home / skills / multiversx / mx-ai-skills / mvx_sdk_go_interactors
This skill simplifies blockchain integration in Go by providing wallet management, nonce handling, and transaction interactor utilities for secure key handling
npx playbooks add skill multiversx/mx-ai-skills --skill mvx_sdk_go_interactorsReview the files below or copy the command above to add this skill to your agents.
---
name: mvx_sdk_go_interactors
description: Components for interacting with the blockchain (Wallets, Transaction Interactors, Nonce Handlers) in Go.
---
# MultiversX SDK-Go Interactors
## Wallet Management
Loading keys and addresses.
```go
import "github.com/multiversx/mx-sdk-go/interactors"
wallet := interactors.NewWallet()
// Load PEM
privateKey, err := wallet.LoadPrivateKeyFromPemFile("wallet.pem")
// Load Keystore
privateKey, err := wallet.LoadPrivateKeyFromKeystoreFile("wallet.json", "password")
// Get Address
address, err := wallet.GetAddressFromPrivateKey(privateKey)
bech32Address := address.AddressAsBech32String()
```
## Transaction Nonce Handler (V3)
Automatically fetches and increments nonces. Recommended way to manage nonces.
```go
import "github.com/multiversx/mx-sdk-go/interactors/nonceHandlerV3"
// Initialize Handler
args := nonceHandlerV3.ArgsAddressNonceHandler{
Proxy: proxy,
Address: address,
}
handler, err := nonceHandlerV3.NewAddressNonceHandler(args)
// Fetch Initial Nonce
nonce, err := handler.GetNonce(ctx)
// Apply Nonce to Transaction & Increment
handler.ApplyNonceAndGasPrice(tx) // Sets tx.Nonce = current, then increments internal counter
```
## Transaction Interactor
High-level wrapper for sending transactions.
```go
import "github.com/multiversx/mx-sdk-go/interactors"
// Setup
txInteractor, err := interactors.NewTransactionInteractor(proxy, txBuilder)
// Send Transaction
txHash, err := txInteractor.SendTransaction(ctx, tx, privateKey)
// Send Multiple Transactions
txHashes, err := txInteractor.SendTransactions(ctx, txs, privateKey)
```
## Creating a Wallet Instance
```go
// Helper to create new keypair
privateKey, publicKey := wallet.GeneratePrivateKey()
```
## Best Practices
1. **Use NonceHandlerV3** for robust nonce management, especially in concurrent environments
2. **Use TransactionInteractor** to simplify signing + sending flow
3. **Secure Key Management** - avoid hardcoding private keys
This skill provides Go components for interacting with the MultiversX blockchain: wallet utilities, transaction interactors, and nonce handlers. It bundles secure key loading and generation, a robust nonce handler (V3) for concurrent scenarios, and a high-level transaction interactor to sign and send transactions. The focus is on simplifying common blockchain tasks while encouraging safe key and nonce management.
The wallet component loads private keys from PEM or keystore files, generates keypairs, and derives addresses in Bech32 format. The nonce handler (V3) fetches the current on-chain nonce for an address, maintains an internal counter, and can apply and increment nonces to transactions to avoid collisions. The transaction interactor wraps signing and network submission, supporting single or batch sends and returning transaction hashes.
How do I avoid nonce collisions when sending many transactions?
Use the NonceHandlerV3: it fetches the current on-chain nonce, applies it to each transaction, and increments an internal counter to prevent reuse.
Can I load keys from keystore files securely?
Yes. Load encrypted keystore files with the wallet loader and provide the password; avoid storing passwords or keys in source code.