MCPcopy Index your code
hub / github.com/codeaashu/claude-code / handleStatus

Function handleStatus

src/commands/x402/x402.ts:98–126  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

96}
97
98function handleStatus(): string {
99 const config = getX402Config()
100 const address = getX402WalletAddress()
101 const enabled = isX402Enabled()
102 const sessionSpent = getX402SessionSpentUSD()
103 const paymentCount = getX402PaymentCount()
104
105 const lines: string[] = []
106 lines.push('x402 Payment Status')
107 lines.push('─'.repeat(40))
108 lines.push(`Enabled: ${config.enabled ? 'Yes' : 'No'}`)
109 lines.push(`Wallet: ${address ?? 'Not configured'}`)
110 lines.push(`Network: ${config.network}`)
111 lines.push(`Max per request: $${config.maxPaymentPerRequestUSD.toFixed(2)}`)
112 lines.push(`Max per session: $${config.maxSessionSpendUSD.toFixed(2)}`)
113 lines.push(`Ready: ${enabled ? 'Yes' : 'No (need wallet + enabled)'}`)
114 lines.push('')
115 lines.push('Session:')
116 lines.push(` Payments: ${paymentCount}`)
117 lines.push(` Total spent: $${sessionSpent.toFixed(4)}`)
118
119 const x402Summary = formatX402Cost()
120 if (x402Summary) {
121 lines.push('')
122 lines.push(x402Summary)
123 }
124
125 return lines.join('\n')
126}
127
128function handleSetLimit(args: string): string {
129 const parts = args.trim().split(/\s+/)

Callers 1

callFunction · 0.85

Calls 7

getX402ConfigFunction · 0.85
getX402WalletAddressFunction · 0.85
isX402EnabledFunction · 0.85
getX402SessionSpentUSDFunction · 0.85
getX402PaymentCountFunction · 0.85
formatX402CostFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected