The Wallet class is the base class for all wallet types. It provides common functionality for balance queries, transactions, delegated signers, and more.
Properties
The blockchain network this wallet operates on
The wallet’s address on the blockchain
Optional owner identifier
The signer used for authentication and signing
Balance Methods
balances()
Get the wallet balances including native token, USDC, and optionally other tokens.
public async balances ( tokens ?: string []): Promise < Balances < C >>
Additional token addresses to query (native token and USDC are always included)
The wallet balances Native token balance (ETH, SOL, XLM) Formatted amount (decimal units)
Raw amount (smallest unit)
Additional token balances
Example
const balances = await wallet . balances ([
"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" // Additional token
]);
console . log ( "ETH Balance:" , balances . nativeToken . amount );
console . log ( "USDC Balance:" , balances . usdc . amount );
console . log ( "Other tokens:" , balances . tokens );
stagingFund()
Fund the wallet with Crossmint’s stablecoin (USDXM). Note: This method is only available in staging environments.
public async stagingFund (
amount : number ,
chain ?: Chain
): Promise < FundWalletResponse >
The amount of USDXM to fund the wallet with
Optional chain to fund on. If not provided, uses the wallet’s default chain
Example
const fundResponse = await wallet . stagingFund ( 100 );
console . log ( "Wallet funded:" , fundResponse );
Transaction Methods
send()
Send tokens to a wallet address or user locator.
public async send < T extends SendTokenTransactionOptions | undefined = undefined > (
to : string | UserLocator ,
token : string ,
amount : string ,
options ?: T
): Promise < Transaction < T extends PrepareOnly < true > ? true : false >>
to
string | UserLocator
required
Recipient wallet address or user locator (email, phone, etc.) Phone number: { phone: "+1234567890" }
X/Twitter handle: { x: "@username" }
User ID: { userId: "user123" }
Token contract address or currency symbol (e.g., “usdc”, “eth”)
Amount to send in decimal units (e.g., “1.5” for 1.5 tokens)
options
SendTokenTransactionOptions
Transaction options If true, returns transaction ID without auto-approving
transactionType
'onramp' | 'regulated-transfer' | 'direct'
Transaction type for compliance
The transaction result Transaction hash (undefined if prepareOnly)
Block explorer link (undefined if prepareOnly)
Example
// Send to wallet address
const tx = await wallet . send (
"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb" ,
"usdc" ,
"10.50"
);
console . log ( "Transaction hash:" , tx . hash );
console . log ( "Explorer:" , tx . explorerLink );
// Send to email
const tx2 = await wallet . send (
{ email: "[email protected] " },
"usdc" ,
"5.0"
);
// Prepare only (don't auto-approve)
const tx3 = await wallet . send (
"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb" ,
"usdc" ,
"10.50" ,
{ experimental_prepareOnly: true }
);
console . log ( "Transaction ID:" , tx3 . transactionId );
// Later: await wallet.approve({ transactionId: tx3.transactionId });
approve()
Approve a transaction or signature that is awaiting approval.
public async approve < T extends ApproveParams > (
params : T
): Promise < ApproveResult < T >>
Approval parameters Transaction ID to approve (either this or signatureId required)
Signature ID to approve (either this or transactionId required)
Approval options External approval signature
Additional signers for multi-sig wallets
The approved transaction or signature result
Example
// Approve a transaction
const result = await wallet . approve ({
transactionId: "tx_123abc"
});
console . log ( "Transaction hash:" , result . hash );
// Approve a signature
const sigResult = await wallet . approve ({
signatureId: "sig_456def"
});
console . log ( "Signature:" , sigResult . signature );
Delegated Signers
addDelegatedSigner()
Add a delegated signer to the wallet for gasless transactions or multi-sig.
public async addDelegatedSigner < T extends AddDelegatedSignerOptions | undefined = undefined >( params : {
signer : string | RegisterSignerPasskeyParams ;
options ?: T ;
}) : Promise < T extends PrepareOnly < true > ? AddDelegatedSignerReturnType < C > : void >
signer
string | RegisterSignerPasskeyParams
required
For Solana: wallet address string. For EVM: wallet address or passkey configuration
options
AddDelegatedSignerOptions
If true, returns transaction/signature ID without auto-approving
result
void | AddDelegatedSignerReturnType<C>
Returns void if approved, or transaction/signature ID if prepareOnly
Example
// Add delegated signer (auto-approve)
await wallet . addDelegatedSigner ({
signer: "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
});
// Add delegated signer (prepare only)
const result = await wallet . addDelegatedSigner ({
signer: "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb" ,
options: { experimental_prepareOnly: true }
});
// For Solana, returns transactionId
if ( 'transactionId' in result ) {
await wallet . approve ({ transactionId: result . transactionId });
}
// For EVM, returns signatureId
if ( 'signatureId' in result ) {
await wallet . approve ({ signatureId: result . signatureId });
}
delegatedSigners()
List all delegated signers for this wallet.
public async delegatedSigners (): Promise < DelegatedSigner [] >
Array of delegated signers Signer locator in format external-wallet:address
Example
const signers = await wallet . delegatedSigners ();
console . log ( "Delegated signers:" , signers );
// [{ signer: "external-wallet:0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb" }]
Experimental Methods
experimental_apiClient()
Get the underlying API client.
public experimental_apiClient (): ApiClient
experimental_nfts()
Get NFTs owned by the wallet.
public async experimental_nfts ( params : {
perPage: number ;
page : number ;
}): Promise < NftsResponse >
Example
const nfts = await wallet . experimental_nfts ({
perPage: 20 ,
page: 0
});
experimental_transactions()
Get all transactions for this wallet.
public async experimental_transactions (): Promise < GetTransactionsResponse >
Example
const transactions = await wallet . experimental_transactions ();
console . log ( "Transaction history:" , transactions );
experimental_transaction()
Get a specific transaction by ID.
public async experimental_transaction (
transactionId : string
): Promise < GetTransactionSuccessResponse >
transaction
GetTransactionSuccessResponse
The transaction details
Example
const transaction = await wallet . experimental_transaction ( "tx_123abc" );
console . log ( "Transaction:" , transaction );
experimental_activity()
Get wallet activity (transactions, transfers, etc.).
public async experimental_activity (): Promise < Activity >
Example
const activity = await wallet . experimental_activity ();
console . log ( "Wallet activity:" , activity );