Quick Start

Get started with the SDK in under 5 minutes!

Import the SDK

<script src="https://solpay.solblaze.org/sdk.js" type="text/javascript"></script>

Connect to the Solana Network

Connect to Default RPC Endpoint:

(async () => {
    let network_details = await SOLPay.connectNetwork();
    console.log(network_details.network); // default network RPC URL
    console.log(network_details.commitment); // "confirmed"
})();

Connect to Custom RPC Endpoint:

(async () => {
    let network_details = await SOLPay.connectNetwork("https://api.mainnet-beta.solana.com", "confirmed");
    console.log(network_details.network); // "https://api.mainnet-beta.solana.com"
    console.log(network_details.commitment); // "confirmed"
})();

Connect Wallet

Wallet Adapters:

SOL Pay supports six wallets:

  • Phantom (SOLPay.adapters.PHANTOM)

  • Solflare (SOLPay.adapters.SOLFLARE)

  • Slope (SOLPay.adapters.SLOPE)

  • Glow (SOLPay.adapters.GLOW)

  • Exodus (SOLPay.adapters.EXODUS)

  • Brave (SOLPay.adapters.BRAVE)

You can also use SOLPay.adapters.CURRENT_ADAPTER or leave the adapter field blank to use the current adapter.

Send Transaction

Send Solana Lamports

Send Solana

Important:

Verify Transaction

Important:

Verifies the details of a transaction made through SOL Pay

GET https://solpay.solblaze.org/transaction.php

The transaction endpoint takes in two parameters: to and txid. The to parameter is for the recipient address, and the txid is for the signature (which can be obtained through the payment details above). The endpoint returns the sender address and the number of lamports sent.

Query Parameters

Name
Type
Description

to*

string

recipient address

txid*

string

transaction signature

Example Verification URL

Example

Frontend

Backend

Important:

Last updated