@0xsequence/relayer 1.2.7 → 1.2.9

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.
@@ -187,7 +187,7 @@ class LocalRelayer extends ProviderRelayer {
187
187
  options: []
188
188
  };
189
189
  }
190
- async getFeeOptionsRaw(_entrypoint, _data) {
190
+ async getFeeOptionsRaw(_entrypoint, _data, _options) {
191
191
  return {
192
192
  options: []
193
193
  };
@@ -229,11 +229,11 @@ class LocalRelayer extends ProviderRelayer {
229
229
  }
230
230
 
231
231
  /* eslint-disable */
232
- // sequence-relayer v0.4.0 752f4f4274ca80d2fd974b5b44ed8245dfe40554
232
+ // sequence-relayer v0.4.0 950b00c821b56110c64d947312b9dea3e197e207
233
233
  // --
234
- // Code generated by webrpc-gen@v0.10.x-dev with typescript generator. DO NOT EDIT.
234
+ // Code generated by webrpc-gen@v0.12.x-dev with typescript@v0.10.0 generator. DO NOT EDIT.
235
235
  //
236
- // webrpc-gen -schema=relayer.ridl -target=typescript -client -out=./clients/relayer.gen.ts
236
+ // webrpc-gen -schema=relayer.ridl -target=typescript@v0.10.0 -client -out=./clients/relayer.gen.ts
237
237
 
238
238
  // WebRPC description and code-gen version
239
239
  const WebRPCVersion = 'v1';
@@ -242,7 +242,7 @@ const WebRPCVersion = 'v1';
242
242
  const WebRPCSchemaVersion = 'v0.4.0';
243
243
 
244
244
  // Schema hash generated from your RIDL schema
245
- const WebRPCSchemaHash = '752f4f4274ca80d2fd974b5b44ed8245dfe40554';
245
+ const WebRPCSchemaHash = '950b00c821b56110c64d947312b9dea3e197e207';
246
246
 
247
247
  //
248
248
  // Types
@@ -424,6 +424,44 @@ class Relayer {
424
424
  });
425
425
  });
426
426
  };
427
+ this.getGasTank = (args, headers) => {
428
+ return this.fetch(this.url('GetGasTank'), createHTTPRequest(args, headers)).then(res => {
429
+ return buildResponse(res).then(_data => {
430
+ return {
431
+ gasTank: _data.gasTank
432
+ };
433
+ });
434
+ });
435
+ };
436
+ this.addGasTank = (args, headers) => {
437
+ return this.fetch(this.url('AddGasTank'), createHTTPRequest(args, headers)).then(res => {
438
+ return buildResponse(res).then(_data => {
439
+ return {
440
+ status: _data.status,
441
+ gasTank: _data.gasTank
442
+ };
443
+ });
444
+ });
445
+ };
446
+ this.updateGasTank = (args, headers) => {
447
+ return this.fetch(this.url('UpdateGasTank'), createHTTPRequest(args, headers)).then(res => {
448
+ return buildResponse(res).then(_data => {
449
+ return {
450
+ status: _data.status,
451
+ gasTank: _data.gasTank
452
+ };
453
+ });
454
+ });
455
+ };
456
+ this.getGasSponsor = (args, headers) => {
457
+ return this.fetch(this.url('GetGasSponsor'), createHTTPRequest(args, headers)).then(res => {
458
+ return buildResponse(res).then(_data => {
459
+ return {
460
+ gasSponsor: _data.gasSponsor
461
+ };
462
+ });
463
+ });
464
+ };
427
465
  this.listGasSponsors = (args, headers) => {
428
466
  return this.fetch(this.url('ListGasSponsors'), createHTTPRequest(args, headers)).then(res => {
429
467
  return buildResponse(res).then(_data => {
@@ -454,6 +492,15 @@ class Relayer {
454
492
  });
455
493
  });
456
494
  };
495
+ this.removeGasSponsor = (args, headers) => {
496
+ return this.fetch(this.url('RemoveGasSponsor'), createHTTPRequest(args, headers)).then(res => {
497
+ return buildResponse(res).then(_data => {
498
+ return {
499
+ status: _data.status
500
+ };
501
+ });
502
+ });
503
+ };
457
504
  this.reportGasSponsorUsage = (args, headers) => {
458
505
  return this.fetch(this.url('ReportGasSponsorUsage'), createHTTPRequest(args, headers)).then(res => {
459
506
  return buildResponse(res).then(_data => {
@@ -463,6 +510,44 @@ class Relayer {
463
510
  });
464
511
  });
465
512
  };
513
+ this.nextGasTankBalanceAdjustmentNonce = (args, headers) => {
514
+ return this.fetch(this.url('NextGasTankBalanceAdjustmentNonce'), createHTTPRequest(args, headers)).then(res => {
515
+ return buildResponse(res).then(_data => {
516
+ return {
517
+ nonce: _data.nonce
518
+ };
519
+ });
520
+ });
521
+ };
522
+ this.adjustGasTankBalance = (args, headers) => {
523
+ return this.fetch(this.url('AdjustGasTankBalance'), createHTTPRequest(args, headers)).then(res => {
524
+ return buildResponse(res).then(_data => {
525
+ return {
526
+ status: _data.status,
527
+ adjustment: _data.adjustment
528
+ };
529
+ });
530
+ });
531
+ };
532
+ this.getGasTankBalanceAdjustment = (args, headers) => {
533
+ return this.fetch(this.url('GetGasTankBalanceAdjustment'), createHTTPRequest(args, headers)).then(res => {
534
+ return buildResponse(res).then(_data => {
535
+ return {
536
+ adjustment: _data.adjustment
537
+ };
538
+ });
539
+ });
540
+ };
541
+ this.listGasTankBalanceAdjustments = (args, headers) => {
542
+ return this.fetch(this.url('ListGasTankBalanceAdjustments'), createHTTPRequest(args, headers)).then(res => {
543
+ return buildResponse(res).then(_data => {
544
+ return {
545
+ page: _data.page,
546
+ adjustments: _data.adjustments
547
+ };
548
+ });
549
+ });
550
+ };
466
551
  this.hostname = hostname;
467
552
  this.fetch = (input, init) => fetch(input, init);
468
553
  }
@@ -600,17 +685,18 @@ class RpcRelayer {
600
685
  };
601
686
  }
602
687
  }
603
- async getFeeOptionsRaw(entrypoint, data) {
688
+ async getFeeOptionsRaw(entrypoint, data, options) {
604
689
  const {
605
- options,
690
+ options: feeOptions,
606
691
  quote
607
692
  } = await this.service.feeOptions({
608
693
  wallet: entrypoint,
609
694
  to: entrypoint,
610
- data: ethers.ethers.utils.hexlify(data)
695
+ data: ethers.ethers.utils.hexlify(data),
696
+ simulate: options == null ? void 0 : options.simulate
611
697
  });
612
698
  return {
613
- options,
699
+ options: feeOptions,
614
700
  quote: {
615
701
  _tag: 'FeeQuote',
616
702
  _quote: quote
@@ -187,7 +187,7 @@ class LocalRelayer extends ProviderRelayer {
187
187
  options: []
188
188
  };
189
189
  }
190
- async getFeeOptionsRaw(_entrypoint, _data) {
190
+ async getFeeOptionsRaw(_entrypoint, _data, _options) {
191
191
  return {
192
192
  options: []
193
193
  };
@@ -229,11 +229,11 @@ class LocalRelayer extends ProviderRelayer {
229
229
  }
230
230
 
231
231
  /* eslint-disable */
232
- // sequence-relayer v0.4.0 752f4f4274ca80d2fd974b5b44ed8245dfe40554
232
+ // sequence-relayer v0.4.0 950b00c821b56110c64d947312b9dea3e197e207
233
233
  // --
234
- // Code generated by webrpc-gen@v0.10.x-dev with typescript generator. DO NOT EDIT.
234
+ // Code generated by webrpc-gen@v0.12.x-dev with typescript@v0.10.0 generator. DO NOT EDIT.
235
235
  //
236
- // webrpc-gen -schema=relayer.ridl -target=typescript -client -out=./clients/relayer.gen.ts
236
+ // webrpc-gen -schema=relayer.ridl -target=typescript@v0.10.0 -client -out=./clients/relayer.gen.ts
237
237
 
238
238
  // WebRPC description and code-gen version
239
239
  const WebRPCVersion = 'v1';
@@ -242,7 +242,7 @@ const WebRPCVersion = 'v1';
242
242
  const WebRPCSchemaVersion = 'v0.4.0';
243
243
 
244
244
  // Schema hash generated from your RIDL schema
245
- const WebRPCSchemaHash = '752f4f4274ca80d2fd974b5b44ed8245dfe40554';
245
+ const WebRPCSchemaHash = '950b00c821b56110c64d947312b9dea3e197e207';
246
246
 
247
247
  //
248
248
  // Types
@@ -424,6 +424,44 @@ class Relayer {
424
424
  });
425
425
  });
426
426
  };
427
+ this.getGasTank = (args, headers) => {
428
+ return this.fetch(this.url('GetGasTank'), createHTTPRequest(args, headers)).then(res => {
429
+ return buildResponse(res).then(_data => {
430
+ return {
431
+ gasTank: _data.gasTank
432
+ };
433
+ });
434
+ });
435
+ };
436
+ this.addGasTank = (args, headers) => {
437
+ return this.fetch(this.url('AddGasTank'), createHTTPRequest(args, headers)).then(res => {
438
+ return buildResponse(res).then(_data => {
439
+ return {
440
+ status: _data.status,
441
+ gasTank: _data.gasTank
442
+ };
443
+ });
444
+ });
445
+ };
446
+ this.updateGasTank = (args, headers) => {
447
+ return this.fetch(this.url('UpdateGasTank'), createHTTPRequest(args, headers)).then(res => {
448
+ return buildResponse(res).then(_data => {
449
+ return {
450
+ status: _data.status,
451
+ gasTank: _data.gasTank
452
+ };
453
+ });
454
+ });
455
+ };
456
+ this.getGasSponsor = (args, headers) => {
457
+ return this.fetch(this.url('GetGasSponsor'), createHTTPRequest(args, headers)).then(res => {
458
+ return buildResponse(res).then(_data => {
459
+ return {
460
+ gasSponsor: _data.gasSponsor
461
+ };
462
+ });
463
+ });
464
+ };
427
465
  this.listGasSponsors = (args, headers) => {
428
466
  return this.fetch(this.url('ListGasSponsors'), createHTTPRequest(args, headers)).then(res => {
429
467
  return buildResponse(res).then(_data => {
@@ -454,6 +492,15 @@ class Relayer {
454
492
  });
455
493
  });
456
494
  };
495
+ this.removeGasSponsor = (args, headers) => {
496
+ return this.fetch(this.url('RemoveGasSponsor'), createHTTPRequest(args, headers)).then(res => {
497
+ return buildResponse(res).then(_data => {
498
+ return {
499
+ status: _data.status
500
+ };
501
+ });
502
+ });
503
+ };
457
504
  this.reportGasSponsorUsage = (args, headers) => {
458
505
  return this.fetch(this.url('ReportGasSponsorUsage'), createHTTPRequest(args, headers)).then(res => {
459
506
  return buildResponse(res).then(_data => {
@@ -463,6 +510,44 @@ class Relayer {
463
510
  });
464
511
  });
465
512
  };
513
+ this.nextGasTankBalanceAdjustmentNonce = (args, headers) => {
514
+ return this.fetch(this.url('NextGasTankBalanceAdjustmentNonce'), createHTTPRequest(args, headers)).then(res => {
515
+ return buildResponse(res).then(_data => {
516
+ return {
517
+ nonce: _data.nonce
518
+ };
519
+ });
520
+ });
521
+ };
522
+ this.adjustGasTankBalance = (args, headers) => {
523
+ return this.fetch(this.url('AdjustGasTankBalance'), createHTTPRequest(args, headers)).then(res => {
524
+ return buildResponse(res).then(_data => {
525
+ return {
526
+ status: _data.status,
527
+ adjustment: _data.adjustment
528
+ };
529
+ });
530
+ });
531
+ };
532
+ this.getGasTankBalanceAdjustment = (args, headers) => {
533
+ return this.fetch(this.url('GetGasTankBalanceAdjustment'), createHTTPRequest(args, headers)).then(res => {
534
+ return buildResponse(res).then(_data => {
535
+ return {
536
+ adjustment: _data.adjustment
537
+ };
538
+ });
539
+ });
540
+ };
541
+ this.listGasTankBalanceAdjustments = (args, headers) => {
542
+ return this.fetch(this.url('ListGasTankBalanceAdjustments'), createHTTPRequest(args, headers)).then(res => {
543
+ return buildResponse(res).then(_data => {
544
+ return {
545
+ page: _data.page,
546
+ adjustments: _data.adjustments
547
+ };
548
+ });
549
+ });
550
+ };
466
551
  this.hostname = hostname;
467
552
  this.fetch = (input, init) => fetch(input, init);
468
553
  }
@@ -600,17 +685,18 @@ class RpcRelayer {
600
685
  };
601
686
  }
602
687
  }
