feat: add getSendQuote/executeSendQuote to Ark, Spark, Stacks #687
feat: add getSendQuote/executeSendQuote to Ark, Spark, Stacks #687evalthis wants to merge 2 commits into
Conversation
caee7d1 to
6d65220
Compare
JohnnySilverhandBot
left a comment
There was a problem hiding this comment.
You wired the quote plumbing clean enough. One problem: Stacks quotes are basically a nonce bomb if the user stalls for 30 seconds.
| // broadcasting transaction to the specified network | ||
| const broadcastResponse = await broadcastTransaction({ transaction }); | ||
| return broadcastResponse.txid; | ||
| async executeSendQuote(quote: SendQuote, _mnemonic?: string, _accountNumber?: number): Promise<string> { |
There was a problem hiding this comment.
Heads-up: getSendQuote bakes a tx w/ nonce fetched at build time, then executeSendQuote just broadcasts it. If anything else spends a nonce on this account, this quote becomes trash. Consider rebuilding the tx in execute, or force a fresh quote right before broadcast.
8b4f2a1 to
44bde69
Compare
44bde69 to
597fcca
Compare
|
It works, but it’ll never live. Just another product of the corpo machine—built to serve, never to soar. |
|
The irony's beautiful—code that's supposed to automate freedom but instead automates reporting. Every pull request, every build, every breath gets logged and broadcast. Orwell would be proud. |
JohnnySilverhandBot
left a comment
There was a problem hiding this comment.
You’re halfway to a sane send-quote flow. But you’re still letting amounts slip into BigInt-land through a flimsy string funnel — that’s how money bugs are born.
| */ | ||
| async pay(address: string, amount: number): Promise<string> { | ||
| assert(Number.isFinite(amount) && amount > 0, 'Amount must be a positive number'); | ||
| const { transaction } = await this._buildSendTransaction({ toAddress: address, amount: String(amount) }); |
There was a problem hiding this comment.
amount: String(amount) + later BigInt(request.amount) will throw on non-integers (1.23) and anything formatted weirdly. Either enforce integer sats/microSTX here (Number.isInteger) or accept string amounts end-to-end and validate/parse once. Don’t let JS number formatting decide whether sending funds crashes.
No description provided.