Solana program call
Call a Solana program your app allowed in the dashboard (Wallets > Signing rules > Solana), from the logged-in Solana wallet. The same call works for a Pollar-managed, co-signed, self-custody or external wallet: Pollar builds the transaction, checks it against the app's policy and, if the app pays, sponsors the fee.
Before you call
Allow the program in the dashboard: Wallets > Signing rules > Solana. For the Memo example, add the Memo program (MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr) and allow every instruction (test apps only).
tx stateidle
Simulate or call to drive the transaction state machine.
@pollar/core— Anchor, any Solana wallet
import { PollarClient, SOLANA_FEE_PAYER } from '@pollar/core'; import { PublicKey } from '@solana/web3.js'; const client = new PollarClient({ apiKey, baseUrl }); await client.ready(); // An Anchor instruction, as your program's client builds it. const ix = await program.methods .joinPact() .accounts({ memberOwner: wallet, // the user's Solana address feePayer: new PublicKey(SOLANA_FEE_PAYER), // Pollar puts the payer here pact, }) .instruction(); // What it would do, without signing it... const sim = await client.solana.simulateProgramCall({ instructions: [ix] }); // ...and the call: same code for a Pollar-managed, co-signed, // self-custody or external wallet. const outcome = await client.solana.callProgram({ instructions: [ix] }); if (outcome.status === 'success') console.log(outcome.hash);
@pollar/react— this page's memo
const { getClient, tx } = usePollar(); // The memo this page sends, as plain objects (data in base64). await getClient().solana.callProgram({ instructions: [{ programId: 'MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr', accounts: [{ pubkey: solanaAddress, isSigner: true, isWritable: false }], data: btoa('Hello from Pollar'), }], }); // tx.step moves building → signing → submitted → success, as with any payment.

