EscrowUtils
@human-protocol/sdk • Docs
@human-protocol/sdk / escrow / EscrowUtils
Class: EscrowUtils
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
new EscrowUtils()
new EscrowUtils():
EscrowUtils
Returns
Methods
getEscrow()
staticgetEscrow(chainId,escrowAddress):Promise<EscrowData>
This function returns the escrow data for a given address.
This uses Subgraph
Input parameters
Parameters
• chainId: ChainId
Network in which the escrow has been deployed
• escrowAddress: string
Address of the escrow
Returns
Promise<EscrowData>
Escrow data
Code example
Defined in
getEscrows()
staticgetEscrows(filter):Promise<EscrowData[]>
This function returns an array of escrows based on the specified filter parameters.
Input parameters
Parameters
• filter: IEscrowsFilter
Filter parameters.
Returns
Promise<EscrowData[]>
List of escrows that match the filter.
Code example
Defined in
getStatusEvents()
staticgetStatusEvents(chainId,statuses?,from?,to?,launcher?,first?,skip?,orderDirection?):Promise<StatusEvent[]>
This function returns the status events for a given set of networks within an optional date range.
This uses Subgraph
Input parameters
Parameters
• chainId: ChainId
List of network IDs to query for status events.
• statuses?: EscrowStatus[]
Optional array of statuses to query for. If not provided, queries for all statuses.
• from?: Date
Optional start date to filter events.
• to?: Date
Optional end date to filter events.
• launcher?: string
Optional launcher address to filter events. Must be a valid Ethereum address.
• first?: number
Optional number of transactions per page. Default is 10.
• skip?: number
Optional number of transactions to skip. Default is 0.
• orderDirection?: OrderDirection
Optional order of the results. Default is DESC.
Returns
Promise<StatusEvent[]>
Array of status events with their corresponding statuses.
Code example
Defined in
Last updated