Guide
To make the most of SolanaPortal’s API for token swaps, you first need to understand the basic components and tools used in the Solana blockchain. This guide will introduce these key concepts, helping you build a solid foundation before diving into swaps.
Key Concepts
Wallets
A wallet is where you store your cryptocurrencies and tokens on the blockchain. To use SolanaPortal, you’ll need access to a Solana-compatible wallet that supports private keys for signing transactions. Popular wallets include:
Phantom: A user-friendly browser extension wallet.
Solflare: A versatile wallet available on browsers and mobile devices.
Warning: Always keep your private key secure and never share it. You’ll need your wallet’s private key to sign swaps using the SolanaPortal API.
Mint Address
A mint address is a unique identifier for a token on the Solana blockchain. Each token, including SOL, USDC, and other tokens, has its own mint address. You’ll need the mint address of the token you want to trade. For example:
SOL:
So11111111111111111111111111111111111111112
USDC:
EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
Private Keys
Your wallet’s private key is required to authenticate and sign transactions on the Solana blockchain. Without the private key, you cannot initiate or complete swaps.
Use libraries like bs58 in Node.js or solana-py in Python to decode and use your private key programmatically.
API Basics
SolanaPortal provides two key endpoints for swapping:
Single Swap Endpoint:
Use this for individual swaps using jito or bloxroute.
Jito Bundle Endpoint:
Use this to execute multiple swaps in a single transaction.
Last updated