Skip to content
LogoLogo

receivePolicy.get

Gets the receive policy configured for an account. Learn more about transfer policies

Usage

import { client } from './viem.config'
 
const policy = await client.receivePolicy.get({
  account: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEbb',
})
 
console.log('Has receive policy:', policy.hasReceivePolicy)
Has receive policy: true

Return Type

type ReturnType = {
  /** Whether the account has a receive policy configured. */
  hasReceivePolicy: boolean
  /** TIP-403 policy restricting which senders are allowed. */
  senderPolicyId: 'reject-all' | 'allow-all' | bigint
  /** Type of the sender policy. */
  senderPolicyType: 'whitelist' | 'blacklist'
  /** TIP-403 policy restricting which tokens are allowed. */
  tokenPolicyId: 'reject-all' | 'allow-all' | bigint
  /** Type of the token policy. */
  tokenPolicyType: 'whitelist' | 'blacklist'
  /** Who can reclaim funds blocked by this policy. */
  claimer: 'sender' | 'self' | Address
  /** Raw recovery authority address. */
  recoveryAuthority: Address
}

Parameters

account

  • Type: Account | Address

Account to read the receive policy for. Defaults to the client's account if set.