rango-sdk 0.0.7 → 0.0.8
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.
|
@@ -45,7 +45,7 @@ export declare type RecommendedSlippage = {
|
|
|
45
45
|
*/
|
|
46
46
|
export declare type SwapFee = {
|
|
47
47
|
name: string;
|
|
48
|
-
expenseType: 'FROM_SOURCE_WALLET' | 'DECREASE_FROM_OUTPUT';
|
|
48
|
+
expenseType: 'FROM_SOURCE_WALLET' | 'DECREASE_FROM_OUTPUT' | 'FROM_DESTINATION_WALLET';
|
|
49
49
|
asset: Asset;
|
|
50
50
|
amount: string;
|
|
51
51
|
};
|
|
@@ -57,6 +57,7 @@ export declare type SwapFee = {
|
|
|
57
57
|
* @property {string | number} address - Contract address of the source/dest asset of this step, null for native token
|
|
58
58
|
* @property {number} decimals - Decimals of the source/destination asset of this step, example: 18
|
|
59
59
|
* @property {string} logo - Absolute path of the logo of the source/destination asset of this step
|
|
60
|
+
* @property {string | null} usdPrice - Usd price unit for the asset if available
|
|
60
61
|
*
|
|
61
62
|
*/
|
|
62
63
|
export declare type SwapResultAsset = {
|
|
@@ -65,6 +66,7 @@ export declare type SwapResultAsset = {
|
|
|
65
66
|
symbol: string;
|
|
66
67
|
logo: string;
|
|
67
68
|
decimals: number;
|
|
69
|
+
usdPrice: string | null;
|
|
68
70
|
};
|
|
69
71
|
/**
|
|
70
72
|
* A node of the swap path
|
|
@@ -133,7 +135,9 @@ export declare type TimeStat = {
|
|
|
133
135
|
*
|
|
134
136
|
* @property {string} swapperId - Unique Id of swapper. example: 1INCH_BSC, TERRASWAP
|
|
135
137
|
*
|
|
136
|
-
* @property {
|
|
138
|
+
* @property {'BRIDGE' | 'DEX' | 'AGGREGATOR'} swapperType - Type of swapper. example: BRIDGE, DEX, AGGREGATOR
|
|
139
|
+
*
|
|
140
|
+
* @property {'INTER_CHAIN' | 'INTRA_CHAIN'} swapChainType - Type of swapping. It could be inter chain or intra chain
|
|
137
141
|
*
|
|
138
142
|
* @property {SwapResultAsset} from - The source asset
|
|
139
143
|
*
|
|
@@ -170,6 +174,10 @@ export declare type TimeStat = {
|
|
|
170
174
|
*
|
|
171
175
|
* @property {TimeStat | null} timeStat - The minimum, avg and max estimation time for this step
|
|
172
176
|
*
|
|
177
|
+
* @property {boolean} includesDestinationTx - Is it required to sign a transaction on the destination chain or not
|
|
178
|
+
*
|
|
179
|
+
* @property {number} maxRequiredSign - Max number of transaction signing required by the user
|
|
180
|
+
*
|
|
173
181
|
* @property {RecommendedSlippage | null} recommendedSlippage
|
|
174
182
|
*
|
|
175
183
|
* @property {string[] | null} warnings - List of warnings for this swap step, usually null or empty
|
|
@@ -177,7 +185,8 @@ export declare type TimeStat = {
|
|
|
177
185
|
*/
|
|
178
186
|
export declare type SwapResult = {
|
|
179
187
|
swapperId: string;
|
|
180
|
-
swapperType:
|
|
188
|
+
swapperType: 'BRIDGE' | 'DEX' | 'AGGREGATOR';
|
|
189
|
+
swapChainType: 'INTER_CHAIN' | 'INTRA_CHAIN';
|
|
181
190
|
from: SwapResultAsset;
|
|
182
191
|
to: SwapResultAsset;
|
|
183
192
|
fromAmount: string;
|
|
@@ -190,6 +199,8 @@ export declare type SwapResult = {
|
|
|
190
199
|
fromAmountRestrictionType: 'EXCLUSIVE' | 'INCLUSIVE';
|
|
191
200
|
estimatedTimeInSeconds: number;
|
|
192
201
|
timeStat: TimeStat | null;
|
|
202
|
+
includesDestinationTx: boolean;
|
|
203
|
+
maxRequiredSign: number;
|
|
193
204
|
recommendedSlippage: RecommendedSlippage | null;
|
|
194
205
|
warnings: string[] | null;
|
|
195
206
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/types/api/common.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,oBAAY,KAAK,GAAG;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,GAAG,IAAI,CAA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AC1B,GAAG,EAAE,OAAO,EAAE,CAAA;IACd,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAA;IAClC,yBAAyB,EAAE,WAAW,GAAG,WAAW,CAAA;IACpD,sBAAsB,EAAE,MAAM,CAAA;IAC9B,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAA;IACzB,qBAAqB,EAAE,OAAO,CAAA;IAC9B,eAAe,EAAE,MAAM,CAAA;IACvB,mBAAmB,EAAE,mBAAmB,GAAG,IAAI,CAAA;IAC/C,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;CAC1B,CAAA;AAED;;;;;;;;;GASG;AACH,oBAAY,eAAe,GAAG;IAC5B,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;CACf,CAAA"}
|
|
@@ -15,11 +15,13 @@ export declare type UserWalletBlockchain = {
|
|
|
15
15
|
* Full information of a path of multiple swaps that should be executed by user to swap X to Y
|
|
16
16
|
*
|
|
17
17
|
* @property {string} outputAmount - The estimation of Rango from output amount of Y
|
|
18
|
+
* @property {'OK' | 'HIGH_IMPACT' | 'NO_ROUTE' | 'INPUT_LIMIT_ISSUE'} resultType
|
|
18
19
|
* @property {SwapResult[]} swaps - List of required swaps to swap X to Y with the expected outputAmount
|
|
19
20
|
*
|
|
20
21
|
*/
|
|
21
22
|
export declare type SimulationResult = {
|
|
22
23
|
outputAmount: string;
|
|
24
|
+
resultType: 'OK' | 'HIGH_IMPACT' | 'NO_ROUTE' | 'INPUT_LIMIT_ISSUE';
|
|
23
25
|
swaps: SwapResult[];
|
|
24
26
|
};
|
|
25
27
|
/**
|
|
@@ -73,11 +75,12 @@ export declare type BlockchainValidationStatus = {
|
|
|
73
75
|
* @property {Asset} from - The source asset
|
|
74
76
|
* @property {Asset} to - The destination asset
|
|
75
77
|
* @property {string} amount - The human-readable amount of asset X that is going to be swapped, example: 0.28
|
|
78
|
+
* @property {{ [key: string]: string }} selectedWallets - Map of blockchain to selected address
|
|
79
|
+
* @property {UserWalletBlockchain[]} connectedWallets - List of all user connected wallet addresses per each blockchain
|
|
76
80
|
* @property {boolean} checkPrerequisites - It should be false when client just likes to preview the route to user,
|
|
77
81
|
* and true when user really accepted to swap. If true, server will be much slower to respond, but will check some
|
|
78
82
|
* pre-requisites including balance of X and required fees in user's wallets
|
|
79
|
-
* @property {
|
|
80
|
-
* @property {UserWalletBlockchain[]} connectedWallets - List of all user connected wallet addresses per each blockchain
|
|
83
|
+
* @property {boolean} [forceExecution] - Use this flag if you want to ignore checkPrerequisites before executing the route
|
|
81
84
|
* @property {string | null} [affiliateRef] - The affiliate ref that client likes to send to Rango, so in cases of
|
|
82
85
|
* 1inch, Thorchain, etc. that support affiliation, the referrer will earn some money if user accept the route and
|
|
83
86
|
* signs the transactions. example: K3ldk3
|
|
@@ -92,11 +95,12 @@ export declare type BestRouteRequest = {
|
|
|
92
95
|
from: Asset;
|
|
93
96
|
to: Asset;
|
|
94
97
|
amount: string;
|
|
95
|
-
checkPrerequisites: boolean;
|
|
96
98
|
connectedWallets: UserWalletBlockchain[];
|
|
97
99
|
selectedWallets: {
|
|
98
100
|
[key: string]: string;
|
|
99
101
|
};
|
|
102
|
+
checkPrerequisites: boolean;
|
|
103
|
+
forceExecution?: boolean;
|
|
100
104
|
affiliateRef?: string | null;
|
|
101
105
|
disableMultiStepTx?: boolean;
|
|
102
106
|
blockchains?: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routing.d.ts","sourceRoot":"","sources":["../../../src/types/api/routing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACzD,OAAO,KAAK,EAAE,e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