https://github.com/ark930/bifrost.js
https://github.com/ark930/bifrost.js
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/ark930/bifrost.js
- Owner: ark930
- License: apache-2.0
- Created: 2020-04-05T10:10:49.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-05T10:11:37.000Z (about 6 years ago)
- Last Synced: 2025-01-24T19:36:46.914Z (over 1 year ago)
- Language: TypeScript
- Size: 241 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

[](https://www.npmjs.com/package/@acala-network/api)
# @acala-network
This library provides additional typing information for user to access Acala Network by using [polkadot.js](https://github.com/polkadot-js/api).
# Getting Started
- Install dependencies
```bash
yarn add @polkadot/api@1.9.0 @acala-network/api@beta
```
Note: Currently only `@acala-network/api@beta` and `@polkadot/api@1.9.0` are supported.
- Create API instance
```ts
import { ApiPromise } from '@polkadot/api';
import { WsProvider } from '@polkadot/rpc-provider';
import { options } from '@acala-network/api';
async function main() {
const provider = new WsProvider('wss://testnet-node-1.acala.laminar.one/ws');
const api = new ApiPromise(options({ provider }));
await api.isReady;
// use api
}
main()
```
- Use api to interact with node
```ts
// query and display account data
const data = await api.query.system.account('5F98oWfz2r5rcRVnP9VCndg33DAAsky3iuoBSpaPUbgN9AJn');
console.log(data.toHuman())
```