Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

feat(robinhood): add hood-pay, USDG checkout + payment links for Robinhood Chain

nirholasf2d954127aee
diff --git a/robinhood/hood-pay/.gitignore b/robinhood/hood-pay/.gitignore
new file mode 100644
index 000000000..e91ad5a6f
--- /dev/null
+++ b/robinhood/hood-pay/.gitignore
@@ -0,0 +1,13 @@
+node_modules/
+dist/
+contracts/out/
+contracts/cache/
+*.tgz
+*.log
+.env
+.env.*
+!.env.example
+examples/shop/*.sqlite
+examples/shop/*.sqlite-*
+tests/**/*.sqlite
+coverage/
diff --git a/robinhood/hood-pay/LICENSE b/robinhood/hood-pay/LICENSE
new file mode 100644
index 000000000..4216cf919
--- /dev/null
+++ b/robinhood/hood-pay/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2026 nirholas
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/robinhood/hood-pay/README.md b/robinhood/hood-pay/README.md
new file mode 100644
index 000000000..610d34870
--- /dev/null
+++ b/robinhood/hood-pay/README.md
@@ -0,0 +1,287 @@
+# hood-pay
+
+Stripe-Checkout-grade USDG payments on **Robinhood Chain** (chain ID 4663). Three pieces, each
+usable on its own:
+
+- **Core** (`hood-pay`): networks, the payment-request type + URL-fragment link codec, the
+ reference/dust attribution scheme, and unsigned-tx builders for direct ERC-20 transfers and
+ `HoodPayRouter`-mode payments.
+- **Widget** (`hood-pay/widget`, or the prebuilt `dist/hood-pay.min.js`): an embeddable checkout
+ that mounts on `[data-hoodpay]` elements or via `mountCheckout()`, no bundler required. It
+ drives wallet discovery and chain-add/switch through [`hood-connect`](../hood-connect), so it
+ never re-implements EIP-6963 or EIP-3085 itself.
+- **Verify** (`hood-pay/verify`, Node-only): a reorg-safe on-chain payment watcher, an idempotent
+ SQLite ledger, signed webhooks, and refund helpers for the merchant side.
+
+USDG (Robinhood Chain's dollar stablecoin) is a plain ERC-20: no memo field, no EIP-2612 permit.
+A bare `transfer` cannot say which invoice it settles. hood-pay solves that two ways: **router
+mode**, where the buyer pays through the stateless, non-custodial `HoodPayRouter` contract
+(`contracts/src/HoodPayRouter.sol`) which emits `PaymentReceived(reference, payer, payTo, token,
+amount)` for exact attribution regardless of amount; and **direct mode**, where the invoice
+amount itself is fingerprinted in USDG's unused low decimal digits (zero contracts, works with
+any ERC-20). See `src/reference.ts` for the full collision-probability math behind both.
+
+## Install
+
+```sh
+npm install hood-pay
+```
+
+`viem >= 2.55.0` is a peer dependency. [`hood-connect`](../hood-connect) (wallet discovery +
+chain add/switch) and [`hoodchain`](https://www.npmjs.com/package/hoodchain) (the Robinhood
+Chain address book and chain definitions) are regular dependencies and install automatically.
+
+## Quickstart
+
+### 1. Embeddable widget (`hood-pay/widget`)
+
+Script tag, no build step:
+
+```html
+<div data-hoodpay
+ data-pay-to="0x4022de2D36C334E73C7a108805Cea11C0564f402"
+ data-amount="25.00"
+ data-memo="Invoice 7"></div>
+<script src="https://unpkg.com/hood-pay/widget.js"></script>
+```
+
+Any element with `data-hoodpay` auto-mounts on load. Add `data-network="testnet"` for chain
+46630, or `data-reference` + `data-router` to pay through `HoodPayRouter` instead of a plain
+transfer. From a bundler, mount the same checkout programmatically and observe every state:
+
+```ts
+import { mountCheckout } from 'hood-pay/widget'
+
+const checkout = mountCheckout('#checkout', {
+ payTo: '0x4022de2D36C334E73C7a108805Cea11C0564f402',
+ amount: '25.00',
+ memo: 'Invoice 7',
+ onStateChange: (state) => console.log(state.step), // review, discovering, paying, success, ...
+ onSuccess: (receipt) => console.log(receipt.txHash, receipt.explorerUrl),
+ onError: (error) => console.error(error.message),
+})
+
+// Later: checkout.destroy()
+```
+
+The widget never holds keys or custodies funds: it only builds the unsigned `approve`/`transfer`/
+`pay` calls for the buyer's own EIP-6963 wallet to sign, via `hood-connect`'s wallet discovery.
+
+### 2. Payment links (core, `hood-pay`)
+
+A payment link encodes a `PaymentRequest` as a base64url JSON payload in the URL **fragment**
+(never sent to a server, so a hosted link page leaks nothing to its host):
+
+```ts
+import { paymentLinkUrl } from 'hood-pay'
+
+const url = paymentLinkUrl({
+ v: 1,
+ network: 'mainnet',
+ payTo: '0x4022de2D36C334E73C7a108805Cea11C0564f402',
+ amount: '25.00',
+ memo: 'invoice 7',
+})
+// https://nirholas.github.io/hood-pay/pay.html#1.eyJ2IjoxLCJuZXR3b3JrIjoibWFpbm5ldC...
+```
+
+or from the CLI:
+
+```sh
+npx hood-pay link --to 0x4022de2D36C334E73C7a108805Cea11C0564f402 --amount 25 --memo "invoice 7"
+```
+
+The default base URL (`https://nirholas.github.io/hood-pay/pay.html`) is a real page in this repo
+(`docs/pay.html`, published to GitHub Pages from `docs/`): it decodes the fragment client-side,
+mounts the checkout, and never sends the payment request to any server. `docs/index.html` is the
+landing page and `docs/hood-pay.min.js` is the compiled widget both pages load (regenerated by
+`npm run build`). To self-host instead, point `paymentLinkUrl`'s second argument at your own static
+page - it only needs to decode the fragment and mount the widget, no server involved:
+
+```html
+<!doctype html>
+<div id="checkout"></div>
+<script type="module">
+ import { decodePaymentRequest, mountCheckout } from 'https://esm.sh/hood-pay/widget'
+
+ const request = decodePaymentRequest(location.hash)
+ mountCheckout('#checkout', request)
+</script>
+```
+
+### 3. Merchant-side verification (`hood-pay/verify`, Node-only)
+
+Watch the chain for a payment, keep an idempotent ledger, and deliver a signed webhook when it
+settles:
+
+```ts
+import { createLedger, createReader, awaitPayment, createWebhookEmitter, toWebhookEvent } from 'hood-pay/verify'
+import { networkInfo } from 'hood-pay'
+
+const ledger = await createLedger('./data/hood-pay.sqlite') // Node >= 22.5 (node:sqlite)
+const payTo = '0x4022de2D36C334E73C7a108805Cea11C0564f402'
+const usdg = networkInfo('mainnet').usdg
+
+const invoice = ledger.createDirectInvoice({
+ network: 'mainnet',
+ payTo,
+ token: usdg.address,
+ baseRaw: 25_000000n, // 25.00 USDG; low 4 digits reserved for the fingerprint
+})
+
+const reader = createReader('mainnet')
+const result = await awaitPayment(
+ { token: invoice.token, payTo: invoice.payTo, expectedRaw: invoice.expectedRaw },
+ { reader, fromBlock: await reader.getBlockNumber(), onState: (r) => ledger.setStatus(invoice.id, r.status) },
+)
+ledger.recordTransfer(invoice.id, result.transfers[0]!)
+
+const emitter = createWebhookEmitter({
+ url: 'https://merchant.example/webhooks/hood-pay',
+ secret: process.env.HOOD_PAY_WEBHOOK_SECRET!,
+})
+await emitter.emit(toWebhookEvent(`payment.${result.status}`, invoice.id, result))
+```
+
+Receive and verify that webhook on the merchant's server (any framework - this reads the raw
+body and the `hood-pay-signature` header):
+
+```ts
+import { verifyWebhookSignature, type WebhookEvent } from 'hood-pay/verify'
+
+app.post('/webhooks/hood-pay', express.text({ type: '*/*' }), (req, res) => {
+ const signature = req.header('hood-pay-signature')
+ if (!signature || !verifyWebhookSignature(process.env.HOOD_PAY_WEBHOOK_SECRET!, req.body, signature)) {
+ return res.status(400).send('bad signature')
+ }
+ const event = JSON.parse(req.body) as WebhookEvent
+ if (event.type === 'payment.paid' || event.type === 'payment.overpaid') markOrderPaid(event.invoiceId)
+ res.sendStatus(200)
+})
+```
+
+`verifyWebhookSignature` is constant-time and rejects a stale timestamp (5 minute default
+tolerance) - but still treat the payload as a hint: the ledger/watcher above remain the source of
+truth for amounts.
+
+Or watch and verify a payment straight from the CLI, no code:
+
+```sh
+npx hood-pay verify --to 0x4022de2D36C334E73C7a108805Cea11C0564f402 --amount 25.0042
+```
+
+Run `hood-pay <command> --help` for every flag.
+
+## Reorg safety
+
+`awaitPayment`/`checkPayment` only ever scan blocks at depth `>= confirmations` below the chain
+head (default 30, about 3s of Robinhood Chain's ~100ms blocks), and every candidate log's block
+hash is re-fetched by number and compared before it counts - a block reorged out after the scan
+but before the re-check is dropped. A confirmed `PaymentResult` is stable under any reorg
+shallower than `confirmations` blocks.
+
+## Addresses are checksum-validated
+
+Every address accepted anywhere in this package (`payTo`, `token.address`, `router`) is validated
+against its EIP-55 checksum via viem's `getAddress`. A lowercase or fully-uppercase address is
+accepted as-is (it makes no checksum claim); a mixed-case address with even one wrong character
+throws, so a corrupted or mistyped merchant address is caught before a payment link is ever
+generated.
+
+## API
+
+### Core (`hood-pay`)
+
+| Export | Purpose |
+| --- | --- |
+| `networkInfo(network?)` | Resolve chain id, RPC/explorer URLs, and the USDG `PayToken` for `'mainnet'` (4663, default) or `'testnet'` (46630) |
+| `explorerTxUrl` / `explorerAddressUrl` | Blockscout links for a network |
+| `newReference()` / `isReference(v)` | 32-byte router-mode reference generation + validation |
+| `randomDust()` / `applyDust(base, dust)` / `splitDust(raw)` | Direct-mode amount-fingerprint helpers |
+| `directCollisionProbability(k)` / `referenceCollisionProbability(k)` | Birthday-bound collision math for `k` concurrent invoices |
+| `validatePaymentRequest(input)` | Parse + validate untrusted data into a `PaymentRequest`, checksumming every address |
+| `requestToken` / `requestRawAmount` / `formatRequestAmount` | Read a request's settlement token and amount |
+| `encodePaymentRequest` / `decodePaymentRequest` / `paymentLinkUrl` | The URL-fragment link codec |
+| `buildTransferTx` / `buildApproveTx` / `buildRouterPayTx` | Unsigned `{ to, data, value }` calls for any signer |
+| `erc20Abi` / `hoodPayRouterAbi` | ABI literals used throughout the package |
+
+### Verify (`hood-pay/verify`, Node-only)
+
+| Export | Purpose |
+| --- | --- |
+| `createReader(network, rpcUrl?)` | Build a `ChainReader` (viem public client) for the watcher |
+| `awaitPayment(spec, options)` | Poll until an invoice is `paid`/`overpaid`, or `expired` after `timeoutMs` |
+| `checkPayment(spec, options)` | One-shot historical scan (reconciliation/audits) |
+| `createLedger(path)` | Idempotent SQLite ledger: reserved dust fingerprints, monotonic status transitions, replay-safe transfer recording |
+| `createWebhookEmitter(options)` | Signed webhook delivery with retry on network errors and 5xx/429 |
+| `signWebhook` / `verifyWebhookSignature` | HMAC-SHA256 signature scheme, constant-time verify |
+| `toWebhookEvent(type, invoiceId, result)` | Serialize a `PaymentResult` (bigints as decimal strings) into the webhook wire shape |
+| `buildRefundTx` / `refundOverageTx` / `refundReceivedTx` | Unsigned refund transfers for any signer |
+| `sendRefund(wallet, call)` | Sign + broadcast a refund with a merchant-supplied viem `WalletClient` |
+
+### Widget (`hood-pay/widget`)
+
+| Export | Purpose |
+| --- | --- |
+| `mountCheckout(el, config)` | Mount the checkout; returns `{ request, destroy() }` |
+| `validateCheckoutConfig(config)` | Validate a raw config into `{ request, onSuccess?, onError?, onStateChange? }` |
+| `ensureStyles(doc?)` / `WIDGET_CSS` | The scoped `.hoodpay` stylesheet, injected once per document |
+| `decodePaymentRequest` / `encodePaymentRequest` / `paymentLinkUrl` | Re-exported from core, for building a link page without a second import |
+
+The IIFE build (`dist/hood-pay.min.js`, loaded via `hood-pay/widget.js`) additionally exposes
+`window.HoodPay = { version, mount, validateConfig, decodePaymentRequest, encodePaymentRequest, paymentLinkUrl }`
+and auto-mounts every `[data-hoodpay]` element on `DOMContentLoaded`.
+
+## Solidity
+
+`contracts/src/HoodPayRouter.sol` is the stateless, non-custodial router: `pay(token, payTo,
+amount, ref)` pulls `amount` of `token` from the caller straight to `payTo` via `transferFrom`
+(requires a prior `approve` - USDG has no permit) and emits `PaymentReceived`. It never holds a
+balance, has no owner, no pause, and no upgrade path; it tolerates non-reverting tokens that
+signal failure by returning `false` and legacy tokens that return no data at all.
+
+```sh
+npm run forge:build
+npm run forge:test # 10 unit/fuzz tests against a local EVM
+npm run forge:test:fork # + 2 read-only tests against live mainnet USDG (needs an RPC)
+```
+
+## Differences from hood-connect
+
+[`hood-connect`](../hood-connect) is generic dApp infrastructure: add-chain, connect, and the
+funding funnel, with no notion of an invoice or a checkout. hood-pay is the payments layer built
+on top of it - the widget calls straight into `hood-connect`'s `discoverWallets`/`ensureChain`
+rather than re-implementing wallet discovery, and adds everything a checkout needs that
+`hood-connect` deliberately does not: the reference/dust attribution scheme, payment-request
+validation and link encoding, a reorg-safe watcher, an idempotent ledger, signed webhooks, and
+refund helpers. Use `hood-connect` alone for "connect and fund a wallet"; add `hood-pay` when you
+need to accept and reconcile a specific payment.
+
+## Development
+
+```sh
+npm install
+npm test # unit tests (vitest)
+npm run test:live # live-network tests against Robinhood Chain mainnet
+npm run typecheck
+npm run build # tsup (., ./verify, ./widget) + the minified IIFE bundle, copied to docs/
+npm run forge:test # contracts/ (Foundry)
+```
+
+`createLedger` imports `node:sqlite` lazily and throws a clear error if it is unavailable: Node
+22.5-22.x needs `--experimental-sqlite`; it is stable without a flag from Node 23 on.
+
+## Notes
+
+- **Non-custodial, always.** hood-pay never holds a merchant's or a buyer's keys anywhere in the
+ package. The widget builds unsigned calls for the buyer's wallet; refunds build unsigned calls
+ for the merchant's own signer (`sendRefund` or any viem `WalletClient`).
+- **USDG is not a Stock Token.** hood-pay settles in USDG (or any ERC-20 a merchant configures)
+ only; it never touches Robinhood Chain's tokenized-equity Stock Tokens.
+- Not affiliated with Robinhood Markets, Inc.
+
+## License
+
+MIT, see [LICENSE](./LICENSE).
+
+Built by [nirholas](https://x.com/nichxbt) · [three.ws](https://three.ws)
diff --git a/robinhood/hood-pay/bin/hood-pay.mjs b/robinhood/hood-pay/bin/hood-pay.mjs
new file mode 100755
index 000000000..cf343d94c
--- /dev/null
+++ b/robinhood/hood-pay/bin/hood-pay.mjs
@@ -0,0 +1,158 @@
+#!/usr/bin/env node
+/**
+ * hood-pay CLI.
+ *
+ * hood-pay link --to 0x… --amount 25 --memo "invoice 7" hosted payment link
+ * hood-pay reference new router-mode reference
+ * hood-pay verify --to 0x… --amount 25.0042 [--from-block N] await a payment (read-only)
+ *
+ * Run `hood-pay <command> --help` for every flag.
+ */
+import { parseArgs } from 'node:util'
+
+const [, , command, ...rest] = process.argv
+
+function fail(message) {
+ console.error(`hood-pay: ${message}`)
+ process.exit(1)
+}
+
+function printHelp() {
+ console.log(`hood-pay - USDG checkout tooling for Robinhood Chain
+
+Usage:
+ hood-pay link --to 0x… --amount 25 [--memo "invoice 7"] [--network mainnet|testnet]
+ [--reference 0x… --router 0x…]
+ [--token-address 0x… --token-symbol SYM --token-decimals N]
+ [--base-url https://…/pay.html]
+ hood-pay reference
+ hood-pay verify --to 0x… --amount 25.0042 [--network mainnet|testnet] [--rpc-url URL]
+ [--reference 0x… --router 0x…] [--payer 0x…]
+ [--from-block N] [--confirmations 30] [--timeout-ms 600000]
+
+Commands:
+ link Print a hosted payment link (and its raw fragment) for a request.
+ reference Generate a fresh 32-byte router-mode reference.
+ verify Watch the chain (read-only) until the payment settles; exits 0 on
+ paid, 2 on overpaid, 3 on underpaid, 4 on expired.`)
+}
+
+if (!command || command === '--help' || command === '-h' || command === 'help') {
+ printHelp()
+ process.exit(command ? 0 : 1)
+}
+
+const core = await import('../dist/index.js')
+
+if (command === 'reference') {
+ console.log(core.newReference())
+ process.exit(0)
+}
+
+if (command === 'link') {
+ const { values } = parseArgs({
+ args: rest,
+ options: {
+ to: { type: 'string' },
+ amount: { type: 'string' },
+ memo: { type: 'string' },
+ network: { type: 'string', default: 'mainnet' },
+ reference: { type: 'string' },
+ router: { type: 'string' },
+ 'token-address': { type: 'string' },
+ 'token-symbol': { type: 'string' },
+ 'token-decimals': { type: 'string' },
+ 'base-url': { type: 'string', default: 'https://nirholas.github.io/hood-pay/pay.html' },
+ },
+ })
+ if (!values.to) fail('--to is required')
+ if (!values.amount) fail('--amount is required (a decimal like 25 or 12.50, or "dynamic")')
+ const request = {
+ v: 1,
+ network: values.network,
+ payTo: values.to,
+ amount: values.amount,
+ }
+ if (values.memo) request.memo = values.memo
+ if (values.reference) request.reference = values.reference
+ if (values.router) request.router = values.router
+ if (values['token-address']) {
+ if (!values['token-symbol'] || !values['token-decimals']) {
+ fail('--token-address needs --token-symbol and --token-decimals too')
+ }
+ request.token = {
+ address: values['token-address'],
+ symbol: values['token-symbol'],
+ decimals: Number(values['token-decimals']),
+ }
+ }
+ try {
+ const url = core.paymentLinkUrl(request, values['base-url'])
+ const fragment = core.encodePaymentRequest(request)
+ console.log(url)
+ console.error(`\nfragment (host it anywhere): #${fragment}`)
+ } catch (error) {
+ fail(error instanceof Error ? error.message : String(error))
+ }
+ process.exit(0)
+}
+
+if (command === 'verify') {
+ const { values } = parseArgs({
+ args: rest,
+ options: {
+ to: { type: 'string' },
+ amount: { type: 'string' },
+ network: { type: 'string', default: 'mainnet' },
+ 'rpc-url': { type: 'string' },
+ reference: { type: 'string' },
+ router: { type: 'string' },
+ payer: { type: 'string' },
+ 'from-block': { type: 'string' },
+ confirmations: { type: 'string', default: '30' },
+ 'timeout-ms': { type: 'string', default: '600000' },
+ 'token-address': { type: 'string' },
+ 'token-decimals': { type: 'string' },
+ },
+ })
+ if (!values.to) fail('--to is required')
+ if (!values.amount) fail('--amount is required (the exact fingerprinted decimal amount)')
+ const verify = await import('../dist/verify/index.js')
+ const viem = await import('viem')
+ const info = core.networkInfo(values.network)
+ const decimals = values['token-decimals'] ? Number(values['token-decimals']) : info.usdg.decimals
+ const token = values['token-address'] ?? info.usdg.address
+ const expectedRaw = viem.parseUnits(values.amount, decimals)
+ const reader = verify.createReader(values.network, values['rpc-url'])
+ const fromBlock = values['from-block'] ? BigInt(values['from-block']) : await reader.getBlockNumber()
+
+ const spec = { token, payTo: values.to, expectedRaw }
+ if (values.reference) {
+ if (!values.router) fail('--reference needs --router (the HoodPayRouter address)')
+ spec.reference = values.reference
+ spec.router = values.router
+ }
+ if (values.payer) spec.payer = values.payer
+
+ console.error(
+ `watching ${values.network} (chain ${info.chainId}) from block ${fromBlock} for ${values.amount} -> ${values.to} …`,
+ )
+ const result = await verify.awaitPayment(spec, {
+ reader,
+ fromBlock,
+ confirmations: Number(values.confirmations),
+ timeoutMs: Number(values['timeout-ms']),
+ onState: (state) => console.error(`status: ${state.status} (received ${state.receivedRaw})`),
+ })
+ console.log(
+ JSON.stringify(
+ result,
+ (_key, value) => (typeof value === 'bigint' ? value.toString() : value),
+ 2,
+ ),
+ )
+ const exitCodes = { paid: 0, overpaid: 2, underpaid: 3, expired: 4 }
+ process.exit(exitCodes[result.status] ?? 5)
+}
+
+fail(`unknown command "${command}" (run hood-pay --help)`)
diff --git a/robinhood/hood-pay/contracts/README.md b/robinhood/hood-pay/contracts/README.md
new file mode 100644
index 000000000..bc831c25d
--- /dev/null
+++ b/robinhood/hood-pay/contracts/README.md
@@ -0,0 +1,68 @@
+# HoodPayRouter
+
+Stateless, non-custodial payment attribution for plain ERC-20s on Robinhood
+Chain. `pay(token, payTo, amount, reference)` pulls the tokens from the
+caller straight to the merchant and emits
+`PaymentReceived(reference, payer, payTo, token, amount)`. The contract
+never holds a balance, has no owner, and cannot be paused or upgraded.
+
+Why it exists: USDG has no memo field and no EIP-2612 permit (verified
+on-chain), so a bare `transfer` cannot say which invoice it settles. See
+`docs/security.html` for the full reference-scheme design and collision
+math.
+
+## Layout
+
+- `src/HoodPayRouter.sol` - the router (zero dependencies, solc 0.8.30).
+- `test/HoodPayRouter.t.sol` - local unit + fuzz tests. Cheatcodes are
+ declared inline, so there is no forge-std submodule to install.
+- `test/HoodPayRouter.fork.t.sol` - fork tests against the REAL USDG
+ contract and real mainnet balances (executed only in forge's local fork
+ EVM; nothing is broadcast).
+
+## Test
+
+```sh
+npm run forge:test # local unit + fuzz
+npm run forge:test:fork # mainnet-fork tests against real USDG
+```
+
+## Deploy (owner step - signs and broadcasts a real transaction)
+
+The router is optional: direct-mode checkouts need no contract at all.
+Deploy it to enable router mode (exact attribution + partial-payment
+semantics). Fund the deployer with a little testnet/mainnet ETH first
+(gas is ETH on Robinhood Chain).
+
+Testnet (chain 46630), with Blockscout verification:
+
+```sh
+forge create contracts/src/HoodPayRouter.sol:HoodPayRouter \
+ --root contracts \
+ --rpc-url https://rpc.testnet.chain.robinhood.com \
+ --private-key "$ROBINHOOD_CHAIN_PRIVATE_KEY" \
+ --broadcast \
+ --verify \
+ --verifier blockscout \
+ --verifier-url https://explorer.testnet.chain.robinhood.com/api
+```
+
+Mainnet (chain 4663):
+
+```sh
+forge create contracts/src/HoodPayRouter.sol:HoodPayRouter \
+ --root contracts \
+ --rpc-url https://rpc.mainnet.chain.robinhood.com \
+ --private-key "$ROBINHOOD_CHAIN_PRIVATE_KEY" \
+ --broadcast \
+ --verify \
+ --verifier blockscout \
+ --verifier-url https://robinhoodchain.blockscout.com/api
+```
+
+Then pass the deployed address as `router` (together with a `reference`)
+in widget configs, payment links, and `hood-pay link --router 0x…`.
+
+The deployment is permissionless and address-agnostic: anyone may deploy
+their own router; verifiers watch whatever router address the merchant
+configures.
diff --git a/robinhood/hood-pay/contracts/foundry.toml b/robinhood/hood-pay/contracts/foundry.toml
new file mode 100644
index 000000000..a72e6f19b
--- /dev/null
+++ b/robinhood/hood-pay/contracts/foundry.toml
@@ -0,0 +1,9 @@
+[profile.default]
+src = "src"
+test = "test"
+out = "out"
+libs = []
+solc_version = "0.8.30"
+optimizer = true
+optimizer_runs = 10000
+evm_version = "cancun"
diff --git a/robinhood/hood-pay/contracts/src/HoodPayRouter.sol b/robinhood/hood-pay/contracts/src/HoodPayRouter.sol
new file mode 100644
index 000000000..3132e2105
--- /dev/null
+++ b/robinhood/hood-pay/contracts/src/HoodPayRouter.sol
@@ -0,0 +1,59 @@
+// SPDX-License-Identifier: MIT
+pragma solidity 0.8.30;
+
+/**
+ * @title HoodPayRouter
+ * @author nirholas (https://x.com/nichxbt)
+ * @notice Stateless, non-custodial payment attribution for plain ERC-20s.
+ *
+ * USDG (Paxos Global Dollar, Robinhood Chain's dollar stablecoin) is a
+ * plain ERC-20: no memo field, no EIP-2612 permit. A bare `transfer`
+ * therefore cannot say WHICH invoice it settles. `pay` fixes that in one
+ * hop: it pulls `amount` of `token` from the caller STRAIGHT to `payTo`
+ * (this contract never holds a balance, has no owner, no pause, no
+ * upgrade path, and no way to move funds that were not just approved for
+ * this exact call) and emits `PaymentReceived` with the merchant's
+ * 32-byte reference, which the hood-pay verifier matches exactly.
+ *
+ * Works with any standard ERC-20, including non-reverting tokens that
+ * signal failure by returning false, and legacy tokens that return no
+ * data at all.
+ */
+contract HoodPayRouter {
+ /// @notice Emitted for every settled payment; the verifier's source of truth.
+ /// @param ref Merchant-generated 32-byte invoice reference.
+ /// @param payer Buyer (the caller; also the `transferFrom` source).
+ /// @param payTo Merchant receiving address.
+ /// @param token ERC-20 the payment settles in (USDG by default).
+ /// @param amount Raw token units moved.
+ event PaymentReceived(
+ bytes32 indexed ref,
+ address indexed payer,
+ address indexed payTo,
+ address token,
+ uint256 amount
+ );
+
+ error ZeroAmount();
+ error ZeroAddress();
+ error TransferFailed();
+
+ /**
+ * @notice Pay `amount` of `token` to `payTo`, attributed to `reference`.
+ * @dev Requires a prior `approve(router, amount)` on `token` - USDG has
+ * no permit, so the two-step approve + pay is the only flow.
+ * Reverts unless the token both succeeds and (when it returns
+ * data) returns true.
+ */
+ function pay(address token, address payTo, uint256 amount, bytes32 ref) external {
+ if (amount == 0) revert ZeroAmount();
+ if (payTo == address(0) || token == address(0)) revert ZeroAddress();
+
+ (bool ok, bytes memory data) =
+ token.call(abi.encodeWithSelector(0x23b872dd, msg.sender, payTo, amount));
+ if (!ok || (data.length != 0 && !abi.decode(data, (bool)))) revert TransferFailed();
+ if (data.length == 0 && token.code.length == 0) revert TransferFailed();
+
+ emit PaymentReceived(ref, msg.sender, payTo, token, amount);
+ }
+}
diff --git a/robinhood/hood-pay/contracts/test/HoodPayRouter.fork.t.sol b/robinhood/hood-pay/contracts/test/HoodPayRouter.fork.t.sol
new file mode 100644
index 000000000..85345843e
--- /dev/null
+++ b/robinhood/hood-pay/contracts/test/HoodPayRouter.fork.t.sol
@@ -0,0 +1,80 @@
+// SPDX-License-Identifier: MIT
+pragma solidity 0.8.30;
+
+import {HoodPayRouter} from "../src/HoodPayRouter.sol";
+
+interface Vm {
+ function prank(address sender) external;
+ function expectEmit(bool t1, bool t2, bool t3, bool data) external;
+ function skip(bool shouldSkip) external;
+}
+
+interface IERC20 {
+ function balanceOf(address owner) external view returns (uint256);
+ function approve(address spender, uint256 amount) external returns (bool);
+ function decimals() external view returns (uint8);
+ function symbol() external view returns (string memory);
+}
+
+/**
+ * Fork suite: runs against the REAL USDG contract and REAL balances on
+ * Robinhood Chain mainnet (chain 4663), inside forge's local fork EVM -
+ * nothing is signed or broadcast to the real network.
+ *
+ * npm run forge:test:fork
+ * (forge test --root contracts --match-path 'test/*.fork.t.sol' \
+ * --fork-url https://rpc.mainnet.chain.robinhood.com -vv)
+ *
+ * WHALE is the largest USDG EOA holder at the time of writing (verified on
+ * Blockscout, ~50M USDG); the fork lets tests act as that address locally.
+ */
+contract HoodPayRouterForkTest {
+ Vm internal constant vm = Vm(address(uint160(uint256(keccak256("hevm cheat code")))));
+
+ address internal constant USDG = 0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168;
+ address internal constant WHALE = 0x2d4d2A025b10C09BDbd794B4FCe4F7ea8C7d7bB4;
+ address internal constant MERCHANT = address(0xCAFE);
+ bytes32 internal constant REF = keccak256("fork-invoice-1");
+ uint256 internal constant AMOUNT = 25_000_000; // 25 USDG
+
+ event PaymentReceived(
+ bytes32 indexed ref,
+ address indexed payer,
+ address indexed payTo,
+ address token,
+ uint256 amount
+ );
+
+ /// Skip cleanly when running without --fork-url (plain `forge test`).
+ modifier onlyFork() {
+ vm.skip(USDG.code.length == 0);
+ _;
+ }
+
+ function test_RealUsdgHasSixDecimalsAndSymbol() public onlyFork {
+ require(IERC20(USDG).decimals() == 6, "USDG must have 6 decimals");
+ require(
+ keccak256(bytes(IERC20(USDG).symbol())) == keccak256(bytes("USDG")),
+ "symbol must be USDG"
+ );
+ }
+
+ function test_PayWithRealUsdg() public onlyFork {
+ HoodPayRouter router = new HoodPayRouter();
+ uint256 whaleBefore = IERC20(USDG).balanceOf(WHALE);
+ require(whaleBefore >= AMOUNT, "whale drained since research; pick a new holder");
+ uint256 merchantBefore = IERC20(USDG).balanceOf(MERCHANT);
+
+ vm.prank(WHALE);
+ IERC20(USDG).approve(address(router), AMOUNT);
+
+ vm.expectEmit(true, true, true, true);
+ emit PaymentReceived(REF, WHALE, MERCHANT, USDG, AMOUNT);
+ vm.prank(WHALE);
+ router.pay(USDG, MERCHANT, AMOUNT, REF);
+
+ require(IERC20(USDG).balanceOf(MERCHANT) == merchantBefore + AMOUNT, "merchant not paid");
+ require(IERC20(USDG).balanceOf(WHALE) == whaleBefore - AMOUNT, "whale not debited");
+ require(IERC20(USDG).balanceOf(address(router)) == 0, "router must never hold USDG");
+ }
+}
diff --git a/robinhood/hood-pay/contracts/test/HoodPayRouter.t.sol b/robinhood/hood-pay/contracts/test/HoodPayRouter.t.sol
new file mode 100644
index 000000000..dd7d6307a
--- /dev/null
+++ b/robinhood/hood-pay/contracts/test/HoodPayRouter.t.sol
@@ -0,0 +1,190 @@
+// SPDX-License-Identifier: MIT
+pragma solidity 0.8.30;
+
+import {HoodPayRouter} from "../src/HoodPayRouter.sol";
+
+/// Foundry cheatcode surface used by these tests. Declared inline so the
+/// contracts folder has ZERO dependencies (no forge-std submodule to
+/// install); forge exposes the cheatcode contract at the well-known address.
+interface Vm {
+ function prank(address sender) external;
+ function expectRevert(bytes4 selector) external;
+ function expectEmit(bool t1, bool t2, bool t3, bool data) external;
+}
+
+/// Complete minimal ERC-20 used as the payment token in local tests
+/// (6 decimals, like USDG). The fork suite exercises the REAL USDG.
+contract TestToken {
+ string public constant name = "Test Global Dollar";
+ string public constant symbol = "tUSDG";
+ uint8 public constant decimals = 6;
+ uint256 public totalSupply;
+ mapping(address => uint256) public balanceOf;
+ mapping(address => mapping(address => uint256)) public allowance;
+
+ event Transfer(address indexed from, address indexed to, uint256 value);
+ event Approval(address indexed owner, address indexed spender, uint256 value);
+
+ function mint(address to, uint256 amount) external {
+ totalSupply += amount;
+ balanceOf[to] += amount;
+ emit Transfer(address(0), to, amount);
+ }
+
+ function approve(address spender, uint256 amount) external returns (bool) {
+ allowance[msg.sender][spender] = amount;
+ emit Approval(msg.sender, spender, amount);
+ return true;
+ }
+
+ function transfer(address to, uint256 amount) external returns (bool) {
+ return _move(msg.sender, to, amount);
+ }
+
+ function transferFrom(address from, address to, uint256 amount) external returns (bool) {
+ uint256 allowed = allowance[from][msg.sender];
+ require(allowed >= amount, "allowance");
+ if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount;
+ return _move(from, to, amount);
+ }
+
+ function _move(address from, address to, uint256 amount) internal returns (bool) {
+ require(balanceOf[from] >= amount, "balance");
+ balanceOf[from] -= amount;
+ balanceOf[to] += amount;
+ emit Transfer(from, to, amount);
+ return true;
+ }
+}
+
+/// A token that signals failure by RETURNING FALSE instead of reverting -
+/// the router must reject it.
+contract FalseReturningToken {
+ function transferFrom(address, address, uint256) external pure returns (bool) {
+ return false;
+ }
+}
+
+/// A no-return-data token (USDT-style ABI). Success = no revert, no data.
+contract NoReturnToken {
+ mapping(address => uint256) public balanceOf;
+ mapping(address => mapping(address => uint256)) public allowance;
+
+ function mint(address to, uint256 amount) external {
+ balanceOf[to] += amount;
+ }
+
+ function approve(address spender, uint256 amount) external {
+ allowance[msg.sender][spender] = amount;
+ }
+
+ function transferFrom(address from, address to, uint256 amount) external {
+ require(allowance[from][msg.sender] >= amount, "allowance");
+ require(balanceOf[from] >= amount, "balance");
+ allowance[from][msg.sender] -= amount;
+ balanceOf[from] -= amount;
+ balanceOf[to] += amount;
+ }
+}
+
+contract HoodPayRouterTest {
+ Vm internal constant vm = Vm(address(uint160(uint256(keccak256("hevm cheat code")))));
+
+ event PaymentReceived(
+ bytes32 indexed ref,
+ address indexed payer,
+ address indexed payTo,
+ address token,
+ uint256 amount
+ );
+
+ HoodPayRouter internal router;
+ TestToken internal token;
+ address internal constant BUYER = address(0xB0B);
+ address internal constant MERCHANT = address(0xCAFE);
+ bytes32 internal constant REF = keccak256("invoice-7");
+ uint256 internal constant AMOUNT = 12_500_000; // 12.50 with 6 decimals
+
+ function setUp() public {
+ router = new HoodPayRouter();
+ token = new TestToken();
+ token.mint(BUYER, 100_000_000);
+ vm.prank(BUYER);
+ token.approve(address(router), AMOUNT);
+ }
+
+ function test_PayMovesFundsDirectlyToMerchant() public {
+ vm.prank(BUYER);
+ router.pay(address(token), MERCHANT, AMOUNT, REF);
+ require(token.balanceOf(MERCHANT) == AMOUNT, "merchant not paid");
+ require(token.balanceOf(BUYER) == 100_000_000 - AMOUNT, "buyer not debited");
+ require(token.balanceOf(address(router)) == 0, "router must never hold funds");
+ }
+
+ function test_PayEmitsPaymentReceivedWithExactFields() public {
+ vm.expectEmit(true, true, true, true);
+ emit PaymentReceived(REF, BUYER, MERCHANT, address(token), AMOUNT);
+ vm.prank(BUYER);
+ router.pay(address(token), MERCHANT, AMOUNT, REF);
+ }
+
+ function test_RevertWhen_AmountIsZero() public {
+ vm.expectRevert(HoodPayRouter.ZeroAmount.selector);
+ vm.prank(BUYER);
+ router.pay(address(token), MERCHANT, 0, REF);
+ }
+
+ function test_RevertWhen_PayToIsZero() public {
+ vm.expectRevert(HoodPayRouter.ZeroAddress.selector);
+ vm.prank(BUYER);
+ router.pay(address(token), address(0), AMOUNT, REF);
+ }
+
+ function test_RevertWhen_TokenIsZero() public {
+ vm.expectRevert(HoodPayRouter.ZeroAddress.selector);
+ vm.prank(BUYER);
+ router.pay(address(0), MERCHANT, AMOUNT, REF);
+ }
+
+ function test_RevertWhen_AllowanceMissing() public {
+ vm.expectRevert(HoodPayRouter.TransferFailed.selector);
+ vm.prank(BUYER);
+ router.pay(address(token), MERCHANT, AMOUNT + 1, REF);
+ }
+
+ function test_RevertWhen_TokenReturnsFalse() public {
+ FalseReturningToken bad = new FalseReturningToken();
+ vm.expectRevert(HoodPayRouter.TransferFailed.selector);
+ vm.prank(BUYER);
+ router.pay(address(bad), MERCHANT, AMOUNT, REF);
+ }
+
+ function test_RevertWhen_TokenHasNoCode() public {
+ vm.expectRevert(HoodPayRouter.TransferFailed.selector);
+ vm.prank(BUYER);
+ router.pay(address(0xDEAD), MERCHANT, AMOUNT, REF);
+ }
+
+ function test_NoReturnDataTokenSucceeds() public {
+ NoReturnToken usdtStyle = new NoReturnToken();
+ usdtStyle.mint(BUYER, AMOUNT);
+ vm.prank(BUYER);
+ usdtStyle.approve(address(router), AMOUNT);
+ vm.expectEmit(true, true, true, true);
+ emit PaymentReceived(REF, BUYER, MERCHANT, address(usdtStyle), AMOUNT);
+ vm.prank(BUYER);
+ router.pay(address(usdtStyle), MERCHANT, AMOUNT, REF);
+ require(usdtStyle.balanceOf(MERCHANT) == AMOUNT, "merchant not paid");
+ }
+
+ function testFuzz_PayAnyAmountAndReference(uint96 amount, bytes32 invoiceRef) public {
+ uint256 value = uint256(amount) % 100_000_000;
+ if (value == 0) value = 1;
+ vm.prank(BUYER);
+ token.approve(address(router), value);
+ vm.expectEmit(true, true, true, true);
+ emit PaymentReceived(invoiceRef, BUYER, MERCHANT, address(token), value);
+ vm.prank(BUYER);
+ router.pay(address(token), MERCHANT, value, invoiceRef);
+ }
+}
diff --git a/robinhood/hood-pay/docs/hood-pay.min.js b/robinhood/hood-pay/docs/hood-pay.min.js
new file mode 100644
index 000000000..786d408bc
--- /dev/null
+++ b/robinhood/hood-pay/docs/hood-pay.min.js
@@ -0,0 +1,71 @@
+/* hood-pay checkout widget | MIT | https://github.com/nirholas/hood-pay */
+"use strict";(()=>{var on=Object.defineProperty;var rn=(e,t,o)=>t in e?on(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var d=(e,t)=>()=>(e&&(t=e(e=0)),t);var ae=(e,t,o)=>rn(e,typeof t!="symbol"?t+"":t,o);function io(e,t){return e.exec(t)?.groups}var ao=d(()=>{});function ke(e){let t=e.type;if(so.test(e.type)&&"components"in e){t="(";let o=e.components.length;for(let n=0;n<o;n++){let i=e.components[n];t+=ke(i),n<o-1&&(t+=", ")}let r=io(so,e.type);return t+=`)${r?.array||""}`,ke({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}var so,co=d(()=>{ao();so=/^tuple(?<array>(\[(\d*)\])*)$/});function V(e){let t="",o=e.length;for(let r=0;r<o;r++){let n=e[r];t+=ke(n),r!==o-1&&(t+=", ")}return t}var po=d(()=>{co()});function ct(e){return e.type==="function"?`function ${e.name}(${V(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${e.outputs?.length?` returns (${V(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${V(e.inputs)})`:e.type==="error"?`error ${e.name}(${V(e.inputs)})`:e.type==="constructor"?`constructor(${V(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?`fallback() external${e.stateMutability==="payable"?" payable":""}`:"receive() external payable"}var uo=d(()=>{po()});var mo=d(()=>{uo()});function se(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new Se(e.type);return`${e.name}(${Ce(e.inputs,{includeName:t})})`}function Ce(e,{includeName:t=!1}={}){return e?e.map(o=>nn(o,{includeName:t})).join(t?", ":","):""}function nn(e,{includeName:t}){return e.type.startsWith("tuple")?`(${Ce(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}var pt=d(()=>{O()});function k(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}var W=d(()=>{});function g(e){return k(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}var X=d(()=>{W()});var dt,fo=d(()=>{dt="2.55.2"});function lo(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?lo(e.cause,t):t?null:e}var ut,x,C=d(()=>{fo();ut={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:o})=>t?`${e??"https://viem.sh"}${t}${o?`#${o}`:""}`:void 0,version:`viem@${dt}`},x=class e extends Error{constructor(t,o={}){let r=o.cause instanceof e?o.cause.details:o.cause?.message?o.cause.message:o.details,n=o.cause instanceof e&&o.cause.docsPath||o.docsPath,i=ut.getDocsUrl?.({...o,docsPath:n}),a=[t||"An error occurred.","",...o.metaMessages?[...o.metaMessages,""]:[],...i?[`Docs: ${i}`]:[],...r?[`Details: ${r}`]:[],...ut.version?[`Version: ${ut.version}`]:[]].join(`
+`);super(a,o.cause?{cause:o.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=n,this.metaMessages=o.metaMessages,this.name=o.name??this.name,this.shortMessage=t,this.version=dt}walk(t){return lo(this,t)}}});var Ie,De,Be,Re,Fe,P,Me,Ue,Ne,Pe,$e,Se,O=d(()=>{pt();X();C();Ie=class extends x{constructor({data:t,params:o,size:r}){super([`Data size of ${r} bytes is too small for given parameters.`].join(`
+`),{metaMessages:[`Params: (${Ce(o,{includeName:!0})})`,`Data: ${t} (${r} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t,this.params=o,this.size=r}},De=class extends x{constructor({cause:t}={}){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError",cause:t})}},Be=class extends x{constructor({expectedLength:t,givenLength:o,type:r}){super([`ABI encoding array length mismatch for type ${r}.`,`Expected length: ${t}`,`Given length: ${o}`].join(`
+`),{name:"AbiEncodingArrayLengthMismatchError"})}},Re=class extends x{constructor({expectedSize:t,value:o}){super(`Size of bytes "${o}" (bytes${g(o)}) does not match expected size (bytes${t}).`,{name:"AbiEncodingBytesSizeMismatchError"})}},Fe=class extends x{constructor({expectedLength:t,givenLength:o}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${t}`,`Given length (values): ${o}`].join(`
+`),{name:"AbiEncodingLengthMismatchError"})}},P=class extends x{constructor(t,{docsPath:o}={}){super([`Function ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(`
+`),{docsPath:o,name:"AbiFunctionNotFoundError"})}},Me=class extends x{constructor(t,{docsPath:o}){super([`Function "${t}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(`
+`),{docsPath:o,name:"AbiFunctionOutputsNotFoundError"})}},Ue=class extends x{constructor(t,o){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${t.type}\` in \`${se(t.abiItem)}\`, and`,`\`${o.type}\` in \`${se(o.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}},Ne=class extends x{constructor(t,{docsPath:o}){super([`Type "${t}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
+`),{docsPath:o,name:"InvalidAbiEncodingType"})}},Pe=class extends x{constructor(t,{docsPath:o}){super([`Type "${t}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(`
+`),{docsPath:o,name:"InvalidAbiDecodingType"})}},$e=class extends x{constructor(t){super([`Value "${t}" is not a valid array.`].join(`
+`),{name:"InvalidArrayError"})}},Se=class extends x{constructor(t){super([`"${t}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
+`),{name:"InvalidDefinitionTypeError"})}}});var ce,pe,mt=d(()=>{C();ce=class extends x{constructor({offset:t,position:o,size:r}){super(`Slice ${o==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${r}).`,{name:"SliceOffsetOutOfBoundsError"})}},pe=class extends x{constructor({size:t,targetSize:o,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${t}) exceeds padding size (${o}).`,{name:"SizeExceedsPaddingSizeError"})}}});function $(e,{dir:t,size:o=32}={}){return typeof e=="string"?D(e,{dir:t,size:o}):an(e,{dir:t,size:o})}function D(e,{dir:t,size:o=32}={}){if(o===null)return e;let r=e.replace("0x","");if(r.length>o*2)throw new pe({size:Math.ceil(r.length/2),targetSize:o,type:"hex"});return`0x${r[t==="right"?"padEnd":"padStart"](o*2,"0")}`}function an(e,{dir:t,size:o=32}={}){if(o===null)return e;if(e.length>o)throw new pe({size:e.length,targetSize:o,type:"bytes"});let r=new Uint8Array(o);for(let n=0;n<o;n++){let i=t==="right";r[i?n:o-n-1]=e[i?n:e.length-n-1]}return r}var Le=d(()=>{mt()});var L,ze,He,de=d(()=>{C();L=class extends x{constructor({max:t,min:o,signed:r,size:n,value:i}){super(`Number "${i}" is not in safe ${n?`${n*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${t?`(${o} to ${t})`:`(above ${o})`}`,{name:"IntegerOutOfRangeError"})}},ze=class extends x{constructor(t){super(`Bytes value "${t}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}},He=class extends x{constructor({givenSize:t,maxSize:o}){super(`Size cannot exceed ${o} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}}});function ue(e,{dir:t="left"}={}){let o=typeof e=="string"?e.replace("0x",""):e,r=0;for(let n=0;n<o.length-1&&o[t==="left"?n:o.length-n-1].toString()==="0";n++)r++;return o=t==="left"?o.slice(r):o.slice(0,o.length-r),typeof e=="string"?(o.length===1&&t==="right"&&(o=`${o}0`),`0x${o.length%2===1?`0${o}`:o}`):o}var ft=d(()=>{});function A(e,{size:t}){if(g(e)>t)throw new He({givenSize:g(e),maxSize:t})}function lt(e,t={}){let{signed:o}=t;t.size&&A(e,{size:t.size});let r=BigInt(e);if(!o)return r;let n=(e.length-2)/2,i=(1n<<BigInt(n)*8n-1n)-1n;return r<=i?r:r-BigInt(`0x${"f".padStart(n*2,"f")}`)-1n}function xo(e,t={}){let o=lt(e,t),r=Number(o);if(!Number.isSafeInteger(r))throw new L({max:`${Number.MAX_SAFE_INTEGER}`,min:`${Number.MIN_SAFE_INTEGER}`,signed:t.signed,size:t.size,value:`${o}n`});return r}var Ge=d(()=>{de();X()});function ho(e,t={}){return typeof e=="number"||typeof e=="bigint"?B(e,t):typeof e=="string"?ht(e,t):typeof e=="boolean"?xt(e,t):S(e,t)}function xt(e,t={}){let o=`0x${Number(e)}`;return typeof t.size=="number"?(A(o,{size:t.size}),$(o,{size:t.size})):o}function S(e,t={}){let o="";for(let n=0;n<e.length;n++)o+=sn[e[n]];let r=`0x${o}`;return typeof t.size=="number"?(A(r,{size:t.size}),$(r,{dir:"right",size:t.size})):r}function B(e,t={}){let{signed:o,size:r}=t,n=BigInt(e),i;r?o?i=(1n<<BigInt(r)*8n-1n)-1n:i=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(i=BigInt(Number.MAX_SAFE_INTEGER));let a=typeof i=="bigint"&&o?-i-1n:0;if(i&&n>i||n<a){let c=typeof e=="bigint"?"n":"";throw new L({max:i?`${i}${c}`:void 0,min:`${a}${c}`,signed:o,size:r,value:`${e}${c}`})}let s=`0x${(o&&n<0?(1n<<BigInt(r*8))+BigInt(n):n).toString(16)}`;return r?$(s,{size:r}):s}function ht(e,t={}){let o=cn.encode(e);return S(o,t)}var sn,cn,K=d(()=>{de();Le();Ge();sn=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));cn=new TextEncoder});function Oe(e,t={}){return typeof e=="number"||typeof e=="bigint"?un(e,t):typeof e=="boolean"?dn(e,t):k(e)?_e(e,t):yt(e,t)}function dn(e,t={}){let o=new Uint8Array(1);return o[0]=Number(e),typeof t.size=="number"?(A(o,{size:t.size}),$(o,{size:t.size})):o}function yo(e){if(e>=R.zero&&e<=R.nine)return e-R.zero;if(e>=R.A&&e<=R.F)return e-(R.A-10);if(e>=R.a&&e<=R.f)return e-(R.a-10)}function _e(e,t={}){let o=e;t.size&&(A(o,{size:t.size}),o=$(o,{dir:"right",size:t.size}));let r=o.slice(2);r.length%2&&(r=`0${r}`);let n=r.length/2,i=new Uint8Array(n);for(let a=0,s=0;a<n;a++){let c=yo(r.charCodeAt(s++)),p=yo(r.charCodeAt(s++));if(c===void 0||p===void 0)throw new x(`Invalid byte sequence ("${r[s-2]}${r[s-1]}" in "${r}").`);i[a]=c*16+p}return i}function un(e,t){let o=B(e,t);return _e(o)}function yt(e,t={}){let o=pn.encode(e);return typeof t.size=="number"?(A(o,{size:t.size}),$(o,{dir:"right",size:t.size})):o}var pn,R,me=d(()=>{C();W();Le();Ge();K();pn=new TextEncoder;R={zero:48,nine:57,A:65,F:70,a:97,f:102}});function mn(e,t=!1){return t?{h:Number(e&je),l:Number(e>>bo&je)}:{h:Number(e>>bo&je)|0,l:Number(e&je)|0}}function go(e,t=!1){let o=e.length,r=new Uint32Array(o),n=new Uint32Array(o);for(let i=0;i<o;i++){let{h:a,l:s}=mn(e[i],t);[r[i],n[i]]=[a,s]}return[r,n]}var je,bo,Eo,Ao,wo,To,vo=d(()=>{je=BigInt(4294967295),bo=BigInt(32);Eo=(e,t,o)=>e<<o|t>>>32-o,Ao=(e,t,o)=>t<<o|e>>>32-o,wo=(e,t,o)=>t<<o-32|e>>>64-o,To=(e,t,o)=>e<<o-32|t>>>64-o});function fn(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function bt(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function fe(e,...t){if(!fn(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function gt(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function ko(e,t){fe(e);let o=t.outputLen;if(e.length<o)throw new Error("digestInto() expects output buffer of length at least "+o)}function Co(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function Et(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function xn(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function hn(e){for(let t=0;t<e.length;t++)e[t]=xn(e[t]);return e}function yn(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function wt(e){return typeof e=="string"&&(e=yn(e)),fe(e),e}function So(e){let t=r=>e().update(wt(r)).digest(),o=e();return t.outputLen=o.outputLen,t.blockLen=o.blockLen,t.create=()=>e(),t}var ln,At,qe,Io=d(()=>{ln=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;At=ln?e=>e:hn;qe=class{}});function kn(e,t=24){let o=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let a=0;a<10;a++)o[a]=e[a]^e[a+10]^e[a+20]^e[a+30]^e[a+40];for(let a=0;a<10;a+=2){let s=(a+8)%10,c=(a+2)%10,p=o[c],y=o[c+1],h=Do(p,y,1)^o[s],T=Bo(p,y,1)^o[s+1];for(let u=0;u<50;u+=10)e[a+u]^=h,e[a+u+1]^=T}let n=e[2],i=e[3];for(let a=0;a<24;a++){let s=Fo[a],c=Do(n,i,s),p=Bo(n,i,s),y=Ro[a];n=e[y],i=e[y+1],e[y]=c,e[y+1]=p}for(let a=0;a<50;a+=10){for(let s=0;s<10;s++)o[s]=e[a+s];for(let s=0;s<10;s++)e[a+s]^=~o[(s+2)%10]&o[(s+4)%10]}e[0]^=Tn[r],e[1]^=vn[r]}Et(o)}var bn,le,gn,En,An,wn,Ro,Fo,Mo,Uo,Tn,vn,Do,Bo,Tt,Cn,No,Po=d(()=>{vo();Io();bn=BigInt(0),le=BigInt(1),gn=BigInt(2),En=BigInt(7),An=BigInt(256),wn=BigInt(113),Ro=[],Fo=[],Mo=[];for(let e=0,t=le,o=1,r=0;e<24;e++){[o,r]=[r,(2*o+3*r)%5],Ro.push(2*(5*r+o)),Fo.push((e+1)*(e+2)/2%64);let n=bn;for(let i=0;i<7;i++)t=(t<<le^(t>>En)*wn)%An,t&gn&&(n^=le<<(le<<BigInt(i))-le);Mo.push(n)}Uo=go(Mo,!0),Tn=Uo[0],vn=Uo[1],Do=(e,t,o)=>o>32?wo(e,t,o):Eo(e,t,o),Bo=(e,t,o)=>o>32?To(e,t,o):Ao(e,t,o);Tt=class e extends qe{constructor(t,o,r,n=!1,i=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=o,this.outputLen=r,this.enableXOF=n,this.rounds=i,bt(r),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=Co(this.state)}clone(){return this._cloneInto()}keccak(){At(this.state32),kn(this.state32,this.rounds),At(this.state32),this.posOut=0,this.pos=0}update(t){gt(this),t=wt(t),fe(t);let{blockLen:o,state:r}=this,n=t.length;for(let i=0;i<n;){let a=Math.min(o-this.pos,n-i);for(let s=0;s<a;s++)r[this.pos++]^=t[i++];this.pos===o&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:o,pos:r,blockLen:n}=this;t[r]^=o,(o&128)!==0&&r===n-1&&this.keccak(),t[n-1]^=128,this.keccak()}writeInto(t){gt(this,!1),fe(t),this.finish();let o=this.state,{blockLen:r}=this;for(let n=0,i=t.length;n<i;){this.posOut>=r&&this.keccak();let a=Math.min(r-this.posOut,i-n);t.set(o.subarray(this.posOut,this.posOut+a),n),this.posOut+=a,n+=a}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return bt(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(ko(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,Et(this.state)}_cloneInto(t){let{blockLen:o,suffix:r,outputLen:n,rounds:i,enableXOF:a}=this;return t||(t=new e(o,r,n,a,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=r,t.outputLen=n,t.enableXOF=a,t.destroyed=this.destroyed,t}},Cn=(e,t,o)=>So(()=>new Tt(t,e,o)),No=Cn(1,136,256/8)});function Ve(e,t){let o=t||"hex",r=No(k(e,{strict:!1})?Oe(e):e);return o==="bytes"?r:ho(r)}var vt=d(()=>{Po();W();me();K()});function $o(e){return Sn(e)}var Sn,Lo=d(()=>{me();vt();Sn=e=>Ve(Oe(e))});function zo(e){let t=!0,o="",r=0,n="",i=!1;for(let a=0;a<e.length;a++){let s=e[a];if(["(",")",","].includes(s)&&(t=!0),s==="("&&r++,s===")"&&r--,!!t){if(r===0){if(s===" "&&["event","function",""].includes(n))n="";else if(n+=s,s===")"){i=!0;break}continue}if(s===" "){e[a-1]!==","&&o!==","&&o!==",("&&(o="",t=!1);continue}n+=s,o+=s}}if(!i)throw new x("Unable to normalize signature.");return n}var Ho=d(()=>{C()});var Go,Oo=d(()=>{mo();Ho();Go=e=>{let t=typeof e=="string"?e:ct(e);return zo(t)}});function We(e){return $o(Go(e))}var kt=d(()=>{Lo();Oo()});var _o,jo=d(()=>{kt();_o=We});var Q,Ct=d(()=>{C();Q=class extends x{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}});var Y,St=d(()=>{Y=class extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){let o=super.get(t);return super.has(t)&&(super.delete(t),super.set(t,o)),o}set(t,o){if(super.has(t)&&super.delete(t),super.set(t,o),this.maxSize&&this.size>this.maxSize){let r=super.keys().next().value;r!==void 0&&super.delete(r)}return this}}});function Z(e,t){if(It.has(`${e}.${t}`))return It.get(`${e}.${t}`);let o=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),r=Ve(yt(o),"bytes"),n=(t?o.substring(`${t}0x`.length):o).split("");for(let a=0;a<40;a+=2)r[a>>1]>>4>=8&&n[a]&&(n[a]=n[a].toUpperCase()),(r[a>>1]&15)>=8&&n[a+1]&&(n[a+1]=n[a+1].toUpperCase());let i=`0x${n.join("")}`;return It.set(`${e}.${t}`,i),i}function xe(e,t){if(!w(e,{strict:!1}))throw new Q({address:e});return Z(e,t)}var It,Xe=d(()=>{Ct();me();vt();St();he();It=new Y(8192)});function w(e,t){let{strict:o=!0}=t??{},r=`${e}.${o}`;if(Dt.has(r))return Dt.get(r);let n=In.test(e)?e.toLowerCase()===e?!0:o?Z(e)===e:!0:!1;return Dt.set(r,n),n}var In,Dt,he=d(()=>{St();Xe();In=/^0x[a-fA-F0-9]{40}$/,Dt=new Y(8192)});function F(e){return`0x${e.reduce((t,o)=>t+o.replace("0x",""),"")}`}var Bt=d(()=>{});function Ke(e,t,o,{strict:r}={}){return k(e,{strict:!1})?Dn(e,t,o,{strict:r}):Rt(e,t,o,{strict:r})}function qo(e,t){if(typeof t=="number"&&t>0&&t>g(e)-1)throw new ce({offset:t,position:"start",size:g(e)})}function Vo(e,t,o){if(typeof t=="number"&&typeof o=="number"&&g(e)!==o-t)throw new ce({offset:o,position:"end",size:g(e)})}function Rt(e,t,o,{strict:r}={}){qo(e,t);let n=e.slice(t,o);return r&&Vo(n,t,o),n}function Dn(e,t,o,{strict:r}={}){qo(e,t);let n=`0x${e.replace("0x","").slice((t??0)*2,(o??e.length)*2)}`;return r&&Vo(n,t,o),n}var Qe=d(()=>{mt();W();X()});var Wo,Xo=d(()=>{Wo=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/});function Ko(e,t){if(e.length!==t.length)throw new Fe({expectedLength:e.length,givenLength:t.length});let o=Bn({params:e,values:t});return Ut(o)}function Bn({params:e,values:t}){let o=[];for(let r=0;r<e.length;r++)o.push(Mt({param:e[r],value:t[r]}));return o}function Mt({param:e,value:t}){let o=ye(e.type);if(o){let[r,n]=o;return Fn(t,{length:r,param:{...e,type:n}})}if(e.type==="tuple")return $n(t,{param:e});if(e.type==="address")return Rn(t);if(e.type==="bool")return Un(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){let r=e.type.startsWith("int"),[,,n="256"]=Wo.exec(e.type)??[];return Nn(t,{signed:r,size:Number(n)})}if(e.type.startsWith("bytes"))return Mn(t,{param:e});if(e.type==="string")return Pn(t);throw new Ne(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function Ut(e){let t=0;for(let i=0;i<e.length;i++){let{dynamic:a,encoded:s}=e[i];a?t+=32:t+=g(s)}let o=[],r=[],n=0;for(let i=0;i<e.length;i++){let{dynamic:a,encoded:s}=e[i];a?(o.push(B(t+n,{size:32})),r.push(s),n+=g(s)):o.push(s)}return F([...o,...r])}function Rn(e){if(!w(e))throw new Q({address:e});return{dynamic:!1,encoded:D(e.toLowerCase())}}function Fn(e,{length:t,param:o}){let r=t===null;if(!Array.isArray(e))throw new $e(e);if(!r&&e.length!==t)throw new Be({expectedLength:t,givenLength:e.length,type:`${o.type}[${t}]`});let n=e.length===0&&Ft(o),i=[];for(let a=0;a<e.length;a++){let s=Mt({param:o,value:e[a]});s.dynamic&&(n=!0),i.push(s)}if(r||n){let a=Ut(i);if(r){let s=B(i.length,{size:32});return{dynamic:!0,encoded:F([s,a])}}if(n)return{dynamic:!0,encoded:a}}return{dynamic:!1,encoded:F(i.map(({encoded:a})=>a))}}function Mn(e,{param:t}){let[,o]=t.type.split("bytes"),r=g(e);if(!o){let n=e;return r%32!==0&&(n=D(n,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:F([D(B(r,{size:32})),n])}}if(r!==Number.parseInt(o,10))throw new Re({expectedSize:Number.parseInt(o,10),value:e});return{dynamic:!1,encoded:D(e,{dir:"right"})}}function Un(e){if(typeof e!="boolean")throw new x(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:D(xt(e))}}function Nn(e,{signed:t,size:o=256}){if(typeof o=="number"){let r=2n**(BigInt(o)-(t?1n:0n))-1n,n=t?-r-1n:0n;if(e>r||e<n)throw new L({max:r.toString(),min:n.toString(),signed:t,size:o/8,value:e.toString()})}return{dynamic:!1,encoded:B(e,{size:32,signed:t})}}function Pn(e){let t=ht(e),o=Math.ceil(g(t)/32),r=[];for(let n=0;n<o;n++)r.push(D(Ke(t,n*32,(n+1)*32),{dir:"right"}));return{dynamic:!0,encoded:F([D(B(g(t),{size:32})),...r])}}function $n(e,{param:t}){let o=!1,r=[];for(let n=0;n<t.components.length;n++){let i=t.components[n],a=Array.isArray(e)?n:i.name,s=Mt({param:i,value:e[a]});r.push(s),s.dynamic&&(o=!0)}return{dynamic:o,encoded:o?Ut(r):F(r.map(({encoded:n})=>n))}}function ye(e){let t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function Ft(e){let{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return e.components.some(Ft);let o=ye(t);return o?Ft({...e,type:o[1]}):!1}var Nt=d(()=>{O();Ct();C();de();he();Bt();Le();X();Qe();K();Xo()});var Ye,Pt=d(()=>{Qe();kt();Ye=e=>Ke(We(e),0,4)});function Ze(e){let{abi:t,args:o=[],name:r}=e,n=k(r,{strict:!1}),i=t.filter(s=>n?s.type==="function"?Ye(s)===r:s.type==="event"?_o(s)===r:!1:"name"in s&&s.name===r);if(i.length===0)return;if(i.length===1)return i[0];let a;for(let s of i){if(!("inputs"in s))continue;if(!o||o.length===0){if(!s.inputs||s.inputs.length===0)return s;continue}if(!s.inputs||s.inputs.length===0||s.inputs.length!==o.length)continue;if(o.every((p,y)=>{let h="inputs"in s&&s.inputs[y];return h?$t(p,h):!1})){if(a&&"inputs"in a&&a.inputs){let p=Qo(s.inputs,a.inputs,o);if(p)throw new Ue({abiItem:s,type:p[0]},{abiItem:a,type:p[1]})}a=s}}return a||i[0]}function $t(e,t){let o=typeof e,r=t.type;switch(r){case"address":return w(e,{strict:!1});case"bool":return o==="boolean";case"function":return o==="string";case"string":return o==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((n,i)=>o==="object"&&$t(Object.values(e)[i],n)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?o==="number"||o==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?o==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(n=>$t(n,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function Qo(e,t,o){for(let r in e){let n=e[r],i=t[r];if(n.type==="tuple"&&i.type==="tuple"&&"components"in n&&"components"in i)return Qo(n.components,i.components,o[r]);let a=[n.type,i.type];if(a.includes("address")&&a.includes("bytes20")?!0:a.includes("address")&&a.includes("string")?w(o[r],{strict:!1}):a.includes("address")&&a.includes("bytes")?w(o[r],{strict:!1}):!1)return a}}var Lt=d(()=>{O();W();he();jo();Pt()});function Zo(e){let{abi:t,args:o,functionName:r}=e,n=t[0];if(r){let i=Ze({abi:t,args:o,name:r});if(!i)throw new P(r,{docsPath:Yo});n=i}if(n.type!=="function")throw new P(void 0,{docsPath:Yo});return{abi:[n],functionName:Ye(se(n))}}var Yo,Jo=d(()=>{O();Pt();pt();Lt();Yo="/docs/contract/encodeFunctionData"});function z(e){let{args:t}=e,{abi:o,functionName:r}=e.abi.length===1&&e.functionName?.startsWith("0x")?e:Zo(e),n=o[0],i=r,a="inputs"in n&&n.inputs?Ko(n.inputs,t??[]):void 0;return F([i,a??"0x"])}var er=d(()=>{Bt();Nt();Jo()});var be,Je,et,tr=d(()=>{C();be=class extends x{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}},Je=class extends x{constructor({length:t,position:o}){super(`Position \`${o}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}},et=class extends x{constructor({count:t,limit:o}){super(`Recursive read limit of \`${o}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}}});function or(e,{recursiveReadLimit:t=8192}={}){let o=Object.create(Ln);return o.bytes=e,o.dataView=new DataView(e.buffer??e,e.byteOffset,e.byteLength),o.positionReadCount=new Map,o.recursiveReadLimit=t,o}var Ln,rr=d(()=>{tr();Ln={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new et({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new Je({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new be({offset:e});let t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new be({offset:e});let t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){let o=t??this.position;return this.assertPosition(o+e-1),this.bytes.subarray(o,o+e)},inspectUint8(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){let t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){let t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){let t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();let e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();let o=this.inspectBytes(e);return this.position+=t??e,o},readUint8(){this.assertReadLimit(),this._touch();let e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();let e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();let e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();let e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){let t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;let e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}}});function nr(e,t={}){typeof t.size<"u"&&A(e,{size:t.size});let o=S(e,t);return lt(o,t)}function ir(e,t={}){let o=e;if(typeof t.size<"u"&&(A(o,{size:t.size}),o=ue(o)),o.length>1||o[0]>1)throw new ze(o);return!!o[0]}function I(e,t={}){typeof t.size<"u"&&A(e,{size:t.size});let o=S(e,t);return xo(o,t)}function ar(e,t={}){let o=e;return typeof t.size<"u"&&(A(o,{size:t.size}),o=ue(o,{dir:"right"})),new TextDecoder().decode(o)}var sr=d(()=>{de();ft();Ge();K()});function pr(e,t){let o=typeof t=="string"?_e(t):t,r=or(o);if(g(o)===0&&e.length>0)throw new De;if(g(t)&&g(t)<32)throw new Ie({data:typeof t=="string"?t:S(t),params:e,size:g(t)});let n=0,i=[];for(let a=0;a<e.length;++a){let s=e[a];n<o.length&&r.setPosition(n);let[c,p]=J(r,s,{staticPosition:0});n+=p,i.push(c)}return i}function J(e,t,{staticPosition:o}){let r=ye(t.type);if(r){let[n,i]=r;return Hn(e,{...t,type:i},{length:n,staticPosition:o})}if(t.type==="tuple")return jn(e,t,{staticPosition:o});if(t.type==="address")return zn(e);if(t.type==="bool")return Gn(e);if(t.type.startsWith("bytes"))return On(e,t,{staticPosition:o});if(t.type.startsWith("uint")||t.type.startsWith("int"))return _n(e,t);if(t.type==="string")return qn(e,{staticPosition:o});throw new Pe(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}function zn(e){let t=e.readBytes(32);return[Z(S(Rt(t,-20))),32]}function Hn(e,t,{length:o,staticPosition:r}){if(o===null){let a=I(e.readBytes(zt)),s=r+a,c=s+cr;e.setPosition(s);let p=I(e.readBytes(cr)),y=ge(t),h=0,T=[];for(let u=0;u<p;++u){e.setPosition(c+(y?u*32:h));let[U,ne]=J(e,t,{staticPosition:c});h+=ne,T.push(U),ne===0&&(e.assertReadLimit(),e._touch())}return e.setPosition(r+32),[T,32]}if(ge(t)){let a=I(e.readBytes(zt)),s=r+a,c=[];for(let p=0;p<o;++p){e.setPosition(s+p*32);let[y]=J(e,t,{staticPosition:s});c.push(y)}return e.setPosition(r+32),[c,32]}let n=0,i=[];for(let a=0;a<o;++a){let[s,c]=J(e,t,{staticPosition:r+n});n+=c,i.push(s),c===0&&(e.assertReadLimit(),e._touch())}return[i,n]}function Gn(e){return[ir(e.readBytes(32),{size:32}),32]}function On(e,t,{staticPosition:o}){let[r,n]=t.type.split("bytes");if(!n){let a=I(e.readBytes(32));e.setPosition(o+a);let s=I(e.readBytes(32));if(s===0)return e.setPosition(o+32),["0x",32];let c=e.readBytes(s);return e.setPosition(o+32),[S(c),32]}return[S(e.readBytes(Number.parseInt(n,10),32)),32]}function _n(e,t){let o=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256",10),n=e.readBytes(32);return[r>48?nr(n,{signed:o}):I(n,{signed:o}),32]}function jn(e,t,{staticPosition:o}){let r=t.components.length===0||t.components.some(({name:a})=>!a),n=r?[]:{},i=0;if(ge(t)){let a=I(e.readBytes(zt)),s=o+a;for(let c=0;c<t.components.length;++c){let p=t.components[c];e.setPosition(s+i);let[y,h]=J(e,p,{staticPosition:s});i+=h,n[r?c:p?.name]=y}return e.setPosition(o+32),[n,32]}for(let a=0;a<t.components.length;++a){let s=t.components[a],[c,p]=J(e,s,{staticPosition:o});n[r?a:s?.name]=c,i+=p}return[n,i]}function qn(e,{staticPosition:t}){let o=I(e.readBytes(32)),r=t+o;e.setPosition(r);let n=I(e.readBytes(32));if(n===0)return e.setPosition(t+32),["",32];let i=e.readBytes(n,32),a=ar(ue(i));return e.setPosition(t+32),[a,32]}function ge(e){let{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return e.components?.some(ge);let o=ye(e.type);return!!(o&&ge({...e,type:o[1]}))}var cr,zt,dr=d(()=>{O();Xe();rr();X();Qe();ft();sr();me();K();Nt();cr=32,zt=32});function ee(e,t){let o=e.toString(),r=o.startsWith("-");r&&(o=o.slice(1)),o=o.padStart(t,"0");let[n,i]=[o.slice(0,o.length-t),o.slice(o.length-t)];return i=i.replace(/(0+)$/,""),`${r?"-":""}${n||"0"}${i?`.${i}`:""}`}var ur=d(()=>{});function Gt(e){let{abi:t,args:o,functionName:r,data:n}=e,i=t[0];if(r){let s=Ze({abi:t,args:o,name:r});if(!s)throw new P(r,{docsPath:Ht});i=s}if(i.type!=="function")throw new P(void 0,{docsPath:Ht});if(!i.outputs)throw new Me(i.name,{docsPath:Ht});let a=pr(i.outputs,n);if(a&&a.length>1)return a;if(a&&a.length===1)return a[0]}var Ht,mr=d(()=>{O();dr();Lt();Ht="/docs/contract/decodeFunctionResult"});var Vt,wr=d(()=>{Vt="2.55.2"});function Tr(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?Tr(e.cause,t):t?null:e}var Wt,oe,Xt=d(()=>{wr();Wt={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:o})=>t?`${e??"https://viem.sh"}${t}${o?`#${o}`:""}`:void 0,version:`viem@${Vt}`},oe=class e extends Error{constructor(t,o={}){let r=o.cause instanceof e?o.cause.details:o.cause?.message?o.cause.message:o.details,n=o.cause instanceof e&&o.cause.docsPath||o.docsPath,i=Wt.getDocsUrl?.({...o,docsPath:n}),a=[t||"An error occurred.","",...o.metaMessages?[...o.metaMessages,""]:[],...i?[`Docs: ${i}`]:[],...r?[`Details: ${r}`]:[],...Wt.version?[`Version: ${Wt.version}`]:[]].join(`
+`);super(a,o.cause?{cause:o.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=n,this.metaMessages=o.metaMessages,this.name=o.name??this.name,this.shortMessage=t,this.version=Vt}walk(t){return Tr(this,t)}}});var Ee,vr=d(()=>{Xt();Ee=class extends oe{constructor({size:t,targetSize:o,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${t}) exceeds padding size (${o}).`,{name:"SizeExceedsPaddingSizeError"})}}});function kr(e,{dir:t,size:o=32}={}){return typeof e=="string"?Jn(e,{dir:t,size:o}):ei(e,{dir:t,size:o})}function Jn(e,{dir:t,size:o=32}={}){if(o===null)return e;let r=e.replace("0x","");if(r.length>o*2)throw new Ee({size:Math.ceil(r.length/2),targetSize:o,type:"hex"});return`0x${r[t==="right"?"padEnd":"padStart"](o*2,"0")}`}function ei(e,{dir:t,size:o=32}={}){if(o===null)return e;if(e.length>o)throw new Ee({size:e.length,targetSize:o,type:"bytes"});let r=new Uint8Array(o);for(let n=0;n<o;n++){let i=t==="right";r[i?n:o-n-1]=e[i?n:e.length-n-1]}return r}var Cr=d(()=>{vr()});var rt,Sr=d(()=>{Xt();rt=class extends oe{constructor({max:t,min:o,signed:r,size:n,value:i}){super(`Number "${i}" is not in safe ${n?`${n*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${t?`(${o} to ${t})`:`(above ${o})`}`,{name:"IntegerOutOfRangeError"})}}});function Ae(e,t={}){let{signed:o,size:r}=t,n=BigInt(e),i;r?o?i=(1n<<BigInt(r)*8n-1n)-1n:i=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(i=BigInt(Number.MAX_SAFE_INTEGER));let a=typeof i=="bigint"&&o?-i-1n:0;if(i&&n>i||n<a){let c=typeof e=="bigint"?"n":"";throw new rt({max:i?`${i}${c}`:void 0,min:`${a}${c}`,signed:o,size:r,value:`${e}${c}`})}let s=`0x${(o&&n<0?(1n<<BigInt(r*8))+BigInt(n):n).toString(16)}`;return r?kr(s,{size:r}):s}var Ir=d(()=>{Sr();Cr()});C();var tt=class extends x{constructor({value:t}){super(`Number \`${t}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}};function te(e,t){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(e))throw new tt({value:e});let[o,r="0"]=e.split("."),n=o.startsWith("-");if(n&&(o=o.slice(1)),r=r.replace(/(0+)$/,""),t===0)Math.round(+`.${r}`)===1&&(o=`${BigInt(o)+1n}`),r="";else if(r.length>t){let[i,a,s]=[r.slice(0,t-1),r.slice(t-1,t),r.slice(t)],c=Math.round(+`${a}.${s}`);c>9?r=`${BigInt(i)+BigInt(1)}0`.padStart(i.length+1,"0"):r=`${i}${c}`,r.length>t&&(r=r.slice(1),o=`${BigInt(o)+1n}`),r=r.slice(0,t)}else r=r.padEnd(t,"0");return BigInt(`${n?"-":""}${o}${r}`)}mr();er();Xe();he();ur();var fr={usdg:"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",weth:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",uniswapV3Factory:"0x1f7d7550B1b028f7571E69A784071F0205FD2EfA",quoterV2:"0x33e885eD0Ec9bF04EcfB19341582aADCb4c8A9E7",swapRouter02:"0xCaf681a66D020601342297493863E78C959E5cb2",universalRouter:"0x53BF6B0684Ec7eF91e1387Da3D1a1769bC5A6F77",nonfungiblePositionManager:"0x73991a25C818Bf1f1128dEAaB1492D45638DE0D3",multicall3:"0xca11bde05977b3631167028862be2a173976ca11"},lr={usdg:"0x7E955252E15c84f5768B83c41a71F9eba181802F",weth:"0x7943e237c7F95DA44E0301572D358911207852Fa",uniswapV3Factory:"0x0BFbCF9fa4f9C56B0F40a671Ad40E0805A091865",quoterV2:"0xcf05Fc31A6B693DD0bEB76e958ae4BCD490dc985",swapRouter:"0x1b81D678ffb9C0263b24A97847620C99d213eB14",nonfungiblePositionManager:"0x46A15B0b27311cedF172AB29E4f4766fbE7F4364",multicall3:"0xca11bde05977b3631167028862be2a173976ca11"};var _t=6;var Vn={$schema:"./stock-tokens.schema.json",chainId:4663,generatedAtBlock:7690522,sources:{discovery:'https://robinhoodchain.blockscout.com/api/v2/tokens?q=Robinhood Token (canonical name pattern "<Name> \u2022 Robinhood Token")',feeds:"https://reference-data-directory.vercel.app/feeds-robinhood-mainnet.json",verification:"on-chain via public RPC: shared beacon slot, symbol/name/decimals/uiMultiplier multicall, feed latestRoundData"},stockBeacon:"0xe10b6f6B275de231345c20D14Ab812db62151b00",tokenCount:95,feedCount:34,tokens:[{address:"0x521Cf887E6531c6F667b5BC4D896E5d9bfE8EB2E",symbol:"AAOI",name:"Applied Optoelectronics \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xaF3D76f1834A1d425780943C99Ea8A608f8a93f9",symbol:"AAPL",name:"Apple \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x6B22A786bAa607d76728168703a39Ea9C99f2cD0",feedDecimals:8,feedAnswerAtGeneration:"31550000000",feedUpdatedAtGeneration:1783710274},{address:"0x36046893810a7E7fCE501229d57dc3FC8c8716d0",symbol:"AMAT",name:"Applied Materials \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x86923f96303D656E4aa86D9d42D1e57ad2023fdC",symbol:"AMD",name:"AMD \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x943A29E7ae51A4798823ca9eEd2ed533B2A22C72",feedDecimals:8,feedAnswerAtGeneration:"55821015000",feedUpdatedAtGeneration:1783713346},{address:"0x12f190a9F9d7D37a250758b26824B97CE941bF54",symbol:"AMZN",name:"Amazon \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0xD5a1508ceD74c084eBf3cBe853e2C968fB2a651C",feedDecimals:8,feedAnswerAtGeneration:"24556770000",feedUpdatedAtGeneration:1783692103},{address:"0xb8DBf92F9741c9ac1c32115E78581f23509916FD",symbol:"APLD",name:"Applied Digital \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x47F93d52cBeC7C6D2CfC080e154002370a60dAEA",symbol:"ASML",name:"ASML Holding NV \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0xB4106147E8cce40b7d46124090d373A71b70f87D",feedDecimals:8,feedAnswerAtGeneration:"179758755000",feedUpdatedAtGeneration:1783710661},{address:"0x1AF6446f07eb1d97c546AFC8c9544cBDF3AD5137",symbol:"ASTS",name:"AST SpaceMobile \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x156E175DD063a8cE274C50654eF40e0032b3fbcF",symbol:"AVGO",name:"Broadcom \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x4D21483a44Bf67a86b77E3dA301411880797D452",symbol:"BA",name:"Boeing \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xad25Ac6C84D497db898fa1E8387bf6Af3532a1c4",symbol:"BABA",name:"Alibaba \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x62Cc8F9b5f56a33c9C8A60c8B92779f523c4E984",feedDecimals:8,feedAnswerAtGeneration:"11219500000",feedUpdatedAtGeneration:1783707523},{address:"0x822CC93fFD030293E9842c30BBD678F530701867",symbol:"BE",name:"Bloom Energy \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x5c90450Bbb4273D7b2f17CF6917AEB237A569679",symbol:"CBRS",name:"Cerebras Systems \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x9651342CeA770aE9a2969Ba2A52611523146aef9",symbol:"CCL",name:"Carnival Corporation \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x8cF07C5A878945185d327aAa6e33FAa95F95e7bF",symbol:"CELH",name:"Celsius \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xcBB95BBF36099d34dA091dc6Fa6F49EfA257Cee3",symbol:"CLSK",name:"CleanSpark \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x810c12D3a554Bc47fd39597Fe3b3AAC4941F50eF",feedDecimals:8,feedAnswerAtGeneration:"1286499999",feedUpdatedAtGeneration:1783713313},{address:"0x6330D8C3178a418788dF01a47479c0ce7CCF450b",symbol:"COIN",name:"Coinbase \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0xA3a468A452940B7D6b69991207B508c609a98Ef2",feedDecimals:8,feedAnswerAtGeneration:"15943135000",feedUpdatedAtGeneration:1783703473},{address:"0x4EA005168D7F09a7A0Ba9D1DEf21a479950E44C2",symbol:"COST",name:"Costco \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xdF0992E440dD0be65BD8439b609d6D4366bf1CB5",symbol:"CRCL",name:"Circle Internet Group \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x6652eDf64bA3731C4F2D3ce821A0Fb1f1f6b482a",feedDecimals:8,feedAnswerAtGeneration:"6634635000",feedUpdatedAtGeneration:1783717360},{address:"0x5f10A1C971B69e47e059e1dC91901B59b3fB49C3",symbol:"CRWV",name:"CoreWeave \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0xe1b3aABCAFAd1c94708dc1367dcfF8Aa4407487C",feedDecimals:8,feedAnswerAtGeneration:"8883970000",feedUpdatedAtGeneration:1783711393},{address:"0x27c99fBde9D0d2AA4f4Bfb4943f237843DdF6958",symbol:"DDOG",name:"Datadog \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x941AE714EC6D8130c7B75d67160Ca08f1e7d11Dd",symbol:"DELL",name:"Dell \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x39EC44Bee4F6A116c6F9B8De566848a985C53C60",symbol:"ELF",name:"e.l.f. Beauty \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x7f0aBeF0C07280F82c6a08ead09dEd6BAE2C13Fc",symbol:"EWY",name:"iShares MSCI South Korea fund \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0xEFdf54610B62A7753Ec30bDc380847c12D32e1D1",feedDecimals:8,feedAnswerAtGeneration:"18377499999",feedUpdatedAtGeneration:1783705547},{address:"0x25C288E6D899b9BC30160965aD9644c67e73bE0C",symbol:"F",name:"Ford Motor \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x282e87451E10fA6679BC7D76C69BE44cD3fC777C",symbol:"FLNC",name:"Fluence Energy \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xeB30663bDFf0622Ef4e4E5cBb4E975F19f33f51D",symbol:"FUTU",name:"Futu Holdings \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x7c04E6A3368F2A1DE3874f0e80d2e0A1a9915da6",symbol:"GLW",name:"Corning \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x1b0E319c6A659F002271B69dB8A7df2F911c153E",symbol:"GME",name:"GameStop \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x27C71df6A64fB476468EdF256CF72c038baB5B67",feedDecimals:8,feedAnswerAtGeneration:"2176125000",feedUpdatedAtGeneration:1783694006},{address:"0x2e0847E8910a9732eB3fb1bb4b70a580ADAD4FE3",symbol:"GOOGL",name:"Alphabet Class A \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0xF6f373a037c30F0e5010d854385cA89185AE638b",feedDecimals:8,feedAnswerAtGeneration:"35672000000",feedUpdatedAtGeneration:1783711606},{address:"0xf1953DAB6FaD537488d5A022361FfAa8B4c95eC6",symbol:"INOD",name:"Innodata \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xc72b96e0E48ecd4DC75E1e45396e26300BC39681",symbol:"INTC",name:"Intel \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x3f390C5C24628Ac7C489515402235FeAD71D1913",feedDecimals:8,feedAnswerAtGeneration:"10965095000",feedUpdatedAtGeneration:1783712771},{address:"0x56d23beE5f41A7120170b0c603Dae30128e460e9",symbol:"INTU",name:"Intuit \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x558378E000D634A36593E338eBacdd6207640EfE",symbol:"IONQ",name:"IonQ \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x22EfeC4919baf55F360E0EDee4AbEB26DE4971eb",feedDecimals:8,feedAnswerAtGeneration:"4308000000",feedUpdatedAtGeneration:1783711226},{address:"0xF0AB0c93bE6F41369d302e55db1A96b3c430212D",symbol:"IREN",name:"IREN Limited \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x8eF20885F94e3D9bc7eB3080279188Bd5ED7c08C",symbol:"LITE",name:"Lumentum \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x8005d266423c7ea827372c9c864491e5786600ea",symbol:"LLY",name:"Eli Lilly \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x4e62068525Ab11FE768e29dfD00ef909B9803016",symbol:"LULU",name:"Lululemon \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xa5D4968421bA94814Be3B136b15cf422101aC1a3",symbol:"LUNR",name:"Intuitive Machines \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xDdf2266b79abf0B48898959B0ed6E6adf512be74",symbol:"MDB",name:"MongoDB \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xc0D6457C16Cc70d6790Dd43521C899C87ce02f35",symbol:"META",name:"Meta Platforms \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x7C38C00C30BEe9378381E7B6135d7283356D71b1",feedDecimals:8,feedAnswerAtGeneration:"67067485000",feedUpdatedAtGeneration:1783713401},{address:"0x62fd0668e10D8B72339BE2DCF7643001688ff13B",symbol:"MRVL",name:"Marvell Technology \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xe93237C50D904957Cf27E7B1133b510C669c2e74",symbol:"MSFT",name:"Microsoft \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x45C3C877C15E6BA2EBB19eA114Ea508d14C1Af2E",feedDecimals:8,feedAnswerAtGeneration:"38469000000",feedUpdatedAtGeneration:1783697881},{address:"0xec262a75e413fAfD0dF80480274532C79D42da09",symbol:"MSTR",name:"Strategy Inc. \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x396118bdFB181e6240E74D243F266B061c0edc3D",feedDecimals:8,feedAnswerAtGeneration:"9469500000",feedUpdatedAtGeneration:1783712395},{address:"0xfF080c8ce2E5feadaCa0Da81314Ae59D232d4afD",symbol:"MU",name:"Micron Technology \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x425EEFdCf05ed6526C3cE61Af99429A228a6d596",feedDecimals:8,feedAnswerAtGeneration:"97854340000",feedUpdatedAtGeneration:1783713684},{address:"0x48961813349333209994750ffA89b3c5C22eC969",symbol:"MXL",name:"MaxLinear \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x9D9c6684F596F66a64C030B93A886D51Fd4D7931",symbol:"NBIS",name:"Nebius Group \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0xE1D87B116Ba0fe898998f1D140339D1fA1E09705",feedDecimals:8,feedAnswerAtGeneration:"21923750000",feedUpdatedAtGeneration:1783713491},{address:"0xE0444EF8BF4eD74f74FD73686e2ddF4C1c5591E8",symbol:"NFLX",name:"Netflix \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xBEF75684C43c4ea7BD18Dd532a2244674Ee8b926",symbol:"NNE",name:"Nano Nuclear Energy \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x0C3260aF4B8f13a69c4c2dFb84fD667890CDFa14",symbol:"NOW",name:"ServiceNow \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x408c14038a04f7bD235329E26d2bf569ee20e250",symbol:"NU",name:"Nu \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xd0601CE157Db5bdC3162BbaC2a2C8aF5320D9EEC",symbol:"NVDA",name:"NVIDIA \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x379EC4f7C378F34a1B47E4F3cbeBCbAC3E8E9F15",feedDecimals:8,feedAnswerAtGeneration:"21019000000",feedUpdatedAtGeneration:1783700623},{address:"0xbE6702d7b70315376dC48a3293f24f0982F86386",symbol:"NVTS",name:"Navitas Semiconductor \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xb0992820E760d836549ba69BC7598b4af75dEE03",symbol:"ORCL",name:"Oracle \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x0e6a64a2B58A6693a531E6c555f3A5d042eEA844",feedDecimals:8,feedAnswerAtGeneration:"14108370000",feedUpdatedAtGeneration:1783709137},{address:"0x1Cdad396DB64BDa184d5182A97Dd9B3C62100b7D",symbol:"P",name:"Everpure \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x9b23573b156B52565012F5cE02CDF60AFBaa70Be",symbol:"PENG",name:"Penguin Solutions \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x894E1EC2D74FFE5AEF8Dc8A9e84686acCB964F2A",symbol:"PLTR",name:"Palantir Technologies \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x820ABedFF239034956B7A9d2F0a331f9F075eB4c",feedDecimals:8,feedAnswerAtGeneration:"12656140000",feedUpdatedAtGeneration:1783714557},{address:"0xcf6B2D875361be807EAfa57458c80f28521F9333",symbol:"POET",name:"POET Technologies \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x4189F0c66EBBB0bfeF1C31f763131361EF32f77C",symbol:"PR",name:"Permian Resources \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xC583c60aeF9Dc401Da72cEC1B404743a93cea1Cc",symbol:"QBTS",name:"D-Wave Quantum \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x0f17206447090e464C277571124dD2688E48AEA9",symbol:"QCOM",name:"Qualcomm \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xD5f3879160bc7c32ebb4dC785F8a4F505888de68",symbol:"QQQ",name:"Invesco QQQ \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x80901d846d5D7B030F26B480776EE3b29374C2ae",feedDecimals:8,feedAnswerAtGeneration:"72545060000",feedUpdatedAtGeneration:1783702260},{address:"0x59818904ab4cE163b3cE4FfB64f2D6Ca02c434B4",symbol:"QUBT",name:"Quantum Computing \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xF0C4BF4C582cb3836e98394b1d4e7B7281101bE8",symbol:"RBLX",name:"Roblox \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x05b37Fb53A299a1b874A619e1c4C404D52C36F4C",symbol:"RDDT",name:"Reddit \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x92Ef19E82bD8fF36661DE838D5eaE7e5CEF0EfFE",symbol:"RDW",name:"Redwire \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x284358abc07F9359f19f4b5b4aC91901Be2597Ba",symbol:"RGTI",name:"Rigetti Computing \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x2A045cF1C49c61c166C036d2f06FA2D2d984f765",feedDecimals:8,feedAnswerAtGeneration:"1657150813",feedUpdatedAtGeneration:1783713654},{address:"0xB1BF26c1D20ff267A4f93550d1E0d06ac40a114B",symbol:"RIVN",name:"Rivian Automotive \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x3b14C39E89D60D627b42a1A4CA45b5bb45Fc12e2",symbol:"RKLB",name:"Rocket Lab Corporation \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x045477BF65Aef6f4F2386ad0164579e48381CC74",feedDecimals:8,feedAnswerAtGeneration:"8128970000",feedUpdatedAtGeneration:1783726597},{address:"0x95052ddcd5DC25641657424A8Cf04834997E1730",symbol:"SATS",name:"EchoStar \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x92FD66527192E3e61d4DDd13322Aa222DE86F9B5",symbol:"SGOV",name:"iShares 0-3 Month Treasury Bond \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000957519890990718",feed:"0xa0DF4ee0fFf975306345875E3548Fcc519577A11",feedDecimals:8,feedAnswerAtGeneration:"10060428845",feedUpdatedAtGeneration:1783728100},{address:"0xF53F66751B1Eff985311b693531E3290F600c410",symbol:"SHOP",name:"Shopify \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x411eFb0E7f985935DAec3D4C3ebaEa0d0AD7D89f",symbol:"SLV",name:"iShares Silver Trust \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x209b73908e92Ae021826eD79609845451Ecba2ce",feedDecimals:8,feedAnswerAtGeneration:"5416490000",feedUpdatedAtGeneration:1783719808},{address:"0xc01aA1fECeC0605b13bc84874ff7256C0f5F562a",symbol:"SMCI",name:"Super Micro Computer \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xB90A19fF0Af67f7779afF50A882A9CfF42446400",symbol:"SNDK",name:"Sandisk Corporation \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0xfb133Fa4B7b385802B693a293606682Df47109A3",feedDecimals:8,feedAnswerAtGeneration:"193162665000",feedUpdatedAtGeneration:1783727430},{address:"0x98E75885157C80992A8D41b696D8c9C6Fb30A926",symbol:"SOFI",name:"SoFi Technologies \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x75742c18BC1f1C5c5f448f4C9D9C6F66dafAAa38",symbol:"SOXX",name:"iShares Semiconductor ETF \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x4a0E65A3EcceC6dBe60AE065F2e7bb85Fae35eEa",symbol:"SPCX",name:"Space Exploration Technologies Corp. Class A Common Stock \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0xB265810950ba6c5C0Ff821c9963014a56fD8Bffb",feedDecimals:8,feedAnswerAtGeneration:"14572500000",feedUpdatedAtGeneration:1783713430},{address:"0xAd622320e520de39e72d41EF07438C3Fd3354875",symbol:"SPMO",name:"Invesco S&P 500 Momentum ETF \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x117cc2133c37B721F49dE2A7a74833232B3B4C0C",symbol:"SPY",name:"SPDR S&P 500 ETF Trust \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x319724394D3A0e3669269846abE664Cd621f9f6A",feedDecimals:8,feedAnswerAtGeneration:"75361500000",feedUpdatedAtGeneration:1783700203},{address:"0x89776d4Cd68193597A2fC132cfaC1fDe36CCeA8a",symbol:"TSEM",name:"Tower Semiconductor \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x322F0929c4625eD5bAd873c95208D54E1c003b2d",symbol:"TSLA",name:"Tesla \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x4A1166a659A55625345e9515b32adECea5547C38",feedDecimals:8,feedAnswerAtGeneration:"40782500000",feedUpdatedAtGeneration:1783713215},{address:"0x58FfE4a942d3885bAa22D7520691F611EF09e7AA",symbol:"TSM",name:"Taiwan Semiconductor Manufacturing \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x874cF94aa8eC88Fd9560094dD065f2fB3E41Fc2F",feedDecimals:8,feedAnswerAtGeneration:"43437150000",feedUpdatedAtGeneration:1783713983},{address:"0x5e81213613b6B86EaB4c6c50d718d34359459786",symbol:"TTWO",name:"Take-Two Interactive Software \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x0E6e67Ba88e7b5d9B67636A215c76779B948dE79",symbol:"UMC",name:"United Microelectronics \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xf23250dac154D05Bb671CB0d0eBEf3c635c79CE2",symbol:"UPS",name:"UPS \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xd917B029C761D264c6A312BBbcDA868658eF86a6",symbol:"USAR",name:"USA Rare Earth \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0xA994d3684e8400A6c8078226925779FdeE682DD9",feedDecimals:8,feedAnswerAtGeneration:"1853505000",feedUpdatedAtGeneration:1783709442},{address:"0xa30FA36Db767ad9eD3f7a60fC79526fB4d56D344",symbol:"USO",name:"United States Oil Fund \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x75a9c76Ef439e2C7c2E5a34Ab105EcFe3766431c",feedDecimals:8,feedAnswerAtGeneration:"10868500000",feedUpdatedAtGeneration:1783708312},{address:"0x82DA4646242e1D962e96e932269Dc644c94a9CaA",symbol:"WDAY",name:"Workday \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xc93a8c440CEa26D7445dF01729f193b27965099f",symbol:"WEEK",name:"Roundhill Weekly T-Bill ETF \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"2006182524271844660",feed:null,feedDecimals:null},{address:"0x15Cd20759CE7F3285c29A319dE2D1A2e098c6f43",symbol:"XLK",name:"State Street Technology Select Sector SPDR ETF \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xA8eB3BCcbf2017eE7CBfb652eB51CF2E1B153289",symbol:"XNDU",name:"Xanadu Quantum \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xf9B46d3D1B22199D4D1025a9cEDB540A33F1a2d5",symbol:"XOM",name:"ExxonMobil Holdings Corporation \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x44c4F142009036cF477eD2d09932051843137CF1",symbol:"ZM",name:"Zoom \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x7dc013eB55e436f30d7ED1AFE4E36d6e45e3c3f7",symbol:"ZS",name:"Zscaler \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null}]},xr=Vn,tc=new Map(xr.tokens.map(e=>[e.symbol.toUpperCase(),e])),oc=new Map(xr.tokens.map(e=>[e.address.toLowerCase(),e]));var hr=[{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"to",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"event",name:"Transfer",inputs:[{name:"from",type:"address",indexed:!0},{name:"to",type:"address",indexed:!0},{name:"value",type:"uint256",indexed:!1}]},{type:"event",name:"Approval",inputs:[{name:"owner",type:"address",indexed:!0},{name:"spender",type:"address",indexed:!0},{name:"value",type:"uint256",indexed:!1}]}],rc=[...hr,{type:"function",name:"uiMultiplier",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"newUIMultiplier",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"effectiveAt",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"balanceOfUI",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"totalSupplyUI",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"paused",stateMutability:"view",inputs:[],outputs:[{type:"bool"}]},{type:"function",name:"tokenPaused",stateMutability:"view",inputs:[],outputs:[{type:"bool"}]},{type:"function",name:"oraclePaused",stateMutability:"view",inputs:[],outputs:[{type:"bool"}]},{type:"function",name:"terms",stateMutability:"pure",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"uid",stateMutability:"view",inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"nonces",stateMutability:"view",inputs:[{name:"owner",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"permit",stateMutability:"nonpayable",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"},{name:"value",type:"uint256"},{name:"deadline",type:"uint256"},{name:"v",type:"uint8"},{name:"r",type:"bytes32"},{name:"s",type:"bytes32"}],outputs:[]}];var nc=[...hr,{type:"function",name:"deposit",stateMutability:"payable",inputs:[],outputs:[]},{type:"function",name:"withdraw",stateMutability:"nonpayable",inputs:[{name:"wad",type:"uint256"}],outputs:[]}];var ic=4320*60;var Ot={bondingCurveFactory:"0xEb3FeeD2716cF0eEAda05B22e67424794e1f5a80",reflectionFactory:"0x6Ce85c4b7cE12903E5867652C265bCcce57f935F",instantFactory:"0xD7601cEe401306fdea5833c6898181D9c770F800",robinLock:"0x5B41D59Fa0ce65750bc64e06D85bC999084493CD",legacyFactory:"0xAf9f3ce1d34909F59E88c23027f89d5807B0F915"};var ac=[Ot.bondingCurveFactory,Ot.reflectionFactory,Ot.instantFactory];var Wn={network:"mainnet",chainId:4663,rpcUrl:"https://rpc.mainnet.chain.robinhood.com",explorerUrl:"https://robinhoodchain.blockscout.com",usdg:{address:fr.usdg,symbol:"USDG",decimals:_t}},Xn={network:"testnet",chainId:46630,rpcUrl:"https://rpc.testnet.chain.robinhood.com",explorerUrl:"https://explorer.testnet.chain.robinhood.com",usdg:{address:lr.usdg,symbol:"USDG",decimals:_t}};function _(e="mainnet"){if(e!=="mainnet"&&e!=="testnet")throw new RangeError(`Unknown hood-pay network "${String(e)}" (use "mainnet" or "testnet")`);return e==="testnet"?Xn:Wn}function yr(e,t){return`${_(e).explorerUrl}/tx/${t}`}var uc=10n**BigInt(4);function br(e){return typeof e=="string"&&/^0x[0-9a-fA-F]{64}$/.test(e)}var Kn=280,Qn=/^(0|[1-9]\d{0,11})(\.\d{1,18})?$/;function ot(e){if(typeof e!="object"||e===null)throw new TypeError("payment request must be an object");let t=e;if(t.v!==1&&t.v!==void 0)throw new RangeError(`unsupported payment request version ${String(t.v)}`);let o=t.network??"mainnet";if(_(o),typeof t.payTo!="string"||!w(t.payTo,{strict:!0}))throw new TypeError("payTo must be a 0x-prefixed 20-byte address with a valid EIP-55 checksum");let r=xe(t.payTo);if(typeof t.amount!="string")throw new TypeError('amount must be a string (decimal or "dynamic")');let n=t.amount.trim();if(n!=="dynamic"&&!Qn.test(n))throw new RangeError(`amount "${n}" is not a plain decimal string (or "dynamic")`);let i;if(t.token!==void 0){let h=t.token;if(typeof h!="object"||h===null)throw new TypeError("token must be an object");if(typeof h.address!="string"||!w(h.address,{strict:!0}))throw new TypeError("token.address must be a 0x-prefixed 20-byte address with a valid EIP-55 checksum");if(typeof h.symbol!="string"||h.symbol.length===0||h.symbol.length>20)throw new TypeError("token.symbol must be a 1-20 character string");if(typeof h.decimals!="number"||!Number.isInteger(h.decimals)||h.decimals<0||h.decimals>36)throw new RangeError("token.decimals must be an integer in [0, 36]");i={address:xe(h.address),symbol:h.symbol,decimals:h.decimals}}let a=i?.decimals??_(o).usdg.decimals;if(n!=="dynamic"){if(te(n,a)<=0n)throw new RangeError("amount must be greater than zero");if((n.split(".")[1]??"").length>a)throw new RangeError(`amount "${n}" has more decimal places than the token's ${a}`)}let s;if(t.memo!==void 0){if(typeof t.memo!="string")throw new TypeError("memo must be a string");s=t.memo.slice(0,Kn)}let c,p;if(t.reference!==void 0){if(!br(t.reference))throw new TypeError("reference must be a 0x-prefixed 32-byte hex string");if(c=t.reference.toLowerCase(),typeof t.router!="string"||!w(t.router,{strict:!0}))throw new TypeError('router-mode requests (reference set) must carry a checksummed HoodPayRouter address in "router"');p=xe(t.router)}else if(t.router!==void 0)throw new TypeError('"router" is only valid together with "reference"');let y={v:1,network:o,payTo:r,amount:n};return i&&(y.token=i),s!==void 0&&(y.memo=s),c&&(y.reference=c),p&&(y.router=p),y}function jt(e){return e.token??_(e.network).usdg}function gr(e){if(e.amount==="dynamic")throw new RangeError("dynamic-amount requests have no fixed raw amount");return te(e.amount,jt(e).decimals)}function Yn(e){let t=new TextEncoder().encode(e),o="";for(let r of t)o+=String.fromCharCode(r);return btoa(o).replaceAll("+","-").replaceAll("/","_").replace(/=+$/,"")}function Zn(e){let t=e.replaceAll("-","+").replaceAll("_","/"),o=atob(t),r=new Uint8Array(o.length);for(let n=0;n<o.length;n++)r[n]=o.charCodeAt(n);return new TextDecoder().decode(r)}function qt(e){let t=ot(e);return`1.${Yn(JSON.stringify(t))}`}function Er(e){let t=e.startsWith("#")?e.slice(1):e,o=t.indexOf(".");if(o===-1)throw new TypeError("malformed payment link (missing version prefix)");let r=t.slice(0,o);if(r!=="1")throw new RangeError(`unsupported payment link version "${r}"`);let n;try{n=JSON.parse(Zn(t.slice(o+1)))}catch{throw new TypeError("malformed payment link (payload is not base64url JSON)")}return ot(n)}function Ar(e,t="https://nirholas.github.io/hood-pay/pay.html"){return`${t}#${qt(e)}`}function nt(e){let t={formatters:void 0,fees:void 0,serializers:void 0,...e};function o(r){return n=>{let i=typeof n=="function"?n(r):n,a={...r,...i};return Object.assign(a,{extend:o(a)})}}return Object.assign(t,{extend:o(t)})}Ir();var we=nt({id:4663,name:"Robinhood Chain",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.chain.robinhood.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://robinhoodchain.blockscout.com",apiUrl:"https://robinhoodchain.blockscout.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11"}}});var Te=nt({id:46630,name:"Robinhood Chain Testnet",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.testnet.chain.robinhood.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.testnet.chain.robinhood.com",apiUrl:"https://explorer.testnet.chain.robinhood.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11"}},testnet:!0});var H=class extends Error{constructor(t,o={}){super(t,o.cause===void 0?void 0:{cause:o.cause});ae(this,"code");this.name="HoodConnectError",this.code=o.code}};var Rr=class extends H{constructor(e){super("Wallet connection was rejected in the wallet.",{code:4001,cause:e}),this.name="ConnectionRejectedError"}},j=class extends H{constructor(t,o={}){super(t,o);ae(this,"rejectedByUser");this.name="ChainSwitchRejectedError",this.rejectedByUser=o.code===4001}},Kt=class extends H{constructor(t,o={}){super(t,o);ae(this,"rejectedByUser");this.name="ChainAddRejectedError",this.rejectedByUser=o.code===4001}};function M(e){if(typeof e!="object"||e===null)return;let t=e,o=t.data,r=o?.originalError?.code??o?.code;if(typeof r=="number"&&r!==-32603)return r;if(typeof t.code=="number"&&t.code!==-32603)return t.code;if(t.cause!==void 0&&t.cause!==e){let n=M(t.cause);if(n!==void 0)return n}return typeof t.code=="number"?t.code:void 0}function at(e){return M(e)===4001}function Fr(e){if(M(e)===4902)return!0;let o=e instanceof Error?e.message:String(e);return/unrecognized chain|4902|first add|wallet_addEthereumChain/i.test(o)}function re(e){return e instanceof Error&&e.message?e.message:String(e)}var ti=we.id,oi=Te.id;function Yt(e="mainnet"){return e==="testnet"?Te:we}function Mr(e){let t=e.blockExplorers?.default?.url,o={chainId:Ae(e.id),chainName:e.name,nativeCurrency:e.nativeCurrency,rpcUrls:e.rpcUrls.default.http};return t&&(o.blockExplorerUrls=[t]),o}async function Ur(e,t={}){let o=t.chain??Yt(t.network);try{await e.request({method:"wallet_addEthereumChain",params:[Mr(o)]})}catch(r){throw at(r)?new Kt(`Adding ${o.name} was rejected in the wallet.`,{code:4001,cause:r}):new Kt(`The wallet could not add ${o.name}: ${re(r)}`,{code:M(r),cause:r})}}async function it(e){let t=await e.request({method:"eth_chainId"});return Number.parseInt(t,16)}var Dr="eip6963:announceProvider",ri="eip6963:requestProvider",Qt="injected.window.ethereum",ni="data:image/svg+xml;base64,"+(typeof btoa=="function"?btoa('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"><rect width="24" height="24" rx="6" fill="#1f2328"/><path d="M6 9.5a2.5 2.5 0 0 1 2.5-2.5h7A2.5 2.5 0 0 1 18 9.5v5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 6 14.5v-5Z" stroke="#00c805" stroke-width="1.5"/><circle cx="14.5" cy="12" r="1.25" fill="#00c805"/></svg>'):"");function ii(){return typeof window>"u"?void 0:window}function Nr(){if(typeof window>"u")return;let e=window.ethereum;return e&&typeof e.request=="function"?e:void 0}function Pr(){let e=Nr();if(e)return{info:{uuid:Qt,name:"Injected wallet",icon:ni,rdns:Qt},provider:e}}function $r(e,t={}){let o=t.target??ii();if(!o)return()=>{};let r=new Map,n=i=>{let a=i.detail;!a?.info?.uuid||!a.provider||typeof a.provider.request!="function"||r.has(a.info.uuid)||(r.set(a.info.uuid,Object.freeze({info:{...a.info},provider:a.provider})),e([...r.values()]))};return o.addEventListener(Dr,n),o.dispatchEvent(new Event(ri)),()=>o.removeEventListener(Dr,n)}async function Zt(e={}){let t=e.timeoutMs??300,o=e.includeLegacyFallback??!0,r=[],n=$r(i=>{r=i},e);if(await new Promise(i=>setTimeout(i,t)),n(),r.length===0&&o){let i=Pr();if(i)return[i]}return r}async function ai(e){let t;try{t=await e.request({method:"eth_requestAccounts"})}catch(r){throw at(r)?new Rr(r):new H(`Wallet connection failed: ${re(r)}`,{code:M(r),cause:r})}let o=Array.isArray(t)?t[0]:void 0;if(!o)throw new H("The wallet returned no accounts.");return o}async function Br(e,t){try{await e.request({method:"wallet_switchEthereumChain",params:[{chainId:Ae(t.id)}]})}catch(o){throw at(o)?new j(`Switching to ${t.name} was rejected in the wallet.`,{code:4001,cause:o}):o}}async function Jt(e,t={}){let o=t.chain??Yt(t.network),r=t.onState??(()=>{});try{r({status:"connecting"});let n=await ai(e),i=await it(e);if(i!==o.id){r({status:"switching",chainId:o.id});try{await Br(e,o)}catch(s){if(s instanceof j)throw s;if(!Fr(s))throw new j(`The wallet could not switch to ${o.name}: ${re(s)}`,{code:M(s),cause:s});if(r({status:"adding",chainId:o.id}),await Ur(e,{chain:o}),i=await it(e),i!==o.id){r({status:"switching",chainId:o.id});try{await Br(e,o)}catch(c){throw c instanceof j?c:new j(`The wallet added ${o.name} but could not switch to it: ${re(c)}`,{code:M(c),cause:c})}}}if(i=await it(e),i!==o.id)throw new j(`The wallet reported success but is on chain ${i}, not ${o.id} (${o.name}).`)}let a={address:n,chainId:o.id};return r({status:"connected",...a}),a}catch(n){let i=n instanceof H?n:new H(re(n),{code:M(n),cause:n});throw r({status:"error",error:i}),i}}var q=[{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"to",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"owner",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"event",name:"Transfer",inputs:[{name:"from",type:"address",indexed:!0},{name:"to",type:"address",indexed:!0},{name:"value",type:"uint256",indexed:!1}]}],Lr=[{type:"function",name:"pay",stateMutability:"nonpayable",inputs:[{name:"token",type:"address"},{name:"payTo",type:"address"},{name:"amount",type:"uint256"},{name:"ref",type:"bytes32"}],outputs:[]},{type:"event",name:"PaymentReceived",inputs:[{name:"ref",type:"bytes32",indexed:!0},{name:"payer",type:"address",indexed:!0},{name:"payTo",type:"address",indexed:!0},{name:"token",type:"address",indexed:!1},{name:"amount",type:"uint256",indexed:!1}]}];function zr(e,t,o){return{to:e,data:z({abi:q,functionName:"transfer",args:[t,o]}),value:0n}}function Hr(e,t,o){return{to:e,data:z({abi:q,functionName:"approve",args:[t,o]}),value:0n}}function Gr(e,t,o,r,n){return{to:e,data:z({abi:Lr,functionName:"pay",args:[t,o,r,n]}),value:0n}}var si=`
+.hoodpay{--hp-bg:#0b0e12;--hp-panel:#12161d;--hp-line:#232a35;--hp-text:#e8edf4;--hp-dim:#8b96a5;
+--hp-accent:#00c805;--hp-accent2:#00e5a0;--hp-danger:#ff5c5c;--hp-warn:#ffb454;--hp-radius:14px;
+font-family:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
+color:var(--hp-text);background:var(--hp-bg);border:1px solid var(--hp-line);border-radius:var(--hp-radius);
+max-width:420px;width:100%;box-sizing:border-box;padding:20px;line-height:1.45;font-size:15px}
+.hoodpay *{box-sizing:border-box;margin:0}
+.hoodpay-head{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-bottom:14px}
+.hoodpay-brand{font-weight:700;letter-spacing:-.02em;font-size:14px;color:var(--hp-dim)}
+.hoodpay-brand b{background:linear-gradient(90deg,var(--hp-accent),var(--hp-accent2));
+-webkit-background-clip:text;background-clip:text;color:transparent}
+.hoodpay-net{font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:var(--hp-dim);
+border:1px solid var(--hp-line);border-radius:999px;padding:3px 9px}
+.hoodpay-net[data-net="testnet"]{color:var(--hp-warn);border-color:rgba(255,180,84,.4)}
+.hoodpay-amount{font-size:34px;font-weight:700;letter-spacing:-.03em;margin:2px 0 4px}
+.hoodpay-amount small{font-size:16px;font-weight:600;color:var(--hp-dim);margin-left:6px}
+.hoodpay-memo{color:var(--hp-dim);font-size:14px;margin-bottom:14px;overflow-wrap:anywhere}
+.hoodpay-row{display:flex;justify-content:space-between;gap:12px;padding:9px 0;
+border-top:1px solid var(--hp-line);font-size:13px}
+.hoodpay-row dt{color:var(--hp-dim)}.hoodpay-row dd{font-variant-numeric:tabular-nums;text-align:right;overflow-wrap:anywhere}
+.hoodpay-btn{appearance:none;width:100%;border:0;border-radius:10px;padding:13px 16px;margin-top:14px;
+font:inherit;font-weight:600;cursor:pointer;color:#04110a;
+background:linear-gradient(90deg,var(--hp-accent),var(--hp-accent2));
+transition:transform .12s ease,filter .12s ease,opacity .12s ease}
+.hoodpay-btn:hover{filter:brightness(1.08)}
+.hoodpay-btn:active{transform:translateY(1px) scale(.995)}
+.hoodpay-btn:focus-visible,.hoodpay a:focus-visible,.hoodpay-wallet:focus-visible,.hoodpay-input:focus-visible{
+outline:2px solid var(--hp-accent2);outline-offset:2px}
+.hoodpay-btn[disabled]{opacity:.55;cursor:not-allowed}
+.hoodpay-btn.secondary{background:transparent;color:var(--hp-text);border:1px solid var(--hp-line)}
+.hoodpay-btn.secondary:hover{border-color:var(--hp-dim)}
+.hoodpay-input{width:100%;padding:12px 14px;border-radius:10px;border:1px solid var(--hp-line);
+background:var(--hp-panel);color:var(--hp-text);font:inherit;font-size:22px;font-weight:600;margin:6px 0 2px}
+.hoodpay-input:hover{border-color:var(--hp-dim)}
+.hoodpay-label{font-size:12px;color:var(--hp-dim);text-transform:uppercase;letter-spacing:.07em}
+.hoodpay-wallets{display:flex;flex-direction:column;gap:8px;margin-top:12px}
+.hoodpay-wallet{display:flex;align-items:center;gap:12px;width:100%;padding:11px 13px;border-radius:10px;
+border:1px solid var(--hp-line);background:var(--hp-panel);color:var(--hp-text);font:inherit;font-weight:600;
+cursor:pointer;transition:border-color .12s ease,background .12s ease}
+.hoodpay-wallet:hover{border-color:var(--hp-accent2)}
+.hoodpay-wallet:active{background:#161c25}
+.hoodpay-wallet img{width:26px;height:26px;border-radius:6px}
+.hoodpay-status{display:flex;align-items:center;gap:12px;padding:14px;border-radius:10px;
+background:var(--hp-panel);border:1px solid var(--hp-line);margin-top:14px;font-size:14px}
+.hoodpay-spin{width:18px;height:18px;flex:none;border-radius:50%;border:2px solid var(--hp-line);
+border-top-color:var(--hp-accent2);animation:hoodpay-spin .8s linear infinite}
+@keyframes hoodpay-spin{to{transform:rotate(360deg)}}
+.hoodpay-ok{color:var(--hp-accent2)}.hoodpay-err{color:var(--hp-danger)}.hoodpay-warnc{color:var(--hp-warn)}
+.hoodpay-check{width:44px;height:44px;border-radius:50%;flex:none;display:grid;place-items:center;
+background:rgba(0,229,160,.12);color:var(--hp-accent2);font-size:22px;animation:hoodpay-pop .25s ease}
+@keyframes hoodpay-pop{from{transform:scale(.6);opacity:0}to{transform:scale(1);opacity:1}}
+.hoodpay a{color:var(--hp-accent2);text-decoration:none;border-bottom:1px solid rgba(0,229,160,.35)}
+.hoodpay a:hover{border-bottom-color:var(--hp-accent2)}
+.hoodpay-fine{font-size:12px;color:var(--hp-dim);margin-top:12px;text-align:center}
+.hoodpay-err-box{border-color:rgba(255,92,92,.45)}
+@media (max-width:360px){.hoodpay{padding:14px}.hoodpay-amount{font-size:28px}}
+@media (prefers-reduced-motion:reduce){.hoodpay-spin,.hoodpay-check{animation:none}}
+`,Or=!1;function _r(e=document){if(Or&&e.querySelector("style[data-hood-pay]"))return;let t=e.createElement("style");t.setAttribute("data-hood-pay",""),t.textContent=si,e.head.appendChild(t),Or=!0}function eo(e){if(typeof e!="object"||e===null)throw new TypeError("checkout config must be an object");let t=e;for(let n of["onSuccess","onError","onStateChange"])if(t[n]!==void 0&&typeof t[n]!="function")throw new TypeError(`${n} must be a function`);let r={request:ot({v:1,network:t.network??"mainnet",payTo:t.payTo,amount:t.amount,token:t.token,memo:t.memo,reference:t.reference,router:t.router})};return t.onSuccess&&(r.onSuccess=t.onSuccess),t.onError&&(r.onError=t.onError),t.onStateChange&&(r.onStateChange=t.onStateChange),r}function jr(e){return`${e.slice(0,6)}\u2026${e.slice(-4)}`}async function qr(e,t,o,r){let n=await e.request({method:"eth_call",params:[{to:t,data:o},"latest"]});return Gt({abi:q,functionName:r,data:n})}async function Vr(e,t,o){return await e.request({method:"eth_sendTransaction",params:[{from:t,to:o.to,data:o.data,value:"0x0"}]})}async function Wr(e,t,o=12e4){let r=Date.now();for(;;){let n=await e.request({method:"eth_getTransactionReceipt",params:[t]});if(n?.blockNumber)return n;if(Date.now()-r>o)throw new Error("timed out waiting for the transaction to mine");await new Promise(i=>setTimeout(i,700))}}function Xr(e){if(typeof e=="object"&&e!==null){if(e.code===4001)return"You rejected the request in your wallet.";let o=e.message;if(typeof o=="string"&&o.length>0)return o.split(`
+`)[0].slice(0,200)}return String(e)}function to(e,t){let o=typeof e=="string"?document.querySelector(e):e;if(!o)throw new TypeError(`mountCheckout: no element matches ${String(e)}`);let{request:r,onSuccess:n,onError:i,onStateChange:a}=eo(t),s=_(r.network),c=jt(r);_r(o.ownerDocument);let p=o.ownerDocument.createElement("div");p.className="hoodpay",o.replaceChildren(p);let y=!1,h="",T=m=>{y||a?.(m)},u=(m,f,l)=>{let b=o.ownerDocument.createElement(m);return f&&(b.className=f),l!==void 0&&(b.textContent=l),b},U=()=>{let m=u("div","hoodpay-head"),f=u("span","hoodpay-brand");f.append("hood",Object.assign(u("b"),{textContent:"pay"}));let l=u("span","hoodpay-net",r.network==="testnet"?"testnet 46630":"chain 4663");return l.dataset.net=r.network,m.append(f,l),m},ne=()=>{let m=u("dl"),f=(l,b)=>{let E=u("div","hoodpay-row");return E.append(u("dt",void 0,l),u("dd",void 0,b)),E};return m.append(f("To",jr(r.payTo)),f("Token",`${c.symbol} (${c.decimals} decimals)`)),r.reference&&m.append(f("Reference",jr(r.reference))),m},Qr=(m,f)=>{let l=u("div","hoodpay-status");return f&&l.append(u("span","hoodpay-spin")),l.append(u("span",void 0,m)),l};function ve(){if(p.replaceChildren(U()),r.amount==="dynamic"){p.append(u("span","hoodpay-label",`Amount (${c.symbol})`));let f=u("input","hoodpay-input");f.type="text",f.inputMode="decimal",f.placeholder="10.00",f.value=h,f.setAttribute("aria-label",`Amount in ${c.symbol}`),f.addEventListener("input",()=>{h=f.value.trim()}),p.append(f)}else{let f=u("div","hoodpay-amount",r.amount);f.append(Object.assign(u("small"),{textContent:c.symbol})),p.append(f)}r.memo&&p.append(u("p","hoodpay-memo",r.memo)),p.append(ne());let m=u("button","hoodpay-btn",r.amount==="dynamic"?"Pay":`Pay ${r.amount} ${c.symbol}`);m.type="button",m.addEventListener("click",()=>void en()),p.append(m),p.append(u("p","hoodpay-fine","Non-custodial. Your wallet signs; funds go straight to the merchant.")),T({step:"review"})}function Yr(m){p.replaceChildren(U(),u("p","hoodpay-memo","Choose a wallet to pay with"));let f=u("div","hoodpay-wallets");f.setAttribute("role","list");for(let b of m){let E=u("button","hoodpay-wallet");E.type="button";let v=u("img");v.src=b.info.icon,v.alt="",E.append(v,u("span",void 0,b.info.name)),E.addEventListener("click",()=>void ro(b)),f.append(E)}p.append(f);let l=u("button","hoodpay-btn secondary","Back");l.type="button",l.addEventListener("click",ve),p.append(l),T({step:"choose-wallet",wallets:m.length})}function G(m,f){p.replaceChildren(U()),r.memo&&p.append(u("p","hoodpay-memo",r.memo)),p.append(Qr(m,!0)),T(f)}function Zr(m,f){let l=ee(m,c.decimals),b=ee(f,c.decimals);p.replaceChildren(U());let E=u("div","hoodpay-status hoodpay-err-box");E.append(u("span","hoodpay-warnc","!"),u("span",void 0,`Not enough ${c.symbol}: you hold ${l}, this payment needs ${b}.`)),p.append(E);let v=u("p","hoodpay-fine");if(r.network==="testnet"){let ie=u("a",void 0,"Get testnet funds from the faucet");ie.setAttribute("href","https://faucet.testnet.chain.robinhood.com/"),ie.setAttribute("target","_blank"),ie.setAttribute("rel","noopener noreferrer"),v.append(ie)}else v.textContent="Fund your wallet with USDG on Robinhood Chain, then try again.";p.append(v);let N=u("button","hoodpay-btn secondary","Try again");N.type="button",N.addEventListener("click",ve),p.append(N),T({step:"insufficient",balance:l,needed:b})}function st(m,f=!0){p.replaceChildren(U());let l=u("div","hoodpay-status hoodpay-err-box");if(l.append(u("span","hoodpay-err","\xD7"),u("span",void 0,m)),p.append(l),f){let b=u("button","hoodpay-btn secondary","Try again");b.type="button",b.addEventListener("click",ve),p.append(b)}T({step:"error",message:m,recoverable:f}),i?.(new Error(m))}function Jr(m){p.replaceChildren(U());let f=u("div","hoodpay-status");f.append(u("span","hoodpay-check","\u2713"));let l=u("div");l.append(u("div","hoodpay-ok",`Paid ${m.amount} ${m.tokenSymbol}`));let b=u("a",void 0,"View receipt on Blockscout");b.setAttribute("href",m.explorerUrl),b.setAttribute("target","_blank"),b.setAttribute("rel","noopener noreferrer"),l.append(b),f.append(l),p.append(f,ne()),T({step:"success",receipt:m}),n?.(m)}function oo(){if(r.amount!=="dynamic")return gr(r);if(!/^(0|[1-9]\d{0,11})(\.\d{1,18})?$/.test(h))throw new RangeError("Enter the amount as a plain decimal, e.g. 10.00");let m=te(h,c.decimals);if(m<=0n)throw new RangeError("Amount must be greater than zero");return m}async function en(){let m;try{m=oo()}catch(l){st(Xr(l));return}G("Looking for wallets\u2026",{step:"discovering"});let f=await Zt();if(!y){if(f.length===0){st("No wallet found. Install an EIP-6963 wallet (MetaMask, Rabby, \u2026) and reload.",!0);return}f.length===1?ro(f[0],m):Yr(f)}}async function ro(m,f){try{let l=f??oo();G(`Connecting ${m.info.name}\u2026`,{step:"connecting",wallet:m.info.name});let{address:b}=await Jt(m.provider,{network:r.network});if(y)return;let E=await qr(m.provider,c.address,z({abi:q,functionName:"balanceOf",args:[b]}),"balanceOf");if(E<l){Zr(E,l);return}let v;if(r.reference&&r.router){if(await qr(m.provider,c.address,z({abi:q,functionName:"allowance",args:[b,r.router]}),"allowance")<l){G(`Approve ${c.symbol} in your wallet (1 of 2)\u2026`,{step:"approving"});let tn=await Vr(m.provider,b,Hr(c.address,r.router,l));if(G("Waiting for the approval to mine\u2026",{step:"approving"}),(await Wr(m.provider,tn)).status!=="0x1")throw new Error("The approval transaction reverted.")}v=Gr(r.router,c.address,r.payTo,l,r.reference),G("Confirm the payment in your wallet (2 of 2)\u2026",{step:"paying"})}else v=zr(c.address,r.payTo,l),G("Confirm the payment in your wallet\u2026",{step:"paying"});let N=await Vr(m.provider,b,v);if(G("Payment sent - waiting for confirmation\u2026",{step:"confirming",txHash:N}),(await Wr(m.provider,N)).status!=="0x1")throw new Error("The payment transaction reverted.");let no={txHash:N,payer:b,amountRaw:l.toString(),amount:ee(l,c.decimals),tokenSymbol:c.symbol,network:r.network,explorerUrl:yr(r.network,N)};r.reference&&(no.reference=r.reference),Jr(no)}catch(l){y||st(Xr(l))}}return ve(),{request:r,destroy(){y=!0,p.remove()}}}function ci(e){let t=e.dataset,o={payTo:t.payTo??"",amount:t.amount??""};return(t.network==="mainnet"||t.network==="testnet")&&(o.network=t.network),t.memo&&(o.memo=t.memo),t.reference&&(o.reference=t.reference),t.router&&(o.router=t.router),t.tokenAddress&&t.tokenSymbol&&t.tokenDecimals&&(o.token={address:t.tokenAddress,symbol:t.tokenSymbol,decimals:Number(t.tokenDecimals)}),o}function Kr(){for(let e of Array.from(document.querySelectorAll("[data-hoodpay]")))if(e.dataset.hoodpayMounted!=="true"){e.dataset.hoodpayMounted="true";try{to(e,ci(e))}catch(t){e.textContent=`hood-pay: ${t instanceof Error?t.message:String(t)}`}}}var pi={version:"0.1.0",mount:to,validateConfig:eo,decodePaymentRequest:Er,encodePaymentRequest:qt,paymentLinkUrl:Ar};window.HoodPay=pi;document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Kr,{once:!0}):Kr();})();
diff --git a/robinhood/hood-pay/docs/index.html b/robinhood/hood-pay/docs/index.html
new file mode 100644
index 000000000..ca4c8afcc
--- /dev/null
+++ b/robinhood/hood-pay/docs/index.html
@@ -0,0 +1,182 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ <title>hood-pay - USDG checkout for Robinhood Chain</title>
+ <meta name="description" content="Stripe-Checkout-grade USDG payments on Robinhood Chain: an embeddable checkout widget, hosted payment links that run entirely on GitHub Pages, and a reorg-safe merchant verification library." />
+ <link rel="stylesheet" href="styles.css" />
+</head>
+<body>
+ <nav class="nav">
+ <div class="wrap nav-inner">
+ <span class="brand">hood<b>pay</b></span>
+ <div class="nav-links">
+ <a href="#demo">Demo</a>
+ <a href="#embed">Embed</a>
+ <a href="links.html">Payment links</a>
+ <a href="verify.html">Verify</a>
+ <a href="security.html">Security</a>
+ <a class="cta" href="https://github.com/nirholas/hood-pay">GitHub</a>
+ </div>
+ </div>
+ </nav>
+
+ <header class="hero">
+ <div class="wrap hero-grid">
+ <div>
+ <span class="eyebrow"><span class="dot"></span> USDG · Robinhood Chain · 4663</span>
+ <h1>Accept <span class="grad">USDG</span> like Stripe accepts cards.</h1>
+ <p class="lede">An embeddable checkout widget, hosted payment links that run with no backend, and a reorg-safe verifier with webhooks. Non-custodial by construction.</p>
+ <div class="hero-actions">
+ <a class="btn primary" href="#demo">Try the live demo</a>
+ <a class="btn" href="#embed">Copy the embed</a>
+ </div>
+ <div class="status-strip">
+ <span class="chip"><span class="live">●</span> mainnet <b id="mainnet-block">…</b></span>
+ <span class="chip">testnet <b id="testnet-block">…</b></span>
+ <span class="chip">USDG <b id="usdg-info">…</b></span>
+ </div>
+ </div>
+
+ <div id="demo" class="demo-card">
+ <h3>Live testnet checkout</h3>
+ <p class="muted">Real widget, real chain 46630. Connect an EIP-6963 wallet, switch to Robinhood testnet, pay test USDG. Nothing here is a mock.</p>
+ <div id="checkout"></div>
+ </div>
+ </div>
+ </header>
+
+ <section id="features">
+ <div class="wrap">
+ <h2 class="section-title">Three pieces, each usable alone</h2>
+ <p class="section-sub">Ship a whole checkout, or drop in just the part you need. Every module is typed, tree-shakeable, and verified against on-chain USDG.</p>
+ <div class="grid">
+ <div class="feature">
+ <div class="ic">W</div>
+ <h4>Checkout widget</h4>
+ <p>One <code class="inline">&lt;script&gt;</code> and one div. Connect wallet, ensure chain 4663, pay USDG. Under 27 kB gzipped, every visual state designed.</p>
+ </div>
+ <div class="feature">
+ <div class="ic">L</div>
+ <h4>Hosted payment links</h4>
+ <p>The request is encoded in the URL fragment, so a link is a full checkout that runs entirely client-side. No server, no database, no fee.</p>
+ </div>
+ <div class="feature">
+ <div class="ic">V</div>
+ <h4>Merchant verify</h4>
+ <p>A reorg-safe watcher confirms amounts on-chain (never from the DOM), fires signed webhooks, and records to an idempotent SQLite ledger.</p>
+ </div>
+ </div>
+ </div>
+ </section>
+
+ <section id="embed">
+ <div class="wrap">
+ <h2 class="section-title">Embed in two lines</h2>
+ <p class="section-sub">Point <code class="inline">data-pay-to</code> at your address, set an amount, done. The buyer's wallet signs; funds go straight to you.</p>
+ <div class="codewrap">
+ <button class="copy" data-copy="embed-code">Copy</button>
+ <pre id="embed-code"><span class="c">&lt;!-- your merchant address + the amount you want to charge --&gt;</span>
+<span class="k">&lt;div</span> data-hoodpay
+ data-pay-to=<span class="s">"0x4022de2D36C334E73C7a108805Cea11C0564f402"</span>
+ data-amount=<span class="s">"25.00"</span>
+ data-memo=<span class="s">"Order 1042"</span><span class="k">&gt;&lt;/div&gt;</span>
+<span class="k">&lt;script</span> src=<span class="s">"https://nirholas.github.io/hood-pay/hood-pay.min.js"</span><span class="k">&gt;&lt;/script&gt;</span></pre>
+ </div>
+
+ <h3 style="margin-top:28px; font-size:1.15rem; letter-spacing:-0.01em;">Or mount it programmatically</h3>
+ <div class="codewrap">
+ <button class="copy" data-copy="js-code">Copy</button>
+ <pre id="js-code"><span class="k">import</span> { mountCheckout } <span class="k">from</span> <span class="s">'hood-pay/widget'</span>
+
+mountCheckout(<span class="s">'#checkout'</span>, {
+ payTo: <span class="s">'0x4022de2D36C334E73C7a108805Cea11C0564f402'</span>,
+ amount: <span class="s">'25.00'</span>, <span class="c">// or 'dynamic' for tips / pay-what-you-want</span>
+ memo: <span class="s">'Order 1042'</span>,
+ onSuccess: (receipt) =&gt; console.log(<span class="s">'paid'</span>, receipt.txHash)
+})</pre>
+ </div>
+ </div>
+ </section>
+
+ <section id="verify-cta">
+ <div class="wrap split">
+ <div class="prose">
+ <h3>Confirm payments on your server</h3>
+ <p>The widget never decides whether a payment is real - your verifier does, by reading the chain. <code class="inline">awaitPayment</code> watches for the transfer (or router event), waits out reorgs, and returns a terminal status your shop can trust.</p>
+ <ul>
+ <li><strong>paid / underpaid / overpaid / expired</strong> - every outcome is explicit.</li>
+ <li>Signed webhooks, Stripe-style, with an idempotent SQLite ledger.</li>
+ <li>Refund helpers for overages and abandoned invoices.</li>
+ </ul>
+ <p><a href="verify.html">Read the verify + webhook guide →</a></p>
+ </div>
+ <div class="codewrap">
+ <button class="copy" data-copy="verify-code">Copy</button>
+ <pre id="verify-code"><span class="k">import</span> { networkInfo } <span class="k">from</span> <span class="s">'hood-pay'</span>
+<span class="k">import</span> { awaitPayment, createReader } <span class="k">from</span> <span class="s">'hood-pay/verify'</span>
+<span class="k">import</span> { parseUnits } <span class="k">from</span> <span class="s">'viem'</span>
+
+<span class="k">const</span> info = networkInfo(<span class="s">'mainnet'</span>)
+<span class="k">const</span> reader = createReader(<span class="s">'mainnet'</span>)
+
+<span class="k">const</span> result = <span class="k">await</span> awaitPayment(
+ {
+ token: info.usdg.address,
+ payTo: <span class="s">'0x4022de2D36C334E73C7a108805Cea11C0564f402'</span>,
+ expectedRaw: parseUnits(<span class="s">'25.00'</span>, info.usdg.decimals)
+ },
+ { reader, fromBlock: <span class="k">await</span> reader.getBlockNumber() }
+)
+<span class="c">// result.status === 'paid'</span></pre>
+ </div>
+ </div>
+ </section>
+
+ <footer>
+ <div class="wrap footer-inner">
+ <span>Built by <a href="https://x.com/nichxbt">nirholas</a> · <a href="https://three.ws">three.ws</a></span>
+ <span>MIT · USDG is a plain ERC-20 (6 decimals, no permit) on Robinhood Chain 4663</span>
+ </div>
+ </footer>
+
+ <script src="live.js"></script>
+ <script src="hood-pay.min.js"></script>
+ <script>
+ // Live testnet demo. Uses test USDG on chain 46630 - the widget builds an
+ // unsigned transfer for the buyer's own wallet to sign; this page holds no
+ // keys and moves no funds on its own.
+ (function () {
+ var TESTNET_USDG = { address: '0x7E955252E15c84f5768B83c41a71F9eba181802F', symbol: 'USDG', decimals: 6 };
+ function mount() {
+ if (!window.HoodPay) { setTimeout(mount, 60); return; }
+ try {
+ window.HoodPay.mount('#checkout', {
+ payTo: '0x4022de2D36C334E73C7a108805Cea11C0564f402',
+ amount: '1.00',
+ network: 'testnet',
+ token: TESTNET_USDG,
+ memo: 'hood-pay live demo (testnet)'
+ });
+ } catch (e) {
+ document.getElementById('checkout').textContent = 'demo failed to mount: ' + e.message;
+ }
+ }
+ mount();
+ })();
+
+ // Copy buttons.
+ document.querySelectorAll('.copy').forEach(function (btn) {
+ btn.addEventListener('click', function () {
+ var el = document.getElementById(btn.getAttribute('data-copy'));
+ navigator.clipboard.writeText(el.innerText).then(function () {
+ btn.textContent = 'Copied';
+ btn.classList.add('ok');
+ setTimeout(function () { btn.textContent = 'Copy'; btn.classList.remove('ok'); }, 1400);
+ });
+ });
+ });
+ </script>
+</body>
+</html>
diff --git a/robinhood/hood-pay/docs/links.html b/robinhood/hood-pay/docs/links.html
new file mode 100644
index 000000000..0e4027546
--- /dev/null
+++ b/robinhood/hood-pay/docs/links.html
@@ -0,0 +1,167 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ <title>Payment links - hood-pay</title>
+ <meta name="description" content="Generate a hosted USDG payment link for Robinhood Chain. Entirely client-side: the request is encoded into a URL fragment you can share anywhere." />
+ <link rel="stylesheet" href="styles.css" />
+</head>
+<body>
+ <nav class="nav">
+ <div class="wrap nav-inner">
+ <span class="brand"><a href="index.html" style="color:inherit;text-decoration:none;">hood<b>pay</b></a></span>
+ <div class="nav-links">
+ <a href="index.html#demo">Demo</a>
+ <a href="index.html#embed">Embed</a>
+ <a href="links.html">Payment links</a>
+ <a href="verify.html">Verify</a>
+ <a href="security.html">Security</a>
+ <a class="cta" href="https://github.com/nirholas/hood-pay">GitHub</a>
+ </div>
+ </div>
+ </nav>
+
+ <section style="border-top:0;">
+ <div class="wrap">
+ <h1 style="font-size:clamp(1.8rem,4vw,2.6rem);letter-spacing:-0.03em;margin:0 0 8px;">Payment links</h1>
+ <p class="section-sub">Encode a merchant address, amount, and memo into a shareable link. It renders a full checkout with no backend - the request lives in the URL fragment, which never leaves the browser.</p>
+
+ <div class="split">
+ <form id="form" class="card" autocomplete="off">
+ <div class="field">
+ <label for="payTo">Pay to (merchant address)</label>
+ <input id="payTo" type="text" placeholder="0x…" spellcheck="false" />
+ <div class="hint">Checksum-validated. A mistyped mixed-case address is rejected before a link is made.</div>
+ </div>
+ <div class="row2">
+ <div class="field">
+ <label for="amount">Amount</label>
+ <input id="amount" type="text" placeholder="25.00" inputmode="decimal" />
+ <div class="hint">A decimal, or the word <code class="inline">dynamic</code> for tips.</div>
+ </div>
+ <div class="field">
+ <label for="network">Network</label>
+ <select id="network">
+ <option value="mainnet">mainnet · 4663</option>
+ <option value="testnet">testnet · 46630</option>
+ </select>
+ </div>
+ </div>
+ <div class="field">
+ <label for="memo">Memo (optional, off-chain)</label>
+ <input id="memo" type="text" placeholder="Invoice 7" maxlength="280" />
+ </div>
+ <div class="field">
+ <label for="baseUrl">Checkout host</label>
+ <input id="baseUrl" type="text" value="https://nirholas.github.io/hood-pay/pay.html" spellcheck="false" />
+ <div class="hint">Any host that serves <code class="inline">pay.html</code> works - self-host it for free on your own Pages.</div>
+ </div>
+ </form>
+
+ <div>
+ <div class="card">
+ <label style="display:block;font-size:13px;color:var(--dim);margin-bottom:8px;font-weight:500;">Payment link</label>
+ <div id="linkOut" class="out">Fill the form to generate a link.</div>
+ <div class="hero-actions" style="margin-top:14px;">
+ <button id="copyLink" class="btn" type="button">Copy link</button>
+ <a id="openLink" class="btn primary" href="#" target="_blank" rel="noopener" style="pointer-events:none;opacity:0.5;">Open checkout</a>
+ </div>
+ </div>
+ <div class="card">
+ <label style="display:block;font-size:13px;color:var(--dim);margin-bottom:8px;font-weight:500;">Raw fragment (host it anywhere)</label>
+ <div id="fragOut" class="out">#…</div>
+ </div>
+ </div>
+ </div>
+
+ <h3 style="margin-top:36px;font-size:1.15rem;letter-spacing:-0.01em;">Or from the CLI</h3>
+ <div class="codewrap">
+ <button class="copy" data-copy="cli-code">Copy</button>
+ <pre id="cli-code"><span class="c"># prints the hosted link, plus the raw fragment on stderr</span>
+npx hood-pay link --to 0x4022de2D36C334E73C7a108805Cea11C0564f402 --amount 25 --memo <span class="s">"invoice 7"</span></pre>
+ </div>
+ </div>
+ </section>
+
+ <footer>
+ <div class="wrap footer-inner">
+ <span>Built by <a href="https://x.com/nichxbt">nirholas</a> · <a href="https://three.ws">three.ws</a></span>
+ <span>MIT</span>
+ </div>
+ </footer>
+
+ <script src="hood-pay.min.js"></script>
+ <script>
+ (function () {
+ var ids = ['payTo', 'amount', 'network', 'memo', 'baseUrl'];
+ var els = {};
+ ids.forEach(function (id) { els[id] = document.getElementById(id); });
+ var linkOut = document.getElementById('linkOut');
+ var fragOut = document.getElementById('fragOut');
+ var openLink = document.getElementById('openLink');
+ var currentLink = '';
+
+ function regenerate() {
+ var payTo = els.payTo.value.trim();
+ var amount = els.amount.value.trim();
+ if (!payTo || !amount) {
+ linkOut.className = 'out';
+ linkOut.textContent = 'Fill the form to generate a link.';
+ fragOut.textContent = '#…';
+ openLink.style.pointerEvents = 'none';
+ openLink.style.opacity = '0.5';
+ currentLink = '';
+ return;
+ }
+ var request = { v: 1, network: els.network.value, payTo: payTo, amount: amount };
+ if (els.memo.value.trim()) request.memo = els.memo.value.trim();
+ try {
+ var base = els.baseUrl.value.trim() || 'https://nirholas.github.io/hood-pay/pay.html';
+ var url = window.HoodPay.paymentLinkUrl(request, base);
+ var fragment = window.HoodPay.encodePaymentRequest(request);
+ linkOut.className = 'out';
+ linkOut.textContent = url;
+ fragOut.textContent = '#' + fragment;
+ openLink.href = url;
+ openLink.style.pointerEvents = 'auto';
+ openLink.style.opacity = '1';
+ currentLink = url;
+ } catch (e) {
+ linkOut.className = 'out err';
+ linkOut.textContent = e.message;
+ fragOut.textContent = '#…';
+ openLink.style.pointerEvents = 'none';
+ openLink.style.opacity = '0.5';
+ currentLink = '';
+ }
+ }
+
+ function bind() {
+ if (!window.HoodPay) { setTimeout(bind, 60); return; }
+ ids.forEach(function (id) {
+ els[id].addEventListener('input', regenerate);
+ els[id].addEventListener('change', regenerate);
+ });
+ document.getElementById('copyLink').addEventListener('click', function () {
+ if (!currentLink) return;
+ navigator.clipboard.writeText(currentLink);
+ var b = document.getElementById('copyLink');
+ b.textContent = 'Copied'; setTimeout(function () { b.textContent = 'Copy link'; }, 1400);
+ });
+ document.querySelectorAll('.copy').forEach(function (btn) {
+ btn.addEventListener('click', function () {
+ var el = document.getElementById(btn.getAttribute('data-copy'));
+ navigator.clipboard.writeText(el.innerText).then(function () {
+ btn.textContent = 'Copied'; btn.classList.add('ok');
+ setTimeout(function () { btn.textContent = 'Copy'; btn.classList.remove('ok'); }, 1400);
+ });
+ });
+ });
+ regenerate();
+ }
+ bind();
+ })();
+ </script>
+</body>
+</html>
diff --git a/robinhood/hood-pay/docs/live.js b/robinhood/hood-pay/docs/live.js
new file mode 100644
index 000000000..654840319
--- /dev/null
+++ b/robinhood/hood-pay/docs/live.js
@@ -0,0 +1,99 @@
+/* Live read-only chain data for the docs pages. No dependencies, no backend:
+ these are plain JSON-RPC calls against the public Robinhood Chain RPC, so
+ they work directly on GitHub Pages. Payment safety: this file NEVER signs,
+ sends, or constructs a spend - it only reads block height and the USDG
+ token's decimals/symbol. */
+(function () {
+ 'use strict';
+
+ var NETWORKS = {
+ mainnet: {
+ chainId: 4663,
+ rpc: 'https://rpc.mainnet.chain.robinhood.com',
+ usdg: '0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168',
+ explorer: 'https://robinhoodchain.blockscout.com'
+ },
+ testnet: {
+ chainId: 46630,
+ rpc: 'https://rpc.testnet.chain.robinhood.com',
+ usdg: '0x7E955252E15c84f5768B83c41a71F9eba181802F',
+ explorer: 'https://explorer.testnet.chain.robinhood.com'
+ }
+ };
+
+ function rpc(url, method, params) {
+ return fetch(url, {
+ method: 'POST',
+ headers: { 'content-type': 'application/json' },
+ body: JSON.stringify({ jsonrpc: '2.0', id: 1, method: method, params: params || [] })
+ })
+ .then(function (r) { return r.json(); })
+ .then(function (j) {
+ if (j.error) throw new Error(j.error.message || 'rpc error');
+ return j.result;
+ });
+ }
+
+ // Decode an ABI-encoded uint8 (decimals) from a 32-byte hex word.
+ function decodeUint(hex) {
+ return parseInt(hex, 16);
+ }
+
+ // Decode an ABI-encoded dynamic string (offset, length, bytes).
+ function decodeString(hex) {
+ var data = hex.slice(2);
+ var len = parseInt(data.slice(64, 128), 16);
+ var bytes = data.slice(128, 128 + len * 2);
+ var out = '';
+ for (var i = 0; i < bytes.length; i += 2) out += String.fromCharCode(parseInt(bytes.substr(i, 2), 16));
+ return out;
+ }
+
+ function setText(id, text) {
+ var el = document.getElementById(id);
+ if (el) el.textContent = text;
+ }
+
+ function blockHeight(name) {
+ var net = NETWORKS[name];
+ return rpc(net.rpc, 'eth_blockNumber').then(function (hex) {
+ return parseInt(hex, 16);
+ });
+ }
+
+ function usdgInfo(name) {
+ var net = NETWORKS[name];
+ // decimals() selector 0x313ce567, symbol() selector 0x95d89b41
+ return Promise.all([
+ rpc(net.rpc, 'eth_call', [{ to: net.usdg, data: '0x313ce567' }, 'latest']),
+ rpc(net.rpc, 'eth_call', [{ to: net.usdg, data: '0x95d89b41' }, 'latest'])
+ ]).then(function (r) {
+ return { decimals: decodeUint(r[0]), symbol: decodeString(r[1]) };
+ });
+ }
+
+ // Public API for pages that want raw access.
+ window.HoodPayLive = { NETWORKS: NETWORKS, rpc: rpc, blockHeight: blockHeight, usdgInfo: usdgInfo };
+
+ // Auto-populate the status strip if present.
+ function refreshStrip() {
+ blockHeight('mainnet').then(function (n) {
+ setText('mainnet-block', '#' + n.toLocaleString());
+ }).catch(function () { setText('mainnet-block', 'unreachable'); });
+
+ blockHeight('testnet').then(function (n) {
+ setText('testnet-block', '#' + n.toLocaleString());
+ }).catch(function () { setText('testnet-block', 'unreachable'); });
+
+ usdgInfo('mainnet').then(function (info) {
+ setText('usdg-info', info.symbol + ' · ' + info.decimals + ' decimals');
+ }).catch(function () { setText('usdg-info', 'unreachable'); });
+ }
+
+ if (document.getElementById('mainnet-block') || document.getElementById('usdg-info')) {
+ document.addEventListener('DOMContentLoaded', function () {
+ refreshStrip();
+ setInterval(refreshStrip, 12000);
+ });
+ }
+})();
diff --git a/robinhood/hood-pay/docs/pay.html b/robinhood/hood-pay/docs/pay.html
new file mode 100644
index 000000000..8722b3f0a
--- /dev/null
+++ b/robinhood/hood-pay/docs/pay.html
@@ -0,0 +1,69 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ <title>Pay - hood-pay</title>
+ <meta name="description" content="A hosted hood-pay checkout. The payment request is encoded in this page's URL fragment and never leaves your browser." />
+ <link rel="stylesheet" href="styles.css" />
+</head>
+<body>
+ <div class="pay-page">
+ <div class="pay-shell">
+ <a class="pay-back" href="index.html">← hood-pay</a>
+ <div id="checkout"></div>
+ <div id="fallback" style="display:none" class="pay-error">
+ <h2>No payment request</h2>
+ <p id="fallback-msg">This link is missing its payment details. A valid hood-pay link looks like <code class="inline">pay.html#1.&lt;encoded&gt;</code>. Generate one on the <a href="links.html">payment links</a> page.</p>
+ </div>
+ <p class="hero-actions" style="margin-top:16px; justify-content:center;">
+ <span class="badge">Non-custodial · your wallet signs</span>
+ </p>
+ </div>
+ </div>
+
+ <script src="hood-pay.min.js"></script>
+ <script>
+ // The request is in the URL fragment (never sent to any server). We decode
+ // it client-side and mount the checkout. This page holds no keys.
+ (function () {
+ function showError(message) {
+ document.getElementById('checkout').style.display = 'none';
+ document.getElementById('fallback').style.display = 'block';
+ if (message) document.getElementById('fallback-msg').textContent = message;
+ }
+ function boot() {
+ if (!window.HoodPay) { setTimeout(boot, 60); return; }
+ var frag = window.location.hash.replace(/^#/, '');
+ if (!frag) { showError(null); return; }
+ var request;
+ try {
+ request = window.HoodPay.decodePaymentRequest(frag);
+ } catch (e) {
+ showError('This payment link is malformed: ' + e.message);
+ return;
+ }
+ document.title = 'Pay ' + (request.amount === 'dynamic' ? '' : request.amount + ' ') +
+ (request.token ? request.token.symbol : 'USDG') + ' - hood-pay';
+ try {
+ var config = {
+ payTo: request.payTo,
+ amount: request.amount,
+ network: request.network
+ };
+ if (request.token) config.token = request.token;
+ if (request.memo) config.memo = request.memo;
+ if (request.reference) config.reference = request.reference;
+ if (request.router) config.router = request.router;
+ window.HoodPay.mount('#checkout', config);
+ } catch (e) {
+ showError('Could not render this checkout: ' + e.message);
+ }
+ }
+ boot();
+ // Re-render if the fragment changes (e.g. a new link pasted in place).
+ window.addEventListener('hashchange', function () { window.location.reload(); });
+ })();
+ </script>
+</body>
+</html>
diff --git a/robinhood/hood-pay/docs/styles.css b/robinhood/hood-pay/docs/styles.css
new file mode 100644
index 000000000..5a9f4cafc
--- /dev/null
+++ b/robinhood/hood-pay/docs/styles.css
@@ -0,0 +1,212 @@
+/* hood-pay docs - dark-first, one accent gradient, system type stack.
+ Aesthetic reference: Linear / Vercel / Stripe docs. Self-hosted, no CDN. */
+:root {
+ --bg: #0b0e12;
+ --bg-soft: #0f131a;
+ --panel: #12161d;
+ --panel-2: #161c25;
+ --line: #232a35;
+ --line-soft: #1b212b;
+ --text: #e8edf4;
+ --dim: #8b96a5;
+ --dimmer: #626d7c;
+ --accent: #00c805;
+ --accent-2: #00e5a0;
+ --danger: #ff5c5c;
+ --warn: #ffb454;
+ --radius: 14px;
+ --maxw: 1080px;
+ --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
+ --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
+}
+* { box-sizing: border-box; }
+html { scroll-behavior: smooth; }
+body {
+ margin: 0;
+ font-family: var(--sans);
+ background: var(--bg);
+ color: var(--text);
+ line-height: 1.6;
+ font-size: 16px;
+ -webkit-font-smoothing: antialiased;
+}
+body::before {
+ content: "";
+ position: fixed;
+ inset: 0;
+ z-index: -1;
+ background:
+ radial-gradient(60rem 40rem at 78% -10%, rgba(0, 229, 160, 0.08), transparent 60%),
+ radial-gradient(50rem 30rem at 5% 0%, rgba(0, 200, 5, 0.06), transparent 55%);
+ pointer-events: none;
+}
+a { color: var(--accent-2); text-decoration: none; }
+a:hover { text-decoration: underline; }
+a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
+ outline: 2px solid var(--accent-2);
+ outline-offset: 2px;
+ border-radius: 6px;
+}
+.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
+
+/* Top navigation */
+.nav {
+ position: sticky;
+ top: 0;
+ z-index: 20;
+ backdrop-filter: blur(12px);
+ background: rgba(11, 14, 18, 0.72);
+ border-bottom: 1px solid var(--line-soft);
+}
+.nav-inner { display: flex; align-items: center; gap: 18px; height: 60px; }
+.brand { font-weight: 700; letter-spacing: -0.02em; font-size: 17px; color: var(--text); }
+.brand b { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
+.nav-links { display: flex; gap: 20px; margin-left: auto; align-items: center; flex-wrap: wrap; }
+.nav-links a { color: var(--dim); font-size: 14px; font-weight: 500; }
+.nav-links a:hover { color: var(--text); text-decoration: none; }
+.nav-links a.cta {
+ color: #04110a;
+ background: linear-gradient(90deg, var(--accent), var(--accent-2));
+ padding: 7px 14px;
+ border-radius: 8px;
+ font-weight: 600;
+}
+.nav-links a.cta:hover { filter: brightness(1.08); }
+
+/* Hero */
+.hero { padding: 72px 0 40px; }
+.eyebrow {
+ display: inline-flex; align-items: center; gap: 8px;
+ font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em;
+ color: var(--accent-2); border: 1px solid rgba(0, 229, 160, 0.3);
+ border-radius: 999px; padding: 5px 12px; margin-bottom: 22px;
+}
+.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 0 rgba(0, 229, 160, 0.5); animation: pulse 2s infinite; }
+@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(0, 229, 160, 0.5); } 70% { box-shadow: 0 0 0 8px rgba(0, 229, 160, 0); } 100% { box-shadow: 0 0 0 0 rgba(0, 229, 160, 0); } }
+h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); line-height: 1.06; letter-spacing: -0.035em; margin: 0 0 18px; font-weight: 700; }
+h1 .grad { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
+.lede { font-size: clamp(1.05rem, 2.2vw, 1.28rem); color: var(--dim); max-width: 40ch; margin: 0 0 28px; }
+.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
+.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
+.btn {
+ display: inline-flex; align-items: center; gap: 8px;
+ font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
+ border-radius: 10px; padding: 12px 20px; border: 1px solid var(--line);
+ background: var(--panel); color: var(--text); transition: border-color 0.15s, transform 0.12s, filter 0.15s;
+}
+.btn:hover { border-color: var(--dim); text-decoration: none; }
+.btn:active { transform: translateY(1px); }
+.btn.primary { color: #04110a; border: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
+.btn.primary:hover { filter: brightness(1.08); }
+
+/* Live status strip */
+.status-strip { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 30px; }
+.chip {
+ display: inline-flex; align-items: center; gap: 8px;
+ border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px;
+ font-size: 13px; color: var(--dim); background: rgba(18, 22, 29, 0.6);
+ font-variant-numeric: tabular-nums;
+}
+.chip b { color: var(--text); font-weight: 600; }
+.chip .live { color: var(--accent-2); }
+
+/* Demo panel */
+.demo-card {
+ background: linear-gradient(180deg, var(--panel), var(--bg-soft));
+ border: 1px solid var(--line); border-radius: 20px; padding: 26px;
+ box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.7);
+}
+.demo-card h3 { margin: 0 0 4px; font-size: 15px; }
+.demo-card .muted { color: var(--dim); font-size: 13px; margin: 0 0 18px; }
+
+/* Sections */
+section { padding: 56px 0; border-top: 1px solid var(--line-soft); }
+.section-title { font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -0.02em; margin: 0 0 8px; }
+.section-sub { color: var(--dim); margin: 0 0 32px; max-width: 60ch; }
+
+/* Feature grid */
+.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
+.feature {
+ background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
+ padding: 22px; transition: border-color 0.15s, transform 0.15s;
+}
+.feature:hover { border-color: var(--line); transform: translateY(-2px); }
+.feature .ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; margin-bottom: 14px;
+ background: rgba(0, 229, 160, 0.1); color: var(--accent-2); font-weight: 700; }
+.feature h4 { margin: 0 0 6px; font-size: 15px; }
+.feature p { margin: 0; color: var(--dim); font-size: 14px; }
+
+/* Code blocks */
+pre {
+ background: #0a0d11; border: 1px solid var(--line); border-radius: 12px;
+ padding: 18px 20px; overflow-x: auto; font-family: var(--mono); font-size: 13.5px;
+ line-height: 1.65; color: #cdd6e2; margin: 0;
+}
+pre .k { color: #7ee787; }
+pre .s { color: #a5d6ff; }
+pre .c { color: var(--dimmer); }
+code.inline { font-family: var(--mono); font-size: 0.88em; background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 6px; padding: 1px 6px; }
+.codewrap { position: relative; }
+.copy {
+ position: absolute; top: 10px; right: 10px; font-size: 12px; font-family: var(--sans);
+ color: var(--dim); background: var(--panel-2); border: 1px solid var(--line); border-radius: 7px;
+ padding: 4px 10px; cursor: pointer; transition: color 0.15s, border-color 0.15s;
+}
+.copy:hover { color: var(--text); border-color: var(--dim); }
+.copy.ok { color: var(--accent-2); border-color: rgba(0, 229, 160, 0.4); }
+
+/* Two-col docs layout */
+.split { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
+.prose h3 { font-size: 1.15rem; margin: 26px 0 8px; letter-spacing: -0.01em; }
+.prose h3:first-child { margin-top: 0; }
+.prose p { color: var(--dim); }
+.prose ul { color: var(--dim); padding-left: 20px; }
+.prose li { margin: 5px 0; }
+.prose strong { color: var(--text); }
+.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 18px; }
+
+/* Table */
+table { width: 100%; border-collapse: collapse; font-size: 14px; }
+th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); }
+th { color: var(--dim); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
+td { color: var(--text); }
+td code { font-family: var(--mono); font-size: 0.85em; color: var(--accent-2); }
+
+/* Form (links generator) */
+.field { margin-bottom: 16px; }
+.field label { display: block; font-size: 13px; color: var(--dim); margin-bottom: 6px; font-weight: 500; }
+.field input, .field select, .field textarea {
+ width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
+ padding: 11px 13px; color: var(--text); font-family: inherit; font-size: 14px;
+}
+.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--dim); }
+.field .hint { font-size: 12px; color: var(--dimmer); margin-top: 5px; }
+.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
+.out {
+ background: #0a0d11; border: 1px solid var(--line); border-radius: 12px; padding: 16px;
+ font-family: var(--mono); font-size: 13px; word-break: break-all; color: #a5d6ff; min-height: 52px;
+}
+.out.err { color: var(--danger); }
+.badge { display: inline-block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--dim); }
+.badge.testnet { color: var(--warn); border-color: rgba(255, 180, 84, 0.4); }
+
+/* Footer */
+footer { border-top: 1px solid var(--line-soft); padding: 40px 0; color: var(--dim); font-size: 14px; }
+.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
+
+/* Pay page */
+.pay-page { min-height: 100vh; display: grid; place-items: center; padding: 40px 20px; }
+.pay-shell { width: 100%; max-width: 440px; }
+.pay-back { display: inline-block; margin-bottom: 18px; color: var(--dim); font-size: 14px; }
+.pay-error { background: var(--panel); border: 1px solid rgba(255, 92, 92, 0.4); border-radius: var(--radius); padding: 24px; text-align: center; }
+.pay-error h2 { margin: 0 0 8px; font-size: 18px; color: var(--danger); }
+.pay-error p { margin: 0; color: var(--dim); font-size: 14px; }
+
+@media (max-width: 860px) {
+ .hero-grid, .split { grid-template-columns: 1fr; }
+ .grid { grid-template-columns: 1fr; }
+ .row2 { grid-template-columns: 1fr; }
+ .hero { padding: 48px 0 24px; }
+ .nav-links a:not(.cta) { display: none; }
+}
+@media (prefers-reduced-motion: reduce) { * { animation: none !important; scroll-behavior: auto; } }
diff --git a/robinhood/hood-pay/package-lock.json b/robinhood/hood-pay/package-lock.json
new file mode 100644
index 000000000..f1afd0791
--- /dev/null
+++ b/robinhood/hood-pay/package-lock.json
@@ -0,0 +1,4678 @@
+{
+ "name": "hood-pay",
+ "version": "0.1.0",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "": {
+ "name": "hood-pay",
+ "version": "0.1.0",
+ "license": "MIT",
+ "dependencies": {
+ "hood-connect": "file:../hood-connect",
+ "hoodchain": "^0.1.1"
+ },
+ "bin": {
+ "hood-pay": "bin/hood-pay.mjs"
+ },
+ "devDependencies": {
+ "@types/node": "^24.0.0",
+ "esbuild": "^0.25.0",
+ "express": "^5.1.0",
+ "tsup": "^8.5.0",
+ "tsx": "^4.20.0",
+ "typescript": "^5.8.0",
+ "viem": "^2.55.0",
+ "vitest": "^3.2.0"
+ },
+ "engines": {
+ "node": ">=20"
+ },
+ "peerDependencies": {
+ "viem": "^2.55.0"
+ }
+ },
+ "../hood-connect": {
+ "version": "0.1.0",
+ "license": "MIT",
+ "dependencies": {
+ "hoodchain": "^0.1.1",
+ "viem": "^2.55.0"
+ },
+ "devDependencies": {
+ "@playwright/test": "^1.61.0",
+ "@tanstack/react-query": "^5.62.0",
+ "@tenkeylabs/dappwright": "^2.13.6",
+ "@types/node": "^24.0.0",
+ "@types/react": "^18.3.0",
+ "happy-dom": "^15.11.0",
+ "react": "^18.3.1",
+ "tsup": "^8.5.0",
+ "typescript": "^5.9.0",
+ "vitest": "^3.2.0",
+ "wagmi": "^2.16.0"
+ },
+ "engines": {
+ "node": ">=20"
+ },
+ "peerDependencies": {
+ "react": ">=18",
+ "wagmi": ">=2"
+ },
+ "peerDependenciesMeta": {
+ "react": {
+ "optional": true
+ },
+ "wagmi": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@adraffy/ens-normalize": {
+ "version": "1.11.1",
+ "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.11.1.tgz",
+ "integrity": "sha512-nhCBV3quEgesuf7c7KYfperqSS14T8bYuvJ8PcLJp6znkZpFc0AuW4qBtr8eKVyPPe/8RSr7sglCWPU5eaxwKQ==",
+ "license": "MIT"
+ },
+ "node_modules/@esbuild/aix-ppc64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz",
+ "integrity": "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "aix"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/android-arm": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.12.tgz",
+ "integrity": "sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/android-arm64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.12.tgz",
+ "integrity": "sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/android-x64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.12.tgz",
+ "integrity": "sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/darwin-arm64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz",
+ "integrity": "sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/darwin-x64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.12.tgz",
+ "integrity": "sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/freebsd-arm64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.12.tgz",
+ "integrity": "sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/freebsd-x64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.12.tgz",
+ "integrity": "sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-arm": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.12.tgz",
+ "integrity": "sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-arm64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.12.tgz",
+ "integrity": "sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-ia32": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.12.tgz",
+ "integrity": "sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-loong64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.12.tgz",
+ "integrity": "sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==",
+ "cpu": [
+ "loong64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-mips64el": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.12.tgz",
+ "integrity": "sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==",
+ "cpu": [
+ "mips64el"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-ppc64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.12.tgz",
+ "integrity": "sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-riscv64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.12.tgz",
+ "integrity": "sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-s390x": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.12.tgz",
+ "integrity": "sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==",
+ "cpu": [
+ "s390x"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-x64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.12.tgz",
+ "integrity": "sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/netbsd-arm64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.12.tgz",
+ "integrity": "sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/netbsd-x64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.12.tgz",
+ "integrity": "sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/openbsd-arm64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.12.tgz",
+ "integrity": "sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/openbsd-x64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.12.tgz",
+ "integrity": "sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/openharmony-arm64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.12.tgz",
+ "integrity": "sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openharmony"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/sunos-x64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.12.tgz",
+ "integrity": "sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "sunos"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/win32-arm64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.12.tgz",
+ "integrity": "sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/win32-ia32": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.12.tgz",
+ "integrity": "sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/win32-x64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.12.tgz",
+ "integrity": "sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@jridgewell/gen-mapping": {
+ "version": "0.3.13",
+ "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",
+ "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/sourcemap-codec": "^1.5.0",
+ "@jridgewell/trace-mapping": "^0.3.24"
+ }
+ },
+ "node_modules/@jridgewell/resolve-uri": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
+ "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@jridgewell/sourcemap-codec": {
+ "version": "1.5.5",
+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz",
+ "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@jridgewell/trace-mapping": {
+ "version": "0.3.31",
+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz",
+ "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/resolve-uri": "^3.1.0",
+ "@jridgewell/sourcemap-codec": "^1.4.14"
+ }
+ },
+ "node_modules/@noble/ciphers": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-1.3.0.tgz",
+ "integrity": "sha512-2I0gnIVPtfnMw9ee9h1dJG7tp81+8Ob3OJb3Mv37rx5L40/b0i7djjCVvGOVqc9AEIQyvyu1i6ypKdFw8R8gQw==",
+ "license": "MIT",
+ "engines": {
+ "node": "^14.21.3 || >=16"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/@noble/curves": {
+ "version": "1.9.1",
+ "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.9.1.tgz",
+ "integrity": "sha512-k11yZxZg+t+gWvBbIswW0yoJlu8cHOC7dhunwOzoWH/mXGBiYyR4YY6hAEK/3EUs4UpB8la1RfdRpeGsFHkWsA==",
+ "license": "MIT",
+ "dependencies": {
+ "@noble/hashes": "1.8.0"
+ },
+ "engines": {
+ "node": "^14.21.3 || >=16"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/@noble/hashes": {
+ "version": "1.8.0",
+ "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz",
+ "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==",
+ "license": "MIT",
+ "engines": {
+ "node": "^14.21.3 || >=16"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/@rollup/rollup-android-arm-eabi": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.62.2.tgz",
+ "integrity": "sha512-6o7ZLZK+BeenkZCFNDXqpbjw9bD6nuWonvS/lwQJp7NoVVxm6p3qE7qQ5jGuBjiFsgvqjD8mZAU5oWxTmbOeOg==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ]
+ },
+ "node_modules/@rollup/rollup-android-arm64": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.62.2.tgz",
+ "integrity": "sha512-BaH7BllCACHoH1LguOU56UItGfUWjujlO65kS9LAodViaN4bwIKd7oeW/ZHJ/4ljr/7MIiENnNy3HJ0zXv8Zkw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ]
+ },
+ "node_modules/@rollup/rollup-darwin-arm64": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.62.2.tgz",
+ "integrity": "sha512-v39RCCvj4He82I9sFmk+M1VZ0PLM9sfsLVikjfx2hYBNALhrrOR2D3JjQA6AhlaSOgcR+RzrKY7e1+bT6SUO/A==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ]
+ },
+ "node_modules/@rollup/rollup-darwin-x64": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.62.2.tgz",
+ "integrity": "sha512-yl0y2vq3S3lHeuXhEdss6TWfKW8vkujImO12tn4ZkG/4oghr09LvdYm2RElVjokTQiUvDUGXLGsYeLqUMCKpGA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ]
+ },
+ "node_modules/@rollup/rollup-freebsd-arm64": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.62.2.tgz",
+ "integrity": "sha512-tT4pvt4qXD+vEoezupCWi+a1F0vvDiksiHc+PxRlYTOH1I6/X4id9jPxTP+Fg+545euaFT1jJVs4CEdHZAU1vw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ]
+ },
+ "node_modules/@rollup/rollup-freebsd-x64": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.62.2.tgz",
+ "integrity": "sha512-6nU5F2wCW+qvCBhTn1pdIU3bzsIoF7EUwsCDRxilWGprQR6yd508YnH9+OKFCwpfS8pjZqDUmnCAr7exax0XCg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm-gnueabihf": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.62.2.tgz",
+ "integrity": "sha512-n1GJHPOvpIfhi3TmrCeh6S6URt9BFCt0KQE3qvexyGCTAKpR4Lg+eWvNZEqu7epxwus/8ElT3hacYEucm49SZg==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm-musleabihf": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.62.2.tgz",
+ "integrity": "sha512-JqgflS8wEB+UXV/vS1RpRbifGBeN4D5lz8D8oOFbFZw4vedvdOgCFAjfBmIMdW3yL10XpQQ0Ambepw6MXrhOnA==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm64-gnu": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.62.2.tgz",
+ "integrity": "sha512-wnFJkogWvN4jm/hQRF2UBaeUmk20j5+DmHvoyWii2b8HJDyvz1MF2OU/6ynXt2KR63rbZLWkFpoytpdc/yBuSA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm64-musl": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.62.2.tgz",
+ "integrity": "sha512-HVu2bp0zhvJ8xHEV9+UUs7S90VadmBSY3LcIMvozbPo4AuMGDWlz3ymHLHZPX4hR67TKTt8Qp5PJ5RBg/i+RMQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-loong64-gnu": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.62.2.tgz",
+ "integrity": "sha512-mQqqAV8QaoSgr9I2fKDLY2BAVvmKjWoGiu/cSYQonsLvtqwEn1E4QYfnCOcp5zoEqNhsDYin1s6jx/VJmrxlZg==",
+ "cpu": [
+ "loong64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-loong64-musl": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.62.2.tgz",
+ "integrity": "sha512-IxKLoxCQ2IWi6bT2akyDUBGsOImDKB+sPp4EsTmwFQ/fMwpCKm8uLSSgP/Kx/QYUgKis6SEZ5/Nlhup0DIA0PQ==",
+ "cpu": [
+ "loong64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-ppc64-gnu": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.62.2.tgz",
+ "integrity": "sha512-Mk5ha2RQSgyFfmYYLkBpPnUk8D8FriBxesO1u9O75X0mHgXL1UQcH5Itl2lurWL2tj0RxV9b9tJgipac0hRY9A==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-ppc64-musl": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.62.2.tgz",
+ "integrity": "sha512-CjvEnqJL/0/TQ3TXX3OPIJ/kmBellrWd4heXUmHeJlTnmwjKpSJzoehLaL6Xk0ZnMHBu9dZuFADNOrtjF4v+2w==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-riscv64-gnu": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.62.2.tgz",
+ "integrity": "sha512-1SiZbzwdkaDURsew/tSOrooKiYy7EQGT6m8ufavAi9NEyQb/6VuIxFXAL1fqa4iZe3g4NbNk4P7J32z2tw5Mgg==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-riscv64-musl": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.62.2.tgz",
+ "integrity": "sha512-nQts12zJ3NQRoE6uYljOH89v7szzLDvG2JD/vsX+vGXU8w/At1GowTZ5/7qeFQ8m7L55rpR8Okugnuo5bgjy2Q==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-s390x-gnu": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.62.2.tgz",
+ "integrity": "sha512-E9/ll019jhPIJgpzfZoIkBGhcz+kKNgVWYRY0zr9srBdPPFVpvOKW8VaJKUbeK+eZXyQF9ltME+Kk6affeaPgg==",
+ "cpu": [
+ "s390x"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-x64-gnu": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.62.2.tgz",
+ "integrity": "sha512-5BqxR/pshjey51iliyzTD5Xi3EN0aLmQ2lZ3lvefVV9c82BvrLo2/6OT55iifpWBufs6kdwWbuOKS841DrmK9A==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-x64-musl": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.62.2.tgz",
+ "integrity": "sha512-uNN83XxQrRAh/w0/pmAfibcwyb6YWt4gP+dpnQKPVJshAloQ785ii8CT8ZCIxkGg9opVsvAlGhFitSm6D1Jjpg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-openbsd-x64": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.62.2.tgz",
+ "integrity": "sha512-srjEIxSH3LRnJN6THczDHWQplqEMFiAJrTab0msUryh9kwNpkICf3Ea6q6MN/2cZwRFUNx5w+h6Hpi4QuHS6Zg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ]
+ },
+ "node_modules/@rollup/rollup-openharmony-arm64": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.62.2.tgz",
+ "integrity": "sha512-8hOJnxgbyObnCm5AlRA3A931xX19xq80RjVTKgJOvEKWqJruP/Uf12IbAOaDjjEXYRewwHLfmF0YRIdK3OwKWA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openharmony"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-arm64-msvc": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.62.2.tgz",
+ "integrity": "sha512-mmF4AY1i0hG/bLWUctUq59gtmgaSIRa3cu/A3JFRp/sCNEme2bgDEiDS22P9FbnJB8NJNF4jPJiSP5RHQpUTDg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-ia32-msvc": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.62.2.tgz",
+ "integrity": "sha512-DZgkknc6jhHrk46V25vbAM0zZkyP0nSDkJB8/dRkLTxv470dOmWDqGoEJl/9A0dFfS7yE3REOwNDxpHwSLSt0Q==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-x64-gnu": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.62.2.tgz",
+ "integrity": "sha512-T6xr6ucWSFto+VGajA8YH26LdpHRuP4YLHEKAtCWvJDOlnmWcDZVCI2Jmjr+IFHDlt2zRaTAKE4tfjTaWLgJBg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-x64-msvc": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.62.2.tgz",
+ "integrity": "sha512-BfzEnDJOt9T8M989/lA37EcJgat01wLRnoi5dQf3QzOH7jzpqTAzdDbVfRljVr5r+jzKqpbHeyOfAaXxAd0PAA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@scure/base": {
+ "version": "1.2.6",
+ "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.2.6.tgz",
+ "integrity": "sha512-g/nm5FgUa//MCj1gV09zTJTaM6KBAHqLN907YVQqf7zC49+DcO4B1so4ZX07Ef10Twr6nuqYEH9GEggFXA4Fmg==",
+ "license": "MIT",
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/@scure/bip32": {
+ "version": "1.7.0",
+ "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.7.0.tgz",
+ "integrity": "sha512-E4FFX/N3f4B80AKWp5dP6ow+flD1LQZo/w8UnLGYZO674jS6YnYeepycOOksv+vLPSpgN35wgKgy+ybfTb2SMw==",
+ "license": "MIT",
+ "dependencies": {
+ "@noble/curves": "~1.9.0",
+ "@noble/hashes": "~1.8.0",
+ "@scure/base": "~1.2.5"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/@scure/bip39": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.6.0.tgz",
+ "integrity": "sha512-+lF0BbLiJNwVlev4eKelw1WWLaiKXw7sSl8T6FvBlWkdX+94aGJ4o8XjUdlyhTCjd8c+B3KT3JfS8P0bLRNU6A==",
+ "license": "MIT",
+ "dependencies": {
+ "@noble/hashes": "~1.8.0",
+ "@scure/base": "~1.2.5"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/@types/chai": {
+ "version": "5.2.3",
+ "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz",
+ "integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@types/deep-eql": "*",
+ "assertion-error": "^2.0.1"
+ }
+ },
+ "node_modules/@types/deep-eql": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz",
+ "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@types/estree": {
+ "version": "1.0.9",
+ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz",
+ "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@types/node": {
+ "version": "24.13.3",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-24.13.3.tgz",
+ "integrity": "sha512-Dh8vAsV36ig5wa9OX4pXvMc9D3Veibfw2wix0CUwYODLD8nkj9UsLjASr49nPg+2eKzxhBV+v7L8pXvT4e639Q==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "undici-types": "~7.18.0"
+ }
+ },
+ "node_modules/@vitest/expect": {
+ "version": "3.2.7",
+ "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-3.2.7.tgz",
+ "integrity": "sha512-E8eBXaKibuvH2pSZErOjdVb5vF4PbKYcrnluBTYxEk1l/VhhwZg1kZQsdtjq+CsF5CFydf2Rdkz7jDHKSisi3w==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@types/chai": "^5.2.2",
+ "@vitest/spy": "3.2.7",
+ "@vitest/utils": "3.2.7",
+ "chai": "^5.2.0",
+ "tinyrainbow": "^2.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ }
+ },
+ "node_modules/@vitest/mocker": {
+ "version": "3.2.7",
+ "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-3.2.7.tgz",
+ "integrity": "sha512-Trr0hYO9CM3Wj6ksWHRhK9IZpIY6wTMO5u/MqXurMxT57sWBaOPEtP3Oq60ihZuh5JsiagKfz95OcxdEP6dBrA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@vitest/spy": "3.2.7",
+ "estree-walker": "^3.0.3",
+ "magic-string": "^0.30.17"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ },
+ "peerDependencies": {
+ "msw": "^2.4.9",
+ "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0"
+ },
+ "peerDependenciesMeta": {
+ "msw": {
+ "optional": true
+ },
+ "vite": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@vitest/pretty-format": {
+ "version": "3.2.7",
+ "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.2.7.tgz",
+ "integrity": "sha512-KUHlwqVu0sRlhCdyPdQ/wBoTfRahjUky1MubOmYw9fWfIZy1gNoHpuaaQBPAaMaVYdQYHJLurzj8ECCj5OwTqA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "tinyrainbow": "^2.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ }
+ },
+ "node_modules/@vitest/runner": {
+ "version": "3.2.7",
+ "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-3.2.7.tgz",
+ "integrity": "sha512-sB9y4ovltoQP+WaUPwmSxO9WIg9Ig694Di5PalVPsYHklAdE027mehpWF2SQSVq+k6sFgaivbTjTJwZLSHbedA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@vitest/utils": "3.2.7",
+ "pathe": "^2.0.3",
+ "strip-literal": "^3.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ }
+ },
+ "node_modules/@vitest/snapshot": {
+ "version": "3.2.7",
+ "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-3.2.7.tgz",
+ "integrity": "sha512-7C+MwShwtBSI5Buwoyg3s/iY1eHL9PKAf+O1wVh/TdnjXUtkoL/9YQtre90i4MtNXM6edP1wJ2zOBpfCyhIS7g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@vitest/pretty-format": "3.2.7",
+ "magic-string": "^0.30.17",
+ "pathe": "^2.0.3"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ }
+ },
+ "node_modules/@vitest/spy": {
+ "version": "3.2.7",
+ "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-3.2.7.tgz",
+ "integrity": "sha512-Q2eQGI6d2L/hBtZ0qNuKcAGid68XK6cv1xsoaIma6PaJhHPoqcEJhYpXZ/5myCMqkNgtP6UKuBhbc0nHKnrkuQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "tinyspy": "^4.0.3"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ }
+ },
+ "node_modules/@vitest/utils": {
+ "version": "3.2.7",
+ "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-3.2.7.tgz",
+ "integrity": "sha512-x6BDOd7dyo3PFLY3I9/HJ25X/6OurhGXk2/B9gOZNPF7XDVjeBK4k01lQE5uvDpbuheErh91qYuE1E2OEjK3Rw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@vitest/pretty-format": "3.2.7",
+ "loupe": "^3.1.4",
+ "tinyrainbow": "^2.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ }
+ },
+ "node_modules/abitype": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/abitype/-/abitype-1.2.3.tgz",
+ "integrity": "sha512-Ofer5QUnuUdTFsBRwARMoWKOH1ND5ehwYhJ3OJ/BQO+StkwQjHw0XyVh4vDttzHB7QOFhPHa/o413PJ82gU/Tg==",
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/wevm"
+ },
+ "peerDependencies": {
+ "typescript": ">=5.0.4",
+ "zod": "^3.22.0 || ^4.0.0"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ },
+ "zod": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/accepts": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz",
+ "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "mime-types": "^3.0.0",
+ "negotiator": "^1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/acorn": {
+ "version": "8.17.0",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.17.0.tgz",
+ "integrity": "sha512-xRQbDb9BnwDafYNn6Vwl839DYVjqXYb1XVGtWAZ1kcDc6iwAL4hg3B1dZlRiuENFeO2H53gFG3in621AdERVAg==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "acorn": "bin/acorn"
+ },
+ "engines": {
+ "node": ">=0.4.0"
+ }
+ },
+ "node_modules/any-promise": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz",
+ "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/assertion-error": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz",
+ "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/body-parser": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.3.0.tgz",
+ "integrity": "sha512-2cGmJupaNgg+QUwVLAucDuWuoMZ6EX9iHDRswZ5lsNYEmwPaRknMPCLZz07yTzVq/83p4o/wzbDZbBrTvGGTIw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "bytes": "^3.1.2",
+ "content-type": "^2.0.0",
+ "debug": "^4.4.3",
+ "http-errors": "^2.0.1",
+ "iconv-lite": "^0.7.2",
+ "on-finished": "^2.4.1",
+ "qs": "^6.15.2",
+ "raw-body": "^3.0.2",
+ "type-is": "^2.1.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/body-parser/node_modules/content-type": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.0.0.tgz",
+ "integrity": "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/bundle-require": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/bundle-require/-/bundle-require-5.1.0.tgz",
+ "integrity": "sha512-3WrrOuZiyaaZPWiEt4G3+IffISVC9HYlWueJEBWED4ZH4aIAC2PnkdnuRrR94M+w6yGWn4AglWtJtBI8YqvgoA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "load-tsconfig": "^0.2.3"
+ },
+ "engines": {
+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
+ },
+ "peerDependencies": {
+ "esbuild": ">=0.18"
+ }
+ },
+ "node_modules/bytes": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
+ "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/cac": {
+ "version": "6.7.14",
+ "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz",
+ "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/call-bind-apply-helpers": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
+ "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "es-errors": "^1.3.0",
+ "function-bind": "^1.1.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/call-bound": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz",
+ "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "call-bind-apply-helpers": "^1.0.2",
+ "get-intrinsic": "^1.3.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/chai": {
+ "version": "5.3.3",
+ "resolved": "https://registry.npmjs.org/chai/-/chai-5.3.3.tgz",
+ "integrity": "sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "assertion-error": "^2.0.1",
+ "check-error": "^2.1.1",
+ "deep-eql": "^5.0.1",
+ "loupe": "^3.1.0",
+ "pathval": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/check-error": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.3.tgz",
+ "integrity": "sha512-PAJdDJusoxnwm1VwW07VWwUN1sl7smmC3OKggvndJFadxxDRyFJBX/ggnu/KE4kQAB7a3Dp8f/YXC1FlUprWmA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 16"
+ }
+ },
+ "node_modules/chokidar": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz",
+ "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "readdirp": "^4.0.1"
+ },
+ "engines": {
+ "node": ">= 14.16.0"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/commander": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz",
+ "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/confbox": {
+ "version": "0.1.8",
+ "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.8.tgz",
+ "integrity": "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/consola": {
+ "version": "3.4.2",
+ "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz",
+ "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^14.18.0 || >=16.10.0"
+ }
+ },
+ "node_modules/content-disposition": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.1.0.tgz",
+ "integrity": "sha512-5jRCH9Z/+DRP7rkvY83B+yGIGX96OYdJmzngqnw2SBSxqCFPd0w2km3s5iawpGX8krnwSGmF0FW5Nhr0Hfai3g==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/content-type": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz",
+ "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/cookie": {
+ "version": "0.7.2",
+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz",
+ "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/cookie-signature": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz",
+ "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.6.0"
+ }
+ },
+ "node_modules/debug": {
+ "version": "4.4.3",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
+ "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/deep-eql": {
+ "version": "5.0.2",
+ "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz",
+ "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/depd": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
+ "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/dunder-proto": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
+ "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "call-bind-apply-helpers": "^1.0.1",
+ "es-errors": "^1.3.0",
+ "gopd": "^1.2.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/ee-first": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
+ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/encodeurl": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz",
+ "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/es-define-property": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
+ "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/es-errors": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
+ "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/es-module-lexer": {
+ "version": "1.7.0",
+ "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz",
+ "integrity": "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/es-object-atoms": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz",
+ "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "es-errors": "^1.3.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/esbuild": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.12.tgz",
+ "integrity": "sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "MIT",
+ "bin": {
+ "esbuild": "bin/esbuild"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "optionalDependencies": {
+ "@esbuild/aix-ppc64": "0.25.12",
+ "@esbuild/android-arm": "0.25.12",
+ "@esbuild/android-arm64": "0.25.12",
+ "@esbuild/android-x64": "0.25.12",
+ "@esbuild/darwin-arm64": "0.25.12",
+ "@esbuild/darwin-x64": "0.25.12",
+ "@esbuild/freebsd-arm64": "0.25.12",
+ "@esbuild/freebsd-x64": "0.25.12",
+ "@esbuild/linux-arm": "0.25.12",
+ "@esbuild/linux-arm64": "0.25.12",
+ "@esbuild/linux-ia32": "0.25.12",
+ "@esbuild/linux-loong64": "0.25.12",
+ "@esbuild/linux-mips64el": "0.25.12",
+ "@esbuild/linux-ppc64": "0.25.12",
+ "@esbuild/linux-riscv64": "0.25.12",
+ "@esbuild/linux-s390x": "0.25.12",
+ "@esbuild/linux-x64": "0.25.12",
+ "@esbuild/netbsd-arm64": "0.25.12",
+ "@esbuild/netbsd-x64": "0.25.12",
+ "@esbuild/openbsd-arm64": "0.25.12",
+ "@esbuild/openbsd-x64": "0.25.12",
+ "@esbuild/openharmony-arm64": "0.25.12",
+ "@esbuild/sunos-x64": "0.25.12",
+ "@esbuild/win32-arm64": "0.25.12",
+ "@esbuild/win32-ia32": "0.25.12",
+ "@esbuild/win32-x64": "0.25.12"
+ }
+ },
+ "node_modules/escape-html": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
+ "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/estree-walker": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz",
+ "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@types/estree": "^1.0.0"
+ }
+ },
+ "node_modules/etag": {
+ "version": "1.8.1",
+ "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
+ "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/eventemitter3": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz",
+ "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==",
+ "license": "MIT"
+ },
+ "node_modules/expect-type": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.4.0.tgz",
+ "integrity": "sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=12.0.0"
+ }
+ },
+ "node_modules/express": {
+ "version": "5.2.1",
+ "resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz",
+ "integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "accepts": "^2.0.0",
+ "body-parser": "^2.2.1",
+ "content-disposition": "^1.0.0",
+ "content-type": "^1.0.5",
+ "cookie": "^0.7.1",
+ "cookie-signature": "^1.2.1",
+ "debug": "^4.4.0",
+ "depd": "^2.0.0",
+ "encodeurl": "^2.0.0",
+ "escape-html": "^1.0.3",
+ "etag": "^1.8.1",
+ "finalhandler": "^2.1.0",
+ "fresh": "^2.0.0",
+ "http-errors": "^2.0.0",
+ "merge-descriptors": "^2.0.0",
+ "mime-types": "^3.0.0",
+ "on-finished": "^2.4.1",
+ "once": "^1.4.0",
+ "parseurl": "^1.3.3",
+ "proxy-addr": "^2.0.7",
+ "qs": "^6.14.0",
+ "range-parser": "^1.2.1",
+ "router": "^2.2.0",
+ "send": "^1.1.0",
+ "serve-static": "^2.2.0",
+ "statuses": "^2.0.1",
+ "type-is": "^2.0.1",
+ "vary": "^1.1.2"
+ },
+ "engines": {
+ "node": ">= 18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/fdir": {
+ "version": "6.5.0",
+ "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz",
+ "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12.0.0"
+ },
+ "peerDependencies": {
+ "picomatch": "^3 || ^4"
+ },
+ "peerDependenciesMeta": {
+ "picomatch": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/finalhandler": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.1.tgz",
+ "integrity": "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "debug": "^4.4.0",
+ "encodeurl": "^2.0.0",
+ "escape-html": "^1.0.3",
+ "on-finished": "^2.4.1",
+ "parseurl": "^1.3.3",
+ "statuses": "^2.0.1"
+ },
+ "engines": {
+ "node": ">= 18.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/fix-dts-default-cjs-exports": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/fix-dts-default-cjs-exports/-/fix-dts-default-cjs-exports-1.0.1.tgz",
+ "integrity": "sha512-pVIECanWFC61Hzl2+oOCtoJ3F17kglZC/6N94eRWycFgBH35hHx0Li604ZIzhseh97mf2p0cv7vVrOZGoqhlEg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "magic-string": "^0.30.17",
+ "mlly": "^1.7.4",
+ "rollup": "^4.34.8"
+ }
+ },
+ "node_modules/forwarded": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
+ "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/fresh": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz",
+ "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/fsevents": {
+ "version": "2.3.3",
+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
+ "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": "^8.16.0 || ^10.6.0 || >=11.0.0"
+ }
+ },
+ "node_modules/function-bind": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
+ "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
+ "dev": true,
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/get-intrinsic": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
+ "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "call-bind-apply-helpers": "^1.0.2",
+ "es-define-property": "^1.0.1",
+ "es-errors": "^1.3.0",
+ "es-object-atoms": "^1.1.1",
+ "function-bind": "^1.1.2",
+ "get-proto": "^1.0.1",
+ "gopd": "^1.2.0",
+ "has-symbols": "^1.1.0",
+ "hasown": "^2.0.2",
+ "math-intrinsics": "^1.1.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/get-proto": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",
+ "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "dunder-proto": "^1.0.1",
+ "es-object-atoms": "^1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/gopd": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
+ "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/has-symbols": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
+ "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/hasown": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz",
+ "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "function-bind": "^1.1.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/hood-connect": {
+ "resolved": "../hood-connect",
+ "link": true
+ },
+ "node_modules/hoodchain": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/hoodchain/-/hoodchain-0.1.1.tgz",
+ "integrity": "sha512-+9URZdPjo6dSZt+7iGWrS20ttTyuwsH8hBcyf44xqQI22kMqZIR4e1oQgoQHzoEYmJ6+2NgDy2nQppypucPfBA==",
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=20"
+ },
+ "peerDependencies": {
+ "viem": "^2.55.0",
+ "ws": "^8.18.0"
+ },
+ "peerDependenciesMeta": {
+ "ws": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/http-errors": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz",
+ "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "depd": "~2.0.0",
+ "inherits": "~2.0.4",
+ "setprototypeof": "~1.2.0",
+ "statuses": "~2.0.2",
+ "toidentifier": "~1.0.1"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/iconv-lite": {
+ "version": "0.7.3",
+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.3.tgz",
+ "integrity": "sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "safer-buffer": ">= 2.1.2 < 3.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/inherits": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
+ "dev": true,
+ "license": "ISC"
+ },
+ "node_modules/ipaddr.js": {
+ "version": "1.9.1",
+ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
+ "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/is-promise": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz",
+ "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/isows": {
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/isows/-/isows-1.0.7.tgz",
+ "integrity": "sha512-I1fSfDCZL5P0v33sVqeTDSpcstAg/N+wF5HS033mogOVIp4B+oHC7oOCsA3axAbBSGTJ8QubbNmnIRN/h8U7hg==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/wevm"
+ }
+ ],
+ "license": "MIT",
+ "peerDependencies": {
+ "ws": "*"
+ }
+ },
+ "node_modules/joycon": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/joycon/-/joycon-3.1.1.tgz",
+ "integrity": "sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/js-tokens": {
+ "version": "9.0.1",
+ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.1.tgz",
+ "integrity": "sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/lilconfig": {
+ "version": "3.1.3",
+ "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz",
+ "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=14"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/antonk52"
+ }
+ },
+ "node_modules/lines-and-columns": {
+ "version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz",
+ "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/load-tsconfig": {
+ "version": "0.2.5",
+ "resolved": "https://registry.npmjs.org/load-tsconfig/-/load-tsconfig-0.2.5.tgz",
+ "integrity": "sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
+ }
+ },
+ "node_modules/loupe": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.2.1.tgz",
+ "integrity": "sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/magic-string": {
+ "version": "0.30.21",
+ "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz",
+ "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/sourcemap-codec": "^1.5.5"
+ }
+ },
+ "node_modules/math-intrinsics": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
+ "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/media-typer": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz",
+ "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/merge-descriptors": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz",
+ "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/mime-db": {
+ "version": "1.54.0",
+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz",
+ "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/mime-types": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz",
+ "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "mime-db": "^1.54.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/mlly": {
+ "version": "1.8.2",
+ "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.8.2.tgz",
+ "integrity": "sha512-d+ObxMQFmbt10sretNDytwt85VrbkhhUA/JBGm1MPaWJ65Cl4wOgLaB1NYvJSZ0Ef03MMEU/0xpPMXUIQ29UfA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "acorn": "^8.16.0",
+ "pathe": "^2.0.3",
+ "pkg-types": "^1.3.1",
+ "ufo": "^1.6.3"
+ }
+ },
+ "node_modules/ms": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/mz": {
+ "version": "2.7.0",
+ "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz",
+ "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "any-promise": "^1.0.0",
+ "object-assign": "^4.0.1",
+ "thenify-all": "^1.0.0"
+ }
+ },
+ "node_modules/nanoid": {
+ "version": "3.3.16",
+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.16.tgz",
+ "integrity": "sha512-bzlKTyNJ7+LdGIIwy8ijFpIqEQIvafahV7eYykJ8Cvh42EdJeODoJ6gUJXpQJvej1BddH8OqTXZNE/KfbWAu8Q==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "license": "MIT",
+ "bin": {
+ "nanoid": "bin/nanoid.cjs"
+ },
+ "engines": {
+ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
+ }
+ },
+ "node_modules/negotiator": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz",
+ "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/object-assign": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
+ "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/object-inspect": {
+ "version": "1.13.4",
+ "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz",
+ "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/on-finished": {
+ "version": "2.4.1",
+ "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",
+ "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ee-first": "1.1.1"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/once": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
+ "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
+ "dev": true,
+ "license": "ISC",
+ "dependencies": {
+ "wrappy": "1"
+ }
+ },
+ "node_modules/ox": {
+ "version": "0.14.30",
+ "resolved": "https://registry.npmjs.org/ox/-/ox-0.14.30.tgz",
+ "integrity": "sha512-LI11uu+8iiM1B3CLckgd++YF1a0A2k5wDoM9ZeQMiL21BOzQs6L//BLS6hb1HSEKCyycdDIQLsVQx9MjpcC0hA==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/wevm"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "@adraffy/ens-normalize": "^1.11.0",
+ "@noble/ciphers": "^1.3.0",
+ "@noble/curves": "1.9.1",
+ "@noble/hashes": "^1.8.0",
+ "@scure/bip32": "^1.7.0",
+ "@scure/bip39": "^1.6.0",
+ "abitype": "^1.2.3",
+ "eventemitter3": "5.0.1"
+ },
+ "peerDependencies": {
+ "typescript": ">=5.4.0"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/parseurl": {
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
+ "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/path-to-regexp": {
+ "version": "8.4.2",
+ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.4.2.tgz",
+ "integrity": "sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA==",
+ "dev": true,
+ "license": "MIT",
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/pathe": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz",
+ "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/pathval": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.1.tgz",
+ "integrity": "sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 14.16"
+ }
+ },
+ "node_modules/picocolors": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
+ "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",
+ "dev": true,
+ "license": "ISC"
+ },
+ "node_modules/picomatch": {
+ "version": "4.0.5",
+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz",
+ "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/jonschlinkert"
+ }
+ },
+ "node_modules/pirates": {
+ "version": "4.0.7",
+ "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz",
+ "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/pkg-types": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.3.1.tgz",
+ "integrity": "sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "confbox": "^0.1.8",
+ "mlly": "^1.7.4",
+ "pathe": "^2.0.1"
+ }
+ },
+ "node_modules/postcss": {
+ "version": "8.5.19",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.19.tgz",
+ "integrity": "sha512-Mz8SaolMd8nB+G13WkORcxQKHZ/NE4xXevtkJHVuG+guo9/wYKlIMTKAqGdEmYOXR2ijPjTYNHssizdaVSUNdQ==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/postcss/"
+ },
+ {
+ "type": "tidelift",
+ "url": "https://tidelift.com/funding/github/npm/postcss"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "nanoid": "^3.3.12",
+ "picocolors": "^1.1.1",
+ "source-map-js": "^1.2.1"
+ },
+ "engines": {
+ "node": "^10 || ^12 || >=14"
+ }
+ },
+ "node_modules/postcss-load-config": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-6.0.1.tgz",
+ "integrity": "sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/postcss/"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "lilconfig": "^3.1.1"
+ },
+ "engines": {
+ "node": ">= 18"
+ },
+ "peerDependencies": {
+ "jiti": ">=1.21.0",
+ "postcss": ">=8.0.9",
+ "tsx": "^4.8.1",
+ "yaml": "^2.4.2"
+ },
+ "peerDependenciesMeta": {
+ "jiti": {
+ "optional": true
+ },
+ "postcss": {
+ "optional": true
+ },
+ "tsx": {
+ "optional": true
+ },
+ "yaml": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/proxy-addr": {
+ "version": "2.0.7",
+ "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
+ "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "forwarded": "0.2.0",
+ "ipaddr.js": "1.9.1"
+ },
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/qs": {
+ "version": "6.15.3",
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.3.tgz",
+ "integrity": "sha512-O9gl3zCl5h5blw1KGUzQKhA5oUXSl8rwUIM5o0S3nCXMliSvy5Dzx7/DJcI+SwgICv+IneSZwhBh1oSyEHA71A==",
+ "dev": true,
+ "license": "BSD-3-Clause",
+ "dependencies": {
+ "es-define-property": "^1.0.1",
+ "side-channel": "^1.1.1"
+ },
+ "engines": {
+ "node": ">=0.6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/range-parser": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.3.0.tgz",
+ "integrity": "sha512-hek2mFQpPuI4E1BBKrSto+BU3e3x4xuarsbiwr3+lf7p44juvFMV0XFWQAP3xUyqXA4RrXLIoaSUGbSt056ZMw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/raw-body": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.2.tgz",
+ "integrity": "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "bytes": "~3.1.2",
+ "http-errors": "~2.0.1",
+ "iconv-lite": "~0.7.0",
+ "unpipe": "~1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/readdirp": {
+ "version": "4.1.2",
+ "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz",
+ "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 14.18.0"
+ },
+ "funding": {
+ "type": "individual",
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/resolve-from": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz",
+ "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/rollup": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.62.2.tgz",
+ "integrity": "sha512-RFnrW4lhXA3s3eqHDZvN654g8OTjzRfqpIRJYczCGB6HzphckVAi/Qh4tbPUbRuDi7s1Llv8g/NspLkttY3gTA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@types/estree": "1.0.9"
+ },
+ "bin": {
+ "rollup": "dist/bin/rollup"
+ },
+ "engines": {
+ "node": ">=18.0.0",
+ "npm": ">=8.0.0"
+ },
+ "optionalDependencies": {
+ "@rollup/rollup-android-arm-eabi": "4.62.2",
+ "@rollup/rollup-android-arm64": "4.62.2",
+ "@rollup/rollup-darwin-arm64": "4.62.2",
+ "@rollup/rollup-darwin-x64": "4.62.2",
+ "@rollup/rollup-freebsd-arm64": "4.62.2",
+ "@rollup/rollup-freebsd-x64": "4.62.2",
+ "@rollup/rollup-linux-arm-gnueabihf": "4.62.2",
+ "@rollup/rollup-linux-arm-musleabihf": "4.62.2",
+ "@rollup/rollup-linux-arm64-gnu": "4.62.2",
+ "@rollup/rollup-linux-arm64-musl": "4.62.2",
+ "@rollup/rollup-linux-loong64-gnu": "4.62.2",
+ "@rollup/rollup-linux-loong64-musl": "4.62.2",
+ "@rollup/rollup-linux-ppc64-gnu": "4.62.2",
+ "@rollup/rollup-linux-ppc64-musl": "4.62.2",
+ "@rollup/rollup-linux-riscv64-gnu": "4.62.2",
+ "@rollup/rollup-linux-riscv64-musl": "4.62.2",
+ "@rollup/rollup-linux-s390x-gnu": "4.62.2",
+ "@rollup/rollup-linux-x64-gnu": "4.62.2",
+ "@rollup/rollup-linux-x64-musl": "4.62.2",
+ "@rollup/rollup-openbsd-x64": "4.62.2",
+ "@rollup/rollup-openharmony-arm64": "4.62.2",
+ "@rollup/rollup-win32-arm64-msvc": "4.62.2",
+ "@rollup/rollup-win32-ia32-msvc": "4.62.2",
+ "@rollup/rollup-win32-x64-gnu": "4.62.2",
+ "@rollup/rollup-win32-x64-msvc": "4.62.2",
+ "fsevents": "~2.3.2"
+ }
+ },
+ "node_modules/router": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz",
+ "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "debug": "^4.4.0",
+ "depd": "^2.0.0",
+ "is-promise": "^4.0.0",
+ "parseurl": "^1.3.3",
+ "path-to-regexp": "^8.0.0"
+ },
+ "engines": {
+ "node": ">= 18"
+ }
+ },
+ "node_modules/safer-buffer": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
+ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/send": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/send/-/send-1.2.1.tgz",
+ "integrity": "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "debug": "^4.4.3",
+ "encodeurl": "^2.0.0",
+ "escape-html": "^1.0.3",
+ "etag": "^1.8.1",
+ "fresh": "^2.0.0",
+ "http-errors": "^2.0.1",
+ "mime-types": "^3.0.2",
+ "ms": "^2.1.3",
+ "on-finished": "^2.4.1",
+ "range-parser": "^1.2.1",
+ "statuses": "^2.0.2"
+ },
+ "engines": {
+ "node": ">= 18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/serve-static": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.1.tgz",
+ "integrity": "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "encodeurl": "^2.0.0",
+ "escape-html": "^1.0.3",
+ "parseurl": "^1.3.3",
+ "send": "^1.2.0"
+ },
+ "engines": {
+ "node": ">= 18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/setprototypeof": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
+ "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==",
+ "dev": true,
+ "license": "ISC"
+ },
+ "node_modules/side-channel": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.1.tgz",
+ "integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "es-errors": "^1.3.0",
+ "object-inspect": "^1.13.4",
+ "side-channel-list": "^1.0.1",
+ "side-channel-map": "^1.0.1",
+ "side-channel-weakmap": "^1.0.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/side-channel-list": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz",
+ "integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "es-errors": "^1.3.0",
+ "object-inspect": "^1.13.4"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/side-channel-map": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz",
+ "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "call-bound": "^1.0.2",
+ "es-errors": "^1.3.0",
+ "get-intrinsic": "^1.2.5",
+ "object-inspect": "^1.13.3"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/side-channel-weakmap": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz",
+ "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "call-bound": "^1.0.2",
+ "es-errors": "^1.3.0",
+ "get-intrinsic": "^1.2.5",
+ "object-inspect": "^1.13.3",
+ "side-channel-map": "^1.0.1"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/siginfo": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz",
+ "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==",
+ "dev": true,
+ "license": "ISC"
+ },
+ "node_modules/source-map": {
+ "version": "0.7.6",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.6.tgz",
+ "integrity": "sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==",
+ "dev": true,
+ "license": "BSD-3-Clause",
+ "engines": {
+ "node": ">= 12"
+ }
+ },
+ "node_modules/source-map-js": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",
+ "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==",
+ "dev": true,
+ "license": "BSD-3-Clause",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/stackback": {
+ "version": "0.0.2",
+ "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz",
+ "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/statuses": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz",
+ "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/std-env": {
+ "version": "3.10.0",
+ "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.10.0.tgz",
+ "integrity": "sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/strip-literal": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-3.1.0.tgz",
+ "integrity": "sha512-8r3mkIM/2+PpjHoOtiAW8Rg3jJLHaV7xPwG+YRGrv6FP0wwk/toTpATxWYOW0BKdWwl82VT2tFYi5DlROa0Mxg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "js-tokens": "^9.0.1"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/antfu"
+ }
+ },
+ "node_modules/sucrase": {
+ "version": "3.35.1",
+ "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.1.tgz",
+ "integrity": "sha512-DhuTmvZWux4H1UOnWMB3sk0sbaCVOoQZjv8u1rDoTV0HTdGem9hkAZtl4JZy8P2z4Bg0nT+YMeOFyVr4zcG5Tw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/gen-mapping": "^0.3.2",
+ "commander": "^4.0.0",
+ "lines-and-columns": "^1.1.6",
+ "mz": "^2.7.0",
+ "pirates": "^4.0.1",
+ "tinyglobby": "^0.2.11",
+ "ts-interface-checker": "^0.1.9"
+ },
+ "bin": {
+ "sucrase": "bin/sucrase",
+ "sucrase-node": "bin/sucrase-node"
+ },
+ "engines": {
+ "node": ">=16 || 14 >=14.17"
+ }
+ },
+ "node_modules/thenify": {
+ "version": "3.3.1",
+ "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz",
+ "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "any-promise": "^1.0.0"
+ }
+ },
+ "node_modules/thenify-all": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz",
+ "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "thenify": ">= 3.1.0 < 4"
+ },
+ "engines": {
+ "node": ">=0.8"
+ }
+ },
+ "node_modules/tinybench": {
+ "version": "2.9.0",
+ "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz",
+ "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/tinyexec": {
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz",
+ "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/tinyglobby": {
+ "version": "0.2.17",
+ "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz",
+ "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "fdir": "^6.5.0",
+ "picomatch": "^4.0.4"
+ },
+ "engines": {
+ "node": ">=12.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/SuperchupuDev"
+ }
+ },
+ "node_modules/tinypool": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.1.1.tgz",
+ "integrity": "sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^18.0.0 || >=20.0.0"
+ }
+ },
+ "node_modules/tinyrainbow": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-2.0.0.tgz",
+ "integrity": "sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/tinyspy": {
+ "version": "4.0.4",
+ "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-4.0.4.tgz",
+ "integrity": "sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/toidentifier": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
+ "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.6"
+ }
+ },
+ "node_modules/tree-kill": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz",
+ "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "tree-kill": "cli.js"
+ }
+ },
+ "node_modules/ts-interface-checker": {
+ "version": "0.1.13",
+ "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz",
+ "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==",
+ "dev": true,
+ "license": "Apache-2.0"
+ },
+ "node_modules/tsup": {
+ "version": "8.5.1",
+ "resolved": "https://registry.npmjs.org/tsup/-/tsup-8.5.1.tgz",
+ "integrity": "sha512-xtgkqwdhpKWr3tKPmCkvYmS9xnQK3m3XgxZHwSUjvfTjp7YfXe5tT3GgWi0F2N+ZSMsOeWeZFh7ZZFg5iPhing==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "bundle-require": "^5.1.0",
+ "cac": "^6.7.14",
+ "chokidar": "^4.0.3",
+ "consola": "^3.4.0",
+ "debug": "^4.4.0",
+ "esbuild": "^0.27.0",
+ "fix-dts-default-cjs-exports": "^1.0.0",
+ "joycon": "^3.1.1",
+ "picocolors": "^1.1.1",
+ "postcss-load-config": "^6.0.1",
+ "resolve-from": "^5.0.0",
+ "rollup": "^4.34.8",
+ "source-map": "^0.7.6",
+ "sucrase": "^3.35.0",
+ "tinyexec": "^0.3.2",
+ "tinyglobby": "^0.2.11",
+ "tree-kill": "^1.2.2"
+ },
+ "bin": {
+ "tsup": "dist/cli-default.js",
+ "tsup-node": "dist/cli-node.js"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "peerDependencies": {
+ "@microsoft/api-extractor": "^7.36.0",
+ "@swc/core": "^1",
+ "postcss": "^8.4.12",
+ "typescript": ">=4.5.0"
+ },
+ "peerDependenciesMeta": {
+ "@microsoft/api-extractor": {
+ "optional": true
+ },
+ "@swc/core": {
+ "optional": true
+ },
+ "postcss": {
+ "optional": true
+ },
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/tsup/node_modules/@esbuild/aix-ppc64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.7.tgz",
+ "integrity": "sha512-EKX3Qwmhz1eMdEJokhALr0YiD0lhQNwDqkPYyPhiSwKrh7/4KRjQc04sZ8db+5DVVnZ1LmbNDI1uAMPEUBnQPg==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "aix"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsup/node_modules/@esbuild/android-arm": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.7.tgz",
+ "integrity": "sha512-jbPXvB4Yj2yBV7HUfE2KHe4GJX51QplCN1pGbYjvsyCZbQmies29EoJbkEc+vYuU5o45AfQn37vZlyXy4YJ8RQ==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsup/node_modules/@esbuild/android-arm64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.7.tgz",
+ "integrity": "sha512-62dPZHpIXzvChfvfLJow3q5dDtiNMkwiRzPylSCfriLvZeq0a1bWChrGx/BbUbPwOrsWKMn8idSllklzBy+dgQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsup/node_modules/@esbuild/android-x64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.7.tgz",
+ "integrity": "sha512-x5VpMODneVDb70PYV2VQOmIUUiBtY3D3mPBG8NxVk5CogneYhkR7MmM3yR/uMdITLrC1ml/NV1rj4bMJuy9MCg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsup/node_modules/@esbuild/darwin-arm64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.7.tgz",
+ "integrity": "sha512-5lckdqeuBPlKUwvoCXIgI2D9/ABmPq3Rdp7IfL70393YgaASt7tbju3Ac+ePVi3KDH6N2RqePfHnXkaDtY9fkw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsup/node_modules/@esbuild/darwin-x64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.7.tgz",
+ "integrity": "sha512-rYnXrKcXuT7Z+WL5K980jVFdvVKhCHhUwid+dDYQpH+qu+TefcomiMAJpIiC2EM3Rjtq0sO3StMV/+3w3MyyqQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsup/node_modules/@esbuild/freebsd-arm64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.7.tgz",
+ "integrity": "sha512-B48PqeCsEgOtzME2GbNM2roU29AMTuOIN91dsMO30t+Ydis3z/3Ngoj5hhnsOSSwNzS+6JppqWsuhTp6E82l2w==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsup/node_modules/@esbuild/freebsd-x64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.7.tgz",
+ "integrity": "sha512-jOBDK5XEjA4m5IJK3bpAQF9/Lelu/Z9ZcdhTRLf4cajlB+8VEhFFRjWgfy3M1O4rO2GQ/b2dLwCUGpiF/eATNQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsup/node_modules/@esbuild/linux-arm": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.7.tgz",
+ "integrity": "sha512-RkT/YXYBTSULo3+af8Ib0ykH8u2MBh57o7q/DAs3lTJlyVQkgQvlrPTnjIzzRPQyavxtPtfg0EopvDyIt0j1rA==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsup/node_modules/@esbuild/linux-arm64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.7.tgz",
+ "integrity": "sha512-RZPHBoxXuNnPQO9rvjh5jdkRmVizktkT7TCDkDmQ0W2SwHInKCAV95GRuvdSvA7w4VMwfCjUiPwDi0ZO6Nfe9A==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsup/node_modules/@esbuild/linux-ia32": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.7.tgz",
+ "integrity": "sha512-GA48aKNkyQDbd3KtkplYWT102C5sn/EZTY4XROkxONgruHPU72l+gW+FfF8tf2cFjeHaRbWpOYa/uRBz/Xq1Pg==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsup/node_modules/@esbuild/linux-loong64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.7.tgz",
+ "integrity": "sha512-a4POruNM2oWsD4WKvBSEKGIiWQF8fZOAsycHOt6JBpZ+JN2n2JH9WAv56SOyu9X5IqAjqSIPTaJkqN8F7XOQ5Q==",
+ "cpu": [
+ "loong64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsup/node_modules/@esbuild/linux-mips64el": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.7.tgz",
+ "integrity": "sha512-KabT5I6StirGfIz0FMgl1I+R1H73Gp0ofL9A3nG3i/cYFJzKHhouBV5VWK1CSgKvVaG4q1RNpCTR2LuTVB3fIw==",
+ "cpu": [
+ "mips64el"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsup/node_modules/@esbuild/linux-ppc64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.7.tgz",
+ "integrity": "sha512-gRsL4x6wsGHGRqhtI+ifpN/vpOFTQtnbsupUF5R5YTAg+y/lKelYR1hXbnBdzDjGbMYjVJLJTd2OFmMewAgwlQ==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsup/node_modules/@esbuild/linux-riscv64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.7.tgz",
+ "integrity": "sha512-hL25LbxO1QOngGzu2U5xeXtxXcW+/GvMN3ejANqXkxZ/opySAZMrc+9LY/WyjAan41unrR3YrmtTsUpwT66InQ==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsup/node_modules/@esbuild/linux-s390x": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.7.tgz",
+ "integrity": "sha512-2k8go8Ycu1Kb46vEelhu1vqEP+UeRVj2zY1pSuPdgvbd5ykAw82Lrro28vXUrRmzEsUV0NzCf54yARIK8r0fdw==",
+ "cpu": [
+ "s390x"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsup/node_modules/@esbuild/linux-x64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.7.tgz",
+ "integrity": "sha512-hzznmADPt+OmsYzw1EE33ccA+HPdIqiCRq7cQeL1Jlq2gb1+OyWBkMCrYGBJ+sxVzve2ZJEVeePbLM2iEIZSxA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsup/node_modules/@esbuild/netbsd-arm64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.7.tgz",
+ "integrity": "sha512-b6pqtrQdigZBwZxAn1UpazEisvwaIDvdbMbmrly7cDTMFnw/+3lVxxCTGOrkPVnsYIosJJXAsILG9XcQS+Yu6w==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsup/node_modules/@esbuild/netbsd-x64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.7.tgz",
+ "integrity": "sha512-OfatkLojr6U+WN5EDYuoQhtM+1xco+/6FSzJJnuWiUw5eVcicbyK3dq5EeV/QHT1uy6GoDhGbFpprUiHUYggrw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsup/node_modules/@esbuild/openbsd-arm64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.7.tgz",
+ "integrity": "sha512-AFuojMQTxAz75Fo8idVcqoQWEHIXFRbOc1TrVcFSgCZtQfSdc1RXgB3tjOn/krRHENUB4j00bfGjyl2mJrU37A==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsup/node_modules/@esbuild/openbsd-x64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.7.tgz",
+ "integrity": "sha512-+A1NJmfM8WNDv5CLVQYJ5PshuRm/4cI6WMZRg1by1GwPIQPCTs1GLEUHwiiQGT5zDdyLiRM/l1G0Pv54gvtKIg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsup/node_modules/@esbuild/openharmony-arm64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.7.tgz",
+ "integrity": "sha512-+KrvYb/C8zA9CU/g0sR6w2RBw7IGc5J2BPnc3dYc5VJxHCSF1yNMxTV5LQ7GuKteQXZtspjFbiuW5/dOj7H4Yw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openharmony"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsup/node_modules/@esbuild/sunos-x64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.7.tgz",
+ "integrity": "sha512-ikktIhFBzQNt/QDyOL580ti9+5mL/YZeUPKU2ivGtGjdTYoqz6jObj6nOMfhASpS4GU4Q/Clh1QtxWAvcYKamA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "sunos"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsup/node_modules/@esbuild/win32-arm64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.7.tgz",
+ "integrity": "sha512-7yRhbHvPqSpRUV7Q20VuDwbjW5kIMwTHpptuUzV+AA46kiPze5Z7qgt6CLCK3pWFrHeNfDd1VKgyP4O+ng17CA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsup/node_modules/@esbuild/win32-ia32": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.7.tgz",
+ "integrity": "sha512-SmwKXe6VHIyZYbBLJrhOoCJRB/Z1tckzmgTLfFYOfpMAx63BJEaL9ExI8x7v0oAO3Zh6D/Oi1gVxEYr5oUCFhw==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsup/node_modules/@esbuild/win32-x64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.7.tgz",
+ "integrity": "sha512-56hiAJPhwQ1R4i+21FVF7V8kSD5zZTdHcVuRFMW0hn753vVfQN8xlx4uOPT4xoGH0Z/oVATuR82AiqSTDIpaHg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsup/node_modules/esbuild": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.7.tgz",
+ "integrity": "sha512-IxpibTjyVnmrIQo5aqNpCgoACA/dTKLTlhMHihVHhdkxKyPO1uBBthumT0rdHmcsk9uMonIWS0m4FljWzILh3w==",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "MIT",
+ "bin": {
+ "esbuild": "bin/esbuild"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "optionalDependencies": {
+ "@esbuild/aix-ppc64": "0.27.7",
+ "@esbuild/android-arm": "0.27.7",
+ "@esbuild/android-arm64": "0.27.7",
+ "@esbuild/android-x64": "0.27.7",
+ "@esbuild/darwin-arm64": "0.27.7",
+ "@esbuild/darwin-x64": "0.27.7",
+ "@esbuild/freebsd-arm64": "0.27.7",
+ "@esbuild/freebsd-x64": "0.27.7",
+ "@esbuild/linux-arm": "0.27.7",
+ "@esbuild/linux-arm64": "0.27.7",
+ "@esbuild/linux-ia32": "0.27.7",
+ "@esbuild/linux-loong64": "0.27.7",
+ "@esbuild/linux-mips64el": "0.27.7",
+ "@esbuild/linux-ppc64": "0.27.7",
+ "@esbuild/linux-riscv64": "0.27.7",
+ "@esbuild/linux-s390x": "0.27.7",
+ "@esbuild/linux-x64": "0.27.7",
+ "@esbuild/netbsd-arm64": "0.27.7",
+ "@esbuild/netbsd-x64": "0.27.7",
+ "@esbuild/openbsd-arm64": "0.27.7",
+ "@esbuild/openbsd-x64": "0.27.7",
+ "@esbuild/openharmony-arm64": "0.27.7",
+ "@esbuild/sunos-x64": "0.27.7",
+ "@esbuild/win32-arm64": "0.27.7",
+ "@esbuild/win32-ia32": "0.27.7",
+ "@esbuild/win32-x64": "0.27.7"
+ }
+ },
+ "node_modules/tsx": {
+ "version": "4.23.1",
+ "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.23.1.tgz",
+ "integrity": "sha512-GQHnkIfxyx1wYCOS/wonik5MVRZU9hi1TEZmzGZSCJB1y9YgoZ8H6itNE/u4suE+yLmOzuE4E5S4TZ/ZX2wcWQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "esbuild": "~0.28.0"
+ },
+ "bin": {
+ "tsx": "dist/cli.mjs"
+ },
+ "engines": {
+ "node": ">=18.0.0"
+ },
+ "optionalDependencies": {
+ "fsevents": "~2.3.3"
+ }
+ },
+ "node_modules/tsx/node_modules/@esbuild/aix-ppc64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.1.tgz",
+ "integrity": "sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "aix"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsx/node_modules/@esbuild/android-arm": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.1.tgz",
+ "integrity": "sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsx/node_modules/@esbuild/android-arm64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.1.tgz",
+ "integrity": "sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsx/node_modules/@esbuild/android-x64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.1.tgz",
+ "integrity": "sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsx/node_modules/@esbuild/darwin-arm64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.1.tgz",
+ "integrity": "sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsx/node_modules/@esbuild/darwin-x64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.1.tgz",
+ "integrity": "sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsx/node_modules/@esbuild/freebsd-arm64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.1.tgz",
+ "integrity": "sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsx/node_modules/@esbuild/freebsd-x64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.1.tgz",
+ "integrity": "sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsx/node_modules/@esbuild/linux-arm": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.1.tgz",
+ "integrity": "sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsx/node_modules/@esbuild/linux-arm64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.1.tgz",
+ "integrity": "sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsx/node_modules/@esbuild/linux-ia32": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.1.tgz",
+ "integrity": "sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsx/node_modules/@esbuild/linux-loong64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.1.tgz",
+ "integrity": "sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg==",
+ "cpu": [
+ "loong64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsx/node_modules/@esbuild/linux-mips64el": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.1.tgz",
+ "integrity": "sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==",
+ "cpu": [
+ "mips64el"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsx/node_modules/@esbuild/linux-ppc64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.1.tgz",
+ "integrity": "sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsx/node_modules/@esbuild/linux-riscv64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.1.tgz",
+ "integrity": "sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsx/node_modules/@esbuild/linux-s390x": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.1.tgz",
+ "integrity": "sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==",
+ "cpu": [
+ "s390x"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsx/node_modules/@esbuild/linux-x64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.1.tgz",
+ "integrity": "sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsx/node_modules/@esbuild/netbsd-arm64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.1.tgz",
+ "integrity": "sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsx/node_modules/@esbuild/netbsd-x64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.1.tgz",
+ "integrity": "sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsx/node_modules/@esbuild/openbsd-arm64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.1.tgz",
+ "integrity": "sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsx/node_modules/@esbuild/openbsd-x64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.1.tgz",
+ "integrity": "sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsx/node_modules/@esbuild/openharmony-arm64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.1.tgz",
+ "integrity": "sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openharmony"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsx/node_modules/@esbuild/sunos-x64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.1.tgz",
+ "integrity": "sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "sunos"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsx/node_modules/@esbuild/win32-arm64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.1.tgz",
+ "integrity": "sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsx/node_modules/@esbuild/win32-ia32": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.1.tgz",
+ "integrity": "sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsx/node_modules/@esbuild/win32-x64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.1.tgz",
+ "integrity": "sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tsx/node_modules/esbuild": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.1.tgz",
+ "integrity": "sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw==",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "MIT",
+ "bin": {
+ "esbuild": "bin/esbuild"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "optionalDependencies": {
+ "@esbuild/aix-ppc64": "0.28.1",
+ "@esbuild/android-arm": "0.28.1",
+ "@esbuild/android-arm64": "0.28.1",
+ "@esbuild/android-x64": "0.28.1",
+ "@esbuild/darwin-arm64": "0.28.1",
+ "@esbuild/darwin-x64": "0.28.1",
+ "@esbuild/freebsd-arm64": "0.28.1",
+ "@esbuild/freebsd-x64": "0.28.1",
+ "@esbuild/linux-arm": "0.28.1",
+ "@esbuild/linux-arm64": "0.28.1",
+ "@esbuild/linux-ia32": "0.28.1",
+ "@esbuild/linux-loong64": "0.28.1",
+ "@esbuild/linux-mips64el": "0.28.1",
+ "@esbuild/linux-ppc64": "0.28.1",
+ "@esbuild/linux-riscv64": "0.28.1",
+ "@esbuild/linux-s390x": "0.28.1",
+ "@esbuild/linux-x64": "0.28.1",
+ "@esbuild/netbsd-arm64": "0.28.1",
+ "@esbuild/netbsd-x64": "0.28.1",
+ "@esbuild/openbsd-arm64": "0.28.1",
+ "@esbuild/openbsd-x64": "0.28.1",
+ "@esbuild/openharmony-arm64": "0.28.1",
+ "@esbuild/sunos-x64": "0.28.1",
+ "@esbuild/win32-arm64": "0.28.1",
+ "@esbuild/win32-ia32": "0.28.1",
+ "@esbuild/win32-x64": "0.28.1"
+ }
+ },
+ "node_modules/type-is": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.1.0.tgz",
+ "integrity": "sha512-faYHw0anBbc/kWF3zFTEnxSFOAGUX9GFbOBthvDdLsIlEoWOFOtS0zgCiQYwIskL9iGXZL3kAXD8OoZ4GmMATA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "content-type": "^2.0.0",
+ "media-typer": "^1.1.0",
+ "mime-types": "^3.0.0"
+ },
+ "engines": {
+ "node": ">= 18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/type-is/node_modules/content-type": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.0.0.tgz",
+ "integrity": "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/typescript": {
+ "version": "5.9.3",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
+ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
+ "devOptional": true,
+ "license": "Apache-2.0",
+ "bin": {
+ "tsc": "bin/tsc",
+ "tsserver": "bin/tsserver"
+ },
+ "engines": {
+ "node": ">=14.17"
+ }
+ },
+ "node_modules/ufo": {
+ "version": "1.6.4",
+ "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.6.4.tgz",
+ "integrity": "sha512-JFNbkD1Svwe0KvGi8GOeLcP4kAWQ609twvCdcHxq1oSL8svv39ZuSvajcD8B+5D0eL4+s1Is2D/O6KN3qcTeRA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/undici-types": {
+ "version": "7.18.2",
+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.18.2.tgz",
+ "integrity": "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/unpipe": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
+ "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/vary": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
+ "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/viem": {
+ "version": "2.55.2",
+ "resolved": "https://registry.npmjs.org/viem/-/viem-2.55.2.tgz",
+ "integrity": "sha512-XlJeyNAZ96dQfOHlxLTK1FKgtWw/TtxENKNMBSBgxqALjiWiBWrFmSSzwwMivryKnBwkbt5E+90jSCLnVEilLA==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/wevm"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "@noble/curves": "1.9.1",
+ "@noble/hashes": "1.8.0",
+ "@scure/bip32": "1.7.0",
+ "@scure/bip39": "1.6.0",
+ "abitype": "1.2.3",
+ "isows": "1.0.7",
+ "ox": "0.14.30",
+ "ws": "8.21.0"
+ },
+ "peerDependencies": {
+ "typescript": ">=5.0.4"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/vite": {
+ "version": "7.3.6",
+ "resolved": "https://registry.npmjs.org/vite/-/vite-7.3.6.tgz",
+ "integrity": "sha512-4XP60spRGjSZFf1qYH+dJIkK2znL3zQfl9KkOV9MkkRR/3Dls0dxaBsQPTloEc5BLXWPL9vsOxopxyKoMmDueg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "esbuild": "^0.27.0 || ^0.28.0",
+ "fdir": "^6.5.0",
+ "picomatch": "^4.0.3",
+ "postcss": "^8.5.6",
+ "rollup": "^4.43.0",
+ "tinyglobby": "^0.2.15"
+ },
+ "bin": {
+ "vite": "bin/vite.js"
+ },
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ },
+ "funding": {
+ "url": "https://github.com/vitejs/vite?sponsor=1"
+ },
+ "optionalDependencies": {
+ "fsevents": "~2.3.3"
+ },
+ "peerDependencies": {
+ "@types/node": "^20.19.0 || >=22.12.0",
+ "jiti": ">=1.21.0",
+ "less": "^4.0.0",
+ "lightningcss": "^1.21.0",
+ "sass": "^1.70.0",
+ "sass-embedded": "^1.70.0",
+ "stylus": ">=0.54.8",
+ "sugarss": "^5.0.0",
+ "terser": "^5.16.0",
+ "tsx": "^4.8.1",
+ "yaml": "^2.4.2"
+ },
+ "peerDependenciesMeta": {
+ "@types/node": {
+ "optional": true
+ },
+ "jiti": {
+ "optional": true
+ },
+ "less": {
+ "optional": true
+ },
+ "lightningcss": {
+ "optional": true
+ },
+ "sass": {
+ "optional": true
+ },
+ "sass-embedded": {
+ "optional": true
+ },
+ "stylus": {
+ "optional": true
+ },
+ "sugarss": {
+ "optional": true
+ },
+ "terser": {
+ "optional": true
+ },
+ "tsx": {
+ "optional": true
+ },
+ "yaml": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/vite-node": {
+ "version": "3.2.4",
+ "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-3.2.4.tgz",
+ "integrity": "sha512-EbKSKh+bh1E1IFxeO0pg1n4dvoOTt0UDiXMd/qn++r98+jPO1xtJilvXldeuQ8giIB5IkpjCgMleHMNEsGH6pg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "cac": "^6.7.14",
+ "debug": "^4.4.1",
+ "es-module-lexer": "^1.7.0",
+ "pathe": "^2.0.3",
+ "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0"
+ },
+ "bin": {
+ "vite-node": "vite-node.mjs"
+ },
+ "engines": {
+ "node": "^18.0.0 || ^20.0.0 || >=22.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/aix-ppc64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.1.tgz",
+ "integrity": "sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "aix"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/android-arm": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.1.tgz",
+ "integrity": "sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/android-arm64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.1.tgz",
+ "integrity": "sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/android-x64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.1.tgz",
+ "integrity": "sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/darwin-arm64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.1.tgz",
+ "integrity": "sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/darwin-x64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.1.tgz",
+ "integrity": "sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/freebsd-arm64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.1.tgz",
+ "integrity": "sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/freebsd-x64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.1.tgz",
+ "integrity": "sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/linux-arm": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.1.tgz",
+ "integrity": "sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/linux-arm64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.1.tgz",
+ "integrity": "sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/linux-ia32": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.1.tgz",
+ "integrity": "sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/linux-loong64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.1.tgz",
+ "integrity": "sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg==",
+ "cpu": [
+ "loong64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/linux-mips64el": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.1.tgz",
+ "integrity": "sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==",
+ "cpu": [
+ "mips64el"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/linux-ppc64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.1.tgz",
+ "integrity": "sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/linux-riscv64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.1.tgz",
+ "integrity": "sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/linux-s390x": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.1.tgz",
+ "integrity": "sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==",
+ "cpu": [
+ "s390x"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/linux-x64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.1.tgz",
+ "integrity": "sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/netbsd-arm64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.1.tgz",
+ "integrity": "sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/netbsd-x64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.1.tgz",
+ "integrity": "sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/openbsd-arm64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.1.tgz",
+ "integrity": "sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/openbsd-x64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.1.tgz",
+ "integrity": "sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/openharmony-arm64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.1.tgz",
+ "integrity": "sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openharmony"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/sunos-x64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.1.tgz",
+ "integrity": "sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "sunos"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/win32-arm64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.1.tgz",
+ "integrity": "sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/win32-ia32": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.1.tgz",
+ "integrity": "sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/win32-x64": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.1.tgz",
+ "integrity": "sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite/node_modules/esbuild": {
+ "version": "0.28.1",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.1.tgz",
+ "integrity": "sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw==",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "MIT",
+ "bin": {
+ "esbuild": "bin/esbuild"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "optionalDependencies": {
+ "@esbuild/aix-ppc64": "0.28.1",
+ "@esbuild/android-arm": "0.28.1",
+ "@esbuild/android-arm64": "0.28.1",
+ "@esbuild/android-x64": "0.28.1",
+ "@esbuild/darwin-arm64": "0.28.1",
+ "@esbuild/darwin-x64": "0.28.1",
+ "@esbuild/freebsd-arm64": "0.28.1",
+ "@esbuild/freebsd-x64": "0.28.1",
+ "@esbuild/linux-arm": "0.28.1",
+ "@esbuild/linux-arm64": "0.28.1",
+ "@esbuild/linux-ia32": "0.28.1",
+ "@esbuild/linux-loong64": "0.28.1",
+ "@esbuild/linux-mips64el": "0.28.1",
+ "@esbuild/linux-ppc64": "0.28.1",
+ "@esbuild/linux-riscv64": "0.28.1",
+ "@esbuild/linux-s390x": "0.28.1",
+ "@esbuild/linux-x64": "0.28.1",
+ "@esbuild/netbsd-arm64": "0.28.1",
+ "@esbuild/netbsd-x64": "0.28.1",
+ "@esbuild/openbsd-arm64": "0.28.1",
+ "@esbuild/openbsd-x64": "0.28.1",
+ "@esbuild/openharmony-arm64": "0.28.1",
+ "@esbuild/sunos-x64": "0.28.1",
+ "@esbuild/win32-arm64": "0.28.1",
+ "@esbuild/win32-ia32": "0.28.1",
+ "@esbuild/win32-x64": "0.28.1"
+ }
+ },
+ "node_modules/vitest": {
+ "version": "3.2.7",
+ "resolved": "https://registry.npmjs.org/vitest/-/vitest-3.2.7.tgz",
+ "integrity": "sha512-KrxIJ62Fd89gfysR4WotlgZABiz2dqFPgqGzX7s+CwsqLFomRH7777ZcrOD6+WVAh7khPQP41A+BKbpcJFrdEg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@types/chai": "^5.2.2",
+ "@vitest/expect": "3.2.7",
+ "@vitest/mocker": "3.2.7",
+ "@vitest/pretty-format": "^3.2.7",
+ "@vitest/runner": "3.2.7",
+ "@vitest/snapshot": "3.2.7",
+ "@vitest/spy": "3.2.7",
+ "@vitest/utils": "3.2.7",
+ "chai": "^5.2.0",
+ "debug": "^4.4.1",
+ "expect-type": "^1.2.1",
+ "magic-string": "^0.30.17",
+ "pathe": "^2.0.3",
+ "picomatch": "^4.0.2",
+ "std-env": "^3.9.0",
+ "tinybench": "^2.9.0",
+ "tinyexec": "^0.3.2",
+ "tinyglobby": "^0.2.14",
+ "tinypool": "^1.1.1",
+ "tinyrainbow": "^2.0.0",
+ "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0",
+ "vite-node": "3.2.4",
+ "why-is-node-running": "^2.3.0"
+ },
+ "bin": {
+ "vitest": "vitest.mjs"
+ },
+ "engines": {
+ "node": "^18.0.0 || ^20.0.0 || >=22.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ },
+ "peerDependencies": {
+ "@edge-runtime/vm": "*",
+ "@types/debug": "^4.1.12",
+ "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0",
+ "@vitest/browser": "3.2.7",
+ "@vitest/ui": "3.2.7",
+ "happy-dom": "*",
+ "jsdom": "*"
+ },
+ "peerDependenciesMeta": {
+ "@edge-runtime/vm": {
+ "optional": true
+ },
+ "@types/debug": {
+ "optional": true
+ },
+ "@types/node": {
+ "optional": true
+ },
+ "@vitest/browser": {
+ "optional": true
+ },
+ "@vitest/ui": {
+ "optional": true
+ },
+ "happy-dom": {
+ "optional": true
+ },
+ "jsdom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/why-is-node-running": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz",
+ "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "siginfo": "^2.0.0",
+ "stackback": "0.0.2"
+ },
+ "bin": {
+ "why-is-node-running": "cli.js"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/wrappy": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
+ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
+ "dev": true,
+ "license": "ISC"
+ },
+ "node_modules/ws": {
+ "version": "8.21.0",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.0.tgz",
+ "integrity": "sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=10.0.0"
+ },
+ "peerDependencies": {
+ "bufferutil": "^4.0.1",
+ "utf-8-validate": ">=5.0.2"
+ },
+ "peerDependenciesMeta": {
+ "bufferutil": {
+ "optional": true
+ },
+ "utf-8-validate": {
+ "optional": true
+ }
+ }
+ }
+ }
+}
diff --git a/robinhood/hood-pay/package.json b/robinhood/hood-pay/package.json
new file mode 100644
index 000000000..550e3dcc9
--- /dev/null
+++ b/robinhood/hood-pay/package.json
@@ -0,0 +1,91 @@
+{
+ "name": "hood-pay",
+ "version": "0.1.0",
+ "description": "Stripe-Checkout-grade USDG payments on Robinhood Chain (chain 4663): an embeddable checkout widget, hosted payment links that run entirely on GitHub Pages, and a reorg-safe merchant verification library with webhooks, an idempotent SQLite ledger, and refund helpers.",
+ "keywords": [
+ "robinhood",
+ "robinhood-chain",
+ "usdg",
+ "checkout",
+ "payments",
+ "payment-links",
+ "stablecoin",
+ "commerce",
+ "web3",
+ "viem",
+ "webhook"
+ ],
+ "license": "MIT",
+ "author": "nirholas (https://x.com/nichxbt)",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/nirholas/hood-pay.git"
+ },
+ "homepage": "https://nirholas.github.io/hood-pay/",
+ "bugs": {
+ "url": "https://github.com/nirholas/hood-pay/issues"
+ },
+ "type": "module",
+ "engines": {
+ "node": ">=20"
+ },
+ "sideEffects": false,
+ "main": "./dist/index.cjs",
+ "module": "./dist/index.js",
+ "types": "./dist/index.d.ts",
+ "bin": {
+ "hood-pay": "./bin/hood-pay.mjs"
+ },
+ "exports": {
+ ".": {
+ "types": "./dist/index.d.ts",
+ "import": "./dist/index.js",
+ "require": "./dist/index.cjs"
+ },
+ "./verify": {
+ "types": "./dist/verify/index.d.ts",
+ "import": "./dist/verify/index.js",
+ "require": "./dist/verify/index.cjs"
+ },
+ "./widget": {
+ "types": "./dist/widget/index.d.ts",
+ "import": "./dist/widget/index.js",
+ "require": "./dist/widget/index.cjs"
+ },
+ "./widget.js": "./dist/hood-pay.min.js",
+ "./package.json": "./package.json"
+ },
+ "files": [
+ "dist",
+ "bin",
+ "README.md",
+ "LICENSE"
+ ],
+ "scripts": {
+ "build": "tsup && node scripts/build-widget.mjs",
+ "typecheck": "tsc --noEmit",
+ "test": "vitest run tests/unit",
+ "test:live": "vitest run tests/live --testTimeout 240000",
+ "forge:build": "forge build --root contracts",
+ "forge:test": "forge test --root contracts -vv",
+ "forge:test:fork": "forge test --root contracts --match-path 'test/*.fork.t.sol' --fork-url https://rpc.mainnet.chain.robinhood.com -vv",
+ "prepublishOnly": "npm run build && npm test"
+ },
+ "dependencies": {
+ "hood-connect": "file:../hood-connect",
+ "hoodchain": "^0.1.1"
+ },
+ "peerDependencies": {
+ "viem": "^2.55.0"
+ },
+ "devDependencies": {
+ "@types/node": "^24.0.0",
+ "esbuild": "^0.25.0",
+ "express": "^5.1.0",
+ "tsup": "^8.5.0",
+ "tsx": "^4.20.0",
+ "typescript": "^5.8.0",
+ "viem": "^2.55.0",
+ "vitest": "^3.2.0"
+ }
+}
diff --git a/robinhood/hood-pay/scripts/build-widget.mjs b/robinhood/hood-pay/scripts/build-widget.mjs
new file mode 100644
index 000000000..ccbcd2a0e
--- /dev/null
+++ b/robinhood/hood-pay/scripts/build-widget.mjs
@@ -0,0 +1,44 @@
+/**
+ * Build the self-contained checkout bundle (IIFE, minified) to
+ * dist/hood-pay.min.js, copy it into docs/ for the GitHub Pages site, and
+ * enforce the size budget: the work order caps the widget at 30 kB gzipped.
+ * The build FAILS if the budget is exceeded - no silent bloat.
+ */
+import { build } from 'esbuild'
+import { gzipSync } from 'node:zlib'
+import { readFileSync, writeFileSync, mkdirSync, copyFileSync } from 'node:fs'
+import { dirname, resolve } from 'node:path'
+import { fileURLToPath } from 'node:url'
+
+const root = resolve(dirname(fileURLToPath(import.meta.url)), '..')
+const outfile = resolve(root, 'dist/hood-pay.min.js')
+const BUDGET_GZIP_BYTES = 30 * 1024
+
+mkdirSync(resolve(root, 'dist'), { recursive: true })
+
+await build({
+ entryPoints: [resolve(root, 'src/widget/iife.ts')],
+ bundle: true,
+ minify: true,
+ format: 'iife',
+ target: ['es2020'],
+ platform: 'browser',
+ outfile,
+ legalComments: 'none',
+ define: { 'process.env.NODE_ENV': '"production"' },
+ banner: { js: '/* hood-pay checkout widget | MIT | https://github.com/nirholas/hood-pay */' },
+})
+
+const raw = readFileSync(outfile)
+const gzipped = gzipSync(raw, { level: 9 })
+const kb = (n) => (n / 1024).toFixed(1)
+console.log(`hood-pay.min.js ${kb(raw.length)} kB raw ${kb(gzipped.length)} kB gzip (budget ${kb(BUDGET_GZIP_BYTES)} kB gzip)`)
+
+if (gzipped.length > BUDGET_GZIP_BYTES) {
+ console.error(`SIZE BUDGET EXCEEDED by ${kb(gzipped.length - BUDGET_GZIP_BYTES)} kB gzip`)
+ process.exit(1)
+}
+
+copyFileSync(outfile, resolve(root, 'docs/hood-pay.min.js'))
+writeFileSync(resolve(root, 'dist/widget-size.json'), JSON.stringify({ raw: raw.length, gzip: gzipped.length }, null, 2) + '\n')
+console.log('copied to docs/hood-pay.min.js')
diff --git a/robinhood/hood-pay/src/abi.ts b/robinhood/hood-pay/src/abi.ts
new file mode 100644
index 000000000..a37830db5
--- /dev/null
+++ b/robinhood/hood-pay/src/abi.ts
@@ -0,0 +1,100 @@
+/**
+ * ABIs as literal constants (no runtime human-readable parsing: keeps the
+ * browser widget bundle small and the types fully inferred via `as const`).
+ */
+
+/** Minimal ERC-20 surface the checkout and verifier touch. */
+export const erc20Abi = [
+ {
+ type: 'function',
+ name: 'transfer',
+ stateMutability: 'nonpayable',
+ inputs: [
+ { name: 'to', type: 'address' },
+ { name: 'amount', type: 'uint256' },
+ ],
+ outputs: [{ type: 'bool' }],
+ },
+ {
+ type: 'function',
+ name: 'approve',
+ stateMutability: 'nonpayable',
+ inputs: [
+ { name: 'spender', type: 'address' },
+ { name: 'amount', type: 'uint256' },
+ ],
+ outputs: [{ type: 'bool' }],
+ },
+ {
+ type: 'function',
+ name: 'allowance',
+ stateMutability: 'view',
+ inputs: [
+ { name: 'owner', type: 'address' },
+ { name: 'spender', type: 'address' },
+ ],
+ outputs: [{ type: 'uint256' }],
+ },
+ {
+ type: 'function',
+ name: 'balanceOf',
+ stateMutability: 'view',
+ inputs: [{ name: 'owner', type: 'address' }],
+ outputs: [{ type: 'uint256' }],
+ },
+ {
+ type: 'function',
+ name: 'decimals',
+ stateMutability: 'view',
+ inputs: [],
+ outputs: [{ type: 'uint8' }],
+ },
+ {
+ type: 'function',
+ name: 'symbol',
+ stateMutability: 'view',
+ inputs: [],
+ outputs: [{ type: 'string' }],
+ },
+ {
+ type: 'event',
+ name: 'Transfer',
+ inputs: [
+ { name: 'from', type: 'address', indexed: true },
+ { name: 'to', type: 'address', indexed: true },
+ { name: 'value', type: 'uint256', indexed: false },
+ ],
+ },
+] as const
+
+/**
+ * HoodPayRouter - the stateless, non-custodial attribution contract
+ * (`contracts/src/HoodPayRouter.sol`). `pay` pulls `amount` of `token` from
+ * the caller straight to `payTo` and emits `PaymentReceived`; the contract
+ * never holds a balance.
+ */
+export const hoodPayRouterAbi = [
+ {
+ type: 'function',
+ name: 'pay',
+ stateMutability: 'nonpayable',
+ inputs: [
+ { name: 'token', type: 'address' },
+ { name: 'payTo', type: 'address' },
+ { name: 'amount', type: 'uint256' },
+ { name: 'ref', type: 'bytes32' },
+ ],
+ outputs: [],
+ },
+ {
+ type: 'event',
+ name: 'PaymentReceived',
+ inputs: [
+ { name: 'ref', type: 'bytes32', indexed: true },
+ { name: 'payer', type: 'address', indexed: true },
+ { name: 'payTo', type: 'address', indexed: true },
+ { name: 'token', type: 'address', indexed: false },
+ { name: 'amount', type: 'uint256', indexed: false },
+ ],
+ },
+] as const
diff --git a/robinhood/hood-pay/src/index.ts b/robinhood/hood-pay/src/index.ts
new file mode 100644
index 000000000..2142729f1
--- /dev/null
+++ b/robinhood/hood-pay/src/index.ts
@@ -0,0 +1,48 @@
+/**
+ * hood-pay - Stripe-Checkout-grade USDG payments on Robinhood Chain.
+ *
+ * Core module: networks, the reference/fingerprint scheme, payment
+ * requests + link codec, and unsigned-tx builders. The merchant-side
+ * watcher/webhook/ledger stack lives in `hood-pay/verify`; the embeddable
+ * checkout in `hood-pay/widget` (or the prebuilt `dist/hood-pay.min.js`).
+ *
+ * @packageDocumentation
+ */
+
+// networks
+export { networkInfo, explorerTxUrl, explorerAddressUrl } from './networks.js'
+export type { HoodPayNetwork, NetworkInfo, PayToken } from './networks.js'
+
+// reference scheme
+export {
+ newReference,
+ isReference,
+ randomDust,
+ applyDust,
+ splitDust,
+ directCollisionProbability,
+ referenceCollisionProbability,
+ DUST_SLOTS,
+ DUST_DIGITS,
+ DUST_MODULUS,
+} from './reference.js'
+
+// payment requests + links
+export {
+ validatePaymentRequest,
+ requestToken,
+ requestRawAmount,
+ formatRequestAmount,
+ encodePaymentRequest,
+ decodePaymentRequest,
+ paymentLinkUrl,
+ MAX_MEMO_LENGTH,
+} from './request.js'
+export type { PaymentRequest } from './request.js'
+
+// unsigned transactions
+export { buildTransferTx, buildApproveTx, buildRouterPayTx } from './tx.js'
+export type { UnsignedCall } from './tx.js'
+
+// ABIs
+export { erc20Abi, hoodPayRouterAbi } from './abi.js'
diff --git a/robinhood/hood-pay/src/networks.ts b/robinhood/hood-pay/src/networks.ts
new file mode 100644
index 000000000..2a8d86948
--- /dev/null
+++ b/robinhood/hood-pay/src/networks.ts
@@ -0,0 +1,62 @@
+import { MAINNET_ADDRESSES, TESTNET_ADDRESSES, USDG_DECIMALS } from 'hoodchain'
+import type { Address } from 'viem'
+
+/**
+ * Network identity for hood-pay. Everything chain-specific the checkout and
+ * the verifier need lives here, derived from the `hoodchain` SDK's verified
+ * address book (never retyped by hand).
+ */
+
+/** Network selector: `'mainnet'` = chain 4663, `'testnet'` = chain 46630. */
+export type HoodPayNetwork = 'mainnet' | 'testnet'
+
+/** A payment token: address + decimals + display symbol. */
+export interface PayToken {
+ address: Address
+ symbol: string
+ decimals: number
+}
+
+/** Resolved chain parameters for one network. */
+export interface NetworkInfo {
+ network: HoodPayNetwork
+ chainId: number
+ rpcUrl: string
+ explorerUrl: string
+ /** USDG on this network (the default payment token). */
+ usdg: PayToken
+}
+
+const MAINNET: NetworkInfo = {
+ network: 'mainnet',
+ chainId: 4663,
+ rpcUrl: 'https://rpc.mainnet.chain.robinhood.com',
+ explorerUrl: 'https://robinhoodchain.blockscout.com',
+ usdg: { address: MAINNET_ADDRESSES.usdg, symbol: 'USDG', decimals: USDG_DECIMALS },
+}
+
+const TESTNET: NetworkInfo = {
+ network: 'testnet',
+ chainId: 46630,
+ rpcUrl: 'https://rpc.testnet.chain.robinhood.com',
+ explorerUrl: 'https://explorer.testnet.chain.robinhood.com',
+ usdg: { address: TESTNET_ADDRESSES.usdg, symbol: 'USDG', decimals: USDG_DECIMALS },
+}
+
+/** Resolve the {@link NetworkInfo} for a network name. */
+export function networkInfo(network: HoodPayNetwork = 'mainnet'): NetworkInfo {
+ if (network !== 'mainnet' && network !== 'testnet') {
+ throw new RangeError(`Unknown hood-pay network "${String(network)}" (use "mainnet" or "testnet")`)
+ }
+ return network === 'testnet' ? TESTNET : MAINNET
+}
+
+/** Blockscout transaction URL on the given network. */
+export function explorerTxUrl(network: HoodPayNetwork, hash: string): string {
+ return `${networkInfo(network).explorerUrl}/tx/${hash}`
+}
+
+/** Blockscout address URL on the given network. */
+export function explorerAddressUrl(network: HoodPayNetwork, address: string): string {
+ return `${networkInfo(network).explorerUrl}/address/${address}`
+}
diff --git a/robinhood/hood-pay/src/reference.ts b/robinhood/hood-pay/src/reference.ts
new file mode 100644
index 000000000..65e8e86a8
--- /dev/null
+++ b/robinhood/hood-pay/src/reference.ts
@@ -0,0 +1,129 @@
+import type { Hex } from 'viem'
+
+/**
+ * The hood-pay reference scheme.
+ *
+ * USDG is a plain ERC-20 with no memo field and no EIP-2612 permit (verified
+ * on the Blockscout-verified implementation during the `hoodchain` SDK
+ * build), so a bare `transfer` carries no way to say WHICH invoice a payment
+ * settles. hood-pay solves attribution two ways:
+ *
+ * 1. **Router mode** (exact attribution): the buyer pays through the
+ * stateless, non-custodial `HoodPayRouter` contract, which moves the
+ * tokens straight to the merchant and emits
+ * `PaymentReceived(reference, payer, payTo, token, amount)`. The
+ * `reference` is 32 random bytes generated per checkout. Collision math:
+ * references are drawn uniformly from 2^256; by the birthday bound the
+ * probability that any two of `k` references collide is
+ * ~ k^2 / 2^257 - at a trillion payments (k = 10^12) that is ~ 8.6e-54.
+ * Attribution is exact regardless of amount, so partial payments and
+ * overpayments are first-class (summed per reference).
+ *
+ * 2. **Direct mode** (amount fingerprinting, zero contracts): the buyer
+ * sends a plain USDG `transfer` and the invoice amount itself is made
+ * unique. USDG has 6 decimals; retail prices use at most 2, which leaves
+ * the low 4 decimal digits (10,000 slots, each worth 0.0001 USDG) as a
+ * fingerprint. The verifier then matches `Transfer(to = payTo,
+ * value = base + dust)` exactly. With a ledger the dust slot is RESERVED
+ * per (payTo, base amount) while the invoice is pending, making
+ * collisions impossible by construction. Without a ledger (static
+ * payment links) dust is random and the birthday bound applies:
+ * `directCollisionProbability(k)` ~ k(k-1)/(2 * 9999) for k concurrent
+ * open invoices at the SAME price to the SAME merchant - ~0.45% at
+ * k = 10, so static links suit low-concurrency sellers and the router
+ * or a ledger suits everyone else.
+ */
+
+/** Number of usable dust slots in direct mode (values 1..9999 micro-USDG). */
+export const DUST_SLOTS = 9999
+
+/** How many low decimal digits of a 6-decimal amount carry the fingerprint. */
+export const DUST_DIGITS = 4
+
+/** Modulus isolating the dust digits of a raw 6-decimal amount. */
+export const DUST_MODULUS = 10n ** BigInt(DUST_DIGITS)
+
+const HEX_CHARS = '0123456789abcdef'
+
+function randomBytes(length: number): Uint8Array {
+ const out = new Uint8Array(length)
+ // Web Crypto exists in browsers, workers, and Node >= 19 as a global.
+ globalThis.crypto.getRandomValues(out)
+ return out
+}
+
+/** Generate a fresh 32-byte payment reference (router mode), 0x-prefixed. */
+export function newReference(): Hex {
+ const bytes = randomBytes(32)
+ let hex = '0x'
+ for (const b of bytes) hex += HEX_CHARS[b >> 4]! + HEX_CHARS[b & 0xf]!
+ return hex as Hex
+}
+
+/** True when `value` is a well-formed 32-byte hex reference. */
+export function isReference(value: unknown): value is Hex {
+ return typeof value === 'string' && /^0x[0-9a-fA-F]{64}$/.test(value)
+}
+
+/**
+ * Draw a random dust value in [1, {@link DUST_SLOTS}] (raw token units).
+ * Rejection-sampled so the distribution is uniform.
+ */
+export function randomDust(): bigint {
+ // 9999 < 2^14; sample 16 bits and reject out-of-range values.
+ for (;;) {
+ const b = randomBytes(2)
+ const v = ((b[0]! << 8) | b[1]!) & 0x3fff // 0..16383
+ if (v >= 1 && v <= DUST_SLOTS) return BigInt(v)
+ }
+}
+
+/**
+ * Apply a dust fingerprint to a raw base amount (direct mode). The base
+ * amount's low {@link DUST_DIGITS} digits must be zero - hood-pay treats a
+ * non-zero low nibble as a merchant error rather than silently clobbering it.
+ */
+export function applyDust(baseRaw: bigint, dust: bigint): bigint {
+ if (baseRaw < 0n) throw new RangeError('base amount must be non-negative')
+ if (baseRaw % DUST_MODULUS !== 0n) {
+ throw new RangeError(
+ `base amount ${baseRaw} already uses its low ${DUST_DIGITS} decimal digits; ` +
+ 'price direct-mode invoices with at most 2 decimals or use router mode',
+ )
+ }
+ if (dust < 1n || dust > BigInt(DUST_SLOTS)) {
+ throw new RangeError(`dust must be in [1, ${DUST_SLOTS}], got ${dust}`)
+ }
+ return baseRaw + dust
+}
+
+/** Split a fingerprinted raw amount back into `{ base, dust }`. */
+export function splitDust(raw: bigint): { base: bigint; dust: bigint } {
+ if (raw < 0n) throw new RangeError('amount must be non-negative')
+ const dust = raw % DUST_MODULUS
+ return { base: raw - dust, dust }
+}
+
+/**
+ * Birthday-bound collision probability for `k` concurrent direct-mode
+ * invoices at the same base amount to the same merchant with RANDOM dust
+ * (no ledger reservation). Exact complement-product form.
+ */
+export function directCollisionProbability(k: number): number {
+ if (!Number.isInteger(k) || k < 0) throw new RangeError('k must be a non-negative integer')
+ if (k <= 1) return 0
+ if (k > DUST_SLOTS) return 1
+ let pNoCollision = 1
+ for (let i = 0; i < k; i++) pNoCollision *= (DUST_SLOTS - i) / DUST_SLOTS
+ return 1 - pNoCollision
+}
+
+/**
+ * Birthday-bound collision probability for `k` router-mode references
+ * (32 random bytes). Uses the k^2 / 2^257 approximation, which is exact to
+ * double precision for every physically plausible k.
+ */
+export function referenceCollisionProbability(k: number): number {
+ if (!Number.isFinite(k) || k < 0) throw new RangeError('k must be a non-negative number')
+ return (k * k) / 2 ** 257
+}
diff --git a/robinhood/hood-pay/src/request.ts b/robinhood/hood-pay/src/request.ts
new file mode 100644
index 000000000..5c149f039
--- /dev/null
+++ b/robinhood/hood-pay/src/request.ts
@@ -0,0 +1,188 @@
+import { getAddress, isAddress, parseUnits, formatUnits, type Address, type Hex } from 'viem'
+import { networkInfo, type HoodPayNetwork, type PayToken } from './networks.js'
+import { isReference } from './reference.js'
+
+/**
+ * A payment request is the unit hood-pay moves around: the widget renders
+ * one, a payment link encodes one in its URL fragment, and the verifier
+ * awaits one. It is plain data - no keys, no secrets - safe to embed in a
+ * public page or QR code.
+ */
+export interface PaymentRequest {
+ /** Schema version. Always 1. */
+ v: 1
+ network: HoodPayNetwork
+ /** Merchant receiving address (checksummed). */
+ payTo: Address
+ /**
+ * Decimal amount string (e.g. `"12.50"`), or `"dynamic"` to let the buyer
+ * enter the amount (tips, donations, pay-what-you-want).
+ */
+ amount: string
+ /**
+ * Payment token. Omitted = USDG on the request's network. Any ERC-20
+ * works (the testnet, for example, has faucet Stock Tokens but the router
+ * and verifier are token-agnostic).
+ */
+ token?: PayToken
+ /** Free-text memo shown to the buyer. Off-chain only - never posted on-chain. */
+ memo?: string
+ /**
+ * Router-mode reference (32-byte hex). Present = pay through the
+ * HoodPayRouter at `router`; absent = direct ERC-20 transfer matched by
+ * amount fingerprint.
+ */
+ reference?: Hex
+ /** HoodPayRouter address. Required when `reference` is set. */
+ router?: Address
+}
+
+/** Longest memo a request may carry (keeps links QR-friendly). */
+export const MAX_MEMO_LENGTH = 280
+
+const AMOUNT_RE = /^(0|[1-9]\d{0,11})(\.\d{1,18})?$/
+
+/**
+ * Validate an untrusted value into a {@link PaymentRequest}. Addresses are
+ * checksum-normalized via viem's `getAddress` (mixed-case inputs with a bad
+ * EIP-55 checksum are rejected). Throws `TypeError`/`RangeError` with a
+ * human-readable message on the first problem found.
+ */
+export function validatePaymentRequest(input: unknown): PaymentRequest {
+ if (typeof input !== 'object' || input === null) throw new TypeError('payment request must be an object')
+ const r = input as Record<string, unknown>
+
+ if (r.v !== 1 && r.v !== undefined) throw new RangeError(`unsupported payment request version ${String(r.v)}`)
+
+ const network = (r.network ?? 'mainnet') as HoodPayNetwork
+ networkInfo(network) // throws on unknown network
+
+ if (typeof r.payTo !== 'string' || !isAddress(r.payTo, { strict: true })) {
+ throw new TypeError('payTo must be a 0x-prefixed 20-byte address with a valid EIP-55 checksum')
+ }
+ const payTo = getAddress(r.payTo)
+
+ if (typeof r.amount !== 'string') throw new TypeError('amount must be a string (decimal or "dynamic")')
+ const amount = r.amount.trim()
+ if (amount !== 'dynamic' && !AMOUNT_RE.test(amount)) {
+ throw new RangeError(`amount "${amount}" is not a plain decimal string (or "dynamic")`)
+ }
+
+ let token: PayToken | undefined
+ if (r.token !== undefined) {
+ const t = r.token as Record<string, unknown>
+ if (typeof t !== 'object' || t === null) throw new TypeError('token must be an object')
+ if (typeof t.address !== 'string' || !isAddress(t.address, { strict: true })) {
+ throw new TypeError('token.address must be a 0x-prefixed 20-byte address with a valid EIP-55 checksum')
+ }
+ if (typeof t.symbol !== 'string' || t.symbol.length === 0 || t.symbol.length > 20) {
+ throw new TypeError('token.symbol must be a 1-20 character string')
+ }
+ if (typeof t.decimals !== 'number' || !Number.isInteger(t.decimals) || t.decimals < 0 || t.decimals > 36) {
+ throw new RangeError('token.decimals must be an integer in [0, 36]')
+ }
+ token = { address: getAddress(t.address), symbol: t.symbol, decimals: t.decimals }
+ }
+
+ const decimals = token?.decimals ?? networkInfo(network).usdg.decimals
+ if (amount !== 'dynamic') {
+ const raw = parseUnits(amount, decimals)
+ if (raw <= 0n) throw new RangeError('amount must be greater than zero')
+ const frac = amount.split('.')[1] ?? ''
+ if (frac.length > decimals) {
+ throw new RangeError(`amount "${amount}" has more decimal places than the token's ${decimals}`)
+ }
+ }
+
+ let memo: string | undefined
+ if (r.memo !== undefined) {
+ if (typeof r.memo !== 'string') throw new TypeError('memo must be a string')
+ memo = r.memo.slice(0, MAX_MEMO_LENGTH)
+ }
+
+ let reference: Hex | undefined
+ let router: Address | undefined
+ if (r.reference !== undefined) {
+ if (!isReference(r.reference)) throw new TypeError('reference must be a 0x-prefixed 32-byte hex string')
+ reference = r.reference.toLowerCase() as Hex
+ if (typeof r.router !== 'string' || !isAddress(r.router, { strict: true })) {
+ throw new TypeError('router-mode requests (reference set) must carry a checksummed HoodPayRouter address in "router"')
+ }
+ router = getAddress(r.router)
+ } else if (r.router !== undefined) {
+ throw new TypeError('"router" is only valid together with "reference"')
+ }
+
+ const out: PaymentRequest = { v: 1, network, payTo, amount }
+ if (token) out.token = token
+ if (memo !== undefined) out.memo = memo
+ if (reference) out.reference = reference
+ if (router) out.router = router
+ return out
+}
+
+/** The token a request settles in (USDG unless overridden). */
+export function requestToken(request: PaymentRequest): PayToken {
+ return request.token ?? networkInfo(request.network).usdg
+}
+
+/** Raw on-chain amount for a fixed-amount request. Throws for `"dynamic"`. */
+export function requestRawAmount(request: PaymentRequest): bigint {
+ if (request.amount === 'dynamic') {
+ throw new RangeError('dynamic-amount requests have no fixed raw amount')
+ }
+ return parseUnits(request.amount, requestToken(request).decimals)
+}
+
+/** Format a raw amount in the request's token for display. */
+export function formatRequestAmount(request: PaymentRequest, raw: bigint): string {
+ return formatUnits(raw, requestToken(request).decimals)
+}
+
+// --- URL fragment codec -----------------------------------------------------
+
+function base64UrlEncode(text: string): string {
+ const bytes = new TextEncoder().encode(text)
+ let bin = ''
+ for (const b of bytes) bin += String.fromCharCode(b)
+ return btoa(bin).replaceAll('+', '-').replaceAll('/', '_').replace(/=+$/, '')
+}
+
+function base64UrlDecode(encoded: string): string {
+ const b64 = encoded.replaceAll('-', '+').replaceAll('_', '/')
+ const bin = atob(b64)
+ const bytes = new Uint8Array(bin.length)
+ for (let i = 0; i < bin.length; i++) bytes[i] = bin.charCodeAt(i)
+ return new TextDecoder().decode(bytes)
+}
+
+/**
+ * Encode a request as a URL fragment payload: `1.<base64url(JSON)>`.
+ * The fragment never leaves the browser (fragments are not sent in HTTP
+ * requests), so hosted payment links leak nothing to the host.
+ */
+export function encodePaymentRequest(request: PaymentRequest): string {
+ const validated = validatePaymentRequest(request)
+ return `1.${base64UrlEncode(JSON.stringify(validated))}`
+}
+
+/** Decode and validate a fragment payload produced by {@link encodePaymentRequest}. */
+export function decodePaymentRequest(fragment: string): PaymentRequest {
+ const clean = fragment.startsWith('#') ? fragment.slice(1) : fragment
+ const dot = clean.indexOf('.')
+ if (dot === -1) throw new TypeError('malformed payment link (missing version prefix)')
+ const version = clean.slice(0, dot)
+ if (version !== '1') throw new RangeError(`unsupported payment link version "${version}"`)
+ let parsed: unknown
+ try {
+ parsed = JSON.parse(base64UrlDecode(clean.slice(dot + 1)))
+ } catch {
+ throw new TypeError('malformed payment link (payload is not base64url JSON)')
+ }
+ return validatePaymentRequest(parsed)
+}
+
+/** Build a full hosted payment link for a request. */
+export function paymentLinkUrl(request: PaymentRequest, baseUrl = 'https://nirholas.github.io/hood-pay/pay.html'): string {
+ return `${baseUrl}#${encodePaymentRequest(request)}`
+}
diff --git a/robinhood/hood-pay/src/tx.ts b/robinhood/hood-pay/src/tx.ts
new file mode 100644
index 000000000..dc3ea541f
--- /dev/null
+++ b/robinhood/hood-pay/src/tx.ts
@@ -0,0 +1,58 @@
+import { encodeFunctionData, type Address, type Hex } from 'viem'
+import { erc20Abi, hoodPayRouterAbi } from './abi.js'
+
+/**
+ * Unsigned transaction builders. hood-pay NEVER holds keys: these produce
+ * `{ to, data }` (plus value 0) for the buyer's own wallet - or the
+ * merchant's, for refunds - to sign. Every builder is covered by a unit
+ * test that pins the exact calldata.
+ */
+
+/** An unsigned call: pass to `eth_sendTransaction` / viem `sendTransaction`. */
+export interface UnsignedCall {
+ to: Address
+ data: Hex
+ value: 0n
+}
+
+/** Direct mode: plain ERC-20 `transfer(payTo, rawAmount)` on the token. */
+export function buildTransferTx(token: Address, payTo: Address, rawAmount: bigint): UnsignedCall {
+ return {
+ to: token,
+ data: encodeFunctionData({ abi: erc20Abi, functionName: 'transfer', args: [payTo, rawAmount] }),
+ value: 0n,
+ }
+}
+
+/**
+ * Router mode, step 1: `approve(router, rawAmount)` on the token. USDG has
+ * no EIP-2612 permit (verified on-chain), so an explicit approve is the
+ * only allowance mechanism. hood-pay approves the EXACT invoice amount,
+ * never unlimited.
+ */
+export function buildApproveTx(token: Address, router: Address, rawAmount: bigint): UnsignedCall {
+ return {
+ to: token,
+ data: encodeFunctionData({ abi: erc20Abi, functionName: 'approve', args: [router, rawAmount] }),
+ value: 0n,
+ }
+}
+
+/** Router mode, step 2: `pay(token, payTo, rawAmount, reference)` on the router. */
+export function buildRouterPayTx(
+ router: Address,
+ token: Address,
+ payTo: Address,
+ rawAmount: bigint,
+ reference: Hex,
+): UnsignedCall {
+ return {
+ to: router,
+ data: encodeFunctionData({
+ abi: hoodPayRouterAbi,
+ functionName: 'pay',
+ args: [token, payTo, rawAmount, reference],
+ }),
+ value: 0n,
+ }
+}
diff --git a/robinhood/hood-pay/src/verify/index.ts b/robinhood/hood-pay/src/verify/index.ts
new file mode 100644
index 000000000..bf0a99b44
--- /dev/null
+++ b/robinhood/hood-pay/src/verify/index.ts
@@ -0,0 +1,38 @@
+/**
+ * hood-pay/verify - the merchant side: a reorg-safe on-chain payment
+ * watcher, an idempotent SQLite ledger, signed webhooks, and refund
+ * helpers. Node-only (the widget and link pages never import this).
+ *
+ * @packageDocumentation
+ */
+
+export { awaitPayment, checkPayment, createReader } from './watcher.js'
+export type { AwaitPaymentOptions, ChainReader, WatchOptions, WatchSpec } from './watcher.js'
+
+export type { MatchedTransfer, PaymentResult, PaymentStatus } from './types.js'
+
+export { createLedger } from './ledger.js'
+export type {
+ CreateDirectInvoiceInput,
+ CreateRouterInvoiceInput,
+ Ledger,
+ LedgerInvoice,
+ WebhookDeliveryRecord,
+} from './ledger.js'
+
+export {
+ createWebhookEmitter,
+ signWebhook,
+ verifyWebhookSignature,
+ toWebhookEvent,
+ SIGNATURE_HEADER,
+} from './webhook.js'
+export type {
+ VerifyWebhookOptions,
+ WebhookDeliveryResult,
+ WebhookEmitterOptions,
+ WebhookEvent,
+} from './webhook.js'
+
+export { buildRefundTx, refundOverageTx, refundReceivedTx, sendRefund } from './refund.js'
+export type { RefundSender } from './refund.js'
diff --git a/robinhood/hood-pay/src/verify/ledger.ts b/robinhood/hood-pay/src/verify/ledger.ts
new file mode 100644
index 000000000..e614fcc75
--- /dev/null
+++ b/robinhood/hood-pay/src/verify/ledger.ts
@@ -0,0 +1,345 @@
+import type { Address, Hex } from 'viem'
+import { DUST_MODULUS, DUST_SLOTS, randomDust } from '../reference.js'
+import type { HoodPayNetwork } from '../networks.js'
+import type { MatchedTransfer, PaymentStatus } from './types.js'
+
+/**
+ * Idempotent merchant ledger on SQLite (`node:sqlite`, zero native deps;
+ * Node >= 22.5 - on Node 22 start with `--experimental-sqlite`).
+ *
+ * Guarantees:
+ * - **Idempotent event recording**: `(txHash, logIndex)` is the primary key
+ * of the transfers table, so replaying a webhook, re-running a watcher, or
+ * double-processing a poll can never double-credit an invoice.
+ * - **Monotonic status transitions**: an invoice can only move forward
+ * (pending -> underpaid -> paid -> overpaid -> refunded; expired only from
+ * pending/underpaid). A stale writer can never un-pay an invoice.
+ * - **Atomic dust reservation** (direct mode): a partial UNIQUE index over
+ * pending invoices on `(payTo, token, expectedRaw)` means two concurrent
+ * invoices at the same base price can never hold the same fingerprinted
+ * amount - collisions are impossible by construction, not by probability.
+ */
+
+const STATUS_RANK: Record<PaymentStatus, number> = {
+ pending: 0,
+ expired: 1,
+ underpaid: 2,
+ paid: 3,
+ overpaid: 4,
+ refunded: 5,
+}
+
+/** A ledger row. */
+export interface LedgerInvoice {
+ id: string
+ network: HoodPayNetwork
+ payTo: Address
+ token: Address
+ /** Raw units expected, dust included for direct mode. */
+ expectedRaw: bigint
+ /** Direct-mode dust component of expectedRaw (0n for router mode). */
+ dust: bigint
+ reference?: Hex
+ memo?: string
+ status: PaymentStatus
+ payer?: Address
+ receivedRaw: bigint
+ createdAt: number
+ updatedAt: number
+}
+
+export interface CreateDirectInvoiceInput {
+ network: HoodPayNetwork
+ payTo: Address
+ token: Address
+ /** Raw base amount; its low 4 decimal digits must be zero (see reference scheme). */
+ baseRaw: bigint
+ memo?: string
+}
+
+export interface CreateRouterInvoiceInput {
+ network: HoodPayNetwork
+ payTo: Address
+ token: Address
+ expectedRaw: bigint
+ reference: Hex
+ memo?: string
+}
+
+export interface WebhookDeliveryRecord {
+ paymentId: string
+ event: string
+ ok: boolean
+ attempts: number
+ lastError?: string
+}
+
+export interface Ledger {
+ /** Reserve a unique fingerprinted amount and open a direct-mode invoice. */
+ createDirectInvoice(input: CreateDirectInvoiceInput): LedgerInvoice
+ /** Open a router-mode invoice keyed by its reference. */
+ createRouterInvoice(input: CreateRouterInvoiceInput): LedgerInvoice
+ getInvoice(id: string): LedgerInvoice | undefined
+ /**
+ * Credit an on-chain event to an invoice. Returns the refreshed invoice,
+ * or `undefined` when the event was already recorded (idempotent replay).
+ */
+ recordTransfer(id: string, transfer: MatchedTransfer): LedgerInvoice | undefined
+ /** Move an invoice's status forward. Backward transitions are ignored. */
+ setStatus(id: string, status: PaymentStatus): LedgerInvoice
+ /** List invoices, newest first. */
+ listInvoices(limit?: number): LedgerInvoice[]
+ /** Record the outcome of a webhook delivery attempt. */
+ recordWebhookDelivery(record: WebhookDeliveryRecord): void
+ close(): void
+}
+
+interface SqliteStatement {
+ run(...args: unknown[]): { changes: number | bigint }
+ get(...args: unknown[]): unknown
+ all(...args: unknown[]): unknown[]
+}
+interface SqliteDatabase {
+ exec(sql: string): void
+ prepare(sql: string): SqliteStatement
+ close(): void
+}
+
+interface InvoiceRow {
+ id: string
+ network: string
+ pay_to: string
+ token: string
+ expected_raw: string
+ dust: string
+ reference: string | null
+ memo: string | null
+ status: string
+ payer: string | null
+ received_raw: string
+ created_at: number
+ updated_at: number
+}
+
+function rowToInvoice(row: InvoiceRow): LedgerInvoice {
+ const invoice: LedgerInvoice = {
+ id: row.id,
+ network: row.network as HoodPayNetwork,
+ payTo: row.pay_to as Address,
+ token: row.token as Address,
+ expectedRaw: BigInt(row.expected_raw),
+ dust: BigInt(row.dust),
+ status: row.status as PaymentStatus,
+ receivedRaw: BigInt(row.received_raw),
+ createdAt: Number(row.created_at),
+ updatedAt: Number(row.updated_at),
+ }
+ if (row.reference) invoice.reference = row.reference as Hex
+ if (row.memo !== null) invoice.memo = row.memo
+ if (row.payer) invoice.payer = row.payer as Address
+ return invoice
+}
+
+/**
+ * Open (or create) a ledger database. `path` may be `':memory:'` for tests.
+ * Async because `node:sqlite` is imported lazily with a version-aware error.
+ */
+export async function createLedger(path: string): Promise<Ledger> {
+ let DatabaseSync: new (path: string) => SqliteDatabase
+ try {
+ ;({ DatabaseSync } = (await import('node:sqlite')) as unknown as {
+ DatabaseSync: new (path: string) => SqliteDatabase
+ })
+ } catch {
+ throw new Error(
+ 'hood-pay ledger needs the node:sqlite module (Node >= 23, or Node 22.5+ with --experimental-sqlite)',
+ )
+ }
+ const db = new DatabaseSync(path)
+ db.exec(`
+ PRAGMA journal_mode = WAL;
+ CREATE TABLE IF NOT EXISTS invoices (
+ id TEXT PRIMARY KEY,
+ network TEXT NOT NULL,
+ pay_to TEXT NOT NULL,
+ token TEXT NOT NULL,
+ expected_raw TEXT NOT NULL,
+ dust TEXT NOT NULL DEFAULT '0',
+ reference TEXT,
+ memo TEXT,
+ status TEXT NOT NULL DEFAULT 'pending',
+ payer TEXT,
+ received_raw TEXT NOT NULL DEFAULT '0',
+ created_at INTEGER NOT NULL,
+ updated_at INTEGER NOT NULL
+ );
+ CREATE UNIQUE INDEX IF NOT EXISTS idx_pending_amount_reservation
+ ON invoices (pay_to, token, expected_raw)
+ WHERE status IN ('pending', 'underpaid') AND reference IS NULL;
+ CREATE TABLE IF NOT EXISTS transfers (
+ tx_hash TEXT NOT NULL,
+ log_index INTEGER NOT NULL,
+ invoice_id TEXT NOT NULL REFERENCES invoices(id),
+ payer TEXT NOT NULL,
+ amount_raw TEXT NOT NULL,
+ block_number INTEGER NOT NULL,
+ block_hash TEXT NOT NULL,
+ PRIMARY KEY (tx_hash, log_index)
+ );
+ CREATE TABLE IF NOT EXISTS webhook_deliveries (
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
+ invoice_id TEXT NOT NULL,
+ event TEXT NOT NULL,
+ ok INTEGER NOT NULL,
+ attempts INTEGER NOT NULL,
+ last_error TEXT,
+ created_at INTEGER NOT NULL
+ );
+ `)
+
+ const insertInvoice = db.prepare(
+ `INSERT INTO invoices (id, network, pay_to, token, expected_raw, dust, reference, memo, status, received_raw, created_at, updated_at)
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, 'pending', '0', ?, ?)`,
+ )
+ const selectInvoice = db.prepare('SELECT * FROM invoices WHERE id = ?')
+ const selectAll = db.prepare('SELECT * FROM invoices ORDER BY created_at DESC, id DESC LIMIT ?')
+ const insertTransfer = db.prepare(
+ `INSERT OR IGNORE INTO transfers (tx_hash, log_index, invoice_id, payer, amount_raw, block_number, block_hash)
+ VALUES (?, ?, ?, ?, ?, ?, ?)`,
+ )
+ // Amounts are summed in JS as BigInt: 18-decimal tokens overflow SQLite's
+ // 64-bit integers, so SUM() in SQL would silently lose precision.
+ const listTransferAmounts = db.prepare('SELECT amount_raw FROM transfers WHERE invoice_id = ?')
+ const updateReceived = db.prepare(
+ 'UPDATE invoices SET received_raw = ?, payer = COALESCE(payer, ?), status = ?, updated_at = ? WHERE id = ?',
+ )
+ const updateStatus = db.prepare('UPDATE invoices SET status = ?, updated_at = ? WHERE id = ?')
+ const insertDelivery = db.prepare(
+ 'INSERT INTO webhook_deliveries (invoice_id, event, ok, attempts, last_error, created_at) VALUES (?, ?, ?, ?, ?, ?)',
+ )
+
+ function mustGet(id: string): LedgerInvoice {
+ const row = selectInvoice.get(id) as InvoiceRow | undefined
+ if (!row) throw new RangeError(`unknown invoice "${id}"`)
+ return rowToInvoice(row)
+ }
+
+ function statusFor(expected: bigint, received: bigint, current: PaymentStatus): PaymentStatus {
+ let next: PaymentStatus = current
+ if (received > 0n) {
+ next = received < expected ? 'underpaid' : received === expected ? 'paid' : 'overpaid'
+ }
+ return STATUS_RANK[next] > STATUS_RANK[current] ? next : current
+ }
+
+ return {
+ createDirectInvoice(input) {
+ if (input.baseRaw <= 0n) throw new RangeError('baseRaw must be positive')
+ if (input.baseRaw % DUST_MODULUS !== 0n) {
+ throw new RangeError('baseRaw must leave the low 4 decimal digits free for the fingerprint')
+ }
+ const now = Date.now()
+ // Atomic reservation: the partial unique index rejects a duplicate
+ // (payTo, token, expectedRaw) among open direct invoices; retry with
+ // fresh dust until a free slot is found.
+ for (let attempt = 0; attempt < DUST_SLOTS; attempt++) {
+ const dust = randomDust()
+ const expected = input.baseRaw + dust
+ const id = `hp_${crypto.randomUUID().replaceAll('-', '')}`
+ try {
+ insertInvoice.run(
+ id,
+ input.network,
+ input.payTo,
+ input.token,
+ expected.toString(),
+ dust.toString(),
+ null,
+ input.memo ?? null,
+ now,
+ now,
+ )
+ return mustGet(id)
+ } catch (error) {
+ const message = error instanceof Error ? error.message : String(error)
+ if (!message.includes('UNIQUE')) throw error
+ }
+ }
+ throw new RangeError(
+ `all ${DUST_SLOTS} fingerprint slots for this (payTo, token, amount) are reserved by open invoices; ` +
+ 'settle or expire some, or switch to router mode',
+ )
+ },
+
+ createRouterInvoice(input) {
+ if (input.expectedRaw <= 0n) throw new RangeError('expectedRaw must be positive')
+ const now = Date.now()
+ insertInvoice.run(
+ input.reference,
+ input.network,
+ input.payTo,
+ input.token,
+ input.expectedRaw.toString(),
+ '0',
+ input.reference,
+ input.memo ?? null,
+ now,
+ now,
+ )
+ return mustGet(input.reference)
+ },
+
+ getInvoice(id) {
+ const row = selectInvoice.get(id) as InvoiceRow | undefined
+ return row ? rowToInvoice(row) : undefined
+ },
+
+ recordTransfer(id, transfer) {
+ const invoice = mustGet(id)
+ const inserted = insertTransfer.run(
+ transfer.txHash,
+ transfer.logIndex,
+ id,
+ transfer.payer,
+ transfer.amountRaw.toString(),
+ Number(transfer.blockNumber),
+ transfer.blockHash,
+ )
+ if (Number(inserted.changes) === 0) return undefined // replay - already credited
+ const total = (listTransferAmounts.all(id) as Array<{ amount_raw: string }>).reduce(
+ (sum, row) => sum + BigInt(row.amount_raw),
+ 0n,
+ )
+ const next = statusFor(invoice.expectedRaw, total, invoice.status)
+ updateReceived.run(total.toString(), transfer.payer, next, Date.now(), id)
+ return mustGet(id)
+ },
+
+ setStatus(id, status) {
+ const invoice = mustGet(id)
+ if (STATUS_RANK[status] > STATUS_RANK[invoice.status]) {
+ updateStatus.run(status, Date.now(), id)
+ }
+ return mustGet(id)
+ },
+
+ listInvoices(limit = 100) {
+ return (selectAll.all(limit) as InvoiceRow[]).map(rowToInvoice)
+ },
+
+ recordWebhookDelivery(record) {
+ insertDelivery.run(
+ record.paymentId,
+ record.event,
+ record.ok ? 1 : 0,
+ record.attempts,
+ record.lastError ?? null,
+ Date.now(),
+ )
+ },
+
+ close() {
+ db.close()
+ },
+ }
+}
diff --git a/robinhood/hood-pay/src/verify/refund.ts b/robinhood/hood-pay/src/verify/refund.ts
new file mode 100644
index 000000000..dcb111688
--- /dev/null
+++ b/robinhood/hood-pay/src/verify/refund.ts
@@ -0,0 +1,49 @@
+import type { Address, Hex } from 'viem'
+import { buildTransferTx, type UnsignedCall } from '../tx.js'
+import type { PaymentResult } from './types.js'
+
+/**
+ * Refund helpers. hood-pay never holds the merchant's keys: `buildRefundTx`
+ * produces the unsigned ERC-20 transfer for ANY signer, and `sendRefund`
+ * drives a viem WalletClient the merchant supplies (key from
+ * `ROBINHOOD_CHAIN_PRIVATE_KEY` or a signer service - never from this
+ * library).
+ *
+ * Semantics (documented in docs/verify.html):
+ * - `overpaid` invoices: refund the overage with {@link refundOverageTx}.
+ * - `underpaid` invoices past their window: refund the full received amount
+ * (the sale did not happen) with {@link refundReceivedTx}.
+ * - Full refunds of settled sales: `buildRefundTx(token, payer, expectedRaw)`.
+ */
+
+/** Unsigned ERC-20 transfer sending `rawAmount` of `token` back to `to`. */
+export function buildRefundTx(token: Address, to: Address, rawAmount: bigint): UnsignedCall {
+ if (rawAmount <= 0n) throw new RangeError('refund amount must be positive')
+ return buildTransferTx(token, to, rawAmount)
+}
+
+/** Unsigned refund of an overpaid invoice's overage. Throws unless overpaid. */
+export function refundOverageTx(token: Address, result: PaymentResult): UnsignedCall {
+ if (result.status !== 'overpaid' || result.overageRaw <= 0n) {
+ throw new RangeError(`invoice is ${result.status}, not overpaid - nothing to refund`)
+ }
+ if (!result.payer) throw new RangeError('cannot refund: no payer attributed')
+ return buildRefundTx(token, result.payer, result.overageRaw)
+}
+
+/** Unsigned refund of everything an underpaid/abandoned invoice received. */
+export function refundReceivedTx(token: Address, result: PaymentResult): UnsignedCall {
+ if (result.receivedRaw <= 0n) throw new RangeError('nothing received - nothing to refund')
+ if (!result.payer) throw new RangeError('cannot refund: no payer attributed')
+ return buildRefundTx(token, result.payer, result.receivedRaw)
+}
+
+/** The slice of a viem WalletClient a refund needs (stub-friendly). */
+export interface RefundSender {
+ sendTransaction(args: { to: Address; data: Hex; value: bigint }): Promise<Hex>
+}
+
+/** Sign + broadcast a refund with the merchant's own wallet client. */
+export async function sendRefund(wallet: RefundSender, call: UnsignedCall): Promise<Hex> {
+ return wallet.sendTransaction({ to: call.to, data: call.data, value: call.value })
+}
diff --git a/robinhood/hood-pay/src/verify/types.ts b/robinhood/hood-pay/src/verify/types.ts
new file mode 100644
index 000000000..a086f87d0
--- /dev/null
+++ b/robinhood/hood-pay/src/verify/types.ts
@@ -0,0 +1,39 @@
+import type { Address, Hex } from 'viem'
+
+/** Lifecycle of a hood-pay invoice, as the verifier sees it. */
+export type PaymentStatus =
+ | 'pending' // nothing attributable received yet
+ | 'underpaid' // attributable value received, but less than expected
+ | 'paid' // exactly the expected value received
+ | 'overpaid' // more than expected received - flagged for refund of the overage
+ | 'expired' // watch window closed with nothing received
+ | 'refunded' // merchant refunded the buyer (ledger-only state)
+
+/** One on-chain transfer/route event attributed to an invoice. */
+export interface MatchedTransfer {
+ txHash: Hex
+ logIndex: number
+ blockNumber: bigint
+ blockHash: Hex
+ /** Buyer address (Transfer `from` / PaymentReceived `payer`). */
+ payer: Address
+ /** Raw token units moved in this event. */
+ amountRaw: bigint
+}
+
+/** Result of {@link awaitPayment} / {@link checkPayment}. */
+export interface PaymentResult {
+ status: PaymentStatus
+ /** Raw token units the invoice expects. */
+ expectedRaw: bigint
+ /** Raw token units attributed so far. */
+ receivedRaw: bigint
+ /** Overage (receivedRaw - expectedRaw) when overpaid, else 0n. */
+ overageRaw: bigint
+ /** Buyer address, once at least one transfer is attributed. */
+ payer?: Address
+ /** Every attributed on-chain event, confirmation-depth safe. */
+ transfers: MatchedTransfer[]
+ /** Router-mode reference this result settles, when applicable. */
+ reference?: Hex
+}
diff --git a/robinhood/hood-pay/src/verify/watcher.ts b/robinhood/hood-pay/src/verify/watcher.ts
new file mode 100644
index 000000000..ade683a1a
--- /dev/null
+++ b/robinhood/hood-pay/src/verify/watcher.ts
@@ -0,0 +1,279 @@
+import {
+ createPublicClient,
+ http,
+ parseAbiItem,
+ type Address,
+ type Hex,
+} from 'viem'
+import { networkInfo, type HoodPayNetwork } from '../networks.js'
+import type { MatchedTransfer, PaymentResult, PaymentStatus } from './types.js'
+
+/**
+ * The merchant-side payment watcher. Amounts are verified ON-CHAIN - never
+ * trusted from the DOM, a callback, or a webhook body. Reorg policy:
+ *
+ * - Only blocks at depth >= `confirmations` below the head are ever
+ * scanned, so a log must survive `confirmations` blocks before it can
+ * count (default 30; ~3s of Robinhood Chain's ~100ms blocks).
+ * - Every candidate log's block hash is re-fetched by number and compared;
+ * a mismatch means the block was reorged out after our scan and the log
+ * is dropped.
+ *
+ * Together this makes a confirmed result stable under any reorg shallower
+ * than `confirmations` blocks, and immune to deeper ones that happen
+ * between scanning and re-checking.
+ */
+
+const transferEvent = parseAbiItem('event Transfer(address indexed from, address indexed to, uint256 value)')
+const paymentReceivedEvent = parseAbiItem(
+ 'event PaymentReceived(bytes32 indexed ref, address indexed payer, address indexed payTo, address token, uint256 amount)',
+)
+
+/** The narrow slice of a viem `PublicClient` the watcher needs (stub-friendly). */
+export interface ChainReader {
+ getBlockNumber(): Promise<bigint>
+ getBlock(args: { blockNumber: bigint }): Promise<{ hash: Hex | null }>
+ getLogs(args: {
+ address: Address
+ event: typeof transferEvent | typeof paymentReceivedEvent
+ args?: Record<string, unknown>
+ fromBlock: bigint
+ toBlock: bigint
+ }): Promise<
+ Array<{
+ transactionHash: Hex | null
+ logIndex: number | null
+ blockNumber: bigint | null
+ blockHash: Hex | null
+ args: Record<string, unknown>
+ }>
+ >
+}
+
+/** Build a {@link ChainReader} for a network from viem's public client. */
+export function createReader(network: HoodPayNetwork, rpcUrl?: string): ChainReader {
+ const info = networkInfo(network)
+ return createPublicClient({ transport: http(rpcUrl ?? info.rpcUrl) }) as unknown as ChainReader
+}
+
+/** What to watch for. Exactly one of `reference` (router mode) or plain direct mode. */
+export interface WatchSpec {
+ /** Token contract the invoice settles in. */
+ token: Address
+ /** Merchant receiving address. */
+ payTo: Address
+ /** Raw token units expected. */
+ expectedRaw: bigint
+ /** Router mode: the 32-byte reference and the router emitting it. */
+ reference?: Hex
+ router?: Address
+ /**
+ * Direct mode: the buyer's address, when known (the widget reports it on
+ * success). With a payer, every transfer payer -> payTo is attributed, so
+ * under/overpayment is detected. Without one, only an EXACT match of the
+ * fingerprinted amount is attributable.
+ */
+ payer?: Address
+}
+
+/** Options shared by {@link awaitPayment} and {@link checkPayment}. */
+export interface WatchOptions {
+ reader: ChainReader
+ /** First block to scan (e.g. the block height when the invoice was created). */
+ fromBlock: bigint
+ /** Confirmation depth before a log may count. @defaultValue 30 */
+ confirmations?: number
+ /** Max blocks per `eth_getLogs` call. @defaultValue 5000 */
+ chunkSize?: bigint
+}
+
+export interface AwaitPaymentOptions extends WatchOptions {
+ /** Give up after this long. @defaultValue 600_000 (10 minutes) */
+ timeoutMs?: number
+ /** Delay between head polls. @defaultValue 1500 */
+ pollIntervalMs?: number
+ /** Observer called whenever the aggregate status changes. */
+ onState?: (result: PaymentResult) => void
+ /** Abort from outside (e.g. buyer cancelled). */
+ signal?: AbortSignal
+}
+
+function statusFor(expected: bigint, received: bigint): PaymentStatus {
+ if (received === 0n) return 'pending'
+ if (received < expected) return 'underpaid'
+ if (received === expected) return 'paid'
+ return 'overpaid'
+}
+
+function toResult(spec: WatchSpec, transfers: MatchedTransfer[]): PaymentResult {
+ const receivedRaw = transfers.reduce((sum, t) => sum + t.amountRaw, 0n)
+ const status = statusFor(spec.expectedRaw, receivedRaw)
+ const result: PaymentResult = {
+ status,
+ expectedRaw: spec.expectedRaw,
+ receivedRaw,
+ overageRaw: receivedRaw > spec.expectedRaw ? receivedRaw - spec.expectedRaw : 0n,
+ transfers,
+ }
+ if (transfers[0]) result.payer = transfers[0].payer
+ if (spec.reference) result.reference = spec.reference
+ return result
+}
+
+/** Scan one confirmed block range for attributable events. */
+async function scanRange(
+ spec: WatchSpec,
+ reader: ChainReader,
+ fromBlock: bigint,
+ toBlock: bigint,
+): Promise<MatchedTransfer[]> {
+ const matches: MatchedTransfer[] = []
+ const logs = spec.reference
+ ? await reader.getLogs({
+ address: spec.router!,
+ event: paymentReceivedEvent,
+ args: { ref: spec.reference, payTo: spec.payTo },
+ fromBlock,
+ toBlock,
+ })
+ : await reader.getLogs({
+ address: spec.token,
+ event: transferEvent,
+ args: spec.payer ? { from: spec.payer, to: spec.payTo } : { to: spec.payTo },
+ fromBlock,
+ toBlock,
+ })
+
+ for (const log of logs) {
+ if (log.blockNumber === null || log.blockHash === null || log.transactionHash === null || log.logIndex === null) {
+ continue // pending log - not yet mined, cannot count
+ }
+ let payer: Address
+ let amountRaw: bigint
+ if (spec.reference) {
+ if ((log.args.token as string).toLowerCase() !== spec.token.toLowerCase()) continue
+ payer = log.args.payer as Address
+ amountRaw = log.args.amount as bigint
+ } else {
+ payer = log.args.from as Address
+ amountRaw = log.args.value as bigint
+ // Anonymous direct mode: only the exact fingerprinted amount is
+ // attributable to THIS invoice; other transfers belong to other buyers.
+ if (!spec.payer && amountRaw !== spec.expectedRaw) continue
+ }
+ // Reorg re-check: the block that carried this log must still be canonical.
+ const canonical = await reader.getBlock({ blockNumber: log.blockNumber })
+ if (!canonical.hash || canonical.hash.toLowerCase() !== log.blockHash.toLowerCase()) continue
+ matches.push({
+ txHash: log.transactionHash,
+ logIndex: log.logIndex,
+ blockNumber: log.blockNumber,
+ blockHash: log.blockHash,
+ payer,
+ amountRaw,
+ })
+ }
+ return matches
+}
+
+/**
+ * One-shot historical check: scan `[fromBlock, head - confirmations]` once
+ * and report. Useful for reconciliation and audits of past invoices.
+ */
+export async function checkPayment(spec: WatchSpec, options: WatchOptions): Promise<PaymentResult> {
+ const confirmations = BigInt(options.confirmations ?? 30)
+ const chunkSize = options.chunkSize ?? 5000n
+ const head = await options.reader.getBlockNumber()
+ const safeHead = head - confirmations
+ const transfers: MatchedTransfer[] = []
+ let cursor = options.fromBlock
+ while (cursor <= safeHead) {
+ const to = cursor + chunkSize - 1n > safeHead ? safeHead : cursor + chunkSize - 1n
+ transfers.push(...(await scanRange(spec, options.reader, cursor, to)))
+ cursor = to + 1n
+ }
+ return toResult(spec, transfers)
+}
+
+class Deferred<T> {
+ promise: Promise<T>
+ resolve!: (value: T) => void
+ constructor() {
+ this.promise = new Promise((resolve) => {
+ this.resolve = resolve
+ })
+ }
+}
+
+/**
+ * Watch the chain until the invoice is settled (paid or overpaid), the
+ * timeout elapses, or `signal` aborts. NEVER rejects on settlement grounds:
+ * the returned {@link PaymentResult} carries the terminal status
+ * (`paid` / `overpaid` / `underpaid` / `expired`) so merchants handle every
+ * outcome explicitly. Network errors during a poll are retried on the next
+ * tick; a persistent RPC failure surfaces after the timeout as the current
+ * aggregate state.
+ */
+export async function awaitPayment(spec: WatchSpec, options: AwaitPaymentOptions): Promise<PaymentResult> {
+ if (spec.reference && !spec.router) {
+ throw new TypeError('router-mode specs (reference set) need the router address')
+ }
+ const confirmations = BigInt(options.confirmations ?? 30)
+ const chunkSize = options.chunkSize ?? 5000n
+ const timeoutMs = options.timeoutMs ?? 600_000
+ const pollIntervalMs = options.pollIntervalMs ?? 1500
+ const startedAt = Date.now()
+
+ const seen = new Set<string>()
+ const transfers: MatchedTransfer[] = []
+ let cursor = options.fromBlock
+ let lastStatus: PaymentStatus | undefined
+ const done = new Deferred<PaymentResult>()
+ let settled = false
+
+ const finish = (result: PaymentResult) => {
+ if (settled) return
+ settled = true
+ done.resolve(result)
+ }
+
+ const tick = async () => {
+ const head = await options.reader.getBlockNumber()
+ const safeHead = head - confirmations
+ while (cursor <= safeHead) {
+ const to = cursor + chunkSize - 1n > safeHead ? safeHead : cursor + chunkSize - 1n
+ for (const match of await scanRange(spec, options.reader, cursor, to)) {
+ const key = `${match.txHash}:${match.logIndex}`
+ if (seen.has(key)) continue
+ seen.add(key)
+ transfers.push(match)
+ }
+ cursor = to + 1n
+ }
+ const result = toResult(spec, transfers)
+ if (result.status !== lastStatus) {
+ lastStatus = result.status
+ options.onState?.(result)
+ }
+ if (result.status === 'paid' || result.status === 'overpaid') finish(result)
+ }
+
+ const loop = async () => {
+ while (!settled) {
+ try {
+ await tick()
+ } catch {
+ // transient RPC failure: retry on the next tick
+ }
+ if (settled) return
+ if (Date.now() - startedAt >= timeoutMs || options.signal?.aborted) {
+ const result = toResult(spec, transfers)
+ finish(result.status === 'pending' ? { ...result, status: 'expired' } : result)
+ return
+ }
+ await new Promise((r) => setTimeout(r, pollIntervalMs))
+ }
+ }
+ void loop()
+ return done.promise
+}
diff --git a/robinhood/hood-pay/src/verify/webhook.ts b/robinhood/hood-pay/src/verify/webhook.ts
new file mode 100644
index 000000000..f65c22917
--- /dev/null
+++ b/robinhood/hood-pay/src/verify/webhook.ts
@@ -0,0 +1,169 @@
+import { createHmac, timingSafeEqual } from 'node:crypto'
+import type { PaymentResult } from './types.js'
+
+/**
+ * Signed webhooks, Stripe-style. Every delivery carries a
+ * `hood-pay-signature: t=<unix seconds>,v1=<hex hmac-sha256>` header where
+ * the MAC covers `"<t>.<raw body>"` with the merchant's shared secret.
+ * Receivers MUST verify the signature and SHOULD reject stale timestamps
+ * (default tolerance 5 minutes) - and must still treat the payload as a
+ * hint only: the ledger/watcher remain the source of truth for amounts.
+ */
+
+export const SIGNATURE_HEADER = 'hood-pay-signature'
+
+/** Compute the signature header value for a body at a timestamp. */
+export function signWebhook(secret: string, body: string, timestampSeconds: number): string {
+ const mac = createHmac('sha256', secret).update(`${timestampSeconds}.${body}`).digest('hex')
+ return `t=${timestampSeconds},v1=${mac}`
+}
+
+export interface VerifyWebhookOptions {
+ /** Max accepted age/skew of the timestamp, seconds. @defaultValue 300 */
+ toleranceSeconds?: number
+ /** Injectable clock (unix seconds) for deterministic tests. */
+ now?: number
+}
+
+/** Verify a `hood-pay-signature` header against a raw body. Constant-time. */
+export function verifyWebhookSignature(
+ secret: string,
+ body: string,
+ header: string,
+ options: VerifyWebhookOptions = {},
+): boolean {
+ const tolerance = options.toleranceSeconds ?? 300
+ const parts = new Map(
+ header.split(',').map((part) => {
+ const eq = part.indexOf('=')
+ return [part.slice(0, eq).trim(), part.slice(eq + 1).trim()] as const
+ }),
+ )
+ const t = Number(parts.get('t'))
+ const v1 = parts.get('v1')
+ if (!Number.isFinite(t) || !v1 || !/^[0-9a-f]{64}$/.test(v1)) return false
+ const now = options.now ?? Math.floor(Date.now() / 1000)
+ if (Math.abs(now - t) > tolerance) return false
+ const expected = createHmac('sha256', secret).update(`${t}.${body}`).digest()
+ const given = Buffer.from(v1, 'hex')
+ return expected.length === given.length && timingSafeEqual(expected, given)
+}
+
+/** The JSON body a hood-pay webhook posts. */
+export interface WebhookEvent {
+ /** e.g. `payment.paid`, `payment.underpaid`, `payment.overpaid`, `payment.expired` */
+ type: string
+ /** Invoice id (ledger id / router reference). */
+ invoiceId: string
+ /** Full verifier result, bigints as decimal strings. */
+ payment: {
+ status: PaymentResult['status']
+ expectedRaw: string
+ receivedRaw: string
+ overageRaw: string
+ payer?: string
+ reference?: string
+ transfers: Array<{
+ txHash: string
+ logIndex: number
+ blockNumber: string
+ payer: string
+ amountRaw: string
+ }>
+ }
+ /** Unix seconds when the event was created. */
+ created: number
+}
+
+/** Serialize a {@link PaymentResult} into the webhook wire shape. */
+export function toWebhookEvent(type: string, invoiceId: string, result: PaymentResult): WebhookEvent {
+ const payment: WebhookEvent['payment'] = {
+ status: result.status,
+ expectedRaw: result.expectedRaw.toString(),
+ receivedRaw: result.receivedRaw.toString(),
+ overageRaw: result.overageRaw.toString(),
+ transfers: result.transfers.map((t) => ({
+ txHash: t.txHash,
+ logIndex: t.logIndex,
+ blockNumber: t.blockNumber.toString(),
+ payer: t.payer,
+ amountRaw: t.amountRaw.toString(),
+ })),
+ }
+ if (result.payer) payment.payer = result.payer
+ if (result.reference) payment.reference = result.reference
+ return { type, invoiceId, payment, created: Math.floor(Date.now() / 1000) }
+}
+
+export interface WebhookEmitterOptions {
+ url: string
+ secret: string
+ /** Backoff delays between attempts, ms. @defaultValue [0, 2000, 10000, 60000] */
+ retryDelaysMs?: number[]
+ /** Injectable fetch for tests. */
+ fetchImpl?: typeof fetch
+}
+
+export interface WebhookDeliveryResult {
+ ok: boolean
+ attempts: number
+ /** HTTP status of the final attempt, when a response was received. */
+ status?: number
+ error?: string
+}
+
+/**
+ * Create a webhook emitter. `emit` posts the signed event and retries on
+ * network errors and 5xx/429 responses; 2xx settles as delivered, other
+ * 4xx settle as failed immediately (the receiver rejected it - retrying
+ * the same payload cannot help).
+ */
+export function createWebhookEmitter(options: WebhookEmitterOptions) {
+ const delays = options.retryDelaysMs ?? [0, 2000, 10000, 60000]
+ const doFetch = options.fetchImpl ?? fetch
+
+ return {
+ async emit(event: WebhookEvent): Promise<WebhookDeliveryResult> {
+ const body = JSON.stringify(event)
+ let lastError: string | undefined
+ let lastStatus: number | undefined
+ for (let attempt = 0; attempt < delays.length; attempt++) {
+ const delay = delays[attempt]!
+ if (delay > 0) await new Promise((r) => setTimeout(r, delay))
+ try {
+ const response = await doFetch(options.url, {
+ method: 'POST',
+ headers: {
+ 'content-type': 'application/json',
+ [SIGNATURE_HEADER]: signWebhook(options.secret, body, Math.floor(Date.now() / 1000)),
+ },
+ body,
+ })
+ lastStatus = response.status
+ if (response.ok) {
+ const result: WebhookDeliveryResult = { ok: true, attempts: attempt + 1, status: response.status }
+ return result
+ }
+ if (response.status !== 429 && response.status < 500) {
+ return {
+ ok: false,
+ attempts: attempt + 1,
+ status: response.status,
+ error: `receiver rejected with HTTP ${response.status}`,
+ }
+ }
+ lastError = `HTTP ${response.status}`
+ } catch (error) {
+ lastError = error instanceof Error ? error.message : String(error)
+ }
+ }
+ const result: WebhookDeliveryResult = {
+ ok: false,
+ attempts: delays.length,
+ error: lastError ?? 'delivery failed',
+ }
+ if (lastStatus !== undefined) result.status = lastStatus
+ return result
+ },
+ }
+}
diff --git a/robinhood/hood-pay/src/widget/iife.ts b/robinhood/hood-pay/src/widget/iife.ts
new file mode 100644
index 000000000..9ed79ebbe
--- /dev/null
+++ b/robinhood/hood-pay/src/widget/iife.ts
@@ -0,0 +1,74 @@
+import { decodePaymentRequest, encodePaymentRequest, paymentLinkUrl } from '../request.js'
+import { mountCheckout, validateCheckoutConfig, type CheckoutConfig } from './widget.js'
+
+/**
+ * IIFE entry for script-tag embedding (built to `dist/hood-pay.min.js`).
+ *
+ * Auto-mount: any element carrying `data-hoodpay` is mounted on
+ * DOMContentLoaded from its data attributes:
+ *
+ * <div data-hoodpay
+ * data-pay-to="0x…"
+ * data-amount="12.50"
+ * data-network="mainnet"
+ * data-memo="Invoice 7"></div>
+ * <script src="https://nirholas.github.io/hood-pay/hood-pay.min.js"></script>
+ *
+ * Router mode adds `data-reference` + `data-router`; token overrides use
+ * `data-token-address` / `data-token-symbol` / `data-token-decimals`.
+ */
+
+function configFrom(el: HTMLElement): CheckoutConfig {
+ const d = el.dataset
+ const config: CheckoutConfig = {
+ payTo: d.payTo ?? '',
+ amount: d.amount ?? '',
+ }
+ if (d.network === 'mainnet' || d.network === 'testnet') config.network = d.network
+ if (d.memo) config.memo = d.memo
+ if (d.reference) config.reference = d.reference
+ if (d.router) config.router = d.router
+ if (d.tokenAddress && d.tokenSymbol && d.tokenDecimals) {
+ config.token = {
+ address: d.tokenAddress,
+ symbol: d.tokenSymbol,
+ decimals: Number(d.tokenDecimals),
+ }
+ }
+ return config
+}
+
+function autoMount(): void {
+ for (const el of Array.from(document.querySelectorAll<HTMLElement>('[data-hoodpay]'))) {
+ if (el.dataset.hoodpayMounted === 'true') continue
+ el.dataset.hoodpayMounted = 'true'
+ try {
+ mountCheckout(el, configFrom(el))
+ } catch (error) {
+ el.textContent = `hood-pay: ${error instanceof Error ? error.message : String(error)}`
+ }
+ }
+}
+
+const api = {
+ version: '0.1.0',
+ mount: mountCheckout,
+ validateConfig: validateCheckoutConfig,
+ decodePaymentRequest,
+ encodePaymentRequest,
+ paymentLinkUrl,
+}
+
+declare global {
+ interface Window {
+ HoodPay: typeof api
+ }
+}
+
+window.HoodPay = api
+
+if (document.readyState === 'loading') {
+ document.addEventListener('DOMContentLoaded', autoMount, { once: true })
+} else {
+ autoMount()
+}
diff --git a/robinhood/hood-pay/src/widget/index.ts b/robinhood/hood-pay/src/widget/index.ts
new file mode 100644
index 000000000..b2cc1795a
--- /dev/null
+++ b/robinhood/hood-pay/src/widget/index.ts
@@ -0,0 +1,13 @@
+/**
+ * hood-pay/widget - the embeddable checkout, as an ESM module for bundler
+ * users. Script-tag users load `dist/hood-pay.min.js` instead, which
+ * exposes `window.HoodPay` and auto-mounts `[data-hoodpay]` elements.
+ *
+ * @packageDocumentation
+ */
+
+export { mountCheckout, validateCheckoutConfig } from './widget.js'
+export type { CheckoutConfig, CheckoutHandle, CheckoutReceipt, CheckoutState } from './widget.js'
+export { ensureStyles, WIDGET_CSS } from './styles.js'
+export { decodePaymentRequest, encodePaymentRequest, paymentLinkUrl } from '../request.js'
+export type { PaymentRequest } from '../request.js'
diff --git a/robinhood/hood-pay/src/widget/styles.ts b/robinhood/hood-pay/src/widget/styles.ts
new file mode 100644
index 000000000..4f74b7fec
--- /dev/null
+++ b/robinhood/hood-pay/src/widget/styles.ts
@@ -0,0 +1,76 @@
+/**
+ * Widget stylesheet, injected once per document. Dark-first with a single
+ * accent gradient; every interactive element has hover/active/focus states;
+ * responsive from 320px up. Scoped under `.hoodpay` to never leak into the
+ * host page.
+ */
+export const WIDGET_CSS = `
+.hoodpay{--hp-bg:#0b0e12;--hp-panel:#12161d;--hp-line:#232a35;--hp-text:#e8edf4;--hp-dim:#8b96a5;
+--hp-accent:#00c805;--hp-accent2:#00e5a0;--hp-danger:#ff5c5c;--hp-warn:#ffb454;--hp-radius:14px;
+font-family:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
+color:var(--hp-text);background:var(--hp-bg);border:1px solid var(--hp-line);border-radius:var(--hp-radius);
+max-width:420px;width:100%;box-sizing:border-box;padding:20px;line-height:1.45;font-size:15px}
+.hoodpay *{box-sizing:border-box;margin:0}
+.hoodpay-head{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-bottom:14px}
+.hoodpay-brand{font-weight:700;letter-spacing:-.02em;font-size:14px;color:var(--hp-dim)}
+.hoodpay-brand b{background:linear-gradient(90deg,var(--hp-accent),var(--hp-accent2));
+-webkit-background-clip:text;background-clip:text;color:transparent}
+.hoodpay-net{font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:var(--hp-dim);
+border:1px solid var(--hp-line);border-radius:999px;padding:3px 9px}
+.hoodpay-net[data-net="testnet"]{color:var(--hp-warn);border-color:rgba(255,180,84,.4)}
+.hoodpay-amount{font-size:34px;font-weight:700;letter-spacing:-.03em;margin:2px 0 4px}
+.hoodpay-amount small{font-size:16px;font-weight:600;color:var(--hp-dim);margin-left:6px}
+.hoodpay-memo{color:var(--hp-dim);font-size:14px;margin-bottom:14px;overflow-wrap:anywhere}
+.hoodpay-row{display:flex;justify-content:space-between;gap:12px;padding:9px 0;
+border-top:1px solid var(--hp-line);font-size:13px}
+.hoodpay-row dt{color:var(--hp-dim)}.hoodpay-row dd{font-variant-numeric:tabular-nums;text-align:right;overflow-wrap:anywhere}
+.hoodpay-btn{appearance:none;width:100%;border:0;border-radius:10px;padding:13px 16px;margin-top:14px;
+font:inherit;font-weight:600;cursor:pointer;color:#04110a;
+background:linear-gradient(90deg,var(--hp-accent),var(--hp-accent2));
+transition:transform .12s ease,filter .12s ease,opacity .12s ease}
+.hoodpay-btn:hover{filter:brightness(1.08)}
+.hoodpay-btn:active{transform:translateY(1px) scale(.995)}
+.hoodpay-btn:focus-visible,.hoodpay a:focus-visible,.hoodpay-wallet:focus-visible,.hoodpay-input:focus-visible{
+outline:2px solid var(--hp-accent2);outline-offset:2px}
+.hoodpay-btn[disabled]{opacity:.55;cursor:not-allowed}
+.hoodpay-btn.secondary{background:transparent;color:var(--hp-text);border:1px solid var(--hp-line)}
+.hoodpay-btn.secondary:hover{border-color:var(--hp-dim)}
+.hoodpay-input{width:100%;padding:12px 14px;border-radius:10px;border:1px solid var(--hp-line);
+background:var(--hp-panel);color:var(--hp-text);font:inherit;font-size:22px;font-weight:600;margin:6px 0 2px}
+.hoodpay-input:hover{border-color:var(--hp-dim)}
+.hoodpay-label{font-size:12px;color:var(--hp-dim);text-transform:uppercase;letter-spacing:.07em}
+.hoodpay-wallets{display:flex;flex-direction:column;gap:8px;margin-top:12px}
+.hoodpay-wallet{display:flex;align-items:center;gap:12px;width:100%;padding:11px 13px;border-radius:10px;
+border:1px solid var(--hp-line);background:var(--hp-panel);color:var(--hp-text);font:inherit;font-weight:600;
+cursor:pointer;transition:border-color .12s ease,background .12s ease}
+.hoodpay-wallet:hover{border-color:var(--hp-accent2)}
+.hoodpay-wallet:active{background:#161c25}
+.hoodpay-wallet img{width:26px;height:26px;border-radius:6px}
+.hoodpay-status{display:flex;align-items:center;gap:12px;padding:14px;border-radius:10px;
+background:var(--hp-panel);border:1px solid var(--hp-line);margin-top:14px;font-size:14px}
+.hoodpay-spin{width:18px;height:18px;flex:none;border-radius:50%;border:2px solid var(--hp-line);
+border-top-color:var(--hp-accent2);animation:hoodpay-spin .8s linear infinite}
+@keyframes hoodpay-spin{to{transform:rotate(360deg)}}
+.hoodpay-ok{color:var(--hp-accent2)}.hoodpay-err{color:var(--hp-danger)}.hoodpay-warnc{color:var(--hp-warn)}
+.hoodpay-check{width:44px;height:44px;border-radius:50%;flex:none;display:grid;place-items:center;
+background:rgba(0,229,160,.12);color:var(--hp-accent2);font-size:22px;animation:hoodpay-pop .25s ease}
+@keyframes hoodpay-pop{from{transform:scale(.6);opacity:0}to{transform:scale(1);opacity:1}}
+.hoodpay a{color:var(--hp-accent2);text-decoration:none;border-bottom:1px solid rgba(0,229,160,.35)}
+.hoodpay a:hover{border-bottom-color:var(--hp-accent2)}
+.hoodpay-fine{font-size:12px;color:var(--hp-dim);margin-top:12px;text-align:center}
+.hoodpay-err-box{border-color:rgba(255,92,92,.45)}
+@media (max-width:360px){.hoodpay{padding:14px}.hoodpay-amount{font-size:28px}}
+@media (prefers-reduced-motion:reduce){.hoodpay-spin,.hoodpay-check{animation:none}}
+`
+
+let injected = false
+
+/** Inject the stylesheet once. Safe to call repeatedly. */
+export function ensureStyles(doc: Document = document): void {
+ if (injected && doc.querySelector('style[data-hood-pay]')) return
+ const style = doc.createElement('style')
+ style.setAttribute('data-hood-pay', '')
+ style.textContent = WIDGET_CSS
+ doc.head.appendChild(style)
+ injected = true
+}
diff --git a/robinhood/hood-pay/src/widget/widget.ts b/robinhood/hood-pay/src/widget/widget.ts
new file mode 100644
index 000000000..baf3df85a
--- /dev/null
+++ b/robinhood/hood-pay/src/widget/widget.ts
@@ -0,0 +1,444 @@
+import {
+ discoverWallets,
+ ensureChain,
+ type Eip1193Provider,
+ type Eip6963ProviderDetail,
+} from 'hood-connect'
+import { decodeFunctionResult, encodeFunctionData, formatUnits, parseUnits, type Address, type Hex } from 'viem'
+import { erc20Abi } from '../abi.js'
+import { explorerTxUrl, networkInfo } from '../networks.js'
+import {
+ requestRawAmount,
+ requestToken,
+ validatePaymentRequest,
+ type PaymentRequest,
+} from '../request.js'
+import { buildApproveTx, buildRouterPayTx, buildTransferTx, type UnsignedCall } from '../tx.js'
+import { ensureStyles } from './styles.js'
+
+/**
+ * The embeddable hood-pay checkout. One div + one call (or one script tag,
+ * via the IIFE build). The widget NEVER holds keys, never custodies funds,
+ * and never decides amounts from the DOM at settlement time - it only
+ * builds unsigned calls for the buyer's own wallet to approve, and the
+ * merchant's verifier re-checks everything on-chain.
+ */
+
+/** What `onSuccess` receives after the payment transaction is mined. */
+export interface CheckoutReceipt {
+ txHash: Hex
+ payer: Address
+ /** Raw token units paid (decimal string - JSON-safe). */
+ amountRaw: string
+ /** Display amount, e.g. `"12.5"`. */
+ amount: string
+ tokenSymbol: string
+ network: 'mainnet' | 'testnet'
+ reference?: Hex
+ explorerUrl: string
+}
+
+/** Merchant-facing widget configuration. */
+export interface CheckoutConfig {
+ /** Merchant receiving address. */
+ payTo: string
+ /** Decimal amount (`"12.50"`) or `"dynamic"` for buyer-entered amounts. */
+ amount: string
+ /** `'mainnet'` (default) or `'testnet'`. */
+ network?: 'mainnet' | 'testnet'
+ /** Override the payment token (default: USDG on the chosen network). */
+ token?: { address: string; symbol: string; decimals: number }
+ /** Shown to the buyer. Off-chain only. */
+ memo?: string
+ /** Router-mode reference (32-byte hex). Requires `router`. */
+ reference?: string
+ /** HoodPayRouter address (router mode). */
+ router?: string
+ onSuccess?: (receipt: CheckoutReceipt) => void
+ onError?: (error: Error) => void
+ /** Observer for every state transition (analytics, custom UI hooks). */
+ onStateChange?: (state: CheckoutState) => void
+}
+
+/** Every observable widget state. */
+export type CheckoutState =
+ | { step: 'review' }
+ | { step: 'discovering' }
+ | { step: 'choose-wallet'; wallets: number }
+ | { step: 'connecting'; wallet: string }
+ | { step: 'insufficient'; balance: string; needed: string }
+ | { step: 'approving' }
+ | { step: 'paying' }
+ | { step: 'confirming'; txHash: Hex }
+ | { step: 'success'; receipt: CheckoutReceipt }
+ | { step: 'error'; message: string; recoverable: boolean }
+
+/** Handle returned by {@link mountCheckout}. */
+export interface CheckoutHandle {
+ /** The validated request this checkout renders. */
+ request: PaymentRequest
+ /** Unmount and remove all DOM/listeners. */
+ destroy(): void
+}
+
+/**
+ * Validate a raw config into `{ request, callbacks }`. Exported for unit
+ * tests and for the payment-link page, which builds configs from URL data.
+ */
+export function validateCheckoutConfig(config: unknown): {
+ request: PaymentRequest
+ onSuccess?: (receipt: CheckoutReceipt) => void
+ onError?: (error: Error) => void
+ onStateChange?: (state: CheckoutState) => void
+} {
+ if (typeof config !== 'object' || config === null) throw new TypeError('checkout config must be an object')
+ const c = config as Record<string, unknown>
+ for (const key of ['onSuccess', 'onError', 'onStateChange'] as const) {
+ if (c[key] !== undefined && typeof c[key] !== 'function') {
+ throw new TypeError(`${key} must be a function`)
+ }
+ }
+ const request = validatePaymentRequest({
+ v: 1,
+ network: c.network ?? 'mainnet',
+ payTo: c.payTo,
+ amount: c.amount,
+ token: c.token,
+ memo: c.memo,
+ reference: c.reference,
+ router: c.router,
+ })
+ const out: ReturnType<typeof validateCheckoutConfig> = { request }
+ if (c.onSuccess) out.onSuccess = c.onSuccess as (receipt: CheckoutReceipt) => void
+ if (c.onError) out.onError = c.onError as (error: Error) => void
+ if (c.onStateChange) out.onStateChange = c.onStateChange as (state: CheckoutState) => void
+ return out
+}
+
+function shortAddress(address: string): string {
+ return `${address.slice(0, 6)}…${address.slice(-4)}`
+}
+
+async function readUint(provider: Eip1193Provider, to: Address, data: Hex, fn: 'balanceOf' | 'allowance'): Promise<bigint> {
+ const raw = (await provider.request({ method: 'eth_call', params: [{ to, data }, 'latest'] })) as Hex
+ return decodeFunctionResult({ abi: erc20Abi, functionName: fn, data: raw }) as bigint
+}
+
+async function sendCall(provider: Eip1193Provider, from: Address, call: UnsignedCall): Promise<Hex> {
+ return (await provider.request({
+ method: 'eth_sendTransaction',
+ params: [{ from, to: call.to, data: call.data, value: '0x0' }],
+ })) as Hex
+}
+
+interface MinimalReceipt {
+ status: Hex
+ blockNumber: Hex
+}
+
+async function waitForReceipt(provider: Eip1193Provider, hash: Hex, timeoutMs = 120_000): Promise<MinimalReceipt> {
+ const startedAt = Date.now()
+ for (;;) {
+ const receipt = (await provider.request({
+ method: 'eth_getTransactionReceipt',
+ params: [hash],
+ })) as MinimalReceipt | null
+ if (receipt?.blockNumber) return receipt
+ if (Date.now() - startedAt > timeoutMs) throw new Error('timed out waiting for the transaction to mine')
+ await new Promise((r) => setTimeout(r, 700))
+ }
+}
+
+function messageFor(error: unknown): string {
+ if (typeof error === 'object' && error !== null) {
+ const code = (error as { code?: number }).code
+ if (code === 4001) return 'You rejected the request in your wallet.'
+ const message = (error as { message?: string }).message
+ if (typeof message === 'string' && message.length > 0) return message.split('\n')[0]!.slice(0, 200)
+ }
+ return String(error)
+}
+
+/** Mount a checkout into `el` (element or selector). */
+export function mountCheckout(el: HTMLElement | string, config: CheckoutConfig): CheckoutHandle {
+ const host = typeof el === 'string' ? document.querySelector<HTMLElement>(el) : el
+ if (!host) throw new TypeError(`mountCheckout: no element matches ${String(el)}`)
+ const { request, onSuccess, onError, onStateChange } = validateCheckoutConfig(config)
+ const info = networkInfo(request.network)
+ const token = requestToken(request)
+ ensureStyles(host.ownerDocument)
+
+ const root = host.ownerDocument.createElement('div')
+ root.className = 'hoodpay'
+ host.replaceChildren(root)
+
+ let destroyed = false
+ let dynamicAmount = ''
+
+ const emit = (state: CheckoutState) => {
+ if (!destroyed) onStateChange?.(state)
+ }
+
+ const h = <K extends keyof HTMLElementTagNameMap>(
+ tag: K,
+ className?: string,
+ text?: string,
+ ): HTMLElementTagNameMap[K] => {
+ const node = host.ownerDocument.createElement(tag)
+ if (className) node.className = className
+ if (text !== undefined) node.textContent = text
+ return node
+ }
+
+ const header = () => {
+ const head = h('div', 'hoodpay-head')
+ const brand = h('span', 'hoodpay-brand')
+ brand.append('hood', Object.assign(h('b'), { textContent: 'pay' }))
+ const net = h('span', 'hoodpay-net', request.network === 'testnet' ? 'testnet 46630' : 'chain 4663')
+ net.dataset.net = request.network
+ head.append(brand, net)
+ return head
+ }
+
+ const summaryRows = () => {
+ const dl = h('dl')
+ const row = (label: string, value: string) => {
+ const div = h('div', 'hoodpay-row')
+ div.append(h('dt', undefined, label), h('dd', undefined, value))
+ return div
+ }
+ dl.append(row('To', shortAddress(request.payTo)), row('Token', `${token.symbol} (${token.decimals} decimals)`))
+ if (request.reference) dl.append(row('Reference', shortAddress(request.reference)))
+ return dl
+ }
+
+ const statusLine = (text: string, spinning: boolean) => {
+ const box = h('div', 'hoodpay-status')
+ if (spinning) box.append(h('span', 'hoodpay-spin'))
+ box.append(h('span', undefined, text))
+ return box
+ }
+
+ function renderReview() {
+ root.replaceChildren(header())
+ if (request.amount === 'dynamic') {
+ root.append(h('span', 'hoodpay-label', `Amount (${token.symbol})`))
+ const input = h('input', 'hoodpay-input') as HTMLInputElement
+ input.type = 'text'
+ input.inputMode = 'decimal'
+ input.placeholder = '10.00'
+ input.value = dynamicAmount
+ input.setAttribute('aria-label', `Amount in ${token.symbol}`)
+ input.addEventListener('input', () => {
+ dynamicAmount = input.value.trim()
+ })
+ root.append(input)
+ } else {
+ const amount = h('div', 'hoodpay-amount', request.amount)
+ amount.append(Object.assign(h('small'), { textContent: token.symbol }))
+ root.append(amount)
+ }
+ if (request.memo) root.append(h('p', 'hoodpay-memo', request.memo))
+ root.append(summaryRows())
+ const button = h('button', 'hoodpay-btn', request.amount === 'dynamic' ? 'Pay' : `Pay ${request.amount} ${token.symbol}`)
+ button.type = 'button'
+ button.addEventListener('click', () => void start())
+ root.append(button)
+ root.append(h('p', 'hoodpay-fine', 'Non-custodial. Your wallet signs; funds go straight to the merchant.'))
+ emit({ step: 'review' })
+ }
+
+ function renderWalletChoice(wallets: Eip6963ProviderDetail[]) {
+ root.replaceChildren(header(), h('p', 'hoodpay-memo', 'Choose a wallet to pay with'))
+ const list = h('div', 'hoodpay-wallets')
+ list.setAttribute('role', 'list')
+ for (const wallet of wallets) {
+ const button = h('button', 'hoodpay-wallet')
+ button.type = 'button'
+ const icon = h('img') as HTMLImageElement
+ icon.src = wallet.info.icon
+ icon.alt = ''
+ button.append(icon, h('span', undefined, wallet.info.name))
+ button.addEventListener('click', () => void connectAndPay(wallet))
+ list.append(button)
+ }
+ root.append(list)
+ const back = h('button', 'hoodpay-btn secondary', 'Back')
+ back.type = 'button'
+ back.addEventListener('click', renderReview)
+ root.append(back)
+ emit({ step: 'choose-wallet', wallets: wallets.length })
+ }
+
+ function renderBusy(text: string, state: CheckoutState) {
+ root.replaceChildren(header())
+ if (request.memo) root.append(h('p', 'hoodpay-memo', request.memo))
+ root.append(statusLine(text, true))
+ emit(state)
+ }
+
+ function renderInsufficient(balanceRaw: bigint, neededRaw: bigint) {
+ const balance = formatUnits(balanceRaw, token.decimals)
+ const needed = formatUnits(neededRaw, token.decimals)
+ root.replaceChildren(header())
+ const box = h('div', 'hoodpay-status hoodpay-err-box')
+ box.append(
+ h('span', 'hoodpay-warnc', '!'),
+ h(
+ 'span',
+ undefined,
+ `Not enough ${token.symbol}: you hold ${balance}, this payment needs ${needed}.`,
+ ),
+ )
+ root.append(box)
+ const hint = h('p', 'hoodpay-fine')
+ if (request.network === 'testnet') {
+ const a = h('a', undefined, 'Get testnet funds from the faucet')
+ a.setAttribute('href', 'https://faucet.testnet.chain.robinhood.com/')
+ a.setAttribute('target', '_blank')
+ a.setAttribute('rel', 'noopener noreferrer')
+ hint.append(a)
+ } else {
+ hint.textContent = 'Fund your wallet with USDG on Robinhood Chain, then try again.'
+ }
+ root.append(hint)
+ const retry = h('button', 'hoodpay-btn secondary', 'Try again')
+ retry.type = 'button'
+ retry.addEventListener('click', renderReview)
+ root.append(retry)
+ emit({ step: 'insufficient', balance, needed })
+ }
+
+ function renderError(message: string, recoverable = true) {
+ root.replaceChildren(header())
+ const box = h('div', 'hoodpay-status hoodpay-err-box')
+ box.append(h('span', 'hoodpay-err', '×'), h('span', undefined, message))
+ root.append(box)
+ if (recoverable) {
+ const retry = h('button', 'hoodpay-btn secondary', 'Try again')
+ retry.type = 'button'
+ retry.addEventListener('click', renderReview)
+ root.append(retry)
+ }
+ emit({ step: 'error', message, recoverable })
+ onError?.(new Error(message))
+ }
+
+ function renderSuccess(receipt: CheckoutReceipt) {
+ root.replaceChildren(header())
+ const wrap = h('div', 'hoodpay-status')
+ wrap.append(h('span', 'hoodpay-check', '✓'))
+ const col = h('div')
+ col.append(h('div', 'hoodpay-ok', `Paid ${receipt.amount} ${receipt.tokenSymbol}`))
+ const link = h('a', undefined, 'View receipt on Blockscout')
+ link.setAttribute('href', receipt.explorerUrl)
+ link.setAttribute('target', '_blank')
+ link.setAttribute('rel', 'noopener noreferrer')
+ col.append(link)
+ wrap.append(col)
+ root.append(wrap, summaryRows())
+ emit({ step: 'success', receipt })
+ onSuccess?.(receipt)
+ }
+
+ function resolveRawAmount(): bigint {
+ if (request.amount !== 'dynamic') return requestRawAmount(request)
+ if (!/^(0|[1-9]\d{0,11})(\.\d{1,18})?$/.test(dynamicAmount)) {
+ throw new RangeError('Enter the amount as a plain decimal, e.g. 10.00')
+ }
+ const raw = parseUnits(dynamicAmount, token.decimals)
+ if (raw <= 0n) throw new RangeError('Amount must be greater than zero')
+ return raw
+ }
+
+ async function start() {
+ let rawAmount: bigint
+ try {
+ rawAmount = resolveRawAmount()
+ } catch (error) {
+ renderError(messageFor(error))
+ return
+ }
+ renderBusy('Looking for wallets…', { step: 'discovering' })
+ const wallets = await discoverWallets()
+ if (destroyed) return
+ if (wallets.length === 0) {
+ renderError('No wallet found. Install an EIP-6963 wallet (MetaMask, Rabby, …) and reload.', true)
+ return
+ }
+ if (wallets.length === 1) void connectAndPay(wallets[0]!, rawAmount)
+ else renderWalletChoice(wallets)
+ }
+
+ async function connectAndPay(wallet: Eip6963ProviderDetail, precomputedRaw?: bigint) {
+ try {
+ const rawAmount = precomputedRaw ?? resolveRawAmount()
+ renderBusy(`Connecting ${wallet.info.name}…`, { step: 'connecting', wallet: wallet.info.name })
+ const { address: payer } = await ensureChain(wallet.provider, { network: request.network })
+ if (destroyed) return
+
+ const balance = await readUint(
+ wallet.provider,
+ token.address,
+ encodeFunctionData({ abi: erc20Abi, functionName: 'balanceOf', args: [payer] }),
+ 'balanceOf',
+ )
+ if (balance < rawAmount) {
+ renderInsufficient(balance, rawAmount)
+ return
+ }
+
+ let payCall: UnsignedCall
+ if (request.reference && request.router) {
+ const allowance = await readUint(
+ wallet.provider,
+ token.address,
+ encodeFunctionData({ abi: erc20Abi, functionName: 'allowance', args: [payer, request.router] }),
+ 'allowance',
+ )
+ if (allowance < rawAmount) {
+ renderBusy(`Approve ${token.symbol} in your wallet (1 of 2)…`, { step: 'approving' })
+ const approveHash = await sendCall(wallet.provider, payer, buildApproveTx(token.address, request.router, rawAmount))
+ renderBusy('Waiting for the approval to mine…', { step: 'approving' })
+ const approveReceipt = await waitForReceipt(wallet.provider, approveHash)
+ if (approveReceipt.status !== '0x1') throw new Error('The approval transaction reverted.')
+ }
+ payCall = buildRouterPayTx(request.router, token.address, request.payTo, rawAmount, request.reference)
+ renderBusy('Confirm the payment in your wallet (2 of 2)…', { step: 'paying' })
+ } else {
+ payCall = buildTransferTx(token.address, request.payTo, rawAmount)
+ renderBusy('Confirm the payment in your wallet…', { step: 'paying' })
+ }
+
+ const txHash = await sendCall(wallet.provider, payer, payCall)
+ renderBusy('Payment sent - waiting for confirmation…', { step: 'confirming', txHash })
+ const receipt = await waitForReceipt(wallet.provider, txHash)
+ if (receipt.status !== '0x1') throw new Error('The payment transaction reverted.')
+
+ const checkoutReceipt: CheckoutReceipt = {
+ txHash,
+ payer,
+ amountRaw: rawAmount.toString(),
+ amount: formatUnits(rawAmount, token.decimals),
+ tokenSymbol: token.symbol,
+ network: request.network,
+ explorerUrl: explorerTxUrl(request.network, txHash),
+ }
+ if (request.reference) checkoutReceipt.reference = request.reference
+ renderSuccess(checkoutReceipt)
+ } catch (error) {
+ if (!destroyed) renderError(messageFor(error))
+ }
+ }
+
+ renderReview()
+ void info // network resolved eagerly above so bad configs fail at mount
+
+ return {
+ request,
+ destroy() {
+ destroyed = true
+ root.remove()
+ },
+ }
+}
diff --git a/robinhood/hood-pay/tests/unit/ledger.test.ts b/robinhood/hood-pay/tests/unit/ledger.test.ts
new file mode 100644
index 000000000..3c53ffdcf
--- /dev/null
+++ b/robinhood/hood-pay/tests/unit/ledger.test.ts
@@ -0,0 +1,108 @@
+import { describe, expect, it } from 'vitest'
+import type { Address, Hex } from 'viem'
+import { createLedger } from '../../src/verify/ledger.js'
+import { splitDust } from '../../src/reference.js'
+import type { MatchedTransfer } from '../../src/verify/types.js'
+
+const MERCHANT = '0x4022de2D36C334E73C7a108805Cea11C0564f402' as Address
+const TOKEN = '0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168' as Address
+const BUYER = '0x2d4d2A025b10C09BDbd794B4FCe4F7ea8C7d7bB4' as Address
+
+function transfer(overrides: Partial<MatchedTransfer> = {}): MatchedTransfer {
+ return {
+ txHash: `0x${'aa'.repeat(32)}` as Hex,
+ logIndex: 0,
+ blockNumber: 100n,
+ blockHash: `0x${'bb'.repeat(32)}` as Hex,
+ payer: BUYER,
+ amountRaw: 12_500_042n,
+ ...overrides,
+ }
+}
+
+describe('ledger', () => {
+ it('reserves unique fingerprinted amounts per (payTo, token, amount)', async () => {
+ const ledger = await createLedger(':memory:')
+ const base = 12_500_000n
+ const seen = new Set<string>()
+ for (let i = 0; i < 50; i++) {
+ const invoice = ledger.createDirectInvoice({ network: 'mainnet', payTo: MERCHANT, token: TOKEN, baseRaw: base })
+ expect(invoice.status).toBe('pending')
+ const { base: b, dust } = splitDust(invoice.expectedRaw)
+ expect(b).toBe(base)
+ expect(dust).toBe(invoice.dust)
+ expect(dust >= 1n && dust <= 9999n).toBe(true)
+ expect(seen.has(invoice.expectedRaw.toString())).toBe(false)
+ seen.add(invoice.expectedRaw.toString())
+ }
+ ledger.close()
+ })
+
+ it('rejects a base amount that already carries dust digits', async () => {
+ const ledger = await createLedger(':memory:')
+ expect(() =>
+ ledger.createDirectInvoice({ network: 'mainnet', payTo: MERCHANT, token: TOKEN, baseRaw: 12_500_042n }),
+ ).toThrow(/low 4 decimal digits/)
+ ledger.close()
+ })
+
+ it('records transfers idempotently and never double-credits', async () => {
+ const ledger = await createLedger(':memory:')
+ const invoice = ledger.createDirectInvoice({ network: 'mainnet', payTo: MERCHANT, token: TOKEN, baseRaw: 12_500_000n })
+ const t = transfer({ amountRaw: invoice.expectedRaw })
+ const first = ledger.recordTransfer(invoice.id, t)
+ expect(first?.status).toBe('paid')
+ expect(first?.receivedRaw).toBe(invoice.expectedRaw)
+ expect(first?.payer).toBe(BUYER)
+ // exact replay: ignored
+ expect(ledger.recordTransfer(invoice.id, t)).toBeUndefined()
+ expect(ledger.getInvoice(invoice.id)?.receivedRaw).toBe(invoice.expectedRaw)
+ ledger.close()
+ })
+
+ it('sums 18-decimal amounts beyond SQLite integer range correctly', async () => {
+ const ledger = await createLedger(':memory:')
+ const big = 5_000n * 10n ** 18n // 5000 tokens, 18 decimals: overflows int64
+ const invoice = ledger.createRouterInvoice({
+ network: 'mainnet',
+ payTo: MERCHANT,
+ token: TOKEN,
+ expectedRaw: big * 2n,
+ reference: `0x${'11'.repeat(32)}` as Hex,
+ })
+ ledger.recordTransfer(invoice.id, transfer({ amountRaw: big, logIndex: 0 }))
+ const after = ledger.recordTransfer(invoice.id, transfer({ amountRaw: big, logIndex: 1 }))
+ expect(after?.receivedRaw).toBe(big * 2n)
+ expect(after?.status).toBe('paid')
+ ledger.close()
+ })
+
+ it('walks underpaid -> paid -> overpaid and never goes backward', async () => {
+ const ledger = await createLedger(':memory:')
+ const invoice = ledger.createRouterInvoice({
+ network: 'mainnet',
+ payTo: MERCHANT,
+ token: TOKEN,
+ expectedRaw: 10_000_000n,
+ reference: `0x${'33'.repeat(32)}` as Hex,
+ })
+ expect(ledger.recordTransfer(invoice.id, transfer({ amountRaw: 4_000_000n, logIndex: 0 }))?.status).toBe('underpaid')
+ expect(ledger.recordTransfer(invoice.id, transfer({ amountRaw: 6_000_000n, logIndex: 1 }))?.status).toBe('paid')
+ expect(ledger.recordTransfer(invoice.id, transfer({ amountRaw: 1_000_000n, logIndex: 2 }))?.status).toBe('overpaid')
+ // a stale writer cannot un-pay
+ expect(ledger.setStatus(invoice.id, 'pending').status).toBe('overpaid')
+ expect(ledger.setStatus(invoice.id, 'expired').status).toBe('overpaid')
+ expect(ledger.setStatus(invoice.id, 'refunded').status).toBe('refunded')
+ ledger.close()
+ })
+
+ it('lists invoices newest first and records webhook deliveries', async () => {
+ const ledger = await createLedger(':memory:')
+ ledger.createDirectInvoice({ network: 'testnet', payTo: MERCHANT, token: TOKEN, baseRaw: 1_000_000n, memo: 'a' })
+ ledger.createDirectInvoice({ network: 'testnet', payTo: MERCHANT, token: TOKEN, baseRaw: 2_000_000n, memo: 'b' })
+ const list = ledger.listInvoices()
+ expect(list).toHaveLength(2)
+ ledger.recordWebhookDelivery({ paymentId: list[0]!.id, event: 'payment.paid', ok: true, attempts: 1 })
+ ledger.close()
+ })
+})
diff --git a/robinhood/hood-pay/tests/unit/reference.test.ts b/robinhood/hood-pay/tests/unit/reference.test.ts
new file mode 100644
index 000000000..62791003f
--- /dev/null
+++ b/robinhood/hood-pay/tests/unit/reference.test.ts
@@ -0,0 +1,86 @@
+import { describe, expect, it } from 'vitest'
+import {
+ applyDust,
+ DUST_MODULUS,
+ DUST_SLOTS,
+ directCollisionProbability,
+ isReference,
+ newReference,
+ randomDust,
+ referenceCollisionProbability,
+ splitDust,
+} from '../../src/reference.js'
+
+describe('newReference', () => {
+ it('produces well-formed, unique 32-byte references', () => {
+ const seen = new Set<string>()
+ for (let i = 0; i < 1000; i++) {
+ const ref = newReference()
+ expect(isReference(ref)).toBe(true)
+ expect(seen.has(ref)).toBe(false)
+ seen.add(ref)
+ }
+ })
+})
+
+describe('isReference', () => {
+ it('accepts 32-byte hex and rejects everything else', () => {
+ expect(isReference(`0x${'ab'.repeat(32)}`)).toBe(true)
+ expect(isReference(`0x${'ab'.repeat(31)}`)).toBe(false)
+ expect(isReference(`0x${'ab'.repeat(33)}`)).toBe(false)
+ expect(isReference('ab'.repeat(32))).toBe(false)
+ expect(isReference(`0x${'zz'.repeat(32)}`)).toBe(false)
+ expect(isReference(42)).toBe(false)
+ expect(isReference(null)).toBe(false)
+ })
+})
+
+describe('dust fingerprinting', () => {
+ it('randomDust stays in [1, DUST_SLOTS] and covers the range', () => {
+ const seen = new Set<bigint>()
+ for (let i = 0; i < 5000; i++) {
+ const dust = randomDust()
+ expect(dust >= 1n && dust <= BigInt(DUST_SLOTS)).toBe(true)
+ seen.add(dust)
+ }
+ expect(seen.size).toBeGreaterThan(2000) // ~40%+ of 9999 slots after 5k draws
+ })
+
+ it('applyDust/splitDust round-trip', () => {
+ const base = 12_500_000n // 12.50 USDG
+ const dust = 42n
+ const fingerprinted = applyDust(base, dust)
+ expect(fingerprinted).toBe(12_500_042n)
+ expect(splitDust(fingerprinted)).toEqual({ base, dust })
+ })
+
+ it('rejects a base amount that already uses the dust digits', () => {
+ expect(() => applyDust(12_500_042n, 7n)).toThrow(/low 4 decimal digits/)
+ })
+
+ it('rejects out-of-range dust', () => {
+ expect(() => applyDust(1_000_000n, 0n)).toThrow(RangeError)
+ expect(() => applyDust(1_000_000n, DUST_MODULUS)).toThrow(RangeError)
+ expect(() => applyDust(-1n, 5n)).toThrow(RangeError)
+ })
+})
+
+describe('collision math', () => {
+ it('direct-mode collision probability matches the birthday bound', () => {
+ expect(directCollisionProbability(0)).toBe(0)
+ expect(directCollisionProbability(1)).toBe(0)
+ // exact for k=2: 1/9999
+ expect(directCollisionProbability(2)).toBeCloseTo(1 / DUST_SLOTS, 10)
+ // documented figure: ~0.45% at 10 concurrent same-price invoices
+ expect(directCollisionProbability(10)).toBeGreaterThan(0.004)
+ expect(directCollisionProbability(10)).toBeLessThan(0.005)
+ expect(directCollisionProbability(DUST_SLOTS + 1)).toBe(1)
+ })
+
+ it('router references never realistically collide', () => {
+ expect(referenceCollisionProbability(1e12)).toBeLessThan(1e-50)
+ expect(referenceCollisionProbability(0)).toBe(0)
+ expect(() => directCollisionProbability(-1)).toThrow(RangeError)
+ expect(() => referenceCollisionProbability(-1)).toThrow(RangeError)
+ })
+})
diff --git a/robinhood/hood-pay/tests/unit/refund.test.ts b/robinhood/hood-pay/tests/unit/refund.test.ts
new file mode 100644
index 000000000..59353426e
--- /dev/null
+++ b/robinhood/hood-pay/tests/unit/refund.test.ts
@@ -0,0 +1,56 @@
+import { describe, expect, it } from 'vitest'
+import type { Address, Hex } from 'viem'
+import { buildRefundTx, refundOverageTx, refundReceivedTx, sendRefund } from '../../src/verify/refund.js'
+import type { PaymentResult } from '../../src/verify/types.js'
+
+const TOKEN = '0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168' as Address
+const BUYER = '0x2d4d2A025b10C09BDbd794B4FCe4F7ea8C7d7bB4' as Address
+
+function result(status: PaymentResult['status'], received: bigint, expected = 10_000_000n): PaymentResult {
+ return {
+ status,
+ expectedRaw: expected,
+ receivedRaw: received,
+ overageRaw: received > expected ? received - expected : 0n,
+ payer: BUYER,
+ transfers: [],
+ }
+}
+
+describe('refund helpers', () => {
+ it('builds a plain ERC-20 transfer back to the buyer', () => {
+ const call = buildRefundTx(TOKEN, BUYER, 1_000_000n)
+ expect(call.to).toBe(TOKEN)
+ expect(call.data.startsWith('0xa9059cbb')).toBe(true)
+ expect(() => buildRefundTx(TOKEN, BUYER, 0n)).toThrow(/positive/)
+ })
+
+ it('refundOverageTx refunds exactly the overage of an overpaid invoice', () => {
+ const call = refundOverageTx(TOKEN, result('overpaid', 12_000_000n))
+ expect(call.data.endsWith((2_000_000n).toString(16).padStart(64, '0'))).toBe(true)
+ expect(() => refundOverageTx(TOKEN, result('paid', 10_000_000n))).toThrow(/not overpaid/)
+ const noPayer = { ...result('overpaid', 12_000_000n) }
+ delete noPayer.payer
+ expect(() => refundOverageTx(TOKEN, noPayer)).toThrow(/payer/)
+ })
+
+ it('refundReceivedTx refunds everything an abandoned invoice received', () => {
+ const call = refundReceivedTx(TOKEN, result('underpaid', 4_000_000n))
+ expect(call.data.endsWith((4_000_000n).toString(16).padStart(64, '0'))).toBe(true)
+ expect(() => refundReceivedTx(TOKEN, result('pending', 0n))).toThrow(/nothing received/)
+ })
+
+ it('sendRefund drives the merchant-supplied signer (stubbed - no broadcast)', async () => {
+ const sent: Array<{ to: Address; data: Hex; value: bigint }> = []
+ const wallet = {
+ async sendTransaction(args: { to: Address; data: Hex; value: bigint }) {
+ sent.push(args)
+ return `0x${'cc'.repeat(32)}` as Hex
+ },
+ }
+ const hash = await sendRefund(wallet, buildRefundTx(TOKEN, BUYER, 1_000_000n))
+ expect(hash).toBe(`0x${'cc'.repeat(32)}`)
+ expect(sent[0]!.to).toBe(TOKEN)
+ expect(sent[0]!.value).toBe(0n)
+ })
+})
diff --git a/robinhood/hood-pay/tests/unit/request.test.ts b/robinhood/hood-pay/tests/unit/request.test.ts
new file mode 100644
index 000000000..ff870388c
--- /dev/null
+++ b/robinhood/hood-pay/tests/unit/request.test.ts
@@ -0,0 +1,113 @@
+import { describe, expect, it } from 'vitest'
+import {
+ decodePaymentRequest,
+ encodePaymentRequest,
+ formatRequestAmount,
+ paymentLinkUrl,
+ requestRawAmount,
+ requestToken,
+ validatePaymentRequest,
+} from '../../src/request.js'
+import { networkInfo } from '../../src/networks.js'
+
+const PAY_TO = '0x4022de2D36C334E73C7a108805Cea11C0564f402'
+const ROUTER = '0x1f7d7550B1b028f7571E69A784071F0205FD2EfA'
+const REF = `0x${'11'.repeat(32)}` as const
+
+describe('validatePaymentRequest', () => {
+ it('normalizes a minimal mainnet USDG request', () => {
+ const request = validatePaymentRequest({ payTo: PAY_TO.toLowerCase(), amount: '12.50' })
+ expect(request.v).toBe(1)
+ expect(request.network).toBe('mainnet')
+ expect(request.payTo).toBe(PAY_TO) // checksum restored
+ expect(requestToken(request)).toEqual(networkInfo('mainnet').usdg)
+ expect(requestRawAmount(request)).toBe(12_500_000n)
+ expect(formatRequestAmount(request, 12_500_042n)).toBe('12.500042')
+ })
+
+ it('rejects a bad EIP-55 checksum', () => {
+ const badChecksum = PAY_TO.replace('D', 'd').replace('C', 'c')
+ expect(() => validatePaymentRequest({ payTo: badChecksum, amount: '1' })).toThrow()
+ })
+
+ it('rejects malformed addresses, amounts, and networks', () => {
+ expect(() => validatePaymentRequest({ payTo: '0x123', amount: '1' })).toThrow(/payTo/)
+ expect(() => validatePaymentRequest({ payTo: PAY_TO, amount: '1,50' })).toThrow(/decimal/)
+ expect(() => validatePaymentRequest({ payTo: PAY_TO, amount: '-1' })).toThrow(/decimal/)
+ expect(() => validatePaymentRequest({ payTo: PAY_TO, amount: '0' })).toThrow(/greater than zero/)
+ expect(() => validatePaymentRequest({ payTo: PAY_TO, amount: '1e3' })).toThrow(/decimal/)
+ expect(() => validatePaymentRequest({ payTo: PAY_TO, amount: '1', network: 'base' })).toThrow(/network/)
+ expect(() => validatePaymentRequest({ payTo: PAY_TO, amount: 5 })).toThrow(/string/)
+ })
+
+ it('rejects more decimals than the token carries', () => {
+ expect(() => validatePaymentRequest({ payTo: PAY_TO, amount: '1.1234567' })).toThrow(/decimal places/)
+ expect(validatePaymentRequest({ payTo: PAY_TO, amount: '1.123456' }).amount).toBe('1.123456')
+ })
+
+ it('accepts dynamic amounts', () => {
+ const request = validatePaymentRequest({ payTo: PAY_TO, amount: 'dynamic' })
+ expect(request.amount).toBe('dynamic')
+ expect(() => requestRawAmount(request)).toThrow(/dynamic/)
+ })
+
+ it('validates token overrides', () => {
+ const token = { address: ROUTER.toLowerCase(), symbol: 'TSLA', decimals: 18 }
+ const request = validatePaymentRequest({ payTo: PAY_TO, amount: '0.5', token })
+ expect(request.token?.address).toBe(ROUTER)
+ expect(requestRawAmount(request)).toBe(500_000_000_000_000_000n)
+ expect(() =>
+ validatePaymentRequest({ payTo: PAY_TO, amount: '1', token: { ...token, decimals: 37 } }),
+ ).toThrow(/decimals/)
+ expect(() =>
+ validatePaymentRequest({ payTo: PAY_TO, amount: '1', token: { ...token, symbol: '' } }),
+ ).toThrow(/symbol/)
+ })
+
+ it('enforces router-mode pairing', () => {
+ expect(() => validatePaymentRequest({ payTo: PAY_TO, amount: '1', reference: REF })).toThrow(/router/)
+ expect(() => validatePaymentRequest({ payTo: PAY_TO, amount: '1', router: ROUTER })).toThrow(/reference/)
+ expect(() => validatePaymentRequest({ payTo: PAY_TO, amount: '1', reference: '0x1234', router: ROUTER })).toThrow(
+ /32-byte/,
+ )
+ const request = validatePaymentRequest({ payTo: PAY_TO, amount: '1', reference: REF, router: ROUTER })
+ expect(request.reference).toBe(REF)
+ expect(request.router).toBe(ROUTER)
+ })
+
+ it('caps the memo length', () => {
+ const request = validatePaymentRequest({ payTo: PAY_TO, amount: '1', memo: 'x'.repeat(500) })
+ expect(request.memo).toHaveLength(280)
+ })
+})
+
+describe('payment link codec', () => {
+ it('round-trips every field through the fragment', () => {
+ const request = validatePaymentRequest({
+ network: 'testnet',
+ payTo: PAY_TO,
+ amount: '3.99',
+ memo: 'Invoice #7 - sticker pack (unicode: Ω≈ç√)',
+ reference: REF,
+ router: ROUTER,
+ })
+ const fragment = encodePaymentRequest(request)
+ expect(fragment.startsWith('1.')).toBe(true)
+ expect(decodePaymentRequest(fragment)).toEqual(request)
+ expect(decodePaymentRequest(`#${fragment}`)).toEqual(request)
+ })
+
+ it('builds hosted links against the default and custom bases', () => {
+ const request = validatePaymentRequest({ payTo: PAY_TO, amount: '25' })
+ expect(paymentLinkUrl(request)).toMatch(/^https:\/\/nirholas\.github\.io\/hood-pay\/pay\.html#1\./)
+ expect(paymentLinkUrl(request, 'https://shop.example/pay.html')).toMatch(/^https:\/\/shop\.example\/pay\.html#1\./)
+ })
+
+ it('rejects tampered and malformed fragments', () => {
+ expect(() => decodePaymentRequest('no-dot')).toThrow(/version/)
+ expect(() => decodePaymentRequest('2.abcd')).toThrow(/version "2"/)
+ expect(() => decodePaymentRequest('1.!!!not-base64!!!')).toThrow(/malformed/)
+ const fragment = encodePaymentRequest(validatePaymentRequest({ payTo: PAY_TO, amount: '25' }))
+ expect(() => decodePaymentRequest(`1.${fragment.slice(2, -4)}`)).toThrow()
+ })
+})
diff --git a/robinhood/hood-pay/tests/unit/tx.test.ts b/robinhood/hood-pay/tests/unit/tx.test.ts
new file mode 100644
index 000000000..21853f810
--- /dev/null
+++ b/robinhood/hood-pay/tests/unit/tx.test.ts
@@ -0,0 +1,64 @@
+import { encodeFunctionData, parseAbi, toFunctionSelector } from 'viem'
+import { describe, expect, it } from 'vitest'
+import { erc20Abi, hoodPayRouterAbi } from '../../src/abi.js'
+import { buildApproveTx, buildRouterPayTx, buildTransferTx } from '../../src/tx.js'
+
+const TOKEN = '0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168' as const // real mainnet USDG
+const PAY_TO = '0x4022de2D36C334E73C7a108805Cea11C0564f402' as const
+const ROUTER = '0x1f7d7550B1b028f7571E69A784071F0205FD2EfA' as const
+const REF = `0x${'ab'.repeat(32)}` as const
+const AMOUNT = 12_500_042n
+
+describe('unsigned tx construction', () => {
+ it('buildTransferTx pins the exact ERC-20 transfer calldata', () => {
+ const call = buildTransferTx(TOKEN, PAY_TO, AMOUNT)
+ expect(call.to).toBe(TOKEN)
+ expect(call.value).toBe(0n)
+ expect(call.data.slice(0, 10)).toBe('0xa9059cbb') // transfer(address,uint256)
+ const reference = encodeFunctionData({
+ abi: parseAbi(['function transfer(address to, uint256 amount) returns (bool)']),
+ functionName: 'transfer',
+ args: [PAY_TO, AMOUNT],
+ })
+ expect(call.data).toBe(reference)
+ })
+
+ it('buildApproveTx pins the exact ERC-20 approve calldata', () => {
+ const call = buildApproveTx(TOKEN, ROUTER, AMOUNT)
+ expect(call.to).toBe(TOKEN)
+ expect(call.data.slice(0, 10)).toBe('0x095ea7b3') // approve(address,uint256)
+ const reference = encodeFunctionData({
+ abi: parseAbi(['function approve(address spender, uint256 amount) returns (bool)']),
+ functionName: 'approve',
+ args: [ROUTER, AMOUNT],
+ })
+ expect(call.data).toBe(reference)
+ })
+
+ it('buildRouterPayTx targets the router with pay(token, payTo, amount, ref)', () => {
+ const call = buildRouterPayTx(ROUTER, TOKEN, PAY_TO, AMOUNT, REF)
+ expect(call.to).toBe(ROUTER)
+ expect(call.data.slice(0, 10)).toBe(toFunctionSelector('pay(address,address,uint256,bytes32)'))
+ const reference = encodeFunctionData({
+ abi: parseAbi(['function pay(address token, address payTo, uint256 amount, bytes32 ref)']),
+ functionName: 'pay',
+ args: [TOKEN, PAY_TO, AMOUNT, REF],
+ })
+ expect(call.data).toBe(reference)
+ })
+
+ it('literal ABIs match their human-readable definitions', () => {
+ // Guards the hand-written literal ABIs against drift.
+ const readable = parseAbi([
+ 'function pay(address token, address payTo, uint256 amount, bytes32 ref)',
+ 'event PaymentReceived(bytes32 indexed ref, address indexed payer, address indexed payTo, address token, uint256 amount)',
+ ])
+ expect(hoodPayRouterAbi).toMatchObject(JSON.parse(JSON.stringify(readable)))
+ const erc20 = parseAbi([
+ 'function transfer(address to, uint256 amount) returns (bool)',
+ 'event Transfer(address indexed from, address indexed to, uint256 value)',
+ ])
+ const names = new Set(erc20Abi.map((item) => item.name))
+ for (const item of erc20) expect(names.has(item.name)).toBe(true)
+ })
+})
diff --git a/robinhood/hood-pay/tests/unit/watcher.test.ts b/robinhood/hood-pay/tests/unit/watcher.test.ts
new file mode 100644
index 000000000..bdbcf9898
--- /dev/null
+++ b/robinhood/hood-pay/tests/unit/watcher.test.ts
@@ -0,0 +1,260 @@
+import { describe, expect, it } from 'vitest'
+import type { Address, Hex } from 'viem'
+import { awaitPayment, checkPayment, type ChainReader, type WatchSpec } from '../../src/verify/watcher.js'
+
+/**
+ * Deterministic in-memory chain for exercising the watcher state machine:
+ * blocks advance on demand, logs live in blocks, and a "reorg" replaces a
+ * block's hash (and drops its logs) exactly like a real chain would.
+ * The live suite (tests/live) runs the same watcher against real mainnet
+ * USDG transfers and an anvil fork; this suite pins the state machine.
+ */
+class FakeChain implements ChainReader {
+ head = 0n
+ private hashes = new Map<bigint, Hex>()
+ private logs: Array<{
+ address: Address
+ eventName: 'Transfer' | 'PaymentReceived'
+ blockNumber: bigint
+ logIndex: number
+ txHash: Hex
+ args: Record<string, unknown>
+ }> = []
+
+ private hashFor(block: bigint, generation = 0): Hex {
+ return `0x${(block * 1000n + BigInt(generation)).toString(16).padStart(64, '0')}` as Hex
+ }
+
+ mineTo(height: bigint) {
+ for (let b = this.head + 1n; b <= height; b++) this.hashes.set(b, this.hashFor(b))
+ this.head = height
+ }
+
+ addTransfer(block: bigint, token: Address, from: Address, to: Address, value: bigint, logIndex = 0) {
+ this.mineTo(block > this.head ? block : this.head)
+ this.logs.push({
+ address: token,
+ eventName: 'Transfer',
+ blockNumber: block,
+ logIndex,
+ txHash: `0x${block.toString(16).padStart(8, '0')}${logIndex.toString(16).padStart(56, '0')}` as Hex,
+ args: { from, to, value },
+ })
+ }
+
+ addRouterPayment(block: bigint, router: Address, ref: Hex, payer: Address, payTo: Address, token: Address, amount: bigint, logIndex = 0) {
+ this.mineTo(block > this.head ? block : this.head)
+ this.logs.push({
+ address: router,
+ eventName: 'PaymentReceived',
+ blockNumber: block,
+ logIndex,
+ txHash: `0x${block.toString(16).padStart(8, '0')}${(logIndex + 500).toString(16).padStart(56, '0')}` as Hex,
+ args: { ref, payer, payTo, token, amount },
+ })
+ }
+
+ /** Reorg `block` out: new hash, logs in it vanish from the canonical chain. */
+ reorg(block: bigint) {
+ this.hashes.set(block, this.hashFor(block, 1))
+ this.logs = this.logs.filter((log) => log.blockNumber !== block)
+ }
+
+ async getBlockNumber() {
+ return this.head
+ }
+
+ async getBlock({ blockNumber }: { blockNumber: bigint }) {
+ return { hash: this.hashes.get(blockNumber) ?? null }
+ }
+
+ async getLogs(args: {
+ address: Address
+ event: { name: string }
+ args?: Record<string, unknown>
+ fromBlock: bigint
+ toBlock: bigint
+ }) {
+ return this.logs
+ .filter((log) => {
+ if (log.address.toLowerCase() !== args.address.toLowerCase()) return false
+ if (log.eventName !== args.event.name) return false
+ if (log.blockNumber < args.fromBlock || log.blockNumber > args.toBlock) return false
+ for (const [key, expected] of Object.entries(args.args ?? {})) {
+ if (expected === undefined) continue
+ if (String(log.args[key]).toLowerCase() !== String(expected).toLowerCase()) return false
+ }
+ return true
+ })
+ .map((log) => ({
+ transactionHash: log.txHash,
+ logIndex: log.logIndex,
+ blockNumber: log.blockNumber,
+ blockHash: this.hashFor(log.blockNumber),
+ args: log.args,
+ }))
+ }
+}
+
+const TOKEN = '0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168' as Address
+const ROUTER = '0x1f7d7550B1b028f7571E69A784071F0205FD2EfA' as Address
+const MERCHANT = '0x4022de2D36C334E73C7a108805Cea11C0564f402' as Address
+const BUYER = '0x2d4d2A025b10C09BDbd794B4FCe4F7ea8C7d7bB4' as Address
+const OTHER = '0x0000000000000000000000000000000000000BEB' as Address
+const REF = `0x${'11'.repeat(32)}` as Hex
+const EXPECTED = 12_500_042n
+
+const directSpec: WatchSpec = { token: TOKEN, payTo: MERCHANT, expectedRaw: EXPECTED }
+const fast = { confirmations: 5, pollIntervalMs: 5, timeoutMs: 1500 }
+
+describe('direct mode (amount fingerprint)', () => {
+ it('settles paid on an exact confirmed match and ignores other amounts', async () => {
+ const chain = new FakeChain()
+ chain.mineTo(10n)
+ chain.addTransfer(11n, TOKEN, OTHER, MERCHANT, 99_000_000n) // someone else's payment
+ chain.addTransfer(12n, TOKEN, BUYER, MERCHANT, EXPECTED)
+ chain.mineTo(20n) // deep enough to confirm
+ const result = await checkPayment(directSpec, { reader: chain, fromBlock: 11n, confirmations: 5 })
+ expect(result.status).toBe('paid')
+ expect(result.receivedRaw).toBe(EXPECTED)
+ expect(result.payer).toBe(BUYER)
+ expect(result.transfers).toHaveLength(1)
+ })
+
+ it('stays pending while the match is above the confirmation depth', async () => {
+ const chain = new FakeChain()
+ chain.mineTo(10n)
+ chain.addTransfer(11n, TOKEN, BUYER, MERCHANT, EXPECTED)
+ chain.mineTo(13n) // only 2 deep, need 5
+ const result = await checkPayment(directSpec, { reader: chain, fromBlock: 11n, confirmations: 5 })
+ expect(result.status).toBe('pending')
+ expect(result.receivedRaw).toBe(0n)
+ })
+
+ it('awaitPayment resolves once the transfer gains depth', async () => {
+ const chain = new FakeChain()
+ chain.mineTo(10n)
+ const promise = awaitPayment(directSpec, { reader: chain, fromBlock: 10n, ...fast })
+ chain.addTransfer(12n, TOKEN, BUYER, MERCHANT, EXPECTED)
+ setTimeout(() => chain.mineTo(20n), 30)
+ const result = await promise
+ expect(result.status).toBe('paid')
+ })
+
+ it('a reorged-out transfer never counts (log vanishes below depth)', async () => {
+ const chain = new FakeChain()
+ chain.mineTo(10n)
+ chain.addTransfer(12n, TOKEN, BUYER, MERCHANT, EXPECTED)
+ chain.reorg(12n) // dropped before it ever had 5 confirmations
+ chain.mineTo(30n)
+ const result = await checkPayment(directSpec, { reader: chain, fromBlock: 10n, confirmations: 5 })
+ expect(result.status).toBe('pending')
+ })
+
+ it('a log whose block hash changed after scanning is dropped by the re-check', async () => {
+ const chain = new FakeChain()
+ chain.mineTo(10n)
+ chain.addTransfer(12n, TOKEN, BUYER, MERCHANT, EXPECTED)
+ chain.mineTo(30n)
+ // Simulate the block being replaced but the (stale) log still indexed:
+ const original = chain.getLogs.bind(chain)
+ chain.getLogs = async (args) => {
+ const logs = await original(args)
+ chain.reorg(12n) // hash flips between getLogs and getBlock
+ return logs
+ }
+ const result = await checkPayment(directSpec, { reader: chain, fromBlock: 10n, confirmations: 5 })
+ expect(result.status).toBe('pending')
+ })
+
+ it('with a known payer, under- and overpayment are detected and summed', async () => {
+ const chain = new FakeChain()
+ chain.mineTo(10n)
+ chain.addTransfer(11n, TOKEN, BUYER, MERCHANT, 5_000_000n)
+ chain.mineTo(20n)
+ const spec: WatchSpec = { ...directSpec, payer: BUYER }
+ const under = await checkPayment(spec, { reader: chain, fromBlock: 10n, confirmations: 5 })
+ expect(under.status).toBe('underpaid')
+ expect(under.receivedRaw).toBe(5_000_000n)
+
+ chain.addTransfer(21n, TOKEN, BUYER, MERCHANT, 10_000_000n, 1)
+ chain.mineTo(30n)
+ const over = await checkPayment(spec, { reader: chain, fromBlock: 10n, confirmations: 5 })
+ expect(over.status).toBe('overpaid')
+ expect(over.receivedRaw).toBe(15_000_000n)
+ expect(over.overageRaw).toBe(15_000_000n - EXPECTED)
+ })
+
+ it('expires when nothing arrives before the timeout', async () => {
+ const chain = new FakeChain()
+ chain.mineTo(10n)
+ const result = await awaitPayment(directSpec, { reader: chain, fromBlock: 10n, confirmations: 5, pollIntervalMs: 5, timeoutMs: 60 })
+ expect(result.status).toBe('expired')
+ })
+
+ it('an underpayment at timeout reports underpaid, not expired', async () => {
+ const chain = new FakeChain()
+ chain.mineTo(10n)
+ chain.addTransfer(11n, TOKEN, BUYER, MERCHANT, 1_000_000n)
+ chain.mineTo(20n)
+ const spec: WatchSpec = { ...directSpec, payer: BUYER }
+ const result = await awaitPayment(spec, { reader: chain, fromBlock: 10n, confirmations: 5, pollIntervalMs: 5, timeoutMs: 100 })
+ expect(result.status).toBe('underpaid')
+ })
+})
+
+describe('router mode (reference attribution)', () => {
+ const routerSpec: WatchSpec = { ...directSpec, reference: REF, router: ROUTER }
+
+ it('matches by reference regardless of amount and sums partial payments', async () => {
+ const chain = new FakeChain()
+ chain.mineTo(10n)
+ chain.addRouterPayment(11n, ROUTER, REF, BUYER, MERCHANT, TOKEN, 5_000_000n)
+ chain.addRouterPayment(12n, ROUTER, REF, BUYER, MERCHANT, TOKEN, 7_500_042n, 1)
+ chain.addRouterPayment(13n, ROUTER, `0x${'22'.repeat(32)}` as Hex, OTHER, MERCHANT, TOKEN, 9_000_000n) // other invoice
+ chain.mineTo(25n)
+ const result = await checkPayment(routerSpec, { reader: chain, fromBlock: 10n, confirmations: 5 })
+ expect(result.status).toBe('paid')
+ expect(result.receivedRaw).toBe(EXPECTED)
+ expect(result.transfers).toHaveLength(2)
+ expect(result.reference).toBe(REF)
+ })
+
+ it('ignores same-reference events for a different token', async () => {
+ const chain = new FakeChain()
+ chain.mineTo(10n)
+ chain.addRouterPayment(11n, ROUTER, REF, BUYER, MERCHANT, OTHER, EXPECTED)
+ chain.mineTo(25n)
+ const result = await checkPayment(routerSpec, { reader: chain, fromBlock: 10n, confirmations: 5 })
+ expect(result.status).toBe('pending')
+ })
+
+ it('requires the router address', async () => {
+ await expect(
+ awaitPayment({ ...directSpec, reference: REF }, { reader: new FakeChain(), fromBlock: 0n, ...fast }),
+ ).rejects.toThrow(/router/)
+ })
+
+ it('emits onState transitions in order', async () => {
+ const chain = new FakeChain()
+ chain.mineTo(10n)
+ const states: string[] = []
+ const promise = awaitPayment(routerSpec, {
+ reader: chain,
+ fromBlock: 10n,
+ ...fast,
+ onState: (state) => states.push(state.status),
+ })
+ setTimeout(() => {
+ chain.addRouterPayment(12n, ROUTER, REF, BUYER, MERCHANT, TOKEN, 5_000_000n)
+ chain.mineTo(20n)
+ }, 20)
+ setTimeout(() => {
+ chain.addRouterPayment(21n, ROUTER, REF, BUYER, MERCHANT, TOKEN, 7_500_042n, 1)
+ chain.mineTo(30n)
+ }, 60)
+ const result = await promise
+ expect(result.status).toBe('paid')
+ expect(states).toEqual(['pending', 'underpaid', 'paid'])
+ })
+})
diff --git a/robinhood/hood-pay/tests/unit/webhook.test.ts b/robinhood/hood-pay/tests/unit/webhook.test.ts
new file mode 100644
index 000000000..08f906438
--- /dev/null
+++ b/robinhood/hood-pay/tests/unit/webhook.test.ts
@@ -0,0 +1,124 @@
+import { createServer, type Server } from 'node:http'
+import { afterAll, beforeAll, describe, expect, it } from 'vitest'
+import {
+ createWebhookEmitter,
+ signWebhook,
+ toWebhookEvent,
+ verifyWebhookSignature,
+ SIGNATURE_HEADER,
+} from '../../src/verify/webhook.js'
+import type { PaymentResult } from '../../src/verify/types.js'
+import type { Address, Hex } from 'viem'
+
+const SECRET = 'whsec_test_1234567890'
+
+const result: PaymentResult = {
+ status: 'paid',
+ expectedRaw: 12_500_042n,
+ receivedRaw: 12_500_042n,
+ overageRaw: 0n,
+ payer: '0x2d4d2A025b10C09BDbd794B4FCe4F7ea8C7d7bB4' as Address,
+ transfers: [
+ {
+ txHash: `0x${'aa'.repeat(32)}` as Hex,
+ logIndex: 3,
+ blockNumber: 123456n,
+ blockHash: `0x${'bb'.repeat(32)}` as Hex,
+ payer: '0x2d4d2A025b10C09BDbd794B4FCe4F7ea8C7d7bB4' as Address,
+ amountRaw: 12_500_042n,
+ },
+ ],
+}
+
+describe('signature scheme', () => {
+ it('signs and verifies round-trip', () => {
+ const body = JSON.stringify(toWebhookEvent('payment.paid', 'inv_1', result))
+ const now = Math.floor(Date.now() / 1000)
+ const header = signWebhook(SECRET, body, now)
+ expect(header).toMatch(/^t=\d+,v1=[0-9a-f]{64}$/)
+ expect(verifyWebhookSignature(SECRET, body, header)).toBe(true)
+ })
+
+ it('rejects wrong secret, tampered body, stale timestamp, malformed header', () => {
+ const body = '{"type":"payment.paid"}'
+ const now = 1_800_000_000
+ const header = signWebhook(SECRET, body, now)
+ expect(verifyWebhookSignature('other', body, header, { now })).toBe(false)
+ expect(verifyWebhookSignature(SECRET, body + ' ', header, { now })).toBe(false)
+ expect(verifyWebhookSignature(SECRET, body, header, { now: now + 301 })).toBe(false)
+ expect(verifyWebhookSignature(SECRET, body, header, { now: now + 299 })).toBe(true)
+ expect(verifyWebhookSignature(SECRET, body, 't=zzz,v1=00', { now })).toBe(false)
+ expect(verifyWebhookSignature(SECRET, body, '', { now })).toBe(false)
+ })
+
+ it('serializes bigints as decimal strings', () => {
+ const event = toWebhookEvent('payment.paid', 'inv_1', result)
+ expect(event.payment.expectedRaw).toBe('12500042')
+ expect(event.payment.transfers[0]!.blockNumber).toBe('123456')
+ expect(() => JSON.stringify(event)).not.toThrow()
+ })
+})
+
+describe('emitter against a real HTTP server', () => {
+ let server: Server
+ let url: string
+ let failuresLeft = 0
+ const received: Array<{ body: string; signature: string }> = []
+
+ beforeAll(async () => {
+ server = createServer((req, res) => {
+ let body = ''
+ req.on('data', (chunk: Buffer) => (body += chunk.toString()))
+ req.on('end', () => {
+ if (failuresLeft > 0) {
+ failuresLeft--
+ res.writeHead(500).end()
+ return
+ }
+ received.push({ body, signature: String(req.headers[SIGNATURE_HEADER]) })
+ res.writeHead(200).end('ok')
+ })
+ })
+ await new Promise<void>((resolve) => server.listen(0, '127.0.0.1', resolve))
+ const address = server.address()
+ if (typeof address === 'object' && address) url = `http://127.0.0.1:${address.port}/webhook`
+ })
+
+ afterAll(() => server.close())
+
+ it('delivers a signed event the receiver can verify', async () => {
+ const emitter = createWebhookEmitter({ url, secret: SECRET, retryDelaysMs: [0, 10] })
+ const outcome = await emitter.emit(toWebhookEvent('payment.paid', 'inv_1', result))
+ expect(outcome).toMatchObject({ ok: true, attempts: 1, status: 200 })
+ const delivery = received.at(-1)!
+ expect(verifyWebhookSignature(SECRET, delivery.body, delivery.signature)).toBe(true)
+ expect(JSON.parse(delivery.body).invoiceId).toBe('inv_1')
+ })
+
+ it('retries 5xx and succeeds', async () => {
+ failuresLeft = 2
+ const emitter = createWebhookEmitter({ url, secret: SECRET, retryDelaysMs: [0, 5, 5] })
+ const outcome = await emitter.emit(toWebhookEvent('payment.paid', 'inv_2', result))
+ expect(outcome).toMatchObject({ ok: true, attempts: 3 })
+ })
+
+ it('gives up after exhausting retries', async () => {
+ failuresLeft = 99
+ const emitter = createWebhookEmitter({ url, secret: SECRET, retryDelaysMs: [0, 5] })
+ const outcome = await emitter.emit(toWebhookEvent('payment.paid', 'inv_3', result))
+ expect(outcome.ok).toBe(false)
+ expect(outcome.attempts).toBe(2)
+ failuresLeft = 0
+ })
+
+ it('does not retry a 4xx rejection', async () => {
+ const rejecting = createServer((_req, res) => res.writeHead(400).end())
+ await new Promise<void>((resolve) => rejecting.listen(0, '127.0.0.1', resolve))
+ const address = rejecting.address()
+ const badUrl = typeof address === 'object' && address ? `http://127.0.0.1:${address.port}` : ''
+ const emitter = createWebhookEmitter({ url: badUrl, secret: SECRET, retryDelaysMs: [0, 5, 5] })
+ const outcome = await emitter.emit(toWebhookEvent('payment.paid', 'inv_4', result))
+ expect(outcome).toMatchObject({ ok: false, attempts: 1, status: 400 })
+ rejecting.close()
+ })
+})
diff --git a/robinhood/hood-pay/tests/unit/widget-config.test.ts b/robinhood/hood-pay/tests/unit/widget-config.test.ts
new file mode 100644
index 000000000..ea515d3c7
--- /dev/null
+++ b/robinhood/hood-pay/tests/unit/widget-config.test.ts
@@ -0,0 +1,35 @@
+import { describe, expect, it } from 'vitest'
+import { validateCheckoutConfig } from '../../src/widget/widget.js'
+
+const PAY_TO = '0x4022de2D36C334E73C7a108805Cea11C0564f402'
+
+describe('validateCheckoutConfig', () => {
+ it('accepts a minimal config and defaults to mainnet USDG', () => {
+ const { request } = validateCheckoutConfig({ payTo: PAY_TO, amount: '9.99' })
+ expect(request.network).toBe('mainnet')
+ expect(request.payTo).toBe(PAY_TO)
+ expect(request.amount).toBe('9.99')
+ })
+
+ it('rejects non-object and callback-shaped mistakes', () => {
+ expect(() => validateCheckoutConfig(null)).toThrow(/object/)
+ expect(() => validateCheckoutConfig('config')).toThrow(/object/)
+ expect(() => validateCheckoutConfig({ payTo: PAY_TO, amount: '1', onSuccess: 'yes' })).toThrow(/onSuccess/)
+ expect(() => validateCheckoutConfig({ payTo: PAY_TO, amount: '1', onError: 42 })).toThrow(/onError/)
+ expect(() => validateCheckoutConfig({ payTo: PAY_TO, amount: '1', onStateChange: {} })).toThrow(/onStateChange/)
+ })
+
+ it('propagates request-level validation', () => {
+ expect(() => validateCheckoutConfig({ payTo: 'nope', amount: '1' })).toThrow(/payTo/)
+ expect(() => validateCheckoutConfig({ payTo: PAY_TO, amount: 'free' })).toThrow(/decimal/)
+ expect(() =>
+ validateCheckoutConfig({ payTo: PAY_TO, amount: '1', reference: `0x${'22'.repeat(32)}` }),
+ ).toThrow(/router/)
+ })
+
+ it('carries callbacks through', () => {
+ const onSuccess = () => {}
+ const out = validateCheckoutConfig({ payTo: PAY_TO, amount: '1', onSuccess })
+ expect(out.onSuccess).toBe(onSuccess)
+ })
+})
diff --git a/robinhood/hood-pay/tsconfig.json b/robinhood/hood-pay/tsconfig.json
new file mode 100644
index 000000000..2af09a202
--- /dev/null
+++ b/robinhood/hood-pay/tsconfig.json
@@ -0,0 +1,20 @@
+{
+ "compilerOptions": {
+ "target": "ES2022",
+ "module": "NodeNext",
+ "moduleResolution": "NodeNext",
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
+ "strict": true,
+ "noUncheckedIndexedAccess": true,
+ "exactOptionalPropertyTypes": true,
+ "declaration": true,
+ "skipLibCheck": true,
+ "esModuleInterop": true,
+ "forceConsistentCasingInFileNames": true,
+ "resolveJsonModule": true,
+ "noEmit": true,
+ "types": ["node"]
+ },
+ "include": ["src", "tests", "scripts"],
+ "exclude": ["node_modules", "dist", "contracts"]
+}
diff --git a/robinhood/hood-pay/tsup.config.ts b/robinhood/hood-pay/tsup.config.ts
new file mode 100644
index 000000000..41827514e
--- /dev/null
+++ b/robinhood/hood-pay/tsup.config.ts
@@ -0,0 +1,16 @@
+import { defineConfig } from 'tsup'
+
+export default defineConfig({
+ entry: {
+ index: 'src/index.ts',
+ 'verify/index': 'src/verify/index.ts',
+ 'widget/index': 'src/widget/index.ts',
+ },
+ format: ['esm', 'cjs'],
+ dts: true,
+ sourcemap: true,
+ clean: true,
+ target: 'es2022',
+ platform: 'neutral',
+ external: ['viem', 'hoodchain', 'hood-connect', 'node:sqlite', 'node:crypto', 'node:events'],
+})
diff --git a/robinhood/hood-pay/vitest.config.ts b/robinhood/hood-pay/vitest.config.ts
new file mode 100644
index 000000000..f4a6ac92e
--- /dev/null
+++ b/robinhood/hood-pay/vitest.config.ts
@@ -0,0 +1,10 @@
+import { defineConfig } from 'vitest/config'
+
+export default defineConfig({
+ test: {
+ environment: 'node',
+ include: ['tests/**/*.test.ts'],
+ testTimeout: 30000,
+ hookTimeout: 120000,
+ },
+})