@0xsequence/indexer 2.3.35 → 3.0.0-beta.2
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/.turbo/turbo-build.log +5 -0
- package/CHANGELOG.md +1791 -0
- package/LICENSE +0 -17
- package/README.md +1 -2
- package/dist/{declarations/src/index.d.ts → index.d.ts} +5 -4
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +97 -0
- package/dist/{declarations/src/indexer.gen.d.ts → indexer.gen.d.ts} +7 -15
- package/dist/indexer.gen.d.ts.map +1 -0
- package/dist/indexer.gen.js +1005 -0
- package/dist/{declarations/src/indexergw.gen.d.ts → indexergw.gen.d.ts} +13 -29
- package/dist/indexergw.gen.d.ts.map +1 -0
- package/dist/indexergw.gen.js +644 -0
- package/package.json +19 -13
- package/src/index.ts +2 -2
- package/src/indexer.gen.ts +326 -294
- package/src/indexergw.gen.ts +142 -164
- package/tsconfig.json +10 -0
- package/dist/0xsequence-indexer.cjs.d.ts +0 -2
- package/dist/0xsequence-indexer.cjs.dev.js +0 -1883
- package/dist/0xsequence-indexer.cjs.js +0 -7
- package/dist/0xsequence-indexer.cjs.prod.js +0 -1883
- package/dist/0xsequence-indexer.esm.js +0 -1820
package/src/indexergw.gen.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
|
-
// sequence-indexer v0.4.0
|
|
2
|
+
// sequence-indexer v0.4.0 5be4a3e78d9c7e0cc378c675ec01c518e83772e3
|
|
3
3
|
// --
|
|
4
4
|
// Code generated by webrpc-gen@v0.21.1 with typescript generator. DO NOT EDIT.
|
|
5
5
|
//
|
|
@@ -16,7 +16,7 @@ export const WebRPCVersion = 'v1'
|
|
|
16
16
|
export const WebRPCSchemaVersion = 'v0.4.0'
|
|
17
17
|
|
|
18
18
|
// Schema hash generated from your RIDL schema
|
|
19
|
-
export const WebRPCSchemaHash = '
|
|
19
|
+
export const WebRPCSchemaHash = '5be4a3e78d9c7e0cc378c675ec01c518e83772e3'
|
|
20
20
|
|
|
21
21
|
type WebrpcGenVersions = {
|
|
22
22
|
webrpcGenVersion: string
|
|
@@ -34,7 +34,7 @@ export function VersionFromHeader(headers: Headers): WebrpcGenVersions {
|
|
|
34
34
|
codeGenName: '',
|
|
35
35
|
codeGenVersion: '',
|
|
36
36
|
schemaName: '',
|
|
37
|
-
schemaVersion: ''
|
|
37
|
+
schemaVersion: '',
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
|
|
@@ -49,20 +49,20 @@ function parseWebrpcGenVersions(header: string): WebrpcGenVersions {
|
|
|
49
49
|
codeGenName: '',
|
|
50
50
|
codeGenVersion: '',
|
|
51
51
|
schemaName: '',
|
|
52
|
-
schemaVersion: ''
|
|
52
|
+
schemaVersion: '',
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
const [_, webrpcGenVersion] = versions[0]
|
|
57
|
-
const [codeGenName, codeGenVersion] = versions[1]
|
|
58
|
-
const [schemaName, schemaVersion] = versions[2]
|
|
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
|
|
62
|
-
codeGenName
|
|
63
|
-
codeGenVersion
|
|
64
|
-
schemaName
|
|
65
|
-
schemaVersion
|
|
61
|
+
webrpcGenVersion: webrpcGenVersion!,
|
|
62
|
+
codeGenName: codeGenName!,
|
|
63
|
+
codeGenVersion: codeGenVersion!,
|
|
64
|
+
schemaName: schemaName!,
|
|
65
|
+
schemaVersion: schemaVersion!,
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
|
|
@@ -73,7 +73,7 @@ function parseWebrpcGenVersions(header: string): WebrpcGenVersions {
|
|
|
73
73
|
export enum ResourceStatus {
|
|
74
74
|
NOT_AVAILABLE = 'NOT_AVAILABLE',
|
|
75
75
|
REFRESHING = 'REFRESHING',
|
|
76
|
-
AVAILABLE = 'AVAILABLE'
|
|
76
|
+
AVAILABLE = 'AVAILABLE',
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
export interface ContractInfo {
|
|
@@ -155,60 +155,54 @@ export enum ContractType {
|
|
|
155
155
|
ERC20_BRIDGE = 'ERC20_BRIDGE',
|
|
156
156
|
ERC721_BRIDGE = 'ERC721_BRIDGE',
|
|
157
157
|
ERC1155_BRIDGE = 'ERC1155_BRIDGE',
|
|
158
|
-
SEQ_MARKETPLACE = 'SEQ_MARKETPLACE'
|
|
158
|
+
SEQ_MARKETPLACE = 'SEQ_MARKETPLACE',
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
export enum EventLogType {
|
|
162
162
|
UNKNOWN = 'UNKNOWN',
|
|
163
163
|
BLOCK_ADDED = 'BLOCK_ADDED',
|
|
164
|
-
BLOCK_REMOVED = 'BLOCK_REMOVED'
|
|
164
|
+
BLOCK_REMOVED = 'BLOCK_REMOVED',
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
export enum EventLogDataType {
|
|
168
168
|
EVENT = 'EVENT',
|
|
169
169
|
TOKEN_TRANSFER = 'TOKEN_TRANSFER',
|
|
170
170
|
NATIVE_TOKEN_TRANSFER = 'NATIVE_TOKEN_TRANSFER',
|
|
171
|
-
SEQUENCE_TXN = 'SEQUENCE_TXN'
|
|
171
|
+
SEQUENCE_TXN = 'SEQUENCE_TXN',
|
|
172
172
|
}
|
|
173
173
|
|
|
174
174
|
export enum OrderStatus {
|
|
175
175
|
OPEN = 'OPEN',
|
|
176
176
|
CLOSED = 'CLOSED',
|
|
177
|
-
CANCELLED = 'CANCELLED'
|
|
177
|
+
CANCELLED = 'CANCELLED',
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
export enum TxnTransferType {
|
|
181
181
|
UNKNOWN = 'UNKNOWN',
|
|
182
182
|
SEND = 'SEND',
|
|
183
|
-
RECEIVE = 'RECEIVE'
|
|
183
|
+
RECEIVE = 'RECEIVE',
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
export enum TransactionStatus {
|
|
187
187
|
FAILED = 'FAILED',
|
|
188
|
-
SUCCESSFUL = 'SUCCESSFUL'
|
|
188
|
+
SUCCESSFUL = 'SUCCESSFUL',
|
|
189
189
|
}
|
|
190
190
|
|
|
191
191
|
export enum TransactionType {
|
|
192
192
|
LegacyTxnType = 'LegacyTxnType',
|
|
193
193
|
AccessListTxnType = 'AccessListTxnType',
|
|
194
|
-
DynamicFeeTxnType = 'DynamicFeeTxnType'
|
|
194
|
+
DynamicFeeTxnType = 'DynamicFeeTxnType',
|
|
195
195
|
}
|
|
196
196
|
|
|
197
197
|
export enum SortOrder {
|
|
198
198
|
DESC = 'DESC',
|
|
199
|
-
ASC = 'ASC'
|
|
199
|
+
ASC = 'ASC',
|
|
200
200
|
}
|
|
201
201
|
|
|
202
202
|
export enum ContractVerificationStatus {
|
|
203
203
|
VERIFIED = 'VERIFIED',
|
|
204
204
|
UNVERIFIED = 'UNVERIFIED',
|
|
205
|
-
ALL = 'ALL'
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
export enum NetworkType {
|
|
209
|
-
MAINNETS = 'MAINNETS',
|
|
210
|
-
TESTNETS = 'TESTNETS',
|
|
211
|
-
ALL = 'ALL'
|
|
205
|
+
ALL = 'ALL',
|
|
212
206
|
}
|
|
213
207
|
|
|
214
208
|
export interface Version {
|
|
@@ -313,7 +307,7 @@ export interface NativeTokenBalance {
|
|
|
313
307
|
accountAddress: string
|
|
314
308
|
chainId: number
|
|
315
309
|
balance: string
|
|
316
|
-
|
|
310
|
+
error: string
|
|
317
311
|
}
|
|
318
312
|
|
|
319
313
|
export interface IndexState {
|
|
@@ -560,57 +554,55 @@ export interface TokenBalancesByContractFilter {
|
|
|
560
554
|
|
|
561
555
|
export interface GatewayEtherBalance {
|
|
562
556
|
chainId: number
|
|
563
|
-
|
|
557
|
+
error: string
|
|
564
558
|
result: EtherBalance
|
|
565
559
|
}
|
|
566
560
|
|
|
567
561
|
export interface GatewayNativeTokenBalance {
|
|
568
562
|
chainId: number
|
|
569
|
-
|
|
563
|
+
error: string
|
|
570
564
|
result: NativeTokenBalance
|
|
571
565
|
}
|
|
572
566
|
|
|
573
567
|
export interface GatewayNativeTokenBalances {
|
|
574
568
|
chainId: number
|
|
575
|
-
|
|
569
|
+
error: string
|
|
576
570
|
results: Array<NativeTokenBalance>
|
|
577
571
|
}
|
|
578
572
|
|
|
579
573
|
export interface GatewayTokenBalance {
|
|
580
574
|
chainId: number
|
|
581
|
-
|
|
575
|
+
error: string
|
|
582
576
|
results: Array<TokenBalance>
|
|
583
577
|
}
|
|
584
578
|
|
|
585
|
-
export interface ChainInfo {
|
|
586
|
-
chainId: number
|
|
587
|
-
chainName: string
|
|
588
|
-
}
|
|
589
|
-
|
|
590
579
|
export interface IndexerGateway {
|
|
591
580
|
getNativeTokenBalance(
|
|
592
581
|
args: GetNativeTokenBalanceArgs,
|
|
593
582
|
headers?: object,
|
|
594
|
-
signal?: AbortSignal
|
|
583
|
+
signal?: AbortSignal,
|
|
595
584
|
): Promise<GetNativeTokenBalanceReturn>
|
|
596
585
|
getTokenBalances(args: GetTokenBalancesArgs, headers?: object, signal?: AbortSignal): Promise<GetTokenBalancesReturn>
|
|
597
586
|
getTokenBalancesSummary(
|
|
598
587
|
args: GetTokenBalancesSummaryArgs,
|
|
599
588
|
headers?: object,
|
|
600
|
-
signal?: AbortSignal
|
|
589
|
+
signal?: AbortSignal,
|
|
601
590
|
): Promise<GetTokenBalancesSummaryReturn>
|
|
602
591
|
getTokenBalancesDetails(
|
|
603
592
|
args: GetTokenBalancesDetailsArgs,
|
|
604
593
|
headers?: object,
|
|
605
|
-
signal?: AbortSignal
|
|
594
|
+
signal?: AbortSignal,
|
|
606
595
|
): Promise<GetTokenBalancesDetailsReturn>
|
|
607
596
|
getTokenBalancesByContract(
|
|
608
597
|
args: GetTokenBalancesByContractArgs,
|
|
609
598
|
headers?: object,
|
|
610
|
-
signal?: AbortSignal
|
|
599
|
+
signal?: AbortSignal,
|
|
611
600
|
): Promise<GetTokenBalancesByContractReturn>
|
|
612
|
-
getBalanceUpdates(
|
|
613
|
-
|
|
601
|
+
getBalanceUpdates(
|
|
602
|
+
args: GetBalanceUpdatesArgs,
|
|
603
|
+
headers?: object,
|
|
604
|
+
signal?: AbortSignal,
|
|
605
|
+
): Promise<GetBalanceUpdatesReturn>
|
|
614
606
|
ping(headers?: object, signal?: AbortSignal): Promise<PingReturn>
|
|
615
607
|
version(headers?: object, signal?: AbortSignal): Promise<VersionReturn>
|
|
616
608
|
runtimeStatus(headers?: object, signal?: AbortSignal): Promise<RuntimeStatusReturn>
|
|
@@ -619,7 +611,7 @@ export interface IndexerGateway {
|
|
|
619
611
|
export interface GetNativeTokenBalanceArgs {
|
|
620
612
|
chainIds?: Array<number>
|
|
621
613
|
networks?: Array<string>
|
|
622
|
-
|
|
614
|
+
testnets?: boolean
|
|
623
615
|
accountAddress?: string
|
|
624
616
|
}
|
|
625
617
|
|
|
@@ -629,7 +621,7 @@ export interface GetNativeTokenBalanceReturn {
|
|
|
629
621
|
export interface GetTokenBalancesArgs {
|
|
630
622
|
chainIds?: Array<number>
|
|
631
623
|
networks?: Array<string>
|
|
632
|
-
|
|
624
|
+
testnets?: boolean
|
|
633
625
|
accountAddress?: string
|
|
634
626
|
contractAddress?: string
|
|
635
627
|
tokenID?: string
|
|
@@ -646,7 +638,7 @@ export interface GetTokenBalancesReturn {
|
|
|
646
638
|
export interface GetTokenBalancesSummaryArgs {
|
|
647
639
|
chainIds?: Array<number>
|
|
648
640
|
networks?: Array<string>
|
|
649
|
-
|
|
641
|
+
testnets?: boolean
|
|
650
642
|
filter: TokenBalancesFilter
|
|
651
643
|
omitMetadata?: boolean
|
|
652
644
|
page?: Page
|
|
@@ -660,7 +652,7 @@ export interface GetTokenBalancesSummaryReturn {
|
|
|
660
652
|
export interface GetTokenBalancesDetailsArgs {
|
|
661
653
|
chainIds?: Array<number>
|
|
662
654
|
networks?: Array<string>
|
|
663
|
-
|
|
655
|
+
testnets?: boolean
|
|
664
656
|
filter: TokenBalancesFilter
|
|
665
657
|
omitMetadata?: boolean
|
|
666
658
|
page?: Page
|
|
@@ -674,7 +666,7 @@ export interface GetTokenBalancesDetailsReturn {
|
|
|
674
666
|
export interface GetTokenBalancesByContractArgs {
|
|
675
667
|
chainIds?: Array<number>
|
|
676
668
|
networks?: Array<string>
|
|
677
|
-
|
|
669
|
+
testnets?: boolean
|
|
678
670
|
filter: TokenBalancesByContractFilter
|
|
679
671
|
omitMetadata?: boolean
|
|
680
672
|
page?: Page
|
|
@@ -687,7 +679,7 @@ export interface GetTokenBalancesByContractReturn {
|
|
|
687
679
|
export interface GetBalanceUpdatesArgs {
|
|
688
680
|
chainIds?: Array<number>
|
|
689
681
|
networks?: Array<string>
|
|
690
|
-
|
|
682
|
+
testnets?: boolean
|
|
691
683
|
contractAddress: string
|
|
692
684
|
lastBlockNumber: number
|
|
693
685
|
lastBlockHash?: string
|
|
@@ -698,13 +690,6 @@ export interface GetBalanceUpdatesReturn {
|
|
|
698
690
|
page: Page
|
|
699
691
|
balances: Array<GatewayTokenBalance>
|
|
700
692
|
}
|
|
701
|
-
export interface GetChainsArgs {
|
|
702
|
-
networkType?: NetworkType
|
|
703
|
-
}
|
|
704
|
-
|
|
705
|
-
export interface GetChainsReturn {
|
|
706
|
-
chains: Array<ChainInfo>
|
|
707
|
-
}
|
|
708
693
|
export interface PingArgs {}
|
|
709
694
|
|
|
710
695
|
export interface PingReturn {
|
|
@@ -741,173 +726,166 @@ export class IndexerGateway implements IndexerGateway {
|
|
|
741
726
|
getNativeTokenBalance = (
|
|
742
727
|
args: GetNativeTokenBalanceArgs,
|
|
743
728
|
headers?: object,
|
|
744
|
-
signal?: AbortSignal
|
|
729
|
+
signal?: AbortSignal,
|
|
745
730
|
): Promise<GetNativeTokenBalanceReturn> => {
|
|
746
731
|
return this.fetch(this.url('GetNativeTokenBalance'), createHTTPRequest(args, headers, signal)).then(
|
|
747
|
-
res => {
|
|
748
|
-
return buildResponse(res).then(_data => {
|
|
732
|
+
(res) => {
|
|
733
|
+
return buildResponse(res).then((_data) => {
|
|
749
734
|
return {
|
|
750
|
-
balances: <Array<GatewayNativeTokenBalance>>_data.balances
|
|
735
|
+
balances: <Array<GatewayNativeTokenBalance>>_data.balances,
|
|
751
736
|
}
|
|
752
737
|
})
|
|
753
738
|
},
|
|
754
|
-
error => {
|
|
739
|
+
(error) => {
|
|
755
740
|
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
756
|
-
}
|
|
741
|
+
},
|
|
757
742
|
)
|
|
758
743
|
}
|
|
759
744
|
|
|
760
|
-
getTokenBalances = (
|
|
745
|
+
getTokenBalances = (
|
|
746
|
+
args: GetTokenBalancesArgs,
|
|
747
|
+
headers?: object,
|
|
748
|
+
signal?: AbortSignal,
|
|
749
|
+
): Promise<GetTokenBalancesReturn> => {
|
|
761
750
|
return this.fetch(this.url('GetTokenBalances'), createHTTPRequest(args, headers, signal)).then(
|
|
762
|
-
res => {
|
|
763
|
-
return buildResponse(res).then(_data => {
|
|
751
|
+
(res) => {
|
|
752
|
+
return buildResponse(res).then((_data) => {
|
|
764
753
|
return {
|
|
765
754
|
page: <Page>_data.page,
|
|
766
|
-
balances: <Array<GatewayTokenBalance>>_data.balances
|
|
755
|
+
balances: <Array<GatewayTokenBalance>>_data.balances,
|
|
767
756
|
}
|
|
768
757
|
})
|
|
769
758
|
},
|
|
770
|
-
error => {
|
|
759
|
+
(error) => {
|
|
771
760
|
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
772
|
-
}
|
|
761
|
+
},
|
|
773
762
|
)
|
|
774
763
|
}
|
|
775
764
|
|
|
776
765
|
getTokenBalancesSummary = (
|
|
777
766
|
args: GetTokenBalancesSummaryArgs,
|
|
778
767
|
headers?: object,
|
|
779
|
-
signal?: AbortSignal
|
|
768
|
+
signal?: AbortSignal,
|
|
780
769
|
): Promise<GetTokenBalancesSummaryReturn> => {
|
|
781
770
|
return this.fetch(this.url('GetTokenBalancesSummary'), createHTTPRequest(args, headers, signal)).then(
|
|
782
|
-
res => {
|
|
783
|
-
return buildResponse(res).then(_data => {
|
|
771
|
+
(res) => {
|
|
772
|
+
return buildResponse(res).then((_data) => {
|
|
784
773
|
return {
|
|
785
774
|
page: <Page>_data.page,
|
|
786
775
|
nativeBalances: <Array<GatewayNativeTokenBalances>>_data.nativeBalances,
|
|
787
|
-
balances: <Array<GatewayTokenBalance>>_data.balances
|
|
776
|
+
balances: <Array<GatewayTokenBalance>>_data.balances,
|
|
788
777
|
}
|
|
789
778
|
})
|
|
790
779
|
},
|
|
791
|
-
error => {
|
|
780
|
+
(error) => {
|
|
792
781
|
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
793
|
-
}
|
|
782
|
+
},
|
|
794
783
|
)
|
|
795
784
|
}
|
|
796
785
|
|
|
797
786
|
getTokenBalancesDetails = (
|
|
798
787
|
args: GetTokenBalancesDetailsArgs,
|
|
799
788
|
headers?: object,
|
|
800
|
-
signal?: AbortSignal
|
|
789
|
+
signal?: AbortSignal,
|
|
801
790
|
): Promise<GetTokenBalancesDetailsReturn> => {
|
|
802
791
|
return this.fetch(this.url('GetTokenBalancesDetails'), createHTTPRequest(args, headers, signal)).then(
|
|
803
|
-
res => {
|
|
804
|
-
return buildResponse(res).then(_data => {
|
|
792
|
+
(res) => {
|
|
793
|
+
return buildResponse(res).then((_data) => {
|
|
805
794
|
return {
|
|
806
795
|
page: <Page>_data.page,
|
|
807
796
|
nativeBalances: <Array<GatewayNativeTokenBalances>>_data.nativeBalances,
|
|
808
|
-
balances: <Array<GatewayTokenBalance>>_data.balances
|
|
797
|
+
balances: <Array<GatewayTokenBalance>>_data.balances,
|
|
809
798
|
}
|
|
810
799
|
})
|
|
811
800
|
},
|
|
812
|
-
error => {
|
|
801
|
+
(error) => {
|
|
813
802
|
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
814
|
-
}
|
|
803
|
+
},
|
|
815
804
|
)
|
|
816
805
|
}
|
|
817
806
|
|
|
818
807
|
getTokenBalancesByContract = (
|
|
819
808
|
args: GetTokenBalancesByContractArgs,
|
|
820
809
|
headers?: object,
|
|
821
|
-
signal?: AbortSignal
|
|
810
|
+
signal?: AbortSignal,
|
|
822
811
|
): Promise<GetTokenBalancesByContractReturn> => {
|
|
823
812
|
return this.fetch(this.url('GetTokenBalancesByContract'), createHTTPRequest(args, headers, signal)).then(
|
|
824
|
-
res => {
|
|
825
|
-
return buildResponse(res).then(_data => {
|
|
813
|
+
(res) => {
|
|
814
|
+
return buildResponse(res).then((_data) => {
|
|
826
815
|
return {
|
|
827
816
|
page: <Page>_data.page,
|
|
828
|
-
balances: <Array<GatewayTokenBalance>>_data.balances
|
|
817
|
+
balances: <Array<GatewayTokenBalance>>_data.balances,
|
|
829
818
|
}
|
|
830
819
|
})
|
|
831
820
|
},
|
|
832
|
-
error => {
|
|
821
|
+
(error) => {
|
|
833
822
|
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
834
|
-
}
|
|
823
|
+
},
|
|
835
824
|
)
|
|
836
825
|
}
|
|
837
826
|
|
|
838
|
-
getBalanceUpdates = (
|
|
827
|
+
getBalanceUpdates = (
|
|
828
|
+
args: GetBalanceUpdatesArgs,
|
|
829
|
+
headers?: object,
|
|
830
|
+
signal?: AbortSignal,
|
|
831
|
+
): Promise<GetBalanceUpdatesReturn> => {
|
|
839
832
|
return this.fetch(this.url('GetBalanceUpdates'), createHTTPRequest(args, headers, signal)).then(
|
|
840
|
-
res => {
|
|
841
|
-
return buildResponse(res).then(_data => {
|
|
833
|
+
(res) => {
|
|
834
|
+
return buildResponse(res).then((_data) => {
|
|
842
835
|
return {
|
|
843
836
|
page: <Page>_data.page,
|
|
844
|
-
balances: <Array<GatewayTokenBalance>>_data.balances
|
|
837
|
+
balances: <Array<GatewayTokenBalance>>_data.balances,
|
|
845
838
|
}
|
|
846
839
|
})
|
|
847
840
|
},
|
|
848
|
-
error => {
|
|
841
|
+
(error) => {
|
|
849
842
|
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
850
|
-
}
|
|
851
|
-
)
|
|
852
|
-
}
|
|
853
|
-
|
|
854
|
-
getChains = (args: GetChainsArgs, headers?: object, signal?: AbortSignal): Promise<GetChainsReturn> => {
|
|
855
|
-
return this.fetch(this.url('GetChains'), createHTTPRequest(args, headers, signal)).then(
|
|
856
|
-
res => {
|
|
857
|
-
return buildResponse(res).then(_data => {
|
|
858
|
-
return {
|
|
859
|
-
chains: <Array<ChainInfo>>_data.chains
|
|
860
|
-
}
|
|
861
|
-
})
|
|
862
843
|
},
|
|
863
|
-
error => {
|
|
864
|
-
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
865
|
-
}
|
|
866
844
|
)
|
|
867
845
|
}
|
|
868
846
|
|
|
869
847
|
ping = (headers?: object, signal?: AbortSignal): Promise<PingReturn> => {
|
|
870
848
|
return this.fetch(this.url('Ping'), createHTTPRequest({}, headers, signal)).then(
|
|
871
|
-
res => {
|
|
872
|
-
return buildResponse(res).then(_data => {
|
|
849
|
+
(res) => {
|
|
850
|
+
return buildResponse(res).then((_data) => {
|
|
873
851
|
return {
|
|
874
|
-
status: <boolean>_data.status
|
|
852
|
+
status: <boolean>_data.status,
|
|
875
853
|
}
|
|
876
854
|
})
|
|
877
855
|
},
|
|
878
|
-
error => {
|
|
856
|
+
(error) => {
|
|
879
857
|
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
880
|
-
}
|
|
858
|
+
},
|
|
881
859
|
)
|
|
882
860
|
}
|
|
883
861
|
|
|
884
862
|
version = (headers?: object, signal?: AbortSignal): Promise<VersionReturn> => {
|
|
885
863
|
return this.fetch(this.url('Version'), createHTTPRequest({}, headers, signal)).then(
|
|
886
|
-
res => {
|
|
887
|
-
return buildResponse(res).then(_data => {
|
|
864
|
+
(res) => {
|
|
865
|
+
return buildResponse(res).then((_data) => {
|
|
888
866
|
return {
|
|
889
|
-
version: <Version>_data.version
|
|
867
|
+
version: <Version>_data.version,
|
|
890
868
|
}
|
|
891
869
|
})
|
|
892
870
|
},
|
|
893
|
-
error => {
|
|
871
|
+
(error) => {
|
|
894
872
|
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
895
|
-
}
|
|
873
|
+
},
|
|
896
874
|
)
|
|
897
875
|
}
|
|
898
876
|
|
|
899
877
|
runtimeStatus = (headers?: object, signal?: AbortSignal): Promise<RuntimeStatusReturn> => {
|
|
900
878
|
return this.fetch(this.url('RuntimeStatus'), createHTTPRequest({}, headers, signal)).then(
|
|
901
|
-
res => {
|
|
902
|
-
return buildResponse(res).then(_data => {
|
|
879
|
+
(res) => {
|
|
880
|
+
return buildResponse(res).then((_data) => {
|
|
903
881
|
return {
|
|
904
|
-
status: <GatewayRuntimeStatus>_data.status
|
|
882
|
+
status: <GatewayRuntimeStatus>_data.status,
|
|
905
883
|
}
|
|
906
884
|
})
|
|
907
885
|
},
|
|
908
|
-
error => {
|
|
886
|
+
(error) => {
|
|
909
887
|
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
910
|
-
}
|
|
888
|
+
},
|
|
911
889
|
)
|
|
912
890
|
}
|
|
913
891
|
}
|
|
@@ -920,12 +898,12 @@ const createHTTPRequest = (body: object = {}, headers: object = {}, signal: Abor
|
|
|
920
898
|
method: 'POST',
|
|
921
899
|
headers: reqHeaders,
|
|
922
900
|
body: JSON.stringify(body || {}),
|
|
923
|
-
signal
|
|
901
|
+
signal,
|
|
924
902
|
}
|
|
925
903
|
}
|
|
926
904
|
|
|
927
905
|
const buildResponse = (res: Response): Promise<any> => {
|
|
928
|
-
return res.text().then(text => {
|
|
906
|
+
return res.text().then((text) => {
|
|
929
907
|
let data
|
|
930
908
|
try {
|
|
931
909
|
data = JSON.parse(text)
|
|
@@ -936,7 +914,7 @@ const buildResponse = (res: Response): Promise<any> => {
|
|
|
936
914
|
}
|
|
937
915
|
throw WebrpcBadResponseError.new({
|
|
938
916
|
status: res.status,
|
|
939
|
-
cause: `JSON.parse(): ${message}: response text: ${text}
|
|
917
|
+
cause: `JSON.parse(): ${message}: response text: ${text}`,
|
|
940
918
|
})
|
|
941
919
|
}
|
|
942
920
|
if (!res.ok) {
|
|
@@ -985,7 +963,7 @@ export class WebrpcEndpointError extends WebrpcError {
|
|
|
985
963
|
code: number = 0,
|
|
986
964
|
message: string = 'endpoint error',
|
|
987
965
|
status: number = 0,
|
|
988
|
-
cause?: string
|
|
966
|
+
cause?: string,
|
|
989
967
|
) {
|
|
990
968
|
super(name, code, message, status, cause)
|
|
991
969
|
Object.setPrototypeOf(this, WebrpcEndpointError.prototype)
|
|
@@ -998,7 +976,7 @@ export class WebrpcRequestFailedError extends WebrpcError {
|
|
|
998
976
|
code: number = -1,
|
|
999
977
|
message: string = 'request failed',
|
|
1000
978
|
status: number = 0,
|
|
1001
|
-
cause?: string
|
|
979
|
+
cause?: string,
|
|
1002
980
|
) {
|
|
1003
981
|
super(name, code, message, status, cause)
|
|
1004
982
|
Object.setPrototypeOf(this, WebrpcRequestFailedError.prototype)
|
|
@@ -1011,7 +989,7 @@ export class WebrpcBadRouteError extends WebrpcError {
|
|
|
1011
989
|
code: number = -2,
|
|
1012
990
|
message: string = 'bad route',
|
|
1013
991
|
status: number = 0,
|
|
1014
|
-
cause?: string
|
|
992
|
+
cause?: string,
|
|
1015
993
|
) {
|
|
1016
994
|
super(name, code, message, status, cause)
|
|
1017
995
|
Object.setPrototypeOf(this, WebrpcBadRouteError.prototype)
|
|
@@ -1024,7 +1002,7 @@ export class WebrpcBadMethodError extends WebrpcError {
|
|
|
1024
1002
|
code: number = -3,
|
|
1025
1003
|
message: string = 'bad method',
|
|
1026
1004
|
status: number = 0,
|
|
1027
|
-
cause?: string
|
|
1005
|
+
cause?: string,
|
|
1028
1006
|
) {
|
|
1029
1007
|
super(name, code, message, status, cause)
|
|
1030
1008
|
Object.setPrototypeOf(this, WebrpcBadMethodError.prototype)
|
|
@@ -1037,7 +1015,7 @@ export class WebrpcBadRequestError extends WebrpcError {
|
|
|
1037
1015
|
code: number = -4,
|
|
1038
1016
|
message: string = 'bad request',
|
|
1039
1017
|
status: number = 0,
|
|
1040
|
-
cause?: string
|
|
1018
|
+
cause?: string,
|
|
1041
1019
|
) {
|
|
1042
1020
|
super(name, code, message, status, cause)
|
|
1043
1021
|
Object.setPrototypeOf(this, WebrpcBadRequestError.prototype)
|
|
@@ -1050,7 +1028,7 @@ export class WebrpcBadResponseError extends WebrpcError {
|
|
|
1050
1028
|
code: number = -5,
|
|
1051
1029
|
message: string = 'bad response',
|
|
1052
1030
|
status: number = 0,
|
|
1053
|
-
cause?: string
|
|
1031
|
+
cause?: string,
|
|
1054
1032
|
) {
|
|
1055
1033
|
super(name, code, message, status, cause)
|
|
1056
1034
|
Object.setPrototypeOf(this, WebrpcBadResponseError.prototype)
|
|
@@ -1063,7 +1041,7 @@ export class WebrpcServerPanicError extends WebrpcError {
|
|
|
1063
1041
|
code: number = -6,
|
|
1064
1042
|
message: string = 'server panic',
|
|
1065
1043
|
status: number = 0,
|
|
1066
|
-
cause?: string
|
|
1044
|
+
cause?: string,
|
|
1067
1045
|
) {
|
|
1068
1046
|
super(name, code, message, status, cause)
|
|
1069
1047
|
Object.setPrototypeOf(this, WebrpcServerPanicError.prototype)
|
|
@@ -1076,7 +1054,7 @@ export class WebrpcInternalErrorError extends WebrpcError {
|
|
|
1076
1054
|
code: number = -7,
|
|
1077
1055
|
message: string = 'internal error',
|
|
1078
1056
|
status: number = 0,
|
|
1079
|
-
cause?: string
|
|
1057
|
+
cause?: string,
|
|
1080
1058
|
) {
|
|
1081
1059
|
super(name, code, message, status, cause)
|
|
1082
1060
|
Object.setPrototypeOf(this, WebrpcInternalErrorError.prototype)
|
|
@@ -1089,7 +1067,7 @@ export class WebrpcClientDisconnectedError extends WebrpcError {
|
|
|
1089
1067
|
code: number = -8,
|
|
1090
1068
|
message: string = 'client disconnected',
|
|
1091
1069
|
status: number = 0,
|
|
1092
|
-
cause?: string
|
|
1070
|
+
cause?: string,
|
|
1093
1071
|
) {
|
|
1094
1072
|
super(name, code, message, status, cause)
|
|
1095
1073
|
Object.setPrototypeOf(this, WebrpcClientDisconnectedError.prototype)
|
|
@@ -1102,7 +1080,7 @@ export class WebrpcStreamLostError extends WebrpcError {
|
|
|
1102
1080
|
code: number = -9,
|
|
1103
1081
|
message: string = 'stream lost',
|
|
1104
1082
|
status: number = 0,
|
|
1105
|
-
cause?: string
|
|
1083
|
+
cause?: string,
|
|
1106
1084
|
) {
|
|
1107
1085
|
super(name, code, message, status, cause)
|
|
1108
1086
|
Object.setPrototypeOf(this, WebrpcStreamLostError.prototype)
|
|
@@ -1115,7 +1093,7 @@ export class WebrpcStreamFinishedError extends WebrpcError {
|
|
|
1115
1093
|
code: number = -10,
|
|
1116
1094
|
message: string = 'stream finished',
|
|
1117
1095
|
status: number = 0,
|
|
1118
|
-
cause?: string
|
|
1096
|
+
cause?: string,
|
|
1119
1097
|
) {
|
|
1120
1098
|
super(name, code, message, status, cause)
|
|
1121
1099
|
Object.setPrototypeOf(this, WebrpcStreamFinishedError.prototype)
|
|
@@ -1130,7 +1108,7 @@ export class UnauthorizedError extends WebrpcError {
|
|
|
1130
1108
|
code: number = 1000,
|
|
1131
1109
|
message: string = 'Unauthorized access',
|
|
1132
1110
|
status: number = 0,
|
|
1133
|
-
cause?: string
|
|
1111
|
+
cause?: string,
|
|
1134
1112
|
) {
|
|
1135
1113
|
super(name, code, message, status, cause)
|
|
1136
1114
|
Object.setPrototypeOf(this, UnauthorizedError.prototype)
|
|
@@ -1143,7 +1121,7 @@ export class PermissionDeniedError extends WebrpcError {
|
|
|
1143
1121
|
code: number = 1001,
|
|
1144
1122
|
message: string = 'Permission denied',
|
|
1145
1123
|
status: number = 0,
|
|
1146
|
-
cause?: string
|
|
1124
|
+
cause?: string,
|
|
1147
1125
|
) {
|
|
1148
1126
|
super(name, code, message, status, cause)
|
|
1149
1127
|
Object.setPrototypeOf(this, PermissionDeniedError.prototype)
|
|
@@ -1156,7 +1134,7 @@ export class SessionExpiredError extends WebrpcError {
|
|
|
1156
1134
|
code: number = 1002,
|
|
1157
1135
|
message: string = 'Session expired',
|
|
1158
1136
|
status: number = 0,
|
|
1159
|
-
cause?: string
|
|
1137
|
+
cause?: string,
|
|
1160
1138
|
) {
|
|
1161
1139
|
super(name, code, message, status, cause)
|
|
1162
1140
|
Object.setPrototypeOf(this, SessionExpiredError.prototype)
|
|
@@ -1169,7 +1147,7 @@ export class MethodNotFoundError extends WebrpcError {
|
|
|
1169
1147
|
code: number = 1003,
|
|
1170
1148
|
message: string = 'Method not found',
|
|
1171
1149
|
status: number = 0,
|
|
1172
|
-
cause?: string
|
|
1150
|
+
cause?: string,
|
|
1173
1151
|
) {
|
|
1174
1152
|
super(name, code, message, status, cause)
|
|
1175
1153
|
Object.setPrototypeOf(this, MethodNotFoundError.prototype)
|
|
@@ -1182,7 +1160,7 @@ export class RequestConflictError extends WebrpcError {
|
|
|
1182
1160
|
code: number = 1004,
|
|
1183
1161
|
message: string = 'Conflict with target resource',
|
|
1184
1162
|
status: number = 0,
|
|
1185
|
-
cause?: string
|
|
1163
|
+
cause?: string,
|
|
1186
1164
|
) {
|
|
1187
1165
|
super(name, code, message, status, cause)
|
|
1188
1166
|
Object.setPrototypeOf(this, RequestConflictError.prototype)
|
|
@@ -1195,7 +1173,7 @@ export class AbortedError extends WebrpcError {
|
|
|
1195
1173
|
code: number = 1005,
|
|
1196
1174
|
message: string = 'Request aborted',
|
|
1197
1175
|
status: number = 0,
|
|
1198
|
-
cause?: string
|
|
1176
|
+
cause?: string,
|
|
1199
1177
|
) {
|
|
1200
1178
|
super(name, code, message, status, cause)
|
|
1201
1179
|
Object.setPrototypeOf(this, AbortedError.prototype)
|
|
@@ -1208,7 +1186,7 @@ export class GeoblockedError extends WebrpcError {
|
|
|
1208
1186
|
code: number = 1006,
|
|
1209
1187
|
message: string = 'Geoblocked region',
|
|
1210
1188
|
status: number = 0,
|
|
1211
|
-
cause?: string
|
|
1189
|
+
cause?: string,
|
|
1212
1190
|
) {
|
|
1213
1191
|
super(name, code, message, status, cause)
|
|
1214
1192
|
Object.setPrototypeOf(this, GeoblockedError.prototype)
|
|
@@ -1221,7 +1199,7 @@ export class RateLimitedError extends WebrpcError {
|
|
|
1221
1199
|
code: number = 1007,
|
|
1222
1200
|
message: string = 'Rate-limited. Please slow down.',
|
|
1223
1201
|
status: number = 0,
|
|
1224
|
-
cause?: string
|
|
1202
|
+
cause?: string,
|
|
1225
1203
|
) {
|
|
1226
1204
|
super(name, code, message, status, cause)
|
|
1227
1205
|
Object.setPrototypeOf(this, RateLimitedError.prototype)
|
|
@@ -1234,7 +1212,7 @@ export class ProjectNotFoundError extends WebrpcError {
|
|
|
1234
1212
|
code: number = 1100,
|
|
1235
1213
|
message: string = 'Project not found',
|
|
1236
1214
|
status: number = 0,
|
|
1237
|
-
cause?: string
|
|
1215
|
+
cause?: string,
|
|
1238
1216
|
) {
|
|
1239
1217
|
super(name, code, message, status, cause)
|
|
1240
1218
|
Object.setPrototypeOf(this, ProjectNotFoundError.prototype)
|
|
@@ -1247,7 +1225,7 @@ export class AccessKeyNotFoundError extends WebrpcError {
|
|
|
1247
1225
|
code: number = 1101,
|
|
1248
1226
|
message: string = 'Access key not found',
|
|
1249
1227
|
status: number = 0,
|
|
1250
|
-
cause?: string
|
|
1228
|
+
cause?: string,
|
|
1251
1229
|
) {
|
|
1252
1230
|
super(name, code, message, status, cause)
|
|
1253
1231
|
Object.setPrototypeOf(this, AccessKeyNotFoundError.prototype)
|
|
@@ -1260,7 +1238,7 @@ export class AccessKeyMismatchError extends WebrpcError {
|
|
|
1260
1238
|
code: number = 1102,
|
|
1261
1239
|
message: string = 'Access key mismatch',
|
|
1262
1240
|
status: number = 0,
|
|
1263
|
-
cause?: string
|
|
1241
|
+
cause?: string,
|
|
1264
1242
|
) {
|
|
1265
1243
|
super(name, code, message, status, cause)
|
|
1266
1244
|
Object.setPrototypeOf(this, AccessKeyMismatchError.prototype)
|
|
@@ -1273,7 +1251,7 @@ export class InvalidOriginError extends WebrpcError {
|
|
|
1273
1251
|
code: number = 1103,
|
|
1274
1252
|
message: string = 'Invalid origin for Access Key',
|
|
1275
1253
|
status: number = 0,
|
|
1276
|
-
cause?: string
|
|
1254
|
+
cause?: string,
|
|
1277
1255
|
) {
|
|
1278
1256
|
super(name, code, message, status, cause)
|
|
1279
1257
|
Object.setPrototypeOf(this, InvalidOriginError.prototype)
|
|
@@ -1286,7 +1264,7 @@ export class InvalidServiceError extends WebrpcError {
|
|
|
1286
1264
|
code: number = 1104,
|
|
1287
1265
|
message: string = 'Service not enabled for Access key',
|
|
1288
1266
|
status: number = 0,
|
|
1289
|
-
cause?: string
|
|
1267
|
+
cause?: string,
|
|
1290
1268
|
) {
|
|
1291
1269
|
super(name, code, message, status, cause)
|
|
1292
1270
|
Object.setPrototypeOf(this, InvalidServiceError.prototype)
|
|
@@ -1299,7 +1277,7 @@ export class UnauthorizedUserError extends WebrpcError {
|
|
|
1299
1277
|
code: number = 1105,
|
|
1300
1278
|
message: string = 'Unauthorized user',
|
|
1301
1279
|
status: number = 0,
|
|
1302
|
-
cause?: string
|
|
1280
|
+
cause?: string,
|
|
1303
1281
|
) {
|
|
1304
1282
|
super(name, code, message, status, cause)
|
|
1305
1283
|
Object.setPrototypeOf(this, UnauthorizedUserError.prototype)
|
|
@@ -1312,7 +1290,7 @@ export class QuotaExceededError extends WebrpcError {
|
|
|
1312
1290
|
code: number = 1200,
|
|
1313
1291
|
message: string = 'Quota exceeded',
|
|
1314
1292
|
status: number = 0,
|
|
1315
|
-
cause?: string
|
|
1293
|
+
cause?: string,
|
|
1316
1294
|
) {
|
|
1317
1295
|
super(name, code, message, status, cause)
|
|
1318
1296
|
Object.setPrototypeOf(this, QuotaExceededError.prototype)
|
|
@@ -1325,7 +1303,7 @@ export class RateLimitError extends WebrpcError {
|
|
|
1325
1303
|
code: number = 1201,
|
|
1326
1304
|
message: string = 'Rate limit exceeded',
|
|
1327
1305
|
status: number = 0,
|
|
1328
|
-
cause?: string
|
|
1306
|
+
cause?: string,
|
|
1329
1307
|
) {
|
|
1330
1308
|
super(name, code, message, status, cause)
|
|
1331
1309
|
Object.setPrototypeOf(this, RateLimitError.prototype)
|
|
@@ -1338,7 +1316,7 @@ export class NoDefaultKeyError extends WebrpcError {
|
|
|
1338
1316
|
code: number = 1300,
|
|
1339
1317
|
message: string = 'No default access key found',
|
|
1340
1318
|
status: number = 0,
|
|
1341
|
-
cause?: string
|
|
1319
|
+
cause?: string,
|
|
1342
1320
|
) {
|
|
1343
1321
|
super(name, code, message, status, cause)
|
|
1344
1322
|
Object.setPrototypeOf(this, NoDefaultKeyError.prototype)
|
|
@@ -1351,7 +1329,7 @@ export class MaxAccessKeysError extends WebrpcError {
|
|
|
1351
1329
|
code: number = 1301,
|
|
1352
1330
|
message: string = 'Access keys limit reached',
|
|
1353
1331
|
status: number = 0,
|
|
1354
|
-
cause?: string
|
|
1332
|
+
cause?: string,
|
|
1355
1333
|
) {
|
|
1356
1334
|
super(name, code, message, status, cause)
|
|
1357
1335
|
Object.setPrototypeOf(this, MaxAccessKeysError.prototype)
|
|
@@ -1364,7 +1342,7 @@ export class AtLeastOneKeyError extends WebrpcError {
|
|
|
1364
1342
|
code: number = 1302,
|
|
1365
1343
|
message: string = 'You need at least one Access Key',
|
|
1366
1344
|
status: number = 0,
|
|
1367
|
-
cause?: string
|
|
1345
|
+
cause?: string,
|
|
1368
1346
|
) {
|
|
1369
1347
|
super(name, code, message, status, cause)
|
|
1370
1348
|
Object.setPrototypeOf(this, AtLeastOneKeyError.prototype)
|
|
@@ -1377,7 +1355,7 @@ export class TimeoutError extends WebrpcError {
|
|
|
1377
1355
|
code: number = 1900,
|
|
1378
1356
|
message: string = 'Request timed out',
|
|
1379
1357
|
status: number = 0,
|
|
1380
|
-
cause?: string
|
|
1358
|
+
cause?: string,
|
|
1381
1359
|
) {
|
|
1382
1360
|
super(name, code, message, status, cause)
|
|
1383
1361
|
Object.setPrototypeOf(this, TimeoutError.prototype)
|
|
@@ -1390,7 +1368,7 @@ export class InvalidArgumentError extends WebrpcError {
|
|
|
1390
1368
|
code: number = 2001,
|
|
1391
1369
|
message: string = 'Invalid argument',
|
|
1392
1370
|
status: number = 0,
|
|
1393
|
-
cause?: string
|
|
1371
|
+
cause?: string,
|
|
1394
1372
|
) {
|
|
1395
1373
|
super(name, code, message, status, cause)
|
|
1396
1374
|
Object.setPrototypeOf(this, InvalidArgumentError.prototype)
|
|
@@ -1403,7 +1381,7 @@ export class UnavailableError extends WebrpcError {
|
|
|
1403
1381
|
code: number = 2002,
|
|
1404
1382
|
message: string = 'Unavailable resource',
|
|
1405
1383
|
status: number = 0,
|
|
1406
|
-
cause?: string
|
|
1384
|
+
cause?: string,
|
|
1407
1385
|
) {
|
|
1408
1386
|
super(name, code, message, status, cause)
|
|
1409
1387
|
Object.setPrototypeOf(this, UnavailableError.prototype)
|
|
@@ -1416,7 +1394,7 @@ export class QueryFailedError extends WebrpcError {
|
|
|
1416
1394
|
code: number = 2003,
|
|
1417
1395
|
message: string = 'Query failed',
|
|
1418
1396
|
status: number = 0,
|
|
1419
|
-
cause?: string
|
|
1397
|
+
cause?: string,
|
|
1420
1398
|
) {
|
|
1421
1399
|
super(name, code, message, status, cause)
|
|
1422
1400
|
Object.setPrototypeOf(this, QueryFailedError.prototype)
|
|
@@ -1429,7 +1407,7 @@ export class ResourceExhaustedError extends WebrpcError {
|
|
|
1429
1407
|
code: number = 2004,
|
|
1430
1408
|
message: string = 'Resource exhausted',
|
|
1431
1409
|
status: number = 0,
|
|
1432
|
-
cause?: string
|
|
1410
|
+
cause?: string,
|
|
1433
1411
|
) {
|
|
1434
1412
|
super(name, code, message, status, cause)
|
|
1435
1413
|
Object.setPrototypeOf(this, ResourceExhaustedError.prototype)
|
|
@@ -1442,7 +1420,7 @@ export class NotFoundError extends WebrpcError {
|
|
|
1442
1420
|
code: number = 3000,
|
|
1443
1421
|
message: string = 'Resource not found',
|
|
1444
1422
|
status: number = 0,
|
|
1445
|
-
cause?: string
|
|
1423
|
+
cause?: string,
|
|
1446
1424
|
) {
|
|
1447
1425
|
super(name, code, message, status, cause)
|
|
1448
1426
|
Object.setPrototypeOf(this, NotFoundError.prototype)
|
|
@@ -1455,7 +1433,7 @@ export class MetadataCallFailedError extends WebrpcError {
|
|
|
1455
1433
|
code: number = 3003,
|
|
1456
1434
|
message: string = 'Metadata service call failed',
|
|
1457
1435
|
status: number = 0,
|
|
1458
|
-
cause?: string
|
|
1436
|
+
cause?: string,
|
|
1459
1437
|
) {
|
|
1460
1438
|
super(name, code, message, status, cause)
|
|
1461
1439
|
Object.setPrototypeOf(this, MetadataCallFailedError.prototype)
|
|
@@ -1499,7 +1477,7 @@ export enum errors {
|
|
|
1499
1477
|
QueryFailed = 'QueryFailed',
|
|
1500
1478
|
ResourceExhausted = 'ResourceExhausted',
|
|
1501
1479
|
NotFound = 'NotFound',
|
|
1502
|
-
MetadataCallFailed = 'MetadataCallFailed'
|
|
1480
|
+
MetadataCallFailed = 'MetadataCallFailed',
|
|
1503
1481
|
}
|
|
1504
1482
|
|
|
1505
1483
|
const webrpcErrorByCode: { [code: number]: any } = {
|
|
@@ -1539,7 +1517,7 @@ const webrpcErrorByCode: { [code: number]: any } = {
|
|
|
1539
1517
|
[2003]: QueryFailedError,
|
|
1540
1518
|
[2004]: ResourceExhaustedError,
|
|
1541
1519
|
[3000]: NotFoundError,
|
|
1542
|
-
[3003]: MetadataCallFailedError
|
|
1520
|
+
[3003]: MetadataCallFailedError,
|
|
1543
1521
|
}
|
|
1544
1522
|
|
|
1545
1523
|
export type Fetch = (input: RequestInfo, init?: RequestInit) => Promise<Response>
|