jay-network
v0.1.0
Published
JavaScript/TypeScript SDK for The Jay Network — queries, staking, governance, and transfers built on CosmJS.
Maintainers
Readme
jay-network
JavaScript / TypeScript SDK for The Jay Network — a Cosmos SDK Layer‑1 with CosmWasm and IBC. Built on CosmJS.
JayClient— read-only queries (balances, validators, governance, IBC, supply)JaySigningClient— transactions (send, stake, redelegate, claim, vote, IBC)- Chain constants + address helpers
npm install jay-networkNetwork
| Parameter | Value |
|-----------|-------|
| Chain ID | thejaynetwork |
| Token | JAY (ujay, 6 decimals) |
| Address prefix | yjay |
| RPC | https://pixture.thejaynetwork.com/rpc |
| REST | https://pixture.thejaynetwork.com/rest |
Querying (no wallet)
import { JayClient } from 'jay-network'
const jay = new JayClient()
const { height } = await jay.getLatestBlock()
const balance = await jay.getJayBalance('yjay1...')
const validators = await jay.getValidators()
const proposals = await jay.getProposals()Use custom endpoints:
const jay = new JayClient({
rpc: 'https://my-node:26657',
rest: 'https://my-node:1317',
})Transactions (with a wallet)
JaySigningClient works with any CosmJS OfflineSigner — Keplr, JAY Wallet, or a mnemonic.
Keplr / JAY Wallet (browser)
import { JaySigningClient, JAY_CHAIN_INFO, JAY_CHAIN_ID } from 'jay-network'
await window.keplr.experimentalSuggestChain(JAY_CHAIN_INFO)
await window.keplr.enable(JAY_CHAIN_ID)
const signer = await window.keplr.getOfflineSignerAuto(JAY_CHAIN_ID)
const [account] = await signer.getAccounts()
const jay = await JaySigningClient.connect(signer, account.address)
await jay.send('yjay1recipient...', '5') // send 5 JAY
await jay.delegate('yjayvaloper1...', '100') // stake 100 JAY
await jay.claimRewards('yjayvaloper1...') // claim rewards
await jay.vote(12, 'VOTE_OPTION_YES') // vote on proposal #12Node.js (mnemonic)
import { DirectSecp256k1HdWallet } from '@cosmjs/proto-signing'
import { JaySigningClient, JAY_PREFIX } from 'jay-network'
const signer = await DirectSecp256k1HdWallet.fromMnemonic(process.env.MNEMONIC!, {
prefix: JAY_PREFIX,
})
const [account] = await signer.getAccounts()
const jay = await JaySigningClient.connect(signer, account.address)
await jay.send('yjay1...', '1')IBC transfer
await jay.ibcTransfer({
sourceChannel: 'channel-0',
receiver: 'cosmos1...',
amount: '2.5',
})Helpers
import {
toMicro, fromMicro, reEncodeAddress, toValoper,
isValidatorOperator, isValidJayAddress, shortenAddress,
} from 'jay-network'
toMicro('1.5') // "1500000"
fromMicro('1500000') // "1.500000"
reEncodeAddress('yjay1...', 'cosmos')// "cosmos1..."
toValoper('yjay1...') // "yjayvaloper1..."
isValidJayAddress('yjay1...') // trueAPI
JayClient(options?)
getLatestBlock · getNodeInfo · getBalances · getJayBalance · getValidators · getValidator · getDelegations · getRewards · getValidatorCommission · getProposals · getProposal · getSupply · getIbcChannels · resolveIbcDenom
JaySigningClient.connect(signer, address, options?)
send · delegate · undelegate · redelegate · claimRewards · claimAllRewards · withdrawCommission · vote · ibcTransfer · disconnect
Every tx method accepts an optional memo and an optional explicit StdFee (pass a plain fee object, not a GasPrice instance).
Publishing (maintainers)
This package lives in the hub-jay repo (under jaynetwork-sdk/) and auto-publishes to npm via GitHub Actions.
One-time setup
- Create an npm Automation access token at npmjs.com → Access Tokens.
- In the hub-jay repo: Settings → Secrets and variables → Actions → New repository secret.
- Name:
NPM_TOKEN - Value: the npm token
- Never commit the token to the repo.
- Name:
Release flow
- Bump the version in
jaynetwork-sdk/package.json. - Create a GitHub Release in the hub-jay repo.
- The
Publish SDK to npmworkflow buildsjaynetwork-sdk/and runsnpm publish --access public.
You can also trigger it manually from the Actions tab (workflow_dispatch).
License
MIT © Winnode
