getAllForeignCalls(config, rulesEngineForeignCallContract, policyId, blockParams?): Promise<ForeignCallOnChain[]>
Defined in: src/modules/foreign-calls.ts:439 Retrieves all foreign calls associated with a specific policy ID from the Rules Engine Component Contract.

Parameters

ParameterTypeDescription
configConfigThe configuration object containing network and wallet information.
rulesEngineForeignCallContract{ abi: ({ anonymous: undefined; inputs: ({ components: undefined; internalType: string; name: string; type: string; } | { components: ({ components: undefined; internalType: string; name: string; type: string; } | { components: …[]; internalType: string; name: string; type: string; })[]; internalType: string; name: string; type: string; })[]; name: string; outputs: object[]; stateMutability: string; type: string; } | { anonymous: undefined; inputs: ({ components: undefined; internalType: string; name: string; type: string; } | { components: ({ components: undefined; internalType: string; name: string; type: string; } | { components: …[]; internalType: string; name: string; type: string; })[]; internalType: string; name: string; type: string; })[]; name: string; outputs: object[]; stateMutability: string; type: string; } | { anonymous: boolean; inputs: object[]; name: string; outputs: undefined; stateMutability: undefined; type: string; })[]; address: `0x${string}`; }An object representing the Rules Engine Component Contract,
rulesEngineForeignCallContract.abi({ anonymous: undefined; inputs: ({ components: undefined; internalType: string; name: string; type: string; } | { components: ({ components: undefined; internalType: string; name: string; type: string; } | { components: …[]; internalType: string; name: string; type: string; })[]; internalType: string; name: string; type: string; })[]; name: string; outputs: object[]; stateMutability: string; type: string; } | { anonymous: undefined; inputs: ({ components: undefined; internalType: string; name: string; type: string; } | { components: ({ components: undefined; internalType: string; name: string; type: string; } | { components: …[]; internalType: string; name: string; type: string; })[]; internalType: string; name: string; type: string; })[]; name: string; outputs: object[]; stateMutability: string; type: string; } | { anonymous: boolean; inputs: object[]; name: string; outputs: undefined; stateMutability: undefined; type: string; })[]-
rulesEngineForeignCallContract.address`0x${string}`-
policyId?numberThe ID of the policy for which foreign calls are to be retrieved.
blockParams?ContractBlockParametersOptional parameters to specify block number or tag for the contract read operation. containing its address and ABI.

Returns

Promise<ForeignCallOnChain[]> A promise that resolves to an array of foreign calls if successful, or null if an error occurs.

Throws

Will log an error to the console if the operation fails.