zoa-wallet 0.2.5 → 0.2.6
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/index.mjs +25 -10
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -22279,6 +22279,10 @@ async function updateWallet(id, updates) {
|
|
|
22279
22279
|
wallet.label = updates.label;
|
|
22280
22280
|
if (updates.color !== void 0)
|
|
22281
22281
|
wallet.color = updates.color;
|
|
22282
|
+
if (updates.evmAddress !== void 0)
|
|
22283
|
+
wallet.evmAddress = updates.evmAddress;
|
|
22284
|
+
if (updates.solanaAddress !== void 0)
|
|
22285
|
+
wallet.solanaAddress = updates.solanaAddress;
|
|
22282
22286
|
await saveConfig(config);
|
|
22283
22287
|
}
|
|
22284
22288
|
|
|
@@ -47800,6 +47804,10 @@ async function loadActiveWallet(password) {
|
|
|
47800
47804
|
const entry = (config.wallets ?? []).find((w) => w.id === wallet.id);
|
|
47801
47805
|
if (entry) {
|
|
47802
47806
|
entry.lastUsedAt = Date.now();
|
|
47807
|
+
if (!entry.evmAddress || !entry.solanaAddress) {
|
|
47808
|
+
entry.evmAddress = account.evmAddress;
|
|
47809
|
+
entry.solanaAddress = account.solanaAddress;
|
|
47810
|
+
}
|
|
47803
47811
|
await saveConfig(config);
|
|
47804
47812
|
}
|
|
47805
47813
|
return { keyring: kr, wallet, account };
|
|
@@ -48256,18 +48264,20 @@ function registerInitCommand(program2) {
|
|
|
48256
48264
|
const storage = new FileStorage();
|
|
48257
48265
|
const kr = createKeyring(storage, vaultKey);
|
|
48258
48266
|
await kr.initialize(mnemonic, password);
|
|
48267
|
+
const accounts = kr.getAccounts();
|
|
48268
|
+
const firstAccount = accounts[0];
|
|
48259
48269
|
await addWallet({
|
|
48260
48270
|
id: walletId,
|
|
48261
48271
|
label: "Default Wallet",
|
|
48262
48272
|
color: "#00bbf9",
|
|
48263
48273
|
vaultKey,
|
|
48264
|
-
createdAt: Date.now()
|
|
48274
|
+
createdAt: Date.now(),
|
|
48275
|
+
evmAddress: firstAccount?.evmAddress,
|
|
48276
|
+
solanaAddress: firstAccount?.solanaAddress
|
|
48265
48277
|
});
|
|
48266
48278
|
await setActiveWallet(walletId);
|
|
48267
48279
|
if (!isJsonMode())
|
|
48268
48280
|
spinner.succeed(" Wallet initialized successfully!");
|
|
48269
|
-
const accounts = kr.getAccounts();
|
|
48270
|
-
const firstAccount = accounts[0];
|
|
48271
48281
|
if (firstAccount) {
|
|
48272
48282
|
output({
|
|
48273
48283
|
success: true,
|
|
@@ -48599,7 +48609,8 @@ function registerWalletCommand(program2) {
|
|
|
48599
48609
|
activeWalletId: active?.id
|
|
48600
48610
|
}, () => {
|
|
48601
48611
|
console.log(sectionHeader("Wallets"));
|
|
48602
|
-
const
|
|
48612
|
+
const shortenAddr = (addr) => addr ? `${addr.slice(0, 4)}...${addr.slice(-4)}` : "\u2014";
|
|
48613
|
+
const table = createTable(["", "Label", "ID", "EVM Address", "Solana Address", "Created", "Last Used"], [4, 22, 14, 14, 14, 14, 14]);
|
|
48603
48614
|
for (const w of wallets) {
|
|
48604
48615
|
const isActive = w.id === active?.id;
|
|
48605
48616
|
const dot = chalk3.hex(w.color)("\u25CF");
|
|
@@ -48611,6 +48622,8 @@ function registerWalletCommand(program2) {
|
|
|
48611
48622
|
`${dot}${indicator}`,
|
|
48612
48623
|
label,
|
|
48613
48624
|
colors.muted(w.id),
|
|
48625
|
+
colors.address(shortenAddr(w.evmAddress)),
|
|
48626
|
+
colors.address(shortenAddr(w.solanaAddress)),
|
|
48614
48627
|
colors.muted(created),
|
|
48615
48628
|
typeof lastUsed === "string" ? lastUsed : lastUsed
|
|
48616
48629
|
]);
|
|
@@ -48738,18 +48751,20 @@ function registerWalletCommand(program2) {
|
|
|
48738
48751
|
const storage = new FileStorage();
|
|
48739
48752
|
const kr = createKeyring(storage, vaultKey);
|
|
48740
48753
|
await kr.initialize(mnemonic, password);
|
|
48754
|
+
const accounts = kr.getAccounts();
|
|
48755
|
+
const firstAccount = accounts[0];
|
|
48741
48756
|
await addWallet({
|
|
48742
48757
|
id: walletId,
|
|
48743
48758
|
label,
|
|
48744
48759
|
color,
|
|
48745
48760
|
vaultKey,
|
|
48746
|
-
createdAt: Date.now()
|
|
48761
|
+
createdAt: Date.now(),
|
|
48762
|
+
evmAddress: firstAccount?.evmAddress,
|
|
48763
|
+
solanaAddress: firstAccount?.solanaAddress
|
|
48747
48764
|
});
|
|
48748
48765
|
await setActiveWallet(walletId);
|
|
48749
48766
|
if (!isJsonMode())
|
|
48750
48767
|
spinner.succeed(" Wallet created successfully!");
|
|
48751
|
-
const accounts = kr.getAccounts();
|
|
48752
|
-
const firstAccount = accounts[0];
|
|
48753
48768
|
if (firstAccount) {
|
|
48754
48769
|
output({
|
|
48755
48770
|
success: true,
|
|
@@ -48985,7 +49000,7 @@ var zoaGradient2 = gradient2([
|
|
|
48985
49000
|
"#c77dff"
|
|
48986
49001
|
]);
|
|
48987
49002
|
var subtleGradient = gradient2(["#6b7280", "#9ca3af", "#6b7280"]);
|
|
48988
|
-
var VERSION = "0.2.
|
|
49003
|
+
var VERSION = "0.2.6";
|
|
48989
49004
|
async function displayBanner() {
|
|
48990
49005
|
const banner = figlet.textSync("ZOA-wallet", { font: "ANSI Shadow" });
|
|
48991
49006
|
console.log();
|
|
@@ -48994,7 +49009,7 @@ async function displayBanner() {
|
|
|
48994
49009
|
console.log(subtleGradient(tagline));
|
|
48995
49010
|
console.log();
|
|
48996
49011
|
const versionBadge = chalk4.bgHex("#5e60ce").white.bold(` v${VERSION} `);
|
|
48997
|
-
const siteLink = chalk4.hex("#ff6b35")("wallet") + chalk4.hex("#00bbf9")(".zoa.fun");
|
|
49012
|
+
const siteLink = chalk4.white("https://") + chalk4.hex("#ff6b35")("wallet") + chalk4.hex("#00bbf9")(".zoa.fun");
|
|
48998
49013
|
const npmBadge = chalk4.hex("#cb3837")("npm") + chalk4.hex("#6b7280")(" zoa-wallet");
|
|
48999
49014
|
let walletIndicator = "";
|
|
49000
49015
|
try {
|
|
@@ -49023,7 +49038,7 @@ program.hook("preAction", async (_thisCommand, actionCommand) => {
|
|
|
49023
49038
|
}
|
|
49024
49039
|
}
|
|
49025
49040
|
});
|
|
49026
|
-
program.name("zoa").description("ZOA Wallet \u2014 API-First Crypto Wallet for Power-traders, Developers, & AI Agents").version("0.2.
|
|
49041
|
+
program.name("zoa").description("ZOA Wallet \u2014 API-First Crypto Wallet for Power-traders, Developers, & AI Agents").version("0.2.6");
|
|
49027
49042
|
registerInitCommand(program);
|
|
49028
49043
|
registerBalanceCommand(program);
|
|
49029
49044
|
registerSendCommand(program);
|
package/package.json
CHANGED