rango-sdk-basic 0.0.10 → 0.0.11
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/lib/types/api/common.d.ts +6 -5
- package/lib/types/api/common.d.ts.map +1 -1
- package/lib/types/api/meta.d.ts +6 -2
- package/lib/types/api/meta.d.ts.map +1 -1
- package/lib/types/api/routing.d.ts +2 -0
- package/lib/types/api/routing.d.ts.map +1 -1
- package/lib/types/api/txs/evm.d.ts +4 -3
- package/lib/types/api/txs/evm.d.ts.map +1 -1
- package/lib/types/api/txs/transfer.d.ts +3 -1
- package/lib/types/api/txs/transfer.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -53,6 +53,7 @@ export declare type SwapperType = 'BRIDGE' | 'DEX' | 'AGGREGATOR';
|
|
|
53
53
|
* @property {SwapperMetaDto} swapper - Swapper for this path
|
|
54
54
|
* @property {SwapperType} swapperType - Type of swapper
|
|
55
55
|
* @property {string} expectedOutput - Expected output
|
|
56
|
+
* @property {number} estimatedTimeInSeconds - Expected duration
|
|
56
57
|
*
|
|
57
58
|
*/
|
|
58
59
|
export declare type QuotePath = {
|
|
@@ -61,6 +62,7 @@ export declare type QuotePath = {
|
|
|
61
62
|
swapper: SwapperMetaDto;
|
|
62
63
|
swapperType: SwapperType;
|
|
63
64
|
expectedOutput: string;
|
|
65
|
+
estimatedTimeInSeconds: number;
|
|
64
66
|
};
|
|
65
67
|
/**
|
|
66
68
|
* Limitations on input amount for requested route
|
|
@@ -79,23 +81,22 @@ export declare type AmountRestriction = {
|
|
|
79
81
|
* A step of a multi-step swap route
|
|
80
82
|
*
|
|
81
83
|
* @property {string} outputAmount - The estimation of Rango from output amount of Y
|
|
82
|
-
*
|
|
83
84
|
* @property {SwapperMetaDto} swapper - Swapper suggested for this path
|
|
84
|
-
*
|
|
85
|
+
* @property {Token} from - Source token
|
|
86
|
+
* @property {Token} to - Destination token
|
|
85
87
|
* @property {QuotePath[] | null} path - The internal routing of this step showing how the initial swap request will
|
|
86
88
|
* be split and executed. This can be used for previewing purpose to give the user a sense of what's going to happen.
|
|
87
89
|
* Null indicates that there is no internal mechanism and swapping is simple and straight-forward.
|
|
88
|
-
*
|
|
89
90
|
* @property {SwapFee[]} fee - List of fees that are taken from user in this step
|
|
90
|
-
*
|
|
91
91
|
* @property {AmountRestriction | null} amountRestriction - restrictions on input amount. This field is informational
|
|
92
92
|
* and there is no need to apply it in client-side
|
|
93
|
-
*
|
|
94
93
|
* @property {number} estimatedTimeInSeconds - The estimated time (in seconds) that this step might take, beware that
|
|
95
94
|
* this number is just an estimation and should be used only for user preview, example: 15
|
|
96
95
|
*
|
|
97
96
|
*/
|
|
98
97
|
export declare type QuoteSimulationResult = {
|
|
98
|
+
from: Token;
|
|
99
|
+
to: Token;
|
|
99
100
|
outputAmount: string;
|
|
100
101
|
swapper: SwapperMetaDto;
|
|
101
102
|
path: QuotePath[] | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/types/api/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAE9C;;;;;;;GAOG;AACH,oBAAY,KAAK,GAAG;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAIlD;AAED;;;;;;;GAOG;AACH,oBAAY,MAAM,GAAG;IACnB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED;;;;;;;;GAQG;AACH,oBAAY,OAAO,GAAG;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,KAAK,CAAA;IACZ,WAAW,EACP,oBAAoB,GACpB,sBAAsB,GACtB,yBAAyB,CAAA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M,GAAG,IAAI,CAAA;IAClB,IAAI,EAAE,WAAW,GAAG,WAAW,CAAA;CAChC,CAAA;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,oBAAY,qBAAqB,GAAG;IAClC,IAAI,EAAE,KAAK,CAAA;IACX,EAAE,EAAE,KAAK,CAAA;IACT,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,cAAc,CAAA;IACvB,IAAI,EAAE,SAAS,EAAE,GAAG,IAAI,CAAA;IACxB,GAAG,EAAE,OAAO,EAAE,CAAA;IACd,iBAAiB,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAC3C,sBAAsB,EAAE,MAAM,CAAA;CAC/B,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"}
|
package/lib/types/api/meta.d.ts
CHANGED
|
@@ -26,14 +26,16 @@ export declare type BlockchainMeta = {
|
|
|
26
26
|
* @property {string} id - Unique identifier for the swapper
|
|
27
27
|
* @property {string} title - Display name for the swapper
|
|
28
28
|
* @property {string} logo - Icon logo for the swapper
|
|
29
|
-
* @property {
|
|
29
|
+
* @property {string | null} swapperGroup - Group name for swapper
|
|
30
|
+
* @property {SwapperType[] | null} types - Type of the transaction supported by the swapper
|
|
30
31
|
*
|
|
31
32
|
*/
|
|
32
33
|
export declare type SwapperMetaDto = {
|
|
33
34
|
id: string;
|
|
34
35
|
title: string;
|
|
35
36
|
logo: string;
|
|
36
|
-
|
|
37
|
+
swapperGroup: string | null;
|
|
38
|
+
types: SwapperType[] | null;
|
|
37
39
|
};
|
|
38
40
|
/**
|
|
39
41
|
* All metadata info for a token, unique by (blockchain, symbol, address) tuple
|
|
@@ -44,6 +46,7 @@ export declare type SwapperMetaDto = {
|
|
|
44
46
|
* @property {string} name - The token name, e.g: Binance Pegged ETH
|
|
45
47
|
* @property {number} decimals - Decimals of token in blockchain, example: 18
|
|
46
48
|
* @property {string} image - Url of its image, example: https://api.rango.exchange/tokens/ETH/ETH.png
|
|
49
|
+
* @property {string | decimals} usdPrice - The token unit price
|
|
47
50
|
*
|
|
48
51
|
*/
|
|
49
52
|
export declare type Token = {
|
|
@@ -53,6 +56,7 @@ export declare type Token = {
|
|
|
53
56
|
name: string;
|
|
54
57
|
decimals: number;
|
|
55
58
|
image: string;
|
|
59
|
+
usdPrice: string | null;
|
|
56
60
|
};
|
|
57
61
|
/**
|
|
58
62
|
* Metadata info for all blockchains and tokens supported
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/types/api/meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAEhD;;;;;;;;;;;GAWG;AACH,oBAAY,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,eAAe,EAAE,MAAM,CAAA;IACvB,SAAS,EAAE,KAAK,EAAE,CAAA;IAClB,eAAe,EAAE,MAAM,EAAE,CAAA;IACzB,IAAI,EAAE,eAAe,GAAG,IAAI,CAAA;IAC5B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;CACvB,CAAA;AAED
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/types/api/meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAEhD;;;;;;;;;;;GAWG;AACH,oBAAY,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,eAAe,EAAE,MAAM,CAAA;IACvB,SAAS,EAAE,KAAK,EAAE,CAAA;IAClB,eAAe,EAAE,MAAM,EAAE,CAAA;IACzB,IAAI,EAAE,eAAe,GAAG,IAAI,CAAA;IAC5B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;CACvB,CAAA;AAED;;;;;;;;;GASG;AACH,oBAAY,cAAc,GAAG;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,KAAK,EAAE,WAAW,EAAE,GAAG,IAAI,CAAA;CAC5B,CAAA;AAED;;;;;;;;;;;GAWG;AACH,oBAAY,KAAK,GAAG;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;CACxB,CAAA;AAED;;;;;;;GAOG;AACH,oBAAY,YAAY,GAAG;IACzB,WAAW,EAAE,cAAc,EAAE,CAAA;IAC7B,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,QAAQ,EAAE,cAAc,EAAE,CAAA;CAC3B,CAAA"}
|
|
@@ -32,11 +32,13 @@ export declare type QuoteRequest = {
|
|
|
32
32
|
* passed down to all other endpoints if this swap continues on. e.g. d10657ce-b13a-405c-825b-b47f8a5016ad
|
|
33
33
|
* @property {string} resultType - Type of result (OK or error type)
|
|
34
34
|
* @property {QuoteSimulationResult | null} route - Suggested route
|
|
35
|
+
* @property {string | null} error - Error message
|
|
35
36
|
*
|
|
36
37
|
*/
|
|
37
38
|
export declare type QuoteResponse = {
|
|
38
39
|
requestId: string;
|
|
39
40
|
resultType: 'OK' | 'HIGH_IMPACT' | 'INPUT_LIMIT_ISSUE' | 'NO_ROUTE';
|
|
40
41
|
route: QuoteSimulationResult | null;
|
|
42
|
+
error: string | null;
|
|
41
43
|
};
|
|
42
44
|
//# sourceMappingURL=routing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routing.d.ts","sourceRoot":"","sources":["../../../src/types/api/routing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAE5D;;;;;;;;;;;;;;GAcG;AACH,oBAAY,YAAY,GAAG;IACzB,IAAI,EAAE,KAAK,CAAA;IACX,EAAE,EAAE,KAAK,CAAA;IACT,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IACnB,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB,CAAA;AAED
|
|
1
|
+
{"version":3,"file":"routing.d.ts","sourceRoot":"","sources":["../../../src/types/api/routing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAE5D;;;;;;;;;;;;;;GAcG;AACH,oBAAY,YAAY,GAAG;IACzB,IAAI,EAAE,KAAK,CAAA;IACX,EAAE,EAAE,KAAK,CAAA;IACT,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IACnB,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB,CAAA;AAED;;;;;;;;;GASG;AACH,oBAAY,aAAa,GAAG;IAC1B,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,IAAI,GAAG,aAAa,GAAG,mBAAmB,GAAG,UAAU,CAAA;IACnE,KAAK,EAAE,qBAAqB,GAAG,IAAI,CAAA;IACnC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB,CAAA"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BlockchainMeta } from '../meta';
|
|
2
|
+
import { TransactionType } from '../transactions';
|
|
2
3
|
/**
|
|
3
4
|
* The transaction object for all EVM-based blockchains, including Ethereum, BSC, Polygon, Harmony, etc
|
|
4
5
|
*
|
|
5
6
|
* @property {TransactionType} type - This fields equals to TransactionType.EVM for all EVMTransactions
|
|
6
|
-
* @property {
|
|
7
|
+
* @property {BlockchainMeta} blockChain - The blockchain info that this transaction is going to run in
|
|
7
8
|
* @property {string | null} from - The source wallet address, it can be null
|
|
8
9
|
* @property {string} approveTo - Address of source token erc20 contract for increasing approve amount
|
|
9
10
|
* @property {string | null} approveData - The data of approve transaction
|
|
@@ -16,7 +17,7 @@ import { TransactionType } from "../transactions";
|
|
|
16
17
|
*/
|
|
17
18
|
export interface EvmTransaction {
|
|
18
19
|
type: TransactionType;
|
|
19
|
-
blockChain:
|
|
20
|
+
blockChain: BlockchainMeta;
|
|
20
21
|
from: string | null;
|
|
21
22
|
approveTo: string | null;
|
|
22
23
|
approveData: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evm.d.ts","sourceRoot":"","sources":["../../../../src/types/api/txs/evm.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"evm.d.ts","sourceRoot":"","sources":["../../../../src/types/api/txs/evm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEjD;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,eAAe,CAAA;IACrB,UAAU,EAAE,cAAc,CAAA;IAC1B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;CACxB"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { AssetWithTicker } from '../common';
|
|
2
|
-
import { TransactionType } from
|
|
2
|
+
import { TransactionType } from '../transactions';
|
|
3
3
|
/**
|
|
4
4
|
* TransferTransaction. This type of transaction is used for non-EVM and non-Cosmos blockchains including BTC, LTC, BCH
|
|
5
5
|
*
|
|
6
6
|
* @property {TransactionType} type - This fields equals to TransactionType.TRANSFER for all TransferTransactions
|
|
7
|
+
* @property {string} blockChain - The blockchain that this transaction will be executed in, same as the input blockchain of creating transaction
|
|
7
8
|
* @property {string} method - The method that should be passed to wallet. examples: deposit, transfer
|
|
8
9
|
* @property {AssetWithTicker} asset
|
|
9
10
|
* @property {string} amount - The machine-readable amount of transaction, example: 1000000000000000000
|
|
@@ -15,6 +16,7 @@ import { TransactionType } from "../transactions";
|
|
|
15
16
|
*/
|
|
16
17
|
export interface Transfer {
|
|
17
18
|
type: TransactionType;
|
|
19
|
+
blockChain: string;
|
|
18
20
|
method: string;
|
|
19
21
|
asset: AssetWithTicker;
|
|
20
22
|
amount: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transfer.d.ts","sourceRoot":"","sources":["../../../../src/types/api/txs/transfer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAChD,OAAO,
|
|
1
|
+
{"version":3,"file":"transfer.d.ts","sourceRoot":"","sources":["../../../../src/types/api/txs/transfer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEjD;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,eAAe,CAAA;IACrB,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,eAAe,CAAA;IACtB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,iBAAiB,EAAE,MAAM,CAAA;IACzB,gBAAgB,EAAE,MAAM,CAAA;IACxB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CACpB"}
|