Solone
Search…
Web3 SDK
Let's talk about Web3 integration! Moralis comes with a set of plugins to help you focus on the development of your app, leaving the rest to us.
Web3 Specific Functionality of the Solona SDK.

Getting Started

In HTML

Use this when you need a fully functional Web3 instance
1
https://cdn.jsdelivr.net/npm/[email protected]/dist/index.min.js
Copied!

In-Browser

1
npm install solone-sdk
Copied!

Initialize

1
import { Solone } from 'solone-sdk';
2
3
// network could be mainnet-beta, testnet or devnet
4
const solone = new Solone('testnet');
5
6
solone.masterUrl = 'https://api.solone.io/web3Api/';
7
solone.masterKey = 'sol_fm58yVjjC9vY7q1NPQ5rMBFt68e7aqfC';
Copied!

switchNetwork

The function is to change the current network of the instance.

Options:

  • network (required): network name
1
const network = "testnet" || "mainner-beta" || "devnet"; // network
2
await solone.switchNetwork(network);
Copied!

CreateAccount

The function to create a new wallet or wallet using a secret key.

Options:

  • secretKey (optional): string or base58 secret key of wallet
1
const wallet = solone.createAccount(); // create new random account
2
const wallet = solone.createAccount(secretKey); // create account using secretKey, Can be either in string or uinit8Array.
Copied!

addWallet

The function is to save a wallet in the solona instance and naming it for future use.

Options:

  • name (required): string unique name of wallet
  • secretKey (required): string or base58 secret key of wallet
1
// Add wallet(name, secretKeyArray)
2
const wallet = await solanaClient.addWallet('myWallet', [106,241,17,...,25,111,29,121,118]);
3
Copied!
Last modified 8mo ago