Skip to main content
This page documents every method available on the TransactionBuilder. To start a transaction:

Token Operations

Sends NEAR tokens from the signer to the receiver.
string
required
The account receiving the tokens.
Amount
required
The amount to send (e.g. "10 NEAR", "0.5 NEAR", "1000 yocto").
Stakes NEAR with a validator.
string
required
The validator’s public key.
Amount
required
The amount to stake.

Contract Operations

Calls a method on a smart contract.
string
required
The contract account ID.
string
required
The method to call.
object | Uint8Array
Arguments. Objects are automatically JSON serialized.
object
Deploys Wasm code to an account. If the account already has a contract, it will be updated.
string
required
The account to deploy to.
Uint8Array
required
The raw bytes of the compiled Wasm file.
Deploys a contract to a deterministic account ID (NEP-616). The address is auto-derived from the initialization state. Idempotent—refunds if already deployed.
object
required
object
See Global Contracts for more details.

Account Management

Creates a new account. This is often chained with .transfer (to fund it) and .addKey (to secure it).
string
required
The full ID of the new account (must be a sub-account of the signer).
Deletes the transaction receiver’s account and sends all remaining funds to the beneficiary.
string
required
The account that receives the remaining NEAR balance.

Access Keys

Adds a new access key to the account.
string
required
The public key to add (ed25519 or secp256k1).
AccessKeyPermission
required
One of:
  • { type: "fullAccess" } - Can do anything.
  • { type: "functionCall", receiverId, methodNames?, allowance? } - Restricted to specific contracts/methods.
Removes an access key.
string
required
The account to remove the key from.
string
required
The public key to remove.

Global Contracts

Publishes contract code to the global registry so others can deploy it by reference.
Uint8Array
required
The Wasm bytes.
object
Deploys contract code that was previously published to the registry. This saves gas by avoiding uploading the full Wasm bytes.
object
required
One of:
  • { accountId: string } - Account ID of the publisher (for updatable contracts)
  • { codeHash: string } - Base58 hash of an immutable contract

Advanced / Meta-Transactions

Instead of sending the transaction, this method signs it and returns a SignedDelegateAction payload. This is used for meta-transactions where a relayer pays the gas.
object
Returns: { signedDelegateAction, payload, format }
Adds a pre-signed delegate action to this transaction. Used by relayers to submit a user’s action.
SignedDelegateAction
required
The signed delegate action from the user.
Overrides the signer for this specific transaction. Does not change the global Near configuration.
string | Signer
required
A private key string OR a custom signer function.