Prerequisites
- A running Grat relay (see the Quickstart).
- The Grat TypeScript SDK installed.
Establish a USDC Trustline
Before a user can receive USDC on Stellar, they must establish a trustline. You can sponsor this setup transaction as well.
Build a USDC Payment
Build a standard payment transaction. Note that you don’t need to worry about Alice having XLM for the fee, as Grat will cover it.
Sign and Sponsor
Alice signs the transaction to authorize the payment, then your app sends it to Grat for sponsorship.
Verify the Payment
Verify the transaction hash on Stellar Expert. The record will show that Alice’s balance decreased by 10 USDC, while Grat’s channel account paid the native XLM fee.
This guide uses the Testnet USDC issuer address. For Mainnet, you must use the official Circle USDC issuer address.