@shapeshiftoss/swapper 9.13.0 → 9.14.0
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.
|
@@ -178,7 +178,6 @@ class OsmosisSwapper {
|
|
|
178
178
|
const signTxInput = await (0, helpers_1.buildTradeTx)({
|
|
179
179
|
osmoAddress,
|
|
180
180
|
adapter: osmosisAdapter,
|
|
181
|
-
trade,
|
|
182
181
|
buyAssetDenom,
|
|
183
182
|
sellAssetDenom,
|
|
184
183
|
sellAmount: ibcSellAmount !== null && ibcSellAmount !== void 0 ? ibcSellAmount : sellAmount,
|
|
@@ -205,7 +204,7 @@ class OsmosisSwapper {
|
|
|
205
204
|
// delay to ensure all nodes we interact with are up to date at this point
|
|
206
205
|
// seeing intermittent bugs that suggest the balances and sequence numbers were sometimes off
|
|
207
206
|
await new Promise((resolve) => setTimeout(resolve, 3000));
|
|
208
|
-
await (0, helpers_1.performIbcTransfer)(transfer, osmosisAdapter, wallet, this.deps.cosmosUrl, buyAssetDenom, constants_1.OSMO_COSMO_CHANNEL,
|
|
207
|
+
await (0, helpers_1.performIbcTransfer)(transfer, osmosisAdapter, wallet, this.deps.cosmosUrl, buyAssetDenom, constants_1.OSMO_COSMO_CHANNEL, '0', ibcAccountNumber, ibcSequence, gas);
|
|
209
208
|
}
|
|
210
209
|
return { tradeId: tradeId || 'error' };
|
|
211
210
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { ChainId } from '@shapeshiftoss/caip';
|
|
2
1
|
import { osmosis } from '@shapeshiftoss/chain-adapters';
|
|
3
2
|
import { HDWallet } from '@shapeshiftoss/hdwallet-core';
|
|
4
|
-
import { CosmosSdkSupportedChainAdapters,
|
|
3
|
+
import { CosmosSdkSupportedChainAdapters, TradeResult } from '../../../index';
|
|
5
4
|
import { IbcTransferInput } from './types';
|
|
6
5
|
export interface SymbolDenomMapping {
|
|
7
6
|
OSMO: string;
|
|
@@ -23,10 +22,9 @@ export declare const getRateInfo: (sellAsset: string, buyAsset: string, sellAmou
|
|
|
23
22
|
buyAmount: string;
|
|
24
23
|
}>;
|
|
25
24
|
export declare const performIbcTransfer: (input: IbcTransferInput, adapter: CosmosSdkSupportedChainAdapters, wallet: HDWallet, blockBaseUrl: string, denom: string, sourceChannel: string, feeAmount: string, accountNumber: string, sequence: string, gas: string) => Promise<TradeResult>;
|
|
26
|
-
export declare const buildTradeTx: ({ osmoAddress, adapter,
|
|
25
|
+
export declare const buildTradeTx: ({ osmoAddress, adapter, buyAssetDenom, sellAssetDenom, sellAmount, gas, wallet }: {
|
|
27
26
|
osmoAddress: string;
|
|
28
27
|
adapter: osmosis.ChainAdapter;
|
|
29
|
-
trade: Trade<ChainId>;
|
|
30
28
|
buyAssetDenom: string;
|
|
31
29
|
sellAssetDenom: string;
|
|
32
30
|
sellAmount: string;
|
|
@@ -227,7 +227,7 @@ const performIbcTransfer = async (input, adapter, wallet, blockBaseUrl, denom, s
|
|
|
227
227
|
};
|
|
228
228
|
exports.performIbcTransfer = performIbcTransfer;
|
|
229
229
|
// TODO: move to chain adapters
|
|
230
|
-
const buildTradeTx = async ({ osmoAddress, adapter,
|
|
230
|
+
const buildTradeTx = async ({ osmoAddress, adapter, buyAssetDenom, sellAssetDenom, sellAmount, gas, wallet }) => {
|
|
231
231
|
const responseAccount = await adapter.getAccount(osmoAddress);
|
|
232
232
|
const accountNumber = responseAccount.chainSpecific.accountNumber || '0';
|
|
233
233
|
const sequence = responseAccount.chainSpecific.sequence || '0';
|
|
@@ -241,7 +241,7 @@ const buildTradeTx = async ({ osmoAddress, adapter, trade, buyAssetDenom, sellAs
|
|
|
241
241
|
fee: {
|
|
242
242
|
amount: [
|
|
243
243
|
{
|
|
244
|
-
amount:
|
|
244
|
+
amount: '0',
|
|
245
245
|
denom: 'uosmo'
|
|
246
246
|
}
|
|
247
247
|
],
|
package/package.json
CHANGED