Loops HouseNEAR Payments for BTCPay Server

NEAR HACKATHON
Links
Team
1 member- SAOwner
Salar
Overview
NEAR Payments for BTCPay Server lets any self-hosted BTCPay Server store accept NEAR, USDC and USDT on NEAR, straight into the store's own account. No processor, no custodian, no keys on the server: the plugin only watches. The customer clicks "Pay in wallet" on BTCPay's normal checkout, lands on the plugin's pay page, connects a NEAR wallet (MyNearWallet, Meteor, HOT, Nightly) and approves one transaction: the exact amount, the invoice id as the memo, and for USDC the store account's NEP-145 registration when it is missing. The invoice settles seconds later.
How NEAR fits: NEAR makes a block every 0.6 s across a dozen shards, too fast and too wide for a payment watcher to read block by block over a free RPC node. So the plugin watches balances instead: every few seconds it compares each reserved account's balance (NEAR, and tokens through ft_balance_of) with the balance at the end of the previous turn, bisects the span of blocks when they differ, then reads that block's account changes and chunks to name the transaction, including meta transactions where a relayer paid the gas and transfers sent by contracts or intents settlements. Nothing a customer can do is missed, and a free node suffices.
Built in the hackathon window on top of our open-source BTCPay plugin family (Neo and BNB Chain, baseline commit fdcba68): the NEAR plugin, the balance-anchored NEAR client, the pay page and the tests, including a real BTCPay Server settling NEAR and USDC invoices in CI, a read-only check against the public testnet, and a recorded run in GitHub Actions that pays real testnet invoices (run 42611632686). MIT.