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});
}