@0xsequence/relayer 2.2.9 → 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
|
@@ -1,6 +1,16 @@
|
|
|
1
|
+
export declare const WebrpcHeader = "Webrpc";
|
|
2
|
+
export declare const WebrpcHeaderValue = "webrpc@v0.22.0;gen-typescript@v0.16.1;sequence-relayer@v0.4.1";
|
|
1
3
|
export declare const WebRPCVersion = "v1";
|
|
2
4
|
export declare const WebRPCSchemaVersion = "v0.4.1";
|
|
3
|
-
export declare const WebRPCSchemaHash = "
|
|
5
|
+
export declare const WebRPCSchemaHash = "9c42435ea10493aecdfbbecb2be284b8dd721539";
|
|
6
|
+
type WebrpcGenVersions = {
|
|
7
|
+
webrpcGenVersion: string;
|
|
8
|
+
codeGenName: string;
|
|
9
|
+
codeGenVersion: string;
|
|
10
|
+
schemaName: string;
|
|
11
|
+
schemaVersion: string;
|
|
12
|
+
};
|
|
13
|
+
export declare function VersionFromHeader(headers: Headers): WebrpcGenVersions;
|
|
4
14
|
export declare enum ETHTxnStatus {
|
|
5
15
|
UNKNOWN = "UNKNOWN",
|
|
6
16
|
DROPPED = "DROPPED",
|
|
@@ -136,6 +146,7 @@ export interface MetaTxnLog {
|
|
|
136
146
|
gasFeeMarkup?: number;
|
|
137
147
|
usdRate: string;
|
|
138
148
|
creditsUsed: number;
|
|
149
|
+
cost: string;
|
|
139
150
|
isWhitelisted: boolean;
|
|
140
151
|
gasSponsor?: number;
|
|
141
152
|
gasTank?: number;
|
|
@@ -241,17 +252,16 @@ export interface Relayer {
|
|
|
241
252
|
getGasTank(args: GetGasTankArgs, headers?: object, signal?: AbortSignal): Promise<GetGasTankReturn>;
|
|
242
253
|
addGasTank(args: AddGasTankArgs, headers?: object, signal?: AbortSignal): Promise<AddGasTankReturn>;
|
|
243
254
|
updateGasTank(args: UpdateGasTankArgs, headers?: object, signal?: AbortSignal): Promise<UpdateGasTankReturn>;
|
|
244
|
-
getGasSponsor(args: GetGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise<GetGasSponsorReturn>;
|
|
245
|
-
addressGasSponsors(args: AddressGasSponsorsArgs, headers?: object, signal?: AbortSignal): Promise<AddressGasSponsorsReturn>;
|
|
246
|
-
listGasSponsors(args: ListGasSponsorsArgs, headers?: object, signal?: AbortSignal): Promise<ListGasSponsorsReturn>;
|
|
247
|
-
addGasSponsor(args: AddGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise<AddGasSponsorReturn>;
|
|
248
|
-
updateGasSponsor(args: UpdateGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise<UpdateGasSponsorReturn>;
|
|
249
|
-
removeGasSponsor(args: RemoveGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise<RemoveGasSponsorReturn>;
|
|
250
|
-
reportGasSponsorUsage(args: ReportGasSponsorUsageArgs, headers?: object, signal?: AbortSignal): Promise<ReportGasSponsorUsageReturn>;
|
|
251
255
|
nextGasTankBalanceAdjustmentNonce(args: NextGasTankBalanceAdjustmentNonceArgs, headers?: object, signal?: AbortSignal): Promise<NextGasTankBalanceAdjustmentNonceReturn>;
|
|
252
256
|
adjustGasTankBalance(args: AdjustGasTankBalanceArgs, headers?: object, signal?: AbortSignal): Promise<AdjustGasTankBalanceReturn>;
|
|
253
257
|
getGasTankBalanceAdjustment(args: GetGasTankBalanceAdjustmentArgs, headers?: object, signal?: AbortSignal): Promise<GetGasTankBalanceAdjustmentReturn>;
|
|
254
258
|
listGasTankBalanceAdjustments(args: ListGasTankBalanceAdjustmentsArgs, headers?: object, signal?: AbortSignal): Promise<ListGasTankBalanceAdjustmentsReturn>;
|
|
259
|
+
listGasSponsors(args: ListGasSponsorsArgs, headers?: object, signal?: AbortSignal): Promise<ListGasSponsorsReturn>;
|
|
260
|
+
getGasSponsor(args: GetGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise<GetGasSponsorReturn>;
|
|
261
|
+
addGasSponsor(args: AddGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise<AddGasSponsorReturn>;
|
|
262
|
+
updateGasSponsor(args: UpdateGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise<UpdateGasSponsorReturn>;
|
|
263
|
+
removeGasSponsor(args: RemoveGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise<RemoveGasSponsorReturn>;
|
|
264
|
+
addressGasSponsors(args: AddressGasSponsorsArgs, headers?: object, signal?: AbortSignal): Promise<AddressGasSponsorsReturn>;
|
|
255
265
|
getProjectBalance(args: GetProjectBalanceArgs, headers?: object, signal?: AbortSignal): Promise<GetProjectBalanceReturn>;
|
|
256
266
|
adjustProjectBalance(args: AdjustProjectBalanceArgs, headers?: object, signal?: AbortSignal): Promise<AdjustProjectBalanceReturn>;
|
|
257
267
|
}
|
|
@@ -397,32 +407,53 @@ export interface UpdateGasTankReturn {
|
|
|
397
407
|
status: boolean;
|
|
398
408
|
gasTank: GasTank;
|
|
399
409
|
}
|
|
400
|
-
export interface
|
|
410
|
+
export interface NextGasTankBalanceAdjustmentNonceArgs {
|
|
401
411
|
id: number;
|
|
402
412
|
}
|
|
403
|
-
export interface
|
|
404
|
-
|
|
413
|
+
export interface NextGasTankBalanceAdjustmentNonceReturn {
|
|
414
|
+
nonce: number;
|
|
405
415
|
}
|
|
406
|
-
export interface
|
|
407
|
-
|
|
416
|
+
export interface AdjustGasTankBalanceArgs {
|
|
417
|
+
id: number;
|
|
418
|
+
nonce: number;
|
|
419
|
+
amount: number;
|
|
420
|
+
}
|
|
421
|
+
export interface AdjustGasTankBalanceReturn {
|
|
422
|
+
status: boolean;
|
|
423
|
+
adjustment: GasTankBalanceAdjustment;
|
|
424
|
+
}
|
|
425
|
+
export interface GetGasTankBalanceAdjustmentArgs {
|
|
426
|
+
id: number;
|
|
427
|
+
nonce: number;
|
|
428
|
+
}
|
|
429
|
+
export interface GetGasTankBalanceAdjustmentReturn {
|
|
430
|
+
adjustment: GasTankBalanceAdjustment;
|
|
431
|
+
}
|
|
432
|
+
export interface ListGasTankBalanceAdjustmentsArgs {
|
|
433
|
+
id: number;
|
|
408
434
|
page?: Page;
|
|
409
435
|
}
|
|
410
|
-
export interface
|
|
436
|
+
export interface ListGasTankBalanceAdjustmentsReturn {
|
|
411
437
|
page: Page;
|
|
412
|
-
|
|
438
|
+
adjustments: Array<GasTankBalanceAdjustment>;
|
|
413
439
|
}
|
|
414
440
|
export interface ListGasSponsorsArgs {
|
|
415
441
|
projectId: number;
|
|
416
|
-
gasTankId: number;
|
|
417
442
|
page?: Page;
|
|
418
443
|
}
|
|
419
444
|
export interface ListGasSponsorsReturn {
|
|
420
445
|
page: Page;
|
|
421
446
|
gasSponsors: Array<GasSponsor>;
|
|
422
447
|
}
|
|
448
|
+
export interface GetGasSponsorArgs {
|
|
449
|
+
projectId: number;
|
|
450
|
+
id: number;
|
|
451
|
+
}
|
|
452
|
+
export interface GetGasSponsorReturn {
|
|
453
|
+
gasSponsor: GasSponsor;
|
|
454
|
+
}
|
|
423
455
|
export interface AddGasSponsorArgs {
|
|
424
456
|
projectId: number;
|
|
425
|
-
gasTankId: number;
|
|
426
457
|
address: string;
|
|
427
458
|
name?: string;
|
|
428
459
|
active?: boolean;
|
|
@@ -432,6 +463,7 @@ export interface AddGasSponsorReturn {
|
|
|
432
463
|
gasSponsor: GasSponsor;
|
|
433
464
|
}
|
|
434
465
|
export interface UpdateGasSponsorArgs {
|
|
466
|
+
projectId: number;
|
|
435
467
|
id: number;
|
|
436
468
|
name?: string;
|
|
437
469
|
active?: boolean;
|
|
@@ -441,49 +473,19 @@ export interface UpdateGasSponsorReturn {
|
|
|
441
473
|
gasSponsor: GasSponsor;
|
|
442
474
|
}
|
|
443
475
|
export interface RemoveGasSponsorArgs {
|
|
444
|
-
id: number;
|
|
445
|
-
}
|
|
446
|
-
export interface RemoveGasSponsorReturn {
|
|
447
|
-
status: boolean;
|
|
448
|
-
}
|
|
449
|
-
export interface ReportGasSponsorUsageArgs {
|
|
450
476
|
projectId: number;
|
|
451
|
-
gasTankId: number;
|
|
452
|
-
startTime?: string;
|
|
453
|
-
endTime?: string;
|
|
454
|
-
}
|
|
455
|
-
export interface ReportGasSponsorUsageReturn {
|
|
456
|
-
gasSponsorUsage: Array<GasSponsorUsage>;
|
|
457
|
-
}
|
|
458
|
-
export interface NextGasTankBalanceAdjustmentNonceArgs {
|
|
459
|
-
id: number;
|
|
460
|
-
}
|
|
461
|
-
export interface NextGasTankBalanceAdjustmentNonceReturn {
|
|
462
|
-
nonce: number;
|
|
463
|
-
}
|
|
464
|
-
export interface AdjustGasTankBalanceArgs {
|
|
465
477
|
id: number;
|
|
466
|
-
nonce: number;
|
|
467
|
-
amount: number;
|
|
468
478
|
}
|
|
469
|
-
export interface
|
|
479
|
+
export interface RemoveGasSponsorReturn {
|
|
470
480
|
status: boolean;
|
|
471
|
-
adjustment: GasTankBalanceAdjustment;
|
|
472
|
-
}
|
|
473
|
-
export interface GetGasTankBalanceAdjustmentArgs {
|
|
474
|
-
id: number;
|
|
475
|
-
nonce: number;
|
|
476
|
-
}
|
|
477
|
-
export interface GetGasTankBalanceAdjustmentReturn {
|
|
478
|
-
adjustment: GasTankBalanceAdjustment;
|
|
479
481
|
}
|
|
480
|
-
export interface
|
|
481
|
-
|
|
482
|
+
export interface AddressGasSponsorsArgs {
|
|
483
|
+
address: string;
|
|
482
484
|
page?: Page;
|
|
483
485
|
}
|
|
484
|
-
export interface
|
|
486
|
+
export interface AddressGasSponsorsReturn {
|
|
485
487
|
page: Page;
|
|
486
|
-
|
|
488
|
+
gasSponsors: Array<GasSponsor>;
|
|
487
489
|
}
|
|
488
490
|
export interface GetProjectBalanceArgs {
|
|
489
491
|
projectId: number;
|
|
@@ -525,17 +527,16 @@ export declare class Relayer implements Relayer {
|
|
|
525
527
|
getGasTank: (args: GetGasTankArgs, headers?: object, signal?: AbortSignal) => Promise<GetGasTankReturn>;
|
|
526
528
|
addGasTank: (args: AddGasTankArgs, headers?: object, signal?: AbortSignal) => Promise<AddGasTankReturn>;
|
|
527
529
|
updateGasTank: (args: UpdateGasTankArgs, headers?: object, signal?: AbortSignal) => Promise<UpdateGasTankReturn>;
|
|
528
|
-
getGasSponsor: (args: GetGasSponsorArgs, headers?: object, signal?: AbortSignal) => Promise<GetGasSponsorReturn>;
|
|
529
|
-
addressGasSponsors: (args: AddressGasSponsorsArgs, headers?: object, signal?: AbortSignal) => Promise<AddressGasSponsorsReturn>;
|
|
530
|
-
listGasSponsors: (args: ListGasSponsorsArgs, headers?: object, signal?: AbortSignal) => Promise<ListGasSponsorsReturn>;
|
|
531
|
-
addGasSponsor: (args: AddGasSponsorArgs, headers?: object, signal?: AbortSignal) => Promise<AddGasSponsorReturn>;
|
|
532
|
-
updateGasSponsor: (args: UpdateGasSponsorArgs, headers?: object, signal?: AbortSignal) => Promise<UpdateGasSponsorReturn>;
|
|
533
|
-
removeGasSponsor: (args: RemoveGasSponsorArgs, headers?: object, signal?: AbortSignal) => Promise<RemoveGasSponsorReturn>;
|
|
534
|
-
reportGasSponsorUsage: (args: ReportGasSponsorUsageArgs, headers?: object, signal?: AbortSignal) => Promise<ReportGasSponsorUsageReturn>;
|
|
535
530
|
nextGasTankBalanceAdjustmentNonce: (args: NextGasTankBalanceAdjustmentNonceArgs, headers?: object, signal?: AbortSignal) => Promise<NextGasTankBalanceAdjustmentNonceReturn>;
|
|
536
531
|
adjustGasTankBalance: (args: AdjustGasTankBalanceArgs, headers?: object, signal?: AbortSignal) => Promise<AdjustGasTankBalanceReturn>;
|
|
537
532
|
getGasTankBalanceAdjustment: (args: GetGasTankBalanceAdjustmentArgs, headers?: object, signal?: AbortSignal) => Promise<GetGasTankBalanceAdjustmentReturn>;
|
|
538
533
|
listGasTankBalanceAdjustments: (args: ListGasTankBalanceAdjustmentsArgs, headers?: object, signal?: AbortSignal) => Promise<ListGasTankBalanceAdjustmentsReturn>;
|
|
534
|
+
listGasSponsors: (args: ListGasSponsorsArgs, headers?: object, signal?: AbortSignal) => Promise<ListGasSponsorsReturn>;
|
|
535
|
+
getGasSponsor: (args: GetGasSponsorArgs, headers?: object, signal?: AbortSignal) => Promise<GetGasSponsorReturn>;
|
|
536
|
+
addGasSponsor: (args: AddGasSponsorArgs, headers?: object, signal?: AbortSignal) => Promise<AddGasSponsorReturn>;
|
|
537
|
+
updateGasSponsor: (args: UpdateGasSponsorArgs, headers?: object, signal?: AbortSignal) => Promise<UpdateGasSponsorReturn>;
|
|
538
|
+
removeGasSponsor: (args: RemoveGasSponsorArgs, headers?: object, signal?: AbortSignal) => Promise<RemoveGasSponsorReturn>;
|
|
539
|
+
addressGasSponsors: (args: AddressGasSponsorsArgs, headers?: object, signal?: AbortSignal) => Promise<AddressGasSponsorsReturn>;
|
|
539
540
|
getProjectBalance: (args: GetProjectBalanceArgs, headers?: object, signal?: AbortSignal) => Promise<GetProjectBalanceReturn>;
|
|
540
541
|
adjustProjectBalance: (args: AdjustProjectBalanceArgs, headers?: object, signal?: AbortSignal) => Promise<AdjustProjectBalanceReturn>;
|
|
541
542
|
}
|
|
@@ -589,6 +590,9 @@ export declare class UnauthorizedError extends WebrpcError {
|
|
|
589
590
|
export declare class PermissionDeniedError extends WebrpcError {
|
|
590
591
|
constructor(name?: string, code?: number, message?: string, status?: number, cause?: string);
|
|
591
592
|
}
|
|
593
|
+
export declare class SessionExpiredError extends WebrpcError {
|
|
594
|
+
constructor(name?: string, code?: number, message?: string, status?: number, cause?: string);
|
|
595
|
+
}
|
|
592
596
|
export declare class MethodNotFoundError extends WebrpcError {
|
|
593
597
|
constructor(name?: string, code?: number, message?: string, status?: number, cause?: string);
|
|
594
598
|
}
|
|
@@ -601,6 +605,45 @@ export declare class AbortedError extends WebrpcError {
|
|
|
601
605
|
export declare class GeoblockedError extends WebrpcError {
|
|
602
606
|
constructor(name?: string, code?: number, message?: string, status?: number, cause?: string);
|
|
603
607
|
}
|
|
608
|
+
export declare class RateLimitedError extends WebrpcError {
|
|
609
|
+
constructor(name?: string, code?: number, message?: string, status?: number, cause?: string);
|
|
610
|
+
}
|
|
611
|
+
export declare class ProjectNotFoundError extends WebrpcError {
|
|
612
|
+
constructor(name?: string, code?: number, message?: string, status?: number, cause?: string);
|
|
613
|
+
}
|
|
614
|
+
export declare class AccessKeyNotFoundError extends WebrpcError {
|
|
615
|
+
constructor(name?: string, code?: number, message?: string, status?: number, cause?: string);
|
|
616
|
+
}
|
|
617
|
+
export declare class AccessKeyMismatchError extends WebrpcError {
|
|
618
|
+
constructor(name?: string, code?: number, message?: string, status?: number, cause?: string);
|
|
619
|
+
}
|
|
620
|
+
export declare class InvalidOriginError extends WebrpcError {
|
|
621
|
+
constructor(name?: string, code?: number, message?: string, status?: number, cause?: string);
|
|
622
|
+
}
|
|
623
|
+
export declare class InvalidServiceError extends WebrpcError {
|
|
624
|
+
constructor(name?: string, code?: number, message?: string, status?: number, cause?: string);
|
|
625
|
+
}
|
|
626
|
+
export declare class UnauthorizedUserError extends WebrpcError {
|
|
627
|
+
constructor(name?: string, code?: number, message?: string, status?: number, cause?: string);
|
|
628
|
+
}
|
|
629
|
+
export declare class QuotaExceededError extends WebrpcError {
|
|
630
|
+
constructor(name?: string, code?: number, message?: string, status?: number, cause?: string);
|
|
631
|
+
}
|
|
632
|
+
export declare class QuotaRateLimitError extends WebrpcError {
|
|
633
|
+
constructor(name?: string, code?: number, message?: string, status?: number, cause?: string);
|
|
634
|
+
}
|
|
635
|
+
export declare class NoDefaultKeyError extends WebrpcError {
|
|
636
|
+
constructor(name?: string, code?: number, message?: string, status?: number, cause?: string);
|
|
637
|
+
}
|
|
638
|
+
export declare class MaxAccessKeysError extends WebrpcError {
|
|
639
|
+
constructor(name?: string, code?: number, message?: string, status?: number, cause?: string);
|
|
640
|
+
}
|
|
641
|
+
export declare class AtLeastOneKeyError extends WebrpcError {
|
|
642
|
+
constructor(name?: string, code?: number, message?: string, status?: number, cause?: string);
|
|
643
|
+
}
|
|
644
|
+
export declare class TimeoutError extends WebrpcError {
|
|
645
|
+
constructor(name?: string, code?: number, message?: string, status?: number, cause?: string);
|
|
646
|
+
}
|
|
604
647
|
export declare class InvalidArgumentError extends WebrpcError {
|
|
605
648
|
constructor(name?: string, code?: number, message?: string, status?: number, cause?: string);
|
|
606
649
|
}
|
|
@@ -630,14 +673,70 @@ export declare enum errors {
|
|
|
630
673
|
WebrpcStreamFinished = "WebrpcStreamFinished",
|
|
631
674
|
Unauthorized = "Unauthorized",
|
|
632
675
|
PermissionDenied = "PermissionDenied",
|
|
676
|
+
SessionExpired = "SessionExpired",
|
|
633
677
|
MethodNotFound = "MethodNotFound",
|
|
634
678
|
RequestConflict = "RequestConflict",
|
|
635
679
|
Aborted = "Aborted",
|
|
636
680
|
Geoblocked = "Geoblocked",
|
|
681
|
+
RateLimited = "RateLimited",
|
|
682
|
+
ProjectNotFound = "ProjectNotFound",
|
|
683
|
+
AccessKeyNotFound = "AccessKeyNotFound",
|
|
684
|
+
AccessKeyMismatch = "AccessKeyMismatch",
|
|
685
|
+
InvalidOrigin = "InvalidOrigin",
|
|
686
|
+
InvalidService = "InvalidService",
|
|
687
|
+
UnauthorizedUser = "UnauthorizedUser",
|
|
688
|
+
QuotaExceeded = "QuotaExceeded",
|
|
689
|
+
QuotaRateLimit = "QuotaRateLimit",
|
|
690
|
+
NoDefaultKey = "NoDefaultKey",
|
|
691
|
+
MaxAccessKeys = "MaxAccessKeys",
|
|
692
|
+
AtLeastOneKey = "AtLeastOneKey",
|
|
693
|
+
Timeout = "Timeout",
|
|
637
694
|
InvalidArgument = "InvalidArgument",
|
|
638
695
|
Unavailable = "Unavailable",
|
|
639
696
|
QueryFailed = "QueryFailed",
|
|
640
697
|
NotFound = "NotFound",
|
|
641
698
|
InsufficientFee = "InsufficientFee"
|
|
642
699
|
}
|
|
700
|
+
export declare enum WebrpcErrorCodes {
|
|
701
|
+
WebrpcEndpoint = 0,
|
|
702
|
+
WebrpcRequestFailed = -1,
|
|
703
|
+
WebrpcBadRoute = -2,
|
|
704
|
+
WebrpcBadMethod = -3,
|
|
705
|
+
WebrpcBadRequest = -4,
|
|
706
|
+
WebrpcBadResponse = -5,
|
|
707
|
+
WebrpcServerPanic = -6,
|
|
708
|
+
WebrpcInternalError = -7,
|
|
709
|
+
WebrpcClientDisconnected = -8,
|
|
710
|
+
WebrpcStreamLost = -9,
|
|
711
|
+
WebrpcStreamFinished = -10,
|
|
712
|
+
Unauthorized = 1000,
|
|
713
|
+
PermissionDenied = 1001,
|
|
714
|
+
SessionExpired = 1002,
|
|
715
|
+
MethodNotFound = 1003,
|
|
716
|
+
RequestConflict = 1004,
|
|
717
|
+
Aborted = 1005,
|
|
718
|
+
Geoblocked = 1006,
|
|
719
|
+
RateLimited = 1007,
|
|
720
|
+
ProjectNotFound = 1008,
|
|
721
|
+
AccessKeyNotFound = 1101,
|
|
722
|
+
AccessKeyMismatch = 1102,
|
|
723
|
+
InvalidOrigin = 1103,
|
|
724
|
+
InvalidService = 1104,
|
|
725
|
+
UnauthorizedUser = 1105,
|
|
726
|
+
QuotaExceeded = 1200,
|
|
727
|
+
QuotaRateLimit = 1201,
|
|
728
|
+
NoDefaultKey = 1300,
|
|
729
|
+
MaxAccessKeys = 1301,
|
|
730
|
+
AtLeastOneKey = 1302,
|
|
731
|
+
Timeout = 1900,
|
|
732
|
+
InvalidArgument = 2001,
|
|
733
|
+
Unavailable = 2002,
|
|
734
|
+
QueryFailed = 2003,
|
|
735
|
+
NotFound = 3000,
|
|
736
|
+
InsufficientFee = 3004
|
|
737
|
+
}
|
|
738
|
+
export declare const webrpcErrorByCode: {
|
|
739
|
+
[code: number]: any;
|
|
740
|
+
};
|
|
643
741
|
export type Fetch = (input: RequestInfo, init?: RequestInit) => Promise<Response>;
|
|
742
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xsequence/relayer",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.11",
|
|
4
4
|
"description": "relayer sub-package for Sequence",
|
|
5
5
|
"repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/relayer",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -12,15 +12,15 @@
|
|
|
12
12
|
"ethers": ">=6"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@0xsequence/abi": "2.2.
|
|
16
|
-
"@0xsequence/core": "2.2.
|
|
17
|
-
"@0xsequence/utils": "2.2.
|
|
15
|
+
"@0xsequence/abi": "2.2.11",
|
|
16
|
+
"@0xsequence/core": "2.2.11",
|
|
17
|
+
"@0xsequence/utils": "2.2.11"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@0xsequence/wallet-contracts": "^3.0.1",
|
|
21
21
|
"ethers": "6.13.4",
|
|
22
|
-
"@0xsequence/
|
|
23
|
-
"@0xsequence/
|
|
22
|
+
"@0xsequence/tests": "2.2.11",
|
|
23
|
+
"@0xsequence/signhub": "2.2.11"
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
"src",
|
package/src/index.ts
CHANGED
|
@@ -29,6 +29,12 @@ export interface Relayer {
|
|
|
29
29
|
// relayer for submitting your transaction to a network.
|
|
30
30
|
gasRefundOptions(address: string, ...transactions: commons.transaction.Transaction[]): Promise<FeeOption[]>
|
|
31
31
|
|
|
32
|
+
// Gas tank sponsorship management
|
|
33
|
+
listGasSponsors(args: proto.ListGasSponsorsArgs): Promise<proto.ListGasSponsorsReturn>
|
|
34
|
+
addGasSponsor(args: proto.AddGasSponsorArgs): Promise<proto.AddGasSponsorReturn>
|
|
35
|
+
updateGasSponsor(args: proto.UpdateGasSponsorArgs): Promise<proto.UpdateGasSponsorReturn>
|
|
36
|
+
removeGasSponsor(args: proto.RemoveGasSponsorArgs): Promise<proto.RemoveGasSponsorReturn>
|
|
37
|
+
|
|
32
38
|
// getNonce returns the transaction count/nonce for a wallet, encoded with nonce space.
|
|
33
39
|
// If space is undefined, the relayer can choose a nonce space to encode the result with.
|
|
34
40
|
// Otherwise, the relayer must return a nonce encoded for the given nonce space.
|
package/src/local-relayer.ts
CHANGED
|
@@ -96,6 +96,22 @@ export class LocalRelayer extends ProviderRelayer implements Relayer {
|
|
|
96
96
|
}> {
|
|
97
97
|
return { cost: 0 }
|
|
98
98
|
}
|
|
99
|
+
|
|
100
|
+
async listGasSponsors(args: proto.ListGasSponsorsArgs): Promise<proto.ListGasSponsorsReturn> {
|
|
101
|
+
return { page: { page: 0, pageSize: 100 }, gasSponsors: [] }
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
async addGasSponsor(args: proto.AddGasSponsorArgs): Promise<proto.AddGasSponsorReturn> {
|
|
105
|
+
return { status: true, gasSponsor: {} as proto.GasSponsor }
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
async updateGasSponsor(args: proto.UpdateGasSponsorArgs): Promise<proto.UpdateGasSponsorReturn> {
|
|
109
|
+
return { status: true, gasSponsor: {} as proto.GasSponsor }
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
async removeGasSponsor(args: proto.RemoveGasSponsorArgs): Promise<proto.RemoveGasSponsorReturn> {
|
|
113
|
+
return { status: true }
|
|
114
|
+
}
|
|
99
115
|
}
|
|
100
116
|
|
|
101
117
|
function isAbstractSigner(signer: any): signer is ethers.AbstractSigner {
|
package/src/provider-relayer.ts
CHANGED
|
@@ -75,6 +75,14 @@ export abstract class ProviderRelayer implements Relayer {
|
|
|
75
75
|
transactions: proto.MetaTxnLog[]
|
|
76
76
|
}>
|
|
77
77
|
|
|
78
|
+
abstract listGasSponsors(args: proto.ListGasSponsorsArgs): Promise<proto.ListGasSponsorsReturn>
|
|
79
|
+
|
|
80
|
+
abstract addGasSponsor(args: proto.AddGasSponsorArgs): Promise<proto.AddGasSponsorReturn>
|
|
81
|
+
|
|
82
|
+
abstract updateGasSponsor(args: proto.UpdateGasSponsorArgs): Promise<proto.UpdateGasSponsorReturn>
|
|
83
|
+
|
|
84
|
+
abstract removeGasSponsor(args: proto.RemoveGasSponsorArgs): Promise<proto.RemoveGasSponsorReturn>
|
|
85
|
+
|
|
78
86
|
async simulate(wallet: string, ...transactions: commons.transaction.Transaction[]): Promise<SimulateResult[]> {
|
|
79
87
|
return (
|
|
80
88
|
await Promise.all(
|
package/src/rpc-relayer/index.ts
CHANGED
|
@@ -324,6 +324,22 @@ export class RpcRelayer implements Relayer {
|
|
|
324
324
|
}> {
|
|
325
325
|
return this.service.getTransactionCost({ projectId, from, to })
|
|
326
326
|
}
|
|
327
|
+
|
|
328
|
+
async listGasSponsors(args: proto.ListGasSponsorsArgs): Promise<proto.ListGasSponsorsReturn> {
|
|
329
|
+
return this.service.listGasSponsors(args)
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
async addGasSponsor(args: proto.AddGasSponsorArgs): Promise<proto.AddGasSponsorReturn> {
|
|
333
|
+
return this.service.addGasSponsor(args)
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
async updateGasSponsor(args: proto.UpdateGasSponsorArgs): Promise<proto.UpdateGasSponsorReturn> {
|
|
337
|
+
return this.service.updateGasSponsor(args)
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
async removeGasSponsor(args: proto.RemoveGasSponsorArgs): Promise<proto.RemoveGasSponsorReturn> {
|
|
341
|
+
return this.service.removeGasSponsor(args)
|
|
342
|
+
}
|
|
327
343
|
}
|
|
328
344
|
|
|
329
345
|
class MetaTransactionResponseException {
|