@shapeshiftoss/swapper 11.1.1 → 11.1.3

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.
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.cowExecuteTrade = void 0;
4
4
  const caip_1 = require("@shapeshiftoss/caip");
5
5
  const chain_adapters_1 = require("@shapeshiftoss/chain-adapters");
6
- const hdwallet_core_1 = require("@shapeshiftoss/hdwallet-core");
7
6
  const types_1 = require("@shapeshiftoss/types");
8
7
  const ethers_1 = require("ethers");
9
8
  const api_1 = require("../../../api");
@@ -50,7 +49,7 @@ async function cowExecuteTrade({ apiUrl, adapter }, { trade, wallet }) {
50
49
  const bip44Params = chain_adapters_1.ethereum.ChainAdapter.defaultBIP44Params;
51
50
  const message = {
52
51
  messageToSign: {
53
- addressNList: (0, hdwallet_core_1.bip32ToAddressNList)((0, chain_adapters_1.toPath)(bip44Params)),
52
+ addressNList: (0, chain_adapters_1.toAddressNList)(bip44Params),
54
53
  message: ethers_1.ethers.utils.arrayify(orderDigest),
55
54
  },
56
55
  wallet,
@@ -1,5 +1,5 @@
1
1
  import { osmosis } from '@shapeshiftoss/chain-adapters';
2
- import { HDWallet } from '@shapeshiftoss/hdwallet-core';
2
+ import { HDWallet, Osmosis } from '@shapeshiftoss/hdwallet-core';
3
3
  import { CosmosSdkSupportedChainAdapters, TradeResult } from '../../../index';
4
4
  import { IbcTransferInput } from './types';
5
5
  export interface SymbolDenomMapping {
@@ -32,32 +32,7 @@ export declare const buildTradeTx: ({ osmoAddress, adapter, buyAssetDenom, sellA
32
32
  wallet: HDWallet;
33
33
  }) => Promise<{
34
34
  txToSign: {
35
- tx: {
36
- memo: string;
37
- fee: {
38
- amount: {
39
- amount: string;
40
- denom: string;
41
- }[];
42
- gas: string;
43
- };
44
- signatures: never[];
45
- msg: {
46
- type: string;
47
- value: {
48
- sender: string;
49
- routes: {
50
- poolId: string;
51
- tokenOutDenom: string;
52
- }[];
53
- tokenIn: {
54
- denom: string;
55
- amount: string;
56
- };
57
- tokenOutMinAmount: string;
58
- };
59
- }[];
60
- };
35
+ tx: Osmosis.StdTx;
61
36
  addressNList: number[];
62
37
  chain_id: "osmosis-1";
63
38
  account_number: string;
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.buildTradeTx = exports.performIbcTransfer = exports.getRateInfo = exports.pollForAtomChannelBalance = exports.getAtomChannelBalance = exports.pollForComplete = exports.symbolDenomMapping = void 0;
7
7
  const caip_1 = require("@shapeshiftoss/caip");
8
8
  const chain_adapters_1 = require("@shapeshiftoss/chain-adapters");
9
- const hdwallet_core_1 = require("@shapeshiftoss/hdwallet-core");
10
9
  const axios_1 = __importDefault(require("axios"));
11
10
  const lodash_1 = require("lodash");
12
11
  const index_1 = require("../../../index");
@@ -173,12 +172,7 @@ const performIbcTransfer = async (input, adapter, wallet, blockBaseUrl, denom, s
173
172
  }
174
173
  })();
175
174
  const latestBlock = responseLatestBlock.data.block.header.height;
176
- const bip44Params = adapter.buildBIP44Params({
177
- accountNumber: 0, // TODO: Use real accountNumbers
178
- });
179
- const path = (0, chain_adapters_1.toPath)(bip44Params);
180
- const addressNList = (0, hdwallet_core_1.bip32ToAddressNList)(path);
181
- const tx1 = {
175
+ const tx = {
182
176
  memo: '',
183
177
  fee: {
184
178
  amount: [
@@ -212,8 +206,8 @@ const performIbcTransfer = async (input, adapter, wallet, blockBaseUrl, denom, s
212
206
  };
213
207
  const signed = await adapter.signTransaction({
214
208
  txToSign: {
215
- tx: tx1,
216
- addressNList,
209
+ tx,
210
+ addressNList: (0, chain_adapters_1.toAddressNList)(adapter.buildBIP44Params({ accountNumber: 0 })),
217
211
  chain_id: caip_1.CHAIN_REFERENCE.OsmosisMainnet,
218
212
  account_number: accountNumber,
219
213
  sequence,
@@ -231,11 +225,6 @@ const buildTradeTx = async ({ osmoAddress, adapter, buyAssetDenom, sellAssetDeno
231
225
  const responseAccount = await adapter.getAccount(osmoAddress);
232
226
  const accountNumber = responseAccount.chainSpecific.accountNumber || '0';
233
227
  const sequence = responseAccount.chainSpecific.sequence || '0';
234
- const bip44Params = adapter.buildBIP44Params({
235
- accountNumber: 0, // TODO: Use real accountNumbers
236
- });
237
- const path = (0, chain_adapters_1.toPath)(bip44Params);
238
- const osmoAddressNList = (0, hdwallet_core_1.bip32ToAddressNList)(path);
239
228
  const tx = {
240
229
  memo: '',
241
230
  fee: {
@@ -271,7 +260,7 @@ const buildTradeTx = async ({ osmoAddress, adapter, buyAssetDenom, sellAssetDeno
271
260
  return {
272
261
  txToSign: {
273
262
  tx,
274
- addressNList: osmoAddressNList,
263
+ addressNList: (0, chain_adapters_1.toAddressNList)(adapter.buildBIP44Params({ accountNumber: 0 })),
275
264
  chain_id: caip_1.CHAIN_REFERENCE.OsmosisMainnet,
276
265
  account_number: accountNumber,
277
266
  sequence,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shapeshiftoss/swapper",
3
- "version": "11.1.1",
3
+ "version": "11.1.3",
4
4
  "description": "An interface and implementations to trade coins via various protocols",
5
5
  "repository": "https://github.com/shapeshift/lib",
6
6
  "license": "MIT",
@@ -34,7 +34,7 @@
34
34
  "@shapeshiftoss/caip": "^8.0.0",
35
35
  "@shapeshiftoss/chain-adapters": "^9.0.1",
36
36
  "@shapeshiftoss/errors": "^1.1.2",
37
- "@shapeshiftoss/hdwallet-core": "^1.31.0",
37
+ "@shapeshiftoss/hdwallet-core": "^1.33.0",
38
38
  "@shapeshiftoss/types": "^8.1.0"
39
39
  },
40
40
  "devDependencies": {
@@ -42,7 +42,7 @@
42
42
  "@shapeshiftoss/caip": "^8.0.0",
43
43
  "@shapeshiftoss/chain-adapters": "^9.0.1",
44
44
  "@shapeshiftoss/errors": "^1.1.2",
45
- "@shapeshiftoss/hdwallet-core": "^1.31.0",
45
+ "@shapeshiftoss/hdwallet-core": "^1.33.0",
46
46
  "@shapeshiftoss/types": "^8.1.0",
47
47
  "@types/readline-sync": "^1.4.4",
48
48
  "readline-sync": "^1.4.10",