@meshsdk/wallet 2.0.0-beta.1 → 2.0.0-beta.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/README.md +170 -71
- package/dist/index.cjs +5686 -21930
- package/dist/index.d.ts +1161 -9
- package/dist/index.js +6214 -21878
- package/package.json +25 -16
- package/dist/index.d.cts +0 -107
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meshsdk/wallet",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.10",
|
|
4
4
|
"description": "Wallets - https://meshjs.dev/apis/wallets",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"browser": "./dist/index.js",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"dist/**"
|
|
19
19
|
],
|
|
20
20
|
"scripts": {
|
|
21
|
-
"build": "tsup
|
|
21
|
+
"build": "tsup",
|
|
22
22
|
"build:docs": "typedoc src/index.ts --json ../../apps/docs/src/data/mesh-wallets.json",
|
|
23
23
|
"clean": "rm -rf .turbo && rm -rf dist && rm -rf node_modules",
|
|
24
24
|
"dev": "tsup src/index.ts --format esm,cjs --watch --dts",
|
|
@@ -28,30 +28,38 @@
|
|
|
28
28
|
"test": "jest"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
+
"@ianvs/prettier-plugin-sort-imports": "^4.4.1",
|
|
32
|
+
"@meshsdk/common": "1.9.0-beta.100",
|
|
33
|
+
"@meshsdk/provider": "1.9.0-beta.99",
|
|
34
|
+
"@types/jest": "^29.5.14",
|
|
35
|
+
"@types/mocha": "^10.0.10",
|
|
36
|
+
"dotenv": "^16.4.5",
|
|
31
37
|
"eslint": "^8.57.0",
|
|
38
|
+
"jest": "^29.7.0",
|
|
39
|
+
"jest-environment-jsdom": "^30.4.1",
|
|
32
40
|
"patch-package": "^8.0.1",
|
|
41
|
+
"prettier": "^3.5.3",
|
|
42
|
+
"ts-jest": "^29.1.4",
|
|
43
|
+
"ts-node": "^10.9.2",
|
|
33
44
|
"tsup": "^8.0.2",
|
|
34
45
|
"typedoc": "^0.26.3",
|
|
35
|
-
"typescript": "^5.3.3"
|
|
36
|
-
"jest": "^29.7.0",
|
|
37
|
-
"@types/jest": "^29.5.12",
|
|
38
|
-
"ts-node": "^10.9.2",
|
|
39
|
-
"ts-jest": "^29.1.4",
|
|
40
|
-
"dotenv": "^16.4.5"
|
|
46
|
+
"typescript": "^5.3.3"
|
|
41
47
|
},
|
|
42
48
|
"dependencies": {
|
|
43
|
-
"@cardano-sdk/core": "0.46.
|
|
49
|
+
"@cardano-sdk/core": "0.46.11",
|
|
44
50
|
"@cardano-sdk/crypto": "0.4.4",
|
|
45
51
|
"@cardano-sdk/util": "0.17.1",
|
|
46
52
|
"@harmoniclabs/cbor": "^1.6.6",
|
|
47
|
-
"@meshsdk/core-cst": "1.9.0-beta.87",
|
|
48
|
-
"@meshsdk/provider": "1.9.0-beta.87",
|
|
49
|
-
"@meshsdk/common": "1.9.0-beta.87",
|
|
50
|
-
"json-bigint": "^1.0.0",
|
|
51
53
|
"@simplewebauthn/browser": "^13.0.0",
|
|
52
54
|
"@types/base32-encoding": "^1.0.2",
|
|
53
55
|
"@types/bn.js": "^5.1.5",
|
|
54
|
-
"base32-encoding": "^1.0.0"
|
|
56
|
+
"base32-encoding": "^1.0.0",
|
|
57
|
+
"bip32": "^5.0.0",
|
|
58
|
+
"bip39": "^3.1.0",
|
|
59
|
+
"bitcoinjs-lib": "^6.1.7",
|
|
60
|
+
"ecpair": "^2.1.0",
|
|
61
|
+
"json-bigint": "^1.0.0",
|
|
62
|
+
"tiny-secp256k1": "^2.2.4"
|
|
55
63
|
},
|
|
56
64
|
"prettier": "./prettier.config.js",
|
|
57
65
|
"publishConfig": {
|
|
@@ -59,10 +67,11 @@
|
|
|
59
67
|
},
|
|
60
68
|
"license": "Apache-2.0",
|
|
61
69
|
"keywords": [
|
|
70
|
+
"bitcoin",
|
|
62
71
|
"cardano",
|
|
63
|
-
"ada",
|
|
64
72
|
"web3",
|
|
65
73
|
"blockchain",
|
|
66
|
-
"sdk"
|
|
74
|
+
"sdk",
|
|
75
|
+
"wallet"
|
|
67
76
|
]
|
|
68
77
|
}
|
package/dist/index.d.cts
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
interface ISigner {
|
|
2
|
-
getPublicKey(): Promise<string>;
|
|
3
|
-
getPublicKeyHash(): Promise<string>;
|
|
4
|
-
sign(data: string): Promise<string>;
|
|
5
|
-
verify(data: string, signature: string): Promise<boolean>;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
type DerivationPath = number[] | string;
|
|
9
|
-
interface ISecretManager {
|
|
10
|
-
getPublicKey(derivationPath: DerivationPath): Promise<string>;
|
|
11
|
-
getSigner(derivationPath: DerivationPath): Promise<ISigner>;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
declare class InMemoryBip32 implements ISecretManager {
|
|
15
|
-
private bip32PrivateKey;
|
|
16
|
-
private constructor();
|
|
17
|
-
static fromMnemonic(mnemonic: string[], password?: string): Promise<InMemoryBip32>;
|
|
18
|
-
static fromEntropy(entropy: string, password?: string): Promise<InMemoryBip32>;
|
|
19
|
-
static fromKeyHex(keyHex: string): InMemoryBip32;
|
|
20
|
-
static fromBech32(bech32: string): InMemoryBip32;
|
|
21
|
-
/**
|
|
22
|
-
* Get the Bip32 public key in hex format.
|
|
23
|
-
* @returns {Promise<string>} A promise that resolves to the public key in hex format.
|
|
24
|
-
*/
|
|
25
|
-
getPublicKey(): Promise<string>;
|
|
26
|
-
/**
|
|
27
|
-
* Get an ISigner instance initialized with the current Bip32 private key.
|
|
28
|
-
* @returns {Promise<ISigner>} A promise that resolves to an ISigner instance initialized with the current Bip32 private key.
|
|
29
|
-
*/
|
|
30
|
-
getSigner(derivationPath: DerivationPath): Promise<ISigner>;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* BaseSigner provides functionalities to sign and verify data using Ed25519 keys.
|
|
35
|
-
* It supports construction from both extended and normal private key hex formats.
|
|
36
|
-
*/
|
|
37
|
-
declare class BaseSigner implements ISigner {
|
|
38
|
-
private ed25519PrivateKey;
|
|
39
|
-
private constructor();
|
|
40
|
-
/**
|
|
41
|
-
* Create a BaseSigner instance from an Ed25519 private key in extended hex format.
|
|
42
|
-
* @param keyHex Ed25519 private key in extended hex format
|
|
43
|
-
* @returns {BaseSigner} A BaseSigner instance
|
|
44
|
-
*/
|
|
45
|
-
static fromExtendedKeyHex(keyHex: string): BaseSigner;
|
|
46
|
-
/**
|
|
47
|
-
* Create a BaseSigner instance from an Ed25519 private key in normal hex format.
|
|
48
|
-
* @param keyHex Ed25519 private key in normal hex format
|
|
49
|
-
* @returns {BaseSigner} A BaseSigner instance
|
|
50
|
-
*/
|
|
51
|
-
static fromNormalKeyHex(keyHex: string): BaseSigner;
|
|
52
|
-
static fromKeyHex(keyHex: string): BaseSigner;
|
|
53
|
-
/**
|
|
54
|
-
* Get the Ed25519 public key in hex format.
|
|
55
|
-
* @returns {Promise<string>} A promise that resolves to the public key in hex format.
|
|
56
|
-
*/
|
|
57
|
-
getPublicKey(): Promise<string>;
|
|
58
|
-
/**
|
|
59
|
-
* Get the Ed25519 public key hash in hex format.
|
|
60
|
-
* @returns {Promise<string>} A promise that resolves to the public key hash in hex format.
|
|
61
|
-
*/
|
|
62
|
-
getPublicKeyHash(): Promise<string>;
|
|
63
|
-
/**
|
|
64
|
-
* Sign data using the Ed25519 private key.
|
|
65
|
-
* @param data data to be signed in hex format
|
|
66
|
-
* @returns {Promise<string>} A promise that resolves to the signature in hex format.
|
|
67
|
-
*/
|
|
68
|
-
sign(data: string): Promise<string>;
|
|
69
|
-
/**
|
|
70
|
-
* Verify a signature using the Ed25519 public key.
|
|
71
|
-
* @param data The original data in hex format.
|
|
72
|
-
* @param signature The signature to verify in hex format.
|
|
73
|
-
* @returns {Promise<boolean>} A promise that resolves to true if the signature is valid, false otherwise.
|
|
74
|
-
*/
|
|
75
|
-
verify(data: string, signature: string): Promise<boolean>;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
declare enum CredentialType {
|
|
79
|
-
KeyHash = 0,
|
|
80
|
-
ScriptHash = 1
|
|
81
|
-
}
|
|
82
|
-
type Credential = {
|
|
83
|
-
type: CredentialType;
|
|
84
|
-
hash: string;
|
|
85
|
-
};
|
|
86
|
-
declare enum AddressType {
|
|
87
|
-
Enterprise = 0,
|
|
88
|
-
Base = 1,
|
|
89
|
-
Reward = 2
|
|
90
|
-
}
|
|
91
|
-
declare class CardanoAddress {
|
|
92
|
-
addressType: AddressType;
|
|
93
|
-
networkId: number;
|
|
94
|
-
paymentCredential: Credential;
|
|
95
|
-
stakeCredential?: Credential;
|
|
96
|
-
constructor(addressType: AddressType, networkId: number, paymentCredential: Credential, stakeCredential?: Credential);
|
|
97
|
-
getAddressBech32(): string;
|
|
98
|
-
getAddressHex(): string;
|
|
99
|
-
private getEnterpriseAddressBech32;
|
|
100
|
-
private getEnterpriseAddressHex;
|
|
101
|
-
private getBaseAddressBech32;
|
|
102
|
-
private getBaseAddressHex;
|
|
103
|
-
private getRewardAddressBech32;
|
|
104
|
-
private getRewardAddressHex;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export { AddressType, BaseSigner, CardanoAddress, type Credential, CredentialType, InMemoryBip32 };
|