@hinkal/common 0.1.27 → 0.1.28

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chains.constants.cjs"),t="https://api.coingecko.com/api/v3",c="https://pro-api.coingecko.com/api/v3",o=process.env.COINGECKO_API_KEY,s="x-cg-pro-api-key",i=o?c:t,r=n=>`${i}/simple/price?ids=${n}&vs_currencies=USD,ETH`,h=(n,a)=>`${i}/simple/token_price/${a}?contract_addresses=${n}&vs_currencies=USD`,l=`${c}/coins/list`,d={[e.chainIds.arbMainnet]:"ethereum",[e.chainIds.localhost]:"ethereum",[e.chainIds.ethMainnet]:"ethereum",[e.chainIds.optimism]:"ethereum",[e.chainIds.avalanche]:"avalanche-2",[e.chainIds.polygon]:"matic-network",[e.chainIds.bnbMainnet]:"binancecoin",[e.chainIds.base]:"ethereum"},I=n=>{switch(e.getNonLocalhostChainId(n)){case e.chainIds.ethMainnet:return"ethereum";case e.chainIds.polygon:return"polygon-pos";case e.chainIds.bnbMainnet:return"binance-smart-chain";case e.chainIds.optimism:return"optimistic-ethereum";case e.chainIds.arbMainnet:return"arbitrum-one";case e.chainIds.avalanche:return"avalanche";case e.chainIds.base:return"base";default:return"ethereum"}},p={[e.chainIds.polygon]:"polygon-pos",[e.chainIds.arbMainnet]:"arbitrum-one",[e.chainIds.ethMainnet]:"ethereum",[e.chainIds.avalanche]:"avalanche",[e.chainIds.bnbMainnet]:"binance-smart-chain",[e.chainIds.optimism]:"optimistic-ethereum",[e.chainIds.base]:"base"};exports.COINGECKO_API_KEY=o;exports.CoinGeckoChainLabels=p;exports.coingeckoPriceUrl=r;exports.coingeckoPriceUrl2=h;exports.coingeckoTokenListUrl=l;exports.getCoingeckoIdForNativeTokens=d;exports.getCoingeckoPlatform=I;exports.proCoingeckoUrl=c;exports.proHeader=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chains.constants.cjs"),t="https://api.coingecko.com/api/v3",c="https://pro-api.coingecko.com/api/v3",i=typeof window<"u"?"":process.env.COINGECKO_API_KEY,s="x-cg-pro-api-key",a=i?c:t,r=n=>`${a}/simple/price?ids=${n}&vs_currencies=USD,ETH`,h=(n,o)=>`${a}/simple/token_price/${o}?contract_addresses=${n}&vs_currencies=USD`,d=`${c}/coins/list`,l={[e.chainIds.arbMainnet]:"ethereum",[e.chainIds.localhost]:"ethereum",[e.chainIds.ethMainnet]:"ethereum",[e.chainIds.optimism]:"ethereum",[e.chainIds.avalanche]:"avalanche-2",[e.chainIds.polygon]:"matic-network",[e.chainIds.bnbMainnet]:"binancecoin",[e.chainIds.base]:"ethereum"},I=n=>{switch(e.getNonLocalhostChainId(n)){case e.chainIds.ethMainnet:return"ethereum";case e.chainIds.polygon:return"polygon-pos";case e.chainIds.bnbMainnet:return"binance-smart-chain";case e.chainIds.optimism:return"optimistic-ethereum";case e.chainIds.arbMainnet:return"arbitrum-one";case e.chainIds.avalanche:return"avalanche";case e.chainIds.base:return"base";default:return"ethereum"}},p={[e.chainIds.polygon]:"polygon-pos",[e.chainIds.arbMainnet]:"arbitrum-one",[e.chainIds.ethMainnet]:"ethereum",[e.chainIds.avalanche]:"avalanche",[e.chainIds.bnbMainnet]:"binance-smart-chain",[e.chainIds.optimism]:"optimistic-ethereum",[e.chainIds.base]:"base"};exports.COINGECKO_API_KEY=i;exports.CoinGeckoChainLabels=p;exports.coingeckoPriceUrl=r;exports.coingeckoPriceUrl2=h;exports.coingeckoTokenListUrl=d;exports.getCoingeckoIdForNativeTokens=l;exports.getCoingeckoPlatform=I;exports.proCoingeckoUrl=c;exports.proHeader=s;
@@ -1,5 +1,5 @@
1
1
  import { chainIds as e, getNonLocalhostChainId as c } from "./chains.constants.mjs";
