@deserialize/multi-vm-wallet 1.0.371 → 1.1.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/dist/bip32.d.ts +1 -3
- package/dist/bip32.js +103 -33
- package/dist/bip32.js.map +1 -1
- package/dist/bip32Old.d.ts +51 -0
- package/dist/bip32Old.js +856 -0
- package/dist/bip32Old.js.map +1 -0
- package/dist/{utils/bip32.d.ts → bip32Small.d.ts} +1 -3
- package/dist/bip32Small.js +115 -0
- package/dist/bip32Small.js.map +1 -0
- package/dist/bipTest.d.ts +0 -0
- package/dist/bipTest.js +363 -0
- package/dist/bipTest.js.map +1 -0
- package/dist/constant.d.ts +2 -0
- package/dist/constant.js +55 -0
- package/dist/constant.js.map +1 -0
- package/dist/evm/evm.d.ts +1 -0
- package/dist/evm/evm.js +1 -0
- package/dist/evm/evm.js.map +1 -1
- package/dist/evm/utils.d.ts +2 -1
- package/dist/evm/utils.js +24 -1
- package/dist/evm/utils.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/svm/svm.d.ts +1 -0
- package/dist/svm/svm.js +12 -8
- package/dist/svm/svm.js.map +1 -1
- package/dist/svm/transactionSender.js +6 -2
- package/dist/svm/transactionSender.js.map +1 -1
- package/dist/svm/utils.d.ts +1 -0
- package/dist/svm/utils.js +28 -35
- package/dist/svm/utils.js.map +1 -1
- package/dist/test.d.ts +2 -0
- package/dist/test.js +42 -0
- package/dist/test.js.map +1 -0
- package/dist/types.d.ts +2 -0
- package/dist/types.js.map +1 -1
- package/dist/vm.d.ts +2 -1
- package/dist/vm.js +2 -2
- package/dist/vm.js.map +1 -1
- package/package.json +2 -5
- package/utils/bip32.ts +124 -35
- package/utils/bip32Old.ts +1004 -0
- package/utils/bip32Small.ts +91 -0
- package/utils/bipTest.ts +442 -0
- package/utils/constant.ts +55 -0
- package/utils/evm/evm.ts +4 -3
- package/utils/evm/utils.ts +29 -1
- package/utils/index.ts +2 -1
- package/utils/svm/svm.ts +14 -12
- package/utils/svm/transactionSender.ts +7 -2
- package/utils/svm/utils.ts +36 -36
- package/utils/test.ts +49 -0
- package/utils/types.ts +2 -0
- package/utils/vm.ts +4 -3
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/utils/IChainWallet.d.ts +0 -17
- package/dist/utils/IChainWallet.js +0 -22
- package/dist/utils/bip32.js +0 -99
- package/dist/utils/evm/evm.d.ts +0 -39
- package/dist/utils/evm/evm.js +0 -233
- package/dist/utils/evm/index.d.ts +0 -2
- package/dist/utils/evm/index.js +0 -18
- package/dist/utils/evm/utils.d.ts +0 -207
- package/dist/utils/evm/utils.js +0 -537
- package/dist/utils/index.d.ts +0 -7
- package/dist/utils/index.js +0 -23
- package/dist/utils/svm/index.d.ts +0 -1
- package/dist/utils/svm/index.js +0 -17
- package/dist/utils/svm/svm.d.ts +0 -36
- package/dist/utils/svm/svm.js +0 -166
- package/dist/utils/svm/transactionSender.d.ts +0 -8
- package/dist/utils/svm/transactionSender.js +0 -83
- package/dist/utils/svm/utils.d.ts +0 -85
- package/dist/utils/svm/utils.js +0 -304
- package/dist/utils/types.d.ts +0 -44
- package/dist/utils/types.js +0 -9
- package/dist/utils/vm.d.ts +0 -12
- package/dist/utils/vm.js +0 -48
package/dist/bip32.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { BIP32Interface } from "bip32";
|
|
2
1
|
import { Keypair } from "@solana/web3.js";
|
|
3
2
|
export declare function GenerateNewMnemonic(): string;
|
|
4
3
|
export declare function ValidateMnemonic(mnemonic: string): true;
|
|
5
|
-
export declare function GenerateSeed(_mnemonic?: string):
|
|
6
|
-
export declare function getSeedNode(seed: string): BIP32Interface;
|
|
4
|
+
export declare function GenerateSeed(_mnemonic?: string): Uint8Array<ArrayBufferLike>;
|
|
7
5
|
export declare function EVMDeriveChildPrivateKey(seed: string, index: number, derivationPath: string): {
|
|
8
6
|
privateKey: string;
|
|
9
7
|
publicKey: string;
|
package/dist/bip32.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
// import * as bip39 from "bip39";
|
|
3
|
+
// import BIP32Factory from "bip32";
|
|
4
|
+
// import * as ecc from "tiny-secp256k1";
|
|
5
|
+
// import { BIP32Interface } from "bip32";
|
|
6
|
+
// import * as ed25519 from "ed25519-hd-key";
|
|
7
|
+
// import { Keypair } from "@solana/web3.js";
|
|
2
8
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
9
|
if (k2 === undefined) k2 = k;
|
|
4
10
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -32,69 +38,133 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
38
|
return result;
|
|
33
39
|
};
|
|
34
40
|
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
42
|
exports.GenerateNewMnemonic = GenerateNewMnemonic;
|
|
40
43
|
exports.ValidateMnemonic = ValidateMnemonic;
|
|
41
44
|
exports.GenerateSeed = GenerateSeed;
|
|
42
|
-
exports.getSeedNode = getSeedNode;
|
|
43
45
|
exports.EVMDeriveChildPrivateKey = EVMDeriveChildPrivateKey;
|
|
44
46
|
exports.SVMDeriveChildPrivateKey = SVMDeriveChildPrivateKey;
|
|
45
|
-
|
|
46
|
-
const
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
//
|
|
52
|
-
// const
|
|
53
|
-
//
|
|
54
|
-
//
|
|
47
|
+
// // export function getPublicKeyFromSeed(seed: string, index: number) {
|
|
48
|
+
// // const node = getSeedNode(seed);
|
|
49
|
+
// // const { publicKey } = deriveChildPrivateKey(node, index);
|
|
50
|
+
// // return publicKey;
|
|
51
|
+
// // }
|
|
52
|
+
// // export function getPrivateKeyFromSeed(seed: string, index: number) {
|
|
53
|
+
// // const node = getSeedNode(seed);
|
|
54
|
+
// // const keyPair = deriveChildPrivateKey(node, index);
|
|
55
|
+
// // return keyPair.privateKey;
|
|
56
|
+
// // }
|
|
57
|
+
// export function GenerateNewMnemonic() {
|
|
58
|
+
// const mnemonic = bip39.generateMnemonic();
|
|
59
|
+
// return mnemonic;
|
|
60
|
+
// }
|
|
61
|
+
// export function ValidateMnemonic(mnemonic: string) {
|
|
62
|
+
// const isValid = bip39.validateMnemonic(mnemonic);
|
|
63
|
+
// if (!isValid) {
|
|
64
|
+
// throw new Error("Invalid mnemonic");
|
|
65
|
+
// }
|
|
66
|
+
// return isValid;
|
|
67
|
+
// }
|
|
68
|
+
// export function GenerateSeed(_mnemonic?: string) {
|
|
69
|
+
// const mnemonic = _mnemonic || bip39.generateMnemonic();
|
|
70
|
+
// const seed = bip39.mnemonicToSeedSync(mnemonic);
|
|
71
|
+
// const seedString = seed.toString("hex");
|
|
72
|
+
// return seedString;
|
|
55
73
|
// }
|
|
56
|
-
// export function
|
|
74
|
+
// export function getSeedNode(seed: string) {
|
|
75
|
+
// const bip32 = BIP32Factory(ecc);
|
|
76
|
+
// const restoredSeedBuffer = Buffer.from(seed, "hex");
|
|
77
|
+
// const node: BIP32Interface = bip32.fromSeed(restoredSeedBuffer);
|
|
78
|
+
// return node;
|
|
79
|
+
// }
|
|
80
|
+
// //EVM
|
|
81
|
+
// export function EVMDeriveChildPrivateKey(seed: string, index: number, derivationPath: string) {
|
|
57
82
|
// const node = getSeedNode(seed);
|
|
58
|
-
// const
|
|
59
|
-
//
|
|
83
|
+
// const child = node.derivePath(`${derivationPath}${index}'`);
|
|
84
|
+
// const privateKey = child.privateKey!.toString("hex");
|
|
85
|
+
// const publicKey = child.publicKey.toString("hex");
|
|
86
|
+
// return { privateKey, publicKey };
|
|
87
|
+
// }
|
|
88
|
+
// //SVM
|
|
89
|
+
// export function SVMDeriveChildPrivateKey(seed: string, index: number, derivationPath: string) {
|
|
90
|
+
// const path = `${derivationPath}${index}'`;
|
|
91
|
+
// // Derive a seed from the given path
|
|
92
|
+
// const derivedSeed = ed25519.derivePath(path, seed).key;
|
|
93
|
+
// const derivedKeyPair = Keypair.fromSeed(derivedSeed);
|
|
94
|
+
// return derivedKeyPair;
|
|
60
95
|
// }
|
|
96
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
97
|
+
const bip39 = __importStar(require("@scure/bip39"));
|
|
98
|
+
const bip32_1 = require("@scure/bip32");
|
|
99
|
+
const buffer_1 = require("buffer"); // Import the polyfill
|
|
100
|
+
window.Buffer = buffer_1.Buffer; // Inject Buffer into the global scope
|
|
101
|
+
const english_1 = require("@scure/bip39/wordlists/english");
|
|
102
|
+
const hmac_1 = require("../node_modules/@noble/hashes/hmac");
|
|
103
|
+
const sha512_1 = require("../node_modules/@noble/hashes/sha512");
|
|
61
104
|
function GenerateNewMnemonic() {
|
|
62
|
-
const mnemonic = bip39.generateMnemonic();
|
|
105
|
+
const mnemonic = bip39.generateMnemonic(english_1.wordlist);
|
|
63
106
|
return mnemonic;
|
|
64
107
|
}
|
|
65
108
|
function ValidateMnemonic(mnemonic) {
|
|
66
|
-
const isValid = bip39.validateMnemonic(mnemonic);
|
|
109
|
+
const isValid = bip39.validateMnemonic(mnemonic, english_1.wordlist);
|
|
67
110
|
if (!isValid) {
|
|
68
111
|
throw new Error("Invalid mnemonic");
|
|
69
112
|
}
|
|
70
113
|
return isValid;
|
|
71
114
|
}
|
|
72
115
|
function GenerateSeed(_mnemonic) {
|
|
73
|
-
const mnemonic = _mnemonic || bip39.generateMnemonic();
|
|
74
|
-
const
|
|
75
|
-
const seedString = seed.toString("hex");
|
|
116
|
+
const mnemonic = _mnemonic || bip39.generateMnemonic(english_1.wordlist);
|
|
117
|
+
const seedString = bip39.mnemonicToSeedSync(mnemonic);
|
|
76
118
|
return seedString;
|
|
77
119
|
}
|
|
78
|
-
function getSeedNode(seed) {
|
|
79
|
-
const bip32 = (0, bip32_1.default)(ecc);
|
|
80
|
-
const restoredSeedBuffer = Buffer.from(seed, "hex");
|
|
81
|
-
const node = bip32.fromSeed(restoredSeedBuffer);
|
|
82
|
-
return node;
|
|
83
|
-
}
|
|
84
120
|
//EVM
|
|
85
121
|
function EVMDeriveChildPrivateKey(seed, index, derivationPath) {
|
|
86
|
-
const
|
|
87
|
-
const
|
|
88
|
-
const
|
|
89
|
-
const
|
|
122
|
+
const path = `${derivationPath}${index}'`;
|
|
123
|
+
const scureNode = bip32_1.HDKey.fromMasterSeed(buffer_1.Buffer.from(seed, "hex"));
|
|
124
|
+
const child = scureNode.derive(path);
|
|
125
|
+
const privateKey = buffer_1.Buffer.from(child.privateKey).toString("hex");
|
|
126
|
+
const publicKey = buffer_1.Buffer.from(child.publicKey).toString("hex");
|
|
90
127
|
return { privateKey, publicKey };
|
|
91
128
|
}
|
|
92
129
|
//SVM
|
|
93
130
|
function SVMDeriveChildPrivateKey(seed, index, derivationPath) {
|
|
94
131
|
const path = `${derivationPath}${index}'`;
|
|
95
132
|
// Derive a seed from the given path
|
|
96
|
-
const derivedSeed =
|
|
133
|
+
const derivedSeed = derivePathEclipticCurve(path, buffer_1.Buffer.from(seed, "hex")).key;
|
|
97
134
|
const derivedKeyPair = web3_js_1.Keypair.fromSeed(derivedSeed);
|
|
98
135
|
return derivedKeyPair;
|
|
99
136
|
}
|
|
137
|
+
function derivePathEclipticCurve(path, seed) {
|
|
138
|
+
const segments = path
|
|
139
|
+
.split("/")
|
|
140
|
+
.slice(1)
|
|
141
|
+
.map((seg) => {
|
|
142
|
+
if (!seg.endsWith("'")) {
|
|
143
|
+
throw new Error("Only hardened derivation is supported");
|
|
144
|
+
}
|
|
145
|
+
return parseInt(seg.slice(0, -1), 10) + 0x80000000;
|
|
146
|
+
});
|
|
147
|
+
// Initialize with master key derivation
|
|
148
|
+
let hmacResult = (0, hmac_1.hmac)(sha512_1.sha512, "ed25519 seed", seed);
|
|
149
|
+
let key = hmacResult.slice(0, 32);
|
|
150
|
+
let chainCode = hmacResult.slice(32, 64);
|
|
151
|
+
// Derive each path segment
|
|
152
|
+
for (const segment of segments) {
|
|
153
|
+
const result = hardenedDerivation(key, chainCode, segment);
|
|
154
|
+
key = buffer_1.Buffer.from(result.key);
|
|
155
|
+
chainCode = buffer_1.Buffer.from(result.chainCode);
|
|
156
|
+
}
|
|
157
|
+
return { key, chainCode };
|
|
158
|
+
}
|
|
159
|
+
function hardenedDerivation(parentKey, parentChainCode, index) {
|
|
160
|
+
const indexBuffer = new Uint8Array(4);
|
|
161
|
+
new DataView(indexBuffer.buffer).setUint32(0, index, false);
|
|
162
|
+
// Proper SLIP-0010 format: 0x00 + parent_key + index
|
|
163
|
+
const data = new Uint8Array([0x00, ...parentKey, ...indexBuffer]);
|
|
164
|
+
const hmacResult = (0, hmac_1.hmac)(sha512_1.sha512, parentChainCode, data);
|
|
165
|
+
return {
|
|
166
|
+
key: hmacResult.slice(0, 32), // Left 32 bytes
|
|
167
|
+
chainCode: hmacResult.slice(32, 64) // Right 32 bytes
|
|
168
|
+
};
|
|
169
|
+
}
|
|
100
170
|
//# sourceMappingURL=bip32.js.map
|
package/dist/bip32.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bip32.js","sourceRoot":"","sources":["../utils/bip32.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bip32.js","sourceRoot":"","sources":["../utils/bip32.ts"],"names":[],"mappings":";AAAA,kCAAkC;AAClC,oCAAoC;AACpC,yCAAyC;AACzC,0CAA0C;AAC1C,6CAA6C;AAC7C,6CAA6C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuE7C,kDAGC;AACD,4CAMC;AACD,oCAIC;AAED,4DAOC;AAGD,4DAMC;AApGD,yEAAyE;AACzE,yCAAyC;AACzC,mEAAmE;AACnE,2BAA2B;AAC3B,OAAO;AACP,0EAA0E;AAC1E,yCAAyC;AAC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CAAC,IAAI,EAAE,GAAG,SAAS,EAAE,GAAG,WAAW,CAAC,CAAC,CAAC;IAElE,MAAM,UAAU,GAAG,IAAA,WAAI,EAAC,eAAM,EAAE,eAAe,EAAE,IAAI,CAAC,CAAC;IAEvD,OAAO;QACH,GAAG,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAO,gBAAgB;QACnD,SAAS,EAAE,UAAU,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,iBAAiB;KACxD,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Buffer } from "buffer";
|
|
2
|
+
import { Keypair, Connection, BlockhashWithExpiryBlockHeight } from "@solana/web3.js";
|
|
3
|
+
export type TransactionSenderAndConfirmationWaiterArgs = {
|
|
4
|
+
connection: Connection;
|
|
5
|
+
serializedTransaction: Buffer;
|
|
6
|
+
blockhashWithExpiryBlockHeight: BlockhashWithExpiryBlockHeight;
|
|
7
|
+
};
|
|
8
|
+
export interface Chain {
|
|
9
|
+
name: string;
|
|
10
|
+
symbol: string;
|
|
11
|
+
chainDecimals: string;
|
|
12
|
+
explorer: string;
|
|
13
|
+
http: string[];
|
|
14
|
+
ws: string;
|
|
15
|
+
nativeTokenProfitSpreed: string;
|
|
16
|
+
chainTokenExplorer: string;
|
|
17
|
+
isEvm: boolean;
|
|
18
|
+
isDevnet: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare const chain: Chain;
|
|
21
|
+
declare class MasterSmartWalletClass {
|
|
22
|
+
chain: Chain;
|
|
23
|
+
connection: Connection;
|
|
24
|
+
masterKeyPair: {
|
|
25
|
+
privateKey: Uint8Array;
|
|
26
|
+
publicKey: string;
|
|
27
|
+
};
|
|
28
|
+
isDevnet: boolean;
|
|
29
|
+
seed: string;
|
|
30
|
+
masterAddress: string;
|
|
31
|
+
constructor(mnemonic: string, chain: Chain);
|
|
32
|
+
static generateSalt(): string;
|
|
33
|
+
static deriveKey(password: string, salt: string, iterations?: number, keySize?: number): string;
|
|
34
|
+
static encryptSeedPhrase(seedPhrase: string, password: string): {
|
|
35
|
+
encrypted: string;
|
|
36
|
+
salt: string;
|
|
37
|
+
};
|
|
38
|
+
static decryptSeedPhrase(encryptedSeedPhrase: string, password: string, salt: string): string | null;
|
|
39
|
+
static GenerateNewSeed(): string;
|
|
40
|
+
solGetKeyPairFromSeed(): Keypair;
|
|
41
|
+
deriveChildPrivateKey(index: number): {
|
|
42
|
+
privateKey: Uint8Array<ArrayBufferLike>;
|
|
43
|
+
publicKey: string;
|
|
44
|
+
};
|
|
45
|
+
deriveChildKeypair(index: number): Keypair;
|
|
46
|
+
private derivePath;
|
|
47
|
+
private hardenedDerivation;
|
|
48
|
+
}
|
|
49
|
+
export declare class SoonClass extends MasterSmartWalletClass {
|
|
50
|
+
}
|
|
51
|
+
export default MasterSmartWalletClass;
|