@meshsdk/wallet 1.7.9 → 1.7.10
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 +5 -5
- package/dist/index.d.cts +11 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +7 -7
- package/package.json +9 -9
package/dist/index.cjs
CHANGED
|
@@ -654,14 +654,11 @@ var BrowserWallet = class _BrowserWallet {
|
|
|
654
654
|
* @returns a list of wallet names
|
|
655
655
|
*/
|
|
656
656
|
static async getAvailableWallets({
|
|
657
|
-
metamask =
|
|
658
|
-
network: "preprod"
|
|
659
|
-
}
|
|
657
|
+
metamask = void 0
|
|
660
658
|
} = {}) {
|
|
661
659
|
if (window === void 0) return [];
|
|
662
660
|
if (metamask) await checkIfMetamaskInstalled(metamask.network);
|
|
663
|
-
|
|
664
|
-
return wallets;
|
|
661
|
+
return _BrowserWallet.getInstalledWallets();
|
|
665
662
|
}
|
|
666
663
|
/**
|
|
667
664
|
* Returns a list of wallets installed on user's device. Each wallet is an object with the following properties:
|
|
@@ -821,6 +818,9 @@ var BrowserWallet = class _BrowserWallet {
|
|
|
821
818
|
if (address === void 0) {
|
|
822
819
|
address = (await this.getUsedAddresses())[0];
|
|
823
820
|
}
|
|
821
|
+
if (address.startsWith("drep1")) {
|
|
822
|
+
return this._walletInstance.cip95.signData(address, (0, import_common2.fromUTF8)(payload));
|
|
823
|
+
}
|
|
824
824
|
const signerAddress = (0, import_core_cst3.toAddress)(address).toBytes().toString();
|
|
825
825
|
return this._walletInstance.signData(signerAddress, (0, import_common2.fromUTF8)(payload));
|
|
826
826
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -44,6 +44,7 @@ interface Cip95WalletApi {
|
|
|
44
44
|
getRegisteredPubStakeKeys: () => Promise<Ed25519PublicKeyHex[]>;
|
|
45
45
|
getUnregisteredPubStakeKeys: () => Promise<Ed25519PublicKeyHex[]>;
|
|
46
46
|
getPubDRepKey: () => Promise<Ed25519PublicKeyHex>;
|
|
47
|
+
signData(address: string, payload: string): Promise<DataSignature>;
|
|
47
48
|
}
|
|
48
49
|
type WalletInstance = Cip30WalletApi & Cip95WalletApi;
|
|
49
50
|
type ExperimentalFeatures = {
|
|
@@ -102,6 +103,16 @@ declare global {
|
|
|
102
103
|
cardano: Cardano;
|
|
103
104
|
}
|
|
104
105
|
}
|
|
106
|
+
/**
|
|
107
|
+
* Browser Wallet provides a set of APIs to interact with the blockchain. This wallet is compatible with Mesh transaction builders.
|
|
108
|
+
*
|
|
109
|
+
* These wallets APIs are in accordance to CIP-30, which defines the API for dApps to communicate with the user's wallet. Additional utility functions provided for developers that are useful for building dApps.
|
|
110
|
+
* ```javascript
|
|
111
|
+
* import { BrowserWallet } from '@meshsdk/core';
|
|
112
|
+
*
|
|
113
|
+
* const wallet = await BrowserWallet.enable('eternl');
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
105
116
|
declare class BrowserWallet implements IInitiator, ISigner, ISubmitter {
|
|
106
117
|
readonly _walletInstance: WalletInstance;
|
|
107
118
|
readonly _walletName: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -44,6 +44,7 @@ interface Cip95WalletApi {
|
|
|
44
44
|
getRegisteredPubStakeKeys: () => Promise<Ed25519PublicKeyHex[]>;
|
|
45
45
|
getUnregisteredPubStakeKeys: () => Promise<Ed25519PublicKeyHex[]>;
|
|
46
46
|
getPubDRepKey: () => Promise<Ed25519PublicKeyHex>;
|
|
47
|
+
signData(address: string, payload: string): Promise<DataSignature>;
|
|
47
48
|
}
|
|
48
49
|
type WalletInstance = Cip30WalletApi & Cip95WalletApi;
|
|
49
50
|
type ExperimentalFeatures = {
|
|
@@ -102,6 +103,16 @@ declare global {
|
|
|
102
103
|
cardano: Cardano;
|
|
103
104
|
}
|
|
104
105
|
}
|
|
106
|
+
/**
|
|
107
|
+
* Browser Wallet provides a set of APIs to interact with the blockchain. This wallet is compatible with Mesh transaction builders.
|
|
108
|
+
*
|
|
109
|
+
* These wallets APIs are in accordance to CIP-30, which defines the API for dApps to communicate with the user's wallet. Additional utility functions provided for developers that are useful for building dApps.
|
|
110
|
+
* ```javascript
|
|
111
|
+
* import { BrowserWallet } from '@meshsdk/core';
|
|
112
|
+
*
|
|
113
|
+
* const wallet = await BrowserWallet.enable('eternl');
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
105
116
|
declare class BrowserWallet implements IInitiator, ISigner, ISubmitter {
|
|
106
117
|
readonly _walletInstance: WalletInstance;
|
|
107
118
|
readonly _walletName: string;
|
package/dist/index.js
CHANGED
|
@@ -610,7 +610,7 @@ import {
|
|
|
610
610
|
|
|
611
611
|
// src/browser/metamask.ts
|
|
612
612
|
import { initNufiDappCardanoSdk } from "@nufi/dapp-client-cardano";
|
|
613
|
-
import
|
|
613
|
+
import publicNufiCoreSdk from "@nufi/dapp-client-core";
|
|
614
614
|
|
|
615
615
|
// src/types/nufisnap.ts
|
|
616
616
|
var nufiSnap = {
|
|
@@ -629,7 +629,7 @@ var nufiDomain = {
|
|
|
629
629
|
};
|
|
630
630
|
async function checkIfMetamaskInstalled(network = "preprod") {
|
|
631
631
|
try {
|
|
632
|
-
const _nufiCoreSdk =
|
|
632
|
+
const _nufiCoreSdk = publicNufiCoreSdk.default;
|
|
633
633
|
if (Object.keys(nufiDomain).includes(network)) {
|
|
634
634
|
_nufiCoreSdk.init(nufiDomain[network]);
|
|
635
635
|
} else {
|
|
@@ -663,14 +663,11 @@ var BrowserWallet = class _BrowserWallet {
|
|
|
663
663
|
* @returns a list of wallet names
|
|
664
664
|
*/
|
|
665
665
|
static async getAvailableWallets({
|
|
666
|
-
metamask =
|
|
667
|
-
network: "preprod"
|
|
668
|
-
}
|
|
666
|
+
metamask = void 0
|
|
669
667
|
} = {}) {
|
|
670
668
|
if (window === void 0) return [];
|
|
671
669
|
if (metamask) await checkIfMetamaskInstalled(metamask.network);
|
|
672
|
-
|
|
673
|
-
return wallets;
|
|
670
|
+
return _BrowserWallet.getInstalledWallets();
|
|
674
671
|
}
|
|
675
672
|
/**
|
|
676
673
|
* Returns a list of wallets installed on user's device. Each wallet is an object with the following properties:
|
|
@@ -830,6 +827,9 @@ var BrowserWallet = class _BrowserWallet {
|
|
|
830
827
|
if (address === void 0) {
|
|
831
828
|
address = (await this.getUsedAddresses())[0];
|
|
832
829
|
}
|
|
830
|
+
if (address.startsWith("drep1")) {
|
|
831
|
+
return this._walletInstance.cip95.signData(address, fromUTF8(payload));
|
|
832
|
+
}
|
|
833
833
|
const signerAddress = toAddress2(address).toBytes().toString();
|
|
834
834
|
return this._walletInstance.signData(signerAddress, fromUTF8(payload));
|
|
835
835
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meshsdk/wallet",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.10",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"browser": "./dist/index.js",
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
"type": "module",
|
|
10
10
|
"exports": {
|
|
11
11
|
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
12
13
|
"import": "./dist/index.js",
|
|
13
|
-
"require": "./dist/index.cjs"
|
|
14
|
-
"types": "./dist/index.d.ts"
|
|
14
|
+
"require": "./dist/index.cjs"
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"files": [
|
|
@@ -35,12 +35,12 @@
|
|
|
35
35
|
"typescript": "^5.3.3"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@meshsdk/common": "1.7.
|
|
39
|
-
"@meshsdk/core-csl": "1.7.
|
|
40
|
-
"@meshsdk/core-cst": "1.7.
|
|
41
|
-
"@meshsdk/transaction": "1.7.
|
|
42
|
-
"@nufi/dapp-client-cardano": "
|
|
43
|
-
"@nufi/dapp-client-core": "
|
|
38
|
+
"@meshsdk/common": "1.7.10",
|
|
39
|
+
"@meshsdk/core-csl": "1.7.10",
|
|
40
|
+
"@meshsdk/core-cst": "1.7.10",
|
|
41
|
+
"@meshsdk/transaction": "1.7.10",
|
|
42
|
+
"@nufi/dapp-client-cardano": "0.3.5",
|
|
43
|
+
"@nufi/dapp-client-core": "0.3.5"
|
|
44
44
|
},
|
|
45
45
|
"prettier": "@meshsdk/configs/prettier",
|
|
46
46
|
"publishConfig": {
|