MCPcopy Create free account
hub / github.com/codeaashu/claude-code / handleSetSession

Function handleSetSession

src/commands/x402/x402.ts:144–158  ·  view source on GitHub ↗
(args: string)

Source from the content-addressed store, hash-verified

142}
143
144function handleSetSession(args: string): string {
145 const parts = args.trim().split(/\s+/)
146 const amount = parseFloat(parts[1] ?? '')
147
148 if (isNaN(amount) || amount <= 0) {
149 return 'Usage: /x402 set-session <amount>\nAmount must be a positive number (USD).\nExample: /x402 set-session 10.00'
150 }
151
152 try {
153 setX402MaxSessionSpend(amount)
154 return `Max session spend set to $${amount.toFixed(2)}`
155 } catch (err) {
156 return `Error: ${err instanceof Error ? err.message : String(err)}`
157 }
158}
159
160function handleNetwork(args: string): string {
161 const parts = args.trim().split(/\s+/)

Callers 1

callFunction · 0.85

Calls 1

setX402MaxSessionSpendFunction · 0.85

Tested by

no test coverage detected