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.
Use this when you need a fully functional
Web3
instancehttps://cdn.jsdelivr.net/npm/[email protected]/dist/index.min.js
npm install solone-sdk
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';
The function is to change the current network of the instance.
- network (required): network name
const network = "testnet" || "mainner-beta" || "devnet"; // network
await solone.switchNetwork(network);
The function to create a new wallet or wallet using a secret key.
- 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.
The function is to save a wallet in the solona instance and naming it for future use.
- 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