nous-token 0.2.0 → 0.2.1
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/PROTOCOL.md +1 -1
- package/cli/setup.ts +9 -1
- package/package.json +1 -1
package/PROTOCOL.md
CHANGED
|
@@ -87,7 +87,7 @@ Users identify themselves with an Ethereum wallet address. The wallet is the per
|
|
|
87
87
|
|
|
88
88
|
### Binding rules
|
|
89
89
|
|
|
90
|
-
- **First bind wins**: Once a hash is linked to a wallet, it cannot be relinked to a different wallet. This prevents rebinding with expired or leaked API keys.
|
|
90
|
+
- **First bind wins**: Once a hash is linked to a wallet, it cannot be relinked to a different wallet. This prevents rebinding with expired or leaked API keys. Binding is irreversible — verify your wallet address before your first API call through the gateway.
|
|
91
91
|
- **Multiple hashes per wallet**: A user can link multiple API keys (hashes) to the same wallet. The leaderboard aggregates all hashes under one wallet.
|
|
92
92
|
- **Wallet validation**: Must be a valid Ethereum address (`0x` + 40 hex chars). Invalid addresses are silently ignored.
|
|
93
93
|
|
package/cli/setup.ts
CHANGED
|
@@ -202,7 +202,15 @@ let wallet = loadWallet();
|
|
|
202
202
|
const walletArg = process.argv.find(a => /^0x[a-fA-F0-9]{40}$/.test(a));
|
|
203
203
|
if (walletArg) {
|
|
204
204
|
wallet = walletArg.toLowerCase();
|
|
205
|
-
} else if (
|
|
205
|
+
} else if (wallet) {
|
|
206
|
+
// Existing wallet — ask user to confirm or change
|
|
207
|
+
const input = await ask(` Wallet [${wallet.slice(0, 6)}...${wallet.slice(-4)}] (press Enter to keep, or paste new): `);
|
|
208
|
+
if (input && /^0x[a-fA-F0-9]{40}$/.test(input)) {
|
|
209
|
+
wallet = input.toLowerCase();
|
|
210
|
+
} else if (input) {
|
|
211
|
+
console.log(" \x1b[33mInvalid address format. Keeping current wallet.\x1b[0m");
|
|
212
|
+
}
|
|
213
|
+
} else {
|
|
206
214
|
const input = await ask(" Wallet address (0x...): ");
|
|
207
215
|
if (/^0x[a-fA-F0-9]{40}$/.test(input)) {
|
|
208
216
|
wallet = input.toLowerCase();
|