Skip to content

feat: wire WDK Tron USDT prepare/commit split - #25

Merged
KevinMB0220 merged 1 commit into
mainfrom
feat/wdk-prepare-commit
Sep 10, 2026
Merged

KevinMB0220 merged 1 commit into
mainfrom
feat/wdk-prepare-commit

Conversation

@salazarsebas

Copy link
Copy Markdown
Contributor

Summary

Implements issue #5: WdkWalletAdapter against Tether WDK, with prepare and commit kept as two calls so the risk-friction screen can run (and cancel) between them.

MVP network: Tron (TRC-20 USDT). That matches current apps/web destinations and the USDT scam volume this product intercepts. Ethereum intents are rejected, not coerced onto Tron. Default token is mainnet USDT TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t; testnets pass usdtTokenAddress.

WDK's TRC-20 API is a one-shot account.transfer() that signs and broadcasts. This adapter wraps that shortcut instead of exposing it on WalletPort:

WalletPort WDK call Signs Broadcasts
prepare quoteTransfer no no
commit transfer yes yes

prepare snapshots token, recipient, and base-unit amount. commit spends that snapshot, so a later mutation of SendIntent cannot change what is signed. Abandoning a prepare (never calling commit) never calls transfer. A second commit throws.

createTronWdkAccount is the only import of @tetherto/wdk-wallet-tron. Seed and RPC URL are required so this package never embeds a key or silently targets mainnet.

Unit tests inject a fake WdkTransferClient. CI does not load WDK, hold a seed, or talk to a node. Manual testnet steps are in packages/adapters-wdk/README.md.

apps/web is not wired yet. That is issue #6.

Disclosed-services list updated for @tetherto/wdk-wallet-tron 1.0.0-beta.13.

Test plan

  • pnpm --filter @custos/adapters-wdk test (11 tests)
  • pnpm run build
  • pnpm run typecheck
  • pnpm run test
  • pnpm --filter @custos/web build
  • Optional: follow the README testnet script on Shasta/Nile and confirm prepare creates no tx while commit returns a hash

Closes #5

@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 0443f0b5-f665-4392-8788-29a2415f51ae


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@KevinMB0220
KevinMB0220 merged commit 7194615 into main Sep 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wire WDK wallet: prepare/commit split with pre-sign interception

2 participants