/caigo

Golang Library for StarkNet/Cairo - Dev Fork

Primary LanguageGoMIT LicenseMIT

Golang Library for StarkNet

Go Reference Go

Caigo is an MIT-licensed Go library for interacting with StarkNet.

Getting Started

Run Examples

starkcurve

cd examples/curve
go mod tidy
go run main.go

starknet contract

cd examples/contract
go mod tidy
go run main.go

starknet account

cd examples/account
go mod tidy
go run main.go

RPC

Caigo RPC implements the StarkNet RPC Spec:

Method Implemented (*)
starknet_getBlockByHash ✔️
starknet_getBlockByNumber ✔️
starknet_getTransactionByHash ✔️
starknet_getTransactionReceipt ✔️
starknet_getClass ✔️
starknet_getClassHashAt ✔️
starknet_getClassAt ✔️
starknet_call ✔️
starknet_blockNumber ✔️
starknet_chainId ✔️
starknet_syncing ✔️
starknet_getEvents ✔️
starknet_addInvokeTransaction ✔️
starknet_addDeployTransaction ✔️
starknet_addDeclareTransaction ✔️
starknet_estimateFee ✔️
starknet_getBlockTransactionCountByHash ✔️
starknet_getBlockTransactionCountByNumber ✔️
starknet_getTransactionByBlockNumberAndIndex ✔️
starknet_getTransactionByBlockHashAndIndex ✔️
starknet_getStorageAt ✔️
starknet_getNonce ✔️
starknet_getStateUpdate ✔️
*starknet_traceBlockTransactions
*starknet_traceTransaction

(*) some methods are not implemented because they are not yet available from eqlabs/pathfinder.

Run Tests

go test -v ./...

Run RPC Tests

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

Run Benchmarks

go test -bench=.

Compatibility and stability

Caigo is currently under active development and will under go breaking changes until the initial stable(v1.0.0) release. The example directories and *_test.go files should always be applicable for the latest commitment on the main branch. NOTE: examples and tests may be out of sync with tagged versions and pkg.go.dev documentation

Issues

If you find an issue/bug or have a feature request please submit an issue here Issues

Contributing

If you are looking to contribute, please head to the Contributing section.