603
- async getFeeOptionsRaw(entrypoint, data) {
688
+ async getFeeOptionsRaw(entrypoint, data, options) {
604
689
  const {
605
- options,
690
+ options: feeOptions,
606
691
  quote
607
692
  } = await this.service.feeOptions({
608
693
  wallet: entrypoint,
609
694
  to: entrypoint,
610
- data: ethers.ethers.utils.hexlify(data)
695
+ data: ethers.ethers.utils.hexlify(data),
696
+ simulate: options == null ? void 0 : options.simulate
611
697
  });
612
698
  return {
613
- options,
699
+ options: feeOptions,
614
700
  quote: {
615
701
  _tag: 'FeeQuote',
616
702
  _quote: quote
@@ -183,7 +183,7 @@ class LocalRelayer extends ProviderRelayer {
183
183
  options: []
184
184
  };
185
185
  }
186
- async getFeeOptionsRaw(_entrypoint, _data) {
186
+ async getFeeOptionsRaw(_entrypoint, _data, _options) {
187
187
  return {
188
188
  options: []
189
189
  };
@@ -225,11 +225,11 @@ class LocalRelayer extends ProviderRelayer {
225
225
  }
226
226
 
227
227
  /* eslint-disable */
228
- // sequence-relayer v0.4.0 752f4f4274ca80d2fd974b5b44ed8245dfe40554
228
+ // sequence-relayer v0.4.0 950b00c821b56110c64d947312b9dea3e197e207
229
229
  // --
230
- // Code generated by webrpc-gen@v0.10.x-dev with typescript generator. DO NOT EDIT.
230
+ // Code generated by webrpc-gen@v0.12.x-dev with typescript@v0.10.0 generator. DO NOT EDIT.
231
231
  //
232
- // webrpc-gen -schema=relayer.ridl -target=typescript -client -out=./clients/relayer.gen.ts
232
+ // webrpc-gen -schema=relayer.ridl -target=typescript@v0.10.0 -client -out=./clients/relayer.gen.ts
233
233
 
234
234
  // WebRPC description and code-gen version
235
235
  const WebRPCVersion = 'v1';
@@ -238,7 +238,7 @@ const WebRPCVersion = 'v1';
238
238
  const WebRPCSchemaVersion = 'v0.4.0';
239
239
 
240
240
  // Schema hash generated from your RIDL schema
241
- const WebRPCSchemaHash = '752f4f4274ca80d2fd974b5b44ed8245dfe40554';
241
+ const WebRPCSchemaHash = '950b00c821b56110c64d947312b9dea3e197e207';
242
242
 
243
243
  //
244
244
  // Types
@@ -420,6 +420,44 @@ class Relayer {
420
420
  });
421
421
  });
422
422
  };
423
+ this.getGasTank = (args, headers) => {
424
+ return this.fetch(this.url('GetGasTank'), createHTTPRequest(args, headers)).then(res => {
425
+ return buildResponse(res).then(_data => {
426
+ return {
427
+ gasTank: _data.gasTank
428
+ };
429
+ });
430
+ });
431
+ };
432
+ this.addGasTank = (args, headers) => {
433
+ return this.fetch(this.url('AddGasTank'), createHTTPRequest(args, headers)).then(res => {
434
+ return buildResponse(res).then(_data => {
435
+ return {
436
+ status: _data.status,
437
+ gasTank: _data.gasTank
438
+ };
439
+ });
440
+ });
441
+ };
442
+ this.updateGasTank = (args, headers) => {
443
+ return this.fetch(this.url('UpdateGasTank'), createHTTPRequest(args, headers)).then(res => {
444
+ return buildResponse(res).then(_data => {
445
+ return {
446
+ status: _data.status,
447
+ gasTank: _data.gasTank
448
+ };
449
+ });
450
+ });
451
+ };
452
+ this.getGasSponsor = (args, headers) => {
453
+ return this.fetch(this.url('GetGasSponsor'), createHTTPRequest(args, headers)).then(res => {
454
+ return buildResponse(res).then(_data => {
455
+ return {
456
+ gasSponsor: _data.gasSponsor
457
+ };
458
+ });
459
+ });
460
+ };
423
461
  this.listGasSponsors = (args, headers) => {
424
462
  return this.fetch(this.url('ListGasSponsors'), createHTTPRequest(args, headers)).then(res => {
425
463
  return buildResponse(res).then(_data => {
@@ -450,6 +488,15 @@ class Relayer {
450
488
  });
451
489
  });
452
490
  };
491
+ this.removeGasSponsor = (args, headers) => {
492
+ return this.fetch(this.url('RemoveGasSponsor'), createHTTPRequest(args, headers)).then(res => {
493
+ return buildResponse(res).then(_data => {
494
+ return {
495
+ status: _data.status
496
+ };
497
+ });
498
+ });
499
+ };
453
500
  this.reportGasSponsorUsage = (args, headers) => {
454
501
  return this.fetch(this.url('ReportGasSponsorUsage'), createHTTPRequest(args, headers)).then(res => {
455
502
  return buildResponse(res).then(_data => {
@@ -459,6 +506,44 @@ class Relayer {
459
506
  });
460
507
  });
461
508
  };
509
+ this.nextGasTankBalanceAdjustmentNonce = (args, headers) => {
510
+ return this.fetch(this.url('NextGasTankBalanceAdjustmentNonce'), createHTTPRequest(args, headers)).then(res => {
511
+ return buildResponse(res).then(_data => {
512
+ return {
513
+ nonce: _data.nonce
514
+ };
515
+ });
516
+ });
517
+ };
518
+ this.adjustGasTankBalance = (args, headers) => {
519
+ return this.fetch(this.url('AdjustGasTankBalance'), createHTTPRequest(args, headers)).then(res => {
520
+ return buildResponse(res).then(_data => {
521
+ return {
522
+ status: _data.status,
523
+ adjustment: _data.adjustment
524
+ };
525
+ });
526
+ });
527
+ };
528
+ this.getGasTankBalanceAdjustment = (args, headers) => {
529
+ return this.fetch(this.url('GetGasTankBalanceAdjustment'), createHTTPRequest(args, headers)).then(res => {
530
+ return buildResponse(res).then(_data => {
531
+ return {
532
+ adjustment: _data.adjustment
533
+ };
534
+ });
535
+ });
536
+ };
537
+ this.listGasTankBalanceAdjustments = (args, headers) => {
538
+ return this.fetch(this.url('ListGasTankBalanceAdjustments'), createHTTPRequest(args, headers)).then(res => {
539
+ return buildResponse(res).then(_data => {
540
+ return {
541
+ page: _data.page,
542
+ adjustments: _data.adjustments
543
+ };
544
+ });
545
+ });
546
+ };
462
547
  this.hostname = hostname;
463
548
  this.fetch = (input, init) => fetch(input, init);
464
549
  }
@@ -596,17 +681,18 @@ class RpcRelayer {
596
681
  };
597
682
  }
598
683
  }
