@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
|
@@ -251,18 +251,47 @@ class LocalRelayer extends ProviderRelayer {
|
|
|
251
251
|
cost: 0
|
|
252
252
|
};
|
|
253
253
|
}
|
|
254
|
+
async listGasSponsors(args) {
|
|
255
|
+
return {
|
|
256
|
+
page: {
|
|
257
|
+
page: 0,
|
|
258
|
+
pageSize: 100
|
|
259
|
+
},
|
|
260
|
+
gasSponsors: []
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
async addGasSponsor(args) {
|
|
264
|
+
return {
|
|
265
|
+
status: true,
|
|
266
|
+
gasSponsor: {}
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
async updateGasSponsor(args) {
|
|
270
|
+
return {
|
|
271
|
+
status: true,
|
|
272
|
+
gasSponsor: {}
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
async removeGasSponsor(args) {
|
|
276
|
+
return {
|
|
277
|
+
status: true
|
|
278
|
+
};
|
|
279
|
+
}
|
|
254
280
|
}
|
|
255
281
|
function isAbstractSigner(signer) {
|
|
256
282
|
return signer && typeof signer === 'object' && typeof signer.provider === 'object' && typeof signer.getAddress === 'function' && typeof signer.connect === 'function';
|
|
257
283
|
}
|
|
258
284
|
|
|
259
285
|
/* eslint-disable */
|
|
260
|
-
// sequence-relayer v0.4.1
|
|
286
|
+
// sequence-relayer v0.4.1 9c42435ea10493aecdfbbecb2be284b8dd721539
|
|
261
287
|
// --
|
|
262
|
-
// Code generated by webrpc-gen@v0.
|
|
288
|
+
// Code generated by webrpc-gen@v0.22.0 with typescript generator. DO NOT EDIT.
|
|
263
289
|
//
|
|
264
290
|
// webrpc-gen -schema=relayer.ridl -target=typescript -client -out=./clients/relayer.gen.ts
|
|
265
291
|
|
|
292
|
+
const WebrpcHeader = 'Webrpc';
|
|
293
|
+
const WebrpcHeaderValue = 'webrpc@v0.22.0;gen-typescript@v0.16.1;sequence-relayer@v0.4.1';
|
|
294
|
+
|
|
266
295
|
// WebRPC description and code-gen version
|
|
267
296
|
const WebRPCVersion = 'v1';
|
|
268
297
|
|
|
@@ -270,7 +299,42 @@ const WebRPCVersion = 'v1';
|
|
|
270
299
|
const WebRPCSchemaVersion = 'v0.4.1';
|
|
271
300
|
|
|
272
301
|
// Schema hash generated from your RIDL schema
|
|
273
|
-
const WebRPCSchemaHash = '
|
|
302
|
+
const WebRPCSchemaHash = '9c42435ea10493aecdfbbecb2be284b8dd721539';
|
|
303
|
+
function VersionFromHeader(headers) {
|
|
304
|
+
const headerValue = headers.get(WebrpcHeader);
|
|
305
|
+
if (!headerValue) {
|
|
306
|
+
return {
|
|
307
|
+
webrpcGenVersion: '',
|
|
308
|
+
codeGenName: '',
|
|
309
|
+
codeGenVersion: '',
|
|
310
|
+
schemaName: '',
|
|
311
|
+
schemaVersion: ''
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
return parseWebrpcGenVersions(headerValue);
|
|
315
|
+
}
|
|
316
|
+
function parseWebrpcGenVersions(header) {
|
|
317
|
+
const versions = header.split(';');
|
|
318
|
+
if (versions.length < 3) {
|
|
319
|
+
return {
|
|
320
|
+
webrpcGenVersion: '',
|
|
321
|
+
codeGenName: '',
|
|
322
|
+
codeGenVersion: '',
|
|
323
|
+
schemaName: '',
|
|
324
|
+
schemaVersion: ''
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
const [_, webrpcGenVersion] = versions[0].split('@');
|
|
328
|
+
const [codeGenName, codeGenVersion] = versions[1].split('@');
|
|
329
|
+
const [schemaName, schemaVersion] = versions[2].split('@');
|
|
330
|
+
return {
|
|
331
|
+
webrpcGenVersion,
|
|
332
|
+
codeGenName,
|
|
333
|
+
codeGenVersion,
|
|
334
|
+
schemaName,
|
|
335
|
+
schemaVersion
|
|
336
|
+
};
|
|
337
|
+
}
|
|
274
338
|
|
|
275
339
|
//
|
|
276
340
|
// Types
|
|
@@ -583,25 +647,11 @@ class Relayer {
|
|
|
583
647
|
});
|
|
584
648
|
});
|
|
585
649
|
};
|
|
586
|
-
this.
|
|
587
|
-
return this.fetch(this.url('
|
|
588
|
-
return buildResponse(res).then(_data => {
|
|
589
|
-
return {
|
|
590
|
-
gasSponsor: _data.gasSponsor
|
|
591
|
-
};
|
|
592
|
-
});
|
|
593
|
-
}, error => {
|
|
594
|
-
throw WebrpcRequestFailedError.new({
|
|
595
|
-
cause: `fetch(): ${error.message || ''}`
|
|
596
|
-
});
|
|
597
|
-
});
|
|
598
|
-
};
|
|
599
|
-
this.addressGasSponsors = (args, headers, signal) => {
|
|
600
|
-
return this.fetch(this.url('AddressGasSponsors'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
650
|
+
this.nextGasTankBalanceAdjustmentNonce = (args, headers, signal) => {
|
|
651
|
+
return this.fetch(this.url('NextGasTankBalanceAdjustmentNonce'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
601
652
|
return buildResponse(res).then(_data => {
|
|
602
653
|
return {
|
|
603
|
-
|
|
604
|
-
gasSponsors: _data.gasSponsors
|
|
654
|
+
nonce: _data.nonce
|
|
605
655
|
};
|
|
606
656
|
});
|
|
607
657
|
}, error => {
|
|
@@ -610,12 +660,12 @@ class Relayer {
|
|
|
610
660
|
});
|
|
611
661
|
});
|
|
612
662
|
};
|
|
613
|
-
this.
|
|
614
|
-
return this.fetch(this.url('
|
|
663
|
+
this.adjustGasTankBalance = (args, headers, signal) => {
|
|
664
|
+
return this.fetch(this.url('AdjustGasTankBalance'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
615
665
|
return buildResponse(res).then(_data => {
|
|
616
666
|
return {
|
|
617
|
-
|
|
618
|
-
|
|
667
|
+
status: _data.status,
|
|
668
|
+
adjustment: _data.adjustment
|
|
619
669
|
};
|
|
620
670
|
});
|
|
621
671
|
}, error => {
|
|
@@ -624,12 +674,11 @@ class Relayer {
|
|
|
624
674
|
});
|
|
625
675
|
});
|
|
626
676
|
};
|
|
627
|
-
this.
|
|
628
|
-
return this.fetch(this.url('
|
|
677
|
+
this.getGasTankBalanceAdjustment = (args, headers, signal) => {
|
|
678
|
+
return this.fetch(this.url('GetGasTankBalanceAdjustment'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
629
679
|
return buildResponse(res).then(_data => {
|
|
630
680
|
return {
|
|
631
|
-
|
|
632
|
-
gasSponsor: _data.gasSponsor
|
|
681
|
+
adjustment: _data.adjustment
|
|
633
682
|
};
|
|
634
683
|
});
|
|
635
684
|
}, error => {
|
|
@@ -638,12 +687,12 @@ class Relayer {
|
|
|
638
687
|
});
|
|
639
688
|
});
|
|
640
689
|
};
|
|
641
|
-
this.
|
|
642
|
-
return this.fetch(this.url('
|
|
690
|
+
this.listGasTankBalanceAdjustments = (args, headers, signal) => {
|
|
691
|
+
return this.fetch(this.url('ListGasTankBalanceAdjustments'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
643
692
|
return buildResponse(res).then(_data => {
|
|
644
693
|
return {
|
|
645
|
-
|
|
646
|
-
|
|
694
|
+
page: _data.page,
|
|
695
|
+
adjustments: _data.adjustments
|
|
647
696
|
};
|
|
648
697
|
});
|
|
649
698
|
}, error => {
|
|
@@ -652,11 +701,12 @@ class Relayer {
|
|
|
652
701
|
});
|
|
653
702
|
});
|
|
654
703
|
};
|
|
655
|
-
this.
|
|
656
|
-
return this.fetch(this.url('
|
|
704
|
+
this.listGasSponsors = (args, headers, signal) => {
|
|
705
|
+
return this.fetch(this.url('ListGasSponsors'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
657
706
|
return buildResponse(res).then(_data => {
|
|
658
707
|
return {
|
|
659
|
-
|
|
708
|
+
page: _data.page,
|
|
709
|
+
gasSponsors: _data.gasSponsors
|
|
660
710
|
};
|
|
661
711
|
});
|
|
662
712
|
}, error => {
|
|
@@ -665,11 +715,11 @@ class Relayer {
|
|
|
665
715
|
});
|
|
666
716
|
});
|
|
667
717
|
};
|
|
668
|
-
this.
|
|
669
|
-
return this.fetch(this.url('
|
|
718
|
+
this.getGasSponsor = (args, headers, signal) => {
|
|
719
|
+
return this.fetch(this.url('GetGasSponsor'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
670
720
|
return buildResponse(res).then(_data => {
|
|
671
721
|
return {
|
|
672
|
-
|
|
722
|
+
gasSponsor: _data.gasSponsor
|
|
673
723
|
};
|
|
674
724
|
});
|
|
675
725
|
}, error => {
|
|
@@ -678,11 +728,12 @@ class Relayer {
|
|
|
678
728
|
});
|
|
679
729
|
});
|
|
680
730
|
};
|
|
681
|
-
this.
|
|
682
|
-
return this.fetch(this.url('
|
|
731
|
+
this.addGasSponsor = (args, headers, signal) => {
|
|
732
|
+
return this.fetch(this.url('AddGasSponsor'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
683
733
|
return buildResponse(res).then(_data => {
|
|
684
734
|
return {
|
|
685
|
-
|
|
735
|
+
status: _data.status,
|
|
736
|
+
gasSponsor: _data.gasSponsor
|
|
686
737
|
};
|
|
687
738
|
});
|
|
688
739
|
}, error => {
|
|
@@ -691,12 +742,12 @@ class Relayer {
|
|
|
691
742
|
});
|
|
692
743
|
});
|
|
693
744
|
};
|
|
694
|
-
this.
|
|
695
|
-
return this.fetch(this.url('
|
|
745
|
+
this.updateGasSponsor = (args, headers, signal) => {
|
|
746
|
+
return this.fetch(this.url('UpdateGasSponsor'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
696
747
|
return buildResponse(res).then(_data => {
|
|
697
748
|
return {
|
|
698
749
|
status: _data.status,
|
|
699
|
-
|
|
750
|
+
gasSponsor: _data.gasSponsor
|
|
700
751
|
};
|
|
701
752
|
});
|
|
702
753
|
}, error => {
|
|
@@ -705,11 +756,11 @@ class Relayer {
|
|
|
705
756
|
});
|
|
706
757
|
});
|
|
707
758
|
};
|
|
708
|
-
this.
|
|
709
|
-
return this.fetch(this.url('
|
|
759
|
+
this.removeGasSponsor = (args, headers, signal) => {
|
|
760
|
+
return this.fetch(this.url('RemoveGasSponsor'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
710
761
|
return buildResponse(res).then(_data => {
|
|
711
762
|
return {
|
|
712
|
-
|
|
763
|
+
status: _data.status
|
|
713
764
|
};
|
|
714
765
|
});
|
|
715
766
|
}, error => {
|
|
@@ -718,12 +769,12 @@ class Relayer {
|
|
|
718
769
|
});
|
|
719
770
|
});
|
|
720
771
|
};
|
|
721
|
-
this.
|
|
722
|
-
return this.fetch(this.url('
|
|
772
|
+
this.addressGasSponsors = (args, headers, signal) => {
|
|
773
|
+
return this.fetch(this.url('AddressGasSponsors'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
723
774
|
return buildResponse(res).then(_data => {
|
|
724
775
|
return {
|
|
725
776
|
page: _data.page,
|
|
726
|
-
|
|
777
|
+
gasSponsors: _data.gasSponsors
|
|
727
778
|
};
|
|
728
779
|
});
|
|
729
780
|
}, error => {
|
|
@@ -766,11 +817,13 @@ class Relayer {
|
|
|
766
817
|
}
|
|
767
818
|
}
|
|
768
819
|
const createHTTPRequest = (body = {}, headers = {}, signal = null) => {
|
|
820
|
+
const reqHeaders = _extends({}, headers, {
|
|
821
|
+
'Content-Type': 'application/json'
|
|
822
|
+
});
|
|
823
|
+
reqHeaders[WebrpcHeader] = WebrpcHeaderValue;
|
|
769
824
|
return {
|
|
770
825
|
method: 'POST',
|
|
771
|
-
headers:
|
|
772
|
-
'Content-Type': 'application/json'
|
|
773
|
-
}),
|
|
826
|
+
headers: reqHeaders,
|
|
774
827
|
body: JSON.stringify(body || {}),
|
|
775
828
|
signal
|
|
776
829
|
};
|
|
@@ -908,6 +961,12 @@ class PermissionDeniedError extends WebrpcError {
|
|
|
908
961
|
Object.setPrototypeOf(this, PermissionDeniedError.prototype);
|
|
909
962
|
}
|
|
910
963
|
}
|
|
964
|
+
class SessionExpiredError extends WebrpcError {
|
|
965
|
+
constructor(name = 'SessionExpired', code = 1002, message = 'Session expired', status = 0, cause) {
|
|
966
|
+
super(name, code, message, status, cause);
|
|
967
|
+
Object.setPrototypeOf(this, SessionExpiredError.prototype);
|
|
968
|
+
}
|
|
969
|
+
}
|
|
911
970
|
class MethodNotFoundError extends WebrpcError {
|
|
912
971
|
constructor(name = 'MethodNotFound', code = 1003, message = 'Method not found', status = 0, cause) {
|
|
913
972
|
super(name, code, message, status, cause);
|
|
@@ -932,6 +991,84 @@ class GeoblockedError extends WebrpcError {
|
|
|
932
991
|
Object.setPrototypeOf(this, GeoblockedError.prototype);
|
|
933
992
|
}
|
|
934
993
|
}
|
|
994
|
+
class RateLimitedError extends WebrpcError {
|
|
995
|
+
constructor(name = 'RateLimited', code = 1007, message = 'Rate-limited. Please slow down.', status = 0, cause) {
|
|
996
|
+
super(name, code, message, status, cause);
|
|
997
|
+
Object.setPrototypeOf(this, RateLimitedError.prototype);
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
class ProjectNotFoundError extends WebrpcError {
|
|
1001
|
+
constructor(name = 'ProjectNotFound', code = 1008, message = 'Project not found', status = 0, cause) {
|
|
1002
|
+
super(name, code, message, status, cause);
|
|
1003
|
+
Object.setPrototypeOf(this, ProjectNotFoundError.prototype);
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
class AccessKeyNotFoundError extends WebrpcError {
|
|
1007
|
+
constructor(name = 'AccessKeyNotFound', code = 1101, message = 'Access key not found', status = 0, cause) {
|
|
1008
|
+
super(name, code, message, status, cause);
|
|
1009
|
+
Object.setPrototypeOf(this, AccessKeyNotFoundError.prototype);
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
class AccessKeyMismatchError extends WebrpcError {
|
|
1013
|
+
constructor(name = 'AccessKeyMismatch', code = 1102, message = 'Access key mismatch', status = 0, cause) {
|
|
1014
|
+
super(name, code, message, status, cause);
|
|
1015
|
+
Object.setPrototypeOf(this, AccessKeyMismatchError.prototype);
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
class InvalidOriginError extends WebrpcError {
|
|
1019
|
+
constructor(name = 'InvalidOrigin', code = 1103, message = 'Invalid origin for Access Key', status = 0, cause) {
|
|
1020
|
+
super(name, code, message, status, cause);
|
|
1021
|
+
Object.setPrototypeOf(this, InvalidOriginError.prototype);
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
class InvalidServiceError extends WebrpcError {
|
|
1025
|
+
constructor(name = 'InvalidService', code = 1104, message = 'Service not enabled for Access key', status = 0, cause) {
|
|
1026
|
+
super(name, code, message, status, cause);
|
|
1027
|
+
Object.setPrototypeOf(this, InvalidServiceError.prototype);
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
class UnauthorizedUserError extends WebrpcError {
|
|
1031
|
+
constructor(name = 'UnauthorizedUser', code = 1105, message = 'Unauthorized user', status = 0, cause) {
|
|
1032
|
+
super(name, code, message, status, cause);
|
|
1033
|
+
Object.setPrototypeOf(this, UnauthorizedUserError.prototype);
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
class QuotaExceededError extends WebrpcError {
|
|
1037
|
+
constructor(name = 'QuotaExceeded', code = 1200, message = 'Quota request exceeded', status = 0, cause) {
|
|
1038
|
+
super(name, code, message, status, cause);
|
|
1039
|
+
Object.setPrototypeOf(this, QuotaExceededError.prototype);
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
class QuotaRateLimitError extends WebrpcError {
|
|
1043
|
+
constructor(name = 'QuotaRateLimit', code = 1201, message = 'Quota rate limit exceeded', status = 0, cause) {
|
|
1044
|
+
super(name, code, message, status, cause);
|
|
1045
|
+
Object.setPrototypeOf(this, QuotaRateLimitError.prototype);
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
class NoDefaultKeyError extends WebrpcError {
|
|
1049
|
+
constructor(name = 'NoDefaultKey', code = 1300, message = 'No default access key found', status = 0, cause) {
|
|
1050
|
+
super(name, code, message, status, cause);
|
|
1051
|
+
Object.setPrototypeOf(this, NoDefaultKeyError.prototype);
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
class MaxAccessKeysError extends WebrpcError {
|
|
1055
|
+
constructor(name = 'MaxAccessKeys', code = 1301, message = 'Access keys limit reached', status = 0, cause) {
|
|
1056
|
+
super(name, code, message, status, cause);
|
|
1057
|
+
Object.setPrototypeOf(this, MaxAccessKeysError.prototype);
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
class AtLeastOneKeyError extends WebrpcError {
|
|
1061
|
+
constructor(name = 'AtLeastOneKey', code = 1302, message = 'You need at least one Access Key', status = 0, cause) {
|
|
1062
|
+
super(name, code, message, status, cause);
|
|
1063
|
+
Object.setPrototypeOf(this, AtLeastOneKeyError.prototype);
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
class TimeoutError extends WebrpcError {
|
|
1067
|
+
constructor(name = 'Timeout', code = 1900, message = 'Request timed out', status = 0, cause) {
|
|
1068
|
+
super(name, code, message, status, cause);
|
|
1069
|
+
Object.setPrototypeOf(this, TimeoutError.prototype);
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
935
1072
|
class InvalidArgumentError extends WebrpcError {
|
|
936
1073
|
constructor(name = 'InvalidArgument', code = 2001, message = 'Invalid argument', status = 0, cause) {
|
|
937
1074
|
super(name, code, message, status, cause);
|
|
@@ -976,10 +1113,24 @@ let errors = /*#__PURE__*/function (errors) {
|
|
|
976
1113
|
errors["WebrpcStreamFinished"] = "WebrpcStreamFinished";
|
|
977
1114
|
errors["Unauthorized"] = "Unauthorized";
|
|
978
1115
|
errors["PermissionDenied"] = "PermissionDenied";
|
|
1116
|
+
errors["SessionExpired"] = "SessionExpired";
|
|
979
1117
|
errors["MethodNotFound"] = "MethodNotFound";
|
|
980
1118
|
errors["RequestConflict"] = "RequestConflict";
|
|
981
1119
|
errors["Aborted"] = "Aborted";
|
|
982
1120
|
errors["Geoblocked"] = "Geoblocked";
|
|
1121
|
+
errors["RateLimited"] = "RateLimited";
|
|
1122
|
+
errors["ProjectNotFound"] = "ProjectNotFound";
|
|
1123
|
+
errors["AccessKeyNotFound"] = "AccessKeyNotFound";
|
|
1124
|
+
errors["AccessKeyMismatch"] = "AccessKeyMismatch";
|
|
1125
|
+
errors["InvalidOrigin"] = "InvalidOrigin";
|
|
1126
|
+
errors["InvalidService"] = "InvalidService";
|
|
1127
|
+
errors["UnauthorizedUser"] = "UnauthorizedUser";
|
|
1128
|
+
errors["QuotaExceeded"] = "QuotaExceeded";
|
|
1129
|
+
errors["QuotaRateLimit"] = "QuotaRateLimit";
|
|
1130
|
+
errors["NoDefaultKey"] = "NoDefaultKey";
|
|
1131
|
+
errors["MaxAccessKeys"] = "MaxAccessKeys";
|
|
1132
|
+
errors["AtLeastOneKey"] = "AtLeastOneKey";
|
|
1133
|
+
errors["Timeout"] = "Timeout";
|
|
983
1134
|
errors["InvalidArgument"] = "InvalidArgument";
|
|
984
1135
|
errors["Unavailable"] = "Unavailable";
|
|
985
1136
|
errors["QueryFailed"] = "QueryFailed";
|
|
@@ -987,6 +1138,45 @@ let errors = /*#__PURE__*/function (errors) {
|
|
|
987
1138
|
errors["InsufficientFee"] = "InsufficientFee";
|
|
988
1139
|
return errors;
|
|
989
1140
|
}({});
|
|
1141
|
+
let WebrpcErrorCodes = /*#__PURE__*/function (WebrpcErrorCodes) {
|
|
1142
|
+
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcEndpoint"] = 0] = "WebrpcEndpoint";
|
|
1143
|
+
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcRequestFailed"] = -1] = "WebrpcRequestFailed";
|
|
1144
|
+
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcBadRoute"] = -2] = "WebrpcBadRoute";
|
|
1145
|
+
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcBadMethod"] = -3] = "WebrpcBadMethod";
|
|
1146
|
+
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcBadRequest"] = -4] = "WebrpcBadRequest";
|
|
1147
|
+
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcBadResponse"] = -5] = "WebrpcBadResponse";
|
|
1148
|
+
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcServerPanic"] = -6] = "WebrpcServerPanic";
|
|
1149
|
+
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcInternalError"] = -7] = "WebrpcInternalError";
|
|
1150
|
+
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcClientDisconnected"] = -8] = "WebrpcClientDisconnected";
|
|
1151
|
+
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcStreamLost"] = -9] = "WebrpcStreamLost";
|
|
1152
|
+
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcStreamFinished"] = -10] = "WebrpcStreamFinished";
|
|
1153
|
+
WebrpcErrorCodes[WebrpcErrorCodes["Unauthorized"] = 1000] = "Unauthorized";
|
|
1154
|
+
WebrpcErrorCodes[WebrpcErrorCodes["PermissionDenied"] = 1001] = "PermissionDenied";
|
|
1155
|
+
WebrpcErrorCodes[WebrpcErrorCodes["SessionExpired"] = 1002] = "SessionExpired";
|
|
1156
|
+
WebrpcErrorCodes[WebrpcErrorCodes["MethodNotFound"] = 1003] = "MethodNotFound";
|
|
1157
|
+
WebrpcErrorCodes[WebrpcErrorCodes["RequestConflict"] = 1004] = "RequestConflict";
|
|
1158
|
+
WebrpcErrorCodes[WebrpcErrorCodes["Aborted"] = 1005] = "Aborted";
|
|
1159
|
+
WebrpcErrorCodes[WebrpcErrorCodes["Geoblocked"] = 1006] = "Geoblocked";
|
|
1160
|
+
WebrpcErrorCodes[WebrpcErrorCodes["RateLimited"] = 1007] = "RateLimited";
|
|
1161
|
+
WebrpcErrorCodes[WebrpcErrorCodes["ProjectNotFound"] = 1008] = "ProjectNotFound";
|
|
1162
|
+
WebrpcErrorCodes[WebrpcErrorCodes["AccessKeyNotFound"] = 1101] = "AccessKeyNotFound";
|
|
1163
|
+
WebrpcErrorCodes[WebrpcErrorCodes["AccessKeyMismatch"] = 1102] = "AccessKeyMismatch";
|
|
1164
|
+
WebrpcErrorCodes[WebrpcErrorCodes["InvalidOrigin"] = 1103] = "InvalidOrigin";
|
|
1165
|
+
WebrpcErrorCodes[WebrpcErrorCodes["InvalidService"] = 1104] = "InvalidService";
|
|
1166
|
+
WebrpcErrorCodes[WebrpcErrorCodes["UnauthorizedUser"] = 1105] = "UnauthorizedUser";
|
|
1167
|
+
WebrpcErrorCodes[WebrpcErrorCodes["QuotaExceeded"] = 1200] = "QuotaExceeded";
|
|
1168
|
+
WebrpcErrorCodes[WebrpcErrorCodes["QuotaRateLimit"] = 1201] = "QuotaRateLimit";
|
|
1169
|
+
WebrpcErrorCodes[WebrpcErrorCodes["NoDefaultKey"] = 1300] = "NoDefaultKey";
|
|
1170
|
+
WebrpcErrorCodes[WebrpcErrorCodes["MaxAccessKeys"] = 1301] = "MaxAccessKeys";
|
|
1171
|
+
WebrpcErrorCodes[WebrpcErrorCodes["AtLeastOneKey"] = 1302] = "AtLeastOneKey";
|
|
1172
|
+
WebrpcErrorCodes[WebrpcErrorCodes["Timeout"] = 1900] = "Timeout";
|
|
1173
|
+
WebrpcErrorCodes[WebrpcErrorCodes["InvalidArgument"] = 2001] = "InvalidArgument";
|
|
1174
|
+
WebrpcErrorCodes[WebrpcErrorCodes["Unavailable"] = 2002] = "Unavailable";
|
|
1175
|
+
WebrpcErrorCodes[WebrpcErrorCodes["QueryFailed"] = 2003] = "QueryFailed";
|
|
1176
|
+
WebrpcErrorCodes[WebrpcErrorCodes["NotFound"] = 3000] = "NotFound";
|
|
1177
|
+
WebrpcErrorCodes[WebrpcErrorCodes["InsufficientFee"] = 3004] = "InsufficientFee";
|
|
1178
|
+
return WebrpcErrorCodes;
|
|
1179
|
+
}({});
|
|
990
1180
|
const webrpcErrorByCode = {
|
|
991
1181
|
[0]: WebrpcEndpointError,
|
|
992
1182
|
[-1]: WebrpcRequestFailedError,
|
|
@@ -1001,10 +1191,24 @@ const webrpcErrorByCode = {
|
|
|
1001
1191
|
[-10]: WebrpcStreamFinishedError,
|
|
1002
1192
|
[1000]: UnauthorizedError,
|
|
1003
1193
|
[1001]: PermissionDeniedError,
|
|
1194
|
+
[1002]: SessionExpiredError,
|
|
1004
1195
|
[1003]: MethodNotFoundError,
|
|
1005
1196
|
[1004]: RequestConflictError,
|
|
1006
1197
|
[1005]: AbortedError,
|
|
1007
1198
|
[1006]: GeoblockedError,
|
|
1199
|
+
[1007]: RateLimitedError,
|
|
1200
|
+
[1008]: ProjectNotFoundError,
|
|
1201
|
+
[1101]: AccessKeyNotFoundError,
|
|
1202
|
+
[1102]: AccessKeyMismatchError,
|
|
1203
|
+
[1103]: InvalidOriginError,
|
|
1204
|
+
[1104]: InvalidServiceError,
|
|
1205
|
+
[1105]: UnauthorizedUserError,
|
|
1206
|
+
[1200]: QuotaExceededError,
|
|
1207
|
+
[1201]: QuotaRateLimitError,
|
|
1208
|
+
[1300]: NoDefaultKeyError,
|
|
1209
|
+
[1301]: MaxAccessKeysError,
|
|
1210
|
+
[1302]: AtLeastOneKeyError,
|
|
1211
|
+
[1900]: TimeoutError,
|
|
1008
1212
|
[2001]: InvalidArgumentError,
|
|
1009
1213
|
[2002]: UnavailableError,
|
|
1010
1214
|
[2003]: QueryFailedError,
|
|
@@ -1014,9 +1218,12 @@ const webrpcErrorByCode = {
|
|
|
1014
1218
|
|
|
1015
1219
|
var relayer_gen = /*#__PURE__*/Object.freeze({
|
|
1016
1220
|
__proto__: null,
|
|
1221
|
+
WebrpcHeader: WebrpcHeader,
|
|
1222
|
+
WebrpcHeaderValue: WebrpcHeaderValue,
|
|
1017
1223
|
WebRPCVersion: WebRPCVersion,
|
|
1018
1224
|
WebRPCSchemaVersion: WebRPCSchemaVersion,
|
|
1019
1225
|
WebRPCSchemaHash: WebRPCSchemaHash,
|
|
1226
|
+
VersionFromHeader: VersionFromHeader,
|
|
1020
1227
|
ETHTxnStatus: ETHTxnStatus,
|
|
1021
1228
|
TransferType: TransferType,
|
|
1022
1229
|
FeeTokenType: FeeTokenType,
|
|
@@ -1036,16 +1243,32 @@ var relayer_gen = /*#__PURE__*/Object.freeze({
|
|
|
1036
1243
|
WebrpcStreamFinishedError: WebrpcStreamFinishedError,
|
|
1037
1244
|
UnauthorizedError: UnauthorizedError,
|
|
1038
1245
|
PermissionDeniedError: PermissionDeniedError,
|
|
1246
|
+
SessionExpiredError: SessionExpiredError,
|
|
1039
1247
|
MethodNotFoundError: MethodNotFoundError,
|
|
1040
1248
|
RequestConflictError: RequestConflictError,
|
|
1041
1249
|
AbortedError: AbortedError,
|
|
1042
1250
|
GeoblockedError: GeoblockedError,
|
|
1251
|
+
RateLimitedError: RateLimitedError,
|
|
1252
|
+
ProjectNotFoundError: ProjectNotFoundError,
|
|
1253
|
+
AccessKeyNotFoundError: AccessKeyNotFoundError,
|
|
1254
|
+
AccessKeyMismatchError: AccessKeyMismatchError,
|
|
1255
|
+
InvalidOriginError: InvalidOriginError,
|
|
1256
|
+
InvalidServiceError: InvalidServiceError,
|
|
1257
|
+
UnauthorizedUserError: UnauthorizedUserError,
|
|
1258
|
+
QuotaExceededError: QuotaExceededError,
|
|
1259
|
+
QuotaRateLimitError: QuotaRateLimitError,
|
|
1260
|
+
NoDefaultKeyError: NoDefaultKeyError,
|
|
1261
|
+
MaxAccessKeysError: MaxAccessKeysError,
|
|
1262
|
+
AtLeastOneKeyError: AtLeastOneKeyError,
|
|
1263
|
+
TimeoutError: TimeoutError,
|
|
1043
1264
|
InvalidArgumentError: InvalidArgumentError,
|
|
1044
1265
|
UnavailableError: UnavailableError,
|
|
1045
1266
|
QueryFailedError: QueryFailedError,
|
|
1046
1267
|
NotFoundError: NotFoundError,
|
|
1047
1268
|
InsufficientFeeError: InsufficientFeeError,
|
|
1048
|
-
errors: errors
|
|
1269
|
+
errors: errors,
|
|
1270
|
+
WebrpcErrorCodes: WebrpcErrorCodes,
|
|
1271
|
+
webrpcErrorByCode: webrpcErrorByCode
|
|
1049
1272
|
});
|
|
1050
1273
|
|
|
1051
1274
|
const FINAL_STATUSES = [ETHTxnStatus.DROPPED, ETHTxnStatus.SUCCEEDED, ETHTxnStatus.PARTIALLY_FAILED, ETHTxnStatus.FAILED];
|
|
@@ -1310,6 +1533,18 @@ class RpcRelayer {
|
|
|
1310
1533
|
to
|
|
1311
1534
|
});
|
|
1312
1535
|
}
|
|
1536
|
+
async listGasSponsors(args) {
|
|
1537
|
+
return this.service.listGasSponsors(args);
|
|
1538
|
+
}
|
|
1539
|
+
async addGasSponsor(args) {
|
|
1540
|
+
return this.service.addGasSponsor(args);
|
|
1541
|
+
}
|
|
1542
|
+
async updateGasSponsor(args) {
|
|
1543
|
+
return this.service.updateGasSponsor(args);
|
|
1544
|
+
}
|
|
1545
|
+
async removeGasSponsor(args) {
|
|
1546
|
+
return this.service.removeGasSponsor(args);
|
|
1547
|
+
}
|
|
1313
1548
|
}
|
|
1314
1549
|
class MetaTransactionResponseException {
|
|
1315
1550
|
constructor(receipt) {
|
|
@@ -14,6 +14,10 @@ export interface Relayer {
|
|
|
14
14
|
quote?: FeeQuote;
|
|
15
15
|
}>;
|
|
16
16
|
gasRefundOptions(address: string, ...transactions: commons.transaction.Transaction[]): Promise<FeeOption[]>;
|
|
17
|
+
listGasSponsors(args: proto.ListGasSponsorsArgs): Promise<proto.ListGasSponsorsReturn>;
|
|
18
|
+
addGasSponsor(args: proto.AddGasSponsorArgs): Promise<proto.AddGasSponsorReturn>;
|
|
19
|
+
updateGasSponsor(args: proto.UpdateGasSponsorArgs): Promise<proto.UpdateGasSponsorReturn>;
|
|
20
|
+
removeGasSponsor(args: proto.RemoveGasSponsorArgs): Promise<proto.RemoveGasSponsorReturn>;
|
|
17
21
|
getNonce(address: string, space?: ethers.BigNumberish, blockTag?: ethers.BlockTag): Promise<ethers.BigNumberish>;
|
|
18
22
|
relay(signedTxs: commons.transaction.IntendedTransactionBundle, quote?: FeeQuote, waitForReceipt?: boolean, projectAccessKey?: string): Promise<commons.transaction.TransactionResponse>;
|
|
19
23
|
wait(metaTxnId: string | commons.transaction.SignedTransactionBundle, timeout?: number, delay?: number, maxFails?: number): Promise<commons.transaction.TransactionResponse>;
|
|
@@ -28,4 +28,8 @@ export declare class LocalRelayer extends ProviderRelayer implements Relayer {
|
|
|
28
28
|
getTransactionCost(projectId: number, from: string, to: string): Promise<{
|
|
29
29
|
cost: number;
|
|
30
30
|
}>;
|
|
31
|
+
listGasSponsors(args: proto.ListGasSponsorsArgs): Promise<proto.ListGasSponsorsReturn>;
|
|
32
|
+
addGasSponsor(args: proto.AddGasSponsorArgs): Promise<proto.AddGasSponsorReturn>;
|
|
33
|
+
updateGasSponsor(args: proto.UpdateGasSponsorArgs): Promise<proto.UpdateGasSponsorReturn>;
|
|
34
|
+
removeGasSponsor(args: proto.RemoveGasSponsorArgs): Promise<proto.RemoveGasSponsorReturn>;
|
|
31
35
|
}
|
|
@@ -35,6 +35,10 @@ export declare abstract class ProviderRelayer implements Relayer {
|
|
|
35
35
|
page: proto.Page;
|
|
36
36
|
transactions: proto.MetaTxnLog[];
|
|
37
37
|
}>;
|
|
38
|
+
abstract listGasSponsors(args: proto.ListGasSponsorsArgs): Promise<proto.ListGasSponsorsReturn>;
|
|
39
|
+
abstract addGasSponsor(args: proto.AddGasSponsorArgs): Promise<proto.AddGasSponsorReturn>;
|
|
40
|
+
abstract updateGasSponsor(args: proto.UpdateGasSponsorArgs): Promise<proto.UpdateGasSponsorReturn>;
|
|
41
|
+
abstract removeGasSponsor(args: proto.RemoveGasSponsorArgs): Promise<proto.RemoveGasSponsorReturn>;
|
|
38
42
|
simulate(wallet: string, ...transactions: commons.transaction.Transaction[]): Promise<SimulateResult[]>;
|
|
39
43
|
getNonce(address: string, space?: ethers.BigNumberish, blockTag?: ethers.BlockTag): Promise<ethers.BigNumberish>;
|
|
40
44
|
wait(metaTxnId: string | commons.transaction.SignedTransactionBundle, timeoutDuration?: number, delay?: number, maxFails?: number): Promise<ethers.TransactionResponse & {
|
|
@@ -42,6 +42,10 @@ export declare class RpcRelayer implements Relayer {
|
|
|
42
42
|
getTransactionCost(projectId: number, from: string, to: string): Promise<{
|
|
43
43
|
cost: number;
|
|
44
44
|
}>;
|
|
45
|
+
listGasSponsors(args: proto.ListGasSponsorsArgs): Promise<proto.ListGasSponsorsReturn>;
|
|
46
|
+
addGasSponsor(args: proto.AddGasSponsorArgs): Promise<proto.AddGasSponsorReturn>;
|
|
47
|
+
updateGasSponsor(args: proto.UpdateGasSponsorArgs): Promise<proto.UpdateGasSponsorReturn>;
|
|
48
|
+
removeGasSponsor(args: proto.RemoveGasSponsorArgs): Promise<proto.RemoveGasSponsorReturn>;
|
|
45
49
|
}
|
|
46
50
|
export type RelayerTxReceipt = {
|
|
47
51
|
blockHash: string;
|