Skip to content
LogoLogo

accessKey.getFundingPolicyId

Gets the funding policy ID assigned to an installed access key. Returns 0n when no policy is assigned. Read the policy separately with funding.getPolicy.

Usage

import { client } from './viem.config'
 
const policyId = await client.accessKey.getFundingPolicyId({
  account: client.account.address,
  accessKey: '0x70997970C51812dc3A010C7d01b50e0d17dc79C8',
})
1n

Standalone Action

import { Actions } from 'viem/tempo'
import { client } from './viem.config'
 
const policyId = await Actions.accessKey.getFundingPolicyId(client, {
  account: client.account.address,
  accessKey: '0x70997970C51812dc3A010C7d01b50e0d17dc79C8',
})
1n

Return Value

type ReturnType = bigint

Parameters

accessKey

  • Type: Address | AccessKeyAccount

The access key address or account.

account

  • Type: Address | Account

The account that authorized the access key. Defaults to the client's account.

blockNumber (optional)

  • Type: bigint

Block number to read the state from.

blockOverrides (optional)

  • Type: BlockOverrides

Block overrides to apply to the state.

blockTag (optional)

  • Type: BlockTag

Block tag to read the state from.

stateOverride (optional)

  • Type: StateOverride

State override to apply.