@bsv/wallet-toolbox 1.6.22 → 1.6.23
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/docs/client.md +2 -0
- package/docs/wallet.md +2 -0
- package/mobile/out/src/CWIStyleWalletManager.d.ts +1 -0
- package/mobile/out/src/CWIStyleWalletManager.d.ts.map +1 -1
- package/mobile/out/src/CWIStyleWalletManager.js +4 -2
- package/mobile/out/src/CWIStyleWalletManager.js.map +1 -1
- package/mobile/out/src/storage/methods/createAction.d.ts.map +1 -1
- package/mobile/out/src/storage/methods/createAction.js.map +1 -1
- package/mobile/package-lock.json +2 -2
- package/mobile/package.json +1 -1
- package/out/src/CWIStyleWalletManager.d.ts +1 -0
- package/out/src/CWIStyleWalletManager.d.ts.map +1 -1
- package/out/src/CWIStyleWalletManager.js +4 -2
- package/out/src/CWIStyleWalletManager.js.map +1 -1
- package/out/src/storage/methods/createAction.d.ts.map +1 -1
- package/out/src/storage/methods/createAction.js.map +1 -1
- package/out/tsconfig.all.tsbuildinfo +1 -1
- package/package.json +4 -3
- package/src/CWIStyleWalletManager.ts +14 -4
- package/src/storage/methods/createAction.ts +6 -1
- package/syncVersions.js +71 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bsv/wallet-toolbox",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.23",
|
|
4
4
|
"description": "BRC100 conforming wallet, wallet storage and wallet signer components",
|
|
5
5
|
"main": "./out/src/index.js",
|
|
6
6
|
"types": "./out/src/index.d.ts",
|
|
@@ -22,8 +22,9 @@
|
|
|
22
22
|
"test:coverage": "npm run build && jest --testPathIgnorePatterns=man.test.ts --coverage",
|
|
23
23
|
"lint": "prettier --write 'src/**/*.ts' --write 'test/**/*.ts' --log-level silent",
|
|
24
24
|
"build": "tsc --build",
|
|
25
|
-
"prepublish": "npm run lint && npm run build && npm run doc",
|
|
26
|
-
"doc": "ts2md"
|
|
25
|
+
"prepublish": "npm run lint && npm run build && npm run doc && npm run sync-versions",
|
|
26
|
+
"doc": "ts2md",
|
|
27
|
+
"sync-versions": "node syncVersions.js"
|
|
27
28
|
},
|
|
28
29
|
"bugs": {
|
|
29
30
|
"url": "https://github.com/bsv-blockchain/wallet-toolbox/issues"
|
|
@@ -61,7 +61,9 @@ import {
|
|
|
61
61
|
Transaction,
|
|
62
62
|
PushDrop,
|
|
63
63
|
CreateActionInput,
|
|
64
|
-
SHIPBroadcaster
|
|
64
|
+
SHIPBroadcaster,
|
|
65
|
+
BigNumber,
|
|
66
|
+
Curve
|
|
65
67
|
} from '@bsv/sdk'
|
|
66
68
|
import { PrivilegedKeyManager } from './sdk/PrivilegedKeyManager'
|
|
67
69
|
|
|
@@ -1065,7 +1067,13 @@ export class CWIStyleWalletManager implements WalletInterface {
|
|
|
1065
1067
|
* Lists all available profiles, including the default profile.
|
|
1066
1068
|
* @returns Array of profile info objects, including an 'active' flag.
|
|
1067
1069
|
*/
|
|
1068
|
-
listProfiles(): Array<{
|
|
1070
|
+
listProfiles(): Array<{
|
|
1071
|
+
id: number[]
|
|
1072
|
+
name: string
|
|
1073
|
+
createdAt: number | null
|
|
1074
|
+
active: boolean
|
|
1075
|
+
identityKey: string
|
|
1076
|
+
}> {
|
|
1069
1077
|
if (!this.authenticated) {
|
|
1070
1078
|
throw new Error('Not authenticated.')
|
|
1071
1079
|
}
|
|
@@ -1075,14 +1083,16 @@ export class CWIStyleWalletManager implements WalletInterface {
|
|
|
1075
1083
|
id: DEFAULT_PROFILE_ID,
|
|
1076
1084
|
name: 'default',
|
|
1077
1085
|
createdAt: null, // Default profile doesn't have a creation timestamp in the same way
|
|
1078
|
-
active: this.activeProfileId.every(x => x === 0)
|
|
1086
|
+
active: this.activeProfileId.every(x => x === 0),
|
|
1087
|
+
identityKey: new PrivateKey(this.rootPrimaryKey).toPublicKey().toString()
|
|
1079
1088
|
},
|
|
1080
1089
|
// Other profiles
|
|
1081
1090
|
...this.profiles.map(p => ({
|
|
1082
1091
|
id: p.id,
|
|
1083
1092
|
name: p.name,
|
|
1084
1093
|
createdAt: p.createdAt,
|
|
1085
|
-
active: this.activeProfileId.every((x, i) => x === p.id[i])
|
|
1094
|
+
active: this.activeProfileId.every((x, i) => x === p.id[i]),
|
|
1095
|
+
identityKey: new PrivateKey(this.XOR(this.rootPrimaryKey as number[], p.primaryPad)).toPublicKey().toString()
|
|
1086
1096
|
}))
|
|
1087
1097
|
]
|
|
1088
1098
|
return profileList
|
|
@@ -27,7 +27,12 @@ import {
|
|
|
27
27
|
StorageGetBeefOptions,
|
|
28
28
|
StorageProvidedBy
|
|
29
29
|
} from '../../sdk/WalletStorage.interfaces'
|
|
30
|
-
import {
|
|
30
|
+
import {
|
|
31
|
+
ValidCreateActionArgs,
|
|
32
|
+
ValidCreateActionInput,
|
|
33
|
+
ValidCreateActionOutput,
|
|
34
|
+
validateSatoshis
|
|
35
|
+
} from '../../sdk/validationHelpers'
|
|
31
36
|
import { WERR_INTERNAL, WERR_INVALID_PARAMETER } from '../../sdk/WERR_errors'
|
|
32
37
|
import {
|
|
33
38
|
randomBytesBase64,
|
package/syncVersions.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const { execSync } = require('child_process');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Synchronizes version numbers from root package.json to mobile and client package.json files
|
|
7
|
+
* and updates package-lock.json files by running npm install
|
|
8
|
+
*/
|
|
9
|
+
function syncVersions() {
|
|
10
|
+
try {
|
|
11
|
+
// Read the root package.json
|
|
12
|
+
const rootPackagePath = path.join(__dirname, 'package.json');
|
|
13
|
+
const rootPackage = JSON.parse(fs.readFileSync(rootPackagePath, 'utf8'));
|
|
14
|
+
const version = rootPackage.version;
|
|
15
|
+
|
|
16
|
+
console.log(`Root package version: ${version}`);
|
|
17
|
+
|
|
18
|
+
// Directories to update
|
|
19
|
+
const directoriesToUpdate = [
|
|
20
|
+
{ packagePath: './mobile/package.json', dir: './mobile' },
|
|
21
|
+
{ packagePath: './client/package.json', dir: './client' }
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
// Update each package.json file and run npm install
|
|
25
|
+
directoriesToUpdate.forEach(({ packagePath, dir }) => {
|
|
26
|
+
const fullPath = path.join(__dirname, packagePath);
|
|
27
|
+
const fullDirPath = path.join(__dirname, dir);
|
|
28
|
+
|
|
29
|
+
if (fs.existsSync(fullPath)) {
|
|
30
|
+
const packageData = JSON.parse(fs.readFileSync(fullPath, 'utf8'));
|
|
31
|
+
const oldVersion = packageData.version;
|
|
32
|
+
|
|
33
|
+
packageData.version = version;
|
|
34
|
+
fs.writeFileSync(fullPath, JSON.stringify(packageData, null, 2) + '\n');
|
|
35
|
+
|
|
36
|
+
console.log(`Updated ${packagePath}: ${oldVersion} → ${version}`);
|
|
37
|
+
|
|
38
|
+
// Run npm install to update package-lock.json
|
|
39
|
+
if (fs.existsSync(fullDirPath)) {
|
|
40
|
+
console.log(`Running npm install in ${dir}...`);
|
|
41
|
+
try {
|
|
42
|
+
execSync('npm install', {
|
|
43
|
+
cwd: fullDirPath,
|
|
44
|
+
stdio: 'inherit',
|
|
45
|
+
timeout: 60000 // 60 second timeout
|
|
46
|
+
});
|
|
47
|
+
console.log(`✓ npm install completed in ${dir}`);
|
|
48
|
+
} catch (installError) {
|
|
49
|
+
console.error(`✗ npm install failed in ${dir}:`, installError.message);
|
|
50
|
+
}
|
|
51
|
+
} else {
|
|
52
|
+
console.warn(`Warning: Directory ${dir} not found`);
|
|
53
|
+
}
|
|
54
|
+
} else {
|
|
55
|
+
console.warn(`Warning: ${packagePath} not found`);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
console.log('Version synchronization completed successfully!');
|
|
60
|
+
} catch (error) {
|
|
61
|
+
console.error('Error synchronizing versions:', error.message);
|
|
62
|
+
process.exit(1);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Run the function if this script is executed directly
|
|
67
|
+
if (require.main === module) {
|
|
68
|
+
syncVersions();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
module.exports = syncVersions;
|