MultiversX SDK cookbook
Recipes for building on MultiversX with the JavaScript, TypeScript, and Rust SDKs. The 61 Project build checked recipes show a complete standalone project: package, TypeScript configuration, entrypoint, helpers, and required text assets. Full project files are collapsed so the task itself stays easy to scan. The 11 Reference pages are focused migrations, setup guidance, or Rust examples; they intentionally do not claim to be standalone projects.
CI reconstructs all 61 projects from the files on their pages, installs their exact dependencies, and runs each project's own build on Node 20.19.0. Titled TypeScript fences across the cookbook are also checked together in strict mode. The badges describe that artifact boundary; they are not hand-entered dated status claims.
Point your agent at the docs and let it read the recipes directly.
Agent or agentic engineer? Start here covers the machine-readable
surface (llms.txt) and how to wire the cookbook into an agentic workflow.
Start here5 recipes
The smallest working sdk-dapp v5 setup in a fresh Vite + React + TypeScript project. Compiles strict on the first try, with HTTPS dev built in.
A working Next.js 15 App Router starter with sdk-dapp v5. Client-only init wrapper, the real next.config.js, login button, account hook, compiles strict.
Wallet providers refuse to connect over plain HTTP. Set up trusted HTTPS for localhost using mkcert with Vite, Next.js, or framework-agnostic plain Node.
The canonical sdk-dapp v5 sign, send, and track flow. provider.signTransactions then TransactionManager.send and .track, with proper nonce handling.
Side-by-side v4 vs v5 diffs for every removed hook, component, and import path. The shortest viable upgrade path for an existing v4 dApp.
Accounts and signing15 recipes
Generate a BIP39 mnemonic with sdk-core and derive secret keys at several address indices, fully offline, with a determinism check and secrecy notes.
Build an sdk-core Account from a KeyPair, a raw secret key, or a mnemonic, fully offline, and learn which named constructors are sync versus async.
Save a wallet to an encrypted keystore and load it back with a password, for both secret-key and mnemonic keystores, with sdk-core. Fully offline.
Save a wallet to a PEM file and load it back via Account and UserPem with sdk-core. PEM is unencrypted and dev-only; fully offline, no network.
The sdk-core Address toolkit, bech32/hex conversion, raw public key, shard computation, isSmartContract, and the HRP. Fully offline, no network.
Read any address's nonce, balance, username, and guarded flag, plus its key-value storage, through a network provider. Verified live against mainnet.
Save key-value pairs in an account's on-chain storage with sdk-core's AccountController or AccountTransactionsFactory.
Fetch an account's nonce from the network once, then increment it locally for every transaction sent afterward in a batch, plus recovery from a nonce gap.
Sign a message with an account or secret key and verify it with a UserVerifier, fully offline, including proof the check fails on a tampered signature.
Sign a transaction offline with a raw secret key and verify it three ways with sdk-core, including tamper checks. No devnet, no broadcast.
Opt a transaction into hash signing with sdk-core, assert the version/options bits, and sign the hash correctly. Includes a real v15.4.1 signing trap.
Nominate a guardian for an account with SetGuardian via sdk-core's AccountController and AccountTransactionsFactory, payload verified on devnet.
Activate guardianship with GuardAccount and remove it with UnGuardAccount via sdk-core, including the guardian co-sign requirement, verified on devnet.
Turn any transaction into a guarded one with TransactionComputer.applyGuardian and co-sign it, asserting version, options, and guardian fields on devnet.
A sender who has no EGLD for gas, and a relayer who pays it, both signing the same transaction, devnet-verified, with V1/V2 deprecation flagged.
Network providers7 recipes
Construct an ApiNetworkProvider or ProxyNetworkProvider, tune clientName and timeout, or get one from an entrypoint. Both share one INetworkProvider interface.
Read the static network config (gas costs, shard count, round duration) and the live per-shard status (block nonce, epoch, round) via a network provider.
Fetch the latest block and a block by hash via ApiNetworkProvider, and a block by shard and nonce via ProxyNetworkProvider. Verified live against mainnet.
Block until an account matches a predicate you write with awaitAccountOnCondition, tuning the poll interval and timeout via AwaitingOptions.
Block until a transaction matches a predicate you write with awaitTransactionOnCondition, tuning the poll interval and timeout via AwaitingOptions.
Ask the network what a transaction would cost with estimateTransactionCost and what it would do with simulateTransaction, without ever broadcasting it.
Call any API or Proxy endpoint the typed provider methods do not cover, via doGetGeneric and doPostGeneric, for economics, stats, and a raw VM query.
Fetching data from the network1 recipe
Transactions4 recipes
Send a native EGLD transfer with sdk-core's TransfersController against DevnetEntrypoint, the backend/script pattern for when your own code holds the key.
Send a fungible ESDT token using sdk-core's TransfersController and the Token/TokenTransfer classes against DevnetEntrypoint, no browser required.
Send EGLD plus two or more ESDT/NFT/SFT tokens in one transaction with sdk-core's TransfersController, every field decoded against real devnet.
Track a transaction's live status via sdk-dapp's WebSocket-with-polling-fallback tracker and the pending/successful/failed hooks.
Tokens (ESDT / NFT / SFT)8 recipes
Issue a fungible ESDT token with sdk-core's TokenManagementController against DevnetEntrypoint, payload hand-verified against real devnet.
Issue an NFT collection and mint an NFT into it with sdk-core's TokenManagementController, every field hand-verified against real devnet.
Issue a semi-fungible (SFT) collection, create an SFT batch, then add and burn quantity with sdk-core's TokenManagementController on devnet.
Set and unset the local-mint, local-burn, and ESDT-transfer roles on a fungible ESDT with sdk-core, including a confirmed v15.4.1 unset-role bug.
Increase and decrease a fungible ESDT's circulating supply with ESDTLocalMint and ESDTLocalBurn via sdk-core, plus a real SDK method-name typo.
Freeze/unfreeze an account's token, pause/unpause globally, and wipe with sdk-core, includes the confirmed v15.4.1 wrong-receiver bug and its fix.
Read a token's definition, name, ticker, decimals, owner and property flags, for a fungible token and for an NFT or SFT collection. Verified live.
Read the tokens an account holds, all fungible ESDTs, all NFTs and SFTs, and one specific token balance, via a network provider. Verified live.
Wallets7 recipes
Every AccountType field explained, which ones are optional, how to format the balance correctly, and when to reach for useGetAccountInfo instead.
Configure UnlockPanelManager once at startup, then add a reusable connect and disconnect button that works with every registered wallet provider.
A dedicated single-provider login button using ProviderFactory directly, with real extension detection and no generic multi-provider picker UI.
A dedicated xPortal login button using ProviderFactory and WalletConnect v2 directly, including the QR-code anchor element and project ID setup.
A dedicated Ledger login button using ProviderFactory directly, including the anchor element the SDK renders its own device-connect and account-picker UI into.
How nativeAuth issues a bearer token on login, why loginExpiresAt is not the token's real expiry, and how LogoutManager schedules the warning toast and logout.
Four real bugs found while verifying cookbook recipes against installed sdk-dapp, plus the tsconfig flags and ESLint rules that catch them.
Migration3 recipes
The full-app version of the DappProvider removal, every file that touches it, including the session-restore state v4 quietly handled for you.
The same hook name still resolves in v5 but returns less data, silently. The easiest migration bug to miss because nothing forces a second look at it.
The v4 hook this migration is named for does not exist in the real package. What does exist is batch sends and a v5 nested-array trigger.
Governance2 recipes
Create a MultiversX governance proposal with sdk-core's GovernanceController and factory, reading the live proposal fee from getConfig first.
Vote on and close a MultiversX governance proposal with sdk-core's GovernanceController and factory, reading a live proposal's tallies first.
Delegation5 recipes
Create a new MultiversX delegation (staking-provider) contract with sdk-core DelegationController and factory, then parse the outcome for its address.
Delegate (stake) EGLD to an existing MultiversX delegation contract with sdk-core DelegationController and factory, then parse the staked amount.
Claim delegation rewards to your wallet or re-delegate (compound) them into the same MultiversX staking contract, with sdk-core DelegationController.
Exit a MultiversX delegation: unDelegate an amount, wait out the unbonding period, then withdraw it, using sdk-core DelegationController and factory.
Read a MultiversX staking-provider contract state with read-only queries: total stake, service fee, a delegator active stake and claimable rewards.
Multisig4 recipes
Deploy a MultiversX multisig smart contract with the SDK JS v15 MultisigController or MultisigTransactionsFactory.
Propose a multisig action, a transfer-execute or an add-board-member, with sdk-core's MultisigController and factory, then parse the new action id.
Sign a proposed multisig action to quorum and perform it with sdk-core's MultisigController and factory, reading its live signer state first.
Read a MultiversX multisig's quorum, board members, and pending actions with their signers using sdk-core's MultisigController, no wallet needed.
Smart contracts (call & query)6 recipes
Load a contract's ABI from a file, a URL, or by hand with sdk-core's Abi/AbiRegistry, then introspect its endpoints and argument types.
Query a smart contract's read-only view with sdk-core's SmartContractController, no wallet, no gas, no transaction, verified against live devnet.
Call a mutable contract endpoint with plain JS arguments, auto-converted to typed values by sdk-core's NativeSerializer, verified against live devnet.
Call a payable contract endpoint, attaching EGLD via nativeTransferAmount, against a real live devnet contract with sdk-core's controller pattern.
Decode raw contract return data and encode or decode custom struct and enum types with sdk-core's BinaryCodec, getStruct, and getEnum, fully offline.
Decode a smart contract's emitted events into named typed fields with sdk-core's TransactionEventsParser and an ABI, verified against a real event.
Smart contracts (deploy & upgrade)3 recipes
Predict a smart contract's address before deploying it from the deployer address and deployment nonce with sdk-core's AddressComputer, fully offline.
Deploy a smart contract from WASM bytecode and constructor arguments with sdk-core's controller and factory, then parse the outcome for the new address.
Upgrade a deployed smart contract to new WASM bytecode with sdk-core's controller and factory, and read the upgradeContract builtin wire payload.
Smart contracts (Rust authoring)2 recipes
An authoring-time walkthrough of sc-meta new --template empty and a minimal customization, manually verified when written but not continuously built in CI.
A contract exercising six storage mappers side by side, manually verified when written but not continuously built in CI, with a source-grounded decision table.
72 recipes across 14 sections: 61 standalone projects reconstructed and built in CI, plus 11 focused reference pages. Card badges state which artifact the page contains.