EscrowUtils
@human-protocol/sdk / escrow / EscrowUtils
Class: EscrowUtils
Defined in: escrow.ts:1842
Introduction
Utility class for escrow-related operations.
Installation
npm
npm install @human-protocol/sdkyarn
yarn install @human-protocol/sdkCode example
Signer
Using private key(backend)
Constructors
Constructor
new EscrowUtils():
EscrowUtils
Returns
EscrowUtils
Methods
getCancellationRefund()
staticgetCancellationRefund(chainId,escrowAddress,options?):Promise<ICancellationRefund|null>
Defined in: escrow.ts:2434
This function returns the cancellation refund for a given escrow address.
This uses Subgraph
Input parameters
Parameters
chainId
Network in which the escrow has been deployed
escrowAddress
string
Address of the escrow
options?
Optional configuration for subgraph requests.
Returns
Promise<ICancellationRefund | null>
Cancellation refund data
Code example
getCancellationRefunds()
staticgetCancellationRefunds(filter,options?):Promise<ICancellationRefund[]>
Defined in: escrow.ts:2338
This function returns the cancellation refunds for a given set of networks.
This uses Subgraph
Input parameters
Parameters
filter
Filter parameters.
options?
Optional configuration for subgraph requests.
Returns
Promise<ICancellationRefund[]>
List of cancellation refunds matching the filters.
Code example
getEscrow()
staticgetEscrow(chainId,escrowAddress,options?):Promise<IEscrow|null>
Defined in: escrow.ts:2067
This function returns the escrow data for a given address.
This uses Subgraph
Input parameters
Parameters
chainId
Network in which the escrow has been deployed
escrowAddress
string
Address of the escrow
options?
Optional configuration for subgraph requests.
Returns
Promise<IEscrow | null>
Escrow data or null if not found.
Code example
getEscrows()
staticgetEscrows(filter,options?):Promise<IEscrow[]>
Defined in: escrow.ts:1946
This function returns an array of escrows based on the specified filter parameters.
Input parameters
Parameters
filter
Filter parameters.
options?
Optional configuration for subgraph requests.
Returns
Promise<IEscrow[]>
List of escrows that match the filter.
Code example
getPayouts()
staticgetPayouts(filter,options?):Promise<IPayout[]>
Defined in: escrow.ts:2242
This function returns the payouts for a given set of networks.
This uses Subgraph
Input parameters Fetch payouts from the subgraph.
Parameters
filter
Filter parameters.
options?
Optional configuration for subgraph requests.
Returns
Promise<IPayout[]>
List of payouts matching the filters.
Code example
getStatusEvents()
staticgetStatusEvents(filter,options?):Promise<IStatusEvent[]>
Defined in: escrow.ts:2150
This function returns the status events for a given set of networks within an optional date range.
This uses Subgraph
Input parameters
Parameters
filter
Filter parameters.
options?
Optional configuration for subgraph requests.
Returns
Promise<IStatusEvent[]>
Array of status events with their corresponding statuses.
Code example
Last updated