@cityofzion/bs-neo3 0.8.0 → 0.9.0
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/.rush/temp/operation/build/state.json +1 -1
- package/.rush/temp/package-deps_build.json +5 -5
- package/CHANGELOG.json +4 -4
- package/CHANGELOG.md +3 -3
- package/dist/BSNeo3.d.ts +1 -0
- package/dist/BSNeo3.js +3 -0
- package/package.json +2 -2
- package/src/BSNeo3.ts +4 -0
- package/src/__tests__/BSNeo3.spec.ts +9 -1
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
"files": {
|
|
3
3
|
"packages/bs-neo3/jest.config.ts": "d944475db93cbe41a9339187fd94b9962e411c43",
|
|
4
4
|
"packages/bs-neo3/jest.setup.ts": "9a1976a32050616d4d2ee95b1aa21041bc4daca3",
|
|
5
|
-
"packages/bs-neo3/package.json": "
|
|
6
|
-
"packages/bs-neo3/src/BSNeo3.ts": "
|
|
5
|
+
"packages/bs-neo3/package.json": "b898bb693037b3fbb06bcdcbd1fef757a16a6b7e",
|
|
6
|
+
"packages/bs-neo3/src/BSNeo3.ts": "e7235ac3cb4cef569443b4fbef6cb787972de25b",
|
|
7
7
|
"packages/bs-neo3/src/DoraBDSNeo3.ts": "7891be397db816f811631e56c1abf32bbd0b2a36",
|
|
8
8
|
"packages/bs-neo3/src/DoraESNeo3.ts": "c3d36ee5c38cda45c08f517c49976af6d69c5711",
|
|
9
9
|
"packages/bs-neo3/src/FlamingoEDSNeo3.ts": "041aa79e04b2fafb6da71178e7bcc7011f416c1d",
|
|
10
10
|
"packages/bs-neo3/src/GhostMarketNDSNeo3.ts": "d7db2a624cf099fe550fa4a906f6127ca4815cac",
|
|
11
11
|
"packages/bs-neo3/src/RpcBDSNeo3.ts": "11a7425844ab09a11c631281e103d1edeab4a63f",
|
|
12
12
|
"packages/bs-neo3/src/__tests__/BDSNeo3.spec.ts": "14bd204f3d4546c81b6ea37e16f3fe6e70102dd1",
|
|
13
|
-
"packages/bs-neo3/src/__tests__/BSNeo3.spec.ts": "
|
|
13
|
+
"packages/bs-neo3/src/__tests__/BSNeo3.spec.ts": "b1a3d7fca99e984f32bfe0b0a6aed3a25b5de375",
|
|
14
14
|
"packages/bs-neo3/src/__tests__/DoraESNeo3.spec.ts": "450e087014c22b1a289e64dd80ff3e6ddfd8c932",
|
|
15
15
|
"packages/bs-neo3/src/__tests__/FlamingoEDSNeo3.spec.ts": "473b1aafe03031a28a8414dfa681b06f843acdf6",
|
|
16
16
|
"packages/bs-neo3/src/__tests__/GhostMarketNDSNeo3.spec.ts": "1d583380b60112fb99426b4bf140c92898177b1e",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"packages/bs-neo3/tsconfig.build.json": "4dc23fb9c4c5e4d19a9bc3947a47c523f4bd967c",
|
|
23
23
|
"packages/bs-neo3/tsconfig.json": "77cf2b789e9c665b62792f9992cc81ae86296ef7",
|
|
24
24
|
"packages/bs-neo3/.rush/temp/shrinkwrap-deps.json": "7348b8936da22d117d50dfb8445815a3fabc42cb",
|
|
25
|
-
"packages/bs-neo3/CHANGELOG.json": "
|
|
26
|
-
"packages/bs-neo3/CHANGELOG.md": "
|
|
25
|
+
"packages/bs-neo3/CHANGELOG.json": "01f448101fc9ca122dcd35104e1b43ce51d9da41",
|
|
26
|
+
"packages/bs-neo3/CHANGELOG.md": "6d81b432aaa2c568abc4d8a82df569570040bcbc"
|
|
27
27
|
},
|
|
28
28
|
"arguments": "tsc --project tsconfig.build.json "
|
|
29
29
|
}
|
package/CHANGELOG.json
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"name": "@cityofzion/bs-neo3",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"version": "0.
|
|
6
|
-
"tag": "@cityofzion/bs-neo3_v0.
|
|
7
|
-
"date": "
|
|
5
|
+
"version": "0.9.0",
|
|
6
|
+
"tag": "@cityofzion/bs-neo3_v0.9.0",
|
|
7
|
+
"date": "Tue, 05 Dec 2023 18:42:10 GMT",
|
|
8
8
|
"comments": {
|
|
9
9
|
"minor": [
|
|
10
10
|
{
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
],
|
|
14
14
|
"dependency": [
|
|
15
15
|
{
|
|
16
|
-
"comment": "Updating dependency \"@cityofzion/blockchain-service\" to `0.
|
|
16
|
+
"comment": "Updating dependency \"@cityofzion/blockchain-service\" to `0.9.0`"
|
|
17
17
|
}
|
|
18
18
|
]
|
|
19
19
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# Change Log - @cityofzion/bs-neo3
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Tue, 05 Dec 2023 18:42:10 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
|
-
## 0.
|
|
6
|
-
|
|
5
|
+
## 0.9.0
|
|
6
|
+
Tue, 05 Dec 2023 18:42:10 GMT
|
|
7
7
|
|
|
8
8
|
### Minor changes
|
|
9
9
|
|
package/dist/BSNeo3.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export declare class BSNeo3<BSCustomName extends string = string> implements Blo
|
|
|
20
20
|
generateAccountFromMnemonic(mnemonic: string[] | string, index: number): AccountWithDerivationPath;
|
|
21
21
|
generateAccountFromKey(key: string): Account;
|
|
22
22
|
decrypt(encryptedKey: string, password: string): Promise<Account>;
|
|
23
|
+
encrypt(key: string, password: string): Promise<string>;
|
|
23
24
|
calculateTransferFee(param: TransferParam): Promise<string>;
|
|
24
25
|
transfer(param: TransferParam): Promise<string>;
|
|
25
26
|
claim(account: Account): Promise<string>;
|
package/dist/BSNeo3.js
CHANGED
|
@@ -95,6 +95,9 @@ class BSNeo3 {
|
|
|
95
95
|
return this.generateAccountFromKey(privateKey);
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
|
+
encrypt(key, password) {
|
|
99
|
+
return neon_js_1.wallet.encrypt(key, password);
|
|
100
|
+
}
|
|
98
101
|
calculateTransferFee(param) {
|
|
99
102
|
return __awaiter(this, void 0, void 0, function* () {
|
|
100
103
|
const account = new neon_js_1.wallet.Account(param.senderAccount.key);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cityofzion/bs-neo3",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"repository": "https://github.com/CityOfZion/blockchain-services",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"@cityofzion/dora-ts": "0.0.11",
|
|
17
17
|
"axios": "1.5.1",
|
|
18
18
|
"query-string": "7.1.3",
|
|
19
|
-
"@cityofzion/blockchain-service": "0.
|
|
19
|
+
"@cityofzion/blockchain-service": "0.9.0",
|
|
20
20
|
"@cityofzion/bs-asteroid-sdk": "0.7.3"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
package/src/BSNeo3.ts
CHANGED
|
@@ -130,6 +130,10 @@ export class BSNeo3<BSCustomName extends string = string>
|
|
|
130
130
|
return this.generateAccountFromKey(privateKey)
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
+
encrypt(key: string, password: string): Promise<string> {
|
|
134
|
+
return wallet.encrypt(key, password)
|
|
135
|
+
}
|
|
136
|
+
|
|
133
137
|
async calculateTransferFee(param: TransferParam): Promise<string> {
|
|
134
138
|
const account = new wallet.Account(param.senderAccount.key)
|
|
135
139
|
const invoker = await NeonInvoker.init({
|
|
@@ -69,11 +69,19 @@ describe('BSNeo3', () => {
|
|
|
69
69
|
const mnemonic = generateMnemonic()
|
|
70
70
|
const account = bsNeo3.generateAccountFromMnemonic(mnemonic, 0)
|
|
71
71
|
const password = 'TestPassword'
|
|
72
|
-
const encryptedKey = await
|
|
72
|
+
const encryptedKey = await bsNeo3.encrypt(account.key, password)
|
|
73
73
|
const decryptedAccount = await bsNeo3.decrypt(encryptedKey, password)
|
|
74
74
|
expect(account).toEqual(expect.objectContaining(decryptedAccount))
|
|
75
75
|
}, 20000)
|
|
76
76
|
|
|
77
|
+
it('Should be able to encrypt a key', async () => {
|
|
78
|
+
const mnemonic = generateMnemonic()
|
|
79
|
+
const account = bsNeo3.generateAccountFromMnemonic(mnemonic, 0)
|
|
80
|
+
const password = 'TestPassword'
|
|
81
|
+
const encryptedKey = await bsNeo3.encrypt(account.key, password)
|
|
82
|
+
expect(encryptedKey).toEqual(expect.any(String))
|
|
83
|
+
})
|
|
84
|
+
|
|
77
85
|
it.skip('Should be able to calculate transfer fee', async () => {
|
|
78
86
|
const account = bsNeo3.generateAccountFromKey(process.env.TESTNET_PRIVATE_KEY as string)
|
|
79
87
|
|