Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

github.com/rianhughes/starknet.go

Package Overview
Dependencies
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/rianhughes/starknet.go

Source
Go Modules
Version
v0.4.1
Version published
Created
Source

Golang Library for StarkNet

Go Reference test

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

Getting Started

  • library documentation available at pkg.go.dev.
  • curve example initializing the StarkCurve for signing and verification
  • contract example for smart contract deployment and function call
  • account example for Account initialization and invocation call

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:

MethodImplemented (*)
starknet_getBlockByHash:heavy_check_mark:
starknet_getBlockByNumber:heavy_check_mark:
starknet_getTransactionByHash:heavy_check_mark:
starknet_getTransactionReceipt:heavy_check_mark:
starknet_getClass:heavy_check_mark:
starknet_getClassHashAt:heavy_check_mark:
starknet_getClassAt:heavy_check_mark:
starknet_call:heavy_check_mark:
starknet_blockNumber:heavy_check_mark:
starknet_chainId:heavy_check_mark:
starknet_syncing:heavy_check_mark:
starknet_getEvents:heavy_check_mark:
starknet_addInvokeTransaction:heavy_check_mark:
starknet_addDeployTransaction:heavy_check_mark:
starknet_addDeclareTransaction:heavy_check_mark:
starknet_estimateFee:heavy_check_mark:
starknet_getBlockTransactionCountByHash:heavy_check_mark:
starknet_getBlockTransactionCountByNumber:heavy_check_mark:
starknet_getTransactionByBlockNumberAndIndex:heavy_check_mark:
starknet_getTransactionByBlockHashAndIndex:heavy_check_mark:
starknet_getStorageAt:heavy_check_mark:
starknet_getNonce:heavy_check_mark:
starknet_getStateUpdate:heavy_check_mark:
*starknet_traceBlockTransactions:x:
*starknet_traceTransaction:x:

(*) 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.

FAQs

Package last updated on 24 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts