spender
field of the Spend Permission. It can be the address of any account, whether it’s a Smart Account or a regular account.
token
field of the Spend Permission, and the amount allowed to spend is specified in the allowance
field.
Spend Permissions support both native tokens and ERC-20 tokens. When using the CDP SDK, you have two options for specifying tokens:
"eth"
for native ETH or "usdc"
for USDC, and the SDK will handle the conversion to the correct token address. This shortcut is only supported on Base or Base Sepolia."0x4200000000000000000000000000000000000006"
for WETH).allowance
field, using the smallest unit of the token. For example, if the token is ETH, the allowance is specified in wei, and if the token is USDC, the allowance is specified in the smallest unit of USDC (6 decimals).
periodInDays
field for simple day-based periods, or the period
, start
and end
fields for more complex time controls.
The periodInDays
field provides a convenient way to specify common time periods (e.g., periodInDays: 1
for daily limits, periodInDays: 7
for weekly limits).
For more advanced control, the start
and end
fields specify when the Spend Permission is valid. This means that the Spender can spend the amount specified in the allowance
field after the start
time and before the end
time; attempting to spend outside of this time range will fail.
period
field specifies a rolling window of time in seconds in which the Spender can spend the amount specified in the allowance
field. This allows you specify things like “the Spender can spend up to 0.00001 ETH per day” or “the Spender can spend up to 100 USDC per week”.listSpendPermissions
method works differently depending on whether you’re querying as the Account or as the Spender:
revokeSpendPermission
method:
Spend Permissions | Policies | |
---|---|---|
Evaluation Environment | Evaluated entirely onchain through smart contracts, providing transparency and decentralization | Evaluated within Coinbase’s trusted infrastructure using TEE technology, providing secure off-chain evaluation |
Scope and Flexibility | Specifically designed for spending assets on EVM chains | Can be applied to any arbitrary transaction type, giving full control over allowed transactions |
Platform Support | Only available on EVM chains | Available on both EVM chains and Solana |
Account Scope | Can grant permissions to any account onchain, including accounts outside your CDP project | Govern accounts within your CDP project only |
0xf85210B21cC50302F477BA56686d2019dC9b67Ad
on all supported networks.