EscrowUtils

@human-protocol/sdk / Modules / escrow / EscrowUtils

Class: EscrowUtils

escrow.EscrowUtils

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)

import { ChainId, EscrowUtils } from '@human-protocol/sdk';

const escrowAddresses = new EscrowUtils.getEscrows({
  networks: [ChainId.POLYGON_AMOY]
});

Table of contents

Constructors

Methods

Constructors

constructor

new EscrowUtils(): EscrowUtils

Returns

EscrowUtils

Methods

getEscrow

getEscrow(chainId, escrowAddress): Promise<EscrowData>

This function returns the escrow data for a given address.

This uses Subgraph

Input parameters

Parameters

Name
Type
Description

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

escrow.ts:1634


getEscrows

getEscrows(filter): Promise<EscrowData[]>

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

Input parameters

Parameters

Name
Type
Description

filter

IEscrowsFilter

Filter parameters.

Returns

Promise<EscrowData[]>

List of escrows that match the filter.

Code example

Defined in

escrow.ts:1505

Last updated