Showing preview only (7,631K chars total). Download the full file or copy to clipboard to get everything.
Repository: software-mansion/starknet.py
Branch: development
Commit: 2b3ff31fd607
Files: 457
Total size: 7.2 MB
Directory structure:
gitextract__f1r3mgr/
├── .github/
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_report.yaml
│ │ └── feature_request.yaml
│ ├── actions/
│ │ ├── compile-contracts/
│ │ │ └── action.yml
│ │ └── dispatch-compatibility-tests/
│ │ └── action.yml
│ ├── codecov.yml
│ ├── dependabot.yml
│ ├── pull_request_template.md
│ └── workflows/
│ ├── checks.yml
│ ├── compatibility-tests-dispatcher.yml
│ ├── compatibility-tests.yml
│ └── package.yml
├── .gitignore
├── .pylintrc
├── .python-version
├── .readthedocs.yml
├── .run/
│ ├── All tests.run.xml
│ ├── E2E pytest.run.xml
│ └── starkware-devnet.run.xml
├── CONTRIBUTING.md
├── LICENSE.txt
├── README.md
├── circular.py
├── docs/
│ ├── Makefile
│ ├── _ext/
│ │ ├── autoclass_with_examples.py
│ │ ├── codesnippet.py
│ │ └── test_autoclass_with_examples.py
│ ├── _static/
│ │ └── custom.css
│ ├── _templates/
│ │ └── page.html
│ ├── account_creation.rst
│ ├── api/
│ │ ├── abi.rst
│ │ ├── account.rst
│ │ ├── cairo.rst
│ │ ├── client.rst
│ │ ├── client_errors.rst
│ │ ├── client_models.rst
│ │ ├── contract.rst
│ │ ├── contract_utils.rst
│ │ ├── data_types.rst
│ │ ├── devnet_client.rst
│ │ ├── executable_models.rst
│ │ ├── full_node_client.rst
│ │ ├── hash.rst
│ │ ├── models.rst
│ │ ├── proxy_resolvers.rst
│ │ ├── serializers.rst
│ │ ├── signer.rst
│ │ ├── tip.rst
│ │ ├── transaction_errors.rst
│ │ ├── typed_data.rst
│ │ ├── udc_deployer.rst
│ │ └── websocket_client.rst
│ ├── api.rst
│ ├── conf.py
│ ├── development.rst
│ ├── devnet_utils/
│ │ └── mocking_interaction_with_l1.rst
│ ├── devnet_utils.rst
│ ├── guide/
│ │ ├── account_and_client.rst
│ │ ├── deploying_contracts.rst
│ │ ├── generating_key_pair.rst
│ │ ├── resolving_proxy_contracts.rst
│ │ ├── serialization.rst
│ │ ├── signing.rst
│ │ ├── using_existing_contracts.rst
│ │ └── websockets.rst
│ ├── guide.rst
│ ├── index.rst
│ ├── installation.rst
│ ├── make.bat
│ ├── migration_guide.rst
│ └── quickstart.rst
├── pre-commit
├── pre-push
├── pylint_todo_checker.py
├── pyproject.toml
└── starknet_py/
├── __init__.py
├── abi/
│ ├── v0/
│ │ ├── __init__.py
│ │ ├── model.py
│ │ ├── parser.py
│ │ ├── schemas.py
│ │ └── shape.py
│ ├── v1/
│ │ ├── __init__.py
│ │ ├── core_structures.json
│ │ ├── model.py
│ │ ├── parser.py
│ │ ├── parser_transformer.py
│ │ ├── schemas.py
│ │ └── shape.py
│ └── v2/
│ ├── __init__.py
│ ├── model.py
│ ├── parser.py
│ ├── parser_transformer.py
│ ├── schemas.py
│ └── shape.py
├── cairo/
│ ├── __init__.py
│ ├── data_types.py
│ ├── deprecated_parse/
│ │ ├── __init__.py
│ │ ├── cairo_types.py
│ │ ├── parser.py
│ │ └── parser_transformer.py
│ ├── felt.py
│ ├── type_parser.py
│ ├── v1/
│ │ ├── __init__.py
│ │ └── type_parser.py
│ └── v2/
│ ├── __init__.py
│ └── type_parser.py
├── common.py
├── conftest.py
├── constants.py
├── contract.py
├── contract_utils.py
├── devnet_utils/
│ ├── __init__.py
│ ├── devnet_client.py
│ ├── devnet_client_models.py
│ └── devnet_rpc_schema.py
├── hash/
│ ├── __init__.py
│ ├── address.py
│ ├── address_test.py
│ ├── blake2s.py
│ ├── casm_class_hash.py
│ ├── class_hash.py
│ ├── compiled_class_hash_objects.py
│ ├── hash_method.py
│ ├── outside_execution.py
│ ├── selector.py
│ ├── sierra_class_hash.py
│ ├── storage.py
│ ├── transaction.py
│ └── utils.py
├── net/
│ ├── __init__.py
│ ├── account/
│ │ ├── __init__.py
│ │ ├── account.py
│ │ ├── account_deployment_result.py
│ │ └── base_account.py
│ ├── client.py
│ ├── client_errors.py
│ ├── client_models.py
│ ├── client_utils.py
│ ├── executable_models.py
│ ├── full_node_client.py
│ ├── http_client.py
│ ├── models/
│ │ ├── __init__.py
│ │ ├── address.py
│ │ ├── chains.py
│ │ ├── transaction.py
│ │ └── typed_data.py
│ ├── networks.py
│ ├── schemas/
│ │ ├── __init__.py
│ │ ├── broadcasted_txn.py
│ │ ├── common.py
│ │ ├── contracts_storage_keys.py
│ │ ├── rpc/
│ │ │ ├── block.py
│ │ │ ├── contract.py
│ │ │ ├── event.py
│ │ │ ├── executables_api.py
│ │ │ ├── general.py
│ │ │ ├── storage_proof.py
│ │ │ ├── trace_api.py
│ │ │ ├── transactions.py
│ │ │ └── websockets.py
│ │ └── utils.py
│ ├── signer/
│ │ ├── __init__.py
│ │ ├── base_signer.py
│ │ ├── eth_signer.py
│ │ ├── key_pair.py
│ │ ├── ledger_signer.py
│ │ └── stark_curve_signer.py
│ ├── tip/
│ │ └── __init__.py
│ ├── udc_deployer/
│ │ ├── __init__.py
│ │ └── deployer.py
│ └── websockets/
│ ├── __init__.py
│ ├── errors.py
│ ├── models.py
│ └── websocket_client.py
├── proxy/
│ ├── __init__.py
│ ├── contract_abi_resolver.py
│ └── proxy_check.py
├── py.typed
├── serialization/
│ ├── __init__.py
│ ├── _calldata_reader.py
│ ├── _context.py
│ ├── data_serializers/
│ │ ├── __init__.py
│ │ ├── _common.py
│ │ ├── array_serializer.py
│ │ ├── bool_serializer.py
│ │ ├── byte_array_serializer.py
│ │ ├── cairo_data_serializer.py
│ │ ├── enum_serializer.py
│ │ ├── felt_serializer.py
│ │ ├── int_serializer.py
│ │ ├── named_tuple_serializer.py
│ │ ├── non_zero_serializer.py
│ │ ├── option_serializer.py
│ │ ├── output_serializer.py
│ │ ├── payload_serializer.py
│ │ ├── struct_serializer.py
│ │ ├── tuple_serializer.py
│ │ ├── uint256_serializer.py
│ │ ├── uint_serializer.py
│ │ └── unit_serializer.py
│ ├── errors.py
│ ├── factory.py
│ ├── function_serialization_adapter.py
│ └── tuple_dataclass.py
├── tests/
│ ├── __init__.py
│ ├── e2e/
│ │ ├── __init__.py
│ │ ├── account/
│ │ │ ├── __init__.py
│ │ │ ├── account_test.py
│ │ │ └── outside_execution_test.py
│ │ ├── block_test.py
│ │ ├── cairo1v2_test.py
│ │ ├── client/
│ │ │ ├── __init__.py
│ │ │ ├── client_test.py
│ │ │ ├── fixtures/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── prepare_net_for_gateway_test.py
│ │ │ │ ├── prepare_network.py
│ │ │ │ └── transactions.py
│ │ │ ├── full_node_test.py
│ │ │ └── websocket_client_test.py
│ │ ├── conftest.py
│ │ ├── contract_interaction/
│ │ │ ├── __init__.py
│ │ │ ├── declare_test.py
│ │ │ ├── deploy_test.py
│ │ │ ├── interaction_test.py
│ │ │ └── v1_interaction_test.py
│ │ ├── declare/
│ │ │ ├── __init__.py
│ │ │ └── declare_test.py
│ │ ├── deploy/
│ │ │ ├── __init__.py
│ │ │ └── deployer_test.py
│ │ ├── deploy_account/
│ │ │ ├── __init__.py
│ │ │ └── deploy_account_test.py
│ │ ├── devnet_client/
│ │ │ ├── __init__.py
│ │ │ ├── account_impersonate_test.py
│ │ │ ├── fixtures/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── accounts.py
│ │ │ │ ├── clients.py
│ │ │ │ └── contracts.py
│ │ │ ├── general_test.py
│ │ │ └── time_test.py
│ │ ├── docs/
│ │ │ ├── __init__.py
│ │ │ ├── account_creation/
│ │ │ │ ├── __init__.py
│ │ │ │ └── test_deploy_prefunded_account.py
│ │ │ ├── code_examples/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── test_account.py
│ │ │ │ ├── test_contract.py
│ │ │ │ ├── test_contract_function.py
│ │ │ │ ├── test_deployer.py
│ │ │ │ ├── test_devnet_client.py
│ │ │ │ ├── test_full_node_client.py
│ │ │ │ ├── test_prepared_function_call.py
│ │ │ │ ├── test_prepared_function_invoke_v3.py
│ │ │ │ └── test_websocket_client.py
│ │ │ ├── devnet_utils/
│ │ │ │ ├── __init__.py
│ │ │ │ └── test_l1_integration.py
│ │ │ ├── guide/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── test_account_sign_outside_transaction.py
│ │ │ │ ├── test_account_sign_without_execute.py
│ │ │ │ ├── test_cairo1_contract.py
│ │ │ │ ├── test_contract_account_compatibility.py
│ │ │ │ ├── test_contract_client_compatibility.py
│ │ │ │ ├── test_custom_nonce.py
│ │ │ │ ├── test_custom_signer.py
│ │ │ │ ├── test_declaring_contracts.py
│ │ │ │ ├── test_deploying_in_multicall.py
│ │ │ │ ├── test_deploying_with_udc.py
│ │ │ │ ├── test_executing_transactions.py
│ │ │ │ ├── test_full_node_client.py
│ │ │ │ ├── test_handling_client_errors.py
│ │ │ │ ├── test_key_pair.py
│ │ │ │ ├── test_multicall.py
│ │ │ │ ├── test_resolving_proxies.py
│ │ │ │ ├── test_serializing.py
│ │ │ │ ├── test_sign_for_fee_estimate.py
│ │ │ │ ├── test_sign_offchain_message.py
│ │ │ │ ├── test_simple_declare_and_deploy.py
│ │ │ │ ├── test_simple_declare_and_deploy_cairo1.py
│ │ │ │ ├── test_simple_deploy.py
│ │ │ │ ├── test_simple_deploy_cairo1.py
│ │ │ │ └── test_using_existing_contracts.py
│ │ │ ├── migration_guide/
│ │ │ │ ├── __init__.py
│ │ │ │ └── test_account_comparison.py
│ │ │ └── quickstart/
│ │ │ ├── __init__.py
│ │ │ ├── test_creating_account.py
│ │ │ ├── test_synchronous_api.py
│ │ │ ├── test_synchronous_full_node_client.py
│ │ │ ├── test_using_account.py
│ │ │ ├── test_using_contract.py
│ │ │ └── test_using_full_node_client.py
│ │ ├── fixtures/
│ │ │ ├── __init__.py
│ │ │ ├── abi_structures.py
│ │ │ ├── abi_v1_structures.py
│ │ │ ├── abi_v2_structures.py
│ │ │ ├── accounts.py
│ │ │ ├── clients.py
│ │ │ ├── constants.py
│ │ │ ├── contracts.py
│ │ │ ├── contracts_v1.py
│ │ │ ├── devnet.py
│ │ │ ├── devnet_ws.py
│ │ │ ├── environment_check.py
│ │ │ ├── event_loop.py
│ │ │ └── misc.py
│ │ ├── mock/
│ │ │ ├── cairo_0_contracts_abi/
│ │ │ │ ├── balance_struct_event_abi.json
│ │ │ │ └── complex_contract_abi.json
│ │ │ ├── compile_contracts.sh
│ │ │ ├── contracts_v1/
│ │ │ │ ├── .tool-versions
│ │ │ │ ├── Scarb.toml
│ │ │ │ └── src/
│ │ │ │ ├── account.cairo
│ │ │ │ ├── balance.cairo
│ │ │ │ ├── hello.cairo
│ │ │ │ ├── hello_starknet.cairo
│ │ │ │ ├── lib.cairo
│ │ │ │ ├── map.cairo
│ │ │ │ ├── minimal_contract.cairo
│ │ │ │ ├── test_contract.cairo
│ │ │ │ ├── test_contract_declare.cairo
│ │ │ │ ├── test_enum.cairo
│ │ │ │ └── test_option.cairo
│ │ │ ├── contracts_v2/
│ │ │ │ ├── .tool-versions
│ │ │ │ ├── Scarb.toml
│ │ │ │ └── src/
│ │ │ │ ├── abi_types.cairo
│ │ │ │ ├── account.cairo
│ │ │ │ ├── account_copy_1.cairo
│ │ │ │ ├── balance.cairo
│ │ │ │ ├── constructor_with_arguments.cairo
│ │ │ │ ├── erc20.cairo
│ │ │ │ ├── hello2.cairo
│ │ │ │ ├── hello_starknet.cairo
│ │ │ │ ├── l1_l2.cairo
│ │ │ │ ├── lib.cairo
│ │ │ │ ├── map.cairo
│ │ │ │ ├── map_copy_1.cairo
│ │ │ │ ├── map_copy_2.cairo
│ │ │ │ ├── minimal_contract.cairo
│ │ │ │ ├── new_syntax_test_contract.cairo
│ │ │ │ ├── simple_contract.cairo
│ │ │ │ ├── simple_storage_with_event.cairo
│ │ │ │ ├── string.cairo
│ │ │ │ ├── test_contract.cairo
│ │ │ │ ├── test_contract2.cairo
│ │ │ │ ├── test_contract3.cairo
│ │ │ │ ├── test_contract4.cairo
│ │ │ │ ├── test_enum.cairo
│ │ │ │ ├── test_option.cairo
│ │ │ │ └── token_bridge.cairo
│ │ │ ├── precompiled_contracts/
│ │ │ │ ├── argent-0.4.0/
│ │ │ │ │ ├── ArgentAccount.casm
│ │ │ │ │ └── ArgentAccount.json
│ │ │ │ ├── minimal_contract_compiled_v2_1.casm
│ │ │ │ ├── minimal_contract_compiled_v2_5_4.casm
│ │ │ │ └── starknet_contract_v2_6.casm
│ │ │ └── typed_data/
│ │ │ ├── typed_data_rev_0_example.json
│ │ │ ├── typed_data_rev_0_felt_array_example.json
│ │ │ ├── typed_data_rev_0_long_string_example.json
│ │ │ ├── typed_data_rev_0_struct_array_example.json
│ │ │ ├── typed_data_rev_0_struct_merkletree_example.json
│ │ │ ├── typed_data_rev_1_basic_types_example.json
│ │ │ ├── typed_data_rev_1_enum_example.json
│ │ │ ├── typed_data_rev_1_example.json
│ │ │ ├── typed_data_rev_1_felt_merkletree_example.json
│ │ │ └── typed_data_rev_1_preset_types_example.json
│ │ ├── test-variables.env.template
│ │ ├── tests_on_networks/
│ │ │ ├── __init__.py
│ │ │ ├── account_test.py
│ │ │ ├── client_integration_test.py
│ │ │ ├── client_test.py
│ │ │ ├── fixtures.py
│ │ │ └── trace_api_test.py
│ │ ├── utils.py
│ │ └── utils_functions_test.py
│ ├── install_devnet.sh
│ └── unit/
│ ├── __init__.py
│ ├── abi/
│ │ ├── __init__.py
│ │ ├── v0/
│ │ │ ├── __init__.py
│ │ │ ├── parser_test.py
│ │ │ └── schemas_test.py
│ │ ├── v1/
│ │ │ ├── __init__.py
│ │ │ ├── parser_test.py
│ │ │ ├── parser_transformer_test.py
│ │ │ └── schemas_test.py
│ │ └── v2/
│ │ ├── __init__.py
│ │ ├── parser_test.py
│ │ ├── parser_transformer_test.py
│ │ └── schemas_test.py
│ ├── cairo/
│ │ ├── __init__.py
│ │ ├── felt_test.py
│ │ ├── type_parser_test.py
│ │ ├── v1/
│ │ │ ├── __init__.py
│ │ │ └── type_parser_test.py
│ │ └── v2/
│ │ ├── __init__.py
│ │ └── type_parser_test.py
│ ├── common/
│ │ ├── __init__.py
│ │ └── test_common.py
│ ├── contract/
│ │ ├── __init__.py
│ │ └── contract_test.py
│ ├── hash/
│ │ ├── __init__.py
│ │ ├── blake2s_test.py
│ │ ├── casm_class_hash_test.py
│ │ ├── selector_test.py
│ │ ├── sierra_class_hash_test.py
│ │ ├── storage_test.py
│ │ ├── transaction_test.py
│ │ └── utils_test.py
│ ├── net/
│ │ ├── __init__.py
│ │ ├── account/
│ │ │ ├── __init__.py
│ │ │ └── account_test.py
│ │ ├── client_test.py
│ │ ├── models/
│ │ │ ├── __init__.py
│ │ │ ├── address_test.py
│ │ │ └── chains_test.py
│ │ ├── schemas/
│ │ │ ├── __init__.py
│ │ │ └── common_test.py
│ │ └── tip/
│ │ ├── __init__.py
│ │ └── tip_test.py
│ ├── serialization/
│ │ ├── __init__.py
│ │ ├── _calldata_reader_test.py
│ │ ├── _context_test.py
│ │ ├── data_serializers/
│ │ │ ├── __init__.py
│ │ │ ├── array_serializer_test.py
│ │ │ ├── bool_serializer_test.py
│ │ │ ├── byte_array_serializer_test.py
│ │ │ ├── enum_serializer_test.py
│ │ │ ├── felt_serializer_test.py
│ │ │ ├── int_serializer_test.py
│ │ │ ├── named_tuple_serializer_test.py
│ │ │ ├── non_zero_serializer.py
│ │ │ ├── option_serializer_test.py
│ │ │ ├── output_serializer_test.py
│ │ │ ├── payload_serializer_test.py
│ │ │ ├── struct_serializer_test.py
│ │ │ ├── tuple_serializer_test.py
│ │ │ ├── uint256_serializer_test.py
│ │ │ ├── uint_serializer_test.py
│ │ │ └── unit_serializer_test.py
│ │ ├── factory_test.py
│ │ ├── function_serialization_adapter_test.py
│ │ ├── serialization_test.py
│ │ └── tuple_dataclass_test.py
│ ├── signer/
│ │ ├── __init__.py
│ │ ├── allow_ledger_blind_signing.sh
│ │ ├── speculos_automation.json
│ │ ├── test_eth_signer.py
│ │ ├── test_key_pair.py
│ │ ├── test_ledger_signer.py
│ │ └── test_stark_curve_signer.py
│ └── utils/
│ ├── __init__.py
│ ├── merkle_tree_test.py
│ ├── sync/
│ │ ├── __init__.py
│ │ └── sync_test.py
│ └── typed_data_test.py
├── transaction_errors.py
└── utils/
├── __init__.py
├── constructor_args_translator.py
├── iterable.py
├── merkle_tree.py
├── schema.py
├── sync/
│ ├── __init__.py
│ └── sync.py
└── typed_data.py
================================================
FILE CONTENTS
================================================
================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.yaml
================================================
name: Bug Report
description: File a bug report
title: "[BUG] <title>"
labels: [ "bug" ]
body:
- type: textarea
id: what-happened
attributes:
label: What happened
description: Describe the issue here.
validations:
required: true
- type: textarea
id: logs
attributes:
label: Stack trace
description: Please provide stack trace output of the error.
validations:
required: true
- type: textarea
id: steps-to-reproduce
attributes:
label: Steps to reproduce
description: Please provide the steps required to reproduce the issue.
value: "1. "
validations:
required: true
- type: input
id: sdk-version
attributes:
label: SDK Version
description: What SDK version are you using?
validations:
required: true
- type: input
id: python-version
attributes:
label: Python version
description: What version of Python are you using? Note that the lowest currently supported Python version is 3.10.
validations:
required: true
- type: dropdown
id: operating-systems
attributes:
label: What operating system are you using?
multiple: true
options:
- Linux
- Windows
- Mac
validations:
required: true
- type: checkboxes
id: verified-not-exists
attributes:
label: Is there an existing issue for this?
options:
- label: I have searched the existing issues and verified no issue exits for this problem.
# Thanks to https://github.com/MarketingPipeline/Awesome-Repo-Template
================================================
FILE: .github/ISSUE_TEMPLATE/feature_request.yaml
================================================
name: Feature request
description: Suggest a feature
body:
- type: textarea
id: Suggestion
attributes:
label: Feature Request
description: Describe the feature(s) you would like to be added.
validations:
required: true
# Thanks to https://github.com/MarketingPipeline/Awesome-Repo-Template
================================================
FILE: .github/actions/compile-contracts/action.yml
================================================
name: 'Compile contracts'
description: 'Compile Cairo contracts for a specific package'
inputs:
package:
description: 'Name of contracts package'
required: true
contracts_base_path:
description: 'Base path to contracts directory'
required: false
default: 'starknet_py/tests/e2e/mock'
cache:
description: 'Whether to cache contracts'
required: false
default: true
outputs:
cache-hit:
value: ${{ steps.cache-contracts.outputs.cache-hit }}
runs:
using: 'composite'
steps:
- name: Cache contracts ${{ inputs.package }}
id: cache-contracts
if: inputs.cache == 'true'
uses: actions/cache@v4
with:
path: ${{ inputs.contracts_base_path }}/${{ inputs.package }}/target
key: ${{ runner.os }}-contracts-${{ inputs.package }}-${{ hashFiles(format('starknet_py/tests/e2e/mock/{0}/**', inputs.package)) }}
restore-keys: |
${{ runner.os }}-contracts-${{ inputs.package }}-
- name: Compile contracts ${{ inputs.package }}
if: inputs.cache != 'true' || steps.cache-contracts.outputs.cache-hit != 'true'
shell: bash
run: poetry run poe compile_contracts ${{ inputs.package }}
================================================
FILE: .github/actions/dispatch-compatibility-tests/action.yml
================================================
name: 'Dispatch compatibility tests'
description: 'Dispatch compatibility tests workflow to a target repository'
inputs:
repo:
description: 'Target repository (e.g., software-mansion/starknet.py)'
required: true
ref:
description: 'Git reference (branch, tag, or commit SHA) to use'
required: true
rpc-version:
description: 'RPC version path segment (e.g., v0_10)'
required: true
workflow-file:
description: 'Workflow file name to dispatch'
required: false
default: 'compatibility-tests.yml'
gh-token:
description: 'GitHub token for API authentication. It should be private access token wit permission to trigger workflows in SDK repositories.'
required: true
runs:
using: 'composite'
steps:
- name: Dispatch workflow
shell: bash
env:
REPO: ${{ inputs.repo }}
REF: ${{ inputs.ref }}
RPC_VERSION: ${{ inputs.rpc-version }}
WORKFLOW_FILE: ${{ inputs.workflow-file }}
GH_TOKEN: ${{ inputs.gh-token }}
run: |
gh workflow run "${WORKFLOW_FILE}" \
--repo "${REPO}" \
--ref "${REF}" \
-f rpc-version="${RPC_VERSION}"
echo "Dispatched ${REPO}@${REF} workflow ${WORKFLOW_FILE} with rpc-version=${RPC_VERSION}"
================================================
FILE: .github/codecov.yml
================================================
codecov:
notify:
after_n_builds: 4
require_ci_to_pass: no
coverage:
status: off
comment:
layout: "diff, flags, files"
behavior: default
require_changes: no
================================================
FILE: .github/dependabot.yml
================================================
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "monthly"
versioning-strategy: increase-if-necessary
groups:
production-dependencies:
dependency-type: "production"
dev-dependencies:
dependency-type: "development"
================================================
FILE: .github/pull_request_template.md
================================================
<!-- Reference any GitHub issues resolved by this PR -->
Closes #
## Introduced changes
<!-- A brief description of the changes -->
-
-
##
- [ ] This PR contains breaking changes
<!-- List of all breaking changes -->
================================================
FILE: .github/workflows/checks.yml
================================================
name: Checks
env:
CAIRO_LANG_VERSION: "0.13.1"
# TODO(#1611)
DEVNET_SHA: 7ed5a9675746d1d9bdb108cecf950d6f611caa9d # v0.8.0-rc.0
LEDGER_APP_SHA: 768a7b47b0da681b28112342edd76e2c9b292c4e # v2.3.1
LEDGER_APP_DEV_TOOLS_SHA: a845b2ab0b5dd824133f73858f6f373edea85ec1bd828245bf50ce9700f33bcb # v4.5.0
on:
push:
branches:
- master
- development
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
# ---------------------------------------------------------- #
# ...................LINT-FORMAT-TYPECHECK.................. #
# ---------------------------------------------------------- #
lint-format-typecheck:
name: Lint - Format - Typecheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Set up Python 3.14
uses: actions/setup-python@v5
with:
python-version: "3.14"
cache: 'poetry'
- name: Install dependencies needed for HIDAPI and Pillow
run: |
sudo apt-get update
sudo apt install python3-dev libusb-1.0-0-dev libudev-dev libjpeg-dev
- name: Install dependencies
run: |
poetry install -E ledger
- name: Check poetry.lock
run: |
poetry check --lock
- name: Lint
run: |
poetry run poe lint
- name: Format
run: |
poetry run poe format_check
- name: Typecheck
run: |
poetry run poe typecheck
# ---------------------------------------------------------- #
# .......................SETUP-TESTS........................ #
# ---------------------------------------------------------- #
setup-tests:
name: Setup Tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.14" ]
steps:
# ====================== SETUP ====================== #
- uses: actions/checkout@v4
- uses: asdf-vm/actions/setup@b7bcd026f18772e44fe1026d729e1611cc435d47 # v4.0.1
- uses: actions/setup-python@v5
with:
python-version: "3.14"
cache: 'pip'
- name: Install poetry
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- name: Install dependencies
run: |
poetry install
- name: Compile contracts v2
uses: ./.github/actions/compile-contracts
with:
package: contracts_v2
- name: Compile contracts v1
uses: ./.github/actions/compile-contracts
with:
package: contracts_v1
- name: Upload contracts artifacts
uses: actions/upload-artifact@v4
with:
name: contract-artifacts
path: starknet_py/tests/e2e/mock/
# ---------------------------------------------------------- #
# ........................RUN-TESTS......................... #
# ---------------------------------------------------------- #
run-tests:
name: Tests
needs: setup-tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.10", "3.14" ]
env:
SEPOLIA_RPC_URL: ${{ secrets.SEPOLIA_RPC_URL }}
steps:
- uses: actions/checkout@v4
- name: Download contracts
uses: actions/download-artifact@v4
with:
name: contract-artifacts
path: starknet_py/tests/e2e/mock/
- uses: actions/setup-python@v5
with:
python-version: "3.14"
cache: 'pip'
# ====================== SETUP PYTHON ====================== #
- name: Install poetry
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- name: Install dependencies
run: |
poetry install
# ====================== SETUP DEVNET ====================== #
- name: Install devnet
run: ./starknet_py/tests/install_devnet.sh
# ====================== RUN TESTS ====================== #
- name: Check circular imports
run: |
poetry run poe circular_imports_check
- uses: asdf-vm/actions/setup@b7bcd026f18772e44fe1026d729e1611cc435d47 # v4.0.1
- name: Run tests
run: |
poetry run poe test_ci_v2
poetry run poe test_ci_v1
- name: Generate coverage in XML
run: |
poetry run coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
# ---------------------------------------------------------- #
# .....................RUN-LEDGER-TESTS..................... #
# ---------------------------------------------------------- #
run-ledger-tests:
name: Ledger Tests
needs: setup-tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.10", "3.14" ]
env:
LEDGER_PROXY_ADDRESS: 127.0.0.1
LEDGER_PROXY_PORT: 9999
SEPOLIA_RPC_URL: ${{ secrets.SEPOLIA_RPC_URL }}
steps:
- uses: actions/checkout@v4
- name: Download contracts
uses: actions/download-artifact@v4
with:
name: contract-artifacts
path: starknet_py/tests/e2e/mock/
- uses: actions/setup-python@v5
with:
python-version: "3.14"
cache: 'pip'
# ====================== SETUP PYTHON ====================== #
- name: Install poetry
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- name: Install dependencies needed for HIDAPI and Pillow
run: |
sudo apt-get update
sudo apt install python3-dev libusb-1.0-0-dev libudev-dev libjpeg-dev
- name: Install dependencies
run: |
poetry install -E ledger
# ====================== SETUP DEVNET ====================== #
- name: Install devnet
run: ./starknet_py/tests/install_devnet.sh
# ====================== SETUP LEDGER SPECULOS ====================== #
- name: Pull speculos image
run: docker pull ghcr.io/ledgerhq/ledger-app-builder/ledger-app-dev-tools@sha256:${{ env.LEDGER_APP_DEV_TOOLS_SHA }}
- name: Clone LedgerHQ Starknet app repository
run: git clone https://github.com/LedgerHQ/app-starknet.git
- name: Build the app inside Docker container
uses: addnab/docker-run-action@v3
with:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-dev-tools@sha256:${{ env.LEDGER_APP_DEV_TOOLS_SHA }}
options: --rm -v ${{ github.workspace }}:/apps
run: |
cd /apps/app-starknet
git checkout ${{ env.LEDGER_APP_SHA }}
cd starknet
cargo clean
cargo ledger build nanox
- name: Start Speculos emulator container
uses: addnab/docker-run-action@v3
with:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-dev-tools@sha256:${{ env.LEDGER_APP_DEV_TOOLS_SHA }}
options: --rm -d --name speculos-emulator -v ${{ github.workspace }}:/apps --publish 5000:5000 --publish 9999:9999
run: |
speculos \
-m nanox \
--apdu-port 9999 \
--api-port 5000 \
--display headless \
/apps/app-starknet/target/nanox/release/starknet
- name: Wait for Speculos to start
run: sleep 5
- name: Allow blind signing
run: ./starknet_py/tests/unit/signer/allow_ledger_blind_signing.sh
- name: Update automation rules
working-directory: starknet_py/tests/unit/signer
run: |
curl -X POST http://127.0.0.1:5000/automation \
-H "Content-Type: application/json" \
-d @speculos_automation.json
# ====================== RUN TESTS ====================== #
- name: Run tests
run: |
poetry run poe test_ci_ledger
- name: Generate coverage in XML
run: |
poetry run coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
# ---------------------------------------------------------- #
# ..................RUN-TESTS-ON-NETWORKS................... #
# ---------------------------------------------------------- #
run-tests-on-networks:
name: Tests on networks (testnet)
needs: setup-tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
env:
SEPOLIA_RPC_URL: ${{ secrets.SEPOLIA_RPC_URL }}
SEPOLIA_ACCOUNT_ADDRESS: ${{ secrets.SEPOLIA_ACCOUNT_ADDRESS }}
SEPOLIA_ACCOUNT_PRIVATE_KEY: ${{ secrets.SEPOLIA_ACCOUNT_PRIVATE_KEY }}
# TODO(#1582): Remove braavos envs once integration is restored
SEPOLIA_BRAAVOS_ACCOUNT_ADDRESS: ${{ secrets.SEPOLIA_BRAAVOS_ACCOUNT_ADDRESS }}
SEPOLIA_BRAAVOS_ACCOUNT_PRIVATE_KEY: ${{ secrets.SEPOLIA_BRAAVOS_ACCOUNT_PRIVATE_KEY }}
INTEGRATION_RPC_URL: ${{ secrets.INTEGRATION_RPC_URL }}
steps:
- uses: actions/checkout@v4
- name: Download contracts
uses: actions/download-artifact@v4
with:
name: contract-artifacts
path: starknet_py/tests/e2e/mock/
- uses: actions/setup-python@v5
with:
python-version: "3.14"
cache: 'pip'
# ====================== SETUP PYTHON ====================== #
- name: Install poetry
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Set up Python 3.14
uses: actions/setup-python@v5
with:
python-version: "3.14"
cache: 'poetry'
# ====================== SETUP DEVNET ====================== #
- name: Install devnet
run: ./starknet_py/tests/install_devnet.sh
# ====================== RUN TESTS ====================== #
- name: Check circular imports
run: |
poetry run poe circular_imports_check
- uses: asdf-vm/actions/setup@b7bcd026f18772e44fe1026d729e1611cc435d47 # v4.0.1
- name: Run tests
run: |
if [[ "${{ github.event_name }}" != "pull_request" ]]; then
poetry run poe test_ci_on_networks_extended
else
poetry run poe test_ci_on_networks
fi
- name: Generate coverage in XML
run: |
poetry run coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
# ---------------------------------------------------------- #
# ....................RUN-TESTS-WINDOWS..................... #
# ---------------------------------------------------------- #
run-tests-windows:
if: ${{ github.event_name != 'pull_request' }}
name: Tests Windows
needs: setup-tests
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.10", "3.14" ]
env:
SEPOLIA_RPC_URL: ${{ secrets.SEPOLIA_RPC_URL }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@dc6353516c68da0f06325f42ad880f76a5e77ec9
with:
toolchain: 1.83.0
- name: Download contracts
uses: actions/download-artifact@v4
with:
name: contract-artifacts
path: starknet_py/tests/e2e/mock/
- uses: actions/setup-python@v5
with:
python-version: "3.14"
cache: 'pip'
# ====================== SETUP DEVNET ====================== #
- name: Cache devnet build
id: windows-devnet-cache
uses: actions/cache@v4
with:
path: ${{ github.workspace }}\starknet_py\tests\e2e\devnet\bin
key: ${{ runner.os }}-devnet-${{ env.DEVNET_SHA }}
- name: Install devnet
if: steps.windows-devnet-cache.outputs.cache-hit != 'true'
run: |
$DEVNET_INSTALL_DIR = "${{ github.workspace }}\starknet_py\tests\e2e\devnet"
cargo install --git https://github.com/0xSpaceShard/starknet-devnet-rs.git --locked --rev ${{ env.DEVNET_SHA }} --root $DEVNET_INSTALL_DIR
shell: pwsh
# ====================== SETUP PYTHON ====================== #
- name: Install poetry
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- name: Install dependencies
run: |
poetry install
# ====================== RUN TESTS ====================== #
- name: Check circular imports
run: |
poetry run poe circular_imports_check
- name: Run tests
run: |
poetry run poe test_ci_v2
poetry run poe test_ci_v1
- name: Generate coverage in XML
run: |
poetry run coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
# ---------------------------------------------------------- #
# .....................RUN-DOCS-TESTS....................... #
# ---------------------------------------------------------- #
run-docs-tests:
name: Docs Tests
needs: setup-tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.10", "3.14" ]
steps:
- uses: actions/checkout@v4
- name: Download contracts
uses: actions/download-artifact@v4
with:
name: contract-artifacts
path: starknet_py/tests/e2e/mock/
- uses: actions/setup-python@v5
with:
python-version: "3.14"
cache: 'pip'
# ====================== SETUP PYTHON ====================== #
- name: Install poetry
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- name: Install dependencies
run: |
poetry install
# ====================== SETUP DEVNET ====================== #
- name: Install devnet
run: ./starknet_py/tests/install_devnet.sh
# ====================== RUN TESTS ====================== #
- uses: asdf-vm/actions/setup@b7bcd026f18772e44fe1026d729e1611cc435d47 # v4.0.1
- name: Run tests
run: |
poetry run poe test_ci_docs_v2
poetry run poe test_ci_docs_v1
- name: Generate coverage in XML
run: |
poetry run coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
# ---------------------------------------------------------- #
# .................RUN-DOCS-TESTS-WINDOWS................... #
# ---------------------------------------------------------- #
run-docs-tests-windows:
if: ${{ github.event_name != 'pull_request' }}
name: Docs Tests Windows
needs: setup-tests
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.10", "3.14" ]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@dc6353516c68da0f06325f42ad880f76a5e77ec9
with:
toolchain: 1.83.0
- name: Download contracts
uses: actions/download-artifact@v4
with:
name: contract-artifacts
path: starknet_py/tests/e2e/mock/
- uses: actions/setup-python@v5
with:
python-version: "3.14"
cache: 'pip'
# ====================== SETUP PYTHON ====================== #
- name: Install poetry
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- name: Install dependencies
run: |
poetry install
# ====================== SETUP DEVNET ====================== #
- name: Cache devnet build
id: windows-devnet-cache
uses: actions/cache@v4
with:
path: ${{ github.workspace }}\starknet_py\tests\e2e\devnet\bin
key: ${{ runner.os }}-devnet-${{ env.DEVNET_SHA }}
- name: Install devnet
if: steps.windows-devnet-cache.outputs.cache-hit != 'true'
run: |
$DEVNET_INSTALL_DIR = "${{ github.workspace }}\starknet_py\tests\e2e\devnet"
cargo install --git https://github.com/0xSpaceShard/starknet-devnet-rs.git --locked --rev ${{ env.DEVNET_SHA }} --root $DEVNET_INSTALL_DIR
shell: pwsh
# ====================== RUN TESTS ====================== #
- name: Run tests
run: |
poetry run poe test_ci_docs_v2
poetry run poe test_ci_docs_v1
- name: Generate coverage in XML
run: |
poetry run coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
================================================
FILE: .github/workflows/compatibility-tests-dispatcher.yml
================================================
name: Run compatibility tests with multiple RPC versions
on:
workflow_dispatch:
jobs:
dispatch:
name: Dispatch (RPC ${{ matrix.rpc-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- rpc-version: "v0_8"
# TODO(#1708): Run once compatibility tests are available
# py_ref: "0.26.0"
# jvm_ref: "x.y.z"
# swift_ref: "x.y.z"
# rust_ref: "x.y.z"
- rpc-version: "v0_9"
# TODO(#1708): Run once compatibility tests are available
# py_ref: "0.28.1"
# jvm_ref: "x.y.z"
# swift_ref: "x.y.z"
# rust_ref: "x.y.z"
- rpc-version: "v0_10"
py_ref: "compatibility-tests"
# TODO(#1708): Run once compatibility tests are available
# jvm_ref: "x.y.z"
# swift_ref: "x.y.z"
# rust_ref: "x.y.z"
steps:
- uses: actions/checkout@v6
- name: Dispatch starknet.py workflow
if: matrix.py_ref
uses: ./.github/actions/dispatch-compatibility-tests
with:
repo: software-mansion/starknet.py
ref: ${{ matrix.py_ref }}
rpc-version: ${{ matrix.rpc-version }}
gh-token: ${{ secrets.CI_DISPATCH_TOKEN }}
- name: Dispatch starknet-jvm workflow
if: matrix.jvm_ref
uses: ./.github/actions/dispatch-compatibility-tests
with:
repo: software-mansion/starknet-jvm
ref: ${{ matrix.jvm_ref }}
rpc-version: ${{ matrix.rpc-version }}
gh-token: ${{ secrets.CI_DISPATCH_TOKEN }}
- name: Dispatch starknet.swift workflow
if: matrix.swift_ref
uses: ./.github/actions/dispatch-compatibility-tests
with:
repo: software-mansion/starknet.swift
ref: ${{ matrix.swift_ref }}
rpc-version: ${{ matrix.rpc-version }}
gh-token: ${{ secrets.CI_DISPATCH_TOKEN }}
- name: Dispatch starknet-rust workflow
if: matrix.rust_ref
uses: ./.github/actions/dispatch-compatibility-tests
with:
repo: software-mansion/starknet-rust
ref: ${{ matrix.rust_ref }}
rpc-version: ${{ matrix.rpc-version }}
gh-token: ${{ secrets.CI_DISPATCH_TOKEN }}
================================================
FILE: .github/workflows/compatibility-tests.yml
================================================
name: Compatibility tests
on:
workflow_dispatch:
inputs:
rpc-version:
description: "RPC version path segment, e.g. v0_10"
required: true
type: string
concurrency:
group: compatibility-tests
cancel-in-progress: true
jobs:
setup-tests:
name: Setup Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: asdf-vm/actions/setup@b7bcd026f18772e44fe1026d729e1611cc435d47 # v4.0.1
- name: Install poetry
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Set up Python 3.14
uses: actions/setup-python@v5
with:
python-version: "3.14"
cache: 'poetry'
- name: Install dependencies
run: |
poetry install
- name: Compile contracts_v2 (without cache, so we use salted contracts)
uses: ./.github/actions/compile-contracts
with:
package: contracts_v2
cache: false
- name: Upload contracts artifacts
uses: actions/upload-artifact@v7
with:
name: contract-artifacts
path: starknet_py/tests/e2e/mock/
run-network-tests:
name: Network tests (testnet) with RPC version ${{ inputs.rpc-version }}
needs: setup-tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
env:
SEPOLIA_RPC_URL: ${{ secrets.SEPOLIA_RPC_URL }}
SEPOLIA_ACCOUNT_ADDRESS: ${{ secrets.SEPOLIA_ACCOUNT_ADDRESS }}
SEPOLIA_ACCOUNT_PRIVATE_KEY: ${{ secrets.SEPOLIA_ACCOUNT_PRIVATE_KEY }}
INTEGRATION_RPC_URL: ${{ secrets.INTEGRATION_RPC_URL }}
steps:
- uses: actions/checkout@v6
- name: Download contracts
uses: actions/download-artifact@v4
with:
name: contract-artifacts
path: starknet_py/tests/e2e/mock/
- name: Install poetry
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Set up Python 3.14
uses: actions/setup-python@v5
with:
python-version: "3.14"
cache: 'poetry'
- uses: asdf-vm/actions/setup@b7bcd026f18772e44fe1026d729e1611cc435d47 # v4.0.1
- name: Update RPC url with version from inputs
run: |
URL="${SEPOLIA_RPC_URL}"
RPC_VERSION="${{ inputs.rpc-version }}"
URL="${URL%/}" # Remove trailing slash if any
URL="${URL%/*}" # Get base URL without version
RPC_URL="${URL}/${RPC_VERSION}"
echo "SEPOLIA_RPC_URL=${RPC_URL}" >> "$GITHUB_ENV"
- name: Run tests (extended)
run: poetry run poe test_ci_on_networks_extended
- name: Generate coverage in XML
run: |
poetry run coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
================================================
FILE: .github/workflows/package.yml
================================================
name: Build wheels
on:
push:
tags:
- '*'
workflow_dispatch:
jobs:
build_sdist:
name: Build SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install poetry
run: python -X utf8 -m pip install poetry
- name: Build SDist
run: poetry build -f sdist
- uses: actions/upload-artifact@v4
with:
path: dist/*.tar.gz
upload_pypi:
name: Upload package to PyPI
needs: [build_sdist]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
================================================
FILE: .gitignore
================================================
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
.pybuilder/
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# pytype static type analyzer
.pytype/
# Cython debug symbols
cython_debug/
# PyCharm
.idea
# Shared libs
*.dylib
/e2e.coverage
/unit.coverage
# Compiled contracts
/starknet_py/tests/e2e/mock/contracts_compiled/*
/starknet_py/tests/e2e/mock/*/Scarb.lock
# Allow precompiled contracts
!/starknet_py/tests/e2e/mock/contracts_compiled/precompiled/
# Test variables
/starknet_py/tests/e2e/test-variables.env
# Devnet binary
/starknet_py/tests/e2e/devnet
================================================
FILE: .pylintrc
================================================
[MASTER]
# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code.
extension-pkg-allow-list=
# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code. (This is an alternative name to extension-pkg-allow-list
# for backward compatibility.)
extension-pkg-whitelist=
# Return non-zero exit code if any of these messages/categories are detected,
# even if score is above --fail-under value. Syntax same as enable. Messages
# specified are enabled, while categories only check already-enabled messages.
fail-on=
# Specify a score threshold to be exceeded before program exits with error.
fail-under=10.0
# Files or directories to be skipped. They should be base names, not paths.
ignore=CVS
# Add files or directories matching the regex patterns to the ignore-list. The
# regex matches against paths and can be in Posix or Windows format.
ignore-paths=
# Files or directories matching the regex patterns are skipped. The regex
# matches against base names, not paths.
ignore-patterns=
# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
#init-hook=
# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the
# number of processors available to use.
jobs=0
# Control the amount of potential inferred values when inferring a single
# object. This can help the performance when dealing with large functions or
# complex, nested conditions.
limit-inference-results=100
# List of plugins (as comma separated values of python module names) to load,
# usually to register additional checkers.
load-plugins=pylint.extensions.no_self_use, pylint_todo_checker
# Pickle collected data for later comparisons.
persistent=yes
# Minimum Python version to use for version dependent checks. Will default to
# the version used to run pylint.
py-version=3.10
# When enabled, pylint would attempt to guess common misconfiguration and emit
# user-friendly hints instead of false-positive error messages.
suggestion-mode=yes
# Allow loading of arbitrary C extensions. Extensions are imported into the
# active Python interpreter and may run arbitrary code.
unsafe-load-any-extension=no
[MESSAGES CONTROL]
# Only show warnings with the listed confidence levels. Leave empty to show
# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED.
confidence=
# Disable the message, report, category or checker with the given id(s). You
# can either give multiple identifiers separated by comma (,) or put this
# option multiple times (only on the command line, not in the configuration
# file where it should appear only once). You can also use "--disable=all" to
# disable everything first and then reenable specific checks. For example, if
# you want to run only the similarities checker, you can use "--disable=all
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use "--disable=all --enable=classes
# --disable=W".
disable=raw-checker-failed,
bad-inline-option,
locally-disabled,
file-ignored,
suppressed-message,
useless-suppression,
deprecated-pragma,
use-symbolic-message-instead,
missing-module-docstring,
missing-class-docstring,
missing-function-docstring,
too-few-public-methods,
duplicate-code,
fixme
# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
# multiple time (only on the command line, not in the configuration file where
# it should appear only once). See also the "--disable" option for examples.
enable=c-extension-no-member
[REPORTS]
# Python expression which should return a score less than or equal to 10. You
# have access to the variables 'error', 'warning', 'refactor', and 'convention'
# which contain the number of messages in each category, as well as 'statement'
# which is the total number of statements analyzed. This score is used by the
# global evaluation report (RP0004).
evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
# Template used to display messages. This is a python new-style format string
# used to format the message information. See doc for all details.
#msg-template=
# Set the output format. Available formats are text, parseable, colorized, json
# and msvs (visual studio). You can also give a reporter class, e.g.
# mypackage.mymodule.MyReporterClass.
output-format=text
# Tells whether to display a full report or only the messages.
reports=no
# Activate the evaluation score.
score=yes
[REFACTORING]
# Maximum number of nested blocks for function / method body
max-nested-blocks=5
# Complete name of functions that never returns. When checking for
# inconsistent-return-statements if a never returning function is called then
# it will be considered as an explicit return statement and no message will be
# printed.
never-returning-functions=sys.exit,argparse.parse_error
[LOGGING]
# The type of string formatting that logging methods do. `old` means using %
# formatting, `new` is for `{}` formatting.
logging-format-style=old
# Logging modules to check that the string format arguments are in logging
# function parameter format.
logging-modules=logging
[SPELLING]
# Limits count of emitted suggestions for spelling mistakes.
max-spelling-suggestions=4
# Spelling dictionary name. Available dictionaries: none. To make it work,
# install the 'python-enchant' package.
spelling-dict=
# List of comma separated words that should be considered directives if they
# appear and the beginning of a comment and should not be checked.
spelling-ignore-comment-directives=fmt: on,fmt: off,noqa:,noqa,nosec,isort:skip,mypy:
# List of comma separated words that should not be checked.
spelling-ignore-words=
# A path to a file that contains the private dictionary; one word per line.
spelling-private-dict-file=
# Tells whether to store unknown words to the private dictionary (see the
# --spelling-private-dict-file option) instead of raising a message.
spelling-store-unknown-words=no
[MISCELLANEOUS]
# List of note tags to take in consideration, separated by a comma.
notes=FIXME,
XXX,
TODO
# Regular expression of note tags to take in consideration.
#notes-rgx=
[TYPECHECK]
# List of decorators that produce context managers, such as
# contextlib.contextmanager. Add to this list to register other decorators that
# produce valid context managers.
contextmanager-decorators=contextlib.contextmanager
# List of members which are set dynamically and missed by pylint inference
# system, and so shouldn't trigger E1101 when accessed. Python regular
# expressions are accepted.
generated-members=
# Tells whether missing members accessed in mixin class should be ignored. A
# class is considered mixin if its name matches the mixin-class-rgx option.
ignore-mixin-members=yes
# Tells whether to warn about missing members when the owner of the attribute
# is inferred to be None.
ignore-none=yes
# This flag controls whether pylint should warn about no-member and similar
# checks whenever an opaque object is returned when inferring. The inference
# can return multiple potential results while evaluating a Python object, but
# some branches might not be evaluated, which results in partial inference. In
# that case, it might be useful to still emit no-member and other checks for
# the rest of the inferred objects.
ignore-on-opaque-inference=yes
# List of class names for which member attributes should not be checked (useful
# for classes with dynamically set attributes). This supports the use of
# qualified names.
ignored-classes=optparse.Values,thread._local,_thread._local
# List of module names for which member attributes should not be checked
# (useful for modules/projects where namespaces are manipulated during runtime
# and thus existing member attributes cannot be deduced by static analysis). It
# supports qualified module names, as well as Unix pattern matching.
ignored-modules=
# Show a hint with possible names when a member name was not found. The aspect
# of finding the hint is based on edit distance.
missing-member-hint=yes
# The minimum edit distance a name should have in order to be considered a
# similar match for a missing member name.
missing-member-hint-distance=1
# The total number of similar names that should be taken in consideration when
# showing a hint for a missing member.
missing-member-max-choices=1
# Regex pattern to define which classes are considered mixins ignore-mixin-
# members is set to 'yes'
mixin-class-rgx=.*[Mm]ixin
# List of decorators that change the signature of a decorated function.
signature-mutators=
[VARIABLES]
# List of additional names supposed to be defined in builtins. Remember that
# you should avoid defining new builtins when possible.
additional-builtins=
# Tells whether unused global variables should be treated as a violation.
allow-global-unused-variables=yes
# List of names allowed to shadow builtins
allowed-redefined-builtins=
# List of strings which can identify a callback function by name. A callback
# name must start or end with one of those strings.
callbacks=cb_,
_cb
# A regular expression matching the name of dummy variables (i.e. expected to
# not be used).
dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_
# Argument names that match this expression will be ignored. Default to name
# with leading underscore.
ignored-argument-names=_.*|^ignored_|^unused_
# Tells whether we should check for unused import in __init__ files.
init-import=no
# List of qualified module names which can have objects that can redefine
# builtins.
redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io
[FORMAT]
# Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
expected-line-ending-format=
# Regexp for a line that is allowed to be longer than the limit.
ignore-long-lines=^\s*(# )?<?https?://\S+>?$
# Number of spaces of indent required inside a hanging or continued line.
indent-after-paren=4
# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
# tab).
indent-string=' '
# Maximum number of characters on a single line.
max-line-length=120
# Maximum number of lines in a module.
max-module-lines=1000
# Allow the body of a class to be on the same line as the declaration if body
# contains single statement.
single-line-class-stmt=no
# Allow the body of an if to be on the same line as the test if there is no
# else.
single-line-if-stmt=no
[SIMILARITIES]
# Comments are removed from the similarity computation
ignore-comments=yes
# Docstrings are removed from the similarity computation
ignore-docstrings=yes
# Imports are removed from the similarity computation
ignore-imports=no
# Signatures are removed from the similarity computation
ignore-signatures=no
# Minimum lines number of a similarity.
min-similarity-lines=4
[BASIC]
# Naming style matching correct argument names.
argument-naming-style=snake_case
# Regular expression matching correct argument names. Overrides argument-
# naming-style.
#argument-rgx=
# Naming style matching correct attribute names.
attr-naming-style=snake_case
# Regular expression matching correct attribute names. Overrides attr-naming-
# style.
#attr-rgx=
# Bad variable names which should always be refused, separated by a comma.
bad-names=foo,
bar,
baz,
toto,
tutu,
tata
# Bad variable names regexes, separated by a comma. If names match any regex,
# they will always be refused
bad-names-rgxs=
# Naming style matching correct class attribute names.
class-attribute-naming-style=any
# Regular expression matching correct class attribute names. Overrides class-
# attribute-naming-style.
#class-attribute-rgx=
# Naming style matching correct class constant names.
class-const-naming-style=UPPER_CASE
# Regular expression matching correct class constant names. Overrides class-
# const-naming-style.
#class-const-rgx=
# Naming style matching correct class names.
class-naming-style=PascalCase
# Regular expression matching correct class names. Overrides class-naming-
# style.
#class-rgx=
# Naming style matching correct constant names.
const-naming-style=UPPER_CASE
# Regular expression matching correct constant names. Overrides const-naming-
# style.
#const-rgx=
# Minimum line length for functions/classes that require docstrings, shorter
# ones are exempt.
docstring-min-length=-1
# Naming style matching correct function names.
function-naming-style=snake_case
# Regular expression matching correct function names. Overrides function-
# naming-style.
#function-rgx=
# Good variable names which should always be accepted, separated by a comma.
good-names=i,
j,
k,
v,
n,
ex,
Run,
T,
fn,
tx,
w3,
_
# Good variable names regexes, separated by a comma. If names match any regex,
# they will always be accepted
good-names-rgxs=
# Include a hint for the correct naming format with invalid-name.
include-naming-hint=no
# Naming style matching correct inline iteration names.
inlinevar-naming-style=any
# Regular expression matching correct inline iteration names. Overrides
# inlinevar-naming-style.
#inlinevar-rgx=
# Naming style matching correct method names.
method-naming-style=snake_case
# Regular expression matching correct method names. Overrides method-naming-
# style.
#method-rgx=
# Naming style matching correct module names.
module-naming-style=snake_case
# Regular expression matching correct module names. Overrides module-naming-
# style.
#module-rgx=
# Colon-delimited sets of names that determine each other's naming style when
# the name regexes allow several styles.
name-group=
# Regular expression which should only match function or class names that do
# not require a docstring.
no-docstring-rgx=^_
# List of decorators that produce properties, such as abc.abstractproperty. Add
# to this list to register other decorators that produce valid properties.
# These decorators are taken in consideration only for invalid-name.
property-classes=abc.abstractproperty
# Naming style matching correct variable names.
variable-naming-style=snake_case
# Regular expression matching correct variable names. Overrides variable-
# naming-style.
#variable-rgx=
[STRING]
# This flag controls whether inconsistent-quotes generates a warning when the
# character used as a quote delimiter is used inconsistently within a module.
check-quote-consistency=no
# This flag controls whether the implicit-str-concat should generate a warning
# on implicit string concatenation in sequences defined over several lines.
check-str-concat-over-line-jumps=no
[IMPORTS]
# List of modules that can be imported at any level, not just the top level
# one.
allow-any-import-level=
# Allow wildcard imports from modules that define __all__.
allow-wildcard-with-all=no
# Analyse import fallback blocks. This can be used to support both Python 2 and
# 3 compatible code, which means that the block might have code that exists
# only in one or another interpreter, leading to false positives when analysed.
analyse-fallback-blocks=no
# Deprecated modules which should not be used, separated by a comma.
deprecated-modules=
# Output a graph (.gv or any supported image format) of external dependencies
# to the given file (report RP0402 must not be disabled).
ext-import-graph=
# Output a graph (.gv or any supported image format) of all (i.e. internal and
# external) dependencies to the given file (report RP0402 must not be
# disabled).
import-graph=
# Output a graph (.gv or any supported image format) of internal dependencies
# to the given file (report RP0402 must not be disabled).
int-import-graph=
# Force import order to recognize a module as part of the standard
# compatibility libraries.
known-standard-library=
# Force import order to recognize a module as part of a third party library.
known-third-party=enchant
# Couples of modules and preferred modules, separated by a comma.
preferred-modules=
[CLASSES]
# Warn about protected attribute access inside special methods
check-protected-access-in-special-methods=no
# List of method names used to declare (i.e. assign) instance attributes.
defining-attr-methods=__init__,
__new__,
setUp,
__post_init__
# List of member names, which should be excluded from the protected access
# warning.
exclude-protected=_asdict,
_fields,
_replace,
_source,
_make
# List of valid names for the first argument in a class method.
valid-classmethod-first-arg=cls
# List of valid names for the first argument in a metaclass class method.
valid-metaclass-classmethod-first-arg=cls
[DESIGN]
# List of regular expressions of class ancestor names to ignore when counting
# public methods (see R0903)
exclude-too-few-public-methods=
# List of qualified class names to ignore when counting class parents (see
# R0901)
ignored-parents=
# Maximum number of arguments for function / method.
max-args=6
# Maximum number of attributes for a class (see R0902).
max-attributes=7
# Maximum number of boolean expressions in an if statement (see R0916).
max-bool-expr=5
# Maximum number of branch for function / method body.
max-branches=12
# Maximum number of locals for function / method body.
max-locals=15
# Maximum number of parents for a class (see R0901).
max-parents=7
# Maximum number of public methods for a class (see R0904).
max-public-methods=20
# Maximum number of return / yield for function / method body.
max-returns=6
# Maximum number of statements in function / method body.
max-statements=50
# Minimum number of public methods for a class (see R0903).
min-public-methods=2
[EXCEPTIONS]
# Exceptions that will emit a warning when being caught. Defaults to
# "BaseException, Exception".
overgeneral-exceptions=builtins.BaseException,
builtins.Exception
================================================
FILE: .python-version
================================================
3.10
================================================
FILE: .readthedocs.yml
================================================
version: 2
build:
os: "ubuntu-22.04"
apt_packages:
- libgmp3-dev
tools:
python: "3.10"
jobs:
pre_install:
- pip install poetry
- poetry self add poetry-plugin-export
- poetry export -f requirements.txt --output requirements.txt --without-hashes -E docs -E ledger
sphinx:
configuration: docs/conf.py
fail_on_warning: true
python:
install:
- requirements: requirements.txt
- method: pip
path: .
================================================
FILE: .run/All tests.run.xml
================================================
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="All tests" type="tests" factoryName="Autodetect">
<module name="starknet_python_sdk" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="DEVNET_PORT" value="5001" />
</envs>
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="_new_additionalArguments" value="""" />
<option name="_new_target" value=""starknet_py"" />
<option name="_new_targetType" value=""PYTHON"" />
<method v="2" />
</configuration>
</component>
================================================
FILE: .run/E2E pytest.run.xml
================================================
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="E2E tests" type="tests" factoryName="py.test">
<module name="starknet_python_sdk" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="DEVNET_PORT" value="5001" />
</envs>
<option name="SDK_HOME" value="$USER_HOME$/Library/Caches/pypoetry/virtualenvs/starknet.py-zUPHQ8lh-py3.7/bin/python" />
<option name="WORKING_DIRECTORY" value="" />
<option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="_new_keywords" value="""" />
<option name="_new_parameters" value="""" />
<option name="_new_additionalArguments" value="""" />
<option name="_new_target" value=""starknet_py/tests/e2e"" />
<option name="_new_targetType" value=""PATH"" />
<method v="2" />
</configuration>
</component>
================================================
FILE: .run/starkware-devnet.run.xml
================================================
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="starkware-devnet" type="ShConfigurationType">
<option name="SCRIPT_TEXT" value="poetry run starknet-devnet --host localhost --port $DEVNET_PORT &; DEVNET_PID=$!; trap 'kill $DEVNET_PID' EXIT" />
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
<option name="SCRIPT_PATH" value="" />
<option name="SCRIPT_OPTIONS" value="" />
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
<option name="INTERPRETER_PATH" value="/bin/zsh" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="EXECUTE_IN_TERMINAL" value="true" />
<option name="EXECUTE_SCRIPT_FILE" value="false" />
<envs>
<env name="DEVNET_PORT" value="5001" />
</envs>
<method v="2" />
</configuration>
</component>
================================================
FILE: CONTRIBUTING.md
================================================
# Contribution Guide
## Reporting Issues
If you find a bug or have a suggestion for a feature, you can open a new [issue](https://github.com/software-mansion/starknet.py/issues/new/choose).
When opening an issue:
> 1. Check the [issues](https://github.com/software-mansion/starknet.py/issues) and [pull requests](https://github.com/software-mansion/starknet.py/pulls) to make sure that the feature/bug has not already been addressed, or is being worked upon.
> 2. Follow the provided template.
> 3. Provide as much detail as possible about the issue, including steps to reproduce the issue if applicable.
## Submitting Pull Requests
We welcome contributions to the ***starknet.py*** repository.
If you want to contribute a feature or fix a bug, please follow these steps:
> 1. Check the [issues](https://github.com/software-mansion/starknet.py/issues) and [pull requests](https://github.com/software-mansion/starknet.py/pulls) to make sure that the feature/bug has not already been addressed, or is being worked upon.
> 2. Fork the repository and create a new branch for your changes.
> 3. Make the changes in your fork, following the [development guidelines](https://starknetpy.readthedocs.io/en/latest/development.html).
> 4. ***Test your changes*** thoroughly to make sure they are working as expected.
> 5. ***Add documentation*** for your changes, if applicable.
> 6. Open a pull request with `development` as the base branch.
> 7. In the pull request description, explain the changes you have made and why they are necessary.
We will review the pull request and provide feedback.
Once the changes are approved, they will be merged into the `development` branch.
================================================
FILE: LICENSE.txt
================================================
MIT License
Copyright (c) 2021 Software Mansion
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
================================================
FILE: README.md
================================================
<div align="center">
<img src="https://raw.githubusercontent.com/software-mansion/starknet.py/master/graphic.png" alt="starknet.py"/>
</div>
<h2 align="center">Starknet SDK for Python</h2>
<div align="center">
[](https://codecov.io/gh/software-mansion/starknet.py)
[](https://pypi.org/project/starknet.py/)
[](https://github.com/software-mansion/starknet.py/actions)
[](https://starknetpy.readthedocs.io/en/latest/?badge=latest)
[](https://github.com/software-mansion/starknet.py/blob/master/LICENSE.txt)
[](https://github.com/software-mansion/starknet.py/stargazers)
[](https://starkware.co)
</div>
## 📘 Documentation
- [Installation](https://starknetpy.rtfd.io/en/latest/installation.html)
- [Quickstart](https://starknetpy.rtfd.io/en/latest/quickstart.html)
- [Guide](https://starknetpy.rtfd.io/en/latest/guide.html)
- [API](https://starknetpy.rtfd.io/en/latest/api.html)
- [Migration guide](https://starknetpy.readthedocs.io/en/latest/migration_guide.html)
## ⚙️ Installation
Installation varies between operating systems.
[See our documentation on complete instructions](https://starknetpy.rtfd.io/en/latest/installation.html)
## 💨 Quickstart
### Using FullNodeClient
A [Client](https://starknetpy.readthedocs.io/en/latest/api/client.html#client) is a facade for interacting with Starknet.
[FullNodeClient](https://starknetpy.readthedocs.io/en/latest/api/full_node_client.html#module-starknet_py.net.full_node_client) is a client which interacts with a Starknet full nodes like [Pathfinder](https://github.com/eqlabs/pathfinder), [Papyrus](https://github.com/starkware-libs/papyrus) or [Juno](https://github.com/NethermindEth/juno).
It supports read and write operations, like querying the blockchain state or adding new transactions.
```python
from starknet_py.net.full_node_client import FullNodeClient
node_url = "https://your.node.url"
client = FullNodeClient(node_url=node_url)
call_result = await client.get_block(block_number=1)
```
The default interface is asynchronous. Although it is the recommended way of using starknet.py, you can also use a synchronous version. It might be helpful to play with Starknet directly in python interpreter.
```python
node_url = "https://your.node.url"
client = FullNodeClient(node_url=node_url)
call_result = client.get_block_sync(block_number=1)
```
You can check out all of the FullNodeClient’s methods here: [FullNodeClient](https://starknetpy.readthedocs.io/en/latest/api/full_node_client.html#module-starknet_py.net.full_node_client).
### Creating Account
[Account](https://starknetpy.readthedocs.io/en/latest/api/account.html#starknet_py.net.account.account.Account) is the default implementation of [BaseAccount](https://starknetpy.readthedocs.io/en/latest/api/account.html#starknet_py.net.account.base_account.BaseAccount) interface.
It supports an account contract which proxies the calls to other contracts on Starknet.
Account can be created in two ways:
- By constructor (It is required to provide an `address` and either `key_pair` or `signer`).
- By static method `Account.deploy_account_v3`
Additionally, you can use the [sncast](https://foundry-rs.github.io/starknet-foundry/starknet/index.html) tool to create an account,
which will automatically be saved to a file.
There are some examples how to do it:
```python
from starknet_py.net.account.account import Account
from starknet_py.net.full_node_client import FullNodeClient
from starknet_py.net.models.chains import StarknetChainId
from starknet_py.net.signer.key_pair import KeyPair
from starknet_py.net.signer.stark_curve_signer import StarkCurveSigner
# Creates an instance of account which is already deployed
# Account using transaction version=1 (has __validate__ function)
client = FullNodeClient(node_url="https://your.node.url")
account = Account(
client=client,
address="0x4321",
key_pair=KeyPair(private_key=654, public_key=321),
chain=StarknetChainId.SEPOLIA,
)
# There is another way of creating key_pair
key_pair = KeyPair.from_private_key(key=123)
# or
key_pair = KeyPair.from_private_key(key="0x123")
# Instead of providing key_pair it is possible to specify a signer
signer = StarkCurveSigner("0x1234", key_pair, StarknetChainId.SEPOLIA)
account = Account(
client=client, address="0x1234", signer=signer, chain=StarknetChainId.SEPOLIA
)
```
### Using Account
Example usage:
```python
from starknet_py.contract import Contract
from starknet_py.net.client_models import ResourceBounds, ResourceBoundsMapping
resource_bounds = ResourceBoundsMapping(
l1_gas=ResourceBounds(max_amount=int(1e5), max_price_per_unit=int(1e13)),
l2_gas=ResourceBounds(max_amount=int(1e5), max_price_per_unit=int(1e13)),
l1_data_gas=ResourceBounds(max_amount=int(1e5), max_price_per_unit=int(1e13)),
)
# Declare and deploy an example contract which implements a simple k-v store.
# Contract.declare_v3 takes string containing a compiled contract (sierra) and
# a class hash (casm_class_hash) or string containing a compiled contract (casm)
declare_result = await Contract.declare_v3(
account,
compiled_contract=compiled_contract,
compiled_class_hash=class_hash,
resource_bounds=resource_bounds,
)
await declare_result.wait_for_acceptance()
deploy_result = await declare_result.deploy_v3(
resource_bounds=resource_bounds,
)
# Wait until deployment transaction is accepted
await deploy_result.wait_for_acceptance()
# Get deployed contract
map_contract = deploy_result.deployed_contract
k, v = 13, 4324
# Adds a transaction to mutate the state of k-v store. The call goes through account proxy, because we've used
# Account to create the contract object
await (
await map_contract.functions["put"].invoke_v3(
k,
v,
resource_bounds=resource_bounds,
)
).wait_for_acceptance()
# Retrieves the value, which is equal to 4324 in this case
(resp,) = await map_contract.functions["get"].call(k)
# There is a possibility of invoking the multicall
# Creates a list of prepared function calls
calls = [
map_contract.functions["put"].prepare_invoke_v3(key=10, value=20),
map_contract.functions["put"].prepare_invoke_v3(key=30, value=40),
]
# Executes only one transaction with prepared calls
transaction_response = await account.execute_v3(
calls=calls,
resource_bounds=resource_bounds,
)
await account.client.wait_for_tx(transaction_response.transaction_hash)
```
### Using Contract
[Contract](https://starknetpy.readthedocs.io/en/latest/api/contract.html#starknet_py.contract.Contract) makes interacting with contracts deployed on Starknet much easier:
```python
from starknet_py.contract import Contract
from starknet_py.net.client_models import ResourceBounds, ResourceBoundsMapping
contract_address = (
"0x01336fa7c870a7403aced14dda865b75f29113230ed84e3a661f7af70fe83e7b"
)
key = 1234
# Create contract from contract's address - Contract will download contract's ABI to know its interface.
contract = await Contract.from_address(address=contract_address, provider=account)
# If the ABI is known, create the contract directly (this is the preferred way).
contract = Contract(
address=contract_address,
abi=abi,
provider=account,
cairo_version=1,
)
# All exposed functions are available at contract.functions.
# Here we invoke a function, creating a new transaction.
resource_bounds = ResourceBoundsMapping(
l1_gas=ResourceBounds(max_amount=int(1e5), max_price_per_unit=int(1e13)),
l2_gas=ResourceBounds(max_amount=int(1e5), max_price_per_unit=int(1e13)),
l1_data_gas=ResourceBounds(max_amount=int(1e5), max_price_per_unit=int(1e13)),
)
invocation = await contract.functions["put"].invoke_v3(
key,
7,
resource_bounds=resource_bounds,
)
# Invocation returns InvokeResult object. It exposes a helper for waiting until transaction is accepted.
await invocation.wait_for_acceptance()
# Calling contract's function doesn't create a new transaction, you get the function's result.
(saved,) = await contract.functions["get"].call(key)
# saved = 7 now
```
To check if invoke succeeded use `wait_for_acceptance` on InvokeResult and get its status.
Although asynchronous API is recommended, you can also use Contract’s synchronous API:
```python
from starknet_py.contract import Contract
from starknet_py.net.client_models import ResourceBounds, ResourceBoundsMapping
contract_address = (
"0x01336fa7c870a7403aced14dda865b75f29113230ed84e3a661f7af70fe83e7b"
)
key = 1234
contract = Contract.from_address_sync(address=contract_address, provider=account)
resource_bounds = ResourceBoundsMapping(
l1_gas=ResourceBounds(max_amount=int(1e5), max_price_per_unit=int(1e13)),
l2_gas=ResourceBounds(max_amount=int(1e5), max_price_per_unit=int(1e13)),
l1_data_gas=ResourceBounds(max_amount=int(1e5), max_price_per_unit=int(1e13)),
)
invocation = contract.functions["put"].invoke_v3_sync(key, 7, resource_bounds=resource_bounds)
invocation.wait_for_acceptance_sync()
(saved,) = contract.functions["get"].call_sync(key) # 7
```
Contract automatically serializes values to Cairo calldata. This includes adding array lengths automatically.
See more info in [Serialization](https://starknetpy.readthedocs.io/en/latest/guide/serialization.html#serialization).
Quickstart in docs - click [here](https://starknetpy.rtfd.io/en/latest/quickstart.html).
================================================
FILE: circular.py
================================================
import importlib.util
import os
import shutil
import sys
import pytest
PACKAGE_NAME = "starknet_py"
def _import_from_path(module_name, file_path):
spec = importlib.util.spec_from_file_location(module_name, file_path)
module = importlib.util.module_from_spec(spec)
sys.modules[module_name] = module
spec.loader.exec_module(module)
def assert_no_circular_imports():
for path, _, files in os.walk(PACKAGE_NAME):
py_files = [f for f in files if f.endswith(".py")]
for file in py_files:
file_path = os.path.join(path, file)
relative_path = os.path.relpath(file_path, PACKAGE_NAME)
module_path_no_ext = relative_path.removesuffix(".py")
# Handle __init__.py files specially
if module_path_no_ext.endswith("__init__"):
module_path_no_init = module_path_no_ext.removesuffix(
"__init__"
).rstrip(os.sep)
# Top-level __init__.py gives empty module path
if not module_path_no_init:
module_name = PACKAGE_NAME
else:
dotted_module_path = module_path_no_init.replace(os.sep, ".")
module_name = f"{PACKAGE_NAME}.{dotted_module_path}"
else:
dotted_module_path = module_path_no_ext.replace(os.sep, ".")
module_name = f"{PACKAGE_NAME}.{dotted_module_path}"
_import_from_path(module_name, file_path)
def test_circular_imports_absent():
assert_no_circular_imports()
def _run_circular_import_test(module_name, import_a, import_b):
module_path = os.path.join(PACKAGE_NAME, module_name)
os.makedirs(module_path, exist_ok=True)
try:
with open(os.path.join(module_path, "__init__.py"), "w") as f:
f.write("")
with open(os.path.join(module_path, "file_a.py"), "w") as f:
f.write(f"{import_a}\nclass A:\n pass\n")
with open(os.path.join(module_path, "file_b.py"), "w") as f:
f.write(f"{import_b}\nclass B:\n pass\n")
error_regex = (
rf"(?:"
rf"cannot import name 'A' from '{PACKAGE_NAME}.{module_name}.file_a' \(.*{PACKAGE_NAME}[\\/]+{module_name}[\\/]+file_a\.py\)"
rf"|"
rf"cannot import name 'B' from '{PACKAGE_NAME}.{module_name}.file_b' \(.*{PACKAGE_NAME}[\\/]+{module_name}[\\/]+file_b\.py\)"
rf")"
)
with pytest.raises(ImportError, match=error_regex):
assert_no_circular_imports()
finally:
# Clean up temporary files
if os.path.exists(module_path):
shutil.rmtree(module_path)
sys.modules.pop(f"{PACKAGE_NAME}.{module_name}.file_a", None)
sys.modules.pop(f"{PACKAGE_NAME}.{module_name}.file_b", None)
sys.modules.pop(f"{PACKAGE_NAME}.{module_name}", None)
def test_circular_imports_present():
_run_circular_import_test(
"module_x",
f"from {PACKAGE_NAME}.module_x.file_b import B",
f"from {PACKAGE_NAME}.module_x.file_a import A",
)
def test_circular_imports_present_with_relative_imports():
# This test verifies that circular import detection works correctly when the problematic modules use
# relative imports (e.g., `from .file_b import B`) rather than
# absolute imports (e.g., `from starknet_py.module.file_b import B`),
# which was tested in the previous test case.
_run_circular_import_test(
"module_y",
"from .file_b import B",
"from .file_a import A",
)
================================================
FILE: docs/Makefile
================================================
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
================================================
FILE: docs/_ext/autoclass_with_examples.py
================================================
import re
from importlib import import_module
from typing import Any, Dict, List, Tuple
from docutils.nodes import Node
from sphinx.ext.autodoc.directive import AutodocDirective
from starknet_py.constants import ROOT_PATH
class AutoclassWithExamples(AutodocDirective):
"""
Custom extension of the AutodocDirective class, which is used to
add code examples to the method docstrings in the documentation.
This class runs before the AutodocDirective class and pulls code snippets
from the starknet_py/tests/e2e/docs/code_examples directory to include in the documentation.
This allows developers to easily see and understand how the methods
being documented are intended to be used in a practical context.
"""
def run(self) -> List[Node]:
# Gets the module by its path.
# Path is stored in the self.env.ref_context
module_name = self.env.ref_context.get("py:module")
module = import_module(module_name)
# Gets class from imported module
# Name of the class is passed as an argument
original_class = getattr(module, self.arguments[0])
add_code_examples(original_class)
self.name = self.name.replace("-with-examples", "") # remove `-with-examples`
return AutodocDirective.run(self)
def add_code_examples(original_class: Any):
"""
Adds code examples for the given class.
"""
file_name, file_content = _extract_file_properties(original_class.__name__)
for method_name, method in original_class.__dict__.items():
if not callable(method) and not isinstance(method, staticmethod):
continue
if isinstance(method, staticmethod):
method = method.__func__
stripped_method_name = method_name.strip("_")
if _code_example_exists(stripped_method_name, file_content):
hint = _create_hint(file_name, stripped_method_name)
_append_hint(method, original_class, hint)
def _extract_file_properties(class_name: str) -> Tuple[str, str]:
"""
Extracts file content for given class name.
:param class_name: A string representing the name of the class where examples will be added to.
:returns: A tuple containing the name of the file as a string, and its content as a string.
"""
file_name = "test_" + _camel_to_snake(class_name) + ".py"
file_path = ROOT_PATH / "tests/e2e/docs/code_examples" / file_name
return file_name, file_path.read_text("utf-8")
def _camel_to_snake(text: str) -> str:
"""
Transforms camelCase to the snake_case.
"""
return re.sub(r"(?<!^)(?=[A-Z])", "_", text).lower()
def _code_example_exists(method_name: str, file_content: str):
return f"test_{method_name}(" in file_content
def _create_hint(file_name: str, method_name: str) -> str:
"""
Constructs a hint with code example.
"""
return f"""
.. admonition:: Example
:class: hint
.. codesnippet:: ../../starknet_py/tests/e2e/docs/code_examples/{file_name}
:language: python
:start-after: docs-start: {method_name}
:end-before: docs-end: {method_name}
:dedent: 4
"""
def _append_hint(method: Any, class_: Any, hint: str) -> None:
"""
If method does not have the __doc__, takes it from the ancestor method.
"""
parent_method = method
while parent_method is not None and parent_method.__doc__ is None:
class_ = class_.__base__
parent_method = getattr(class_, method.__name__, None)
if parent_method is not None:
hint = (parent_method.__doc__ or "") + hint
method.__doc__ = hint
def setup(app) -> Dict[str, Any]:
app.add_directive("autoclass-with-examples", AutoclassWithExamples)
return {
"version": "0.1",
"parallel_read_safe": True,
"parallel_write_safe": True,
}
================================================
FILE: docs/_ext/codesnippet.py
================================================
import re
from typing import Any, Dict, List, Tuple
from docutils import nodes
from docutils.nodes import Element, Node
from docutils.parsers.rst import directives
from sphinx.directives import optional_int
from sphinx.directives.code import LiteralIncludeReader
from sphinx.util.docutils import SphinxDirective
from sphinx.util.typing import OptionSpec
def valid_code_snippet(code_snippet: List[str]) -> bool:
"""Check if code_snippet is non-empty"""
return len(code_snippet) > 0
class CodeSnippet(SphinxDirective):
"""
Directive class that allows multiple uses of :start-after: and :end-before: options
"""
default_start_marker = "docs: start"
default_end_marker = "docs: end"
has_content = False # No content, like a block of code, in the directive
required_arguments = 1 # Source file path is needed
optional_arguments = 0
final_argument_whitespace = True
option_spec: OptionSpec = {
"dedent": optional_int,
"language": directives.unchanged_required,
"start-after": directives.unchanged_required,
"end-before": directives.unchanged_required,
}
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.end_marker = None
self.location = None
self.filename = None
self.reader = None
def run(self) -> List[Node]:
self._set_options()
self._set_locals()
code_snippets = self._get_code_snippets()
return [self._make_node(code_snippets)]
def _get_code_snippets(self) -> List[str]:
lines = self.reader.read_file(self.filename, self.location)
result = []
while True:
code_snippet, lines = self._get_code_snippet(lines)
if not valid_code_snippet(code_snippet):
break
result.extend(code_snippet)
return result
def _get_code_snippet(self, lines: List[str]) -> Tuple[List[str], List[str]]:
"""Returns the first code snippet from lines and the rest of lines after that"""
try:
code_snippet_to_end = self._end_filter(lines)
lines = lines[len(code_snippet_to_end) :]
code_snippet_start_to_end = self._start_filter(code_snippet_to_end)
code_snippet = self.reader.dedent_filter(
code_snippet_start_to_end, self.location
)
except ValueError as err:
if "pattern not found" in str(err):
return [], []
raise err
return code_snippet, lines
def _end_filter(self, lines: List[str]) -> List[str]:
end = self.options["end-before"]
pattern = rf"(?<!\S){end}(?!\S)"
for lineno, line in enumerate(lines[1:], start=1):
if re.search(pattern, line):
return lines[:lineno]
raise ValueError(f"end-before pattern not found: {end}")
def _start_filter(self, lines: List[str]) -> List[str]:
start = self.options["start-after"]
pattern = rf"(?<!\S){start}(?!\S)"
for lineno, line in enumerate(lines):
if re.search(pattern, line):
self._fix_lineno_start(lineno)
return lines[lineno + 1 :]
raise ValueError(f"start-after pattern not found: {start}")
def _fix_lineno_start(self, lineno):
if "lineno-match" in self.options:
self.lineno_start += lineno + 1
def _set_options(self) -> None:
self.options["start-after"] = self.options.get(
"start-after", self.default_start_marker
)
self.options["end-before"] = self.options.get(
"end-before", self.default_end_marker
)
def _set_locals(self) -> None:
self.end_marker = self._get_end_marker()
self.location = self._get_location()
self.filename = self._get_filename()
self.reader = LiteralIncludeReader(self.filename, self.options, self.config)
def _get_end_marker(self) -> str:
return self.options["end-before"]
def _get_location(self) -> Tuple[str, int]:
return self.state_machine.get_source_and_line(self.lineno)
def _get_filename(self) -> str:
rel_filename, filename = self.env.relfn2path(self.arguments[0])
self.env.note_dependency(rel_filename)
return filename
def _make_node(self, code_snippets) -> Node:
text = "".join(code_snippets)
node: Element = nodes.literal_block(text, text, source=self.filename)
if "language" in self.options:
node["language"] = self.options["language"]
return node
def setup(app) -> Dict[str, Any]:
app.add_directive("codesnippet", CodeSnippet)
return {
"version": "0.1",
"parallel_read_safe": True,
"parallel_write_safe": True,
}
================================================
FILE: docs/_ext/test_autoclass_with_examples.py
================================================
from docs._ext.autoclass_with_examples import _append_hint
def test_docstring_inheritance():
class A:
def meth(self):
"""Docstring A"""
pass
class B(A):
def meth(self):
pass
class C(B):
def meth(self):
pass
class D(A):
pass
class E(D):
def meth(self):
pass
_append_hint(C.meth, C, " hint")
_append_hint(E.meth, E, " hint")
assert C.meth.__doc__ == "Docstring A hint"
assert E.meth.__doc__ == "Docstring A hint"
================================================
FILE: docs/_static/custom.css
================================================
@import '../furo.css'
.class {
margin: 40px 0;
}
dl.method {
margin: 40px 0;
}
dl.method .sig-object {
margin-bottom: 15px;
}
.sidebar-brand {
text-align: center;
}
.starknetpy-logo {
margin: 5% auto;
}
.get-started-cls {
text-align: center;
font-size: 2em;
outline: none;
cursor: pointer;
font-weight: 600;
border-radius: 3px;
padding: 12px 24px;
border: 0;
color: #3a4149;
background: var(--color-background-secondary);
line-height: 1.15;
:hover {
transition: all .1s ease;
box-shadow: 0 0 0 0 #fff, 0 0 0 3px #1de9b6;
}
}
.description-cls {
font-size: 1.5em;
text-align: center;
font-weight: 600;
margin-bottom: 1em;
margin-top: 0;
}
================================================
FILE: docs/_templates/page.html
================================================
{%- extends "!page.html" %}
{% block extrahead %}
{{ super() }}
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-MJZTCN3S');</script>
<!-- End Google Tag Manager -->
{% endblock %}
{% block body %}
{{ super() }}
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-MJZTCN3S"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
{% endblock %}
{% block footer %}
<div class="related-pages">
{% if next -%}
<a class="next-page" href="{{ next.link }}">
<div class="page-info">
<div class="context">
<span>{{ _("Next") }}</span>
</div>
<div class="title">{{ next.title }}</div>
</div>
<svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg>
</a>
{%- endif %}
{% if prev -%}
<a class="prev-page" href="{{ prev.link }}">
<svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg>
<div class="page-info">
<div class="context">
<span>{{ _("Previous") }}</span>
</div>
{% if prev.link == pathto(master_doc) %}
<div class="title">{{ _("Home") }}</div>
{% else %}
<div class="title">{{ prev.title }}</div>
{% endif %}
</div>
</a>
{%- endif %}
</div>
<div class="bottom-of-page">
<div class="left-details">
<div class="advert">
Looking for a Starknet consult or want us to implement a project?
Contact us on Twitter <a href="https://twitter.com/swmansionxyz">@swmansionxyz</a> or <a href="mailto:contact@swmansion.com">send us an email</a>!
</div>
{%- if show_copyright %}
<div class="copyright">
{%- if hasdoc('copyright') %}
{% trans path=pathto('copyright'), copyright=copyright|e -%}
<a href="{{ path }}">Copyright</a> © {{ copyright }}
{%- endtrans %}
{%- else %}
{% trans copyright=copyright|e -%}
Copyright © {{ copyright }}
{%- endtrans %}
{%- endif %}
</div>
{%- endif %}
{% trans %}Made with {% endtrans -%}
{%- if show_sphinx -%}
{% trans %}<a href="https://www.sphinx-doc.org/">Sphinx</a> and {% endtrans -%}
<a class="muted-link" href="https://pradyunsg.me">@pradyunsg</a>'s
{% endif -%}
{% trans %}
<a href="https://github.com/pradyunsg/furo">Furo</a>
{% endtrans %}
{%- if last_updated -%}
<div class="last-updated">
{% trans last_updated=last_updated|e -%}
Last updated on {{ last_updated }}
{%- endtrans -%}
</div>
{%- endif %}
</div>
</div>
{% endblock %}
================================================
FILE: docs/account_creation.rst
================================================
Account creation
================
An account is needed to start interacting with Starknet.
If you don't have one there are a few ways of creating one programmatically:
- using DeployAccount transaction
- deploy through Cairo syscall (another account is needed)
- using :ref:`Universal Deployer Contract <UDC paragraph>` (another account is needed)
The first approach is recommended since it doesn't rely on third-party contracts.
The concept behind the DeployAccount transaction is based on prefunding a generated address with tokens
and then creating the transaction which will charge the fee from the address.
Deploying an account with DeployAccount transaction requires the following:
- class_hash of the account contract
- private key and deployment salt
- computing an address based on the account's secrets
- prefunding an address with the fee tokens (e.g. using the token bridge)
- creating and signing a DeployAccount transaction with generated secrets
- sending the transaction to Starknet
Here is step by step example:
.. codesnippet:: ../starknet_py/tests/e2e/docs/account_creation/test_deploy_prefunded_account.py
:language: python
:dedent: 4
.. hint::
If you are experiencing transaction failures with ``FEE_TRANSFER_FAILURE``
make sure that the address you are trying to deploy is prefunded with enough
tokens, and verify that ``resource_bounds`` argument in :meth:`~starknet_py.net.account.account.Account.sign_deploy_account_v3` is set
to a high enough value.
================================================
FILE: docs/api/abi.rst
================================================
Abi
===
Module containing representation of contract abi and parser for creating it from parsed json.
.. py:module:: starknet_py.abi.v2
Parsing abi v2
--------------
.. autoclass:: AbiParser
:members: parse
.. autoclass:: AbiParsingError
:exclude-members: __init__, __new__
Model v2
--------
.. autoclass:: Abi
:exclude-members: __init__, __new__
:members: defined_structures, functions, constructor, l1_handler, events, defined_enums, interfaces, implementations
.. autoclass:: starknet_py.abi.v2.Abi.Function
:members:
:undoc-members:
:member-order: groupwise
.. autoclass:: starknet_py.abi.v2.Abi.Event
:members:
:undoc-members:
:member-order: groupwise
.. py:module:: starknet_py.abi.v1
Parsing abi v1
--------------
.. autoclass:: AbiParser
:members: parse
.. autoclass:: AbiParsingError
:exclude-members: __init__, __new__
Model v1
--------
.. autoclass:: Abi
:exclude-members: __init__, __new__
:members: defined_structures, functions, events, defined_enums
.. autoclass:: starknet_py.abi.v1.Abi.Function
:members:
:undoc-members:
:member-order: groupwise
.. autoclass:: starknet_py.abi.v1.Abi.Event
:members:
:undoc-members:
:member-order: groupwise
.. py:module:: starknet_py.abi.v0
Parsing abi v0
--------------
.. autoclass:: AbiParser
:members: parse
.. autoclass:: AbiParsingError
:exclude-members: __init__, __new__
Model v0
--------
.. autoclass:: Abi
:exclude-members: __init__, __new__
:members: defined_structures, functions, constructor, l1_handler, events
.. autoclass:: starknet_py.abi.v0.Abi.Function
:members:
:undoc-members:
:member-order: groupwise
.. autoclass:: starknet_py.abi.v0.Abi.Event
:members:
:undoc-members:
:member-order: groupwise
================================================
FILE: docs/api/account.rst
================================================
Account
=======
---------------------
BaseAccount interface
---------------------
.. py:module:: starknet_py.net.account.base_account
.. autoclass:: BaseAccount
:members:
:member-order: groupwise
----------------------------------
BaseAccount default implementation
----------------------------------
.. py:module:: starknet_py.net.account.account
.. autoclass-with-examples:: Account
:members:
:member-order: groupwise
------------------
Account deployment
------------------
Result of the Account deployment.
.. py:module:: starknet_py.net.account.account_deployment_result
.. autoclass:: AccountDeploymentResult
:exclude-members: __new__, __init__
:members: wait_for_acceptance, wait_for_acceptance_sync, account, hash, status, block_number
:member-order: groupwise
================================================
FILE: docs/api/cairo.rst
================================================
Cairo
=====
.. py:module:: starknet_py.cairo.felt
.. autofunction:: encode_shortstring
.. autofunction:: decode_shortstring
----------
TypeParser
----------
.. automodule:: starknet_py.cairo.type_parser
:members:
:member-order: bysource
================================================
FILE: docs/api/client.rst
================================================
Client
======
Base class for clients interacting with Starknet.
Implemented by :ref:`FullNodeClient`.
.. py:module:: starknet_py.net.client
.. autoclass:: Client
:members:
:member-order: groupwise
================================================
FILE: docs/api/client_errors.rst
================================================
Client errors
=============
.. py:module:: starknet_py.net.client_errors
.. autoclass:: ClientError
:exclude-members: __init__, __new__
.. autoclass:: ContractNotFoundError
:exclude-members: __init__, __new__
================================================
FILE: docs/api/client_models.rst
================================================
Client responses
================
.. automodule:: starknet_py.net.client_models
:members:
:member-order: groupwise
================================================
FILE: docs/api/contract.rst
================================================
Contract
========
.. py:module:: starknet_py.contract
.. autoclass-with-examples:: Contract
:members:
:member-order: groupwise
----------------
ContractFunction
----------------
.. autoclass-with-examples:: ContractFunction
:exclude-members: __init__, __new__
:members:
:member-order: groupwise
------------
ContractData
------------
.. autoclass:: ContractData
:exclude-members: __init__, __new__
:members:
:member-order: groupwise
--------------------
PreparedFunctionCall
--------------------
.. autoclass-with-examples:: PreparedFunctionCall
:exclude-members: __init__, __new__
:members:
:member-order: groupwise
------------------------
PreparedFunctionInvokeV3
------------------------
.. autoclass-with-examples:: PreparedFunctionInvokeV3
:exclude-members: __init__, __new__
:members:
:member-order: groupwise
------------
InvokeResult
------------
.. autoclass:: InvokeResult
:exclude-members: __init__, __new__
:members:
:member-order: groupwise
------------
DeployResult
------------
.. autoclass:: DeployResult
:exclude-members: __init__, __new__
:members:
:member-order: groupwise
-------------
DeclareResult
-------------
.. autoclass:: DeclareResult
:exclude-members: __init__, __new__
:members:
:member-order: groupwise
================================================
FILE: docs/api/contract_utils.rst
================================================
--------------------------
Contract utility functions
--------------------------
.. autofunction:: starknet_py.common.create_compiled_contract
.. autofunction:: starknet_py.common.create_sierra_compiled_contract
.. autofunction:: starknet_py.common.create_contract_class
.. autofunction:: starknet_py.common.create_casm_class
================================================
FILE: docs/api/data_types.rst
================================================
Data types
==========
Module containing representations of Cairo types. Mostly used to generate proper serializers.
.. py:module:: starknet_py.cairo.data_types
.. autoclass:: CairoType
:exclude-members: __init__, __new__
.. autoclass:: FeltType
:exclude-members: __init__, __new__
.. autoclass:: BoolType
:exclude-members: __init__, __new__
.. autoclass:: TupleType
:exclude-members: __init__, __new__
:members: types
.. autoclass:: NamedTupleType
:exclude-members: __init__, __new__
:members: types
.. autoclass:: ArrayType
:exclude-members: __init__, __new__
:members: inner_type
.. autoclass:: StructType
:exclude-members: __init__, __new__
:members: name, types
.. autoclass:: EnumType
:exclude-members: __init__, __new__
:members: name, variants
.. autoclass:: OptionType
:exclude-members: __init__, __new__
:members: type
.. autoclass:: UintType
:exclude-members: __init__, __new__
:members: bits
.. autoclass:: UnitType
:exclude-members: __init__, __new__
.. autoclass:: EventType
:exclude-members: __init__, __new__
:members: name, types, keys
.. autoclass:: NonZeroType
:exclude-members: __init__, __new__
:members: type
================================================
FILE: docs/api/devnet_client.rst
================================================
DevnetClient
============
.. py:module:: starknet_py.devnet_utils.devnet_client
.. autoclass-with-examples:: DevnetClient
:members:
:member-order: groupwise
================================================
FILE: docs/api/executable_models.rst
================================================
Models for executables
======================
.. automodule:: starknet_py.net.executable_models
:members:
:member-order: groupwise
================================================
FILE: docs/api/full_node_client.rst
================================================
FullNodeClient
==============
.. py:module:: starknet_py.net.full_node_client
.. autoclass-with-examples:: FullNodeClient
:members:
:member-order: groupwise
================================================
FILE: docs/api/hash.rst
================================================
Hash
====
------------------
Transaction hashes
------------------
.. automodule:: starknet_py.hash.transaction
:members:
:member-order: bysource
----------
Class hash
----------
.. automodule:: starknet_py.hash.class_hash
:members:
:member-order: bysource
-----------------
Sierra class hash
-----------------
.. automodule:: starknet_py.hash.sierra_class_hash
:members:
:member-order: bysource
---------------
Casm class hash
---------------
.. automodule:: starknet_py.hash.casm_class_hash
:members:
:member-order: bysource
-------
Address
-------
.. automodule:: starknet_py.hash.address
:members:
:member-order: bysource
--------
Selector
--------
.. automodule:: starknet_py.hash.selector
:members:
:member-order: bysource
-------
Storage
-------
.. automodule:: starknet_py.hash.storage
:members:
:member-order: bysource
-------------
Pedersen hash
-------------
.. autofunction:: starknet_py.hash.utils.pedersen_hash
--------------------
Private to stark key
--------------------
.. autofunction:: starknet_py.hash.utils.private_to_stark_key
-----------------
Message signature
-----------------
.. autofunction:: starknet_py.hash.utils.message_signature
------------------------
Verify message signature
------------------------
.. autofunction:: starknet_py.hash.utils.verify_message_signature
================================================
FILE: docs/api/models.rst
================================================
Models
======
Module containing base models and functions to operate on them.
.. py:module:: starknet_py.net.models
.. autoclass:: Transaction
:exclude-members: __init__
:members:
.. autoclass:: AccountTransaction
:exclude-members: __init__, __new__
:members:
.. autoclass:: DeployAccountV1
:exclude-members: __init__, __new__
.. autoclass:: DeployAccountV3
:exclude-members: __init__, __new__
.. autoclass:: DeclareV2
:exclude-members: __init__, __new__
.. autoclass:: DeclareV3
:exclude-members: __init__, __new__
.. autoclass:: InvokeV1
:exclude-members: __init__, __new__
.. autoclass:: InvokeV3
:exclude-members: __init__, __new__
.. autoenum:: StarknetChainId
:members:
================================================
FILE: docs/api/proxy_resolvers.rst
================================================
Proxy Resolvers
===============
.. py:module:: starknet_py.proxy.proxy_check
ProxyCheck
----------
.. autoclass:: ProxyCheck
:members:
.. py:module:: starknet_py.proxy.contract_abi_resolver
ProxyConfig
-----------
.. autoclass:: ProxyConfig
:members:
ContractAbiResolver
-------------------
.. autoclass:: ContractAbiResolver
:members:
Errors
------
.. autoclass:: AbiNotFoundError
:exclude-members: __init__, __new__
.. autoclass:: ProxyResolutionError
:exclude-members: __init__, __new__
================================================
FILE: docs/api/serializers.rst
================================================
Serializers
===========
.. py:module:: starknet_py.serialization
Containers
----------
.. autoclass:: TupleDataclass
:exclude-members: __init__, __new__
:members: as_tuple, as_dict
Factory functions
-----------------
.. autofunction:: serializer_for_function
.. autofunction:: serializer_for_event
.. autofunction:: serializer_for_type
.. autofunction:: serializer_for_payload
Specific serializers
--------------------
.. autoclass:: CairoDataSerializer
:exclude-members: __init__, __new__
:members: serialize, deserialize
.. autoclass:: FeltSerializer
:exclude-members: __init__, __new__
.. autoclass:: ArraySerializer
:exclude-members: __init__, __new__
.. autoclass:: NamedTupleSerializer
:exclude-members: __init__, __new__
.. autoclass:: StructSerializer
:exclude-members: __init__, __new__
.. autoclass:: TupleSerializer
:exclude-members: __init__, __new__
.. autoclass:: Uint256Serializer
:exclude-members: __init__, __new__
.. autoclass:: PayloadSerializer
:exclude-members: __init__, __new__
:members: serialize, deserialize
.. autoclass:: FunctionSerializationAdapter
:exclude-members: __init__, __new__
:members: serialize
Exceptions
----------
.. autoclass:: CairoSerializerException
:exclude-members: __init__, __new__
.. autoclass:: InvalidTypeException
:exclude-members: __init__, __new__
.. autoclass:: InvalidValueException
:exclude-members: __init__, __new__
================================================
FILE: docs/api/signer.rst
================================================
Signer
======
--------------------
BaseSigner interface
--------------------
.. py:module:: starknet_py.net.signer
.. autoclass:: BaseSigner
:members:
:member-order: groupwise
---------------------------------
BaseSigner default implementation
---------------------------------
By default, starknet.py uses ``StarkCurveSigner`` which works with OpenZeppelin's account contract.
.. py:module:: starknet_py.net.signer.stark_curve_signer
.. autoclass:: StarkCurveSigner
:members:
:member-order: groupwise
-------
KeyPair
-------
.. autoclass:: KeyPair
:members:
:undoc-members:
:member-order: groupwise
.. warning::
**Not Audited:** The ``KeyPair.generate()`` function has not been audited for cryptographic security. Use at your own risk.
------------
LedgerSigner
------------
To use LedgerSigner, you need to install starknetpy with ``ledger`` extra like this:
.. code-block:: bash
poetry add starknet_py[ledger]
Under a Debian or Ubuntu based system, you will need to install additional packages:
.. code-block:: bash
sudo apt install python3-dev libusb-1.0-0-dev libudev-dev
They are needed for compiling HIDAPI. Read official `ledgerctl installation guide <https://github.com/LedgerHQ/ledgerctl?tab=readme-ov-file#quick-install)>`_ for more details.
.. py:module:: starknet_py.net.signer.ledger_signer
.. autoclass:: LedgerSigner
:members:
:member-order: groupwise
-----------------
LedgerSigningMode
-----------------
.. autoclass:: LedgerSigningMode
:members:
:member-order: groupwise
---------
EthSigner
---------
Signer compatible with the Ethereum signature.
.. py:module:: starknet_py.net.signer.eth_signer
.. autoclass:: EthSigner
:members:
:member-order: groupwise
================================================
FILE: docs/api/tip.rst
================================================
Tip
===
.. automodule:: starknet_py.net.tip
:members:
:member-order: bysource
================================================
FILE: docs/api/transaction_errors.rst
================================================
Transaction errors
==================
.. py:module:: starknet_py.transaction_errors
.. autoclass:: TransactionFailedError
:exclude-members: __init__, __new__
.. autoclass:: TransactionRevertedError
:exclude-members: __init__, __new__
.. autoclass:: TransactionNotReceivedError
:exclude-members: __init__, __new__
================================================
FILE: docs/api/typed_data.rst
================================================
TypedData
=========
.. autoclass:: starknet_py.utils.typed_data.TypedData
:members:
:undoc-members:
:exclude-members: __init__
:member-order: bysource
---------
Parameter
---------
.. autoclass:: starknet_py.utils.typed_data.Parameter
:members:
:undoc-members:
:exclude-members: __init__
:member-order: bysource
-------------------
StandardParameter
-------------------
.. autoclass:: starknet_py.utils.typed_data.StandardParameter
:members:
:undoc-members:
:exclude-members: __init__
:member-order: bysource
-------------------
EnumParameter
-------------------
.. autoclass:: starknet_py.utils.typed_data.EnumParameter
:members:
:undoc-members:
:exclude-members: __init__
:member-order: bysource
-------------------
MerkleTreeParameter
-------------------
.. autoclass:: starknet_py.utils.typed_data.MerkleTreeParameter
:members:
:undoc-members:
:exclude-members: __init__
:member-order: bysource
--------------
Domain
--------------
.. autoclass:: starknet_py.utils.typed_data.Domain
:members:
:undoc-members:
:exclude-members: __init__
:member-order: bysource
---------
BasicType
---------
.. autoclass:: starknet_py.utils.typed_data.BasicType
:members:
:undoc-members:
:exclude-members: __init__
:member-order: bysource
----------
PresetType
----------
.. autoclass:: starknet_py.utils.typed_data.PresetType
:members:
:undoc-members:
:exclude-members: __init__
:member-order: bysource
================================================
FILE: docs/api/udc_deployer.rst
================================================
Deployer
========
.. py:module:: starknet_py.net.udc_deployer.deployer
.. autoclass-with-examples:: Deployer
:members:
.. autoclass:: ContractDeployment
:exclude-members: __init__, __new__
:members:
================================================
FILE: docs/api/websocket_client.rst
================================================
WebsocketClient
===============
.. py:module:: starknet_py.net.websockets.websocket_client
.. autoclass-with-examples:: WebsocketClient
:members:
:member-order: groupwise
================================================
FILE: docs/api.rst
================================================
API
===
.. toctree::
api/client
api/full_node_client
api/devnet_client
api/account
api/client_models
api/executable_models
api/client_errors
api/transaction_errors
api/contract
api/contract_utils
api/udc_deployer
api/hash
api/signer
api/models
api/abi
api/data_types
api/cairo
api/serializers
api/proxy_resolvers
api/typed_data
api/websocket_client
api/tip
================================================
FILE: docs/conf.py
================================================
# pylint: skip-file
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
sys.path.insert(0, os.path.abspath("."))
sys.path.insert(0, os.path.abspath("../"))
sys.path.insert(1, os.path.dirname(os.path.abspath("../")) + os.sep + "starknet")
sys.path.append(os.path.abspath("./_ext"))
# -- Project information -----------------------------------------------------
project = "starknet.py"
copyright = "2026, Software Mansion"
author = "Software Mansion"
# -- General configuration ---------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
needs_extensions = {"enum_tools.autoenum": "0.9.0"}
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.autosectionlabel",
"enum_tools.autoenum",
"codesnippet",
"autoclass_with_examples",
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
# Add note about documentation from development branch
if os.environ.get("READTHEDOCS_VERSION") == "development":
rst_prolog = """.. attention::
This page was created from `development <https://github.com/software-mansion/starknet.py>`_ branch.
"""
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "furo"
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]
html_css_files = ["custom.css"]
autodoc_class_signature = "separated"
autodoc_default_options = {"exclude-members": "__new__"}
pygments_dark_style = "dracula"
html_favicon = "_static/favicon.png"
html_title = "starknet.py Documentation"
html_short_title = "starknet.py"
html_permalinks_icon = "#"
html_theme_options = {
"light_logo": "logo.png",
"dark_logo": "logo-contour-white.png",
}
================================================
FILE: docs/development.rst
================================================
Development
===========
This page describes how to setup development environment. You don't need to follow the instructions if you just use starknet.py
as a package.
Development dependencies
------------------------
- `poetry <https://python-poetry.org/>`_ - dependency manager.
- `pyenv <https://github.com/pyenv/pyenv>`_ - recommended for installing and switching python versions locally.
- `cairo-lang <https://pypi.org/project/cairo-lang/>`_ - required to compile contracts (`poe compile_contracts`)
- `asdf <https://asdf-vm.com/>`_ - required to install `scarb`, that is used for contracts compilation (`poe compile_contracts`)
Setup
-----
Starknet devnet
^^^^^^^^^^^^^^^
To install `starknet-devnet-rs <https://github.com/0xSpaceShard/starknet-devnet-rs>`_ run the script ``./starknet_py/tests/install_devnet.sh``.
Environment variables
^^^^^^^^^^^^^^^^^^^^^
In order to be able to run tests on testnet network (``starknet_py/tests/e2e/tests_on_networks/``), you must set some environmental variables:
- ``SEPOLIA_RPC_URL``
- ``SEPOLIA_ACCOUNT_PRIVATE_KEY``
- ``SEPOLIA_ACCOUNT_ADDRESS``
The best way to set environment variables 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.
Dependencies
^^^^^^^^^^^^
.. code-block:: bash
poetry install -E ledger
Contracts
^^^^^^^^^
.. code-block:: bash
poe compile_contracts
Git hooks
---------
Run this snippet to enable lint checks and automatic formatting before commit/push.
.. code-block:: bash
cp pre-push ./.git/hooks/
cp pre-commit ./.git/hooks/
chmod +x ./.git/hooks/pre-commit
chmod +x ./.git/hooks/pre-push
Documentation
-------------
`Sphinx <https://www.sphinx-doc.org/en/master/>`_ is used for generating documentation.
.. code-block:: bash
# Install additional dependencies for docs
poetry install -E ledger -E docs
# Generate HTML documentation
poe docs_create
# Open generated HTML documentation
poe docs_open
Tests
-----
.. code-block:: bash
# Run whole suite
poe test
# Run only tests on networks
poe test_ci_on_networks
# Run unit tests and tests on devnet
poe test_ci
# Generate test report in terminal
poe test_report
# Generate HTML report and open it in the browser
poe test_html
Code style guide
----------------
Rules to follow when writing a code:
1. Check the code with pylint
.. code-block:: bash
poe lint
2. Format the code with black
.. code-block:: bash
poe format
3. Run a typechecker (pyright)
.. code-block:: bash
poe typecheck
4. Add constant values to the constants.py file.
5. Prefer keyword-only arguments where appropriate.
6. All public classes providing async api should be marked with the `@add_sync_methods` decorator.
7. Error messages should start with a capital letter.
8. Use `Argument x is...` instead of `X is...` when error message starts with argument (property) name.
9. All sentences (in docstrings/errors) should be ended with a period.
10. When adding a TODO comment, it must have a corresponding issue to it. The format for the comment is: ``# TODO (#issue no.): ...``.
Release checklist
-------------------
Perform these actions before releasing a new starknet.py version
1. Bump package version in ``pyproject.toml``
2. Re-lock using ``poetry lock``
3. Make a PR to development with name of format ``vMAJOR.MINOR.PATCHES-alpha`` and merge it making sure that the merge commit message is the same as PR name
4. Merge development into master without squashing
.. code-block:: bash
git checkout master
git merge development
5. Make a new release on GitHub
================================================
FILE: docs/devnet_utils/mocking_interaction_with_l1.rst
================================================
Mocking interaction with L1
===========================
Abstract
--------
In order to test interaction with L1 contracts, devnet client provides a way to mock the L1 interaction.
Before taking a look at the examples, please get familiar with the `devnet postman docs <https://0xspaceshard.github.io/starknet-devnet-rs/docs/postman>`_ and messaging mechanism:
- `Writing messaging contracts <https://book.cairo-lang.org/ch16-04-L1-L2-messaging.html>`_
- `Mechanism overview <https://docs.starknet.io/architecture-and-concepts/network-architecture/messaging-mechanism/>`_
- `StarkGate example <https://docs.starknet.io/architecture-and-concepts/network-architecture/messaging-mechanism/>`_
L1 network setup
----------------
First of all you should deploy `messaging contract <https://github.com/0xSpaceShard/starknet-devnet-rs/blob/138120b355c44ae60269167b326d1a267f7af0a8/contracts/l1-l2-messaging/solidity/src/MockStarknetMessaging.sol>`_
on ethereum network or load the existing one.
.. codesnippet:: ../../starknet_py/tests/e2e/docs/devnet_utils/test_l1_integration.py
:language: python
:dedent: 4
L2 -> L1
--------
Deploying L2 interaction contract
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Interaction with L1 is done by sending a message using `send_message_to_l1_syscall` function.
So in order to test it, you need to deploy a contract that has this functionality.
Example contract: `l1_l2.cairo <https://github.com/0xSpaceShard/starknet-devnet-js/blob/5069ec3397f31a408d3df2734ae40d93b42a0f7f/test/data/l1_l2.cairo>`_
.. codesnippet:: ../../starknet_py/tests/e2e/docs/devnet_utils/test_l1_integration.py
:language: python
:dedent: 4
:start-after: docs: messaging-contract-start
:end-before: docs: messaging-contract-end
Consuming message
^^^^^^^^^^^^^^^^^
After deploying the contract, you need to flush the messages to the L1 network.
And then you can consume the message on the L1 network.
.. codesnippet:: ../../starknet_py/tests/e2e/docs/devnet_utils/test_l1_integration.py
:language: python
:dedent: 4
:start-after: docs: flush-1-start
:end-before: docs: flush-1-end
L1 -> L2
--------
Sending mock transactions from L1 to L2 does not require L1 node to be running.
.. codesnippet:: ../../starknet_py/tests/e2e/docs/devnet_utils/test_l1_integration.py
:language: python
:dedent: 4
:start-after: docs: send-l2-start
:end-before: docs: send-l2-end
================================================
FILE: docs/devnet_utils.rst
================================================
Devnet Utils
============
.. toctree::
devnet_utils/mocking_interaction_with_l1
================================================
FILE: docs/guide/account_and_client.rst
================================================
Account and Client
==================
Executing transactions
----------------------
To execute transactions on Starknet, use :meth:`~starknet_py.net.account.account.Account.execute_v3` method from :ref:`Account` interface, which will send :class:`~starknet_py.net.models.InvokeV3` transaction.
.. codesnippet:: ../../starknet_py/tests/e2e/docs/guide/test_executing_transactions.py
:language: python
:dedent: 4
Transaction Fee
---------------
All methods within the :ref:`Account` that involve on-chain modifications require either specifying a maximum transaction fee or using auto estimation.
For V3 transaction, the fee is expressed in Fri and is determined by the ``resource_bounds`` parameter.
To enable auto estimation, set the ``auto_estimate`` parameter to ``True``.
.. code-block:: python
resp = await account.execute_v3(calls=call, auto_estimate=True)
.. warning::
It is strongly discouraged to use automatic fee estimation in production code as it may lead to an unexpectedly high fee.
The returned estimated fee (``max_amount`` and ``max_price_per_unit``) is multiplied by ``1.5`` to mitigate fluctuations in price.
.. note::
It is possible to configure the value by which the estimated fee is multiplied,
by changing ``ESTIMATED_AMOUNT_MULTIPLIER`` and ``ESTIMATED_UNIT_PRICE_MULTIPLIER`` in :class:`~starknet_py.net.account.account.Account`.
The fee for a specific transaction or list of transactions can be also estimated using the :meth:`~starknet_py.net.account.account.Account.estimate_fee` of the :ref:`Account` class.
Transaction Tip
---------------
Until Starknet 0.14.0, transactions were processed in FIFO order.
Starting from this version, it is possible to include a *tip* with the transaction fee to incentivize it being placed in an earlier block.
Starknet.py supports this mechanism in several interfaces.
.. code-block:: python
resp = await account.execute_v3(calls=call, tip=12345)
Creating transactions without executing them
--------------------------------------------
Account also provides a way of creating signed transaction without sending them.
.. codesnippet:: ../../starknet_py/tests/e2e/docs/guide/test_account_sign_without_execute.py
:language: python
:dedent: 4
Outside execution
-----------------
Outside execution allows a protocol to submit a transaction on behalf of another account. This feature is implemented according to `SNIP-9 <https://github.com/starknet-io/SNIPs/blob/main/SNIPS/snip-9.md>`_.
Account also provides a way of signing transaction which later can be execute by another account. Signer does not need to be funded with tokens as executor will pay the fee.
.. codesnippet:: ../../starknet_py/tests/e2e/docs/guide/test_account_sign_outside_transaction.py
:language: python
:dedent: 4
Multicall
---------
There is a possibility to execute an Invoke transaction containing multiple calls.
Simply pass a list of calls to :meth:`~starknet_py.net.account.account.Account.execute_v3` method.
Note that the nonce will be bumped only by 1.
.. codesnippet:: ../../starknet_py/tests/e2e/docs/guide/test_multicall.py
:language: python
:dedent: 4
.. note::
If you want to create a **read-only** multicall that does not change on-chain state, check out `this cairo contract made by Argent <https://github.com/argentlabs/argent-contracts-starknet/blob/d2e4365ff1005e03c5575b5a0db48060096cf391/contracts/lib/Multicall.cairo>`_, that implements an endpoint allowing for such behaviour.
.. warning::
Do not pass arbitrarily large number of calls in one batch. Starknet rejects the transaction when it happens.
FullNodeClient usage
--------------------
Use a :ref:`FullNodeClient` to interact with services providing `Starknet RPC interface <https://github.com/starkware-libs/starknet-specs/blob/606c21e06be92ea1543fd0134b7f98df622c2fbf/api/starknet_api_openrpc.json>`_
like `Pathfinder <https://github.com/eqlabs/pathfinder>`_,
`Papyrus <https://github.com/starkware-libs/papyrus>`_, `Juno <https://github.com/NethermindEth/juno>`_
or `starknet-devnet <https://github.com/0xSpaceShard/starknet-devnet>`_.
Using own full node allows for querying Starknet with better performance.
.. codesnippet:: ../../starknet_py/tests/e2e/docs/guide/test_full_node_client.py
:language: python
:dedent: 4
Handling client errors
-----------------------
You can use :class:`starknet_py.net.client_errors.ClientError` to catch errors from invalid requests:
.. codesnippet:: ../../starknet_py/tests/e2e/docs/guide/test_handling_client_errors.py
:language: python
:dedent: 4
Custom nonce logic
------------------
By default, :ref:`Account` calls Starknet for nonce every time a new transaction is signed or executed.
This is okay for most users, but in case your application needs to pre-sign multiple transactions
for execution, deals with high amount of transactions or just needs to support different nonce
logic, it is possible to do so with :ref:`Account`. Simply overwrite the
:meth:`~starknet_py.net.account.account.Account.get_nonce` method with your own logic.
.. codesnippet:: ../../starknet_py/tests/e2e/docs/guide/test_custom_nonce.py
:language: python
:dedent: 4
================================================
FILE: docs/guide/deploying_contracts.rst
================================================
Deploying contracts
===================
Declaring contracts
-------------------
Contracts written in Cairo 0 cannot be declared while those written in Cairo 1 or higher should be declared with transaction version 3.
To sign a declare transaction, you should utilize :meth:`~starknet_py.net.account.account.Account.sign_declare_v3` method.
Here's an example how to use it.
.. codesnippet:: ../../starknet_py/tests/e2e/docs/guide/test_declaring_contracts.py
:language: python
:dedent: 4
Simple deploy
-------------
If you know the class hash of an already declared contract you want to deploy just use the :meth:`~starknet_py.contract.Contract.deploy_contract_v3`.
It will deploy the contract using funds from your account. Deployment is handled by UDC.
.. codesnippet:: ../../starknet_py/tests/e2e/docs/guide/test_simple_deploy.py
:language: python
:dedent: 4
.. _UDC paragraph:
Using Universal Deployer Contract (UDC)
---------------------------------------
Using UDC is a way of deploying contracts if you already have an account. starknet.py assumes that UDC uses an implementation compatible
with `OpenZeppelin's UDC implementation <https://github.com/OpenZeppelin/cairo-contracts/blob/main/src/openzeppelin/utils/presets/UniversalDeployer.cairo>`_.
There is a class responsible for the deployment (:ref:`Deployer<Deployer>`).
Short code example of how to use it:
.. codesnippet:: ../../starknet_py/tests/e2e/docs/guide/test_deploying_with_udc.py
:language: python
:dedent: 4
Deploying and using deployed contract in the same transaction
#############################################################
:ref:`Deployer` is designed to work with multicalls too. It allows to deploy a contract
and call its methods in the same multicall, ensuring atomicity of all operations combined.
.. codesnippet:: ../../starknet_py/tests/e2e/docs/guide/test_deploying_in_multicall.py
:language: python
:dedent: 4
Cairo1 contracts
----------------
Declaring Cairo1 contracts
##########################
To declare a contract in Cairo version 1 or higher, Declare V3 transaction has to be sent.
You can see the structure of these transactions `here <https://docs.starknet.io/documentation/architecture_and_concepts/Network_Architecture/transactions/#declare-transaction>`_.
The main differences in the structure of the transaction from its previous version are:
- ``contract_class`` field is a ``SierraContractClass``
- ``compiled_class_hash`` is the hash obtained from ``CasmClass`` using ``starknet_py.hash.compute_casm_class_hash``
The ``SierraContractClass`` in its ``json`` format can be obtained through the compiler in `Cairo1 repo <https://github.com/starkware-libs/cairo>`_.
The command used to get the class is ``starknet-compile``.
To get ``compiled_class_hash``, ``CasmClass`` will be needed. It can be obtained in a similar way to ``SierraContractClass``.
Simply pluck the ``json`` result of ``starknet-compile`` into ``starknet-sierra-compile`` from the Cairo1 repository.
.. note::
The compilation to Cairo Assembly should use the ``--add-pythonic-hints`` flag.
Here's an example how to declare a Cairo1 contract.
.. codesnippet:: ../../starknet_py/tests/e2e/docs/guide/test_cairo1_contract.py
:language: python
:dedent: 4
Deploying Cairo1 contracts
##########################
After declaring a Cairo1 contract, it can be deployed using UDC.
.. codesnippet:: ../../starknet_py/tests/e2e/docs/guide/test_cairo1_contract.py
:language: python
:dedent: 4
:start-after: docs-deploy: start
:end-before: docs-deploy: end
Simple declare and deploy Cairo1 contract example
#################################################
.. codesnippet:: ../../starknet_py/tests/e2e/docs/guide/test_simple_declare_and_deploy_cairo1.py
:language: python
:dedent: 4
:start-after: docs: start
:end-before: docs: end
Simple deploy Cairo1 contract example
#####################################
.. codesnippet:: ../../starknet_py/tests/e2e/docs/guide/test_simple_deploy_cairo1.py
:language: python
:dedent: 4
:start-after: docs: start
:end-before: docs: end
================================================
FILE: docs/guide/generating_key_pair.rst
================================================
Generating a Key pair
=====================
Key pair
--------
The Key pair is a pair of private and public keys. The private key is used to sign transactions, and the public key is used to verify the signature.
In the starknet.py you need to use the :class:`~starknet_py.net.signer.key_pair.KeyPair` class to be able to create an :class:`~starknet_py.net.account.account.Account` and :class:`~starknet_py.net.signer.stark_curve_signer.StarkCurveSigner` object.
Generating random key pair
--------------------------
Method :meth:`~starknet_py.net.signer.stark_curve_signer.KeyPair.generate` allows to generate cryptographically strong pseudo-random numbers
suitable for managing secrets such as account authentication, tokens, and similar.
.. codesnippet:: ../../starknet_py/tests/e2e/docs/guide/test_key_pair.py
:language: python
:dedent: 4
:start-after: docs-generate: start
:end-before: docs-generate: end
.. warning::
**Not Audited:** The ``KeyPair.generate()`` function has not been audited for cryptographic security. Use at your own risk.
Creating key pair from private Key
----------------------------------
To create a key pair from a private key, use the :meth:`~starknet_py.net.signer.stark_curve_signer.KeyPair.from_private_key` method.
.. codesnippet:: ../../starknet_py/tests/e2e/docs/guide/test_key_pair.py
:language: python
:dedent: 4
:start-after: docs-from-private-key: start
:end-before: docs-from-private-key: end
Reading key pair from keystore file
-----------------------------------
Using :meth:`~starknet_py.net.signer.stark_curve_signer.KeyPair.from_keystore` method there is possibility to import a key pair from a keystore file.
The keystore file should follow the `Ethereum keystore <https://ethereum.org/en/developers/docs/data-structures-and-encoding/web3-secret-storage/>`_ format.
.. codesnippet:: ../../starknet_py/tests/e2e/docs/guide/test_key_pair.py
:language: python
:dedent: 4
:start-after: docs-from-keystore: start
:end-before: docs-from-keystore: end
================================================
FILE: docs/guide/resolving_proxy_contracts.rst
================================================
Resolving proxy contracts
=========================
.. note::
If you know the abi of the contract, **always prefer** creating Contract directly from constructor.
:meth:`Contract.from_address <starknet_py.contract.Contract.from_address>` must perform some calls to Starknet to get an abi of the contract.
Resolving proxies is a powerful feature of starknet.py. If your contract is a proxy to some implementation, you can use
high-level :meth:`Contract.from_address <starknet_py.contract.Contract.from_address>` method to get a contract instance.
:meth:`Contract.from_address <starknet_py.contract.Contract.from_address>` works with contracts which are not proxies, so it is the most universal method of getting
a contract not knowing the abi.
.. codesnippet:: ../../starknet_py/tests/e2e/docs/guide/test_resolving_proxies.py
:language: python
:dedent: 4
:start-after: docs-1: start
:end-before: docs-1: end
ProxyChecks
-----------
Since the Proxy contracts on Starknet can have different implementations, as every user can define their custom implementation, there is no single way of checking if some contract is a Proxy contract.
There are two main ways of proxying a contract on Starknet:
- forward the calls using ``library_call`` and ``class_hash`` of proxied contract
- forward the calls using ``delegate_call`` and ``address`` of proxied contract
:meth:`Contract.from_address <starknet_py.contract.Contract.from_address>` uses ``proxy_checks`` to fetch the ``implementation`` (address or class hash) of the proxied contract.
**ProxyCheck** checks whether the contract is a Proxy contract.
It does that by trying to get the ``address`` or ``class_hash`` of the implementation.
By default, ``proxy_config`` uses a configuration with two **ProxyChecks**:
- ArgentProxyCheck - resolves `Argent Proxy <https://github.com/argentlabs/argent-contracts-starknet/blob/b7c4af7462a461386d29551400b985832ba942de/contracts/upgrade/Proxy.cairo>`_.
- OpenZeppelinProxyCheck - resolves `OpenZeppelin Proxy <https://github.com/OpenZeppelin/cairo-contracts/blob/d12abf335f5c778fd19d6f99e91c099b40865deb/src/openzeppelin/upgrades/presets/Proxy.cairo>`_.
.. warning::
``StarknetEthProxyCheck`` has been removed, because the StarkGate ETH Token was upgraded to Cairo 2, meaning it isn't a Proxy anymore. Currently, all StarkGate's Token contracts use interface of ERC20 to interact.
It's possible to define own ProxyCheck implementation and later pass it to :meth:`Contract.from_address <starknet_py.contract.Contract.from_address>`, so it knows how to resolve the Proxy.
The **ProxyCheck** base class implements the following interface:
.. codesnippet:: ../../starknet_py/proxy/proxy_check.py
:language: python
:start-after: docs-proxy-check: start
:end-before: docs-proxy-check: end
It has two methods:
- `implementation_address` - returns the `address` of the proxied contract (implement this if your Proxy contract uses the `address` of another contract as `implementation`)
- `implementation_hash` - returns the `class_hash` of the proxied contract (implement this if your Proxy contract uses the `class_hash` of another contract as `implementation`)
Here is the complete example:
.. codesnippet:: ../../starknet_py/tests/e2e/docs/guide/test_resolving_proxies.py
:language: python
:dedent: 4
:start-after: docs-2: start
:end-before: docs-2: end
================================================
FILE: docs/guide/serialization.rst
================================================
Serialization
=============
Data serialization
-------------------
starknet.py **serializes** python values to Cairo values and **deserializes** Cairo values to python values.
.. attention::
Serializing short strings to felts has been deprecated. Please use `starknet_py.cairo.felt.encode_shortstring` to
create numeric value from string **before** passing value to serializer.
.. list-table:: Serialization from python to Cairo
:widths: 25 25 25 25
:header-rows: 1
* - Expected Cairo type
- Accepted python types
- Example python values
- Comment
* - felt
- int
- ``0``, ``1``, ``1213124124``
- Provided int must be in range [0;P) - P being the Prime used in cairo-vm.
* - tuple
- any iterable of matching size
- ``(1, 2, (9, 8))``, ``[1, 2, (9, 8)]``, ``(v for v in [1, 2, (9, 8)])``
- Can nest other types apart from pointers
* - named tuple
- dict or NamedTuple or :obj:`TupleDataclass <starknet_py.serialization.TupleDataclass>`
- ``{"a": 1, "b": 2, "c" : (3, 4)}``, ``NamedTuple("name", [("a", int), ("b", int), ("c", tuple)])(1, 2, (3, 4))``
-
* - struct
- dict with keys matching struct
- ``{"key_1": 2, "key_2": (1, 2, 3), "key_3": {"other_struct_key": 13}}``
- Can nest other types apart from pointers
* - pointer/array (adds ``parameter_len`` parameter to abi)
- any iterable
- ``[1, 2, 3]``, ``[]``, ``({"low": 1, "high": 1}, {"low": 2, "high": 2})``
- ``parameter_len`` is filled automatically from value
* - uint256
- int or dict with ``"low"`` and ``"high"`` keys and ints as values
- ``0``, ``340282366920938463463374607431768211583``, ``{"low": 12, "high": 13}``
-
.. list-table:: Deserialization from Cairo to python values
:widths: 25 25
:header-rows: 1
* - Cairo type
- Python type
* - felt
- int
* - tuple
- tuple
* - named tuple
- :obj:`TupleDataclass <starknet_py.serialization.TupleDataclass>`
* - struct
- dict with keys matching struct
* - pointer/array
- list
* - uint256
- int
Working with shortstrings
-------------------------
To make working with short strings easier we provide some utility functions to translate between them and felt values.
You can read more about how cairo treats shortstrings in
`the documentation <https://www.cairo-lang.org/docs/how_cairo_works/consts.html#short-string-literals>`_.
Conversion functions and references:
- :obj:`encode_shortstring <starknet_py.cairo.felt.encode_shortstring>`
- :obj:`decode_shortstring <starknet_py.cairo.felt.decode_shortstring>`
.. codesnippet:: ../../starknet_py/tests/e2e/docs/guide/test_serializing.py
:language: python
:dedent: 4
:start-after: docs-shortstring: start
:end-before: docs-shortstring: end
Creating serializers from abi
-----------------------------
For most use cases using high level :obj:`Contract <starknet_py.contract.Contract>` is enough - it handles serialization
and deserialization for you. If you need more flexibility you can use lower level serialization API, see :ref:`Serializers`
for more details.
:obj:`AbiParser <starknet_py.abi.v2.parser.AbiParser>` transforms ABI into
:obj:`Abi class <starknet_py.abi.v2.model.Abi>` that can be used for creating serializers. This way you can
easily deserialize events or serialize function's inputs. Remember to use the proper version of `AbiParser`
which depends on parsed ABI version.
Serializing function inputs and outputs
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. codesnippet:: ../../starknet_py/tests/e2e/docs/guide/test_serializing.py
:language: python
:dedent: 4
:start-after: docs-serializer: start
:end-before: docs-serializer: end
Serializing events
^^^^^^^^^^^^^^^^^^
Events emitted by contracts can also be serialized, having provided the correct ABI
.. codesnippet:: ../../starknet_py/tests/e2e/docs/guide/test_serializing.py
:language: python
:dedent: 4
:start-after: docs-event: start
:end-before: docs-event: end
================================================
FILE: docs/guide/signing.rst
================================================
Signing
=======
Using different signing methods
-------------------------------
By default, an :ref:`Account` uses the signing method of OpenZeppelin's account contract. If for any reason you want to use a different
signing algorithm, it is possible to create ``Account`` with custom
:ref:`Signer` implementation.
.. codesnippet:: ../../starknet_py/tests/e2e/docs/guide/test_custom_signer.py
:language: python
:dedent: 4
Signing with Ledger
-------------------
:ref:`LedgerSigner` allows you to sign transactions using a Ledger device. The device must be unlocked and Starknet app needs to be open.
Currently used version of `Starknet app <https://github.com/LedgerHQ/app-starknet>`_ is ``2.3.1``.
.. codesnippet:: ../../starknet_py/tests/unit/signer/test_ledger_signer.py
:language: python
:dedent: 4
Deploying account and transferring STRK
---------------------------------------
.. codesnippet:: ../../starknet_py/tests/unit/signer/test_ledger_signer.py
:language: python
:dedent: 4
:start-after: docs-deploy-account-and-transfer: start
:end-before: docs-deploy-account-and-transfer: end
Signing off-chain messages
-------------------------------
:ref:`Account` lets you sign an off-chain message by using encoding standard proposed `here <https://github.com/argentlabs/argent-x/discussions/14>`_.
You can also **verify a message**, which is done by a call to ``is_valid_signature`` endpoint in the account's contract (e.g. `OpenZeppelin's account contract <https://github.com/starkware-libs/cairo-lang/blob/4e233516f52477ad158bc81a86ec2760471c1b65/src/starkware/starknet/third_party/open_zeppelin/Account.cairo#L115>`_).
.. codesnippet:: ../../starknet_py/tests/e2e/docs/guide/test_sign_offchain_message.py
:language: python
:dedent: 4
Signing for fee estimation
--------------------------
:ref:`Account` allows signing transactions for the purpose of fee estimation.
Transactions signed for fee estimation use a transaction version that makes them non-executable on Starknet.
If a transaction like this was to be intercepted in transport, it could not
be executed without the user consent.
.. attention::
Conventionally signed transactions can still be used to estimate fee. They however don't offer
the extra security of signing specifically for the purpose of fee estimation.
When manually estimating fee for transactions, always prefer estimation specific signing.
.. codesnippet:: ../../starknet_py/tests/e2e/docs/guide/test_sign_for_fee_estimate.py
:language: python
:dedent: 4
================================================
FILE: docs/guide/using_existing_contracts.rst
================================================
Using existing contracts
========================
Existing contracts
------------------
Although it is possible to use :ref:`Client` to interact with contracts, it requires translating python values into Cairo
values. Contract offers that and some other utilities.
Let's say we have a contract with this interface:
.. literalinclude:: ../../starknet_py/tests/e2e/docs/guide/test_using_existing_contracts.py
:language: python
:start-after: docs-abi: start
:end-before: docs-abi: end
This is how we can interact with it:
.. codesnippet:: ../../starknet_py/tests/e2e/docs/guide/test_using_existing_contracts.py
:language: python
:dedent: 4
Raw contract calls
------------------
If you do not have ABI statically, but you know the interface of the contract on Starknet, you can make a raw call:
.. codesnippet:: ../../starknet_py/tests/e2e/docs/guide/test_using_existing_contracts.py
:language: python
:dedent: 4
:start-after: docs-raw-call: start
:end-before: docs-raw-call: end
Fees
----
.. currentmodule:: starknet_py.contract
Starknet.py requires you to specify amount of Fri that you are willing to pay when executing :meth:`~ContractFunction.invoke_v3`.
Alternatively, you can estimate fee automatically, as described in the :ref:`automatic-fee-estimation` section below.
.. code-block:: python
await contract.functions["put"].invoke_v3(k, v, resource_bounds=ResourceBoundsMapping(
l1_gas=ResourceBounds(max_amount=int(1e5), max_price_per_unit=int(1e13)),
l2_gas=ResourceBounds(max_amount=int(1e9), max_price_per_unit=int(1e17)),
l1_data_gas=ResourceBounds(max_amount=int(1e5), max_price_per_unit=int(1e13)),
))
The ``resource_bounds`` argument can be also defined in :meth:`~ContractFunction.prepare_invoke_v3`. Subsequently, the :meth:`~PreparedFunctionInvokeV3.invoke` method on a prepared call can be used either with ``resource_bounds`` omitted or with its value overridden.
.. code-block:: python
prepared_call = contract.function["put"].prepare_invoke_v3(k, v, resource_bounds=ResourceBoundsMapping(
l1_gas=ResourceBounds(max_amount=int(1e5), max_price_per_unit=int(1e13)),
l2_gas=ResourceBounds(max_amount=int(1e5), max_price_per_unit=int(1e13)),
l1_data_gas=ResourceBounds(max_amount=int(1e5), max_price_per_unit=int(1e13)),
))
await prepared_call.invoke()
# or resource_bounds can be overridden
await prepared_call.invoke(resource_bounds=ResourceBoundsMapping(
l1_gas=ResourceBounds(max_amount=int(1e5), max_price_per_unit=int(1e13)),
l2_gas=ResourceBounds(max_amount=int(1e5), max_price_per_unit=int(1e13)),
l1_data_gas=ResourceBounds(max_amount=int(1e5), max_price_per_unit=int(1e13)),
))
.. warning::
If ``resource_bounds`` is not specified at any step it will default to ``None``,
and will raise an exception when invoking a transaction, unless `auto_estimate` is specified and is set to `True`.
Please note you will need to have enough Fri in your Starknet account otherwise
transaction will be rejected.
Fee estimation
--------------
You can estimate required amount of fee that will need to be paid for transaction
using :meth:`PreparedFunctionInvoke.estimate_fee() <starknet_py.contract.PreparedFunctionInvoke.estimate_fee>`
.. code-block:: python
await contract.functions["put"].prepare_invoke_v3(k, v).estimate_fee()
.. _automatic-fee-estimation:
Automatic fee estimation
------------------------
For testing purposes it is possible to enable automatic fee estimation when making a transaction. Starknet.py will then call :meth:`~starknet_py.net.full_node_client.FullNodeClient.estimate_fee`
internally and use the returned value. ``max_amount`` and ``max_price_per_unit`` will be multiplied by ``1.5``.
.. code-block:: python
await contract.functions["put"].invoke_v3(k, v, auto_estimate=True)
.. warning::
It is strongly discouraged to use automatic fee estimation in production code as it may lead to unexpectedly high fee.
.. note::
It is possible to configure the value by which the estimated fee is multiplied,
by changing ``ESTIMATED_AMOUNT_MULTIPLIER`` and ``ESTIMATED_UNIT_PRICE_MULTIPLIER``.
Transaction Tips
----------------
Until Starknet 0.14.0, transactions were processed in FIFO order.
Starting from this version, it is possible to include a *tip* with the transaction fee to incentivize it being placed in an earlier block.
Starknet.py supports this mechanism in several interfaces.
.. code-block:: python
call = contract.functions["get"].prepare_invoke_v3(key=1234, tip=12345)
Account and Client interoperability
-----------------------------------
.. currentmodule:: starknet_py.contract
:ref:`Contract` methods have been designed to be compatible with :ref:`Account` and :ref:`Client`.
:ref:`PreparedFunctionInvokeV3` returned by :meth:`ContractFunction.prepare_invoke_v3` can be used in Account methods to create invoke transaction.
.. codesnippet:: ../../starknet_py/tests/e2e/docs/guide/test_contract_account_compatibility.py
:language: python
:dedent: 4
Similarly, :ref:`PreparedFunctionCall` returned by :meth:`ContractFunction.prepare_call` can be used in :meth:`Client.call_contract() <starknet_py.net.client.Client.call_contract>`
.. codesnippet:: ../../starknet_py/tests/e2e/docs/guide/test_contract_client_compatibility.py
:language: python
:dedent: 4
================================================
FILE: docs/guide/websockets.rst
================================================
Websockets
==========
Introduction
------------
Apart from interacting with Starknet by request-response model, you can also rely on real-time notifications.
Here comes :class:`~starknet_py.net.websockets.websocket_client.WebsocketClient` which allows to establish a connection with Starknet node and listen for events.
Connecting
----------
To begin interacting with Starknet via websockets, create a new instance of :class:`~starknet_py.net.websockets.websocket_client.WebsocketClient` and connect to the node.
.. codesnippet:: ../../starknet_py/tests/e2e/docs/code_examples/test_websocket_client.py
:language: python
:dedent: 4
:start-after: docs-start: connect
:end-before: docs-end: connect
Different subscription methods
------------------------------
New block headers
#################
To subscribe to new block headers, use :meth:`~starknet_py.net.websockets.websocket_client.WebsocketClient.subscribe_new_heads`.
Every time a new block is created, the event will be fired.
.. codesnippet:: ../../starknet_py/tests/e2e/docs/code_examples/test_websocket_client.py
:language: python
:dedent: 4
:start-after: docs-start: subscribe_new_heads
:end-before: docs-end: subscribe_new_heads
New events
##########
To subscribe to new events, use :meth:`~starknet_py.net.websockets.websocket_client.WebsocketClient.subscribe_events`.
Every time a new event is emitted, the event will be fired.
It's possible to filter events by contract addresses, keys and block id. See all options in the method documentation.
.. codesnippet:: ../../starknet_py/tests/e2e/docs/code_examples/test_websocket_client.py
:language: python
:dedent: 4
:start-after: docs-start: subscribe_events
:end-before: docs-end: subscribe_events
Transaction status
##################
To subscribe to transaction status changes, use :meth:`~starknet_py.net.websockets.websocket_client.WebsocketClient.subscribe_transaction_status`.
Every time a transaction status changes, the event will be fired.
.. codesnippet:: ../../starknet_py/tests/e2e/docs/code_examples/test_websocket_client.py
:language: python
:dedent: 4
:start-after: docs-start: subscribe_transaction_status
:end-before: docs-end: subscribe_transaction_status
Transaction Receipts
####################
To subscribe to new transaction receipts, use :meth:`~starknet_py.net.websockets.websocket_client.WebsocketClient.subscribe_new_transaction_receipts`.
Every time a new transaction receipt is created, the event will be fired.
It's possible to filter new transaction receipts by finality status and sender address.
.. codesnippet:: ../../starknet_py/tests/e2e/docs/code_examples/test_websocket_client.py
:language: python
:dedent: 4
:start-after: docs-start: subscribe_new_transaction_receipts
:end-before: docs-end: subscribe_new_transaction_receipts
Handling chain reorganization notifications
###########################################
When subscribing to new block headers, events, or transaction statuses, you also receive notifications of chain reorganizations. For example, if two blocks are produced nearly simultaneously and one replaces the other as the canonical block, you'll get an update indicating that the chain has restructured.
To handle them, you need to set the ``on_chain_reorg`` to your custom function.
.. codesnippet:: ../../starknet_py/tests/e2e/docs/code_examples/test_websocket_client.py
:language: python
:dedent: 4
:start-after: docs-start: on_chain_reorg
:end-before: docs-end: on_chain_reorg
Disconnecting
-------------
To disconnect from the node, use :meth:`~starknet_py.net.websockets.websocket_client.WebsocketClient.disconnect`.
.. codesnippet:: ../../starknet_py/tests/e2e/docs/code_examples/test_websocket_client.py
:language: python
:dedent: 4
:start-after: docs-start: disconnect
:end-before: docs-end: disconnect
================================================
FILE: docs/guide.rst
================================================
Guide
=====
.. toctree::
guide/account_and_client
guide/using_existing_contracts
guide/resolving_proxy_contracts
guide/deploying_contracts
guide/serialization
guide/signing
guide/generating_key_pair
guide/websockets
================================================
FILE: docs/index.rst
================================================
.. figure:: _static/starknetpy.png
:class: starknetpy-logo
.. rst-class:: description-cls
Starknet SDK for Python
.. rst-class:: get-started-cls
:doc:`Get Started<quickstart>`
.. toctree::
:hidden:
installation
account_creation
quickstart
guide
devnet_utils
api
development
migration_guide
================================================
FILE: docs/installation.rst
================================================
Installation
============
To use starknet.py, ``ecdsa, fastecdsa, sympy`` dependencies are required. Depending on the operating system,
different installation steps must be performed.
Linux
-----
.. code-block:: bash
sudo apt install -y libgmp3-dev
pip install starknet-py
MacOS
-----
Instructions assume `Homebrew <https://brew.sh/>`_ being installed.
.. hint:: If you are experiencing issues installing starknet.py related to ``fastecdsa`` on recent versions of MacOS
consider installing ``cmake`` with version ``>=3.22.4``.
.. code-block:: bash
brew install cmake
It is required to build `crypto-cpp-py <https://github.com/software-mansion-labs/crypto-cpp-py>`_
dependency in case it hasn't been updated to support newest MacOS versions.
Intel processor
^^^^^^^^^^^^^^^
.. code-block:: bash
brew install gmp
pip install starknet-py
Apple silicon
^^^^^^^^^^^^^
.. code-block:: bash
brew install gmp
CFLAGS=-I`brew --prefix gmp`/include LDFLAGS=-L`brew --prefix gmp`/lib pip install starknet-py
Windows
-------
You can install starknet.py on Windows in two ways:
1. Install it just like you would on Linux.
In such case make sure that you have `MinGW <https://www.mingw-w64.org/>`_ installed and up-to-date.
.. hint::
The recommended way to install is through `chocolatey <https://community.chocolatey.org/packages/mingw>`_.
You also should have MinGW in your PATH environment variable (e.g. ``C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin``).
.. warning::
Please be aware that you may encounter issues related to ``libcrypto_c_exports`` (e.g LoadLibraryEx).
Installing MinGW via chocolatey and correctly adding it to the PATH should solve these issues.
If you encounter any further problems related to installation, you can create an `issue at our GitHub <https://github.com/software-mansion/starknet.py/issues/new?assignees=&labels=bug&projects=&template=bug_report.yaml&title=%5BBUG%5D+%3Ctitle%3E>`_
or ask for help in ``#🐍 | starknet-py`` channel on `Starknet Discord server <https://starknet.io/discord>`_.
2. Use virtual machine with Linux, `Windows Subsystem for Linux 2 <https://learn.microsoft.com/en-us/windows/wsl/>`_ (WSL2).
================================================
FILE: docs/make.bat
================================================
@ECHO OFF
pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build
if "%1" == "" goto help
%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end
:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
:end
popd
================================================
FILE: docs/migration_guide.rst
================================================
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 <https://github.com/starkware-libs/starknet-specs/releases/tag/v0.10.2>`_
.. py:currentmodule:: starknet_py.net.client_models
0.30.0 New features
------------------------
1. New ``response_flags`` parameter added to
:meth:`~starknet_py.net.full_node_client.FullNodeClient.get_block_with_txs`,
:meth:`~starknet_py.net.full_node_client.FullNodeClient.get_block_with_receipts` and
:meth:`~starknet_py.net.full_node_client.FullNodeClient.get_transaction`.
Currently supported flag: ``INCLUDE_PROOF_FACTS``.
2. :meth:`~starknet_py.net.full_node_client.FullNodeClient.get_storage_at` accepts a new
``response_flags`` parameter of type :class:`StorageResponseFlag`. When
``INCLUDE_LAST_UPDATE_BLOCK`` is set, the return type changes from ``int`` to
:class:`StorageResult` (which includes ``value`` and ``last_update_block``).
3. :meth:`~starknet_py.net.full_node_client.FullNodeClient.trace_block_transactions` accepts a new
``trace_flags`` parameter of type :class:`TraceFlag`. When ``RETURN_INITIAL_READS`` is set,
the return type is :class:`BlockTransactionTracesWithInitialReads` instead of
``List[BlockTransactionTrace]``.
4. :meth:`~starknet_py.net.full_node_client.FullNodeClient.get_state_update` accepts a new
``contract_addresses`` parameter. When provided, only state diffs related to those addresses
are returned; class declarations are unaffected by this filter.
5. The ``address`` parameter of :meth:`~starknet_py.net.full_node_client.FullNodeClient.get_events`
now accepts either a single ``Hash`` or a ``List[Hash]``.
6. :class:`SimulationFlag` has a new value ``RETURN_INITIAL_READS``. When included in
``simulation_flags``, :meth:`~starknet_py.net.full_node_client.FullNodeClient.simulate_transactions`
returns :class:`SimulatedTransactionsWithInitialReads` instead of a plain list.
7. Invoke V3 transactions now support optional ``proof_facts`` and ``proof`` fields. These can be passed through:
.. py:currentmodule:: starknet_py.net.account.account
- :meth:`Account.sign_invoke_v3`
- :meth:`Account.execute_v3`
.. py:currentmodule:: starknet_py.contract
- :meth:`ContractFunction.invoke_v3`
- :meth:`PreparedFunctionInvokeV3.invoke`
0.30.0 New types
---------------------
.. py:currentmodule:: starknet_py.net.client_models
- :class:`TransactionResponseFlag` - flags controlling extra fields in transaction responses.
- :class:`StorageResponseFlag` - flags controlling extra fields in storage responses.
- :class:`TraceFlag` - flags controlling extra fields in block traces.
- :class:`StorageResult` - returned by :meth:`~starknet_py.net.full_node_client.FullNodeClient.get_storage_at`
when ``INCLUDE_LAST_UPDATE_BLOCK`` is set; contains ``value`` and ``last_update_block``.
- :class:`InitialReads` - set of state values read from the underlying state reader during execution,
containing optional ``storage``, ``nonces``, ``class_hashes`` and ``declared_contracts`` lists.
- :class:`BlockTransactionTracesWithInitialReads` - block traces response that includes :class:`InitialReads`.
- :class:`SimulatedTransactionsWithInitialReads` - simulation response that includes :class:`InitialReads`.
0.30.0 Bugfixes
--------------------
.. currentmodule:: starknet_py.net.signer.stark_curve_signer
1. :meth:`KeyPair.generate` uses now a correct value for `Stark curve's order <https://docs.starknet.io/learn/protocol/cryptography#the-stark-curve>`_
****************************
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 <https://github.com/starkware-libs/starknet-specs/releases/tag/v0.10.2>`_
.. py:currentmodule:: starknet_py.net.client_models
0.30.0-rc.0 New features
------------------------
1. New ``response_flags`` parameter added to
:meth:`~starknet_py.net.full_node_client.FullNodeClient.get_block_with_txs`,
:meth:`~starknet_py.net.full_node_client.FullNodeClient.get_block_with_receipts` and
:meth:`~starknet_py.net.full_node_client.FullNodeClient.get_transaction`.
Currently supported flag: ``INCLUDE_PROOF_FACTS``.
2. :meth:`~starknet_py.net.full_node_client.FullNodeClient.get_storage_at` accepts a new
``response_flags`` parameter of type :class:`StorageResponseFlag`. When
``INCLUDE_LAST_UPDATE_BLOCK`` is set, the return type changes from ``int`` to
:class:`StorageResult` (which includes ``value`` and ``last_update_block``).
3. :meth:`~starknet_py.net.full_node_client.FullNodeClient.trace_block_transactions` accepts a new
``trace_flags`` parameter of type :class:`TraceFlag`. When ``RETURN_INITIAL_READS`` is set,
the return type is :class:`BlockTransactionTracesWithInitialReads` instead of
``List[BlockTransactionTrace]``.
4. :meth:`~starknet_py.net.full_node_client.FullNodeClient.get_state_update` accepts a new
``contract_addresses`` parameter. When provided, only state diffs related to those addresses
are returned; class declarations are unaffected by this filter.
5. The ``address`` parameter of :meth:`~starknet_py.net.full_node_client.FullNodeClient.get_events`
now accepts either a single ``Hash`` or a ``List[Hash]``.
6. :class:`SimulationFlag` has a new value ``RETURN_INITIAL_READS``. When included in
``simulation_flags``, :meth:`~starknet_py.net.full_node_client.FullNodeClient.simulate_transactions`
returns :class:`SimulatedTransactionsWithInitialReads` instead of a plain list.
7. Invoke V3 transactions now support optional ``proof_facts`` and ``proof`` fields. These can be passed through:
.. py:currentmodule:: starknet_py.net.account.account
- :meth:`Account.sign_invoke_v3`
- :meth:`Account.execute_v3`
.. py:currentmodule:: starknet_py.contract
- :meth:`ContractFunction.invoke_v3`
- :meth:`PreparedFunctionInvokeV3.invoke`
0.30.0-rc.0 New types
---------------------
.. py:currentmodule:: starknet_py.net.client_models
- :class:`TransactionResponseFlag` - flags controlling extra fields in transaction responses.
- :class:`StorageResponseFlag` - flags controlling extra fields in storage responses.
- :class:`TraceFlag` - flags controlling extra fields in block traces.
- :class:`StorageResult` - returned by :meth:`~starknet_py.net.full_node_client.FullNodeClient.get_storage_at`
when ``INCLUDE_LAST_UPDATE_BLOCK`` is set; contains ``value`` and ``last_update_block``.
- :class:`InitialReads` - set of state values read from the underlying state reader during execution,
containing optional ``storage``, ``nonces``, ``class_hashes`` and ``declared_contracts`` lists.
- :class:`BlockTransactionTracesWithInitialReads` - block traces response that includes :class:`InitialReads`.
- :class:`SimulatedTransactionsWithInitialReads` - simulation response that includes :class:`InitialReads`.
0.30.0-rc.0 Bugfixes
--------------------
.. currentmodule:: starknet_py.net.signer.stark_curve_signer
1. :meth:`KeyPair.generate` uses now a correct value for `Stark curve's order <https://docs.starknet.io/learn/protocol/cryptography#the-stark-curve>`_
************************
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
------------------------
- Starknet - `0.14.1 <https://docs.starknet.io/learn/cheatsheets/version-notes#starknet-v0-14-1-tbd>`_
- RPC - `0.10.0 <https://github.com/starkware-libs/starknet-specs/releases/tag/v0.10.0>`_
.. py:currentmodule:: starknet_py.net.client_models
1. :class:`BlockHeader`: Added new fields: ``event_commitment``, ``transaction_commitment``, ``receipt_commitment``, ``state_diff_commitment``, ``event_count``, ``transaction_count``, ``state_diff_length``.
2. :class:`StateDiff` has a new optional field ``migrated_compiled_classes``.
3. ``storage_keys`` field in :class:`ContractsStorageKeys` is now of type ``str``.
4. ``old_root`` field in :class:`PreConfirmedBlockStateUpdate` is now optional.
5. Hash function for contract declaration is now automatically selected based on Starknet version: Blake2s for Starknet >= 0.14.1, Poseidon for older versions.
6. :class:`EmittedEvent` has new fields: ``transaction_index`` and ``event_index``.
0.29.0 Bugfixes
---------------
1. Fixed parsing ABI that contains signed integers (e.g. ``i128``).
0.29.0 Dependency changes
--------------------------
.. py:currentmodule:: starknet_py.net.signer.ledger_signer
1. When installing extra dependencies needed for :class:`LedgerSigner`, Linux users may have to install additional packages:
.. code-block:: bash
sudo apt install python3-dev libusb-1.0-0-dev libudev-dev
These packages are needed for HIDAPI compilation. Read official `ledgerctl installation guide <https://github.com/LedgerHQ/ledgerctl?tab=readme-ov-file#quick-install)>`_ 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
-------------------------------
.. py:currentmodule:: starknet_py.net.signer.ledger_signer
1. When installing extra dependencies needed for :class:`LedgerSigner`, Linux users may have to install additional packages:
.. code-block:: bash
sudo apt install python3-dev libusb-1.0-0-dev libudev-dev
These packages are needed for HIDAPI compilation. Read official `ledgerctl installation guide <https://github.com/LedgerHQ/ledgerctl?tab=readme-ov-file#quick-install)>`_ for more details.
0.29.0-rc.2 Breaking changes
-----------------------------
.. currentmodule:: starknet_py.hash.class_hash
1. :func:`compute_class_hash`: default value of ``hash_method`` param is now ``HashMethod.BLAKE2S``.
***************************
0.29.0-rc.1 Migration guide
***************************
0.29.0-rc.1 Bugfixes
--------------------
1. Fixed parsing ABI that contains signed integers (e.g. ``i128``).
2. 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.
.. py:currentmodule:: starknet_py.net.client_models
1. :class:`StateDiff` has a new field ``migrated_compiled_classes``.
2. ``storage_keys`` field in :class:`ContractsStorageKeys` is now of type ``str``.
3. ``old_root`` field in :class:`PreConfirmedBlockStateUpdate` is now optional.
4. 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.
5. :class:`EmittedEvent` has new fields: ``transaction_index`` and ``event_index``.
***************************
0.28.1 Migration guide
***************************
1. This version adds support for Blake hash used in CASM class hash computation.
0.28.1 Targeted versions
------------------------
- Starknet - `0.14.0 <https://docs.starknet.io/learn/cheatsheets/version-notes#starknet-v0-14-0-september-1>`_ and `0.14.1 <https://docs.starknet.io/learn/cheatsheets/version-notes#starknet-v0-14-1-tbd>`_
- RPC - `0.9.0 <https://github.com/starkware-libs/starknet-specs/releases/tag/v0.9.0>`_
0.28.1 Breaking changes
-----------------------
.. py:currentmodule:: starknet_py.hash.compiled_class_hash_objects
1. :meth:`BytecodeSegmentStructure.hash` has new param ``hash_method``.
2. :meth:`BytecodeLeaf.hash` has new param ``hash_method``.
3. :meth:`BytecodeSegmentedNode.hash` has new param ``hash_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 - `0.14.0 <https://docs.starknet.io/learn/cheatsheets/version-notes#starknet-v0-14-0-september-1>`_
- RPC - `0.9.0 <https://github.com/starkware-libs/starknet-specs/releases/tag/v0.9.0>`_
``starknet_py.net.client_models`` Changes
-----------------------------------------
.. py:currentmodule:: starknet_py.net.client_models
1. Renamed :class:`PendingBlockHeader` to :class:`PreConfirmedBlockHeader`, changed field ``parent_hash`` to ``block_number``.
2. Renamed :class:`PendingStarknetBlock` to :class:`PreConfirmedStarknetBlock`
3. Renamed :class:`PendingStarknetBlockWithTxHashes` to :class:`PreConfirmedStarknetBlockWithTxHashes`
4. Renamed :class:`PendingStarknetBlockWithReceipts` to :class:`PreConfirmedStarknetBlockWithReceipts`
5. Renamed :class:`PendingBlockStateUpdate` to :class:`PreConfirmedBlockStateUpdate`
6. Enum :class:`BlockStatus` variant ``PENDING`` removed, added ``PRE_CONFIRMED``
7. Enum :class:`TransactionFinalityStatus`, added variant ``PRE_CONFIRMED``
8. Enum :class:`TransactionStatus` variant ``REJECTED`` removed, added ``CANDIDATE``, ``PRE_CONFIRMED``
9. :class:`MessageStatus`: ``finality_status`` field is now of type :class:`TransactionFinalityStatus`.
10. Removed :class:`MessageFinalityStatus`.
11. :class:`BlockStatus`: removed ``REJECTED`` variant.
12. Added ``l1_accepted`` variant for ``BlockTag``.
13. Removed fields ``block_number`` and ``block_hash`` from :class:`TransactionReceipt`
14. Added a dedicated class :class:`TransactionReceiptWithBlockInfo`, a subclass of :class:`TransactionReceipt`, that has non-optional field ``block_number`` and optional field ``block_hash``.
``starknet_py.net.client`` Changes
----------------------------------
.. py:currentmodule:: starknet_py.net.client
1. :meth:`Client.get_storage_proof`: replaced param ``block_id`` with ``block_hash`` and ``block_number``.
2. :meth:`Client.wait_for_tx` will now wait until transaction ``finality_status`` is either ``ACCEPTED_ON_L2`` or ``ACCEPTED_ON_L1``.
3. :meth:`Client.wait_for_tx` will no longer raise ``TransactionRejectedError``, see the method docs for details.
4. :meth:`Client.get_messages_status`: changed ``transaction_hash`` type from ``str`` to ``Hash``.
5. Changed return type of :meth:`Client.get_transaction_receipt` to :class:`~starknet_py.net.client_models.TransactionReceiptWithBlockInfo`.
6. Changed return type of :meth:`Client.wait_for_tx` to :class:`~starknet_py.net.client_models.TransactionReceiptWithBlockInfo`.
``starknet_py.net.websockets.websocket_client`` Changes
-------------------------------------------------------
.. py:currentmodule:: starknet_py.net.websockets.websocket_client
1. Removed ``subscribe_pending_transactions`` method and respective notification.
2. Added :meth:`WebsocketClient.subscribe_new_transactions` and :meth:`WebsocketClient.subscribe_new_transaction_receipts` and respective notifications.
3. Added field ``finality_status`` to :meth:`WebsocketClient.subscribe_events`, changed ``NewEventsNotification`` that is used in the handler inner type to contain finalty status.
``starknet_py.net.account.account`` Changes
-------------------------------------------
.. py:currentmodule:: starknet_py.net.account.account
1. When no ``token_address`` is specified in the :meth:`Account.get_balance` method, the default token address is now the STRK fee contract instead of ETH.
2. Rename ``FEE_CONTRACT_ADDRESS`` to ``ETH_FEE_CONTRACT_ADDRESS``.
``starknet_py.contract`` Changes
-------------------------------------------
.. py:currentmodule:: starknet_py.contract
1. Added missing ``tip`` and ``auto_estimate_tip`` to :meth:`ContractFunction.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
.. py:currentmodule:: starknet_py.contract
- :meth:`DeclareResult.deploy_v3`
- :meth:`PreparedFunctionInvokeV3.invoke`
- :meth:`Contract.declare_v3`
- :meth:`Contract.deploy_contract_v3`
.. py:currentmodule:: starknet_py.net.account.account
- :meth:`Account.sign_invoke_v3`
- :meth:`Account.sign_declare_v3`
- :meth:`Account.sign_deploy_account_v3`
- :meth:`Account.execute_v3`
- :meth:`Account.deploy_account_v3`
Additionally, dataclasses representing transactions now require passing a tip.
No default value is used for tip and it is a required parameter.
.. py:currentmodule:: starknet_py.net.models.transaction
- :class:`InvokeV3`, tip is now required
- :class:`DeclareV3`, tip is now required
- :class:`DeployAccountV3`, tip is now required
Transaction Tip Estimation
--------------------------
.. py:currentmodule:: starknet_py.net.tip
1. Added :func:`estimate_tip` for automatic transaction tip estimation.
2. Added ``auto_estimate_tip`` param to :class:`~starknet_py.net.account.account.Account` and :class:`~starknet_py.contract.Contract` methods that accept a ``tip`` argument. If set to ``True``, median of tips from the ``pre_confirmed`` block will be used to estimate select at tip.
Deployment with UDC
-------------------
.. py:currentmodule:: starknet_py.net.udc_deployer.deployer
1. Default deployer address in :class:`Deployer` is now the new UDC (``0x02ceed65a4bd731034c01113685c831b01c15d7d432f71afb1cf1634b53a2125``).
Other Changes
-------------
.. currentmodule:: starknet_py.devnet_utils.devnet_client
1. ``unit`` param in :meth:`DevnetClient.mint` now defaults to ``PriceUnit.FRI``.
.. py:currentmodule:: starknet_py.net.signer.eth_signer
2. :class:`EthSigner` implementation has been added.
0.28.0 Bugfixes
---------------
.. py:currentmodule:: starknet_py.contract
1. Contracts which include fixed sized array type are now correctly serialized (e.g. when using :meth:`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).
.. currentmodule:: starknet_py.net.client_models
1. Removed fields ``block_number`` and ``block_hash`` from :class:`TransactionReceipt`
2. Added a dedicated class :class:`TransactionReceiptWithBlockInfo`, a subclass of :class:`TransactionReceipt`, that has non-optional field ``block_number`` and optional field ``block_hash``.
.. currentmodule:: starknet_py.net.client
3. Changed return type of :meth:`Client.get_transaction_receipt` to :class:`~starknet_py.net.client_models.TransactionReceiptWithBlockInfo`.
4. Changed return type of :meth:`Client.wait_for_tx` to :class:`~starknet_py.net.client_models.TransactionReceiptWithBlockInfo`.
***************************
0.28.0-rc.3 Migration guide
***************************
.. py:currentmodule:: starknet_py.net.account.account
1. When no ``token_address`` is specified in the :meth:`Account.get_balance` method, the default token address now defaults to the STRK fee contract instead of ETH.
2. Rename ``FEE_CONTRACT_ADDRESS`` to ``ETH_FEE_CONTRACT_ADDRESS``.
.. currentmodule:: starknet_py.devnet_utils.devnet_client
3. ``unit`` param in :meth:`DevnetClient.mint` now defaults to ``PriceUnit.FRI``.
.. py:currentmodule:: starknet_py.net.signer.eth_signer
4. :class:`EthSigner` implementation 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!
.. py:currentmodule:: starknet_py.net.client_models
1. :class:`MessageStatus`: ``finality_status`` field is now of type :class:`TransactionFinalityStatus`.
2. Removed :class:`MessageFinalityStatus`.
3. :class:`BlockStatus`: removed ``REJECTED`` variant.
4. Added ``l1_accepted`` variant for ``BlockTag``.
Tip Estimations
---------------
.. py:currentmodule:: starknet_py.net.tip
1. :func:`estimate_tip` will now use ``latest`` block instead of ``pre_confirmed`` if 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
--------------
.. py:currentmodule:: starknet_py.net.tip
1. Added :func:`estimate_tip` for automatic transaction tip estimation.
2. Added ``auto_estimate_tip`` param to :class:`~starknet_py.net.account.account.Account` and :class:`~starknet_py.contract.Contract` methods that accept a ``tip`` argument. If set to ``True``, median of tips from the ``pre_confirmed`` block will be used to estimate select at tip.
Deployment via UDC
------------------
.. py:currentmodule:: starknet_py.net.udc_deployer.deployer
1. Default deployer address in :class:`Deployer` is now the new UDC (``0x02ceed65a4bd731034c01113685c831b01c15d7d432f71afb1cf1634b53a2125``).
0.28.0-rc.1 Bugfixes
---------------------
.. py:currentmodule:: starknet_py.contract
1. Contracts which include fixed sized array type are now correctly serialized (e.g. when using :meth:`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``
---------------------------------
.. py:currentmodule:: starknet_py.net.client_models
1. Renamed :class:`PendingBlockHeader` to :class:`PreConfirmedBlockHeader`, changed field ``parent_hash`` to ``block_number``.
2. Renamed :class:`PendingStarknetBlock` to :class:`PreConfirmedStarknetBlock`
3. Renamed :class:`PendingStarknetBlockWithTxHashes` to :class:`PreConfirmedStarknetBlockWithTxHashes`
4. Renamed :class:`PendingStarknetBlockWithReceipts` to :class:`PreConfirmedStarknetBlockWithReceipts`
5. Renamed :class:`PendingBlockStateUpdate` to :class:`PreConfirmedBlockStateUpdate`
6. Enum :class:`BlockStatus` variant ``PENDING`` removed, added ``PRE_CONFIRMED``
7. Enum :class:`TransactionFinalityStatus`, added variant ``PRE_CONFIRMED``
8. Enum :class:`TransactionStatus` variant ``REJECTED`` removed, added ``CANDIDATE``, ``PRE_CONFIRMED``
``starknet_py.net.client``
--------------------------
.. py:currentmodule:: starknet_py.net.client
1. :meth:`Client.get_storage_proof`: replaced param ``block_id`` with ``block_hash`` and ``block_number``.
2. :meth:`Client.wait_for_tx` will now wait until transaction ``finality_status`` is either ``ACCEPTED_ON_L2`` or ``ACCEPTED_ON_L1``.
3. :meth:`Client.wait_for_tx` will no longer raise ``TransactionRejectedError``, see the method docs for details.
4. :meth:`Client.get_messages_status`: changed ``transaction_hash`` type from ``str`` to ``Hash``.
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
.. py:currentmodule:: starknet_py.contract
- :meth:`DeclareResult.deploy_v3`
- :meth:`PreparedFunctionInvokeV3.invoke`
- :meth:`Contract.declare_v3`
- :meth:`Contract.deploy_contract_v3`
.. py:currentmodule:: starknet_py.net.account.account
- :meth:`Account.sign_invoke_v3`
- :meth:`Account.sign_declare_v3`
- :meth:`Account.sign_deploy_account_v3`
- :meth:`Account.execute_v3`
- :meth:`Account.deploy_account_v3`
Additionally, dataclasses representing transactions now require passing a tip.
No default value is used for tip and it is a required parameter.
.. py:currentmodule:: starknet_py.net.models.transaction
- :class:`InvokeV3`, tip is now required
- :class:`DeclareV3`, tip is now required
- :class:`DeployAccountV3`, tip is now required
**********************
0.27.0 Migration guide
**********************
.. py:currentmodule:: starknet_py.net.signer.ledger_signer
1. Support for clear signing with :class:`LedgerSigner` has been added. It's now the default signing mode (see :class:`LedgerSigningMode`).
2. ``derivation_path_str`` param has been removed from :class:`LedgerSigner` constructor, while ``account_id``, ``application_name`` and ``signing_mode`` params have been added.
0.27.0 Bugfixes
---------------
1. ABI parser supports now fixed size arrays.
.. py:currentmodule:: starknet_py.net.client_models
2. ``l1_address`` in :class:`L2ToL1Message` now accepts felts when deserializing.
**********************
0.26.2 Migration guide
**********************
.. py:currentmodule:: starknet_py.net.full_node_client
1. If an incompatible RPC version is detected between the node and :class:`FullNodeClient`, a warning will be emitted.
**********************
0.26.1 Migration guide
**********************
.. py:currentmodule:: starknet_py.net.client_models
1. Restored ``amount_multiplier`` and ``unit_price_multiplier`` params in :meth:`EstimatedFee.to_resource_bounds()`
2. Using Braavos accounts is temporarily disabled because they don't work with starknet 0.13.5. Please read the `official post <https://community.starknet.io/t/starknet-devtools-for-0-13-5/115495#p-2359168-braavos-compatibility-issues-3>`_ for more details.
0.26.1 Bugfixes
---------------
1. In :class:`FunctionInvocation`, ``execution_resources`` field is now of type :class:`InnerCallExecutionResources`.
**********************
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
------------------------
- Starknet - `0.13.5 <https://docs.starknet.io/documentation/starknet_versions/version_notes/#version0.13.5>`_
- RPC - `0.8.1 <https://github.com/starkware-libs/starknet-specs/releases/tag/v0.8.1>`_
.. py:currentmodule:: starknet_py.net.full_node_client
1. New methods have been added: :meth:`~FullNodeClient.get_storage_proof`, :meth:`~FullNodeClient.get_messages_status` and :meth:`~FullNodeClient.get_compiled_casm`.
.. py:currentmodule:: starknet_py.net.client_models
2. ``failure_reason`` field has been added to :class:`TransactionStatusResponse`.
3. ``execution_resources`` and ``is_reverted`` fields have been added to :class:`FunctionInvocation`.
.. py:currentmodule:: starknet_py.net.websockets.websocket_client
4. Added :class:`WebsocketClient` which allows to interact with websockets API.
0.26.0 Breaking changes
-----------------------
1. ``l1_resource_bounds`` parameter (in transaction methods) has been renamed to ``resource_bounds``, its type has also changed from :class:`~starknet_py.net.client_models.ResourceBounds` to :class:`~starknet_py.net.client_models.ResourceBoundsMapping`.
.. py:currentmodule:: starknet_py.net.client_models
2. :class:`ComputationResources` and :class:`DataResources` have been removed.
3. :class:`ExecutionResources`, :class:`EstimatedFee` have been modified according to new RPC specification.
4. Submitting transactions other than v3 is not possible anymore.
0.26.0 Bugfixes
---------------
.. py:currentmodule:: starknet_py.net.executable_models
1. Fixed typo in :class:`TestLessThanOrEqualAddress` class name and schema data key.
.. py:currentmodule:: starknet_py.contract
2. Fixed an issue in :meth:`Contract.deploy_contract_v3` where omitting the ``abi`` param 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
--------------------
.. py:currentmodule:: starknet_py.net.executable_models
1. Fixed typo in :class:`TestLessThanOrEqualAddress` class name and schema data key.
.. py:currentmodule:: starknet_py.contract
2. Fixed an issue in :meth:`Contract.deploy_contract_v3` where omitting the ``abi`` param 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
------------------------------
- Starknet - `0.13.4 <https://docs.starknet.io/documentation/starknet_versions/version_notes/#version0.13.4>`_
- RPC - `0.8.0 <https://github.com/starkware-libs/starknet-specs/releases/tag/v0.8.0>`_
1. ``l1_resource_bounds`` parameter (in transaction methods) has been renamed to ``resource_bounds``, its type has also changed from :class:`~starknet_py.net.client_models.ResourceBounds` to :class:`~starknet_py.net.client_models.ResourceBoundsMapping`.
.. py:currentmodule:: starknet_py.net.full_node_client
2. New methods have been added: :meth:`~FullNodeClient.get_storage_proof`, :meth:`~FullNodeClient.get_messages_status` and :meth:`~FullNodeClient.get_compiled_casm`.
.. py:currentmodule:: starknet_py.net.client_models
3. :class:`ComputationResources` and :class:`DataResources` have been removed.
4. :class:`ExecutionResources`, :class:`EstimatedFee` have been modified according to new RPC specification.
5. ``failure_reason`` field has been added to :class:`TransactionStatusResponse`.
6. ``execution_resources`` and ``is_reverted`` fields have been added to :class:`FunctionInvocation`.
7. 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.
.. currentmodule:: starknet_py.cairo.data_types
1. Added :class:`NonZeroType` in order to fix parsing ABI which contains Cairo`s `core::zeroable::NonZero <https://github.com/starkware-libs/cairo/blob/a2b9dddeb3212c8d529538454745b27d7a34a6cd/corelib/src/zeroable.cairo#L78>`_.
2. Added `SNIP-9 <https://github.com/starknet-io/SNIPs/blob/main/SNIPS/snip-9.md>`_ support to :class:`~starknet_py.net.account.account.Account`. Now it's possible to create a :class:`~starknet_py.net.client_models.Call` for outside execution using :meth:`~starknet_py.net.account.account.Account.sign_outside_execution_call`.
3. All methods and classes which use transactions other than v3 are now deprecated.
0.25.0 Minor changes
--------------------
1. Added ``keys`` field to :class:`EventType` which contains the list of event fields marked with ``#[key]`` in Cairo code.
******************************
0.24.3 Migration guide
******************************
0.24.3 Minor changes
--------------------
1. Updated `crypto-cpp-py <https://github.com/software-mansion-labs/crypto-cpp-py>`_ to version ``1.4.5``.
.. currentmodule:: starknet_py.net.signer.ledger_signer
2. Ledger support (see :class:`LedgerSigner`) is now optional. To use it, install the package with ``poetry install -E ledger``.
******************************
0.24.2 Migration guide
******************************
0.24.2 Minor changes
--------------------
.. currentmodule:: starknet_py.net.signer.stark_curve_signer
1. Added :meth:`KeyPair.generate` method which allows to generate key pair based on cryptographically strong pseudo-random number.
.. currentmodule:: starknet_py.contract
2. ``abi`` parameter is now optional in :meth:`Contract.deploy_contract_v3`.
3. Added quickfix for ``u96`` parsing for both pre and post ``2.8.0`` Cairo 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
--------------------
1. Fixed parsing ABI that contains ``u96`` data type.
2. Fixed ``l1_address`` deserialization in ``L2toL1MessageSchema``.
******************************
0.24.0 Migration guide
******************************
.. currentmodule:: starknet_py.devnet_utils.devnet_client
1. :class:`DevnetClient` has been implemented to interact with additional features of the `starknet-devnet-rs <https://github.com/0xSpaceShard/starknet-devnet-rs>`_
.. currentmodule:: starknet_py.net.signer.ledger_signer
2. :class:`LedgerSigner` has been implemented to enable signing with Ledger hardware wallet
0.24.0 Targeted versions
------------------------
- Starknet - `0.13.1.1 <https://docs.starknet.io/documentation/starknet_versions/version_notes/#version0.13.1.1>`_
- RPC - `0.7.1 <https://github.com/starkware-libs/starknet-specs/releases/tag/v0.7.1>`_
0.24.0 Breaking changes
-----------------------
.. currentmodule:: starknet_py.net.client_models
1. :class:`CompiledContract` and :class:`ContractClass` have been renamed to :class:`DeprecatedCompiledContract` and :class:`DeprecatedContractClass`.
2. :class:`ContractClassSchema` have been renamed to :class:`DeprecatedContractClassSchema`
******************************
0.23.0 Migration guide
******************************
Version 0.23.0 of **starknet.py** comes with support for `SNIP-12 <https://github.com/starknet-io/SNIPs/blob/main/SNIPS/snip-12.md>`_!
0.23.0 Targeted versions
------------------------
- Starknet - `0.13.1.1 <https://docs.starknet.io/documentation/starknet_versions/version_notes/#version0.13.1.1>`_
- RPC - `0.7.1 <https://github.com/starkware-libs/starknet-specs/releases/tag/v0.7.1>`_
0.23.0 Breaking changes
-----------------------
.. currentmodule:: starknet_py.utils.typed_data
1. :class:`StarkNetDomain` has been renamed to :class:`Domain`
2. :class:`TypedData` field ``domain`` has been changed from ``dict`` to :class:`Domain`
3. :class:`Parameter` is now abstract - :class:`StandardParameter`, :class:`EnumParameter` and :class:`MerkleTreeParameter` should be used
0.23.0 Minor changes
-----------------------
.. currentmodule:: starknet_py.net.account.account
1. :meth:`Account.sign_message` now accepts parameter ``typed_data`` as both :class:`~starknet_py.utils.typed_data.TypedData` and :class:`~starknet_py.net.models.typed_data.TypedDataDict`
2. :meth:`Account.verify_message` now accepts parameter ``typed_data`` as both :class:`~starknet_py.utils.typed_data.TypedData` and :class:`~starknet_py.net.models.typed_data.TypedDataDict`
3. :meth:`~starknet_py.net.signer.stark_curve_signer.KeyPair.from_keystore` has been added
******************************
0.22.0 Migration guide
******************************
0.22.0 Targeted versions
------------------------
- Starknet - `0.13.1.1 <https://docs.starknet.io/documentation/starknet_versions/version_notes/#version0.13.1.1>`_
- RPC - `0.7.1 <https://github.com/starkware-libs/starknet-specs/releases/tag/v0.7.1>`_
0.22.0 Breaking changes
-----------------------
1. Support for Goerli has been removed
.. currentmodule:: starknet_py.net.models
2. ``StarknetChainId.SEPOLIA_TESTNET`` has been renamed to :class:`StarknetChainId.SEPOLIA`
.. currentmodule:: starknet_py.net.account.account
3. Parameter ``chain`` has been removed from the methods :meth:`Account.deploy_account_v1` and :meth:`Account.deploy_account_v3`
4. Parameter ``chain_id`` has been removed from the method :meth:`~Account.get_balance`
5. :class:`~starknet_py.net.client_models.L1HandlerTransactionTrace` field ``execution_resources`` is 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
------------------------
- Starknet - `0.13.1 <https://docs.starknet.io/documentation/starknet_versions/version_notes/#version0.13.1>`_
- RPC - `0.7.0 <https://github.com/starkware-libs/starknet-specs/releases/tag/v0.7.0>`_
0.21.0 Breaking changes
-----------------------
.. currentmodule:: starknet_py.net.client_models
1. :class:`PendingStarknetBlock` and :class:`PendingStarknetBlockWithTxHashes` field ``parent_block_hash`` has been renamed to ``parent_hash``
2. :class:`StarknetBlockCommon` has been renamed to :class:`BlockHeader`
3. :class:`StarknetBlock` and :class:`StarknetBlockWithTxHashes` fields ``parent_block_hash`` and ``root`` have been renamed to ``parent_hash`` and ``new_root`` respectively
4. :class:`FunctionInvocation` field ``execution_resources`` has been renamed to ``computation_resources``
0.21.0 Minor changes
-----------------------
1. :class:`EventsChunk` field ``events`` is now a list of :class:`EmittedEvent` instead of :class:`Event`
2. :class:`ExecutionResources` has a new required field ``data_availability``
3. :class:`InvokeTransactionTrace`, :class:`DeclareTransactionTrace` and :class:`DeployAccountTransactionTrace` have a new required field ``execution_resources``
4. :class:`EstimatedFee` has new required fields ``data_gas_consumed`` and ``data_gas_price``
5. :class:`StarknetBlock`, :class:`PendingStarknetBlock`, :class:`StarknetBlockWithTxHashes`, :class:`PendingStarknetBlockWithTxHashes` have new required fields ``l1_data_gas_price`` and ``l1_da_mode``
6. :class:`SierraContractClass` has an additional propery ``parsed_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
------------------------
- Starknet - `0.13.0 <https://docs.starknet.io/documentation/starknet_versions/version_notes/#version0.13.0>`_
- RPC - `0.6.0 <https://github.com/starkware-libs/starknet-specs/releases/tag/v0.6.0>`_
0.20.0 Breaking changes
-----------------------
1. Type of ``l1_handler`` in :class:`~starknet_py.abi.v2.model.Abi` model class for Cairo 2 has been changed from ``Function`` to ``Dict[str, Function]``
2. In :ref:`Abi` module the code related to Cairo 0 has been moved from ``starknet_py.abi`` to ``starknet_py.abi.v0``
3. :class:`StarknetEthProxyCheck` has been removed from the Proxy checks
**********************
0.19.0 Migration guide
**********************
Version 0.19.0 of **starknet.py** comes with support for RPC 0.6.0!
.. currentmodule:: starknet_py.net.client_models
New classes added to mirror the recent changes in the RPC v0.6.0 specification include:
:class:`ResourceBoundsMapping`, :class:`ResourceBounds`, :class:`PriceUnit`, :class:`FeePayment`, :class:`DAMode`.
Changes in the :class:`~starknet_py.net.account.account.Account`:
.. currentmodule:: starknet_py.net.account.account
- :meth:`~Account.execute` has been renamed to :meth:`~Account.execute_v1`
- :meth:`~Account.execute_v3` has been added
- :meth:`~Account.deploy_account` has been renamed to :meth:`~Account.deploy_account_v1`
- :meth:`~Account.deploy_account_v3` has been added
- :meth:`~Account.sign_declare_v3`, :meth:`~Account.sign_deploy_account_v3` and :meth:`~Account.sign_invoke_v3` have been added
- :meth:`sign_declare_transaction`, :meth:`sign_declare_v2_transaction`, :meth:`sign_deploy_account_transaction` and :meth:`sign_invoke_transaction` have been renamed to :meth:`~Account.sign_declare_v1`, :meth:`~Account.sign_declare_v2`, :meth:`~Account.sign_deploy_account_v1` and :meth:`~Account.sign_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 :class:`~starknet_py.contract.Contract` class.
Changes in the :class:`~starknet_py.net.full_node_client.FullNodeClient`:
.. currentmodule:: starknet_py.net.full_node_client
- :meth:`~FullNodeClient.estimate_fee` has a new parameter ``skip_validate``
- :meth:`~FullNodeClient.declare` accepts ``transaction`` argument of the type :class:`~starknet_py.net.models.transaction.DeclareV3`
- :meth:`~FullNodeClient.send_transaction` accepts ``transaction`` argument of the type :class:`~starknet_py.net.models.transaction.InvokeV3`
- :meth:`~FullNodeClient.deploy_account` accepts ``transaction`` argument of the type :class:`~starknet_py.net.models.transaction.DeployAccountV3`
Changes in the :class:`~starknet_py.contract.Contract`:
.. currentmodule:: starknet_py.contract
- :meth:`Contract.declare` has been replaced by :meth:`Contract.declare_v1`, :meth:`Contract.declare_v2` and :meth:`Contract.declare_v3`
- :meth:`Contract.deploy_contract` has been replaced by :meth:`Contract.deploy_contract_v1` and :meth:`Contract.deploy_contract_v3`. Optional parameters ``unique`` and ``salt`` have been added to both methods
- :meth:`ContractFunction.prepare` has been replaced by :meth:`ContractFunction.prepare_invoke_v1`, :meth:`ContractFunction.prepare_invoke_v3` and :meth:`ContractFunction.prepare_call`
- :meth:`ContractFunction.invoke` has been replaced by :meth:`ContractFunction.invoke_v1` and :meth:`ContractFunction.invoke_v3`
- :meth:`PreparedFunctionCall` has now only methods :meth:`PreparedFunctionCall.call` and :meth:`PreparedFunctionCall.call_raw`
- :meth:`PreparedFunctionInvokeV1` and :meth:`PreparedFunctionInvokeV3` with methods ``invoke`` and ``estimate_fee`` have been added
- :meth:`DeclareResult.deploy` has been replaced by :meth:`DeclareResult.deploy_v1` and :meth:`DeclareResult.deploy_v3`
0.19.0 Targeted versions
------------------------
- Starknet - `0.13.0 <https://docs.starknet.io/documentation/starknet_versions/version_notes/#version0.13.0>`_
- RPC - `0.6.0 <https://github.com/starkware-libs/starknet-specs/releases/tag/v0.6.0>`_
0.19.0 Breaking changes
-----------------------
Other breaking changes not mentioned above.
.. currentmodule:: starknet_py.net.client_models
1. :class:`GatewayClient` all related classes and fields have been removed.
2. Client ``net`` property has been removed.
3. :class:`Declare`, :class:`DeployAccount` and :class:`Invoke` have been renamed to :class:`~starknet_py.net.models.transaction.DeclareV1`, :class:`~starknet_py.net.models.transaction.DeployAccountV1` and :class:`~starknet_py.net.models.transaction.InvokeV1` respectively.
4. :class:`TransactionReceipt` field ``execution_resources`` has been changed from ``dict`` to :class:`ExecutionResources`.
5. :class:`TransactionReceipt` fields ``status`` and ``rejection_reason`` have been removed.
6. :class:`TransactionStatus`, :class:`TransactionExecutionStatus` and :class:`TransactionFinalityStatus` have been changed to have the same structure as in RPC specification.
7. :class:`EstimatedFee` has a new required field ``unit``.
8. :class:`EstimatedFee` field ``gas_usage`` has been renamed to ``gas_consumed``.
9. :class:`FunctionInvocation` has a new required field ``execution_resources``.
10. :class:`ResourcePrice` field ``price_in_strk`` has been renamed to ``price_in_fri`` and has now become required.
11. :class:`ResourceLimits` class has been renamed to :class:`ResourceBounds`.
12. :class:`~starknet_py.net.account.base_account.BaseAccount` and :class:`~starknet_py.net.account.account.Account` property ``supported_transaction_version`` has been removed.
13. ``wait_for_accept`` parameter in :meth:`Client.wait_for_tx` and :meth:`SentTransaction.wait_for_acceptance` has been removed.
14. :class:`InvokeTransaction` has been replaced by :class:`InvokeTransactionV0` and :class:`InvokeTransactionV1`.
15. :class:`DeclareTransaction` has been replaced by :class:`DeclareTransactionV0`, :class:`DeclareTransactionV1` and :class:`DeclareTransactionV3`.
16. :class:`DeployAccountTransaction` has been replaced by :class:`DeployAccountTransactionV1`.
0.19.0 Minor changes
--------------------
1. :class:`L1HandlerTransaction` field ``nonce`` is now required.
2. :class:`TransactionReceipt` fields ``actual_fee``, ``finality_status``, ``execution_status``, ``execution_resources`` and ``type`` are now required.
0.19.0 Development-related changes
----------------------------------
Test execution has been transitioned to the new `starknet-devnet-rs <https://github.com/0xSpaceShard/starknet-devnet-rs>`_.
To adapt to this change, it should be installed locally and added to the ``PATH``. Further information regarding this change can be found in the `Development <https://starknetpy.readthedocs.io/en/latest/development.html>`_ section.
**********************
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
------------------------
- Starknet - `0.12.2 <https://community.starknet.io/t/introducing-p2p-authentication-and-mismatch-resolution-in-v0-12-2/97993>`_
- RPC - `0.5.1 <https://github.com/starkware-libs/starknet-specs/releases/tag/v0.5.1>`_
0.18.3 Breaking changes
-----------------------
1. Support for ``TESTNET2`` network has been removed.
.. currentmodule:: starknet_py.net.client
2. :meth:`FullNodeClient.get_pending_transactions` method has been removed. It is advised to use :meth:`FullNodeClient.get_block` method with ``block_number="pending"`` argument.
.. currentmodule:: starknet_py.net.client_models
3. :class:`PendingStarknetBlock` field ``parent_hash`` is now named ``parent_block_hash``.
4. :class:`FunctionInvocation` fields ``events`` and ``messages`` have been changed from ``List[Event]`` and ``List[L2toL1Message]`` to ``List[OrderedEvent]`` and ``List[OrderedMessage]`` respectively.
5. ``cairo_version`` parameter in :meth:`Account.sign_invoke_transaction` and :meth:`Account.execute` has been removed.
0.18.3 Minor changes
--------------------
1. :class:`StarknetBlock`, :class:`StarknetBlockWithTxHashes`, :class:`PendingStarknetBlock` and :class:`PendingStarknetBlockWithTxHashes` now have two additional fields: ``starknet_version`` and ``l1_gas_price``.
2. :class:`PendingStarknetBlock` and :class:`PendingStarknetBlockWithTxHashes` fields ``timestamp``, ``sequencer_address`` and ``parent_block_hash`` are now required, not optional.
3. :class:`TransactionReceipt` now has an additional field - ``message_hash`` (for ``L1_HANDLER_TXN_RECEIPT``).
4. Most fields in ``TransactionTrace`` classes are now optional.
5. :class:`InvokeTransactionTrace`, :class:`DeclareTransactionTrace`, :class:`DeployAc
gitextract__f1r3mgr/
├── .github/
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_report.yaml
│ │ └── feature_request.yaml
│ ├── actions/
│ │ ├── compile-contracts/
│ │ │ └── action.yml
│ │ └── dispatch-compatibility-tests/
│ │ └── action.yml
│ ├── codecov.yml
│ ├── dependabot.yml
│ ├── pull_request_template.md
│ └── workflows/
│ ├── checks.yml
│ ├── compatibility-tests-dispatcher.yml
│ ├── compatibility-tests.yml
│ └── package.yml
├── .gitignore
├── .pylintrc
├── .python-version
├── .readthedocs.yml
├── .run/
│ ├── All tests.run.xml
│ ├── E2E pytest.run.xml
│ └── starkware-devnet.run.xml
├── CONTRIBUTING.md
├── LICENSE.txt
├── README.md
├── circular.py
├── docs/
│ ├── Makefile
│ ├── _ext/
│ │ ├── autoclass_with_examples.py
│ │ ├── codesnippet.py
│ │ └── test_autoclass_with_examples.py
│ ├── _static/
│ │ └── custom.css
│ ├── _templates/
│ │ └── page.html
│ ├── account_creation.rst
│ ├── api/
│ │ ├── abi.rst
│ │ ├── account.rst
│ │ ├── cairo.rst
│ │ ├── client.rst
│ │ ├── client_errors.rst
│ │ ├── client_models.rst
│ │ ├── contract.rst
│ │ ├── contract_utils.rst
│ │ ├── data_types.rst
│ │ ├── devnet_client.rst
│ │ ├── executable_models.rst
│ │ ├── full_node_client.rst
│ │ ├── hash.rst
│ │ ├── models.rst
│ │ ├── proxy_resolvers.rst
│ │ ├── serializers.rst
│ │ ├── signer.rst
│ │ ├── tip.rst
│ │ ├── transaction_errors.rst
│ │ ├── typed_data.rst
│ │ ├── udc_deployer.rst
│ │ └── websocket_client.rst
│ ├── api.rst
│ ├── conf.py
│ ├── development.rst
│ ├── devnet_utils/
│ │ └── mocking_interaction_with_l1.rst
│ ├── devnet_utils.rst
│ ├── guide/
│ │ ├── account_and_client.rst
│ │ ├── deploying_contracts.rst
│ │ ├── generating_key_pair.rst
│ │ ├── resolving_proxy_contracts.rst
│ │ ├── serialization.rst
│ │ ├── signing.rst
│ │ ├── using_existing_contracts.rst
│ │ └── websockets.rst
│ ├── guide.rst
│ ├── index.rst
│ ├── installation.rst
│ ├── make.bat
│ ├── migration_guide.rst
│ └── quickstart.rst
├── pre-commit
├── pre-push
├── pylint_todo_checker.py
├── pyproject.toml
└── starknet_py/
├── __init__.py
├── abi/
│ ├── v0/
│ │ ├── __init__.py
│ │ ├── model.py
│ │ ├── parser.py
│ │ ├── schemas.py
│ │ └── shape.py
│ ├── v1/
│ │ ├── __init__.py
│ │ ├── core_structures.json
│ │ ├── model.py
│ │ ├── parser.py
│ │ ├── parser_transformer.py
│ │ ├── schemas.py
│ │ └── shape.py
│ └── v2/
│ ├── __init__.py
│ ├── model.py
│ ├── parser.py
│ ├── parser_transformer.py
│ ├── schemas.py
│ └── shape.py
├── cairo/
│ ├── __init__.py
│ ├── data_types.py
│ ├── deprecated_parse/
│ │ ├── __init__.py
│ │ ├── cairo_types.py
│ │ ├── parser.py
│ │ └── parser_transformer.py
│ ├── felt.py
│ ├── type_parser.py
│ ├── v1/
│ │ ├── __init__.py
│ │ └── type_parser.py
│ └── v2/
│ ├── __init__.py
│ └── type_parser.py
├── common.py
├── conftest.py
├── constants.py
├── contract.py
├── contract_utils.py
├── devnet_utils/
│ ├── __init__.py
│ ├── devnet_client.py
│ ├── devnet_client_models.py
│ └── devnet_rpc_schema.py
├── hash/
│ ├── __init__.py
│ ├── address.py
│ ├── address_test.py
│ ├── blake2s.py
│ ├── casm_class_hash.py
│ ├── class_hash.py
│ ├── compiled_class_hash_objects.py
│ ├── hash_method.py
│ ├── outside_execution.py
│ ├── selector.py
│ ├── sierra_class_hash.py
│ ├── storage.py
│ ├── transaction.py
│ └── utils.py
├── net/
│ ├── __init__.py
│ ├── account/
│ │ ├── __init__.py
│ │ ├── account.py
│ │ ├── account_deployment_result.py
│ │ └── base_account.py
│ ├── client.py
│ ├── client_errors.py
│ ├── client_models.py
│ ├── client_utils.py
│ ├── executable_models.py
│ ├── full_node_client.py
│ ├── http_client.py
│ ├── models/
│ │ ├── __init__.py
│ │ ├── address.py
│ │ ├── chains.py
│ │ ├── transaction.py
│ │ └── typed_data.py
│ ├── networks.py
│ ├── schemas/
│ │ ├── __init__.py
│ │ ├── broadcasted_txn.py
│ │ ├── common.py
│ │ ├── contracts_storage_keys.py
│ │ ├── rpc/
│ │ │ ├── block.py
│ │ │ ├── contract.py
│ │ │ ├── event.py
│ │ │ ├── executables_api.py
│ │ │ ├── general.py
│ │ │ ├── storage_proof.py
│ │ │ ├── trace_api.py
│ │ │ ├── transactions.py
│ │ │ └── websockets.py
│ │ └── utils.py
│ ├── signer/
│ │ ├── __init__.py
│ │ ├── base_signer.py
│ │ ├── eth_signer.py
│ │ ├── key_pair.py
│ │ ├── ledger_signer.py
│ │ └── stark_curve_signer.py
│ ├── tip/
│ │ └── __init__.py
│ ├── udc_deployer/
│ │ ├── __init__.py
│ │ └── deployer.py
│ └── websockets/
│ ├── __init__.py
│ ├── errors.py
│ ├── models.py
│ └── websocket_client.py
├── proxy/
│ ├── __init__.py
│ ├── contract_abi_resolver.py
│ └── proxy_check.py
├── py.typed
├── serialization/
│ ├── __init__.py
│ ├── _calldata_reader.py
│ ├── _context.py
│ ├── data_serializers/
│ │ ├── __init__.py
│ │ ├── _common.py
│ │ ├── array_serializer.py
│ │ ├── bool_serializer.py
│ │ ├── byte_array_serializer.py
│ │ ├── cairo_data_serializer.py
│ │ ├── enum_serializer.py
│ │ ├── felt_serializer.py
│ │ ├── int_serializer.py
│ │ ├── named_tuple_serializer.py
│ │ ├── non_zero_serializer.py
│ │ ├── option_serializer.py
│ │ ├── output_serializer.py
│ │ ├── payload_serializer.py
│ │ ├── struct_serializer.py
│ │ ├── tuple_serializer.py
│ │ ├── uint256_serializer.py
│ │ ├── uint_serializer.py
│ │ └── unit_serializer.py
│ ├── errors.py
│ ├── factory.py
│ ├── function_serialization_adapter.py
│ └── tuple_dataclass.py
├── tests/
│ ├── __init__.py
│ ├── e2e/
│ │ ├── __init__.py
│ │ ├── account/
│ │ │ ├── __init__.py
│ │ │ ├── account_test.py
│ │ │ └── outside_execution_test.py
│ │ ├── block_test.py
│ │ ├── cairo1v2_test.py
│ │ ├── client/
│ │ │ ├── __init__.py
│ │ │ ├── client_test.py
│ │ │ ├── fixtures/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── prepare_net_for_gateway_test.py
│ │ │ │ ├── prepare_network.py
│ │ │ │ └── transactions.py
│ │ │ ├── full_node_test.py
│ │ │ └── websocket_client_test.py
│ │ ├── conftest.py
│ │ ├── contract_interaction/
│ │ │ ├── __init__.py
│ │ │ ├── declare_test.py
│ │ │ ├── deploy_test.py
│ │ │ ├── interaction_test.py
│ │ │ └── v1_interaction_test.py
│ │ ├── declare/
│ │ │ ├── __init__.py
│ │ │ └── declare_test.py
│ │ ├── deploy/
│ │ │ ├── __init__.py
│ │ │ └── deployer_test.py
│ │ ├── deploy_account/
│ │ │ ├── __init__.py
│ │ │ └── deploy_account_test.py
│ │ ├── devnet_client/
│ │ │ ├── __init__.py
│ │ │ ├── account_impersonate_test.py
│ │ │ ├── fixtures/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── accounts.py
│ │ │ │ ├── clients.py
│ │ │ │ └── contracts.py
│ │ │ ├── general_test.py
│ │ │ └── time_test.py
│ │ ├── docs/
│ │ │ ├── __init__.py
│ │ │ ├── account_creation/
│ │ │ │ ├── __init__.py
│ │ │ │ └── test_deploy_prefunded_account.py
│ │ │ ├── code_examples/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── test_account.py
│ │ │ │ ├── test_contract.py
│ │ │ │ ├── test_contract_function.py
│ │ │ │ ├── test_deployer.py
│ │ │ │ ├── test_devnet_client.py
│ │ │ │ ├── test_full_node_client.py
│ │ │ │ ├── test_prepared_function_call.py
│ │ │ │ ├── test_prepared_function_invoke_v3.py
│ │ │ │ └── test_websocket_client.py
│ │ │ ├── devnet_utils/
│ │ │ │ ├── __init__.py
│ │ │ │ └── test_l1_integration.py
│ │ │ ├── guide/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── test_account_sign_outside_transaction.py
│ │ │ │ ├── test_account_sign_without_execute.py
│ │ │ │ ├── test_cairo1_contract.py
│ │ │ │ ├── test_contract_account_compatibility.py
│ │ │ │ ├── test_contract_client_compatibility.py
│ │ │ │ ├── test_custom_nonce.py
│ │ │ │ ├── test_custom_signer.py
│ │ │ │ ├── test_declaring_contracts.py
│ │ │ │ ├── test_deploying_in_multicall.py
│ │ │ │ ├── test_deploying_with_udc.py
│ │ │ │ ├── test_executing_transactions.py
│ │ │ │ ├── test_full_node_client.py
│ │ │ │ ├── test_handling_client_errors.py
│ │ │ │ ├── test_key_pair.py
│ │ │ │ ├── test_multicall.py
│ │ │ │ ├── test_resolving_proxies.py
│ │ │ │ ├── test_serializing.py
│ │ │ │ ├── test_sign_for_fee_estimate.py
│ │ │ │ ├── test_sign_offchain_message.py
│ │ │ │ ├── test_simple_declare_and_deploy.py
│ │ │ │ ├── test_simple_declare_and_deploy_cairo1.py
│ │ │ │ ├── test_simple_deploy.py
│ │ │ │ ├── test_simple_deploy_cairo1.py
│ │ │ │ └── test_using_existing_contracts.py
│ │ │ ├── migration_guide/
│ │ │ │ ├── __init__.py
│ │ │ │ └── test_account_comparison.py
│ │ │ └── quickstart/
│ │ │ ├── __init__.py
│ │ │ ├── test_creating_account.py
│ │ │ ├── test_synchronous_api.py
│ │ │ ├── test_synchronous_full_node_client.py
│ │ │ ├── test_using_account.py
│ │ │ ├── test_using_contract.py
│ │ │ └── test_using_full_node_client.py
│ │ ├── fixtures/
│ │ │ ├── __init__.py
│ │ │ ├── abi_structures.py
│ │ │ ├── abi_v1_structures.py
│ │ │ ├── abi_v2_structures.py
│ │ │ ├── accounts.py
│ │ │ ├── clients.py
│ │ │ ├── constants.py
│ │ │ ├── contracts.py
│ │ │ ├── contracts_v1.py
│ │ │ ├── devnet.py
│ │ │ ├── devnet_ws.py
│ │ │ ├── environment_check.py
│ │ │ ├── event_loop.py
│ │ │ └── misc.py
│ │ ├── mock/
│ │ │ ├── cairo_0_contracts_abi/
│ │ │ │ ├── balance_struct_event_abi.json
│ │ │ │ └── complex_contract_abi.json
│ │ │ ├── compile_contracts.sh
│ │ │ ├── contracts_v1/
│ │ │ │ ├── .tool-versions
│ │ │ │ ├── Scarb.toml
│ │ │ │ └── src/
│ │ │ │ ├── account.cairo
│ │ │ │ ├── balance.cairo
│ │ │ │ ├── hello.cairo
│ │ │ │ ├── hello_starknet.cairo
│ │ │ │ ├── lib.cairo
│ │ │ │ ├── map.cairo
│ │ │ │ ├── minimal_contract.cairo
│ │ │ │ ├── test_contract.cairo
│ │ │ │ ├── test_contract_declare.cairo
│ │ │ │ ├── test_enum.cairo
│ │ │ │ └── test_option.cairo
│ │ │ ├── contracts_v2/
│ │ │ │ ├── .tool-versions
│ │ │ │ ├── Scarb.toml
│ │ │ │ └── src/
│ │ │ │ ├── abi_types.cairo
│ │ │ │ ├── account.cairo
│ │ │ │ ├── account_copy_1.cairo
│ │ │ │ ├── balance.cairo
│ │ │ │ ├── constructor_with_arguments.cairo
│ │ │ │ ├── erc20.cairo
│ │ │ │ ├── hello2.cairo
│ │ │ │ ├── hello_starknet.cairo
│ │ │ │ ├── l1_l2.cairo
│ │ │ │ ├── lib.cairo
│ │ │ │ ├── map.cairo
│ │ │ │ ├── map_copy_1.cairo
│ │ │ │ ├── map_copy_2.cairo
│ │ │ │ ├── minimal_contract.cairo
│ │ │ │ ├── new_syntax_test_contract.cairo
│ │ │ │ ├── simple_contract.cairo
│ │ │ │ ├── simple_storage_with_event.cairo
│ │ │ │ ├── string.cairo
│ │ │ │ ├── test_contract.cairo
│ │ │ │ ├── test_contract2.cairo
│ │ │ │ ├── test_contract3.cairo
│ │ │ │ ├── test_contract4.cairo
│ │ │ │ ├── test_enum.cairo
│ │ │ │ ├── test_option.cairo
│ │ │ │ └── token_bridge.cairo
│ │ │ ├── precompiled_contracts/
│ │ │ │ ├── argent-0.4.0/
│ │ │ │ │ ├── ArgentAccount.casm
│ │ │ │ │ └── ArgentAccount.json
│ │ │ │ ├── minimal_contract_compiled_v2_1.casm
│ │ │ │ ├── minimal_contract_compiled_v2_5_4.casm
│ │ │ │ └── starknet_contract_v2_6.casm
│ │ │ └── typed_data/
│ │ │ ├── typed_data_rev_0_example.json
│ │ │ ├── typed_data_rev_0_felt_array_example.json
│ │ │ ├── typed_data_rev_0_long_string_example.json
│ │ │ ├── typed_data_rev_0_struct_array_example.json
│ │ │ ├── typed_data_rev_0_struct_merkletree_example.json
│ │ │ ├── typed_data_rev_1_basic_types_example.json
│ │ │ ├── typed_data_rev_1_enum_example.json
│ │ │ ├── typed_data_rev_1_example.json
│ │ │ ├── typed_data_rev_1_felt_merkletree_example.json
│ │ │ └── typed_data_rev_1_preset_types_example.json
│ │ ├── test-variables.env.template
│ │ ├── tests_on_networks/
│ │ │ ├── __init__.py
│ │ │ ├── account_test.py
│ │ │ ├── client_integration_test.py
│ │ │ ├── client_test.py
│ │ │ ├── fixtures.py
│ │ │ └── trace_api_test.py
│ │ ├── utils.py
│ │ └── utils_functions_test.py
│ ├── install_devnet.sh
│ └── unit/
│ ├── __init__.py
│ ├── abi/
│ │ ├── __init__.py
│ │ ├── v0/
│ │ │ ├── __init__.py
│ │ │ ├── parser_test.py
│ │ │ └── schemas_test.py
│ │ ├── v1/
│ │ │ ├── __init__.py
│ │ │ ├── parser_test.py
│ │ │ ├── parser_transformer_test.py
│ │ │ └── schemas_test.py
│ │ └── v2/
│ │ ├── __init__.py
│ │ ├── parser_test.py
│ │ ├── parser_transformer_test.py
│ │ └── schemas_test.py
│ ├── cairo/
│ │ ├── __init__.py
│ │ ├── felt_test.py
│ │ ├── type_parser_test.py
│ │ ├── v1/
│ │ │ ├── __init__.py
│ │ │ └── type_parser_test.py
│ │ └── v2/
│ │ ├── __init__.py
│ │ └── type_parser_test.py
│ ├── common/
│ │ ├── __init__.py
│ │ └── test_common.py
│ ├── contract/
│ │ ├── __init__.py
│ │ └── contract_test.py
│ ├── hash/
│ │ ├── __init__.py
│ │ ├── blake2s_test.py
│ │ ├── casm_class_hash_test.py
│ │ ├── selector_test.py
│ │ ├── sierra_class_hash_test.py
│ │ ├── storage_test.py
│ │ ├── transaction_test.py
│ │ └── utils_test.py
│ ├── net/
│ │ ├── __init__.py
│ │ ├── account/
│ │ │ ├── __init__.py
│ │ │ └── account_test.py
│ │ ├── client_test.py
│ │ ├── models/
│ │ │ ├── __init__.py
│ │ │ ├── address_test.py
│ │ │ └── chains_test.py
│ │ ├── schemas/
│ │ │ ├── __init__.py
│ │ │ └── common_test.py
│ │ └── tip/
│ │ ├── __init__.py
│ │ └── tip_test.py
│ ├── serialization/
│ │ ├── __init__.py
│ │ ├── _calldata_reader_test.py
│ │ ├── _context_test.py
│ │ ├── data_serializers/
│ │ │ ├── __init__.py
│ │ │ ├── array_serializer_test.py
│ │ │ ├── bool_serializer_test.py
│ │ │ ├── byte_array_serializer_test.py
│ │ │ ├── enum_serializer_test.py
│ │ │ ├── felt_serializer_test.py
│ │ │ ├── int_serializer_test.py
│ │ │ ├── named_tuple_serializer_test.py
│ │ │ ├── non_zero_serializer.py
│ │ │ ├── option_serializer_test.py
│ │ │ ├── output_serializer_test.py
│ │ │ ├── payload_serializer_test.py
│ │ │ ├── struct_serializer_test.py
│ │ │ ├── tuple_serializer_test.py
│ │ │ ├── uint256_serializer_test.py
│ │ │ ├── uint_serializer_test.py
│ │ │ └── unit_serializer_test.py
│ │ ├── factory_test.py
│ │ ├── function_serialization_adapter_test.py
│ │ ├── serialization_test.py
│ │ └── tuple_dataclass_test.py
│ ├── signer/
│ │ ├── __init__.py
│ │ ├── allow_ledger_blind_signing.sh
│ │ ├── speculos_automation.json
│ │ ├── test_eth_signer.py
│ │ ├── test_key_pair.py
│ │ ├── test_ledger_signer.py
│ │ └── test_stark_curve_signer.py
│ └── utils/
│ ├── __init__.py
│ ├── merkle_tree_test.py
│ ├── sync/
│ │ ├── __init__.py
│ │ └── sync_test.py
│ └── typed_data_test.py
├── transaction_errors.py
└── utils/
├── __init__.py
├── constructor_args_translator.py
├── iterable.py
├── merkle_tree.py
├── schema.py
├── sync/
│ ├── __init__.py
│ └── sync.py
└── typed_data.py
Showing preview only (215K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (2265 symbols across 255 files)
FILE: circular.py
function _import_from_path (line 11) | def _import_from_path(module_name, file_path):
function assert_no_circular_imports (line 18) | def assert_no_circular_imports():
function test_circular_imports_absent (line 45) | def test_circular_imports_absent():
function _run_circular_import_test (line 49) | def _run_circular_import_test(module_name, import_a, import_b):
function test_circular_imports_present (line 77) | def test_circular_imports_present():
function test_circular_imports_present_with_relative_imports (line 85) | def test_circular_imports_present_with_relative_imports():
FILE: docs/_ext/autoclass_with_examples.py
class AutoclassWithExamples (line 11) | class AutoclassWithExamples(AutodocDirective):
method run (line 22) | def run(self) -> List[Node]:
function add_code_examples (line 38) | def add_code_examples(original_class: Any):
function _extract_file_properties (line 57) | def _extract_file_properties(class_name: str) -> Tuple[str, str]:
function _camel_to_snake (line 70) | def _camel_to_snake(text: str) -> str:
function _code_example_exists (line 77) | def _code_example_exists(method_name: str, file_content: str):
function _create_hint (line 81) | def _create_hint(file_name: str, method_name: str) -> str:
function _append_hint (line 97) | def _append_hint(method: Any, class_: Any, hint: str) -> None:
function setup (line 111) | def setup(app) -> Dict[str, Any]:
FILE: docs/_ext/codesnippet.py
function valid_code_snippet (line 13) | def valid_code_snippet(code_snippet: List[str]) -> bool:
class CodeSnippet (line 18) | class CodeSnippet(SphinxDirective):
method __init__ (line 37) | def __init__(self, *args, **kwargs):
method run (line 44) | def run(self) -> List[Node]:
method _get_code_snippets (line 50) | def _get_code_snippets(self) -> List[str]:
method _get_code_snippet (line 61) | def _get_code_snippet(self, lines: List[str]) -> Tuple[List[str], List...
method _end_filter (line 76) | def _end_filter(self, lines: List[str]) -> List[str]:
method _start_filter (line 86) | def _start_filter(self, lines: List[str]) -> List[str]:
method _fix_lineno_start (line 97) | def _fix_lineno_start(self, lineno):
method _set_options (line 101) | def _set_options(self) -> None:
method _set_locals (line 109) | def _set_locals(self) -> None:
method _get_end_marker (line 115) | def _get_end_marker(self) -> str:
method _get_location (line 118) | def _get_location(self) -> Tuple[str, int]:
method _get_filename (line 121) | def _get_filename(self) -> str:
method _make_node (line 126) | def _make_node(self, code_snippets) -> Node:
function setup (line 135) | def setup(app) -> Dict[str, Any]:
FILE: docs/_ext/test_autoclass_with_examples.py
function test_docstring_inheritance (line 4) | def test_docstring_inheritance():
FILE: pylint_todo_checker.py
function register (line 7) | def register(linter: "PyLinter") -> None:
class TodoTokenChecker (line 16) | class TodoTokenChecker(checkers.BaseTokenChecker):
method process_tokens (line 27) | def process_tokens(self, tokens):
FILE: starknet_py/abi/v0/model.py
class Abi (line 10) | class Abi:
class Function (line 16) | class Function:
class Event (line 26) | class Event:
FILE: starknet_py/abi/v0/parser.py
class AbiParsingError (line 27) | class AbiParsingError(ValueError):
class AbiParser (line 33) | class AbiParser:
method __init__ (line 43) | def __init__(self, abi_list: List[Dict]):
method parse (line 59) | def parse(self) -> Abi:
method type_parser (line 104) | def type_parser(self) -> TypeParser:
method _parse_structures (line 110) | def _parse_structures(self) -> Dict[str, StructType]:
method _check_for_cycles (line 161) | def _check_for_cycles(structs: Dict[str, StructType]):
method _parse_function (line 169) | def _parse_function(self, function: FunctionDict) -> Abi.Function:
method _parse_event (line 176) | def _parse_event(self, event: EventDict) -> Abi.Event:
method _parse_members (line 182) | def _parse_members(
method _group_by_entry_name (line 193) | def _group_by_entry_name(
function _to_json (line 207) | def _to_json(value):
FILE: starknet_py/abi/v0/schemas.py
class TypedParameterSchema (line 13) | class TypedParameterSchema(Schema):
class StructMemberSchema (line 18) | class StructMemberSchema(TypedParameterSchema):
class FunctionBaseSchema (line 22) | class FunctionBaseSchema(Schema):
class FunctionAbiEntrySchema (line 32) | class FunctionAbiEntrySchema(FunctionBaseSchema):
class ConstructorAbiEntrySchema (line 36) | class ConstructorAbiEntrySchema(FunctionBaseSchema):
class L1HandlerAbiEntrySchema (line 40) | class L1HandlerAbiEntrySchema(FunctionBaseSchema):
class EventAbiEntrySchema (line 44) | class EventAbiEntrySchema(Schema):
class StructAbiEntrySchema (line 55) | class StructAbiEntrySchema(Schema):
class ContractAbiEntrySchema (line 64) | class ContractAbiEntrySchema(OneOfSchema):
FILE: starknet_py/abi/v0/shape.py
class TypedMemberDict (line 18) | class TypedMemberDict(TypedDict):
class StructMemberDict (line 23) | class StructMemberDict(TypedMemberDict):
class StructDict (line 27) | class StructDict(TypedDict):
class FunctionBaseDict (line 34) | class FunctionBaseDict(TypedDict):
class FunctionDict (line 41) | class FunctionDict(FunctionBaseDict):
class ConstructorDict (line 45) | class ConstructorDict(FunctionBaseDict):
class L1HandlerDict (line 49) | class L1HandlerDict(FunctionBaseDict):
class EventDict (line 53) | class EventDict(TypedDict):
FILE: starknet_py/abi/v1/model.py
class Abi (line 10) | class Abi:
class Function (line 16) | class Function:
class Event (line 26) | class Event:
FILE: starknet_py/abi/v1/parser.py
class AbiParsingError (line 27) | class AbiParsingError(ValueError):
class AbiParser (line 33) | class AbiParser:
method __init__ (line 43) | def __init__(self, abi_list: List[Dict]):
method parse (line 64) | def parse(self) -> Abi:
method type_parser (line 98) | def type_parser(self) -> TypeParser:
method _parse_structures_and_enums (line 104) | def _parse_structures_and_enums(
method _check_for_cycles (line 162) | def _check_for_cycles(structs: Dict[str, Union[StructType, EnumType]]):
method _parse_function (line 170) | def _parse_function(self, function: FunctionDict) -> Abi.Function:
method _parse_event (line 180) | def _parse_event(self, event: EventDict) -> Abi.Event:
method _parse_members (line 186) | def _parse_members(
method _group_by_entry_name (line 197) | def _group_by_entry_name(
function _to_json (line 211) | def _to_json(value):
FILE: starknet_py/abi/v1/parser_transformer.py
class ParserTransformer (line 60) | class ParserTransformer(Transformer):
method __init__ (line 65) | def __init__(self, type_identifiers: Optional[dict] = None) -> None:
method __default__ (line 73) | def __default__(self, data: str, children, meta):
method type (line 76) | def type(self, value: List[Optional[CairoType]]) -> Optional[CairoType]:
method type_felt (line 84) | def type_felt(self, _value: List[Any]) -> FeltType:
method type_bool (line 90) | def type_bool(self, _value: List[Any]) -> BoolType:
method type_uint (line 96) | def type_uint(self, value: List[Token]) -> UintType:
method type_unit (line 102) | def type_unit(self, _value: List[Any]) -> UnitType:
method type_option (line 108) | def type_option(self, value: List[CairoType]) -> OptionType:
method type_array (line 115) | def type_array(self, value: List[CairoType]) -> ArrayType:
method type_fixed_size_array (line 121) | def type_fixed_size_array(
method type_span (line 131) | def type_span(self, value: List[CairoType]) -> ArrayType:
method type_identifier (line 137) | def type_identifier(self, tokens: List[Token]) -> TypeIdentifier:
method type_contract_address (line 150) | def type_contract_address(self, _value: List[Any]) -> FeltType:
method type_class_hash (line 156) | def type_class_hash(self, _value: List[Any]) -> FeltType:
method type_storage_address (line 162) | def type_storage_address(self, _value: List[Any]) -> FeltType:
method tuple (line 168) | def tuple(self, types: List[CairoType]) -> TupleType:
function parse (line 175) | def parse(
FILE: starknet_py/abi/v1/schemas.py
class TypeSchema (line 12) | class TypeSchema(Schema):
class TypedParameterSchema (line 16) | class TypedParameterSchema(TypeSchema):
class FunctionBaseSchema (line 20) | class FunctionBaseSchema(Schema):
class FunctionAbiEntrySchema (line 31) | class FunctionAbiEntrySchema(FunctionBaseSchema):
class EventAbiEntrySchema (line 35) | class EventAbiEntrySchema(Schema):
class StructAbiEntrySchema (line 43) | class StructAbiEntrySchema(Schema):
class EnumAbiEntrySchema (line 51) | class EnumAbiEntrySchema(Schema):
class ContractAbiEntrySchema (line 59) | class ContractAbiEntrySchema(OneOfSchema):
FILE: starknet_py/abi/v1/shape.py
class TypeDict (line 9) | class TypeDict(TypedDict):
class TypedParameterDict (line 13) | class TypedParameterDict(TypeDict):
class StructDict (line 17) | class StructDict(TypedDict):
class FunctionBaseDict (line 23) | class FunctionBaseDict(TypedDict):
class FunctionDict (line 30) | class FunctionDict(FunctionBaseDict):
class EventDict (line 34) | class EventDict(TypedDict):
class EnumDict (line 40) | class EnumDict(TypedDict):
FILE: starknet_py/abi/v2/model.py
class Abi (line 10) | class Abi:
class Function (line 18) | class Function:
class Constructor (line 28) | class Constructor:
class EventStruct (line 37) | class EventStruct:
class EventEnum (line 46) | class EventEnum:
class Interface (line 57) | class Interface:
class Impl (line 68) | class Impl:
FILE: starknet_py/abi/v2/parser.py
class AbiParsingError (line 34) | class AbiParsingError(ValueError):
class AbiParser (line 40) | class AbiParser:
method __init__ (line 50) | def __init__(self, abi_list: List[Dict]):
method parse (line 66) | def parse(self) -> Abi:
method type_parser (line 141) | def type_parser(self) -> TypeParser:
method _parse_structures_and_enums (line 147) | def _parse_structures_and_enums(
method _check_for_cycles (line 205) | def _check_for_cycles(structs: Dict[str, Union[StructType, EnumType]]):
method _parse_function (line 213) | def _parse_function(self, function: FunctionDict) -> Abi.Function:
method _parse_constructor (line 223) | def _parse_constructor(self, constructor: ConstructorDict) -> Abi.Cons...
method _parse_event (line 229) | def _parse_event(self, event: EventDict) -> EventType:
method _parse_members (line 244) | def _parse_members(
method _parse_keys (line 254) | def _parse_keys(self, params: List[EventStructMemberDict]) -> List[str]:
method _parse_interface (line 257) | def _parse_interface(self, interface: InterfaceDict) -> Abi.Interface:
method _parse_impl (line 267) | def _parse_impl(impl: ImplDict) -> Abi.Impl:
method _group_by_entry_name (line 274) | def _group_by_entry_name(
function _to_json (line 288) | def _to_json(value):
FILE: starknet_py/abi/v2/parser_transformer.py
class ParserTransformer (line 73) | class ParserTransformer(Transformer):
method __init__ (line 78) | def __init__(self, type_identifiers: Optional[dict] = None) -> None:
method __default__ (line 86) | def __default__(self, data: str, children, meta):
method type (line 89) | def type(self, value: List[Optional[CairoType]]) -> Optional[CairoType]:
method actual_type (line 97) | def actual_type(self, value) -> Optional[CairoType]:
method type_felt (line 100) | def type_felt(self, _value: List[Any]) -> FeltType:
method type_bytes (line 106) | def type_bytes(self, _value: List[Any]) -> FeltType:
method type_bool (line 112) | def type_bool(self, _value: List[Any]) -> BoolType:
method type_int (line 118) | def type_int(self, value: List[Token]) -> IntType:
method type_uint (line 124) | def type_uint(self, value: List[Token]) -> UintType:
method type_bounded_int (line 130) | def type_bounded_int(self, value: List[Token]) -> UintType:
method type_unit (line 141) | def type_unit(self, _value: List[Any]) -> UnitType:
method type_option (line 147) | def type_option(self, value: List[CairoType]) -> OptionType:
method type_array (line 154) | def type_array(self, value: List[CairoType]) -> ArrayType:
method type_fixed_size_array (line 160) | def type_fixed_size_array(
method type_span (line 171) | def type_span(self, value: List[CairoType]) -> ArrayType:
method type_identifier (line 177) | def type_identifier(self, tokens: List[Token]) -> TypeIdentifier:
method type_contract_address (line 190) | def type_contract_address(self, _value: List[Any]) -> FeltType:
method type_class_hash (line 196) | def type_class_hash(self, _value: List[Any]) -> FeltType:
method type_storage_address (line 202) | def type_storage_address(self, _value: List[Any]) -> FeltType:
method tuple (line 208) | def tuple(self, types: List[CairoType]) -> TupleType:
method type_non_zero (line 214) | def type_non_zero(self, value: List[Union[FeltType, UintType]]) -> Non...
function parse (line 221) | def parse(
FILE: starknet_py/abi/v2/schemas.py
class TypeSchema (line 19) | class TypeSchema(Schema):
class TypedParameterSchema (line 23) | class TypedParameterSchema(TypeSchema):
class FunctionBaseSchema (line 27) | class FunctionBaseSchema(Schema):
class FunctionAbiEntrySchema (line 38) | class FunctionAbiEntrySchema(FunctionBaseSchema):
class ConstructorAbiEntrySchema (line 42) | class ConstructorAbiEntrySchema(Schema):
class L1HandlerAbiEntrySchema (line 50) | class L1HandlerAbiEntrySchema(FunctionBaseSchema):
class EventStructMemberSchema (line 54) | class EventStructMemberSchema(TypedParameterSchema):
class EventStructAbiEntrySchema (line 60) | class EventStructAbiEntrySchema(Schema):
class EventEnumVariantSchema (line 69) | class EventEnumVariantSchema(TypedParameterSchema):
class EventEnumAbiEntrySchema (line 73) | class EventEnumAbiEntrySchema(Schema):
class EventAbiEntrySchema (line 82) | class EventAbiEntrySchema(OneOfSchema):
class StructAbiEntrySchema (line 91) | class StructAbiEntrySchema(Schema):
class EnumAbiEntrySchema (line 99) | class EnumAbiEntrySchema(Schema):
class ImplAbiEntrySchema (line 107) | class ImplAbiEntrySchema(Schema):
class InterfaceAbiEntrySchema (line 113) | class InterfaceAbiEntrySchema(Schema):
class ContractAbiEntrySchema (line 124) | class ContractAbiEntrySchema(OneOfSchema):
FILE: starknet_py/abi/v2/shape.py
class TypeDict (line 19) | class TypeDict(TypedDict):
class TypedParameterDict (line 23) | class TypedParameterDict(TypeDict):
class StructDict (line 27) | class StructDict(TypedDict):
class FunctionBaseDict (line 33) | class FunctionBaseDict(TypedDict):
class FunctionDict (line 40) | class FunctionDict(FunctionBaseDict):
class ConstructorDict (line 44) | class ConstructorDict(TypedDict):
class L1HandlerDict (line 50) | class L1HandlerDict(FunctionBaseDict):
class EventBaseDict (line 54) | class EventBaseDict(TypedDict):
class EventStructMemberDict (line 59) | class EventStructMemberDict(TypedParameterDict):
class EventStructDict (line 63) | class EventStructDict(EventBaseDict):
class EventEnumVariantDict (line 68) | class EventEnumVariantDict(TypedParameterDict):
class EventEnumDict (line 72) | class EventEnumDict(EventBaseDict):
class EnumDict (line 80) | class EnumDict(TypedDict):
class ImplDict (line 86) | class ImplDict(TypedDict):
class InterfaceDict (line 92) | class InterfaceDict(TypedDict):
FILE: starknet_py/cairo/data_types.py
class CairoType (line 9) | class CairoType(ABC):
class FeltType (line 16) | class FeltType(CairoType):
class BoolType (line 23) | class BoolType(CairoType):
class TupleType (line 30) | class TupleType(CairoType):
class NamedTupleType (line 39) | class NamedTupleType(CairoType):
class ArrayType (line 48) | class ArrayType(CairoType):
class FixedSizeArrayType (line 57) | class FixedSizeArrayType(CairoType):
class StructType (line 67) | class StructType(CairoType):
class EnumType (line 78) | class EnumType(CairoType):
class OptionType (line 88) | class OptionType(CairoType):
class IntType (line 97) | class IntType(CairoType):
class UintType (line 106) | class UintType(CairoType):
method check_range (line 113) | def check_range(self, value: int):
class TypeIdentifier (line 120) | class TypeIdentifier(CairoType):
class UnitType (line 129) | class UnitType(CairoType):
class EventType (line 136) | class EventType(CairoType):
class NonZeroType (line 147) | class NonZeroType(CairoType):
FILE: starknet_py/cairo/deprecated_parse/cairo_types.py
class CairoType (line 5) | class CairoType:
class TypeFelt (line 12) | class TypeFelt(CairoType):
class TypeCodeoffset (line 17) | class TypeCodeoffset(CairoType):
class TypePointer (line 22) | class TypePointer(CairoType):
class TypeIdentifier (line 27) | class TypeIdentifier(CairoType):
class TypeStruct (line 37) | class TypeStruct(CairoType):
class TypeFunction (line 42) | class TypeFunction(CairoType):
class TypeTuple (line 51) | class TypeTuple(CairoType):
class Item (line 58) | class Item(CairoType):
method is_named (line 71) | def is_named(self) -> bool:
class ExprIdentifier (line 76) | class ExprIdentifier(CairoType):
FILE: starknet_py/cairo/deprecated_parse/parser.py
function parse (line 30) | def parse(code: str) -> CairoType:
FILE: starknet_py/cairo/deprecated_parse/parser_transformer.py
class ParserContext (line 19) | class ParserContext:
class ParserError (line 28) | class ParserError(Exception):
class CommaSeparated (line 35) | class CommaSeparated:
class ParserTransformer (line 44) | class ParserTransformer(Transformer):
method __init__ (line 51) | def __init__(self):
method __default__ (line 55) | def __default__(self, data: str, children, meta):
method comma_separated (line 58) | def comma_separated(self, value) -> CommaSeparated:
method named_type (line 82) | def named_type(self, meta, value) -> TypeTuple.Item:
method type_felt (line 104) | def type_felt(self, meta, value):
method type_codeoffset (line 108) | def type_codeoffset(self, meta, value):
method type_struct (line 111) | def type_struct(self, value):
method type_pointer (line 120) | def type_pointer(self, meta, value):
method type_pointer2 (line 124) | def type_pointer2(self, meta, value):
method type_tuple (line 128) | def type_tuple(self, meta, value: Tuple[CommaSeparated]):
method identifier (line 133) | def identifier(self, meta, value):
method identifier_def (line 137) | def identifier_def(self, meta, value):
FILE: starknet_py/cairo/felt.py
function uint256_range_check (line 12) | def uint256_range_check(value: int):
function is_in_felt_range (line 23) | def is_in_felt_range(value: int) -> bool:
function cairo_vm_range_check (line 27) | def cairo_vm_range_check(value: int):
function encode_shortstring (line 34) | def encode_shortstring(text: str) -> int:
function decode_shortstring (line 56) | def decode_shortstring(value: int) -> str:
FILE: starknet_py/cairo/type_parser.py
class UnknownCairoTypeError (line 18) | class UnknownCairoTypeError(ValueError):
method __init__ (line 25) | def __init__(self, type_name: str):
class TypeParser (line 30) | class TypeParser:
method __init__ (line 37) | def __init__(self, defined_types: Dict[str, StructType]):
method parse_inline_type (line 50) | def parse_inline_type(self, type_string: str) -> CairoType:
method _transform_cairo_lang_type (line 61) | def _transform_cairo_lang_type(
method _get_struct (line 118) | def _get_struct(self, name: str):
FILE: starknet_py/cairo/v1/type_parser.py
class UnknownCairoTypeError (line 9) | class UnknownCairoTypeError(ValueError):
method __init__ (line 16) | def __init__(self, type_name: str):
class TypeParser (line 24) | class TypeParser:
method __init__ (line 31) | def __init__(self, defined_types: Dict[str, Union[StructType, EnumType...
method parse_inline_type (line 44) | def parse_inline_type(self, type_string: str) -> CairoType:
FILE: starknet_py/cairo/v2/type_parser.py
class UnknownCairoTypeError (line 15) | class UnknownCairoTypeError(ValueError):
method __init__ (line 22) | def __init__(self, type_name: str):
class TypeParser (line 30) | class TypeParser:
method __init__ (line 37) | def __init__(
method update_defined_types (line 52) | def update_defined_types(
method add_defined_type (line 57) | def add_defined_type(
method parse_inline_type (line 62) | def parse_inline_type(self, type_string: str) -> CairoType:
FILE: starknet_py/common.py
function create_compiled_contract (line 20) | def create_compiled_contract(
function create_sierra_compiled_contract (line 36) | def create_sierra_compiled_contract(compiled_contract: str) -> SierraCom...
function create_contract_class (line 49) | def create_contract_class(
function create_casm_class (line 69) | def create_casm_class(compiled_contract: str) -> CasmClass:
function int_from_hex (line 87) | def int_from_hex(number: Union[str, int]) -> int:
function int_from_bytes (line 91) | def int_from_bytes(
FILE: starknet_py/constants.py
class OutsideExecutionInterfaceID (line 51) | class OutsideExecutionInterfaceID(IntEnum):
FILE: starknet_py/contract.py
class ContractData (line 63) | class ContractData:
method parsed_abi (line 73) | def parsed_abi(self) -> Union[AbiV0, AbiV1, AbiV2]:
method from_abi (line 86) | def from_abi(address: int, abi: ABI, cairo_version: int = 1) -> Contra...
class SentTransaction (line 104) | class SentTransaction:
method wait_for_acceptance (line 119) | async def wait_for_acceptance(
class InvokeResult (line 143) | class InvokeResult(SentTransaction):
method __post_init__ (line 155) | def __post_init__(self):
class DeclareResult (line 162) | class DeclareResult(SentTransaction):
method __post_init__ (line 179) | def __post_init__(self):
method deploy_v3 (line 192) | async def deploy_v3(
method _get_abi (line 240) | def _get_abi(self) -> List:
class DeployResult (line 260) | class DeployResult(SentTransaction):
method __post_init__ (line 269) | def __post_init__(self):
class PreparedCallBase (line 275) | class PreparedCallBase(Call):
class PreparedFunctionCall (line 284) | class PreparedFunctionCall(PreparedCallBase):
method call_raw (line 289) | async def call_raw(
method call (line 305) | async def call(
class PreparedFunctionInvoke (line 323) | class PreparedFunctionInvoke(ABC, PreparedCallBase):
method __post_init__ (line 327) | def __post_init__(self):
method get_account (line 335) | def get_account(self):
method estimate_fee (line 344) | async def estimate_fee(
method _invoke (line 362) | async def _invoke(self, transaction: InvokeV3) -> InvokeResult:
class PreparedFunctionInvokeV3 (line 377) | class PreparedFunctionInvokeV3(PreparedFunctionInvoke):
method invoke (line 386) | async def invoke(
method estimate_fee (line 423) | async def estimate_fee(
class ContractFunction (line 448) | class ContractFunction:
method __init__ (line 449) | def __init__(
method prepare_call (line 493) | def prepare_call(
method call (line 515) | async def call(
method prepare_invoke_v3 (line 535) | def prepare_invoke_v3(
method invoke_v3 (line 566) | async def invoke_v3(
method get_selector (line 603) | def get_selector(function_name: str):
class Contract (line 615) | class Contract:
method __init__ (line 620) | def __init__(
method functions (line 657) | def functions(self) -> FunctionsRepository:
method address (line 664) | def address(self) -> int:
method from_address (line 669) | async def from_address(
method declare_v3 (line 711) | async def declare_v3(
method deploy_contract_v3 (line 763) | async def deploy_contract_v3(
method _make_functions (line 839) | def _make_functions(
method _create_proxy_config (line 884) | def _create_proxy_config(proxy_config) -> ProxyConfig:
function _declare_contract (line 891) | async def _declare_contract(
FILE: starknet_py/contract_utils.py
function _extract_compiled_class_hash (line 10) | def _extract_compiled_class_hash(
function _unpack_provider (line 30) | def _unpack_provider(
FILE: starknet_py/devnet_utils/devnet_client.py
class DevnetClient (line 35) | class DevnetClient(FullNodeClient):
method __init__ (line 36) | def __init__(
method impersonate_account (line 56) | async def impersonate_account(self, address: Hash):
method stop_impersonate_account (line 69) | async def stop_impersonate_account(self, address: Hash):
method auto_impersonate (line 81) | async def auto_impersonate(self):
method stop_auto_impersonate (line 90) | async def stop_auto_impersonate(self):
method mint (line 93) | async def mint(
method get_account_balance (line 115) | async def get_account_balance(
method create_block (line 140) | async def create_block(self) -> str:
method abort_block (line 149) | async def abort_block(
method dump (line 172) | async def dump(self, path: str):
method load (line 185) | async def load(self, path: str):
method restart (line 197) | async def restart(self):
method postman_load (line 206) | async def postman_load(
method postman_flush (line 231) | async def postman_flush(self, dry_run: bool = False) -> PostmanFlushRe...
method send_message_to_l2 (line 248) | async def send_message_to_l2(
method consume_message_from_l2 (line 288) | async def consume_message_from_l2(
method get_predeployed_accounts (line 316) | async def get_predeployed_accounts(
method get_config (line 333) | async def get_config(self) -> Config:
method increase_time (line 342) | async def increase_time(self, time: int) -> IncreaseTimeResponse:
method set_time (line 356) | async def set_time(
function _to_eth_address (line 375) | def _to_eth_address(value: Hash) -> str:
FILE: starknet_py/devnet_utils/devnet_client_models.py
class MintResponse (line 8) | class MintResponse:
class BalanceRecord (line 19) | class BalanceRecord:
class Balance (line 25) | class Balance:
class MessageToL1 (line 31) | class MessageToL1:
class MessageToL2 (line 38) | class MessageToL2:
class PostmanFlushResponse (line 48) | class PostmanFlushResponse:
class PredeployedAccount (line 56) | class PredeployedAccount:
class ForkConfig (line 65) | class ForkConfig:
class ServerConfig (line 71) | class ServerConfig:
class Config (line 80) | class Config:
class IncreaseTimeResponse (line 103) | class IncreaseTimeResponse:
class SetTimeResponse (line 109) | class SetTimeResponse:
FILE: starknet_py/devnet_utils/devnet_rpc_schema.py
class MintResponseSchema (line 23) | class MintResponseSchema(Schema):
method make_dataclass (line 29) | def make_dataclass(self, data, **kwargs) -> MintResponse:
class BalanceRecordSchema (line 33) | class BalanceRecordSchema(Schema):
method make_dataclass (line 38) | def make_dataclass(self, data, **kwargs) -> BalanceRecord:
class BalanceSchema (line 42) | class BalanceSchema(Schema):
method make_dataclass (line 47) | def make_dataclass(self, data, **kwargs) -> Balance:
class MessageToL1Schema (line 51) | class MessageToL1Schema(Schema):
method make_dataclass (line 57) | def make_dataclass(self, data, **kwargs) -> MessageToL1:
class MessageToL2Schema (line 61) | class MessageToL2Schema(Schema):
method make_dataclass (line 70) | def make_dataclass(self, data, **kwargs) -> MessageToL2:
class PostmanFlushResponseSchema (line 74) | class PostmanFlushResponseSchema(Schema):
method make_dataclass (line 87) | def make_dataclass(self, data, **kwargs) -> PostmanFlushResponse:
class PredeployedAccountSchema (line 91) | class PredeployedAccountSchema(Schema):
method make_dataclass (line 101) | def make_dataclass(self, data, **kwargs) -> PredeployedAccount:
class ForkConfigSchema (line 105) | class ForkConfigSchema(Schema):
method make_dataclass (line 112) | def make_dataclass(self, data, **kwargs) -> ForkConfig:
class ServerConfigSchema (line 116) | class ServerConfigSchema(Schema):
method make_dataclass (line 125) | def make_dataclass(self, data, **kwargs) -> ServerConfig:
class ConfigSchema (line 129) | class ConfigSchema(Schema):
method make_dataclass (line 165) | def make_dataclass(self, data, **kwargs) -> Config:
class IncreasedTimeResponseSchema (line 169) | class IncreasedTimeResponseSchema(Schema):
method make_dataclass (line 176) | def make_dataclass(self, data, **kwargs) -> IncreaseTimeResponse:
class SetTimeResponseSchema (line 180) | class SetTimeResponseSchema(Schema):
method make_dataclass (line 185) | def make_dataclass(self, data, **kwargs) -> SetTimeResponse:
FILE: starknet_py/hash/address.py
function compute_address (line 13) | def compute_address(
function get_checksum_address (line 44) | def get_checksum_address(address: str) -> str:
function is_checksum_address (line 75) | def is_checksum_address(address: str) -> bool:
FILE: starknet_py/hash/address_test.py
function test_compute_address (line 10) | def test_compute_address():
function test_compute_address_with_deployer_address (line 21) | def test_compute_address_with_deployer_address():
function test_get_checksum_address (line 55) | def test_get_checksum_address(address, checksum_address):
function test_get_checksum_address_raises_on_invalid_address (line 60) | def test_get_checksum_address_raises_on_invalid_address(address):
function test_is_checksum_address (line 72) | def test_is_checksum_address(address, is_checksum):
FILE: starknet_py/hash/blake2s.py
function encode_felts_to_u32s (line 16) | def encode_felts_to_u32s(felts: List[int]) -> List[int]:
function pack_256_le_to_felt (line 50) | def pack_256_le_to_felt(hash_bytes: bytes) -> int:
function blake2s_to_felt (line 63) | def blake2s_to_felt(data: bytes) -> int:
function encode_felt252_data_and_calc_blake_hash (line 74) | def encode_felt252_data_and_calc_blake_hash(felts: List[int]) -> int:
function blake2s_hash_many (line 95) | def blake2s_hash_many(values: List[int]) -> int:
FILE: starknet_py/hash/casm_class_hash.py
function get_casm_hash_method_for_starknet_version (line 20) | def get_casm_hash_method_for_starknet_version(starknet_version: Version)...
function compute_casm_class_hash (line 28) | def compute_casm_class_hash(
function _entry_points_array (line 68) | def _entry_points_array(
function create_bytecode_segment_structure (line 88) | def create_bytecode_segment_structure(
function _create_bytecode_segment_structure_inner (line 114) | def _create_bytecode_segment_structure_inner(
FILE: starknet_py/hash/class_hash.py
function compute_class_hash (line 12) | def compute_class_hash(contract_class: DeprecatedContractClass) -> int:
function _entry_points_array (line 54) | def _entry_points_array(entry_points: List[EntryPoint]) -> List[int]:
function _compute_hinted_class_hash (line 62) | def _compute_hinted_class_hash(contract_class: DeprecatedContractClass) ...
function _fix_cairo_types (line 79) | def _fix_cairo_types(identifiers: dict) -> dict:
function _add_backward_compatibility_space (line 98) | def _add_backward_compatibility_space(cairo_type: str) -> str:
function _delete_backward_compatibility_fields (line 102) | def _delete_backward_compatibility_fields(program) -> dict:
FILE: starknet_py/hash/compiled_class_hash_objects.py
class BytecodeSegmentStructure (line 13) | class BytecodeSegmentStructure(ABC):
method hash (line 21) | def hash(self, hash_method: "HashMethod") -> int:
method bytecode_with_skipped_segments (line 28) | def bytecode_with_skipped_segments(self):
method add_bytecode_with_skipped_segments (line 38) | def add_bytecode_with_skipped_segments(self, data: List[int]):
class BytecodeLeaf (line 45) | class BytecodeLeaf(BytecodeSegmentStructure):
method hash (line 52) | def hash(self, hash_method: "HashMethod") -> int:
method add_bytecode_with_skipped_segments (line 55) | def add_bytecode_with_skipped_segments(self, data: List[int]):
class BytecodeSegmentedNode (line 60) | class BytecodeSegmentedNode(BytecodeSegmentStructure):
method hash (line 68) | def hash(self, hash_method: "HashMethod") -> int:
method add_bytecode_with_skipped_segments (line 86) | def add_bytecode_with_skipped_segments(self, data: List[int]):
class BytecodeSegment (line 96) | class BytecodeSegment:
method __post_init__ (line 112) | def __post_init__(self):
FILE: starknet_py/hash/hash_method.py
class HashMethod (line 10) | class HashMethod(Enum):
method hash (line 19) | def hash(self, left: int, right: int):
method hash_many (line 28) | def hash_many(self, values: List[int]):
FILE: starknet_py/hash/outside_execution.py
function outside_execution_to_typed_data (line 13) | def outside_execution_to_typed_data(
FILE: starknet_py/hash/selector.py
function get_selector_from_name (line 9) | def get_selector_from_name(func_name: str) -> int:
FILE: starknet_py/hash/sierra_class_hash.py
function compute_sierra_class_hash (line 14) | def compute_sierra_class_hash(
function _entry_points_array (line 54) | def _entry_points_array(entry_points: List[SierraEntryPoint]) -> List[int]:
FILE: starknet_py/hash/storage.py
function get_storage_var_address (line 7) | def get_storage_var_address(var_name: str, *args: int) -> int:
FILE: starknet_py/hash/transaction.py
class TransactionHashPrefix (line 25) | class TransactionHashPrefix(IntEnum):
class CommonTransactionV3Fields (line 38) | class CommonTransactionV3Fields:
method compute_common_tx_fields (line 52) | def compute_common_tx_fields(self):
method compute_resource_bounds_for_fee (line 64) | def compute_resource_bounds_for_fee(self) -> List[int]:
method get_data_availability_modes (line 85) | def get_data_availability_modes(self) -> int:
function compute_transaction_hash (line 92) | def compute_transaction_hash(
function compute_invoke_transaction_hash (line 148) | def compute_invoke_transaction_hash(
function compute_invoke_v3_transaction_hash (line 180) | def compute_invoke_v3_transaction_hash(
function compute_deploy_account_transaction_hash (line 208) | def compute_deploy_account_transaction_hash(
function compute_deploy_account_v3_transaction_hash (line 243) | def compute_deploy_account_v3_transaction_hash(
function compute_declare_transaction_hash (line 269) | def compute_declare_transaction_hash(
function compute_declare_v2_transaction_hash (line 302) | def compute_declare_v2_transaction_hash(
function compute_declare_v3_transaction_hash (line 343) | def compute_declare_v3_transaction_hash(
FILE: starknet_py/hash/utils.py
function _starknet_keccak (line 20) | def _starknet_keccak(data: bytes) -> int:
function keccak256 (line 29) | def keccak256(data: bytes) -> int:
function pedersen_hash (line 35) | def pedersen_hash(left: int, right: int) -> int:
function compute_hash_on_elements (line 42) | def compute_hash_on_elements(data: Sequence) -> int:
function message_signature (line 54) | def message_signature(
function verify_message_signature (line 63) | def verify_message_signature(
function private_to_stark_key (line 75) | def private_to_stark_key(priv_key: int) -> int:
function encode_uint (line 82) | def encode_uint(value: int, bytes_length: int = 32) -> bytes:
function encode_uint_list (line 86) | def encode_uint_list(data: List[int]) -> bytes:
function get_bytes_length (line 90) | def get_bytes_length(value: int) -> int:
FILE: starknet_py/net/account/account.py
class Account (line 63) | class Account(BaseAccount, OutsideExecutionSupportBaseMixin):
method __init__ (line 76) | def __init__(
method address (line 122) | def address(self) -> int:
method cairo_version (line 126) | async def cairo_version(self) -> int:
method client (line 138) | def client(self) -> Client:
method _get_tip (line 141) | async def _get_tip(self, *, tip: Optional[int], auto_estimate_tip: boo...
method _get_resource_bounds (line 155) | async def _get_resource_bounds(
method _prepare_invoke_v3 (line 179) | async def _prepare_invoke_v3(
method estimate_fee (line 224) | async def estimate_fee(
method get_nonce (line 244) | async def get_nonce(
method _check_outside_execution_nonce (line 261) | async def _check_outside_execution_nonce(
method get_outside_execution_nonce (line 279) | async def get_outside_execution_nonce(self, retry_count=10) -> int:
method _get_outside_execution_version (line 287) | async def _get_outside_execution_version(
method supports_interface (line 298) | async def supports_interface(
method get_balance (line 310) | async def get_balance(
method sign_for_fee_estimate (line 338) | async def sign_for_fee_estimate(
method sign_outside_execution_call (line 347) | async def sign_outside_execution_call(
method sign_invoke_v3 (line 397) | async def sign_invoke_v3(
method sign_declare_v3 (line 423) | async def sign_declare_v3(
method _make_declare_v3_transaction (line 450) | async def _make_declare_v3_transaction(
method sign_deploy_account_v3 (line 480) | async def sign_deploy_account_v3(
method execute_v3 (line 515) | async def execute_v3(
method sign_message (line 540) | def sign_message(self, typed_data: Union[TypedData, TypedDataDict]) ->...
method verify_message (line 546) | def verify_message(
method deploy_account_v3 (line 555) | async def deploy_account_v3(
method _get_chain_id (line 625) | async def _get_chain_id(self) -> int:
function _prepare_account_to_deploy (line 633) | def _prepare_account_to_deploy(
function _is_sierra_contract (line 666) | def _is_sierra_contract(data: Dict[str, Any]) -> bool:
function _add_signature_to_transaction (line 670) | def _add_signature_to_transaction(
function _add_max_fee_to_transaction (line 676) | def _add_max_fee_to_transaction(
function _add_resource_bounds_to_transaction (line 682) | def _add_resource_bounds_to_transaction(
function _parse_calls (line 688) | def _parse_calls(cairo_version: int, calls: Calls) -> List[int]:
function _parse_call_cairo_v0 (line 702) | def _parse_call_cairo_v0(call: Call, entire_calldata: List) -> Tuple[Dic...
function _merge_calls (line 714) | def _merge_calls(calls: Iterable[Call]) -> Tuple[List[Dict], List[int]]:
function _parse_calls_cairo_v1 (line 724) | def _parse_calls_cairo_v1(calls: Iterable[Call]) -> List[Dict]:
FILE: starknet_py/net/account/account_deployment_result.py
class AccountDeploymentResult (line 9) | class AccountDeploymentResult(SentTransaction):
method __post_init__ (line 17) | def __post_init__(self):
FILE: starknet_py/net/account/base_account.py
class OutsideExecutionSupportBaseMixin (line 27) | class OutsideExecutionSupportBaseMixin(ABC):
method get_outside_execution_nonce (line 30) | async def get_outside_execution_nonce(self) -> int:
method supports_interface (line 36) | async def supports_interface(
method sign_outside_execution_call (line 44) | async def sign_outside_execution_call(
class BaseAccount (line 65) | class BaseAccount(OutsideExecutionSupportBaseMixin, ABC):
method address (line 74) | def address(self) -> int:
method cairo_version (line 81) | async def cairo_version(self) -> int:
method client (line 88) | def client(self) -> Client:
method estimate_fee (line 94) | async def estimate_fee(
method get_nonce (line 115) | async def get_nonce(
method get_balance (line 130) | async def get_balance(
method sign_for_fee_estimate (line 148) | async def sign_for_fee_estimate(
method sign_invoke_v3 (line 161) | async def sign_invoke_v3(
method sign_declare_v3 (line 189) | async def sign_declare_v3(
method sign_deploy_account_v3 (line 217) | async def sign_deploy_account_v3(
method execute_v3 (line 247) | async def execute_v3(
method sign_message (line 275) | def sign_message(self, typed_data: TypedDataDict) -> List[int]:
method verify_message (line 286) | def verify_message(self, typed_data: TypedDataDict, signature: List[in...
FILE: starknet_py/net/client.py
class Client (line 57) | class Client(ABC):
method get_block (line 60) | async def get_block(
method get_block_with_txs (line 76) | async def get_block_with_txs(
method get_block_with_tx_hashes (line 92) | async def get_block_with_tx_hashes(
method get_block_with_receipts (line 106) | async def get_block_with_receipts(
method trace_block_transactions (line 122) | async def trace_block_transactions(
method get_state_update (line 138) | async def get_state_update(
method get_storage_at (line 155) | async def get_storage_at(
method get_storage_proof (line 174) | async def get_storage_proof(
method get_transaction (line 195) | async def get_transaction(
method get_transaction_receipt (line 208) | async def get_transaction_receipt(
method get_transaction_status (line 220) | async def get_transaction_status(self, tx_hash: Hash) -> TransactionSt...
method wait_for_tx (line 230) | async def wait_for_tx(
method estimate_fee (line 305) | async def estimate_fee(
method call_contract (line 326) | async def call_contract(
method send_transaction (line 342) | async def send_transaction(
method deploy_account (line 354) | async def deploy_account(
method declare (line 365) | async def declare(self, transaction: DeclareV3) -> DeclareTransactionR...
method get_class_hash_at (line 374) | async def get_class_hash_at(
method get_class_by_hash (line 390) | async def get_class_by_hash(
method get_contract_nonce (line 401) | async def get_contract_nonce(
method get_chain_id (line 417) | async def get_chain_id(self) -> str:
method get_messages_status (line 421) | async def get_messages_status(self, transaction_hash: Hash) -> List[Me...
method get_compiled_casm (line 430) | async def get_compiled_casm(self, class_hash: int) -> CasmClass:
method spec_version (line 439) | async def spec_version(self) -> str:
FILE: starknet_py/net/client_errors.py
class ClientError (line 7) | class ClientError(Exception):
method __init__ (line 12) | def __init__(
class ContractNotFoundError (line 25) | class ContractNotFoundError(ClientError):
method __init__ (line 30) | def __init__(
FILE: starknet_py/net/client_models.py
class Call (line 40) | class Call:
class Event (line 54) | class Event:
class _EmittedEventBase (line 65) | class _EmittedEventBase(Event):
class _EmittedEventDefaultBase (line 72) | class _EmittedEventDefaultBase(Event):
class EmittedEvent (line 78) | class EmittedEvent(_EmittedEventDefaultBase, _EmittedEventBase):
class EventsChunk (line 85) | class EventsChunk:
class L2toL1Message (line 95) | class L2toL1Message:
class ResourcePrice (line 106) | class ResourcePrice:
class ResourceBounds (line 116) | class ResourceBounds:
method init_with_zeros (line 125) | def init_with_zeros():
class OutsideExecutionTimeBounds (line 130) | class OutsideExecutionTimeBounds:
method execute_after_timestamp (line 140) | def execute_after_timestamp(self) -> int:
method execute_before_timestamp (line 144) | def execute_before_timestamp(self) -> int:
class ResourceBoundsMapping (line 149) | class ResourceBoundsMapping:
method init_with_zeros (line 159) | def init_with_zeros():
class PriceUnit (line 167) | class PriceUnit(Enum):
class FeePayment (line 177) | class FeePayment:
class DAMode (line 186) | class DAMode(Enum):
class L1DAMode (line 195) | class L1DAMode(Enum):
class TransactionType (line 200) | class TransactionType(Enum):
class Transaction (line 213) | class Transaction(ABC):
method __post_init__ (line 224) | def __post_init__(self):
class DeprecatedTransaction (line 230) | class DeprecatedTransaction(Transaction):
method __post_init__ (line 237) | def __post_init__(self):
class TransactionV3 (line 243) | class TransactionV3(Transaction):
method __post_init__ (line 254) | def __post_init__(self):
class InvokeTransactionV0 (line 260) | class InvokeTransactionV0(DeprecatedTransaction):
class InvokeTransactionV1 (line 271) | class InvokeTransactionV1(DeprecatedTransaction):
class InvokeTransactionV3 (line 286) | class InvokeTransactionV3(TransactionV3):
class DeclareTransactionV0 (line 299) | class DeclareTransactionV0(DeprecatedTransaction):
class DeclareTransactionV1 (line 309) | class DeclareTransactionV1(DeprecatedTransaction):
class DeclareTransactionV2 (line 324) | class DeclareTransactionV2(DeprecatedTransaction):
class DeclareTransactionV3 (line 340) | class DeclareTransactionV3(TransactionV3):
class DeployTransaction (line 353) | class DeployTransaction(Transaction):
class DeployAccountTransactionV1 (line 364) | class DeployAccountTransactionV1(DeprecatedTransaction):
class DeployAccountTransactionV3 (line 380) | class DeployAccountTransactionV3(TransactionV3):
class L1HandlerTransaction (line 392) | class L1HandlerTransaction(Transaction):
class TransactionStatus (line 403) | class TransactionStatus(Enum):
class TransactionStatusWithoutL1 (line 415) | class TransactionStatusWithoutL1(Enum):
class TransactionExecutionStatus (line 426) | class TransactionExecutionStatus(Enum):
class TransactionFinalityStatus (line 435) | class TransactionFinalityStatus(Enum):
class TransactionFinalityStatusWithoutL1 (line 445) | class TransactionFinalityStatusWithoutL1(Enum):
class InnerCallExecutionResources (line 455) | class InnerCallExecutionResources:
class ExecutionResources (line 465) | class ExecutionResources:
class TransactionReceipt (line 477) | class TransactionReceipt:
class TransactionReceiptWithBlockInfo (line 501) | class TransactionReceiptWithBlockInfo(TransactionReceipt):
class TransactionWithReceipt (line 511) | class TransactionWithReceipt:
class SentTransactionResponse (line 517) | class SentTransactionResponse:
class DeclareTransactionResponse (line 527) | class DeclareTransactionResponse(SentTransactionResponse):
class DeployAccountTransactionResponse (line 536) | class DeployAccountTransactionResponse(SentTransactionResponse):
class BlockStatus (line 544) | class BlockStatus(Enum):
class PreConfirmedBlockHeader (line 555) | class PreConfirmedBlockHeader:
class PreConfirmedStarknetBlock (line 568) | class PreConfirmedStarknetBlock(PreConfirmedBlockHeader):
class PreConfirmedStarknetBlockWithTxHashes (line 577) | class PreConfirmedStarknetBlockWithTxHashes(PreConfirmedBlockHeader):
class PreConfirmedStarknetBlockWithReceipts (line 586) | class PreConfirmedStarknetBlockWithReceipts(PreConfirmedBlockHeader):
class BlockHeader (line 595) | class BlockHeader:
class StarknetBlock (line 623) | class StarknetBlock(BlockHeader):
class StarknetBlockWithTxHashes (line 633) | class StarknetBlockWithTxHashes(BlockHeader):
class TransactionResponseFlag (line 642) | class TransactionResponseFlag(str, Enum):
class StorageResponseFlag (line 650) | class StorageResponseFlag(str, Enum):
class StorageResult (line 659) | class StorageResult:
class StarknetBlockWithReceipts (line 670) | class StarknetBlockWithReceipts(BlockHeader):
class BlockHashAndNumber (line 680) | class BlockHashAndNumber:
class SyncStatus (line 686) | class SyncStatus:
class StorageEntry (line 696) | class StorageEntry:
class StorageDiffItem (line 706) | class StorageDiffItem:
class EstimatedFee (line 716) | class EstimatedFee:
method to_resource_bounds (line 731) | def to_resource_bounds(
method calculate_overall_fee (line 763) | def calculate_overall_fee(self):
class DeployedContract (line 772) | class DeployedContract:
class ContractsNonce (line 782) | class ContractsNonce:
class DeclaredContractHash (line 792) | class DeclaredContractHash:
class ReplacedClass (line 802) | class ReplacedClass:
class MigratedClass (line 812) | class MigratedClass:
class StateDiff (line 822) | class StateDiff:
class BlockStateUpdate (line 837) | class BlockStateUpdate:
class PreConfirmedBlockStateUpdate (line 849) | class PreConfirmedBlockStateUpdate:
class EntryPoint (line 859) | class EntryPoint:
class EntryPointsByType (line 869) | class EntryPointsByType:
class _DeprecatedContract (line 880) | class _DeprecatedContract:
class DeprecatedContractClass (line 890) | class DeprecatedContractClass(_DeprecatedContract):
class DeprecatedCompiledContract (line 899) | class DeprecatedCompiledContract(_DeprecatedContract):
method convert_to_deprecated_contract_class (line 909) | def convert_to_deprecated_contract_class(self) -> DeprecatedContractCl...
class SierraEntryPoint (line 921) | class SierraEntryPoint:
class SierraEntryPointsByType (line 931) | class SierraEntryPointsByType:
class _SierraContract (line 942) | class _SierraContract:
class SierraContractClass (line 950) | class SierraContractClass(_SierraContract):
method parsed_abi (line 958) | def parsed_abi(self) -> Union[AbiDictListV2, AbiDictListV1]:
class SierraCompiledContract (line 980) | class SierraCompiledContract(_SierraContract):
method parsed_abi (line 988) | def parsed_abi(self) -> Union[AbiDictListV2, AbiDictListV1]:
method convert_to_sierra_contract_class (line 1005) | def convert_to_sierra_contract_class(self) -> SierraContractClass:
class CasmClassEntryPoint (line 1018) | class CasmClassEntryPoint:
class CasmClassEntryPointsByType (line 1029) | class CasmClassEntryPointsByType:
class TransactionStatusResponse (line 1040) | class TransactionStatusResponse:
class OrderedEvent (line 1054) | class OrderedEvent:
class OrderedMessage (line 1065) | class OrderedMessage:
class SimulationFlag (line 1076) | class SimulationFlag(str, Enum):
class TraceFlag (line 1086) | class TraceFlag(str, Enum):
class StorageInitialRead (line 1095) | class StorageInitialRead:
class NonceInitialRead (line 1102) | class NonceInitialRead:
class ClassHashInitialRead (line 1108) | class ClassHashInitialRead:
class DeclaredContractInitialRead (line 1114) | class DeclaredContractInitialRead:
class InitialReads (line 1120) | class InitialReads:
class EntryPointType (line 1132) | class EntryPointType(Enum):
class CallType (line 1142) | class CallType(Enum):
class FunctionInvocation (line 1153) | class FunctionInvocation:
class RevertedFunctionInvocation (line 1175) | class RevertedFunctionInvocation:
class InvokeTransactionTrace (line 1184) | class InvokeTransactionTrace:
class DeclareTransactionTrace (line 1197) | class DeclareTransactionTrace:
class DeployAccountTransactionTrace (line 1209) | class DeployAccountTransactionTrace:
class L1HandlerTransactionTrace (line 1222) | class L1HandlerTransactionTrace:
class SimulatedTransaction (line 1241) | class SimulatedTransaction:
class SimulatedTransactionsWithInitialReads (line 1251) | class SimulatedTransactionsWithInitialReads:
class BlockTransactionTrace (line 1263) | class BlockTransactionTrace:
class BlockTransactionTracesWithInitialReads (line 1273) | class BlockTransactionTracesWithInitialReads:
class BinaryNode (line 1284) | class BinaryNode:
class EdgeNode (line 1294) | class EdgeNode:
class NodeHashToNodeMappingItem (line 1308) | class NodeHashToNodeMappingItem:
class ContractsStorageKeys (line 1317) | class ContractsStorageKeys:
class ContractLeafData (line 1327) | class ContractLeafData:
class GlobalRoots (line 1334) | class GlobalRoots:
class ContractsProof (line 1341) | class ContractsProof:
class StorageProofResponse (line 1347) | class StorageProofResponse:
class MessageStatus (line 1359) | class MessageStatus:
class OutsideExecution (line 1367) | class OutsideExecution:
method to_abi_dict (line 1380) | def to_abi_dict(self) -> Dict:
class _EmittedEventWithFinalityStatus (line 1402) | class _EmittedEventWithFinalityStatus:
class EmittedEventWithFinalityStatus (line 1407) | class EmittedEventWithFinalityStatus(
FILE: starknet_py/net/client_utils.py
function hash_to_felt (line 12) | def hash_to_felt(value: Hash) -> str:
function is_block_identifier (line 22) | def is_block_identifier(value: Union[int, Hash, Tag]) -> bool:
function encode_l1_message (line 26) | def encode_l1_message(tx: L1HandlerTransaction) -> bytes:
function _to_storage_key (line 41) | def _to_storage_key(key: int) -> str:
function _to_rpc_felt (line 62) | def _to_rpc_felt(value: Hash) -> str:
function _is_valid_eth_address (line 77) | def _is_valid_eth_address(address: str) -> bool:
function _create_broadcasted_txn (line 84) | def _create_broadcasted_txn(transaction: AccountTransaction) -> dict:
function get_block_identifier (line 91) | def get_block_identifier(
function _get_raw_block_identifier (line 105) | def _get_raw_block_identifier(
FILE: starknet_py/net/executable_models.py
class AssertCurrentAccessIndicesIsEmpty (line 8) | class AssertCurrentAccessIndicesIsEmpty(Enum):
class AssertAllKeysUsed (line 12) | class AssertAllKeysUsed(Enum):
class AssertLeAssertThirdArcExcluded (line 16) | class AssertLeAssertThirdArcExcluded(Enum):
class CellRef (line 21) | class CellRef:
class AssertAllAccessesUsedInner (line 27) | class AssertAllAccessesUsedInner:
class AssertAllAccessesUsed (line 32) | class AssertAllAccessesUsed:
class Deref (line 37) | class Deref:
class DoubleDeref (line 42) | class DoubleDeref:
class Immediate (line 47) | class Immediate:
class BinOpInner (line 52) | class BinOpInner:
class BinOp (line 59) | class BinOp:
class AssertLtAssertValidInputInner (line 67) | class AssertLtAssertValidInputInner:
class AssertLtAssertValidInput (line 73) | class AssertLtAssertValidInput:
class Felt252DictReadInner (line 78) | class Felt252DictReadInner:
class Felt252DictRead (line 85) | class Felt252DictRead:
class Felt252DictWriteInner (line 90) | class Felt252DictWriteInner:
class Felt252DictWrite (line 97) | class Felt252DictWrite:
class AllocSegmentInner (line 102) | class AllocSegmentInner:
class AllocSegment (line 107) | class AllocSegment:
class TestLessThanInner (line 112) | class TestLessThanInner:
class TestLessThan (line 119) | class TestLessThan:
class TestLessThanOrEqualInner (line 124) | class TestLessThanOrEqualInner(TestLessThanInner):
class TestLessThanOrEqual (line 129) | class TestLessThanOrEqual:
class TestLessThanOrEqualAddressInner (line 134) | class TestLessThanOrEqualAddressInner(TestLessThanInner):
class TestLessThanOrEqualAddress (line 139) | class TestLessThanOrEqualAddress:
class WideMul128Inner (line 144) | class WideMul128Inner:
class WideMul128 (line 152) | class WideMul128:
class DivModInner (line 157) | class DivModInner:
class DivMod (line 165) | class DivMod:
class Uint256DivModInner (line 170) | class Uint256DivModInner:
class Uint256DivMod (line 183) | class Uint256DivMod:
class Uint512DivModByUint256Inner (line 188) | class Uint512DivModByUint256Inner:
class Uint512DivModByUint256 (line 205) | class Uint512DivModByUint256:
class SquareRootInner (line 210) | class SquareRootInner:
class SquareRoot (line 216) | class SquareRoot:
class Uint256SquareRootInner (line 221) | class Uint256SquareRootInner:
class Uint256SquareRoot (line 232) | class Uint256SquareRoot:
class LinearSplitInner (line 237) | class LinearSplitInner:
class LinearSplit (line 246) | class LinearSplit:
class AllocFelt252DictInner (line 251) | class AllocFelt252DictInner:
class AllocFelt252Dict (line 256) | class AllocFelt252Dict:
class Felt252DictEntryInitInner (line 261) | class Felt252DictEntryInitInner:
class Felt252DictEntryInit (line 267) | class Felt252DictEntryInit:
class Felt252DictEntryUpdateInner (line 272) | class Felt252DictEntryUpdateInner:
class Felt252DictEntryUpdate (line 278) | class Felt252DictEntryUpdate:
class GetSegmentArenaIndexInner (line 283) | class GetSegmentArenaIndexInner:
class GetSegmentArenaIndex (line 289) | class GetSegmentArenaIndex:
class InitSquashDataInner (line 294) | class InitSquashDataInner:
class InitSquashData (line 303) | class InitSquashData:
class GetCurrentAccessIndexInner (line 308) | class GetCurrentAccessIndexInner:
class GetCurrentAccessIndex (line 313) | class GetCurrentAccessIndex:
class ShouldSkipSquashLoopInner (line 318) | class ShouldSkipSquashLoopInner:
class ShouldSkipSquashLoop (line 323) | class ShouldSkipSquashLoop:
class GetCurrentAccessDeltaInner (line 328) | class GetCurrentAccessDeltaInner:
class GetCurrentAccessDelta (line 333) | class GetCurrentAccessDelta:
class ShouldContinueSquashLoopInner (line 338) | class ShouldContinueSquashLoopInner:
class ShouldContinueSquashLoop (line 343) | class ShouldContinueSquashLoop:
class GetNextDictKeyInner (line 348) | class GetNextDictKeyInner:
class GetNextDictKey (line 353) | class GetNextDictKey:
class AssertLeFindSmallArcsInner (line 358) | class AssertLeFindSmallArcsInner:
class AssertLeFindSmallArcs (line 365) | class AssertLeFindSmallArcs:
class AssertLeIsFirstArcExcludedInner (line 370) | class AssertLeIsFirstArcExcludedInner:
class AssertLeIsFirstArcExcluded (line 375) | class AssertLeIsFirstArcExcluded:
class AssertLeIsSecondArcExcludedInner (line 380) | class AssertLeIsSecondArcExcludedInner:
class AssertLeIsSecondArcExcluded (line 385) | class AssertLeIsSecondArcExcluded:
class RandomEcPointInner (line 390) | class RandomEcPointInner:
class RandomEcPoint (line 396) | class RandomEcPoint:
class FieldSqrtInner (line 401) | class FieldSqrtInner:
class FieldSqrt (line 407) | class FieldSqrt:
class DebugPrintInner (line 412) | class DebugPrintInner:
class DebugPrint (line 418) | class DebugPrint:
class AllocConstantSizeInner (line 423) | class AllocConstantSizeInner:
class AllocConstantSize (line 429) | class AllocConstantSize:
class U256InvModNInner (line 434) | class U256InvModNInner:
class U256InvModN (line 449) | class U256InvModN:
class EvalCircuitInner (line 454) | class EvalCircuitInner:
class EvalCircuit (line 462) | class EvalCircuit:
class SystemCallInner (line 467) | class SystemCallInner:
class SystemCall (line 472) | class SystemCall:
class CheatcodeInner (line 477) | class CheatcodeInner:
class Cheatcode (line 486) | class Cheatcode:
class CasmClass (line 534) | class CasmClass:
FILE: starknet_py/net/full_node_client.py
class FullNodeClient (line 108) | class FullNodeClient(Client):
method __init__ (line 110) | def __init__(
method get_block (line 125) | async def get_block(
method get_block_with_txs (line 145) | async def get_block_with_txs(
method get_block_with_tx_hashes (line 171) | async def get_block_with_tx_hashes(
method get_block_with_receipts (line 195) | async def get_block_with_receipts(
method get_events (line 226) | async def get_events(
method _get_events_chunk (line 309) | async def _get_events_chunk(
method get_state_update (line 339) | async def get_state_update(
method get_storage_at (line 367) | async def get_storage_at(
method get_storage_proof (line 400) | async def get_storage_proof(
method get_transaction (line 454) | async def get_transaction(
method get_l1_message_hash (line 474) | async def get_l1_message_hash(self, tx_hash: Hash) -> Hash:
method get_transaction_receipt (line 488) | async def get_transaction_receipt(
method estimate_fee (line 501) | async def estimate_fee(
method estimate_message_fee (line 534) | async def estimate_message_fee(
method get_block_number (line 587) | async def get_block_number(self) -> int:
method get_block_hash_and_number (line 591) | async def get_block_hash_and_number(self) -> BlockHashAndNumber:
method get_chain_id (line 596) | async def get_chain_id(self) -> str:
method get_messages_status (line 599) | async def get_messages_status(self, transaction_hash: Hash) -> List[Me...
method get_syncing_status (line 609) | async def get_syncing_status(self) -> Union[bool, SyncStatus]:
method call_contract (line 616) | async def call_contract(
method send_transaction (line 638) | async def send_transaction(self, transaction: InvokeV3) -> SentTransac...
method deploy_account (line 648) | async def deploy_account(
method declare (line 663) | async def declare(self, transaction: DeclareV3) -> DeclareTransactionR...
method get_class_hash_at (line 676) | async def get_class_hash_at(
method get_class_by_hash (line 695) | async def get_class_by_hash(
method get_transaction_by_block_id (line 720) | async def get_transaction_by_block_id(
method get_block_transaction_count (line 754) | async def get_block_transaction_count(
method get_class_at (line 777) | async def get_class_at(
method get_contract_nonce (line 810) | async def get_contract_nonce(
method get_compiled_casm (line 829) | async def get_compiled_casm(self, class_hash: int) -> CasmClass:
method spec_version (line 836) | async def spec_version(self) -> str:
method get_transaction_status (line 851) | async def get_transaction_status(self, tx_hash: Hash) -> TransactionSt...
method trace_transaction (line 863) | async def trace_transaction(
method simulate_transactions (line 881) | async def simulate_transactions(
method trace_block_transactions (line 947) | async def trace_block_transactions(
FILE: starknet_py/net/http_client.py
class HttpMethod (line 12) | class HttpMethod(Enum):
class HttpClient (line 17) | class HttpClient(ABC):
method __init__ (line 18) | def __init__(self, url, session: Optional[ClientSession] = None):
method request (line 22) | async def request(
method _make_request (line 41) | async def _make_request(
method handle_request_error (line 57) | async def handle_request_error(self, request: ClientResponse):
class RpcHttpClient (line 63) | class RpcHttpClient(HttpClient):
method __init__ (line 64) | def __init__(
method call (line 74) | async def call(self, method_name: str, params: Optional[dict] = None):
method handle_rpc_error (line 93) | def handle_rpc_error(result: dict):
method handle_request_error (line 102) | async def handle_request_error(self, request: ClientResponse):
method _warn_if_incompatible_rpc_version (line 105) | async def _warn_if_incompatible_rpc_version(self):
function basic_error_handle (line 128) | async def basic_error_handle(request: ClientResponse):
class ServerError (line 133) | class ServerError(Exception):
method __init__ (line 134) | def __init__(self, body: dict):
class IncompatibleRPCVersionWarning (line 140) | class IncompatibleRPCVersionWarning(Warning):
FILE: starknet_py/net/models/address.py
function parse_address (line 7) | def parse_address(value: AddressRepresentation) -> Address:
FILE: starknet_py/net/models/chains.py
class StarknetChainId (line 8) | class StarknetChainId(IntEnum):
function chain_from_network (line 25) | def chain_from_network(
function parse_chain (line 47) | def parse_chain(chain: Chain) -> ChainId:
FILE: starknet_py/net/models/transaction.py
class Transaction (line 50) | class Transaction(ABC):
method type (line 59) | def type(self) -> TransactionType:
method calculate_hash (line 65) | def calculate_hash(self, chain_id: int) -> int:
class AccountTransaction (line 73) | class AccountTransaction(Transaction, ABC):
class _DeprecatedAccountTransaction (line 90) | class _DeprecatedAccountTransaction(AccountTransaction, ABC):
class _AccountTransactionV3 (line 95) | class _AccountTransactionV3(AccountTransaction, ABC):
method get_common_fields (line 102) | def get_common_fields(
class DeclareV3 (line 127) | class DeclareV3(_AccountTransactionV3):
method type (line 139) | def type(self) -> TransactionType:
method calculate_hash (line 142) | def calculate_hash(self, chain_id: int) -> int:
class DeclareV2 (line 156) | class DeclareV2(_DeprecatedAccountTransaction):
method type (line 173) | def type(self) -> TransactionType:
method calculate_hash (line 176) | def calculate_hash(self, chain_id: int) -> int:
class DeclareV1 (line 190) | class DeclareV1(_DeprecatedAccountTransaction):
method type (line 210) | def type(self) -> TransactionType:
method post_dump (line 214) | def post_dump(self, data: Dict[str, Any], **kwargs) -> Dict[str, Any]:
method pre_load (line 221) | def pre_load(self, data: Dict[str, Any], **kwargs) -> Dict[str, Any]:
method calculate_hash (line 225) | def calculate_hash(self, chain_id: int) -> int:
class DeployAccountV3 (line 243) | class DeployAccountV3(_AccountTransactionV3):
method type (line 254) | def type(self) -> TransactionType:
method calculate_hash (line 257) | def calculate_hash(self, chain_id: int) -> int:
class DeployAccountV1 (line 277) | class DeployAccountV1(_DeprecatedAccountTransaction):
method type (line 294) | def type(self) -> TransactionType:
method calculate_hash (line 297) | def calculate_hash(self, chain_id: int) -> int:
class InvokeV3 (line 320) | class InvokeV3(_AccountTransactionV3):
method type (line 333) | def type(self) -> TransactionType:
method calculate_hash (line 336) | def calculate_hash(self, chain_id: int) -> int:
class InvokeV1 (line 350) | class InvokeV1(_DeprecatedAccountTransaction):
method type (line 366) | def type(self) -> TransactionType:
method calculate_hash (line 369) | def calculate_hash(self, chain_id: int) -> int:
function compress_program (line 393) | def compress_program(data: dict, program_name: str = "program") -> dict:
function decompress_program (line 402) | def decompress_program(data: dict, program_name: str = "program") -> dict:
FILE: starknet_py/net/models/typed_data.py
class ParameterDict (line 16) | class ParameterDict(TypedDict):
class DomainDict (line 26) | class DomainDict(TypedDict):
class TypedDataDict (line 37) | class TypedDataDict(TypedDict):
class TypeContext (line 48) | class TypeContext(TypedDict):
FILE: starknet_py/net/networks.py
function default_token_address_for_network (line 14) | def default_token_address_for_network(net: Network) -> str:
FILE: starknet_py/net/schemas/broadcasted_txn.py
class BroadcastedDeclareV3Schema (line 13) | class BroadcastedDeclareV3Schema(DeclareTransactionV3Schema):
class BroadcastedTransactionSchema (line 19) | class BroadcastedTransactionSchema(OneOfSchema):
method get_obj_type (line 26) | def get_obj_type(self, obj):
FILE: starknet_py/net/schemas/common.py
function _pascal_to_screaming_upper (line 26) | def _pascal_to_screaming_upper(checked_string: str) -> str:
class NumberAsHex (line 32) | class NumberAsHex(fields.Field):
method _serialize (line 46) | def _serialize(self, value: Any, attr: Optional[str], obj: Any, **kwar...
method _deserialize (line 57) | def _deserialize(
method _is_int_and_in_range (line 74) | def _is_int_and_in_range(self, value: Any) -> bool:
method _is_str_and_valid_pattern (line 77) | def _is_str_and_valid_pattern(self, value: Any) -> bool:
class Felt (line 84) | class Felt(NumberAsHex):
class Uint64 (line 93) | class Uint64(NumberAsHex):
class Uint128 (line 102) | class Uint128(NumberAsHex):
class NonPrefixedHex (line 111) | class NonPrefixedHex(fields.Field):
method _serialize (line 112) | def _serialize(self, value: Any, attr: Optional[str], obj: Any, **kwar...
method _deserialize (line 115) | def _deserialize(
class StatusField (line 125) | class StatusField(fields.Field):
method _serialize (line 126) | def _serialize(self, value: Any, attr: Optional[str], obj: Any, **kwar...
method _deserialize (line 129) | def _deserialize(
class ExecutionStatusField (line 146) | class ExecutionStatusField(fields.Field):
method _serialize (line 147) | def _serialize(self, value: Any, attr: Optional[str], obj: Any, **kwar...
method _deserialize (line 150) | def _deserialize(
class FinalityStatusField (line 167) | class FinalityStatusField(fields.Field):
method _serialize (line 168) | def _serialize(self, value: Any, attr: Optional[str], obj: Any, **kwar...
method _deserialize (line 171) | def _deserialize(
class TransactionFinalityStatusField (line 188) | class TransactionFinalityStatusField(fields.Field):
method _serialize (line 189) | def _serialize(self, value: Any, attr: Optional[str], obj: Any, **kwar...
method _deserialize (line 192) | def _deserialize(
class TransactionStatusWithoutL1Field (line 209) | class TransactionStatusWithoutL1Field(fields.Field):
method _serialize (line 210) | def _serialize(self, value: Any, attr: Optional[str], obj: Any, **kwar...
method _deserialize (line 213) | def _deserialize(
class BlockStatusField (line 230) | class BlockStatusField(fields.Field):
method _serialize (line 231) | def _serialize(self, value: Any, attr: Optional[str], obj: Any, **kwar...
method _deserialize (line 234) | def _deserialize(
class TransactionTypeField (line 249) | class TransactionTypeField(fields.Field):
method _serialize (line 250) | def _serialize(self, value: Any, attr: Optional[str], obj: Any, **kwar...
method _deserialize (line 255) | def _deserialize(
class EntryPointTypeField (line 275) | class EntryPointTypeField(fields.Field):
method _serialize (line 276) | def _serialize(self, value: Any, attr: Optional[str], obj: Any, **kwar...
method _deserialize (line 279) | def _deserialize(
class CallTypeField (line 296) | class CallTypeField(fields.Field):
method _serialize (line 297) | def _serialize(self, value: Any, attr: Optional[str], obj: Any, **kwar...
method _deserialize (line 300) | def _deserialize(
class L1DAModeField (line 315) | class L1DAModeField(fields.Field):
method _serialize (line 316) | def _serialize(self, value: Any, attr: Optional[str], obj: Any, **kwar...
method _deserialize (line 319) | def _deserialize(
class PriceUnitField (line 334) | class PriceUnitField(fields.Field):
method _serialize (line 335) | def _serialize(self, value: Any, attr: Optional[str], obj: Any, **kwar...
method _deserialize (line 338) | def _deserialize(
class DAModeField (line 353) | class DAModeField(fields.Field):
method _serialize (line 354) | def _serialize(self, value: Any, attr: Optional[str], obj: Any, **kwar...
method _deserialize (line 357) | def _deserialize(
class StorageEntrySchema (line 372) | class StorageEntrySchema(Schema):
method make_dataclass (line 377) | def make_dataclass(self, data, **kwargs):
class Revision (line 382) | class Revision(Enum):
class RevisionField (line 391) | class RevisionField(fields.Field):
method _serialize (line 392) | def _serialize(self, value: Any, attr: Optional[str], obj: Any, **kwar...
method _deserialize (line 397) | def _deserialize(self, value, attr, data, **kwargs) -> Revision:
FILE: starknet_py/net/schemas/contracts_storage_keys.py
class StorageKeySchema (line 9) | class StorageKeySchema(fields.Str):
method __init__ (line 14) | def __init__(self, **kwargs):
class ContractsStorageKeysSchema (line 24) | class ContractsStorageKeysSchema(Schema):
FILE: starknet_py/net/schemas/rpc/block.py
class ResourcePriceSchema (line 37) | class ResourcePriceSchema(Schema):
method make_dataclass (line 42) | def make_dataclass(self, data, **kwargs) -> ResourcePrice:
class PreConfirmedBlockHeaderSchema (line 46) | class PreConfirmedBlockHeaderSchema(Schema):
class BlockHeaderSchema (line 63) | class BlockHeaderSchema(Schema):
method make_dataclass (line 96) | def make_dataclass(self, data, **kwargs) -> BlockHeader:
class BlockHashAndNumberSchema (line 100) | class BlockHashAndNumberSchema(Schema):
method make_dataclass (line 105) | def make_dataclass(self, data, **kwargs) -> BlockHashAndNumber:
class StorageDiffSchema (line 109) | class StorageDiffSchema(Schema):
method make_dataclass (line 118) | def make_dataclass(self, data, **kwargs) -> StorageDiffItem:
class DeclaredContractHashSchema (line 122) | class DeclaredContractHashSchema(Schema):
method make_dataclass (line 127) | def make_dataclass(self, data, **kwargs) -> DeclaredContractHash:
class DeployedContractSchema (line 131) | class DeployedContractSchema(Schema):
method make_dataclass (line 136) | def make_dataclass(self, data, **kwargs):
class ContractsNonceSchema (line 140) | class ContractsNonceSchema(Schema):
method make_dataclass (line 145) | def make_dataclass(self, data, **kwargs):
class ReplacedClassSchema (line 149) | class ReplacedClassSchema(Schema):
method make_dataclass (line 154) | def make_dataclass(self, data, **kwargs) -> ReplacedClass:
class MigratedClassSchema (line 158) | class MigratedClassSchema(Schema):
method make_dataclass (line 163) | def make_dataclass(self, data, **kwargs) -> MigratedClass:
class StateDiffSchema (line 167) | class StateDiffSchema(Schema):
method make_dataclass (line 203) | def make_dataclass(self, data, **kwargs) -> StateDiff:
class BlockStateUpdateSchema (line 207) | class BlockStateUpdateSchema(Schema):
method make_dataclass (line 214) | def make_dataclass(self, data, **kwargs) -> BlockStateUpdate:
class PreConfirmedBlockStateUpdateSchema (line 218) | class PreConfirmedBlockStateUpdateSchema(Schema):
method make_dataclass (line 223) | def make_dataclass(self, data, **kwargs) -> PreConfirmedBlockStateUpdate:
class PreConfirmedStarknetBlockWithTxHashesSchema (line 227) | class PreConfirmedStarknetBlockWithTxHashesSchema(PreConfirmedBlockHeade...
method make_dataclass (line 231) | def make_dataclass(self, data, **kwargs) -> PreConfirmedStarknetBlockW...
class StarknetBlockWithTxHashesSchema (line 235) | class StarknetBlockWithTxHashesSchema(BlockHeaderSchema):
method make_dataclass (line 240) | def make_dataclass(self, data, **kwargs) -> StarknetBlockWithTxHashes:
class StarknetBlockWithReceiptsSchema (line 244) | class StarknetBlockWithReceiptsSchema(BlockHeaderSchema):
method make_dataclass (line 253) | def make_dataclass(self, data, **kwargs) -> StarknetBlockWithReceipts:
class PreConfirmedStarknetBlockSchema (line 257) | class PreConfirmedStarknetBlockSchema(PreConfirmedBlockHeaderSchema):
method make_dataclass (line 265) | def make_dataclass(self, data, **kwargs) -> PreConfirmedStarknetBlock:
class StarknetBlockSchema (line 269) | class StarknetBlockSchema(BlockHeaderSchema):
method make_dataclass (line 278) | def make_dataclass(self, data, **kwargs) -> StarknetBlock:
class PreConfirmedStarknetBlockWithReceiptsSchema (line 282) | class PreConfirmedStarknetBlockWithReceiptsSchema(PreConfirmedBlockHeade...
method make_dataclass (line 290) | def make_dataclass(self, data, **kwargs) -> PreConfirmedStarknetBlockW...
FILE: starknet_py/net/schemas/rpc/contract.py
class SyncStatusSchema (line 28) | class SyncStatusSchema(Schema):
method make_dataclass (line 37) | def make_dataclass(self, data, **kwargs) -> SyncStatus:
class ContractDiffSchema (line 41) | class ContractDiffSchema(Schema):
method make_dataclass (line 46) | def make_dataclass(self, data, **kwargs) -> DeployedContract:
class SierraEntryPointSchema (line 50) | class SierraEntryPointSchema(Schema):
method make_dataclass (line 55) | def make_dataclass(self, data, **kwargs) -> SierraEntryPoint:
class EntryPointSchema (line 59) | class EntryPointSchema(Schema):
method make_dataclass (line 64) | def make_dataclass(self, data, **kwargs) -> EntryPoint:
class SierraEntryPointsByTypeSchema (line 68) | class SierraEntryPointsByTypeSchema(Schema):
method make_dataclass (line 80) | def make_dataclass(self, data, **kwargs) -> SierraEntryPointsByType:
class EntryPointsByTypeSchema (line 84) | class EntryPointsByTypeSchema(Schema):
method make_dataclass (line 96) | def make_dataclass(self, data, **kwargs) -> EntryPointsByType:
class SierraContractClassSchema (line 100) | class SierraContractClassSchema(Schema):
method make_dataclass (line 111) | def make_dataclass(self, data, **kwargs) -> SierraContractClass:
class ContractClassSchema (line 115) | class ContractClassSchema(Schema):
method make_dataclass (line 128) | def make_dataclass(self, data, **kwargs) -> DeprecatedContractClass:
class DeprecatedContractClassSchema (line 132) | class DeprecatedContractClassSchema(Schema):
method make_dataclass (line 142) | def make_dataclass(self, data, **kwargs) -> DeprecatedContractClass:
class DeprecatedCompiledContractSchema (line 146) | class DeprecatedCompiledContractSchema(ContractClassSchema):
method make_dataclass (line 150) | def make_dataclass(self, data, **kwargs) -> DeprecatedCompiledContract:
class CasmClassEntryPointSchema (line 154) | class CasmClassEntryPointSchema(Schema):
method make_dataclass (line 160) | def make_dataclass(self, data, **kwargs) -> CasmClassEntryPoint:
class CasmClassEntryPointsByTypeSchema (line 164) | class CasmClassEntryPointsByTypeSchema(Schema):
method make_dataclass (line 182) | def make_dataclass(self, data, **kwargs) -> CasmClassEntryPointsByType:
class CasmClassSchema (line 188) | class CasmClassSchema(MarshmallowSchema):
method make_dataclass (line 210) | def make_dataclass(self, data, **kwargs) -> CasmClass:
class AbiField (line 214) | class AbiField(fields.Field):
method _deserialize (line 215) | def _deserialize(self, value, attr, data, **kwargs):
class SierraCompiledContractSchema (line 223) | class SierraCompiledContractSchema(SierraContractClassSchema):
method make_dataclass (line 227) | def make_dataclass(self, data, **kwargs) -> SierraCompiledContract:
FILE: starknet_py/net/schemas/rpc/event.py
class EventSchema (line 13) | class EventSchema(Schema):
method make_dataclass (line 19) | def make_dataclass(self, data, **kwargs) -> Event:
class EmittedEventSchema (line 23) | class EmittedEventSchema(EventSchema):
method make_dataclass (line 39) | def make_dataclass(self, data, **kwargs) -> EmittedEvent:
class EmittedEventWithFinalitySchema (line 43) | class EmittedEventWithFinalitySchema(EmittedEventSchema):
method make_dataclass (line 47) | def make_dataclass(self, data, **kwargs) -> EmittedEventWithFinalitySt...
class EventsChunkSchema (line 51) | class EventsChunkSchema(Schema):
method make_dataclass (line 60) | def make_dataclass(self, data, **kwargs):
FILE: starknet_py/net/schemas/rpc/executables_api.py
class CellRefSchema (line 90) | class CellRefSchema(Schema):
method make_dataclass (line 97) | def make_dataclass(self, data, **kwargs) -> CellRef:
class AssertAllAccessesUsedInnerSchema (line 101) | class AssertAllAccessesUsedInnerSchema(Schema):
method make_dataclass (line 107) | def make_dataclass(self, data, **kwargs) -> AssertAllAccessesUsedInner:
class AssertAllAccessesUsedSchema (line 111) | class AssertAllAccessesUsedSchema(Schema):
method make_dataclass (line 119) | def make_dataclass(self, data, **kwargs) -> AssertAllAccessesUsed:
class DerefSchema (line 123) | class DerefSchema(Schema):
method make_dataclass (line 127) | def make_dataclass(self, data, **kwargs) -> Deref:
class DoubleDerefSchema (line 131) | class DoubleDerefSchema(Schema):
method make_dataclass (line 139) | def make_dataclass(self, data, **kwargs) -> DoubleDeref:
class ImmediateSchema (line 143) | class ImmediateSchema(Schema):
method make_dataclass (line 147) | def make_dataclass(self, data, **kwargs) -> Immediate:
class BinOpBField (line 151) | class BinOpBField(fields.Field):
method _serialize (line 152) | def _serialize(self, value: Any, attr: Optional[str], obj: Any, **kwar...
method _deserialize (line 162) | def _deserialize(self, value, attr, data, **kwargs):
class BinOpInnerSchema (line 174) | class BinOpInnerSchema(Schema):
method make_dataclass (line 182) | def make_dataclass(self, data, **kwargs) -> BinOpInner:
class BinOpSchema (line 186) | class BinOpSchema(Schema):
method make_dataclass (line 190) | def make_dataclass(self, data, **kwargs) -> BinOp:
class ResOperandField (line 194) | class ResOperandField(fields.Field):
method _serialize (line 195) | def _serialize(self, value, attr, obj, **kwargs):
method _deserialize (line 209) | def _deserialize(self, value, attr, data, **kwargs):
class AssertLtAssertValidInputInnerSchema (line 223) | class AssertLtAssertValidInputInnerSchema(Schema):
method make_dataclass (line 228) | def make_dataclass(self, data, **kwargs) -> AssertLtAssertValidInputIn...
class AssertLtAssertValidInputSchema (line 232) | class AssertLtAssertValidInputSchema(Schema):
method make_dataclass (line 240) | def make_dataclass(self, data, **kwargs) -> AssertLtAssertValidInput:
class Felt252DictReadInnerSchema (line 244) | class Felt252DictReadInnerSchema(Schema):
method make_dataclass (line 250) | def make_dataclass(self, data, **kwargs) -> Felt252DictReadInner:
class Felt252DictReadSchema (line 254) | class Felt252DictReadSchema(Schema):
method make_dataclass (line 260) | def make_dataclass(self, data, **kwargs) -> Felt252DictRead:
class Felt252DictWriteInnerSchema (line 264) | class Felt252DictWriteInnerSchema(Schema):
method make_dataclass (line 270) | def make_dataclass(self, data, **kwargs) -> Felt252DictWriteInner:
class Felt252DictWriteSchema (line 274) | class Felt252DictWriteSchema(Schema):
method make_dataclass (line 280) | def make_dataclass(self, data, **kwargs) -> Felt252DictWrite:
class AllocSegmentInnerSchema (line 284) | class AllocSegmentInnerSchema(Schema):
method make_dataclass (line 288) | def make_dataclass(self, data, **kwargs) -> AllocSegmentInner:
class AllocSegmentSchema (line 292) | class AllocSegmentSchema(Schema):
method make_dataclass (line 298) | def make_dataclass(self, data, **kwargs) -> AllocSegment:
class TestLessThanInnerSchema (line 302) | class TestLessThanInnerSchema(Schema):
method make_dataclass (line 308) | def make_dataclass(self, data, **kwargs) -> TestLessThanInner:
class TestLessThanSchema (line 312) | class TestLessThanSchema(Schema):
method make_dataclass (line 318) | def make_dataclass(self, data, **kwargs) -> TestLessThan:
class TestLessThanOrEqualInnerSchema (line 322) | class TestLessThanOrEqualInnerSchema(TestLessThanInnerSchema):
method make_dataclass (line 326) | def make_dataclass(self, data, **kwargs) -> TestLessThanOrEqualInner:
class TestLessThanOrEqualSchema (line 330) | class TestLessThanOrEqualSchema(Schema):
method make_dataclass (line 336) | def make_dataclass(self, data, **kwargs) -> TestLessThanOrEqual:
class TestLessThanOrEqualAddressInnerSchema (line 340) | class TestLessThanOrEqualAddressInnerSchema(TestLessThanInnerSchema):
method make_dataclass (line 344) | def make_dataclass(self, data, **kwargs) -> TestLessThanOrEqualAddress...
class TestLessThanOrEqualAddressSchema (line 348) | class TestLessThanOrEqualAddressSchema(Schema):
method make_dataclass (line 356) | def make_dataclass(self, data, **kwargs) -> TestLessThanOrEqualAddress:
class WideMul128InnerSchema (line 360) | class WideMul128InnerSchema(Schema):
method make_dataclass (line 367) | def make_dataclass(self, data, **kwargs) -> WideMul128Inner:
class WideMul128Schema (line 371) | class WideMul128Schema(Schema):
method make_dataclass (line 377) | def make_dataclass(self, data, **kwargs) -> WideMul128:
class DivModInnerSchema (line 381) | class DivModInnerSchema(Schema):
method make_dataclass (line 388) | def make_dataclass(self, data, **kwargs) -> DivModInner:
class DivModSchema (line 392) | class DivModSchema(Schema):
method make_dataclass (line 396) | def make_dataclass(self, data, **kwargs) -> DivMod:
class Uint256DivModInnerSchema (line 400) | class Uint256DivModInnerSchema(Schema):
method make_dataclass (line 411) | def make_dataclass(self, data, **kwargs) -> Uint256DivModInner:
class Uint256DivModSchema (line 415) | class Uint256DivModSchema(Schema):
method make_dataclass (line 421) | def make_dataclass(self, data, **kwargs) -> Uint256DivMod:
class Uint512DivModByUint256InnerSchema (line 425) | class Uint512DivModByUint256InnerSchema(Schema):
method make_dataclass (line 440) | def make_dataclass(self, data, **kwargs) -> Uint512DivModByUint256Inner:
class Uint512DivModByUint256Schema (line 444) | class Uint512DivModByUint256Schema(Schema):
method make_dataclass (line 452) | def make_dataclass(self, data, **kwargs) -> Uint512DivModByUint256:
class SquareRootInnerSchema (line 456) | class SquareRootInnerSchema(Schema):
method make_dataclass (line 461) | def make_dataclass(self, data, **kwargs) -> SquareRootInner:
class SquareRootSchema (line 465) | class SquareRootSchema(Schema):
method make_dataclass (line 471) | def make_dataclass(self, data, **kwargs) -> SquareRoot:
class Uint256SquareRootInnerSchema (line 475) | class Uint256SquareRootInnerSchema(Schema):
method make_dataclass (line 491) | def make_dataclass(self, data, **kwargs) -> Uint256SquareRootInner:
class Uint256SquareRootSchema (line 495) | class Uint256SquareRootSchema(Schema):
method make_dataclass (line 501) | def make_dataclass(self, data, **kwargs) -> Uint256SquareRoot:
class LinearSplitInnerSchema (line 505) | class LinearSplitInnerSchema(Schema):
method make_dataclass (line 513) | def make_dataclass(self, data, **kwargs) -> LinearSplitInner:
class LinearSplitSchema (line 517) | class LinearSplitSchema(Schema):
method make_dataclass (line 523) | def make_dataclass(self, data, **kwargs) -> LinearSplit:
class AllocFelt252DictInnerSchema (line 527) | class AllocFelt252DictInnerSchema(Schema):
method make_dataclass (line 531) | def make_dataclass(self, data, **kwargs) -> AllocFelt252DictInner:
class AllocFelt252DictSchema (line 535) | class AllocFelt252DictSchema(Schema):
method make_dataclass (line 541) | def make_dataclass(self, data, **kwargs) -> AllocFelt252Dict:
class Felt252DictEntryInitInnerSchema (line 545) | class Felt252DictEntryInitInnerSchema(Schema):
method make_dataclass (line 550) | def make_dataclass(self, data, **kwargs) -> Felt252DictEntryInitInner:
class Felt252DictEntryInitSchema (line 554) | class Felt252DictEntryInitSchema(Schema):
method make_dataclass (line 562) | def make_dataclass(self, data, **kwargs) -> Felt252DictEntryInit:
class Felt252DictEntryUpdateInnerSchema (line 566) | class Felt252DictEntryUpdateInnerSchema(Schema):
method make_dataclass (line 571) | def make_dataclass(self, data, **kwargs) -> Felt252DictEntryUpdateInner:
class Felt252DictEntryUpdateSchema (line 575) | class Felt252DictEntryUpdateSchema(Schema):
method make_dataclass (line 583) | def make_dataclass(self, data, **kwargs) -> Felt252DictEntryUpdate:
class GetSegmentArenaIndexInnerSchema (line 587) | class GetSegmentArenaIndexInnerSchema(Schema):
method make_dataclass (line 592) | def make_dataclass(self, data, **kwargs) -> GetSegmentArenaIndexInner:
class GetSegmentArenaIndexSchema (line 596) | class GetSegmentArenaIndexSchema(Schema):
method make_dataclass (line 604) | def make_dataclass(self, data, **kwargs) -> GetSegmentArenaIndex:
class InitSquashDataInnerSchema (line 608) | class InitSquashDataInnerSchema(Schema):
method make_dataclass (line 616) | def make_dataclass(self, data, **kwargs) -> InitSquashDataInner:
class InitSquashDataSchema (line 620) | class InitSquashDataSchema(Schema):
method make_dataclass (line 626) | def make_dataclass(self, data, **kwargs) -> InitSquashData:
class GetCurrentAccessIndexInnerSchema (line 630) | class GetCurrentAccessIndexInnerSchema(Schema):
method make_dataclass (line 634) | def make_dataclass(self, data, **kwargs) -> GetCurrentAccessIndexInner:
class GetCurrentAccessIndexSchema (line 638) | class GetCurrentAccessIndexSchema(Schema):
method make_dataclass (line 646) | def make_dataclass(self, data, **kwargs) -> GetCurrentAccessIndex:
class ShouldSkipSquashLoopInnerSchema (line 650) | class ShouldSkipSquashLoopInnerSchema(Schema):
method make_dataclass (line 656) | def make_dataclass(self, data, **kwargs) -> ShouldSkipSquashLoopInner:
class ShouldSkipSquashLoopSchema (line 660) | class ShouldSkipSquashLoopSchema(Schema):
method make_dataclass (line 668) | def make_dataclass(self, data, **kwargs) -> ShouldSkipSquashLoop:
class GetCurrentAccessDeltaInnerSchema (line 672) | class GetCurrentAccessDeltaInnerSchema(Schema):
method make_dataclass (line 678) | def make_dataclass(self, data, **kwargs) -> GetCurrentAccessDeltaInner:
class GetCurrentAccessDeltaSchema (line 682) | class GetCurrentAccessDeltaSchema(Schema):
method make_dataclass (line 690) | def make_dataclass(self, data, **kwargs) -> GetCurrentAccessDelta:
class ShouldContinueSquashLoopInnerSchema (line 694) | class ShouldContinueSquashLoopInnerSchema(Schema):
method make_dataclass (line 700) | def make_dataclass(self, data, **kwargs) -> ShouldContinueSquashLoopIn...
class ShouldContinueSquashLoopSchema (line 704) | class ShouldContinueSquashLoopSchema(Schema):
method make_dataclass (line 712) | def make_dataclass(self, data, **kwargs) -> ShouldContinueSquashLoop:
class GetNextDictKeyInnerSchema (line 716) | class GetNextDictKeyInnerSchema(Schema):
method make_dataclass (line 720) | def make_dataclass(self, data, **kwargs) -> GetNextDictKeyInner:
class GetNextDictKeySchema (line 724) | class GetNextDictKeySchema(Schema):
method make_dataclass (line 730) | def make_dataclass(self, data, **kwargs) -> GetNextDictKey:
class AssertLeFindSmallArcsInnerSchema (line 734) | class AssertLeFindSmallArcsInnerSchema(Schema):
method make_dataclass (line 740) | def make_dataclass(self, data, **kwargs) -> AssertLeFindSmallArcsInner:
class AssertLeFindSmallArcsSchema (line 744) | class AssertLeFindSmallArcsSchema(Schema):
method make_dataclass (line 752) | def make_dataclass(self, data, **kwargs) -> AssertLeFindSmallArcs:
class AssertLeIsFirstArcExcludedInnerSchema (line 756) | class AssertLeIsFirstArcExcludedInnerSchema(Schema):
method make_dataclass (line 762) | def make_dataclass(self, data, **kwargs) -> AssertLeIsFirstArcExcluded...
class AssertLeIsFirstArcExcludedSchema (line 766) | class AssertLeIsFirstArcExcludedSchema(Schema):
method make_dataclass (line 774) | def make_dataclass(self, data, **kwargs) -> AssertLeIsFirstArcExcluded:
class AssertLeIsSecondArcExcludedInnerSchema (line 778) | class AssertLeIsSecondArcExcludedInnerSchema(Schema):
method make_dataclass (line 784) | def make_dataclass(self, data, **kwargs) -> AssertLeIsSecondArcExclude...
class AssertLeIsSecondArcExcludedSchema (line 788) | class AssertLeIsSecondArcExcludedSchema(Schema):
method make_dataclass (line 796) | def make_dataclass(self, data, **kwargs) -> AssertLeIsSecondArcExcluded:
class RandomEcPointInnerSchema (line 800) | class RandomEcPointInnerSchema(Schema):
method make_dataclass (line 805) | def make_dataclass(self, data, **kwargs) -> RandomEcPointInner:
class RandomEcPointSchema (line 809) | class RandomEcPointSchema(Schema):
method make_dataclass (line 815) | def make_dataclass(self, data, **kwargs) -> RandomEcPoint:
class FieldSqrtInnerSchema (line 819) | class FieldSqrtInnerSchema(Schema):
method make_dataclass (line 824) | def make_dataclass(self, data, **kwargs) -> FieldSqrtInner:
class FieldSqrtSchema (line 828) | class FieldSqrtSchema(Schema):
method make_dataclass (line 834) | def make_dataclass(self, data, **kwargs) -> FieldSqrt:
class DebugPrintInnerSchema (line 838) | class DebugPrintInnerSchema(Schema):
method make_dataclass (line 843) | def make_dataclass(self, data, **kwargs) -> DebugPrintInner:
class DebugPrintSchema (line 847) | class DebugPrintSchema(Schema):
method make_dataclass (line 853) | def make_dataclass(self, data, **kwargs) -> DebugPrint:
class AllocConstantSizeInnerSchema (line 857) | class AllocConstantSizeInnerSchema(Schema):
method make_dataclass (line 862) | def make_dataclass(self, data, **kwargs) -> AllocConstantSizeInner:
class AllocConstantSizeSchema (line 866) | class AllocConstantSizeSchema(Schema):
method make_dataclass (line 872) | def make_dataclass(self, data, **kwargs) -> AllocConstantSize:
class U256InvModNInnerSchema (line 876) | class U256InvModNInnerSchema(Schema):
method make_dataclass (line 891) | def make_dataclass(self, data, **kwargs) -> U256InvModNInner:
class U256InvModNSchema (line 895) | class U256InvModNSchema(Schema):
method make_dataclass (line 901) | def make_dataclass(self, data, **kwargs) -> U256InvModN:
class EvalCircuitInnerSchema (line 905) | class EvalCircuitInnerSchema(Schema):
method make_dataclass (line 912) | def make_dataclass(self, data, **kwargs) -> EvalCircuitInner:
class EvalCircuitSchema (line 916) | class EvalCircuitSchema(Schema):
method make_dataclass (line 922) | def make_dataclass(self, data, **kwargs) -> EvalCircuit:
class SystemCallInnerSchema (line 926) | class SystemCallInnerSchema(Schema):
method make_dataclass (line 930) | def make_dataclass(self, data, **kwargs) -> SystemCallInner:
class SystemCallSchema (line 934) | class SystemCallSchema(Schema):
method make_dataclass (line 940) | def make_dataclass(self, data, **kwargs) -> SystemCall:
class CheatcodeInnerSchema (line 944) | class CheatcodeInnerSchema(Schema):
method make_dataclass (line 954) | def make_dataclass(self, data, **kwargs) -> CheatcodeInner:
class CheatcodeSchema (line 958) | class CheatcodeSchema(Schema):
method make_dataclass (line 964) | def make_dataclass(self, data, **kwargs) -> Cheatcode:
class HintSchema (line 1012) | class HintSchema(Schema):
method load (line 1013) | def load(self, data, *args, **kwargs) -> Hint:
method dump (line 1026) | def dump(self, obj, *args, **kwargs):
FILE: starknet_py/net/schemas/rpc/general.py
class InnerCallExecutionResourcesSchema (line 13) | class InnerCallExecutionResourcesSchema(Schema):
method make_dataclass (line 18) | def make_dataclass(self, data, **kwargs) -> InnerCallExecutionResources:
class ExecutionResourcesSchema (line 22) | class ExecutionResourcesSchema(Schema):
method make_dataclass (line 28) | def make_dataclass(self, data, **kwargs) -> ExecutionResources:
class StorageResultSchema (line 32) | class StorageResultSchema(Schema):
method make_dataclass (line 37) | def make_dataclass(self, data, **kwargs) -> StorageResult:
class EstimatedFeeSchema (line 41) | class EstimatedFeeSchema(Schema):
method make_dataclass (line 52) | def make_dataclass(self, data, **kwargs) -> EstimatedFee:
FILE: starknet_py/net/schemas/rpc/storage_proof.py
class BinaryNodeSchema (line 18) | class BinaryNodeSchema(Schema):
method make_dataclass (line 23) | def make_dataclass(self, data, **kwargs) -> BinaryNode:
class EdgeNodeSchema (line 27) | class EdgeNodeSchema(Schema):
method make_dataclass (line 33) | def make_dataclass(self, data, **kwargs) -> EdgeNode:
class MerkleNodeSchema (line 37) | class MerkleNodeSchema(Schema):
method make_dataclass (line 45) | def make_dataclass(self, data, **kwargs) -> Union[BinaryNode, EdgeNode]:
class NodeHashToNodeMappingItemSchema (line 53) | class NodeHashToNodeMappingItemSchema(Schema):
method make_dataclass (line 58) | def make_dataclass(self, data, **kwargs) -> NodeHashToNodeMappingItem:
class NodeHashToNodeMappingField (line 62) | class NodeHashToNodeMappingField(fields.Field):
method _serialize (line 63) | def _serialize(self, value: Any, attr: Optional[str], obj: Any, **kwar...
method _deserialize (line 72) | def _deserialize(self, value: Any, attr: Optional[str], data: Any, **k...
class ContractLeafDataSchema (line 82) | class ContractLeafDataSchema(Schema):
method make_dataclass (line 88) | def make_dataclass(self, data, **kwargs) -> ContractLeafData:
class GlobalRootsSchema (line 92) | class GlobalRootsSchema(Schema):
method make_dataclass (line 98) | def make_dataclass(self, data, **kwargs) -> GlobalRoots:
class ContractsProofSchema (line 102) | class ContractsProofSchema(Schema):
method make_dataclass (line 111) | def make_dataclass(self, data, **kwargs) -> ContractsProof:
class StorageProofResponseSchema (line 115) | class StorageProofResponseSchema(Schema):
method make_dataclass (line 132) | def make_dataclass(self, data, **kwargs) -> StorageProofResponse:
FILE: starknet_py/net/schemas/rpc/trace_api.py
class OrderedEventSchema (line 33) | class OrderedEventSchema(Schema):
method make_dataclass (line 39) | def make_dataclass(self, data, **kwargs):
class OrderedMessageSchema (line 43) | class OrderedMessageSchema(Schema):
method make_dataclass (line 50) | def make_dataclass(self, data, **kwargs) -> OrderedMessage:
class FunctionInvocationSchema (line 54) | class FunctionInvocationSchema(Schema):
method make_dataclass (line 85) | def make_dataclass(self, data, **kwargs) -> FunctionInvocation:
class RevertedFunctionInvocationSchema (line 89) | class RevertedFunctionInvocationSchema(Schema):
method make_dataclass (line 93) | def make_dataclass(self, data, **kwargs) -> RevertedFunctionInvocation:
class ExecuteInvocationSchema (line 97) | class ExecuteInvocationSchema(OneOfSchema):
method get_data_type (line 103) | def get_data_type(self, data):
class InvokeTransactionTraceSchema (line 109) | class InvokeTransactionTraceSchema(Schema):
method make_dataclass (line 129) | def make_dataclass(self, data, **kwargs) -> InvokeTransactionTrace:
class DeclareTransactionTraceSchema (line 133) | class DeclareTransactionTraceSchema(Schema):
method make_dataclass (line 150) | def make_dataclass(self, data, **kwargs) -> DeclareTransactionTrace:
class DeployAccountTransactionTraceSchema (line 154) | class DeployAccountTransactionTraceSchema(Schema):
method make_dataclass (line 174) | def make_dataclass(self, data, **kwargs) -> DeployAccountTransactionTr...
class L1HandlerTransactionTraceSchema (line 178) | class L1HandlerTransactionTraceSchema(Schema):
method make_dataclass (line 191) | def make_dataclass(self, data, **kwargs) -> L1HandlerTransactionTrace:
class TransactionTraceSchema (line 195) | class TransactionTraceSchema(OneOfSchema):
class SimulatedTransactionSchema (line 206) | class SimulatedTransactionSchema(Schema):
method make_dataclass (line 219) | def make_dataclass(self, data, **kwargs) -> SimulatedTransaction:
class StorageInitialReadSchema (line 223) | class StorageInitialReadSchema(Schema):
method make_dataclass (line 229) | def make_dataclass(self, data, **kwargs) -> StorageInitialRead:
class NonceInitialReadSchema (line 233) | class NonceInitialReadSchema(Schema):
method make_dataclass (line 238) | def make_dataclass(self, data, **kwargs) -> NonceInitialRead:
class ClassHashInitialReadSchema (line 242) | class ClassHashInitialReadSchema(Schema):
method make_dataclass (line 247) | def make_dataclass(self, data, **kwargs) -> ClassHashInitialRead:
class DeclaredContractInitialReadSchema (line 251) | class DeclaredContractInitialReadSchema(Schema):
method make_dataclass (line 256) | def make_dataclass(self, data, **kwargs) -> DeclaredContractInitialRead:
class InitialReadsSchema (line 260) | class InitialReadsSchema(Schema):
method make_dataclass (line 283) | def make_dataclass(self, data, **kwargs) -> InitialReads:
class SimulatedTransactionsWithInitialReadsSchema (line 287) | class SimulatedTransactionsWithInitialReadsSchema(Schema):
method make_dataclass (line 298) | def make_dataclass(self, data, **kwargs) -> SimulatedTransactionsWithI...
class BlockTransactionTraceSchema (line 302) | class BlockTransactionTraceSchema(Schema):
method make_dataclass (line 310) | def make_dataclass(self, data, **kwargs) -> BlockTransactionTrace:
class BlockTransactionTracesSchema (line 314) | class BlockTransactionTracesSchema(Schema):
method make_dataclass (line 325) | def make_dataclass(self, data, **kwargs) -> BlockTransactionTracesWith...
FILE: starknet_py/net/schemas/rpc/transactions.py
class L2toL1MessageSchema (line 49) | class L2toL1MessageSchema(Schema):
method make_dataclass (line 55) | def make_dataclass(self, data, **kwargs) -> L2toL1Message:
class FeePaymentSchema (line 59) | class FeePaymentSchema(Schema):
method make_dataclass (line 64) | def make_dataclass(self, data, **kwargs) -> FeePayment:
class TransactionReceiptSchema (line 68) | class TransactionReceiptSchema(Schema):
method make_dataclass (line 88) | def make_dataclass(self, data, **kwargs) -> TransactionReceipt:
class TransactionReceiptWithBlockInfoSchema (line 92) | class TransactionReceiptWithBlockInfoSchema(TransactionReceiptSchema):
method make_dataclass (line 97) | def make_dataclass(self, data, **kwargs) -> TransactionReceiptWithBloc...
class TransactionStatusResponseSchema (line 101) | class TransactionStatusResponseSchema(Schema):
method make_dataclass (line 109) | def make_dataclass(self, data, **kwargs) -> TransactionStatusResponse:
class ResourceBoundsSchema (line 113) | class ResourceBoundsSchema(Schema):
method make_dataclass (line 118) | def make_dataclass(self, data, **kwargs) -> ResourceBounds:
class ResourceBoundsMappingSchema (line 122) | class ResourceBoundsMappingSchema(Schema):
method make_dataclass (line 130) | def make_dataclass(self, data, **kwargs) -> ResourceBoundsMapping:
class TransactionSchema (line 134) | class TransactionSchema(Schema):
class DeprecatedTransactionSchema (line 140) | class DeprecatedTransactionSchema(TransactionSchema):
class TransactionV3Schema (line 144) | class TransactionV3Schema(TransactionSchema):
class InvokeTransactionV0Schema (line 158) | class InvokeTransactionV0Schema(DeprecatedTransactionSchema):
method make_transaction (line 164) | def make_transaction(self, data, **kwargs) -> InvokeTransactionV0:
class InvokeTransactionV1Schema (line 168) | class InvokeTransactionV1Schema(DeprecatedTransactionSchema):
method make_transaction (line 174) | def make_transaction(self, data, **kwargs) -> InvokeTransactionV1:
class InvokeTransactionV3Schema (line 178) | class InvokeTransactionV3Schema(TransactionV3Schema):
method make_transaction (line 188) | def make_transaction(self, data, **kwargs) -> InvokeTransactionV3:
class BroadcastedInvokeTransactionV3Schema (line 192) | class BroadcastedInvokeTransactionV3Schema(InvokeTransactionV3Schema):
method remove_none_proof_fields (line 196) | def remove_none_proof_fields(self, data, **kwargs):
class DeclareTransactionV0Schema (line 204) | class DeclareTransactionV0Schema(DeprecatedTransactionSchema):
method make_dataclass (line 209) | def make_dataclass(self, data, **kwargs) -> DeclareTransactionV0:
class DeclareTransactionV1Schema (line 213) | class DeclareTransactionV1Schema(DeprecatedTransactionSchema):
method make_dataclass (line 219) | def make_dataclass(self, data, **kwargs) -> DeclareTransactionV1:
class DeclareTransactionV2Schema (line 223) | class DeclareTransactionV2Schema(DeprecatedTransactionSchema):
method make_dataclass (line 230) | def make_dataclass(self, data, **kwargs) -> DeclareTransactionV2:
class DeclareTransactionV3Schema (line 234) | class DeclareTransactionV3Schema(TransactionV3Schema):
method make_dataclass (line 245) | def make_dataclass(self, data, **kwargs) -> DeclareTransactionV3:
class DeployTransactionSchema (line 249) | class DeployTransactionSchema(TransactionSchema):
method make_dataclass (line 257) | def make_dataclass(self, data, **kwargs) -> DeployTransaction:
class DeployAccountTransactionV1Schema (line 261) | class DeployAccountTransactionV1Schema(DeprecatedTransactionSchema):
method make_dataclass (line 270) | def make_dataclass(self, data, **kwargs) -> DeployAccountTransactionV1:
class DeployAccountTransactionV3Schema (line 274) | class DeployAccountTransactionV3Schema(TransactionV3Schema):
method make_dataclass (line 283) | def make_dataclass(self, data, **kwargs) -> DeployAccountTransactionV3:
class DeclareTransactionSchema (line 287) | class DeclareTransactionSchema(OneOfSchema):
method get_data_type (line 295) | def get_data_type(self, data):
class InvokeTransactionSchema (line 299) | class InvokeTransactionSchema(OneOfSchema):
method get_obj_type (line 306) | def get_obj_type(self, obj):
method get_data_type (line 309) | def get_data_type(self, data):
class DeployAccountTransactionSchema (line 313) | class DeployAccountTransactionSchema(OneOfSchema):
method get_obj_type (line 319) | def get_obj_type(self, obj):
method get_data_type (line 322) | def get_data_type(self, data):
class L1HandlerTransactionSchema (line 326) | class L1HandlerTransactionSchema(TransactionSchema):
method make_dataclass (line 333) | def make_dataclass(self, data, **kwargs) -> L1HandlerTransaction:
class TypesOfTransactionsSchema (line 337) | class TypesOfTransactionsSchema(OneOfSchema):
class TransactionWithReceiptSchema (line 348) | class TransactionWithReceiptSchema(Schema):
method make_dataclass (line 353) | def make_dataclass(self, data, **kwargs) -> TransactionWithReceipt:
class SentTransactionSchema (line 357) | class SentTransactionSchema(Schema):
method make_dataclass (line 361) | def make_dataclass(self, data, **kwargs) -> SentTransactionResponse:
class DeclareTransactionResponseSchema (line 365) | class DeclareTransactionResponseSchema(SentTransactionSchema):
method make_dataclass (line 369) | def make_dataclass(self, data, **kwargs) -> DeclareTransactionResponse:
class DeployAccountTransactionResponseSchema (line 373) | class DeployAccountTransactionResponseSchema(SentTransactionSchema):
method make_dataclass (line 377) | def make_dataclass(self, data, **kwargs) -> DeployAccountTransactionRe...
class MessageStatusSchema (line 381) | class MessageStatusSchema(Schema):
method make_dataclass (line 390) | def make_dataclass(self, data, **kwargs) -> MessageStatus:
FILE: starknet_py/net/schemas/rpc/websockets.py
class NewHeadsNotificationSchema (line 29) | class NewHeadsNotificationSchema(Schema):
method make_dataclass (line 34) | def make_dataclass(self, data, **kwargs) -> NewHeadsNotification:
class NewEventsNotificationSchema (line 38) | class NewEventsNotificationSchema(Schema):
method make_dataclass (line 45) | def make_dataclass(self, data, **kwargs) -> NewEventsNotification:
class NewTransactionStatusSchema (line 49) | class NewTransactionStatusSchema(Schema):
method make_dataclass (line 56) | def make_dataclass(self, data, **kwargs) -> NewTransactionStatus:
class TransactionStatusNotificationSchema (line 60) | class TransactionStatusNotificationSchema(Schema):
method make_dataclass (line 67) | def make_dataclass(self, data, **kwargs) -> TransactionStatusNotificat...
class PendingTransactionsNotificationResultField (line 71) | class PendingTransactionsNotificationResultField(fields.Field):
method _serialize (line 72) | def _serialize(self, value: Any, attr: Optional[str], obj: Any, **kwar...
method _deserialize (line 81) | def _deserialize(
class ReorgDataSchema (line 97) | class ReorgDataSchema(Schema):
method make_dataclass (line 108) | def make_dataclass(self, data, **kwargs) -> ReorgData:
class ReorgNotificationSchema (line 112) | class ReorgNotificationSchema(Schema):
method make_dataclass (line 117) | def make_dataclass(self, data, **kwargs) -> ReorgNotification:
class NewTransactionReceiptsNotificationSchema (line 121) | class NewTransactionReceiptsNotificationSchema(Schema):
method make_dataclass (line 128) | def make_dataclass(self, data, **kwargs) -> NewTransactionReceiptsNoti...
class TypesOfTransactionWithFinalitySchema (line 132) | class TypesOfTransactionWithFinalitySchema(TypesOfTransactionsSchema):
method load (line 133) | def load(self, data, *, many=None, partial=None, unknown=None, **kwargs):
class NewTransactionNotificationSchema (line 159) | class NewTransactionNotificationSchema(Schema):
method make_dataclass (line 166) | def make_dataclass(self, data, **kwargs) -> NewTransactionNotification:
FILE: starknet_py/net/schemas/utils.py
function _extract_tx_version (line 6) | def _extract_tx_version(version: Union[int, str]) -> str:
FILE: starknet_py/net/signer/base_signer.py
class BaseSigner (line 8) | class BaseSigner(ABC):
method public_key (line 15) | def public_key(self) -> int:
method sign_transaction (line 23) | def sign_transaction(self, transaction: AccountTransaction) -> List[int]:
method sign_message (line 32) | def sign_message(self, typed_data: TypedData, account_address: int) ->...
FILE: starknet_py/net/signer/eth_signer.py
class EthSigner (line 14) | class EthSigner(BaseSigner):
method __init__ (line 15) | def __init__(
method public_key (line 28) | def public_key(self) -> int:
method sign_message (line 31) | def sign_message(self, typed_data: TypedData, account_address: int) ->...
method sign_transaction (line 39) | def sign_transaction(self, transaction: AccountTransaction) -> List[int]:
function _serialize_signature (line 49) | def _serialize_signature(signature: Signature) -> List[int]:
FILE: starknet_py/net/signer/key_pair.py
class KeyPair (line 12) | class KeyPair:
method __init__ (line 16) | def __init__(self, private_key: Hash, public_key: Hash):
method generate (line 28) | def generate() -> "KeyPair":
method from_private_key (line 40) | def from_private_key(key: Hash) -> "KeyPair":
method from_keystore (line 46) | def from_keystore(path: str, password: str) -> "KeyPair":
FILE: starknet_py/net/signer/ledger_signer.py
class LateException (line 21) | class LateException:
method __init__ (line 22) | def __init__(self, exc: Exception):
method __getattr__ (line 25) | def __getattr__(self, item):
method __call__ (line 28) | def __call__(self, *args, **kwargs):
class LedgerStarknetApp (line 41) | class LedgerStarknetApp:
method __init__ (line 42) | def __init__(self, account_id: int = 0, application_name: str = "Ledge...
method version (line 54) | def version(self) -> str:
method get_public_key (line 68) | def get_public_key(self, device_confirmation: bool = False) -> int:
method sign_hash (line 91) | def sign_hash(self, hash_val: int) -> List[int]:
method set_private_key (line 124) | def set_private_key(self, ins: int):
class LedgerSigningMode (line 133) | class LedgerSigningMode(Enum):
class LedgerSigner (line 154) | class LedgerSigner(BaseSigner):
method __init__ (line 155) | def __init__(
method public_key (line 176) | def public_key(self) -> int:
method sign_transaction (line 179) | def sign_transaction(self, transaction: AccountTransaction) -> List[int]:
method sign_message (line 193) | def sign_message(self, typed_data: TypedData, account_address: int) ->...
method _decode_signature (line 198) | def _decode_signature(self, response: bytes) -> List[int]:
method _sign_deploy_account_v3 (line 203) | def _sign_deploy_account_v3(self, tx: DeployAccountV3) -> List[int]:
method _sign_invoke_transaction_v3 (line 299) | def _sign_invoke_transaction_v3(self, tx: InvokeV3) -> List[int]:
method _encode_fee (line 398) | def _encode_fee(
function _string_to_4byte_hash (line 419) | def _string_to_4byte_hash(s: str) -> bytes:
function _call_to_bytes (line 425) | def _call_to_bytes(serialized_call: List[int]) -> List[bytes]:
function _get_derivation_path (line 452) | def _get_derivation_path(
class BlindSigningModeWarning (line 483) | class BlindSigningModeWarning(Warning):
function _print_blind_signing_mode_warning (line 487) | def _print_blind_signing_mode_warning():
FILE: starknet_py/net/signer/stark_curve_signer.py
class StarkCurveSigner (line 12) | class StarkCurveSigner(BaseSigner):
method __init__ (line 13) | def __init__(
method private_key (line 29) | def private_key(self) -> int:
method public_key (line 34) | def public_key(self) -> int:
method sign_transaction (line 37) | def sign_transaction(
method sign_message (line 46) | def sign_message(self, typed_data: TypedData, account_address: int) ->...
FILE: starknet_py/net/tip/__init__.py
function estimate_tip (line 9) | async def estimate_tip(
FILE: starknet_py/net/udc_deployer/deployer.py
class ContractDeployment (line 18) | class ContractDeployment(NamedTuple):
class Deployer (line 35) | class Deployer:
method __init__ (line 40) | def __init__(
method create_contract_deployment (line 58) | def create_contract_deployment(
method create_contract_deployment_raw (line 95) | def create_contract_deployment_raw(
method _compute_address (line 130) | def _compute_address(
function _get_random_salt (line 147) | def _get_random_salt() -> int:
function _is_list_of_ints_or_strings (line 187) | def _is_list_of_ints_or_strings(data: Union[List, dict]) -> bool:
FILE: starknet_py/net/websockets/errors.py
class WebsocketClientError (line 4) | class WebsocketClientError(Exception):
method __init__ (line 9) | def __init__(
FILE: starknet_py/net/websockets/models.py
class Notification (line 22) | class Notification(Generic[T]):
class NewHeadsNotification (line 32) | class NewHeadsNotification(Notification[BlockHeader]):
class NewEventsNotification (line 39) | class NewEventsNotification(Notification[EmittedEventWithFinalityStatus]):
class NewTransactionStatus (line 46) | class NewTransactionStatus:
class TransactionStatusNotification (line 56) | class TransactionStatusNotification(Notification[NewTransactionStatus]):
class ReorgData (line 63) | class ReorgData:
class ReorgNotification (line 75) | class ReorgNotification(Notification[ReorgData]):
class NewTransactionReceiptsNotification (line 82) | class NewTransactionReceiptsNotification(Notification[TransactionReceipt...
class NewTransactionNotificationResult (line 89) | class NewTransactionNotificationResult:
class NewTransactionNotification (line 95) | class NewTransactionNotification(Notification[NewTransactionNotification...
class SubscriptionTag (line 101) | class SubscriptionTag(str, Enum):
FILE: starknet_py/net/websockets/websocket_client.py
class WebsocketClient (line 62) | class WebsocketClient:
method __init__ (line 67) | def __init__(self, node_url: str):
method connect (line 83) | async def connect(self):
method disconnect (line 99) | async def disconnect(self):
method is_connected (line 119) | async def is_connected(self) -> bool:
method subscribe_new_heads (line 127) | async def subscribe_new_heads(
method subscribe_events (line 150) | async def subscribe_events(
method subscribe_transaction_status (line 198) | async def subscribe_transaction_status(
method subscribe_new_transactions (line 218) | async def subscribe_new_transactions(
method subscribe_new_transaction_receipts (line 252) | async def subscribe_new_transaction_receipts(
method on_chain_reorg (line 284) | def on_chain_reorg(
method on_chain_reorg (line 296) | def on_chain_reorg(self, handler: Callable[[ReorgNotification], Any]):
method unsubscribe (line 304) | async def unsubscribe(self, subscription_id: str) -> bool:
method _subscribe (line 323) | async def _subscribe(
method _listen (line 348) | async def _listen(self):
method _fail_fast (line 359) | def _fail_fast(self, task: asyncio.Task) -> None:
method _send_message (line 378) | async def _send_message(
method _handle_received_message (line 428) | def _handle_received_message(self, message: Union[str, bytes]):
method _handle_notification (line 446) | def _handle_notification(self, data: Dict):
method _handle_error (line 470) | def _handle_error(self, result: dict):
method wait_closed_or_failed (line 479) | async def wait_closed_or_failed(self) -> None:
FILE: starknet_py/proxy/contract_abi_resolver.py
class ProxyConfig (line 24) | class ProxyConfig(TypedDict, total=False):
function prepare_proxy_config (line 36) | def prepare_proxy_config(proxy_config: ProxyConfig) -> ProxyConfig:
class ImplementationType (line 47) | class ImplementationType(Enum):
class ContractAbiResolver (line 56) | class ContractAbiResolver:
method __init__ (line 61) | def __init__(
method resolve (line 76) | async def resolve(self) -> Tuple[AbiDictList, int]:
method get_abi_for_address (line 89) | async def get_abi_for_address(self) -> Tuple[AbiDictList, int]:
method resolve_abi (line 105) | async def resolve_abi(self) -> Tuple[AbiDictList, int]:
method _get_cairo_version (line 143) | def _get_cairo_version(
method get_abi_from_contract_class (line 149) | def get_abi_from_contract_class(
method _get_implementation_from_proxy (line 158) | async def _get_implementation_from_proxy(
class AbiNotFoundError (line 193) | class AbiNotFoundError(Exception):
class ProxyResolutionError (line 199) | class ProxyResolutionError(Exception):
method __init__ (line 206) | def __init__(
function _get_class_at (line 219) | async def _get_class_at(
FILE: starknet_py/proxy/proxy_check.py
class ProxyCheck (line 12) | class ProxyCheck(ABC):
method implementation_address (line 14) | async def implementation_address(
method implementation_hash (line 23) | async def implementation_hash(
class ArgentProxyCheck (line 33) | class ArgentProxyCheck(ProxyCheck):
method implementation_address (line 34) | async def implementation_address(
method implementation_hash (line 39) | async def implementation_hash(
method get_implementation (line 45) | async def get_implementation(address: Address, client: Client) -> Opti...
class OpenZeppelinProxyCheck (line 55) | class OpenZeppelinProxyCheck(ProxyCheck):
method implementation_address (line 56) | async def implementation_address(
method implementation_hash (line 63) | async def implementation_hash(
method _get_storage_at_or_none (line 71) | async def _get_storage_at_or_none(
FILE: starknet_py/serialization/_calldata_reader.py
class OutOfBoundsError (line 6) | class OutOfBoundsError(Exception):
method __init__ (line 7) | def __init__(self, position: int, requested_size: int, remaining_size:...
class CalldataReader (line 16) | class CalldataReader:
method __init__ (line 20) | def __init__(self, data: List[int]):
method remaining_len (line 25) | def remaining_len(self) -> int:
method read (line 28) | def read(self, size: int) -> CairoData:
FILE: starknet_py/serialization/_context.py
class Context (line 15) | class Context(ABC):
method __init__ (line 23) | def __init__(self):
method current_entity (line 27) | def current_entity(self):
method push_entity (line 36) | def push_entity(self, name: str) -> Generator:
method ensure_valid_value (line 49) | def ensure_valid_value(self, valid: bool, text: str):
method ensure_valid_type (line 53) | def ensure_valid_type(self, value: Any, valid: bool, expected_type: str):
method _wrap_errors (line 61) | def _wrap_errors(self):
method _error_prefix (line 86) | def _error_prefix(self):
class SerializationContext (line 92) | class SerializationContext(Context):
method create (line 101) | def create(cls) -> Iterator[SerializationContext]:
class DeserializationContext (line 107) | class DeserializationContext(Context):
method __init__ (line 114) | def __init__(self, calldata: CairoData):
method create (line 124) | def create(cls, data: CairoData) -> Iterator[DeserializationContext]:
method _ensure_all_values_read (line 130) | def _ensure_all_values_read(self, total_len: int):
FILE: starknet_py/serialization/data_serializers/_common.py
function deserialize_to_list (line 17) | def deserialize_to_list(
function deserialize_to_dict (line 32) | def deserialize_to_dict(
function serialize_from_list (line 49) | def serialize_from_list(
function serialize_from_dict (line 65) | def serialize_from_dict(
FILE: starknet_py/serialization/data_serializers/array_serializer.py
class ArraySerializer (line 18) | class ArraySerializer(CairoDataSerializer[List, List]):
method deserialize_with_context (line 31) | def deserialize_with_context(self, context: DeserializationContext) ->...
method serialize_with_context (line 37) | def serialize_with_context(
FILE: starknet_py/serialization/data_serializers/bool_serializer.py
class BoolSerializer (line 15) | class BoolSerializer(CairoDataSerializer[bool, int]):
method deserialize_with_context (line 20) | def deserialize_with_context(self, context: DeserializationContext) ->...
method serialize_with_context (line 25) | def serialize_with_context(
method _ensure_bool (line 33) | def _ensure_bool(context: Context, value: int):
FILE: starknet_py/serialization/data_serializers/byte_array_serializer.py
class ByteArraySerializer (line 22) | class ByteArraySerializer(CairoDataSerializer[str, str]):
method deserialize_with_context (line 31) | def deserialize_with_context(self, context: DeserializationContext) ->...
method serialize_with_context (line 57) | def serialize_with_context(
FILE: starknet_py/serialization/data_serializers/cairo_data_serializer.py
class CairoDataSerializer (line 19) | class CairoDataSerializer(ABC, Generic[SerializationType, Deserializatio...
method deserialize (line 24) | def deserialize(self, data: List[int]) -> DeserializationType:
method serialize (line 34) | def serialize(self, data: SerializationType) -> CairoData:
method deserialize_with_context (line 47) | def deserialize_with_context(
method serialize_with_context (line 58) | def serialize_with_context(
method remove_units_from_serialized_data (line 70) | def remove_units_from_serialized_data(serialized_data: List) -> List:
FILE: starknet_py/serialization/data_serializers/enum_serializer.py
class EnumSerializer (line 15) | class EnumSerializer(CairoDataSerializer[Union[Dict, TupleDataclass], Tu...
method deserialize_with_context (line 34) | def deserialize_with_context(
method serialize_with_context (line 48) | def serialize_with_context(
method _get_variant (line 67) | def _get_variant(self, variant_index: int) -> Tuple[str, CairoDataSeri...
method _get_variant_index (line 70) | def _get_variant_index(self, variant_name: str) -> int:
FILE: starknet_py/serialization/data_serializers/felt_serializer.py
class FeltSerializer (line 18) | class FeltSerializer(CairoDataSerializer[int, int]):
method deserialize_with_context (line 23) | def deserialize_with_context(self, context: DeserializationContext) ->...
method serialize_with_context (line 28) | def serialize_with_context(
method _ensure_felt (line 46) | def _ensure_felt(context: Context, value: int):
FILE: starknet_py/serialization/data_serializers/int_serializer.py
class IntSerializer (line 16) | class IntSerializer(CairoDataSerializer[int, int]):
method deserialize_with_context (line 25) | def deserialize_with_context(self, context: DeserializationContext) ->...
method serialize_with_context (line 39) | def serialize_with_context(
method _serialize_from_int (line 46) | def _serialize_from_int(
method _ensure_valid_int (line 56) | def _ensure_valid_int(value: int, context: Context, bits: int):
FILE: starknet_py/serialization/data_serializers/named_tuple_serializer.py
class NamedTupleSerializer (line 19) | class NamedTupleSerializer(
method deserialize_with_context (line 33) | def deserialize_with_context(
method serialize_with_context (line 39) | def serialize_with_context(
method _is_namedtuple (line 57) | def _is_namedtuple(value) -> bool:
FILE: starknet_py/serialization/data_serializers/non_zero_serializer.py
class NonZeroSerializer (line 15) | class NonZeroSerializer(CairoDataSerializer[Any, int]):
method deserialize_with_context (line 24) | def deserialize_with_context(self, context: DeserializationContext) ->...
method serialize_with_context (line 29) | def serialize_with_context(
method _ensure_valid_nonzero (line 38) | def _ensure_valid_nonzero(value: int, context: Context):
FILE: starknet_py/serialization/data_serializers/option_serializer.py
class OptionSerializer (line 14) | class OptionSerializer(CairoDataSerializer[Optional[Any], Optional[Any]]):
method deserialize_with_context (line 27) | def deserialize_with_context(
method serialize_with_context (line 36) | def serialize_with_context(
FILE: starknet_py/serialization/data_serializers/output_serializer.py
class OutputSerializer (line 14) | class OutputSerializer(CairoDataSerializer[List, Tuple]):
method deserialize_with_context (line 26) | def deserialize_with_context(self, context: DeserializationContext) ->...
method serialize_with_context (line 35) | def serialize_with_context(
FILE: starknet_py/serialization/data_serializers/payload_serializer.py
class PayloadSerializer (line 25) | class PayloadSerializer(CairoDataSerializer[Dict, TupleDataclass]):
method __post_init__ (line 41) | def __post_init__(self, input_serializers):
method deserialize_with_context (line 52) | def deserialize_with_context(
method serialize_with_context (line 58) | def serialize_with_context(
method _is_len_arg (line 64) | def _is_len_arg(arg_name: str, serializers: Dict[str, CairoDataSeriali...
FILE: starknet_py/serialization/data_serializers/struct_serializer.py
class StructSerializer (line 18) | class StructSerializer(CairoDataSerializer[Dict, Dict]):
method deserialize_with_context (line 30) | def deserialize_with_context(self, context: DeserializationContext) ->...
method serialize_with_context (line 33) | def serialize_with_context(
FILE: starknet_py/serialization/data_serializers/tuple_serializer.py
class TupleSerializer (line 18) | class TupleSerializer(CairoDataSerializer[Iterable, Tuple]):
method deserialize_with_context (line 30) | def deserialize_with_context(self, context: DeserializationContext) ->...
method serialize_with_context (line 33) | def serialize_with_context(
FILE: starknet_py/serialization/data_serializers/uint256_serializer.py
class Uint256Dict (line 17) | class Uint256Dict(TypedDict):
class Uint256Serializer (line 23) | class Uint256Serializer(CairoDataSerializer[Union[int, Uint256Dict], int]):
method deserialize_with_context (line 36) | def deserialize_with_context(self, context: DeserializationContext) ->...
method serialize_with_context (line 47) | def serialize_with_context(
method _serialize_from_int (line 57) | def _serialize_from_int(value: int) -> Generator[int, None, None]:
method _serialize_from_dict (line 62) | def _serialize_from_dict(
method _ensure_valid_uint128 (line 73) | def _ensure_valid_uint128(value: int, context: Context):
FILE: starknet_py/serialization/data_serializers/uint_serializer.py
class Uint256Dict (line 15) | class Uint256Dict(TypedDict):
class UintSerializer (line 21) | class UintSerializer(CairoDataSerializer[Union[int, Uint256Dict], int]):
method deserialize_with_context (line 42) | def deserialize_with_context(self, context: DeserializationContext) ->...
method serialize_with_context (line 60) | def serialize_with_context(
method _serialize_from_int (line 70) | def _serialize_from_int(
method _serialize_from_dict (line 83) | def _serialize_from_dict(
method _ensure_valid_uint (line 94) | def _ensure_valid_uint(value: int, context: Context, bits: int):
FILE: starknet_py/serialization/data_serializers/unit_serializer.py
class UnitSerializer (line 15) | class UnitSerializer(CairoDataSerializer[None, None]):
method deserialize_with_context (line 25) | def deserialize_with_context(self, context: DeserializationContext) ->...
method serialize_with_context (line 28) | def serialize_with_context(
FILE: starknet_py/serialization/errors.py
class CairoSerializerException (line 1) | class CairoSerializerException(Exception):
class InvalidTypeException (line 5) | class InvalidTypeException(CairoSerializerException, TypeError):
class InvalidValueException (line 9) | class InvalidValueException(CairoSerializerException, ValueError):
FILE: starknet_py/serialization/factory.py
function serializer_for_type (line 70) | def serializer_for_type(cairo_type: CairoType) -> CairoDataSerializer:
function serializer_for_payload (line 144) | def serializer_for_payload(payload: Dict[str, CairoType]) -> PayloadSeri...
function serializer_for_outputs (line 160) | def serializer_for_outputs(payload: List[CairoType]) -> OutputSerializer:
function serializer_for_event (line 178) | def serializer_for_event(event: EventV0 | EventV1 | EventV2) -> PayloadS...
function serializer_for_function (line 192) | def serializer_for_function(
function serializer_for_function_v1 (line 207) | def serializer_for_function_v1(
function serializer_for_constructor_v2 (line 222) | def serializer_for_constructor_v2(
function _is_byte_array_type (line 237) | def _is_byte_array_type(cairo_type: CairoType) -> bool:
FILE: starknet_py/serialization/function_serialization_adapter.py
class FunctionSerializationAdapter (line 18) | class FunctionSerializationAdapter:
method __post_init__ (line 27) | def __post_init__(self):
method serialize (line 32) | def serialize(self, *args, **kwargs) -> CairoData:
method _merge_arguments (line 41) | def _merge_arguments(self, args: Tuple, kwargs: Dict) -> Dict:
method _ensure_no_unnecessary_positional_args (line 68) | def _ensure_no_unnecessary_positional_args(self, args: Tuple):
method _ensure_no_unnecessary_args (line 75) | def _ensure_no_unnecessary_args(expected_args: Set[str], provided_args...
method _ensure_no_missing_args (line 83) | def _ensure_no_missing_args(expected_args: Set[str], provided_args: Se...
class FunctionSerializationAdapterV0 (line 92) | class FunctionSerializationAdapterV0(FunctionSerializationAdapter):
method deserialize (line 99) | def deserialize(self, data: List[int]) -> TupleDataclass:
class FunctionSerializationAdapterV1 (line 109) | class FunctionSerializationAdapterV1(FunctionSerializationAdapter):
method deserialize (line 112) | def deserialize(self, data: List[int]) -> Tuple:
FILE: starknet_py/serialization/tuple_dataclass.py
class TupleDataclass (line 8) | class TupleDataclass:
method __getattr__ (line 17) | def __getattr__(self, item):
method __getitem__ (line 22) | def __getitem__(self, item: int):
method __iter__ (line 26) | def __iter__(self):
method as_tuple (line 29) | def as_tuple(self) -> Tuple:
method as_dict (line 35) | def as_dict(self) -> Dict:
method _asdict (line 42) | def _asdict(self):
method __eq__ (line 45) | def __eq__(self, other):
method from_dict (line 51) | def from_dict(data: Dict, *, name: Optional[str] = None) -> TupleDatac...
FILE: starknet_py/tests/e2e/account/account_test.py
function test_get_balance_throws_when_token_not_specified (line 41) | async def test_get_balance_throws_when_token_not_specified(account):
function test_balance_when_token_specified (line 60) | async def test_balance_when_token_specified(account, erc20_contract):
function test_estimated_fee_greater_than_zero (line 71) | async def test_estimated_fee_greater_than_zero(account, erc20_contract):
function test_account_estimate_fee_for_declare_transaction (line 85) | async def test_account_estimate_fee_for_declare_transaction(
function test_account_estimate_fee_for_transactions (line 104) | async def test_account_estimate_fee_for_transactions(account, map_contra...
function test_sending_multicall (line 131) | async def test_sending_multicall(account, map_contract, key, val):
function test_rejection_reason_in_transaction_receipt (line 145) | async def test_rejection_reason_in_transaction_receipt(map_contract):
function test_sign_and_verify_offchain_message_fail (line 161) | def test_sign_and_verify_offchain_message_fail(account, typed_data):
function test_sign_and_verify_offchain_message (line 169) | def test_sign_and_verify_offchain_message(account, typed_data):
function test_get_class_hash_at (line 177) | async def test_get_class_hash_at(account, map_contract):
function test_get_nonce (line 186) | async def test_get_nonce(account, map_contract):
function test_sign_invoke_v3 (line 215) | async def test_sign_invoke_v3(account, calls):
function test_sign_invoke_v3_auto_estimate (line 226) | async def test_sign_invoke_v3_auto_estimate(account, map_contract):
function test_sign_declare_v3 (line 248) | async def test_sign_declare_v3(
function test_sign_declare_v3_auto_estimate (line 271) | async def test_sign_declare_v3_auto_estimate(
function test_sign_deploy_account_v3 (line 299) | async def test_sign_deploy_account_v3(account):
function test_sign_deploy_account_v3_auto_estimate (line 323) | async def test_sign_deploy_account_v3_auto_estimate(
function test_deploy_account_v3 (line 349) | async def test_deploy_account_v3(client, deploy_account_details_factory):
function test_deploy_account_raises_on_incorrect_address (line 373) | async def test_deploy_account_raises_on_incorrect_address(
function test_deploy_account_raises_on_no_enough_funds (line 394) | async def test_deploy_account_raises_on_no_enough_funds(
function test_deploy_account_passes_on_enough_funds (line 419) | async def test_deploy_account_passes_on_enough_funds(
function test_deploy_account_uses_custom_calldata (line 449) | async def test_deploy_account_uses_custom_calldata(
function test_sign_invoke_v3_for_fee_estimation (line 482) | async def test_sign_invoke_v3_for_fee_estimation(account, map_contract):
function test_sign_transaction_custom_nonce (line 498) | async def test_sign_transaction_custom_nonce(account, hello_starknet_cla...
function test_argent_account_deploy (line 530) | async def test_argent_account_deploy(
function test_argent_account_execute (line 558) | async def test_argent_account_execute(
function test_account_execute_v3 (line 604) | async def test_account_execute_v3(account, deployed_balance_contract):
function test_invoke_v3_with_tip (line 639) | async def test_invoke_v3_with_tip(account, hello_starknet_class_hash):
function test_invoke_v3_auto_estimate_tip (line 661) | async def test_invoke_v3_auto_estimate_tip(
function test_deploy_account_v3_with_tip (line 688) | async def test_deploy_account_v3_with_tip(client, deploy_account_details...
function test_deploy_account_v3_auto_estimate_tip (line 709) | async def test_deploy_account_v3_auto_estimate_tip(
function test_declare_v3_with_tip (line 737) | async def test_declare_v3_with_tip(account):
function test_declare_v3_auto_estimate_tip (line 755) | async def test_declare_v3_auto_estimate_tip(
function test_invalid_proof (line 778) | async def test_invalid_proof(map_contract):
FILE: starknet_py/tests/e2e/account/outside_execution_test.py
function test_argent_account_outside_execution_compatibility (line 14) | async def test_argent_account_outside_execution_compatibility(
function test_account_outside_execution_any_caller (line 25) | async def test_account_outside_execution_any_caller(
function test_account_outside_execution_for_invalid_caller (line 55) | async def test_account_outside_execution_for_invalid_caller(
function test_account_outside_execution_for_impossible_time_bounds (line 91) | async def test_account_outside_execution_for_impossible_time_bounds(
function test_account_outside_execution_by_itself_is_impossible (line 120) | async def test_account_outside_execution_by_itself_is_impossible(
FILE: starknet_py/tests/e2e/block_test.py
function test_pre_confirmed_block (line 15) | async def test_pre_confirmed_block(account):
function test_latest_block (line 22) | async def test_latest_block(account):
function test_block_with_tx_hashes_pre_confirmed (line 30) | async def test_block_with_tx_hashes_pre_confirmed(account):
function test_block_with_tx_hashes_latest (line 38) | async def test_block_with_tx_hashes_latest(account):
function test_get_block_with_txs_pre_confirmed (line 58) | async def test_get_block_with_txs_pre_confirmed(account):
function test_get_block_with_txs_latest (line 66) | async def test_get_block_with_txs_latest(account, map_class_hash):
function test_block_with_receipts_latest (line 88) | async def test_block_with_receipts_latest(account):
FILE: starknet_py/tests/e2e/cairo1v2_test.py
function declare_deploy_hello2 (line 17) | async def declare_deploy_hello2(account) -> Tuple[DeclareResult, DeployR...
function hello2_contract (line 36) | async def hello2_contract(declare_deploy_hello2) -> Contract:
function test_deploy_cairo2 (line 42) | async def test_deploy_cairo2(contract):
function test_cairo2_interaction (line 47) | async def test_cairo2_interaction(contract):
function test_cairo2_interaction2 (line 63) | async def test_cairo2_interaction2(contract):
function test_cairo2_uint (line 75) | async def test_cairo2_uint(contract, uint_bits):
function test_cairo2_u256 (line 81) | async def test_cairo2_u256(contract):
function test_cairo2_contract_address (line 92) | async def test_cairo2_contract_address(contract):
function test_cairo2_interaction3 (line 103) | async def test_cairo2_interaction3(contract):
function test_cairo2_echo (line 148) | async def test_cairo2_echo(contract):
function test_cairo2_echo_struct (line 162) | async def test_cairo2_echo_struct(contract):
function test_cairo2_echo_complex_struct (line 168) | async def test_cairo2_echo_complex_struct(contract):
function test_cairo2_echo_tuple (line 197) | async def test_cairo2_echo_tuple(contract):
FILE: starknet_py/tests/e2e/client/client_test.py
function test_get_declare_transaction (line 57) | async def test_get_declare_transaction(
function test_get_invoke_transaction (line 69) | async def test_get_invoke_transaction(
function test_get_deploy_account_transaction (line 81) | async def test_get_deploy_account_transaction(client, deploy_account_tra...
function test_get_transaction_raises_on_not_received (line 91) | async def test_get_transaction_raises_on_not_received(client):
function test_get_block_by_hash (line 99) | async def test_get_block_by_hash(
function test_get_block_by_number (line 112) | async def test_get_block_by_number(
function test_get_storage_at (line 125) | async def test_get_storage_at(client, contract_address_2):
function test_get_messages_status (line 136) | async def test_get_messages_status(client):
function test_get_storage_proof (line 164) | async def test_get_storage_proof(client):
function test_get_compiled_casm (line 244) | async def test_get_compiled_casm(client):
function test_get_transaction_receipt (line 279) | async def test_get_transaction_receipt(
function test_estimate_fee_invoke_v3 (line 290) | async def test_estimate_fee_invoke_v3(account, contract_address):
function test_estimate_fee_declare_v3 (line 313) | async def test_estimate_fee_declare_v3(
function test_estimate_fee_deploy_account (line 336) | async def test_estimate_fee_deploy_account(client, deploy_account_transa...
function test_estimate_fee_for_multiple_transactions (line 350) | async def test_estimate_fee_for_multiple_transactions(
function test_call_contract (line 381) | async def test_call_contract(client, contract_address_2):
function test_add_transaction (line 394) | async def test_add_transaction(map_contract, client, account):
function test_add_invoke_v3_transaction_with_tip (line 411) | async def test_add_invoke_v3_transaction_with_tip(map_contract, client, ...
function test_add_declare_v3_transaction_with_tip (line 433) | async def test_add_declare_v3_transaction_with_tip(
function test_get_class_hash_at (line 451) | async def test_get_class_hash_at(client, contract_address, class_hash):
function test_get_class_by_hash (line 459) | async def test_get_class_by_hash(client, class_hash):
function test_wait_for_tx_accepted (line 469) | async def test_wait_for_tx_accepted(client, get_tx_receipt_path, get_tx_...
function test_wait_for_tx_not_received (line 493) | async def test_wait_for_tx_not_received(client, get_tx_status_path):
function test_wait_for_tx_reverted (line 510) | async def test_wait_for_tx_reverted(client, get_tx_receipt_path, get_tx_...
function test_wait_for_tx_unknown_error (line 539) | async def test_wait_for_tx_unknown_error(
function test_custom_session_client (line 556) | async def test_custom_session_client(map_contract, devnet):
function test_get_l1_handler_transaction (line 596) | async def test_get_l1_handler_transaction(client):
function test_state_update_declared_contract_hashes (line 634) | async def test_state_update_declared_contract_hashes(
function test_state_update_storage_diffs (line 646) | async def test_state_update_storage_diffs(
function test_state_update_deployed_contracts (line 663) | async def test_state_update_deployed_contracts(
function test_get_class_by_hash_sierra_program (line 682) | async def test_get_class_by_hash_sierra_program(client, hello_starknet_c...
function test_get_declare_v3_transaction (line 696) | async def test_get_declare_v3_transaction(
function test_get_block_with_declare_v3 (line 724) | async def test_get_block_with_declare_v3(
function test_get_new_state_update (line 756) | async def test_get_new_state_update(
function test_get_state_update_with_contract_addresses (line 776) | async def test_get_state_update_with_contract_addresses(
FILE: starknet_py/tests/e2e/client/fixtures/prepare_net_for_gateway_test.py
class PreparedNetworkData (line 13) | class PreparedNetworkData:
function prepare_net_for_tests (line 28) | async def prepare_net_for_tests(
FILE: starknet_py/tests/e2e/client/fixtures/prepare_network.py
function balance_class_and_transaction_hash (line 23) | async def balance_class_and_transaction_hash(account: BaseAccount) -> Tu...
function deployed_balance_contract (line 34) | async def deployed_balance_contract(
function deployed_balance_contract_2 (line 53) | async def deployed_balance_contract_2(
function balance_abi (line 71) | def balance_abi() -> List:
function block_with_invoke_number (line 80) | def block_with_invoke_number(prepare_network: Tuple[str, PreparedNetwork...
function block_with_declare_number (line 89) | def block_with_declare_number(prepare_network: Tuple[str, PreparedNetwor...
function block_with_declare_hash (line 98) | def block_with_declare_hash(prepare_network: Tuple[str, PreparedNetworkD...
function invoke_transaction (line 107) | def invoke_transaction(prepare_network: Tuple[str, PreparedNetworkData])...
function invoke_transaction_hash (line 120) | def invoke_transaction_hash(invoke_transaction: Dict) -> int:
function invoke_transaction_calldata (line 128) | def invoke_transaction_calldata(invoke_transaction: Dict) -> int:
function invoke_transaction_selector (line 136) | def invoke_transaction_selector(invoke_transaction: Dict) -> int:
function declare_transaction_hash (line 144) | def declare_transaction_hash(prepare_network: Tuple[str, PreparedNetwork...
function contract_address (line 153) | def contract_address(prepare_network: Tuple[str, PreparedNetworkData]) -...
function contract_address_2 (line 165) | def contract_address_2(prepare_network: Tuple[str, PreparedNetworkData])...
function class_hash (line 174) | def class_hash(prepare_network: Tuple[str, PreparedNetworkData]) -> int:
function prepare_network (line 183) | async def prepare_network(
FILE: starknet_py/tests/e2e/client/fixtures/transactions.py
function deploy_account_transaction (line 26) | async def deploy_account_transaction(
function deploy_account_transaction_hash (line 58) | def deploy_account_transaction_hash(
function block_with_deploy_account_number (line 69) | def block_with_deploy_account_number(
function hello_starknet_deploy_transaction_address (line 80) | async def hello_starknet_deploy_transaction_address(
function block_with_declare_v3_number (line 96) | async def block_with_declare_v3_number(hello_starknet_tx_hash: int, clie...
FILE: starknet_py/tests/e2e/client/full_node_test.py
function _parse_event_name (line 39) | def _parse_event_name(event: str) -> str:
function test_node_get_declare_transaction_by_block_number_and_index (line 51) | async def test_node_get_declare_transaction_by_block_number_and_index(
function test_get_class_at (line 66) | async def test_get_class_at(
function test_get_class_at_throws_on_wrong_address (line 89) | async def test_get_class_at_throws_on_wrong_address(client):
function test_block_transaction_count (line 98) | async def test_block_transaction_count(client):
function test_method_raises_on_both_block_hash_and_number (line 110) | async def test_method_raises_on_both_block_hash_and_number(client):
function test_get_transaction_receipt_deploy_account (line 119) | async def test_get_transaction_receipt_deploy_account(
function test_get_storage_at_incorrect_address_full_node_client (line 140) | async def test_get_storage_at_incorrect_address_full_node_client(client):
function test_get_events_without_following_continuation_token (line 155) | async def test_get_events_without_following_continuation_token(
function test_get_events_follow_continuation_token (line 184) | async def test_get_events_follow_continuation_token(
function test_get_events_nonexistent_event_name (line 213) | async def test_get_events_nonexistent_event_name(
function test_get_events_with_two_events (line 240) | async def test_get_events_with_two_events(
function test_get_events_start_from_continuation_token (line 293) | async def test_get_events_start_from_continuation_token(
function test_get_events_no_params (line 324) | async def test_get_events_no_params(
function test_get_events_nonexistent_starting_block (line 347) | async def test_get_events_nonexistent_starting_block(
function test_get_block_number (line 363) | async def test_get_block_number(client, devnet_client):
function test_get_block_hash_and_number (line 377) | async def test_get_block_hash_and_number(client, devnet_client):
function test_get_chain_id (line 397) | async def test_get_chain_id(client):
function test_get_syncing_status_false (line 404) | async def test_get_syncing_status_false(client):
function test_get_syncing_status (line 411) | async def test_get_syncing_status(client):
function test_simulate_transactions_skip_validate (line 434) | async def test_simulate_transactions_skip_validate(account, deployed_bal...
function test_simulate_transactions_skip_fee_charge (line 460) | async def test_simulate_transactions_skip_fee_charge(
function test_simulate_transactions_invoke (line 479) | async def test_simulate_transactions_invoke(account, deployed_balance_co...
function test_simulate_transactions_two_txs (line 509) | async def test_simulate_transactions_two_txs(account, deployed_balance_c...
function test_simulate_transactions_deploy_account (line 551) | async def test_simulate_transactions_deploy_account(
function test_simulate_transactions_return_initial_reads (line 585) | async def test_simulate_transactions_return_initial_reads(
function test_trace_block_transactions_return_initial_reads (line 609) | async def test_trace_block_transactions_return_initial_reads(
function test_get_events_with_multiple_addresses (line 628) | async def test_get_events_with_multiple_addresses(
function test_get_storage_at_with_include_last_update_block (line 653) | async def test_get_storage_at_with_include_last_update_block(client):
FILE: starknet_py/tests/e2e/client/websocket_client_test.py
function test_subscribe_new_heads_with_block_hash (line 36) | async def test_subscribe_new_heads_with_block_hash(
function test_subscribe_new_heads_with_block_number (line 65) | async def test_subscribe_new_heads_with_block_number(
function test_subscribe_new_heads_with_both_block_params_passed (line 94) | async def test_subscribe_new_heads_with_both_block_params_passed(
function test_subscribe_new_heads_too_many_blocks_back (line 107) | async def test_subscribe_new_heads_too_many_blocks_back(
function test_unsubscribe_with_non_existing_id (line 129) | async def test_unsubscribe_with_non_existing_id(
function test_subscribe_events_with_finality_status (line 137) | async def test_subscribe_events_with_finality_status(
function test_subscribe_new_transactions_with_finality_status (line 179) | async def test_subscribe_new_transactions_with_finality_status(
function test_subscribe_new_transaction_receipts_with_finality_status (line 218) | async def test_subscribe_new_transaction_receipts_with_finality_status(
function test_subscribe_events_with_all_filters (line 257) | async def test_subscribe_events_with_all_filters(
function test_subscribe_failure (line 308) | async def test_subscribe_failure():
function test_listener_failure (line 337) | async def test_listener_failure():
FILE: starknet_py/tests/e2e/contract_interaction/declare_test.py
function test_throws_when_cairo1_without_compiled_contract_casm_and_class_hash (line 11) | async def test_throws_when_cairo1_without_compiled_contract_casm_and_cla...
function test_declare_v3 (line 36) | async def test_declare_v3(
function test_declare_v3_auto_estimate_tip (line 55) | async def test_declare_v3_auto_estimate_tip(
FILE: starknet_py/tests/e2e/contract_interaction/deploy_test.py
function test_declare_deploy_v3 (line 16) | async def test_declare_deploy_v3(
function test_declare_deploy_v3_auto_estimate_tip (line 47) | async def test_declare_deploy_v3_auto_estimate_tip(
function test_throws_on_wrong_abi (line 83) | async def test_throws_on_wrong_abi(account, minimal_contract_class_hash:...
function test_deploy_contract_v3 (line 112) | async def test_deploy_contract_v3(account, hello_starknet_class_hash: int):
FILE: starknet_py/tests/e2e/contract_interaction/interaction_test.py
function test_prepare_and_invoke_v3 (line 15) | async def test_prepare_and_invoke_v3(map_contract):
function test_invoke_v3 (line 27) | async def test_invoke_v3(map_contract):
function test_auto_fee_estimation_v3 (line 36) | async def test_auto_fee_estimation_v3(map_contract):
function test_throws_invoke_v3_without_resource_bounds (line 46) | async def test_throws_invoke_v3_without_resource_bounds(map_contract):
function test_throws_prepared_invoke_v3_without_resource_bounds (line 57) | async def test_throws_prepared_invoke_v3_without_resource_bounds(map_con...
function test_throws_when_invoke_v3_with_resource_bounds_and_auto_estimate (line 71) | async def test_throws_when_invoke_v3_with_resource_bounds_and_auto_estim...
function test_throws_when_invoke_v3_with_tip_and_auto_estimate_tip (line 86) | async def test_throws_when_invoke_v3_with_tip_and_auto_estimate_tip(map_...
function test_default_tip_is_zero (line 99) | async def test_default_tip_is_zero(map_contract):
function test_provided_tip_is_used (line 108) | async def test_provided_tip_is_used(map_contract):
function test_auto_estimate_tip_is_used (line 117) | async def test_auto_estimate_tip_is_used(
function test_latest_resource_bounds_takes_precedence (line 136) | async def test_latest_resource_bounds_takes_precedence(map_contract):
function test_latest_resource_bounds_take_precedence (line 172) | async def test_latest_resource_bounds_take_precedence(map_contract):
function test_prepare_without_resource_bounds (line 209) | async def test_prepare_without_resource_bounds(map_contract):
function test_invoke_v3_and_call (line 217) | async def test_invoke_v3_and_call(key, value, map_contract):
function test_call_uninitialized_contract (line 229) | async def test_call_uninitialized_contract(client):
function test_wait_for_tx (line 242) | async def test_wait_for_tx(client, map_contract):
function test_error_when_prepare_without_account (line 250) | async def test_error_when_prepare_without_account(client, map_contract):
function test_error_when_invoke_without_account (line 261) | async def test_error_when_invoke_without_account(client, map_contract):
FILE: starknet_py/tests/e2e/contract_interaction/v1_interaction_test.py
function test_general_v3_interaction (line 18) | async def test_general_v3_interaction(account, erc20_class_hash: int):
function test_serializing_struct (line 64) | async def test_serializing_struct(account, token_bridge_class_hash: int):
function test_serializing_option (line 80) | async def test_serializing_option(account, test_option_class_hash: int):
function test_serializing_enum (line 115) | async def test_serializing_enum(account, test_enum_class_hash: int):
function test_from_address_on_v1_contract (line 156) | async def test_from_address_on_v1_contract(account, erc20_class_hash: int):
function test_invoke_contract_with_bytearray (line 184) | async def test_invoke_contract_with_bytearray(string_contract):
FILE: starknet_py/tests/e2e/declare/declare_test.py
function test_declare_v3_tx (line 9) | async def test_declare_v3_tx(account, abi_types_compiled_contract_and_cl...
FILE: starknet_py/tests/e2e/deploy/deployer_test.py
function test_default_deploy_with_class_hash (line 14) | async def test_default_deploy_with_class_hash(account, map_class_hash):
function test_constructor_arguments_contract_deploy_without_abi (line 35) | async def test_constructor_arguments_contract_deploy_without_abi(
function test_constructor_arguments_contract_deploy (line 83) | async def test_constructor_arguments_contract_deploy(
function test_throws_when_calldata_provided_without_abi (line 136) | async def test_throws_when_calldata_provided_without_abi(
function test_address_computation (line 156) | async def test_address_computation(salt, pass_account_address, account, ...
function test_create_deployment_call_raw (line 198) | async def test_create_deployment_call_raw(
function test_create_deployment_call_raw_supports_seed_0 (line 233) | async def test_create_deployment_call_raw_supports_seed_0(
FILE: starknet_py/tests/e2e/deploy_account/deploy_account_test.py
function test_general_flow (line 10) | async def test_general_flow(client, deploy_account_details_factory):
function test_deploy_account_v3 (line 32) | async def test_deploy_account_v3(client, deploy_account_details_factory):
FILE: starknet_py/tests/e2e/devnet_client/account_impersonate_test.py
function test_impersonate_account (line 15) | async def test_impersonate_account(
function test_auto_impersonate (line 44) | async def test_auto_impersonate(
function test_impersonated_account_should_fail (line 69) | async def test_impersonated_account_should_fail(
FILE: starknet_py/tests/e2e/devnet_client/fixtures/accounts.py
function account_forked_devnet (line 11) | async def account_forked_devnet(
function account_to_impersonate (line 26) | async def account_to_impersonate(devnet_client_fork_mode: DevnetClient) ...
FILE: starknet_py/tests/e2e/devnet_client/fixtures/clients.py
function create_devnet_client (line 7) | def create_devnet_client(devnet) -> DevnetClient:
function create_devnet_client_fork_mode (line 12) | def create_devnet_client_fork_mode(devnet_forking_mode) -> DevnetClient:
FILE: starknet_py/tests/e2e/devnet_client/fixtures/contracts.py
function declare_string_contract (line 12) | async def declare_string_contract(account_forked_devnet) -> int:
function deploy_string_contract (line 21) | async def deploy_string_contract(
function declare_l1_l2_contract (line 32) | async def declare_l1_l2_contract(account) -> int:
function deploy_l1_l2_contract (line 41) | async def deploy_l1_l2_contract(account, l1_l2_contract_class_hash) -> C...
FILE: starknet_py/tests/e2e/devnet_client/general_test.py
function test_mint (line 10) | async def test_mint(devnet_client, account):
function test_create_blocks (line 24) | async def test_create_blocks(devnet_client):
function test_abort_blocks (line 30) | async def test_abort_blocks(devnet_client):
function test_predeployed_accounts (line 40) | async def test_predeployed_accounts(devnet_client):
FILE: starknet_py/tests/e2e/devnet_client/time_test.py
function test_set_and_increase_time (line 5) | async def test_set_and_increase_time(devnet_client):
function test_set_time_with_generate_block (line 23) | async def test_set_time_with_generate_block(devnet_client):
function test_set_time_without_generate_block (line 34) | async def test_set_time_without_generate_block(devnet_client):
FILE: starknet_py/tests/e2e/docs/account_creation/test_deploy_prefunded_account.py
function test_deploy_prefunded_account (line 9) | async def test_deploy_prefunded_account(
FILE: starknet_py/tests/e2e/docs/code_examples/test_account.py
function test_init (line 16) | def test_init():
function test_execute_v3 (line 28) | async def test_execute_v3(account, contract_address):
function test_get_balance (line 59) | async def test_get_balance(account):
function test_sign_message (line 71) | def test_sign_message(account):
function test_verify_message (line 93) | def test_verify_message(account):
FILE: starknet_py/tests/e2e/docs/code_examples/test_contract.py
function test_init (line 19) | def test_init():
function test_from_address (line 43) | async def test_from_address(account, contract_address):
function test_declare_v3 (line 62) | async def test_declare_v3(account):
function test_deploy_contract_v3 (line 87) | async def test_deploy_contract_v3(account, hello_starknet_class_hash: int):
function test_deploy_contract_v3_without_abi (line 124) | async def test_deploy_contract_v3_without_abi(account, hello_starknet_cl...
FILE: starknet_py/tests/e2e/docs/code_examples/test_contract_function.py
function test_prepare_invoke_v3 (line 8) | def test_prepare_invoke_v3(map_contract: Contract):
function test_call (line 17) | async def test_call(map_contract: Contract):
function test_invoke_v3 (line 25) | def test_invoke_v3(map_contract: Contract):
function test_get_selector (line 40) | def test_get_selector():
FILE: starknet_py/tests/e2e/docs/code_examples/test_deployer.py
function test_init (line 5) | def test_init():
function test_create_contract_deployment_raw (line 15) | def test_create_contract_deployment_raw():
FILE: starknet_py/tests/e2e/docs/code_examples/test_devnet_client.py
function test_init (line 5) | def test_init():
FILE: starknet_py/tests/e2e/docs/code_examples/test_full_node_client.py
function test_init (line 13) | def test_init():
function test_init_with_custom_client_session (line 20) | async def test_init_with_custom_client_session():
function test_get_block (line 32) | async def test_get_block(client, block_with_declare_hash):
function test_get_state_update (line 46) | async def test_get_state_update(
function test_get_storage_at (line 65) | async def test_get_storage_at(client, map_contract):
function test_get_transaction (line 77) | async def test_get_transaction(client, declare_transaction_hash):
function test_get_transaction_receipt (line 88) | async def test_get_transaction_receipt(client, declare_transaction_hash):
function test_estimate_fee (line 96) | async def test_estimate_fee(client, deploy_account_transaction):
function test_call_contract (line 107) | async def test_call_contract(client, contract_address):
function test_get_class_hash_at (line 121) | async def test_get_class_hash_at(client, contract_address):
function test_get_class_by_hash (line 134) | async def test_get_class_by_hash(client, class_hash):
function test_get_transaction_by_block_id (line 146) | async def test_get_transaction_by_block_id(client):
function test_get_block_transaction_count (line 155) | async def test_get_block_transaction_count(client):
function test_get_class_at (line 164) | async def test_get_class_at(client, contract_address):
function test_get_contract_nonce (line 177) | async def test_get_contract_nonce(client, contract_address):
function test_get_events (line 190) | async def test_get_events(client, contract_address):
function test_trace_block_transactions (line 212) | async def test_trace_block_transactions(client):
function test_trace_transaction (line 226) | async def test_trace_transaction(client):
function test_simulate_transactions (line 242) | async def test_simulate_transactions(
FILE: starknet_py/tests/e2e/docs/code_examples/test_prepared_function_call.py
function test_call_raw (line 8) | async def test_call_raw(map_contract: Contract):
function test_call (line 18) | async def test_call(map_contract: Contract):
FILE: starknet_py/tests/e2e/docs/code_examples/test_prepared_function_invoke_v3.py
function test_invoke (line 9) | async def test_invoke(map_contract: Contract):
FILE: starknet_py/tests/e2e/docs/code_examples/test_websocket_client.py
function test_connect_and_disconnect (line 24) | async def test_connect_and_disconnect(devnet_ws: str):
function test_subscribe_new_heads (line 52) | async def test_subscribe_new_heads(
function test_subscribe_events (line 89) | async def test_subscribe_events(
function test_subscribe_transaction_status (line 142) | async def test_subscribe_transaction_status(
function test_subscribe_new_transaction_receipts (line 206) | async def test_subscribe_new_transaction_receipts(
function test_on_chain_reorg (line 269) | async def test_on_chain_reorg(
FILE: starknet_py/tests/e2e/docs/devnet_utils/test_l1_integration.py
function test_postman_load (line 9) | async def test_postman_load(devnet_client, l1_l2_contract, account):
FILE: starknet_py/tests/e2e/docs/guide/test_account_sign_outside_transaction.py
function test_account_outside_execution_any_caller (line 10) | async def test_account_outside_execution_any_caller(
FILE: starknet_py/tests/e2e/docs/guide/test_account_sign_without_execute.py
function test_account_sign_without_execute (line 9) | async def test_account_sign_without_execute(
FILE: starknet_py/tests/e2e/docs/guide/test_cairo1_contract.py
function test_cairo1_contract (line 12) | async def test_cairo1_contract(
FILE: starknet_py/tests/e2e/docs/guide/test_contract_account_compatibility.py
function test_create_invoke_from_contract (line 7) | async def test_create_invoke_from_contract(map_contract, account):
FILE: starknet_py/tests/e2e/docs/guide/test_contract_client_compatibility.py
function test_create_call_from_contract (line 5) | async def test_create_call_from_contract(map_contract, account):
FILE: starknet_py/tests/e2e/docs/guide/test_custom_nonce.py
function test_custom_nonce (line 10) | async def test_custom_nonce(account):
FILE: starknet_py/tests/e2e/docs/guide/test_custom_signer.py
function test_custom_signer (line 7) | async def test_custom_signer():
FILE: starknet_py/tests/e2e/docs/guide/test_declaring_contracts.py
function test_declaring_contracts (line 13) | async def test_declaring_contracts(
FILE: starknet_py/tests/e2e/docs/guide/test_deploying_in_multicall.py
function test_deploying_in_multicall (line 5) | async def test_deploying_in_multicall(account, map_class_hash, map_abi):
FILE: starknet_py/tests/e2e/docs/guide/test_deploying_with_udc.py
function test_deploying_with_udc (line 11) | async def test_deploying_with_udc(
FILE: starknet_py/tests/e2e/docs/guide/test_executing_transactions.py
function test_executing_transactions (line 5) | async def test_executing_transactions(account, map_contract):
FILE: starknet_py/tests/e2e/docs/guide/test_full_node_client.py
function test_full_node_client (line 7) | async def test_full_node_client(client, map_contract):
FILE: starknet_py/tests/e2e/docs/guide/test_handling_client_errors.py
function test_handling_client_errors (line 5) | async def test_handling_client_errors(account):
FILE: starknet_py/tests/e2e/docs/guide/test_key_pair.py
function test_generate_key_pair (line 7) | def test_generate_key_pair():
function test_key_pair_from_private_key (line 18) | def test_key_pair_from_private_key():
function test_key_pair_from_keystore (line 30) | def test_key_pair_from_keystore():
FILE: starknet_py/tests/e2e/docs/guide/test_multicall.py
function test_multicall (line 7) | async def test_multicall(account, deployed_balance_contract):
FILE: starknet_py/tests/e2e/docs/guide/test_resolving_proxies.py
function test_resolving_proxies (line 15) | async def test_resolving_proxies(
FILE: starknet_py/tests/e2e/docs/guide/test_serializing.py
function test_short_strings (line 7) | def test_short_strings():
function test_abi_parsing (line 21) | def test_abi_parsing():
FILE: starknet_py/tests/e2e/docs/guide/test_sign_for_fee_estimate.py
function test_signing_fee_estimate (line 8) | async def test_signing_fee_estimate(account, map_contract):
FILE: starknet_py/tests/e2e/docs/guide/test_sign_offchain_message.py
function test_sign_offchain_message (line 5) | async def test_sign_offchain_message(account):
FILE: starknet_py/tests/e2e/docs/guide/test_simple_declare_and_deploy_cairo1.py
function test_simple_declare_and_deploy (line 13) | async def test_simple_declare_and_deploy(account):
FILE: starknet_py/tests/e2e/docs/guide/test_simple_deploy.py
function test_simple_deploy (line 7) | async def test_simple_deploy(account, hello_starknet_class_hash, hello_s...
FILE: starknet_py/tests/e2e/docs/guide/test_simple_deploy_cairo1.py
function test_simple_deploy_cairo1 (line 14) | async def test_simple_deploy_cairo1(account, erc20_class_hash):
FILE: starknet_py/tests/e2e/docs/guide/test_using_existing_contracts.py
function test_using_existing_contracts (line 35) | async def test_using_existing_contracts(account, erc20_contract):
function test_raw_call (line 141) | async def test_raw_call(account):
FILE: starknet_py/tests/e2e/docs/migration_guide/test_account_comparison.py
function test_account_comparison (line 9) | async def test_account_comparison(gateway_account, map_contract):
FILE: starknet_py/tests/e2e/docs/quickstart/test_creating_account.py
function test_creating_account (line 7) | async def test_creating_account():
FILE: starknet_py/tests/e2e/docs/quickstart/test_synchronous_api.py
function test_synchronous_api (line 4) | def test_synchronous_api(account, map_contract):
FILE: starknet_py/tests/e2e/docs/quickstart/test_synchronous_full_node_client.py
function test_synchronous_full_node_client (line 4) | def test_synchronous_full_node_client(
FILE: starknet_py/tests/e2e/docs/quickstart/test_using_account.py
function test_using_account (line 16) | async def test_using_account(account, map_compiled_contract_and_class_ha...
FILE: starknet_py/tests/e2e/docs/quickstart/test_using_contract.py
function test_using_contract (line 10) | async def test_using_contract(account, map_contract):
FILE: starknet_py/tests/e2e/docs/quickstart/test_using_full_node_client.py
function test_using_full_node_client (line 11) | async def test_using_full_node_client(client, map_contract):
FILE: starknet_py/tests/e2e/fixtures/accounts.py
class AccountPrerequisites (line 35) | class AccountPrerequisites:
function devnet_account_details (line 42) | async def devnet_account_details(
function full_node_account (line 86) | def full_node_account(client: FullNodeClient) -> BaseAccount:
class AccountToBeDeployedDetailsFactory (line 102) | class AccountToBeDeployedDetailsFactory:
method get (line 107) | async def get(
function deploy_account_details_factory (line 135) | async def deploy_account_details_factory(
function pre_deployed_account_with_validate_deploy (line 155) | def pre_deployed_account_with_validate_deploy(client) -> BaseAccount:
function argent_account_v040_data (line 172) | async def argent_account_v040_data(
function argent_account_v040 (line 197) | async def argent_account_v040(
function eth_account (line 234) | async def eth_account(
FILE: starknet_py/tests/e2e/fixtures/clients.py
function create_full_node_client (line 11) | def create_full_node_client(devnet: str) -> FullNodeClient:
function create_full_node_client_fork_mode (line 16) | def create_full_node_client_fork_mode(devnet_forking_mode: str) -> FullN...
function websocket_client (line 21) | async def websocket_client(devnet_ws: str) -> AsyncGenerator[WebsocketCl...
FILE: starknet_py/tests/e2e/fixtures/constants.py
function _get_env_or_throw (line 11) | def _get_env_or_throw(env_name: str) -> str:
function _get_env_lambda (line 22) | def _get_env_lambda(env_name):
FILE: starknet_py/tests/e2e/fixtures/contracts.py
function eth_fee_contract (line 11) | def eth_fee_contract(account: BaseAccount, cairo_0_fee_contract_abi) -> ...
function strk_fee_contract (line 25) | def strk_fee_contract(account: BaseAccount, cairo_0_fee_contract_abi) ->...
function cairo_0_fee_contract_abi (line 39) | def cairo_0_fee_contract_abi():
FILE: starknet_py/tests/e2e/fixtures/contracts_v1.py
function declare_contract (line 18) | async def declare_contract(
function erc20_class_hash (line 37) | async def erc20_class_hash(account: BaseAccount) -> int:
function constructor_with_arguments_class_hash (line 46) | async def constructor_with_arguments_class_hash(account: BaseAccount) ->...
function constructor_with_arguments_abi (line 55) | def constructor_with_arguments_abi() -> List:
function declare_v3_hello_starknet (line 67) | async def declare_v3_hello_starknet(account: BaseAccount) -> DeclareV3:
function hello_starknet_class_hash_tx_hash (line 78) | async def hello_starknet_class_hash_tx_hash(
function hello_starknet_abi (line 88) | async def hello_starknet_abi() -> List:
function hello_starknet_class_hash (line 98) | def hello_starknet_class_hash(hello_starknet_class_hash_tx_hash) -> int:
function hello_starknet_tx_hash (line 104) | def hello_starknet_tx_hash(hello_starknet_class_hash_tx_hash) -> int:
function minimal_contract_class_hash (line 110) | async def minimal_contract_class_hash(account: BaseAccount) -> int:
function test_enum_class_hash (line 121) | async def test_enum_class_hash(account: BaseAccount) -> int:
function test_option_class_hash (line 132) | async def test_option_class_hash(account: BaseAccount) -> int:
function token_bridge_class_hash (line 143) | async def token_bridge_class_hash(account: BaseAccount) -> int:
function erc20_contract (line 154) | async def erc20_contract(account, erc20_class_hash):
function hello_starknet_contract (line 171) | async def hello_starknet_contract(account: BaseAccount, hello_starknet_c...
function declare_string_contract (line 180) | async def declare_string_contract(account: BaseAccount) -> int:
function deploy_string_contract (line 191) | async def deploy_string_contract(
function map_class_hash (line 202) | async def map_class_hash(account: BaseAccount) -> int:
function map_contract (line 213) | async def map_contract(account: BaseAccount, map_class_hash) -> Contract:
function map_abi (line 222) | async def map_abi() -> List:
function map_compiled_contract_and_class_hash (line 232) | def map_compiled_contract_and_class_hash() -> Tuple[str, int]:
function map_compiled_contract_and_class_hash_copy_1 (line 242) | def map_compiled_contract_and_class_hash_copy_1() -> Tuple[str, int]:
function map_compiled_contract_and_class_hash_copy_2 (line 252) | def map_compiled_contract_and_class_hash_copy_2() -> Tuple[str, int]:
function map_compiled_contract_casm (line 262) | def map_compiled_contract_casm() -> str:
function simple_storage_with_event_class_hash (line 269) | async def simple_storage_with_event_class_hash(account: BaseAccount) -> ...
function declare_eth_account (line 278) | async def declare_eth_account(account: BaseAccount) -> int:
function simple_storage_with_event_contract (line 289) | async def simple_storage_with_event_contract(
function sierra_minimal_compiled_contract_and_class_hash (line 301) | def sierra_minimal_compiled_contract_and_class_hash() -> Tuple[str, int]:
function abi_types_compiled_contract_and_class_hash (line 314) | def abi_types_compiled_contract_and_class_hash() -> Tuple[str, int]:
function declare_account (line 326) | async def declare_account(
function account_declare_class_hash (line 344) | async def account_declare_class_hash(
function account_with_validate_deploy_class_hash (line 366) | async def account_with_validate_deploy_class_hash(
function deploy_v3_contract (line 377) | async def deploy_v3_contract(
FILE: starknet_py/tests/e2e/fixtures/devnet.py
function get_available_port (line 13) | def get_available_port() -> int:
function start_devnet (line 20) | def start_devnet(fork_mode: bool = False):
function get_start_devnet_command (line 30) | def get_start_devnet_command(devnet_port: int, fork_mode: bool = False) ...
function devnet (line 60) | def devnet() -> Generator[str, None, None]:
function devnet_forking_mode (line 70) | def devnet_forking_mode() -> Generator[str, None, None]:
FILE: starknet_py/tests/e2e/fixtures/devnet_ws.py
function devnet_ws (line 7) | def devnet_ws(devnet: str) -> Generator[str, None, None]:
FILE: starknet_py/tests/e2e/fixtures/environment_check.py
function check_if_udc_is_deployed (line 9) | async def check_if_udc_is_deployed(client):
function check_if_udc_has_expected_abi (line 19) | async def check_if_udc_has_expected_abi(gateway_client):
FILE: starknet_py/tests/e2e/fixtures/event_loop.py
function event_loop (line 8) | def event_loop():
FILE: starknet_py/tests/e2e/fixtures/misc.py
function pytest_addoption (line 27) | def pytest_addoption(parser):
function typed_data (line 45) | def typed_data(request) -> TypedDataDict:
function loaded_typed_data (line 59) | def loaded_typed_data(request) -> TypedData:
function get_tx_receipt_full_node_client (line 70) | def get_tx_receipt_full_node_client():
function get_tx_status_full_node_client (line 75) | def get_tx_status_full_node_client():
function get_block_with_txs_full_node_client (line 80) | def get_block_with_txs_full_node_client():
function transaction_mock_with_tip (line 84) | def transaction_mock_with_tip(tip: int) -> InvokeTransactionV3:
function starknet_block_mock (line 105) | def starknet_block_mock() -> StarknetBlock:
function block_with_tips_mock (line 131) | def block_with_tips_mock():
class UnknownArtifacts (line 141) | class UnknownArtifacts(BaseException):
function load_contract (line 145) | def load_contract(contract_name: str, package: Optional[str] = None):
function read_contract (line 174) | def read_contract(file_name: str, *, directory: Path) -> str:
FILE: starknet_py/tests/e2e/tests_on_networks/account_test.py
function test_execute_v3 (line 24) | async def test_execute_v3(account_sepolia_testnet):
function test_deploy_account_v3 (line 47) | async def test_deploy_account_v3(
function test_declare_v3 (line 108) | async def test_declare_v3(account_sepolia_testnet):
function test_deploy_v3 (line 130) | async def test_deploy_v3(account_sepolia_testnet, client_sepolia_testnet):
FILE: starknet_py/tests/e2e/tests_on_networks/client_integration_test.py
function test_get_transaction_with_proof_facts (line 24) | async def test_get_transaction_with_proof_facts(client_integration: Full...
function test_get_block_with_txs_response_flags (line 36) | async def test_get_block_with_txs_response_flags(client_integration: Ful...
function test_get_block_with_receipts_response_flags (line 54) | async def test_get_block_with_receipts_response_flags(
FILE: starknet_py/tests/e2e/tests_on_networks/client_test.py
function test_get_transaction_receipt (line 63) | async def test_get_transaction_receipt(client_sepolia_testnet, transacti...
function test_wait_for_tx_reverted (line 77) | async def test_wait_for_tx_reverted(account_sepolia_testnet):
function test_wait_for_tx_accepted (line 95) | async def test_wait_for_tx_accepted(account_sepolia_testnet):
function test_sign_invoke_v3_auto_estimate (line 112) | async def test_sign_invoke_v3_auto_estimate(account_sepolia_testnet):
function test_transaction_not_received_max_fee_too_small (line 129) | async def test_transaction_not_received_max_fee_too_small(account_sepoli...
function test_transaction_not_received_max_fee_too_big (line 155) | async def test_transaction_not_received_max_fee_too_big(account_sepolia_...
function test_transaction_not_received_invalid_nonce (line 180) | async def test_transaction_not_received_invalid_nonce(account_sepolia_te...
function test_transaction_not_received_invalid_signature (line 196) | async def test_transaction_not_received_invalid_signature(account_sepoli...
function test_estimate_message_fee (line 219) | async def test_estimate_message_fee(client_sepolia_testnet):
function test_estimate_message_fee_invalid_eth_address_assertion_error (line 246) | async def test_estimate_message_fee_invalid_eth_address_assertion_error(
function test_estimate_message_fee_throws (line 286) | async def test_estimate_message_fee_throws(
function test_get_tx_receipt_reverted (line 302) | async def test_get_tx_receipt_reverted(client_sepolia_testnet):
function test_get_transaction_by_block_id_and_index (line 323) | async def test_get_transaction_by_block_id_and_index(
function test_get_l1_message_hash (line 335) | async def test_get_l1_message_hash(client_sepolia_testnet):
function test_get_l1_message_hash_raises_on_incorrect_transaction_type (line 345) | async def test_get_l1_message_hash_raises_on_incorrect_transaction_type(
function test_spec_version (line 356) | async def test_spec_version(client_sepolia_testnet):
function test_get_transaction_status (line 364) | async def test_get_transaction_status(client_sepolia_testnet):
function test_get_transaction_status_with_failure_reason (line 374) | async def test_get_transaction_status_with_failure_reason(client_sepolia...
function test_get_block_new_header_fields (line 399) | async def test_get_block_new_header_fields(client_sepolia_testnet):
function test_get_block_with_tx_hashes_new_header_fields (line 428) | async def test_get_block_with_tx_hashes_new_header_fields(client_sepolia...
function test_get_transaction_v3 (line 473) | async def test_get_transaction_v3(client_sepolia_testnet, tx_hash, tx_ty...
function test_get_chain_id_sepolia_testnet (line 485) | async def test_get_chain_id_sepolia_testnet(client_sepolia_testnet):
function test_get_events_sepolia_testnet (line 492) | async def test_get_events_sepolia_testnet(client_sepolia_testnet):
function test_get_block_with_receipts (line 511) | async def test_get_block_with_receipts(client_sepolia_testnet):
function test_get_pre_confirmed_block_with_receipts (line 527) | async def test_get_pre_confirmed_block_with_receipts(client_sepolia_test...
function test_get_storage_proof (line 541) | async def test_get_storage_proof(client_sepolia_testnet):
function test_get_compiled_casm (line 563) | async def test_get_compiled_casm(client_sepolia_testnet):
function test_warning_on_incompatible_node_spec_version (line 597) | async def test_warning_on_incompatible_node_spec_version(client_sepolia_...
function test_l1_accepted_block (line 610) | async def test_l1_accepted_block(account_sepolia_testnet):
FILE: starknet_py/tests/e2e/tests_on_networks/fixtures.py
function client_integration (line 16) | def client_integration() -> FullNodeClient:
function client_sepolia_testnet (line 21) | def client_sepolia_testnet() -> FullNodeClient:
function account_sepolia_testnet (line 27) | def account_sepolia_testnet(
FILE: starknet_py/tests/e2e/tests_on_networks/trace_api_test.py
function test_trace_transaction_invoke_v3 (line 18) | async def test_trace_transaction_invoke_v3(client_sepolia_testnet):
function test_trace_transaction_declare_v3 (line 31) | async def test_trace_transaction_declare_v3(client_sepolia_testnet):
function test_trace_transaction_deploy_account_v3 (line 43) | async def test_trace_transaction_deploy_account_v3(client_sepolia_testnet):
function test_trace_transaction_l1_handler (line 60) | async def test_trace_transaction_l1_handler(client_sepolia_testnet):
function test_trace_transaction_reverted (line 75) | async def test_trace_transaction_reverted(client_sepolia_testnet):
function test_get_block_traces (line 84) | async def test_get_block_traces(client_sepolia_testnet):
FILE: starknet_py/tests/e2e/utils.py
function _new_address (line 17) | def _new_address(
function prepay_account (line 33) | async def prepay_account(
function get_deploy_account_transaction (line 57) | async def get_deploy_account_transaction(
function _get_random_private_key_unsafe (line 78) | def _get_random_private_key_unsafe() -> int:
FILE: starknet_py/tests/e2e/utils_functions_test.py
function test_is_valid_eth_address (line 8) | def test_is_valid_eth_address():
function test_default_token_address_for_network (line 14) | def test_default_token_address_for_network():
FILE: starknet_py/tests/unit/abi/v0/parser_test.py
function test_parsing_types_abi (line 12) | def test_parsing_types_abi():
function test_parsing_types_abi_missing_offset (line 41) | def test_parsing_types_abi_missing_offset():
function test_parsing_types_abi_partial_missing_offset (line 57) | def test_parsing_types_abi_partial_missing_offset():
function test_self_cycle (line 73) | def test_self_cycle():
function test_bigger_cycle (line 89) | def test_bigger_cycle():
function test_duplicated_structure (line 116) | def test_duplicated_structure():
function test_duplicated_function (line 126) | def test_duplicated_function():
function test_duplicated_event (line 141) | def test_duplicated_event():
function test_duplicated_type_members (line 155) | def test_duplicated_type_members():
function test_missing_type_used (line 185) | def test_missing_type_used(missing_name, input_dict):
function test_deserialize_balance_struct_event_abi (line 192) | def test_deserialize_balance_struct_event_abi():
function test_duplicated_constructor (line 205) | def test_duplicated_constructor():
function test_duplicated_l1_handler (line 218) | def test_duplicated_l1_handler():
FILE: starknet_py/tests/unit/abi/v0/schemas_test.py
function test_deserialize_abi (line 10) | def test_deserialize_abi():
FILE: starknet_py/tests/unit/abi/v1/parser_test.py
function test_parsing_types_abi (line 8) | def test_parsing_types_abi():
function test_parsing_types_abi2 (line 36) | def test_parsing_types_abi2():
function test_self_cycle (line 63) | def test_self_cycle():
function test_bigger_cycle (line 78) | def test_bigger_cycle():
function test_duplicated_structure (line 102) | def test_duplicated_structure():
function test_duplicated_function (line 112) | def test_duplicated_function():
function test_duplicated_event (line 127) | def test_duplicated_event():
function test_duplicated_type_members (line 141) | def test_duplicated_type_members():
function test_missing_type_used (line 170) | def test_missing_type_used(missing_name, input_dict):
FILE: starknet_py/tests/unit/abi/v1/parser_transformer_test.py
function test_default_parser_transformer (line 7) | def test_default_parser_transformer():
FILE: starknet_py/tests/unit/abi/v1/schemas_test.py
function test_deserialize_abi (line 21) | def test_deserialize_abi(contract_name):
FILE: starknet_py/tests/unit/abi/v2/parser_test.py
function test_abi_parse (line 28) | def test_abi_parse(contract_name):
function test_bounded_int_parse_pre_2_8_0 (line 41) | def test_bounded_int_parse_pre_2_8_0():
function test_bounded_int_parse_post_2_8_0 (line 78) | def test_bounded_int_parse_post_2_8_0():
FILE: starknet_py/tests/unit/abi/v2/parser_transformer_test.py
function test_default_parser_transformer (line 7) | def test_default_parser_transformer():
FILE: starknet_py/tests/unit/abi/v2/schemas_test.py
function test_deserialize_abi (line 26) | def test_deserialize_abi(contract_name):
FILE: starknet_py/tests/unit/cairo/felt_test.py
function test_invalid_cairo_vm_values (line 12) | def test_invalid_cairo_vm_values(value):
function cairo_vm_range_check_good_numbers (line 18) | def cairo_vm_range_check_good_numbers(value):
function test_encode_decode_shortstring (line 22) | def test_encode_decode_shortstring():
FILE: starknet_py/tests/unit/cairo/type_parser_test.py
function test_parse_without_defined_types (line 47) | def test_parse_without_defined_types(type_string, expected):
function test_parse_with_defined_types (line 83) | def test_parse_with_defined_types(type_string, expected):
function test_code_offset (line 92) | def test_code_offset():
function test_missing_type (line 107) | def test_missing_type():
function test_names_not_matching (line 116) | def test_names_not_matching():
FILE: starknet_py/tests/unit/cairo/v1/type_parser_test.py
function test_parse_without_defined_types (line 49) | def test_parse_without_defined_types(type_string, expected):
function test_parse_with_defined_types (line 88) | def test_parse_with_defined_types(type_string, expected):
function test_missing_type (line 97) | def test_missing_type():
function test_names_not_matching (line 106) | def test_names_not_matching():
FILE: starknet_py/tests/unit/cairo/v2/type_parser_test.py
function test_parse_without_defined_types (line 49) | def test_parse_without_defined_types(type_string, expected):
function test_parse_with_defined_types (line 88) | def test_parse_with_defined_types(type_string, expected):
function test_missing_type (line 97) | def test_missing_type():
function test_names_not_matching (line 106) | def test_names_not_matching():
FILE: starknet_py/tests/unit/common/test_common.py
function test_create_new_compiled_contract (line 5) | def test_create_new_compiled_contract(sierra_minimal_compiled_contract_a...
FILE: starknet_py/tests/unit/contract/contract_test.py
function test_declare_result_post_init (line 8) | def test_declare_result_post_init(param, account):
function test_deploy_result_post_init (line 20) | def test_deploy_result_post_init(client):
function test_contract_raises_on_incorrect_provider_type (line 28) | def test_contract_raises_on_incorrect_provider_type():
function test_contract_create_with_base_account (line 33) | def test_contract_create_with_base_account(account):
function test_contract_create_with_client (line 40) | def test_contract_create_with_client(client):
function test_throws_on_wrong_abi (line 46) | def test_throws_on_wrong_abi(account):
FILE: starknet_py/tests/unit/hash/blake2s_test.py
function test_encode_felt252_data_and_calc_blake_hash (line 48) | def test_encode_felt252_data_and_calc_blake_hash(input_felts, expected_r...
FILE: starknet_py/tests/unit/hash/casm_class_hash_test.py
function test_compute_casm_class_hash_with_poseidon (line 25) | def test_compute_casm_class_hash_with_poseidon(contract, expected_casm_c...
function test_precompiled_compute_casm_class_hash_with_poseidon (line 44) | def test_precompiled_compute_casm_class_hash_with_poseidon(casm_contract...
function test_get_casm_hash_method_for_starknet_version (line 65) | def test_get_casm_hash_method_for_starknet_version(starknet_version, exp...
function test_compute_casm_class_hash_with_blake2s (line 83) | def test_compute_casm_class_hash_with_blake2s(contract, expected_casm_cl...
function test_precompiled_compute_casm_class_hash_with_blake2s (line 100) | def test_precompiled_compute_casm_class_hash_with_blake2s(casm_contract_...
FILE: starknet_py/tests/unit/hash/selector_test.py
function test_get_selector_from_name (line 25) | def test_get_selector_from_name(value, selector):
FILE: starknet_py/tests/unit/hash/sierra_class_hash_test.py
function test_compute_sierra_class_hash (line 21) | def test_compute_sierra_class_hash(contract_name, expected_class_hash):
FILE: starknet_py/tests/unit/hash/storage_test.py
function test_get_storage_var_address (line 20) | def test_get_storage_var_address(value, args, address):
FILE: starknet_py/tests/unit/hash/transaction_test.py
function test_compute_transaction_hash (line 44) | def test_compute_transaction_hash(data, expected_hash):
function test_compute_deploy_account_transaction_hash (line 66) | def test_compute_deploy_account_transaction_hash(data, expected_hash):
function test_compute_declare_v2_transaction_hash (line 87) | def test_compute_declare_v2_transaction_hash(data, expected_hash):
function test_compute_invoke_transaction_hash (line 107) | def test_compute_invoke_transaction_hash(data, expected_hash):
function test_compute_declare_v3_transaction_hash (line 135) | def test_compute_declare_v3_transaction_hash(common_data, declare_data, ...
function test_compute_invoke_v3_transaction_hash (line 225) | def test_compute_invoke_v3_transaction_hash(common_data, invoke_data, ex...
function test_compute_deploy_account_v3_transaction_hash (line 265) | def test_compute_deploy_account_v3_transaction_hash(
FILE: starknet_py/tests/unit/hash/utils_test.py
function test_compute_hash_on_elements (line 21) | def test_compute_hash_on_elements(data, calculated_hash):
function test_pedersen_hash (line 40) | def test_pedersen_hash(first, second, hash_):
function test_encode_uint (line 52) | def test_encode_uint(value, expected_encoded):
function test_encode_uint_list (line 63) | def test_encode_uint_list(value, expected_encoded):
function test_keccak256_strings (line 75) | def test_keccak256_strings(string, expected_hash):
function test_keccak256_ints (line 86) | def test_keccak256_ints(value, expected_hash):
FILE: starknet_py/tests/unit/net/account/account_test.py
function test_get_balance_default_token_address (line 15) | async def test_get_balance_default_token_address():
function test_account_get_balance_strk (line 40) | async def test_account_get_balance_strk(account, hello_starknet_contract):
function test_create_account (line 58) | def test_create_account():
function test_create_account_parses_chain (line 80) | def test_create_account_parses_chain(chain):
function test_create_account_from_signer (line 95) | def test_create_account_from_signer(client):
function test_create_account_raises_on_no_keypair_and_signer (line 107) | def test_create_account_raises_on_no_keypair_and_signer():
function test_create_account_raises_on_both_keypair_and_signer (line 119) | def test_create_account_raises_on_both_keypair_and_signer():
FILE: starknet_py/tests/unit/net/client_test.py
function test_wait_for_tx_negative_check_interval (line 22) | async def test_wait_for_tx_negative_check_interval(client):
function test_cannot_instantiate_abstract_transaction_class (line 29) | def test_cannot_instantiate_abstract_transaction_class():
function test_cannot_instantiate_abstract_transaction_v3_class (line 36) | def test_cannot_instantiate_abstract_transaction_v3_class():
function test_handle_rpc_error_server_error (line 52) | def test_handle_rpc_error_server_error():
function test_get_rpc_storage_key (line 73) | def test_get_rpc_storage_key(key, expected):
function test_get_rpc_storage_key_raises_on_non_representable_key (line 81) | def test_get_rpc_storage_key_raises_on_non_representable_key(key):
function test_broadcasted_txn_declare_v3 (line 87) | async def test_broadcasted_txn_declare_v3(
function test_broadcasted_txn_invoke_v3 (line 104) | async def test_broadcasted_txn_invoke_v3(account, hello_starknet_contract):
function test_broadcasted_txn_deploy_account_v3 (line 125) | async def test_broadcasted_txn_deploy_account_v3(account):
FILE: starknet_py/tests/unit/net/models/address_test.py
function test_parse_address (line 10) | def test_parse_address(input_addr, output):
function test_parse_invalid_address (line 14) | def test_parse_invalid_address():
FILE: starknet_py/tests/unit/net/models/chains_test.py
function test_no_chain_for_custom_network (line 6) | def test_no_chain_for_custom_network():
FILE: starknet_py/tests/unit/net/schemas/common_test.py
class SchemaWithUint64 (line 18) | class SchemaWithUint64(Schema):
class SchemaWithUint128 (line 22) | class SchemaWithUint128(Schema):
class SchemaWithFelt (line 26) | class SchemaWithFelt(Schema):
class SchemaWithDAModeField (line 30) | class SchemaWithDAModeField(Schema):
function test_serialize_felt (line 34) | def test_serialize_felt():
function test_serialize_felt_throws_on_invalid_data (line 48) | def test_serialize_felt_throws_on_invalid_data(data):
function test_deserialize_felt (line 53) | def test_deserialize_felt():
function test_deserialize_felt_throws_on_invalid_data (line 61) | def test_deserialize_felt_throws_on_invalid_data():
function test_serialize_uint64 (line 80) | def test_serialize_uint64(data, expected_serialized):
function test_serialize_uint64_throws_on_invalid_data (line 89) | def test_serialize_uint64_throws_on_invalid_data(data):
function test_deserialize_uint64 (line 101) | def test_deserialize_uint64(data):
function test_deserialize_uint64_throws_on_invalid_data (line 117) | def test_deserialize_uint64_throws_on_invalid_data(data):
function test_serialize_uint128 (line 125) | def test_serialize_uint128():
function test_serialize_uint128_throws_on_invalid_data (line 131) | def test_serialize_uint128_throws_on_invalid_data():
function test_deserialize_uint128 (line 144) | def test_deserialize_uint128(data):
function test_deserialize_uint128_throws_on_invalid_data (line 160) | def test_deserialize_uint128_throws_on_invalid_data(data):
function test_serialize_hex (line 168) | def test_serialize_hex():
function test_deserialize_hex (line 179) | def test_deserialize_hex():
function test_serialize_status_field (line 190) | def test_serialize_status_field():
function test_deserialize_status_field (line 200) | def test_deserialize_status_field():
function test_deserialize_status_field_throws_on_invalid_data (line 211) | def test_deserialize_status_field_throws_on_invalid_data():
function test_serialize_block_status_field (line 223) | def test_serialize_block_status_field():
function test_deserialize_block_status_field (line 233) | def test_deserialize_block_status_field():
function test_serialize_block_status_field_throws_on_invalid_data (line 244) | def test_serialize_block_status_field_throws_on_invalid_data():
function test_serialize_damode_field (line 258) | def test_serialize_damode_field(data):
function test_deserialize_damode_field (line 270) | def test_deserialize_damode_field(data, expected_deserialized):
function get_uint_error_message (line 276) | def get_uint_error_message(
FILE: starknet_py/tests/unit/net/tip/tip_test.py
function test_tip (line 13) | async def test_tip(get_block_with_txs_path, client):
function test_tip_no_txs (line 27) | async def test_tip_no_txs(get_block_with_txs_path, client):
function test_tip_all_equal (line 37) | async def test_tip_all_equal(get_block_with_txs_path, client):
function test_tip_even (line 51) | async def test_tip_even(get_block_with_txs_path, client):
function test_tip_zeroes (line 66) | async def test_tip_zeroes(get_block_with_txs_path, client):
function test_tip_all_zeroes (line 81) | async def test_tip_all_zeroes(get_block_with_txs_path, client):
FILE: starknet_py/tests/unit/serialization/_calldata_reader_test.py
function test_consuming_no_calldata (line 6) | def test_consuming_no_calldata():
function test_consuming_calldata (line 13) | def test_consuming_calldata():
function test_empty_calldata (line 41) | def test_empty_calldata():
FILE: starknet_py/tests/unit/serialization/_context_test.py
function test_if_exceptions_are_wrapped (line 14) | def test_if_exceptions_are_wrapped(initial_exception, wrapped_class):
FILE: starknet_py/tests/unit/serialization/data_serializers/array_serializer_test.py
function test_valid_values (line 23) | def test_valid_values(serializer, value, serialized_value):
FILE: starknet_py/tests/unit/serialization/data_serializers/bool_serializer_test.py
function test_valid_bool_values (line 13) | def test_valid_bool_values(value):
function test_invalid_type (line 21) | def test_invalid_type():
FILE: starknet_py/tests/unit/serialization/data_serializers/byte_array_serializer_test.py
function test_values (line 26) | def test_values(value, serialized_value):
FILE: starknet_py/tests/unit/serialization/data_serializers/enum_serializer_test.py
function test_output_serializer (line 36) | def test_output_serializer(value, correct_serialized_value):
function test_serializer_throws_on_wrong_parameters (line 47) | def test_serializer_throws_on_wrong_parameters():
FILE: starknet_py/tests/unit/serialization/data_serializers/felt_serializer_test.py
function test_valid_felt_values (line 14) | def test_valid_felt_values(value):
function test_valid_shortstring (line 22) | def test_valid_shortstring():
function test_invalid_shortstrings (line 33) | def test_invalid_shortstrings():
function test_invalid_type (line 43) | def test_invalid_type():
function test_values_out_of_range (line 53) | def test_values_out_of_range(value):
function test_not_all_values_used (line 61) | def test_not_all_values_used():
FILE: starknet_py/tests/unit/serialization/data_serializers/int_serializer_test.py
function _felt (line 15) | def _felt(x: int) -> int:
function test_valid_values (line 37) | def test_valid_values(value, serializer, serialized_value):
function test_deserialize_invalid_i128_values (line 45) | def test_deserialize_invalid_i128_values():
function test_serialize_invalid_i128_value (line 55) | def test_serialize_invalid_i128_value():
function test_invalid_type (line 63) | def test_invalid_type():
FILE: starknet_py/tests/unit/serialization/data_serializers/named_tuple_serializer_test.py
function to_different_formats (line 17) | def to_different_formats(data: TupleDataclass):
function test_reversed_order (line 25) | def test_reversed_order():
function test_valid_values (line 55) | def test_valid_values(serializer, value, serialized_value):
FILE: starknet_py/tests/unit/serialization/data_serializers/non_zero_serializer.py
function test_valid_values (line 20) | def test_valid_values(serializer, value, serialized_value):
function test_invalid_values (line 36) | def test_invalid_values(serializer, value, serialized_value):
FILE: starknet_py/tests/unit/serialization/data_serializers/option_serializer_test.py
function test_option_serializer (line 18) | def test_option_serializer(serializer, value, serialized_value):
FILE: starknet_py/tests/unit/serialization/data_serializers/output_serializer_test.py
function test_output_serializer_deserialize (line 46) | def test_output_serializer_deserialize(value, serialized_value):
function test_output_serializer_serialize (line 51) | def test_output_serializer_serialize():
FILE: starknet_py/tests/unit/serialization/data_serializers/payload_serializer_test.py
function test_remove_array_lengths (line 10) | def test_remove_array_lengths():
FILE: starknet_py/tests/unit/serialization/data_serializers/struct_serializer_test.py
function test_valid_values (line 36) | def test_valid_values(serializer, value, serialized_value):
FILE: starknet_py/tests/unit/serialization/data_serializers/tuple_serializer_test.py
function test_valid_values (line 32) | def test_valid_values(serializer, value, serialized_value):
FILE: starknet_py/tests/unit/serialization/data
Condensed preview — 457 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (8,080K chars).
[
{
"path": ".github/ISSUE_TEMPLATE/bug_report.yaml",
"chars": 1616,
"preview": "name: Bug Report\ndescription: File a bug report\ntitle: \"[BUG] <title>\"\nlabels: [ \"bug\" ]\nbody:\n - type: textarea\n id"
},
{
"path": ".github/ISSUE_TEMPLATE/feature_request.yaml",
"chars": 323,
"preview": "name: Feature request\ndescription: Suggest a feature\nbody:\n - type: textarea\n id: Suggestion\n attributes:\n l"
},
{
"path": ".github/actions/compile-contracts/action.yml",
"chars": 1194,
"preview": "name: 'Compile contracts'\ndescription: 'Compile Cairo contracts for a specific package'\n\ninputs:\n package:\n descript"
},
{
"path": ".github/actions/dispatch-compatibility-tests/action.yml",
"chars": 1270,
"preview": "name: 'Dispatch compatibility tests'\ndescription: 'Dispatch compatibility tests workflow to a target repository'\n\ninputs"
},
{
"path": ".github/codecov.yml",
"chars": 174,
"preview": "codecov:\n notify:\n after_n_builds: 4\n require_ci_to_pass: no\n\ncoverage:\n status: off\n\ncomment:\n layout: \"diff, fl"
},
{
"path": ".github/dependabot.yml",
"chars": 694,
"preview": "# To get started with Dependabot version updates, you'll need to specify which\n# package ecosystems to update and where "
},
{
"path": ".github/pull_request_template.md",
"chars": 230,
"preview": "<!-- Reference any GitHub issues resolved by this PR -->\n\nCloses #\n\n\n## Introduced changes\n<!-- A brief description of t"
},
{
"path": ".github/workflows/checks.yml",
"chars": 17848,
"preview": "name: Checks\n\nenv:\n CAIRO_LANG_VERSION: \"0.13.1\"\n # TODO(#1611)\n DEVNET_SHA: 7ed5a9675746d1d9bdb108cecf950d6f611caa9d"
},
{
"path": ".github/workflows/compatibility-tests-dispatcher.yml",
"chars": 2333,
"preview": "name: Run compatibility tests with multiple RPC versions\n\non:\n workflow_dispatch:\n\njobs:\n dispatch:\n name: Dispatch"
},
{
"path": ".github/workflows/compatibility-tests.yml",
"chars": 3265,
"preview": "name: Compatibility tests\n\non:\n workflow_dispatch:\n inputs:\n rpc-version:\n description: \"RPC version pat"
},
{
"path": ".github/workflows/package.yml",
"chars": 860,
"preview": "name: Build wheels\n\non:\n push:\n tags:\n - '*'\n workflow_dispatch:\n\njobs:\n build_sdist:\n name: Build SDist\n "
},
{
"path": ".gitignore",
"chars": 2415,
"preview": "# Byte-compiled / optimized / DLL files\n__pycache__/\n*.py[cod]\n*$py.class\n\n# C extensions\n*.so\n\n# Distribution / packagi"
},
{
"path": ".pylintrc",
"chars": 18475,
"preview": "[MASTER]\n\n# A comma-separated list of package or module names from where C extensions may\n# be loaded. Extensions are lo"
},
{
"path": ".python-version",
"chars": 5,
"preview": "3.10\n"
},
{
"path": ".readthedocs.yml",
"chars": 454,
"preview": "version: 2\n\nbuild:\n os: \"ubuntu-22.04\"\n apt_packages:\n - libgmp3-dev\n tools:\n python: \"3.10\"\n jobs:\n pre_in"
},
{
"path": ".run/All tests.run.xml",
"chars": 926,
"preview": "<component name=\"ProjectRunConfigurationManager\">\n <configuration default=\"false\" name=\"All tests\" type=\"tests\" factory"
},
{
"path": ".run/E2E pytest.run.xml",
"chars": 1133,
"preview": "<component name=\"ProjectRunConfigurationManager\">\n <configuration default=\"false\" name=\"E2E tests\" type=\"tests\" factory"
},
{
"path": ".run/starkware-devnet.run.xml",
"chars": 984,
"preview": "<component name=\"ProjectRunConfigurationManager\">\n <configuration default=\"false\" name=\"starkware-devnet\" type=\"ShConfi"
},
{
"path": "CONTRIBUTING.md",
"chars": 1692,
"preview": "# Contribution Guide\n\n## Reporting Issues\nIf you find a bug or have a suggestion for a feature, you can open a new [issu"
},
{
"path": "LICENSE.txt",
"chars": 1073,
"preview": "MIT License\n\nCopyright (c) 2021 Software Mansion\n\nPermission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "README.md",
"chars": 9896,
"preview": "<div align=\"center\">\n <img src=\"https://raw.githubusercontent.com/software-mansion/starknet.py/master/graphic.png\" al"
},
{
"path": "circular.py",
"chars": 3585,
"preview": "import importlib.util\nimport os\nimport shutil\nimport sys\n\nimport pytest\n\nPACKAGE_NAME = \"starknet_py\"\n\n\ndef _import_from"
},
{
"path": "docs/Makefile",
"chars": 634,
"preview": "# Minimal makefile for Sphinx documentation\n#\n\n# You can set these variables from the command line, and also\n# from the "
},
{
"path": "docs/_ext/autoclass_with_examples.py",
"chars": 3916,
"preview": "import re\nfrom importlib import import_module\nfrom typing import Any, Dict, List, Tuple\n\nfrom docutils.nodes import Node"
},
{
"path": "docs/_ext/codesnippet.py",
"chars": 4822,
"preview": "import re\nfrom typing import Any, Dict, List, Tuple\n\nfrom docutils import nodes\nfrom docutils.nodes import Element, Node"
},
{
"path": "docs/_ext/test_autoclass_with_examples.py",
"chars": 554,
"preview": "from docs._ext.autoclass_with_examples import _append_hint\n\n\ndef test_docstring_inheritance():\n class A:\n def "
},
{
"path": "docs/_static/custom.css",
"chars": 752,
"preview": "@import '../furo.css'\n\n.class {\n margin: 40px 0;\n}\n\ndl.method {\n margin: 40px 0;\n}\n\ndl.method .sig-object {\n ma"
},
{
"path": "docs/_templates/page.html",
"chars": 3036,
"preview": "{%- extends \"!page.html\" %}\n\n{% block extrahead %}\n{{ super() }}\n<!-- Google Tag Manager -->\n<script>(function(w,d,s,l,i"
},
{
"path": "docs/account_creation.rst",
"chars": 1519,
"preview": "Account creation\n================\n\n\nAn account is needed to start interacting with Starknet.\nIf you don't have one there"
},
{
"path": "docs/api/abi.rst",
"chars": 1814,
"preview": "Abi\n===\n\nModule containing representation of contract abi and parser for creating it from parsed json.\n\n.. py:module:: s"
},
{
"path": "docs/api/account.rst",
"chars": 807,
"preview": "Account\n=======\n\n---------------------\nBaseAccount interface\n---------------------\n\n.. py:module:: starknet_py.net.accou"
},
{
"path": "docs/api/cairo.rst",
"chars": 250,
"preview": "Cairo\n=====\n\n.. py:module:: starknet_py.cairo.felt\n\n\n.. autofunction:: encode_shortstring\n.. autofunction:: decode_short"
},
{
"path": "docs/api/client.rst",
"chars": 208,
"preview": "Client\n======\n\nBase class for clients interacting with Starknet.\nImplemented by :ref:`FullNodeClient`.\n\n.. py:module:: s"
},
{
"path": "docs/api/client_errors.rst",
"chars": 220,
"preview": "Client errors\n=============\n\n.. py:module:: starknet_py.net.client_errors\n\n.. autoclass:: ClientError\n :exclude-membe"
},
{
"path": "docs/api/client_models.rst",
"chars": 124,
"preview": "Client responses\n================\n\n.. automodule:: starknet_py.net.client_models\n :members:\n :member-order: groupw"
},
{
"path": "docs/api/contract.rst",
"chars": 1343,
"preview": "Contract\n========\n\n.. py:module:: starknet_py.contract\n\n.. autoclass-with-examples:: Contract\n :members:\n :member-"
},
{
"path": "docs/api/contract_utils.rst",
"chars": 327,
"preview": "--------------------------\nContract utility functions\n--------------------------\n\n.. autofunction:: starknet_py.common.c"
},
{
"path": "docs/api/data_types.rst",
"chars": 1232,
"preview": "Data types\n==========\n\nModule containing representations of Cairo types. Mostly used to generate proper serializers.\n\n.."
},
{
"path": "docs/api/devnet_client.rst",
"chars": 167,
"preview": "DevnetClient\n============\n\n.. py:module:: starknet_py.devnet_utils.devnet_client\n\n.. autoclass-with-examples:: DevnetCli"
},
{
"path": "docs/api/executable_models.rst",
"chars": 140,
"preview": "Models for executables\n======================\n\n.. automodule:: starknet_py.net.executable_models\n :members:\n :memb"
},
{
"path": "docs/api/full_node_client.rst",
"chars": 167,
"preview": "FullNodeClient\n==============\n\n.. py:module:: starknet_py.net.full_node_client\n\n.. autoclass-with-examples:: FullNodeCli"
},
{
"path": "docs/api/hash.rst",
"chars": 1382,
"preview": "Hash\n====\n\n------------------\nTransaction hashes\n------------------\n\n.. automodule:: starknet_py.hash.transaction\n :m"
},
{
"path": "docs/api/models.rst",
"chars": 731,
"preview": "Models\n======\n\nModule containing base models and functions to operate on them.\n\n.. py:module:: starknet_py.net.models\n\n."
},
{
"path": "docs/api/proxy_resolvers.rst",
"chars": 526,
"preview": "Proxy Resolvers\n===============\n\n.. py:module:: starknet_py.proxy.proxy_check\n\n\nProxyCheck\n----------\n\n.. autoclass:: Pr"
},
{
"path": "docs/api/serializers.rst",
"chars": 1453,
"preview": "Serializers\n===========\n\n.. py:module:: starknet_py.serialization\n\nContainers\n----------\n.. autoclass:: TupleDataclass\n "
},
{
"path": "docs/api/signer.rst",
"chars": 1766,
"preview": "Signer\n======\n\n--------------------\nBaseSigner interface\n--------------------\n\n.. py:module:: starknet_py.net.signer\n\n.."
},
{
"path": "docs/api/tip.rst",
"chars": 87,
"preview": "Tip\n===\n\n.. automodule:: starknet_py.net.tip\n :members:\n :member-order: bysource\n"
},
{
"path": "docs/api/transaction_errors.rst",
"chars": 329,
"preview": "Transaction errors\n==================\n\n.. py:module:: starknet_py.transaction_errors\n\n.. autoclass:: TransactionFailedEr"
},
{
"path": "docs/api/typed_data.rst",
"chars": 1533,
"preview": "TypedData\n=========\n\n.. autoclass:: starknet_py.utils.typed_data.TypedData\n :members:\n :undoc-members:\n :exclud"
},
{
"path": "docs/api/udc_deployer.rst",
"chars": 214,
"preview": "Deployer\n========\n\n.. py:module:: starknet_py.net.udc_deployer.deployer\n\n.. autoclass-with-examples:: Deployer\n :memb"
},
{
"path": "docs/api/websocket_client.rst",
"chars": 181,
"preview": "WebsocketClient\n===============\n\n.. py:module:: starknet_py.net.websockets.websocket_client\n\n.. autoclass-with-examples:"
},
{
"path": "docs/api.rst",
"chars": 424,
"preview": "API\n===\n.. toctree::\n\n api/client\n api/full_node_client\n api/devnet_client\n api/account\n api/client_models\n "
},
{
"path": "docs/conf.py",
"chars": 2904,
"preview": "# pylint: skip-file\n# Configuration file for the Sphinx documentation builder.\n#\n# This file only contains a selection o"
},
{
"path": "docs/development.rst",
"chars": 3848,
"preview": "Development\n===========\n\nThis page describes how to setup development environment. You don't need to follow the instruct"
},
{
"path": "docs/devnet_utils/mocking_interaction_with_l1.rst",
"chars": 2425,
"preview": "Mocking interaction with L1\n===========================\n\nAbstract\n--------\n\nIn order to test interaction with L1 contrac"
},
{
"path": "docs/devnet_utils.rst",
"chars": 85,
"preview": "Devnet Utils\n============\n\n.. toctree::\n\n devnet_utils/mocking_interaction_with_l1"
},
{
"path": "docs/guide/account_and_client.rst",
"chars": 5225,
"preview": "Account and Client\n==================\n\nExecuting transactions\n----------------------\n\nTo execute transactions on Starkne"
},
{
"path": "docs/guide/deploying_contracts.rst",
"chars": 4158,
"preview": "Deploying contracts\n===================\n\nDeclaring contracts\n-------------------\n\nContracts written in Cairo 0 cannot be"
},
{
"path": "docs/guide/generating_key_pair.rst",
"chars": 2058,
"preview": "Generating a Key pair\n=====================\n\nKey pair\n--------\n\nThe Key pair is a pair of private and public keys. The p"
},
{
"path": "docs/guide/resolving_proxy_contracts.rst",
"chars": 3416,
"preview": "Resolving proxy contracts\n=========================\n\n.. note::\n If you know the abi of the contract, **always prefer*"
},
{
"path": "docs/guide/serialization.rst",
"chars": 4064,
"preview": "Serialization\n=============\n\nData serialization\n-------------------\n\nstarknet.py **serializes** python values to Cairo v"
},
{
"path": "docs/guide/signing.rst",
"chars": 2564,
"preview": "Signing\n=======\n\nUsing different signing methods\n-------------------------------\n\nBy default, an :ref:`Account` uses the"
},
{
"path": "docs/guide/using_existing_contracts.rst",
"chars": 5472,
"preview": "Using existing contracts\n========================\n\nExisting contracts\n------------------\n\nAlthough it is possible to use"
},
{
"path": "docs/guide/websockets.rst",
"chars": 3919,
"preview": "Websockets\n==========\n\nIntroduction\n------------\nApart from interacting with Starknet by request-response model, you can"
},
{
"path": "docs/guide.rst",
"chars": 250,
"preview": "Guide\n=====\n\n.. toctree::\n\n guide/account_and_client\n guide/using_existing_contracts\n guide/resolving_proxy_con"
},
{
"path": "docs/index.rst",
"chars": 329,
"preview": ".. figure:: _static/starknetpy.png\n :class: starknetpy-logo\n\n\n.. rst-class:: description-cls\n\nStarknet SDK for Python\n"
},
{
"path": "docs/installation.rst",
"chars": 2244,
"preview": "Installation\n============\n\nTo use starknet.py, ``ecdsa, fastecdsa, sympy`` dependencies are required. Depending on the o"
},
{
"path": "docs/make.bat",
"chars": 800,
"preview": "@ECHO OFF\r\n\r\npushd %~dp0\r\n\r\nREM Command file for Sphinx documentation\r\n\r\nif \"%SPHINXBUILD%\" == \"\" (\r\n\tset SPHINXBUILD=sp"
},
{
"path": "docs/migration_guide.rst",
"chars": 81613,
"preview": "Migration guide\n===============\n\n****************************\n0.30.0 Migration guide\n****************************\n\nVersi"
},
{
"path": "docs/quickstart.rst",
"chars": 2591,
"preview": "Quickstart\n==========\n\nUsing FullNodeClient\n--------------------\nA :ref:`Client` is a facade for interacting with Starkn"
},
{
"path": "pre-commit",
"chars": 78,
"preview": "#!/bin/sh\n\npoetry run poe format\npoetry run poe lint\npoetry run poe typecheck\n"
},
{
"path": "pre-push",
"chars": 38,
"preview": "#!/bin/sh\n\npoetry run poe format_check"
},
{
"path": "pylint_todo_checker.py",
"chars": 1042,
"preview": "import re\nimport tokenize\n\nfrom pylint import checkers, interfaces\n\n\ndef register(linter: \"PyLinter\") -> None:\n \"\"\"\n "
},
{
"path": "pyproject.toml",
"chars": 4704,
"preview": "[project]\nname = \"starknet-py\"\nversion = \"0.30.0\"\ndescription = \"A python SDK for Starknet\"\nauthors = [\n { name = \"To"
},
{
"path": "starknet_py/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "starknet_py/abi/v0/__init__.py",
"chars": 70,
"preview": "from .model import Abi\nfrom .parser import AbiParser, AbiParsingError\n"
},
{
"path": "starknet_py/abi/v0/model.py",
"chars": 1158,
"preview": "from __future__ import annotations\n\nfrom dataclasses import dataclass\nfrom typing import Dict, Optional, OrderedDict\n\nfr"
},
{
"path": "starknet_py/abi/v0/parser.py",
"chars": 7959,
"preview": "from __future__ import annotations\n\nimport dataclasses\nimport json\nfrom collections import OrderedDict, defaultdict\nfrom"
},
{
"path": "starknet_py/abi/v0/schemas.py",
"chars": 2278,
"preview": "from marshmallow import Schema, fields\nfrom marshmallow_oneofschema.one_of_schema import OneOfSchema\n\nfrom starknet_py.a"
},
{
"path": "starknet_py/abi/v0/shape.py",
"chars": 1349,
"preview": "# TODO (#1260): update pylint to 3.1.0 and remove pylint disable\n# pylint: disable=too-many-ancestors\nimport sys\nfrom ty"
},
{
"path": "starknet_py/abi/v1/__init__.py",
"chars": 70,
"preview": "from .model import Abi\nfrom .parser import AbiParser, AbiParsingError\n"
},
{
"path": "starknet_py/abi/v1/core_structures.json",
"chars": 222,
"preview": "{\n \"abi\": [\n {\n \"type\": \"struct\",\n \"name\": \"core::starknet::eth_address::EthAddress\",\n \"members\": [\n "
},
{
"path": "starknet_py/abi/v1/model.py",
"chars": 1004,
"preview": "from __future__ import annotations\n\nfrom dataclasses import dataclass\nfrom typing import Dict, List, OrderedDict\n\nfrom s"
},
{
"path": "starknet_py/abi/v1/parser.py",
"chars": 8018,
"preview": "from __future__ import annotations\n\nimport dataclasses\nimport json\nimport os\nfrom collections import OrderedDict, defaul"
},
{
"path": "starknet_py/abi/v1/parser_transformer.py",
"chars": 5664,
"preview": "from typing import Any, List, Optional, Tuple\n\nimport lark\nfrom lark import Token, Transformer\n\nfrom starknet_py.cairo.d"
},
{
"path": "starknet_py/abi/v1/schemas.py",
"chars": 2035,
"preview": "from marshmallow import Schema, fields\nfrom marshmallow_oneofschema.one_of_schema import OneOfSchema\n\nfrom starknet_py.a"
},
{
"path": "starknet_py/abi/v1/shape.py",
"chars": 927,
"preview": "from typing import List, Literal, Optional, TypedDict, Union\n\nENUM_ENTRY = \"enum\"\nSTRUCT_ENTRY = \"struct\"\nFUNCTION_ENTRY"
},
{
"path": "starknet_py/abi/v2/__init__.py",
"chars": 70,
"preview": "from .model import Abi\nfrom .parser import AbiParser, AbiParsingError\n"
},
{
"path": "starknet_py/abi/v2/model.py",
"chars": 2206,
"preview": "from __future__ import annotations\n\nfrom dataclasses import dataclass\nfrom typing import Dict, List, Optional, OrderedDi"
},
{
"path": "starknet_py/abi/v2/parser.py",
"chars": 10736,
"preview": "from __future__ import annotations\n\nimport dataclasses\nimport json\nfrom collections import OrderedDict, defaultdict\nfrom"
},
{
"path": "starknet_py/abi/v2/parser_transformer.py",
"chars": 7225,
"preview": "from math import log2\nfrom typing import Any, List, Optional, Tuple, Union\n\nimport lark\nfrom lark import Token, Transfor"
},
{
"path": "starknet_py/abi/v2/schemas.py",
"chars": 4344,
"preview": "from marshmallow import Schema, fields, validate\nfrom marshmallow_oneofschema.one_of_schema import OneOfSchema\n\nfrom sta"
},
{
"path": "starknet_py/abi/v2/shape.py",
"chars": 2067,
"preview": "from __future__ import annotations\n\nfrom typing import List, Literal, Optional, TypedDict, Union\n\nSTRUCT_ENTRY = \"struct"
},
{
"path": "starknet_py/cairo/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "starknet_py/cairo/data_types.py",
"chars": 2946,
"preview": "from __future__ import annotations\n\nfrom abc import ABC\nfrom collections import OrderedDict\nfrom dataclasses import data"
},
{
"path": "starknet_py/cairo/deprecated_parse/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "starknet_py/cairo/deprecated_parse/cairo_types.py",
"chars": 1434,
"preview": "import dataclasses\nfrom typing import List, Optional\n\n\nclass CairoType:\n \"\"\"\n Base class for cairo types.\n \"\"\"\n"
},
{
"path": "starknet_py/cairo/deprecated_parse/parser.py",
"chars": 1339,
"preview": "import lark\n\nfrom starknet_py.cairo.deprecated_parse.cairo_types import CairoType\nfrom starknet_py.cairo.deprecated_pars"
},
{
"path": "starknet_py/cairo/deprecated_parse/parser_transformer.py",
"chars": 3913,
"preview": "import dataclasses\nfrom typing import Optional, Tuple\n\nfrom lark import Token, Transformer, v_args\n\nfrom starknet_py.cai"
},
{
"path": "starknet_py/cairo/felt.py",
"chars": 1718,
"preview": "from typing import List\n\nfrom starknet_py.constants import FIELD_PRIME\n\nCairoData = List[int]\n\n\nMAX_UINT256 = (1 << 256)"
},
{
"path": "starknet_py/cairo/type_parser.py",
"chars": 4453,
"preview": "from __future__ import annotations\n\nfrom collections import OrderedDict\nfrom typing import Dict, cast\n\nimport starknet_p"
},
{
"path": "starknet_py/cairo/v1/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "starknet_py/cairo/v1/type_parser.py",
"chars": 2107,
"preview": "from __future__ import annotations\n\nfrom typing import Dict, Union\n\nfrom starknet_py.abi.v1.parser_transformer import pa"
},
{
"path": "starknet_py/cairo/v2/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "starknet_py/cairo/v2/type_parser.py",
"chars": 2531,
"preview": "from __future__ import annotations\n\nfrom typing import Dict, Union\n\nfrom starknet_py.abi.v2.parser_transformer import pa"
},
{
"path": "starknet_py/common.py",
"chars": 2986,
"preview": "import warnings\nfrom typing import Literal, Union, cast\n\nfrom marshmallow import EXCLUDE, ValidationError\n\nfrom starknet"
},
{
"path": "starknet_py/conftest.py",
"chars": 870,
"preview": "# This is needed for importing fixtures from `fixtures` directory\npytest_plugins = [\n \"starknet_py.tests.e2e.fixtures"
},
{
"path": "starknet_py/constants.py",
"chars": 1876,
"preview": "from enum import IntEnum\nfrom pathlib import Path\n\n# Addresses came from starkware-libs/starknet-addresses repository: h"
},
{
"path": "starknet_py/contract.py",
"chars": 32482,
"preview": "from __future__ import annotations\n\nimport dataclasses\nfrom abc import ABC, abstractmethod\nfrom dataclasses import datac"
},
{
"path": "starknet_py/contract_utils.py",
"chars": 1569,
"preview": "from typing import Optional, Tuple, Union\n\nfrom starknet_py.common import create_casm_class\nfrom starknet_py.hash.casm_c"
},
{
"path": "starknet_py/devnet_utils/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "starknet_py/devnet_utils/devnet_client.py",
"chars": 13003,
"preview": "import re\nfrom typing import List, Optional, Union, cast\n\nfrom aiohttp import ClientSession\n\nfrom starknet_py.devnet_uti"
},
{
"path": "starknet_py/devnet_utils/devnet_client_models.py",
"chars": 2126,
"preview": "from dataclasses import dataclass\nfrom typing import List, Optional\n\nfrom starknet_py.net.client_models import PriceUnit"
},
{
"path": "starknet_py/devnet_utils/devnet_rpc_schema.py",
"chars": 6738,
"preview": "from marshmallow import fields, post_load\n\nfrom starknet_py.devnet_utils.devnet_client_models import (\n Balance,\n "
},
{
"path": "starknet_py/hash/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "starknet_py/hash/address.py",
"chars": 2285,
"preview": "from typing import Sequence\n\nfrom starknet_py.constants import CONTRACT_ADDRESS_PREFIX, L2_ADDRESS_UPPER_BOUND\nfrom star"
},
{
"path": "starknet_py/hash/address_test.py",
"chars": 2367,
"preview": "import pytest\n\nfrom starknet_py.hash.address import (\n compute_address,\n get_checksum_address,\n is_checksum_add"
},
{
"path": "starknet_py/hash/blake2s.py",
"chars": 3940,
"preview": "\"\"\"\nThis module's Blake2s felt encoding and hashing logic is based on StarkWare's\nsequencer implementation:\nhttps://gith"
},
{
"path": "starknet_py/hash/casm_class_hash.py",
"chars": 5778,
"preview": "from typing import List, Optional, Sequence, Tuple\n\nfrom semver import Version\n\nfrom starknet_py.cairo.felt import encod"
},
{
"path": "starknet_py/hash/class_hash.py",
"chars": 4102,
"preview": "import copy\nimport json\nimport re\nfrom typing import List\n\nfrom starknet_py.cairo.felt import encode_shortstring\nfrom st"
},
{
"path": "starknet_py/hash/compiled_class_hash_objects.py",
"chars": 3668,
"preview": "# File is copied from\n# https://github.com/starkware-libs/cairo-lang/blob/v0.13.1/src/starkware/starknet/core/os/contrac"
},
{
"path": "starknet_py/hash/hash_method.py",
"chars": 1142,
"preview": "from enum import Enum\nfrom typing import List\n\nfrom poseidon_py.poseidon_hash import poseidon_hash, poseidon_hash_many\n\n"
},
{
"path": "starknet_py/hash/outside_execution.py",
"chars": 4864,
"preview": "from starknet_py.constants import OutsideExecutionInterfaceID\nfrom starknet_py.net.client_models import OutsideExecution"
},
{
"path": "starknet_py/hash/selector.py",
"chars": 494,
"preview": "from starknet_py.constants import (\n DEFAULT_ENTRY_POINT_NAME,\n DEFAULT_ENTRY_POINT_SELECTOR,\n DEFAULT_L1_ENTRY"
},
{
"path": "starknet_py/hash/sierra_class_hash.py",
"chars": 1827,
"preview": "from typing import List, Union\n\nfrom poseidon_py.poseidon_hash import poseidon_hash_many\n\nfrom starknet_py.cairo.felt im"
},
{
"path": "starknet_py/hash/storage.py",
"chars": 426,
"preview": "from functools import reduce\n\nfrom starknet_py.constants import ADDR_BOUND\nfrom starknet_py.hash.utils import _starknet_"
},
{
"path": "starknet_py/hash/transaction.py",
"chars": 12149,
"preview": "from dataclasses import dataclass\nfrom enum import IntEnum\nfrom typing import List, Optional, Sequence\n\nfrom poseidon_py"
},
{
"path": "starknet_py/hash/utils.py",
"chars": 2452,
"preview": "import functools\nfrom typing import List, Optional, Sequence\n\nfrom Crypto.Hash import keccak\nfrom crypto_cpp_py.cpp_bind"
},
{
"path": "starknet_py/net/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "starknet_py/net/account/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "starknet_py/net/account/account.py",
"chars": 27095,
"preview": "import dataclasses\nfrom collections import OrderedDict\nfrom typing import Any, Dict, Iterable, List, Optional, Tuple, Un"
},
{
"path": "starknet_py/net/account/account_deployment_result.py",
"chars": 652,
"preview": "from dataclasses import dataclass\n\nfrom starknet_py.contract import SentTransaction\nfrom starknet_py.utils.sync import a"
},
{
"path": "starknet_py/net/account/base_account.py",
"chars": 11718,
"preview": "from abc import ABC, abstractmethod\nfrom typing import List, Optional, Union\n\nfrom starknet_py.constants import ANY_CALL"
},
{
"path": "starknet_py/net/client.py",
"chars": 17780,
"preview": "from __future__ import annotations\n\nimport asyncio\nfrom abc import ABC, abstractmethod\nfrom typing import List, Optional"
},
{
"path": "starknet_py/net/client_errors.py",
"chars": 1437,
"preview": "from typing import Optional, Union\n\nfrom starknet_py.net.client_models import Hash, Tag\nfrom starknet_py.net.models impo"
},
{
"path": "starknet_py/net/client_models.py",
"chars": 32188,
"preview": "\"\"\"\nDataclasses representing responses from Starknet.\nThey need to stay backwards compatible for old transactions/blocks"
},
{
"path": "starknet_py/net/client_utils.py",
"chars": 3796,
"preview": "import re\nfrom typing import Dict, Optional, Union, cast\n\nfrom typing_extensions import get_args\n\nfrom starknet_py.hash."
},
{
"path": "starknet_py/net/executable_models.py",
"chars": 9452,
"preview": "from dataclasses import dataclass\nfrom enum import Enum\nfrom typing import List, Literal, Optional, Tuple, Union\n\nfrom s"
},
{
"path": "starknet_py/net/full_node_client.py",
"chars": 36698,
"preview": "from typing import Dict, List, Optional, Tuple, Union, cast\n\nimport aiohttp\n\nfrom starknet_py.constants import RPC_CONTR"
},
{
"path": "starknet_py/net/http_client.py",
"chars": 4256,
"preview": "import warnings\nfrom abc import ABC, abstractmethod\nfrom enum import Enum\nfrom typing import Any, Dict, List, Optional, "
},
{
"path": "starknet_py/net/models/__init__.py",
"chars": 308,
"preview": "from .address import Address, AddressRepresentation, parse_address\nfrom .chains import StarknetChainId, chain_from_netwo"
},
{
"path": "starknet_py/net/models/address.py",
"chars": 327,
"preview": "from typing import Union\n\nAddressRepresentation = Union[int, str]\nAddress = int\n\n\ndef parse_address(value: AddressRepres"
},
{
"path": "starknet_py/net/models/chains.py",
"chars": 1347,
"preview": "from enum import IntEnum\nfrom typing import Optional, Union\n\nfrom starknet_py.common import int_from_bytes\nfrom starknet"
},
{
"path": "starknet_py/net/models/transaction.py",
"chars": 13788,
"preview": "\"\"\"\nDataclasses representing Transactions for library use, most often\nwhen sending a transaction to Starknet.\nThey shoul"
},
{
"path": "starknet_py/net/models/typed_data.py",
"chars": 922,
"preview": "\"\"\"\nTypedDict structures for TypedData\n\"\"\"\n\nimport sys\nfrom typing import Any, Dict, List, Optional, TypedDict\n\nfrom sta"
},
{
"path": "starknet_py/net/networks.py",
"chars": 575,
"preview": "from typing import Literal, Union\n\nfrom starknet_py.constants import ETH_FEE_CONTRACT_ADDRESS\n\nMAINNET = \"mainnet\"\nSEPOL"
},
{
"path": "starknet_py/net/schemas/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "starknet_py/net/schemas/broadcasted_txn.py",
"chars": 953,
"preview": "from marshmallow import fields\nfrom marshmallow_oneofschema.one_of_schema import OneOfSchema\n\nfrom starknet_py.net.clien"
},
{
"path": "starknet_py/net/schemas/common.py",
"chars": 11532,
"preview": "import re\nimport sys\nfrom enum import Enum\nfrom typing import Any, Mapping, Optional, Union\n\nfrom marshmallow import Sch"
},
{
"path": "starknet_py/net/schemas/contracts_storage_keys.py",
"chars": 804,
"preview": "from marshmallow import fields, validate\n\nfrom starknet_py.net.schemas.common import Felt\nfrom starknet_py.utils.schema "
},
{
"path": "starknet_py/net/schemas/rpc/block.py",
"chars": 9815,
"preview": "from marshmallow import fields, post_load, validate\n\nfrom starknet_py.net.client_models import (\n BlockHashAndNumber,"
},
{
"path": "starknet_py/net/schemas/rpc/contract.py",
"chars": 7679,
"preview": "import json\n\nfrom marshmallow import EXCLUDE\nfrom marshmallow import Schema as MarshmallowSchema\nfrom marshmallow import"
},
{
"path": "starknet_py/net/schemas/rpc/event.py",
"chars": 1985,
"preview": "from marshmallow import fields, post_load, validate\n\nfrom starknet_py.net.client_models import (\n EmittedEvent,\n E"
},
{
"path": "starknet_py/net/schemas/rpc/executables_api.py",
"chars": 33507,
"preview": "from typing import Any, Optional\n\nfrom marshmallow import ValidationError, fields, post_load, validate\n\nfrom starknet_py"
},
{
"path": "starknet_py/net/schemas/rpc/general.py",
"chars": 1988,
"preview": "from marshmallow import fields, post_load\n\nfrom starknet_py.net.client_models import (\n EstimatedFee,\n ExecutionRe"
},
{
"path": "starknet_py/net/schemas/rpc/storage_proof.py",
"chars": 4552,
"preview": "from typing import Any, Optional, Union\n\nfrom marshmallow import ValidationError, fields, post_load\n\nfrom starknet_py.ne"
},
{
"path": "starknet_py/net/schemas/rpc/trace_api.py",
"chars": 11013,
"preview": "from marshmallow import EXCLUDE, fields, post_load\nfrom marshmallow_oneofschema.one_of_schema import OneOfSchema\n\nfrom s"
},
{
"path": "starknet_py/net/schemas/rpc/transactions.py",
"chars": 13950,
"preview": "from marshmallow import fields, post_dump, post_load\nfrom marshmallow_oneofschema.one_of_schema import OneOfSchema\n\nfrom"
},
{
"path": "starknet_py/net/schemas/rpc/websockets.py",
"chars": 5967,
"preview": "from typing import Any, Optional, cast\n\nfrom marshmallow import ValidationError, fields, post_load\n\nfrom starknet_py.net"
},
{
"path": "starknet_py/net/schemas/utils.py",
"chars": 252,
"preview": "from typing import Union\n\nfrom starknet_py.constants import QUERY_VERSION_BASE\n\n\ndef _extract_tx_version(version: Union["
},
{
"path": "starknet_py/net/signer/__init__.py",
"chars": 36,
"preview": "from .base_signer import BaseSigner\n"
},
{
"path": "starknet_py/net/signer/base_signer.py",
"chars": 1227,
"preview": "from abc import ABC, abstractmethod\nfrom typing import List\n\nfrom starknet_py.net.models.transaction import AccountTrans"
},
{
"path": "starknet_py/net/signer/eth_signer.py",
"chars": 1891,
"preview": "from typing import List\n\nfrom eth_keys import keys # pyright: ignore[reportPrivateImportUsage]\nfrom eth_keys.datatypes "
},
{
"path": "starknet_py/net/signer/key_pair.py",
"chars": 1830,
"preview": "import secrets\nfrom dataclasses import dataclass\n\nfrom eth_keyfile.keyfile import extract_key_from_keyfile\n\nfrom starkne"
},
{
"path": "starknet_py/net/signer/ledger_signer.py",
"chars": 16546,
"preview": "import hashlib\nimport warnings\nfrom enum import Enum\nfrom typing import TYPE_CHECKING, List\n\nfrom starknet_py.hash.addre"
},
{
"path": "starknet_py/net/signer/stark_curve_signer.py",
"chars": 1728,
"preview": "from typing import List\n\nfrom starknet_py.hash.utils import message_signature\nfrom starknet_py.net.models import Address"
},
{
"path": "starknet_py/net/tip/__init__.py",
"chars": 1131,
"preview": "import math\nimport statistics\nfrom typing import Optional, Union\n\nfrom starknet_py.net.client import Client\nfrom starkne"
},
{
"path": "starknet_py/net/udc_deployer/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "starknet_py/net/udc_deployer/deployer.py",
"chars": 7083,
"preview": "from __future__ import annotations\n\nimport random\nfrom typing import List, NamedTuple, Optional, Union, cast\n\nfrom stark"
},
{
"path": "starknet_py/net/websockets/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "starknet_py/net/websockets/errors.py",
"chars": 598,
"preview": "from typing import Optional\n\n\nclass WebsocketClientError(Exception):\n \"\"\"\n Base class for all errors raised while "
},
{
"path": "starknet_py/net/websockets/models.py",
"chars": 2161,
"preview": "\"\"\"\nDataclasses representing responses from Starknet Websocket RPC API.\n\"\"\"\n\nfrom dataclasses import dataclass\nfrom enum"
},
{
"path": "starknet_py/net/websockets/websocket_client.py",
"chars": 18593,
"preview": "import asyncio\nimport json\nfrom typing import Any, Callable, Dict, List, Literal, Optional, Union, cast\n\nfrom websockets"
},
{
"path": "starknet_py/proxy/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "starknet_py/proxy/contract_abi_resolver.py",
"chars": 8450,
"preview": "import json\nimport re\nfrom enum import Enum\nfrom typing import AsyncGenerator, List, Tuple, TypedDict, Union, cast\n\nfrom"
},
{
"path": "starknet_py/proxy/proxy_check.py",
"chars": 2720,
"preview": "from abc import ABC, abstractmethod\nfrom typing import Optional\n\nfrom starknet_py.hash.selector import get_selector_from"
},
{
"path": "starknet_py/py.typed",
"chars": 0,
"preview": ""
},
{
"path": "starknet_py/serialization/__init__.py",
"chars": 655,
"preview": "# PayloadSerializer and FunctionSerializationAdapter would mostly be used by users\nfrom .data_serializers import (\n A"
},
{
"path": "starknet_py/serialization/_calldata_reader.py",
"chars": 1145,
"preview": "from typing import List\n\nfrom starknet_py.cairo.felt import CairoData\n\n\nclass OutOfBoundsError(Exception):\n def __ini"
},
{
"path": "starknet_py/serialization/_context.py",
"chars": 4871,
"preview": "from __future__ import annotations\n\nfrom abc import ABC\nfrom contextlib import contextmanager\nfrom typing import Any, Ge"
},
{
"path": "starknet_py/serialization/data_serializers/__init__.py",
"chars": 539,
"preview": "from .array_serializer import ArraySerializer\nfrom .bool_serializer import BoolSerializer\nfrom .byte_array_serializer im"
},
{
"path": "starknet_py/serialization/data_serializers/_common.py",
"chars": 2925,
"preview": "# We have to use parametrised type from typing\nfrom collections import OrderedDict as _OrderedDict\nfrom typing import Di"
},
{
"path": "starknet_py/serialization/data_serializers/array_serializer.py",
"chars": 1277,
"preview": "from dataclasses import dataclass\nfrom typing import Generator, List\n\nfrom starknet_py.serialization._context import (\n "
},
{
"path": "starknet_py/serialization/data_serializers/bool_serializer.py",
"chars": 1065,
"preview": "from dataclasses import dataclass\nfrom typing import Generator\n\nfrom starknet_py.serialization._context import (\n Con"
},
{
"path": "starknet_py/serialization/data_serializers/byte_array_serializer.py",
"chars": 2432,
"preview": "from dataclasses import dataclass\nfrom typing import Generator\n\nfrom starknet_py.cairo.felt import decode_shortstring, e"
},
{
"path": "starknet_py/serialization/data_serializers/cairo_data_serializer.py",
"chars": 2327,
"preview": "from abc import ABC, abstractmethod\nfrom typing import Generator, Generic, List, TypeVar\n\nfrom starknet_py.serialization"
},
{
"path": "starknet_py/serialization/data_serializers/enum_serializer.py",
"chars": 2319,
"preview": "from dataclasses import dataclass\nfrom typing import Dict, Generator, OrderedDict, Tuple, Union\n\nfrom starknet_py.serial"
},
{
"path": "starknet_py/serialization/data_serializers/felt_serializer.py",
"chars": 1632,
"preview": "import warnings\nfrom dataclasses import dataclass\nfrom typing import Generator\n\nfrom starknet_py.cairo.felt import encod"
},
{
"path": "starknet_py/serialization/data_serializers/int_serializer.py",
"chars": 1984,
"preview": "from dataclasses import dataclass\nfrom typing import Generator\n\nfrom starknet_py.constants import FIELD_PRIME\nfrom stark"
},
{
"path": "starknet_py/serialization/data_serializers/named_tuple_serializer.py",
"chars": 1941,
"preview": "from dataclasses import dataclass\nfrom typing import Dict, Generator, NamedTuple, OrderedDict, Union\n\nfrom starknet_py.s"
},
{
"path": "starknet_py/serialization/data_serializers/non_zero_serializer.py",
"chars": 1210,
"preview": "from dataclasses import dataclass\nfrom typing import Any, Generator\n\nfrom starknet_py.serialization._context import (\n "
},
{
"path": "starknet_py/serialization/data_serializers/option_serializer.py",
"chars": 1202,
"preview": "from dataclasses import dataclass\nfrom typing import Any, Generator, Optional\n\nfrom starknet_py.serialization._context i"
},
{
"path": "starknet_py/serialization/data_serializers/output_serializer.py",
"chars": 1211,
"preview": "from dataclasses import dataclass, field\nfrom typing import Generator, List, Tuple\n\nfrom starknet_py.serialization._cont"
},
{
"path": "starknet_py/serialization/data_serializers/payload_serializer.py",
"chars": 2661,
"preview": "from collections import OrderedDict as _OrderedDict\nfrom dataclasses import InitVar, dataclass, field\nfrom typing import"
},
{
"path": "starknet_py/serialization/data_serializers/struct_serializer.py",
"chars": 1049,
"preview": "from dataclasses import dataclass\nfrom typing import Dict, Generator, OrderedDict\n\nfrom starknet_py.serialization._conte"
},
{
"path": "starknet_py/serialization/data_serializers/tuple_serializer.py",
"chars": 1072,
"preview": "from dataclasses import dataclass\nfrom typing import Generator, Iterable, List, Tuple\n\nfrom starknet_py.serialization._c"
},
{
"path": "starknet_py/serialization/data_serializers/uint256_serializer.py",
"chars": 2481,
"preview": "from dataclasses import dataclass\nfrom typing import Generator, TypedDict, Union\n\nfrom starknet_py.cairo.felt import uin"
},
{
"path": "starknet_py/serialization/data_serializers/uint_serializer.py",
"chars": 3232,
"preview": "from dataclasses import dataclass\nfrom typing import Generator, TypedDict, Union\n\nfrom starknet_py.cairo.felt import uin"
},
{
"path": "starknet_py/serialization/data_serializers/unit_serializer.py",
"chars": 894,
"preview": "from dataclasses import dataclass\nfrom typing import Any, Generator, Optional\n\nfrom starknet_py.serialization._context i"
},
{
"path": "starknet_py/serialization/errors.py",
"chars": 345,
"preview": "class CairoSerializerException(Exception):\n \"\"\"Exception thrown by CairoSerializer.\"\"\"\n\n\nclass InvalidTypeException(C"
}
]
// ... and 257 more files (download for full content)
About this extraction
This page contains the full source code of the software-mansion/starknet.py GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 457 files (7.2 MB), approximately 1.9M tokens, and a symbol index with 2265 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.