@0xsquid/squid-types 0.1.45 → 0.1.47

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.
Files changed (41) hide show
  1. package/README.md +43 -1
  2. package/dist/bridges/index.d.ts +14 -0
  3. package/dist/bridges/index.js +8 -4
  4. package/dist/bridges/index.js.map +1 -0
  5. package/dist/chains/index.d.ts +213 -0
  6. package/dist/chains/index.js +12 -8
  7. package/dist/chains/index.js.map +1 -0
  8. package/dist/dexes/index.d.ts +81 -0
  9. package/dist/dexes/index.js +8 -4
  10. package/dist/dexes/index.js.map +1 -0
  11. package/dist/errors/index.d.ts +9 -0
  12. package/dist/errors/index.js +3 -1
  13. package/dist/errors/index.js.map +1 -0
  14. package/dist/fees/index.d.ts +26 -0
  15. package/dist/fees/index.js +8 -4
  16. package/dist/fees/index.js.map +1 -0
  17. package/dist/index.d.ts +12 -0
  18. package/dist/index.js +29 -12
  19. package/dist/index.js.map +1 -0
  20. package/dist/path/index.d.ts +64 -0
  21. package/dist/path/index.js +3 -1
  22. package/dist/path/index.js.map +1 -0
  23. package/dist/quote/index.d.ts +23 -0
  24. package/dist/quote/index.js +3 -1
  25. package/dist/quote/index.js.map +1 -0
  26. package/dist/routes/index.d.ts +161 -0
  27. package/dist/routes/index.js +8 -4
  28. package/dist/routes/index.js.map +1 -0
  29. package/dist/squid/index.d.ts +64 -0
  30. package/dist/squid/index.js +10 -6
  31. package/dist/squid/index.js.map +1 -0
  32. package/dist/status/index.d.ts +60 -0
  33. package/dist/status/index.js +8 -4
  34. package/dist/status/index.js.map +1 -0
  35. package/dist/tokens/index.d.ts +39 -0
  36. package/dist/tokens/index.js +6 -2
  37. package/dist/tokens/index.js.map +1 -0
  38. package/dist/wrappers/index.d.ts +20 -0
  39. package/dist/wrappers/index.js +8 -4
  40. package/dist/wrappers/index.js.map +1 -0
  41. package/package.json +1 -1
package/README.md CHANGED
@@ -1,3 +1,45 @@
1
1
  # Squid Types
2
2
 
