@0xsequence/relayer 3.0.5 → 3.0.6

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.
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable */
2
- // sequence-relayer v0.4.1 7f8a4b83b00e0b6849c76c2ff0e23931e26b3d9f
2
+ // sequence-relayer v0.4.1 0a2503bc893179ba968b0015d7580aabf6a88dd4
3
3
  // --
4
- // Code generated by Webrpc-gen@v0.30.2 with typescript generator. DO NOT EDIT.
4
+ // Code generated by Webrpc-gen@v0.32.2 with typescript generator. DO NOT EDIT.
5
5
  //
6
6
  // webrpc-gen -schema=relayer.ridl -target=typescript -client -out=./clients/relayer.gen.ts -compat
7
7
  // Webrpc description and code-gen version
@@ -9,10 +9,16 @@ export const WebrpcVersion = 'v1';
9
9
  // Schema version of your RIDL schema
10
10
  export const WebrpcSchemaVersion = 'v0.4.1';
11
11
  // Schema hash generated from your RIDL schema
12
- export const WebrpcSchemaHash = '7f8a4b83b00e0b6849c76c2ff0e23931e26b3d9f';
12
+ export const WebrpcSchemaHash = '0a2503bc893179ba968b0015d7580aabf6a88dd4';
13
13
  //
14
14
  // Schema types
15
15
  //
16
+ export var RepairOperation;
17
+ (function (RepairOperation) {
18
+ RepairOperation["SKIP"] = "SKIP";
19
+ RepairOperation["REQUEUE"] = "REQUEUE";
20
+ RepairOperation["DROP"] = "DROP";
21
+ })(RepairOperation || (RepairOperation = {}));
16
22
  export var ETHTxnStatus;
17
23
  (function (ETHTxnStatus) {
18
24
  ETHTxnStatus["UNKNOWN"] = "UNKNOWN";
@@ -23,6 +29,7 @@ export var ETHTxnStatus;
23
29
  ETHTxnStatus["PARTIALLY_FAILED"] = "PARTIALLY_FAILED";
24
30
  ETHTxnStatus["FAILED"] = "FAILED";
25
31
  ETHTxnStatus["PENDING_PRECONDITION"] = "PENDING_PRECONDITION";
32
+ ETHTxnStatus["MINED"] = "MINED";
26
33
  })(ETHTxnStatus || (ETHTxnStatus = {}));
27
34
  export var TransferType;
28
35
  (function (TransferType) {
@@ -48,11 +55,11 @@ export var FeeTokenType;
48
55
  FeeTokenType["ERC20_TOKEN"] = "ERC20_TOKEN";
49
56
  FeeTokenType["ERC1155_TOKEN"] = "ERC1155_TOKEN";
50
57
  })(FeeTokenType || (FeeTokenType = {}));
51
- export var SortOrder;
52
- (function (SortOrder) {
53
- SortOrder["DESC"] = "DESC";
54
- SortOrder["ASC"] = "ASC";
55
- })(SortOrder || (SortOrder = {}));
58
+ export var Order;
59
+ (function (Order) {
60
+ Order["DESC"] = "DESC";
61
+ Order["ASC"] = "ASC";
62
+ })(Order || (Order = {}));
56
63
  //
57
64
  // Client
58
65
  //
