mega.grantPermissions()
Signature
Parameters
Field
Type
Required
Notes
interface Permission {
id?: string; // Server-assigned grant identifier (set on grants returned from the wallet)
expiry: number; // Unix timestamp
/** @deprecated No longer used — the gas token is taken from the granted session permissions. */
feeToken?: {
limit: string; // DECIMAL string, e.g. '0.01' (ETH)
symbol?: string;
};
permissions: {
calls: { to: string; signature: string }[]; // Allowed contract+function pairs
spend: {
limit: bigint; // Spend cap in base units, e.g. 5000000000000000n wei
period: 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';
token?: `0x${string}`;
}[];
};
}Example
Response
Canonical Call Matcher
Notes
Last updated