operatorApprovals
operatorApprovals(
client,options):Promise<OutputType>
Defined in: packages/synapse-core/src/pay/operator-approvals.ts:80
Get operator approval information from the Filecoin Pay contract
Returns the approval status and allowances for an operator acting on behalf of a client. Operators can create and manage payment rails within their approved allowances.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
client | Client<Transport, Chain> | The viem client to use for the contract call. |
options | OptionsType | operatorApprovals.OptionsType |
Returns
Section titled “Returns”The operator approval information operatorApprovals.OutputType
Throws
Section titled “Throws”Errors operatorApprovals.ErrorType
Example
Section titled “Example”import { operatorApprovals } from '@filoz/synapse-core/pay'import { createPublicClient, http } from 'viem'import { calibration } from '@filoz/synapse-core/chains'
const client = createPublicClient({ chain: calibration, transport: http(),})
const approval = await operatorApprovals(client, { address: '0x1234567890123456789012345678901234567890',})
console.log(approval.isApproved)console.log(approval.rateAllowance)console.log(approval.lockupAllowance)