rango-sdk-basic 0.0.6 → 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.
- package/README.md +117 -3
- package/lib/services/client.d.ts +1 -1
- package/lib/services/client.d.ts.map +1 -1
- package/lib/services/client.js +12 -1
- package/lib/services/client.js.map +1 -1
- package/lib/types/api/common.d.ts +7 -2
- package/lib/types/api/common.d.ts.map +1 -1
- package/lib/types/api/meta.d.ts +9 -2
- package/lib/types/api/meta.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Rango Exchange Basic SDK (BETA)
|
|
1
|
+
# 1. Rango Exchange Basic SDK (BETA)
|
|
2
2
|
|
|
3
3
|
[](https://badge.fury.io/js/rango-sdk-basic)
|
|
4
4
|
[](https://github.com/rango-exchange/rango-sdk/blob/master/LICENSE)
|
|
@@ -11,15 +11,129 @@ This is the first phase of Rango SDK which only wraps Rest API calls. In the nex
|
|
|
11
11
|
> **WARNING:** The Rango SDK has not stabilized yet, and we might make some breaking changes.
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
## Installation
|
|
14
|
+
## 2. Installation
|
|
15
15
|
|
|
16
16
|
```shell
|
|
17
17
|
npm install rango-sdk-basic --save
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
## Usage
|
|
20
|
+
## 3. Usage
|
|
21
21
|
|
|
22
22
|
Please checkout the examples' folder for sample usage of the SDK. We will add more examples there soon.
|
|
23
23
|
|
|
24
24
|
- [Documents](https://docs.rango.exchange/integration/overview)
|
|
25
25
|
- [Examples](https://github.com/rango-exchange/rango-sdk/tree/master/examples/)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
## 4. Message Passing API
|
|
29
|
+
|
|
30
|
+
When transferring tokens using Rango cross-chain API, you could pass a random message from the source chain to the destination and call your contract on the destination. In order to do so, you need to pass your contracts on source & destination chains plus an arbitrary hex message like this:
|
|
31
|
+
|
|
32
|
+
### 4.1. SDK usage
|
|
33
|
+
|
|
34
|
+
You should specify `sourceContract`, `destinationContract` and `imMessage` arguments in both `quote` and `swap` methods if you want to pass a message from the source contract to the destination.
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
const quoteResponse = await rangoClient.quote({
|
|
38
|
+
from: {
|
|
39
|
+
"blockchain": "FANTOM",
|
|
40
|
+
"symbol": "FTM",
|
|
41
|
+
"address": null
|
|
42
|
+
},
|
|
43
|
+
to: {
|
|
44
|
+
"blockchain": "BSC",
|
|
45
|
+
"symbol": "BNB",
|
|
46
|
+
"address": null
|
|
47
|
+
},
|
|
48
|
+
amount: "100000000000000000000",
|
|
49
|
+
messagingProtocols: ['cbridge'],
|
|
50
|
+
sourceContract: "<source contract address>",
|
|
51
|
+
destinationContract: "<destination contract address>",
|
|
52
|
+
imMessage: "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000007E8A8b130272430008eCa062419ACD8B423d339D"
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
As you can see in the code above, you could also limit `messagingProtocols` used to a custom list like `['cbridge']`. (Please note that as message is relayed alongside with token in a single transaction, if you limit messaging protocols to celer bridge, we use same bridge (cbridge) for transerring tokens.
|
|
58
|
+
Here is list of all available options for `messagingProtocols`: `cbridge`, (soon: `anyswap`, `axelar`, `layer0`)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
```ts
|
|
62
|
+
const swapResponse = await rangoClient.swap({
|
|
63
|
+
from: {
|
|
64
|
+
"blockchain": "FANTOM",
|
|
65
|
+
"symbol": "FTM",
|
|
66
|
+
"address": null
|
|
67
|
+
},
|
|
68
|
+
to: {
|
|
69
|
+
"blockchain": "BSC",
|
|
70
|
+
"symbol": "BNB",
|
|
71
|
+
"address": null
|
|
72
|
+
},
|
|
73
|
+
amount: "100000000000000000000",
|
|
74
|
+
fromAddress: fromAddress,
|
|
75
|
+
toAddress: fromAddress,
|
|
76
|
+
disableEstimate: false,
|
|
77
|
+
referrerAddress: null,
|
|
78
|
+
referrerFee: null,
|
|
79
|
+
slippage: '1.0',
|
|
80
|
+
messagingProtocols: ['cbridge'],
|
|
81
|
+
sourceContract: "<source contract address>",
|
|
82
|
+
destinationContract: "<destination contract address>",
|
|
83
|
+
imMessage: "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000007E8A8b130272430008eCa062419ACD8B423d339D"
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
if (!!swapResponse && !swapResponse.error && swapResponse.resultType === "OK" && swapResponse.tx?.type === TransactionType.EVM) {
|
|
87
|
+
const evmTx = swapResponse.tx as EvmTransaction
|
|
88
|
+
const value = evmTx.value
|
|
89
|
+
const txData = evmTx.value
|
|
90
|
+
console.log({value, txData})
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
You need to use `value` and `txData` if you want to call your own contract. (not calling Rango directly from the client side)
|
|
94
|
+
|
|
95
|
+
### 4.2. dApp Contracts
|
|
96
|
+
|
|
97
|
+
Both dApp contracts on the source and destination chains should implemenet `IRangoMessageReceiver` interface. Rango will call `handleRangoMessage` function in case of `SUCCESS`, `REFUND_IN_SOURCE` or `REFUND_IN_DESTINATION`.
|
|
98
|
+
```solidity
|
|
99
|
+
interface IRangoMessageReceiver {
|
|
100
|
+
enum ProcessStatus { SUCCESS, REFUND_IN_SOURCE, REFUND_IN_DESTINATION }
|
|
101
|
+
|
|
102
|
+
function handleRangoMessage(
|
|
103
|
+
address _token,
|
|
104
|
+
uint _amount,
|
|
105
|
+
ProcessStatus _status,
|
|
106
|
+
bytes memory _message
|
|
107
|
+
) external;
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
And here is a sample dapp contract for the demo purpose. (The demo is very simple and you should consider adding security considerations yourself)
|
|
112
|
+
|
|
113
|
+
https://gist.github.com/RanGojo/1066ed2bf1556be7c2def69dbe2b3cb9
|
|
114
|
+
|
|
115
|
+
You need to deploy this contract on every chains needed and **ask us to white list them in Rango Contract**.
|
|
116
|
+
|
|
117
|
+
Here are some sample transaction for this contracts in action for swapping Fantom.FTM to BSC.BNB and relaying custom message:
|
|
118
|
+
|
|
119
|
+
- Inbound transaction:
|
|
120
|
+
https://ftmscan.com/tx/0x59a526e4376dc5b083b7876d47699b6c110fcba319c78553f3b8342674a68b3d
|
|
121
|
+
|
|
122
|
+
- Outbound transaction:
|
|
123
|
+
https://bscscan.com/tx/0x8e91d7c3baf914cad8190bba4d608149d093d059ef769f9ca7a01a3d90a9c5e9
|
|
124
|
+
|
|
125
|
+
Here is how dApp [call Rango](https://gist.github.com/RanGojo/1066ed2bf1556be7c2def69dbe2b3cb9#file-crosschainsampleapp-sol-L36) in the source chain:
|
|
126
|
+
|
|
127
|
+

|
|
128
|
+
|
|
129
|
+
And here is how dApp could [handle Rango message](https://gist.github.com/RanGojo/1066ed2bf1556be7c2def69dbe2b3cb9#file-crosschainsampleapp-sol-L45):
|
|
130
|
+
|
|
131
|
+

|
|
132
|
+
|
|
133
|
+
We emit a sample event in destination for debug and here you could check it:
|
|
134
|
+
|
|
135
|
+
[emit NFTPurchaseStatus(m.assetId, m.buyer, PurchaseType.BOUGHT);](https://gist.github.com/RanGojo/1066ed2bf1556be7c2def69dbe2b3cb9#file-crosschainsampleapp-sol-L64)
|
|
136
|
+
|
|
137
|
+

|
|
138
|
+
|
|
139
|
+
|
package/lib/services/client.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ declare type WalletAddress = {
|
|
|
6
6
|
export declare class RangoClient {
|
|
7
7
|
private readonly deviceId;
|
|
8
8
|
private readonly apiKey;
|
|
9
|
-
constructor(apiKey: string);
|
|
9
|
+
constructor(apiKey: string, debug?: boolean);
|
|
10
10
|
meta(): Promise<MetaResponse>;
|
|
11
11
|
quote(quoteRequest: QuoteRequest): Promise<QuoteResponse>;
|
|
12
12
|
isApproved(requestId: string, txId: string): Promise<CheckApprovalResponse>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/services/client.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,qBAAqB,EACrB,aAAa,EACb,cAAc,EACd,WAAW,EACX,YAAY,EACZ,wBAAwB,EACxB,qBAAqB,EAEtB,MAAM,UAAU,CAAA;AAEjB,aAAK,aAAa,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAA;AAE5D,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;IAEjC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAQ;gBAEnB,MAAM,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/services/client.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,qBAAqB,EACrB,aAAa,EACb,cAAc,EACd,WAAW,EACX,YAAY,EACZ,wBAAwB,EACxB,qBAAqB,EAEtB,MAAM,UAAU,CAAA;AAEjB,aAAK,aAAa,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAA;AAE5D,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;IAEjC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAQ;gBAEnB,MAAM,EAAE,MAAM,EAAE,KAAK,GAAE,OAAe;IA8BrC,IAAI,IAAI,OAAO,CAAC,YAAY,CAAC;IAO7B,KAAK,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC;IAyBzD,UAAU,CACrB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,qBAAqB,CAAC;IAWpB,MAAM,CAAC,aAAa,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC;IAW7D,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC;IAyBrD,aAAa,CACxB,WAAW,EAAE,wBAAwB,GACpC,OAAO,CAAC,IAAI,CAAC;IAUH,OAAO,CAClB,aAAa,EAAE,aAAa,GAC3B,OAAO,CAAC,qBAAqB,CAAC;CAUlC"}
|
package/lib/services/client.js
CHANGED
|
@@ -52,7 +52,8 @@ var uuid_1 = require("uuid");
|
|
|
52
52
|
var httpService_1 = require("./httpService");
|
|
53
53
|
var types_1 = require("../types");
|
|
54
54
|
var RangoClient = /** @class */ (function () {
|
|
55
|
-
function RangoClient(apiKey) {
|
|
55
|
+
function RangoClient(apiKey, debug) {
|
|
56
|
+
if (debug === void 0) { debug = false; }
|
|
56
57
|
this.apiKey = apiKey;
|
|
57
58
|
try {
|
|
58
59
|
if (typeof window !== 'undefined') {
|
|
@@ -73,6 +74,16 @@ var RangoClient = /** @class */ (function () {
|
|
|
73
74
|
catch (e) {
|
|
74
75
|
this.deviceId = (0, uuid_1.v4)();
|
|
75
76
|
}
|
|
77
|
+
if (debug) {
|
|
78
|
+
httpService_1.httpService.interceptors.request.use(function (request) {
|
|
79
|
+
console.log('Starting Request', JSON.stringify(request, null, 2));
|
|
80
|
+
return request;
|
|
81
|
+
});
|
|
82
|
+
httpService_1.httpService.interceptors.response.use(function (response) {
|
|
83
|
+
console.log('Response:', JSON.stringify(response, null, 2));
|
|
84
|
+
return response;
|
|
85
|
+
});
|
|
86
|
+
}
|
|
76
87
|
}
|
|
77
88
|
RangoClient.prototype.meta = function () {
|
|
78
89
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/services/client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6BAAyB;AAEzB,6CAA2C;AAC3C,kCAYiB;AAIjB;IAKE,qBAAY,MAAc;
|
|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CACZ,OAAO,EAAE,EAAE,YAAY,EAAE,IAAI,CAAC,QAAQ,EAAE;6BACzC,CACF,EAAA;;wBANK,aAAa,GAAG,SAMrB;wBACD,sBAAO,aAAa,CAAC,IAAI,EAAA;;;;KAC1B;IAEY,mCAAa,GAA1B,UACE,WAAqC;;;;4BAErC,qBAAM,yBAAW,CAAC,IAAI,CACpB,kCAA2B,IAAI,CAAC,MAAM,CAAE,EACxC,WAAW,EACX;4BACE,OAAO,EAAE,EAAE,YAAY,EAAE,IAAI,CAAC,QAAQ,EAAE;yBACzC,CACF,EAAA;;wBAND,SAMC,CAAA;;;;;KACF;IAEY,6BAAO,GAApB,UACE,aAA4B;;;;;4BAEN,qBAAM,yBAAW,CAAC,GAAG,CACzC,gCAAyB,IAAI,CAAC,MAAM,CAAE,EACtC;4BACE,MAAM,EAAE,aAAa;4BACrB,OAAO,EAAE,EAAE,YAAY,EAAE,IAAI,CAAC,QAAQ,EAAE;yBACzC,CACF,EAAA;;wBANK,aAAa,GAAG,SAMrB;wBACD,sBAAO,aAAa,CAAC,IAAI,EAAA;;;;KAC1B;IACH,kBAAC;AAAD,CAAC,AA7ID,IA6IC;AA7IY,kCAAW"}
|
|
@@ -40,13 +40,18 @@ export declare type SwapFee = {
|
|
|
40
40
|
expenseType: 'FROM_SOURCE_WALLET' | 'DECREASE_FROM_OUTPUT' | 'FROM_DESTINATION_WALLET';
|
|
41
41
|
amount: string;
|
|
42
42
|
};
|
|
43
|
+
/**
|
|
44
|
+
* Type of the swapper
|
|
45
|
+
*
|
|
46
|
+
*/
|
|
47
|
+
export declare type SwapperType = 'BRIDGE' | 'DEX' | 'AGGREGATOR';
|
|
43
48
|
/**
|
|
44
49
|
* A quote path from asset x (from) to asset y (to)
|
|
45
50
|
*
|
|
46
51
|
* @property {Token} from - The source asset
|
|
47
52
|
* @property {Token} to - The destination asset
|
|
48
53
|
* @property {SwapperMetaDto} swapper - Swapper for this path
|
|
49
|
-
* @property {
|
|
54
|
+
* @property {SwapperType} swapperType - Type of swapper
|
|
50
55
|
* @property {string} expectedOutput - Expected output
|
|
51
56
|
*
|
|
52
57
|
*/
|
|
@@ -54,7 +59,7 @@ export declare type QuotePath = {
|
|
|
54
59
|
from: Token;
|
|
55
60
|
to: Token;
|
|
56
61
|
swapper: SwapperMetaDto;
|
|
57
|
-
swapperType:
|
|
62
|
+
swapperType: SwapperType;
|
|
58
63
|
expectedOutput: string;
|
|
59
64
|
};
|
|
60
65
|
/**
|
|
@@ -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;IAC7B,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED;;;;;;;;;GASG;AACH,oBAAY,SAAS,GAAG;IACtB,IAAI,EAAE,KAAK,CAAA;IACX,EAAE,EAAE,KAAK,CAAA;IACT,OAAO,EAAE,cAAc,CAAA;IACvB,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/types/api/common.ts"],"names":[],"mappings":"AAAA,OA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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
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Asset } from './common';
|
|
2
|
-
import { TransactionType } from
|
|
1
|
+
import type { Asset, SwapperType } from './common';
|
|
2
|
+
import { TransactionType } from './transactions';
|
|
3
3
|
/**
|
|
4
4
|
* Blockchain information
|
|
5
5
|
*
|
|
@@ -22,11 +22,18 @@ export declare type BlockchainMeta = {
|
|
|
22
22
|
};
|
|
23
23
|
/**
|
|
24
24
|
* Metadata of Swapper
|
|
25
|
+
*
|
|
26
|
+
* @property {string} id - Unique identifier for the swapper
|
|
27
|
+
* @property {string} title - Display name for the swapper
|
|
28
|
+
* @property {string} logo - Icon logo for the swapper
|
|
29
|
+
* @property {SwapperType[]} types - Type of the transaction supported by the swapper
|
|
30
|
+
*
|
|
25
31
|
*/
|
|
26
32
|
export declare type SwapperMetaDto = {
|
|
27
33
|
id: string;
|
|
28
34
|
title: string;
|
|
29
35
|
logo: string;
|
|
36
|
+
types: SwapperType[];
|
|
30
37
|
};
|
|
31
38
|
/**
|
|
32
39
|
* All metadata info for a token, unique by (blockchain, symbol, address) tuple
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/types/api/meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;
|
|
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;;;;;;;;GAQG;AACH,oBAAY,cAAc,GAAG;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,WAAW,EAAE,CAAA;CACrB,CAAA;AAED;;;;;;;;;GASG;AACH,oBAAY,KAAK,GAAG;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;CACd,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"}
|