EscrowUtils

@human-protocol/sdk


@human-protocol/sdk / escrow / EscrowUtils

Class: EscrowUtils

Defined in: escrow.ts:1566

Introduction

Utility class for escrow-related operations.

Installation

npm

npm install @human-protocol/sdk

yarn

yarn install @human-protocol/sdk

Code example

Signer

Using private key(backend)

Constructors

Constructor

new EscrowUtils(): EscrowUtils

Returns

EscrowUtils

Methods

getEscrow()

static getEscrow(chainId, escrowAddress): Promise<IEscrow>

Defined in: escrow.ts:1779

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<IEscrow>

Escrow data

Code example


getEscrows()

static getEscrows(filter): Promise<IEscrow[]>

Defined in: escrow.ts:1663

This function returns an array of escrows based on the specified filter parameters.

Input parameters

Parameters

filter

IEscrowsFilter

Filter parameters.

Returns

Promise<IEscrow[]>

List of escrows that match the filter.

Code example


getPayouts()

static getPayouts(filter): Promise<Payout[]>

Defined in: escrow.ts:1949

This function returns the payouts for a given set of networks.

This uses Subgraph

Input parameters Fetch payouts from the subgraph.

Parameters

filter

IPayoutFilter

Filter parameters.

Returns

Promise<Payout[]>

List of payouts matching the filters.

Code example


getStatusEvents()

static getStatusEvents(filter): Promise<StatusEvent[]>

Defined in: escrow.ts:1858

This function returns the status events for a given set of networks within an optional date range.

This uses Subgraph

Input parameters

Parameters

filter

IStatusEventFilter

Filter parameters.

Returns

Promise<StatusEvent[]>

  • Array of status events with their corresponding statuses.

Code example

Last updated