Getting started
A thin JSON-RPC wrapper for interacting with chains and Blocto wallet.
Blocto SDK comes with an EIP-1193 compatible provider, you can use it to interact with Solana.
Note that Blocto SDK for Solana is still in Beta. APIs are subject to breaking changes.

Installation

Install from npm/yarn
1
$ yarn add @solana/web3.js
2
$ yarn add @blocto/sdk
Copied!
... or via CDN
1
<script src="https://unpkg.com/@solana/[email protected]/lib/index.iife.min.js"></script>
2
<script src="https://unpkg.com/@blocto/[email protected]/dist/blocto-sdk.umd.js" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
Copied!

Usage

Initiate the Blocto provider
1
import solanaWeb3 from '@solana/web3'
2
import BloctoSDK from '@blocto/sdk'
3
4
const bloctoSDK = new BloctoSDK({
5
solana: {
6
// (required) devnet to be used
7
net: 'testnet',
8
},
9
10
// (optional) Blocto app ID
11
appId: 'YOUR_BLOCTO_APP_ID',
12
});
Copied!

Blocto Provider parameters

Parameter
Type
Description
Required
solana.net
String
one of testnet or mainnet-beta
Yes
appId
String
Blocto dApp ID
No
Last modified 3mo ago
Copy link