@lucid-evolution/wallet 0.1.31 → 0.1.33

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
@@ -47,7 +47,7 @@ var import_core_utils = require("@lucid-evolution/core-utils");
47
47
  var CML = __toESM(require("@anastasia-labs/cardano-multiplatform-lib-nodejs"), 1);
48
48
 
49
49
  // src/wallet.ts
50
- var import_bip39 = require("@lucid-evolution/bip39");
50
+ var import_bip39 = require("bip39");
51
51
  function walletFromSeed(seed, options = { addressType: "Base", accountIndex: 0, network: "Mainnet" }) {
52
52
  function harden(num) {
53
53
  if (typeof num !== "number") throw new Error("Type number required here!");
@@ -399,8 +399,15 @@ var makeWalletFromAddress = (provider, network, address, utxos) => {
399
399
  overrideUTxOs: (utxos2) => config.overriddenUTxOs = utxos2,
400
400
  address: async () => address,
401
401
  rewardAddress: async () => rewardAddress,
402
- getUtxos: async () => config.overriddenUTxOs,
403
- getUtxosCore: async () => config.overriddenUTxOs.map(import_utils2.utxoToCore),
402
+ getUtxos: async () => config.overriddenUTxOs.length > 0 ? config.overriddenUTxOs : provider.getUtxos((0, import_utils2.paymentCredentialOf)(address)),
403
+ getUtxosCore: async () => {
404
+ const utxos2 = config.overriddenUTxOs.length > 0 ? config.overriddenUTxOs : await provider.getUtxos((0, import_utils2.paymentCredentialOf)(address));
405
+ const coreUtxos = [];
406
+ for (const utxo of utxos2) {
407
+ coreUtxos.push((0, import_utils2.utxoToCore)(utxo));
408
+ }
409
+ return coreUtxos;
410
+ },
404
411
  getDelegation: async () => rewardAddress ? provider.getDelegation(rewardAddress) : { poolId: null, rewards: 0n },
405
412
  signTx: async (_tx) => {
406
413
  throw new Error("Not implemented");
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import { fromHex } from "@lucid-evolution/core-utils";
6
6
  import * as CML from "@anastasia-labs/cardano-multiplatform-lib-nodejs";
7
7
 
8
8
  // src/wallet.ts
9
- import { mnemonicToEntropy } from "@lucid-evolution/bip39";
9
+ import { mnemonicToEntropy } from "bip39";
10
10
  function walletFromSeed(seed, options = { addressType: "Base", accountIndex: 0, network: "Mainnet" }) {
11
11
  function harden(num) {
12
12
  if (typeof num !== "number") throw new Error("Type number required here!");
@@ -364,8 +364,15 @@ var makeWalletFromAddress = (provider, network, address, utxos) => {
364
364
  overrideUTxOs: (utxos2) => config.overriddenUTxOs = utxos2,
365
365
  address: async () => address,
366
366
  rewardAddress: async () => rewardAddress,
367
- getUtxos: async () => config.overriddenUTxOs,
368
- getUtxosCore: async () => config.overriddenUTxOs.map(utxoToCore),
367
+ getUtxos: async () => config.overriddenUTxOs.length > 0 ? config.overriddenUTxOs : provider.getUtxos(paymentCredentialOf(address)),
368
+ getUtxosCore: async () => {
369
+ const utxos2 = config.overriddenUTxOs.length > 0 ? config.overriddenUTxOs : await provider.getUtxos(paymentCredentialOf(address));
370
+ const coreUtxos = [];
371
+ for (const utxo of utxos2) {
372
+ coreUtxos.push(utxoToCore(utxo));
373
+ }
374
+ return coreUtxos;
375
+ },
369
376
  getDelegation: async () => rewardAddress ? provider.getDelegation(rewardAddress) : { poolId: null, rewards: 0n },
370
377
  signTx: async (_tx) => {
371
378
  throw new Error("Not implemented");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lucid-evolution/wallet",
3
- "version": "0.1.31",
3
+ "version": "0.1.33",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -26,11 +26,11 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "@anastasia-labs/cardano-multiplatform-lib-nodejs": "^5.3.1-3",
29
- "@lucid-evolution/bip39": "0.2.11",
30
- "@lucid-evolution/core-utils": "0.1.9",
29
+ "bip39": "^3.1.0",
31
30
  "@lucid-evolution/core-types": "0.1.12",
32
- "@lucid-evolution/sign_data": "0.1.12",
33
- "@lucid-evolution/utils": "0.1.28"
31
+ "@lucid-evolution/core-utils": "0.1.10",
32
+ "@lucid-evolution/sign_data": "0.1.13",
33
+ "@lucid-evolution/utils": "0.1.29"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/node": "^20.12.8",