@@ -81,11 +88,14 @@ export class Relayer {
81
88
  updateMetaTxnGasLimits: (req) => ['Relayer', 'updateMetaTxnGasLimits', req],
82
89
  feeTokens: () => ['Relayer', 'feeTokens'],
83
90
  feeOptions: (req) => ['Relayer', 'feeOptions', req],
91
+ sendMetaTxnWithBridgeGas: (req) => ['Relayer', 'sendMetaTxnWithBridgeGas', req],
92
+ feeOptionsWithBridgeGas: (req) => ['Relayer', 'feeOptionsWithBridgeGas', req],
84
93
  getMetaTxnNetworkFeeOptions: (req) => ['Relayer', 'getMetaTxnNetworkFeeOptions', req],
94
+ startSender: (req) => ['Relayer', 'startSender', req],
95
+ stopSender: (req) => ['Relayer', 'stopSender', req],
96
+ repairSender: (req) => ['Relayer', 'repairSender', req],
85
97
  getMetaTransactions: (req) => ['Relayer', 'getMetaTransactions', req],
86
98
  getTransactionCost: (req) => ['Relayer', 'getTransactionCost', req],
87
- sentTransactions: (req) => ['Relayer', 'sentTransactions', req],
88
- pendingTransactions: (req) => ['Relayer', 'pendingTransactions', req],
89
99
  getGasTank: (req) => ['Relayer', 'getGasTank', req],
90
100
  addGasTank: (req) => ['Relayer', 'addGasTank', req],
91
101
  updateGasTank: (req) => ['Relayer', 'updateGasTank', req],
@@ -98,6 +108,11 @@ export class Relayer {
98
108
  addGasSponsor: (req) => ['Relayer', 'addGasSponsor', req],
99
109
  updateGasSponsor: (req) => ['Relayer', 'updateGasSponsor', req],
100
110
  removeGasSponsor: (req) => ['Relayer', 'removeGasSponsor', req],
111
+ listEcosystemGasSponsors: (req) => ['Relayer', 'listEcosystemGasSponsors', req],
112
+ getEcosystemGasSponsor: (req) => ['Relayer', 'getEcosystemGasSponsor', req],
113
+ addEcosystemGasSponsor: (req) => ['Relayer', 'addEcosystemGasSponsor', req],
114
+ updateEcosystemGasSponsor: (req) => ['Relayer', 'updateEcosystemGasSponsor', req],
115
+ removeEcosystemGasSponsor: (req) => ['Relayer', 'removeEcosystemGasSponsor', req],
101
116
  addressGasSponsors: (req) => ['Relayer', 'addressGasSponsors', req],
102
117
  getProjectBalance: (req) => ['Relayer', 'getProjectBalance', req],
103
118
  adjustProjectBalance: (req) => ['Relayer', 'adjustProjectBalance', req],
@@ -158,7 +173,7 @@ export class Relayer {
158
173
  });
159
174
  };
