@pioneer-platform/chainflip-client 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.
Files changed (2) hide show
  1. package/lib/index.js +14 -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,16 +134,17 @@ 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": amountToQuote.toString(),
137
142
  "quote": responseQuote.data,
138
- "destAddress": "bc1qu3ghkz8788ysk7gqcvke5l0mr7skhgvpuk6dk4"
143
+ "destAddress": quote.recipientAddress,
139
144
  }
140
145
  }
141
146
  };
147
+ log.info("data good: ", data);
142
148
  const headers = {
143
149
  'Accept': '*/*',
144
150
  'Accept-Encoding': 'gzip, deflate, br, zstd',
@@ -162,6 +168,7 @@ const get_quote = function (quote) {
162
168
  log.info(tag, "result: ", result);
163
169
  output.id = result.id;
164
170
  output.source = 'chainflip';
171
+ output.inboundAddress = result.depositAddress;
165
172
  output.estimatedExpiryTime = result.estimatedExpiryTime;
166
173
  let tx = {
167
174
  type: "transfer",
@@ -177,6 +184,7 @@ const get_quote = function (quote) {
177
184
  }
178
185
  catch (e) {
179
186
  console.error(tag, "e: ", e);
187
+ console.error(tag, "e: ", JSON.stringify(e));
180
188
  throw e;
181
189
  }
182
190
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pioneer-platform/chainflip-client",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "main": "./lib/index.js",
5
5
  "types": "./lib/index.d.ts",
6
6
  "dependencies": {