Skip to main content
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.

Prerequisites

  • A running Grat relay (see the Quickstart).
  • The Grat TypeScript SDK installed.
1

Initialize the SDK

Connect to your local relay.
2

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.
3

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.
4

Sign and Sponsor

Alice signs the transaction to authorize the payment, then your app sends it to Grat for sponsorship.
5

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.
View on GitHub