@ecency/wallets 1.0.2 → 1.0.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.
@@ -90,13 +90,13 @@ function se(e, t) {
90
90
  }
91
91
  });
92
92
  }
93
- function f() {
93
+ function y() {
94
94
  return l({
95
95
  queryKey: ["ecency-wallets", "seed"],
96
96
  queryFn: async () => D.generateMnemonic(128)
97
97
  });
98
98
  }
99
- const W = {
99
+ const H = {
100
100
  max: 500,
101
101
  // how long to live in ms
102
102
  ttl: 1e3 * 60 * 5,
@@ -104,8 +104,8 @@ const W = {
104
104
  allowStale: !1,
105
105
  updateAgeOnGet: !1,
106
106
  updateAgeOnHas: !1
107
- }, y = new K(W), m = Symbol("undefined"), q = (e, t) => y.set(e, t === void 0 ? m : t), x = (e) => {
108
- const t = y.get(e);
107
+ }, f = new K(H), m = Symbol("undefined"), W = (e, t) => f.set(e, t === void 0 ? m : t), q = (e) => {
108
+ const t = f.get(e);
109
109
  return t === m ? void 0 : t;
110
110
  };
111
111
  function ce(e) {
@@ -126,7 +126,7 @@ function ce(e) {
126
126
  default:
127
127
  t = e;
128
128
  }
129
- let o = x("gecko"), s;
129
+ let o = q("gecko"), s;
130
130
  if (o)
131
131
  s = o;
132
132
  else {
@@ -142,15 +142,15 @@ function ce(e) {
142
142
  })
143
143
  }
144
144
  )).json();
145
- q("gecko", a === void 0 ? m : a), s = a;
145
+ W("gecko", a === void 0 ? m : a), s = a;
146
146
  }
147
147
  return 1 / +s[Object.keys(s)[0]].usd;
148
148
  },
149
149
  enabled: !!e
150
150
  });
151
151
  }
152
- function B(e) {
153
- const { data: t } = f(), o = b(
152
+ function x(e) {
153
+ const { data: t } = y(), o = b(
154
154
  () => N(t ?? "").toString("hex"),
155
155
  [t]
156
156
  );
@@ -174,7 +174,7 @@ function B(e) {
174
174
  }
175
175
  });
176
176
  }
177
- const H = {
177
+ const B = {
178
178
  [n.BTC]: "m/44'/0'/0'/0/0",
179
179
  // Bitcoin (BIP44)
180
180
  [n.ETH]: "m/44'/60'/0'/0/0",
@@ -191,14 +191,14 @@ const H = {
191
191
  // Cosmos (BIP44)
192
192
  };
193
193
  function re(e, t) {
194
- const { data: o } = f(), s = g(), c = d({
194
+ const { data: o } = y(), s = g(), c = d({
195
195
  mutationKey: ["ecency-wallets", "create-wallet", e, t],
196
196
  mutationFn: async () => {
197
197
  if (!o)
198
198
  throw new Error("[Ecency][Wallets] - No seed to create a wallet");
199
199
  const a = _(t), i = await (a == null ? void 0 : a.getDerivedPrivateKey({
200
200
  mnemonic: o,
201
- hdPath: H[t]
201
+ hdPath: B[t]
202
202
  }));
203
203
  await j(1e3);
204
204
  const p = await (a == null ? void 0 : a.getNewAddress({
@@ -225,14 +225,14 @@ function re(e, t) {
225
225
  importWallet: r
226
226
  };
227
227
  }
228
- const M = {};
228
+ const M = { privateApiHost: "https://ecency.com" };
229
229
  function C(e) {
230
230
  const { data: t } = l({
231
231
  queryKey: ["ecency-wallets", "wallets", e]
232
- }), { data: o } = B(e);
232
+ }), { data: o } = x(e);
233
233
  return d({
234
234
  mutationKey: ["ecency-wallets", "create-account-with-wallets", e],
235
- mutationFn: ({ currency: s, address: c }) => fetch(M + "/private-api/wallets-add", {
235
+ mutationFn: ({ currency: s, address: c }) => fetch(M.privateApiHost + "/private-api/wallets-add", {
236
236
  method: "POST",
237
237
  body: JSON.stringify({
238
238
  username: e,
@@ -266,7 +266,7 @@ export {
266
266
  _ as getWallet,
267
267
  ce as useCoinGeckoPriceQuery,
268
268
  se as useGetExternalWalletBalanceQuery,
269
- B as useHiveKeysQuery,
270
- f as useSeedPhrase,
269
+ x as useHiveKeysQuery,
270
+ y as useSeedPhrase,
271
271
  re as useWalletCreate
272
272
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ecency/wallets",
3
3
  "private": false,
4
- "version": "1.0.2",
4
+ "version": "1.0.4",
5
5
  "type": "module",
6
6
  "main": "./dist/ecency-wallets.umd.js",
7
7
  "module": "./dist/ecency-wallets.es.js",
@@ -9,11 +9,6 @@
9
9
  "dist",
10
10
  "README.md"
11
11
  ],
12
- "exports": {
13
- ".": {
14
- "import": "./dist/ecency-renderer.es.js"
15
- }
16
- },
17
12
  "scripts": {
18
13
  "dev": "vite",
19
14
  "build": "tsc && vite build",