@shapeshiftoss/swapper 11.1.0 → 11.1.2
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,
|
|
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
|
|
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
|
|
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:
|
|
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