Skip to main content

Function: spendLimit()

spendLimit(opts): SessionPolicy
Defined in: packages/accounts/src/policy/compile.ts:12 Build a spendLimit session policy. max is coerced to a decimal string of token base units (USDC = 7 decimals); period defaults to “day”. This is the shape SessionManager consumes and the one the on-chain policy account enforces in __check_auth.

Parameters

opts

max

string | bigint

period?

"day" | "week" | "month" | "total"

token

string

Returns

SessionPolicy