@meshsdk/wallet 1.9.0-beta.90 → 1.9.0-beta.91
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 +12 -22
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +12 -23
- package/package.json +7 -4
package/dist/index.cjs
CHANGED
|
@@ -572,12 +572,12 @@ var WalletStaticMethods = class {
|
|
|
572
572
|
static privateKeyBech32ToPrivateKeyHex(_bech32) {
|
|
573
573
|
const bech32DecodedBytes = bech32.decodeToBytes(_bech32).bytes;
|
|
574
574
|
const bip32PrivateKey = import_core_cst.Bip32PrivateKey.fromBytes(bech32DecodedBytes);
|
|
575
|
-
return
|
|
575
|
+
return bip32PrivateKey.hex();
|
|
576
576
|
}
|
|
577
577
|
static mnemonicToPrivateKeyHex(words) {
|
|
578
578
|
const entropy = (0, import_common.mnemonicToEntropy)(words.join(" "));
|
|
579
579
|
const bip32PrivateKey = (0, import_core_cst.buildBip32PrivateKey)(entropy);
|
|
580
|
-
return
|
|
580
|
+
return bip32PrivateKey.hex();
|
|
581
581
|
}
|
|
582
582
|
static signingKeyToHexes(paymentKey, stakeKey) {
|
|
583
583
|
return [
|
|
@@ -587,29 +587,21 @@ var WalletStaticMethods = class {
|
|
|
587
587
|
}
|
|
588
588
|
static bip32BytesToPrivateKeyHex(bip32Bytes) {
|
|
589
589
|
const bip32PrivateKey = import_core_cst.Bip32PrivateKey.fromBytes(bip32Bytes);
|
|
590
|
-
return
|
|
590
|
+
return bip32PrivateKey.hex();
|
|
591
591
|
}
|
|
592
592
|
static getAddresses(paymentKey, stakingKey, networkId = 0) {
|
|
593
593
|
const baseAddress = (0, import_core_cst.buildBaseAddress)(
|
|
594
594
|
networkId,
|
|
595
|
-
import_core_cst.Hash28ByteBase16.
|
|
596
|
-
|
|
597
|
-
),
|
|
598
|
-
import_core_cst.Hash28ByteBase16.fromEd25519KeyHashHex(
|
|
599
|
-
stakingKey.toPublic().hash().hex()
|
|
600
|
-
)
|
|
595
|
+
(0, import_core_cst.Hash28ByteBase16)(paymentKey.toPublic().hash().hex()),
|
|
596
|
+
(0, import_core_cst.Hash28ByteBase16)(stakingKey.toPublic().hash().hex())
|
|
601
597
|
).toAddress();
|
|
602
598
|
const enterpriseAddress = (0, import_core_cst.buildEnterpriseAddress)(
|
|
603
599
|
networkId,
|
|
604
|
-
import_core_cst.Hash28ByteBase16.
|
|
605
|
-
paymentKey.toPublic().hash().hex()
|
|
606
|
-
)
|
|
600
|
+
(0, import_core_cst.Hash28ByteBase16)(paymentKey.toPublic().hash().hex())
|
|
607
601
|
).toAddress();
|
|
608
602
|
const rewardAddress = (0, import_core_cst.buildRewardAddress)(
|
|
609
603
|
networkId,
|
|
610
|
-
import_core_cst.Hash28ByteBase16.
|
|
611
|
-
stakingKey.toPublic().hash().hex()
|
|
612
|
-
)
|
|
604
|
+
(0, import_core_cst.Hash28ByteBase16)(stakingKey.toPublic().hash().hex())
|
|
613
605
|
).toAddress();
|
|
614
606
|
return {
|
|
615
607
|
baseAddress,
|
|
@@ -618,7 +610,7 @@ var WalletStaticMethods = class {
|
|
|
618
610
|
};
|
|
619
611
|
}
|
|
620
612
|
static getDRepKey(dRepKey, networkId = 0) {
|
|
621
|
-
const pubDRepKey = dRepKey.toPublic().hex()
|
|
613
|
+
const pubDRepKey = dRepKey.toPublic().hex();
|
|
622
614
|
const dRepIDBech32 = (0, import_core_cst.buildDRepID)(
|
|
623
615
|
(0, import_core_cst.Ed25519PublicKeyHex)(pubDRepKey),
|
|
624
616
|
networkId
|
|
@@ -2172,24 +2164,22 @@ var MeshWallet = class {
|
|
|
2172
2164
|
if (pubKeyHash && stakeKeyHash) {
|
|
2173
2165
|
this.addresses.baseAddress = (0, import_core_cst5.buildBaseAddress)(
|
|
2174
2166
|
this._networkId,
|
|
2175
|
-
|
|
2176
|
-
import_core_cst5.Hash28ByteBase16
|
|
2177
|
-
(0, import_core_cst5.Ed25519KeyHashHex)((0, import_core_cst5.Ed25519KeyHashHex)(stakeKeyHash))
|
|
2178
|
-
)
|
|
2167
|
+
(0, import_core_cst5.Hash28ByteBase16)(pubKeyHash),
|
|
2168
|
+
(0, import_core_cst5.Hash28ByteBase16)(stakeKeyHash)
|
|
2179
2169
|
).toAddress();
|
|
2180
2170
|
this.addresses.baseAddressBech32 = this.addresses.baseAddress.toBech32();
|
|
2181
2171
|
}
|
|
2182
2172
|
if (pubKeyHash) {
|
|
2183
2173
|
this.addresses.enterpriseAddress = (0, import_core_cst5.buildEnterpriseAddress)(
|
|
2184
2174
|
this._networkId,
|
|
2185
|
-
import_core_cst5.Hash28ByteBase16
|
|
2175
|
+
(0, import_core_cst5.Hash28ByteBase16)((0, import_core_cst5.Ed25519KeyHashHex)(pubKeyHash))
|
|
2186
2176
|
).toAddress();
|
|
2187
2177
|
this.addresses.enterpriseAddressBech32 = this.addresses.enterpriseAddress.toBech32();
|
|
2188
2178
|
}
|
|
2189
2179
|
if (stakeKeyHash) {
|
|
2190
2180
|
this.addresses.rewardAddress = (0, import_core_cst5.buildRewardAddress)(
|
|
2191
2181
|
this._networkId,
|
|
2192
|
-
|
|
2182
|
+
(0, import_core_cst5.Hash28ByteBase16)(stakeKeyHash)
|
|
2193
2183
|
).toAddress();
|
|
2194
2184
|
this.addresses.rewardAddressBech32 = this.addresses.rewardAddress.toBech32();
|
|
2195
2185
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -324,7 +324,7 @@ declare class BrowserWallet implements IWallet {
|
|
|
324
324
|
} | undefined>;
|
|
325
325
|
private static dRepKeyToDRepID;
|
|
326
326
|
private static resolveInstance;
|
|
327
|
-
static addBrowserWitnesses(unsignedTx: string, witnesses: string):
|
|
327
|
+
static addBrowserWitnesses(unsignedTx: string, witnesses: string): any;
|
|
328
328
|
static getSupportedExtensions(wallet: string): {
|
|
329
329
|
cip: number;
|
|
330
330
|
}[];
|
|
@@ -559,7 +559,7 @@ declare class MeshWallet implements IWallet {
|
|
|
559
559
|
enterpriseAddressBech32?: string;
|
|
560
560
|
rewardAddressBech32?: string;
|
|
561
561
|
pubDRepKey?: string;
|
|
562
|
-
dRepIDBech32?:
|
|
562
|
+
dRepIDBech32?: any;
|
|
563
563
|
dRepIDHash?: Ed25519KeyHashHex;
|
|
564
564
|
dRepIDCip105?: string;
|
|
565
565
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -324,7 +324,7 @@ declare class BrowserWallet implements IWallet {
|
|
|
324
324
|
} | undefined>;
|
|
325
325
|
private static dRepKeyToDRepID;
|
|
326
326
|
private static resolveInstance;
|
|
327
|
-
static addBrowserWitnesses(unsignedTx: string, witnesses: string):
|
|
327
|
+
static addBrowserWitnesses(unsignedTx: string, witnesses: string): any;
|
|
328
328
|
static getSupportedExtensions(wallet: string): {
|
|
329
329
|
cip: number;
|
|
330
330
|
}[];
|
|
@@ -559,7 +559,7 @@ declare class MeshWallet implements IWallet {
|
|
|
559
559
|
enterpriseAddressBech32?: string;
|
|
560
560
|
rewardAddressBech32?: string;
|
|
561
561
|
pubDRepKey?: string;
|
|
562
|
-
dRepIDBech32?:
|
|
562
|
+
dRepIDBech32?: any;
|
|
563
563
|
dRepIDHash?: Ed25519KeyHashHex;
|
|
564
564
|
dRepIDCip105?: string;
|
|
565
565
|
};
|
package/dist/index.js
CHANGED
|
@@ -554,7 +554,6 @@ var bech32 = /* @__PURE__ */ genBech32("bech32");
|
|
|
554
554
|
|
|
555
555
|
// src/embedded/index.ts
|
|
556
556
|
import {
|
|
557
|
-
bytesToHex,
|
|
558
557
|
generateMnemonic,
|
|
559
558
|
mnemonicToEntropy
|
|
560
559
|
} from "@meshsdk/common";
|
|
@@ -585,12 +584,12 @@ var WalletStaticMethods = class {
|
|
|
585
584
|
static privateKeyBech32ToPrivateKeyHex(_bech32) {
|
|
586
585
|
const bech32DecodedBytes = bech32.decodeToBytes(_bech32).bytes;
|
|
587
586
|
const bip32PrivateKey = Bip32PrivateKey.fromBytes(bech32DecodedBytes);
|
|
588
|
-
return
|
|
587
|
+
return bip32PrivateKey.hex();
|
|
589
588
|
}
|
|
590
589
|
static mnemonicToPrivateKeyHex(words) {
|
|
591
590
|
const entropy = mnemonicToEntropy(words.join(" "));
|
|
592
591
|
const bip32PrivateKey = buildBip32PrivateKey(entropy);
|
|
593
|
-
return
|
|
592
|
+
return bip32PrivateKey.hex();
|
|
594
593
|
}
|
|
595
594
|
static signingKeyToHexes(paymentKey, stakeKey) {
|
|
596
595
|
return [
|
|
@@ -600,29 +599,21 @@ var WalletStaticMethods = class {
|
|
|
600
599
|
}
|
|
601
600
|
static bip32BytesToPrivateKeyHex(bip32Bytes) {
|
|
602
601
|
const bip32PrivateKey = Bip32PrivateKey.fromBytes(bip32Bytes);
|
|
603
|
-
return
|
|
602
|
+
return bip32PrivateKey.hex();
|
|
604
603
|
}
|
|
605
604
|
static getAddresses(paymentKey, stakingKey, networkId = 0) {
|
|
606
605
|
const baseAddress = buildBaseAddress(
|
|
607
606
|
networkId,
|
|
608
|
-
Hash28ByteBase16.
|
|
609
|
-
|
|
610
|
-
),
|
|
611
|
-
Hash28ByteBase16.fromEd25519KeyHashHex(
|
|
612
|
-
stakingKey.toPublic().hash().hex()
|
|
613
|
-
)
|
|
607
|
+
Hash28ByteBase16(paymentKey.toPublic().hash().hex()),
|
|
608
|
+
Hash28ByteBase16(stakingKey.toPublic().hash().hex())
|
|
614
609
|
).toAddress();
|
|
615
610
|
const enterpriseAddress = buildEnterpriseAddress(
|
|
616
611
|
networkId,
|
|
617
|
-
Hash28ByteBase16.
|
|
618
|
-
paymentKey.toPublic().hash().hex()
|
|
619
|
-
)
|
|
612
|
+
Hash28ByteBase16(paymentKey.toPublic().hash().hex())
|
|
620
613
|
).toAddress();
|
|
621
614
|
const rewardAddress = buildRewardAddress(
|
|
622
615
|
networkId,
|
|
623
|
-
Hash28ByteBase16.
|
|
624
|
-
stakingKey.toPublic().hash().hex()
|
|
625
|
-
)
|
|
616
|
+
Hash28ByteBase16(stakingKey.toPublic().hash().hex())
|
|
626
617
|
).toAddress();
|
|
627
618
|
return {
|
|
628
619
|
baseAddress,
|
|
@@ -631,7 +622,7 @@ var WalletStaticMethods = class {
|
|
|
631
622
|
};
|
|
632
623
|
}
|
|
633
624
|
static getDRepKey(dRepKey, networkId = 0) {
|
|
634
|
-
const pubDRepKey = dRepKey.toPublic().hex()
|
|
625
|
+
const pubDRepKey = dRepKey.toPublic().hex();
|
|
635
626
|
const dRepIDBech32 = buildDRepID(
|
|
636
627
|
Ed25519PublicKeyHex(pubDRepKey),
|
|
637
628
|
networkId
|
|
@@ -2225,24 +2216,22 @@ var MeshWallet = class {
|
|
|
2225
2216
|
if (pubKeyHash && stakeKeyHash) {
|
|
2226
2217
|
this.addresses.baseAddress = buildBaseAddress2(
|
|
2227
2218
|
this._networkId,
|
|
2228
|
-
Hash28ByteBase162
|
|
2229
|
-
Hash28ByteBase162
|
|
2230
|
-
Ed25519KeyHashHex3(Ed25519KeyHashHex3(stakeKeyHash))
|
|
2231
|
-
)
|
|
2219
|
+
Hash28ByteBase162(pubKeyHash),
|
|
2220
|
+
Hash28ByteBase162(stakeKeyHash)
|
|
2232
2221
|
).toAddress();
|
|
2233
2222
|
this.addresses.baseAddressBech32 = this.addresses.baseAddress.toBech32();
|
|
2234
2223
|
}
|
|
2235
2224
|
if (pubKeyHash) {
|
|
2236
2225
|
this.addresses.enterpriseAddress = buildEnterpriseAddress2(
|
|
2237
2226
|
this._networkId,
|
|
2238
|
-
Hash28ByteBase162
|
|
2227
|
+
Hash28ByteBase162(Ed25519KeyHashHex3(pubKeyHash))
|
|
2239
2228
|
).toAddress();
|
|
2240
2229
|
this.addresses.enterpriseAddressBech32 = this.addresses.enterpriseAddress.toBech32();
|
|
2241
2230
|
}
|
|
2242
2231
|
if (stakeKeyHash) {
|
|
2243
2232
|
this.addresses.rewardAddress = buildRewardAddress2(
|
|
2244
2233
|
this._networkId,
|
|
2245
|
-
Hash28ByteBase162
|
|
2234
|
+
Hash28ByteBase162(stakeKeyHash)
|
|
2246
2235
|
).toAddress();
|
|
2247
2236
|
this.addresses.rewardAddressBech32 = this.addresses.rewardAddress.toBech32();
|
|
2248
2237
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meshsdk/wallet",
|
|
3
|
-
"version": "1.9.0-beta.
|
|
3
|
+
"version": "1.9.0-beta.91",
|
|
4
4
|
"description": "Wallets - https://meshjs.dev/apis/wallets",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"browser": "./dist/index.js",
|
|
@@ -35,11 +35,14 @@
|
|
|
35
35
|
"typescript": "^5.3.3"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@meshsdk/common": "1.9.0-beta.
|
|
39
|
-
"@meshsdk/core-cst": "1.9.0-beta.
|
|
40
|
-
"@meshsdk/transaction": "1.9.0-beta.
|
|
38
|
+
"@meshsdk/common": "1.9.0-beta.91",
|
|
39
|
+
"@meshsdk/core-cst": "1.9.0-beta.91",
|
|
40
|
+
"@meshsdk/transaction": "1.9.0-beta.91",
|
|
41
41
|
"@simplewebauthn/browser": "^13.0.0"
|
|
42
42
|
},
|
|
43
|
+
"overrides": {
|
|
44
|
+
"libsodium-wrappers-sumo": "0.7.15"
|
|
45
|
+
},
|
|
43
46
|
"prettier": "@meshsdk/configs/prettier",
|
|
44
47
|
"publishConfig": {
|
|
45
48
|
"access": "public"
|