5.2.5 • Published 11 months ago
@crownfi/sei-js-core v5.2.5
@sei-js/core
A library for Sei written in Typescript.
Installation
npm install @crownfi/sei-js-core
Getting Started
Basic queries
import { getRpcQueryClient } from '@crownfi/sei-js-core';
const queryClient = await getRpcQueryClient(RPC_URL);
const seiBalance = await queryClient.bank.balance(USER_SEI_ADDRESS, "usei");
const userEvmAddress = (await queryclient.evm.eVMAddressBySeiAddress({seiAddress: USER_SEI_ADDRESS})).evmAddress;
Connecting to a wallet
In order to interact with a Sei node, you'll need a wallet to sign transactions. The wallet extensions that are currently supported can be found using the SeiWallet
class.
import { SeiWallet } from '@crownfi/sei-js-core';
const discoveredWallets = SeiWallet.discoveredWalletList();
const seiWallet = new SeiWallet(discoveredWallets[0]); // Just pick the first one
Fully interacting with the chain
import { connectComet } from '@cosmjs/tendermint-rpc';
import { getRpcQueryClient, SeiWallet } from '@crownfi/sei-js-core';
const discoveredWallets = SeiWallet.discoveredWalletList();
const seiWallet = new SeiWallet(discoveredWallets[0]); // Just pick the first one
const baseClient = await connectComet(RPC_URL);
const seiQueryClient = await getRpcQueryClient(baseClient);
const signingClient = await getSigningClient(baseClient, await seiWallet.getOfflineSigner());
// Do stuff!
We also have @crownfi/sei-utils which makes things slightly easier to use
5.2.4
1 year ago
5.2.3
1 year ago
5.2.2
1 year ago
5.2.1
1 year ago
5.1.2
1 year ago
5.2.0
1 year ago
5.1.1
1 year ago
5.1.0
1 year ago
5.0.0
1 year ago
4.0.0-beta.2
1 year ago
5.2.5
11 months ago
4.0.0-beta.1
1 year ago
4.0.0-beta.0
2 years ago
3.0.2-beta.8
2 years ago
3.0.2-beta.7
2 years ago
3.0.2-beta.6
2 years ago
3.0.2-beta.5
2 years ago
3.0.2-beta.4
2 years ago
3.0.2-beta.3
2 years ago
3.0.2-beta.2
2 years ago
3.0.2-beta.1
2 years ago
3.0.2-beta.0
2 years ago