@pioneer-platform/chainflip-client 0.0.5 → 0.0.7

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 (2) hide show
  1. package/lib/index.js +12 -6
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -86,6 +86,11 @@ const get_quote = function (quote) {
86
86
  if (!networkSupport.includes(caipToNetworkId(quote.sellAsset))) {
87
87
  throw new Error("unsupported sellAsset");
88
88
  }
89
+ output.sellAsset = {};
90
+ output.sellAsset.caip = quote.sellAsset;
91
+ output.sellAmount = quote.sellAmount;
92
+ output.buyAsset = {};
93
+ output.buyAsset.caip = quote.buyAsset;
89
94
  let chainSell = NetworkIdToChain[caipToNetworkId(quote.sellAsset)];
90
95
  let chainBuy = NetworkIdToChain[caipToNetworkId(quote.buyAsset)];
91
96
  log.info(tag, "chainSell: ", chainSell);
@@ -129,13 +134,13 @@ const get_quote = function (quote) {
129
134
  const data = {
130
135
  "0": {
131
136
  "json": {
132
- "srcChain": "Ethereum",
133
- "destChain": "Bitcoin",
134
- "srcAsset": "ETH",
135
- "destAsset": "BTC",
136
- "amount": "20427368230548824399",
137
+ "srcChain": longNameSell,
138
+ "destChain": longNameBuy,
139
+ "srcAsset": chainSell,
140
+ "destAsset": chainBuy,
141
+ "amount": responseQuote.data.egressAmount,
137
142
  "quote": responseQuote.data,
138
- "destAddress": "bc1qu3ghkz8788ysk7gqcvke5l0mr7skhgvpuk6dk4"
143
+ "destAddress": quote.recipientAddress,
139
144
  }
140
145
  }
141
146
  };
@@ -162,6 +167,7 @@ const get_quote = function (quote) {
162
167
  log.info(tag, "result: ", result);
163
168
  output.id = result.id;
164
169
  output.source = 'chainflip';
170
+ output.inboundAddress = result.depositAddress;
165
171
  output.estimatedExpiryTime = result.estimatedExpiryTime;
166
172
  let tx = {
167
173
  type: "transfer",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pioneer-platform/chainflip-client",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "main": "./lib/index.js",
5
5
  "types": "./lib/index.d.ts",
6
6
  "dependencies": {