Documentation Index
Fetch the complete documentation index at: https://mintlify.com/near/near-api-ts/llms.txt
Use this file to discover all available pages before exploring further.
Overview
TheMemorySigner provides an easy way to sign and execute transactions on NEAR. It manages access keys, nonces, and transaction signing automatically.
Creating a MemorySigner
createMemorySigner()
Creates a new memory-based signer instance.
Parameters
The account ID that will sign transactions
NEAR client instance for RPC communication
Key service that manages cryptographic keys
Configuration for the key pool
Configuration for the task queue
Returns
AMemorySigner object with the following properties:
signerAccountId- The account ID of the signerclient- The NEAR client instancekeyService- The key service instancesignTransaction()- Signs a transaction (throws on error)executeTransaction()- Signs and executes a transaction (throws on error)safeSignTransaction()- Signs a transaction (returns Result)safeExecuteTransaction()- Signs and executes a transaction (returns Result)
Factory Pattern
Create a factory function to generate signers for multiple accounts:Complete Example
Error Handling
The signer provides both throwing and safe (Result-based) variants:Common Errors
CreateMemorySigner.Args.InvalidSchema- Invalid arguments providedCreateMemorySigner.Internal- Internal error during signer creation
See Also
- executeTransaction - Execute transactions
- Action Creators - Available action types
- MemoryKeyService - Key management