repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
public Clawd ADK gateway launch mirror
stars
latest
clone command
git clone gitlawb://did:key:z6Mkq5mY...iFZ5/my-project-publ...git clone gitlawb://did:key:z6Mkq5mY.../my-project-publ...2fa351d6docs: add automaton and perps launch sources16d ago| #1 | import chalk from 'chalk'; |
| #2 | import { readVaultInfo, shortAddress, type VaultInfo } from '../sdk.js'; |
| #3 | |
| #4 | export async function runWallet(): Promise<void> { |
| #5 | process.stdout.write('\x1b[2J\x1b[H'); |
| #6 | process.stdout.write(chalk.cyanBright.bold('\n Wallet\n\n')); |
| #7 | |
| #8 | const vault = await readVaultInfo(); |
| #9 | renderVault(vault); |
| #10 | |
| #11 | process.stdout.write('\n'); |
| #12 | process.stdout.write(chalk.gray(' Wallet funding flows live in the packaged clawd CLI:\n')); |
| #13 | process.stdout.write(chalk.cyan(' clawd fund <usdc_amount>\n')); |
| #14 | process.stdout.write(chalk.cyan(' clawd feed <clawd_amount>\n\n')); |
| #15 | process.stdout.write(chalk.gray(' Press any key to return.\n')); |
| #16 | await waitForAnyKey(); |
| #17 | } |
| #18 | |
| #19 | function renderVault(vault: VaultInfo): void { |
| #20 | process.stdout.write(chalk.white.bold(' Agentwallet Vault\n')); |
| #21 | process.stdout.write(chalk.gray(` Path: ${vault.path || '(not resolved)'}\n`)); |
| #22 | |
| #23 | if (!vault.available) { |
| #24 | process.stdout.write(chalk.red(` Status: unavailable${vault.error ? ` (${vault.error})` : ''}\n`)); |
| #25 | return; |
| #26 | } |
| #27 | |
| #28 | process.stdout.write(chalk.green(` Status: online · ${vault.wallets.length} wallet(s)\n\n`)); |
| #29 | |
| #30 | if (vault.wallets.length === 0) { |
| #31 | process.stdout.write(chalk.yellow(' No vault wallets found.\n')); |
| #32 | return; |
| #33 | } |
| #34 | |
| #35 | process.stdout.write(chalk.gray(' Label Chain Address Status\n')); |
| #36 | process.stdout.write(chalk.gray(' ' + '-'.repeat(68) + '\n')); |
| #37 | |
| #38 | for (const wallet of vault.wallets.slice(0, 8)) { |
| #39 | const label = wallet.label.slice(0, 22).padEnd(22); |
| #40 | const chain = wallet.chainType.slice(0, 8).padEnd(8); |
| #41 | const status = wallet.paused ? chalk.red('paused') : chalk.green('active'); |
| #42 | process.stdout.write( |
| #43 | ` ${chalk.white(label)} ${chalk.cyan(chain)} ${chalk.yellow(shortAddress(wallet.address).padEnd(20))} ${status}\n`, |
| #44 | ); |
| #45 | } |
| #46 | |
| #47 | if (vault.wallets.length > 8) { |
| #48 | process.stdout.write(chalk.gray(` ... and ${vault.wallets.length - 8} more\n`)); |
| #49 | } |
| #50 | } |
| #51 | |
| #52 | function waitForAnyKey(): Promise<void> { |
| #53 | return new Promise(resolve => { |
| #54 | if (process.stdin.setRawMode) process.stdin.setRawMode(true); |
| #55 | process.stdin.resume(); |
| #56 | process.stdin.once('data', () => { |
| #57 | if (process.stdin.setRawMode) process.stdin.setRawMode(false); |
| #58 | resolve(); |
| #59 | }); |
| #60 | }); |
| #61 | } |
| #62 |