Overview
executeTransaction() is a method on MemorySigner that signs a transaction and sends it to the NEAR blockchain in a single operation. It automatically handles nonce management, block hash retrieval, and transaction signing.
Signature
Parameters
The transaction intent containing the receiver and action(s)
Returns
Returns aPromise that resolves to SendSignedTransactionOutput:
transactionHash- The hash of the transactionsignedTransaction- The signed transaction objectresult- The transaction execution result from the RPC
Single Action Example
Multiple Actions Example
Function Call Example
Deploy Contract Example
Error Handling
Throwing Variant
Safe Variant
For explicit error handling, usesafeExecuteTransaction():
Common Errors
Validation Errors
MemorySigner.ExecuteTransaction.Args.InvalidSchema- Invalid transaction intent format
Key Management Errors
MemorySigner.ExecuteTransaction.KeyPool.AccessKeys.NotLoaded- Access keys not loaded from blockchainMemorySigner.ExecuteTransaction.KeyPool.Empty- No keys available in the key poolMemorySigner.ExecuteTransaction.KeyPool.SigningKey.NotFound- No key with required permissions found
Network Errors
MemorySigner.ExecuteTransaction.PreferredRpc.NotFound- No RPC endpoint availableMemorySigner.ExecuteTransaction.Timeout- Request timed outMemorySigner.ExecuteTransaction.Aborted- Request was abortedMemorySigner.ExecuteTransaction.Exhausted- All RPC endpoints failed
Transaction Errors
MemorySigner.ExecuteTransaction.Rpc.Transaction.Signer.Balance.TooLow- Insufficient account balanceMemorySigner.ExecuteTransaction.Rpc.Transaction.Receiver.NotFound- Receiver account doesn’t existMemorySigner.ExecuteTransaction.Rpc.Transaction.Timeout- Transaction timed out on chain
Action-Specific Errors
MemorySigner.ExecuteTransaction.Rpc.Transaction.Action.CreateAccount.AlreadyExist- Account already existsMemorySigner.ExecuteTransaction.Rpc.Transaction.Action.Stake.BelowThreshold- Stake amount below minimumMemorySigner.ExecuteTransaction.Rpc.Transaction.Action.Stake.Balance.TooLow- Insufficient balance for stakingMemorySigner.ExecuteTransaction.Rpc.Transaction.Action.Stake.NotFound- Validator not found
Internal Errors
MemorySigner.ExecuteTransaction.Internal- Unexpected internal error
Transaction Options
You can customize transaction behavior with options:See Also
- MemorySigner - Signer setup and configuration
- Transfer Action - Send NEAR tokens
- Function Call Action - Call smart contract methods
- Deploy Contract Action - Deploy smart contracts