3
- Squid types used on the graph, api and sdk
3
+ Squid types used on the graph, api and sdk.
4
+
5
+ ### LINTER & PRETTIER
6
+
7
+ This project has installed prettier and linter rules, with husky we ensure pre-commit and pre-push validation.
8
+
9
+ ```bash
10
+ yarn lint
11
+ ```
12
+
13
+ ```bash
14
+ yarn lint:fix
15
+ ```
16
+
17
+ ```bash
18
+ yarn format
19
+ ```
20
+
21
+ ### VSCODE
22
+
23
+ Create `.vscode/setting.json` for auto-saving linter and prettier format
24
+
25
+ ```json
26
+ {
27
+ "editor.formatOnSave": true,
28
+ "editor.codeActionsOnSave": {
29
+ "source.fixAll.eslint": true
30
+ },
31
+ "[json]": {
32
+ "editor.defaultFormatter": "esbenp.prettier-vscode"
33
+ }
34
+ }
35
+ ```
36
+
37
+ # RELEASE
38
+
39
+ NPM package publish is automated with github actions, follow these steps:
40
+
41
+ 1 - Create a PR to `develop` branch updating `package.json` version. (review, approve and merge)
42
+
43
+ 2 - Create a PR from `develop` to `main`. (review, approve and merge)
44
+
45
+ Once the PR to `main` is merged, this commit on this branch gonna trigger automatically the release to NPM, please make sure you update correctly the version.
@@ -0,0 +1,14 @@
1
+ export declare enum BridgeType {
2
+ AXELAR_GMP = "gmp",
3
+ AXELAR_ITS = "its",
4
+ CCTP = "cctp",
5
+ NOBLE_CCTP = "noble-cctp",
6
+ IBC = "ibc"
7
+ }
8
+ export declare enum BridgeProvider {
9
+ AXELAR = "axelar",
10
+ CCTP = "cctp",
11
+ NOBLE_CCTP = "noble-cctp",
12
+ IBC = "ibc"
13
+ }
14
+ export type BridgeConfig = Record<string, string>;
@@ -1,15 +1,19 @@
1
- export var BridgeType;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BridgeProvider = exports.BridgeType = void 0;
4
+ var BridgeType;
2
5
  (function (BridgeType) {
3
6
  BridgeType["AXELAR_GMP"] = "gmp";
4
7
  BridgeType["AXELAR_ITS"] = "its";
5
8
  BridgeType["CCTP"] = "cctp";
6
9
  BridgeType["NOBLE_CCTP"] = "noble-cctp";
7
10
  BridgeType["IBC"] = "ibc";
8
- })(BridgeType || (BridgeType = {}));
9
- export var BridgeProvider;
11
+ })(BridgeType || (exports.BridgeType = BridgeType = {}));
12
+ var BridgeProvider;
10
13
  (function (BridgeProvider) {
11
14
  BridgeProvider["AXELAR"] = "axelar";
12
15
  BridgeProvider["CCTP"] = "cctp";
13
16
  BridgeProvider["NOBLE_CCTP"] = "noble-cctp";
14
17
  BridgeProvider["IBC"] = "ibc";
15
- })(BridgeProvider || (BridgeProvider = {}));
18
+ })(BridgeProvider || (exports.BridgeProvider = BridgeProvider = {}));
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/bridges/index.ts"],"names":[],"mappings":";;;AAAA,IAAY,UAMX;AAND,WAAY,UAAU;IACpB,gCAAkB,CAAA;IAClB,gCAAkB,CAAA;IAClB,2BAAa,CAAA;IACb,uCAAyB,CAAA;IACzB,yBAAW,CAAA;AACb,CAAC,EANW,UAAU,0BAAV,UAAU,QAMrB;AAED,IAAY,cAKX;AALD,WAAY,cAAc;IACxB,mCAAiB,CAAA;IACjB,+BAAa,CAAA;IACb,2CAAyB,CAAA;IACzB,6BAAW,CAAA;AACb,CAAC,EALW,cAAc,8BAAd,cAAc,QAKzB"}
@@ -0,0 +1,213 @@
1
+ import { BridgeConfig } from "bridges";
2
+ export declare enum ChainType {
3
+ EVM = "evm",
4
+ COSMOS = "cosmos"
5
+ }
6
+ export type BaseChain = {
7
+ chainId: string;
8
+ chainType: ChainType;
9
+ axelarChainName: ChainName;
10
+ networkIdentifier: NetworkIdentifier;
11
+ networkName: string;
12
+ rpc: string;
13
+ internalRpc: string;
14
+ chainIconURI: string;
15
+ blockExplorerUrls: string[];
16
+ enableBoostByDefault: boolean;
17
+ estimatedRouteDuration: number;
18
+ estimatedBoostRouteDuration: number;
19
+ swapAmountForGas: string;
20
+ sameChainSwapsSupported: boolean;
21
+ nativeCurrency: {
22
+ name: string;
23
+ symbol: string;
24
+ decimals: number;
25
+ icon: string;
26
+ };
27
+ squidContracts: {
28
+ defaultCrosschainToken: string;
29
+ squidRouter?: string;
30
+ squidMulticall?: string;
31
+ squidFeeCollector?: string;
32
+ };
33
+ bridges: {
34
+ [key: string]: BridgeConfig;
35
+ };
36
+ };
37
+ export type EvmChain = BaseChain & {
38
+ chainNativeContracts: {
39
+ wrappedNativeToken: string;
40
+ ensRegistry: string;
41
+ multicall: string;
42
+ usdcToken: string;
43
+ };
44
+ gas?: {
45
+ lastBaseFeePerGas: string;
46
+ maxFeePerGas: string;
47
+ maxPriorityFeePerGas: string;
48
+ gasPrice: string;
49
+ };
50
+ };
51
+ export type CosmosChain = BaseChain & {
52
+ rest: string;
53
+ stakeCurrency: CosmosCurrency;
54
+ walletUrl?: string;
55
+ walletUrlForStaking?: string;
56
+ bip44: BIP44;
57
+ alternativeBIP44s?: BIP44[];
58
+ bech32Config: Bech32Config;
59
+ currencies: CosmosCurrency[];
60
+ feeCurrencies: CosmosCurrency[];
61
+ coinType?: number;
62
+ features?: string[];
63
+ gasPriceStep?: CosmosGasType;
64
+ chainToAxelarChannelId: string;
65
+ };
66
+ export type CosmosCurrency = {
67
+ coinDenom: string;
68
+ coinMinimalDenom: string;
69
+ coinDecimals: number;
70
+ coingeckoId?: string;
71
+ gasPriceStep?: CosmosGasType;
72
+ };
73
+ export type BIP44 = {
74
+ coinType: number;
75
+ };
76
+ export type Bech32Config = {
77
+ bech32PrefixAccAddr: string;
78
+ bech32PrefixAccPub: string;
79
+ bech32PrefixValAddr: string;
80
+ bech32PrefixValPub: string;
81
+ bech32PrefixConsAddr: string;
82
+ bech32PrefixConsPub: string;
83
+ };
84
+ export type CosmosGasType = {
85
+ low: number;
86
+ average: number;
87
+ high: number;
88
+ };
89
+ export type ChainData = EvmChain | CosmosChain;
90
+ export declare enum ChainName {
91
+ ARBITRUM = "Arbitrum",
92
+ ARBITRUM2 = "arbitrum",//testnet
93
+ AURORA = "aurora",
94
+ AVALANCHE = "Avalanche",
95
+ BASE = "base",
96
+ BINANCE = "binance",
97
+ CELO = "celo",
98
+ CENTRIFUGE = "centrifuge",
99
+ ETHEREUM = "Ethereum",
100
+ ETHEREUM2 = "Ethereum-2",//testnet
101
+ FANTOM = "Fantom",
102
+ FILECOIN = "filecoin",
103
+ FILECOIN2 = "filecoin-2",//testnet
104
+ KAVA = "kava",
105
+ MANTLE = "mantle",
106
+ MOONBEAM = "Moonbeam",
107
+ OPTIMISM = "optimism",
108
+ POLYGON_ZKEVM = "polygon-zkevm",
109
+ POLYGON = "Polygon",
110
+ LINEA = "linea",
111
+ SCROLL = "scroll",
112
+ AGORIC = "agoric",
113
+ ASSETMANTLE = "assetmantle",
114
+ AURA = "aura",
115
+ AXELARNET = "axelarnet",
116
+ CARBON = "carbon",
117
+ COMDEX = "comdex",
118
+ COSMOS = "cosmoshub",
119
+ CRESCENT = "crescent",
120
+ EMONEY = "e-money",
121
+ EVMOS = "evmos",
122
+ FETCH = "fetch",
123
+ INJECTIVE = "injective",
124
+ JUNO = "juno",
125
+ KI = "ki",
126
+ KUJIRA = "kujira",
127
+ NOBLE = "noble",
128
+ OSMOSIS = "osmosis",
129
+ OSMOSIS5 = "osmosis-5",//testnet
130
+ REGEN = "regen",
131
+ SEI = "sei",
132
+ SECRET = "secret",//deprecated
133
+ SECRETSNIP = "secret-snip",
134
+ STARGAZE = "stargaze",
135
+ STRIDE = "stride",
136
+ TERRA2 = "terra-2",
137
+ UMEE = "umee"
138
+ }
139
+ export declare enum NetworkIdentifier {
140
+ ETHEREUM = "Ethereum",
141
+ AVALANCHE = "Avalanche",
142
+ ARBITRUM = "Arbitrum",
143
+ AURORA = "Aurora",
144
+ BASE = "Base",
145
+ BINANCE = "Binance",
146
+ CELO = "Celo",
147
+ FANTOM = "Fantom",
148
+ FILECOIN = "Filecoin",
149
+ KAVA = "Kava",
150
+ MANTLE = "Mantle",
151
+ MOONBEAM = "Moonbeam",
152
+ OPTIMISM = "Optimism",
153
+ POLYGON = "Polygon",
154
+ LINEA = "Linea",
155
+ SCROLL = "Scroll",
156
+ AGORIC = "agoric",
157
+ ASSETMANTLE = "assetmantle",
158
+ AURA = "Aura",
159
+ AXELAR = "Axelar",
160
+ AXELARNET = "Axelarnet",
161
+ CARBON = "Carbon",
162
+ COMDEX = "Comdex",
163
+ COSMOS = "Cosmoshub",
164
+ CRESCENT = "Crescent",
165
+ EMONEY = "E-money",
166
+ EVMOS = "Evmos",
167
+ FETCH = "Fetch",
168
+ INJECTIVE = "Injective",
169
+ JUNO = "Juno",
170
+ KI = "Ki",
171
+ KUJIRA = "Kujira",
172
+ NOBLE = "Noble",
173
+ OSMOSIS = "Osmosis",
174
+ REGEN = "Regen",
175
+ SEI = "Sei",
176
+ SECRET = "Secret",//deprecated
177
+ SECRETSNIP = "Secret-snip",
178
+ STARGAZE = "Stargaze",
179
+ STRIDE = "Stride",
180
+ TERRA2 = "Terra-2",
181
+ UMEE = "Umee"
182
+ }
183
+ export type ChainIBCInfo = {
184
+ chain_id: string;
185
+ client_id: string;
186
+ connection_id: string;
187
+ };
188
+ export type Channel = {
189
+ chain_1: {
190
+ channel_id: string;
191
+ port_id: string;
192
+ };
193
+ chain_2: {
194
+ channel_id: string;
195
+ port_id: string;
196
+ };
197
+ ordering: string;
198
+ version: string;
199
+ tags: {
200
+ status: string;
201
+ preferred?: boolean;
202
+ dex?: string;
203
+ };
204
+ };
205
+ export type IbcData = {
206
+ chain_1: ChainIBCInfo;
207
+ chain_2: ChainIBCInfo;
208
+ channels: Channel[];
209
+ };
210
+ export declare enum CosmosChainFeatures {
211
+ PACKET_FORWARD_MIDDLEWARE = "packet-forward-middleware",
212
+ COSMWASM = "cosmwasm"
213
+ }
@@ -1,9 +1,12 @@
1
- export var ChainType;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CosmosChainFeatures = exports.NetworkIdentifier = exports.ChainName = exports.ChainType = void 0;
4
+ var ChainType;
2
5
  (function (ChainType) {
3
6
  ChainType["EVM"] = "evm";
4
7
  ChainType["COSMOS"] = "cosmos";
5
- })(ChainType || (ChainType = {}));
6
- export var ChainName;
8
+ })(ChainType || (exports.ChainType = ChainType = {}));
9
+ var ChainName;
7
10
  (function (ChainName) {
8
11
  ChainName["ARBITRUM"] = "Arbitrum";
9
12
  ChainName["ARBITRUM2"] = "arbitrum";
@@ -53,8 +56,8 @@ export var ChainName;
53
56
  ChainName["STRIDE"] = "stride";
54
57
  ChainName["TERRA2"] = "terra-2";
55
58
  ChainName["UMEE"] = "umee";
56
- })(ChainName || (ChainName = {}));
57
- export var NetworkIdentifier;
59
+ })(ChainName || (exports.ChainName = ChainName = {}));
60
+ var NetworkIdentifier;
58
61
  (function (NetworkIdentifier) {
59
62
  // EVM
60
63
  NetworkIdentifier["ETHEREUM"] = "Ethereum";
@@ -100,9 +103,10 @@ export var NetworkIdentifier;
100
103
  NetworkIdentifier["STRIDE"] = "Stride";
101
104
  NetworkIdentifier["TERRA2"] = "Terra-2";
102
105
  NetworkIdentifier["UMEE"] = "Umee";
103
- })(NetworkIdentifier || (NetworkIdentifier = {}));
104
- export var CosmosChainFeatures;
106
+ })(NetworkIdentifier || (exports.NetworkIdentifier = NetworkIdentifier = {}));
107
+ var CosmosChainFeatures;
105
108
  (function (CosmosChainFeatures) {
106
109
  CosmosChainFeatures["PACKET_FORWARD_MIDDLEWARE"] = "packet-forward-middleware";
107
110
  CosmosChainFeatures["COSMWASM"] = "cosmwasm";
108
- })(CosmosChainFeatures || (CosmosChainFeatures = {}));
111
+ })(CosmosChainFeatures || (exports.CosmosChainFeatures = CosmosChainFeatures = {}));
112
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/chains/index.ts"],"names":[],"mappings":";;;AAEA,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,8BAAiB,CAAA;AACnB,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB;AA8FD,IAAY,SAkDX;AAlDD,WAAY,SAAS;IACnB,kCAAqB,CAAA;IACrB,mCAAsB,CAAA;IACtB,8BAAiB,CAAA;IACjB,oCAAuB,CAAA;IACvB,0BAAa,CAAA;IACb,gCAAmB,CAAA;IACnB,0BAAa,CAAA;IACb,sCAAyB,CAAA;IACzB,kCAAqB,CAAA;IACrB,qCAAwB,CAAA;IACxB,8BAAiB,CAAA;IACjB,kCAAqB,CAAA;IACrB,qCAAwB,CAAA;IACxB,0BAAa,CAAA;IACb,8BAAiB,CAAA;IACjB,kCAAqB,CAAA;IACrB,kCAAqB,CAAA;IACrB,4CAA+B,CAAA;IAC/B,gCAAmB,CAAA;IACnB,4BAAe,CAAA;IACf,8BAAiB,CAAA;IAEjB,SAAS;IACT,8BAAiB,CAAA;IACjB,wCAA2B,CAAA;IAC3B,0BAAa,CAAA;IACb,oCAAuB,CAAA;IACvB,8BAAiB,CAAA;IACjB,8BAAiB,CAAA;IACjB,iCAAoB,CAAA;IACpB,kCAAqB,CAAA;IACrB,+BAAkB,CAAA;IAClB,4BAAe,CAAA;IACf,4BAAe,CAAA;IACf,oCAAuB,CAAA;IACvB,0BAAa,CAAA;IACb,sBAAS,CAAA;IACT,8BAAiB,CAAA;IACjB,4BAAe,CAAA;IACf,gCAAmB,CAAA;IACnB,mCAAsB,CAAA;IACtB,4BAAe,CAAA;IACf,wBAAW,CAAA;IACX,8BAAiB,CAAA;IACjB,uCAA0B,CAAA;IAC1B,kCAAqB,CAAA;IACrB,8BAAiB,CAAA;IACjB,+BAAkB,CAAA;IAClB,0BAAa,CAAA;AACf,CAAC,EAlDW,SAAS,yBAAT,SAAS,QAkDpB;AAED,IAAY,iBA8CX;AA9CD,WAAY,iBAAiB;IAC3B,MAAM;IACN,0CAAqB,CAAA;IACrB,4CAAuB,CAAA;IACvB,0CAAqB,CAAA;IACrB,sCAAiB,CAAA;IACjB,kCAAa,CAAA;IACb,wCAAmB,CAAA;IACnB,kCAAa,CAAA;IACb,sCAAiB,CAAA;IACjB,0CAAqB,CAAA;IACrB,kCAAa,CAAA;IACb,sCAAiB,CAAA;IACjB,0CAAqB,CAAA;IACrB,0CAAqB,CAAA;IACrB,wCAAmB,CAAA;IACnB,oCAAe,CAAA;IACf,sCAAiB,CAAA;IAEjB,SAAS;IACT,sCAAiB,CAAA;IACjB,gDAA2B,CAAA;IAC3B,kCAAa,CAAA;IACb,sCAAiB,CAAA;IACjB,4CAAuB,CAAA;IACvB,sCAAiB,CAAA;IACjB,sCAAiB,CAAA;IACjB,yCAAoB,CAAA;IACpB,0CAAqB,CAAA;IACrB,uCAAkB,CAAA;IAClB,oCAAe,CAAA;IACf,oCAAe,CAAA;IACf,4CAAuB,CAAA;IACvB,kCAAa,CAAA;IACb,8BAAS,CAAA;IACT,sCAAiB,CAAA;IACjB,oCAAe,CAAA;IACf,wCAAmB,CAAA;IACnB,oCAAe,CAAA;IACf,gCAAW,CAAA;IACX,sCAAiB,CAAA;IACjB,+CAA0B,CAAA;IAC1B,0CAAqB,CAAA;IACrB,sCAAiB,CAAA;IACjB,uCAAkB,CAAA;IAClB,kCAAa,CAAA;AACf,CAAC,EA9CW,iBAAiB,iCAAjB,iBAAiB,QA8C5B;AAgCD,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC7B,8EAAuD,CAAA;IACvD,4CAAqB,CAAA;AACvB,CAAC,EAHW,mBAAmB,mCAAnB,mBAAmB,QAG9B"}
@@ -0,0 +1,81 @@
1
+ export interface Dex {
2
+ name: DexName;
3
+ chainId: string;
4
+ type: DexType;
5
+ properties: Record<string, any>;
6
+ }
7
+ export declare enum DexName {
8
+ AGNI_V3 = "Agni-v3",
9
+ AERODROME = "Aerodrome",
10
+ APESWAP = "Apeswap",
11
+ APESWAP_V3 = "Apeswap-v3",
12
+ BALANCER_V2 = "Balancer-v2",
13
+ BASESWAP = "Baseswap",
14
+ BASESWAP_V3 = "Baseswap-v3",
15
+ BEAMSWAP = "Beamswap",
16
+ CAMELOT = "Camelot",
17
+ CURVE_V2 = "Curve-v2",
18
+ ELLIPSIS = "Ellipsis",
19
+ EQUILIBRE = "Equilibre",
20
+ EQUALIZER = "Equalizer",
21
+ FUSIONX_V2 = "FusionX-v2",
22
+ FUSIONX_V3 = "FusionX-v3",
23
+ GMX = "GMX",
24
+ HORIZON = "Horizon",
25
+ HORIZON_V3 = "Horizon-v3",
26
+ KYBERSWAP = "KyberSwap",
27
+ KYBERSWAP_AGGREGATOR = "kyberswap-aggregator",
28
+ KINETIX_V3 = "Kinetix-v3",
29
+ MENTO_V2 = "Mento-v2",
30
+ OPENOCEAN = "OpenOcean",
31
+ OSMOSIS = "Osmosis",
32
+ PANCAKESWAP = "Pancakeswap",
33
+ PANCAKESWAP_V3 = "Pancakeswap-v3",
34
+ PANCAKESWAP_STABLE = "Pancakeswap-stable",
35
+ PANGOLIN = "Pangolin",
36
+ PLATYPUS = "Platypus",
37
+ QUICKSWAP = "Quickswap",
38
+ QUICKSWAP_V3 = "Quickswap-v3",
39
+ RAMSES = "Ramses",
40
+ SPOOKYSWAP = "Spookyswap",
41
+ STELLASWAP = "Stellaswap",
42
+ STELLASWAP_V3 = "Stellaswap-v3",
43
+ STELLASWAP_SADDLE = "Stellaswap-saddle",
44
+ SUSHISWAP = "Sushiswap",
45
+ SUSHISWAP_V3 = "Sushiswap-v3",
46
+ SWAPBASED = "SwapBased",
47
+ SYNTHSWAP_V2 = "SynthSwap-v2",
48
+ SYNTHSWAP_V3 = "SynthSwap-v3",
49
+ SKYDROME = "Skydrome",
50
+ THENA = "Thena",
51
+ THENA_V3 = "Thena-v3",
52
+ TRADERJOE = "TraderJoe",
53
+ TRIDENT = "Trident",
54
+ UBESWAP = "Ubeswap",
55
+ UBESWAP_V3 = "Ubeswap-v3",
56
+ UNISWAP_V2 = "Uniswap-v2",
57
+ UNISWAP_V3 = "Uniswap-v3",
58
+ WOMBAT = "Wombat",
59
+ VELODROME = "Velodrome",
60
+ VELODROME_V2 = "Velodrome-v2",
61
+ VELOCIMETER = "Velocimeter",
62
+ ZYBERSWAP = "Zyberswap",
63
+ ZYBERSWAP_V3 = "Zyberswap-v3"
64
+ }
65
+ export declare enum DexType {
66
+ ALGEBRA = "algebra",
67
+ BALANCER_V2 = "balancer-v2",
68
+ CURVE = "curve",
69
+ GMX = "gmx",
70
+ KYBERSWAP_ELASTIC = "kyberswap-elastic",
71
+ PLATYPUS = "platypus",
72
+ PANCAKESWAP_STABLE = "pancakeswap-stable",
73
+ SADDLE = "saddle",
74
+ SOLIDLY = "solidly",
75
+ TRIDENT = "trident",
76
+ WOMBAT = "wombat",
77
+ UNISWAP_V2 = "uniswap-v2",
78
+ UNISWAP_V3 = "uniswap-v3",
79
+ MENTO_V2 = "mento-v2",
80
+ OSMOSIS = "osmosis"
81
+ }
@@ -1,5 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DexType = exports.DexName = void 0;
1
4
  // identifiers for dexes
