@covalenthq/client-sdk 0.6.3 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +10 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/services/CovalentClient.d.ts +1 -1
- package/dist/es/index.js +10 -3
- package/dist/es/index.js.map +1 -1
- package/dist/es/services/CovalentClient.d.ts +1 -1
- package/dist/esm/index.js +10 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/services/CovalentClient.d.ts +1 -1
- package/dist/services/CovalentClient.d.ts +1 -1
- package/dist/services/CovalentClient.js +1 -1
- package/dist/util/CalculatePrettyBalance.js +9 -2
- package/dist/util/CalculatePrettyBalance.js.map +1 -1
- package/package.json +1 -1
|
@@ -21,7 +21,7 @@ export type Chains = "btc-mainnet" | "eth-mainnet" | "matic-mainnet" | "bsc-main
|
|
|
21
21
|
* CovalentClient Class
|
|
22
22
|
*/
|
|
23
23
|
export type Quotes = "USD" | "CAD" | "EUR" | "SGD" | "INR" | "JPY" | "VND" | "CNY" | "KRW" | "RUB" | "TRY" | "NGN" | "ARS" | "AUD" | "CHF" | "GBP";
|
|
24
|
-
export declare const userAgent = "com.covalenthq.sdk.typescript/0.6.
|
|
24
|
+
export declare const userAgent = "com.covalenthq.sdk.typescript/0.6.4";
|
|
25
25
|
export declare class Response<T> {
|
|
26
26
|
data: T;
|
|
27
27
|
error: boolean;
|
|
@@ -21,7 +21,7 @@ export type Chains = "btc-mainnet" | "eth-mainnet" | "matic-mainnet" | "bsc-main
|
|
|
21
21
|
* CovalentClient Class
|
|
22
22
|
*/
|
|
23
23
|
export type Quotes = "USD" | "CAD" | "EUR" | "SGD" | "INR" | "JPY" | "VND" | "CNY" | "KRW" | "RUB" | "TRY" | "NGN" | "ARS" | "AUD" | "CHF" | "GBP";
|
|
24
|
-
export declare const userAgent = "com.covalenthq.sdk.typescript/0.6.
|
|
24
|
+
export declare const userAgent = "com.covalenthq.sdk.typescript/0.6.4";
|
|
25
25
|
export declare class Response<T> {
|
|
26
26
|
data: T;
|
|
27
27
|
error: boolean;
|
|
@@ -5,7 +5,7 @@ import { NftService } from "./NftService";
|
|
|
5
5
|
import { PricingService } from "./PricingService";
|
|
6
6
|
import { TransactionService } from "./TransactionService";
|
|
7
7
|
import { XykService } from "./XykService";
|
|
8
|
-
export const userAgent = "com.covalenthq.sdk.typescript/0.6.
|
|
8
|
+
export const userAgent = "com.covalenthq.sdk.typescript/0.6.4";
|
|
9
9
|
export class Response {
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import Big from "big.js";
|
|
2
2
|
export const calculatePrettyBalance = (value, decimals = 18, roundOff = true, precision = 0) => {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
let bigIntValue;
|
|
4
|
+
let bigDecimalValue;
|
|
5
|
+
try {
|
|
6
|
+
bigIntValue = BigInt(value);
|
|
7
|
+
bigDecimalValue = new Big(bigIntValue.toString());
|
|
8
|
+
}
|
|
9
|
+
catch (error) {
|
|
10
|
+
bigDecimalValue = new Big(value.toString());
|
|
11
|
+
}
|
|
5
12
|
const _decimals = decimals || 18;
|
|
6
13
|
const _expoValue = BigInt(Math.pow(10, _decimals));
|
|
7
14
|
const bigDecimalExpo = new Big(_expoValue.toString());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CalculatePrettyBalance.js","sourceRoot":"","sources":["../../src/util/CalculatePrettyBalance.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,QAAQ,CAAC;AAEzB,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAClC,KAAsB,EACtB,WAAmB,EAAE,EACrB,WAAoB,IAAI,EACxB,YAAoB,CAAC,EACf,EAAE;IACR,
|
|
1
|
+
{"version":3,"file":"CalculatePrettyBalance.js","sourceRoot":"","sources":["../../src/util/CalculatePrettyBalance.ts"],"names":[],"mappings":"AAAA,OAAO,GAA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