com um clique
mvx-sdk-go-builders
Transaction construction and signing using Builders in Go SDK.
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Menu
Transaction construction and signing using Builders in Go SDK.
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Baseado na classificação ocupacional SOC
Guidelines for establishing context before an audit.
Perform a comprehensive on-chain security audit of a deployed MultiversX smart contract. Use when reviewing a contract's security posture, permissions, state, and economic safety without source code.
Read on-chain state in MultiversX smart contracts. Use when accessing caller info, account balances, block timestamps, ESDT token metadata, local roles, code metadata, or any data from self.blockchain().
Gas-optimized cache patterns for MultiversX smart contracts using Drop-based write-back caches. Use when building contracts that read/write multiple storage values per transaction, DeFi protocols, or any gas-sensitive contract.
Identify ambiguous requirements and ask targeted clarifying questions for MultiversX development. Use when user requests are vague, missing technical constraints, or have conflicting requirements.
Comprehensive code analysis toolkit for MultiversX smart contracts. Covers differential review (version comparison, upgrade safety), fix verification (validate patches, regression testing), and variant analysis (find similar bugs across codebase). Use when reviewing PRs, verifying security patches, or hunting for bug variants.
| name | mvx-sdk-go-builders |
| description | Transaction construction and signing using Builders in Go SDK. |
Using TxBuilder to construct and sign transactions.
import (
"github.com/multiversx/mx-sdk-go/builders"
"github.com/multiversx/mx-sdk-go/core"
"github.com/multiversx/mx-sdk-go/data"
)
// Initialize
txBuilder, err := builders.NewTxBuilder(core.Marshalizer)
// Manual Transaction Construction
tx := &data.Transaction{
Nonce: nonce,
Value: "1000000000000000000", // 1 EGLD
RcvAddr: receiverAddressString,
SndAddr: senderAddressString,
GasPrice: 1000000000,
GasLimit: 50000,
Data: []byte("memo"),
ChainID: "D",
Version: 1,
}
// Sign Transaction
err = txBuilder.ApplySignature(tx, privateKey)
// tx.Signature, tx.SenderUsername are updated
There are specific builders for SC interactions (often generated code or custom implementations), but the core pattern is:
data.Transaction structTxBuilderESDT transfers require specific data fields.
// Native EGLD
tx.Value = "1000000000000000000"
tx.Data = []byte("")
// ESDT Transfer
// Function: ESDTTransfer
// Args: TokenIdentifier (hex), Amount (hex)
tx.Value = "0"
tx.Data = []byte("ESDTTransfer@" + hexTokenId + "@" + hexAmount)
Constructing the inner transaction for a relayed call.
// Inner Tx (User)
innerTx := &data.Transaction{...}
// Sign Inner Tx
signature, _ := userPrivateKey.Sign(innerTxBytes)
// Relayer Tx
relayerTx := &data.Transaction{
Sender: relayerAddress,
Data: []byte("relayedTx@" + innerTxBytesHex + "@" + signatureHex),
...
}
The SDK uses a Marshalizer interface (usually JSON).
import "github.com/multiversx/mx-sdk-go/core"
bytes, err := core.Marshalizer.Marshal(tx)
Value field