160
175
  sendMetaTxn = (req, headers, signal) => {
161
- return this.fetch(this.url('SendMetaTxn'), createHttpRequest(JsonEncode(req, 'SendMetaTxnArgs'), headers, signal)).then((res) => {
176
+ return this.fetch(this.url('SendMetaTxn'), createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
162
177
  return buildResponse(res).then((_data) => {
163
178
  return JsonDecode(_data, 'SendMetaTxnReturn');
164
179
  });
@@ -169,7 +184,7 @@ export class Relayer {
169
184
  });
170
185
  };
171
186
  getMetaTxnNonce = (req, headers, signal) => {
172
- return this.fetch(this.url('GetMetaTxnNonce'), createHttpRequest(JsonEncode(req, 'GetMetaTxnNonceArgs'), headers, signal)).then((res) => {
187
+ return this.fetch(this.url('GetMetaTxnNonce'), createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
173
188
  return buildResponse(res).then((_data) => {
174
189
  return JsonDecode(_data, 'GetMetaTxnNonceReturn');
175
190
  });
@@ -180,7 +195,7 @@ export class Relayer {
180
195
  });
181
196
  };
182
197
  getMetaTxnReceipt = (req, headers, signal) => {
183
- return this.fetch(this.url('GetMetaTxnReceipt'), createHttpRequest(JsonEncode(req, 'GetMetaTxnReceiptArgs'), headers, signal)).then((res) => {
198
+ return this.fetch(this.url('GetMetaTxnReceipt'), createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
184
199
  return buildResponse(res).then((_data) => {
185
200
  return JsonDecode(_data, 'GetMetaTxnReceiptReturn');
186
201
  });
@@ -191,7 +206,7 @@ export class Relayer {
191
206
  });
192
207
  };
193
208
  simulate = (req, headers, signal) => {
194
- return this.fetch(this.url('Simulate'), createHttpRequest(JsonEncode(req, 'SimulateArgs'), headers, signal)).then((res) => {
209
+ return this.fetch(this.url('Simulate'), createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
195
210
  return buildResponse(res).then((_data) => {
196
211
  return JsonDecode(_data, 'SimulateReturn');
197
212
  });
@@ -202,7 +217,7 @@ export class Relayer {
202
217
  });
203
218
  };
204
219
  simulateV3 = (req, headers, signal) => {
205
- return this.fetch(this.url('SimulateV3'), createHttpRequest(JsonEncode(req, 'SimulateV3Args'), headers, signal)).then((res) => {
220
+ return this.fetch(this.url('SimulateV3'), createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
206
221
  return buildResponse(res).then((_data) => {
207
222
  return JsonDecode(_data, 'SimulateV3Return');
208
223
  });
@@ -213,7 +228,7 @@ export class Relayer {
213
228
  });
214
229
  };
215
230
  updateMetaTxnGasLimits = (req, headers, signal) => {
216
- return this.fetch(this.url('UpdateMetaTxnGasLimits'), createHttpRequest(JsonEncode(req, 'UpdateMetaTxnGasLimitsArgs'), headers, signal)).then((res) => {
231
+ return this.fetch(this.url('UpdateMetaTxnGasLimits'), createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
217
232
  return buildResponse(res).then((_data) => {
218
233
  return JsonDecode(_data, 'UpdateMetaTxnGasLimitsReturn');
219
234
  });
@@ -235,7 +250,7 @@ export class Relayer {
235
250
  });
236
251
  };
237
252
  feeOptions = (req, headers, signal) => {
238
- return this.fetch(this.url('FeeOptions'), createHttpRequest(JsonEncode(req, 'FeeOptionsArgs'), headers, signal)).then((res) => {
253
+ return this.fetch(this.url('FeeOptions'), createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
239
254
  return buildResponse(res).then((_data) => {
240
255
  return JsonDecode(_data, 'FeeOptionsReturn');
241
256
  });
@@ -245,8 +260,30 @@ export class Relayer {
245
260
  });
246
261
  });
247
262
  };
263
+ sendMetaTxnWithBridgeGas = (req, headers, signal) => {
264
+ return this.fetch(this.url('SendMetaTxnWithBridgeGas'), createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
265
+ return buildResponse(res).then((_data) => {
266
+ return JsonDecode(_data, 'SendMetaTxnWithBridgeGasReturn');
267
+ });
268
+ }, (error) => {
269
+ throw WebrpcRequestFailedError.new({
270
+ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
271
+ });
272
+ });
273
+ };
274
+ feeOptionsWithBridgeGas = (req, headers, signal) => {
275
+ return this.fetch(this.url('FeeOptionsWithBridgeGas'), createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
276
+ return buildResponse(res).then((_data) => {
277
+ return JsonDecode(_data, 'FeeOptionsWithBridgeGasReturn');
278
+ });
279
+ }, (error) => {
280
+ throw WebrpcRequestFailedError.new({
281
+ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
282
+ });
283
+ });
284
+ };
248
285
  getMetaTxnNetworkFeeOptions = (req, headers, signal) => {
249
- return this.fetch(this.url('GetMetaTxnNetworkFeeOptions'), createHttpRequest(JsonEncode(req, 'GetMetaTxnNetworkFeeOptionsArgs'), headers, signal)).then((res) => {
286
+ return this.fetch(this.url('GetMetaTxnNetworkFeeOptions'), createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
250
287
  return buildResponse(res).then((_data) => {
251
288
  return JsonDecode(_data, 'GetMetaTxnNetworkFeeOptionsReturn');
252
289
  });
@@ -256,10 +293,10 @@ export class Relayer {
256
293
  });
257
294
  });
258
295
  };
259
- getMetaTransactions = (req, headers, signal) => {
260
- return this.fetch(this.url('GetMetaTransactions'), createHttpRequest(JsonEncode(req, 'GetMetaTransactionsArgs'), headers, signal)).then((res) => {
296
+ startSender = (req, headers, signal) => {
297
+ return this.fetch(this.url('StartSender'), createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
261
298
  return buildResponse(res).then((_data) => {
262
- return JsonDecode(_data, 'GetMetaTransactionsReturn');
299
+ return JsonDecode(_data, 'StartSenderReturn');
263
300
  });
264
301
  }, (error) => {
265
302
  throw WebrpcRequestFailedError.new({
@@ -267,10 +304,21 @@ export class Relayer {
267
304
  });
268
305
  });
269
306
  };
270
- getTransactionCost = (req, headers, signal) => {
271
- return this.fetch(this.url('GetTransactionCost'), createHttpRequest(JsonEncode(req, 'GetTransactionCostArgs'), headers, signal)).then((res) => {
307
+ stopSender = (req, headers, signal) => {
308
+ return this.fetch(this.url('StopSender'), createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
272
309
  return buildResponse(res).then((_data) => {
273
- return JsonDecode(_data, 'GetTransactionCostReturn');
310
+ return JsonDecode(_data, 'StopSenderReturn');
311
+ });
312
+ }, (error) => {
313
+ throw WebrpcRequestFailedError.new({
314
+ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
315
+ });
316
+ });
317
+ };
318
+ repairSender = (req, headers, signal) => {
319
+ return this.fetch(this.url('RepairSender'), createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
320
+ return buildResponse(res).then((_data) => {
321
+ return JsonDecode(_data, 'RepairSenderReturn');
274
322
  });
275
323
  }, (error) => {
276
324
  throw WebrpcRequestFailedError.new({
@@ -278,10 +326,10 @@ export class Relayer {
278
326
  });
279
327
  });
280
328
  };
281
- sentTransactions = (req, headers, signal) => {
282
- return this.fetch(this.url('SentTransactions'), createHttpRequest(JsonEncode(req, 'SentTransactionsArgs'), headers, signal)).then((res) => {
329
+ getMetaTransactions = (req, headers, signal) => {
330
+ return this.fetch(this.url('GetMetaTransactions'), createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
283
331
  return buildResponse(res).then((_data) => {
284
- return JsonDecode(_data, 'SentTransactionsReturn');
332
+ return JsonDecode(_data, 'GetMetaTransactionsReturn');
285
333
  });
286
334
  }, (error) => {
287
335
  throw WebrpcRequestFailedError.new({
@@ -289,10 +337,10 @@ export class Relayer {
289
337
  });
290
338
  });
291
339
  };
292
- pendingTransactions = (req, headers, signal) => {
293
- return this.fetch(this.url('PendingTransactions'), createHttpRequest(JsonEncode(req, 'PendingTransactionsArgs'), headers, signal)).then((res) => {
340
+ getTransactionCost = (req, headers, signal) => {
341
+ return this.fetch(this.url('GetTransactionCost'), createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
294
342
  return buildResponse(res).then((_data) => {
295
- return JsonDecode(_data, 'PendingTransactionsReturn');
343
+ return JsonDecode(_data, 'GetTransactionCostReturn');
296
344
  });
297
345
  }, (error) => {
298
346
  throw WebrpcRequestFailedError.new({
@@ -301,7 +349,7 @@ export class Relayer {
301
349
  });
302
350
  };
303
351
  getGasTank = (req, headers, signal) => {
304
- return this.fetch(this.url('GetGasTank'), createHttpRequest(JsonEncode(req, 'GetGasTankArgs'), headers, signal)).then((res) => {
352
+ return this.fetch(this.url('GetGasTank'), createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
305
353
  return buildResponse(res).then((_data) => {
306
354
  return JsonDecode(_data, 'GetGasTankReturn');
307
355
  });
@@ -312,7 +360,7 @@ export class Relayer {
312
360
  });
313
361
  };
314
362
  addGasTank = (req, headers, signal) => {
315
- return this.fetch(this.url('AddGasTank'), createHttpRequest(JsonEncode(req, 'AddGasTankArgs'), headers, signal)).then((res) => {
363
+ return this.fetch(this.url('AddGasTank'), createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
316
364
  return buildResponse(res).then((_data) => {
317
365
  return JsonDecode(_data, 'AddGasTankReturn');
318
366
  });
@@ -323,7 +371,7 @@ export class Relayer {
323
371
  });
324
372
  };
325
373
  updateGasTank = (req, headers, signal) => {
326
- return this.fetch(this.url('UpdateGasTank'), createHttpRequest(JsonEncode(req, 'UpdateGasTankArgs'), headers, signal)).then((res) => {
374
+ return this.fetch(this.url('UpdateGasTank'), createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
327
375
  return buildResponse(res).then((_data) => {
328
376
  return JsonDecode(_data, 'UpdateGasTankReturn');
329
377
  });
@@ -334,7 +382,7 @@ export class Relayer {
334
382
  });
335
383
  };
336
384
  nextGasTankBalanceAdjustmentNonce = (req, headers, signal) => {
337
- return this.fetch(this.url('NextGasTankBalanceAdjustmentNonce'), createHttpRequest(JsonEncode(req, 'NextGasTankBalanceAdjustmentNonceArgs'), headers, signal)).then((res) => {
385
+ return this.fetch(this.url('NextGasTankBalanceAdjustmentNonce'), createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
338
386
  return buildResponse(res).then((_data) => {
339
387
  return JsonDecode(_data, 'NextGasTankBalanceAdjustmentNonceReturn');
340
388
  });
@@ -345,7 +393,7 @@ export class Relayer {
345
393
  });
346
394
  };
347
395
  adjustGasTankBalance = (req, headers, signal) => {
348
- return this.fetch(this.url('AdjustGasTankBalance'), createHttpRequest(JsonEncode(req, 'AdjustGasTankBalanceArgs'), headers, signal)).then((res) => {
396
+ return this.fetch(this.url('AdjustGasTankBalance'), createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
349
397
  return buildResponse(res).then((_data) => {
350
398
  return JsonDecode(_data, 'AdjustGasTankBalanceReturn');
351
399
  });
@@ -356,7 +404,7 @@ export class Relayer {
356
404
  });
357
405
  };
358
406
  getGasTankBalanceAdjustment = (req, headers, signal) => {
359
- return this.fetch(this.url('GetGasTankBalanceAdjustment'), createHttpRequest(JsonEncode(req, 'GetGasTankBalanceAdjustmentArgs'), headers, signal)).then((res) => {
407
+ return this.fetch(this.url('GetGasTankBalanceAdjustment'), createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
360
408
  return buildResponse(res).then((_data) => {
361
409
  return JsonDecode(_data, 'GetGasTankBalanceAdjustmentReturn');
362
410
  });
@@ -367,7 +415,7 @@ export class Relayer {
367
415
  });
368
416
  };
369
417
  listGasTankBalanceAdjustments = (req, headers, signal) => {
370
- return this.fetch(this.url('ListGasTankBalanceAdjustments'), createHttpRequest(JsonEncode(req, 'ListGasTankBalanceAdjustmentsArgs'), headers, signal)).then((res) => {
418
+ return this.fetch(this.url('ListGasTankBalanceAdjustments'), createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
371
419
  return buildResponse(res).then((_data) => {
372
420
  return JsonDecode(_data, 'ListGasTankBalanceAdjustmentsReturn');
373
421
  });
@@ -378,7 +426,7 @@ export class Relayer {
378
426
  });
379
427
  };
380
428
  listGasSponsors = (req, headers, signal) => {
381
- return this.fetch(this.url('ListGasSponsors'), createHttpRequest(JsonEncode(req, 'ListGasSponsorsArgs'), headers, signal)).then((res) => {
429
+ return this.fetch(this.url('ListGasSponsors'), createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
382
430
  return buildResponse(res).then((_data) => {
383
431
  return JsonDecode(_data, 'ListGasSponsorsReturn');
384
432
  });
@@ -389,7 +437,7 @@ export class Relayer {
389
437
  });
390
438
  };
391
439
  getGasSponsor = (req, headers, signal) => {
392
- return this.fetch(this.url('GetGasSponsor'), createHttpRequest(JsonEncode(req, 'GetGasSponsorArgs'), headers, signal)).then((res) => {
440
+ return this.fetch(this.url('GetGasSponsor'), createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
393
441
  return buildResponse(res).then((_data) => {
394
442
  return JsonDecode(_data, 'GetGasSponsorReturn');
395
443
  });
@@ -400,7 +448,7 @@ export class Relayer {
400
448
  });
401
449
  };
402
450
  addGasSponsor = (req, headers, signal) => {
403
- return this.fetch(this.url('AddGasSponsor'), createHttpRequest(JsonEncode(req, 'AddGasSponsorArgs'), headers, signal)).then((res) => {
451
+ return this.fetch(this.url('AddGasSponsor'), createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
404
452
  return buildResponse(res).then((_data) => {
405
453
  return JsonDecode(_data, 'AddGasSponsorReturn');
406
454
  });
@@ -411,7 +459,7 @@ export class Relayer {
411
459
  });
412
460
  };
413
461
  updateGasSponsor = (req, headers, signal) => {
414
- return this.fetch(this.url('UpdateGasSponsor'), createHttpRequest(JsonEncode(req, 'UpdateGasSponsorArgs'), headers, signal)).then((res) => {
462
+ return this.fetch(this.url('UpdateGasSponsor'), createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
415
463
  return buildResponse(res).then((_data) => {
416
464
  return JsonDecode(_data, 'UpdateGasSponsorReturn');
417
465
  });
@@ -422,7 +470,7 @@ export class Relayer {
422
470
  });
423
471
  };
424
472
  removeGasSponsor = (req, headers, signal) => {
425
- return this.fetch(this.url('RemoveGasSponsor'), createHttpRequest(JsonEncode(req, 'RemoveGasSponsorArgs'), headers, signal)).then((res) => {
473
+ return this.fetch(this.url('RemoveGasSponsor'), createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
426
474
  return buildResponse(res).then((_data) => {
427
475
  return JsonDecode(_data, 'RemoveGasSponsorReturn');
428
476
  });
@@ -432,8 +480,63 @@ export class Relayer {
432
480
  });
433
481
  });
434
482
  };
483
+ listEcosystemGasSponsors = (req, headers, signal) => {
484
+ return this.fetch(this.url('ListEcosystemGasSponsors'), createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
485
+ return buildResponse(res).then((_data) => {
486
+ return JsonDecode(_data, 'ListEcosystemGasSponsorsReturn');
487
+ });
488
+ }, (error) => {
489
+ throw WebrpcRequestFailedError.new({
490
+ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
491
+ });
492
+ });
493
+ };
494
+ getEcosystemGasSponsor = (req, headers, signal) => {
495
+ return this.fetch(this.url('GetEcosystemGasSponsor'), createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
496
+ return buildResponse(res).then((_data) => {
497
+ return JsonDecode(_data, 'GetEcosystemGasSponsorReturn');
498
+ });
499
+ }, (error) => {
500
+ throw WebrpcRequestFailedError.new({
501
+ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
502
+ });
503
+ });
504
+ };
505
+ addEcosystemGasSponsor = (req, headers, signal) => {
506
+ return this.fetch(this.url('AddEcosystemGasSponsor'), createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
507
+ return buildResponse(res).then((_data) => {
508
+ return JsonDecode(_data, 'AddEcosystemGasSponsorReturn');
509
+ });
510
+ }, (error) => {
511
+ throw WebrpcRequestFailedError.new({
512
+ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
513
+ });
514
+ });
515
+ };
516
+ updateEcosystemGasSponsor = (req, headers, signal) => {
517
+ return this.fetch(this.url('UpdateEcosystemGasSponsor'), createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
518
+ return buildResponse(res).then((_data) => {
519
+ return JsonDecode(_data, 'UpdateEcosystemGasSponsorReturn');
520
+ });
521
+ }, (error) => {
522
+ throw WebrpcRequestFailedError.new({
523
+ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
524
+ });
525
+ });
526
+ };
527
+ removeEcosystemGasSponsor = (req, headers, signal) => {
528
+ return this.fetch(this.url('RemoveEcosystemGasSponsor'), createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
529
+ return buildResponse(res).then((_data) => {
530
+ return JsonDecode(_data, 'RemoveEcosystemGasSponsorReturn');
531
+ });
532
+ }, (error) => {
533
+ throw WebrpcRequestFailedError.new({
534
+ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
535
+ });
536
+ });
537
+ };
435
538
  addressGasSponsors = (req, headers, signal) => {
436
- return this.fetch(this.url('AddressGasSponsors'), createHttpRequest(JsonEncode(req, 'AddressGasSponsorsArgs'), headers, signal)).then((res) => {
539
+ return this.fetch(this.url('AddressGasSponsors'), createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
437
540
  return buildResponse(res).then((_data) => {
438
541
  return JsonDecode(_data, 'AddressGasSponsorsReturn');
439
542
  });
@@ -444,7 +547,7 @@ export class Relayer {
444
547
  });
445
548
  };
446
549
  getProjectBalance = (req, headers, signal) => {
447
- return this.fetch(this.url('GetProjectBalance'), createHttpRequest(JsonEncode(req, 'GetProjectBalanceArgs'), headers, signal)).then((res) => {
550
+ return this.fetch(this.url('GetProjectBalance'), createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
448
551
  return buildResponse(res).then((_data) => {
449
552
  return JsonDecode(_data, 'GetProjectBalanceReturn');
450
553
  });
@@ -455,7 +558,7 @@ export class Relayer {
455
558
  });
456
559
  };
457
560
  adjustProjectBalance = (req, headers, signal) => {
458
- return this.fetch(this.url('AdjustProjectBalance'), createHttpRequest(JsonEncode(req, 'AdjustProjectBalanceArgs'), headers, signal)).then((res) => {
561
+ return this.fetch(this.url('AdjustProjectBalance'), createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
459
562
  return buildResponse(res).then((_data) => {
460
563
  return JsonDecode(_data, 'AdjustProjectBalanceReturn');
461
564
  });
@@ -467,7 +570,11 @@ export class Relayer {
467
570
  };
468
571
  }
469
572
  const createHttpRequest = (body = '{}', headers = {}, signal = null) => {
470
- const reqHeaders = { ...headers, 'Content-Type': 'application/json' };
573
+ const reqHeaders = {
574
+ ...headers,
575
+ 'Content-Type': 'application/json',
576
+ [WebrpcHeader]: WebrpcHeaderValue,
577
+ };
471
578
  return { method: 'POST', headers: reqHeaders, body, signal };
472
579
  };
473
580
  const buildResponse = (res) => {
@@ -494,48 +601,10 @@ const buildResponse = (res) => {
494
601
  //
495
602
  const BIG_INT_FIELDS = {
496
603
  SendMetaTxnArgs: [['preconditions', 'TransactionPrecondition[]']],
604
+ SendMetaTxnWithBridgeGasArgs: [['preconditions', 'TransactionPrecondition[]']],
497
605
  TransactionPrecondition: ['minAmount'],
498
606
  Transactions: [['preconditions', 'TransactionPrecondition[]']],
499
607
  };
500
- // Encode in-place: mutate provided object graph to serialize bigints to strings.
501
- function encodeType(typ, obj) {
502
- if (obj == null || typeof obj !== 'object')
503
- return obj;
504
- const descs = BIG_INT_FIELDS[typ] || [];
505
- if (!descs.length)
506
- return obj;
507
- for (const d of descs) {
508
- if (Array.isArray(d)) {
509
- const [fieldName, nestedType] = d;
510
- if (fieldName.endsWith('[]')) {
511
- const base = fieldName.slice(0, -2);
512
- const arr = obj[base];
513
- if (Array.isArray(arr)) {
514
- for (let i = 0; i < arr.length; i++)
515
- arr[i] = encodeType(nestedType, arr[i]);
516
- }
517
- }
518
- else if (obj[fieldName]) {
519
- obj[fieldName] = encodeType(nestedType, obj[fieldName]);
520
- }
521
- continue;
522
- }
523
- if (d.endsWith('[]')) {
524
- const base = d.slice(0, -2);
525
- const arr = obj[base];
526
- if (Array.isArray(arr)) {
527
- for (let i = 0; i < arr.length; i++) {
528
- if (typeof arr[i] === 'bigint')
529
- arr[i] = arr[i].toString();
530
- }
531
- }
532
- continue;
533
- }
534
- if (typeof obj[d] === 'bigint')
535
- obj[d] = obj[d].toString();
536
- }
537
- return obj;
538
- }
539
608
  // Decode in-place: mutate object graph; throw if expected numeric string is invalid.
540
609
  function decodeType(typ, obj) {
541
610
  if (obj == null || typeof obj !== 'object')
@@ -555,7 +624,18 @@ function decodeType(typ, obj) {
555
624
  }
556
625
  }
557
626
  else if (obj[fieldName]) {
558
- obj[fieldName] = decodeType(nestedType, obj[fieldName]);
627
+ // Handle nestedType that might be an array type like 'Message[]'
628
+ if (nestedType.endsWith('[]')) {
629
+ const baseType = nestedType.slice(0, -2);
630
+ const arr = obj[fieldName];
631
+ if (Array.isArray(arr)) {
632
+ for (let i = 0; i < arr.length; i++)
633
+ arr[i] = decodeType(baseType, arr[i]);
634
+ }
635
+ }
636
+ else {
637
+ obj[fieldName] = decodeType(nestedType, obj[fieldName]);
638
+ }
559
639
  }
560
640
  continue;
561
641
  }
@@ -589,9 +669,9 @@ function decodeType(typ, obj) {
589
669
  }
590
670
  return obj;
591
671
  }
592
- // Encode object of given root type to JSON with BigInts converted to decimal strings.
593
- export const JsonEncode = (obj, typ = '') => {
594
- return JSON.stringify(encodeType(typ, obj));
672
+ // Encode object to JSON with BigInts converted to decimal strings.
673
+ export const JsonEncode = (obj) => {
674
+ return JSON.stringify(obj, (key, value) => (typeof value === 'bigint' ? value.toString() : value));
595
675
  };
596
676
  // Decode data (JSON string or already-parsed object) and convert declared BigInt string fields back to BigInt.
597
677
  export const JsonDecode = (data, typ = '') => {
@@ -884,7 +964,7 @@ export class AccessKeyMismatchError extends WebrpcError {
884
964
  this.name = error.name || 'AccessKeyMismatch';
885
965
  this.code = typeof error.code === 'number' ? error.code : 1102;
886
966
  this.message = error.message || `Access key mismatch`;
887
- this.status = typeof error.status === 'number' ? error.status : 409;
967
+ this.status = typeof error.status === 'number' ? error.status : 403;
888
968
  if (error.cause !== undefined)
889
969
  this.cause = error.cause;
890
970
  Object.setPrototypeOf(this, AccessKeyMismatchError.prototype);
@@ -926,6 +1006,18 @@ export class UnauthorizedUserError extends WebrpcError {
926
1006
  Object.setPrototypeOf(this, UnauthorizedUserError.prototype);
927
1007
  }
928
1008
  }
1009
+ export class InvalidChainError extends WebrpcError {
1010
+ constructor(error = {}) {
1011
+ super(error);
1012
+ this.name = error.name || 'InvalidChain';
1013
+ this.code = typeof error.code === 'number' ? error.code : 1106;
1014
+ this.message = error.message || `Network not enabled for Access key`;
1015
+ this.status = typeof error.status === 'number' ? error.status : 403;
1016
+ if (error.cause !== undefined)
1017
+ this.cause = error.cause;
1018
+ Object.setPrototypeOf(this, InvalidChainError.prototype);
1019
+ }
1020
+ }
929
1021
  export class QuotaExceededError extends WebrpcError {
930
1022
  constructor(error = {}) {
931
1023
  super(error);
@@ -1109,6 +1201,7 @@ export var errors;
1109
1201
  errors["InvalidOrigin"] = "InvalidOrigin";
1110
1202
  errors["InvalidService"] = "InvalidService";
1111
1203
  errors["UnauthorizedUser"] = "UnauthorizedUser";
1204
+ errors["InvalidChain"] = "InvalidChain";
1112
1205
  errors["QuotaExceeded"] = "QuotaExceeded";
1113
1206
  errors["QuotaRateLimit"] = "QuotaRateLimit";
1114
1207
  errors["NoDefaultKey"] = "NoDefaultKey";
@@ -1150,6 +1243,7 @@ export var WebrpcErrorCodes;
1150
1243
  WebrpcErrorCodes[WebrpcErrorCodes["InvalidOrigin"] = 1103] = "InvalidOrigin";
1151
1244
  WebrpcErrorCodes[WebrpcErrorCodes["InvalidService"] = 1104] = "InvalidService";
1152
1245
  WebrpcErrorCodes[WebrpcErrorCodes["UnauthorizedUser"] = 1105] = "UnauthorizedUser";
1246
+ WebrpcErrorCodes[WebrpcErrorCodes["InvalidChain"] = 1106] = "InvalidChain";
1153
1247
  WebrpcErrorCodes[WebrpcErrorCodes["QuotaExceeded"] = 1200] = "QuotaExceeded";
1154
1248
  WebrpcErrorCodes[WebrpcErrorCodes["QuotaRateLimit"] = 1201] = "QuotaRateLimit";
1155
1249
  WebrpcErrorCodes[WebrpcErrorCodes["NoDefaultKey"] = 1300] = "NoDefaultKey";
@@ -1190,6 +1284,7 @@ export const webrpcErrorByCode = {
1190
1284
  [1103]: InvalidOriginError,
1191
1285
  [1104]: InvalidServiceError,
1192
1286
  [1105]: UnauthorizedUserError,
1287
+ [1106]: InvalidChainError,
1193
1288
  [1200]: QuotaExceededError,
1194
1289
  [1201]: QuotaRateLimitError,
1195
1290
  [1300]: NoDefaultKeyError,
@@ -1208,7 +1303,7 @@ export const webrpcErrorByCode = {
1208
1303
  // Webrpc
1209
1304
  //
1210
1305
  export const WebrpcHeader = 'Webrpc';
1211
- export const WebrpcHeaderValue = 'webrpc@v0.30.2;gen-typescript@v0.22.2;sequence-relayer@v0.4.1';
1306
+ export const WebrpcHeaderValue = 'webrpc@v0.32.2;gen-typescript@v0.23.1;sequence-relayer@v0.4.1';
1212
1307
  export function VersionFromHeader(headers) {
1213
1308
  const headerValue = headers.get(WebrpcHeader);
1214
1309
  if (!headerValue) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xsequence/relayer",
3
- "version": "3.0.5",
3
+ "version": "3.0.6",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -26,7 +26,7 @@
26
26
  "mipd": "^0.0.7",
27
27
  "ox": "^0.9.17",
28
28
  "viem": "^2.40.3",
29
- "@0xsequence/wallet-primitives": "^3.0.5"
29
+ "@0xsequence/wallet-primitives": "^3.0.6"
30
30
  },
31
31
  "scripts": {
32
32
  "build": "tsc",