@0xsquid/squid-types 0.1.26 → 0.1.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { Token } from "tokens";
1
+ import { Token } from "../tokens";
2
2
  export declare enum FeeType {
3
3
  AXELAR_FEE = "Axelar Fee",
4
4
  GAS_RECEIVER_FEE = "Gas Receiver Fee",
package/dist/index.d.ts CHANGED
@@ -8,3 +8,4 @@ export * from "./routes";
8
8
  export * from "./squid";
9
9
  export * from "./status";
10
10
  export * from "./wrappers";
11
+ export * from "./path";
package/dist/index.js CHANGED
@@ -24,4 +24,5 @@ __exportStar(require("./routes"), exports);
24
24
  __exportStar(require("./squid"), exports);
25
25
  __exportStar(require("./status"), exports);
26
26
  __exportStar(require("./wrappers"), exports);
27
+ __exportStar(require("./path"), exports);
27
28
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,0CAAwB;AACxB,2CAAyB;AACzB,2CAAyB;AACzB,yCAAuB;AACvB,0CAAwB;AACxB,2CAAyB;AACzB,0CAAwB;AACxB,2CAAyB;AACzB,6CAA2B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,0CAAwB;AACxB,2CAAyB;AACzB,2CAAyB;AACzB,yCAAuB;AACvB,0CAAwB;AACxB,2CAAyB;AACzB,0CAAwB;AACxB,2CAAyB;AACzB,6CAA2B;AAC3B,yCAAuB"}
@@ -0,0 +1,61 @@
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
+ export interface PathInternal {
7
+ fromChain: string;
8
+ fromToken: string;
9
+ toChain: string;
10
+ toToken: string;
11
+ actions: PathActionInternal[];
12
+ }
13
+ export interface Path {
14
+ fromChain: ChainData;
15
+ fromToken: Token;
16
+ toChain: ChainData;
17
+ toToken: Token;
18
+ actions: PathAction[];
19
+ }
20
+ export interface PathActionInternal {
21
+ type: ActionType;
22
+ chainType: ChainType;
23
+ fromChainId: string;
24
+ toChainId: string;
25
+ fromToken: string;
26
+ toToken: string;
27
+ data: Record<string, any>;
28
+ }
29
+ export interface ActionBaseData {
30
+ dex: DexName | Dex;
31
+ chainId: string;
32
+ slippage: number;
33
+ path: string[];
34
+ custom: Record<string, any>;
35
+ poolFees: number[][];
36
+ pools: string[];
37
+ poolId: string;
38
+ isStable: boolean[];
39
+ exchangeId?: string;
40
+ exchangeProvider?: string;
41
+ address: string;
42
+ wrapper: string;
43
+ type: WrapperType;
44
+ coinAddresses: string[];
45
+ }
46
+ export interface PathAction {
47
+ type: ActionType;
48
+ chainType: ChainType;
49
+ fromChain: ChainData;
50
+ toChain: ChainData;
51
+ fromToken: Token;
52
+ toToken: Token;
53
+ data: ActionBaseData;
54
+ }
55
+ export interface PathParams {
56
+ fromChainId: string;
57
+ toChainId: string;
58
+ fromToken: Pick<Token, "type" | "chainId" | "name" | "symbol" | "decimals" | "address">;
59
+ toToken: Pick<Token, "type" | "chainId" | "name" | "symbol" | "decimals" | "address">;
60
+ maxResults?: number;
61
+ }
@@ -0,0 +1,3 @@
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":""}
@@ -1,4 +1,4 @@
1
- import { ActionStage, ActionType, BridgeDetails, ChainType, CustomCallDetails, SwapDetails, IbcTransferDetails, Token } from "../index";
1
+ import { ActionStage, BridgeDetails, CustomCallDetails, SwapDetails, PathAction, WrapDetails } from "../index";
2
2
  export interface Quote {
3
3
  actions: QuoteAction[];
4
4
  fromAmount: string;
@@ -12,13 +12,12 @@ export interface Quote {
12
12
  toAmountUsd?: string;
13
13
  aggregateSlippage?: number;
14
14
  }
15
- export interface QuoteAction {
16
- type: ActionType;
17
- chainType: ChainType;
18
- fromChainId: string;
19
- toChainId: string;
20
- fromToken: Token;
21
- toToken: Token;
15
+ export interface QuoteAction extends Omit<PathAction, "data"> {
16
+ fromAmount: string;
17
+ toAmount: string;
18
+ toAmountMin: string;
19
+ exchangeRate: string;
20
+ priceImpact: string;
22
21
  stage?: ActionStage;
23
- details: SwapDetails | BridgeDetails | CustomCallDetails | IbcTransferDetails;
22
+ data: SwapDetails | WrapDetails | BridgeDetails | CustomCallDetails;
24
23
  }
@@ -1,25 +1,16 @@
1
- import { ChainData, ChainType } from "chains";
2
- import { Dex, DexName } from "dexes";
3
- import { FeeCost, GasCost } from "fees";
4
- import { ChainCall, EvmContractCall, SlippageMode, SquidData } from "squid";
5
- import { Token } from "tokens";
6
- import { WrapDirection, WrapperType } from "wrappers";
7
- export declare enum ActionType {
8
- SWAP = "swap",
9
- WRAP = "wrap",
10
- BRIDGE = "bridge",
11
- IBC_TRANSFER = "ibc-transfer",
12
- CUSTOM = "custom"
13
- }
14
- export declare enum ActionStage {
15
- EVM_SOURCE = 0,
16
- EVM_DESTINATION = 1,
17
- EVM_TRANSIENT = 2,
18
- EVM_ONLY = 3,
19
- COSMOS_SOURCE = 4,
20
- COSMOS_DESTINATION = 5,
21
- COSMOS_TRANSIENT = 6,
22
- COSMOS_ONLY = 7
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, EvmContractCall, SlippageMode, SquidData } from "../squid";
6
+ import { Token } from "../tokens";
7
+ import { WrapDirection, WrapperType } from "../wrappers";
8
+ export interface RouteResponse {
9
+ route: {
10
+ estimate: Estimate;
11
+ transactionRequest: SquidData;
12
+ params: RouteRequest;
13
+ };
23
14
  }
24
15
  export interface RouteRequest {
25
16
  fromChain: string;
@@ -40,39 +31,6 @@ export interface RouteRequest {
40
31
  prefer?: DexName[];
41
32
  receiveGasOnDestination?: boolean;
42
33
  }
43
- export interface Route {
44
- actions: RouteAction[];
45
- fromToken: Token;
46
- toToken: Token;
47
- fromAmount: string;
48
- toAmount: string;
49
- toAmountMin: string;
50
- sendAmount: string;
51
- exchangeRate: string;
52
- aggregatePriceImpact: string;
53
- estimatedRouteDuration: number;
54
- fromAmountUSD?: string;
55
- toAmountUSD?: string;
56
- isBoostSupported: boolean;
57
- gasCosts: GasCost[];
58
- feeCosts: FeeCost[];
59
- }
60
- export interface StageContext {
61
- stage: ActionStage;
62
- isSourceNative: boolean;
63
- isDestinationNative: boolean;
64
- isEvm: boolean;
65
- isCosmos: boolean;
66
- toAddress: string;
67
- receiver: string;
68
- isFirstAction?: boolean;
69
- isLastAction?: boolean;
70
- hasDestinationCalls?: boolean;
71
- hasSourceCalls?: boolean;
72
- multicall?: string;
73
- preHook: boolean;
74
- postHook: boolean;
75
- }
76
34
  export interface RouteRequestPopulated {
77
35
  fromChain: ChainData;
78
36
  toChain: ChainData;
@@ -92,83 +50,99 @@ export interface RouteRequestPopulated {
92
50
  prefer?: DexName[];
93
51
  receiveGasOnDestination?: boolean;
94
52
  }
95
- export interface RouteResponse {
96
- route: {
97
- estimate: Estimate;
98
- transactionRequest: SquidData;
99
- params: RouteRequest;
100
- };
101
- }
102
53
  export interface Estimate extends Route {
103
- actions: SimpleRouteAction[];
54
+ actions: RouteAction[];
104
55
  }
105
- export interface RouteAction {
106
- type: ActionType;
107
- chainType: ChainType;
108
- fromChainId: string;
109
- toChainId: string;
56
+ export interface Route {
57
+ actions: RouteAction[];
110
58
  fromToken: Token;
111
59
  toToken: Token;
60
+ fromAmount: string;
61
+ toAmount: string;
62
+ toAmountMin: string;
63
+ sendAmount: string;
64
+ exchangeRate: string;
65
+ aggregatePriceImpact: string;
66
+ estimatedRouteDuration: number;
67
+ fromAmountUSD?: string;
68
+ toAmountUSD?: string;
69
+ isBoostSupported: boolean;
70
+ gasCosts: GasCost[];
71
+ feeCosts: FeeCost[];
72
+ }
73
+ export interface RouteAction extends QuoteAction {
112
74
  provider?: string;
113
75
  description?: string;
114
- stage?: ActionStage;
115
- details: SwapDetails | WrapDetails | BridgeDetails | CustomCallDetails | IbcTransferDetails;
76
+ data: SwapDetails | WrapDetails | BridgeDetails | CustomCallDetails;
116
77
  }
117
- export interface SimpleRouteAction extends RouteAction {
118
- details: SimpleSwapDetails | SimpleWrapDetails | BridgeDetails | CustomCallDetails | IbcTransferDetails;
78
+ export declare enum ActionType {
79
+ SWAP = "swap",
80
+ WRAP = "wrap",
81
+ BRIDGE = "bridge",
82
+ IBC_TRANSFER = "ibc-transfer",
83
+ CUSTOM = "custom"
119
84
  }
120
- export interface BaseSwapDetails {
85
+ export interface WrapDetails {
121
86
  target: string;
122
87
  path: string[];
123
- swapType: string;
124
- fromAmount: string;
125
- toAmount: string;
126
- toAmountMin: string;
127
- exchangeRate: string;
128
- priceImpact: string;
129
- isWrappedNative?: boolean;
130
- dynamicSlippage?: number;
131
- }
132
- export interface WrapDetails extends SimpleWrapDetails {
88
+ type: WrapperType;
89
+ address: string;
90
+ wrapper: string;
91
+ coinAddresses: string[];
92
+ direction: WrapDirection;
133
93
  calls: ChainCall[];
134
94
  custom?: Record<string, any>;
135
95
  }
136
- export interface SimpleWrapDetails {
96
+ export interface SwapDetails {
137
97
  target: string;
138
98
  path: string[];
139
- wrapType: WrapperType;
140
- direction: WrapDirection;
141
- fromAmount: string;
142
- toAmount: string;
143
- exchangeRate: string;
144
- priceImpact: string;
145
- }
146
- export interface SwapDetails extends BaseSwapDetails {
147
99
  dex: Dex;
148
100
  calls: ChainCall[];
101
+ pools: string[];
102
+ poolFees: string[];
103
+ coinAddresses: string[];
104
+ exchangeId?: string;
105
+ exchangeProvider?: string;
149
106
  custom?: Record<string, any>;
150
- pools?: string[];
151
- }
152
- export interface SimpleSwapDetails extends BaseSwapDetails {
153
- dexName: DexName;
154
107
  }
155
108
  export interface BridgeDetails {
156
109
  target: string;
157
110
  provider: string;
158
111
  name: string;
159
- sendAmount: string;
160
- receiveAmount: string;
161
- exchangeRate: string;
162
112
  }
163
113
  export interface CustomCallDetails {
164
114
  name: string;
165
115
  calls: EvmContractCall[];
166
116
  }
167
- export interface IbcTransferDetails {
168
- }
169
117
  export interface Hook {
170
118
  chainType: ChainType;
171
119
  fundAmount: string;
172
120
  fundToken: string;
173
121
  calls: ChainCall[];
174
122
  }
123
+ export declare enum ActionStage {
124
+ EVM_SOURCE = 0,
125
+ EVM_DESTINATION = 1,
126
+ EVM_TRANSIENT = 2,
127
+ EVM_ONLY = 3,
128
+ COSMOS_SOURCE = 4,
129
+ COSMOS_DESTINATION = 5,
130
+ COSMOS_TRANSIENT = 6,
131
+ COSMOS_ONLY = 7
132
+ }
133
+ export interface StageContext {
134
+ stage: ActionStage;
135
+ isSourceNative: boolean;
136
+ isDestinationNative: boolean;
137
+ isEvm: boolean;
138
+ isCosmos: boolean;
139
+ toAddress: string;
140
+ receiver: string;
141
+ isFirstAction?: boolean;
142
+ isLastAction?: boolean;
143
+ hasDestinationCalls?: boolean;
144
+ hasSourceCalls?: boolean;
145
+ multicall?: string;
146
+ preHook: boolean;
147
+ postHook: boolean;
148
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/routes/index.ts"],"names":[],"mappings":";;;AAOA,IAAY,UAMX;AAND,WAAY,UAAU;IACpB,2BAAa,CAAA;IACb,2BAAa,CAAA;IACb,+BAAiB,CAAA;IACjB,2CAA6B,CAAA;IAC7B,+BAAiB,CAAA;AACnB,CAAC,EANW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAMrB;AAED,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,GAAX,mBAAW,KAAX,mBAAW,QAStB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/routes/index.ts"],"names":[],"mappings":";;;AAoFA,IAAY,UAMX;AAND,WAAY,UAAU;IACpB,2BAAa,CAAA;IACb,2BAAa,CAAA;IACb,+BAAiB,CAAA;IACjB,2CAA6B,CAAA;IAC7B,+BAAiB,CAAA;AACnB,CAAC,EANW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAMrB;AA6CD,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,GAAX,mBAAW,KAAX,mBAAW,QAStB"}
@@ -1,4 +1,4 @@
1
- import { ChainType } from "chains";
1
+ import { ChainType } from "../chains";
2
2
  export declare enum SquidRouteType {
3
3
  CALL_BRIDGE_CALL = "CALL_BRIDGE_CALL",
4
4
  CALL_BRIDGE = "CALL_BRIDGE",
@@ -1,6 +1,6 @@
1
1
  import { BlockTag } from "@ethersproject/providers";
2
2
  import { GMPError } from "@axelar-network/axelarjs-sdk";
3
- import { ChainData } from "chains";
3
+ import { ChainData } from "../chains";
4
4
  export type StatusRequest = {
5
5
  transactionId: string;
6
6
  routeType: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xsquid/squid-types",
3
- "version": "0.1.26",
3
+ "version": "0.1.27",
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",