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) 651 B
import"../../utils/numerics/index.js";import{getRuntimeConfig as o}from"../../runtime-config/index.js";import{BigNumber as e}from"@ethersproject/bignumber";const r=o().logVerbosityLevel;const t=console.log;function i(o){return o instanceof e?o.toString():Array.isArray(o)?o.map(i):"object"==typeof o?Object.fromEntries(Object.entries(o).map((([o,e])=>[o,i(e)]))):o}r>=2&&(console.debug=(...o)=>{const e=o.map(i);t.apply(console,e)});class s{_prefix;constructor(o){this._prefix=`[SDK][${o}]:`}error(...o){console.error(this._prefix,...o)}log(...o){console.log(this._prefix,...o)}debug(...o){r>=1&&console.debug(this._prefix,...o)}}export{s as Logger};