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