@0xsequence/indexer 0.39.5 → 0.40.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -27,7 +27,7 @@ function _extends() {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
/* eslint-disable */
|
|
30
|
-
// sequence-indexer v0.4.0
|
|
30
|
+
// sequence-indexer v0.4.0 6071879702f8258e8912ca95cf2d9c1459ca991d
|
|
31
31
|
// --
|
|
32
32
|
// This file has been generated by https://github.com/webrpc/webrpc using gen/typescript
|
|
33
33
|
// Do not edit by hand. Update your webrpc schema and re-generate.
|
|
@@ -36,7 +36,7 @@ const WebRPCVersion = "v1"; // Schema version of your RIDL schema
|
|
|
36
36
|
|
|
37
37
|
const WebRPCSchemaVersion = "v0.4.0"; // Schema hash generated from your RIDL schema
|
|
38
38
|
|
|
39
|
-
const WebRPCSchemaHash = "
|
|
39
|
+
const WebRPCSchemaHash = "6071879702f8258e8912ca95cf2d9c1459ca991d"; //
|
|
40
40
|
// Types
|
|
41
41
|
//
|
|
42
42
|
|
|
@@ -147,6 +147,7 @@ class Indexer {
|
|
|
147
147
|
return this.fetch(this.url('GetTokenBalances'), createHTTPRequest(args, headers)).then(res => {
|
|
148
148
|
return buildResponse(res).then(_data => {
|
|
149
149
|
return {
|
|
150
|
+
page: _data.page,
|
|
150
151
|
balances: _data.balances
|
|
151
152
|
};
|
|
152
153
|
});
|
|
@@ -157,6 +158,7 @@ class Indexer {
|
|
|
157
158
|
return this.fetch(this.url('GetTokenSupplies'), createHTTPRequest(args, headers)).then(res => {
|
|
158
159
|
return buildResponse(res).then(_data => {
|
|
159
160
|
return {
|
|
161
|
+
page: _data.page,
|
|
160
162
|
contractType: _data.contractType,
|
|
161
163
|
tokenIDs: _data.tokenIDs
|
|
162
164
|
};
|
|
@@ -196,6 +198,14 @@ class Indexer {
|
|
|
196
198
|
});
|
|
197
199
|
};
|
|
198
200
|
|
|
201
|
+
this.syncBalance = (args, headers) => {
|
|
202
|
+
return this.fetch(this.url('SyncBalance'), createHTTPRequest(args, headers)).then(res => {
|
|
203
|
+
return buildResponse(res).then(_data => {
|
|
204
|
+
return {};
|
|
205
|
+
});
|
|
206
|
+
});
|
|
207
|
+
};
|
|
208
|
+
|
|
199
209
|
this.hostname = hostname;
|
|
200
210
|
this.fetch = fetch;
|
|
201
211
|
}
|
|
@@ -27,7 +27,7 @@ function _extends() {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
/* eslint-disable */
|
|
30
|
-
// sequence-indexer v0.4.0
|
|
30
|
+
// sequence-indexer v0.4.0 6071879702f8258e8912ca95cf2d9c1459ca991d
|
|
31
31
|
// --
|
|
32
32
|
// This file has been generated by https://github.com/webrpc/webrpc using gen/typescript
|
|
33
33
|
// Do not edit by hand. Update your webrpc schema and re-generate.
|
|
@@ -36,7 +36,7 @@ const WebRPCVersion = "v1"; // Schema version of your RIDL schema
|
|
|
36
36
|
|
|
37
37
|
const WebRPCSchemaVersion = "v0.4.0"; // Schema hash generated from your RIDL schema
|
|
38
38
|
|
|
39
|
-
const WebRPCSchemaHash = "
|
|
39
|
+
const WebRPCSchemaHash = "6071879702f8258e8912ca95cf2d9c1459ca991d"; //
|
|
40
40
|
// Types
|
|
41
41
|
//
|
|
42
42
|
|
|
@@ -147,6 +147,7 @@ class Indexer {
|
|
|
147
147
|
return this.fetch(this.url('GetTokenBalances'), createHTTPRequest(args, headers)).then(res => {
|
|
148
148
|
return buildResponse(res).then(_data => {
|
|
149
149
|
return {
|
|
150
|
+
page: _data.page,
|
|
150
151
|
balances: _data.balances
|
|
151
152
|
};
|
|
152
153
|
});
|
|
@@ -157,6 +158,7 @@ class Indexer {
|
|
|
157
158
|
return this.fetch(this.url('GetTokenSupplies'), createHTTPRequest(args, headers)).then(res => {
|
|
158
159
|
return buildResponse(res).then(_data => {
|
|
159
160
|
return {
|
|
161
|
+
page: _data.page,
|
|
160
162
|
contractType: _data.contractType,
|
|
161
163
|
tokenIDs: _data.tokenIDs
|
|
162
164
|
};
|
|
@@ -196,6 +198,14 @@ class Indexer {
|
|
|
196
198
|
});
|
|
197
199
|
};
|
|
198
200
|
|
|
201
|
+
this.syncBalance = (args, headers) => {
|
|
202
|
+
return this.fetch(this.url('SyncBalance'), createHTTPRequest(args, headers)).then(res => {
|
|
203
|
+
return buildResponse(res).then(_data => {
|
|
204
|
+
return {};
|
|
205
|
+
});
|
|
206
|
+
});
|
|
207
|
+
};
|
|
208
|
+
|
|
199
209
|
this.hostname = hostname;
|
|
200
210
|
this.fetch = fetch;
|
|
201
211
|
}
|
|
@@ -19,7 +19,7 @@ function _extends() {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
/* eslint-disable */
|
|
22
|
-
// sequence-indexer v0.4.0
|
|
22
|
+
// sequence-indexer v0.4.0 6071879702f8258e8912ca95cf2d9c1459ca991d
|
|
23
23
|
// --
|
|
24
24
|
// This file has been generated by https://github.com/webrpc/webrpc using gen/typescript
|
|
25
25
|
// Do not edit by hand. Update your webrpc schema and re-generate.
|
|
@@ -28,7 +28,7 @@ const WebRPCVersion = "v1"; // Schema version of your RIDL schema
|
|
|
28
28
|
|
|
29
29
|
const WebRPCSchemaVersion = "v0.4.0"; // Schema hash generated from your RIDL schema
|
|
30
30
|
|
|
31
|
-
const WebRPCSchemaHash = "
|
|
31
|
+
const WebRPCSchemaHash = "6071879702f8258e8912ca95cf2d9c1459ca991d"; //
|
|
32
32
|
// Types
|
|
33
33
|
//
|
|
34
34
|
|
|
@@ -139,6 +139,7 @@ class Indexer {
|
|
|
139
139
|
return this.fetch(this.url('GetTokenBalances'), createHTTPRequest(args, headers)).then(res => {
|
|
140
140
|
return buildResponse(res).then(_data => {
|
|
141
141
|
return {
|
|
142
|
+
page: _data.page,
|
|
142
143
|
balances: _data.balances
|
|
143
144
|
};
|
|
144
145
|
});
|
|
@@ -149,6 +150,7 @@ class Indexer {
|
|
|
149
150
|
return this.fetch(this.url('GetTokenSupplies'), createHTTPRequest(args, headers)).then(res => {
|
|
150
151
|
return buildResponse(res).then(_data => {
|
|
151
152
|
return {
|
|
153
|
+
page: _data.page,
|
|
152
154
|
contractType: _data.contractType,
|
|
153
155
|
tokenIDs: _data.tokenIDs
|
|
154
156
|
};
|
|
@@ -188,6 +190,14 @@ class Indexer {
|
|
|
188
190
|
});
|
|
189
191
|
};
|
|
190
192
|
|
|
193
|
+
this.syncBalance = (args, headers) => {
|
|
194
|
+
return this.fetch(this.url('SyncBalance'), createHTTPRequest(args, headers)).then(res => {
|
|
195
|
+
return buildResponse(res).then(_data => {
|
|
196
|
+
return {};
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
};
|
|
200
|
+
|
|
191
201
|
this.hostname = hostname;
|
|
192
202
|
this.fetch = fetch;
|
|
193
203
|
}
|
|
@@ -1,6 +1,44 @@
|
|
|
1
1
|
export declare const WebRPCVersion = "v1";
|
|
2
2
|
export declare const WebRPCSchemaVersion = "v0.4.0";
|
|
3
|
-
export declare const WebRPCSchemaHash = "
|
|
3
|
+
export declare const WebRPCSchemaHash = "6071879702f8258e8912ca95cf2d9c1459ca991d";
|
|
4
|
+
export interface ContractInfo {
|
|
5
|
+
chainId: number;
|
|
6
|
+
address: string;
|
|
7
|
+
name: string;
|
|
8
|
+
type: string;
|
|
9
|
+
symbol: string;
|
|
10
|
+
decimals?: number;
|
|
11
|
+
logoURI: string;
|
|
12
|
+
extensions: ContractInfoExtensions;
|
|
13
|
+
}
|
|
14
|
+
export interface ContractInfoExtensions {
|
|
15
|
+
link: string;
|
|
16
|
+
description: string;
|
|
17
|
+
ogImage: string;
|
|
18
|
+
originChainId: number;
|
|
19
|
+
originAddress: string;
|
|
20
|
+
blacklist: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface TokenMetadata {
|
|
23
|
+
tokenId: string;
|
|
24
|
+
contractAddress: string;
|
|
25
|
+
name: string;
|
|
26
|
+
description: string;
|
|
27
|
+
image: string;
|
|
28
|
+
decimals: number;
|
|
29
|
+
properties: {
|
|
30
|
+
[key: string]: any;
|
|
31
|
+
};
|
|
32
|
+
video: string;
|
|
33
|
+
audio: string;
|
|
34
|
+
image_data: string;
|
|
35
|
+
external_url: string;
|
|
36
|
+
background_color: string;
|
|
37
|
+
animation_url: string;
|
|
38
|
+
attributes: Array<{
|
|
39
|
+
[key: string]: any;
|
|
40
|
+
}>;
|
|
41
|
+
}
|
|
4
42
|
export declare enum ContractType {
|
|
5
43
|
UNKNOWN = "UNKNOWN",
|
|
6
44
|
ERC20 = "ERC20",
|
|
@@ -85,6 +123,8 @@ export interface TokenBalance {
|
|
|
85
123
|
blockNumber: number;
|
|
86
124
|
updateId: number;
|
|
87
125
|
chainId: number;
|
|
126
|
+
contractInfo?: ContractInfo;
|
|
127
|
+
tokenMetadata?: TokenMetadata;
|
|
88
128
|
}
|
|
89
129
|
export interface TokenHistory {
|
|
90
130
|
id: number;
|
|
@@ -104,6 +144,8 @@ export interface TokenSupply {
|
|
|
104
144
|
tokenID: string;
|
|
105
145
|
supply: string;
|
|
106
146
|
chainId: number;
|
|
147
|
+
contractInfo?: ContractInfo;
|
|
148
|
+
tokenMetadata?: TokenMetadata;
|
|
107
149
|
}
|
|
108
150
|
export interface Transaction {
|
|
109
151
|
txnHash: string;
|
|
@@ -122,6 +164,11 @@ export interface TxnTransfer {
|
|
|
122
164
|
to: string;
|
|
123
165
|
tokenIds?: Array<string>;
|
|
124
166
|
amounts: Array<string>;
|
|
167
|
+
logIndex: number;
|
|
168
|
+
contractInfo?: ContractInfo;
|
|
169
|
+
tokenMetadata?: {
|
|
170
|
+
[key: string]: TokenMetadata;
|
|
171
|
+
};
|
|
125
172
|
}
|
|
126
173
|
export interface TransactionHistoryFilter {
|
|
127
174
|
accountAddress?: string;
|
|
@@ -134,13 +181,13 @@ export interface TransactionHistoryFilter {
|
|
|
134
181
|
toBlock?: number;
|
|
135
182
|
}
|
|
136
183
|
export interface Page {
|
|
137
|
-
pageSize?: number;
|
|
138
184
|
page?: number;
|
|
139
|
-
more?: boolean;
|
|
140
185
|
column?: string;
|
|
141
186
|
before?: any;
|
|
142
187
|
after?: any;
|
|
143
188
|
sort?: Array<SortBy>;
|
|
189
|
+
pageSize?: number;
|
|
190
|
+
more?: boolean;
|
|
144
191
|
}
|
|
145
192
|
export interface SortBy {
|
|
146
193
|
column: string;
|
|
@@ -157,6 +204,7 @@ export interface Indexer {
|
|
|
157
204
|
getTokenSuppliesMap(args: GetTokenSuppliesMapArgs, headers?: object): Promise<GetTokenSuppliesMapReturn>;
|
|
158
205
|
getBalanceUpdates(args: GetBalanceUpdatesArgs, headers?: object): Promise<GetBalanceUpdatesReturn>;
|
|
159
206
|
getTransactionHistory(args: GetTransactionHistoryArgs, headers?: object): Promise<GetTransactionHistoryReturn>;
|
|
207
|
+
syncBalance(args: SyncBalanceArgs, headers?: object): Promise<SyncBalanceReturn>;
|
|
160
208
|
}
|
|
161
209
|
export interface PingArgs {
|
|
162
210
|
}
|
|
@@ -187,14 +235,20 @@ export interface GetEtherBalanceReturn {
|
|
|
187
235
|
export interface GetTokenBalancesArgs {
|
|
188
236
|
accountAddress?: string;
|
|
189
237
|
contractAddress?: string;
|
|
238
|
+
includeMetadata?: boolean;
|
|
239
|
+
page?: Page;
|
|
190
240
|
}
|
|
191
241
|
export interface GetTokenBalancesReturn {
|
|
242
|
+
page: Page;
|
|
192
243
|
balances: Array<TokenBalance>;
|
|
193
244
|
}
|
|
194
245
|
export interface GetTokenSuppliesArgs {
|
|
195
246
|
contractAddress: string;
|
|
247
|
+
includeMetadata?: boolean;
|
|
248
|
+
page?: Page;
|
|
196
249
|
}
|
|
197
250
|
export interface GetTokenSuppliesReturn {
|
|
251
|
+
page: Page;
|
|
198
252
|
contractType: ContractType;
|
|
199
253
|
tokenIDs: Array<TokenSupply>;
|
|
200
254
|
}
|
|
@@ -202,6 +256,7 @@ export interface GetTokenSuppliesMapArgs {
|
|
|
202
256
|
tokenMap: {
|
|
203
257
|
[key: string]: Array<string>;
|
|
204
258
|
};
|
|
259
|
+
includeMetadata?: boolean;
|
|
205
260
|
}
|
|
206
261
|
export interface GetTokenSuppliesMapReturn {
|
|
207
262
|
supplies: {
|
|
@@ -214,17 +269,25 @@ export interface GetBalanceUpdatesArgs {
|
|
|
214
269
|
page?: Page;
|
|
215
270
|
}
|
|
216
271
|
export interface GetBalanceUpdatesReturn {
|
|
217
|
-
page
|
|
272
|
+
page: Page;
|
|
218
273
|
balances: Array<TokenBalance>;
|
|
219
274
|
}
|
|
220
275
|
export interface GetTransactionHistoryArgs {
|
|
221
276
|
filter: TransactionHistoryFilter;
|
|
222
277
|
page?: Page;
|
|
278
|
+
includeMetadata?: boolean;
|
|
223
279
|
}
|
|
224
280
|
export interface GetTransactionHistoryReturn {
|
|
225
281
|
page: Page;
|
|
226
282
|
transactions: Array<Transaction>;
|
|
227
283
|
}
|
|
284
|
+
export interface SyncBalanceArgs {
|
|
285
|
+
accountAddress: string;
|
|
286
|
+
contractAddress: string;
|
|
287
|
+
tokenID?: string;
|
|
288
|
+
}
|
|
289
|
+
export interface SyncBalanceReturn {
|
|
290
|
+
}
|
|
228
291
|
export declare class Indexer implements Indexer {
|
|
229
292
|
protected hostname: string;
|
|
230
293
|
protected fetch: Fetch;
|
|
@@ -241,6 +304,7 @@ export declare class Indexer implements Indexer {
|
|
|
241
304
|
getTokenSuppliesMap: (args: GetTokenSuppliesMapArgs, headers?: object | undefined) => Promise<GetTokenSuppliesMapReturn>;
|
|
242
305
|
getBalanceUpdates: (args: GetBalanceUpdatesArgs, headers?: object | undefined) => Promise<GetBalanceUpdatesReturn>;
|
|
243
306
|
getTransactionHistory: (args: GetTransactionHistoryArgs, headers?: object | undefined) => Promise<GetTransactionHistoryReturn>;
|
|
307
|
+
syncBalance: (args: SyncBalanceArgs, headers?: object | undefined) => Promise<SyncBalanceReturn>;
|
|
244
308
|
}
|
|
245
309
|
export interface WebRPCError extends Error {
|
|
246
310
|
code: string;
|
package/package.json
CHANGED
package/src/indexer.gen.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
|
-
// sequence-indexer v0.4.0
|
|
2
|
+
// sequence-indexer v0.4.0 6071879702f8258e8912ca95cf2d9c1459ca991d
|
|
3
3
|
// --
|
|
4
4
|
// This file has been generated by https://github.com/webrpc/webrpc using gen/typescript
|
|
5
5
|
// Do not edit by hand. Update your webrpc schema and re-generate.
|
|
@@ -11,12 +11,49 @@ export const WebRPCVersion = "v1"
|
|
|
11
11
|
export const WebRPCSchemaVersion = "v0.4.0"
|
|
12
12
|
|
|
13
13
|
// Schema hash generated from your RIDL schema
|
|
14
|
-
export const WebRPCSchemaHash = "
|
|
14
|
+
export const WebRPCSchemaHash = "6071879702f8258e8912ca95cf2d9c1459ca991d"
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
//
|
|
18
18
|
// Types
|
|
19
19
|
//
|
|
20
|
+
export interface ContractInfo {
|
|
21
|
+
chainId: number
|
|
22
|
+
address: string
|
|
23
|
+
name: string
|
|
24
|
+
type: string
|
|
25
|
+
symbol: string
|
|
26
|
+
decimals?: number
|
|
27
|
+
logoURI: string
|
|
28
|
+
extensions: ContractInfoExtensions
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface ContractInfoExtensions {
|
|
32
|
+
link: string
|
|
33
|
+
description: string
|
|
34
|
+
ogImage: string
|
|
35
|
+
originChainId: number
|
|
36
|
+
originAddress: string
|
|
37
|
+
blacklist: boolean
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface TokenMetadata {
|
|
41
|
+
tokenId: string
|
|
42
|
+
contractAddress: string
|
|
43
|
+
name: string
|
|
44
|
+
description: string
|
|
45
|
+
image: string
|
|
46
|
+
decimals: number
|
|
47
|
+
properties: {[key: string]: any}
|
|
48
|
+
video: string
|
|
49
|
+
audio: string
|
|
50
|
+
image_data: string
|
|
51
|
+
external_url: string
|
|
52
|
+
background_color: string
|
|
53
|
+
animation_url: string
|
|
54
|
+
attributes: Array<{[key: string]: any}>
|
|
55
|
+
}
|
|
56
|
+
|
|
20
57
|
export enum ContractType {
|
|
21
58
|
UNKNOWN = 'UNKNOWN',
|
|
22
59
|
ERC20 = 'ERC20',
|
|
@@ -113,6 +150,8 @@ export interface TokenBalance {
|
|
|
113
150
|
blockNumber: number
|
|
114
151
|
updateId: number
|
|
115
152
|
chainId: number
|
|
153
|
+
contractInfo?: ContractInfo
|
|
154
|
+
tokenMetadata?: TokenMetadata
|
|
116
155
|
}
|
|
117
156
|
|
|
118
157
|
export interface TokenHistory {
|
|
@@ -134,6 +173,8 @@ export interface TokenSupply {
|
|
|
134
173
|
tokenID: string
|
|
135
174
|
supply: string
|
|
136
175
|
chainId: number
|
|
176
|
+
contractInfo?: ContractInfo
|
|
177
|
+
tokenMetadata?: TokenMetadata
|
|
137
178
|
}
|
|
138
179
|
|
|
139
180
|
export interface Transaction {
|
|
@@ -154,6 +195,9 @@ export interface TxnTransfer {
|
|
|
154
195
|
to: string
|
|
155
196
|
tokenIds?: Array<string>
|
|
156
197
|
amounts: Array<string>
|
|
198
|
+
logIndex: number
|
|
199
|
+
contractInfo?: ContractInfo
|
|
200
|
+
tokenMetadata?: {[key: string]: TokenMetadata}
|
|
157
201
|
}
|
|
158
202
|
|
|
159
203
|
export interface TransactionHistoryFilter {
|
|
@@ -168,13 +212,13 @@ export interface TransactionHistoryFilter {
|
|
|
168
212
|
}
|
|
169
213
|
|
|
170
214
|
export interface Page {
|
|
171
|
-
pageSize?: number
|
|
172
215
|
page?: number
|
|
173
|
-
more?: boolean
|
|
174
216
|
column?: string
|
|
175
217
|
before?: any
|
|
176
218
|
after?: any
|
|
177
219
|
sort?: Array<SortBy>
|
|
220
|
+
pageSize?: number
|
|
221
|
+
more?: boolean
|
|
178
222
|
}
|
|
179
223
|
|
|
180
224
|
export interface SortBy {
|
|
@@ -193,6 +237,7 @@ export interface Indexer {
|
|
|
193
237
|
getTokenSuppliesMap(args: GetTokenSuppliesMapArgs, headers?: object): Promise<GetTokenSuppliesMapReturn>
|
|
194
238
|
getBalanceUpdates(args: GetBalanceUpdatesArgs, headers?: object): Promise<GetBalanceUpdatesReturn>
|
|
195
239
|
getTransactionHistory(args: GetTransactionHistoryArgs, headers?: object): Promise<GetTransactionHistoryReturn>
|
|
240
|
+
syncBalance(args: SyncBalanceArgs, headers?: object): Promise<SyncBalanceReturn>
|
|
196
241
|
}
|
|
197
242
|
|
|
198
243
|
export interface PingArgs {
|
|
@@ -229,21 +274,28 @@ export interface GetEtherBalanceReturn {
|
|
|
229
274
|
export interface GetTokenBalancesArgs {
|
|
230
275
|
accountAddress?: string
|
|
231
276
|
contractAddress?: string
|
|
277
|
+
includeMetadata?: boolean
|
|
278
|
+
page?: Page
|
|
232
279
|
}
|
|
233
280
|
|
|
234
281
|
export interface GetTokenBalancesReturn {
|
|
282
|
+
page: Page
|
|
235
283
|
balances: Array<TokenBalance>
|
|
236
284
|
}
|
|
237
285
|
export interface GetTokenSuppliesArgs {
|
|
238
286
|
contractAddress: string
|
|
287
|
+
includeMetadata?: boolean
|
|
288
|
+
page?: Page
|
|
239
289
|
}
|
|
240
290
|
|
|
241
291
|
export interface GetTokenSuppliesReturn {
|
|
292
|
+
page: Page
|
|
242
293
|
contractType: ContractType
|
|
243
294
|
tokenIDs: Array<TokenSupply>
|
|
244
295
|
}
|
|
245
296
|
export interface GetTokenSuppliesMapArgs {
|
|
246
297
|
tokenMap: {[key: string]: Array<string>}
|
|
298
|
+
includeMetadata?: boolean
|
|
247
299
|
}
|
|
248
300
|
|
|
249
301
|
export interface GetTokenSuppliesMapReturn {
|
|
@@ -256,18 +308,27 @@ export interface GetBalanceUpdatesArgs {
|
|
|
256
308
|
}
|
|
257
309
|
|
|
258
310
|
export interface GetBalanceUpdatesReturn {
|
|
259
|
-
page
|
|
311
|
+
page: Page
|
|
260
312
|
balances: Array<TokenBalance>
|
|
261
313
|
}
|
|
262
314
|
export interface GetTransactionHistoryArgs {
|
|
263
315
|
filter: TransactionHistoryFilter
|
|
264
316
|
page?: Page
|
|
317
|
+
includeMetadata?: boolean
|
|
265
318
|
}
|
|
266
319
|
|
|
267
320
|
export interface GetTransactionHistoryReturn {
|
|
268
321
|
page: Page
|
|
269
322
|
transactions: Array<Transaction>
|
|
270
323
|
}
|
|
324
|
+
export interface SyncBalanceArgs {
|
|
325
|
+
accountAddress: string
|
|
326
|
+
contractAddress: string
|
|
327
|
+
tokenID?: string
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
export interface SyncBalanceReturn {
|
|
331
|
+
}
|
|
271
332
|
|
|
272
333
|
|
|
273
334
|
|
|
@@ -358,6 +419,7 @@ export class Indexer implements Indexer {
|
|
|
358
419
|
createHTTPRequest(args, headers)).then((res) => {
|
|
359
420
|
return buildResponse(res).then(_data => {
|
|
360
421
|
return {
|
|
422
|
+
page: <Page>(_data.page),
|
|
361
423
|
balances: <Array<TokenBalance>>(_data.balances)
|
|
362
424
|
}
|
|
363
425
|
})
|
|
@@ -370,6 +432,7 @@ export class Indexer implements Indexer {
|
|
|
370
432
|
createHTTPRequest(args, headers)).then((res) => {
|
|
371
433
|
return buildResponse(res).then(_data => {
|
|
372
434
|
return {
|
|
435
|
+
page: <Page>(_data.page),
|
|
373
436
|
contractType: <ContractType>(_data.contractType),
|
|
374
437
|
tokenIDs: <Array<TokenSupply>>(_data.tokenIDs)
|
|
375
438
|
}
|
|
@@ -415,6 +478,17 @@ export class Indexer implements Indexer {
|
|
|
415
478
|
})
|
|
416
479
|
}
|
|
417
480
|
|
|
481
|
+
syncBalance = (args: SyncBalanceArgs, headers?: object): Promise<SyncBalanceReturn> => {
|
|
482
|
+
return this.fetch(
|
|
483
|
+
this.url('SyncBalance'),
|
|
484
|
+
createHTTPRequest(args, headers)).then((res) => {
|
|
485
|
+
return buildResponse(res).then(_data => {
|
|
486
|
+
return {
|
|
487
|
+
}
|
|
488
|
+
})
|
|
489
|
+
})
|
|
490
|
+
}
|
|
491
|
+
|
|
418
492
|
}
|
|
419
493
|
|
|
420
494
|
|
|
@@ -447,4 +521,4 @@ const buildResponse = (res: Response): Promise<any> => {
|
|
|
447
521
|
})
|
|
448
522
|
}
|
|
449
523
|
|
|
450
|
-
export type Fetch = (input: RequestInfo, init?: RequestInit) => Promise<Response>
|
|
524
|
+
export type Fetch = (input: RequestInfo, init?: RequestInit) => Promise<Response>
|