• Fetches the balance of a specified SPL token for a given wallet address.

    Parameters

    • rpcUrl: string

      The URL of the Solana RPC endpoint.

    • ownerAddress: string

      The public key of the wallet owner.

    • mintAddress: string

      The mint address of the SPL token.

    Returns Promise<number>

    The balance of the SPL token in the specified wallet.

    Example

    const rpcUrl = 'https://rpc.helius.xyz/?api-key=<API_KEY>'
    const ownerAddress = 'EPiCHbeCzokXifRK6m91uwFM5A5XVoS6cgwM2JuLXVdC'
    const mintAddress = 'CvB1ztJvpYQPvdPBePtRzjL4aQidjydtUz61NWgcgQtP'

    const result = await getSPLTokenBalance(rpcUrl, ownerAddress, mintAddress)
    console.log(result)

Generated using TypeDoc