Migration guide#
0.30.0 Migration guide#
Version 0.30.0 of starknet.py comes with support for RPC 0.10.2.
0.30.0 Targeted versions#
Starknet - 0.14.2
RPC - 0.10.2
0.30.0 New features#
New
response_flagsparameter added toget_block_with_txs(),get_block_with_receipts()andget_transaction(). Currently supported flag:INCLUDE_PROOF_FACTS.get_storage_at()accepts a newresponse_flagsparameter of typeStorageResponseFlag. WhenINCLUDE_LAST_UPDATE_BLOCKis set, the return type changes frominttoStorageResult(which includesvalueandlast_update_block).trace_block_transactions()accepts a newtrace_flagsparameter of typeTraceFlag. WhenRETURN_INITIAL_READSis set, the return type isBlockTransactionTracesWithInitialReadsinstead ofList[BlockTransactionTrace].get_state_update()accepts a newcontract_addressesparameter. When provided, only state diffs related to those addresses are returned; class declarations are unaffected by this filter.The
addressparameter ofget_events()now accepts either a singleHashor aList[Hash].SimulationFlaghas a new valueRETURN_INITIAL_READS. When included insimulation_flags,simulate_transactions()returnsSimulatedTransactionsWithInitialReadsinstead of a plain list.Invoke V3 transactions now support optional
proof_factsandprooffields. These can be passed through:
0.30.0 New types#
TransactionResponseFlag- flags controlling extra fields in transaction responses.StorageResponseFlag- flags controlling extra fields in storage responses.TraceFlag- flags controlling extra fields in block traces.StorageResult- returned byget_storage_at()whenINCLUDE_LAST_UPDATE_BLOCKis set; containsvalueandlast_update_block.InitialReads- set of state values read from the underlying state reader during execution, containing optionalstorage,nonces,class_hashesanddeclared_contractslists.BlockTransactionTracesWithInitialReads- block traces response that includesInitialReads.SimulatedTransactionsWithInitialReads- simulation response that includesInitialReads.
0.30.0 Bugfixes#
KeyPair.generate()uses now a correct value for Stark curve’s order
0.30.0-rc.0 Migration guide#
Version 0.30.0-rc.0 of starknet.py comes with support for RPC 0.10.2.
0.30.0-rc.0 Targeted versions#
Starknet - 0.14.2
RPC - 0.10.2
0.30.0-rc.0 New features#
New
response_flagsparameter added toget_block_with_txs(),get_block_with_receipts()andget_transaction(). Currently supported flag:INCLUDE_PROOF_FACTS.get_storage_at()accepts a newresponse_flagsparameter of typeStorageResponseFlag. WhenINCLUDE_LAST_UPDATE_BLOCKis set, the return type changes frominttoStorageResult(which includesvalueandlast_update_block).trace_block_transactions()accepts a newtrace_flagsparameter of typeTraceFlag. WhenRETURN_INITIAL_READSis set, the return type isBlockTransactionTracesWithInitialReadsinstead ofList[BlockTransactionTrace].get_state_update()accepts a newcontract_addressesparameter. When provided, only state diffs related to those addresses are returned; class declarations are unaffected by this filter.The
addressparameter ofget_events()now accepts either a singleHashor aList[Hash].SimulationFlaghas a new valueRETURN_INITIAL_READS. When included insimulation_flags,simulate_transactions()returnsSimulatedTransactionsWithInitialReadsinstead of a plain list.Invoke V3 transactions now support optional
proof_factsandprooffields. These can be passed through:
0.30.0-rc.0 New types#
TransactionResponseFlag- flags controlling extra fields in transaction responses.StorageResponseFlag- flags controlling extra fields in storage responses.TraceFlag- flags controlling extra fields in block traces.StorageResult- returned byget_storage_at()whenINCLUDE_LAST_UPDATE_BLOCKis set; containsvalueandlast_update_block.InitialReads- set of state values read from the underlying state reader during execution, containing optionalstorage,nonces,class_hashesanddeclared_contractslists.BlockTransactionTracesWithInitialReads- block traces response that includesInitialReads.SimulatedTransactionsWithInitialReads- simulation response that includesInitialReads.
0.30.0-rc.0 Bugfixes#
KeyPair.generate()uses now a correct value for Stark curve’s order
0.29.0 Migration guide#
Version 0.29.0 of starknet.py comes with full support for RPC 0.10.0.
It also changes the supported Python version. The lowest supported version Python is now 3.10.
0.29.0 Targeted versions#
BlockHeader: Added new fields:event_commitment,transaction_commitment,receipt_commitment,state_diff_commitment,event_count,transaction_count,state_diff_length.StateDiffhas a new optional fieldmigrated_compiled_classes.storage_keysfield inContractsStorageKeysis now of typestr.old_rootfield inPreConfirmedBlockStateUpdateis now optional.Hash function for contract declaration is now automatically selected based on Starknet version: Blake2s for Starknet >= 0.14.1, Poseidon for older versions.
EmittedEventhas new fields:transaction_indexandevent_index.
0.29.0 Bugfixes#
Fixed parsing ABI that contains signed integers (e.g.
i128).
0.29.0 Dependency changes#
When installing extra dependencies needed for
LedgerSigner, Linux users may have to install additional packages:
sudo apt install python3-dev libusb-1.0-0-dev libudev-dev
These packages are needed for HIDAPI compilation. Read official ledgerctl installation guide for more details.
0.29.0-rc.2 Migration guide#
Version 0.29.0-rc.2 changes the supported Python version. The lowest supported version Python is now 3.10.
0.29.0-rc.2 Dependency changes#
When installing extra dependencies needed for
LedgerSigner, Linux users may have to install additional packages:
sudo apt install python3-dev libusb-1.0-0-dev libudev-dev
These packages are needed for HIDAPI compilation. Read official ledgerctl installation guide for more details.
0.29.0-rc.2 Breaking changes#
compute_class_hash(): default value ofhash_methodparam is nowHashMethod.BLAKE2S.
0.29.0-rc.1 Migration guide#
0.29.0-rc.1 Bugfixes#
Fixed parsing ABI that contains signed integers (e.g.
i128).Fixed logic for choosing hash method used in CASM class hash computation.
0.29.0-rc.0 Migration guide#
Version 0.29.0-rc.0 of starknet.py comes with support for RPC 0.10.0-rc.1.
StateDiffhas a new fieldmigrated_compiled_classes.storage_keysfield inContractsStorageKeysis now of typestr.old_rootfield inPreConfirmedBlockStateUpdateis now optional.Hash function for contract declaration is now automatically selected based on node’s RPC version: Blake2s for RPC >= 0.10.0-rc.0, Poseidon for older versions.
EmittedEventhas new fields:transaction_indexandevent_index.
0.28.1 Migration guide#
This version adds support for Blake hash used in CASM class hash computation.
0.28.1 Targeted versions#
0.28.1 Breaking changes#
BytecodeSegmentStructure.hash()has new paramhash_method.BytecodeLeaf.hash()has new paramhash_method.BytecodeSegmentedNode.hash()has new paramhash_method.
0.28.0 Migration guide#
Version 0.28.0 of starknet.py comes with full support for RPC 0.9.0.
0.28.0 Targeted versions#
starknet_py.net.client_models Changes#
Renamed
PendingBlockHeadertoPreConfirmedBlockHeader, changed fieldparent_hashtoblock_number.Renamed
PendingStarknetBlocktoPreConfirmedStarknetBlockRenamed
PendingStarknetBlockWithTxHashestoPreConfirmedStarknetBlockWithTxHashesRenamed
PendingStarknetBlockWithReceiptstoPreConfirmedStarknetBlockWithReceiptsRenamed
PendingBlockStateUpdatetoPreConfirmedBlockStateUpdateEnum
BlockStatusvariantPENDINGremoved, addedPRE_CONFIRMEDEnum
TransactionFinalityStatus, added variantPRE_CONFIRMEDEnum
TransactionStatusvariantREJECTEDremoved, addedCANDIDATE,PRE_CONFIRMEDMessageStatus:finality_statusfield is now of typeTransactionFinalityStatus.Removed
MessageFinalityStatus.BlockStatus: removedREJECTEDvariant.Added
l1_acceptedvariant forBlockTag.Removed fields
block_numberandblock_hashfromTransactionReceiptAdded a dedicated class
TransactionReceiptWithBlockInfo, a subclass ofTransactionReceipt, that has non-optional fieldblock_numberand optional fieldblock_hash.
starknet_py.net.client Changes#
Client.get_storage_proof(): replaced paramblock_idwithblock_hashandblock_number.Client.wait_for_tx()will now wait until transactionfinality_statusis eitherACCEPTED_ON_L2orACCEPTED_ON_L1.Client.wait_for_tx()will no longer raiseTransactionRejectedError, see the method docs for details.Client.get_messages_status(): changedtransaction_hashtype fromstrtoHash.Changed return type of
Client.get_transaction_receipt()toTransactionReceiptWithBlockInfo.Changed return type of
Client.wait_for_tx()toTransactionReceiptWithBlockInfo.
starknet_py.net.websockets.websocket_client Changes#
Removed
subscribe_pending_transactionsmethod and respective notification.Added
WebsocketClient.subscribe_new_transactions()andWebsocketClient.subscribe_new_transaction_receipts()and respective notifications.Added field
finality_statustoWebsocketClient.subscribe_events(), changedNewEventsNotificationthat is used in the handler inner type to contain finalty status.
starknet_py.net.account.account Changes#
When no
token_addressis specified in theAccount.get_balance()method, the default token address is now the STRK fee contract instead of ETH.Rename
FEE_CONTRACT_ADDRESStoETH_FEE_CONTRACT_ADDRESS.
starknet_py.contract Changes#
Added missing
tipandauto_estimate_tiptoContractFunction.invoke_v3().
Transaction Tip Support#
Ability to pass tip for the transaction has been added to following methods.
If tip is not provided, a default value of 0 will be used
Additionally, dataclasses representing transactions now require passing a tip. No default value is used for tip and it is a required parameter.
InvokeV3, tip is now requiredDeclareV3, tip is now requiredDeployAccountV3, tip is now required
Transaction Tip Estimation#
Added
estimate_tip()for automatic transaction tip estimation.Added
auto_estimate_tipparam toAccountandContractmethods that accept atipargument. If set toTrue, median of tips from thepre_confirmedblock will be used to estimate select at tip.
Deployment with UDC#
Default deployer address in
Deployeris now the new UDC (0x02ceed65a4bd731034c01113685c831b01c15d7d432f71afb1cf1634b53a2125).
Other Changes#
unitparam inDevnetClient.mint()now defaults toPriceUnit.FRI.
EthSignerimplementation has been added.
0.28.0 Bugfixes#
Contracts which include fixed sized array type are now correctly serialized (e.g. when using
Contract.deploy_contract_v3())
0.28.0-rc.4 Migration guide#
Version 0.28.0-rc.4 of starknet.py comes with support for RPC 0.9.0 (without the support for changes in the Websockets methods).
Removed fields
block_numberandblock_hashfromTransactionReceiptAdded a dedicated class
TransactionReceiptWithBlockInfo, a subclass ofTransactionReceipt, that has non-optional fieldblock_numberand optional fieldblock_hash.
Changed return type of
Client.get_transaction_receipt()toTransactionReceiptWithBlockInfo.Changed return type of
Client.wait_for_tx()toTransactionReceiptWithBlockInfo.
0.28.0-rc.3 Migration guide#
When no
token_addressis specified in theAccount.get_balance()method, the default token address now defaults to the STRK fee contract instead of ETH.Rename
FEE_CONTRACT_ADDRESStoETH_FEE_CONTRACT_ADDRESS.
unitparam inDevnetClient.mint()now defaults toPriceUnit.FRI.
EthSignerimplementation has been added.
0.28.0-rc.2 Migration guide#
Version 0.28.0-rc.2 of starknet.py comes with support for RPC 0.9.0-rc.2!
MessageStatus:finality_statusfield is now of typeTransactionFinalityStatus.Removed
MessageFinalityStatus.BlockStatus: removedREJECTEDvariant.Added
l1_acceptedvariant forBlockTag.
Tip Estimations#
estimate_tip()will now uselatestblock instead ofpre_confirmedif no block is provided
0.28.0-rc.1 Migration guide#
Version 0.28.0-rc.1 of starknet.py comes with support for automatic transaction tip estimation.
Tip Estimation#
Added
estimate_tip()for automatic transaction tip estimation.Added
auto_estimate_tipparam toAccountandContractmethods that accept atipargument. If set toTrue, median of tips from thepre_confirmedblock will be used to estimate select at tip.
Deployment via UDC#
Default deployer address in
Deployeris now the new UDC (0x02ceed65a4bd731034c01113685c831b01c15d7d432f71afb1cf1634b53a2125).
0.28.0-rc.1 Bugfixes#
Contracts which include fixed sized array type are now correctly serialized (e.g. when using
Contract.deploy_contract_v3())
0.28.0-rc.0 Migration guide#
Version 0.28.0-rc.0 of starknet.py comes with support for RPC 0.9.0-rc.1!
starknet_py.net.client_models#
Renamed
PendingBlockHeadertoPreConfirmedBlockHeader, changed fieldparent_hashtoblock_number.Renamed
PendingStarknetBlocktoPreConfirmedStarknetBlockRenamed
PendingStarknetBlockWithTxHashestoPreConfirmedStarknetBlockWithTxHashesRenamed
PendingStarknetBlockWithReceiptstoPreConfirmedStarknetBlockWithReceiptsRenamed
PendingBlockStateUpdatetoPreConfirmedBlockStateUpdateEnum
BlockStatusvariantPENDINGremoved, addedPRE_CONFIRMEDEnum
TransactionFinalityStatus, added variantPRE_CONFIRMEDEnum
TransactionStatusvariantREJECTEDremoved, addedCANDIDATE,PRE_CONFIRMED
starknet_py.net.client#
Client.get_storage_proof(): replaced paramblock_idwithblock_hashandblock_number.Client.wait_for_tx()will now wait until transactionfinality_statusis eitherACCEPTED_ON_L2orACCEPTED_ON_L1.Client.wait_for_tx()will no longer raiseTransactionRejectedError, see the method docs for details.Client.get_messages_status(): changedtransaction_hashtype fromstrtoHash.
Tip Support#
Ability to pass tip for the transaction has been added to following methods.
If tip is not provided, a default value of 0 will be used
Additionally, dataclasses representing transactions now require passing a tip. No default value is used for tip and it is a required parameter.
InvokeV3, tip is now requiredDeclareV3, tip is now requiredDeployAccountV3, tip is now required
0.27.0 Migration guide#
Support for clear signing with
LedgerSignerhas been added. It’s now the default signing mode (seeLedgerSigningMode).derivation_path_strparam has been removed fromLedgerSignerconstructor, whileaccount_id,application_nameandsigning_modeparams have been added.
0.27.0 Bugfixes#
ABI parser supports now fixed size arrays.
l1_addressinL2ToL1Messagenow accepts felts when deserializing.
0.26.2 Migration guide#
If an incompatible RPC version is detected between the node and
FullNodeClient, a warning will be emitted.
0.26.1 Migration guide#
Restored
amount_multiplierandunit_price_multiplierparams inEstimatedFee.to_resource_bounds()Using Braavos accounts is temporarily disabled because they don’t work with starknet 0.13.5. Please read the official post for more details.
0.26.1 Bugfixes#
In
FunctionInvocation,execution_resourcesfield is now of typeInnerCallExecutionResources.
0.26.0 Migration guide#
Version 0.26.0 of starknet.py comes with support for RPC 0.8.1!
0.26.0 Targeted versions#
New methods have been added:
get_storage_proof(),get_messages_status()andget_compiled_casm().
failure_reasonfield has been added toTransactionStatusResponse.execution_resourcesandis_revertedfields have been added toFunctionInvocation.
Added
WebsocketClientwhich allows to interact with websockets API.
0.26.0 Breaking changes#
l1_resource_boundsparameter (in transaction methods) has been renamed toresource_bounds, its type has also changed fromResourceBoundstoResourceBoundsMapping.
ComputationResourcesandDataResourceshave been removed.ExecutionResources,EstimatedFeehave been modified according to new RPC specification.Submitting transactions other than v3 is not possible anymore.
0.26.0 Bugfixes#
Fixed typo in
TestLessThanOrEqualAddressclass name and schema data key.
Fixed an issue in
Contract.deploy_contract_v3()where omitting theabiparam caused the node to return an error indicating that the contract was not found.
0.26.0-rc.1 Migration guide#
The latest release candidate compatible with Starknet’s JSON-RPC v0.8.0.
0.26.0-rc.1 Bugfixes#
Fixed typo in
TestLessThanOrEqualAddressclass name and schema data key.
Fixed an issue in
Contract.deploy_contract_v3()where omitting theabiparam caused the node to return an error indicating that the contract was not found.
0.26.0-rc.0 Migration guide#
The latest release candidate compatible with Starknet’s JSON-RPC v0.8.0.
0.26.0-rc.0 Targeted versions#
l1_resource_boundsparameter (in transaction methods) has been renamed toresource_bounds, its type has also changed fromResourceBoundstoResourceBoundsMapping.
New methods have been added:
get_storage_proof(),get_messages_status()andget_compiled_casm().
ComputationResourcesandDataResourceshave been removed.ExecutionResources,EstimatedFeehave been modified according to new RPC specification.failure_reasonfield has been added toTransactionStatusResponse.execution_resourcesandis_revertedfields have been added toFunctionInvocation.Submitting transactions other than v3 is not possible anymore.
0.25.0 Migration guide#
This version of starknet.py requires Python 3.9 as a minimum version.
Added
NonZeroTypein order to fix parsing ABI which contains Cairo`s core::zeroable::NonZero.Added SNIP-9 support to
Account. Now it’s possible to create aCallfor outside execution usingsign_outside_execution_call().All methods and classes which use transactions other than v3 are now deprecated.
0.25.0 Minor changes#
Added
keysfield toEventTypewhich contains the list of event fields marked with#[key]in Cairo code.
0.24.3 Migration guide#
0.24.3 Minor changes#
Updated crypto-cpp-py to version
1.4.5.
Ledger support (see
LedgerSigner) is now optional. To use it, install the package withpoetry install -E ledger.
0.24.2 Migration guide#
0.24.2 Minor changes#
Added
KeyPair.generate()method which allows to generate key pair based on cryptographically strong pseudo-random number.
abiparameter is now optional inContract.deploy_contract_v3().Added quickfix for
u96parsing for both pre and post2.8.0Cairo versions.
0.24.1 Migration guide#
This version contains a quick fix to parsing ABI for Cairo v2 contracts. Due to new release of compiler, u96 is now compiled to BoundedInt in ABI.
0.24.1 Minor changes#
Fixed parsing ABI that contains
u96data type.Fixed
l1_addressdeserialization inL2toL1MessageSchema.
0.24.0 Migration guide#
DevnetClienthas been implemented to interact with additional features of the starknet-devnet-rs
LedgerSignerhas been implemented to enable signing with Ledger hardware wallet
0.24.0 Targeted versions#
0.24.0 Breaking changes#
CompiledContractandContractClasshave been renamed toDeprecatedCompiledContractandDeprecatedContractClass.ContractClassSchemahave been renamed toDeprecatedContractClassSchema
0.23.0 Migration guide#
Version 0.23.0 of starknet.py comes with support for SNIP-12!
0.23.0 Targeted versions#
0.23.0 Breaking changes#
StarkNetDomainhas been renamed toDomainParameteris now abstract -StandardParameter,EnumParameterandMerkleTreeParametershould be used
0.23.0 Minor changes#
Account.sign_message()now accepts parametertyped_dataas bothTypedDataandTypedDataDictAccount.verify_message()now accepts parametertyped_dataas bothTypedDataandTypedDataDictfrom_keystore()has been added
0.22.0 Migration guide#
0.22.0 Targeted versions#
0.22.0 Breaking changes#
Support for Goerli has been removed
StarknetChainId.SEPOLIA_TESTNEThas been renamed toStarknetChainId.SEPOLIA
Parameter
chainhas been removed from the methodsAccount.deploy_account_v1()andAccount.deploy_account_v3()Parameter
chain_idhas been removed from the methodget_balance()L1HandlerTransactionTracefieldexecution_resourcesis now required
0.21.0 Migration guide#
Version 0.21.0 of starknet.py comes with support for RPC 0.7.0!
0.21.0 Targeted versions#
0.21.0 Breaking changes#
PendingStarknetBlockandPendingStarknetBlockWithTxHashesfieldparent_block_hashhas been renamed toparent_hashStarknetBlockCommonhas been renamed toBlockHeaderStarknetBlockandStarknetBlockWithTxHashesfieldsparent_block_hashandroothave been renamed toparent_hashandnew_rootrespectivelyFunctionInvocationfieldexecution_resourceshas been renamed tocomputation_resources
0.21.0 Minor changes#
EventsChunkfieldeventsis now a list ofEmittedEventinstead ofEventExecutionResourceshas a new required fielddata_availabilityInvokeTransactionTrace,DeclareTransactionTraceandDeployAccountTransactionTracehave a new required fieldexecution_resourcesEstimatedFeehas new required fieldsdata_gas_consumedanddata_gas_priceStarknetBlock,PendingStarknetBlock,StarknetBlockWithTxHashes,PendingStarknetBlockWithTxHasheshave new required fieldsl1_data_gas_priceandl1_da_modeSierraContractClasshas an additional properyparsed_abi
0.20.0 Migration guide#
Version 0.20.0 of starknet.py comes with support for Python 3.12!
0.20.0 Targeted versions#
0.20.0 Breaking changes#
0.19.0 Migration guide#
Version 0.19.0 of starknet.py comes with support for RPC 0.6.0!
New classes added to mirror the recent changes in the RPC v0.6.0 specification include:
ResourceBoundsMapping, ResourceBounds, PriceUnit, FeePayment, DAMode.
Changes in the Account:
execute()has been renamed toexecute_v1()execute_v3()has been addeddeploy_account()has been renamed todeploy_account_v1()deploy_account_v3()has been addedsign_declare_v3(),sign_deploy_account_v3()andsign_invoke_v3()have been addedsign_declare_transaction(),sign_declare_v2_transaction(),sign_deploy_account_transaction()andsign_invoke_transaction()have been renamed tosign_declare_v1(),sign_declare_v2(),sign_deploy_account_v1()andsign_invoke_v1()respectively
All new functions with v3 in their name operate similarly to their v1 and v2 counterparts.
Unlike their v1 counterparts however, v3 transaction fees are paid in Fri (10^-18 STRK). Therefore, max_fee parameter, which is typically set in Wei, is not applicable for v3 functions. Instead, l1_resource_bounds parameter is utilized to limit the Fri amount used.
The same applies to the new v3 methods in the Contract class.
Changes in the FullNodeClient:
estimate_fee()has a new parameterskip_validatedeclare()acceptstransactionargument of the typeDeclareV3send_transaction()acceptstransactionargument of the typeInvokeV3deploy_account()acceptstransactionargument of the typeDeployAccountV3
Changes in the Contract:
Contract.declare()has been replaced byContract.declare_v1(),Contract.declare_v2()andContract.declare_v3()Contract.deploy_contract()has been replaced byContract.deploy_contract_v1()andContract.deploy_contract_v3(). Optional parametersuniqueandsalthave been added to both methodsContractFunction.prepare()has been replaced byContractFunction.prepare_invoke_v1(),ContractFunction.prepare_invoke_v3()andContractFunction.prepare_call()ContractFunction.invoke()has been replaced byContractFunction.invoke_v1()andContractFunction.invoke_v3()PreparedFunctionCall()has now only methodsPreparedFunctionCall.call()andPreparedFunctionCall.call_raw()PreparedFunctionInvokeV1()andPreparedFunctionInvokeV3()with methodsinvokeandestimate_feehave been addedDeclareResult.deploy()has been replaced byDeclareResult.deploy_v1()andDeclareResult.deploy_v3()
0.19.0 Targeted versions#
0.19.0 Breaking changes#
Other breaking changes not mentioned above.
GatewayClientall related classes and fields have been removed.Client
netproperty has been removed.Declare,DeployAccountandInvokehave been renamed toDeclareV1,DeployAccountV1andInvokeV1respectively.TransactionReceiptfieldexecution_resourceshas been changed fromdicttoExecutionResources.TransactionReceiptfieldsstatusandrejection_reasonhave been removed.TransactionStatus,TransactionExecutionStatusandTransactionFinalityStatushave been changed to have the same structure as in RPC specification.EstimatedFeehas a new required fieldunit.EstimatedFeefieldgas_usagehas been renamed togas_consumed.FunctionInvocationhas a new required fieldexecution_resources.ResourcePricefieldprice_in_strkhas been renamed toprice_in_friand has now become required.ResourceLimitsclass has been renamed toResourceBounds.BaseAccountandAccountpropertysupported_transaction_versionhas been removed.wait_for_acceptparameter inClient.wait_for_tx()andSentTransaction.wait_for_acceptance()has been removed.InvokeTransactionhas been replaced byInvokeTransactionV0andInvokeTransactionV1.DeclareTransactionhas been replaced byDeclareTransactionV0,DeclareTransactionV1andDeclareTransactionV3.DeployAccountTransactionhas been replaced byDeployAccountTransactionV1.
0.19.0 Minor changes#
L1HandlerTransactionfieldnonceis now required.TransactionReceiptfieldsactual_fee,finality_status,execution_status,execution_resourcesandtypeare now required.
0.18.3 Migration guide#
Version 0.18.3 of starknet.py comes with support for RPC 0.5.1!
0.18.3 Targeted versions#
0.18.3 Breaking changes#
Support for
TESTNET2network has been removed.
FullNodeClient.get_pending_transactions()method has been removed. It is advised to useFullNodeClient.get_block()method withblock_number="pending"argument.
PendingStarknetBlockfieldparent_hashis now namedparent_block_hash.FunctionInvocationfieldseventsandmessageshave been changed fromList[Event]andList[L2toL1Message]toList[OrderedEvent]andList[OrderedMessage]respectively.cairo_versionparameter inAccount.sign_invoke_transaction()andAccount.execute()has been removed.
0.18.3 Minor changes#
StarknetBlock,StarknetBlockWithTxHashes,PendingStarknetBlockandPendingStarknetBlockWithTxHashesnow have two additional fields:starknet_versionandl1_gas_price.PendingStarknetBlockandPendingStarknetBlockWithTxHashesfieldstimestamp,sequencer_addressandparent_block_hashare now required, not optional.TransactionReceiptnow has an additional field -message_hash(forL1_HANDLER_TXN_RECEIPT).Most fields in
TransactionTraceclasses are now optional.InvokeTransactionTrace,DeclareTransactionTrace,DeployAccountTransactionTraceandL1HandlerTransactionTraceclasses now have an additional field -state_diff.
0.18.2 Migration guide#
Version 0.18.2 of starknet.py comes with support of RPC v0.4.0 Trace API!
Additionally, you can now properly use Cairo1 accounts! starknet.py automatically checks if your account is in Cairo1 and
sets the calldata encoding accordingly.
0.18.2 Targeted versions#
0.18.2 Breaking changes#
Client.get_block_traces()has been renamed toClient.trace_block_transactions()in order to match RPC specification.
0.18.2 Deprecations#
cairo_versionparameter inAccount.sign_invoke_transaction()andAccount.execute()has been deprecated.
0.18.2 Bugfixes#
Fixed a bug when using
proxy_config=TrueinContract.from_address()method regardingEntry point EntryPointSelector(...) not found in contract.
0.18.2 Minor changes#
Client.trace_block_transactions()return type has been changed fromBlockTransactionTracestoUnion[BlockTransactionTraces, List[BlockTransactionTrace]].
include_blockparameter inGatewayClient.get_state_update()now works on gateway mainnet.
BaseAccountinterface andAccountnow have an additional async property -cairo_version.
0.18.2 Development-related changes#
In order to be able to run tests, you must set some environmental variables:
INTEGRATION_RPC_URLTESTNET_RPC_URLINTEGRATION_ACCOUNT_PRIVATE_KEYINTEGRATION_ACCOUNT_ADDRESSTESTNET_ACCOUNT_PRIVATE_KEYTESTNET_ACCOUNT_ADDRESS
The best way to do that is to create test-variables.env file in starknet_py/tests/e2e/ directory, so they can be loaded by the python-dotenv library.
You can find an example file test-variables.env.template in the same directory with the format of how it should look like.
0.18.1 Migration guide#
This version contains a quick fix to GatewayClient.get_state_update() method (mainnet wasn’t updated to 0.12.2 then).
Additionally, accounts in Cairo1 are now supported! You can pass additional argument cairo_version to Account.sign_invoke_transaction() method.
0.18.1 Minor changes#
Parameter
include_blockinGatewayClient.get_state_update()doesn’t work on mainnet gateway (an error is thrown).
Account.sign_invoke_transaction()now accepts additional parametercairo_version, which allows specifying which type of calldata encoding should be used.
0.18.0 Migration guide#
This version of starknet.py brings support Starknet 0.12.1, 0.12.2 and RPC v0.4.0!
TransactionReceiptdataclass properties have been changed (more details in RPC specification linked above).
0.18.0 Deprecations#
statusfield inTransactionReceiptreturned byFullNodeClient.get_transaction_receipt()has been deprecated.
0.18.0 Minor changes#
FullNodeClient.get_transaction_receipt()now returns two additional fields:acceptance_statusandfinality_status.
Added two fields to
TransactionReceipt-revert_error(Gateway) andrevert_reason(FullNode).hashproperty inTransactionis now optional.Added missing field
contract_address_salttoDeployTransaction.
Lowered
check_intervalparameter default value inClient.wait_for_tx()from 5 seconds to 2.
Added fields to dataclasses that previously were missing (e.g.
contract_address_saltinDeployTransaction).
decode_shortstring()now is returned without\x00in front of the decoded string.
Added two new methods to
GatewayClient-GatewayClient.get_public_key()andGatewayClient.get_signature().GatewayClient.get_state_update()now accepts additional parameter - include_block.
KeyPairandKeyPair.from_private_key()now can accept keys in string representation.
0.18.0 Bugfixes#
Fixed invalid type in
BlockStateUpdatefromStateDifftoUnion[StateDiff, GatewayStateDiff]Fixed
Contract not founderror inAbiResolver
0.17.0 Migration guide#
With Starknet 0.12.0, the PENDING transaction status has been removed.
Contract now supports contracts written in Cairo1 in both old and new syntax.
To create an instance of such contract, a keyword parameter cairo_version=1 in the Contract constructor is required.
Note
Please note that while using the interface with Cairo1 contracts, it is possible for problems to occur due to some of the types being not yet implemented in the parser.
In such case, please open an issue at our GitHub or contract us on Starknet Discord server in #🐍 | starknet-py channel.
GatewayClientand Gateway / Feeder Gateway API will become deprecated in the future.As a result,
GatewayClientwon’t work and will eventually be removed. Consider migrating to FullNodeClient.
FullNodeClient RPC specification has been updated from v0.3.0-rc1 to v0.3.0.
Also, four methods were added to its interface:
FullNodeClient.get_block_number()FullNodeClient.get_block_hash_and_number()FullNodeClient.get_chain_id()FullNodeClient.get_syncing_status()
0.17.0 Breaking changes#
Deprecated function
compute_invoke_hashinstarknet_py.net.models.transactionhas been removed in favor ofstarknet_py.hash.transaction.compute_invoke_transaction_hash().
Removed deprecated
Deployer.create_deployment_callandDeployer.create_deployment_call_rawin favor ofDeployer.create_contract_deployment()andDeployer.create_contract_deployment_raw().Removed
PENDINGtransaction status.
0.17.0 Minor changes#
DeclareResult.deploy(),PreparedFunctionCall.invoke(),PreparedFunctionCall.estimate_fee(),ContractFunction.invoke(),Contract.declare()andContract.deploy_contract()can now accept customnonceparameter.
Account.sign_invoke_transaction(),Account.sign_declare_transaction(),Account.sign_declare_v2(),Account.sign_deploy_account_transaction()andAccount.execute()can now accept customnonceparameter.Account.get_nonce()can now be parametrized withblock_numberorblock_hash.Account.get_balance()can now be parametrized withblock_numberorblock_hash.
RPC related changes:
L2toL1Messagedataclass now has an additional field:from_address.TransactionReceiptdataclass now has two additional, optional fields:typeandcontract_address.
FullNodeClient.get_events()keysandaddressparameters type are now optional.FullNodeClient.get_events()keysparameter can now also accept integers as felts.
StarknetChainIdchanged fromEnumtoIntEnum.
Client.wait_for_tx()has a new parameterretriesdescribing the amount of retries before a time out when querying for a transaction.
0.17.0 Deprecations#
wait_for_accept parameter in
Client.wait_for_tx()andSentTransaction.wait_for_acceptance()has been deprecated.
0.17.0 Bugfixes#
Fixed a bug when
compute_class_hash()mutated thecontract_classargument passed to a function.
0.16.1 Migration guide#
Version 0.16.1 of starknet.py brings the long-awaited Windows support!
Additionally, this release brings support for RPC v0.3.0rc1!
0.16.1 Breaking changes#
FullNodeClient.get_events()keysparameter type is nowList[List[str]]instead ofList[str].FullNodeClient.get_state_update()return type has been changed fromStateUpdatetoUnion[BlockStateUpdate, PendingBlockStateUpdate]
StateDiffdataclass properties have been changed (more details in RPC specification linked above).
0.16.1 Minor changes#
Client.estimate_fee()can take a single transaction or a list of transactions to estimate.
0.16.0 Migration guide#
Version 0.16.0 of starknet.py comes with support for Python 3.8, 3.9, 3.10 and 3.11!
The cairo-lang package has been removed as a dependency.
Also, dependencies are now optimized to include only necessary packages.
0.16.0 Bugfixes#
Fixed a bug where
Deployer.create_contract_deployment_raw()would use a random salt, whensalt = 0was passed.
0.16.0 Breaking changes#
BaseAccount.verify_message()is no longerasync.
Some functions’ implementation has been changed to use
crypto-cpp-pypackage:Deprecated
utils.data_transformermodule has been removed. Use Serializers module instead.Deprecated
is_felt_pointerandis_uint256functions have been removed. Use TypeParser class instead.Deprecated
Compilermodule has been removed. Use an external compilation tool (e.g. Starknet CLI) instead.Deprecated
compilation_sourceandsearch_pathsarguments has been removed from several methods. Usecompiled_contractparameter instead.
Deprecated
ContractData.identifier_managerhas been removed. UseContractData.parsed_abi()instead.
Removed deprecated
typed_dataparameter as dict inBaseSigner.sign_message(). Use TypedData dataclass fromstarknet_py.utils.typed_data.starknet_py.utils.cryptomodule has been removed.Changed name of
starknet_py.transaction_exceptionstostarknet_py.transaction_errorsto match other files.
Potentially breaking changes
Internal code of starknet_py.abi.AbiParser.parse() has changed.
It should not affect users but keep in mind that the Contract can have difficulties resolving ABI.
If so, please report.
0.15.0 Migration guide#
0.15.0 adds initial support for Starknet 0.11.0 and related changes. It also makes the first step to remove the cairo-lang package as starknet.py dependency!
Some classes/functions from cairo-lang package are rewritten and are a part of starknet.py:
get_selector_from_nameandget_storage_var_addressfunctionsDeclaredContractis now ContractClasscompute_class_hashfunction
Python version#
Unfortunately, as a result of adaptation to support cairo-lang newest package, support for Python 3.8.X has been dropped. The only supported Python version is 3.9.
0.15.0 Deprecations#
compute_invoke_hashis deprecated in favour ofcompute_transaction_hashstarknet_py.common.create_contract_classis deprecated in favour ofstarknet_py.common.create_compiled_contractClient
net()property.create_deployment_call()is deprecated in favour ofcreate_contract_deployment()
0.15.0 Breaking changes#
InvokeFunctionis replaced by theInvokedataclass (behaviour is the same, just the name is changed).Removed from client_models.py:
Invoke,
InvokeFunction,
StarknetTransaction,
AccountTransaction,
ContractClass,
Declare,
DeployAccount.
Transaction’s
tx_typefield is renamed totype.The
types.pyis removed (outdated file containing only imports):import
decode_shortstringandencode_shortstringfromstarknet_py.cairo.felt,import
InvokeandTransactionfromstarknet_py.net.models.transaction,import
parse_addressfromstarknet_py.net.models.address,import
net_address_from_netfromstarknet_py.net.networks.
- Changes in the location of some of the functions:
Function
Old Path
New Path
compute_address
starknet_py.net.models.address
starknet_py.hash.address
compute_transaction_hash, compute_deploy_account_transaction_hash, compute_declare_transaction_hash
starknet_py.utils.crypto.transaction_hash
starknet_py.hash.transaction
compute_hash_on_elements
starknet_py.utils.crypto.facade
starknet_py.hash.utils
message_signature
starknet_py.utils.crypto.facade
starknet_py.hash.utils
pedersen_hash
starknet_py.utils.crypto.facade
starknet_py.hash.utils
compute_class_hash
starkware.starknet.core.os.class_hash
starknet_py.hash.class_hash
get_selector_from_name
starkware.starknet.public.abi
starknet_py.hash.selector
get_storage_var_address
starkware.starknet.public.abi
starknet_py.hash.storage
Removed deprecated
AccountClientRemoved support for making transactions with version 0.
Removed
Deploytransaction.Removed deprecated
make_declare_tx.
Removed
clientargument from Contract__init__()andfrom_address(). Useproviderargument instead.Removed
net.l1L1<>L2 messaging module.Added chain_id argument to BaseAccount interface and implementation
get_balance()method.Changed Client
get_class_by_hash()return type toUnion[ContractClass, SierraContractClass].Replaced
contract_addresswithsender_addressin:starknet_py.net.client_models.InvokeTransactionstarknet_py.net.models.transaction.Invokecompute_invoke_hash
Replaced
BlockStateUpdate.state_diff.declared_contract_hashesis now a list ofDeclaredContractHashrepresenting new Cairo classes. Old declared contract classes are still available atBlockStateUpdate.state_diff.deprecated_declared_contract_hashes.Removed
versionproperty fromPreparedFunctionCallclass.Removed deprecated
max_stepsinProxyConfig.Removed
supported_transaction_versionproperty fromBaseAccountabstract class.
Transaction dataclasses#
All transaction’s dataclasses can be imported from the starknet_py.net.models.transaction module.
The main differences between them and those from the Cairo-lang:
tx_typefield is renamed totype,fields are not validated while creating.
All of them can be used as usual.
ContractClass#
DeclaredContract has been renamed to ContractClass.
There also exists CompiledContract dataclass, which specifies abi attribute to be required.
0.14.0 Migration guide#
This version deprecates several modules and fixes underlying issues with several others.
0.14.0 Breaking changes#
Renamed first parameter of
ContractDeploymentfromudctocall, that is returned fromcreate_deployment_call().
0.14.0 Deprecations#
compiler module. It will be removed in the future. We recommend transitioning to building contracts through Starknet CLI or external tools and using only compiled contracts with starknet.py.
utils.data_transformermodule. It has been replaced with Serializers module.
Serializers module#
New Serializers module has been added in place of old data_transformer. See Serialization guide for more details.
auto_estimate#
The way automatic fee estimation is calculated has changed from
transaction estimated fee * 1.1
to
transaction estimated fee * 1.5
when using auto_estimate parameter in API functions (for example execute(), sign_invoke_transaction() or invoke()).
It was caused by many transactions failing due to low max_fee.
Note
It is now possible to set the value by which the estimated fee is multiplied,
by changing ESTIMATED_FEE_MULTIPLIER in Account.
0.13.0 Migration guide#
This version deprecates the AccountClient, which is a major change to the starknet.py.
It is replaced with new BaseAccount ABC and its
default implementation Account.
Unlike AccountClient, an Account is not a Client anymore. This means that methods like
get_storage_at, call_contract etc. are not available in the Account interface.
However, Account now exposes a .client property, which means using an Account is
just as simple as AccountClient was. For example:
# Inspecting storage
await account_client.get_storage_at(contract_address=address, key=key)
# becomes
await account.client.get_storage_at(contract_address=address, key=key)
# Sending transactions
tx = await account_client.sign_invoke_v3(call, resource_bounds)
await account_client.send_transaction(tx)
# becomes
tx = await account.sign_invoke_v3(call, resource_bounds=resource_bounds)
# Note that resource_bounds is now keyword-only argument
await account.client.send_transaction(tx)
# Using execute method
await account_client.execute_v3(call, resource_bounds=resource_bounds)
# becomes
await account.execute_v3(call, resource_bounds=resource_bounds)
Replacing inheritance with composition simplifies the Account interface and will make
maintaining Account simpler.
Changes in the Account interface#
Removed
hash_messagemethod. UseTypedData.message_hashdirectly instead.Accountdoesn’t expose anetproperty.Accountdoesn’t accept asupported_tx_versionparameter. It currently always uses version 1.Some parameters like
max_feeorauto_estimateare now keyword only arguments. They have to be explicitly named likeaccount.sign_invoke_transaction(Call(...), max_fee=1000). Writingaccount.sign_invoke_transaction(Call(...), 1000)will not work.
0.13.0 Deprecations#
Passing a dict to
BaseSigner.sign_messageas parameter has been deprecated in favor ofTypedDatadataclass.Argument
clientofContract`.__init__` and ``Contract.from_addresshas been deprecated and replaced withprovider.Starknet <> Ethereum Messaging module has been deprecated.
PreparedFunctionCall.argumentshas been deprecated to simplify the upcomingserializationmodule.
0.13.0 Breaking changes#
versionparameter has been removed from the mostContractmethods.Contractwill now use version that theAccountorAccountClientis using.DeclareResultnow only acceptsBaseAccount.invoke_txhas been removed from theClient.call_contractparameters.callshould be used instead.All error messages have been standardized with capitalization at the beginning and a full stop at the end.
0.12.0 Migration guide#
starknet.py 0.12.0 brings support for the Cairo-lang 0.10.3 and the new TESTNET2 chainId.
0.12.0 Breaking Changes#
There should not be any breaking changes if you are using the StarknetChainId imported from the starknet_py.net.models, but if you are importing it from the Cairo-lang package, please switch to the one from starknet.py.
0.11.0 Migration guide#
Cairo-lang 0.10.3 dropped support for the Deploy transaction. To be compatible we had to remove some deprecated features.
0.11.0 Breaking Changes#
Removed APIs:
Contract.deploy. Read more about deployment in the Deploying contracts section.
AccountClient.create_account. Account creation docs are here to help you!
Client.deploy method (from the interface and all implementations)
make_deploy_tx
compute_deploy_hash
the Deploy transaction
Invoke Transaction#
Old InvokeFunction transaction is now aliased as Invoke. We suggest to start using the new Invoke.
0.9.0 Migration guide#
starknet.py 0.9.0 brings support for RPC 0.2.0,
updates Contract.from_address() method to work with the newest proxies and removes some deprecated features.
0.9.0 Breaking Changes#
Removed deprecated Account.sign_transaction. Use new Account.sign_invoke_transaction.
Removed deprecated InvokeFunction as call_contract parameter. Use Call class instead.
StateDiff has declared_contract_hashes instead of declared_contracts field (only name has changed).
Support for RPC 0.1.0 has been dropped in favour of RPC 0.2.0.
Contract.from_address#
Check out the Guide with the new section Resolving proxy contracts to see how to easily use proxies with the starknet.py.
0.8.0 Migration guide#
Cairo-lang 0.10.1 brings support for DEPLOY_ACCOUNT transactions that will completely replace currently used DEPLOY transactions sometime in the future.
You should already modify your applications to use new deployment flow to either support deployments using new flow:
Declare a contract on Starknet using Declare transaction
Pre-fund the address of new account with enough tokens to cover transaction costs
Send a DeployAccount transaction with the pre-funded address
or support deploying through syscall or Universal Deployer Contract.
0.8.0 Breaking Changes#
entry_point_selector has been removed from v1 transactions. InvokeTransaction’s field has been changed to Optional[int]
net.models.address.compute_address signature has been changed and use of keyword arguments is now mandatory
Client.estimate_fee ABC now also accepts DeployAccount transaction as tx parameter. Custom clients should be updated to reflect this change.
0.8.0 Deprecations#
Contract.deploy has been deprecated in favor of new DeployAccount flow
Client.deploy has been deprecated
0.5.0 Migration guide#
cairo-lang 0.10.0 brings a lot of new exciting changes, like:
new cairo syntax,
new transaction version (1),
new
__validate__endpoint in accounts.
starknet.py 0.5.0 has an experimental support for new features and tries to minimize number of breaking changes for
users who want to use the old transaction version (0). Please note that support for this transaction version will be
removed in the future.
Note
There is no need to upgrade starknet.py to the newest version because the old one is still compatible with Starknet.
However, an upgrade is required to use the new features.
0.5.0 Breaking Changes#
New Cairo syntax#
With the update of cairo-lang to version 0.10.0,
the syntax of contracts written in cairo changes significantly.
You can see the new syntax here.
As a result, the old syntax is no longer supported.
Note
This only applies to you if you compile your cairo programs using starknet.py. If you use programs that are already compiled you don’t need to worry.
For the already existent programs to be compatible with the new Starknet version,
they would have to be migrated using cairo-migrate command from CLI. It is a part of cairo-lang package.
To migrate old syntax to the old one in place run:
> cairo-migrate FILES_LIST -i
See cairo-lang release notes for more details about the new syntax.
Python versions#
We drop support for python 3.7.X, following cairo-lang support. You must use python 3.8+ to use starknet.py 0.5.0.
InvokeFunction and Declare#
A new required parameter, nonce, was added to them. Use None for transaction version = 0 and a proper nonce value for
new transaction version = 1.
New Transaction version#
Cairo 0.10.0 brings a transaction version = 1:
Deploy transactions are no longer available,
user accounts need to have __validate__ and __validate_declare__ functions,
transactions have different fields,
contracts have a native nonce field available.
You can still use the old transaction version, but please note it will be removed in the future. Please refer to deprecation warnings to see required changes.
For now both (0 nad 1) transaction versions will be accepted but there will be a DeprecationWarning while using version 0.
AccountClient constructor#
AccountClient’s constructor has a new parameter now. supported_tx_version is used to differentiate between old and new accounts.
It is set to 0 as default so there is no need to set it while using old account.
Note
In the future versions default value of supported_tx_version will be changed to 1. This will happen when transaction version = 0 is removed.
Deprecated Features#
InvokeFunction as call_contract parameter#
InvokeFunction has been deprecated as a call_contract parameter. Users should use Call instead.
Transaction version 0#
Although transactions version 0 are still valid, users should switch to Accounts supporting transaction version 1.
AccountClient’s methods#
The following AccountClient’s methods has been deprecated:
prepare_invoke_function(),sign_invoke_transaction()should be used instead.sign_transaction(),sign_invoke_transaction()should be used instead.
Unsigned declare transaction#
make_declare_tx is deprecated, because in the future versions of Starknet unsigned declare transactions will not be
supported. sign_declare_transaction() should be used to create
and sign declare transaction.
Deploy transaction#
Deploy transactions will not be supported in the future versions of Starknet, so make_deploy_tx is deprecated.
Contracts should be deployed through cairo syscall.
0.4.0 Migration guide#
0.4.0 of starknet.py brings multiple changes including breaking changes to API. To ensure smooth migration to this version please familiarize yourself with this migration guide.
Overlook of the changes#
0.4.0 brings support for the Starknet rpc interface.
This required us to introduce some big changes to the clients. API methods has
remained mostly the same, but their parameters changed. Also, we’ve introduced custom dataclasses
for every endpoint, that are simplified from these from cairo-lang library.
This provides uniform interface for both Starknet gateway (only supported way of interacting with Starknet in previous starknet.py versions), as well as JSON-RPC.
Clients#
Client has been separated into two specialized modules.
Use
GatewayClientto interact with Starknet like you did in previous starknet.py versionsUse FullNodeClient to interact with JSON-RPC
Note
It is no longer possible to create an instance of Client. Doing so will cause
errors in runtime.
API Changes#
Client methods has had some of the parameters removed, so it provided uniform interface
for both gateway and rpc methods. Please refer to GatewayClient and FullNodeClient
to see what has changed.
There is no longer add_transaction method in the Client interface. It was renamed to send_transaction.
Note
Please note that send_transaction only sends a transaction, it doesn’t sign it, even when using AccountClient.
Sending transactions#
Sending transactions is currently only supported in GatewayClient. We’ve also changed the flow
of creating transactions through clients:
Client.deploy and Client.declare no longer accept contract source as their input.
Instead they require a prepared transactions. These can be created using Transactions module
from starknet_py.transactions.declare import make_declare_tx
client = GatewayClient("testnet")
contract_source_code = "..."
declare_tx = make_declare_tx(compilation_source=contract_source_code)
await client.declare(declare_tx)
Interface of Contract remains unchanged and it is still the recommended way of using starknet.py
AccountClient#
AccountClient now implements Client interface: parameters of some of its methods were changed. It also doesn’t have add_transaction method (like the rest of the clients).
Quick summary about the new methods:
prepare_invoke_function - it can be used to create InvokeFunction from one or few calls (without signature)
sign_transaction - takes list of calls and creates signed InvokeFunction from them
send_transaction - implements Client interface (takes Invoke function and sends it without changes)
execute - can take list of calls, sign them and send
Client errors changes#
BadRequest class has been removed and replaced with Client errors module and
starknet_py.net.client_errors.ClientError or more specified errors can now
be used for handling client errors.
See Handling client errors in guide for an example.
Facade.py#
sign_calldata method has been removed entirely. See guide on how how you can now prepare and send transactions to Starknet.
Contract changes#
Transaction’s status is not checked while invoking through Contract interface, because RPC write API doesn’t return “code” parameter. To check if the transaction passed use wait_for_acceptance on InvokeResult.