@meshsdk/wallet 1.7.8 → 1.7.9

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/index.cjs CHANGED
@@ -216,6 +216,8 @@ function genBech32(encoding) {
216
216
  function encode(prefix, words, limit = 90) {
217
217
  if (typeof prefix !== "string")
218
218
  throw new Error(`bech32.encode prefix should be string, not ${typeof prefix}`);
219
+ if (words instanceof Uint8Array)
220
+ words = Array.from(words);
219
221
  if (!Array.isArray(words) || words.length && typeof words[0] !== "number")
220
222
  throw new Error(`bech32.encode words should be array of numbers, not ${typeof words}`);
221
223
  if (prefix.length === 0)
@@ -253,7 +255,19 @@ function genBech32(encoding) {
253
255
  const { prefix, words } = decode(str, false);
254
256
  return { prefix, words, bytes: fromWords(words) };
255
257
  }
256
- return { encode, decode, decodeToBytes, decodeUnsafe, fromWords, fromWordsUnsafe, toWords };
258
+ function encodeFromBytes(prefix, bytes) {
259
+ return encode(prefix, toWords(bytes));
260
+ }
261
+ return {
262
+ encode,
263
+ decode,
264
+ encodeFromBytes,
265
+ decodeToBytes,
266
+ decodeUnsafe,
267
+ fromWords,
268
+ fromWordsUnsafe,
269
+ toWords
270
+ };
257
271
  }
258
272
  var bech32 = /* @__PURE__ */ genBech32("bech32");
259
273
 
package/dist/index.js CHANGED
@@ -180,6 +180,8 @@ function genBech32(encoding) {
180
180
  function encode(prefix, words, limit = 90) {
181
181
  if (typeof prefix !== "string")
182
182
  throw new Error(`bech32.encode prefix should be string, not ${typeof prefix}`);
183
+ if (words instanceof Uint8Array)
184
+ words = Array.from(words);
183
185
  if (!Array.isArray(words) || words.length && typeof words[0] !== "number")
184
186
  throw new Error(`bech32.encode words should be array of numbers, not ${typeof words}`);
185
187
  if (prefix.length === 0)
@@ -217,7 +219,19 @@ function genBech32(encoding) {
217
219
  const { prefix, words } = decode(str, false);
218
220
  return { prefix, words, bytes: fromWords(words) };
219
221
  }
220
- return { encode, decode, decodeToBytes, decodeUnsafe, fromWords, fromWordsUnsafe, toWords };
222
+ function encodeFromBytes(prefix, bytes) {
223
+ return encode(prefix, toWords(bytes));
224
+ }
225
+ return {
226
+ encode,
227
+ decode,
228
+ encodeFromBytes,
229
+ decodeToBytes,
230
+ decodeUnsafe,
231
+ fromWords,
232
+ fromWordsUnsafe,
233
+ toWords
234
+ };
221
235
  }
222
236
  var bech32 = /* @__PURE__ */ genBech32("bech32");
223
237
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meshsdk/wallet",
3
- "version": "1.7.8",
3
+ "version": "1.7.9",
4
4
  "description": "",
5
5
  "main": "./dist/index.cjs",
6
6
  "browser": "./dist/index.js",
@@ -35,10 +35,10 @@
35
35
  "typescript": "^5.3.3"
36
36
  },
37
37
  "dependencies": {
38
- "@meshsdk/common": "1.7.8",
39
- "@meshsdk/core-csl": "1.7.8",
40
- "@meshsdk/core-cst": "1.7.8",
41
- "@meshsdk/transaction": "1.7.8",
38
+ "@meshsdk/common": "1.7.9",
39
+ "@meshsdk/core-csl": "1.7.9",
40
+ "@meshsdk/core-cst": "1.7.9",
41
+ "@meshsdk/transaction": "1.7.9",
42
42
  "@nufi/dapp-client-cardano": "^0.3.1",
43
43
  "@nufi/dapp-client-core": "^0.3.1"
44
44
  },