pnpm i # installs all dependencies
pnpm build # builds all packages
These Packages are published to NPM
luxnet
: Lux Network JavaScript SDK.@luxfi/cloud
: Lux Cloud JavaScript SDK.@luxfi/vue-components
: Lux Wallet Vue Components and Vue SDK.@luxfi/wallet-sdk
: Lux Wallet SDK.@luxfi/vm-parser
: Parse arbitrary VM data for display in the Lux Network Explorer.
These packages are only used internally for development
@luxfi/tsconfig
: tsconfig for sdks@luxfi/tsupp-config
: tsup for sdks@luxfi/eslint-config
: eslint config for sdks@luxfi/github-actions
: github actions for sdks
These are apps published to the web
teleport-demo
: This is a demo of the Lux Teleport cross-chain messaging system.
Each package and app is 100% TypeScript.
Please check out the examples
folder for more info.
pnpm build
- Build all packagespnpm dev
- Develop all packagespnpm lint
- Lint all packagespnpm changeset
- Generate a changeset. See in #versioning-and-publishing-packages
LuxNet is a JavaScript Library for interfacing with the Lux Network. It is built using TypeScript and intended to support both browser and Node.js. The LuxNet library allows you to issue commands to the Lux node APIs.
Using LuxNet, developers can:
- Retrieve balances on addresses
- Get UTXOs for addresses
- Build and sign transactions
- Issue signed transactions to the X-Chain, P-Chain, and C-Chain
- Perform cross-chain swaps between the X, P and C chains
- Add Validators and Delegators
- Create Subnets and Blockchains
LuxNet requires Node.js LTS version 20.11.1 or higher to compile.
Add LuxNet to your project via npm
or yarn
.
For installing via npm
:
npm install --save luxnet
For installing via yarn
:
yarn add luxnet
import { avm /** X-chain */, pvm /** P-chain */, evm /** C-chain */, utils, secp256k1 } from "luxnet"
// example calls
const exportTx = avm.newExportTx(...) // constructs a new export tx from X
const addValidatorTx = pvm.newAddPermissionlessValidatorTx(...) // constructs a new add validator tx on P
const importTx = evm.newImportTx(...) // constructs a new import tx to C
const publicKeyBytes = utils.hexToBuffer(publicKeyHex)
const signature = secp256k1.signHash(bytes, privateKeyBytes)
The LuxNet library can be imported into your existing project as follows:
import { avm, pvm, evm } from 'luxnet';
Package publishing has been configured using Changesets. Please review their documentation to familiarize yourself with the workflow.
This repo has an automated npm releases setup in a GitHub Action using the Changesets bot.
If you're interested in contributing, please read the contributing docs before submitting a pull request.