Prerequisites
Before you begin, make sure you have:- A Squads API key (get one here)
- An Ed25519 keypair for signing transactions (learn more about signing)
- A supported token for paying fees (USDC or SOL) (fee documentation)
Making API Requests
All requests should be made to the base URL:https://developer-api.squads.so
Include your API key and network in the request headers of every request:
Create your first smart account
Create a basic smart account with a single signer. For more details about smart account creation and management, see the Create Smart Account documentation.Create a token transfer
Let’s create a token transfer transaction using your new smart account. We’ll break this down into steps:1. Set up the transfer instruction
First, import the required dependencies and create the token transfer instruction:2. Create a versioned transaction
Next, create a V0 transaction message with the latest blockhash:3. Prepare the transaction
Send the transaction to the Squads API for preparation. This step will:- Add the necessary program instructions
- Configure fee payment
- Return the prepared transaction and fee details