For the complete documentation index, see llms.txt. This page is also available as Markdown.

Query Supported Permission Types

Use wallet_getSupportedExecutionPermissions to retrieve the permission types currently supported by TokenPocket, applicable chain IDs, and bindable rule types. It is recommended to call this before initiating authorization to avoid requesting an unsupported permission.type or chainId.

RPC Method

wallet_getSupportedExecutionPermissions

Request

const result = await provider.request({
  method: "wallet_getSupportedExecutionPermissions",
  params: [],
});

Response Structure

type GetSupportedExecutionPermissionsResult = Record<
  string, // permission type
  {
    chainIds: `0x${string}`[];
    ruleTypes: string[]; // 如 ['expiry']
  }
>;

Response Example

{
  "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"]
  }
}

The above is an illustrative structure; the actual return value depends on the wallet version and chain configuration.

Capability Probe Example

Validate the target chain and permission type before initiating authorization:

Last updated