@logion/extension
TypeScript icon, indicating that this package has built-in type declarations

0.8.0 • Public • Published

Logion Extension SDK

This project provides some utility classes enabling the use the Polkadot JS extension with a logion client.

Usage

Install package @logion/extension with your favorite package manager and start siging content using the extension.

import { enableExtensions, ExtensionSigner } from '@logion/extension';

const client = LogionClient.create(...); // Create your logion client

const register = await enableExtensions("Your app name", [ "polkadot-js" ]);
const signer = new ExtensionSigner();
register((accounts: InjectedAccount[]) => {
    const addresses = accounts.map(account => account.address);
    const authenticated = await client.authenticate(addresses, signer); // This will enable authentication by signing with the extension
    // Use authenticated to use logion features
});

Readme

Keywords

Package Sidebar

Install

npm i @logion/extension

Weekly Downloads

69

Version

0.8.0

License

Apache-2.0

Unpacked Size

5.84 kB

Total Files

8

Last publish

Collaborators

  • benoitdevos
  • gdethier