查询支持的权限类型
使用 wallet_getSupportedExecutionPermissions 获取 TokenPocket 当前支持的权限类型、适用链 ID 及可绑定的规则类型。建议在发起授权前调用,避免请求不支持的 permission.type 或 chainId。
RPC 方法
wallet_getSupportedExecutionPermissions请求
const result = await provider.request({
method: "wallet_getSupportedExecutionPermissions",
params: [],
});响应结构
type GetSupportedExecutionPermissionsResult = Record<
string, // permission type
{
chainIds: `0x${string}`[];
ruleTypes: string[]; // 如 ['expiry']
}
>;响应示例
{
"erc20-token-periodic": {
"chainIds": ["0x1", "0x38", "0x89"],
"ruleTypes": ["expiry"]
},
"native-token-periodic": {
"chainIds": ["0x1", "0x38"],
"ruleTypes": ["expiry"]
},
"erc20-token-stream": {
"chainIds": ["0x38", "0x89"],
"ruleTypes": ["expiry"]
},
"native-token-stream": {
"chainIds": ["0x38"],
"ruleTypes": ["expiry"]
}
}以上为示意结构,实际返回值以钱包版本与链配置为准。
能力探测示例
在发起授权前校验目标链与权限类型:
Last updated