counterstake-sdk
Version:
Counterstake SDK for integrating cross-chain transactions in your dapps
26 lines (25 loc) • 1.03 kB
TypeScript
/**
* Find an Oswap pool that connects `from_asset` and `to_asset`
* @memberOf counterstake-sdk
* @param {string} from_asset
* @param {string} to_asset
* @param {boolean} testnet
* @param {Object} obyteClient
* @return {Promise<?string>}
* @example
* const pool = await findOswapPool(from_asset, to_asset, testnet, obyteClient);
*/
export function findOswapPool(from_asset: string, to_asset: string, testnet: boolean, obyteClient: any): Promise<string | null>;
/**
* Get the output amount from swapping `in_asset` through `pool`
* @memberOf counterstake-sdk
* @param {string} pool
* @param {number} in_amount_in_pennies
* @param {string} in_asset
* @param {boolean} testnet
* @param {Object} obyteClient
* @return {Promise<number>}
* @example
* const out_amount_in_pennies = await getOswapOutput(pool, in_amount_in_pennies, in_asset, testnet, obyteClient);
*/
export function getOswapOutput(pool: string, in_amount_in_pennies: number, in_asset: string, testnet: boolean, obyteClient: any): Promise<number>;