@0xsequence/indexer 2.0.14 → 2.0.16
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.
- package/dist/0xsequence-indexer.cjs.dev.js +132 -80
- package/dist/0xsequence-indexer.cjs.prod.js +132 -80
- package/dist/0xsequence-indexer.esm.js +132 -81
- package/dist/declarations/src/indexer.gen.d.ts +76 -4
- package/package.json +1 -1
- package/src/indexer.gen.ts +249 -87
|
@@ -18,9 +18,9 @@ function _extends() {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
/* eslint-disable */
|
|
21
|
-
// sequence-indexer v0.4.0
|
|
21
|
+
// sequence-indexer v0.4.0 cae735346d8e5c3dce48dce9f85116989b6beffd
|
|
22
22
|
// --
|
|
23
|
-
// Code generated by webrpc-gen@v0.
|
|
23
|
+
// Code generated by webrpc-gen@v0.20.3 with typescript generator. DO NOT EDIT.
|
|
24
24
|
//
|
|
25
25
|
// webrpc-gen -schema=indexer.ridl -target=typescript -client -out=./clients/indexer.gen.ts
|
|
26
26
|
|
|
@@ -31,7 +31,7 @@ const WebRPCVersion = 'v1';
|
|
|
31
31
|
const WebRPCSchemaVersion = 'v0.4.0';
|
|
32
32
|
|
|
33
33
|
// Schema hash generated from your RIDL schema
|
|
34
|
-
const WebRPCSchemaHash = '
|
|
34
|
+
const WebRPCSchemaHash = 'cae735346d8e5c3dce48dce9f85116989b6beffd';
|
|
35
35
|
|
|
36
36
|
//
|
|
37
37
|
// Types
|
|
@@ -91,6 +91,12 @@ let SortOrder = /*#__PURE__*/function (SortOrder) {
|
|
|
91
91
|
SortOrder["ASC"] = "ASC";
|
|
92
92
|
return SortOrder;
|
|
93
93
|
}({});
|
|
94
|
+
let ContractVerificationStatus = /*#__PURE__*/function (ContractVerificationStatus) {
|
|
95
|
+
ContractVerificationStatus["VERIFIED"] = "VERIFIED";
|
|
96
|
+
ContractVerificationStatus["UNVERIFIED"] = "UNVERIFIED";
|
|
97
|
+
ContractVerificationStatus["ALL"] = "ALL";
|
|
98
|
+
return ContractVerificationStatus;
|
|
99
|
+
}({});
|
|
94
100
|
//
|
|
95
101
|
// Client
|
|
96
102
|
//
|
|
@@ -164,6 +170,61 @@ class Indexer {
|
|
|
164
170
|
});
|
|
165
171
|
});
|
|
166
172
|
};
|
|
173
|
+
this.getNativeTokenBalance = (args, headers, signal) => {
|
|
174
|
+
return this.fetch(this.url('GetNativeTokenBalance'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
175
|
+
return buildResponse(res).then(_data => {
|
|
176
|
+
return {
|
|
177
|
+
balance: _data.balance
|
|
178
|
+
};
|
|
179
|
+
});
|
|
180
|
+
}, error => {
|
|
181
|
+
throw WebrpcRequestFailedError.new({
|
|
182
|
+
cause: `fetch(): ${error.message || ''}`
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
};
|
|
186
|
+
this.getTokenBalancesSummary = (args, headers, signal) => {
|
|
187
|
+
return this.fetch(this.url('GetTokenBalancesSummary'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
188
|
+
return buildResponse(res).then(_data => {
|
|
189
|
+
return {
|
|
190
|
+
page: _data.page,
|
|
191
|
+
balances: _data.balances
|
|
192
|
+
};
|
|
193
|
+
});
|
|
194
|
+
}, error => {
|
|
195
|
+
throw WebrpcRequestFailedError.new({
|
|
196
|
+
cause: `fetch(): ${error.message || ''}`
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
};
|
|
200
|
+
this.getTokenBalancesDetails = (args, headers, signal) => {
|
|
201
|
+
return this.fetch(this.url('GetTokenBalancesDetails'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
202
|
+
return buildResponse(res).then(_data => {
|
|
203
|
+
return {
|
|
204
|
+
page: _data.page,
|
|
205
|
+
balances: _data.balances
|
|
206
|
+
};
|
|
207
|
+
});
|
|
208
|
+
}, error => {
|
|
209
|
+
throw WebrpcRequestFailedError.new({
|
|
210
|
+
cause: `fetch(): ${error.message || ''}`
|
|
211
|
+
});
|
|
212
|
+
});
|
|
213
|
+
};
|
|
214
|
+
this.getTokenBalancesByContract = (args, headers, signal) => {
|
|
215
|
+
return this.fetch(this.url('GetTokenBalancesByContract'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
216
|
+
return buildResponse(res).then(_data => {
|
|
217
|
+
return {
|
|
218
|
+
page: _data.page,
|
|
219
|
+
balances: _data.balances
|
|
220
|
+
};
|
|
221
|
+
});
|
|
222
|
+
}, error => {
|
|
223
|
+
throw WebrpcRequestFailedError.new({
|
|
224
|
+
cause: `fetch(): ${error.message || ''}`
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
};
|
|
167
228
|
this.getTokenBalances = (args, headers, signal) => {
|
|
168
229
|
return this.fetch(this.url('GetTokenBalances'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
169
230
|
return buildResponse(res).then(_data => {
|
|
@@ -427,7 +488,7 @@ class Indexer {
|
|
|
427
488
|
});
|
|
428
489
|
return _fetch();
|
|
429
490
|
};
|
|
430
|
-
this.hostname = hostname;
|
|
491
|
+
this.hostname = hostname.replace(/\/*$/, '');
|
|
431
492
|
this.fetch = (input, init) => fetch(input, init);
|
|
432
493
|
}
|
|
433
494
|
url(name) {
|
|
@@ -463,89 +524,79 @@ const sseResponse = async (res, options, retryFetch) => {
|
|
|
463
524
|
let buffer = '';
|
|
464
525
|
let lastReadTime = Date.now();
|
|
465
526
|
const timeout = (10 + 1) * 1000;
|
|
466
|
-
let
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
527
|
+
let timeoutError = false;
|
|
528
|
+
const intervalId = setInterval(() => {
|
|
529
|
+
if (Date.now() - lastReadTime > timeout) {
|
|
530
|
+
timeoutError = true;
|
|
531
|
+
clearInterval(intervalId);
|
|
532
|
+
reader.releaseLock();
|
|
533
|
+
}
|
|
534
|
+
}, timeout);
|
|
535
|
+
while (true) {
|
|
536
|
+
let value;
|
|
537
|
+
let done;
|
|
538
|
+
try {
|
|
539
|
+
;
|
|
540
|
+
({
|
|
541
|
+
value,
|
|
542
|
+
done
|
|
543
|
+
} = await reader.read());
|
|
544
|
+
if (timeoutError) throw new Error('Timeout, no data or heartbeat received');
|
|
545
|
+
lastReadTime = Date.now();
|
|
546
|
+
buffer += decoder.decode(value, {
|
|
547
|
+
stream: true
|
|
548
|
+
});
|
|
549
|
+
} catch (error) {
|
|
550
|
+
let message = '';
|
|
551
|
+
if (error instanceof Error) {
|
|
552
|
+
message = error.message;
|
|
473
553
|
}
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
}
|
|
493
|
-
if (error instanceof DOMException && error.name === 'AbortError') {
|
|
494
|
-
onError(WebrpcRequestFailedError.new({
|
|
495
|
-
message: 'AbortError',
|
|
496
|
-
cause: `AbortError: ${message}`
|
|
497
|
-
}), () => {
|
|
498
|
-
throw new Error('Abort signal cannot be used to reconnect');
|
|
499
|
-
});
|
|
500
|
-
} else {
|
|
501
|
-
onError(WebrpcStreamLostError.new({
|
|
502
|
-
cause: `reader.read(): ${message}`
|
|
503
|
-
}), retryFetch);
|
|
504
|
-
}
|
|
505
|
-
return;
|
|
554
|
+
if (error instanceof DOMException && error.name === 'AbortError') {
|
|
555
|
+
onError(WebrpcRequestFailedError.new({
|
|
556
|
+
message: 'AbortError',
|
|
557
|
+
cause: `AbortError: ${message}`
|
|
558
|
+
}), () => {
|
|
559
|
+
throw new Error('Abort signal cannot be used to reconnect');
|
|
560
|
+
});
|
|
561
|
+
} else {
|
|
562
|
+
onError(WebrpcStreamLostError.new({
|
|
563
|
+
cause: `reader.read(): ${message}`
|
|
564
|
+
}), retryFetch);
|
|
565
|
+
}
|
|
566
|
+
return;
|
|
567
|
+
}
|
|
568
|
+
let lines = buffer.split('\n');
|
|
569
|
+
for (let i = 0; i < lines.length - 1; i++) {
|
|
570
|
+
if (lines[i].length == 0) {
|
|
571
|
+
continue;
|
|
506
572
|
}
|
|
507
|
-
let
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
573
|
+
let data;
|
|
574
|
+
try {
|
|
575
|
+
data = JSON.parse(lines[i]);
|
|
576
|
+
if (data.hasOwnProperty('webrpcError')) {
|
|
577
|
+
const error = data.webrpcError;
|
|
578
|
+
const code = typeof error.code === 'number' ? error.code : 0;
|
|
579
|
+
onError((webrpcErrorByCode[code] || WebrpcError).new(error), retryFetch);
|
|
580
|
+
return;
|
|
511
581
|
}
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
if (data.hasOwnProperty('webrpcError')) {
|
|
516
|
-
const error = data.webrpcError;
|
|
517
|
-
const code = typeof error.code === 'number' ? error.code : 0;
|
|
518
|
-
onError((webrpcErrorByCode[code] || WebrpcError).new(error), retryFetch);
|
|
519
|
-
return;
|
|
520
|
-
}
|
|
521
|
-
} catch (error) {
|
|
522
|
-
if (error instanceof Error && error.message === 'Abort signal cannot be used to reconnect') {
|
|
523
|
-
throw error;
|
|
524
|
-
}
|
|
525
|
-
onError(WebrpcBadResponseError.new({
|
|
526
|
-
status: res.status,
|
|
527
|
-
// @ts-ignore
|
|
528
|
-
cause: `JSON.parse(): ${error.message}`
|
|
529
|
-
}), retryFetch);
|
|
582
|
+
} catch (error) {
|
|
583
|
+
if (error instanceof Error && error.message === 'Abort signal cannot be used to reconnect') {
|
|
584
|
+
throw error;
|
|
530
585
|
}
|
|
531
|
-
|
|
586
|
+
onError(WebrpcBadResponseError.new({
|
|
587
|
+
status: res.status,
|
|
588
|
+
// @ts-ignore
|
|
589
|
+
cause: `JSON.parse(): ${error.message}`
|
|
590
|
+
}), retryFetch);
|
|
532
591
|
}
|
|
533
|
-
|
|
534
|
-
buffer = lines[lines.length - 1];
|
|
535
|
-
continue;
|
|
536
|
-
}
|
|
537
|
-
onClose && onClose();
|
|
538
|
-
return;
|
|
592
|
+
onMessage(data);
|
|
539
593
|
}
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
onError(error, retryFetch);
|
|
544
|
-
} else {
|
|
545
|
-
throw error;
|
|
594
|
+
if (!done) {
|
|
595
|
+
buffer = lines[lines.length - 1];
|
|
596
|
+
continue;
|
|
546
597
|
}
|
|
547
|
-
|
|
548
|
-
|
|
598
|
+
onClose && onClose();
|
|
599
|
+
return;
|
|
549
600
|
}
|
|
550
601
|
};
|
|
551
602
|
const createHTTPRequest = (body = {}, headers = {}, signal = null) => {
|
|
@@ -848,6 +899,7 @@ class SequenceIndexer extends Indexer {
|
|
|
848
899
|
|
|
849
900
|
exports.AbortedError = AbortedError;
|
|
850
901
|
exports.ContractType = ContractType;
|
|
902
|
+
exports.ContractVerificationStatus = ContractVerificationStatus;
|
|
851
903
|
exports.EventLogDataType = EventLogDataType;
|
|
852
904
|
exports.EventLogType = EventLogType;
|
|
853
905
|
exports.Indexer = Indexer;
|
|
@@ -18,9 +18,9 @@ function _extends() {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
/* eslint-disable */
|
|
21
|
-
// sequence-indexer v0.4.0
|
|
21
|
+
// sequence-indexer v0.4.0 cae735346d8e5c3dce48dce9f85116989b6beffd
|
|
22
22
|
// --
|
|
23
|
-
// Code generated by webrpc-gen@v0.
|
|
23
|
+
// Code generated by webrpc-gen@v0.20.3 with typescript generator. DO NOT EDIT.
|
|
24
24
|
//
|
|
25
25
|
// webrpc-gen -schema=indexer.ridl -target=typescript -client -out=./clients/indexer.gen.ts
|
|
26
26
|
|
|
@@ -31,7 +31,7 @@ const WebRPCVersion = 'v1';
|
|
|
31
31
|
const WebRPCSchemaVersion = 'v0.4.0';
|
|
32
32
|
|
|
33
33
|
// Schema hash generated from your RIDL schema
|
|
34
|
-
const WebRPCSchemaHash = '
|
|
34
|
+
const WebRPCSchemaHash = 'cae735346d8e5c3dce48dce9f85116989b6beffd';
|
|
35
35
|
|
|
36
36
|
//
|
|
37
37
|
// Types
|
|
@@ -91,6 +91,12 @@ let SortOrder = /*#__PURE__*/function (SortOrder) {
|
|
|
91
91
|
SortOrder["ASC"] = "ASC";
|
|
92
92
|
return SortOrder;
|
|
93
93
|
}({});
|
|
94
|
+
let ContractVerificationStatus = /*#__PURE__*/function (ContractVerificationStatus) {
|
|
95
|
+
ContractVerificationStatus["VERIFIED"] = "VERIFIED";
|
|
96
|
+
ContractVerificationStatus["UNVERIFIED"] = "UNVERIFIED";
|
|
97
|
+
ContractVerificationStatus["ALL"] = "ALL";
|
|
98
|
+
return ContractVerificationStatus;
|
|
99
|
+
}({});
|
|
94
100
|
//
|
|
95
101
|
// Client
|
|
96
102
|
//
|
|
@@ -164,6 +170,61 @@ class Indexer {
|
|
|
164
170
|
});
|
|
165
171
|
});
|
|
166
172
|
};
|
|
173
|
+
this.getNativeTokenBalance = (args, headers, signal) => {
|
|
174
|
+
return this.fetch(this.url('GetNativeTokenBalance'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
175
|
+
return buildResponse(res).then(_data => {
|
|
176
|
+
return {
|
|
177
|
+
balance: _data.balance
|
|
178
|
+
};
|
|
179
|
+
});
|
|
180
|
+
}, error => {
|
|
181
|
+
throw WebrpcRequestFailedError.new({
|
|
182
|
+
cause: `fetch(): ${error.message || ''}`
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
};
|
|
186
|
+
this.getTokenBalancesSummary = (args, headers, signal) => {
|
|
187
|
+
return this.fetch(this.url('GetTokenBalancesSummary'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
188
|
+
return buildResponse(res).then(_data => {
|
|
189
|
+
return {
|
|
190
|
+
page: _data.page,
|
|
191
|
+
balances: _data.balances
|
|
192
|
+
};
|
|
193
|
+
});
|
|
194
|
+
}, error => {
|
|
195
|
+
throw WebrpcRequestFailedError.new({
|
|
196
|
+
cause: `fetch(): ${error.message || ''}`
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
};
|
|
200
|
+
this.getTokenBalancesDetails = (args, headers, signal) => {
|
|
201
|
+
return this.fetch(this.url('GetTokenBalancesDetails'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
202
|
+
return buildResponse(res).then(_data => {
|
|
203
|
+
return {
|
|
204
|
+
page: _data.page,
|
|
205
|
+
balances: _data.balances
|
|
206
|
+
};
|
|
207
|
+
});
|
|
208
|
+
}, error => {
|
|
209
|
+
throw WebrpcRequestFailedError.new({
|
|
210
|
+
cause: `fetch(): ${error.message || ''}`
|
|
211
|
+
});
|
|
212
|
+
});
|
|
213
|
+
};
|
|
214
|
+
this.getTokenBalancesByContract = (args, headers, signal) => {
|
|
215
|
+
return this.fetch(this.url('GetTokenBalancesByContract'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
216
|
+
return buildResponse(res).then(_data => {
|
|
217
|
+
return {
|
|
218
|
+
page: _data.page,
|
|
219
|
+
balances: _data.balances
|
|
220
|
+
};
|
|
221
|
+
});
|
|
222
|
+
}, error => {
|
|
223
|
+
throw WebrpcRequestFailedError.new({
|
|
224
|
+
cause: `fetch(): ${error.message || ''}`
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
};
|
|
167
228
|
this.getTokenBalances = (args, headers, signal) => {
|
|
168
229
|
return this.fetch(this.url('GetTokenBalances'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
169
230
|
return buildResponse(res).then(_data => {
|
|
@@ -427,7 +488,7 @@ class Indexer {
|
|
|
427
488
|
});
|
|
428
489
|
return _fetch();
|
|
429
490
|
};
|
|
430
|
-
this.hostname = hostname;
|
|
491
|
+
this.hostname = hostname.replace(/\/*$/, '');
|
|
431
492
|
this.fetch = (input, init) => fetch(input, init);
|
|
432
493
|
}
|
|
433
494
|
url(name) {
|
|
@@ -463,89 +524,79 @@ const sseResponse = async (res, options, retryFetch) => {
|
|
|
463
524
|
let buffer = '';
|
|
464
525
|
let lastReadTime = Date.now();
|
|
465
526
|
const timeout = (10 + 1) * 1000;
|
|
466
|
-
let
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
527
|
+
let timeoutError = false;
|
|
528
|
+
const intervalId = setInterval(() => {
|
|
529
|
+
if (Date.now() - lastReadTime > timeout) {
|
|
530
|
+
timeoutError = true;
|
|
531
|
+
clearInterval(intervalId);
|
|
532
|
+
reader.releaseLock();
|
|
533
|
+
}
|
|
534
|
+
}, timeout);
|
|
535
|
+
while (true) {
|
|
536
|
+
let value;
|
|
537
|
+
let done;
|
|
538
|
+
try {
|
|
539
|
+
;
|
|
540
|
+
({
|
|
541
|
+
value,
|
|
542
|
+
done
|
|
543
|
+
} = await reader.read());
|
|
544
|
+
if (timeoutError) throw new Error('Timeout, no data or heartbeat received');
|
|
545
|
+
lastReadTime = Date.now();
|
|
546
|
+
buffer += decoder.decode(value, {
|
|
547
|
+
stream: true
|
|
548
|
+
});
|
|
549
|
+
} catch (error) {
|
|
550
|
+
let message = '';
|
|
551
|
+
if (error instanceof Error) {
|
|
552
|
+
message = error.message;
|
|
473
553
|
}
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
}
|
|
493
|
-
if (error instanceof DOMException && error.name === 'AbortError') {
|
|
494
|
-
onError(WebrpcRequestFailedError.new({
|
|
495
|
-
message: 'AbortError',
|
|
496
|
-
cause: `AbortError: ${message}`
|
|
497
|
-
}), () => {
|
|
498
|
-
throw new Error('Abort signal cannot be used to reconnect');
|
|
499
|
-
});
|
|
500
|
-
} else {
|
|
501
|
-
onError(WebrpcStreamLostError.new({
|
|
502
|
-
cause: `reader.read(): ${message}`
|
|
503
|
-
}), retryFetch);
|
|
504
|
-
}
|
|
505
|
-
return;
|
|
554
|
+
if (error instanceof DOMException && error.name === 'AbortError') {
|
|
555
|
+
onError(WebrpcRequestFailedError.new({
|
|
556
|
+
message: 'AbortError',
|
|
557
|
+
cause: `AbortError: ${message}`
|
|
558
|
+
}), () => {
|
|
559
|
+
throw new Error('Abort signal cannot be used to reconnect');
|
|
560
|
+
});
|
|
561
|
+
} else {
|
|
562
|
+
onError(WebrpcStreamLostError.new({
|
|
563
|
+
cause: `reader.read(): ${message}`
|
|
564
|
+
}), retryFetch);
|
|
565
|
+
}
|
|
566
|
+
return;
|
|
567
|
+
}
|
|
568
|
+
let lines = buffer.split('\n');
|
|
569
|
+
for (let i = 0; i < lines.length - 1; i++) {
|
|
570
|
+
if (lines[i].length == 0) {
|
|
571
|
+
continue;
|
|
506
572
|
}
|
|
507
|
-
let
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
573
|
+
let data;
|
|
574
|
+
try {
|
|
575
|
+
data = JSON.parse(lines[i]);
|
|
576
|
+
if (data.hasOwnProperty('webrpcError')) {
|
|
577
|
+
const error = data.webrpcError;
|
|
578
|
+
const code = typeof error.code === 'number' ? error.code : 0;
|
|
579
|
+
onError((webrpcErrorByCode[code] || WebrpcError).new(error), retryFetch);
|
|
580
|
+
return;
|
|
511
581
|
}
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
if (data.hasOwnProperty('webrpcError')) {
|
|
516
|
-
const error = data.webrpcError;
|
|
517
|
-
const code = typeof error.code === 'number' ? error.code : 0;
|
|
518
|
-
onError((webrpcErrorByCode[code] || WebrpcError).new(error), retryFetch);
|
|
519
|
-
return;
|
|
520
|
-
}
|
|
521
|
-
} catch (error) {
|
|
522
|
-
if (error instanceof Error && error.message === 'Abort signal cannot be used to reconnect') {
|
|
523
|
-
throw error;
|
|
524
|
-
}
|
|
525
|
-
onError(WebrpcBadResponseError.new({
|
|
526
|
-
status: res.status,
|
|
527
|
-
// @ts-ignore
|
|
528
|
-
cause: `JSON.parse(): ${error.message}`
|
|
529
|
-
}), retryFetch);
|
|
582
|
+
} catch (error) {
|
|
583
|
+
if (error instanceof Error && error.message === 'Abort signal cannot be used to reconnect') {
|
|
584
|
+
throw error;
|
|
530
585
|
}
|
|
531
|
-
|
|
586
|
+
onError(WebrpcBadResponseError.new({
|
|
587
|
+
status: res.status,
|
|
588
|
+
// @ts-ignore
|
|
589
|
+
cause: `JSON.parse(): ${error.message}`
|
|
590
|
+
}), retryFetch);
|
|
532
591
|
}
|
|
533
|
-
|
|
534
|
-
buffer = lines[lines.length - 1];
|
|
535
|
-
continue;
|
|
536
|
-
}
|
|
537
|
-
onClose && onClose();
|
|
538
|
-
return;
|
|
592
|
+
onMessage(data);
|
|
539
593
|
}
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
onError(error, retryFetch);
|
|
544
|
-
} else {
|
|
545
|
-
throw error;
|
|
594
|
+
if (!done) {
|
|
595
|
+
buffer = lines[lines.length - 1];
|
|
596
|
+
continue;
|
|
546
597
|
}
|
|
547
|
-
|
|
548
|
-
|
|
598
|
+
onClose && onClose();
|
|
599
|
+
return;
|
|
549
600
|
}
|
|
550
601
|
};
|
|
551
602
|
const createHTTPRequest = (body = {}, headers = {}, signal = null) => {
|
|
@@ -848,6 +899,7 @@ class SequenceIndexer extends Indexer {
|
|
|
848
899
|
|
|
849
900
|
exports.AbortedError = AbortedError;
|
|
850
901
|
exports.ContractType = ContractType;
|
|
902
|
+
exports.ContractVerificationStatus = ContractVerificationStatus;
|
|
851
903
|
exports.EventLogDataType = EventLogDataType;
|
|
852
904
|
exports.EventLogType = EventLogType;
|
|
853
905
|
exports.Indexer = Indexer;
|