sideshift-node-sdk
Version:
TypeScript Client for SideShift.ai API
33 lines (32 loc) • 1.2 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CoinsAPI = void 0;
class CoinsAPI {
constructor(sideShiftHttpHandler) {
this.sideShiftHttpHandler = sideShiftHttpHandler;
}
/**
* Returns the list of coins and their respective networks available on SideShift.ai.
*
* Note: The fields fixedOnly, variableOnly, depositOffline, settleOffline will
* return false if false for every network. true for single network assets
* and an array of networks for mixed.
*
* @see https://docs.sideshift.ai/endpoints/v2/coins
* @returns Promise<ApiResponse<Coin[]>>
*/
async getCoins() {
return this.sideShiftHttpHandler.execute('GET', '/coins');
}
/**
* Returns the icon of the coin in svg or png format.
* @see https://docs.sideshift.ai/endpoints/v2/coinicon
*
* @param coinNetwork - The coin-network. Network can be ommitted (e.g., 'btc-mainnet' or 'btc')
* @returns Promise<ApiResponse<string>>
*/
async getCoinIcon(coinNetwork) {
return this.sideShiftHttpHandler.execute('GET', `/coins/icon/${coinNetwork}`);
}
}
exports.CoinsAPI = CoinsAPI;