@meshsdk/wallet 1.6.0-alpha.21 → 1.6.2
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 +6 -0
- package/dist/{index.d.mts → index.d.cts} +30 -1
- package/dist/index.d.ts +30 -1
- package/dist/index.js +1 -1208
- package/package.json +33 -15
- package/.turbo/turbo-build$colon$docs.log +0 -11
- package/.turbo/turbo-build$colon$mesh.log +0 -19
- package/.turbo/turbo-build.log +0 -19
- package/dist/index.mjs +0 -1234
- package/jest.config.js +0 -5
- package/src/app/index.ts +0 -239
- package/src/browser/index.ts +0 -440
- package/src/embedded/index.ts +0 -258
- package/src/index.ts +0 -4
- package/src/mesh/index.ts +0 -413
- package/src/types/index.ts +0 -39
- package/test/app.test.ts +0 -98
- package/test/browser.test.ts +0 -21
- package/test/embedded.test.ts +0 -137
- package/test/mesh.test.ts +0 -95
- package/tsconfig.json +0 -5
package/test/app.test.ts
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { AppWallet } from "@meshsdk/wallet";
|
|
2
|
-
|
|
3
|
-
describe("AppWallet", () => {
|
|
4
|
-
const wallet = new AppWallet({
|
|
5
|
-
networkId: 0,
|
|
6
|
-
key: {
|
|
7
|
-
type: "mnemonic",
|
|
8
|
-
words: "solution,".repeat(24).split(",").slice(0, 24),
|
|
9
|
-
},
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
it("brew", () => {
|
|
13
|
-
const mnemonic = AppWallet.brew();
|
|
14
|
-
expect(mnemonic.length).toEqual(24);
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
it("private keys", () => {
|
|
18
|
-
const wallet = new AppWallet({
|
|
19
|
-
networkId: 0,
|
|
20
|
-
key: {
|
|
21
|
-
type: "root",
|
|
22
|
-
bech32:
|
|
23
|
-
"xprv1cqa46gk29plgkg98upclnjv5t425fcpl4rgf9mq2txdxuga7jfq5shk7np6l55nj00sl3m4syzna3uwgrwppdm0azgy9d8zahyf32s62klfyhe0ayyxkc7x92nv4s77fa0v25tufk9tnv7x6dgexe9kdz5gpeqgu",
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
const paymentAddress = wallet.getPaymentAddress();
|
|
28
|
-
expect(paymentAddress).toEqual(
|
|
29
|
-
"addr_test1qpvx0sacufuypa2k4sngk7q40zc5c4npl337uusdh64kv0uafhxhu32dys6pvn6wlw8dav6cmp4pmtv7cc3yel9uu0nq93swx9",
|
|
30
|
-
);
|
|
31
|
-
const enterpriseAddress = wallet.getEnterpriseAddress();
|
|
32
|
-
expect(enterpriseAddress).toEqual(
|
|
33
|
-
"addr_test1vpvx0sacufuypa2k4sngk7q40zc5c4npl337uusdh64kv0c7e4cxr",
|
|
34
|
-
);
|
|
35
|
-
const rewardAddress = wallet.getRewardAddress();
|
|
36
|
-
expect(rewardAddress).toEqual(
|
|
37
|
-
"stake_test1uzw5mnt7g4xjgdqkfa80hrk7kdvds6sa4k0vvgjvlj7w8eskffj2n",
|
|
38
|
-
);
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
it("cli keys", () => {
|
|
42
|
-
const wallet = new AppWallet({
|
|
43
|
-
networkId: 0,
|
|
44
|
-
key: {
|
|
45
|
-
type: "cli",
|
|
46
|
-
payment:
|
|
47
|
-
"5820f083e5878c6f980c53d30b9cc2baadd780307b08acec9e0792892e013bbe9241",
|
|
48
|
-
stake:
|
|
49
|
-
"5820b810d6398db44f380a9ab279f63950c4b95432f44fafb5a6f026afe23bbe9241",
|
|
50
|
-
},
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
const paymentAddress = wallet.getPaymentAddress();
|
|
54
|
-
expect(paymentAddress).toEqual(
|
|
55
|
-
"addr_test1qqdy60gf798xrl20wwvapvsxj3kr8yz8ac6zfmgwg6c5g9p3x07mt562mneg8jxgj03p2uvmhyfyvktjn259mws8e6wq3cdn8p",
|
|
56
|
-
);
|
|
57
|
-
const enterpriseAddress = wallet.getEnterpriseAddress();
|
|
58
|
-
expect(enterpriseAddress).toEqual(
|
|
59
|
-
"addr_test1vqdy60gf798xrl20wwvapvsxj3kr8yz8ac6zfmgwg6c5g9qh602xh",
|
|
60
|
-
);
|
|
61
|
-
const rewardAddress = wallet.getRewardAddress();
|
|
62
|
-
expect(rewardAddress).toEqual(
|
|
63
|
-
"stake_test1uqcn8ld46d9deu5reryf8cs4wxdmjyjxt9ef42zahgrua8qctnd74",
|
|
64
|
-
);
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
it("correct payment address", () => {
|
|
68
|
-
const paymentAddress = wallet.getPaymentAddress();
|
|
69
|
-
expect(paymentAddress).toEqual(
|
|
70
|
-
"addr_test1qpvx0sacufuypa2k4sngk7q40zc5c4npl337uusdh64kv0uafhxhu32dys6pvn6wlw8dav6cmp4pmtv7cc3yel9uu0nq93swx9",
|
|
71
|
-
);
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
it("correct enterprise address", () => {
|
|
75
|
-
const enterpriseAddress = wallet.getEnterpriseAddress();
|
|
76
|
-
expect(enterpriseAddress).toEqual(
|
|
77
|
-
"addr_test1vpvx0sacufuypa2k4sngk7q40zc5c4npl337uusdh64kv0c7e4cxr",
|
|
78
|
-
);
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
it("correct reward address", () => {
|
|
82
|
-
const rewardAddress = wallet.getRewardAddress();
|
|
83
|
-
expect(rewardAddress).toEqual(
|
|
84
|
-
"stake_test1uzw5mnt7g4xjgdqkfa80hrk7kdvds6sa4k0vvgjvlj7w8eskffj2n",
|
|
85
|
-
);
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
it("correct used addresses", () => {
|
|
89
|
-
const paymentAddress = wallet.getUsedAddress();
|
|
90
|
-
expect(paymentAddress.toBech32()).toEqual(
|
|
91
|
-
"addr_test1qpvx0sacufuypa2k4sngk7q40zc5c4npl337uusdh64kv0uafhxhu32dys6pvn6wlw8dav6cmp4pmtv7cc3yel9uu0nq93swx9",
|
|
92
|
-
);
|
|
93
|
-
const enterpriseAddress = wallet.getUsedAddress(0, 0, "enterprise");
|
|
94
|
-
expect(enterpriseAddress.toBech32()).toEqual(
|
|
95
|
-
"addr_test1vpvx0sacufuypa2k4sngk7q40zc5c4npl337uusdh64kv0c7e4cxr",
|
|
96
|
-
);
|
|
97
|
-
});
|
|
98
|
-
});
|
package/test/browser.test.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { CardanoSDKUtil, Serialization } from "@meshsdk/core-cst";
|
|
2
|
-
|
|
3
|
-
import { WalletStaticMethods } from "../src";
|
|
4
|
-
|
|
5
|
-
describe("BroswerWallet", () => {
|
|
6
|
-
it("signTx: addWitnessSet", () => {
|
|
7
|
-
const unsignedTx =
|
|
8
|
-
"84a4008282582023925df9067578d15e766d5e7aacf3f1af5b0eb5a90abd9c9281e4881338317e01825820c9b837816abbdcd28ba3905752b24054ca0d8f5b510d15567041e96bb18b2a29000182825839005867c3b8e27840f556ac268b781578b14c5661fc63ee720dbeab663f9d4dcd7e454d2434164f4efb8edeb358d86a1dad9ec6224cfcbce3e61a0016e360825839001e4eb194e3335a0dcc4f5c5d009318167c583bb3b0879d9f718cd9e0d63a93470bd4d8bb986c02ff8a6043796b91cc397ceb29058f5c9ac01a4387095e021a0002a98d0d83825820423351f26b28a089171fb9a6cfb824de99524972c59958533beba877af74503c01825820d06a742f2b8fe2bad4c38e2db9e9dfe924235d2d0b894d207b251f9cfc93e85103825820ec0c2e70b898cf531b03c9db937602e98c45378d9fa8e8a5b5a91ec5c1d7540d05a0f5f6";
|
|
9
|
-
const witness =
|
|
10
|
-
"a10081825820cb845bb836d4baf4edffb9f76198072cbc70f0d8bb5402644ffd4db17e65259f58403c82976d080de380506a8fd78afc5e8a0ab4367916c943f368b8541e8aca8cbe4d98e4106a7da065918a676849c00201aed154cda38348220960aba80bb5190a";
|
|
11
|
-
const cWitness = Serialization.TransactionWitnessSet.fromCbor(
|
|
12
|
-
CardanoSDKUtil.HexBlob(witness),
|
|
13
|
-
);
|
|
14
|
-
const signedTx = WalletStaticMethods.addWitnessSets(unsignedTx, [
|
|
15
|
-
...cWitness.vkeys()?.values()!,
|
|
16
|
-
]);
|
|
17
|
-
expect(signedTx).toEqual(
|
|
18
|
-
"84a4008282582023925df9067578d15e766d5e7aacf3f1af5b0eb5a90abd9c9281e4881338317e01825820c9b837816abbdcd28ba3905752b24054ca0d8f5b510d15567041e96bb18b2a29000182825839005867c3b8e27840f556ac268b781578b14c5661fc63ee720dbeab663f9d4dcd7e454d2434164f4efb8edeb358d86a1dad9ec6224cfcbce3e61a0016e360825839001e4eb194e3335a0dcc4f5c5d009318167c583bb3b0879d9f718cd9e0d63a93470bd4d8bb986c02ff8a6043796b91cc397ceb29058f5c9ac01a4387095e021a0002a98d0d83825820423351f26b28a089171fb9a6cfb824de99524972c59958533beba877af74503c01825820d06a742f2b8fe2bad4c38e2db9e9dfe924235d2d0b894d207b251f9cfc93e85103825820ec0c2e70b898cf531b03c9db937602e98c45378d9fa8e8a5b5a91ec5c1d7540d05a10081825820cb845bb836d4baf4edffb9f76198072cbc70f0d8bb5402644ffd4db17e65259f58403c82976d080de380506a8fd78afc5e8a0ab4367916c943f368b8541e8aca8cbe4d98e4106a7da065918a676849c00201aed154cda38348220960aba80bb5190af5f6",
|
|
19
|
-
);
|
|
20
|
-
});
|
|
21
|
-
});
|
package/test/embedded.test.ts
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import { checkSignature } from "@meshsdk/core-cst";
|
|
2
|
-
import { EmbeddedWallet } from "@meshsdk/wallet";
|
|
3
|
-
|
|
4
|
-
describe("EmbeddedWallet mnemonic", () => {
|
|
5
|
-
const wallet = new EmbeddedWallet({
|
|
6
|
-
networkId: 0,
|
|
7
|
-
key: {
|
|
8
|
-
type: "mnemonic",
|
|
9
|
-
words: "solution,".repeat(24).split(",").slice(0, 24),
|
|
10
|
-
},
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
it("generate mnemonic", () => {
|
|
14
|
-
const mnemonic = EmbeddedWallet.generateMnemonic();
|
|
15
|
-
expect(mnemonic.length).toEqual(24);
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it("correct base address", () => {
|
|
19
|
-
const account = wallet.getAccount(0, 0);
|
|
20
|
-
expect(account.baseAddressBech32).toEqual(
|
|
21
|
-
"addr_test1qpvx0sacufuypa2k4sngk7q40zc5c4npl337uusdh64kv0uafhxhu32dys6pvn6wlw8dav6cmp4pmtv7cc3yel9uu0nq93swx9",
|
|
22
|
-
);
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it("correct enterprise address", () => {
|
|
26
|
-
const account = wallet.getAccount(0, 0);
|
|
27
|
-
expect(account.enterpriseAddressBech32).toEqual(
|
|
28
|
-
"addr_test1vpvx0sacufuypa2k4sngk7q40zc5c4npl337uusdh64kv0c7e4cxr",
|
|
29
|
-
);
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
it("correct reward address", () => {
|
|
33
|
-
const account = wallet.getAccount(0, 0);
|
|
34
|
-
expect(account.rewardAddressBech32).toEqual(
|
|
35
|
-
"stake_test1uzw5mnt7g4xjgdqkfa80hrk7kdvds6sa4k0vvgjvlj7w8eskffj2n",
|
|
36
|
-
);
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
it("sign message", () => {
|
|
40
|
-
const message = `meshjs's core-cst is pure typescript while core-csl is wasm rust.`;
|
|
41
|
-
const signature = wallet.signData(
|
|
42
|
-
"addr_test1qpvx0sacufuypa2k4sngk7q40zc5c4npl337uusdh64kv0uafhxhu32dys6pvn6wlw8dav6cmp4pmtv7cc3yel9uu0nq93swx9",
|
|
43
|
-
message,
|
|
44
|
-
0,
|
|
45
|
-
0,
|
|
46
|
-
);
|
|
47
|
-
const result = checkSignature(message, signature);
|
|
48
|
-
|
|
49
|
-
expect(signature.key).toEqual(
|
|
50
|
-
"c32dfdb461dd016e8fdd9b6d424a77439eab8f8c644a804b013b6cefa2454f95",
|
|
51
|
-
);
|
|
52
|
-
expect(signature.signature).toEqual(
|
|
53
|
-
"2808fc47212c2fe2151ccb4209cc7c5cf44b5ec6a80e21232a3f004697bd795b5610880184d8466761820bcb38401cc1e16945b1c1944037ce92a0929e729a0f",
|
|
54
|
-
);
|
|
55
|
-
expect(result).toEqual(true);
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
describe("EmbeddedWallet privateKey", () => {
|
|
60
|
-
const walletMnemonic = new EmbeddedWallet({
|
|
61
|
-
networkId: 0,
|
|
62
|
-
key: {
|
|
63
|
-
type: "mnemonic",
|
|
64
|
-
words: [
|
|
65
|
-
"ramp",
|
|
66
|
-
"over",
|
|
67
|
-
"popular",
|
|
68
|
-
"angry",
|
|
69
|
-
"flock",
|
|
70
|
-
"idle",
|
|
71
|
-
"silent",
|
|
72
|
-
"stove",
|
|
73
|
-
"very",
|
|
74
|
-
"hover",
|
|
75
|
-
"hip",
|
|
76
|
-
"juice",
|
|
77
|
-
"dentist",
|
|
78
|
-
"mask",
|
|
79
|
-
"radar",
|
|
80
|
-
"example",
|
|
81
|
-
"layer",
|
|
82
|
-
"tongue",
|
|
83
|
-
"shift",
|
|
84
|
-
"cement",
|
|
85
|
-
"margin",
|
|
86
|
-
"since",
|
|
87
|
-
"floor",
|
|
88
|
-
"clinic",
|
|
89
|
-
],
|
|
90
|
-
},
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
const walletRoot = new EmbeddedWallet({
|
|
94
|
-
networkId: 0,
|
|
95
|
-
key: {
|
|
96
|
-
type: "root",
|
|
97
|
-
bech32:
|
|
98
|
-
"xprv1tzdu7xzqjc0j8jzlsjwdvchczkxu4qjyhkxewtcuu7zt3amd44x6emkcrzks8gthdwyfavq98ayp06434yda6xudfd5zltd4tjxhdu37qumdlvcx8f05pp5n45j6nwqztx2ra0jm636xqluwxw47vlrlzqp7a0a9",
|
|
99
|
-
},
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
it("correct addresses", () => {
|
|
103
|
-
const accountMnemonic = walletMnemonic.getAccount(0, 0);
|
|
104
|
-
expect(accountMnemonic.enterpriseAddressBech32).toEqual(
|
|
105
|
-
"addr_test1vz0vlyux43d7c4su8uzkkqvm6vug28t3zvnycxjnuvnxa0c5gr4p9",
|
|
106
|
-
);
|
|
107
|
-
const accountRoot = walletRoot.getAccount(0, 0);
|
|
108
|
-
expect(accountRoot.enterpriseAddressBech32).toEqual(
|
|
109
|
-
"addr_test1vz0vlyux43d7c4su8uzkkqvm6vug28t3zvnycxjnuvnxa0c5gr4p9",
|
|
110
|
-
);
|
|
111
|
-
});
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
describe("EmbeddedWallet signingKeys", () => {
|
|
115
|
-
const wallet = new EmbeddedWallet({
|
|
116
|
-
networkId: 0,
|
|
117
|
-
key: {
|
|
118
|
-
type: "cli",
|
|
119
|
-
payment:
|
|
120
|
-
"f083e5878c6f980c53d30b9cc2baadd780307b08acec9e0792892e013bbe9241",
|
|
121
|
-
stake: "b810d6398db44f380a9ab279f63950c4b95432f44fafb5a6f026afe23bbe9241",
|
|
122
|
-
},
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
it("correct addresses", () => {
|
|
126
|
-
const account = wallet.getAccount(0, 0);
|
|
127
|
-
expect(account.baseAddressBech32).toEqual(
|
|
128
|
-
"addr_test1qqdy60gf798xrl20wwvapvsxj3kr8yz8ac6zfmgwg6c5g9p3x07mt562mneg8jxgj03p2uvmhyfyvktjn259mws8e6wq3cdn8p",
|
|
129
|
-
);
|
|
130
|
-
expect(account.enterpriseAddressBech32).toEqual(
|
|
131
|
-
"addr_test1vqdy60gf798xrl20wwvapvsxj3kr8yz8ac6zfmgwg6c5g9qh602xh",
|
|
132
|
-
);
|
|
133
|
-
expect(account.rewardAddressBech32).toEqual(
|
|
134
|
-
"stake_test1uqcn8ld46d9deu5reryf8cs4wxdmjyjxt9ef42zahgrua8qctnd74",
|
|
135
|
-
);
|
|
136
|
-
});
|
|
137
|
-
});
|
package/test/mesh.test.ts
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { MeshWallet } from "@meshsdk/wallet";
|
|
2
|
-
|
|
3
|
-
describe("MeshWallet", () => {
|
|
4
|
-
const wallet = new MeshWallet({
|
|
5
|
-
networkId: 0,
|
|
6
|
-
key: {
|
|
7
|
-
type: "mnemonic",
|
|
8
|
-
words: "solution,".repeat(24).split(",").slice(0, 24),
|
|
9
|
-
},
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
it("private keys", () => {
|
|
13
|
-
const wallet = new MeshWallet({
|
|
14
|
-
networkId: 0,
|
|
15
|
-
key: {
|
|
16
|
-
type: "root",
|
|
17
|
-
bech32:
|
|
18
|
-
"xprv1cqa46gk29plgkg98upclnjv5t425fcpl4rgf9mq2txdxuga7jfq5shk7np6l55nj00sl3m4syzna3uwgrwppdm0azgy9d8zahyf32s62klfyhe0ayyxkc7x92nv4s77fa0v25tufk9tnv7x6dgexe9kdz5gpeqgu",
|
|
19
|
-
},
|
|
20
|
-
});
|
|
21
|
-
expect(wallet.getChangeAddress()).toEqual(
|
|
22
|
-
"addr_test1qpvx0sacufuypa2k4sngk7q40zc5c4npl337uusdh64kv0uafhxhu32dys6pvn6wlw8dav6cmp4pmtv7cc3yel9uu0nq93swx9",
|
|
23
|
-
);
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
it("cli keys", () => {
|
|
27
|
-
const wallet = new MeshWallet({
|
|
28
|
-
networkId: 0,
|
|
29
|
-
key: {
|
|
30
|
-
type: "cli",
|
|
31
|
-
payment:
|
|
32
|
-
"5820f083e5878c6f980c53d30b9cc2baadd780307b08acec9e0792892e013bbe9241",
|
|
33
|
-
stake:
|
|
34
|
-
"5820b810d6398db44f380a9ab279f63950c4b95432f44fafb5a6f026afe23bbe9241",
|
|
35
|
-
},
|
|
36
|
-
});
|
|
37
|
-
expect(wallet.getChangeAddress()).toEqual(
|
|
38
|
-
"addr_test1qqdy60gf798xrl20wwvapvsxj3kr8yz8ac6zfmgwg6c5g9p3x07mt562mneg8jxgj03p2uvmhyfyvktjn259mws8e6wq3cdn8p",
|
|
39
|
-
);
|
|
40
|
-
expect(wallet.getRewardAddresses()[0]).toEqual(
|
|
41
|
-
"stake_test1uqcn8ld46d9deu5reryf8cs4wxdmjyjxt9ef42zahgrua8qctnd74",
|
|
42
|
-
);
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
it("getChangeAddress", () => {
|
|
46
|
-
const changeAddress = wallet.getChangeAddress();
|
|
47
|
-
expect(changeAddress).toEqual(
|
|
48
|
-
"addr_test1qpvx0sacufuypa2k4sngk7q40zc5c4npl337uusdh64kv0uafhxhu32dys6pvn6wlw8dav6cmp4pmtv7cc3yel9uu0nq93swx9",
|
|
49
|
-
);
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
it("getNetworkId", () => {
|
|
53
|
-
const networkId = wallet.getNetworkId();
|
|
54
|
-
expect(networkId).toEqual(0);
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
it("getRewardAddresses", () => {
|
|
58
|
-
const addresses = wallet.getRewardAddresses();
|
|
59
|
-
expect(addresses).toEqual([
|
|
60
|
-
"stake_test1uzw5mnt7g4xjgdqkfa80hrk7kdvds6sa4k0vvgjvlj7w8eskffj2n",
|
|
61
|
-
]);
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
it("getUnusedAddresses", () => {
|
|
65
|
-
const addresses = wallet.getUnusedAddresses();
|
|
66
|
-
expect(addresses).toEqual([
|
|
67
|
-
"addr_test1qpvx0sacufuypa2k4sngk7q40zc5c4npl337uusdh64kv0uafhxhu32dys6pvn6wlw8dav6cmp4pmtv7cc3yel9uu0nq93swx9",
|
|
68
|
-
]);
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
it("getUsedAddresses", () => {
|
|
72
|
-
const addresses = wallet.getUsedAddresses();
|
|
73
|
-
expect(addresses).toEqual([
|
|
74
|
-
"addr_test1qpvx0sacufuypa2k4sngk7q40zc5c4npl337uusdh64kv0uafhxhu32dys6pvn6wlw8dav6cmp4pmtv7cc3yel9uu0nq93swx9",
|
|
75
|
-
]);
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
it("getUsedAddress", () => {
|
|
79
|
-
const address = wallet.getUsedAddress();
|
|
80
|
-
expect(address.toBech32()).toEqual(
|
|
81
|
-
"addr_test1qpvx0sacufuypa2k4sngk7q40zc5c4npl337uusdh64kv0uafhxhu32dys6pvn6wlw8dav6cmp4pmtv7cc3yel9uu0nq93swx9",
|
|
82
|
-
);
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
it("brew", () => {
|
|
86
|
-
const mnemonic = MeshWallet.brew();
|
|
87
|
-
expect(mnemonic.length).toEqual(24);
|
|
88
|
-
|
|
89
|
-
const privatekey = MeshWallet.brew(true);
|
|
90
|
-
expect(privatekey.length).toEqual(165);
|
|
91
|
-
|
|
92
|
-
if (typeof privatekey === "string")
|
|
93
|
-
expect(privatekey.substring(0, 5)).toEqual("xprv1");
|
|
94
|
-
});
|
|
95
|
-
});
|