How to use
Installation
yarn add @xchainjs/xchain-solana
or
npm install @xchainjs/xchain-solana
Initialization
Using the Solana client you can initialize the main class of the module in consultation mode if you do not provide any parameters, this means you could retrieve information from the blockchain and prepare transactions to sign, but you will not be able to sign transactions, or generate addresses.
import { Client } from '@xchainjs/xchain-solana'
const client = new Client()
// Make read operations with your client
Otherwise, if you want to sign transactions and get the addresses you own, you will need to initialize the main class of the protocol as follows
import { Client, defaultSolanaParams } from '@xchainjs/xchain-solana'
const client = new Client({
phrase: 'your secret phrase',
...defaultSolanaParams
})
// Make read or write operations with your client
Last updated