Documentation Index Fetch the complete documentation index at: https://docs.mandate.md/llms.txt
Use this file to discover all available pages before exploring further.
Every type listed here is exported from @mandate.md/sdk:
import type {
MandateConfig ,
MandateWalletConfig ,
PreflightPayload ,
PreflightResult ,
ValidateResult ,
IntentPayload ,
IntentStatus ,
RegisterResult ,
ExternalSigner ,
TransferResult ,
} from '@mandate.md/sdk' ;
MandateConfig
Base configuration for MandateClient. Pass your runtime key and an optional custom API URL.
interface MandateConfig {
runtimeKey : string ;
baseUrl ?: string ;
}
Field Type Required Description runtimeKeystringYes Your mndt_live_... or mndt_test_... runtime key baseUrlstringNo Mandate API URL. Defaults to https://app.mandate.md
MandateWalletConfig
Configuration for MandateWallet. Extends MandateConfig with chain and signer options. You must provide either privateKey or signer, not both.
interface MandateWalletConfig extends MandateConfig {
chainId : number ;
privateKey ?: `0x ${ string } ` ;
signer ?: ExternalSigner ;
rpcUrl ?: string ;
}
Field Type Required Description chainIdnumberYes Target chain ID (e.g. 84532 for Base Sepolia, 8453 for Base) privateKey`0x${string}`No Raw hex private key. Use this for simple setups. signerExternalSignerNo External wallet adapter. Use this for AgentKit, Privy, or custom signers. rpcUrlstringNo Custom RPC endpoint. Defaults to Base Sepolia/Base public RPCs.
PreflightPayload
Input for the action-based validate() method on MandateClient. Describes the intended action in human-readable terms.
interface PreflightPayload {
action : string ;
amount ?: string ;
to ?: string ;
token ?: string ;
reason : string ;
chain ?: string ;
}
Field Type Required Description actionstringYes Action type (e.g. "transfer", "swap", "approve") amountstringNo Human-readable amount (e.g. "5.00") tostringNo Destination address tokenstringNo Token symbol or address (e.g. "USDC") reasonstringYes Why the agent wants to perform this action chainstringNo Chain name or ID (e.g. "base-sepolia")
PreflightResult
Response from validate(). Extends ValidateResult with the action field echoed back.
interface PreflightResult extends ValidateResult {
action : string ;
}
Field Type Description allowedbooleanWhether the action is permitted intentIdstring | nullIntent ID if a reservation was created requiresApprovalbooleanWhether human approval is needed approvalIdstring | nullApproval request ID, if applicable approvalReasonstring | nullWhy approval is required blockReasonstring | nullReason code if blocked blockDetailstring | nullAdditional detail about the block actionstringThe action that was evaluated
ValidateResult
Response from rawValidate(). Contains the policy decision and intent metadata.
interface ValidateResult {
allowed : boolean ;
intentId : string | null ;
requiresApproval : boolean ;
approvalId : string | null ;
approvalReason ?: string | null ;
blockReason : string | null ;
blockDetail ?: string | null ;
}
Field Type Description allowedbooleanWhether the transaction is permitted intentIdstring | nullIntent ID for tracking. null if blocked. requiresApprovalbooleanWhether human approval is needed before proceeding approvalIdstring | nullApproval request ID for polling approvalReasonstring | nullHuman-readable reason for requiring approval blockReasonstring | nullMachine-readable block reason (e.g. spend_limit_exceeded) blockDetailstring | nullAdditional context from the policy engine
IntentPayload
Full transaction parameters for rawValidate(). Used in self-custodial signing flows where you compute gas parameters yourself.
interface IntentPayload {
chainId : number ;
nonce : number ;
to : `0x ${ string } ` ;
calldata : `0x ${ string } ` ;
valueWei : string ;
gasLimit : string ;
maxFeePerGas : string ;
maxPriorityFeePerGas : string ;
txType ?: number ;
accessList ?: unknown [];
intentHash : `0x ${ string } ` ;
reason : string ;
}
Field Type Required Description chainIdnumberYes Target chain ID noncenumberYes Sender’s transaction nonce to`0x${string}`Yes Destination address calldata`0x${string}`Yes Encoded transaction data (0x for native transfers) valueWeistringYes Native token value in wei gasLimitstringYes Gas limit maxFeePerGasstringYes EIP-1559 max fee per gas maxPriorityFeePerGasstringYes EIP-1559 priority fee per gas txTypenumberNo Transaction type. Defaults to 2 (EIP-1559). accessListunknown[]No EIP-2930 access list. Defaults to []. intentHash`0x${string}`Yes Keccak256 hash of canonical tx params. See Intent Hash . reasonstringYes Why the agent is making this transaction
IntentStatus
Status of a tracked intent. Returned by getStatus(), waitForApproval(), and waitForConfirmation().
interface IntentStatus {
intentId : string ;
status : 'reserved' | 'approval_pending' | 'approved' | 'broadcasted' | 'confirmed' | 'failed' | 'expired' ;
txHash : string | null ;
blockNumber : string | null ;
gasUsed : string | null ;
amountUsd : string | null ;
decodedAction : string | null ;
summary : string | null ;
blockReason : string | null ;
requiresApproval : boolean ;
approvalId : string | null ;
expiresAt : string | null ;
}
Field Type Description intentIdstringUnique intent identifier statusstringCurrent state: reserved, approval_pending, approved, broadcasted, confirmed, failed, or expired txHashstring | nullOn-chain transaction hash (set after broadcast) blockNumberstring | nullBlock number where tx was confirmed gasUsedstring | nullActual gas consumed amountUsdstring | nullUSD value of the transaction decodedActionstring | nullHuman-readable decoded action (e.g. "transfer 5 USDC") summarystring | nullOne-line summary of the transaction blockReasonstring | nullReason if the intent was blocked or failed requiresApprovalbooleanWhether approval is still pending approvalIdstring | nullApproval request ID expiresAtstring | nullISO 8601 expiration timestamp for approval window
RegisterResult
Response from MandateClient.register(). Contains credentials for the newly registered agent.
interface RegisterResult {
agentId : string ;
runtimeKey : string ;
claimUrl : string ;
evmAddress : string ;
chainId : number ;
}
Field Type Description agentIdstringUnique agent identifier runtimeKeystringRuntime key (mndt_live_... or mndt_test_...) for API auth claimUrlstringURL for the agent owner to claim and link the agent to their dashboard evmAddressstringThe agent’s EVM wallet address chainIdnumberThe chain the agent registered on
ExternalSigner
Interface for plugging in any wallet that can send transactions. Implement this to use AgentKit, Privy, or any custom wallet with MandateWallet.
interface ExternalSigner {
sendTransaction ( tx : {
to : `0x ${ string } ` ;
data : `0x ${ string } ` ;
value : bigint ;
gas : bigint ;
maxFeePerGas ?: bigint ;
maxPriorityFeePerGas ?: bigint ;
nonce ?: number ;
}) : Promise < `0x ${ string } ` >;
getAddress () : Promise < `0x ${ string } ` > | `0x ${ string } ` ;
}
Method Returns Description sendTransaction(tx)Promise<\0x$`>`Sign and broadcast the transaction. Return the tx hash. getAddress()Promise<\0x$`> | `0x$“Return the wallet address. Can be sync or async.
The tx object passed to sendTransaction contains all fields needed for an EIP-1559 transaction. maxFeePerGas, maxPriorityFeePerGas, and nonce are optional because some signers manage these internally.
TransferResult
Returned by MandateWallet.transfer(), sendTransaction(), and related methods. Contains the transaction hash, intent ID, and final status.
interface TransferResult {
txHash : Hash ;
intentId : string ;
status : IntentStatus ;
}
Field Type Description txHashHashOn-chain transaction hash (viem Hash type, which is `0x${string}`) intentIdstringMandate intent ID for audit trail and status polling statusIntentStatusFinal intent status after broadcast and optional confirmation wait
MandateClient Low-level API client that uses these types.
MandateWallet High-level wallet wrapper with signing and broadcasting.
Errors Error classes thrown when validation fails.