599
- async getFeeOptionsRaw(entrypoint, data) {
684
+ async getFeeOptionsRaw(entrypoint, data, options) {
600
685
  const {
601
- options,
686
+ options: feeOptions,
602
687
  quote
603
688
  } = await this.service.feeOptions({
604
689
  wallet: entrypoint,
605
690
  to: entrypoint,
606
- data: ethers.utils.hexlify(data)
691
+ data: ethers.utils.hexlify(data),
692
+ simulate: options == null ? void 0 : options.simulate
607
693
  });
608
694
  return {
609
- options,
695
+ options: feeOptions,
610
696
  quote: {
611
697
  _tag: 'FeeQuote',
612
698
  _quote: quote
@@ -7,7 +7,9 @@ export interface Relayer {
7
7
  options: FeeOption[];
8
8
  quote?: FeeQuote;
9
9
  }>;
10
- getFeeOptionsRaw(entrypoint: string, data: ethers.utils.BytesLike): Promise<{
10
+ getFeeOptionsRaw(entrypoint: string, data: ethers.utils.BytesLike, options?: {
11
+ simulate?: boolean;
12
+ }): Promise<{
11
13
  options: FeeOption[];
12
14
  quote?: FeeQuote;
13
15
  }>;
@@ -13,7 +13,9 @@ export declare class LocalRelayer extends ProviderRelayer implements Relayer {
13
13
  getFeeOptions(_address: string, ..._transactions: commons.transaction.Transaction[]): Promise<{
14
14
  options: FeeOption[];
15
15
  }>;
16
- getFeeOptionsRaw(_entrypoint: string, _data: BytesLike): Promise<{
16
+ getFeeOptionsRaw(_entrypoint: string, _data: BytesLike, _options?: {
17
+ simulate?: boolean;
18
+ }): Promise<{
17
19
  options: FeeOption[];
18
20
  }>;
19
21
  gasRefundOptions(address: string, ...transactions: commons.transaction.Transaction[]): Promise<FeeOption[]>;
@@ -20,7 +20,9 @@ export declare abstract class ProviderRelayer implements Relayer {
20
20
  options: FeeOption[];
21
21
  quote?: FeeQuote;
22
22
  }>;
23
- abstract getFeeOptionsRaw(entrypoint: string, data: ethers.utils.BytesLike): Promise<{
23
+ abstract getFeeOptionsRaw(entrypoint: string, data: ethers.utils.BytesLike, options?: {
24
+ simulate?: boolean;
25
+ }): Promise<{
24
26
  options: FeeOption[];
25
27
  quote?: FeeQuote;
26
28
  }>;
@@ -20,7 +20,9 @@ export declare class RpcRelayer implements Relayer {
20
20
  options: FeeOption[];
21
21
  quote?: FeeQuote;
22
22
  }>;
23
- getFeeOptionsRaw(entrypoint: string, data: ethers.utils.BytesLike): Promise<{
23
+ getFeeOptionsRaw(entrypoint: string, data: ethers.utils.BytesLike, options?: {
24
+ simulate?: boolean;
25
+ }): Promise<{
24
26
  options: FeeOption[];
25
27
  quote?: FeeQuote;
26
28
  }>;
@@ -1,6 +1,6 @@
1
1
  export declare const WebRPCVersion = "v1";
2
2
  export declare const WebRPCSchemaVersion = "v0.4.0";
3
- export declare const WebRPCSchemaHash = "752f4f4274ca80d2fd974b5b44ed8245dfe40554";
3
+ export declare const WebRPCSchemaHash = "950b00c821b56110c64d947312b9dea3e197e207";
4
4
  export declare enum ETHTxnStatus {
5
5
  UNKNOWN = "UNKNOWN",
6
6
  DROPPED = "DROPPED",
@@ -42,7 +42,7 @@ export interface RuntimeStatus {
42
42
  commitHash: string;
43
43
  senders: Array<SenderStatus>;
44
44
  checks: RuntimeChecks;
45
- numTxnsRelayed: number;
45
+ numTxnsRelayed: NumTxnsRelayed;
46
46
  }
47
47
  export interface SenderStatus {
48
48
  index: number;
@@ -52,6 +52,11 @@ export interface SenderStatus {
52
52
  }
53
53
  export interface RuntimeChecks {
54
54
  }
55
+ export interface NumTxnsRelayed {
56
+ prev: number;
57
+ current: number;
58
+ period: number;
59
+ }
55
60
  export interface SequenceContext {
56
61
  factory: string;
57
62
  mainModule: string;
@@ -59,29 +64,39 @@ export interface SequenceContext {
59
64
  guestModule: string;
60
65
  utils: string;
61
66
  }
62
- export interface WalletConfig {
63
- address: string;
64
- signers: Array<WalletSigner>;
65
- threshold: number;
66
- chainId?: number;
67
+ export interface GasTank {
68
+ id: number;
69
+ name: string;
70
+ currentBalance: number;
71
+ unlimited: boolean;
72
+ feeMarkupFactor: number;
73
+ updatedAt: string;
74
+ createdAt: string;
67
75
  }
68
- export interface WalletSigner {
69
- address: string;
70
- weight: number;
76
+ export interface GasTankBalanceAdjustment {
77
+ gasTankId: number;
78
+ nonce: number;
79
+ amount: number;
80
+ totalBalance: number;
81
+ balanceTimestamp: string;
82
+ createdAt: string;
71
83
  }
72
84
  export interface GasSponsor {
73
85
  id: number;
86
+ gasTankId: number;
74
87
  address: string;
75
88
  name: string;
76
89
  active: boolean;
77
90
  updatedAt: string;
78
91
  createdAt: string;
92
+ deletedAt: string;
79
93
  }
80
94
  export interface GasSponsorUsage {
81
95
  name: string;
82
96
  id: number;
83
97
  totalGasUsed: number;
84
98
  totalTxnFees: number;
99
+ totalTxnFeesUsd: number;
85
100
  avgGasPrice: number;
86
101
  totalTxns: number;
87
102
  startTime: string;
@@ -116,8 +131,12 @@ export interface MetaTxnLog {
116
131
  gasLimit: number;
117
132
  gasPrice: string;
118
133
  gasUsed: number;
134
+ gasEstimated: number;
135
+ gasFeeMarkup?: number;
136
+ usdRate: string;
119
137
  isWhitelisted: boolean;
120
138
  gasSponsor?: number;
139
+ gasTank?: number;
121
140
  updatedAt: string;
122
141
  createdAt: string;
123
142
  }
@@ -224,10 +243,19 @@ export interface Relayer {
224
243
  getMetaTxnNetworkFeeOptions(args: GetMetaTxnNetworkFeeOptionsArgs, headers?: object): Promise<GetMetaTxnNetworkFeeOptionsReturn>;
225
244
  sentTransactions(args: SentTransactionsArgs, headers?: object): Promise<SentTransactionsReturn>;
226
245
  pendingTransactions(args: PendingTransactionsArgs, headers?: object): Promise<PendingTransactionsReturn>;
246
+ getGasTank(args: GetGasTankArgs, headers?: object): Promise<GetGasTankReturn>;
247
+ addGasTank(args: AddGasTankArgs, headers?: object): Promise<AddGasTankReturn>;
248
+ updateGasTank(args: UpdateGasTankArgs, headers?: object): Promise<UpdateGasTankReturn>;
249
+ getGasSponsor(args: GetGasSponsorArgs, headers?: object): Promise<GetGasSponsorReturn>;
227
250
  listGasSponsors(args: ListGasSponsorsArgs, headers?: object): Promise<ListGasSponsorsReturn>;
228
251
  addGasSponsor(args: AddGasSponsorArgs, headers?: object): Promise<AddGasSponsorReturn>;
229
252
  updateGasSponsor(args: UpdateGasSponsorArgs, headers?: object): Promise<UpdateGasSponsorReturn>;
253
+ removeGasSponsor(args: RemoveGasSponsorArgs, headers?: object): Promise<RemoveGasSponsorReturn>;
230
254
  reportGasSponsorUsage(args: ReportGasSponsorUsageArgs, headers?: object): Promise<ReportGasSponsorUsageReturn>;
255
+ nextGasTankBalanceAdjustmentNonce(args: NextGasTankBalanceAdjustmentNonceArgs, headers?: object): Promise<NextGasTankBalanceAdjustmentNonceReturn>;
256
+ adjustGasTankBalance(args: AdjustGasTankBalanceArgs, headers?: object): Promise<AdjustGasTankBalanceReturn>;
257
+ getGasTankBalanceAdjustment(args: GetGasTankBalanceAdjustmentArgs, headers?: object): Promise<GetGasTankBalanceAdjustmentReturn>;
258
+ listGasTankBalanceAdjustments(args: ListGasTankBalanceAdjustmentsArgs, headers?: object): Promise<ListGasTankBalanceAdjustmentsReturn>;
231
259
  }
232
260
  export interface PingArgs {
233
261
  }
@@ -284,7 +312,7 @@ export interface SimulateReturn {
284
312
  }
285
313
  export interface UpdateMetaTxnGasLimitsArgs {
286
314
  walletAddress: string;
287
- walletConfig: WalletConfig;
315
+ walletConfig: any;
288
316
  payload: string;
289
317
  }
290
318
  export interface UpdateMetaTxnGasLimitsReturn {
@@ -300,13 +328,14 @@ export interface FeeOptionsArgs {
300
328
  wallet: string;
301
329
  to: string;
302
330
  data: string;
331
+ simulate?: boolean;
303
332
  }
304
333
  export interface FeeOptionsReturn {
305
334
  options: Array<FeeOption>;
306
335
  quote?: string;
307
336
  }
308
337
  export interface GetMetaTxnNetworkFeeOptionsArgs {
309
- walletConfig: WalletConfig;
338
+ walletConfig: any;
310
339
  payload: string;
311
340
  }
312
341
  export interface GetMetaTxnNetworkFeeOptionsReturn {
@@ -327,7 +356,39 @@ export interface PendingTransactionsReturn {
327
356
  page: Page;
328
357
  transactions: Array<Transaction>;
329
358
  }
359
+ export interface GetGasTankArgs {
360
+ id: number;
361
+ }
362
+ export interface GetGasTankReturn {
363
+ gasTank: GasTank;
364
+ }
365
+ export interface AddGasTankArgs {
366
+ name: string;
367
+ feeMarkupFactor: number;
368
+ unlimited?: boolean;
369
+ }
370
+ export interface AddGasTankReturn {
371
+ status: boolean;
372
+ gasTank: GasTank;
373
+ }
374
+ export interface UpdateGasTankArgs {
375
+ id: number;
376
+ name?: string;
377
+ feeMarkupFactor?: number;
378
+ unlimited?: boolean;
379
+ }
380
+ export interface UpdateGasTankReturn {
381
+ status: boolean;
382
+ gasTank: GasTank;
383
+ }
384
+ export interface GetGasSponsorArgs {
385
+ id: number;
386
+ }
387
+ export interface GetGasSponsorReturn {
388
+ gasSponsor: GasSponsor;
389
+ }
330
390
  export interface ListGasSponsorsArgs {
391
+ gasTankId: number;
331
392
  page?: Page;
332
393
  }
333
394
  export interface ListGasSponsorsReturn {
@@ -335,6 +396,7 @@ export interface ListGasSponsorsReturn {
335
396
  gasSponsors: Array<GasSponsor>;
336
397
  }
337
398
  export interface AddGasSponsorArgs {
399
+ gasTankId: number;
338
400
  address: string;
339
401
  name?: string;
340
402
  active?: boolean;
@@ -344,7 +406,7 @@ export interface AddGasSponsorReturn {
344
406
  gasSponsor: GasSponsor;
345
407
  }
346
408
  export interface UpdateGasSponsorArgs {
347
- address: string;
409
+ id: number;
348
410
  name?: string;
349
411
  active?: boolean;
350
412
  }
@@ -352,13 +414,50 @@ export interface UpdateGasSponsorReturn {
352
414
  status: boolean;
353
415
  gasSponsor: GasSponsor;
354
416
  }
417
+ export interface RemoveGasSponsorArgs {
418
+ id: number;
419
+ }
420
+ export interface RemoveGasSponsorReturn {
421
+ status: boolean;
422
+ }
355
423
  export interface ReportGasSponsorUsageArgs {
424
+ gasTankId: number;
356
425
  startTime?: string;
357
426
  endTime?: string;
358
427
  }
359
428
  export interface ReportGasSponsorUsageReturn {
360
429
  gasSponsorUsage: Array<GasSponsorUsage>;
361
430
  }
431
+ export interface NextGasTankBalanceAdjustmentNonceArgs {
432
+ id: number;
433
+ }
434
+ export interface NextGasTankBalanceAdjustmentNonceReturn {
435
+ nonce: number;
436
+ }
437
+ export interface AdjustGasTankBalanceArgs {
438
+ id: number;
439
+ nonce: number;
440
+ amount: number;
441
+ }
442
+ export interface AdjustGasTankBalanceReturn {
443
+ status: boolean;
444
+ adjustment: GasTankBalanceAdjustment;
445
+ }
446
+ export interface GetGasTankBalanceAdjustmentArgs {
447
+ id: number;
448
+ nonce: number;
449
+ }
450
+ export interface GetGasTankBalanceAdjustmentReturn {
451
+ adjustment: GasTankBalanceAdjustment;
452
+ }
453
+ export interface ListGasTankBalanceAdjustmentsArgs {
454
+ id: number;
455
+ page?: Page;
456
+ }
457
+ export interface ListGasTankBalanceAdjustmentsReturn {
458
+ page: Page;
459
+ adjustments: Array<GasTankBalanceAdjustment>;
460
+ }
362
461
  export declare class Relayer implements Relayer {
363
462
  protected hostname: string;
364
463
  protected fetch: Fetch;
@@ -380,10 +479,19 @@ export declare class Relayer implements Relayer {
380
479
  getMetaTxnNetworkFeeOptions: (args: GetMetaTxnNetworkFeeOptionsArgs, headers?: object | undefined) => Promise<GetMetaTxnNetworkFeeOptionsReturn>;
381
480
  sentTransactions: (args: SentTransactionsArgs, headers?: object | undefined) => Promise<SentTransactionsReturn>;
382
481
  pendingTransactions: (args: PendingTransactionsArgs, headers?: object | undefined) => Promise<PendingTransactionsReturn>;
482
+ getGasTank: (args: GetGasTankArgs, headers?: object | undefined) => Promise<GetGasTankReturn>;
483
+ addGasTank: (args: AddGasTankArgs, headers?: object | undefined) => Promise<AddGasTankReturn>;
484
+ updateGasTank: (args: UpdateGasTankArgs, headers?: object | undefined) => Promise<UpdateGasTankReturn>;
485
+ getGasSponsor: (args: GetGasSponsorArgs, headers?: object | undefined) => Promise<GetGasSponsorReturn>;
383
486
  listGasSponsors: (args: ListGasSponsorsArgs, headers?: object | undefined) => Promise<ListGasSponsorsReturn>;
384
487
  addGasSponsor: (args: AddGasSponsorArgs, headers?: object | undefined) => Promise<AddGasSponsorReturn>;
385
488
  updateGasSponsor: (args: UpdateGasSponsorArgs, headers?: object | undefined) => Promise<UpdateGasSponsorReturn>;
489
+ removeGasSponsor: (args: RemoveGasSponsorArgs, headers?: object | undefined) => Promise<RemoveGasSponsorReturn>;
386
490
  reportGasSponsorUsage: (args: ReportGasSponsorUsageArgs, headers?: object | undefined) => Promise<ReportGasSponsorUsageReturn>;
491
+ nextGasTankBalanceAdjustmentNonce: (args: NextGasTankBalanceAdjustmentNonceArgs, headers?: object | undefined) => Promise<NextGasTankBalanceAdjustmentNonceReturn>;
492
+ adjustGasTankBalance: (args: AdjustGasTankBalanceArgs, headers?: object | undefined) => Promise<AdjustGasTankBalanceReturn>;
493
+ getGasTankBalanceAdjustment: (args: GetGasTankBalanceAdjustmentArgs, headers?: object | undefined) => Promise<GetGasTankBalanceAdjustmentReturn>;
494
+ listGasTankBalanceAdjustments: (args: ListGasTankBalanceAdjustmentsArgs, headers?: object | undefined) => Promise<ListGasTankBalanceAdjustmentsReturn>;
387
495
  }
388
496
  export interface WebRPCError extends Error {
389
497
  code: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xsequence/relayer",
3
- "version": "1.2.7",
3
+ "version": "1.2.9",
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",
@@ -9,9 +9,9 @@
9
9
  "author": "Horizon Blockchain Games",
10
10
  "license": "Apache-2.0",
11
11
  "dependencies": {
12
- "@0xsequence/abi": "1.2.7",
13
- "@0xsequence/core": "1.2.7",
14
- "@0xsequence/utils": "1.2.7"
12
+ "@0xsequence/abi": "1.2.9",
13
+ "@0xsequence/utils": "1.2.9",
14
+ "@0xsequence/core": "1.2.9"
15
15
  },
16
16
  "peerDependencies": {
17
17
  "ethers": ">=5.5 < 6"
@@ -19,8 +19,8 @@
19
19
  "devDependencies": {
20
20
  "@0xsequence/wallet-contracts": "^1.10.0",
21
21
  "ethers": "^5.7.2",
22
- "@0xsequence/signhub": "1.2.7",
23
- "@0xsequence/tests": "1.2.7"
22
+ "@0xsequence/signhub": "1.2.9",
23
+ "@0xsequence/tests": "1.2.9"
24
24
  },
25
25
  "files": [
26
26
  "src",
package/src/index.ts CHANGED
@@ -17,7 +17,13 @@ export interface Relayer {
17
17
  // getFeeOptionsRaw returns the fee options that the relayer will accept as payment.
18
18
  // If a quote is returned, it may be passed back to the relayer for dispatch.
19
19
  // It doesn't make any assumptions about the transaction format.
20
- getFeeOptionsRaw(entrypoint: string, data: ethers.utils.BytesLike): Promise<{ options: FeeOption[]; quote?: FeeQuote }>
20
+ getFeeOptionsRaw(
21
+ entrypoint: string,
22
+ data: ethers.utils.BytesLike,
23
+ options?: {
24
+ simulate?: boolean
25
+ }
26
+ ): Promise<{ options: FeeOption[]; quote?: FeeQuote }>
21
27
 
22
28
  // gasRefundOptions returns the transactions which can be included to refund a
23
29
  // relayer for submitting your transaction to a network.
@@ -26,7 +26,13 @@ export class LocalRelayer extends ProviderRelayer implements Relayer {
26
26
  return { options: [] }
27
27
  }
28
28
 
29
- async getFeeOptionsRaw(_entrypoint: string, _data: BytesLike): Promise<{ options: FeeOption[] }> {
29
+ async getFeeOptionsRaw(
30
+ _entrypoint: string,
31
+ _data: BytesLike,
32
+ _options?: {
33
+ simulate?: boolean
34
+ }
35
+ ): Promise<{ options: FeeOption[] }> {
30
36
  return { options: [] }
31
37
  }
32
38
 
@@ -39,7 +39,13 @@ export abstract class ProviderRelayer implements Relayer {
39
39
  ...transactions: commons.transaction.Transaction[]
40
40
  ): Promise<{ options: FeeOption[]; quote?: FeeQuote }>
41
41
 
42
- abstract getFeeOptionsRaw(entrypoint: string, data: ethers.utils.BytesLike): Promise<{ options: FeeOption[]; quote?: FeeQuote }>
42
+ abstract getFeeOptionsRaw(
43
+ entrypoint: string,
44
+ data: ethers.utils.BytesLike,
45
+ options?: {
46
+ simulate?: boolean
47
+ }
48
+ ): Promise<{ options: FeeOption[]; quote?: FeeQuote }>
43
49
 
44
50
  abstract gasRefundOptions(address: string, ...transactions: commons.transaction.Transaction[]): Promise<FeeOption[]>
45
51
 
@@ -131,14 +131,21 @@ export class RpcRelayer implements Relayer {
131
131
  }
132
132
  }
133
133
 
134
- async getFeeOptionsRaw(entrypoint: string, data: ethers.utils.BytesLike): Promise<{ options: FeeOption[]; quote?: FeeQuote }> {
135
- const { options, quote } = await this.service.feeOptions({
134
+ async getFeeOptionsRaw(
135
+ entrypoint: string,
136
+ data: ethers.utils.BytesLike,
137
+ options?: {
138
+ simulate?: boolean
139
+ }
140
+ ): Promise<{ options: FeeOption[]; quote?: FeeQuote }> {
141
+ const { options: feeOptions, quote } = await this.service.feeOptions({
136
142
  wallet: entrypoint,
137
143
  to: entrypoint,
138
- data: ethers.utils.hexlify(data)
144
+ data: ethers.utils.hexlify(data),
145
+ simulate: options?.simulate
139
146
  })
140
147
 
141
- return { options, quote: { _tag: 'FeeQuote', _quote: quote } }
148
+ return { options: feeOptions, quote: { _tag: 'FeeQuote', _quote: quote } }
142
149
  }
143
150
 
144
151
  async gasRefundOptions(address: string, ...transactions: commons.transaction.Transaction[]): Promise<FeeOption[]> {
@@ -1,9 +1,9 @@
1
1
  /* eslint-disable */
2
- // sequence-relayer v0.4.0 752f4f4274ca80d2fd974b5b44ed8245dfe40554
2
+ // sequence-relayer v0.4.0 950b00c821b56110c64d947312b9dea3e197e207
3
3
  // --
4
- // Code generated by webrpc-gen@v0.10.x-dev with typescript generator. DO NOT EDIT.
4
+ // Code generated by webrpc-gen@v0.12.x-dev with typescript@v0.10.0 generator. DO NOT EDIT.
5
5
  //
6
- // webrpc-gen -schema=relayer.ridl -target=typescript -client -out=./clients/relayer.gen.ts
6
+ // webrpc-gen -schema=relayer.ridl -target=typescript@v0.10.0 -client -out=./clients/relayer.gen.ts
7
7
 
8
8
  // WebRPC description and code-gen version
9
9
  export const WebRPCVersion = 'v1'
@@ -12,7 +12,7 @@ export const WebRPCVersion = 'v1'
12
12
  export const WebRPCSchemaVersion = 'v0.4.0'
13
13
 
14
14
  // Schema hash generated from your RIDL schema
15
- export const WebRPCSchemaHash = '752f4f4274ca80d2fd974b5b44ed8245dfe40554'
15
+ export const WebRPCSchemaHash = '950b00c821b56110c64d947312b9dea3e197e207'
16
16
 
17
17
  //
18
18
  // Types
@@ -61,7 +61,7 @@ export interface RuntimeStatus {
61
61
  commitHash: string
62
62
  senders: Array<SenderStatus>
63
63
  checks: RuntimeChecks
64
- numTxnsRelayed: number
64
+ numTxnsRelayed: NumTxnsRelayed
65
65
  }
66
66
 
67
67
  export interface SenderStatus {
@@ -73,6 +73,12 @@ export interface SenderStatus {
73
73
 
74
74
  export interface RuntimeChecks {}
75
75
 
76
+ export interface NumTxnsRelayed {
77
+ prev: number
78
+ current: number
79
+ period: number
80
+ }
81
+
76
82
  export interface SequenceContext {
77
83
  factory: string
78
84
  mainModule: string
@@ -81,25 +87,34 @@ export interface SequenceContext {
81
87
  utils: string
82
88
  }
83
89
 
84
- export interface WalletConfig {
85
- address: string
86
- signers: Array<WalletSigner>
87
- threshold: number
88
- chainId?: number
90
+ export interface GasTank {
91
+ id: number
92
+ name: string
93
+ currentBalance: number
94
+ unlimited: boolean
95
+ feeMarkupFactor: number
96
+ updatedAt: string
97
+ createdAt: string
89
98
  }
90
99
 
91
- export interface WalletSigner {
92
- address: string
93
- weight: number
100
+ export interface GasTankBalanceAdjustment {
101
+ gasTankId: number
102
+ nonce: number
103
+ amount: number
104
+ totalBalance: number
105
+ balanceTimestamp: string
106
+ createdAt: string
94
107
  }
95
108
 
96
109
  export interface GasSponsor {
97
110
  id: number
111
+ gasTankId: number
98
112
  address: string
99
113
  name: string
100
114
  active: boolean
101
115
  updatedAt: string
102
116
  createdAt: string
117
+ deletedAt: string
103
118
  }
104
119
 
105
120
  export interface GasSponsorUsage {
@@ -107,6 +122,7 @@ export interface GasSponsorUsage {
107
122
  id: number
108
123
  totalGasUsed: number
109
124
  totalTxnFees: number
125
+ totalTxnFeesUsd: number
110
126
  avgGasPrice: number
111
127
  totalTxns: number
112
128
  startTime: string
@@ -139,8 +155,12 @@ export interface MetaTxnLog {
139
155
  gasLimit: number
140
156
  gasPrice: string
141
157
  gasUsed: number
158
+ gasEstimated: number
159
+ gasFeeMarkup?: number
160
+ usdRate: string
142
161
  isWhitelisted: boolean
143
162
  gasSponsor?: number
163
+ gasTank?: number
144
164
  updatedAt: string
145
165
  createdAt: string
146
166
  }
@@ -258,10 +278,25 @@ export interface Relayer {
258
278
  getMetaTxnNetworkFeeOptions(args: GetMetaTxnNetworkFeeOptionsArgs, headers?: object): Promise<GetMetaTxnNetworkFeeOptionsReturn>
259
279
  sentTransactions(args: SentTransactionsArgs, headers?: object): Promise<SentTransactionsReturn>
260
280
  pendingTransactions(args: PendingTransactionsArgs, headers?: object): Promise<PendingTransactionsReturn>
281
+ getGasTank(args: GetGasTankArgs, headers?: object): Promise<GetGasTankReturn>
282
+ addGasTank(args: AddGasTankArgs, headers?: object): Promise<AddGasTankReturn>
283
+ updateGasTank(args: UpdateGasTankArgs, headers?: object): Promise<UpdateGasTankReturn>
284
+ getGasSponsor(args: GetGasSponsorArgs, headers?: object): Promise<GetGasSponsorReturn>
261
285
  listGasSponsors(args: ListGasSponsorsArgs, headers?: object): Promise<ListGasSponsorsReturn>
262
286
  addGasSponsor(args: AddGasSponsorArgs, headers?: object): Promise<AddGasSponsorReturn>
263
287
  updateGasSponsor(args: UpdateGasSponsorArgs, headers?: object): Promise<UpdateGasSponsorReturn>
288
+ removeGasSponsor(args: RemoveGasSponsorArgs, headers?: object): Promise<RemoveGasSponsorReturn>
264
289
  reportGasSponsorUsage(args: ReportGasSponsorUsageArgs, headers?: object): Promise<ReportGasSponsorUsageReturn>
290
+ nextGasTankBalanceAdjustmentNonce(
291
+ args: NextGasTankBalanceAdjustmentNonceArgs,
292
+ headers?: object
293
+ ): Promise<NextGasTankBalanceAdjustmentNonceReturn>
294
+ adjustGasTankBalance(args: AdjustGasTankBalanceArgs, headers?: object): Promise<AdjustGasTankBalanceReturn>
295
+ getGasTankBalanceAdjustment(args: GetGasTankBalanceAdjustmentArgs, headers?: object): Promise<GetGasTankBalanceAdjustmentReturn>
296
+ listGasTankBalanceAdjustments(
297
+ args: ListGasTankBalanceAdjustmentsArgs,
298
+ headers?: object
299
+ ): Promise<ListGasTankBalanceAdjustmentsReturn>
265
300
  }
266
301
 
267
302
  export interface PingArgs {}
@@ -323,7 +358,7 @@ export interface SimulateReturn {
323
358
  }
324
359
  export interface UpdateMetaTxnGasLimitsArgs {
325
360
  walletAddress: string
326
- walletConfig: WalletConfig
361
+ walletConfig: any
327
362
  payload: string
328
363
  }
329
364
 
@@ -340,6 +375,7 @@ export interface FeeOptionsArgs {
340
375
  wallet: string
341
376
  to: string
342
377
  data: string
378
+ simulate?: boolean
343
379
  }
344
380
 
345
381
  export interface FeeOptionsReturn {
@@ -347,7 +383,7 @@ export interface FeeOptionsReturn {
347
383
  quote?: string
348
384
  }
349
385
  export interface GetMetaTxnNetworkFeeOptionsArgs {
350
- walletConfig: WalletConfig
386
+ walletConfig: any
351
387
  payload: string
352
388
  }
353
389
 
@@ -371,7 +407,43 @@ export interface PendingTransactionsReturn {
371
407
  page: Page
372
408
  transactions: Array<Transaction>
373
409
  }
410
+ export interface GetGasTankArgs {
411
+ id: number
412
+ }
413
+
414
+ export interface GetGasTankReturn {
415
+ gasTank: GasTank
416
+ }
417
+ export interface AddGasTankArgs {
418
+ name: string
419
+ feeMarkupFactor: number
420
+ unlimited?: boolean
421
+ }
422
+
423
+ export interface AddGasTankReturn {
424
+ status: boolean
425
+ gasTank: GasTank
426
+ }
427
+ export interface UpdateGasTankArgs {
428
+ id: number
429
+ name?: string
430
+ feeMarkupFactor?: number
431
+ unlimited?: boolean
432
+ }
433
+
434
+ export interface UpdateGasTankReturn {
435
+ status: boolean
436
+ gasTank: GasTank
437
+ }
438
+ export interface GetGasSponsorArgs {
439
+ id: number
440
+ }
441
+
442
+ export interface GetGasSponsorReturn {
443
+ gasSponsor: GasSponsor
444
+ }
374
445
  export interface ListGasSponsorsArgs {
446
+ gasTankId: number
375
447
  page?: Page
376
448
  }
377
449
 
@@ -380,6 +452,7 @@ export interface ListGasSponsorsReturn {
380
452
  gasSponsors: Array<GasSponsor>
381
453
  }
382
454
  export interface AddGasSponsorArgs {
455
+ gasTankId: number
383
456
  address: string
384
457
  name?: string
385
458
  active?: boolean
@@ -390,7 +463,7 @@ export interface AddGasSponsorReturn {
390
463
  gasSponsor: GasSponsor
391
464
  }
392
465
  export interface UpdateGasSponsorArgs {
393
- address: string
466
+ id: number
394
467
  name?: string
395
468
  active?: boolean
396
469
  }
@@ -399,7 +472,15 @@ export interface UpdateGasSponsorReturn {
399
472
  status: boolean
400
473
  gasSponsor: GasSponsor
401
474
  }
475
+ export interface RemoveGasSponsorArgs {
476
+ id: number
477
+ }
478
+
479
+ export interface RemoveGasSponsorReturn {
480
+ status: boolean
481
+ }
402
482
  export interface ReportGasSponsorUsageArgs {
483
+ gasTankId: number
403
484
  startTime?: string
404
485
  endTime?: string
405
486
  }
@@ -407,6 +488,40 @@ export interface ReportGasSponsorUsageArgs {
407
488
  export interface ReportGasSponsorUsageReturn {
408
489
  gasSponsorUsage: Array<GasSponsorUsage>
409
490
  }
491
+ export interface NextGasTankBalanceAdjustmentNonceArgs {
492
+ id: number
493
+ }
494
+
495
+ export interface NextGasTankBalanceAdjustmentNonceReturn {
496
+ nonce: number
497
+ }
498
+ export interface AdjustGasTankBalanceArgs {
499
+ id: number
500
+ nonce: number
501
+ amount: number
502
+ }
503
+
504
+ export interface AdjustGasTankBalanceReturn {
505
+ status: boolean
506
+ adjustment: GasTankBalanceAdjustment
507
+ }
508
+ export interface GetGasTankBalanceAdjustmentArgs {
509
+ id: number
510
+ nonce: number
511
+ }
512
+
513
+ export interface GetGasTankBalanceAdjustmentReturn {
514
+ adjustment: GasTankBalanceAdjustment
515
+ }
516
+ export interface ListGasTankBalanceAdjustmentsArgs {
517
+ id: number
518
+ page?: Page
519
+ }
520
+
521
+ export interface ListGasTankBalanceAdjustmentsReturn {
522
+ page: Page
523
+ adjustments: Array<GasTankBalanceAdjustment>
524
+ }
410
525
 
411
526
  //
412
527
  // Client
@@ -583,6 +698,48 @@ export class Relayer implements Relayer {
583
698
  })
584
699
  }
585
700
 
701
+ getGasTank = (args: GetGasTankArgs, headers?: object): Promise<GetGasTankReturn> => {
702
+ return this.fetch(this.url('GetGasTank'), createHTTPRequest(args, headers)).then(res => {
703
+ return buildResponse(res).then(_data => {
704
+ return {
705
+ gasTank: <GasTank>_data.gasTank
706
+ }
707
+ })
708
+ })
709
+ }
710
+
711
+ addGasTank = (args: AddGasTankArgs, headers?: object): Promise<AddGasTankReturn> => {
712
+ return this.fetch(this.url('AddGasTank'), createHTTPRequest(args, headers)).then(res => {
713
+ return buildResponse(res).then(_data => {
714
+ return {
715
+ status: <boolean>_data.status,
716
+ gasTank: <GasTank>_data.gasTank
717
+ }
718
+ })
719
+ })
720
+ }
721
+
722
+ updateGasTank = (args: UpdateGasTankArgs, headers?: object): Promise<UpdateGasTankReturn> => {
723
+ return this.fetch(this.url('UpdateGasTank'), createHTTPRequest(args, headers)).then(res => {
724
+ return buildResponse(res).then(_data => {
725
+ return {
726
+ status: <boolean>_data.status,
727
+ gasTank: <GasTank>_data.gasTank
728
+ }
729
+ })
730
+ })
731
+ }
732
+
733
+ getGasSponsor = (args: GetGasSponsorArgs, headers?: object): Promise<GetGasSponsorReturn> => {
734
+ return this.fetch(this.url('GetGasSponsor'), createHTTPRequest(args, headers)).then(res => {
735
+ return buildResponse(res).then(_data => {
736
+ return {
737
+ gasSponsor: <GasSponsor>_data.gasSponsor
738
+ }
739
+ })
740
+ })
741
+ }
742
+
586
743
  listGasSponsors = (args: ListGasSponsorsArgs, headers?: object): Promise<ListGasSponsorsReturn> => {
587
744
  return this.fetch(this.url('ListGasSponsors'), createHTTPRequest(args, headers)).then(res => {
588
745
  return buildResponse(res).then(_data => {
@@ -616,6 +773,16 @@ export class Relayer implements Relayer {
616
773
  })
617
774
  }
618
775
 
776
+ removeGasSponsor = (args: RemoveGasSponsorArgs, headers?: object): Promise<RemoveGasSponsorReturn> => {
777
+ return this.fetch(this.url('RemoveGasSponsor'), createHTTPRequest(args, headers)).then(res => {
778
+ return buildResponse(res).then(_data => {
779
+ return {
780
+ status: <boolean>_data.status
781
+ }
782
+ })
783
+ })
784
+ }
785
+
619
786
  reportGasSponsorUsage = (args: ReportGasSponsorUsageArgs, headers?: object): Promise<ReportGasSponsorUsageReturn> => {
620
787
  return this.fetch(this.url('ReportGasSponsorUsage'), createHTTPRequest(args, headers)).then(res => {
621
788
  return buildResponse(res).then(_data => {
@@ -625,6 +792,57 @@ export class Relayer implements Relayer {
625
792
  })
626
793
  })
627
794
  }
795
+
796
+ nextGasTankBalanceAdjustmentNonce = (
797
+ args: NextGasTankBalanceAdjustmentNonceArgs,
798
+ headers?: object
799
+ ): Promise<NextGasTankBalanceAdjustmentNonceReturn> => {
800
+ return this.fetch(this.url('NextGasTankBalanceAdjustmentNonce'), createHTTPRequest(args, headers)).then(res => {
801
+ return buildResponse(res).then(_data => {
802
+ return {
803
+ nonce: <number>_data.nonce
804
+ }
805
+ })
806
+ })
807
+ }
808
+
809
+ adjustGasTankBalance = (args: AdjustGasTankBalanceArgs, headers?: object): Promise<AdjustGasTankBalanceReturn> => {
810
+ return this.fetch(this.url('AdjustGasTankBalance'), createHTTPRequest(args, headers)).then(res => {
811
+ return buildResponse(res).then(_data => {
812
+ return {
813
+ status: <boolean>_data.status,
814
+ adjustment: <GasTankBalanceAdjustment>_data.adjustment
815
+ }
816
+ })
817
+ })
818
+ }
819
+
820
+ getGasTankBalanceAdjustment = (
821
+ args: GetGasTankBalanceAdjustmentArgs,
822
+ headers?: object
823
+ ): Promise<GetGasTankBalanceAdjustmentReturn> => {
824
+ return this.fetch(this.url('GetGasTankBalanceAdjustment'), createHTTPRequest(args, headers)).then(res => {
825
+ return buildResponse(res).then(_data => {
826
+ return {
827
+ adjustment: <GasTankBalanceAdjustment>_data.adjustment
828
+ }
829
+ })
830
+ })
831
+ }
832
+
833
+ listGasTankBalanceAdjustments = (
834
+ args: ListGasTankBalanceAdjustmentsArgs,
835
+ headers?: object
836
+ ): Promise<ListGasTankBalanceAdjustmentsReturn> => {
837
+ return this.fetch(this.url('ListGasTankBalanceAdjustments'), createHTTPRequest(args, headers)).then(res => {
838
+ return buildResponse(res).then(_data => {
839
+ return {
840
+ page: <Page>_data.page,
841
+ adjustments: <Array<GasTankBalanceAdjustment>>_data.adjustments
842
+ }
843
+ })
844
+ })
845
+ }
628
846
  }
629
847
 
630
848
  export interface WebRPCError extends Error {