@0xsequence/relayer 2.3.43 → 2.3.44
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 +178 -50
- package/dist/0xsequence-relayer.cjs.prod.js +178 -50
- package/dist/0xsequence-relayer.esm.js +178 -50
- package/dist/declarations/src/rpc-relayer/relayer.gen.d.ts +193 -48
- package/package.json +6 -6
- package/src/local-relayer.ts +2 -2
- package/src/rpc-relayer/index.ts +2 -2
- package/src/rpc-relayer/relayer.gen.ts +748 -567
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
|
-
// sequence-relayer v0.4.1
|
|
2
|
+
// sequence-relayer v0.4.1 b5902e32e652488166fc44a95f5cda0c67e10d82
|
|
3
3
|
// --
|
|
4
|
-
// Code generated by Webrpc-gen@v0.
|
|
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
|
|
|
8
8
|
// Webrpc description and code-gen version
|
|
9
|
-
export const WebrpcVersion =
|
|
9
|
+
export const WebrpcVersion = "v1"
|
|
10
10
|
|
|
11
11
|
// Schema version of your RIDL schema
|
|
12
|
-
export const WebrpcSchemaVersion =
|
|
12
|
+
export const WebrpcSchemaVersion = "v0.4.1"
|
|
13
13
|
|
|
14
14
|
// Schema hash generated from your RIDL schema
|
|
15
|
-
export const WebrpcSchemaHash =
|
|
15
|
+
export const WebrpcSchemaHash = "b5902e32e652488166fc44a95f5cda0c67e10d82"
|
|
16
16
|
|
|
17
17
|
//
|
|
18
18
|
// Client interface
|
|
@@ -30,9 +30,9 @@ export interface RelayerClient {
|
|
|
30
30
|
getChainID(headers?: object, signal?: AbortSignal): Promise<GetChainIDReturn>
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
33
|
+
*
|
|
34
34
|
* Transactions
|
|
35
|
-
*
|
|
35
|
+
*
|
|
36
36
|
* TODO (future): rename this to just, 'SendTransaction(txn: MetaTransaction)' or 'SendTransaction(txn: SignedTransaction)', or something..
|
|
37
37
|
* Project ID is only used by service and admin calls. Other clients must have projectID passed via the context
|
|
38
38
|
* TODO: rename return txnHash: string to metaTxnID: string
|
|
@@ -58,39 +58,40 @@ export interface RelayerClient {
|
|
|
58
58
|
/**
|
|
59
59
|
* TODO: deprecated, to be removed by https://github.com/0xsequence/stack/pull/356 at a later date
|
|
60
60
|
*/
|
|
61
|
-
updateMetaTxnGasLimits(
|
|
62
|
-
req: UpdateMetaTxnGasLimitsArgs,
|
|
63
|
-
headers?: object,
|
|
64
|
-
signal?: AbortSignal
|
|
65
|
-
): Promise<UpdateMetaTxnGasLimitsReturn>
|
|
61
|
+
updateMetaTxnGasLimits(req: UpdateMetaTxnGasLimitsArgs, headers?: object, signal?: AbortSignal): Promise<UpdateMetaTxnGasLimitsReturn>
|
|
66
62
|
|
|
67
63
|
feeTokens(headers?: object, signal?: AbortSignal): Promise<FeeTokensReturn>
|
|
68
64
|
|
|
69
65
|
feeOptions(req: FeeOptionsArgs, headers?: object, signal?: AbortSignal): Promise<FeeOptionsReturn>
|
|
70
66
|
|
|
71
67
|
/**
|
|
72
|
-
*
|
|
68
|
+
* Bridge gas endpoints for S2S calls
|
|
69
|
+
* Used for bridge fees (e.g., LayerZero messaging fees) that require msg.value to be fronted at runtime.
|
|
70
|
+
* bridgeGas will be included in fee calculation so the relayer gets reimbursed.
|
|
73
71
|
*/
|
|
74
|
-
|
|
75
|
-
req: GetMetaTxnNetworkFeeOptionsArgs,
|
|
76
|
-
headers?: object,
|
|
77
|
-
signal?: AbortSignal
|
|
78
|
-
): Promise<GetMetaTxnNetworkFeeOptionsReturn>
|
|
72
|
+
sendMetaTxnWithBridgeGas(req: SendMetaTxnWithBridgeGasArgs, headers?: object, signal?: AbortSignal): Promise<SendMetaTxnWithBridgeGasReturn>
|
|
79
73
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
getTransactionCost(req: GetTransactionCostArgs, headers?: object, signal?: AbortSignal): Promise<GetTransactionCostReturn>
|
|
74
|
+
feeOptionsWithBridgeGas(req: FeeOptionsWithBridgeGasArgs, headers?: object, signal?: AbortSignal): Promise<FeeOptionsWithBridgeGasReturn>
|
|
83
75
|
|
|
84
76
|
/**
|
|
85
|
-
*
|
|
77
|
+
* TODO: deprecated, to be removed by https://github.com/0xsequence/stack/pull/356 at a later date
|
|
86
78
|
*/
|
|
87
|
-
|
|
79
|
+
getMetaTxnNetworkFeeOptions(req: GetMetaTxnNetworkFeeOptionsArgs, headers?: object, signal?: AbortSignal): Promise<GetMetaTxnNetworkFeeOptionsReturn>
|
|
88
80
|
|
|
89
81
|
/**
|
|
90
|
-
*
|
|
91
|
-
*
|
|
82
|
+
*
|
|
83
|
+
* Sender administration
|
|
84
|
+
*
|
|
92
85
|
*/
|
|
93
|
-
|
|
86
|
+
startSender(req: StartSenderArgs, headers?: object, signal?: AbortSignal): Promise<StartSenderReturn>
|
|
87
|
+
|
|
88
|
+
stopSender(req: StopSenderArgs, headers?: object, signal?: AbortSignal): Promise<StopSenderReturn>
|
|
89
|
+
|
|
90
|
+
repairSender(req: RepairSenderArgs, headers?: object, signal?: AbortSignal): Promise<RepairSenderReturn>
|
|
91
|
+
|
|
92
|
+
getMetaTransactions(req: GetMetaTransactionsArgs, headers?: object, signal?: AbortSignal): Promise<GetMetaTransactionsReturn>
|
|
93
|
+
|
|
94
|
+
getTransactionCost(req: GetTransactionCostArgs, headers?: object, signal?: AbortSignal): Promise<GetTransactionCostReturn>
|
|
94
95
|
|
|
95
96
|
/**
|
|
96
97
|
* Legacy Gas Tank
|
|
@@ -104,28 +105,16 @@ export interface RelayerClient {
|
|
|
104
105
|
/**
|
|
105
106
|
* Legacy Gas Adjustment
|
|
106
107
|
*/
|
|
107
|
-
nextGasTankBalanceAdjustmentNonce(
|
|
108
|
-
req: NextGasTankBalanceAdjustmentNonceArgs,
|
|
109
|
-
headers?: object,
|
|
110
|
-
signal?: AbortSignal
|
|
111
|
-
): Promise<NextGasTankBalanceAdjustmentNonceReturn>
|
|
108
|
+
nextGasTankBalanceAdjustmentNonce(req: NextGasTankBalanceAdjustmentNonceArgs, headers?: object, signal?: AbortSignal): Promise<NextGasTankBalanceAdjustmentNonceReturn>
|
|
112
109
|
|
|
113
110
|
adjustGasTankBalance(req: AdjustGasTankBalanceArgs, headers?: object, signal?: AbortSignal): Promise<AdjustGasTankBalanceReturn>
|
|
114
111
|
|
|
115
|
-
getGasTankBalanceAdjustment(
|
|
116
|
-
req: GetGasTankBalanceAdjustmentArgs,
|
|
117
|
-
headers?: object,
|
|
118
|
-
signal?: AbortSignal
|
|
119
|
-
): Promise<GetGasTankBalanceAdjustmentReturn>
|
|
112
|
+
getGasTankBalanceAdjustment(req: GetGasTankBalanceAdjustmentArgs, headers?: object, signal?: AbortSignal): Promise<GetGasTankBalanceAdjustmentReturn>
|
|
120
113
|
|
|
121
|
-
listGasTankBalanceAdjustments(
|
|
122
|
-
req: ListGasTankBalanceAdjustmentsArgs,
|
|
123
|
-
headers?: object,
|
|
124
|
-
signal?: AbortSignal
|
|
125
|
-
): Promise<ListGasTankBalanceAdjustmentsReturn>
|
|
114
|
+
listGasTankBalanceAdjustments(req: ListGasTankBalanceAdjustmentsArgs, headers?: object, signal?: AbortSignal): Promise<ListGasTankBalanceAdjustmentsReturn>
|
|
126
115
|
|
|
127
116
|
/**
|
|
128
|
-
* Gas Sponsorship
|
|
117
|
+
* Project-Level Gas Sponsorship
|
|
129
118
|
*/
|
|
130
119
|
listGasSponsors(req: ListGasSponsorsArgs, headers?: object, signal?: AbortSignal): Promise<ListGasSponsorsReturn>
|
|
131
120
|
|
|
@@ -137,6 +126,19 @@ export interface RelayerClient {
|
|
|
137
126
|
|
|
138
127
|
removeGasSponsor(req: RemoveGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise<RemoveGasSponsorReturn>
|
|
139
128
|
|
|
129
|
+
/**
|
|
130
|
+
* Ecosystem-level Gas Sponsorship
|
|
131
|
+
*/
|
|
132
|
+
listEcosystemGasSponsors(req: ListEcosystemGasSponsorsArgs, headers?: object, signal?: AbortSignal): Promise<ListEcosystemGasSponsorsReturn>
|
|
133
|
+
|
|
134
|
+
getEcosystemGasSponsor(req: GetEcosystemGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise<GetEcosystemGasSponsorReturn>
|
|
135
|
+
|
|
136
|
+
addEcosystemGasSponsor(req: AddEcosystemGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise<AddEcosystemGasSponsorReturn>
|
|
137
|
+
|
|
138
|
+
updateEcosystemGasSponsor(req: UpdateEcosystemGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise<UpdateEcosystemGasSponsorReturn>
|
|
139
|
+
|
|
140
|
+
removeEcosystemGasSponsor(req: RemoveEcosystemGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise<RemoveEcosystemGasSponsorReturn>
|
|
141
|
+
|
|
140
142
|
/**
|
|
141
143
|
* Gas Sponsor Lookup
|
|
142
144
|
*/
|
|
@@ -150,10 +152,17 @@ export interface RelayerClient {
|
|
|
150
152
|
adjustProjectBalance(req: AdjustProjectBalanceArgs, headers?: object, signal?: AbortSignal): Promise<AdjustProjectBalanceReturn>
|
|
151
153
|
}
|
|
152
154
|
|
|
155
|
+
|
|
153
156
|
//
|
|
154
157
|
// Schema types
|
|
155
158
|
//
|
|
156
159
|
|
|
160
|
+
export enum RepairOperation {
|
|
161
|
+
SKIP = 'SKIP',
|
|
162
|
+
REQUEUE = 'REQUEUE',
|
|
163
|
+
DROP = 'DROP'
|
|
164
|
+
}
|
|
165
|
+
|
|
157
166
|
export enum ETHTxnStatus {
|
|
158
167
|
UNKNOWN = 'UNKNOWN',
|
|
159
168
|
DROPPED = 'DROPPED',
|
|
@@ -162,7 +171,8 @@ export enum ETHTxnStatus {
|
|
|
162
171
|
SUCCEEDED = 'SUCCEEDED',
|
|
163
172
|
PARTIALLY_FAILED = 'PARTIALLY_FAILED',
|
|
164
173
|
FAILED = 'FAILED',
|
|
165
|
-
PENDING_PRECONDITION = 'PENDING_PRECONDITION'
|
|
174
|
+
PENDING_PRECONDITION = 'PENDING_PRECONDITION',
|
|
175
|
+
MINED = 'MINED'
|
|
166
176
|
}
|
|
167
177
|
|
|
168
178
|
export enum TransferType {
|
|
@@ -189,7 +199,7 @@ export enum FeeTokenType {
|
|
|
189
199
|
ERC1155_TOKEN = 'ERC1155_TOKEN'
|
|
190
200
|
}
|
|
191
201
|
|
|
192
|
-
export enum
|
|
202
|
+
export enum Order {
|
|
193
203
|
DESC = 'DESC',
|
|
194
204
|
ASC = 'ASC'
|
|
195
205
|
}
|
|
@@ -218,10 +228,35 @@ export interface SenderStatus {
|
|
|
218
228
|
index: number
|
|
219
229
|
address: string
|
|
220
230
|
etherBalance: number
|
|
231
|
+
enabled: boolean
|
|
221
232
|
active: boolean
|
|
233
|
+
nonce?: NonceStatus
|
|
234
|
+
current?: CurrentStatus
|
|
222
235
|
}
|
|
223
236
|
|
|
224
|
-
export interface
|
|
237
|
+
export interface NonceStatus {
|
|
238
|
+
chain: number
|
|
239
|
+
mempool: number
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export interface CurrentStatus {
|
|
243
|
+
transaction: string
|
|
244
|
+
first: TransactionStatus
|
|
245
|
+
latest?: TransactionStatus
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
export interface TransactionStatus {
|
|
249
|
+
transaction: string
|
|
250
|
+
gas: number
|
|
251
|
+
gasPrice: string
|
|
252
|
+
priorityFee: string
|
|
253
|
+
time: string
|
|
254
|
+
age: string
|
|
255
|
+
error?: string
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
export interface RuntimeChecks {
|
|
259
|
+
}
|
|
225
260
|
|
|
226
261
|
export interface SequenceContext {
|
|
227
262
|
factory: string
|
|
@@ -255,10 +290,13 @@ export interface GasSponsor {
|
|
|
255
290
|
id: number
|
|
256
291
|
gasTankId: number
|
|
257
292
|
projectId: number
|
|
293
|
+
ecosystemId: number
|
|
258
294
|
chainId: number
|
|
259
295
|
address: string
|
|
260
296
|
name: string
|
|
261
297
|
active: boolean
|
|
298
|
+
webhookUrl: string
|
|
299
|
+
webhookAuthToken: string
|
|
262
300
|
updatedAt: string
|
|
263
301
|
createdAt: string
|
|
264
302
|
deletedAt: string
|
|
@@ -280,6 +318,14 @@ export interface MetaTxn {
|
|
|
280
318
|
walletAddress: string
|
|
281
319
|
contract: string
|
|
282
320
|
input: string
|
|
321
|
+
authorization?: EIP7702Authorization
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
export interface EIP7702Authorization {
|
|
325
|
+
chainId: number
|
|
326
|
+
implementation: string
|
|
327
|
+
nonce: number
|
|
328
|
+
signature: string
|
|
283
329
|
}
|
|
284
330
|
|
|
285
331
|
export interface MetaTxnLog {
|
|
@@ -297,8 +343,9 @@ export interface MetaTxnLog {
|
|
|
297
343
|
minedAt: string
|
|
298
344
|
target: string
|
|
299
345
|
input: string
|
|
300
|
-
|
|
301
|
-
|
|
346
|
+
bridgeGas?: string
|
|
347
|
+
txnArgs: {[key: string]: any}
|
|
348
|
+
txnReceipt?: {[key: string]: any}
|
|
302
349
|
walletAddress: string
|
|
303
350
|
metaTxnNonce: string
|
|
304
351
|
gasLimit: number
|
|
@@ -370,11 +417,6 @@ export interface TxnLogTransfer {
|
|
|
370
417
|
amounts: Array<string>
|
|
371
418
|
}
|
|
372
419
|
|
|
373
|
-
export interface SentTransactionsFilter {
|
|
374
|
-
pending?: boolean
|
|
375
|
-
failed?: boolean
|
|
376
|
-
}
|
|
377
|
-
|
|
378
420
|
export interface SimulateResult {
|
|
379
421
|
executed: boolean
|
|
380
422
|
succeeded: boolean
|
|
@@ -411,46 +453,48 @@ export interface FeeToken {
|
|
|
411
453
|
}
|
|
412
454
|
|
|
413
455
|
export interface Page {
|
|
414
|
-
pageSize
|
|
415
|
-
page
|
|
416
|
-
more
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
before?: any
|
|
420
|
-
after?: any
|
|
421
|
-
sort?: Array<SortBy>
|
|
456
|
+
pageSize: number
|
|
457
|
+
page: number
|
|
458
|
+
more: boolean
|
|
459
|
+
column: string
|
|
460
|
+
sort: Array<Sort>
|
|
422
461
|
}
|
|
423
462
|
|
|
424
|
-
export interface
|
|
463
|
+
export interface Sort {
|
|
425
464
|
column: string
|
|
426
|
-
order:
|
|
465
|
+
order: Order
|
|
427
466
|
}
|
|
428
467
|
|
|
429
|
-
export interface PingArgs {
|
|
468
|
+
export interface PingArgs {
|
|
469
|
+
}
|
|
430
470
|
|
|
431
471
|
export interface PingReturn {
|
|
432
472
|
status: boolean
|
|
433
473
|
}
|
|
434
474
|
|
|
435
|
-
export interface VersionArgs {
|
|
475
|
+
export interface VersionArgs {
|
|
476
|
+
}
|
|
436
477
|
|
|
437
478
|
export interface VersionReturn {
|
|
438
479
|
version: Version
|
|
439
480
|
}
|
|
440
481
|
|
|
441
|
-
export interface RuntimeStatusArgs {
|
|
482
|
+
export interface RuntimeStatusArgs {
|
|
483
|
+
}
|
|
442
484
|
|
|
443
485
|
export interface RuntimeStatusReturn {
|
|
444
486
|
status: RuntimeStatus
|
|
445
487
|
}
|
|
446
488
|
|
|
447
|
-
export interface GetSequenceContextArgs {
|
|
489
|
+
export interface GetSequenceContextArgs {
|
|
490
|
+
}
|
|
448
491
|
|
|
449
492
|
export interface GetSequenceContextReturn {
|
|
450
493
|
data: SequenceContext
|
|
451
494
|
}
|
|
452
495
|
|
|
453
|
-
export interface GetChainIDArgs {
|
|
496
|
+
export interface GetChainIDArgs {
|
|
497
|
+
}
|
|
454
498
|
|
|
455
499
|
export interface GetChainIDReturn {
|
|
456
500
|
chainID: number
|
|
@@ -483,6 +527,7 @@ export interface GetMetaTxnReceiptArgs {
|
|
|
483
527
|
|
|
484
528
|
export interface GetMetaTxnReceiptReturn {
|
|
485
529
|
receipt: MetaTxnReceipt
|
|
530
|
+
metaTxnEnqueued: boolean
|
|
486
531
|
}
|
|
487
532
|
|
|
488
533
|
export interface SimulateArgs {
|
|
@@ -513,7 +558,8 @@ export interface UpdateMetaTxnGasLimitsReturn {
|
|
|
513
558
|
payload: string
|
|
514
559
|
}
|
|
515
560
|
|
|
516
|
-
export interface FeeTokensArgs {
|
|
561
|
+
export interface FeeTokensArgs {
|
|
562
|
+
}
|
|
517
563
|
|
|
518
564
|
export interface FeeTokensReturn {
|
|
519
565
|
isFeeRequired: boolean
|
|
@@ -526,6 +572,7 @@ export interface FeeOptionsArgs {
|
|
|
526
572
|
to: string
|
|
527
573
|
data: string
|
|
528
574
|
simulate?: boolean
|
|
575
|
+
authorization?: EIP7702Authorization
|
|
529
576
|
}
|
|
530
577
|
|
|
531
578
|
export interface FeeOptionsReturn {
|
|
@@ -534,6 +581,34 @@ export interface FeeOptionsReturn {
|
|
|
534
581
|
quote?: string
|
|
535
582
|
}
|
|
536
583
|
|
|
584
|
+
export interface SendMetaTxnWithBridgeGasArgs {
|
|
585
|
+
call: MetaTxn
|
|
586
|
+
quote?: string
|
|
587
|
+
projectID?: number
|
|
588
|
+
bridgeGas: string
|
|
589
|
+
preconditions?: Array<TransactionPrecondition>
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
export interface SendMetaTxnWithBridgeGasReturn {
|
|
593
|
+
status: boolean
|
|
594
|
+
txnHash: string
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
export interface FeeOptionsWithBridgeGasArgs {
|
|
598
|
+
wallet: string
|
|
599
|
+
to: string
|
|
600
|
+
data: string
|
|
601
|
+
simulate?: boolean
|
|
602
|
+
bridgeGas: string
|
|
603
|
+
authorization?: EIP7702Authorization
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
export interface FeeOptionsWithBridgeGasReturn {
|
|
607
|
+
options: Array<FeeOption>
|
|
608
|
+
sponsored: boolean
|
|
609
|
+
quote?: string
|
|
610
|
+
}
|
|
611
|
+
|
|
537
612
|
export interface GetMetaTxnNetworkFeeOptionsArgs {
|
|
538
613
|
walletConfig: any
|
|
539
614
|
payload: string
|
|
@@ -543,9 +618,33 @@ export interface GetMetaTxnNetworkFeeOptionsReturn {
|
|
|
543
618
|
options: Array<FeeOption>
|
|
544
619
|
}
|
|
545
620
|
|
|
621
|
+
export interface StartSenderArgs {
|
|
622
|
+
sender: number
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
export interface StartSenderReturn {
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
export interface StopSenderArgs {
|
|
629
|
+
sender: number
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
export interface StopSenderReturn {
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
export interface RepairSenderArgs {
|
|
636
|
+
sender: number
|
|
637
|
+
nonce: number
|
|
638
|
+
operation: RepairOperation
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
export interface RepairSenderReturn {
|
|
642
|
+
}
|
|
643
|
+
|
|
546
644
|
export interface GetMetaTransactionsArgs {
|
|
547
645
|
projectId: number
|
|
548
646
|
page?: Page
|
|
647
|
+
includeNonSponsored?: boolean
|
|
549
648
|
}
|
|
550
649
|
|
|
551
650
|
export interface GetMetaTransactionsReturn {
|
|
@@ -563,25 +662,6 @@ export interface GetTransactionCostReturn {
|
|
|
563
662
|
cost: number
|
|
564
663
|
}
|
|
565
664
|
|
|
566
|
-
export interface SentTransactionsArgs {
|
|
567
|
-
filter?: SentTransactionsFilter
|
|
568
|
-
page?: Page
|
|
569
|
-
}
|
|
570
|
-
|
|
571
|
-
export interface SentTransactionsReturn {
|
|
572
|
-
page: Page
|
|
573
|
-
transactions: Array<Transaction>
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
export interface PendingTransactionsArgs {
|
|
577
|
-
page?: Page
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
export interface PendingTransactionsReturn {
|
|
581
|
-
page: Page
|
|
582
|
-
transactions: Array<Transaction>
|
|
583
|
-
}
|
|
584
|
-
|
|
585
665
|
export interface GetGasTankArgs {
|
|
586
666
|
id: number
|
|
587
667
|
}
|
|
@@ -675,6 +755,8 @@ export interface AddGasSponsorArgs {
|
|
|
675
755
|
address: string
|
|
676
756
|
name?: string
|
|
677
757
|
active?: boolean
|
|
758
|
+
webhookUrl?: string
|
|
759
|
+
webhookAuthToken?: string
|
|
678
760
|
}
|
|
679
761
|
|
|
680
762
|
export interface AddGasSponsorReturn {
|
|
@@ -687,6 +769,8 @@ export interface UpdateGasSponsorArgs {
|
|
|
687
769
|
id: number
|
|
688
770
|
name?: string
|
|
689
771
|
active?: boolean
|
|
772
|
+
webhookUrl?: string
|
|
773
|
+
webhookAuthToken?: string
|
|
690
774
|
}
|
|
691
775
|
|
|
692
776
|
export interface UpdateGasSponsorReturn {
|
|
@@ -703,6 +787,62 @@ export interface RemoveGasSponsorReturn {
|
|
|
703
787
|
status: boolean
|
|
704
788
|
}
|
|
705
789
|
|
|
790
|
+
export interface ListEcosystemGasSponsorsArgs {
|
|
791
|
+
ecosystemId: number
|
|
792
|
+
page?: Page
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
export interface ListEcosystemGasSponsorsReturn {
|
|
796
|
+
page: Page
|
|
797
|
+
gasSponsors: Array<GasSponsor>
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
export interface GetEcosystemGasSponsorArgs {
|
|
801
|
+
ecosystemId: number
|
|
802
|
+
id: number
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
export interface GetEcosystemGasSponsorReturn {
|
|
806
|
+
gasSponsor: GasSponsor
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
export interface AddEcosystemGasSponsorArgs {
|
|
810
|
+
ecosystemId: number
|
|
811
|
+
address: string
|
|
812
|
+
name?: string
|
|
813
|
+
active?: boolean
|
|
814
|
+
webhookUrl?: string
|
|
815
|
+
webhookAuthToken?: string
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
export interface AddEcosystemGasSponsorReturn {
|
|
819
|
+
status: boolean
|
|
820
|
+
gasSponsor: GasSponsor
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
export interface UpdateEcosystemGasSponsorArgs {
|
|
824
|
+
ecosystemId: number
|
|
825
|
+
id: number
|
|
826
|
+
name?: string
|
|
827
|
+
active?: boolean
|
|
828
|
+
webhookUrl?: string
|
|
829
|
+
webhookAuthToken?: string
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
export interface UpdateEcosystemGasSponsorReturn {
|
|
833
|
+
status: boolean
|
|
834
|
+
gasSponsor: GasSponsor
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
export interface RemoveEcosystemGasSponsorArgs {
|
|
838
|
+
ecosystemId: number
|
|
839
|
+
id: number
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
export interface RemoveEcosystemGasSponsorReturn {
|
|
843
|
+
status: boolean
|
|
844
|
+
}
|
|
845
|
+
|
|
706
846
|
export interface AddressGasSponsorsArgs {
|
|
707
847
|
address: string
|
|
708
848
|
page?: Page
|
|
@@ -731,6 +871,8 @@ export interface AdjustProjectBalanceReturn {
|
|
|
731
871
|
balance: number
|
|
732
872
|
}
|
|
733
873
|
|
|
874
|
+
|
|
875
|
+
|
|
734
876
|
//
|
|
735
877
|
// Client
|
|
736
878
|
//
|
|
@@ -748,7 +890,7 @@ export class Relayer implements RelayerClient {
|
|
|
748
890
|
private url(name: string): string {
|
|
749
891
|
return this.hostname + this.path + name
|
|
750
892
|
}
|
|
751
|
-
|
|
893
|
+
|
|
752
894
|
queryKey = {
|
|
753
895
|
ping: () => ['Relayer', 'ping'] as const,
|
|
754
896
|
version: () => ['Relayer', 'version'] as const,
|
|
@@ -763,512 +905,532 @@ export class Relayer implements RelayerClient {
|
|
|
763
905
|
updateMetaTxnGasLimits: (req: UpdateMetaTxnGasLimitsArgs) => ['Relayer', 'updateMetaTxnGasLimits', req] as const,
|
|
764
906
|
feeTokens: () => ['Relayer', 'feeTokens'] as const,
|
|
765
907
|
feeOptions: (req: FeeOptionsArgs) => ['Relayer', 'feeOptions', req] as const,
|
|
766
|
-
|
|
767
|
-
|
|
908
|
+
sendMetaTxnWithBridgeGas: (req: SendMetaTxnWithBridgeGasArgs) => ['Relayer', 'sendMetaTxnWithBridgeGas', req] as const,
|
|
909
|
+
feeOptionsWithBridgeGas: (req: FeeOptionsWithBridgeGasArgs) => ['Relayer', 'feeOptionsWithBridgeGas', req] as const,
|
|
910
|
+
getMetaTxnNetworkFeeOptions: (req: GetMetaTxnNetworkFeeOptionsArgs) => ['Relayer', 'getMetaTxnNetworkFeeOptions', req] as const,
|
|
911
|
+
startSender: (req: StartSenderArgs) => ['Relayer', 'startSender', req] as const,
|
|
912
|
+
stopSender: (req: StopSenderArgs) => ['Relayer', 'stopSender', req] as const,
|
|
913
|
+
repairSender: (req: RepairSenderArgs) => ['Relayer', 'repairSender', req] as const,
|
|
768
914
|
getMetaTransactions: (req: GetMetaTransactionsArgs) => ['Relayer', 'getMetaTransactions', req] as const,
|
|
769
915
|
getTransactionCost: (req: GetTransactionCostArgs) => ['Relayer', 'getTransactionCost', req] as const,
|
|
770
|
-
sentTransactions: (req: SentTransactionsArgs) => ['Relayer', 'sentTransactions', req] as const,
|
|
771
|
-
pendingTransactions: (req: PendingTransactionsArgs) => ['Relayer', 'pendingTransactions', req] as const,
|
|
772
916
|
getGasTank: (req: GetGasTankArgs) => ['Relayer', 'getGasTank', req] as const,
|
|
773
917
|
addGasTank: (req: AddGasTankArgs) => ['Relayer', 'addGasTank', req] as const,
|
|
774
918
|
updateGasTank: (req: UpdateGasTankArgs) => ['Relayer', 'updateGasTank', req] as const,
|
|
775
|
-
nextGasTankBalanceAdjustmentNonce: (req: NextGasTankBalanceAdjustmentNonceArgs) =>
|
|
776
|
-
['Relayer', 'nextGasTankBalanceAdjustmentNonce', req] as const,
|
|
919
|
+
nextGasTankBalanceAdjustmentNonce: (req: NextGasTankBalanceAdjustmentNonceArgs) => ['Relayer', 'nextGasTankBalanceAdjustmentNonce', req] as const,
|
|
777
920
|
adjustGasTankBalance: (req: AdjustGasTankBalanceArgs) => ['Relayer', 'adjustGasTankBalance', req] as const,
|
|
778
|
-
getGasTankBalanceAdjustment: (req: GetGasTankBalanceAdjustmentArgs) =>
|
|
779
|
-
|
|
780
|
-
listGasTankBalanceAdjustments: (req: ListGasTankBalanceAdjustmentsArgs) =>
|
|
781
|
-
['Relayer', 'listGasTankBalanceAdjustments', req] as const,
|
|
921
|
+
getGasTankBalanceAdjustment: (req: GetGasTankBalanceAdjustmentArgs) => ['Relayer', 'getGasTankBalanceAdjustment', req] as const,
|
|
922
|
+
listGasTankBalanceAdjustments: (req: ListGasTankBalanceAdjustmentsArgs) => ['Relayer', 'listGasTankBalanceAdjustments', req] as const,
|
|
782
923
|
listGasSponsors: (req: ListGasSponsorsArgs) => ['Relayer', 'listGasSponsors', req] as const,
|
|
783
924
|
getGasSponsor: (req: GetGasSponsorArgs) => ['Relayer', 'getGasSponsor', req] as const,
|
|
784
925
|
addGasSponsor: (req: AddGasSponsorArgs) => ['Relayer', 'addGasSponsor', req] as const,
|
|
785
926
|
updateGasSponsor: (req: UpdateGasSponsorArgs) => ['Relayer', 'updateGasSponsor', req] as const,
|
|
786
927
|
removeGasSponsor: (req: RemoveGasSponsorArgs) => ['Relayer', 'removeGasSponsor', req] as const,
|
|
928
|
+
listEcosystemGasSponsors: (req: ListEcosystemGasSponsorsArgs) => ['Relayer', 'listEcosystemGasSponsors', req] as const,
|
|
929
|
+
getEcosystemGasSponsor: (req: GetEcosystemGasSponsorArgs) => ['Relayer', 'getEcosystemGasSponsor', req] as const,
|
|
930
|
+
addEcosystemGasSponsor: (req: AddEcosystemGasSponsorArgs) => ['Relayer', 'addEcosystemGasSponsor', req] as const,
|
|
931
|
+
updateEcosystemGasSponsor: (req: UpdateEcosystemGasSponsorArgs) => ['Relayer', 'updateEcosystemGasSponsor', req] as const,
|
|
932
|
+
removeEcosystemGasSponsor: (req: RemoveEcosystemGasSponsorArgs) => ['Relayer', 'removeEcosystemGasSponsor', req] as const,
|
|
787
933
|
addressGasSponsors: (req: AddressGasSponsorsArgs) => ['Relayer', 'addressGasSponsors', req] as const,
|
|
788
934
|
getProjectBalance: (req: GetProjectBalanceArgs) => ['Relayer', 'getProjectBalance', req] as const,
|
|
789
|
-
adjustProjectBalance: (req: AdjustProjectBalanceArgs) => ['Relayer', 'adjustProjectBalance', req] as const
|
|
935
|
+
adjustProjectBalance: (req: AdjustProjectBalanceArgs) => ['Relayer', 'adjustProjectBalance', req] as const,
|
|
790
936
|
}
|
|
791
937
|
|
|
792
938
|
ping = (headers?: object, signal?: AbortSignal): Promise<PingReturn> => {
|
|
793
|
-
return this.fetch(
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
}
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
)
|
|
939
|
+
return this.fetch(
|
|
940
|
+
this.url('Ping'),
|
|
941
|
+
createHttpRequest('{}', headers, signal)).then((res) => {
|
|
942
|
+
return buildResponse(res).then(_data => {
|
|
943
|
+
return JsonDecode<PingReturn>(_data, 'PingReturn')
|
|
944
|
+
})
|
|
945
|
+
}, (error) => {
|
|
946
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
947
|
+
})
|
|
803
948
|
}
|
|
804
949
|
|
|
805
950
|
version = (headers?: object, signal?: AbortSignal): Promise<VersionReturn> => {
|
|
806
|
-
return this.fetch(
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
}
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
)
|
|
951
|
+
return this.fetch(
|
|
952
|
+
this.url('Version'),
|
|
953
|
+
createHttpRequest('{}', headers, signal)).then((res) => {
|
|
954
|
+
return buildResponse(res).then(_data => {
|
|
955
|
+
return JsonDecode<VersionReturn>(_data, 'VersionReturn')
|
|
956
|
+
})
|
|
957
|
+
}, (error) => {
|
|
958
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
959
|
+
})
|
|
816
960
|
}
|
|
817
961
|
|
|
818
962
|
runtimeStatus = (headers?: object, signal?: AbortSignal): Promise<RuntimeStatusReturn> => {
|
|
819
|
-
return this.fetch(
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
}
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
)
|
|
963
|
+
return this.fetch(
|
|
964
|
+
this.url('RuntimeStatus'),
|
|
965
|
+
createHttpRequest('{}', headers, signal)).then((res) => {
|
|
966
|
+
return buildResponse(res).then(_data => {
|
|
967
|
+
return JsonDecode<RuntimeStatusReturn>(_data, 'RuntimeStatusReturn')
|
|
968
|
+
})
|
|
969
|
+
}, (error) => {
|
|
970
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
971
|
+
})
|
|
829
972
|
}
|
|
830
973
|
|
|
831
974
|
getSequenceContext = (headers?: object, signal?: AbortSignal): Promise<GetSequenceContextReturn> => {
|
|
832
|
-
return this.fetch(
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
}
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
)
|
|
975
|
+
return this.fetch(
|
|
976
|
+
this.url('GetSequenceContext'),
|
|
977
|
+
createHttpRequest('{}', headers, signal)).then((res) => {
|
|
978
|
+
return buildResponse(res).then(_data => {
|
|
979
|
+
return JsonDecode<GetSequenceContextReturn>(_data, 'GetSequenceContextReturn')
|
|
980
|
+
})
|
|
981
|
+
}, (error) => {
|
|
982
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
983
|
+
})
|
|
842
984
|
}
|
|
843
985
|
|
|
844
986
|
getChainID = (headers?: object, signal?: AbortSignal): Promise<GetChainIDReturn> => {
|
|
845
|
-
return this.fetch(
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
}
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
)
|
|
987
|
+
return this.fetch(
|
|
988
|
+
this.url('GetChainID'),
|
|
989
|
+
createHttpRequest('{}', headers, signal)).then((res) => {
|
|
990
|
+
return buildResponse(res).then(_data => {
|
|
991
|
+
return JsonDecode<GetChainIDReturn>(_data, 'GetChainIDReturn')
|
|
992
|
+
})
|
|
993
|
+
}, (error) => {
|
|
994
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
995
|
+
})
|
|
855
996
|
}
|
|
856
997
|
|
|
857
998
|
sendMetaTxn = (req: SendMetaTxnArgs, headers?: object, signal?: AbortSignal): Promise<SendMetaTxnReturn> => {
|
|
858
|
-
return this.fetch(
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
}
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
)
|
|
999
|
+
return this.fetch(
|
|
1000
|
+
this.url('SendMetaTxn'),
|
|
1001
|
+
createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
|
|
1002
|
+
return buildResponse(res).then(_data => {
|
|
1003
|
+
return JsonDecode<SendMetaTxnReturn>(_data, 'SendMetaTxnReturn')
|
|
1004
|
+
})
|
|
1005
|
+
}, (error) => {
|
|
1006
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
1007
|
+
})
|
|
868
1008
|
}
|
|
869
1009
|
|
|
870
1010
|
getMetaTxnNonce = (req: GetMetaTxnNonceArgs, headers?: object, signal?: AbortSignal): Promise<GetMetaTxnNonceReturn> => {
|
|
871
|
-
return this.fetch(
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
}
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
)
|
|
1011
|
+
return this.fetch(
|
|
1012
|
+
this.url('GetMetaTxnNonce'),
|
|
1013
|
+
createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
|
|
1014
|
+
return buildResponse(res).then(_data => {
|
|
1015
|
+
return JsonDecode<GetMetaTxnNonceReturn>(_data, 'GetMetaTxnNonceReturn')
|
|
1016
|
+
})
|
|
1017
|
+
}, (error) => {
|
|
1018
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
1019
|
+
})
|
|
881
1020
|
}
|
|
882
1021
|
|
|
883
1022
|
getMetaTxnReceipt = (req: GetMetaTxnReceiptArgs, headers?: object, signal?: AbortSignal): Promise<GetMetaTxnReceiptReturn> => {
|
|
884
|
-
return this.fetch(
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
}
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
)
|
|
1023
|
+
return this.fetch(
|
|
1024
|
+
this.url('GetMetaTxnReceipt'),
|
|
1025
|
+
createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
|
|
1026
|
+
return buildResponse(res).then(_data => {
|
|
1027
|
+
return JsonDecode<GetMetaTxnReceiptReturn>(_data, 'GetMetaTxnReceiptReturn')
|
|
1028
|
+
})
|
|
1029
|
+
}, (error) => {
|
|
1030
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
1031
|
+
})
|
|
894
1032
|
}
|
|
895
1033
|
|
|
896
1034
|
simulate = (req: SimulateArgs, headers?: object, signal?: AbortSignal): Promise<SimulateReturn> => {
|
|
897
|
-
return this.fetch(
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
}
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
)
|
|
1035
|
+
return this.fetch(
|
|
1036
|
+
this.url('Simulate'),
|
|
1037
|
+
createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
|
|
1038
|
+
return buildResponse(res).then(_data => {
|
|
1039
|
+
return JsonDecode<SimulateReturn>(_data, 'SimulateReturn')
|
|
1040
|
+
})
|
|
1041
|
+
}, (error) => {
|
|
1042
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
1043
|
+
})
|
|
907
1044
|
}
|
|
908
1045
|
|
|
909
1046
|
simulateV3 = (req: SimulateV3Args, headers?: object, signal?: AbortSignal): Promise<SimulateV3Return> => {
|
|
910
|
-
return this.fetch(
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
}
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
})
|
|
932
|
-
},
|
|
933
|
-
error => {
|
|
934
|
-
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
935
|
-
}
|
|
936
|
-
)
|
|
1047
|
+
return this.fetch(
|
|
1048
|
+
this.url('SimulateV3'),
|
|
1049
|
+
createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
|
|
1050
|
+
return buildResponse(res).then(_data => {
|
|
1051
|
+
return JsonDecode<SimulateV3Return>(_data, 'SimulateV3Return')
|
|
1052
|
+
})
|
|
1053
|
+
}, (error) => {
|
|
1054
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
1055
|
+
})
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
updateMetaTxnGasLimits = (req: UpdateMetaTxnGasLimitsArgs, headers?: object, signal?: AbortSignal): Promise<UpdateMetaTxnGasLimitsReturn> => {
|
|
1059
|
+
return this.fetch(
|
|
1060
|
+
this.url('UpdateMetaTxnGasLimits'),
|
|
1061
|
+
createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
|
|
1062
|
+
return buildResponse(res).then(_data => {
|
|
1063
|
+
return JsonDecode<UpdateMetaTxnGasLimitsReturn>(_data, 'UpdateMetaTxnGasLimitsReturn')
|
|
1064
|
+
})
|
|
1065
|
+
}, (error) => {
|
|
1066
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
1067
|
+
})
|
|
937
1068
|
}
|
|
938
1069
|
|
|
939
1070
|
feeTokens = (headers?: object, signal?: AbortSignal): Promise<FeeTokensReturn> => {
|
|
940
|
-
return this.fetch(
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
}
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
)
|
|
1071
|
+
return this.fetch(
|
|
1072
|
+
this.url('FeeTokens'),
|
|
1073
|
+
createHttpRequest('{}', headers, signal)).then((res) => {
|
|
1074
|
+
return buildResponse(res).then(_data => {
|
|
1075
|
+
return JsonDecode<FeeTokensReturn>(_data, 'FeeTokensReturn')
|
|
1076
|
+
})
|
|
1077
|
+
}, (error) => {
|
|
1078
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
1079
|
+
})
|
|
950
1080
|
}
|
|
951
1081
|
|
|
952
1082
|
feeOptions = (req: FeeOptionsArgs, headers?: object, signal?: AbortSignal): Promise<FeeOptionsReturn> => {
|
|
953
|
-
return this.fetch(
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
}
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
}
|
|
1043
|
-
)
|
|
1083
|
+
return this.fetch(
|
|
1084
|
+
this.url('FeeOptions'),
|
|
1085
|
+
createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
|
|
1086
|
+
return buildResponse(res).then(_data => {
|
|
1087
|
+
return JsonDecode<FeeOptionsReturn>(_data, 'FeeOptionsReturn')
|
|
1088
|
+
})
|
|
1089
|
+
}, (error) => {
|
|
1090
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
1091
|
+
})
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
sendMetaTxnWithBridgeGas = (req: SendMetaTxnWithBridgeGasArgs, headers?: object, signal?: AbortSignal): Promise<SendMetaTxnWithBridgeGasReturn> => {
|
|
1095
|
+
return this.fetch(
|
|
1096
|
+
this.url('SendMetaTxnWithBridgeGas'),
|
|
1097
|
+
createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
|
|
1098
|
+
return buildResponse(res).then(_data => {
|
|
1099
|
+
return JsonDecode<SendMetaTxnWithBridgeGasReturn>(_data, 'SendMetaTxnWithBridgeGasReturn')
|
|
1100
|
+
})
|
|
1101
|
+
}, (error) => {
|
|
1102
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
1103
|
+
})
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
feeOptionsWithBridgeGas = (req: FeeOptionsWithBridgeGasArgs, headers?: object, signal?: AbortSignal): Promise<FeeOptionsWithBridgeGasReturn> => {
|
|
1107
|
+
return this.fetch(
|
|
1108
|
+
this.url('FeeOptionsWithBridgeGas'),
|
|
1109
|
+
createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
|
|
1110
|
+
return buildResponse(res).then(_data => {
|
|
1111
|
+
return JsonDecode<FeeOptionsWithBridgeGasReturn>(_data, 'FeeOptionsWithBridgeGasReturn')
|
|
1112
|
+
})
|
|
1113
|
+
}, (error) => {
|
|
1114
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
1115
|
+
})
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
getMetaTxnNetworkFeeOptions = (req: GetMetaTxnNetworkFeeOptionsArgs, headers?: object, signal?: AbortSignal): Promise<GetMetaTxnNetworkFeeOptionsReturn> => {
|
|
1119
|
+
return this.fetch(
|
|
1120
|
+
this.url('GetMetaTxnNetworkFeeOptions'),
|
|
1121
|
+
createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
|
|
1122
|
+
return buildResponse(res).then(_data => {
|
|
1123
|
+
return JsonDecode<GetMetaTxnNetworkFeeOptionsReturn>(_data, 'GetMetaTxnNetworkFeeOptionsReturn')
|
|
1124
|
+
})
|
|
1125
|
+
}, (error) => {
|
|
1126
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
1127
|
+
})
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
startSender = (req: StartSenderArgs, headers?: object, signal?: AbortSignal): Promise<StartSenderReturn> => {
|
|
1131
|
+
return this.fetch(
|
|
1132
|
+
this.url('StartSender'),
|
|
1133
|
+
createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
|
|
1134
|
+
return buildResponse(res).then(_data => {
|
|
1135
|
+
return JsonDecode<StartSenderReturn>(_data, 'StartSenderReturn')
|
|
1136
|
+
})
|
|
1137
|
+
}, (error) => {
|
|
1138
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
1139
|
+
})
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
stopSender = (req: StopSenderArgs, headers?: object, signal?: AbortSignal): Promise<StopSenderReturn> => {
|
|
1143
|
+
return this.fetch(
|
|
1144
|
+
this.url('StopSender'),
|
|
1145
|
+
createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
|
|
1146
|
+
return buildResponse(res).then(_data => {
|
|
1147
|
+
return JsonDecode<StopSenderReturn>(_data, 'StopSenderReturn')
|
|
1148
|
+
})
|
|
1149
|
+
}, (error) => {
|
|
1150
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
1151
|
+
})
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
repairSender = (req: RepairSenderArgs, headers?: object, signal?: AbortSignal): Promise<RepairSenderReturn> => {
|
|
1155
|
+
return this.fetch(
|
|
1156
|
+
this.url('RepairSender'),
|
|
1157
|
+
createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
|
|
1158
|
+
return buildResponse(res).then(_data => {
|
|
1159
|
+
return JsonDecode<RepairSenderReturn>(_data, 'RepairSenderReturn')
|
|
1160
|
+
})
|
|
1161
|
+
}, (error) => {
|
|
1162
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
1163
|
+
})
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
getMetaTransactions = (req: GetMetaTransactionsArgs, headers?: object, signal?: AbortSignal): Promise<GetMetaTransactionsReturn> => {
|
|
1167
|
+
return this.fetch(
|
|
1168
|
+
this.url('GetMetaTransactions'),
|
|
1169
|
+
createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
|
|
1170
|
+
return buildResponse(res).then(_data => {
|
|
1171
|
+
return JsonDecode<GetMetaTransactionsReturn>(_data, 'GetMetaTransactionsReturn')
|
|
1172
|
+
})
|
|
1173
|
+
}, (error) => {
|
|
1174
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
1175
|
+
})
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
getTransactionCost = (req: GetTransactionCostArgs, headers?: object, signal?: AbortSignal): Promise<GetTransactionCostReturn> => {
|
|
1179
|
+
return this.fetch(
|
|
1180
|
+
this.url('GetTransactionCost'),
|
|
1181
|
+
createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
|
|
1182
|
+
return buildResponse(res).then(_data => {
|
|
1183
|
+
return JsonDecode<GetTransactionCostReturn>(_data, 'GetTransactionCostReturn')
|
|
1184
|
+
})
|
|
1185
|
+
}, (error) => {
|
|
1186
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
1187
|
+
})
|
|
1044
1188
|
}
|
|
1045
1189
|
|
|
1046
1190
|
getGasTank = (req: GetGasTankArgs, headers?: object, signal?: AbortSignal): Promise<GetGasTankReturn> => {
|
|
1047
|
-
return this.fetch(
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
}
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
)
|
|
1191
|
+
return this.fetch(
|
|
1192
|
+
this.url('GetGasTank'),
|
|
1193
|
+
createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
|
|
1194
|
+
return buildResponse(res).then(_data => {
|
|
1195
|
+
return JsonDecode<GetGasTankReturn>(_data, 'GetGasTankReturn')
|
|
1196
|
+
})
|
|
1197
|
+
}, (error) => {
|
|
1198
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
1199
|
+
})
|
|
1057
1200
|
}
|
|
1058
1201
|
|
|
1059
1202
|
addGasTank = (req: AddGasTankArgs, headers?: object, signal?: AbortSignal): Promise<AddGasTankReturn> => {
|
|
1060
|
-
return this.fetch(
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
}
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
)
|
|
1203
|
+
return this.fetch(
|
|
1204
|
+
this.url('AddGasTank'),
|
|
1205
|
+
createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
|
|
1206
|
+
return buildResponse(res).then(_data => {
|
|
1207
|
+
return JsonDecode<AddGasTankReturn>(_data, 'AddGasTankReturn')
|
|
1208
|
+
})
|
|
1209
|
+
}, (error) => {
|
|
1210
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
1211
|
+
})
|
|
1070
1212
|
}
|
|
1071
1213
|
|
|
1072
1214
|
updateGasTank = (req: UpdateGasTankArgs, headers?: object, signal?: AbortSignal): Promise<UpdateGasTankReturn> => {
|
|
1073
|
-
return this.fetch(
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
}
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
error => {
|
|
1131
|
-
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
1132
|
-
}
|
|
1133
|
-
)
|
|
1134
|
-
}
|
|
1135
|
-
|
|
1136
|
-
listGasTankBalanceAdjustments = (
|
|
1137
|
-
req: ListGasTankBalanceAdjustmentsArgs,
|
|
1138
|
-
headers?: object,
|
|
1139
|
-
signal?: AbortSignal
|
|
1140
|
-
): Promise<ListGasTankBalanceAdjustmentsReturn> => {
|
|
1141
|
-
return this.fetch(this.url('ListGasTankBalanceAdjustments'), createHttpRequest(JsonEncode(req), headers, signal)).then(
|
|
1142
|
-
res => {
|
|
1143
|
-
return buildResponse(res).then(_data => {
|
|
1144
|
-
return JsonDecode<ListGasTankBalanceAdjustmentsReturn>(_data, 'ListGasTankBalanceAdjustmentsReturn')
|
|
1145
|
-
})
|
|
1146
|
-
},
|
|
1147
|
-
error => {
|
|
1148
|
-
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
1149
|
-
}
|
|
1150
|
-
)
|
|
1215
|
+
return this.fetch(
|
|
1216
|
+
this.url('UpdateGasTank'),
|
|
1217
|
+
createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
|
|
1218
|
+
return buildResponse(res).then(_data => {
|
|
1219
|
+
return JsonDecode<UpdateGasTankReturn>(_data, 'UpdateGasTankReturn')
|
|
1220
|
+
})
|
|
1221
|
+
}, (error) => {
|
|
1222
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
1223
|
+
})
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
nextGasTankBalanceAdjustmentNonce = (req: NextGasTankBalanceAdjustmentNonceArgs, headers?: object, signal?: AbortSignal): Promise<NextGasTankBalanceAdjustmentNonceReturn> => {
|
|
1227
|
+
return this.fetch(
|
|
1228
|
+
this.url('NextGasTankBalanceAdjustmentNonce'),
|
|
1229
|
+
createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
|
|
1230
|
+
return buildResponse(res).then(_data => {
|
|
1231
|
+
return JsonDecode<NextGasTankBalanceAdjustmentNonceReturn>(_data, 'NextGasTankBalanceAdjustmentNonceReturn')
|
|
1232
|
+
})
|
|
1233
|
+
}, (error) => {
|
|
1234
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
1235
|
+
})
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
adjustGasTankBalance = (req: AdjustGasTankBalanceArgs, headers?: object, signal?: AbortSignal): Promise<AdjustGasTankBalanceReturn> => {
|
|
1239
|
+
return this.fetch(
|
|
1240
|
+
this.url('AdjustGasTankBalance'),
|
|
1241
|
+
createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
|
|
1242
|
+
return buildResponse(res).then(_data => {
|
|
1243
|
+
return JsonDecode<AdjustGasTankBalanceReturn>(_data, 'AdjustGasTankBalanceReturn')
|
|
1244
|
+
})
|
|
1245
|
+
}, (error) => {
|
|
1246
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
1247
|
+
})
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
getGasTankBalanceAdjustment = (req: GetGasTankBalanceAdjustmentArgs, headers?: object, signal?: AbortSignal): Promise<GetGasTankBalanceAdjustmentReturn> => {
|
|
1251
|
+
return this.fetch(
|
|
1252
|
+
this.url('GetGasTankBalanceAdjustment'),
|
|
1253
|
+
createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
|
|
1254
|
+
return buildResponse(res).then(_data => {
|
|
1255
|
+
return JsonDecode<GetGasTankBalanceAdjustmentReturn>(_data, 'GetGasTankBalanceAdjustmentReturn')
|
|
1256
|
+
})
|
|
1257
|
+
}, (error) => {
|
|
1258
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
1259
|
+
})
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
listGasTankBalanceAdjustments = (req: ListGasTankBalanceAdjustmentsArgs, headers?: object, signal?: AbortSignal): Promise<ListGasTankBalanceAdjustmentsReturn> => {
|
|
1263
|
+
return this.fetch(
|
|
1264
|
+
this.url('ListGasTankBalanceAdjustments'),
|
|
1265
|
+
createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
|
|
1266
|
+
return buildResponse(res).then(_data => {
|
|
1267
|
+
return JsonDecode<ListGasTankBalanceAdjustmentsReturn>(_data, 'ListGasTankBalanceAdjustmentsReturn')
|
|
1268
|
+
})
|
|
1269
|
+
}, (error) => {
|
|
1270
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
1271
|
+
})
|
|
1151
1272
|
}
|
|
1152
1273
|
|
|
1153
1274
|
listGasSponsors = (req: ListGasSponsorsArgs, headers?: object, signal?: AbortSignal): Promise<ListGasSponsorsReturn> => {
|
|
1154
|
-
return this.fetch(
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
}
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
)
|
|
1275
|
+
return this.fetch(
|
|
1276
|
+
this.url('ListGasSponsors'),
|
|
1277
|
+
createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
|
|
1278
|
+
return buildResponse(res).then(_data => {
|
|
1279
|
+
return JsonDecode<ListGasSponsorsReturn>(_data, 'ListGasSponsorsReturn')
|
|
1280
|
+
})
|
|
1281
|
+
}, (error) => {
|
|
1282
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
1283
|
+
})
|
|
1164
1284
|
}
|
|
1165
1285
|
|
|
1166
1286
|
getGasSponsor = (req: GetGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise<GetGasSponsorReturn> => {
|
|
1167
|
-
return this.fetch(
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
}
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
)
|
|
1287
|
+
return this.fetch(
|
|
1288
|
+
this.url('GetGasSponsor'),
|
|
1289
|
+
createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
|
|
1290
|
+
return buildResponse(res).then(_data => {
|
|
1291
|
+
return JsonDecode<GetGasSponsorReturn>(_data, 'GetGasSponsorReturn')
|
|
1292
|
+
})
|
|
1293
|
+
}, (error) => {
|
|
1294
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
1295
|
+
})
|
|
1177
1296
|
}
|
|
1178
1297
|
|
|
1179
1298
|
addGasSponsor = (req: AddGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise<AddGasSponsorReturn> => {
|
|
1180
|
-
return this.fetch(
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
}
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
)
|
|
1299
|
+
return this.fetch(
|
|
1300
|
+
this.url('AddGasSponsor'),
|
|
1301
|
+
createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
|
|
1302
|
+
return buildResponse(res).then(_data => {
|
|
1303
|
+
return JsonDecode<AddGasSponsorReturn>(_data, 'AddGasSponsorReturn')
|
|
1304
|
+
})
|
|
1305
|
+
}, (error) => {
|
|
1306
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
1307
|
+
})
|
|
1190
1308
|
}
|
|
1191
1309
|
|
|
1192
1310
|
updateGasSponsor = (req: UpdateGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise<UpdateGasSponsorReturn> => {
|
|
1193
|
-
return this.fetch(
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
}
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
)
|
|
1311
|
+
return this.fetch(
|
|
1312
|
+
this.url('UpdateGasSponsor'),
|
|
1313
|
+
createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
|
|
1314
|
+
return buildResponse(res).then(_data => {
|
|
1315
|
+
return JsonDecode<UpdateGasSponsorReturn>(_data, 'UpdateGasSponsorReturn')
|
|
1316
|
+
})
|
|
1317
|
+
}, (error) => {
|
|
1318
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
1319
|
+
})
|
|
1203
1320
|
}
|
|
1204
1321
|
|
|
1205
1322
|
removeGasSponsor = (req: RemoveGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise<RemoveGasSponsorReturn> => {
|
|
1206
|
-
return this.fetch(
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
}
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1323
|
+
return this.fetch(
|
|
1324
|
+
this.url('RemoveGasSponsor'),
|
|
1325
|
+
createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
|
|
1326
|
+
return buildResponse(res).then(_data => {
|
|
1327
|
+
return JsonDecode<RemoveGasSponsorReturn>(_data, 'RemoveGasSponsorReturn')
|
|
1328
|
+
})
|
|
1329
|
+
}, (error) => {
|
|
1330
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
1331
|
+
})
|
|
1332
|
+
}
|
|
1333
|
+
|
|
1334
|
+
listEcosystemGasSponsors = (req: ListEcosystemGasSponsorsArgs, headers?: object, signal?: AbortSignal): Promise<ListEcosystemGasSponsorsReturn> => {
|
|
1335
|
+
return this.fetch(
|
|
1336
|
+
this.url('ListEcosystemGasSponsors'),
|
|
1337
|
+
createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
|
|
1338
|
+
return buildResponse(res).then(_data => {
|
|
1339
|
+
return JsonDecode<ListEcosystemGasSponsorsReturn>(_data, 'ListEcosystemGasSponsorsReturn')
|
|
1340
|
+
})
|
|
1341
|
+
}, (error) => {
|
|
1342
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
1343
|
+
})
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
getEcosystemGasSponsor = (req: GetEcosystemGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise<GetEcosystemGasSponsorReturn> => {
|
|
1347
|
+
return this.fetch(
|
|
1348
|
+
this.url('GetEcosystemGasSponsor'),
|
|
1349
|
+
createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
|
|
1350
|
+
return buildResponse(res).then(_data => {
|
|
1351
|
+
return JsonDecode<GetEcosystemGasSponsorReturn>(_data, 'GetEcosystemGasSponsorReturn')
|
|
1352
|
+
})
|
|
1353
|
+
}, (error) => {
|
|
1354
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
1355
|
+
})
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
addEcosystemGasSponsor = (req: AddEcosystemGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise<AddEcosystemGasSponsorReturn> => {
|
|
1359
|
+
return this.fetch(
|
|
1360
|
+
this.url('AddEcosystemGasSponsor'),
|
|
1361
|
+
createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
|
|
1362
|
+
return buildResponse(res).then(_data => {
|
|
1363
|
+
return JsonDecode<AddEcosystemGasSponsorReturn>(_data, 'AddEcosystemGasSponsorReturn')
|
|
1364
|
+
})
|
|
1365
|
+
}, (error) => {
|
|
1366
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
1367
|
+
})
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
updateEcosystemGasSponsor = (req: UpdateEcosystemGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise<UpdateEcosystemGasSponsorReturn> => {
|
|
1371
|
+
return this.fetch(
|
|
1372
|
+
this.url('UpdateEcosystemGasSponsor'),
|
|
1373
|
+
createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
|
|
1374
|
+
return buildResponse(res).then(_data => {
|
|
1375
|
+
return JsonDecode<UpdateEcosystemGasSponsorReturn>(_data, 'UpdateEcosystemGasSponsorReturn')
|
|
1376
|
+
})
|
|
1377
|
+
}, (error) => {
|
|
1378
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
1379
|
+
})
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
removeEcosystemGasSponsor = (req: RemoveEcosystemGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise<RemoveEcosystemGasSponsorReturn> => {
|
|
1383
|
+
return this.fetch(
|
|
1384
|
+
this.url('RemoveEcosystemGasSponsor'),
|
|
1385
|
+
createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
|
|
1386
|
+
return buildResponse(res).then(_data => {
|
|
1387
|
+
return JsonDecode<RemoveEcosystemGasSponsorReturn>(_data, 'RemoveEcosystemGasSponsorReturn')
|
|
1388
|
+
})
|
|
1389
|
+
}, (error) => {
|
|
1390
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
1391
|
+
})
|
|
1392
|
+
}
|
|
1393
|
+
|
|
1394
|
+
addressGasSponsors = (req: AddressGasSponsorsArgs, headers?: object, signal?: AbortSignal): Promise<AddressGasSponsorsReturn> => {
|
|
1395
|
+
return this.fetch(
|
|
1396
|
+
this.url('AddressGasSponsors'),
|
|
1397
|
+
createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
|
|
1398
|
+
return buildResponse(res).then(_data => {
|
|
1399
|
+
return JsonDecode<AddressGasSponsorsReturn>(_data, 'AddressGasSponsorsReturn')
|
|
1400
|
+
})
|
|
1401
|
+
}, (error) => {
|
|
1402
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
1403
|
+
})
|
|
1233
1404
|
}
|
|
1234
1405
|
|
|
1235
1406
|
getProjectBalance = (req: GetProjectBalanceArgs, headers?: object, signal?: AbortSignal): Promise<GetProjectBalanceReturn> => {
|
|
1236
|
-
return this.fetch(
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
}
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
)
|
|
1246
|
-
}
|
|
1247
|
-
|
|
1248
|
-
adjustProjectBalance = (
|
|
1249
|
-
req: AdjustProjectBalanceArgs,
|
|
1250
|
-
headers?: object,
|
|
1251
|
-
signal?: AbortSignal
|
|
1252
|
-
): Promise<AdjustProjectBalanceReturn> => {
|
|
1253
|
-
return this.fetch(this.url('AdjustProjectBalance'), createHttpRequest(JsonEncode(req), headers, signal)).then(
|
|
1254
|
-
res => {
|
|
1255
|
-
return buildResponse(res).then(_data => {
|
|
1256
|
-
return JsonDecode<AdjustProjectBalanceReturn>(_data, 'AdjustProjectBalanceReturn')
|
|
1257
|
-
})
|
|
1258
|
-
},
|
|
1259
|
-
error => {
|
|
1260
|
-
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
1261
|
-
}
|
|
1262
|
-
)
|
|
1407
|
+
return this.fetch(
|
|
1408
|
+
this.url('GetProjectBalance'),
|
|
1409
|
+
createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
|
|
1410
|
+
return buildResponse(res).then(_data => {
|
|
1411
|
+
return JsonDecode<GetProjectBalanceReturn>(_data, 'GetProjectBalanceReturn')
|
|
1412
|
+
})
|
|
1413
|
+
}, (error) => {
|
|
1414
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
1415
|
+
})
|
|
1263
1416
|
}
|
|
1417
|
+
|
|
1418
|
+
adjustProjectBalance = (req: AdjustProjectBalanceArgs, headers?: object, signal?: AbortSignal): Promise<AdjustProjectBalanceReturn> => {
|
|
1419
|
+
return this.fetch(
|
|
1420
|
+
this.url('AdjustProjectBalance'),
|
|
1421
|
+
createHttpRequest(JsonEncode(req), headers, signal)).then((res) => {
|
|
1422
|
+
return buildResponse(res).then(_data => {
|
|
1423
|
+
return JsonDecode<AdjustProjectBalanceReturn>(_data, 'AdjustProjectBalanceReturn')
|
|
1424
|
+
})
|
|
1425
|
+
}, (error) => {
|
|
1426
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
|
|
1427
|
+
})
|
|
1428
|
+
}
|
|
1429
|
+
|
|
1264
1430
|
}
|
|
1265
1431
|
|
|
1266
1432
|
const createHttpRequest = (body: string = '{}', headers: object = {}, signal: AbortSignal | null = null): object => {
|
|
1267
|
-
const reqHeaders: { [key: string]: string } = {
|
|
1268
|
-
...headers,
|
|
1269
|
-
'Content-Type': 'application/json',
|
|
1270
|
-
[WebrpcHeader]: WebrpcHeaderValue
|
|
1271
|
-
}
|
|
1433
|
+
const reqHeaders: { [key: string]: string } = { ...headers, 'Content-Type': 'application/json', [WebrpcHeader]: WebrpcHeaderValue }
|
|
1272
1434
|
return { method: 'POST', headers: reqHeaders, body, signal }
|
|
1273
1435
|
}
|
|
1274
1436
|
|
|
@@ -1277,14 +1439,14 @@ const buildResponse = (res: Response): Promise<any> => {
|
|
|
1277
1439
|
let data
|
|
1278
1440
|
try {
|
|
1279
1441
|
data = JSON.parse(text)
|
|
1280
|
-
} catch
|
|
1442
|
+
} catch(error) {
|
|
1281
1443
|
throw WebrpcBadResponseError.new({
|
|
1282
1444
|
status: res.status,
|
|
1283
|
-
cause: `JSON.parse(): ${error instanceof Error ? error.message : String(error)}: response text: ${text}`
|
|
1284
|
-
|
|
1445
|
+
cause: `JSON.parse(): ${error instanceof Error ? error.message : String(error)}: response text: ${text}`},
|
|
1446
|
+
)
|
|
1285
1447
|
}
|
|
1286
1448
|
if (!res.ok) {
|
|
1287
|
-
const code: number = typeof data.code === 'number' ? data.code : 0
|
|
1449
|
+
const code: number = (typeof data.code === 'number') ? data.code : 0
|
|
1288
1450
|
throw (webrpcErrorByCode[code] || WebrpcError).new(data)
|
|
1289
1451
|
}
|
|
1290
1452
|
return data
|
|
@@ -1293,12 +1455,17 @@ const buildResponse = (res: Response): Promise<any> => {
|
|
|
1293
1455
|
|
|
1294
1456
|
export type Fetch = (input: RequestInfo, init?: RequestInit) => Promise<Response>
|
|
1295
1457
|
|
|
1458
|
+
|
|
1459
|
+
|
|
1460
|
+
|
|
1461
|
+
|
|
1296
1462
|
//
|
|
1297
1463
|
// BigInt helpers
|
|
1298
1464
|
//
|
|
1299
1465
|
|
|
1300
1466
|
const BIG_INT_FIELDS: { [typ: string]: (string | [string, string])[] } = {
|
|
1301
1467
|
SendMetaTxnArgs: [['preconditions', 'TransactionPrecondition[]']],
|
|
1468
|
+
SendMetaTxnWithBridgeGasArgs: [['preconditions', 'TransactionPrecondition[]']],
|
|
1302
1469
|
TransactionPrecondition: ['minAmount'],
|
|
1303
1470
|
Transactions: [['preconditions', 'TransactionPrecondition[]']]
|
|
1304
1471
|
}
|
|
@@ -1338,11 +1505,7 @@ function decodeType(typ: string, obj: any): any {
|
|
|
1338
1505
|
for (let i = 0; i < arr.length; i++) {
|
|
1339
1506
|
const v = arr[i]
|
|
1340
1507
|
if (typeof v === 'string') {
|
|
1341
|
-
try {
|
|
1342
|
-
arr[i] = BigInt(v)
|
|
1343
|
-
} catch (e) {
|
|
1344
|
-
throw WebrpcBadResponseError.new({ cause: `Invalid bigint value for ${base}[${i}]: ${v}` })
|
|
1345
|
-
}
|
|
1508
|
+
try { arr[i] = BigInt(v) } catch (e) { throw WebrpcBadResponseError.new({ cause: `Invalid bigint value for ${base}[${i}]: ${v}` }) }
|
|
1346
1509
|
}
|
|
1347
1510
|
}
|
|
1348
1511
|
}
|
|
@@ -1350,11 +1513,7 @@ function decodeType(typ: string, obj: any): any {
|
|
|
1350
1513
|
}
|
|
1351
1514
|
const v = obj[d]
|
|
1352
1515
|
if (typeof v === 'string') {
|
|
1353
|
-
try {
|
|
1354
|
-
obj[d] = BigInt(v)
|
|
1355
|
-
} catch (e) {
|
|
1356
|
-
throw WebrpcBadResponseError.new({ cause: `Invalid bigint value for ${d}: ${v}` })
|
|
1357
|
-
}
|
|
1516
|
+
try { obj[d] = BigInt(v) } catch (e) { throw WebrpcBadResponseError.new({ cause: `Invalid bigint value for ${d}: ${v}` }) }
|
|
1358
1517
|
}
|
|
1359
1518
|
}
|
|
1360
1519
|
return obj
|
|
@@ -1362,27 +1521,28 @@ function decodeType(typ: string, obj: any): any {
|
|
|
1362
1521
|
|
|
1363
1522
|
// Encode object to JSON with BigInts converted to decimal strings.
|
|
1364
1523
|
export const JsonEncode = <T = any>(obj: T): string => {
|
|
1365
|
-
return JSON.stringify(obj, (key, value) =>
|
|
1524
|
+
return JSON.stringify(obj, (key, value) =>
|
|
1525
|
+
typeof value === 'bigint' ? value.toString() : value
|
|
1526
|
+
)
|
|
1366
1527
|
}
|
|
1367
1528
|
|
|
1368
1529
|
// Decode data (JSON string or already-parsed object) and convert declared BigInt string fields back to BigInt.
|
|
1369
1530
|
export const JsonDecode = <T = any>(data: string | any, typ: string = ''): T => {
|
|
1370
1531
|
let parsed: any = data
|
|
1371
1532
|
if (typeof data === 'string') {
|
|
1372
|
-
try {
|
|
1373
|
-
parsed = JSON.parse(data)
|
|
1374
|
-
} catch (err) {
|
|
1533
|
+
try { parsed = JSON.parse(data) } catch (err) {
|
|
1375
1534
|
throw WebrpcBadResponseError.new({ cause: `JsonDecode: JSON.parse failed: ${(err as Error).message}` })
|
|
1376
1535
|
}
|
|
1377
1536
|
}
|
|
1378
1537
|
return decodeType(typ, parsed) as T
|
|
1379
1538
|
}
|
|
1380
1539
|
|
|
1540
|
+
|
|
1381
1541
|
//
|
|
1382
1542
|
// Errors
|
|
1383
1543
|
//
|
|
1384
1544
|
|
|
1385
|
-
type WebrpcErrorParams = { name?: string
|
|
1545
|
+
type WebrpcErrorParams = { name?: string, code?: number, message?: string, status?: number, cause?: string }
|
|
1386
1546
|
|
|
1387
1547
|
export class WebrpcError extends Error {
|
|
1388
1548
|
code: number
|
|
@@ -1403,6 +1563,7 @@ export class WebrpcError extends Error {
|
|
|
1403
1563
|
}
|
|
1404
1564
|
}
|
|
1405
1565
|
|
|
1566
|
+
|
|
1406
1567
|
export class WebrpcEndpointError extends WebrpcError {
|
|
1407
1568
|
constructor(error: WebrpcErrorParams = {}) {
|
|
1408
1569
|
super(error)
|
|
@@ -1535,6 +1696,7 @@ export class WebrpcStreamFinishedError extends WebrpcError {
|
|
|
1535
1696
|
}
|
|
1536
1697
|
}
|
|
1537
1698
|
|
|
1699
|
+
|
|
1538
1700
|
//
|
|
1539
1701
|
// Schema errors
|
|
1540
1702
|
//
|
|
@@ -1665,7 +1827,7 @@ export class AccessKeyMismatchError extends WebrpcError {
|
|
|
1665
1827
|
this.name = error.name || 'AccessKeyMismatch'
|
|
1666
1828
|
this.code = typeof error.code === 'number' ? error.code : 1102
|
|
1667
1829
|
this.message = error.message || `Access key mismatch`
|
|
1668
|
-
this.status = typeof error.status === 'number' ? error.status :
|
|
1830
|
+
this.status = typeof error.status === 'number' ? error.status : 403
|
|
1669
1831
|
if (error.cause !== undefined) this.cause = error.cause
|
|
1670
1832
|
Object.setPrototypeOf(this, AccessKeyMismatchError.prototype)
|
|
1671
1833
|
}
|
|
@@ -1707,6 +1869,18 @@ export class UnauthorizedUserError extends WebrpcError {
|
|
|
1707
1869
|
}
|
|
1708
1870
|
}
|
|
1709
1871
|
|
|
1872
|
+
export class InvalidChainError extends WebrpcError {
|
|
1873
|
+
constructor(error: WebrpcErrorParams = {}) {
|
|
1874
|
+
super(error)
|
|
1875
|
+
this.name = error.name || 'InvalidChain'
|
|
1876
|
+
this.code = typeof error.code === 'number' ? error.code : 1106
|
|
1877
|
+
this.message = error.message || `Network not enabled for Access key`
|
|
1878
|
+
this.status = typeof error.status === 'number' ? error.status : 403
|
|
1879
|
+
if (error.cause !== undefined) this.cause = error.cause
|
|
1880
|
+
Object.setPrototypeOf(this, InvalidChainError.prototype)
|
|
1881
|
+
}
|
|
1882
|
+
}
|
|
1883
|
+
|
|
1710
1884
|
export class QuotaExceededError extends WebrpcError {
|
|
1711
1885
|
constructor(error: WebrpcErrorParams = {}) {
|
|
1712
1886
|
super(error)
|
|
@@ -1863,6 +2037,7 @@ export class SimulationFailedError extends WebrpcError {
|
|
|
1863
2037
|
}
|
|
1864
2038
|
}
|
|
1865
2039
|
|
|
2040
|
+
|
|
1866
2041
|
export enum errors {
|
|
1867
2042
|
WebrpcEndpoint = 'WebrpcEndpoint',
|
|
1868
2043
|
WebrpcRequestFailed = 'WebrpcRequestFailed',
|
|
@@ -1889,6 +2064,7 @@ export enum errors {
|
|
|
1889
2064
|
InvalidOrigin = 'InvalidOrigin',
|
|
1890
2065
|
InvalidService = 'InvalidService',
|
|
1891
2066
|
UnauthorizedUser = 'UnauthorizedUser',
|
|
2067
|
+
InvalidChain = 'InvalidChain',
|
|
1892
2068
|
QuotaExceeded = 'QuotaExceeded',
|
|
1893
2069
|
QuotaRateLimit = 'QuotaRateLimit',
|
|
1894
2070
|
NoDefaultKey = 'NoDefaultKey',
|
|
@@ -1901,7 +2077,7 @@ export enum errors {
|
|
|
1901
2077
|
NotFound = 'NotFound',
|
|
1902
2078
|
InsufficientFee = 'InsufficientFee',
|
|
1903
2079
|
NotEnoughBalance = 'NotEnoughBalance',
|
|
1904
|
-
SimulationFailed = 'SimulationFailed'
|
|
2080
|
+
SimulationFailed = 'SimulationFailed',
|
|
1905
2081
|
}
|
|
1906
2082
|
|
|
1907
2083
|
export enum WebrpcErrorCodes {
|
|
@@ -1930,6 +2106,7 @@ export enum WebrpcErrorCodes {
|
|
|
1930
2106
|
InvalidOrigin = 1103,
|
|
1931
2107
|
InvalidService = 1104,
|
|
1932
2108
|
UnauthorizedUser = 1105,
|
|
2109
|
+
InvalidChain = 1106,
|
|
1933
2110
|
QuotaExceeded = 1200,
|
|
1934
2111
|
QuotaRateLimit = 1201,
|
|
1935
2112
|
NoDefaultKey = 1300,
|
|
@@ -1942,7 +2119,7 @@ export enum WebrpcErrorCodes {
|
|
|
1942
2119
|
NotFound = 3000,
|
|
1943
2120
|
InsufficientFee = 3004,
|
|
1944
2121
|
NotEnoughBalance = 3005,
|
|
1945
|
-
SimulationFailed = 3006
|
|
2122
|
+
SimulationFailed = 3006,
|
|
1946
2123
|
}
|
|
1947
2124
|
|
|
1948
2125
|
export const webrpcErrorByCode: { [code: number]: any } = {
|
|
@@ -1971,6 +2148,7 @@ export const webrpcErrorByCode: { [code: number]: any } = {
|
|
|
1971
2148
|
[1103]: InvalidOriginError,
|
|
1972
2149
|
[1104]: InvalidServiceError,
|
|
1973
2150
|
[1105]: UnauthorizedUserError,
|
|
2151
|
+
[1106]: InvalidChainError,
|
|
1974
2152
|
[1200]: QuotaExceededError,
|
|
1975
2153
|
[1201]: QuotaRateLimitError,
|
|
1976
2154
|
[1300]: NoDefaultKeyError,
|
|
@@ -1983,61 +2161,64 @@ export const webrpcErrorByCode: { [code: number]: any } = {
|
|
|
1983
2161
|
[3000]: NotFoundError,
|
|
1984
2162
|
[3004]: InsufficientFeeError,
|
|
1985
2163
|
[3005]: NotEnoughBalanceError,
|
|
1986
|
-
[3006]: SimulationFailedError
|
|
2164
|
+
[3006]: SimulationFailedError,
|
|
1987
2165
|
}
|
|
1988
2166
|
|
|
2167
|
+
|
|
2168
|
+
|
|
1989
2169
|
//
|
|
1990
2170
|
// Webrpc
|
|
1991
2171
|
//
|
|
1992
2172
|
|
|
1993
|
-
export const WebrpcHeader =
|
|
2173
|
+
export const WebrpcHeader = "Webrpc"
|
|
1994
2174
|
|
|
1995
|
-
export const WebrpcHeaderValue =
|
|
2175
|
+
export const WebrpcHeaderValue = "webrpc@v0.32.2;gen-typescript@v0.23.1;sequence-relayer@v0.4.1"
|
|
1996
2176
|
|
|
1997
2177
|
type WebrpcGenVersions = {
|
|
1998
|
-
WebrpcGenVersion: string
|
|
1999
|
-
codeGenName: string
|
|
2000
|
-
codeGenVersion: string
|
|
2001
|
-
schemaName: string
|
|
2002
|
-
schemaVersion: string
|
|
2003
|
-
}
|
|
2178
|
+
WebrpcGenVersion: string;
|
|
2179
|
+
codeGenName: string;
|
|
2180
|
+
codeGenVersion: string;
|
|
2181
|
+
schemaName: string;
|
|
2182
|
+
schemaVersion: string;
|
|
2183
|
+
};
|
|
2004
2184
|
|
|
2005
2185
|
export function VersionFromHeader(headers: Headers): WebrpcGenVersions {
|
|
2006
2186
|
const headerValue = headers.get(WebrpcHeader)
|
|
2007
2187
|
if (!headerValue) {
|
|
2008
2188
|
return {
|
|
2009
|
-
WebrpcGenVersion:
|
|
2010
|
-
codeGenName:
|
|
2011
|
-
codeGenVersion:
|
|
2012
|
-
schemaName:
|
|
2013
|
-
schemaVersion:
|
|
2014
|
-
}
|
|
2189
|
+
WebrpcGenVersion: "",
|
|
2190
|
+
codeGenName: "",
|
|
2191
|
+
codeGenVersion: "",
|
|
2192
|
+
schemaName: "",
|
|
2193
|
+
schemaVersion: "",
|
|
2194
|
+
};
|
|
2015
2195
|
}
|
|
2016
2196
|
|
|
2017
2197
|
return parseWebrpcGenVersions(headerValue)
|
|
2018
2198
|
}
|
|
2019
2199
|
|
|
2020
2200
|
function parseWebrpcGenVersions(header: string): WebrpcGenVersions {
|
|
2021
|
-
const versions = header.split(
|
|
2201
|
+
const versions = header.split(";")
|
|
2022
2202
|
if (versions.length < 3) {
|
|
2023
2203
|
return {
|
|
2024
|
-
WebrpcGenVersion:
|
|
2025
|
-
codeGenName:
|
|
2026
|
-
codeGenVersion:
|
|
2027
|
-
schemaName:
|
|
2028
|
-
schemaVersion:
|
|
2029
|
-
}
|
|
2204
|
+
WebrpcGenVersion: "",
|
|
2205
|
+
codeGenName: "",
|
|
2206
|
+
codeGenVersion: "",
|
|
2207
|
+
schemaName: "",
|
|
2208
|
+
schemaVersion: "",
|
|
2209
|
+
};
|
|
2030
2210
|
}
|
|
2031
2211
|
|
|
2032
|
-
const [_, WebrpcGenVersion] = versions[0]!.split(
|
|
2033
|
-
const [codeGenName, codeGenVersion] = versions[1]!.split(
|
|
2034
|
-
const [schemaName, schemaVersion] = versions[2]!.split(
|
|
2212
|
+
const [_, WebrpcGenVersion] = versions[0]!.split("@")
|
|
2213
|
+
const [codeGenName, codeGenVersion] = versions[1]!.split("@")
|
|
2214
|
+
const [schemaName, schemaVersion] = versions[2]!.split("@")
|
|
2035
2215
|
|
|
2036
2216
|
return {
|
|
2037
|
-
WebrpcGenVersion: WebrpcGenVersion ??
|
|
2038
|
-
codeGenName: codeGenName ??
|
|
2039
|
-
codeGenVersion: codeGenVersion ??
|
|
2040
|
-
schemaName: schemaName ??
|
|
2041
|
-
schemaVersion: schemaVersion ??
|
|
2042
|
-
}
|
|
2217
|
+
WebrpcGenVersion: WebrpcGenVersion ?? "",
|
|
2218
|
+
codeGenName: codeGenName ?? "",
|
|
2219
|
+
codeGenVersion: codeGenVersion ?? "",
|
|
2220
|
+
schemaName: schemaName ?? "",
|
|
2221
|
+
schemaVersion: schemaVersion ?? "",
|
|
2222
|
+
};
|
|
2043
2223
|
}
|
|
2224
|
+
|