package
0.7.2
Repository: https://github.com/nethermindeth/starknet.go.git
Documentation: pkg.go.dev

# README

RPC implementation

starknet.go RPC implementation provides the RPC API to perform operations with Starknet. It is currently being tested and maintained up-to-date with Pathfinder and relies on go-ethereum to provide the JSON RPC 2.0 client implementation.

If you need starknet.go to support another API, open an issue on the project.

Testing the RPC API

To test the RPC API, you should simply go the the rpc directory and run go test like below:

cd rpc
go test -v .

We provide an additional -env flag to go test so that you can choose the environment you want to test. For instance, if you plan to test with the testnet, run:

cd rpc
go test -env testnet -v .

Supported environments are mock, testnet and mainnet. The support for devnet is planned but might require some dedicated condition since it is empty.

If you plan to specify an alternative URL to test the environment, you can set the INTEGRATION_BASE environment variable. In addition, tests load .env.${env}, and .env before relying on the environment variable. So for instanve if you want the URL to change only for the testnet environment, you could add the line below in .env.testnet:

INTEGRATION_BASE=http://localhost:9546

# Functions

Err returns an RPCError based on the given code and data.
NewClient creates a new ethrpc.Client instance.
NewProvider creates a new rpc Provider instance.
WithBlockHash returns a BlockID with the given hash.
WithBlockNumber returns a BlockID with the given block number.
WithBlockTag creates a new BlockID with the specified tag.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Internal JSON-RPC error.
Invalid JSON was received by the server.
Invalid method parameter(s).
The JSON sent is not a valid Request object.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
The method does not exist / is not available.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Flags that indicate how to simulate a given transaction.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

AddDeclareTransactionOutput provides the output for AddDeclareTransaction.
AddDeclareTransactionResponse provides the output for AddDeclareTransaction.
AddDeployTransactionResponse provides the output for AddDeployTransaction.
AddInvokeTransactionResponse provides the output for AddInvokeTransaction.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
BlockHashAndNumberOutput is a struct that is returned by BlockHashAndNumber.
No description provided by the author
BlockID is a struct that is used to choose between different search types.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
encoding/json doesn't support inlining fields.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ContractNonce is a the updated nonce per contract address.
ContractStorageDiffItem is a change in a single storage item.
No description provided by the author
DeclaredClassesItem is an object with class_hash and compiled_class_hash.
the execution trace of a declare transaction.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
DeployAccountTxn The structure of a deployAccount transaction.
the execution trace of a deploy account transaction.
No description provided by the author
DeployedContractItem A new contract deployed as part of the new state.
DeployTxn The structure of a deploy transaction.
No description provided by the author
No description provided by the author
No description provided by the author
EmittedEvent an event emitted as a result of transaction execution.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
FunctionCall function call information.
the execution trace of an invoke transaction.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
the execution trace of an L1 handler transaction.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
The dynamic block being constructed by the sequencer.
PENDING_STATE_UPDATE in spec.
Provider provides the provider for starknet.go/rpc implementation.
contracts whose class was replaced.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
The execution trace and consumed resources of the required transactions.
StateDiff is the change in state applied in this block, given as a mapping of addresses to the new values and/or new contracts.
STATE_UPDATE in spec.
No description provided by the author
No description provided by the author
SyncStatus is An object describing the node synchronization status.
A single pair of transaction hash and corresponding trace.
TransactionReceipt represents the common structure of a transaction receipt.
No description provided by the author
No description provided by the author
TxDetails contains details needed for computing transaction hashes.
https://github.com/starkware-libs/starknet-specs/blob/a789ccc3432c57777beceaa53a34a7ae2f25fda0/api/starknet_api_openrpc.json#L1252.
No description provided by the author
No description provided by the author
No description provided by the author

# Interfaces

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
go:generate mockgen -destination=../mocks/mock_rpc_provider.go -package=mocks -source=provider.go api.
No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
An integer number in hex format (0x...).
No description provided by the author
No description provided by the author
No description provided by the author
string must be NUM_AS_HEX.
No description provided by the author
No description provided by the author
No description provided by the author
64 bit integers, represented by hex string of length at most 32.
64 bit integers, represented by hex string of length at most 16.