2
- const i = "https://api.coingecko.com/api/v3", t = "https://pro-api.coingecko.com/api/v3", r = process.env.COINGECKO_API_KEY, h = "x-cg-pro-api-key", a = r ? t : i, m = (n) => `${a}/simple/price?ids=${n}&vs_currencies=USD,ETH`, p = (n, o) => `${a}/simple/token_price/${o}?contract_addresses=${n}&vs_currencies=USD`, l = `${t}/coins/list`, u = {
2
+ const i = "https://api.coingecko.com/api/v3", t = "https://pro-api.coingecko.com/api/v3", r = typeof window < "u" ? "" : process.env.COINGECKO_API_KEY, h = "x-cg-pro-api-key", a = r ? t : i, p = (n) => `${a}/simple/price?ids=${n}&vs_currencies=USD,ETH`, m = (n, o) => `${a}/simple/token_price/${o}?contract_addresses=${n}&vs_currencies=USD`, l = `${t}/coins/list`, u = {
3
3
  [e.arbMainnet]: "ethereum",
4
4
  [e.localhost]: "ethereum",
5
5
  [e.ethMainnet]: "ethereum",
@@ -39,8 +39,8 @@ const i = "https://api.coingecko.com/api/v3", t = "https://pro-api.coingecko.com
39
39
  export {
40
40
  r as COINGECKO_API_KEY,
41
41
  g as CoinGeckoChainLabels,
42
- m as coingeckoPriceUrl,
43
- p as coingeckoPriceUrl2,
42
+ p as coingeckoPriceUrl,
43
+ m as coingeckoPriceUrl2,
44
44
  l as coingeckoTokenListUrl,
45
45
  u as getCoingeckoIdForNativeTokens,
46
46
  b as getCoingeckoPlatform,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./babyJub.cjs"),r=require("./poseidon.cjs"),i=require("libsodium-wrappers"),s=require("process"),n=require("buffer");let e=!1;const t=async()=>{e||(typeof window<"u"&&(console.log("jere"),window.global=window,globalThis.Buffer=n.Buffer,globalThis.process=s),await Promise.all([i.ready,r.poseidonHolder.init(),o.jubHolder.init()]),e=!0)};exports.preProcessing=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./babyJub.cjs"),o=require("./poseidon.cjs"),i=require("libsodium-wrappers"),s=require("process"),n=require("buffer");let e=!1;const t=async()=>{e||(typeof window<"u"&&(window.global=window,globalThis.Buffer=n.Buffer,globalThis.process=s),await Promise.all([i.ready,o.poseidonHolder.init(),r.jubHolder.init()]),e=!0)};exports.preProcessing=t;
@@ -1,11 +1,11 @@
1
1
  import { jubHolder as r } from "./babyJub.mjs";
2
- import { poseidonHolder as e } from "./poseidon.mjs";
3
- import i from "libsodium-wrappers";
2
+ import { poseidonHolder as i } from "./poseidon.mjs";
3
+ import e from "libsodium-wrappers";
4
4
  import s from "process";
5
5
  import { Buffer as f } from "buffer";
6
6
  let o = !1;
7
7
  const p = async () => {
8
- o || (typeof window < "u" && (console.log("jere"), window.global = window, globalThis.Buffer = f, globalThis.process = s), await Promise.all([i.ready, e.init(), r.init()]), o = !0);
8
+ o || (typeof window < "u" && (window.global = window, globalThis.Buffer = f, globalThis.process = s), await Promise.all([e.ready, i.init(), r.init()]), o = !0);
9
9
  };
10
10
  export {
11
11
  p as preProcessing
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hinkal/common",
3
- "version": "0.1.27",
3
+ "version": "0.1.28",
4
4
  "homepage": "hinkal.pro",
5
5
  "author": {
6
6
  "name": "Hinkal Protocol"
@@ -1 +1 @@
1
- "use strict";const e=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/../../assets/utxoWorkerLauncher-CSVnxNdb.js").href:new URL("../../assets/utxoWorkerLauncher-CSVnxNdb.js",document.currentScript&&document.currentScript.src||document.baseURI).href);module.exports=e;
1
+ "use strict";const e=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/../../assets/utxoWorkerLauncher-BhGbepNe.js").href:new URL("../../assets/utxoWorkerLauncher-BhGbepNe.js",document.currentScript&&document.currentScript.src||document.baseURI).href);module.exports=e;
@@ -1,4 +1,4 @@
1
- const e = "" + new URL("../../assets/utxoWorkerLauncher-CSVnxNdb.js", import.meta.url).href;
1
+ const e = "" + new URL("../../assets/utxoWorkerLauncher-BhGbepNe.js", import.meta.url).href;
2
2
  export {
3
3
  e as default
4
4
  };
@@ -1 +1 @@
1
- "use strict";const e=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/../../assets/zkProofWorkerLauncher-B6UuEvvB.js").href:new URL("../../assets/zkProofWorkerLauncher-B6UuEvvB.js",document.currentScript&&document.currentScript.src||document.baseURI).href);module.exports=e;
1
+ "use strict";const e=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/../../assets/zkProofWorkerLauncher-BEzJJjOf.js").href:new URL("../../assets/zkProofWorkerLauncher-BEzJJjOf.js",document.currentScript&&document.currentScript.src||document.baseURI).href);module.exports=e;
@@ -1,4 +1,4 @@
1
- const r = "" + new URL("../../assets/zkProofWorkerLauncher-B6UuEvvB.js", import.meta.url).href;
1
+ const r = "" + new URL("../../assets/zkProofWorkerLauncher-BEzJJjOf.js", import.meta.url).href;
2
2
  export {
3
3
  r as default
4
4
  };