Skip to main content

Interface: IndexerInstance

Returned by the SDK when connecting to the indexer. Contains functions to read escrow data from the indexer

Properties

getClaimableEscrows

getClaimableEscrows: (walletUserAddress: string) => Promise<string[]>

Type declaration

▸ (walletUserAddress): Promise<string[]>

Get list of escrows that are available for claiming by the provided account

Parameters
NameTypeDescription
walletUserAddressstringAddress of the account
Returns

Promise<string[]>

A list of escrow IDs

Defined in

typing/index.ts:1170


getPaymentList

getPaymentList: (queryParams: TPaymentListQueryParams, pagination: IPage) => Promise<IGetPaymentListResponse>

Type declaration

▸ (queryParams, pagination): Promise<IGetPaymentListResponse>

Get a list of escrows based on defined parameters

Example

await indexerInstance.getPaymentList({seller: "0xA98135151f8dCd5632A63CC6358f5684c62B041D"}, {limit: 20, page: 1}

// Returned object would look e.g. like this:
{
totalCount: 10,
data: [
// List of IEscrowData objects
]
}
Parameters
NameTypeDescription
queryParamsTPaymentListQueryParamsSearch parameters
paginationIPageHow many records should be returned from which "page" (defaults to 20, 1)
Returns

Promise<IGetPaymentListResponse>

List of escrows

Defined in

typing/index.ts:1063


getSinglePayment

getSinglePayment: (escrowId: number) => Promise<IEscrowData>

Type declaration

▸ (escrowId): Promise<IEscrowData>

Reads parameters of a single escrow payment identified by the id

Example

// A returned object might look e.g. like this:
{
challengePeriod: 1209600,
challengePeriodStart: "2023-01-24T11:54:33.000Z",
challengePeriodEnd: "2023-02-07T11:54:33.000Z",
status: {
state: "Paid",
latestChallengeBy: null,
latestSettlementOfferBy: null,
claimed: false
},
escrowId: 434,
amount: "2500000000",
marketplace: "0xf8C03F09b4f53FDc05b57c7846da5F428798f187",
buyer: "0x1cB9dc49C0cC09D72E8dA74a9Ea956A0b1A65ab4",
seller: "0xA98135151f8dCd5632A63CC6358f5684c62B041D",
splitMarketplace: 10,
splitBuyer: 0,
splitSeller: 100,
splitProtocol: 0.69,
consensusBuyer: 0,
consensusSeller: 1,
arbitration: {
arbitrator: "0x3C86F543e64810E1d843809B2b70a4FDcC3b9B66",
consensusSeller: true,
consensusBuyer: true,
arbitrated: false,
arbitratorFee: 0
},
settlement: null,
token: {
address: "0x7eD124F79447a1390281c88bB9bca2AC4F009BBE"
}
}
Parameters
NameTypeDescription
escrowIdnumberID of the escrow
Returns

Promise<IEscrowData>

Populated escrow data (incl. settlement, arbitration, status, etc. information)

Defined in

typing/index.ts:1109


getUserBalance

getUserBalance: (walletUserAddress: string) => Promise<GetResponseUserBalance>

Type declaration

▸ (walletUserAddress): Promise<GetResponseUserBalance>

Read how much balance does the provided account have in the contract

Example

// A returned JSON object  might look like this:
{
pending: [
{
token: {
address: "0x0000000000000000000000000000000000000000",
symbol: "ETH",
decimals: 18
},
status: "Pending",
amount: "1586200000000000000",
total: "1586200000000000000",
displayableAmount: "1.5862",
amountBN: "1.5862"
}
],
readyForClaim: [
{
token: {
address: "0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8",
symbol: "USDC",
decimals: 6
},
status: "Ready to claim",
amount: "1786200000",
total: "1786200000",
displayableAmount: "1786.2",
amountBN: "1786.2"
},
{
token: {
address: "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
symbol: "USDT",
decimals: 6
},
status: "Ready to claim",
amount: "2379300000",
total: "2379300000",
displayableAmount: "2379.3",
amountBN: "2379.3"
}
]
}
Parameters
NameTypeDescription
walletUserAddressstringAddress of an account to get balance of
Returns

Promise<GetResponseUserBalance>

Balance broken down by tokens and claimability

Defined in

typing/index.ts:1160