Your user wants to send USDC to a friend. They do not have XLM, and they should not need it to move their digital dollars. This guide shows you how to build, sign, and sponsor a USDC payment using Grat. You can see this in action on our Live Demo.Documentation Index
Fetch the complete documentation index at: https://grat.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
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.