@vue-polkadot/vue-api
v0.0.50-rc.3
Published
Singleton wrapper for polkadot api
Downloads
7
Readme
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});
}