2
- export var DexName;
5
+ var DexName;
3
6
  (function (DexName) {
4
7
  DexName["AGNI_V3"] = "Agni-v3";
5
8
  DexName["AERODROME"] = "Aerodrome";
@@ -57,9 +60,9 @@ export var DexName;
57
60
  DexName["VELOCIMETER"] = "Velocimeter";
58
61
  DexName["ZYBERSWAP"] = "Zyberswap";
59
62
  DexName["ZYBERSWAP_V3"] = "Zyberswap-v3";
60
- })(DexName || (DexName = {}));
63
+ })(DexName || (exports.DexName = DexName = {}));
61
64
  // identifiers dex adapters
62
- export var DexType;
65
+ var DexType;
63
66
  (function (DexType) {
64
67
  // EVM
65
68
  DexType["ALGEBRA"] = "algebra";
@@ -82,4 +85,5 @@ export var DexType;
82
85
  /*
83
86
  DUALITY = "Duality",
84
87
  */
85
- })(DexType || (DexType = {}));
88
+ })(DexType || (exports.DexType = DexType = {}));
89
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dexes/index.ts"],"names":[],"mappings":";;;AAOA,wBAAwB;AACxB,IAAY,OAyDX;AAzDD,WAAY,OAAO;IACjB,8BAAmB,CAAA;IACnB,kCAAuB,CAAA;IACvB,8BAAmB,CAAA;IACnB,oCAAyB,CAAA;IACzB,sCAA2B,CAAA;IAC3B,gCAAqB,CAAA;IACrB,sCAA2B,CAAA;IAC3B,gCAAqB,CAAA;IACrB,8BAAmB,CAAA;IACnB,gCAAqB,CAAA;IACrB,gCAAqB,CAAA;IACrB,kCAAuB,CAAA;IACvB,kCAAuB,CAAA;IACvB,oCAAyB,CAAA;IACzB,oCAAyB,CAAA;IACzB,sBAAW,CAAA;IACX,8BAAmB,CAAA;IACnB,oCAAyB,CAAA;IACzB,kCAAuB,CAAA;IACvB,wDAA6C,CAAA;IAC7C,oCAAyB,CAAA;IACzB,gCAAqB,CAAA;IACrB,kCAAuB,CAAA;IACvB,8BAAmB,CAAA;IACnB,sCAA2B,CAAA;IAC3B,4CAAiC,CAAA;IACjC,oDAAyC,CAAA;IACzC,gCAAqB,CAAA;IACrB,gCAAqB,CAAA;IACrB,kCAAuB,CAAA;IACvB,wCAA6B,CAAA;IAC7B,4BAAiB,CAAA;IACjB,oCAAyB,CAAA;IACzB,oCAAyB,CAAA;IACzB,0CAA+B,CAAA;IAC/B,kDAAuC,CAAA;IACvC,kCAAuB,CAAA;IACvB,wCAA6B,CAAA;IAC7B,kCAAuB,CAAA;IACvB,wCAA6B,CAAA;IAC7B,wCAA6B,CAAA;IAC7B,gCAAqB,CAAA;IACrB,0BAAe,CAAA;IACf,gCAAqB,CAAA;IACrB,kCAAuB,CAAA;IACvB,8BAAmB,CAAA;IACnB,8BAAmB,CAAA;IACnB,oCAAyB,CAAA;IACzB,oCAAyB,CAAA;IACzB,oCAAyB,CAAA;IACzB,4BAAiB,CAAA;IACjB,kCAAuB,CAAA;IACvB,wCAA6B,CAAA;IAC7B,sCAA2B,CAAA;IAC3B,kCAAuB,CAAA;IACvB,wCAA6B,CAAA;AAC/B,CAAC,EAzDW,OAAO,uBAAP,OAAO,QAyDlB;AAED,2BAA2B;AAC3B,IAAY,OAuBX;AAvBD,WAAY,OAAO;IACjB,MAAM;IACN,8BAAmB,CAAA;IACnB,sCAA2B,CAAA;IAC3B,0BAAe,CAAA;IACf,sBAAW,CAAA;IACX,kDAAuC,CAAA;IACvC,gCAAqB,CAAA;IACrB,oDAAyC,CAAA;IACzC,4BAAiB,CAAA;IACjB,8BAAmB,CAAA;IACnB,8BAAmB,CAAA;IACnB,4BAAiB,CAAA;IACjB,oCAAyB,CAAA;IACzB,oCAAyB,CAAA;IACzB,gCAAqB,CAAA;IACrB,SAAS;IACT,8BAAmB,CAAA;IAEnB,0DAA0D;IAC1D;;MAEE;AACJ,CAAC,EAvBW,OAAO,uBAAP,OAAO,QAuBlB"}
@@ -0,0 +1,9 @@
1
+ export type SquidError = {
2
+ errorType: string;
3
+ message: string;
4
+ reason: string;
5
+ path?: string;
6
+ };
7
+ export type SquidErrorResponse = {
8
+ errors: SquidError[];
9
+ };
@@ -1 +1,3 @@
1
- export {};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,26 @@
1
+ import { Token } from "../tokens";
2
+ export declare enum FeeType {
3
+ AXELAR_FEE = "Axelar Fee",
4
+ GAS_RECEIVER_FEE = "Gas Receiver Fee",
5
+ EXPRESS_FEE = "Express Fee"
6
+ }
7
+ export declare enum GasCostType {
8
+ EXECUTE_CALL = "executeCall"
9
+ }
10
+ export type FeeCost = {
11
+ name: FeeType;
12
+ description: string;
13
+ percentage?: string;
14
+ gasLimit?: string;
15
+ gasMultiplier?: number;
16
+ token: Token;
17
+ amount: string;
18
+ amountUsd: string;
19
+ };
20
+ export type GasCost = {
21
+ type: GasCostType;
22
+ token: Token;
23
+ gasLimit: string;
24
+ amount: string;
25
+ amountUsd: string;
26
+ };
@@ -1,10 +1,14 @@
1
- export var FeeType;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GasCostType = exports.FeeType = void 0;
4
+ var FeeType;
2
5
  (function (FeeType) {
3
6
  FeeType["AXELAR_FEE"] = "Axelar Fee";
4
7
  FeeType["GAS_RECEIVER_FEE"] = "Gas Receiver Fee";
5
8
  FeeType["EXPRESS_FEE"] = "Express Fee";
6
- })(FeeType || (FeeType = {}));
7
- export var GasCostType;
9
+ })(FeeType || (exports.FeeType = FeeType = {}));
10
+ var GasCostType;
8
11
  (function (GasCostType) {
9
12
  GasCostType["EXECUTE_CALL"] = "executeCall";
10
- })(GasCostType || (GasCostType = {}));
13
+ })(GasCostType || (exports.GasCostType = GasCostType = {}));
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/fees/index.ts"],"names":[],"mappings":";;;AAEA,IAAY,OAIX;AAJD,WAAY,OAAO;IACjB,oCAAyB,CAAA;IACzB,gDAAqC,CAAA;IACrC,sCAA2B,CAAA;AAC7B,CAAC,EAJW,OAAO,uBAAP,OAAO,QAIlB;AAED,IAAY,WAEX;AAFD,WAAY,WAAW;IACrB,2CAA4B,CAAA;AAC9B,CAAC,EAFW,WAAW,2BAAX,WAAW,QAEtB"}
@@ -0,0 +1,12 @@
1
+ export * from "./chains";
2
+ export * from "./bridges";
3
+ export * from "./dexes";
4
+ export * from "./errors";
5
+ export * from "./tokens";
6
+ export * from "./fees";
7
+ export * from "./quote";
8
+ export * from "./routes";
9
+ export * from "./squid";
10
+ export * from "./status";
11
+ export * from "./wrappers";
12
+ export * from "./path";
package/dist/index.js CHANGED
@@ -1,12 +1,29 @@
1
- export * from "./chains";
2
- export * from "./bridges";
3
- export * from "./dexes";
4
- export * from "./errors";
5
- export * from "./tokens";
6
- export * from "./fees";
7
- export * from "./quote";
8
- export * from "./routes";
9
- export * from "./squid";
10
- export * from "./status";
11
- export * from "./wrappers";
12
- export * from "./path";
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./chains"), exports);
18
+ __exportStar(require("./bridges"), exports);
19
+ __exportStar(require("./dexes"), exports);
20
+ __exportStar(require("./errors"), exports);
21
+ __exportStar(require("./tokens"), exports);
22
+ __exportStar(require("./fees"), exports);
23
+ __exportStar(require("./quote"), exports);
24
+ __exportStar(require("./routes"), exports);
25
+ __exportStar(require("./squid"), exports);
26
+ __exportStar(require("./status"), exports);
27
+ __exportStar(require("./wrappers"), exports);
28
+ __exportStar(require("./path"), exports);
29
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,4CAA0B;AAC1B,0CAAwB;AACxB,2CAAyB;AACzB,2CAAyB;AACzB,yCAAuB;AACvB,0CAAwB;AACxB,2CAAyB;AACzB,0CAAwB;AACxB,2CAAyB;AACzB,6CAA2B;AAC3B,yCAAuB"}
@@ -0,0 +1,64 @@
1
+ import { Dex, DexName } from "../dexes";
2
+ import { ChainData, ChainType } from "../chains";
3
+ import { ActionType } from "../routes";
4
+ import { Token } from "../tokens";
5
+ import { WrapperType } from "wrappers";
6
+ import { BridgeType } from "bridges";
7
+ export interface PathInternal {
8
+ fromChain: string;
9
+ fromToken: string;
10
+ toChain: string;
11
+ toToken: string;
12
+ actions: PathActionInternal[];
13
+ }
14
+ export interface Path {
15
+ fromChain: ChainData;
16
+ fromToken: Token;
17
+ toChain: ChainData;
18
+ toToken: Token;
19
+ actions: PathAction[];
20
+ }
21
+ export interface PathActionInternal {
22
+ type: ActionType;
23
+ chainType: ChainType;
24
+ fromChainId: string;
25
+ toChainId: string;
26
+ fromToken: string;
27
+ toToken: string;
28
+ data: Record<string, any>;
29
+ }
30
+ export interface ActionBaseData {
31
+ dex: DexName | Dex;
32
+ chainId: string;
33
+ slippage: number;
34
+ path: string[];
35
+ custom: Record<string, any>;
36
+ type: WrapperType | BridgeType;
37
+ poolFee: number;
38
+ poolId: string;
39
+ isStable: boolean;
40
+ exchangeId?: string;
41
+ exchangeProvider?: string;
42
+ address: string;
43
+ wrapper: string;
44
+ coinAddresses: string[];
45
+ name: string;
46
+ provider: string;
47
+ }
48
+ export interface PathAction {
49
+ type: ActionType;
50
+ chainType: ChainType;
51
+ fromChain: ChainData;
52
+ toChain: ChainData;
53
+ fromToken: Token;
54
+ toToken: Token;
55
+ data: ActionBaseData;
56
+ }
57
+ export interface PathParams {
58
+ fromChainId: string;
59
+ toChainId: string;
60
+ fromToken: Pick<Token, "type" | "chainId" | "name" | "symbol" | "decimals" | "address">;
61
+ toToken: Pick<Token, "type" | "chainId" | "name" | "symbol" | "decimals" | "address">;
62
+ maxResults?: number;
63
+ subgraphIds?: string[];
64
+ }
@@ -1 +1,3 @@
1
- export {};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/path/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,23 @@
1
+ import { ActionStage, BridgeDetails, CustomCallDetails, SwapDetails, PathAction, WrapDetails } from "../index";
2
+ export interface Quote {
3
+ actions: QuoteAction[];
4
+ fromAmount: string;
5
+ toAmount: string;
6
+ toAmountMin: string;
7
+ sendAmount: string;
8
+ exchangeRate: string;
9
+ aggregatePriceImpact: string;
10
+ estimatedRouteDuration: number;
11
+ fromAmountUsd?: string;
12
+ toAmountUsd?: string;
13
+ aggregateSlippage?: number;
14
+ }
15
+ export interface QuoteAction extends Omit<PathAction, "data"> {
16
+ fromAmount: string;
17
+ toAmount: string;
18
+ toAmountMin: string;
19
+ exchangeRate: string;
20
+ priceImpact: string;
21
+ stage?: ActionStage;
22
+ data: SwapDetails | WrapDetails | BridgeDetails | CustomCallDetails;
23
+ }
@@ -1 +1,3 @@
1
- export {};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/quote/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,161 @@
1
+ import { ChainData, ChainType } from "../chains";
2
+ import { Dex, DexName } from "../dexes";
3
+ import { FeeCost, GasCost } from "../fees";
4
+ import { QuoteAction } from "../quote";
5
+ import { ChainCall, SlippageMode, SquidData } from "../squid";
6
+ import { Token } from "../tokens";
7
+ import { WrapDirection, WrapperType } from "../wrappers";
8
+ import { BridgeType } from "../bridges";
9
+ export interface RouteResponse {
10
+ route: {
11
+ estimate: Estimate;
12
+ transactionRequest?: SquidData;
13
+ params: RouteRequest;
14
+ };
15
+ }
16
+ export interface RouteRequest {
17
+ fromChain: string;
18
+ fromToken: string;
19
+ fromAmount: string;
20
+ fromAddress?: string;
21
+ toChain: string;
22
+ toToken: string;
23
+ toAddress?: string;
24
+ slippageConfig: {
25
+ slippage?: number;
26
+ autoMode: SlippageMode;
27
+ };
28
+ quoteOnly?: boolean;
29
+ enableBoost?: boolean;
30
+ preHook?: Hook;
31
+ postHook?: Hook;
32
+ prefer?: DexName[];
33
+ receiveGasOnDestination?: boolean;
34
+ }
35
+ export interface RouteRequestPopulated {
36
+ fromChain: ChainData;
37
+ toChain: ChainData;
38
+ fromToken: Token;
39
+ toToken: Token;
40
+ fromAmount: string;
41
+ fromAddress?: string;
42
+ toAddress?: string;
43
+ slippageConfig: {
44
+ slippage?: number;
45
+ autoMode: SlippageMode;
46
+ };
47
+ quoteOnly?: boolean;
48
+ enableBoost?: boolean;
49
+ preHook?: Hook;
50
+ postHook?: Hook;
51
+ prefer?: DexName[];
52
+ receiveGasOnDestination?: boolean;
53
+ }
54
+ export interface Estimate extends Omit<Route, "actions"> {
55
+ actions: RouteActionResponse[];
56
+ }
57
+ export interface Route {
58
+ actions: RouteAction[];
59
+ fromToken: Token;
60
+ toToken: Token;
61
+ fromAmount: string;
62
+ toAmount: string;
63
+ toAmountMin: string;
64
+ sendAmount: string;
65
+ exchangeRate: string;
66
+ aggregatePriceImpact: string;
67
+ estimatedRouteDuration: number;
68
+ fromAmountUSD?: string;
69
+ toAmountUSD?: string;
70
+ isBoostSupported: boolean;
71
+ gasCosts: GasCost[];
72
+ feeCosts: FeeCost[];
73
+ }
74
+ export interface RouteActionResponse extends Omit<RouteAction, "fromChain" | "toChain" | "data"> {
75
+ fromChain: string;
76
+ toChain: string;
77
+ data: _SwapDetails | WrapDetails | BridgeDetails | CustomCallDetails;
78
+ }
79
+ export interface RouteAction extends QuoteAction {
80
+ provider?: string;
81
+ description?: string;
82
+ hookUri?: string;
83
+ data: SwapDetails | WrapDetails | BridgeDetails | CustomCallDetails;
84
+ }
85
+ export declare enum ActionType {
86
+ SWAP = "swap",
87
+ WRAP = "wrap",
88
+ BRIDGE = "bridge",
89
+ IBC_TRANSFER = "ibc-transfer",
90
+ CUSTOM = "custom"
91
+ }
92
+ export interface WrapDetails {
93
+ target: string;
94
+ path: string[];
95
+ type: WrapperType;
96
+ address: string;
97
+ wrapper: string;
98
+ coinAddresses: string[];
99
+ direction: WrapDirection;
100
+ calls: ChainCall[];
101
+ custom?: Record<string, any>;
102
+ }
103
+ export interface _SwapDetails extends Omit<SwapDetails, "dex"> {
104
+ dex: DexName;
105
+ }
106
+ export interface SwapDetails {
107
+ target: string;
108
+ path: string[];
109
+ dex: Dex;
110
+ calls: ChainCall[];
111
+ poolId: string;
112
+ poolFee: string;
113
+ coinAddresses: string[];
114
+ isStable?: boolean;
115
+ exchangeId?: string;
116
+ exchangeProvider?: string;
117
+ custom?: Record<string, any>;
118
+ }
119
+ export interface BridgeDetails {
120
+ target: string;
121
+ provider: string;
122
+ type: BridgeType;
123
+ name: string;
124
+ calls?: ChainCall[];
125
+ }
126
+ export interface CustomCallDetails {
127
+ name: string;
128
+ calls: ChainCall[];
129
+ }
130
+ export interface Hook {
131
+ chainType: ChainType;
132
+ fundAmount: string;
133
+ fundToken: string;
134
+ calls: ChainCall[];
135
+ description: string;
136
+ hookUri?: string;
137
+ }
138
+ export declare enum ActionStage {
139
+ EVM_SOURCE = 0,
140
+ EVM_DESTINATION = 1,
141
+ EVM_TRANSIENT = 2,
142
+ EVM_ONLY = 3,
143
+ COSMOS_SOURCE = 4,
144
+ COSMOS_DESTINATION = 5,
145
+ COSMOS_TRANSIENT = 6,
146
+ COSMOS_ONLY = 7
147
+ }
148
+ export interface StageContext {
149
+ stage?: ActionStage;
150
+ isSourceNative: boolean;
151
+ isDestinationNative: boolean;
152
+ receiver: string;
153
+ fromAddress?: string;
154
+ isFirstAction?: boolean;
155
+ isLastAction?: boolean;
156
+ hasDestinationCalls?: boolean;
157
+ hasSourceCalls?: boolean;
158
+ multicall?: string;
159
+ preHook: boolean;
160
+ postHook: boolean;
161
+ }
@@ -1,12 +1,15 @@
1
- export var ActionType;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ActionStage = exports.ActionType = void 0;
4
+ var ActionType;
2
5
  (function (ActionType) {
3
6
  ActionType["SWAP"] = "swap";
4
7
  ActionType["WRAP"] = "wrap";
5
8
  ActionType["BRIDGE"] = "bridge";
6
9
  ActionType["IBC_TRANSFER"] = "ibc-transfer";
7
10
  ActionType["CUSTOM"] = "custom";
8
- })(ActionType || (ActionType = {}));
9
- export var ActionStage;
11
+ })(ActionType || (exports.ActionType = ActionType = {}));
12
+ var ActionStage;
10
13
  (function (ActionStage) {
11
14
  ActionStage[ActionStage["EVM_SOURCE"] = 0] = "EVM_SOURCE";
12
15
  ActionStage[ActionStage["EVM_DESTINATION"] = 1] = "EVM_DESTINATION";
@@ -16,4 +19,5 @@ export var ActionStage;
16
19
  ActionStage[ActionStage["COSMOS_DESTINATION"] = 5] = "COSMOS_DESTINATION";
17
20
  ActionStage[ActionStage["COSMOS_TRANSIENT"] = 6] = "COSMOS_TRANSIENT";
18
21
  ActionStage[ActionStage["COSMOS_ONLY"] = 7] = "COSMOS_ONLY";
19
- })(ActionStage || (ActionStage = {}));
22
+ })(ActionStage || (exports.ActionStage = ActionStage = {}));
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/routes/index.ts"],"names":[],"mappings":";;;AA4FA,IAAY,UAMX;AAND,WAAY,UAAU;IACpB,2BAAa,CAAA;IACb,2BAAa,CAAA;IACb,+BAAiB,CAAA;IACjB,2CAA6B,CAAA;IAC7B,+BAAiB,CAAA;AACnB,CAAC,EANW,UAAU,0BAAV,UAAU,QAMrB;AAsDD,IAAY,WASX;AATD,WAAY,WAAW;IACrB,yDAAU,CAAA;IACV,mEAAe,CAAA;IACf,+DAAa,CAAA;IACb,qDAAQ,CAAA;IACR,+DAAa,CAAA;IACb,yEAAkB,CAAA;IAClB,qEAAgB,CAAA;IAChB,2DAAW,CAAA;AACb,CAAC,EATW,WAAW,2BAAX,WAAW,QAStB"}
@@ -0,0 +1,64 @@
1
+ import { ChainType } from "../chains";
2
+ export declare enum SquidRouteType {
3
+ CALL_BRIDGE_CALL = "CALL_BRIDGE_CALL",
4
+ CALL_BRIDGE = "CALL_BRIDGE",
5
+ BRIDGE_CALL = "BRIDGE_CALL",
6
+ BRIDGE = "BRIDGE",
7
+ EVM_ONLY = "EVM_ONLY",
8
+ COSMOS_ONLY = "COSMOS_ONLY"
9
+ }
10
+ export interface SquidData {
11
+ routeType: SquidRouteType;
12
+ target: string;
13
+ data: string;
14
+ value: string;
15
+ gasLimit?: string;
16
+ gasPrice?: string;
17
+ maxFeePerGas?: string;
18
+ maxPriorityFeePerGas?: string;
19
+ }
20
+ export type ChainCall = EvmContractCall | CosmosContractCall;
21
+ export interface EvmContractCall {
22
+ chainType: ChainType.EVM;
23
+ callType: SquidCallType;
24
+ target: string;
25
+ value?: string;
26
+ callData: string;
27
+ payload?: {
28
+ tokenAddress: string;
29
+ inputPos: number;
30
+ };
31
+ estimatedGas: string;
32
+ }
33
+ export declare enum SquidCallType {
34
+ DEFAULT = 0,
35
+ FULL_TOKEN_BALANCE = 1,
36
+ FULL_NATIVE_BALANCE = 2,
37
+ COLLECT_TOKEN_BALANCE = 3
38
+ }
39
+ export type SquidCallData = {
40
+ callType: SquidCallType;
41
+ target: string;
42
+ value: string;
43
+ callData: string;
44
+ payload: string;
45
+ };
46
+ export interface CosmosContractCall {
47
+ chainType: ChainType.COSMOS;
48
+ call: CosmosCctpCall;
49
+ }
50
+ export interface CosmosCctpCall {
51
+ typeUrl: "/circle.cctp.v1.MsgDepositForBurn";
52
+ value: {
53
+ from: string;
54
+ amount: string;
55
+ destinationDomain: number;
56
+ mintRecipient: string;
57
+ burnToken: string;
58
+ };
59
+ }
60
+ export declare enum SlippageMode {
61
+ AGGRESSIVE = 0,
62
+ NORMAL = 1,
63
+ FLEXIBLE = 2
64
+ }
@@ -1,4 +1,7 @@
1
- export var SquidRouteType;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SlippageMode = exports.SquidCallType = exports.SquidRouteType = void 0;
4
+ var SquidRouteType;
2
5
  (function (SquidRouteType) {
3
6
  SquidRouteType["CALL_BRIDGE_CALL"] = "CALL_BRIDGE_CALL";
4
7
  SquidRouteType["CALL_BRIDGE"] = "CALL_BRIDGE";
@@ -6,17 +9,18 @@ export var SquidRouteType;
6
9
  SquidRouteType["BRIDGE"] = "BRIDGE";
7
10
  SquidRouteType["EVM_ONLY"] = "EVM_ONLY";
8
11
  SquidRouteType["COSMOS_ONLY"] = "COSMOS_ONLY";
9
- })(SquidRouteType || (SquidRouteType = {}));
10
- export var SquidCallType;
12
+ })(SquidRouteType || (exports.SquidRouteType = SquidRouteType = {}));
13
+ var SquidCallType;
11
14
  (function (SquidCallType) {
12
15
  SquidCallType[SquidCallType["DEFAULT"] = 0] = "DEFAULT";
13
16
  SquidCallType[SquidCallType["FULL_TOKEN_BALANCE"] = 1] = "FULL_TOKEN_BALANCE";
14
17
  SquidCallType[SquidCallType["FULL_NATIVE_BALANCE"] = 2] = "FULL_NATIVE_BALANCE";
15
18
  SquidCallType[SquidCallType["COLLECT_TOKEN_BALANCE"] = 3] = "COLLECT_TOKEN_BALANCE";
16
- })(SquidCallType || (SquidCallType = {}));
17
- export var SlippageMode;
19
+ })(SquidCallType || (exports.SquidCallType = SquidCallType = {}));
20
+ var SlippageMode;
18
21
  (function (SlippageMode) {
19
22
  SlippageMode[SlippageMode["AGGRESSIVE"] = 0] = "AGGRESSIVE";
20
23
  SlippageMode[SlippageMode["NORMAL"] = 1] = "NORMAL";
21
24
  SlippageMode[SlippageMode["FLEXIBLE"] = 2] = "FLEXIBLE";
22
- })(SlippageMode || (SlippageMode = {}));
25
+ })(SlippageMode || (exports.SlippageMode = SlippageMode = {}));
26
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/squid/index.ts"],"names":[],"mappings":";;;AAEA,IAAY,cAOX;AAPD,WAAY,cAAc;IACxB,uDAAqC,CAAA;IACrC,6CAA2B,CAAA;IAC3B,6CAA2B,CAAA;IAC3B,mCAAiB,CAAA;IACjB,uCAAqB,CAAA;IACrB,6CAA2B,CAAA;AAC7B,CAAC,EAPW,cAAc,8BAAd,cAAc,QAOzB;AA4BD,IAAY,aAKX;AALD,WAAY,aAAa;IACvB,uDAAW,CAAA;IACX,6EAAsB,CAAA;IACtB,+EAAuB,CAAA;IACvB,mFAAyB,CAAA;AAC3B,CAAC,EALW,aAAa,6BAAb,aAAa,QAKxB;AA0BD,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,2DAAU,CAAA;IACV,mDAAM,CAAA;IACN,uDAAQ,CAAA;AACV,CAAC,EAJW,YAAY,4BAAZ,YAAY,QAIvB"}
@@ -0,0 +1,60 @@
1
+ import { BlockTag } from "@ethersproject/providers";
2
+ import { GMPError } from "@axelar-network/axelarjs-sdk";
3
+ import { ChainData } from "../chains";
4
+ export type StatusRequest = {
5
+ transactionId: string;
6
+ routeType: string;
7
+ destinationAddress?: string;
8
+ toChain?: string;
9
+ fromBlock?: BlockTag;
10
+ toBlock?: BlockTag;
11
+ };
12
+ type TransactionStatus = {
13
+ transactionId: string;
14
+ blockNumber: string;
15
+ callEventStatus: string;
16
+ callEventLog: Array<any>;
17
+ chainData?: ChainData;
18
+ transactionUrl?: string;
19
+ };
20
+ export type ApiBasicResponse = {
21
+ error?: string | TypeError[] | GMPError;
22
+ errorType?: string;
23
+ };
24
+ export declare enum SquidTransactionStatus {
25
+ SUCCESS = "success",
26
+ NEEDS_GAS = "needs_gas",
27
+ ONGOING = "ongoing",
28
+ PARTIAL_SUCCESS = "partial_success",
29
+ NOT_FOUND = "not_found",
30
+ FAILED_DESTINATION = "failed_on_destination"
31
+ }
32
+ export type StatusResponse = ApiBasicResponse & {
33
+ id: string;
34
+ status: string;
35
+ gasStatus: string;
36
+ isGMPTransaction?: boolean;
37
+ axelarTransactionUrl: string;
38
+ fromChain?: TransactionStatus;
39
+ toChain?: TransactionStatus;
40
+ timeSpent?: Record<string, number> | {};
41
+ squidTransactionStatus?: SquidTransactionStatus;
42
+ routeStatus?: Array<any>;
43
+ };
44
+ export type RouteStatus = {
45
+ chainId: string | number;
46
+ txHash: string;
47
+ status: string;
48
+ action: AxelarRouteAction;
49
+ };
50
+ export declare enum AxelarRouteAction {
51
+ CALL = "call",
52
+ EXECUTED = "executed",
53
+ IBC_TRANSFER = "ibc_transfer",
54
+ SEND = "send",
55
+ VOTE = "vote",
56
+ IBC_SEND = "ibc_send",
57
+ GAS_PAID = "gas_paid",
58
+ APPROVED = "approved"
59
+ }
60
+ export {};
@@ -1,4 +1,7 @@
1
- export var SquidTransactionStatus;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AxelarRouteAction = exports.SquidTransactionStatus = void 0;
4
+ var SquidTransactionStatus;
2
5
  (function (SquidTransactionStatus) {
3
6
  SquidTransactionStatus["SUCCESS"] = "success";
4
7
  SquidTransactionStatus["NEEDS_GAS"] = "needs_gas";
@@ -6,8 +9,8 @@ export var SquidTransactionStatus;
6
9
  SquidTransactionStatus["PARTIAL_SUCCESS"] = "partial_success";
7
10
  SquidTransactionStatus["NOT_FOUND"] = "not_found";
8
11
  SquidTransactionStatus["FAILED_DESTINATION"] = "failed_on_destination";
9
- })(SquidTransactionStatus || (SquidTransactionStatus = {}));
10
- export var AxelarRouteAction;
12
+ })(SquidTransactionStatus || (exports.SquidTransactionStatus = SquidTransactionStatus = {}));
13
+ var AxelarRouteAction;
11
14
  (function (AxelarRouteAction) {
12
15
  AxelarRouteAction["CALL"] = "call";
13
16
  AxelarRouteAction["EXECUTED"] = "executed";
@@ -17,4 +20,5 @@ export var AxelarRouteAction;
17
20
  AxelarRouteAction["IBC_SEND"] = "ibc_send";
18
21
  AxelarRouteAction["GAS_PAID"] = "gas_paid";
19
22
  AxelarRouteAction["APPROVED"] = "approved";
20
- })(AxelarRouteAction || (AxelarRouteAction = {}));
23
+ })(AxelarRouteAction || (exports.AxelarRouteAction = AxelarRouteAction = {}));
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/status/index.ts"],"names":[],"mappings":";;;AA4BA,IAAY,sBAOX;AAPD,WAAY,sBAAsB;IAChC,6CAAmB,CAAA;IACnB,iDAAuB,CAAA;IACvB,6CAAmB,CAAA;IACnB,6DAAmC,CAAA;IACnC,iDAAuB,CAAA;IACvB,sEAA4C,CAAA;AAC9C,CAAC,EAPW,sBAAsB,sCAAtB,sBAAsB,QAOjC;AAsBD,IAAY,iBASX;AATD,WAAY,iBAAiB;IAC3B,kCAAa,CAAA;IACb,0CAAqB,CAAA;IACrB,kDAA6B,CAAA;IAC7B,kCAAa,CAAA;IACb,kCAAa,CAAA;IACb,0CAAqB,CAAA;IACrB,0CAAqB,CAAA;IACrB,0CAAqB,CAAA;AACvB,CAAC,EATW,iBAAiB,iCAAjB,iBAAiB,QAS5B"}
@@ -0,0 +1,39 @@
1
+ import { ChainType } from "../index";
2
+ export interface Token {
3
+ type: ChainType;
4
+ chainId: string;
5
+ address: string;
6
+ name: string;
7
+ symbol: string;
8
+ decimals: number;
9
+ logoURI?: string;
10
+ coingeckoId?: string;
11
+ volatility: Volatility;
12
+ redstoneId?: string;
13
+ usdPrice?: number;
14
+ axelarNetworkSymbol?: string;
15
+ subGraphOnly?: boolean;
16
+ subGraphIds?: string[];
17
+ feeOnTransfer?: boolean;
18
+ isLpToken?: boolean;
19
+ disabled?: boolean;
20
+ }
21
+ export interface CosmosToken extends Token {
22
+ denom: string;
23
+ base_denom: string;
24
+ base_type: string;
25
+ dp_denom: string;
26
+ origin_chain: string;
27
+ decimal: number;
28
+ description: string;
29
+ image: string;
30
+ }
31
+ export interface EvmToken extends Token {
32
+ address: string;
33
+ }
34
+ export declare enum Volatility {
35
+ SUPER_STABLE = 0,
36
+ STABLE = 1,
37
+ HIGH_CAP = 2,
38
+ VOLATILE = 3
39
+ }
@@ -1,7 +1,11 @@
1
- export var Volatility;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Volatility = void 0;
4
+ var Volatility;
2
5
  (function (Volatility) {
3
6
  Volatility[Volatility["SUPER_STABLE"] = 0] = "SUPER_STABLE";
4
7
  Volatility[Volatility["STABLE"] = 1] = "STABLE";
5
8
  Volatility[Volatility["HIGH_CAP"] = 2] = "HIGH_CAP";
6
9
  Volatility[Volatility["VOLATILE"] = 3] = "VOLATILE";
7
- })(Volatility || (Volatility = {}));
10
+ })(Volatility || (exports.Volatility = Volatility = {}));
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tokens/index.ts"],"names":[],"mappings":";;;AAqCA,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,2DAAY,CAAA;IACZ,+CAAM,CAAA;IACN,mDAAQ,CAAA;IACR,mDAAQ,CAAA;AACV,CAAC,EALW,UAAU,0BAAV,UAAU,QAKrB"}
@@ -0,0 +1,20 @@
1
+ export declare enum WrapperType {
2
+ WRAPPED_NATIVE = "WrappedNative",
3
+ OVERNIGHT = "Overnight",
4
+ DEUS = "Deus",
5
+ WSTETH = "WstETH",
6
+ WRAPPED_MAI = "WrappedMAI",
7
+ WRAPPED_USDY = "WrappedUSDY"
8
+ }
9
+ export declare enum WrapDirection {
10
+ WRAP = "wrap",
11
+ UNWRAP = "unwrap"
12
+ }
13
+ export interface Wrapper {
14
+ chainId: string;
15
+ address: string;
16
+ coinAddresses: string[];
17
+ coinNames: string[];
18
+ type: WrapperType;
19
+ properties?: Record<string, any>;
20
+ }
@@ -1,4 +1,7 @@
1
- export var WrapperType;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WrapDirection = exports.WrapperType = void 0;
4
+ var WrapperType;
2
5
  (function (WrapperType) {
3
6
  WrapperType["WRAPPED_NATIVE"] = "WrappedNative";
4
7
  WrapperType["OVERNIGHT"] = "Overnight";
@@ -6,9 +9,10 @@ export var WrapperType;
6
9
  WrapperType["WSTETH"] = "WstETH";
7
10
  WrapperType["WRAPPED_MAI"] = "WrappedMAI";
8
11
  WrapperType["WRAPPED_USDY"] = "WrappedUSDY";
9
- })(WrapperType || (WrapperType = {}));
10
- export var WrapDirection;
12
+ })(WrapperType || (exports.WrapperType = WrapperType = {}));
13
+ var WrapDirection;
11
14
  (function (WrapDirection) {
12
15
  WrapDirection["WRAP"] = "wrap";
13
16
  WrapDirection["UNWRAP"] = "unwrap";
14
- })(WrapDirection || (WrapDirection = {}));
17
+ })(WrapDirection || (exports.WrapDirection = WrapDirection = {}));
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/wrappers/index.ts"],"names":[],"mappings":";;;AAAA,IAAY,WAOX;AAPD,WAAY,WAAW;IACrB,+CAAgC,CAAA;IAChC,sCAAuB,CAAA;IACvB,4BAAa,CAAA;IACb,gCAAiB,CAAA;IACjB,yCAA0B,CAAA;IAC1B,2CAA4B,CAAA;AAC9B,CAAC,EAPW,WAAW,2BAAX,WAAW,QAOtB;AAED,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,8BAAa,CAAA;IACb,kCAAiB,CAAA;AACnB,CAAC,EAHW,aAAa,6BAAb,aAAa,QAGxB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xsquid/squid-types",
3
- "version": "0.1.45",
3
+ "version": "0.1.47",
4
4
  "description": "JS and TS types relating to 0xsquid related projects.",
5
5
  "main": "dist/index.js",
6
6
  "types": "./dist/index.d.ts",