Solone
Search
⌃K

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
https://cdn.jsdelivr.net/npm/[email protected]/dist/index.min.js

In-Browser

npm install solone-sdk

Initialize

import { Solone } from 'solone-sdk';
// network could be mainnet-beta, testnet or devnet
const solone = new Solone('testnet');
solone.masterUrl = 'https://api.solone.io/web3Api/';
solone.masterKey = 'sol_fm58yVjjC9vY7q1NPQ5rMBFt68e7aqfC';

switchNetwork

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

Options:

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

CreateAccount

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

Options:

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

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
// Add wallet(name, secretKeyArray)
const wallet = await solanaClient.addWallet('myWallet', [106,241,17,...,25,111,29,121,118]);
Last modified 1yr ago