Hello World
What we're going to build
Setup
import { NorthStarSDK } from "@sonicsvm/northstar-sdk";
import {
Connection,
Keypair,
PublicKey,
SystemProgram,
Transaction,
} from "@solana/web3.js";
const PORTAL = new PublicKey("74iiMCqFw1afWyp3tdh9pUqfRfCRq7gfdC2YZoNGpovt");
const L1_RPC = new Connection("https://api.devnet.sonic.game", "confirmed");
const ER_RPC = new Connection("https://ephemeral.devnet.sonic.game", "confirmed");
const sdk = new NorthStarSDK({
portalProgramId: PORTAL,
customEndpoints: { solana: L1_RPC, ephemeralRollup: ER_RPC },
});
const owner = Keypair.generate();
const recipient = Keypair.generate();
// Fund the owner — devnet faucet, ~5 SOL is comfortable for the session.
// In your dev workflow, prefer the deploy payer at ~/.config/solana/id.json.Step 1: Open a session
Step 2: Delegate the recipient account
Step 3: Run the transaction inside the ER
Step 4: Settle back
Step 5: Verify
What just happened
Where to go from here
Last updated
