@xchainjs/xchain-solana
TypeScript icon, indicating that this package has built-in type declarations

0.0.6 • Public • Published

Solana client

NPM Version NPM Downloads


Client that allows to perform operations on the Solana blockchain abstracting developers from its particularities, thus allowing developers to focus on their projects. The Solana client is built on top of @solana/web3.js and the suite of packages developed by the Metaplex foundation.

If you want to read more about Solana blockchain, go to its official web site

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

Features

Thanks to the Solana client you will be able to:

  • Get the Solana and tokens balances that an address owns
  • Generate addresses given a secret phrase
  • Transfer Solana and tokens to another address
  • Get details of a transaction
  • Get address transaction history

Examples

You can find examples using the Solana package in the solana examples folder.

Documentation

More information about how to use the Solana client can be found on documentation

Readme

Keywords

Package Sidebar

Install

npm i @xchainjs/xchain-solana

Weekly Downloads

28

Version

0.0.6

License

MIT

Unpacked Size

179 kB

Total Files

12

Last publish

Collaborators

  • xchainjsadmin
  • thorianite
  • polaris_9r
  • thorchain_org
  • _stu
  • veado
  • thatstrangeguy
  • junkai121
  • sarawut11
  • thorswap
  • hodrthemediocre