MCPcopy Index your code
hub / github.com/NethermindEth/starknet.go

github.com/NethermindEth/starknet.go @v0.17.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.17.1 ↗ · + Follow
1,763 symbols 5,907 edges 336 files 997 documented · 57% 2 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README
<img src="https://github.com/NethermindEth/starknet.go/raw/v0.17.1/docs/docs/public/starknetgo_vertical_dark.png" height="256">










<a href="https://pkg.go.dev/github.com/NethermindEth/starknet.go">
    <img src="https://pkg.go.dev/badge/github.com/NethermindEth/starknet.go.svg" alt="Go Reference">
</a>
<a href="https://github.com/nethermindeth/starknet.go/blob/main/LICENSE">
    <img src="https://img.shields.io/badge/license-MIT-black">
</a>
<a href="https://github.com/NethermindEth/starknet.go/actions/workflows/test_testnet.yml">
    <img src="https://github.com/NethermindEth/starknet.go/actions/workflows/test_testnet.yml/badge.svg" alt="Main tests">
</a>
<a href="https://github.com/NethermindEth/starknet.go/stargazers">
  <img src="https://img.shields.io/github/stars/nethermindeth/starknet.go?style=social"/>
</a>


Get the gopher Starkpilled

starknet.go will get your golang backends and WASM frontends to Starknet easily. With simple abstractions for the Starknet RPC, account management and common operations on the wallets. The package has excellent documentation for a smooth 0 to 1 experience.

🌟 Features

  • Seamless interaction with the Starknet RPC
  • Tight integration with Juno
  • Account management: Deploy accounts easily
  • Good concurrency support

Getting Started

Check here for some FAQ.

RPC

starknet.go RPC implements the Starknet RPC v0.9.0 spec

Method Implemented (*)
starknet_getBlockWithReceipts :heavy_check_mark:
starknet_getBlockWithTxHashes :heavy_check_mark:
starknet_getBlockWithTxs :heavy_check_mark:
starknet_getStateUpdate :heavy_check_mark:
starknet_getStorageAt :heavy_check_mark:
starknet_getTransactionByHash :heavy_check_mark:
starknet_getTransactionByBlockIdAndIndex :heavy_check_mark:
starknet_getTransactionReceipt :heavy_check_mark:
starknet_getTransactionStatus :heavy_check_mark:
starknet_getClass :heavy_check_mark:
starknet_getClassHashAt :heavy_check_mark:
starknet_getClassAt :heavy_check_mark:
starknet_getBlockTransactionCount :heavy_check_mark:
starknet_call :heavy_check_mark:
starknet_estimateFee :heavy_check_mark:
starknet_estimateMessageFee :heavy_check_mark:
starknet_blockNumber :heavy_check_mark:
starknet_blockHashAndNumber :heavy_check_mark:
starknet_chainId :heavy_check_mark:
starknet_syncing :heavy_check_mark:
starknet_getEvents :heavy_check_mark:
starknet_getNonce :heavy_check_mark:
starknet_addInvokeTransaction :heavy_check_mark:
starknet_addDeclareTransaction :heavy_check_mark:
starknet_addDeployAccountTransaction :heavy_check_mark:
starknet_traceTransaction :heavy_check_mark:
starknet_simulateTransaction :heavy_check_mark:
starknet_specVersion :heavy_check_mark:
starknet_traceBlockTransactions :heavy_check_mark:
starknet_getStorageProof :heavy_check_mark:
starknet_getMessagesStatus :heavy_check_mark:
starknet_getCompiledCasm :heavy_check_mark:

WebSocket Methods

Method Implemented (*)
starknet_subscribeEvents :heavy_check_mark:
starknet_subscribeNewHeads :heavy_check_mark:
starknet_subscribeNewTransactions :heavy_check_mark:
starknet_subscribeNewTransactionReceipts :heavy_check_mark:

Run Tests

go test -v ./...

Run RPC Tests

go test -v ./rpc -env [mainnet|devnet|testnet|mock]

Run Benchmarks

go test -bench=.

📖 License

This project is licensed under the MIT license.

See LICENSE for more information.

Happy coding! 🎉

Contributors ✨

Thanks goes to these wonderful people

Extension points exported contracts — how you extend this code

Error (Interface)
Error wraps RPC errors, which contain an error code in addition to the message. [10 implementers]
client/errors.go
Transaction (Interface)
Transaction is an interface that represents a Starknet transaction. It is used to provide a common interface for all tra [12 …
rpc/types_transaction_interfaces.go
RPCData (Interface)
RPCData is the interface that all error data types must implement [5 implementers]
client/rpcerr/error.go
ClientI (Interface)
ClientInt is an interface with some methods of the Client type with the purpose of being used to generate mock implement [4 …
client/client.go
RPCProvider (Interface)
go:generate mockgen -destination=../mocks/mock_rpc_provider.go -package=mocks -source=provider.go api [3 implementers]
rpc/provider.go
AccountInterface (Interface)
go:generate mockgen -destination=../mocks/mock_account.go -package=mocks -source=account.go AccountInterface [3 implementers]
account/account.go
ServerCodec (Interface)
ServerCodec implements reading, parsing and writing RPC messages for the server side of an RPC session. Implementations [2 …
client/types.go
Keystore (Interface)
(no doc) [4 implementers]
account/keystore.go

Core symbols most depended-on inside this repo

String
called by 228
client/handler.go
WithBlockTag
called by 137
rpc/block.go
New
called by 92
client/log/logger.go
RunTestOn
called by 86
internal/tests/tests.go
NewProvider
called by 86
rpc/provider.go
Error
called by 77
client/errors.go
Call
called by 68
rpc/provider.go
WithBlockNumber
called by 63
rpc/block.go

Shape

Function 733
Method 649
Struct 291
TypeAlias 53
Interface 34
FuncType 3

Languages

Go98%
TypeScript2%

Modules by API surface

mocks/mock_rpc_provider.go82 symbols
contracts/types_casm_class.go80 symbols
rpc/types_transaction_interfaces.go45 symbols
rpc/provider.go44 symbols
client/json.go42 symbols
client/client.go42 symbols
client/testservice_test.go36 symbols
rpc/mock_test.go34 symbols
mocks/mock_account.go34 symbols
paymaster/build_txn.go33 symbols
client/errors.go33 symbols
rpc/types_block.go32 symbols

Used by 2 indexed graphs manifest dependencies, hub-wide

For agents

$ claude mcp add starknet.go \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact