Skip to content

ava-labs/avalanche-tooling-sdk-go

Repository files navigation

Avalanche Tooling Go SDK

⚠️ Maintenance Mode Notice

As of December 2025, Avalanche Tooling Go SDK has entered maintenance mode. This means:

  • No new features will be developed by the Ava Labs team
  • GitHub issues are expected to be addressed by community members

External contributions are very much welcome! PRs will be reviewed but may not be prioritized. We encourage the community to continue building and improving this project.

Getting Started

Installing

Use go get to retrieve the SDK to add it to your project's Go module dependencies.

go get github.com/ava-labs/avalanche-tooling-sdk-go

To update the SDK use go get -u to retrieve the latest version of the SDK.

go get -u github.com/ava-labs/avalanche-tooling-sdk-go

Wallet Interface

The SDK provides a Wallet interface for interacting with Avalanche networks. local.LocalWallet is its main implementation.

// Create a wallet for Fuji testnet
w, err := local.NewLocalWallet(logger, network.FujiNetwork())

// Import an account from private key
acc, _ := account.ImportFromPrivateKey("myaccount", privateKey)
w.ImportAccount(acc)

// P-Chain operations (create subnet, add validators, etc.)
result, err := w.Primary().SubmitTx(ctx, types.SubmitTxParams{
    BuildTxInput: &pchainTxs.CreateSubnetTxParams{
        ControlKeys: []string{controlKeyAddress},
        Threshold:   1,
    },
})

// EVM operations on any chain
w.SetChain("https://my-l1.example.com/rpc")  // use "C" for C-Chain
balance, err := w.Balance()
method := wallet.Method("transfer(address,uint256)->(bool)", common.HexToAddress(to), amount)
tx, receipt, err := w.WriteContract(contractAddr, nil, method)

See wallet/wallet.go for the full interface definition.

Examples

P-Chain Operations

EVM Operations

Avalanchego Keychains

The SDK supports different keychain implementations for signing transactions:

  • Ledger - Hardware wallet integration for secure key management
  • CubeSigner - Cloud-based key management service

Examples

Ledger Integration

CubeSigner Integration

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 5