UNPKG

@bancor/carbon-sdk

Version:

The SDK is a READ-ONLY tool, intended to facilitate working with Carbon contracts. It's a convenient wrapper around our matching algorithm, allowing programs and users get a ready to use transaction data that will allow them to manage strategies and fulfi

2 lines (1 loc) 938 B
"use strict";require("./numerics-WtCLBFmj.cjs");var r=require("@ethersproject/bignumber");const e=e=>function e(t){if(r.BigNumber.isBigNumber(t))return t.toString();if("object"==typeof t&&null!==t){const r=Array.isArray(t)?[]:{};for(const o in t)r[o]=e(t[o]);return r}return t}(e),t=e=>({y:r.BigNumber.from(e.y),z:r.BigNumber.from(e.z),A:r.BigNumber.from(e.A),B:r.BigNumber.from(e.B)});exports.encodedOrderBNToStr=r=>e(r),exports.encodedOrderStrToBN=t,exports.encodedStrategyBNToStr=r=>e(r),exports.encodedStrategyStrToBN=e=>({id:r.BigNumber.from(e.id),token0:e.token0,token1:e.token1,order0:t(e.order0),order1:t(e.order1)}),exports.matchActionBNToStr=r=>e(r),exports.ordersMapBNToStr=r=>e(r),exports.ordersMapStrToBN=r=>{const e={};for(const[o,n]of Object.entries(r))e[o]=t(n);return e},exports.replaceBigNumbersWithStrings=e,exports.tradeActionStrToBN=e=>({strategyId:r.BigNumber.from(e.strategyId),amount:r.BigNumber.from(e.amount)});