"scheme": "tron_router". Sending USDT normally costs TRX for energy and bandwidth, and a brand-new address can’t send at all until it is activated. With a sponsored transfer, the sender needs neither: Bitnob activates the account if needed and pays the resources, and the fee is taken in USDT.
Request the quote
First transfer or later transfer
Check whethersign.approve is present.
Later transfers only have sign.digest:
approve block:
spender, move this token from the sender’s address. It is a one-time step for each sender and token. The quoted fee already covers it, so the sender pays nothing extra.
Before you ask the user to sign an approval, check what it grants. token should be the contract of the token being sent (TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t for USDT on Tron mainnet), spender the router, and selector approve(address,uint256), the standard token approval. Show the user that this is a one-time approval for the router.
Sign
Both digests are 32-byte hashes that are ready to sign. Sign them directly with the sender’s secp256k1 key, without hashing them again.sign-tron.mjs
serialized is the 0x-prefixed 65-byte signature, r, s, and v, which Submit expects.
Submit both signatures together
Whenapprove was present, send tron_approve_signature in the same call as tron_signature. Submitting tron_signature alone for a first-time sender returns 422 signature_invalid, and the transfer can’t be broadcast without the approval.
What happens for a first-time sender
Aftersubmitted, a first-time sender’s transfer passes through extra statuses while Bitnob onboards the address:
An address that is already active skips
tron_activating. A sender who has approved before skips both. Allow a little more time for a first transfer, and show the user a status such as “Setting up your address” rather than an error.