Skip to content

Releases: many-things/osmosis-router

v1.1.6

20 Dec 10:33
Compare
Choose a tag to compare

Full Changelog: 1.1.5...1.1.6

v1.1.5

20 Dec 09:41
Compare
Choose a tag to compare

Full Changelog: 1.1.1...1.1.5

v1.1.1

09 Dec 04:36
Compare
Choose a tag to compare
  • Enable strict type checking (3bababc)
  • Support empty pool_assets (870c54c)
  • Throw error on getOptimizedRoutesByTokenIn fail (5303117)

v1.1.0

08 Dec 07:51
Compare
Choose a tag to compare
  • @many-things/osmosis-router is a minimal package for Osmosis Swap Estimation.
  • Please use the latest 1.1.0 over 1.0.2 and under(API interface for amount is different, also fixed bugs).
import { Currency } from '@keplr-wallet/types';
import { estimateSwap } from '@many-things/osmosis-router';

const tokenInCurrency: Currency = {
  coinDenom: 'OSMO',
  coinMinimalDenom: 'uosmo',
  coinDecimals: 6,
};
const tokenOutCurrency: Currency = {
  coinDenom: 'USDC',
  coinMinimalDenom:
    'ibc/D189335C6E4A68B513C10AB227BF1C1D38C746766278BA3EEB4FB14124F1D858',
  coinDecimals: 6,
};

// 1 OSMO = 0.899660 USDC
const amount: string = '1000000'; // (1 * 10 ** 6).toString();
estimateSwap(tokenInCurrency, tokenOutCurrency, amount); // CoinPretty (0.899660 USDC)