EscrowUtils

@human-protocol/sdkarrow-up-right


@human-protocol/sdkarrow-up-right / escrow / EscrowUtils

Class: EscrowUtils

Defined in: escrow.ts:1842arrow-up-right

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

getCancellationRefund()

static getCancellationRefund(chainId, escrowAddress, options?): Promise<ICancellationRefundarrow-up-right | null>

Defined in: escrow.ts:2434arrow-up-right

This function returns the cancellation refund for a given escrow address.

This uses Subgraph

Input parameters

Parameters

chainId

ChainIdarrow-up-right

Network in which the escrow has been deployed

escrowAddress

string

Address of the escrow

options?

SubgraphOptionsarrow-up-right

Optional configuration for subgraph requests.

Returns

Promise<ICancellationRefundarrow-up-right | null>

Cancellation refund data

Code example


getCancellationRefunds()

static getCancellationRefunds(filter, options?): Promise<ICancellationRefundarrow-up-right[]>

Defined in: escrow.ts:2338arrow-up-right

This function returns the cancellation refunds for a given set of networks.

This uses Subgraph

Input parameters

Parameters

filter

ICancellationRefundFilterarrow-up-right

Filter parameters.

options?

SubgraphOptionsarrow-up-right

Optional configuration for subgraph requests.

Returns

Promise<ICancellationRefundarrow-up-right[]>

List of cancellation refunds matching the filters.

Code example


getEscrow()

static getEscrow(chainId, escrowAddress, options?): Promise<IEscrowarrow-up-right | null>

Defined in: escrow.ts:2067arrow-up-right

This function returns the escrow data for a given address.

This uses Subgraph

Input parameters

Parameters

chainId

ChainIdarrow-up-right

Network in which the escrow has been deployed

escrowAddress

string

Address of the escrow

options?

SubgraphOptionsarrow-up-right

Optional configuration for subgraph requests.

Returns

Promise<IEscrowarrow-up-right | null>

  • Escrow data or null if not found.

Code example


getEscrows()

static getEscrows(filter, options?): Promise<IEscrowarrow-up-right[]>

Defined in: escrow.ts:1946arrow-up-right

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

Input parameters

Parameters

filter

IEscrowsFilterarrow-up-right

Filter parameters.

options?

SubgraphOptionsarrow-up-right

Optional configuration for subgraph requests.

Returns

Promise<IEscrowarrow-up-right[]>

List of escrows that match the filter.

Code example


getPayouts()

static getPayouts(filter, options?): Promise<IPayoutarrow-up-right[]>

Defined in: escrow.ts:2242arrow-up-right

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

This uses Subgraph

Input parameters Fetch payouts from the subgraph.

Parameters

filter

IPayoutFilterarrow-up-right

Filter parameters.

options?

SubgraphOptionsarrow-up-right

Optional configuration for subgraph requests.

Returns

Promise<IPayoutarrow-up-right[]>

List of payouts matching the filters.

Code example


getStatusEvents()

static getStatusEvents(filter, options?): Promise<IStatusEventarrow-up-right[]>

Defined in: escrow.ts:2150arrow-up-right

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

This uses Subgraph

Input parameters

Parameters

filter

IStatusEventFilterarrow-up-right

Filter parameters.

options?

SubgraphOptionsarrow-up-right

Optional configuration for subgraph requests.

Returns

Promise<IStatusEventarrow-up-right[]>

  • Array of status events with their corresponding statuses.

Code example

Last updated