Documentation Index
Fetch the complete documentation index at: https://docs.cloud.coinbase.com/llms.txt
Use this file to discover all available pages before exploring further.
function createSpendPermission(options: CreateSpendPermissionOptions): Promise<CreateSpendPermissionResult>;
Creates a spend permission for the user’s EVM Smart Account.
Parameters
| Parameter | Type | Description |
|---|
options | CreateSpendPermissionOptions | The options for creating the spend permission. |
Returns
Promise<CreateSpendPermissionResult>
The result of the spend permission creation.
Example
const result = await createSpendPermission({
network: "base-sepolia",
spender: "0x5678...",
token: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", // ETH
allowance: "1000000000000000000", // 1 ETH in wei
period: 86400, // 24 hours
start: Math.floor(Date.now() / 1000),
end: Math.floor(Date.now() / 1000) + 86400 * 30, // 30 days from now
useCdpPaymaster: true
});