@0xsequence/relayer 2.2.10 → 2.2.11
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-relayer.cjs.dev.js +289 -54
- package/dist/0xsequence-relayer.cjs.prod.js +289 -54
- package/dist/0xsequence-relayer.esm.js +289 -54
- package/dist/declarations/src/index.d.ts +4 -0
- package/dist/declarations/src/local-relayer.d.ts +4 -0
- package/dist/declarations/src/provider-relayer.d.ts +4 -0
- package/dist/declarations/src/rpc-relayer/index.d.ts +4 -0
- package/dist/declarations/src/rpc-relayer/relayer.gen.d.ts +158 -59
- package/package.json +6 -6
- package/src/index.ts +6 -0
- package/src/local-relayer.ts +16 -0
- package/src/provider-relayer.ts +8 -0
- package/src/rpc-relayer/index.ts +16 -0
- package/src/rpc-relayer/relayer.gen.ts +405 -133
|
@@ -255,18 +255,47 @@ class LocalRelayer extends ProviderRelayer {
|
|
|
255
255
|
cost: 0
|
|
256
256
|
};
|
|
257
257
|
}
|
|
258
|
+
async listGasSponsors(args) {
|
|
259
|
+
return {
|
|
260
|
+
page: {
|
|
261
|
+
page: 0,
|
|
262
|
+
pageSize: 100
|
|
263
|
+
},
|
|
264
|
+
gasSponsors: []
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
async addGasSponsor(args) {
|
|
268
|
+
return {
|
|
269
|
+
status: true,
|
|
270
|
+
gasSponsor: {}
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
async updateGasSponsor(args) {
|
|
274
|
+
return {
|
|
275
|
+
status: true,
|
|
276
|
+
gasSponsor: {}
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
async removeGasSponsor(args) {
|
|
280
|
+
return {
|
|
281
|
+
status: true
|
|
282
|
+
};
|
|
283
|
+
}
|
|
258
284
|
}
|
|
259
285
|
function isAbstractSigner(signer) {
|
|
260
286
|
return signer && typeof signer === 'object' && typeof signer.provider === 'object' && typeof signer.getAddress === 'function' && typeof signer.connect === 'function';
|
|
261
287
|
}
|
|
262
288
|
|
|
263
289
|
/* eslint-disable */
|
|
264
|
-
// sequence-relayer v0.4.1
|
|
290
|
+
// sequence-relayer v0.4.1 9c42435ea10493aecdfbbecb2be284b8dd721539
|
|
265
291
|
// --
|
|
266
|
-
// Code generated by webrpc-gen@v0.
|
|
292
|
+
// Code generated by webrpc-gen@v0.22.0 with typescript generator. DO NOT EDIT.
|
|
267
293
|
//
|
|
268
294
|
// webrpc-gen -schema=relayer.ridl -target=typescript -client -out=./clients/relayer.gen.ts
|
|
269
295
|
|
|
296
|
+
const WebrpcHeader = 'Webrpc';
|
|
297
|
+
const WebrpcHeaderValue = 'webrpc@v0.22.0;gen-typescript@v0.16.1;sequence-relayer@v0.4.1';
|
|
298
|
+
|
|
270
299
|
// WebRPC description and code-gen version
|
|
271
300
|
const WebRPCVersion = 'v1';
|
|
272
301
|
|
|
@@ -274,7 +303,42 @@ const WebRPCVersion = 'v1';
|
|
|
274
303
|
const WebRPCSchemaVersion = 'v0.4.1';
|
|
275
304
|
|
|
276
305
|
// Schema hash generated from your RIDL schema
|
|
277
|
-
const WebRPCSchemaHash = '
|
|
306
|
+
const WebRPCSchemaHash = '9c42435ea10493aecdfbbecb2be284b8dd721539';
|
|
307
|
+
function VersionFromHeader(headers) {
|
|
308
|
+
const headerValue = headers.get(WebrpcHeader);
|
|
309
|
+
if (!headerValue) {
|
|
310
|
+
return {
|
|
311
|
+
webrpcGenVersion: '',
|
|
312
|
+
codeGenName: '',
|
|
313
|
+
codeGenVersion: '',
|
|
314
|
+
schemaName: '',
|
|
315
|
+
schemaVersion: ''
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
return parseWebrpcGenVersions(headerValue);
|
|
319
|
+
}
|
|
320
|
+
function parseWebrpcGenVersions(header) {
|
|
321
|
+
const versions = header.split(';');
|
|
322
|
+
if (versions.length < 3) {
|
|
323
|
+
return {
|
|
324
|
+
webrpcGenVersion: '',
|
|
325
|
+
codeGenName: '',
|
|
326
|
+
codeGenVersion: '',
|
|
327
|
+
schemaName: '',
|
|
328
|
+
schemaVersion: ''
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
const [_, webrpcGenVersion] = versions[0].split('@');
|
|
332
|
+
const [codeGenName, codeGenVersion] = versions[1].split('@');
|
|
333
|
+
const [schemaName, schemaVersion] = versions[2].split('@');
|
|
334
|
+
return {
|
|
335
|
+
webrpcGenVersion,
|
|
336
|
+
codeGenName,
|
|
337
|
+
codeGenVersion,
|
|
338
|
+
schemaName,
|
|
339
|
+
schemaVersion
|
|
340
|
+
};
|
|
341
|
+
}
|
|
278
342
|
|
|
279
343
|
//
|
|
280
344
|
// Types
|
|
@@ -587,25 +651,11 @@ class Relayer {
|
|
|
587
651
|
});
|
|
588
652
|
});
|
|
589
653
|
};
|
|
590
|
-
this.
|
|
591
|
-
return this.fetch(this.url('
|
|
592
|
-
return buildResponse(res).then(_data => {
|
|
593
|
-
return {
|
|
594
|
-
gasSponsor: _data.gasSponsor
|
|
595
|
-
};
|
|
596
|
-
});
|
|
597
|
-
}, error => {
|
|
598
|
-
throw WebrpcRequestFailedError.new({
|
|
599
|
-
cause: `fetch(): ${error.message || ''}`
|
|
600
|
-
});
|
|
601
|
-
});
|
|
602
|
-
};
|
|
603
|
-
this.addressGasSponsors = (args, headers, signal) => {
|
|
604
|
-
return this.fetch(this.url('AddressGasSponsors'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
654
|
+
this.nextGasTankBalanceAdjustmentNonce = (args, headers, signal) => {
|
|
655
|
+
return this.fetch(this.url('NextGasTankBalanceAdjustmentNonce'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
605
656
|
return buildResponse(res).then(_data => {
|
|
606
657
|
return {
|
|
607
|
-
|
|
608
|
-
gasSponsors: _data.gasSponsors
|
|
658
|
+
nonce: _data.nonce
|
|
609
659
|
};
|
|
610
660
|
});
|
|
611
661
|
}, error => {
|
|
@@ -614,12 +664,12 @@ class Relayer {
|
|
|
614
664
|
});
|
|
615
665
|
});
|
|
616
666
|
};
|
|
617
|
-
this.
|
|
618
|
-
return this.fetch(this.url('
|
|
667
|
+
this.adjustGasTankBalance = (args, headers, signal) => {
|
|
668
|
+
return this.fetch(this.url('AdjustGasTankBalance'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
619
669
|
return buildResponse(res).then(_data => {
|
|
620
670
|
return {
|
|
621
|
-
|
|
622
|
-
|
|
671
|
+
status: _data.status,
|
|
672
|
+
adjustment: _data.adjustment
|
|
623
673
|
};
|
|
624
674
|
});
|
|
625
675
|
}, error => {
|
|
@@ -628,12 +678,11 @@ class Relayer {
|
|
|
628
678
|
});
|
|
629
679
|
});
|
|
630
680
|
};
|
|
631
|
-
this.
|
|
632
|
-
return this.fetch(this.url('
|
|
681
|
+
this.getGasTankBalanceAdjustment = (args, headers, signal) => {
|
|
682
|
+
return this.fetch(this.url('GetGasTankBalanceAdjustment'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
633
683
|
return buildResponse(res).then(_data => {
|
|
634
684
|
return {
|
|
635
|
-
|
|
636
|
-
gasSponsor: _data.gasSponsor
|
|
685
|
+
adjustment: _data.adjustment
|
|
637
686
|
};
|
|
638
687
|
});
|
|
639
688
|
}, error => {
|
|
@@ -642,12 +691,12 @@ class Relayer {
|
|
|
642
691
|
});
|
|
643
692
|
});
|
|
644
693
|
};
|
|
645
|
-
this.
|
|
646
|
-
return this.fetch(this.url('
|
|
694
|
+
this.listGasTankBalanceAdjustments = (args, headers, signal) => {
|
|
695
|
+
return this.fetch(this.url('ListGasTankBalanceAdjustments'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
647
696
|
return buildResponse(res).then(_data => {
|
|
648
697
|
return {
|
|
649
|
-
|
|
650
|
-
|
|
698
|
+
page: _data.page,
|
|
699
|
+
adjustments: _data.adjustments
|
|
651
700
|
};
|
|
652
701
|
});
|
|
653
702
|
}, error => {
|
|
@@ -656,11 +705,12 @@ class Relayer {
|
|
|
656
705
|
});
|
|
657
706
|
});
|
|
658
707
|
};
|
|
659
|
-
this.
|
|
660
|
-
return this.fetch(this.url('
|
|
708
|
+
this.listGasSponsors = (args, headers, signal) => {
|
|
709
|
+
return this.fetch(this.url('ListGasSponsors'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
661
710
|
return buildResponse(res).then(_data => {
|
|
662
711
|
return {
|
|
663
|
-
|
|
712
|
+
page: _data.page,
|
|
713
|
+
gasSponsors: _data.gasSponsors
|
|
664
714
|
};
|
|
665
715
|
});
|
|
666
716
|
}, error => {
|
|
@@ -669,11 +719,11 @@ class Relayer {
|
|
|
669
719
|
});
|
|
670
720
|
});
|
|
671
721
|
};
|
|
672
|
-
this.
|
|
673
|
-
return this.fetch(this.url('
|
|
722
|
+
this.getGasSponsor = (args, headers, signal) => {
|
|
723
|
+
return this.fetch(this.url('GetGasSponsor'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
674
724
|
return buildResponse(res).then(_data => {
|
|
675
725
|
return {
|
|
676
|
-
|
|
726
|
+
gasSponsor: _data.gasSponsor
|
|
677
727
|
};
|
|
678
728
|
});
|
|
679
729
|
}, error => {
|
|
@@ -682,11 +732,12 @@ class Relayer {
|
|
|
682
732
|
});
|
|
683
733
|
});
|
|
684
734
|
};
|
|
685
|
-
this.
|
|
686
|
-
return this.fetch(this.url('
|
|
735
|
+
this.addGasSponsor = (args, headers, signal) => {
|
|
736
|
+
return this.fetch(this.url('AddGasSponsor'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
687
737
|
return buildResponse(res).then(_data => {
|
|
688
738
|
return {
|
|
689
|
-
|
|
739
|
+
status: _data.status,
|
|
740
|
+
gasSponsor: _data.gasSponsor
|
|
690
741
|
};
|
|
691
742
|
});
|
|
692
743
|
}, error => {
|
|
@@ -695,12 +746,12 @@ class Relayer {
|
|
|
695
746
|
});
|
|
696
747
|
});
|
|
697
748
|
};
|
|
698
|
-
this.
|
|
699
|
-
return this.fetch(this.url('
|
|
749
|
+
this.updateGasSponsor = (args, headers, signal) => {
|
|
750
|
+
return this.fetch(this.url('UpdateGasSponsor'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
700
751
|
return buildResponse(res).then(_data => {
|
|
701
752
|
return {
|
|
702
753
|
status: _data.status,
|
|
703
|
-
|
|
754
|
+
gasSponsor: _data.gasSponsor
|
|
704
755
|
};
|
|
705
756
|
});
|
|
706
757
|
}, error => {
|
|
@@ -709,11 +760,11 @@ class Relayer {
|
|
|
709
760
|
});
|
|
710
761
|
});
|
|
711
762
|
};
|
|
712
|
-
this.
|
|
713
|
-
return this.fetch(this.url('
|
|
763
|
+
this.removeGasSponsor = (args, headers, signal) => {
|
|
764
|
+
return this.fetch(this.url('RemoveGasSponsor'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
714
765
|
return buildResponse(res).then(_data => {
|
|
715
766
|
return {
|
|
716
|
-
|
|
767
|
+
status: _data.status
|
|
717
768
|
};
|
|
718
769
|
});
|
|
719
770
|
}, error => {
|
|
@@ -722,12 +773,12 @@ class Relayer {
|
|
|
722
773
|
});
|
|
723
774
|
});
|
|
724
775
|
};
|
|
725
|
-
this.
|
|
726
|
-
return this.fetch(this.url('
|
|
776
|
+
this.addressGasSponsors = (args, headers, signal) => {
|
|
777
|
+
return this.fetch(this.url('AddressGasSponsors'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
727
778
|
return buildResponse(res).then(_data => {
|
|
728
779
|
return {
|
|
729
780
|
page: _data.page,
|
|
730
|
-
|
|
781
|
+
gasSponsors: _data.gasSponsors
|
|
731
782
|
};
|
|
732
783
|
});
|
|
733
784
|
}, error => {
|
|
@@ -770,11 +821,13 @@ class Relayer {
|
|
|
770
821
|
}
|
|
771
822
|
}
|
|
772
823
|
const createHTTPRequest = (body = {}, headers = {}, signal = null) => {
|
|
824
|
+
const reqHeaders = _extends({}, headers, {
|
|
825
|
+
'Content-Type': 'application/json'
|
|
826
|
+
});
|
|
827
|
+
reqHeaders[WebrpcHeader] = WebrpcHeaderValue;
|
|
773
828
|
return {
|
|
774
829
|
method: 'POST',
|
|
775
|
-
headers:
|
|
776
|
-
'Content-Type': 'application/json'
|
|
777
|
-
}),
|
|
830
|
+
headers: reqHeaders,
|
|
778
831
|
body: JSON.stringify(body || {}),
|
|
779
832
|
signal
|
|
780
833
|
};
|
|
@@ -912,6 +965,12 @@ class PermissionDeniedError extends WebrpcError {
|
|
|
912
965
|
Object.setPrototypeOf(this, PermissionDeniedError.prototype);
|
|
913
966
|
}
|
|
914
967
|
}
|
|
968
|
+
class SessionExpiredError extends WebrpcError {
|
|
969
|
+
constructor(name = 'SessionExpired', code = 1002, message = 'Session expired', status = 0, cause) {
|
|
970
|
+
super(name, code, message, status, cause);
|
|
971
|
+
Object.setPrototypeOf(this, SessionExpiredError.prototype);
|
|
972
|
+
}
|
|
973
|
+
}
|
|
915
974
|
class MethodNotFoundError extends WebrpcError {
|
|
916
975
|
constructor(name = 'MethodNotFound', code = 1003, message = 'Method not found', status = 0, cause) {
|
|
917
976
|
super(name, code, message, status, cause);
|
|
@@ -936,6 +995,84 @@ class GeoblockedError extends WebrpcError {
|
|
|
936
995
|
Object.setPrototypeOf(this, GeoblockedError.prototype);
|
|
937
996
|
}
|
|
938
997
|
}
|
|
998
|
+
class RateLimitedError extends WebrpcError {
|
|
999
|
+
constructor(name = 'RateLimited', code = 1007, message = 'Rate-limited. Please slow down.', status = 0, cause) {
|
|
1000
|
+
super(name, code, message, status, cause);
|
|
1001
|
+
Object.setPrototypeOf(this, RateLimitedError.prototype);
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1004
|
+
class ProjectNotFoundError extends WebrpcError {
|
|
1005
|
+
constructor(name = 'ProjectNotFound', code = 1008, message = 'Project not found', status = 0, cause) {
|
|
1006
|
+
super(name, code, message, status, cause);
|
|
1007
|
+
Object.setPrototypeOf(this, ProjectNotFoundError.prototype);
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
class AccessKeyNotFoundError extends WebrpcError {
|
|
1011
|
+
constructor(name = 'AccessKeyNotFound', code = 1101, message = 'Access key not found', status = 0, cause) {
|
|
1012
|
+
super(name, code, message, status, cause);
|
|
1013
|
+
Object.setPrototypeOf(this, AccessKeyNotFoundError.prototype);
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
class AccessKeyMismatchError extends WebrpcError {
|
|
1017
|
+
constructor(name = 'AccessKeyMismatch', code = 1102, message = 'Access key mismatch', status = 0, cause) {
|
|
1018
|
+
super(name, code, message, status, cause);
|
|
1019
|
+
Object.setPrototypeOf(this, AccessKeyMismatchError.prototype);
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
class InvalidOriginError extends WebrpcError {
|
|
1023
|
+
constructor(name = 'InvalidOrigin', code = 1103, message = 'Invalid origin for Access Key', status = 0, cause) {
|
|
1024
|
+
super(name, code, message, status, cause);
|
|
1025
|
+
Object.setPrototypeOf(this, InvalidOriginError.prototype);
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
class InvalidServiceError extends WebrpcError {
|
|
1029
|
+
constructor(name = 'InvalidService', code = 1104, message = 'Service not enabled for Access key', status = 0, cause) {
|
|
1030
|
+
super(name, code, message, status, cause);
|
|
1031
|
+
Object.setPrototypeOf(this, InvalidServiceError.prototype);
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
class UnauthorizedUserError extends WebrpcError {
|
|
1035
|
+
constructor(name = 'UnauthorizedUser', code = 1105, message = 'Unauthorized user', status = 0, cause) {
|
|
1036
|
+
super(name, code, message, status, cause);
|
|
1037
|
+
Object.setPrototypeOf(this, UnauthorizedUserError.prototype);
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
class QuotaExceededError extends WebrpcError {
|
|
1041
|
+
constructor(name = 'QuotaExceeded', code = 1200, message = 'Quota request exceeded', status = 0, cause) {
|
|
1042
|
+
super(name, code, message, status, cause);
|
|
1043
|
+
Object.setPrototypeOf(this, QuotaExceededError.prototype);
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
class QuotaRateLimitError extends WebrpcError {
|
|
1047
|
+
constructor(name = 'QuotaRateLimit', code = 1201, message = 'Quota rate limit exceeded', status = 0, cause) {
|
|
1048
|
+
super(name, code, message, status, cause);
|
|
1049
|
+
Object.setPrototypeOf(this, QuotaRateLimitError.prototype);
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1052
|
+
class NoDefaultKeyError extends WebrpcError {
|
|
1053
|
+
constructor(name = 'NoDefaultKey', code = 1300, message = 'No default access key found', status = 0, cause) {
|
|
1054
|
+
super(name, code, message, status, cause);
|
|
1055
|
+
Object.setPrototypeOf(this, NoDefaultKeyError.prototype);
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
class MaxAccessKeysError extends WebrpcError {
|
|
1059
|
+
constructor(name = 'MaxAccessKeys', code = 1301, message = 'Access keys limit reached', status = 0, cause) {
|
|
1060
|
+
super(name, code, message, status, cause);
|
|
1061
|
+
Object.setPrototypeOf(this, MaxAccessKeysError.prototype);
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
class AtLeastOneKeyError extends WebrpcError {
|
|
1065
|
+
constructor(name = 'AtLeastOneKey', code = 1302, message = 'You need at least one Access Key', status = 0, cause) {
|
|
1066
|
+
super(name, code, message, status, cause);
|
|
1067
|
+
Object.setPrototypeOf(this, AtLeastOneKeyError.prototype);
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
class TimeoutError extends WebrpcError {
|
|
1071
|
+
constructor(name = 'Timeout', code = 1900, message = 'Request timed out', status = 0, cause) {
|
|
1072
|
+
super(name, code, message, status, cause);
|
|
1073
|
+
Object.setPrototypeOf(this, TimeoutError.prototype);
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
939
1076
|
class InvalidArgumentError extends WebrpcError {
|
|
940
1077
|
constructor(name = 'InvalidArgument', code = 2001, message = 'Invalid argument', status = 0, cause) {
|
|
941
1078
|
super(name, code, message, status, cause);
|
|
@@ -980,10 +1117,24 @@ let errors = /*#__PURE__*/function (errors) {
|
|
|
980
1117
|
errors["WebrpcStreamFinished"] = "WebrpcStreamFinished";
|
|
981
1118
|
errors["Unauthorized"] = "Unauthorized";
|
|
982
1119
|
errors["PermissionDenied"] = "PermissionDenied";
|
|
1120
|
+
errors["SessionExpired"] = "SessionExpired";
|
|
983
1121
|
errors["MethodNotFound"] = "MethodNotFound";
|
|
984
1122
|
errors["RequestConflict"] = "RequestConflict";
|
|
985
1123
|
errors["Aborted"] = "Aborted";
|
|
986
1124
|
errors["Geoblocked"] = "Geoblocked";
|
|
1125
|
+
errors["RateLimited"] = "RateLimited";
|
|
1126
|
+
errors["ProjectNotFound"] = "ProjectNotFound";
|
|
1127
|
+
errors["AccessKeyNotFound"] = "AccessKeyNotFound";
|
|
1128
|
+
errors["AccessKeyMismatch"] = "AccessKeyMismatch";
|
|
1129
|
+
errors["InvalidOrigin"] = "InvalidOrigin";
|
|
1130
|
+
errors["InvalidService"] = "InvalidService";
|
|
1131
|
+
errors["UnauthorizedUser"] = "UnauthorizedUser";
|
|
1132
|
+
errors["QuotaExceeded"] = "QuotaExceeded";
|
|
1133
|
+
errors["QuotaRateLimit"] = "QuotaRateLimit";
|
|
1134
|
+
errors["NoDefaultKey"] = "NoDefaultKey";
|
|
1135
|
+
errors["MaxAccessKeys"] = "MaxAccessKeys";
|
|
1136
|
+
errors["AtLeastOneKey"] = "AtLeastOneKey";
|
|
1137
|
+
errors["Timeout"] = "Timeout";
|
|
987
1138
|
errors["InvalidArgument"] = "InvalidArgument";
|
|
988
1139
|
errors["Unavailable"] = "Unavailable";
|
|
989
1140
|
errors["QueryFailed"] = "QueryFailed";
|
|
@@ -991,6 +1142,45 @@ let errors = /*#__PURE__*/function (errors) {
|
|
|
991
1142
|
errors["InsufficientFee"] = "InsufficientFee";
|
|
992
1143
|
return errors;
|
|
993
1144
|
}({});
|
|
1145
|
+
let WebrpcErrorCodes = /*#__PURE__*/function (WebrpcErrorCodes) {
|
|
1146
|
+
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcEndpoint"] = 0] = "WebrpcEndpoint";
|
|
1147
|
+
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcRequestFailed"] = -1] = "WebrpcRequestFailed";
|
|
1148
|
+
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcBadRoute"] = -2] = "WebrpcBadRoute";
|
|
1149
|
+
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcBadMethod"] = -3] = "WebrpcBadMethod";
|
|
1150
|
+
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcBadRequest"] = -4] = "WebrpcBadRequest";
|
|
1151
|
+
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcBadResponse"] = -5] = "WebrpcBadResponse";
|
|
1152
|
+
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcServerPanic"] = -6] = "WebrpcServerPanic";
|
|
1153
|
+
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcInternalError"] = -7] = "WebrpcInternalError";
|
|
1154
|
+
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcClientDisconnected"] = -8] = "WebrpcClientDisconnected";
|
|
1155
|
+
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcStreamLost"] = -9] = "WebrpcStreamLost";
|
|
1156
|
+
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcStreamFinished"] = -10] = "WebrpcStreamFinished";
|
|
1157
|
+
WebrpcErrorCodes[WebrpcErrorCodes["Unauthorized"] = 1000] = "Unauthorized";
|
|
1158
|
+
WebrpcErrorCodes[WebrpcErrorCodes["PermissionDenied"] = 1001] = "PermissionDenied";
|
|
1159
|
+
WebrpcErrorCodes[WebrpcErrorCodes["SessionExpired"] = 1002] = "SessionExpired";
|
|
1160
|
+
WebrpcErrorCodes[WebrpcErrorCodes["MethodNotFound"] = 1003] = "MethodNotFound";
|
|
1161
|
+
WebrpcErrorCodes[WebrpcErrorCodes["RequestConflict"] = 1004] = "RequestConflict";
|
|
1162
|
+
WebrpcErrorCodes[WebrpcErrorCodes["Aborted"] = 1005] = "Aborted";
|
|
1163
|
+
WebrpcErrorCodes[WebrpcErrorCodes["Geoblocked"] = 1006] = "Geoblocked";
|
|
1164
|
+
WebrpcErrorCodes[WebrpcErrorCodes["RateLimited"] = 1007] = "RateLimited";
|
|
1165
|
+
WebrpcErrorCodes[WebrpcErrorCodes["ProjectNotFound"] = 1008] = "ProjectNotFound";
|
|
1166
|
+
WebrpcErrorCodes[WebrpcErrorCodes["AccessKeyNotFound"] = 1101] = "AccessKeyNotFound";
|
|
1167
|
+
WebrpcErrorCodes[WebrpcErrorCodes["AccessKeyMismatch"] = 1102] = "AccessKeyMismatch";
|
|
1168
|
+
WebrpcErrorCodes[WebrpcErrorCodes["InvalidOrigin"] = 1103] = "InvalidOrigin";
|
|
1169
|
+
WebrpcErrorCodes[WebrpcErrorCodes["InvalidService"] = 1104] = "InvalidService";
|
|
1170
|
+
WebrpcErrorCodes[WebrpcErrorCodes["UnauthorizedUser"] = 1105] = "UnauthorizedUser";
|
|
1171
|
+
WebrpcErrorCodes[WebrpcErrorCodes["QuotaExceeded"] = 1200] = "QuotaExceeded";
|
|
1172
|
+
WebrpcErrorCodes[WebrpcErrorCodes["QuotaRateLimit"] = 1201] = "QuotaRateLimit";
|
|
1173
|
+
WebrpcErrorCodes[WebrpcErrorCodes["NoDefaultKey"] = 1300] = "NoDefaultKey";
|
|
1174
|
+
WebrpcErrorCodes[WebrpcErrorCodes["MaxAccessKeys"] = 1301] = "MaxAccessKeys";
|
|
1175
|
+
WebrpcErrorCodes[WebrpcErrorCodes["AtLeastOneKey"] = 1302] = "AtLeastOneKey";
|
|
1176
|
+
WebrpcErrorCodes[WebrpcErrorCodes["Timeout"] = 1900] = "Timeout";
|
|
1177
|
+
WebrpcErrorCodes[WebrpcErrorCodes["InvalidArgument"] = 2001] = "InvalidArgument";
|
|
1178
|
+
WebrpcErrorCodes[WebrpcErrorCodes["Unavailable"] = 2002] = "Unavailable";
|
|
1179
|
+
WebrpcErrorCodes[WebrpcErrorCodes["QueryFailed"] = 2003] = "QueryFailed";
|
|
1180
|
+
WebrpcErrorCodes[WebrpcErrorCodes["NotFound"] = 3000] = "NotFound";
|
|
1181
|
+
WebrpcErrorCodes[WebrpcErrorCodes["InsufficientFee"] = 3004] = "InsufficientFee";
|
|
1182
|
+
return WebrpcErrorCodes;
|
|
1183
|
+
}({});
|
|
994
1184
|
const webrpcErrorByCode = {
|
|
995
1185
|
[0]: WebrpcEndpointError,
|
|
996
1186
|
[-1]: WebrpcRequestFailedError,
|
|
@@ -1005,10 +1195,24 @@ const webrpcErrorByCode = {
|
|
|
1005
1195
|
[-10]: WebrpcStreamFinishedError,
|
|
1006
1196
|
[1000]: UnauthorizedError,
|
|
1007
1197
|
[1001]: PermissionDeniedError,
|
|
1198
|
+
[1002]: SessionExpiredError,
|
|
1008
1199
|
[1003]: MethodNotFoundError,
|
|
1009
1200
|
[1004]: RequestConflictError,
|
|
1010
1201
|
[1005]: AbortedError,
|
|
1011
1202
|
[1006]: GeoblockedError,
|
|
1203
|
+
[1007]: RateLimitedError,
|
|
1204
|
+
[1008]: ProjectNotFoundError,
|
|
1205
|
+
[1101]: AccessKeyNotFoundError,
|
|
1206
|
+
[1102]: AccessKeyMismatchError,
|
|
1207
|
+
[1103]: InvalidOriginError,
|
|
1208
|
+
[1104]: InvalidServiceError,
|
|
1209
|
+
[1105]: UnauthorizedUserError,
|
|
1210
|
+
[1200]: QuotaExceededError,
|
|
1211
|
+
[1201]: QuotaRateLimitError,
|
|
1212
|
+
[1300]: NoDefaultKeyError,
|
|
1213
|
+
[1301]: MaxAccessKeysError,
|
|
1214
|
+
[1302]: AtLeastOneKeyError,
|
|
1215
|
+
[1900]: TimeoutError,
|
|
1012
1216
|
[2001]: InvalidArgumentError,
|
|
1013
1217
|
[2002]: UnavailableError,
|
|
1014
1218
|
[2003]: QueryFailedError,
|
|
@@ -1018,9 +1222,12 @@ const webrpcErrorByCode = {
|
|
|
1018
1222
|
|
|
1019
1223
|
var relayer_gen = /*#__PURE__*/Object.freeze({
|
|
1020
1224
|
__proto__: null,
|
|
1225
|
+
WebrpcHeader: WebrpcHeader,
|
|
1226
|
+
WebrpcHeaderValue: WebrpcHeaderValue,
|
|
1021
1227
|
WebRPCVersion: WebRPCVersion,
|
|
1022
1228
|
WebRPCSchemaVersion: WebRPCSchemaVersion,
|
|
1023
1229
|
WebRPCSchemaHash: WebRPCSchemaHash,
|
|
1230
|
+
VersionFromHeader: VersionFromHeader,
|
|
1024
1231
|
ETHTxnStatus: ETHTxnStatus,
|
|
1025
1232
|
TransferType: TransferType,
|
|
1026
1233
|
FeeTokenType: FeeTokenType,
|
|
@@ -1040,16 +1247,32 @@ var relayer_gen = /*#__PURE__*/Object.freeze({
|
|
|
1040
1247
|
WebrpcStreamFinishedError: WebrpcStreamFinishedError,
|
|
1041
1248
|
UnauthorizedError: UnauthorizedError,
|
|
1042
1249
|
PermissionDeniedError: PermissionDeniedError,
|
|
1250
|
+
SessionExpiredError: SessionExpiredError,
|
|
1043
1251
|
MethodNotFoundError: MethodNotFoundError,
|
|
1044
1252
|
RequestConflictError: RequestConflictError,
|
|
1045
1253
|
AbortedError: AbortedError,
|
|
1046
1254
|
GeoblockedError: GeoblockedError,
|
|
1255
|
+
RateLimitedError: RateLimitedError,
|
|
1256
|
+
ProjectNotFoundError: ProjectNotFoundError,
|
|
1257
|
+
AccessKeyNotFoundError: AccessKeyNotFoundError,
|
|
1258
|
+
AccessKeyMismatchError: AccessKeyMismatchError,
|
|
1259
|
+
InvalidOriginError: InvalidOriginError,
|
|
1260
|
+
InvalidServiceError: InvalidServiceError,
|
|
1261
|
+
UnauthorizedUserError: UnauthorizedUserError,
|
|
1262
|
+
QuotaExceededError: QuotaExceededError,
|
|
1263
|
+
QuotaRateLimitError: QuotaRateLimitError,
|
|
1264
|
+
NoDefaultKeyError: NoDefaultKeyError,
|
|
1265
|
+
MaxAccessKeysError: MaxAccessKeysError,
|
|
1266
|
+
AtLeastOneKeyError: AtLeastOneKeyError,
|
|
1267
|
+
TimeoutError: TimeoutError,
|
|
1047
1268
|
InvalidArgumentError: InvalidArgumentError,
|
|
1048
1269
|
UnavailableError: UnavailableError,
|
|
1049
1270
|
QueryFailedError: QueryFailedError,
|
|
1050
1271
|
NotFoundError: NotFoundError,
|
|
1051
1272
|
InsufficientFeeError: InsufficientFeeError,
|
|
1052
|
-
errors: errors
|
|
1273
|
+
errors: errors,
|
|
1274
|
+
WebrpcErrorCodes: WebrpcErrorCodes,
|
|
1275
|
+
webrpcErrorByCode: webrpcErrorByCode
|
|
1053
1276
|
});
|
|
1054
1277
|
|
|
1055
1278
|
const FINAL_STATUSES = [ETHTxnStatus.DROPPED, ETHTxnStatus.SUCCEEDED, ETHTxnStatus.PARTIALLY_FAILED, ETHTxnStatus.FAILED];
|
|
@@ -1314,6 +1537,18 @@ class RpcRelayer {
|
|
|
1314
1537
|
to
|
|
1315
1538
|
});
|
|
1316
1539
|
}
|
|
1540
|
+
async listGasSponsors(args) {
|
|
1541
|
+
return this.service.listGasSponsors(args);
|
|
1542
|
+
}
|
|
1543
|
+
async addGasSponsor(args) {
|
|
1544
|
+
return this.service.addGasSponsor(args);
|
|
1545
|
+
}
|
|
1546
|
+
async updateGasSponsor(args) {
|
|
1547
|
+
return this.service.updateGasSponsor(args);
|
|
1548
|
+
}
|
|
1549
|
+
async removeGasSponsor(args) {
|
|
1550
|
+
return this.service.removeGasSponsor(args);
|
|
1551
|
+
}
|
|
1317
1552
|
}
|
|
1318
1553
|
class MetaTransactionResponseException {
|
|
1319
1554
|
constructor(receipt) {
|