MCPcopy Index your code
hub / github.com/Conflux-Chain/go-conflux-sdk

github.com/Conflux-Chain/go-conflux-sdk @v1.6.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.6.1 ↗ · + Follow
1,770 symbols 4,265 edges 142 files 1,042 documented · 59% updated 5d agov1.6.1 · 2026-01-13★ 388 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

License: GPL v3 Documentation Build Status GitHub go.mod Go version GitHub release (latest by date)

Conflux Golang API

The Conflux Golang API allows any Golang client to interact with a local or remote Conflux node based on JSON-RPC 2.0 protocol. With Conflux Golang API, users can easily manage accounts, send transactions, deploy smart contracts, and query blockchain information.

Please read the documentation for more.

And read the API documentation from here.

Install go-conflux-sdk

go get github.com/Conflux-Chain/go-conflux-sdk

You can also add the Conflux Golang API into the vendor folder.

govendor fetch github.com/Conflux-Chain/go-conflux-sdk

Use go-conflux-sdk

Create Client

usd sdk.NewClient to creat a client for interact with conflux-rust node, the sdk.ClientOption is for setting Account Manager keystore folder path and retry options.

client, err := sdk.NewClient("https://test.confluxrpc.com", sdk.ClientOption{
    KeystorePath: "../context/keystore",
})

Query RPC

epoch, err := client.GetEpochNumber()

Send Transaction

chainID, err := client.GetNetworkID()
if err!=nil {
    panic(err)
}

from, err :=client.AccountManger().GetDefault()
if err!=nil {
    panic(err)
}

utx, err := client.CreateUnsignedTransaction(*from, cfxaddress.MustNewFromHex("0x1cad0b19bb29d4674531d6f115237e16afce377d", chainID), types.NewBigInt(1), nil)
if err!=nil {
    panic(err)
}

txhash, err := client.SendTransaction(utx)

Interact With Smart Contract

The most simple way to interact with contract is generator contract binding by conflux-abigen, see details from here

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Method 1,018
Function 389
Struct 303
TypeAlias 43
Interface 15
FuncType 2

Languages

Go100%

Modules by API surface

interface.go155 symbols
contract_meta/standard_contract/erc777.go122 symbols
client.go110 symbols
contract_meta/standard_contract/erc721.go92 symbols
contract_meta/standard_contract/erc1155.go89 symbols
light/contract/LightNode.go68 symbols
contract_meta/standard_contract/erc20.go67 symbols
light/contract/LedgerInfo.go48 symbols
cfxclient/bulk/bulk_caller_cfx.go46 symbols
types/cfxaddress/address.go40 symbols
types/transaction.go32 symbols
types/trace.go30 symbols

For agents

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

⬇ download graph artifact

Ask about this repo answers extend the page