@covalenthq/client-sdk 0.9.6 → 0.9.8

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.
@@ -264,7 +264,7 @@ declare class ChainStatusItem {
264
264
  /** * True if the chain is a testnet. */
265
265
  is_testnet: boolean;
266
266
  /** * A svg logo url for the chain. */
267
- logo_url: boolean;
267
+ logo_url: string;
268
268
  /** * A black png logo url for the chain. */
269
269
  black_logo_url: string;
270
270
  /** * A white png logo url for the chain. */
@@ -9,7 +9,7 @@ export type Chain = "btc-mainnet" | "eth-mainnet" | "matic-mainnet" | "bsc-mainn
9
9
  export type Quote = "USD" | "CAD" | "EUR" | "SGD" | "INR" | "JPY" | "VND" | "CNY" | "KRW" | "RUB" | "TRY" | "NGN" | "ARS" | "AUD" | "CHF" | "GBP";
10
10
  export type ChainID = 20090103 | 1 | 137 | 56 | 43114 | 10 | 250 | 1284 | 1285 | 30 | 42161 | 11297108109 | 8217 | 128 | 71402 | 2020 | 9001 | 592 | 4689 | 1666600000 | 25 | 1313161554 | 42262 | 288 | 5 | 80001 | 43113 | 97 | 1287 | 31 | 421613 | 4002 | 11297108099 | 256 | 71401 | 9000 | 4690 | 1666700000 | 1313161555 | 534354 | 534351 | 1131378225 | 53935 | 73772 | 43288 | 1294 | 56288 | 28 | 1297 | 9728 | 4328 | 1001 | 192837465 | 356256156 | 1564830818 | 278611351 | 432204 | 1026062157 | 432201 | 81 | 338 | 335 | 1088 | 588 | 2002 | 200202 | 2001 | 200101 | 73773 | 1399811149 | 2046399126 | 82 | 83 | 2139927552 | 2888 | 245022926 | 344106930 | 476158412 | 42170 | 7700 | 119 | 1029 | 14 | 114 | 19 | 16 | 321 | 322 | 1422 | 59140 | 84531 | 5001 | 534353 | 248 | 9372 | 2152 | 2154 | 416 | 23294 | 23295 | 420 | 1101 | 1662 | 1024 | 39797 | 49797 | 1663 | 11155111 | 1482601649 | 644937893 | 222000222 | 49321 | 1231 | 1230 | 7777777 | 999 | 245022934 | 2044 | 8453 | 5000 | 262018 | 59144 | 7332 | 10507 | 7979 | 1234 | 1228 | 8888 | 333000333 | 12008 | 12011 | 2038 | 1995 | 12010 | 51178 | 12009 | 12012 | 324 | 599 | 280 | 1343 | 11115 | 6765897100 | 1079 | 13337 | 16350 | 1990 | 20221 | 5611 | 12018 | 12013 | 12020 | 12015 | 12016 | 12014 | 12017 | 12019 | 431234 | 6119 | 73 | 7001 | 42888 | 919 | 5151706 | 923018 | 3441005 | 424 | 58008 | 100 | 10200 | 570 | 57000 | 167007 | 11155420 | 204 | 40 | 41 | 321123 | 360163 | 78431 | 2037 | 17772 | 152703 | 894538 | 179188 | 78432 | 7777 | 986532 | 78430 | 2195 | 11111 | 3012 | 4337 | 534352 | 17000 | 88 | 89 | 20765 | 84532 | 47279324479 | 421614 | 12027 | 12028 | 12029 | 31330 | 31331 | 31332 | 31333 | 31334 | 31335 | 412346 | 8545 | 42220 | 167008 | 336 | 999999999 | 4200 | 686868 | 1992 | 660279;
11
11
  export type Source = "Ponder" | "GoldRush" | "Viem";
12
- export declare const userAgent = "com.covalenthq.sdk.typescript/0.9.6";
12
+ export declare const userAgent = "com.covalenthq.sdk.typescript/0.9.8";
13
13
  export declare class Response<T> {
14
14
  data: T;
15
15
  error: boolean;
@@ -192,7 +192,7 @@ export interface ChainStatusItem {
192
192
  /** * True if the chain is a testnet. */
193
193
  is_testnet: boolean;
194
194
  /** * A svg logo url for the chain. */
195
- logo_url: boolean;
195
+ logo_url: string;
196
196
  /** * A black png logo url for the chain. */
197
197
  black_logo_url: string;
198
198
  /** * A white png logo url for the chain. */
@@ -264,7 +264,7 @@ declare class ChainStatusItem {
264
264
  /** * True if the chain is a testnet. */
265
265
  is_testnet: boolean;
266
266
  /** * A svg logo url for the chain. */
267
- logo_url: boolean;
267
+ logo_url: string;
268
268
  /** * A black png logo url for the chain. */
269
269
  black_logo_url: string;
270
270
  /** * A white png logo url for the chain. */
@@ -9,7 +9,7 @@ export type Chain = "btc-mainnet" | "eth-mainnet" | "matic-mainnet" | "bsc-mainn
9
9
  export type Quote = "USD" | "CAD" | "EUR" | "SGD" | "INR" | "JPY" | "VND" | "CNY" | "KRW" | "RUB" | "TRY" | "NGN" | "ARS" | "AUD" | "CHF" | "GBP";
10
10
  export type ChainID = 20090103 | 1 | 137 | 56 | 43114 | 10 | 250 | 1284 | 1285 | 30 | 42161 | 11297108109 | 8217 | 128 | 71402 | 2020 | 9001 | 592 | 4689 | 1666600000 | 25 | 1313161554 | 42262 | 288 | 5 | 80001 | 43113 | 97 | 1287 | 31 | 421613 | 4002 | 11297108099 | 256 | 71401 | 9000 | 4690 | 1666700000 | 1313161555 | 534354 | 534351 | 1131378225 | 53935 | 73772 | 43288 | 1294 | 56288 | 28 | 1297 | 9728 | 4328 | 1001 | 192837465 | 356256156 | 1564830818 | 278611351 | 432204 | 1026062157 | 432201 | 81 | 338 | 335 | 1088 | 588 | 2002 | 200202 | 2001 | 200101 | 73773 | 1399811149 | 2046399126 | 82 | 83 | 2139927552 | 2888 | 245022926 | 344106930 | 476158412 | 42170 | 7700 | 119 | 1029 | 14 | 114 | 19 | 16 | 321 | 322 | 1422 | 59140 | 84531 | 5001 | 534353 | 248 | 9372 | 2152 | 2154 | 416 | 23294 | 23295 | 420 | 1101 | 1662 | 1024 | 39797 | 49797 | 1663 | 11155111 | 1482601649 | 644937893 | 222000222 | 49321 | 1231 | 1230 | 7777777 | 999 | 245022934 | 2044 | 8453 | 5000 | 262018 | 59144 | 7332 | 10507 | 7979 | 1234 | 1228 | 8888 | 333000333 | 12008 | 12011 | 2038 | 1995 | 12010 | 51178 | 12009 | 12012 | 324 | 599 | 280 | 1343 | 11115 | 6765897100 | 1079 | 13337 | 16350 | 1990 | 20221 | 5611 | 12018 | 12013 | 12020 | 12015 | 12016 | 12014 | 12017 | 12019 | 431234 | 6119 | 73 | 7001 | 42888 | 919 | 5151706 | 923018 | 3441005 | 424 | 58008 | 100 | 10200 | 570 | 57000 | 167007 | 11155420 | 204 | 40 | 41 | 321123 | 360163 | 78431 | 2037 | 17772 | 152703 | 894538 | 179188 | 78432 | 7777 | 986532 | 78430 | 2195 | 11111 | 3012 | 4337 | 534352 | 17000 | 88 | 89 | 20765 | 84532 | 47279324479 | 421614 | 12027 | 12028 | 12029 | 31330 | 31331 | 31332 | 31333 | 31334 | 31335 | 412346 | 8545 | 42220 | 167008 | 336 | 999999999 | 4200 | 686868 | 1992 | 660279;
11
11
  export type Source = "Ponder" | "GoldRush" | "Viem";
12
- export declare const userAgent = "com.covalenthq.sdk.typescript/0.9.6";
12
+ export declare const userAgent = "com.covalenthq.sdk.typescript/0.9.8";
13
13
  export declare class Response<T> {
14
14
  data: T;
15
15
  error: boolean;
@@ -6,7 +6,7 @@ import { PricingService } from "./PricingService";
6
6
  import { TransactionService } from "./TransactionService";
7
7
  import { XykService } from "./XykService";
8
8
  import { ApiKeyValidator } from "../util/ApiKeyValidator";
9
- export const userAgent = "com.covalenthq.sdk.typescript/0.9.6";
9
+ export const userAgent = "com.covalenthq.sdk.typescript/0.9.8";
10
10
  export class Response {
11
11
  }
12
12
  /**
@@ -9,10 +9,13 @@ export const calculatePrettyBalance = (value, decimals = 18, roundOff = true, pr
9
9
  catch (error) {
10
10
  bigDecimalValue = new Big(value.toString());
11
11
  }
12
- const _decimals = decimals || 18;
12
+ const _decimals = decimals ?? 18;
13
13
  const _expoValue = BigInt(Math.pow(10, _decimals));
14
14
  const bigDecimalExpo = new Big(_expoValue.toString());
15
15
  const _calculated = bigDecimalValue.div(bigDecimalExpo);
16
+ if (decimals === 0) {
17
+ return _calculated.toString();
18
+ }
16
19
  // removes the decimal places, true by default so it adds decimals
17
20
  if (!roundOff) {
18
21
  return _calculated.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,s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7 +192,7 @@ export interface ChainStatusItem {
192
192
  /** * True if the chain is a testnet. */
193
193
  is_testnet: boolean;
194
194
  /** * A svg logo url for the chain. */
195
- logo_url: boolean;
195
+ logo_url: string;
196
196
  /** * A black png logo url for the chain. */
197
197
  black_logo_url: string;
198
198
  /** * A white png logo url for the chain. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@covalenthq/client-sdk",
3
- "version": "0.9.6",
3
+ "version": "0.9.8",
4
4
  "types": "dist/index.d.ts",
5
5
  "files": [
6
6
  "/dist"