@xx.network/types
v1.0.6
Published
XX Network blockchain type definitions for @polkadot/api
Downloads
9
Maintainers
Readme
@xx.network/types
XX Network blockchain type definitions for @polkadot/api.
Description
This package provides TypeScript type definitions and API augmentations for interacting with the XX Network blockchain using the Polkadot.js API.
Repository
- Source Code: https://git.xx.network/foundation/xx-network-types
- Issues: https://git.xx.network/foundation/xx-network-types/-/issues
Installation
# bun
bun add @xx.network/types
# npm
npm install @xx.network/types
# yarn
yarn add @xx.network/types
# pnpm
pnpm add @xx.network/typesUsage
Import the types before any imports from @polkadot/api to augment the API with XX Network specific types:
// Import XX Network types first (side-effect import)
import '@xx.network/types';
// Then import from @polkadot/api
import { ApiPromise, WsProvider } from '@polkadot/api';
async function main() {
const provider = new WsProvider('wss://rpc.xx.network');
const api = await ApiPromise.create({ provider });
// API is now augmented with XX Network types
const chain = await api.rpc.system.chain();
console.log(`Connected to ${chain}`);
}
main();Compatibility
- Node.js >= 18.0.0
- @polkadot/api >= 16.0.0
License
Apache-2.0
Contributing
Contributions are welcome! Please submit issues and pull requests at: https://git.xx.network/foundation/xx-network-types
Support
For questions and support, visit:
- XX Network Forum: https://forum.xx.network
- Discord: https://discord.xx.network
