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) 727 B
const t=t=>function t(n){if("bigint"==typeof n)return n.toString();if("object"==typeof n&&null!==n){const r=Array.isArray(n)?[]:{};for(const o in n)r[o]=t(n[o]);return r}return n}(t),n=t=>({y:BigInt(t.y),z:BigInt(t.z),A:BigInt(t.A),B:BigInt(t.B)}),r=n=>t(n),o=t=>({id:BigInt(t.id),token0:t.token0,token1:t.token1,order0:n(t.order0),order1:n(t.order1)}),e=n=>t(n),i=t=>{const r={};for(const[o,e]of Object.entries(t))r[o]=n(e);return r},g=n=>t(n),s=t=>({strategyId:BigInt(t.strategyId),amount:BigInt(t.amount)});export{n as encodedOrderStrToBN,r as encodedStrategyBigIntToStr,o as encodedStrategyStrToBN,g as matchActionBNToStr,e as ordersMapBNToStr,i as ordersMapStrToBN,t as replaceBigIntsWithStrings,s as tradeActionStrToBN};