@deserialize/multi-vm-wallet 1.5.34 → 1.5.35
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/svm/svm.d.ts +1 -0
- package/dist/svm/svm.js +3 -0
- package/package.json +1 -1
- package/utils/svm/svm.ts +5 -1
package/dist/svm/svm.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export declare class SVMVM extends VM<PublicKey, Keypair, Connection> {
|
|
|
20
20
|
constructor(seed: string);
|
|
21
21
|
static getNativeBalance(address: PublicKey, connection: Connection): Promise<Balance>;
|
|
22
22
|
static getTokenBalance(address: PublicKey, tokenAddress: PublicKey, connection: Connection): Promise<Balance>;
|
|
23
|
+
static generateMnemonicFromPrivateKey(privateKey: Keypair): string;
|
|
23
24
|
static signAndSendTransaction: (transaction: VersionedTransaction | Transaction, connection: Connection, signers: Keypair, options?: {
|
|
24
25
|
partialSign?: boolean;
|
|
25
26
|
feePayerSigner?: Keypair;
|
package/dist/svm/svm.js
CHANGED
|
@@ -75,6 +75,9 @@ class SVMVM extends vm_1.VM {
|
|
|
75
75
|
}
|
|
76
76
|
return { balance: new bn_js_1.default(balance.amount), formatted: balance.uiAmount || parseInt(balance.amount) / 10 ** balance.decimals, decimal: balance.decimals };
|
|
77
77
|
}
|
|
78
|
+
static generateMnemonicFromPrivateKey(privateKey) {
|
|
79
|
+
return (0, walletBip32_1.EntropyToMnemonic)(bs58_1.default.encode(privateKey.secretKey));
|
|
80
|
+
}
|
|
78
81
|
static signAndSendTransaction = utils_1.signAndSendTransaction;
|
|
79
82
|
static signTransaction = utils_1.signTransaction;
|
|
80
83
|
static sendTransaction = utils_1.sendTransaction;
|
package/package.json
CHANGED
package/utils/svm/svm.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComputeBudgetProgram, Connection, Keypair, PublicKey, Transaction, VersionedTransaction } from "@solana/web3.js";
|
|
2
|
-
import { SVMDeriveChildPrivateKey } from "../walletBip32";
|
|
2
|
+
import { EntropyToMnemonic, SVMDeriveChildPrivateKey } from "../walletBip32";
|
|
3
3
|
import { VM } from "../vm";
|
|
4
4
|
import { ChainAddress, ChainWallet } from "../IChainWallet";
|
|
5
5
|
import { Balance, ChainWalletConfig, UserTokenBalance, TokenInfo, TransactionResult, NFT, DiscoveredWallet, WalletDiscoveryOptions, WalletDiscoveryResult, PocketDiscoveryOptions } from "../types";
|
|
@@ -185,6 +185,10 @@ export class SVMVM extends VM<PublicKey, Keypair, Connection> {
|
|
|
185
185
|
}
|
|
186
186
|
return { balance: new BN(balance.amount), formatted: balance.uiAmount || parseInt(balance.amount) / 10 ** balance.decimals, decimal: balance.decimals };
|
|
187
187
|
}
|
|
188
|
+
static generateMnemonicFromPrivateKey(privateKey: Keypair): string {
|
|
189
|
+
|
|
190
|
+
return EntropyToMnemonic(base58.encode(privateKey.secretKey))
|
|
191
|
+
}
|
|
188
192
|
|
|
189
193
|
static signAndSendTransaction = signAndSendTransaction
|
|
190
194
|
|