@0xsequence/relayer 2.3.9 → 2.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,75 +1,76 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
|
-
// sequence-relayer v0.4.1
|
|
2
|
+
// sequence-relayer v0.4.1 fdce30970483936652aaeabaf9339a302ac52d32
|
|
3
3
|
// --
|
|
4
4
|
// Code generated by webrpc-gen@v0.24.0 with typescript generator. DO NOT EDIT.
|
|
5
5
|
//
|
|
6
6
|
// webrpc-gen -schema=relayer.ridl -target=typescript -client -out=./clients/relayer.gen.ts
|
|
7
7
|
|
|
8
|
-
export const WebrpcHeader =
|
|
8
|
+
export const WebrpcHeader = "Webrpc"
|
|
9
9
|
|
|
10
|
-
export const WebrpcHeaderValue =
|
|
10
|
+
export const WebrpcHeaderValue = "webrpc@v0.24.0;gen-typescript@v0.16.3;sequence-relayer@v0.4.1"
|
|
11
11
|
|
|
12
12
|
// WebRPC description and code-gen version
|
|
13
|
-
export const WebRPCVersion =
|
|
13
|
+
export const WebRPCVersion = "v1"
|
|
14
14
|
|
|
15
15
|
// Schema version of your RIDL schema
|
|
16
|
-
export const WebRPCSchemaVersion =
|
|
16
|
+
export const WebRPCSchemaVersion = "v0.4.1"
|
|
17
17
|
|
|
18
18
|
// Schema hash generated from your RIDL schema
|
|
19
|
-
export const WebRPCSchemaHash =
|
|
19
|
+
export const WebRPCSchemaHash = "fdce30970483936652aaeabaf9339a302ac52d32"
|
|
20
20
|
|
|
21
21
|
type WebrpcGenVersions = {
|
|
22
|
-
webrpcGenVersion: string
|
|
23
|
-
codeGenName: string
|
|
24
|
-
codeGenVersion: string
|
|
25
|
-
schemaName: string
|
|
26
|
-
schemaVersion: string
|
|
27
|
-
}
|
|
22
|
+
webrpcGenVersion: string;
|
|
23
|
+
codeGenName: string;
|
|
24
|
+
codeGenVersion: string;
|
|
25
|
+
schemaName: string;
|
|
26
|
+
schemaVersion: string;
|
|
27
|
+
};
|
|
28
28
|
|
|
29
29
|
export function VersionFromHeader(headers: Headers): WebrpcGenVersions {
|
|
30
|
-
const headerValue = headers.get(WebrpcHeader)
|
|
30
|
+
const headerValue = headers.get(WebrpcHeader);
|
|
31
31
|
if (!headerValue) {
|
|
32
32
|
return {
|
|
33
|
-
webrpcGenVersion:
|
|
34
|
-
codeGenName:
|
|
35
|
-
codeGenVersion:
|
|
36
|
-
schemaName:
|
|
37
|
-
schemaVersion:
|
|
38
|
-
}
|
|
33
|
+
webrpcGenVersion: "",
|
|
34
|
+
codeGenName: "",
|
|
35
|
+
codeGenVersion: "",
|
|
36
|
+
schemaName: "",
|
|
37
|
+
schemaVersion: "",
|
|
38
|
+
};
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
return parseWebrpcGenVersions(headerValue)
|
|
41
|
+
return parseWebrpcGenVersions(headerValue);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
function parseWebrpcGenVersions(header: string): WebrpcGenVersions {
|
|
45
|
-
const versions = header.split(
|
|
45
|
+
const versions = header.split(";");
|
|
46
46
|
if (versions.length < 3) {
|
|
47
47
|
return {
|
|
48
|
-
webrpcGenVersion:
|
|
49
|
-
codeGenName:
|
|
50
|
-
codeGenVersion:
|
|
51
|
-
schemaName:
|
|
52
|
-
schemaVersion:
|
|
53
|
-
}
|
|
48
|
+
webrpcGenVersion: "",
|
|
49
|
+
codeGenName: "",
|
|
50
|
+
codeGenVersion: "",
|
|
51
|
+
schemaName: "",
|
|
52
|
+
schemaVersion: "",
|
|
53
|
+
};
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
const [_, webrpcGenVersion] = versions[0]!.split(
|
|
57
|
-
const [codeGenName, codeGenVersion] = versions[1]!.split(
|
|
58
|
-
const [schemaName, schemaVersion] = versions[2]!.split(
|
|
56
|
+
const [_, webrpcGenVersion] = versions[0]!.split("@");
|
|
57
|
+
const [codeGenName, codeGenVersion] = versions[1]!.split("@");
|
|
58
|
+
const [schemaName, schemaVersion] = versions[2]!.split("@");
|
|
59
59
|
|
|
60
60
|
return {
|
|
61
|
-
webrpcGenVersion: webrpcGenVersion ??
|
|
62
|
-
codeGenName: codeGenName ??
|
|
63
|
-
codeGenVersion: codeGenVersion ??
|
|
64
|
-
schemaName: schemaName ??
|
|
65
|
-
schemaVersion: schemaVersion ??
|
|
66
|
-
}
|
|
61
|
+
webrpcGenVersion: webrpcGenVersion ?? "",
|
|
62
|
+
codeGenName: codeGenName ?? "",
|
|
63
|
+
codeGenVersion: codeGenVersion ?? "",
|
|
64
|
+
schemaName: schemaName ?? "",
|
|
65
|
+
schemaVersion: schemaVersion ?? "",
|
|
66
|
+
};
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
//
|
|
70
70
|
// Types
|
|
71
71
|
//
|
|
72
72
|
|
|
73
|
+
|
|
73
74
|
export enum ETHTxnStatus {
|
|
74
75
|
UNKNOWN = 'UNKNOWN',
|
|
75
76
|
DROPPED = 'DROPPED',
|
|
@@ -127,7 +128,8 @@ export interface SenderStatus {
|
|
|
127
128
|
active: boolean
|
|
128
129
|
}
|
|
129
130
|
|
|
130
|
-
export interface RuntimeChecks {
|
|
131
|
+
export interface RuntimeChecks {
|
|
132
|
+
}
|
|
131
133
|
|
|
132
134
|
export interface SequenceContext {
|
|
133
135
|
factory: string
|
|
@@ -203,8 +205,8 @@ export interface MetaTxnLog {
|
|
|
203
205
|
minedAt: string
|
|
204
206
|
target: string
|
|
205
207
|
input: string
|
|
206
|
-
txnArgs: {
|
|
207
|
-
txnReceipt?: {
|
|
208
|
+
txnArgs: {[key: string]: any}
|
|
209
|
+
txnReceipt?: {[key: string]: any}
|
|
208
210
|
walletAddress: string
|
|
209
211
|
metaTxnNonce: string
|
|
210
212
|
gasLimit: number
|
|
@@ -244,7 +246,7 @@ export interface Transaction {
|
|
|
244
246
|
chainId: number
|
|
245
247
|
metaTxnID?: string
|
|
246
248
|
transfers?: Array<TxnLogTransfer>
|
|
247
|
-
users?: {
|
|
249
|
+
users?: {[key: string]: TxnLogUser}
|
|
248
250
|
timestamp: string
|
|
249
251
|
}
|
|
250
252
|
|
|
@@ -319,18 +321,10 @@ export interface Relayer {
|
|
|
319
321
|
getMetaTxnNonce(args: GetMetaTxnNonceArgs, headers?: object, signal?: AbortSignal): Promise<GetMetaTxnNonceReturn>
|
|
320
322
|
getMetaTxnReceipt(args: GetMetaTxnReceiptArgs, headers?: object, signal?: AbortSignal): Promise<GetMetaTxnReceiptReturn>
|
|
321
323
|
simulate(args: SimulateArgs, headers?: object, signal?: AbortSignal): Promise<SimulateReturn>
|
|
322
|
-
updateMetaTxnGasLimits(
|
|
323
|
-
args: UpdateMetaTxnGasLimitsArgs,
|
|
324
|
-
headers?: object,
|
|
325
|
-
signal?: AbortSignal
|
|
326
|
-
): Promise<UpdateMetaTxnGasLimitsReturn>
|
|
324
|
+
updateMetaTxnGasLimits(args: UpdateMetaTxnGasLimitsArgs, headers?: object, signal?: AbortSignal): Promise<UpdateMetaTxnGasLimitsReturn>
|
|
327
325
|
feeTokens(headers?: object, signal?: AbortSignal): Promise<FeeTokensReturn>
|
|
328
326
|
feeOptions(args: FeeOptionsArgs, headers?: object, signal?: AbortSignal): Promise<FeeOptionsReturn>
|
|
329
|
-
getMetaTxnNetworkFeeOptions(
|
|
330
|
-
args: GetMetaTxnNetworkFeeOptionsArgs,
|
|
331
|
-
headers?: object,
|
|
332
|
-
signal?: AbortSignal
|
|
333
|
-
): Promise<GetMetaTxnNetworkFeeOptionsReturn>
|
|
327
|
+
getMetaTxnNetworkFeeOptions(args: GetMetaTxnNetworkFeeOptionsArgs, headers?: object, signal?: AbortSignal): Promise<GetMetaTxnNetworkFeeOptionsReturn>
|
|
334
328
|
getMetaTransactions(args: GetMetaTransactionsArgs, headers?: object, signal?: AbortSignal): Promise<GetMetaTransactionsReturn>
|
|
335
329
|
getTransactionCost(args: GetTransactionCostArgs, headers?: object, signal?: AbortSignal): Promise<GetTransactionCostReturn>
|
|
336
330
|
sentTransactions(args: SentTransactionsArgs, headers?: object, signal?: AbortSignal): Promise<SentTransactionsReturn>
|
|
@@ -338,26 +332,10 @@ export interface Relayer {
|
|
|
338
332
|
getGasTank(args: GetGasTankArgs, headers?: object, signal?: AbortSignal): Promise<GetGasTankReturn>
|
|
339
333
|
addGasTank(args: AddGasTankArgs, headers?: object, signal?: AbortSignal): Promise<AddGasTankReturn>
|
|
340
334
|
updateGasTank(args: UpdateGasTankArgs, headers?: object, signal?: AbortSignal): Promise<UpdateGasTankReturn>
|
|
341
|
-
nextGasTankBalanceAdjustmentNonce(
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
): Promise<NextGasTankBalanceAdjustmentNonceReturn>
|
|
346
|
-
adjustGasTankBalance(
|
|
347
|
-
args: AdjustGasTankBalanceArgs,
|
|
348
|
-
headers?: object,
|
|
349
|
-
signal?: AbortSignal
|
|
350
|
-
): Promise<AdjustGasTankBalanceReturn>
|
|
351
|
-
getGasTankBalanceAdjustment(
|
|
352
|
-
args: GetGasTankBalanceAdjustmentArgs,
|
|
353
|
-
headers?: object,
|
|
354
|
-
signal?: AbortSignal
|
|
355
|
-
): Promise<GetGasTankBalanceAdjustmentReturn>
|
|
356
|
-
listGasTankBalanceAdjustments(
|
|
357
|
-
args: ListGasTankBalanceAdjustmentsArgs,
|
|
358
|
-
headers?: object,
|
|
359
|
-
signal?: AbortSignal
|
|
360
|
-
): Promise<ListGasTankBalanceAdjustmentsReturn>
|
|
335
|
+
nextGasTankBalanceAdjustmentNonce(args: NextGasTankBalanceAdjustmentNonceArgs, headers?: object, signal?: AbortSignal): Promise<NextGasTankBalanceAdjustmentNonceReturn>
|
|
336
|
+
adjustGasTankBalance(args: AdjustGasTankBalanceArgs, headers?: object, signal?: AbortSignal): Promise<AdjustGasTankBalanceReturn>
|
|
337
|
+
getGasTankBalanceAdjustment(args: GetGasTankBalanceAdjustmentArgs, headers?: object, signal?: AbortSignal): Promise<GetGasTankBalanceAdjustmentReturn>
|
|
338
|
+
listGasTankBalanceAdjustments(args: ListGasTankBalanceAdjustmentsArgs, headers?: object, signal?: AbortSignal): Promise<ListGasTankBalanceAdjustmentsReturn>
|
|
361
339
|
listGasSponsors(args: ListGasSponsorsArgs, headers?: object, signal?: AbortSignal): Promise<ListGasSponsorsReturn>
|
|
362
340
|
getGasSponsor(args: GetGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise<GetGasSponsorReturn>
|
|
363
341
|
addGasSponsor(args: AddGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise<AddGasSponsorReturn>
|
|
@@ -365,37 +343,38 @@ export interface Relayer {
|
|
|
365
343
|
removeGasSponsor(args: RemoveGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise<RemoveGasSponsorReturn>
|
|
366
344
|
addressGasSponsors(args: AddressGasSponsorsArgs, headers?: object, signal?: AbortSignal): Promise<AddressGasSponsorsReturn>
|
|
367
345
|
getProjectBalance(args: GetProjectBalanceArgs, headers?: object, signal?: AbortSignal): Promise<GetProjectBalanceReturn>
|
|
368
|
-
adjustProjectBalance(
|
|
369
|
-
args: AdjustProjectBalanceArgs,
|
|
370
|
-
headers?: object,
|
|
371
|
-
signal?: AbortSignal
|
|
372
|
-
): Promise<AdjustProjectBalanceReturn>
|
|
346
|
+
adjustProjectBalance(args: AdjustProjectBalanceArgs, headers?: object, signal?: AbortSignal): Promise<AdjustProjectBalanceReturn>
|
|
373
347
|
}
|
|
374
348
|
|
|
375
|
-
export interface PingArgs {
|
|
349
|
+
export interface PingArgs {
|
|
350
|
+
}
|
|
376
351
|
|
|
377
352
|
export interface PingReturn {
|
|
378
|
-
status: boolean
|
|
353
|
+
status: boolean
|
|
354
|
+
}
|
|
355
|
+
export interface VersionArgs {
|
|
379
356
|
}
|
|
380
|
-
export interface VersionArgs {}
|
|
381
357
|
|
|
382
358
|
export interface VersionReturn {
|
|
383
|
-
version: Version
|
|
359
|
+
version: Version
|
|
360
|
+
}
|
|
361
|
+
export interface RuntimeStatusArgs {
|
|
384
362
|
}
|
|
385
|
-
export interface RuntimeStatusArgs {}
|
|
386
363
|
|
|
387
364
|
export interface RuntimeStatusReturn {
|
|
388
|
-
status: RuntimeStatus
|
|
365
|
+
status: RuntimeStatus
|
|
366
|
+
}
|
|
367
|
+
export interface GetSequenceContextArgs {
|
|
389
368
|
}
|
|
390
|
-
export interface GetSequenceContextArgs {}
|
|
391
369
|
|
|
392
370
|
export interface GetSequenceContextReturn {
|
|
393
|
-
data: SequenceContext
|
|
371
|
+
data: SequenceContext
|
|
372
|
+
}
|
|
373
|
+
export interface GetChainIDArgs {
|
|
394
374
|
}
|
|
395
|
-
export interface GetChainIDArgs {}
|
|
396
375
|
|
|
397
376
|
export interface GetChainIDReturn {
|
|
398
|
-
chainID: number
|
|
377
|
+
chainID: number
|
|
399
378
|
}
|
|
400
379
|
export interface SendMetaTxnArgs {
|
|
401
380
|
call: MetaTxn
|
|
@@ -405,7 +384,7 @@ export interface SendMetaTxnArgs {
|
|
|
405
384
|
|
|
406
385
|
export interface SendMetaTxnReturn {
|
|
407
386
|
status: boolean
|
|
408
|
-
txnHash: string
|
|
387
|
+
txnHash: string
|
|
409
388
|
}
|
|
410
389
|
export interface GetMetaTxnNonceArgs {
|
|
411
390
|
walletContractAddress: string
|
|
@@ -413,14 +392,14 @@ export interface GetMetaTxnNonceArgs {
|
|
|
413
392
|
}
|
|
414
393
|
|
|
415
394
|
export interface GetMetaTxnNonceReturn {
|
|
416
|
-
nonce: string
|
|
395
|
+
nonce: string
|
|
417
396
|
}
|
|
418
397
|
export interface GetMetaTxnReceiptArgs {
|
|
419
398
|
metaTxID: string
|
|
420
399
|
}
|
|
421
400
|
|
|
422
401
|
export interface GetMetaTxnReceiptReturn {
|
|
423
|
-
receipt: MetaTxnReceipt
|
|
402
|
+
receipt: MetaTxnReceipt
|
|
424
403
|
}
|
|
425
404
|
export interface SimulateArgs {
|
|
426
405
|
wallet: string
|
|
@@ -428,7 +407,7 @@ export interface SimulateArgs {
|
|
|
428
407
|
}
|
|
429
408
|
|
|
430
409
|
export interface SimulateReturn {
|
|
431
|
-
results: Array<SimulateResult>
|
|
410
|
+
results: Array<SimulateResult>
|
|
432
411
|
}
|
|
433
412
|
export interface UpdateMetaTxnGasLimitsArgs {
|
|
434
413
|
walletAddress: string
|
|
@@ -437,13 +416,14 @@ export interface UpdateMetaTxnGasLimitsArgs {
|
|
|
437
416
|
}
|
|
438
417
|
|
|
439
418
|
export interface UpdateMetaTxnGasLimitsReturn {
|
|
440
|
-
payload: string
|
|
419
|
+
payload: string
|
|
420
|
+
}
|
|
421
|
+
export interface FeeTokensArgs {
|
|
441
422
|
}
|
|
442
|
-
export interface FeeTokensArgs {}
|
|
443
423
|
|
|
444
424
|
export interface FeeTokensReturn {
|
|
445
425
|
isFeeRequired: boolean
|
|
446
|
-
tokens: Array<FeeToken>
|
|
426
|
+
tokens: Array<FeeToken>
|
|
447
427
|
}
|
|
448
428
|
export interface FeeOptionsArgs {
|
|
449
429
|
wallet: string
|
|
@@ -455,7 +435,7 @@ export interface FeeOptionsArgs {
|
|
|
455
435
|
export interface FeeOptionsReturn {
|
|
456
436
|
options: Array<FeeOption>
|
|
457
437
|
sponsored: boolean
|
|
458
|
-
quote?: string
|
|
438
|
+
quote?: string
|
|
459
439
|
}
|
|
460
440
|
export interface GetMetaTxnNetworkFeeOptionsArgs {
|
|
461
441
|
walletConfig: any
|
|
@@ -463,7 +443,7 @@ export interface GetMetaTxnNetworkFeeOptionsArgs {
|
|
|
463
443
|
}
|
|
464
444
|
|
|
465
445
|
export interface GetMetaTxnNetworkFeeOptionsReturn {
|
|
466
|
-
options: Array<FeeOption>
|
|
446
|
+
options: Array<FeeOption>
|
|
467
447
|
}
|
|
468
448
|
export interface GetMetaTransactionsArgs {
|
|
469
449
|
projectId: number
|
|
@@ -472,7 +452,7 @@ export interface GetMetaTransactionsArgs {
|
|
|
472
452
|
|
|
473
453
|
export interface GetMetaTransactionsReturn {
|
|
474
454
|
page: Page
|
|
475
|
-
transactions: Array<MetaTxnLog>
|
|
455
|
+
transactions: Array<MetaTxnLog>
|
|
476
456
|
}
|
|
477
457
|
export interface GetTransactionCostArgs {
|
|
478
458
|
projectId: number
|
|
@@ -481,7 +461,7 @@ export interface GetTransactionCostArgs {
|
|
|
481
461
|
}
|
|
482
462
|
|
|
483
463
|
export interface GetTransactionCostReturn {
|
|
484
|
-
cost: number
|
|
464
|
+
cost: number
|
|
485
465
|
}
|
|
486
466
|
export interface SentTransactionsArgs {
|
|
487
467
|
filter?: SentTransactionsFilter
|
|
@@ -490,7 +470,7 @@ export interface SentTransactionsArgs {
|
|
|
490
470
|
|
|
491
471
|
export interface SentTransactionsReturn {
|
|
492
472
|
page: Page
|
|
493
|
-
transactions: Array<Transaction>
|
|
473
|
+
transactions: Array<Transaction>
|
|
494
474
|
}
|
|
495
475
|
export interface PendingTransactionsArgs {
|
|
496
476
|
page?: Page
|
|
@@ -498,14 +478,14 @@ export interface PendingTransactionsArgs {
|
|
|
498
478
|
|
|
499
479
|
export interface PendingTransactionsReturn {
|
|
500
480
|
page: Page
|
|
501
|
-
transactions: Array<Transaction>
|
|
481
|
+
transactions: Array<Transaction>
|
|
502
482
|
}
|
|
503
483
|
export interface GetGasTankArgs {
|
|
504
484
|
id: number
|
|
505
485
|
}
|
|
506
486
|
|
|
507
487
|
export interface GetGasTankReturn {
|
|
508
|
-
gasTank: GasTank
|
|
488
|
+
gasTank: GasTank
|
|
509
489
|
}
|
|
510
490
|
export interface AddGasTankArgs {
|
|
511
491
|
name: string
|
|
@@ -515,7 +495,7 @@ export interface AddGasTankArgs {
|
|
|
515
495
|
|
|
516
496
|
export interface AddGasTankReturn {
|
|
517
497
|
status: boolean
|
|
518
|
-
gasTank: GasTank
|
|
498
|
+
gasTank: GasTank
|
|
519
499
|
}
|
|
520
500
|
export interface UpdateGasTankArgs {
|
|
521
501
|
id: number
|
|
@@ -526,14 +506,14 @@ export interface UpdateGasTankArgs {
|
|
|
526
506
|
|
|
527
507
|
export interface UpdateGasTankReturn {
|
|
528
508
|
status: boolean
|
|
529
|
-
gasTank: GasTank
|
|
509
|
+
gasTank: GasTank
|
|
530
510
|
}
|
|
531
511
|
export interface NextGasTankBalanceAdjustmentNonceArgs {
|
|
532
512
|
id: number
|
|
533
513
|
}
|
|
534
514
|
|
|
535
515
|
export interface NextGasTankBalanceAdjustmentNonceReturn {
|
|
536
|
-
nonce: number
|
|
516
|
+
nonce: number
|
|
537
517
|
}
|
|
538
518
|
export interface AdjustGasTankBalanceArgs {
|
|
539
519
|
id: number
|
|
@@ -543,7 +523,7 @@ export interface AdjustGasTankBalanceArgs {
|
|
|
543
523
|
|
|
544
524
|
export interface AdjustGasTankBalanceReturn {
|
|
545
525
|
status: boolean
|
|
546
|
-
adjustment: GasTankBalanceAdjustment
|
|
526
|
+
adjustment: GasTankBalanceAdjustment
|
|
547
527
|
}
|
|
548
528
|
export interface GetGasTankBalanceAdjustmentArgs {
|
|
549
529
|
id: number
|
|
@@ -551,7 +531,7 @@ export interface GetGasTankBalanceAdjustmentArgs {
|
|
|
551
531
|
}
|
|
552
532
|
|
|
553
533
|
export interface GetGasTankBalanceAdjustmentReturn {
|
|
554
|
-
adjustment: GasTankBalanceAdjustment
|
|
534
|
+
adjustment: GasTankBalanceAdjustment
|
|
555
535
|
}
|
|
556
536
|
export interface ListGasTankBalanceAdjustmentsArgs {
|
|
557
537
|
id: number
|
|
@@ -560,7 +540,7 @@ export interface ListGasTankBalanceAdjustmentsArgs {
|
|
|
560
540
|
|
|
561
541
|
export interface ListGasTankBalanceAdjustmentsReturn {
|
|
562
542
|
page: Page
|
|
563
|
-
adjustments: Array<GasTankBalanceAdjustment>
|
|
543
|
+
adjustments: Array<GasTankBalanceAdjustment>
|
|
564
544
|
}
|
|
565
545
|
export interface ListGasSponsorsArgs {
|
|
566
546
|
projectId: number
|
|
@@ -569,7 +549,7 @@ export interface ListGasSponsorsArgs {
|
|
|
569
549
|
|
|
570
550
|
export interface ListGasSponsorsReturn {
|
|
571
551
|
page: Page
|
|
572
|
-
gasSponsors: Array<GasSponsor>
|
|
552
|
+
gasSponsors: Array<GasSponsor>
|
|
573
553
|
}
|
|
574
554
|
export interface GetGasSponsorArgs {
|
|
575
555
|
projectId: number
|
|
@@ -577,7 +557,7 @@ export interface GetGasSponsorArgs {
|
|
|
577
557
|
}
|
|
578
558
|
|
|
579
559
|
export interface GetGasSponsorReturn {
|
|
580
|
-
gasSponsor: GasSponsor
|
|
560
|
+
gasSponsor: GasSponsor
|
|
581
561
|
}
|
|
582
562
|
export interface AddGasSponsorArgs {
|
|
583
563
|
projectId: number
|
|
@@ -588,7 +568,7 @@ export interface AddGasSponsorArgs {
|
|
|
588
568
|
|
|
589
569
|
export interface AddGasSponsorReturn {
|
|
590
570
|
status: boolean
|
|
591
|
-
gasSponsor: GasSponsor
|
|
571
|
+
gasSponsor: GasSponsor
|
|
592
572
|
}
|
|
593
573
|
export interface UpdateGasSponsorArgs {
|
|
594
574
|
projectId: number
|
|
@@ -599,7 +579,7 @@ export interface UpdateGasSponsorArgs {
|
|
|
599
579
|
|
|
600
580
|
export interface UpdateGasSponsorReturn {
|
|
601
581
|
status: boolean
|
|
602
|
-
gasSponsor: GasSponsor
|
|
582
|
+
gasSponsor: GasSponsor
|
|
603
583
|
}
|
|
604
584
|
export interface RemoveGasSponsorArgs {
|
|
605
585
|
projectId: number
|
|
@@ -607,7 +587,7 @@ export interface RemoveGasSponsorArgs {
|
|
|
607
587
|
}
|
|
608
588
|
|
|
609
589
|
export interface RemoveGasSponsorReturn {
|
|
610
|
-
status: boolean
|
|
590
|
+
status: boolean
|
|
611
591
|
}
|
|
612
592
|
export interface AddressGasSponsorsArgs {
|
|
613
593
|
address: string
|
|
@@ -616,14 +596,14 @@ export interface AddressGasSponsorsArgs {
|
|
|
616
596
|
|
|
617
597
|
export interface AddressGasSponsorsReturn {
|
|
618
598
|
page: Page
|
|
619
|
-
gasSponsors: Array<GasSponsor>
|
|
599
|
+
gasSponsors: Array<GasSponsor>
|
|
620
600
|
}
|
|
621
601
|
export interface GetProjectBalanceArgs {
|
|
622
602
|
projectId: number
|
|
623
603
|
}
|
|
624
604
|
|
|
625
605
|
export interface GetProjectBalanceReturn {
|
|
626
|
-
balance: number
|
|
606
|
+
balance: number
|
|
627
607
|
}
|
|
628
608
|
export interface AdjustProjectBalanceArgs {
|
|
629
609
|
projectId: number
|
|
@@ -632,9 +612,11 @@ export interface AdjustProjectBalanceArgs {
|
|
|
632
612
|
}
|
|
633
613
|
|
|
634
614
|
export interface AdjustProjectBalanceReturn {
|
|
635
|
-
balance: number
|
|
615
|
+
balance: number
|
|
636
616
|
}
|
|
637
617
|
|
|
618
|
+
|
|
619
|
+
|
|
638
620
|
//
|
|
639
621
|
// Client
|
|
640
622
|
//
|
|
@@ -651,549 +633,480 @@ export class Relayer implements Relayer {
|
|
|
651
633
|
private url(name: string): string {
|
|
652
634
|
return this.hostname + this.path + name
|
|
653
635
|
}
|
|
654
|
-
|
|
636
|
+
|
|
655
637
|
ping = (headers?: object, signal?: AbortSignal): Promise<PingReturn> => {
|
|
656
|
-
return this.fetch(
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
}
|
|
667
|
-
)
|
|
638
|
+
return this.fetch(
|
|
639
|
+
this.url('Ping'),
|
|
640
|
+
createHTTPRequest({}, headers, signal)
|
|
641
|
+
).then((res) => {
|
|
642
|
+
return buildResponse(res).then(_data => {
|
|
643
|
+
return {
|
|
644
|
+
status: <boolean>(_data.status),
|
|
645
|
+
}
|
|
646
|
+
})
|
|
647
|
+
}, (error) => {
|
|
648
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
649
|
+
})
|
|
668
650
|
}
|
|
669
|
-
|
|
651
|
+
|
|
670
652
|
version = (headers?: object, signal?: AbortSignal): Promise<VersionReturn> => {
|
|
671
|
-
return this.fetch(
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
}
|
|
682
|
-
)
|
|
653
|
+
return this.fetch(
|
|
654
|
+
this.url('Version'),
|
|
655
|
+
createHTTPRequest({}, headers, signal)
|
|
656
|
+
).then((res) => {
|
|
657
|
+
return buildResponse(res).then(_data => {
|
|
658
|
+
return {
|
|
659
|
+
version: <Version>(_data.version),
|
|
660
|
+
}
|
|
661
|
+
})
|
|
662
|
+
}, (error) => {
|
|
663
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
664
|
+
})
|
|
683
665
|
}
|
|
684
|
-
|
|
666
|
+
|
|
685
667
|
runtimeStatus = (headers?: object, signal?: AbortSignal): Promise<RuntimeStatusReturn> => {
|
|
686
|
-
return this.fetch(
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
}
|
|
697
|
-
)
|
|
668
|
+
return this.fetch(
|
|
669
|
+
this.url('RuntimeStatus'),
|
|
670
|
+
createHTTPRequest({}, headers, signal)
|
|
671
|
+
).then((res) => {
|
|
672
|
+
return buildResponse(res).then(_data => {
|
|
673
|
+
return {
|
|
674
|
+
status: <RuntimeStatus>(_data.status),
|
|
675
|
+
}
|
|
676
|
+
})
|
|
677
|
+
}, (error) => {
|
|
678
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
679
|
+
})
|
|
698
680
|
}
|
|
699
|
-
|
|
681
|
+
|
|
700
682
|
getSequenceContext = (headers?: object, signal?: AbortSignal): Promise<GetSequenceContextReturn> => {
|
|
701
|
-
return this.fetch(
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
}
|
|
712
|
-
)
|
|
683
|
+
return this.fetch(
|
|
684
|
+
this.url('GetSequenceContext'),
|
|
685
|
+
createHTTPRequest({}, headers, signal)
|
|
686
|
+
).then((res) => {
|
|
687
|
+
return buildResponse(res).then(_data => {
|
|
688
|
+
return {
|
|
689
|
+
data: <SequenceContext>(_data.data),
|
|
690
|
+
}
|
|
691
|
+
})
|
|
692
|
+
}, (error) => {
|
|
693
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
694
|
+
})
|
|
713
695
|
}
|
|
714
|
-
|
|
696
|
+
|
|
715
697
|
getChainID = (headers?: object, signal?: AbortSignal): Promise<GetChainIDReturn> => {
|
|
716
|
-
return this.fetch(
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
}
|
|
727
|
-
)
|
|
698
|
+
return this.fetch(
|
|
699
|
+
this.url('GetChainID'),
|
|
700
|
+
createHTTPRequest({}, headers, signal)
|
|
701
|
+
).then((res) => {
|
|
702
|
+
return buildResponse(res).then(_data => {
|
|
703
|
+
return {
|
|
704
|
+
chainID: <number>(_data.chainID),
|
|
705
|
+
}
|
|
706
|
+
})
|
|
707
|
+
}, (error) => {
|
|
708
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
709
|
+
})
|
|
728
710
|
}
|
|
729
|
-
|
|
711
|
+
|
|
730
712
|
sendMetaTxn = (args: SendMetaTxnArgs, headers?: object, signal?: AbortSignal): Promise<SendMetaTxnReturn> => {
|
|
731
|
-
return this.fetch(
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
)
|
|
713
|
+
return this.fetch(
|
|
714
|
+
this.url('SendMetaTxn'),
|
|
715
|
+
createHTTPRequest(args, headers, signal)).then((res) => {
|
|
716
|
+
return buildResponse(res).then(_data => {
|
|
717
|
+
return {
|
|
718
|
+
status: <boolean>(_data.status),
|
|
719
|
+
txnHash: <string>(_data.txnHash),
|
|
720
|
+
}
|
|
721
|
+
})
|
|
722
|
+
}, (error) => {
|
|
723
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
724
|
+
})
|
|
744
725
|
}
|
|
745
|
-
|
|
726
|
+
|
|
746
727
|
getMetaTxnNonce = (args: GetMetaTxnNonceArgs, headers?: object, signal?: AbortSignal): Promise<GetMetaTxnNonceReturn> => {
|
|
747
|
-
return this.fetch(
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
}
|
|
754
|
-
}
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
)
|
|
728
|
+
return this.fetch(
|
|
729
|
+
this.url('GetMetaTxnNonce'),
|
|
730
|
+
createHTTPRequest(args, headers, signal)).then((res) => {
|
|
731
|
+
return buildResponse(res).then(_data => {
|
|
732
|
+
return {
|
|
733
|
+
nonce: <string>(_data.nonce),
|
|
734
|
+
}
|
|
735
|
+
})
|
|
736
|
+
}, (error) => {
|
|
737
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
738
|
+
})
|
|
759
739
|
}
|
|
760
|
-
|
|
740
|
+
|
|
761
741
|
getMetaTxnReceipt = (args: GetMetaTxnReceiptArgs, headers?: object, signal?: AbortSignal): Promise<GetMetaTxnReceiptReturn> => {
|
|
762
|
-
return this.fetch(
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
}
|
|
769
|
-
}
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
)
|
|
742
|
+
return this.fetch(
|
|
743
|
+
this.url('GetMetaTxnReceipt'),
|
|
744
|
+
createHTTPRequest(args, headers, signal)).then((res) => {
|
|
745
|
+
return buildResponse(res).then(_data => {
|
|
746
|
+
return {
|
|
747
|
+
receipt: <MetaTxnReceipt>(_data.receipt),
|
|
748
|
+
}
|
|
749
|
+
})
|
|
750
|
+
}, (error) => {
|
|
751
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
752
|
+
})
|
|
774
753
|
}
|
|
775
|
-
|
|
754
|
+
|
|
776
755
|
simulate = (args: SimulateArgs, headers?: object, signal?: AbortSignal): Promise<SimulateReturn> => {
|
|
777
|
-
return this.fetch(
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
}
|
|
784
|
-
}
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
})
|
|
803
|
-
},
|
|
804
|
-
error => {
|
|
805
|
-
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
806
|
-
}
|
|
807
|
-
)
|
|
756
|
+
return this.fetch(
|
|
757
|
+
this.url('Simulate'),
|
|
758
|
+
createHTTPRequest(args, headers, signal)).then((res) => {
|
|
759
|
+
return buildResponse(res).then(_data => {
|
|
760
|
+
return {
|
|
761
|
+
results: <Array<SimulateResult>>(_data.results),
|
|
762
|
+
}
|
|
763
|
+
})
|
|
764
|
+
}, (error) => {
|
|
765
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
766
|
+
})
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
updateMetaTxnGasLimits = (args: UpdateMetaTxnGasLimitsArgs, headers?: object, signal?: AbortSignal): Promise<UpdateMetaTxnGasLimitsReturn> => {
|
|
770
|
+
return this.fetch(
|
|
771
|
+
this.url('UpdateMetaTxnGasLimits'),
|
|
772
|
+
createHTTPRequest(args, headers, signal)).then((res) => {
|
|
773
|
+
return buildResponse(res).then(_data => {
|
|
774
|
+
return {
|
|
775
|
+
payload: <string>(_data.payload),
|
|
776
|
+
}
|
|
777
|
+
})
|
|
778
|
+
}, (error) => {
|
|
779
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
780
|
+
})
|
|
808
781
|
}
|
|
809
|
-
|
|
782
|
+
|
|
810
783
|
feeTokens = (headers?: object, signal?: AbortSignal): Promise<FeeTokensReturn> => {
|
|
811
|
-
return this.fetch(
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
}
|
|
823
|
-
)
|
|
784
|
+
return this.fetch(
|
|
785
|
+
this.url('FeeTokens'),
|
|
786
|
+
createHTTPRequest({}, headers, signal)
|
|
787
|
+
).then((res) => {
|
|
788
|
+
return buildResponse(res).then(_data => {
|
|
789
|
+
return {
|
|
790
|
+
isFeeRequired: <boolean>(_data.isFeeRequired),
|
|
791
|
+
tokens: <Array<FeeToken>>(_data.tokens),
|
|
792
|
+
}
|
|
793
|
+
})
|
|
794
|
+
}, (error) => {
|
|
795
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
796
|
+
})
|
|
824
797
|
}
|
|
825
|
-
|
|
798
|
+
|
|
826
799
|
feeOptions = (args: FeeOptionsArgs, headers?: object, signal?: AbortSignal): Promise<FeeOptionsReturn> => {
|
|
827
|
-
return this.fetch(
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
}
|
|
836
|
-
}
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
args: GetTransactionCostArgs,
|
|
884
|
-
headers?: object,
|
|
885
|
-
signal?: AbortSignal
|
|
886
|
-
): Promise<GetTransactionCostReturn> => {
|
|
887
|
-
return this.fetch(this.url('GetTransactionCost'), createHTTPRequest(args, headers, signal)).then(
|
|
888
|
-
res => {
|
|
889
|
-
return buildResponse(res).then(_data => {
|
|
890
|
-
return {
|
|
891
|
-
cost: <number>_data.cost
|
|
892
|
-
}
|
|
893
|
-
})
|
|
894
|
-
},
|
|
895
|
-
error => {
|
|
896
|
-
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
897
|
-
}
|
|
898
|
-
)
|
|
800
|
+
return this.fetch(
|
|
801
|
+
this.url('FeeOptions'),
|
|
802
|
+
createHTTPRequest(args, headers, signal)).then((res) => {
|
|
803
|
+
return buildResponse(res).then(_data => {
|
|
804
|
+
return {
|
|
805
|
+
options: <Array<FeeOption>>(_data.options),
|
|
806
|
+
sponsored: <boolean>(_data.sponsored),
|
|
807
|
+
quote: <string>(_data.quote),
|
|
808
|
+
}
|
|
809
|
+
})
|
|
810
|
+
}, (error) => {
|
|
811
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
812
|
+
})
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
getMetaTxnNetworkFeeOptions = (args: GetMetaTxnNetworkFeeOptionsArgs, headers?: object, signal?: AbortSignal): Promise<GetMetaTxnNetworkFeeOptionsReturn> => {
|
|
816
|
+
return this.fetch(
|
|
817
|
+
this.url('GetMetaTxnNetworkFeeOptions'),
|
|
818
|
+
createHTTPRequest(args, headers, signal)).then((res) => {
|
|
819
|
+
return buildResponse(res).then(_data => {
|
|
820
|
+
return {
|
|
821
|
+
options: <Array<FeeOption>>(_data.options),
|
|
822
|
+
}
|
|
823
|
+
})
|
|
824
|
+
}, (error) => {
|
|
825
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
826
|
+
})
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
getMetaTransactions = (args: GetMetaTransactionsArgs, headers?: object, signal?: AbortSignal): Promise<GetMetaTransactionsReturn> => {
|
|
830
|
+
return this.fetch(
|
|
831
|
+
this.url('GetMetaTransactions'),
|
|
832
|
+
createHTTPRequest(args, headers, signal)).then((res) => {
|
|
833
|
+
return buildResponse(res).then(_data => {
|
|
834
|
+
return {
|
|
835
|
+
page: <Page>(_data.page),
|
|
836
|
+
transactions: <Array<MetaTxnLog>>(_data.transactions),
|
|
837
|
+
}
|
|
838
|
+
})
|
|
839
|
+
}, (error) => {
|
|
840
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
841
|
+
})
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
getTransactionCost = (args: GetTransactionCostArgs, headers?: object, signal?: AbortSignal): Promise<GetTransactionCostReturn> => {
|
|
845
|
+
return this.fetch(
|
|
846
|
+
this.url('GetTransactionCost'),
|
|
847
|
+
createHTTPRequest(args, headers, signal)).then((res) => {
|
|
848
|
+
return buildResponse(res).then(_data => {
|
|
849
|
+
return {
|
|
850
|
+
cost: <number>(_data.cost),
|
|
851
|
+
}
|
|
852
|
+
})
|
|
853
|
+
}, (error) => {
|
|
854
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
855
|
+
})
|
|
899
856
|
}
|
|
900
|
-
|
|
857
|
+
|
|
901
858
|
sentTransactions = (args: SentTransactionsArgs, headers?: object, signal?: AbortSignal): Promise<SentTransactionsReturn> => {
|
|
902
|
-
return this.fetch(
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
}
|
|
910
|
-
}
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
})
|
|
930
|
-
},
|
|
931
|
-
error => {
|
|
932
|
-
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
933
|
-
}
|
|
934
|
-
)
|
|
859
|
+
return this.fetch(
|
|
860
|
+
this.url('SentTransactions'),
|
|
861
|
+
createHTTPRequest(args, headers, signal)).then((res) => {
|
|
862
|
+
return buildResponse(res).then(_data => {
|
|
863
|
+
return {
|
|
864
|
+
page: <Page>(_data.page),
|
|
865
|
+
transactions: <Array<Transaction>>(_data.transactions),
|
|
866
|
+
}
|
|
867
|
+
})
|
|
868
|
+
}, (error) => {
|
|
869
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
870
|
+
})
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
pendingTransactions = (args: PendingTransactionsArgs, headers?: object, signal?: AbortSignal): Promise<PendingTransactionsReturn> => {
|
|
874
|
+
return this.fetch(
|
|
875
|
+
this.url('PendingTransactions'),
|
|
876
|
+
createHTTPRequest(args, headers, signal)).then((res) => {
|
|
877
|
+
return buildResponse(res).then(_data => {
|
|
878
|
+
return {
|
|
879
|
+
page: <Page>(_data.page),
|
|
880
|
+
transactions: <Array<Transaction>>(_data.transactions),
|
|
881
|
+
}
|
|
882
|
+
})
|
|
883
|
+
}, (error) => {
|
|
884
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
885
|
+
})
|
|
935
886
|
}
|
|
936
|
-
|
|
887
|
+
|
|
937
888
|
getGasTank = (args: GetGasTankArgs, headers?: object, signal?: AbortSignal): Promise<GetGasTankReturn> => {
|
|
938
|
-
return this.fetch(
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
}
|
|
945
|
-
}
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
)
|
|
889
|
+
return this.fetch(
|
|
890
|
+
this.url('GetGasTank'),
|
|
891
|
+
createHTTPRequest(args, headers, signal)).then((res) => {
|
|
892
|
+
return buildResponse(res).then(_data => {
|
|
893
|
+
return {
|
|
894
|
+
gasTank: <GasTank>(_data.gasTank),
|
|
895
|
+
}
|
|
896
|
+
})
|
|
897
|
+
}, (error) => {
|
|
898
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
899
|
+
})
|
|
950
900
|
}
|
|
951
|
-
|
|
901
|
+
|
|
952
902
|
addGasTank = (args: AddGasTankArgs, headers?: object, signal?: AbortSignal): Promise<AddGasTankReturn> => {
|
|
953
|
-
return this.fetch(
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
}
|
|
961
|
-
}
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
)
|
|
903
|
+
return this.fetch(
|
|
904
|
+
this.url('AddGasTank'),
|
|
905
|
+
createHTTPRequest(args, headers, signal)).then((res) => {
|
|
906
|
+
return buildResponse(res).then(_data => {
|
|
907
|
+
return {
|
|
908
|
+
status: <boolean>(_data.status),
|
|
909
|
+
gasTank: <GasTank>(_data.gasTank),
|
|
910
|
+
}
|
|
911
|
+
})
|
|
912
|
+
}, (error) => {
|
|
913
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
914
|
+
})
|
|
966
915
|
}
|
|
967
|
-
|
|
916
|
+
|
|
968
917
|
updateGasTank = (args: UpdateGasTankArgs, headers?: object, signal?: AbortSignal): Promise<UpdateGasTankReturn> => {
|
|
969
|
-
return this.fetch(
|
|
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
|
-
res => {
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
}
|
|
1035
|
-
}
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
)
|
|
1040
|
-
}
|
|
1041
|
-
|
|
1042
|
-
listGasTankBalanceAdjustments = (
|
|
1043
|
-
args: ListGasTankBalanceAdjustmentsArgs,
|
|
1044
|
-
headers?: object,
|
|
1045
|
-
signal?: AbortSignal
|
|
1046
|
-
): Promise<ListGasTankBalanceAdjustmentsReturn> => {
|
|
1047
|
-
return this.fetch(this.url('ListGasTankBalanceAdjustments'), createHTTPRequest(args, headers, signal)).then(
|
|
1048
|
-
res => {
|
|
1049
|
-
return buildResponse(res).then(_data => {
|
|
1050
|
-
return {
|
|
1051
|
-
page: <Page>_data.page,
|
|
1052
|
-
adjustments: <Array<GasTankBalanceAdjustment>>_data.adjustments
|
|
1053
|
-
}
|
|
1054
|
-
})
|
|
1055
|
-
},
|
|
1056
|
-
error => {
|
|
1057
|
-
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
1058
|
-
}
|
|
1059
|
-
)
|
|
918
|
+
return this.fetch(
|
|
919
|
+
this.url('UpdateGasTank'),
|
|
920
|
+
createHTTPRequest(args, headers, signal)).then((res) => {
|
|
921
|
+
return buildResponse(res).then(_data => {
|
|
922
|
+
return {
|
|
923
|
+
status: <boolean>(_data.status),
|
|
924
|
+
gasTank: <GasTank>(_data.gasTank),
|
|
925
|
+
}
|
|
926
|
+
})
|
|
927
|
+
}, (error) => {
|
|
928
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
929
|
+
})
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
nextGasTankBalanceAdjustmentNonce = (args: NextGasTankBalanceAdjustmentNonceArgs, headers?: object, signal?: AbortSignal): Promise<NextGasTankBalanceAdjustmentNonceReturn> => {
|
|
933
|
+
return this.fetch(
|
|
934
|
+
this.url('NextGasTankBalanceAdjustmentNonce'),
|
|
935
|
+
createHTTPRequest(args, headers, signal)).then((res) => {
|
|
936
|
+
return buildResponse(res).then(_data => {
|
|
937
|
+
return {
|
|
938
|
+
nonce: <number>(_data.nonce),
|
|
939
|
+
}
|
|
940
|
+
})
|
|
941
|
+
}, (error) => {
|
|
942
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
943
|
+
})
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
adjustGasTankBalance = (args: AdjustGasTankBalanceArgs, headers?: object, signal?: AbortSignal): Promise<AdjustGasTankBalanceReturn> => {
|
|
947
|
+
return this.fetch(
|
|
948
|
+
this.url('AdjustGasTankBalance'),
|
|
949
|
+
createHTTPRequest(args, headers, signal)).then((res) => {
|
|
950
|
+
return buildResponse(res).then(_data => {
|
|
951
|
+
return {
|
|
952
|
+
status: <boolean>(_data.status),
|
|
953
|
+
adjustment: <GasTankBalanceAdjustment>(_data.adjustment),
|
|
954
|
+
}
|
|
955
|
+
})
|
|
956
|
+
}, (error) => {
|
|
957
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
958
|
+
})
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
getGasTankBalanceAdjustment = (args: GetGasTankBalanceAdjustmentArgs, headers?: object, signal?: AbortSignal): Promise<GetGasTankBalanceAdjustmentReturn> => {
|
|
962
|
+
return this.fetch(
|
|
963
|
+
this.url('GetGasTankBalanceAdjustment'),
|
|
964
|
+
createHTTPRequest(args, headers, signal)).then((res) => {
|
|
965
|
+
return buildResponse(res).then(_data => {
|
|
966
|
+
return {
|
|
967
|
+
adjustment: <GasTankBalanceAdjustment>(_data.adjustment),
|
|
968
|
+
}
|
|
969
|
+
})
|
|
970
|
+
}, (error) => {
|
|
971
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
972
|
+
})
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
listGasTankBalanceAdjustments = (args: ListGasTankBalanceAdjustmentsArgs, headers?: object, signal?: AbortSignal): Promise<ListGasTankBalanceAdjustmentsReturn> => {
|
|
976
|
+
return this.fetch(
|
|
977
|
+
this.url('ListGasTankBalanceAdjustments'),
|
|
978
|
+
createHTTPRequest(args, headers, signal)).then((res) => {
|
|
979
|
+
return buildResponse(res).then(_data => {
|
|
980
|
+
return {
|
|
981
|
+
page: <Page>(_data.page),
|
|
982
|
+
adjustments: <Array<GasTankBalanceAdjustment>>(_data.adjustments),
|
|
983
|
+
}
|
|
984
|
+
})
|
|
985
|
+
}, (error) => {
|
|
986
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
987
|
+
})
|
|
1060
988
|
}
|
|
1061
|
-
|
|
989
|
+
|
|
1062
990
|
listGasSponsors = (args: ListGasSponsorsArgs, headers?: object, signal?: AbortSignal): Promise<ListGasSponsorsReturn> => {
|
|
1063
|
-
return this.fetch(
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
}
|
|
1071
|
-
}
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
)
|
|
991
|
+
return this.fetch(
|
|
992
|
+
this.url('ListGasSponsors'),
|
|
993
|
+
createHTTPRequest(args, headers, signal)).then((res) => {
|
|
994
|
+
return buildResponse(res).then(_data => {
|
|
995
|
+
return {
|
|
996
|
+
page: <Page>(_data.page),
|
|
997
|
+
gasSponsors: <Array<GasSponsor>>(_data.gasSponsors),
|
|
998
|
+
}
|
|
999
|
+
})
|
|
1000
|
+
}, (error) => {
|
|
1001
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
1002
|
+
})
|
|
1076
1003
|
}
|
|
1077
|
-
|
|
1004
|
+
|
|
1078
1005
|
getGasSponsor = (args: GetGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise<GetGasSponsorReturn> => {
|
|
1079
|
-
return this.fetch(
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
}
|
|
1086
|
-
}
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
)
|
|
1006
|
+
return this.fetch(
|
|
1007
|
+
this.url('GetGasSponsor'),
|
|
1008
|
+
createHTTPRequest(args, headers, signal)).then((res) => {
|
|
1009
|
+
return buildResponse(res).then(_data => {
|
|
1010
|
+
return {
|
|
1011
|
+
gasSponsor: <GasSponsor>(_data.gasSponsor),
|
|
1012
|
+
}
|
|
1013
|
+
})
|
|
1014
|
+
}, (error) => {
|
|
1015
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
1016
|
+
})
|
|
1091
1017
|
}
|
|
1092
|
-
|
|
1018
|
+
|
|
1093
1019
|
addGasSponsor = (args: AddGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise<AddGasSponsorReturn> => {
|
|
1094
|
-
return this.fetch(
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
}
|
|
1102
|
-
}
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
)
|
|
1020
|
+
return this.fetch(
|
|
1021
|
+
this.url('AddGasSponsor'),
|
|
1022
|
+
createHTTPRequest(args, headers, signal)).then((res) => {
|
|
1023
|
+
return buildResponse(res).then(_data => {
|
|
1024
|
+
return {
|
|
1025
|
+
status: <boolean>(_data.status),
|
|
1026
|
+
gasSponsor: <GasSponsor>(_data.gasSponsor),
|
|
1027
|
+
}
|
|
1028
|
+
})
|
|
1029
|
+
}, (error) => {
|
|
1030
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
1031
|
+
})
|
|
1107
1032
|
}
|
|
1108
|
-
|
|
1033
|
+
|
|
1109
1034
|
updateGasSponsor = (args: UpdateGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise<UpdateGasSponsorReturn> => {
|
|
1110
|
-
return this.fetch(
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
}
|
|
1118
|
-
}
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
)
|
|
1035
|
+
return this.fetch(
|
|
1036
|
+
this.url('UpdateGasSponsor'),
|
|
1037
|
+
createHTTPRequest(args, headers, signal)).then((res) => {
|
|
1038
|
+
return buildResponse(res).then(_data => {
|
|
1039
|
+
return {
|
|
1040
|
+
status: <boolean>(_data.status),
|
|
1041
|
+
gasSponsor: <GasSponsor>(_data.gasSponsor),
|
|
1042
|
+
}
|
|
1043
|
+
})
|
|
1044
|
+
}, (error) => {
|
|
1045
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
1046
|
+
})
|
|
1123
1047
|
}
|
|
1124
|
-
|
|
1048
|
+
|
|
1125
1049
|
removeGasSponsor = (args: RemoveGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise<RemoveGasSponsorReturn> => {
|
|
1126
|
-
return this.fetch(
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
}
|
|
1133
|
-
}
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
})
|
|
1153
|
-
},
|
|
1154
|
-
error => {
|
|
1155
|
-
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
1156
|
-
}
|
|
1157
|
-
)
|
|
1050
|
+
return this.fetch(
|
|
1051
|
+
this.url('RemoveGasSponsor'),
|
|
1052
|
+
createHTTPRequest(args, headers, signal)).then((res) => {
|
|
1053
|
+
return buildResponse(res).then(_data => {
|
|
1054
|
+
return {
|
|
1055
|
+
status: <boolean>(_data.status),
|
|
1056
|
+
}
|
|
1057
|
+
})
|
|
1058
|
+
}, (error) => {
|
|
1059
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
1060
|
+
})
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
addressGasSponsors = (args: AddressGasSponsorsArgs, headers?: object, signal?: AbortSignal): Promise<AddressGasSponsorsReturn> => {
|
|
1064
|
+
return this.fetch(
|
|
1065
|
+
this.url('AddressGasSponsors'),
|
|
1066
|
+
createHTTPRequest(args, headers, signal)).then((res) => {
|
|
1067
|
+
return buildResponse(res).then(_data => {
|
|
1068
|
+
return {
|
|
1069
|
+
page: <Page>(_data.page),
|
|
1070
|
+
gasSponsors: <Array<GasSponsor>>(_data.gasSponsors),
|
|
1071
|
+
}
|
|
1072
|
+
})
|
|
1073
|
+
}, (error) => {
|
|
1074
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
1075
|
+
})
|
|
1158
1076
|
}
|
|
1159
|
-
|
|
1077
|
+
|
|
1160
1078
|
getProjectBalance = (args: GetProjectBalanceArgs, headers?: object, signal?: AbortSignal): Promise<GetProjectBalanceReturn> => {
|
|
1161
|
-
return this.fetch(
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
}
|
|
1168
|
-
}
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
})
|
|
1187
|
-
},
|
|
1188
|
-
error => {
|
|
1189
|
-
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
1190
|
-
}
|
|
1191
|
-
)
|
|
1079
|
+
return this.fetch(
|
|
1080
|
+
this.url('GetProjectBalance'),
|
|
1081
|
+
createHTTPRequest(args, headers, signal)).then((res) => {
|
|
1082
|
+
return buildResponse(res).then(_data => {
|
|
1083
|
+
return {
|
|
1084
|
+
balance: <number>(_data.balance),
|
|
1085
|
+
}
|
|
1086
|
+
})
|
|
1087
|
+
}, (error) => {
|
|
1088
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
1089
|
+
})
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
adjustProjectBalance = (args: AdjustProjectBalanceArgs, headers?: object, signal?: AbortSignal): Promise<AdjustProjectBalanceReturn> => {
|
|
1093
|
+
return this.fetch(
|
|
1094
|
+
this.url('AdjustProjectBalance'),
|
|
1095
|
+
createHTTPRequest(args, headers, signal)).then((res) => {
|
|
1096
|
+
return buildResponse(res).then(_data => {
|
|
1097
|
+
return {
|
|
1098
|
+
balance: <number>(_data.balance),
|
|
1099
|
+
}
|
|
1100
|
+
})
|
|
1101
|
+
}, (error) => {
|
|
1102
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
1103
|
+
})
|
|
1192
1104
|
}
|
|
1105
|
+
|
|
1193
1106
|
}
|
|
1194
1107
|
|
|
1195
|
-
const createHTTPRequest = (body: object = {}, headers: object = {}, signal: AbortSignal | null = null): object => {
|
|
1196
|
-
const reqHeaders: {
|
|
1108
|
+
const createHTTPRequest = (body: object = {}, headers: object = {}, signal: AbortSignal | null = null): object => {
|
|
1109
|
+
const reqHeaders: {[key: string]: string} = { ...headers, 'Content-Type': 'application/json' }
|
|
1197
1110
|
reqHeaders[WebrpcHeader] = WebrpcHeaderValue
|
|
1198
1111
|
|
|
1199
1112
|
return {
|
|
@@ -1209,18 +1122,18 @@ const buildResponse = (res: Response): Promise<any> => {
|
|
|
1209
1122
|
let data
|
|
1210
1123
|
try {
|
|
1211
1124
|
data = JSON.parse(text)
|
|
1212
|
-
} catch
|
|
1125
|
+
} catch(error) {
|
|
1213
1126
|
let message = ''
|
|
1214
|
-
if (error instanceof Error)
|
|
1127
|
+
if (error instanceof Error) {
|
|
1215
1128
|
message = error.message
|
|
1216
1129
|
}
|
|
1217
1130
|
throw WebrpcBadResponseError.new({
|
|
1218
1131
|
status: res.status,
|
|
1219
|
-
cause: `JSON.parse(): ${message}: response text: ${text}`
|
|
1220
|
-
|
|
1132
|
+
cause: `JSON.parse(): ${message}: response text: ${text}`},
|
|
1133
|
+
)
|
|
1221
1134
|
}
|
|
1222
1135
|
if (!res.ok) {
|
|
1223
|
-
const code: number = typeof data.code === 'number' ? data.code : 0
|
|
1136
|
+
const code: number = (typeof data.code === 'number') ? data.code : 0
|
|
1224
1137
|
throw (webrpcErrorByCode[code] || WebrpcError).new(data)
|
|
1225
1138
|
}
|
|
1226
1139
|
return data
|
|
@@ -1402,6 +1315,7 @@ export class WebrpcStreamFinishedError extends WebrpcError {
|
|
|
1402
1315
|
}
|
|
1403
1316
|
}
|
|
1404
1317
|
|
|
1318
|
+
|
|
1405
1319
|
// Schema errors
|
|
1406
1320
|
|
|
1407
1321
|
export class UnauthorizedError extends WebrpcError {
|
|
@@ -1729,6 +1643,20 @@ export class InsufficientFeeError extends WebrpcError {
|
|
|
1729
1643
|
}
|
|
1730
1644
|
}
|
|
1731
1645
|
|
|
1646
|
+
export class NotEnoughBalanceError extends WebrpcError {
|
|
1647
|
+
constructor(
|
|
1648
|
+
name: string = 'NotEnoughBalance',
|
|
1649
|
+
code: number = 3005,
|
|
1650
|
+
message: string = `Not enough balance`,
|
|
1651
|
+
status: number = 0,
|
|
1652
|
+
cause?: string
|
|
1653
|
+
) {
|
|
1654
|
+
super(name, code, message, status, cause)
|
|
1655
|
+
Object.setPrototypeOf(this, NotEnoughBalanceError.prototype)
|
|
1656
|
+
}
|
|
1657
|
+
}
|
|
1658
|
+
|
|
1659
|
+
|
|
1732
1660
|
export enum errors {
|
|
1733
1661
|
WebrpcEndpoint = 'WebrpcEndpoint',
|
|
1734
1662
|
WebrpcRequestFailed = 'WebrpcRequestFailed',
|
|
@@ -1765,7 +1693,8 @@ export enum errors {
|
|
|
1765
1693
|
Unavailable = 'Unavailable',
|
|
1766
1694
|
QueryFailed = 'QueryFailed',
|
|
1767
1695
|
NotFound = 'NotFound',
|
|
1768
|
-
InsufficientFee = 'InsufficientFee'
|
|
1696
|
+
InsufficientFee = 'InsufficientFee',
|
|
1697
|
+
NotEnoughBalance = 'NotEnoughBalance',
|
|
1769
1698
|
}
|
|
1770
1699
|
|
|
1771
1700
|
export enum WebrpcErrorCodes {
|
|
@@ -1804,7 +1733,8 @@ export enum WebrpcErrorCodes {
|
|
|
1804
1733
|
Unavailable = 2002,
|
|
1805
1734
|
QueryFailed = 2003,
|
|
1806
1735
|
NotFound = 3000,
|
|
1807
|
-
InsufficientFee = 3004
|
|
1736
|
+
InsufficientFee = 3004,
|
|
1737
|
+
NotEnoughBalance = 3005,
|
|
1808
1738
|
}
|
|
1809
1739
|
|
|
1810
1740
|
export const webrpcErrorByCode: { [code: number]: any } = {
|
|
@@ -1843,7 +1773,9 @@ export const webrpcErrorByCode: { [code: number]: any } = {
|
|
|
1843
1773
|
[2002]: UnavailableError,
|
|
1844
1774
|
[2003]: QueryFailedError,
|
|
1845
1775
|
[3000]: NotFoundError,
|
|
1846
|
-
[3004]: InsufficientFeeError
|
|
1776
|
+
[3004]: InsufficientFeeError,
|
|
1777
|
+
[3005]: NotEnoughBalanceError,
|
|
1847
1778
|
}
|
|
1848
1779
|
|
|
1849
1780
|
export type Fetch = (input: RequestInfo, init?: RequestInit) => Promise<Response>
|
|
1781
|
+
|