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[]>

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

Type declaration

▸ (walletUserAddress): Promise<string[]>

Parameters
NameTypeDescription
walletUserAddressstringAddress of the account
Returns

Promise<string[]>

Defined in

typing/index.ts:1176


getPaymentList

getPaymentList: (queryParams: IQuery, pagination: IPage) => 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
]
}

Type declaration

▸ (queryParams, pagination): Promise<IGetPaymentListResponse>

Parameters
NameTypeDescription
queryParamsIQuerySearch parameters
paginationIPageHow many records should be returned from which "page" (defaults to 20, 1)
Returns

Promise<IGetPaymentListResponse>

Defined in

typing/index.ts:1054


getSinglePayment

getSinglePayment: (escrowId: number) => 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: "Period Expired",
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"
}
}

Type declaration

▸ (escrowId): Promise<IEscrowData>

Parameters
NameTypeDescription
escrowIdnumberID of the escrow
Returns

Promise<IEscrowData>

Defined in

typing/index.ts:1100


getUserBalance

getUserBalance: (walletUserAddress: string) => 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: {
state: "Period Expired",
latestChallengeBy: null,
latestSettlementOfferBy: null,
claimed: false
},
amount: "1586200000000000000",
total: "1586200000000000000",
displayableAmount: "1.5862",
amountBI: "1.5862"
}
],
readyForClaim: [
{
token: {
address: "0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8",
symbol: "USDC",
decimals: 6
},
status: {
state: "Period Expired",
latestChallengeBy: null,
latestSettlementOfferBy: null,
claimed: false
},
amount: "1786200000",
total: "1786200000",
displayableAmount: "1786.2",
amountBI: "1786.2"
},
{
token: {
address: "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
symbol: "USDT",
decimals: 6
},
status: {
state: "Period Expired",
latestChallengeBy: null,
latestSettlementOfferBy: null,
claimed: false
},
amount: "2379300000",
total: "2379300000",
displayableAmount: "2379.3",
amountBI: "2379.3"
}
]
}

Type declaration

▸ (walletUserAddress): Promise<GetResponseUserBalance>

Parameters
NameTypeDescription
walletUserAddressstringAddress of an account to get balance of
Returns

Promise<GetResponseUserBalance>

Defined in

typing/index.ts:1166