@swapkit/types 1.0.0-rc.37 → 1.0.0-rc.38
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/index.cjs +1 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +22 -171
- package/dist/index.es.js +67 -189
- package/dist/index.es.js.map +1 -1
- package/package.json +5 -10
- package/src/abis/erc20.ts +57 -57
- package/src/abis/tcEthVault.ts +284 -284
- package/src/chainflip.ts +8 -8
- package/src/commonTypes.ts +40 -44
- package/src/index.ts +7 -8
- package/src/network.ts +98 -98
- package/src/thorchain.ts +8 -8
- package/src/transactions.ts +3 -3
- package/src/wallet.ts +13 -13
- package/src/errors/apiError.ts +0 -75
- package/src/errors/displayMessages.ts +0 -72
- package/src/errors/index.ts +0 -2
- package/src/errors/types.ts +0 -145
package/src/errors/types.ts
DELETED
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
export 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
|
-
|
|
16
|
-
export enum ERROR_MODULE {
|
|
17
|
-
// Controllers
|
|
18
|
-
HEALTH_CONTROLLER = '1000',
|
|
19
|
-
LIQUIDITY_CONTROLLER = '1001',
|
|
20
|
-
PROVIDER_CONTROLLER = '1002',
|
|
21
|
-
QUOTE_CONTROLLER = '1003',
|
|
22
|
-
SWAP_CONTROLLER = '1004',
|
|
23
|
-
UTIL_CONTROLLER = '1005',
|
|
24
|
-
AIRDROP_CONTROLLER = '1006',
|
|
25
|
-
// Entities
|
|
26
|
-
PROVIDER = '2000',
|
|
27
|
-
ASSET = '2001',
|
|
28
|
-
TOKEN_LIST = '2002',
|
|
29
|
-
// Quote entities
|
|
30
|
-
QUOTE = '2100',
|
|
31
|
-
QUOTE_TXN_DETAILS = '2101',
|
|
32
|
-
// Providers
|
|
33
|
-
THORCHAIN_PROVIDER = '3000',
|
|
34
|
-
UNISWAPV2_ETH_PROVIDER = '3001',
|
|
35
|
-
UNISWAPV3_ETH_PROVIDER = '3002',
|
|
36
|
-
SUSHISWAP_ETH_PROVIDER = '3003',
|
|
37
|
-
PANCAKESWAP_BSC_PROVIDER = '3004',
|
|
38
|
-
PANCAKESWAP_ETH_PROVIDER = '3005',
|
|
39
|
-
ONEINCH_ETH_PROVIDER = '3006',
|
|
40
|
-
ONEINCH_BSC_PROVIDER = '3007',
|
|
41
|
-
ONEINCH_AVAX_PROVIDER = '3008',
|
|
42
|
-
ZEROX_ETH_PROVIDER = '3009',
|
|
43
|
-
WOOFI_AVAX_PROVIDER = '3010',
|
|
44
|
-
PANGOLIN_AVAX_PROVIDER = '3011',
|
|
45
|
-
TRADERJOE_AVAX_PROVIDER = '3012',
|
|
46
|
-
KYBER_ETH_PROVIDER = '3013',
|
|
47
|
-
KYBER_AVAX_PROVIDER = '3014',
|
|
48
|
-
WOOFI_BSC_PROVIDER = '3015',
|
|
49
|
-
STARGATE_PROVIDER = '3016',
|
|
50
|
-
// Utilities
|
|
51
|
-
PROVIDER_UTIL = '4000',
|
|
52
|
-
// Aggregator
|
|
53
|
-
TXN_DETAILS = '5000',
|
|
54
|
-
// AirDrop
|
|
55
|
-
AIRDROP_UTIL = '6000',
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export enum ERROR_CODE {
|
|
59
|
-
// 10xx - Generic
|
|
60
|
-
INVALID_INPUT_PARAMETERS = '1000',
|
|
61
|
-
UNKNOWN_PROVIDERS = '1001',
|
|
62
|
-
CANNOT_FIND_INBOUND_ADDRESS = '1002',
|
|
63
|
-
NO_INBOUND_ADDRESSES = '1003',
|
|
64
|
-
CHAIN_HALTED_OR_UNSUPPORTED = '1004',
|
|
65
|
-
MISSING_INPUT_PARAMETER = '1005',
|
|
66
|
-
// 11xx - Type error
|
|
67
|
-
INVALID_TYPE_GENERIC = '1100',
|
|
68
|
-
INVALID_NUMBER_STRING = '1101',
|
|
69
|
-
INVALID_NUMBER = '1102',
|
|
70
|
-
INVALID_BOOLEAN = '1103',
|
|
71
|
-
INVALID_OBJECT = '1104',
|
|
72
|
-
INVALID_ARRAY = '1105',
|
|
73
|
-
// 20xx - Quote request parameters
|
|
74
|
-
SELL_AMOUNT_MUST_BE_POSITIVE_INTEGER = '2000',
|
|
75
|
-
SELL_BUY_ASSETS_ARE_THE_SAME = '2001',
|
|
76
|
-
MISSING_SOURCE_ADDRESS_FOR_SYNTH = '2002',
|
|
77
|
-
AFF_ADDRESS_AND_BPS_OR_NEITHER = '2003',
|
|
78
|
-
AFF_ADDRESS_TOO_LONG = '2004',
|
|
79
|
-
AFF_BPS_INTEGER_MAX_500 = '2005',
|
|
80
|
-
SOURCE_ADDRESS_INVALID_FOR_SELL_CHAIN = '2006',
|
|
81
|
-
DESTINATION_ADDRESS_INVALID_FOR_BUY_CHAIN = '2007',
|
|
82
|
-
PREFERRED_PROVIDER_NOT_SUPPORTED = '2008',
|
|
83
|
-
DESTINATION_ADDRESS_SMART_CONTRACT = '2009',
|
|
84
|
-
BUY_AMOUNT_MUST_BE_POSITIVE_INTEGER = '2010',
|
|
85
|
-
SOURCE_ADDRESS_SMART_CONTRACT = '2011',
|
|
86
|
-
SWAP_AMOUNT_TOO_LOW = '2012',
|
|
87
|
-
// 21xx - Quote request providers issue
|
|
88
|
-
INVALID_PROVIDER = '2100',
|
|
89
|
-
MISSING_CROSS_CHAIN_PROVIDER = '2101',
|
|
90
|
-
MISSING_AVAX_PROVIDER = '2102',
|
|
91
|
-
MISSING_BSC_PROVIDER = '2103',
|
|
92
|
-
MISSING_ETH_PROVIDER = '2104',
|
|
93
|
-
INVALID_PROVIDER_FOR_SWAP_OUT = '2105',
|
|
94
|
-
MISSING_ARB_PROVIDER = '2106',
|
|
95
|
-
// 22xx - Quote request assets issue
|
|
96
|
-
INVALID_CHAIN = '2200',
|
|
97
|
-
INVALID_ASSET = '2201',
|
|
98
|
-
INVALID_ASSET_IDENTIFIER = '2202',
|
|
99
|
-
UNSUPPORTED_CHAIN = '2204',
|
|
100
|
-
UNSUPPORTED_ASSET = '2203',
|
|
101
|
-
UNSUPPORTED_ASSET_FOR_SWAPOUT = '2205',
|
|
102
|
-
// 23xx - Invalid addresses
|
|
103
|
-
INVALID_SOURCE_ADDRESS = '2300',
|
|
104
|
-
INVALID_DESTINATION_ADDRESS = '2301',
|
|
105
|
-
// 30xx - Thorchain
|
|
106
|
-
THORNODE_QUOTE_GENERIC_ERROR = '3000',
|
|
107
|
-
NOT_ENOUGH_SYNTH_BALANCE = '3001',
|
|
108
|
-
SYNTH_MINTING_CAP_REACHED = '3002',
|
|
109
|
-
// 40xx - Code logic error (not the client's fault)
|
|
110
|
-
INVALID_QUOTE_MODE = '4000',
|
|
111
|
-
NO_QUOTES = '4001',
|
|
112
|
-
// 50xx - Service unavailable
|
|
113
|
-
SERVICE_UNAVAILABLE_GENERIC = '5000',
|
|
114
|
-
// 51xx - Missing gas data
|
|
115
|
-
MISSING_GAS_DATA_GENERIC = '5100',
|
|
116
|
-
// 52xx - Missing token info
|
|
117
|
-
MISSING_TOKEN_INFO_GENERIC = '5200',
|
|
118
|
-
CANT_FIND_TOKEN_LIST = '5201',
|
|
119
|
-
NO_PRICE = '5202',
|
|
120
|
-
PRICE_IS_STALE = '5203',
|
|
121
|
-
// 60xx - Airdrop
|
|
122
|
-
ADDRESS_NOT_WHITELISTED = '6000',
|
|
123
|
-
ADDRESS_ALREADY_CLAIMED = '6001',
|
|
124
|
-
// 90xx - Unhandled
|
|
125
|
-
TEMPORARY_ERROR = '9999', // use only when waiting for a PR to be merged
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
export type ErrorInfo = {
|
|
129
|
-
status: number;
|
|
130
|
-
revision: string;
|
|
131
|
-
type?: ERROR_TYPE;
|
|
132
|
-
module: ERROR_MODULE;
|
|
133
|
-
code: ERROR_CODE;
|
|
134
|
-
message?: string | undefined;
|
|
135
|
-
stack?: string;
|
|
136
|
-
identifier?: string;
|
|
137
|
-
options?: ApiErrorOptions;
|
|
138
|
-
displayMessageParams?: string[];
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
export type ApiErrorOptions = {
|
|
142
|
-
shouldLog?: boolean;
|
|
143
|
-
shouldTrace?: boolean;
|
|
144
|
-
shouldThrow?: boolean;
|
|
145
|
-
};
|