Skip to content
Alchemy Logo

GrantPermissionsParams

type GrantPermissionsParams = {
  key: {
    type: "secp256k1" | "ecdsa" | "contract";
    publicKey: `0x${string}`;
  };
  permissions: (
    | {
        type: "native-token-transfer";
        data: {
          allowance: bigint;
        };
      }
    | {
        type: "erc20-token-transfer";
        data: {
          allowance: bigint;
          address: `0x${string}`;
        };
      }
    | {
        type: "gas-limit";
        data: {
          limit: bigint;
        };
      }
    | {
        type: "contract-access";
        data: {
          address: `0x${string}`;
        };
      }
    | {
        type: "account-functions";
        data: {
          functions: `0x${string}`[];
        };
      }
    | {
        type: "functions-on-all-contracts";
        data: {
          functions: `0x${string}`[];
        };
      }
    | {
        type: "functions-on-contract";
        data: {
          address: `0x${string}`;
          functions: `0x${string}`[];
        };
      }
    | {
        type: "root";
        data?: undefined;
      }
  )[];
  expirySec?: number | undefined;
  account?: AccountParam | undefined;
  chainId?: number | undefined;
};

Defined in: packages/wallet-apis/src/actions/grantPermissions.ts:17

Was this page helpful?