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

Function handleSetLimit

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

Source from the content-addressed store, hash-verified

126}
127
128function handleSetLimit(args: string): string {
129 const parts = args.trim().split(/\s+/)
130 const amount = parseFloat(parts[1] ?? '')
131
132 if (isNaN(amount) || amount <= 0) {
133 return 'Usage: /x402 set-limit <amount>\nAmount must be a positive number (USD).\nExample: /x402 set-limit 0.25'
134 }
135
136 try {
137 setX402MaxPayment(amount)
138 return `Max payment per request set to $${amount.toFixed(2)}`
139 } catch (err) {
140 return `Error: ${err instanceof Error ? err.message : String(err)}`
141 }
142}
143
144function handleSetSession(args: string): string {
145 const parts = args.trim().split(/\s+/)

Callers 1

callFunction · 0.85

Calls 1

setX402MaxPaymentFunction · 0.85

Tested by

no test coverage detected