@dokebi/payment
v0.2.6
Published
On-chain USDT (TRC20) custody for Dokebi: deposit addresses derived from an account xpub, deposits watched and confirmed into the app's ledger in one transaction, withdrawals sent from the hot wallet, sweeps, daily reconciliation, alerts and a kill switch
Maintainers
Readme
@dokebi/payment
On-chain USDT (TRC20) custody for Dokebi, over @dokebi/db and @dokebi/outbox, on PostgreSQL, MySQL 8 and MariaDB 10.6+. Version 0.2.0. AI agents start with AI.md; the design is D-0191.
payment.addressFor(tx, owner)gives each owner a fixed deposit address derived from the account xpub (m/44'/195'/0'/0/i);arm(tx, …)watches it closely while a deposit request waits.- A solid deposit reaches
onDepositConfirmed(tx, deposit)ofsrc/infra/payment/extension.tsinside the plugin's transaction: the app's ledger credit and the credited state commit together. payment.send(tx, { key, to, amount, owner })takes a withdrawal; the outbox pays its energy, signs, sends, confirms, and callsonWithdrawalConfirmedoronWithdrawalFailed.- An operator's
sweepNow(tx, { address } | { all: true }, { by })andmoveToCold(tx, { key, amount, by, reason })(never belowhotMin). - Sweeps to the hot wallet, daily reconciliation, alerts and a kill switch (
paymentPolicy, read on every use). - Key files (scrypt + AES-256-GCM, the format of the starter app) are made by a person with
npx dokebi-payment keystore init | import; keys are never command arguments. network: mockkeeps a TRON-like chain in the database for development and tests; nile and mainnet need a chain driver (@dokebi/payment-tron gives tron).
MIT licensed.
