@vue-polkadot/vue-api
TypeScript icon, indicating that this package has built-in type declarations

0.0.50-rc.3 • Public • Published

vue-api

Singleton wrapper for polkadot api

Installation

npm install --save @vue-polkadot/vue-api

Docs

connect method returns Promise<ApiPromise | Error>

Usage Examples

Import vue-api object like

import Connector from '@vue-polkadot/vue-api';

Connect to selected node

Connector.connect(store.state.setting.apiUrl);

Then in component

async function getChainProperties() {
  const { api } = Connector.getInstance();
  const { chainSS58, chainDecimals, chainToken } = api.registry;
  console.log('[API] Connect <3', { chainSS58, chainDecimals, chainToken});
}

Readme

Keywords

none

Package Sidebar

Install

npm i @vue-polkadot/vue-api

Weekly Downloads

2

Version

0.0.50-rc.3

License

Apache-2.0

Unpacked Size

8.82 kB

Total Files

15

Last publish

Collaborators

  • yangwao
  • vikiival