@coinmasters/types 4.10.1 → 4.10.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/dist/abis/erc20.d.ts +36 -0
- package/dist/abis/erc20.d.ts.map +1 -0
- package/dist/abis/tcEthVault.d.ts +206 -0
- package/dist/abis/tcEthVault.d.ts.map +1 -0
- package/dist/commonTypes.d.ts +130 -0
- package/dist/commonTypes.d.ts.map +1 -0
- package/dist/errors/apiError.d.ts +21 -0
- package/dist/errors/apiError.d.ts.map +1 -0
- package/dist/errors/displayMessages.d.ts +4 -0
- package/dist/errors/displayMessages.d.ts.map +1 -0
- package/dist/errors/index.d.ts +3 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/types.d.ts +121 -0
- package/dist/errors/types.d.ts.map +1 -0
- package/dist/index.d.ts +9 -849
- package/dist/index.d.ts.map +1 -0
- package/dist/network.d.ts +220 -0
- package/dist/network.d.ts.map +1 -0
- package/dist/thorchain.d.ts +28 -0
- package/dist/thorchain.d.ts.map +1 -0
- package/dist/transactions.d.ts +21 -0
- package/dist/transactions.d.ts.map +1 -0
- package/dist/wallet.d.ts +19 -0
- package/dist/wallet.d.ts.map +1 -0
- package/package.json +2 -2
@@ -0,0 +1,36 @@
|
|
1
|
+
export declare const erc20ABI: ({
|
2
|
+
inputs: never[];
|
3
|
+
stateMutability: string;
|
4
|
+
type: string;
|
5
|
+
anonymous?: undefined;
|
6
|
+
name?: undefined;
|
7
|
+
outputs?: undefined;
|
8
|
+
} | {
|
9
|
+
anonymous: boolean;
|
10
|
+
inputs: {
|
11
|
+
indexed: boolean;
|
12
|
+
internalType: string;
|
13
|
+
name: string;
|
14
|
+
type: string;
|
15
|
+
}[];
|
16
|
+
name: string;
|
17
|
+
type: string;
|
18
|
+
stateMutability?: undefined;
|
19
|
+
outputs?: undefined;
|
20
|
+
} | {
|
21
|
+
inputs: {
|
22
|
+
internalType: string;
|
23
|
+
name: string;
|
24
|
+
type: string;
|
25
|
+
}[];
|
26
|
+
name: string;
|
27
|
+
outputs: {
|
28
|
+
internalType: string;
|
29
|
+
name: string;
|
30
|
+
type: string;
|
31
|
+
}[];
|
32
|
+
stateMutability: string;
|
33
|
+
type: string;
|
34
|
+
anonymous?: undefined;
|
35
|
+
})[];
|
36
|
+
//# sourceMappingURL=erc20.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"erc20.d.ts","sourceRoot":"","sources":["../../src/abis/erc20.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAkGpB,CAAC"}
|
@@ -0,0 +1,206 @@
|
|
1
|
+
export declare const TCEthereumVaultAbi: ({
|
2
|
+
inputs: {
|
3
|
+
internalType: string;
|
4
|
+
name: string;
|
5
|
+
type: string;
|
6
|
+
}[];
|
7
|
+
stateMutability: string;
|
8
|
+
type: string;
|
9
|
+
anonymous?: undefined;
|
10
|
+
name?: undefined;
|
11
|
+
outputs?: undefined;
|
12
|
+
} | {
|
13
|
+
anonymous: boolean;
|
14
|
+
inputs: ({
|
15
|
+
indexed: boolean;
|
16
|
+
internalType: string;
|
17
|
+
name: string;
|
18
|
+
type: string;
|
19
|
+
components?: undefined;
|
20
|
+
} | {
|
21
|
+
components: {
|
22
|
+
internalType: string;
|
23
|
+
name: string;
|
24
|
+
type: string;
|
25
|
+
}[];
|
26
|
+
indexed: boolean;
|
27
|
+
internalType: string;
|
28
|
+
name: string;
|
29
|
+
type: string;
|
30
|
+
})[];
|
31
|
+
name: string;
|
32
|
+
type: string;
|
33
|
+
stateMutability?: undefined;
|
34
|
+
outputs?: undefined;
|
35
|
+
} | {
|
36
|
+
inputs: ({
|
37
|
+
internalType: string;
|
38
|
+
name: string;
|
39
|
+
type: string;
|
40
|
+
components?: undefined;
|
41
|
+
} | {
|
42
|
+
components: {
|
43
|
+
internalType: string;
|
44
|
+
name: string;
|
45
|
+
type: string;
|
46
|
+
}[];
|
47
|
+
internalType: string;
|
48
|
+
name: string;
|
49
|
+
type: string;
|
50
|
+
})[];
|
51
|
+
name: string;
|
52
|
+
outputs: never[];
|
53
|
+
stateMutability: string;
|
54
|
+
type: string;
|
55
|
+
anonymous?: undefined;
|
56
|
+
} | {
|
57
|
+
inputs: {
|
58
|
+
internalType: string;
|
59
|
+
name: string;
|
60
|
+
type: string;
|
61
|
+
}[];
|
62
|
+
name: string;
|
63
|
+
outputs: {
|
64
|
+
internalType: string;
|
65
|
+
name: string;
|
66
|
+
type: string;
|
67
|
+
}[];
|
68
|
+
stateMutability: string;
|
69
|
+
type: string;
|
70
|
+
anonymous?: undefined;
|
71
|
+
})[];
|
72
|
+
export declare const TCAvalancheDepositABI: ({
|
73
|
+
inputs: never[];
|
74
|
+
stateMutability: string;
|
75
|
+
type: string;
|
76
|
+
anonymous?: undefined;
|
77
|
+
name?: undefined;
|
78
|
+
outputs?: undefined;
|
79
|
+
} | {
|
80
|
+
anonymous: boolean;
|
81
|
+
inputs: ({
|
82
|
+
indexed: boolean;
|
83
|
+
internalType: string;
|
84
|
+
name: string;
|
85
|
+
type: string;
|
86
|
+
components?: undefined;
|
87
|
+
} | {
|
88
|
+
components: {
|
89
|
+
internalType: string;
|
90
|
+
name: string;
|
91
|
+
type: string;
|
92
|
+
}[];
|
93
|
+
indexed: boolean;
|
94
|
+
internalType: string;
|
95
|
+
name: string;
|
96
|
+
type: string;
|
97
|
+
})[];
|
98
|
+
name: string;
|
99
|
+
type: string;
|
100
|
+
stateMutability?: undefined;
|
101
|
+
outputs?: undefined;
|
102
|
+
} | {
|
103
|
+
inputs: ({
|
104
|
+
internalType: string;
|
105
|
+
name: string;
|
106
|
+
type: string;
|
107
|
+
components?: undefined;
|
108
|
+
} | {
|
109
|
+
components: {
|
110
|
+
internalType: string;
|
111
|
+
name: string;
|
112
|
+
type: string;
|
113
|
+
}[];
|
114
|
+
internalType: string;
|
115
|
+
name: string;
|
116
|
+
type: string;
|
117
|
+
})[];
|
118
|
+
name: string;
|
119
|
+
outputs: never[];
|
120
|
+
stateMutability: string;
|
121
|
+
type: string;
|
122
|
+
anonymous?: undefined;
|
123
|
+
} | {
|
124
|
+
inputs: {
|
125
|
+
internalType: string;
|
126
|
+
name: string;
|
127
|
+
type: string;
|
128
|
+
}[];
|
129
|
+
name: string;
|
130
|
+
outputs: {
|
131
|
+
internalType: string;
|
132
|
+
name: string;
|
133
|
+
type: string;
|
134
|
+
}[];
|
135
|
+
stateMutability: string;
|
136
|
+
type: string;
|
137
|
+
anonymous?: undefined;
|
138
|
+
})[];
|
139
|
+
export declare const TCBscDepositABI: ({
|
140
|
+
inputs: never[];
|
141
|
+
stateMutability: string;
|
142
|
+
type: string;
|
143
|
+
anonymous?: undefined;
|
144
|
+
name?: undefined;
|
145
|
+
outputs?: undefined;
|
146
|
+
} | {
|
147
|
+
anonymous: boolean;
|
148
|
+
inputs: ({
|
149
|
+
indexed: boolean;
|
150
|
+
internalType: string;
|
151
|
+
name: string;
|
152
|
+
type: string;
|
153
|
+
components?: undefined;
|
154
|
+
} | {
|
155
|
+
components: {
|
156
|
+
internalType: string;
|
157
|
+
name: string;
|
158
|
+
type: string;
|
159
|
+
}[];
|
160
|
+
indexed: boolean;
|
161
|
+
internalType: string;
|
162
|
+
name: string;
|
163
|
+
type: string;
|
164
|
+
})[];
|
165
|
+
name: string;
|
166
|
+
type: string;
|
167
|
+
stateMutability?: undefined;
|
168
|
+
outputs?: undefined;
|
169
|
+
} | {
|
170
|
+
inputs: ({
|
171
|
+
internalType: string;
|
172
|
+
name: string;
|
173
|
+
type: string;
|
174
|
+
components?: undefined;
|
175
|
+
} | {
|
176
|
+
components: {
|
177
|
+
internalType: string;
|
178
|
+
name: string;
|
179
|
+
type: string;
|
180
|
+
}[];
|
181
|
+
internalType: string;
|
182
|
+
name: string;
|
183
|
+
type: string;
|
184
|
+
})[];
|
185
|
+
name: string;
|
186
|
+
outputs: never[];
|
187
|
+
stateMutability: string;
|
188
|
+
type: string;
|
189
|
+
anonymous?: undefined;
|
190
|
+
} | {
|
191
|
+
inputs: {
|
192
|
+
internalType: string;
|
193
|
+
name: string;
|
194
|
+
type: string;
|
195
|
+
}[];
|
196
|
+
name: string;
|
197
|
+
outputs: {
|
198
|
+
internalType: string;
|
199
|
+
name: string;
|
200
|
+
type: string;
|
201
|
+
}[];
|
202
|
+
stateMutability: string;
|
203
|
+
type: string;
|
204
|
+
anonymous?: undefined;
|
205
|
+
})[];
|
206
|
+
//# sourceMappingURL=tcEthVault.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"tcEthVault.d.ts","sourceRoot":"","sources":["../../src/abis/tcEthVault.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA+K9B,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoKjC,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAwJ3B,CAAC"}
|
@@ -0,0 +1,130 @@
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
2
|
+
import type { FixedNumber } from 'ethers';
|
3
|
+
import type { Chain, CosmosChain, EVMChain, UTXOChain } from './network.ts';
|
4
|
+
import type { WalletOption } from './wallet.ts';
|
5
|
+
type ConnectMethodNames = 'connectEVMWallet' | 'connectKeplr' | 'connectKeystore' | 'connectKeepkey' | 'connectMetaMask' | 'connectLedger' | 'connectOkx' | 'connectTrezor' | 'connectWalletconnect' | 'connectXDEFI';
|
6
|
+
type ChainWallet = {
|
7
|
+
address: string;
|
8
|
+
balance: any[];
|
9
|
+
walletType: WalletOption;
|
10
|
+
};
|
11
|
+
export type ConnectConfig = {
|
12
|
+
stagenet?: boolean;
|
13
|
+
/**
|
14
|
+
* @required for AVAX & BSC
|
15
|
+
*/
|
16
|
+
covalentApiKey?: string;
|
17
|
+
/**
|
18
|
+
* @required for ETH
|
19
|
+
*/
|
20
|
+
ethplorerApiKey?: string;
|
21
|
+
/**
|
22
|
+
* @required for BTC, BCH, LTC, DOGE
|
23
|
+
*/
|
24
|
+
blockchairApiKey?: string;
|
25
|
+
/**
|
26
|
+
* @deprecated - use blockchairApiKey instead
|
27
|
+
*/
|
28
|
+
utxoApiKey?: string;
|
29
|
+
/**
|
30
|
+
* @required for Walletconnect
|
31
|
+
*/
|
32
|
+
walletConnectProjectId?: string;
|
33
|
+
/**
|
34
|
+
* @optional for Trezor config
|
35
|
+
*/
|
36
|
+
trezorManifest?: {
|
37
|
+
email: string;
|
38
|
+
appUrl: string;
|
39
|
+
};
|
40
|
+
/**
|
41
|
+
* @optional for KeepKey config
|
42
|
+
*/
|
43
|
+
keepkeyConfig?: {
|
44
|
+
apiKey: string;
|
45
|
+
pairingInfo: {
|
46
|
+
name: string;
|
47
|
+
imageUrl: string;
|
48
|
+
basePath: string;
|
49
|
+
url: string;
|
50
|
+
};
|
51
|
+
};
|
52
|
+
};
|
53
|
+
export type AddChainWalletParams = {
|
54
|
+
chain: Chain;
|
55
|
+
wallet: ChainWallet;
|
56
|
+
walletMethods: any;
|
57
|
+
};
|
58
|
+
export type Witness = {
|
59
|
+
value: number;
|
60
|
+
script: Buffer;
|
61
|
+
};
|
62
|
+
export type FixedNumberish = string | number | FixedNumber;
|
63
|
+
type ApisType = {
|
64
|
+
[key in UTXOChain]?: string | any;
|
65
|
+
} & {
|
66
|
+
[key in EVMChain]?: string | any;
|
67
|
+
} & {
|
68
|
+
[key in CosmosChain]?: string;
|
69
|
+
};
|
70
|
+
export type ConnectWalletParams = {
|
71
|
+
addChain: (params: AddChainWalletParams) => void;
|
72
|
+
config: ConnectConfig;
|
73
|
+
rpcUrls: {
|
74
|
+
[chain in Chain]?: string;
|
75
|
+
};
|
76
|
+
apis: ApisType;
|
77
|
+
};
|
78
|
+
export type ExtendParams<WalletConnectMethodNames = ''> = {
|
79
|
+
excludedChains?: Chain[];
|
80
|
+
config?: ConnectConfig;
|
81
|
+
rpcUrls?: {
|
82
|
+
[chain in Chain]?: string;
|
83
|
+
};
|
84
|
+
apis?: ApisType;
|
85
|
+
wallets: {
|
86
|
+
connectMethodName: ConnectMethodNames | WalletConnectMethodNames;
|
87
|
+
connect: (params: ConnectWalletParams) => (...params: any) => Promise<any>;
|
88
|
+
}[];
|
89
|
+
};
|
90
|
+
export type Asset = {
|
91
|
+
chain: Chain;
|
92
|
+
symbol: string;
|
93
|
+
ticker: string;
|
94
|
+
synth?: boolean;
|
95
|
+
};
|
96
|
+
export declare enum QuoteMode {
|
97
|
+
TC_SUPPORTED_TO_TC_SUPPORTED = "TC-TC",
|
98
|
+
TC_SUPPORTED_TO_ETH = "TC-ERC20",
|
99
|
+
TC_SUPPORTED_TO_AVAX = "TC-ARC20",
|
100
|
+
TC_SUPPORTED_TO_BSC = "TC-BEP20",
|
101
|
+
ETH_TO_TC_SUPPORTED = "ERC20-TC",
|
102
|
+
ETH_TO_ETH = "ERC20-ERC20",
|
103
|
+
ETH_TO_AVAX = "ERC20-ARC20",
|
104
|
+
ETH_TO_BSC = "ERC20-BEP20",
|
105
|
+
AVAX_TO_TC_SUPPORTED = "ARC20-TC",
|
106
|
+
AVAX_TO_ETH = "ARC20-ERC20",
|
107
|
+
AVAX_TO_AVAX = "ARC20-ARC20",
|
108
|
+
AVAX_TO_BSC = "ARC20-BEP20",
|
109
|
+
BSC_TO_TC_SUPPORTED = "BEP20-TC",
|
110
|
+
BSC_TO_ETH = "BEP20-ERC20",
|
111
|
+
BSC_TO_AVAX = "BEP20-ARC20",
|
112
|
+
BSC_TO_BSC = "BEP20-BEP20",
|
113
|
+
GAIA_TO_OSMO = "OSMOSIS-IBC",
|
114
|
+
MAYA_SUPPORTED_TO_MAYA_SUPPORTED = "MAYA_SUPPORTED_TO_MAYA_SUPPORTED",
|
115
|
+
CHANGELLY = "CHANGELLY",
|
116
|
+
RANGO = "RANGO"
|
117
|
+
}
|
118
|
+
export declare const SWAP_TYPES: {
|
119
|
+
AGG_SWAP: QuoteMode[];
|
120
|
+
ETH_TO_ETH: QuoteMode[];
|
121
|
+
SWAP_IN: QuoteMode[];
|
122
|
+
SWAP_OUT: QuoteMode[];
|
123
|
+
OSMOSIS_SWAP: QuoteMode[];
|
124
|
+
CENTRALIZED_SWAPPER: QuoteMode[];
|
125
|
+
UXTO_SWAP: QuoteMode[];
|
126
|
+
RANGO: QuoteMode[];
|
127
|
+
};
|
128
|
+
export declare function classifySwap(quoteMode: QuoteMode): string | null;
|
129
|
+
export {};
|
130
|
+
//# sourceMappingURL=commonTypes.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"commonTypes.d.ts","sourceRoot":"","sources":["../src/commonTypes.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAE1C,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC5E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,KAAK,kBAAkB,GACnB,kBAAkB,GAClB,cAAc,GACd,iBAAiB,GACjB,gBAAgB,GAChB,iBAAiB,GACjB,eAAe,GACf,YAAY,GACZ,eAAe,GACf,sBAAsB,GACtB,cAAc,CAAC;AAEnB,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,GAAG,EAAE,CAAC;IACf,UAAU,EAAE,YAAY,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAE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EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,CAEhE"}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import type { ApiErrorOptions, ERROR_CODE, ERROR_MODULE, ErrorInfo } from './types.ts';
|
2
|
+
import { ERROR_TYPE } from './types.ts';
|
3
|
+
export declare class ApiError extends Error {
|
4
|
+
readonly status: number;
|
5
|
+
readonly revision: string;
|
6
|
+
readonly type?: ERROR_TYPE;
|
7
|
+
readonly module: ERROR_MODULE;
|
8
|
+
readonly code: ERROR_CODE;
|
9
|
+
readonly message: string;
|
10
|
+
readonly display: string;
|
11
|
+
readonly stack?: string;
|
12
|
+
readonly options: ApiErrorOptions;
|
13
|
+
readonly displayMessageParams?: string[];
|
14
|
+
constructor({ status, revision, module, code, message, type, options: { shouldLog, shouldThrow, shouldTrace }, displayMessageParams, }: ErrorInfo);
|
15
|
+
static fromErrorInfo(errorInfo: ErrorInfo): ApiError;
|
16
|
+
toErrorInfo(): ErrorInfo;
|
17
|
+
get identifier(): string;
|
18
|
+
get displayMessage(): string;
|
19
|
+
handle(): ErrorInfo;
|
20
|
+
}
|
21
|
+
//# sourceMappingURL=apiError.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"apiError.d.ts","sourceRoot":"","sources":["../../src/errors/apiError.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvF,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,qBAAa,QAAS,SAAQ,KAAK;IACjC,SAAgB,MAAM,EAAE,MAAM,CAAC;IAC/B,SAAgB,QAAQ,EAAE,MAAM,CAAC;IACjC,SAAgB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClC,SAAgB,MAAM,EAAE,YAAY,CAAC;IACrC,SAAgB,IAAI,EAAE,UAAU,CAAC;IACjC,SAAgB,OAAO,EAAE,MAAM,CAAC;IAChC,SAAgB,OAAO,EAAE,MAAM,CAAC;IAChC,SAAgB,KAAK,CAAC,EAAE,MAAM,CAAC;IAC/B,SAAgB,OAAO,EAAE,eAAe,CAAC;IACzC,SAAgB,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;gBAEpC,EACV,MAAM,EACN,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,OAAO,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAI7C,EACD,oBAAoB,GACrB,EAAE,SAAS;WAqBE,aAAa,CAAC,SAAS,EAAE,SAAS,GAAG,QAAQ;IAIpD,WAAW,IAAI,SAAS;IAI/B,IAAW,UAAU,IAAI,MAAM,CAE9B;IAED,IAAW,cAAc,IAAI,MAAM,CAElC;IAEM,MAAM;CAQd"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"displayMessages.d.ts","sourceRoot":"","sources":["../../src/errors/displayMessages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAsDzD,CAAC;AAEF,eAAO,MAAM,iBAAiB,SAAU,UAAU,wBAAwB,MAAM,EAAE,WASjF,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC"}
|
@@ -0,0 +1,121 @@
|
|
1
|
+
export declare enum ERROR_TYPE {
|
2
|
+
VALIDATION_ERROR = "VALIDATION_ERROR",
|
3
|
+
REQUEST_PARAMETER_ERROR = "REQUEST_PARAMETER_ERROR",
|
4
|
+
RESPONSE_PARSING_ERROR = "RESPONSE_PARSING_ERROR",
|
5
|
+
UNSUPPORTED = "UNSUPPORTED",
|
6
|
+
NOT_IMPLEMENTED = "NOT_IMPLEMENTED",
|
7
|
+
INCOMPATIBLE_ASSETS_OPERATIONS = "INCOMPATIBLE_ASSETS_OPERATIONS",
|
8
|
+
SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE",
|
9
|
+
DOWN_FOR_MAINTENANCE = "DOWN_FOR_MAINTENANCE",
|
10
|
+
MISSING_INBOUND_INFO = "MISSING_INBOUND_INFO",
|
11
|
+
QUOTE_FETCHING_ERROR = "QUOTE_FETCHING_ERROR",
|
12
|
+
AIRDROP_ERROR = "AIRDROP_ERROR",
|
13
|
+
UNHANDLED_ERROR = "UNHANDLED_ERROR"
|
14
|
+
}
|
15
|
+
export declare enum ERROR_MODULE {
|
16
|
+
HEALTH_CONTROLLER = "1000",
|
17
|
+
LIQUIDITY_CONTROLLER = "1001",
|
18
|
+
PROVIDER_CONTROLLER = "1002",
|
19
|
+
QUOTE_CONTROLLER = "1003",
|
20
|
+
SWAP_CONTROLLER = "1004",
|
21
|
+
UTIL_CONTROLLER = "1005",
|
22
|
+
AIRDROP_CONTROLLER = "1006",
|
23
|
+
PROVIDER = "2000",
|
24
|
+
ASSET = "2001",
|
25
|
+
TOKEN_LIST = "2002",
|
26
|
+
QUOTE = "2100",
|
27
|
+
QUOTE_TXN_DETAILS = "2101",
|
28
|
+
THORCHAIN_PROVIDER = "3000",
|
29
|
+
UNISWAPV2_ETH_PROVIDER = "3001",
|
30
|
+
UNISWAPV3_ETH_PROVIDER = "3002",
|
31
|
+
SUSHISWAP_ETH_PROVIDER = "3003",
|
32
|
+
PANCAKESWAP_BSC_PROVIDER = "3004",
|
33
|
+
PANCAKESWAP_ETH_PROVIDER = "3005",
|
34
|
+
ONEINCH_ETH_PROVIDER = "3006",
|
35
|
+
ONEINCH_BSC_PROVIDER = "3007",
|
36
|
+
ONEINCH_AVAX_PROVIDER = "3008",
|
37
|
+
ZEROX_ETH_PROVIDER = "3009",
|
38
|
+
WOOFI_AVAX_PROVIDER = "3010",
|
39
|
+
PANGOLIN_AVAX_PROVIDER = "3011",
|
40
|
+
TRADERJOE_AVAX_PROVIDER = "3012",
|
41
|
+
KYBER_ETH_PROVIDER = "3013",
|
42
|
+
KYBER_AVAX_PROVIDER = "3014",
|
43
|
+
WOOFI_BSC_PROVIDER = "3015",
|
44
|
+
STARGATE_PROVIDER = "3016",
|
45
|
+
PROVIDER_UTIL = "4000",
|
46
|
+
TXN_DETAILS = "5000",
|
47
|
+
AIRDROP_UTIL = "6000"
|
48
|
+
}
|
49
|
+
export declare enum ERROR_CODE {
|
50
|
+
INVALID_INPUT_PARAMETERS = "1000",
|
51
|
+
UNKNOWN_PROVIDERS = "1001",
|
52
|
+
CANNOT_FIND_INBOUND_ADDRESS = "1002",
|
53
|
+
NO_INBOUND_ADDRESSES = "1003",
|
54
|
+
CHAIN_HALTED_OR_UNSUPPORTED = "1004",
|
55
|
+
MISSING_INPUT_PARAMETER = "1005",
|
56
|
+
INVALID_TYPE_GENERIC = "1100",
|
57
|
+
INVALID_NUMBER_STRING = "1101",
|
58
|
+
INVALID_NUMBER = "1102",
|
59
|
+
INVALID_BOOLEAN = "1103",
|
60
|
+
INVALID_OBJECT = "1104",
|
61
|
+
INVALID_ARRAY = "1105",
|
62
|
+
SELL_AMOUNT_MUST_BE_POSITIVE_INTEGER = "2000",
|
63
|
+
SELL_BUY_ASSETS_ARE_THE_SAME = "2001",
|
64
|
+
MISSING_SOURCE_ADDRESS_FOR_SYNTH = "2002",
|
65
|
+
AFF_ADDRESS_AND_BPS_OR_NEITHER = "2003",
|
66
|
+
AFF_ADDRESS_TOO_LONG = "2004",
|
67
|
+
AFF_BPS_INTEGER_0_100 = "2005",
|
68
|
+
SOURCE_ADDRESS_INVALID_FOR_SELL_CHAIN = "2006",
|
69
|
+
DESTINATION_ADDRESS_INVALID_FOR_BUY_CHAIN = "2007",
|
70
|
+
PREFERRED_PROFVIDER_NOT_SUPPORTED = "2008",
|
71
|
+
DESTINATION_ADDRESS_SMART_CONTRACT = "2009",
|
72
|
+
BUY_AMOUNT_MUST_BE_POSITIVE_INTEGER = "2010",
|
73
|
+
SOURCE_ADDRESS_SMART_CONTRACT = "2011",
|
74
|
+
INVALID_PROVIDER = "2100",
|
75
|
+
MISSING_CROSS_CHAIN_PROVIDER = "2101",
|
76
|
+
MISSING_AVAX_PROVIDER = "2102",
|
77
|
+
MISSING_BSC_PROVIDER = "2103",
|
78
|
+
MISSING_ETH_PROVIDER = "2104",
|
79
|
+
INVALID_PROVIDER_FOR_SWAP_OUT = "2105",
|
80
|
+
MISSING_ARB_PROVIDER = "2106",
|
81
|
+
INVALID_CHAIN = "2200",
|
82
|
+
INVALID_ASSET = "2201",
|
83
|
+
INVALID_ASSET_IDENTIFIER = "2202",
|
84
|
+
UNSUPPORTED_CHAIN = "2204",
|
85
|
+
UNSUPPORTED_ASSET = "2203",
|
86
|
+
UNSUPPORTED_ASSET_FOR_SWAPOUT = "2205",
|
87
|
+
INVALID_SOURCE_ADDRESS = "2300",
|
88
|
+
INVALID_DESTINATION_ADDRESS = "2301",
|
89
|
+
THORNODE_QUOTE_GENERIC_ERROR = "3000",
|
90
|
+
NOT_ENOUGH_SYNTH_BALANCE = "3001",
|
91
|
+
SYNTH_MINTING_CAP_REACHED = "3002",
|
92
|
+
INVALID_QUOTE_MODE = "4000",
|
93
|
+
NO_QUOTES = "4001",
|
94
|
+
SERVICE_UNAVAILABLE_GENERIC = "5000",
|
95
|
+
MISSING_GAS_DATA_GENERIC = "5100",
|
96
|
+
MISSING_TOKEN_INFO_GENERIC = "5200",
|
97
|
+
CANT_FIND_TOKEN_LIST = "5201",
|
98
|
+
NO_PRICE = "5202",
|
99
|
+
PRICE_IS_STALE = "5203",
|
100
|
+
ADDRESS_NOT_WHITELISTED = "6000",
|
101
|
+
ADDRESS_ALREADY_CLAIMED = "6001",
|
102
|
+
TEMPORARY_ERROR = "9999"
|
103
|
+
}
|
104
|
+
export type ErrorInfo = {
|
105
|
+
status: number;
|
106
|
+
revision: string;
|
107
|
+
type?: ERROR_TYPE;
|
108
|
+
module: ERROR_MODULE;
|
109
|
+
code: ERROR_CODE;
|
110
|
+
message?: string | undefined;
|
111
|
+
stack?: string;
|
112
|
+
identifier?: string;
|
113
|
+
options?: ApiErrorOptions;
|
114
|
+
displayMessageParams?: string[];
|
115
|
+
};
|
116
|
+
export type ApiErrorOptions = {
|
117
|
+
shouldLog?: boolean;
|
118
|
+
shouldTrace?: boolean;
|
119
|
+
shouldThrow?: boolean;
|
120
|
+
};
|
121
|
+
//# sourceMappingURL=types.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/errors/types.ts"],"names":[],"mappings":"AAAA,oBAAY,UAAU;IACpB,gBAAgB,qBAAqB;IACrC,uBAAuB,4BAA4B;IACnD,sBAAsB,2BAA2B;IACjD,WAAW,gBAAgB;IAC3B,eAAe,oBAAoB;IACnC,8BAA8B,mCAAmC;IACjE,mBAAmB,wBAAwB;IAC3C,oBAAoB,yBAAyB;IAC7C,oBAAoB,yBAAyB;IAC7C,oBAAoB,yBAAyB;IAC7C,aAAa,kBAAkB;IAC/B,eAAe,oBAAoB;CACpC;AAED,oBAAY,YAAY;IAEtB,iBAAiB,SAAS;IAC1B,oBAAoB,SAAS;IAC7B,mBAAmB,SAAS;IAC5B,gBAAgB,SAAS;IACzB,eAAe,SAAS;IACxB,eAAe,SAAS;IACxB,kBAAkB,SAAS;IAE3B,QAAQ,SAAS;IACjB,KAAK,SAAS;IACd,UAAU,SAAS;IAEnB,KAAK,SAAS;IACd,iBAAiB,SAAS;IAE1B,kBAAkB,SAAS;IAC3B,sBAAsB,SAAS;IAC/B,sBAAsB,SAAS;IAC/B,sBAAsB,SAAS;IAC/B,wBAAwB,SAAS;IACjC,wBAAwB,SAAS;IACjC,oBAAoB,SAAS;IAC7B,oBAAoB,SAAS;IAC7B,qBAAqB,SAAS;IAC9B,kBAAkB,SAAS;IAC3B,mBAAmB,SAAS;IAC5B,sBAAsB,SAAS;IAC/B,uBAAuB,SAAS;I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