Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bancor/carbon-sdk

Package Overview
Dependencies
Maintainers
2
Versions
105
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bancor/carbon-sdk - npm Package Compare versions

Comparing version 0.0.73-DEV to 0.0.74-DEV

1

dist/common/logger.d.ts
export declare class Logger {
private _prefix;
constructor(file: string);
error(...args: any[]): void;
log(...args: any[]): void;

@@ -5,0 +6,0 @@ debug(...args: any[]): void;

@@ -19,2 +19,3 @@ import { BigNumber } from '../utils/numerics';

getDecimalsByAddress: (address: string) => Promise<number>;
private _getFilteredStrategies;
getLatestStrategyCreatedStrategies: (fromBlock: number, toBlock: number) => Promise<EncodedStrategy[]>;

@@ -21,0 +22,0 @@ getLatestStrategyUpdatedStrategies: (fromBlock: number, toBlock: number) => Promise<EncodedStrategy[]>;

12

dist/shared/index2.js

@@ -66,3 +66,3 @@ import EventEmitter from 'events';

catch (e) {
console.error('Failed to deserialize cache, returning clear cache', e);
logger$1.error('Failed to deserialize cache, returning clear cache', e);
}

@@ -75,3 +75,3 @@ return new ChainCache();

if (version !== schemeVersion) {
console.log('Cache version mismatch, ignoring cache. Expected', schemeVersion, 'got', version, 'This may be due to a breaking change in the cache format since it was last persisted.');
logger$1.log('Cache version mismatch, ignoring cache. Expected', schemeVersion, 'got', version, 'This may be due to a breaking change in the cache format since it was last persisted.');
return;

@@ -455,3 +455,3 @@ }

catch (e) {
console.error('Error while syncing pairs data', e);
logger.error('Error while syncing pairs data', e);
setTimeout(processPairs, 60000);

@@ -542,3 +542,3 @@ }

catch (err) {
console.error('Error syncing events:', err);
logger.error('Error syncing events:', err);
}

@@ -561,3 +561,3 @@ setTimeout(processEvents, interval);

if (number > currentBlock) {
console.log('reorg detected for block number', number, 'larger than current block', currentBlock, 'with hash', hash);
logger.log('reorg detected for block number', number, 'larger than current block', currentBlock, 'with hash', hash);
return true;

@@ -567,3 +567,3 @@ }

if (hash !== currentHash) {
console.log('reorg detected for block number', number, 'old hash', hash, 'new hash', currentHash);
logger.log('reorg detected for block number', number, 'old hash', hash, 'new hash', currentHash);
return true;

@@ -570,0 +570,0 @@ }

import { B as BigNumber } from './numerics.js';
function getVerbosityLevel() {
if (self !== undefined) {
return Number(self.CARBON_DEFI_SDK_VERBOSITY) || 0;
}
else if (typeof window !== 'undefined') {
return Number(window.CARBON_DEFI_SDK_VERBOSITY) || 0;
}
else if (typeof process !== 'undefined' && process.env) {
return Number(process.env.CARBON_DEFI_SDK_VERBOSITY) || 0;
}
return 0;
}
const verbosity = getVerbosityLevel();
function isVerbose() {
return verbosity >= 1;
}
function shouldConvertBigNumbersToStrings() {
return verbosity >= 2;
}
const originalLog = console.log;

@@ -19,3 +38,3 @@ function convertBigNumbersToStrings(obj) {

}
{
if (shouldConvertBigNumbersToStrings()) {
console.debug = (...args) => {

@@ -31,2 +50,5 @@ const convertedArgs = args.map(convertBigNumbersToStrings);

}
error(...args) {
console.error(this._prefix, ...args);
}
log(...args) {

@@ -36,3 +58,3 @@ console.log(this._prefix, ...args);

debug(...args) {
console.debug(this._prefix, ...args);
isVerbose() && console.debug(this._prefix, ...args);
}

@@ -39,0 +61,0 @@ }

@@ -5,3 +5,3 @@ {

"source": "src/index.ts",
"version": "0.0.73-DEV",
"version": "0.0.74-DEV",
"description": "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 fulfill trades",

@@ -8,0 +8,0 @@ "main": "dist/index.js",

@@ -80,2 +80,16 @@ # Carbon SDK

## Notes
- The SDK Logger supports 3 verbosity levels:
- `0` (default) only prints errors and important logs.
- `1` (debug) prints highly verbose logs.
- `2` (debug readable) is same as `1` but also converts any BigNumber to an easy to read string (impacting performance).
To use it in Node, set the environment variable `CARBON_DEFI_SDK_VERBOSITY` to the desired level.
To use it from a browser app do, before importing the SDK:
```js
window.CARBON_DEFI_SDK_VERBOSITY = 2;
```
## Authors

@@ -82,0 +96,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc