@solard/cli 0.2.15 → 0.2.17
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/package.json +4 -3
- package/src/accounting-commands.ts +621 -0
- package/src/backtest-batch-command.ts +1 -1
- package/src/backtest-command.ts +1 -1
- package/src/commands/buy.ts +1 -1
- package/src/commands/jupiter-swap.ts +1 -1
- package/src/commands/sell.ts +1 -1
- package/src/commands/trade-result.ts +5 -1
- package/src/commands/trade-targets.ts +1 -1
- package/src/commands/trade-venue.ts +1 -1
- package/src/commands/transfer.ts +1 -1
- package/src/fairfun-commands.ts +245 -65
- package/src/index.ts +198 -52
- package/src/meteora-commands.ts +1 -1
- package/src/pump/external-deployment-cli.ts +1 -1
- package/src/pump/spam-buy-cli.ts +1 -1
- package/src/pump/token-launch-cli.ts +3 -3
- package/src/pump/vamp-cli.ts +1 -1
- package/src/raydium-commands.ts +1 -1
- package/src/refs.ts +1 -1
- package/src/token-history-command.ts +11 -33
- package/src/vault-onboarding.ts +6 -23
package/src/vault-onboarding.ts
CHANGED
|
@@ -115,40 +115,23 @@ async function confirmNewPassword(): Promise<string> {
|
|
|
115
115
|
|
|
116
116
|
async function validateAllStoredWallets(password: string): Promise<void> {
|
|
117
117
|
setMasterKey(password);
|
|
118
|
-
const { createTraderSolard } = await import("@solard/
|
|
118
|
+
const { createTraderSolard } = await import("@solard/core");
|
|
119
119
|
const probe = createTraderSolard();
|
|
120
120
|
try {
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
.orderBy("id", "asc")
|
|
124
|
-
.all() as Array<{
|
|
125
|
-
name: string;
|
|
126
|
-
address: string;
|
|
127
|
-
}>;
|
|
128
|
-
if (!wallets.length) return;
|
|
129
|
-
const failures: Array<{ name: string; address: string }> = [];
|
|
130
|
-
let decrypted = 0;
|
|
131
|
-
for (const wallet of wallets) {
|
|
132
|
-
try {
|
|
133
|
-
probe.wallets.signer(wallet.address);
|
|
134
|
-
decrypted += 1;
|
|
135
|
-
} catch {
|
|
136
|
-
failures.push({ name: wallet.name, address: wallet.address });
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
if (!failures.length) return;
|
|
121
|
+
const integrity = probe.wallets.integrity();
|
|
122
|
+
if (!integrity.failures.length) return;
|
|
140
123
|
clearMasterKey();
|
|
141
|
-
if (decrypted === 0) {
|
|
124
|
+
if (integrity.decrypted === 0) {
|
|
142
125
|
throw new VaultOnboardingError(
|
|
143
126
|
"That wallet password could not decrypt the stored wallet database.",
|
|
144
127
|
);
|
|
145
128
|
}
|
|
146
|
-
const affected = failures
|
|
129
|
+
const affected = integrity.failures
|
|
147
130
|
.map((wallet) => `@${wallet.name} ${wallet.address}`)
|
|
148
131
|
.join(", ");
|
|
149
132
|
throw new VaultIntegrityError(
|
|
150
133
|
`Wallet database integrity check failed: one master password must decrypt every stored signing wallet. ` +
|
|
151
|
-
`Decrypted ${decrypted}/${
|
|
134
|
+
`Decrypted ${integrity.decrypted}/${integrity.total}; undecryptable or mismatched: ${affected}`,
|
|
152
135
|
);
|
|
153
136
|
} finally {
|
|
154
137
|
probe.close();
|