Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@canvas-js/chain-substrate

Package Overview
Dependencies
Maintainers
0
Versions
170
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@canvas-js/chain-substrate

The Substrate session signer takes an injected `polkadot-js` extension, or generates a random Substrate keypair, and uses it to authenticate a new session.

  • 0.13.10
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
344
increased by19.03%
Maintainers
0
Weekly downloads
 
Created
Source

@canvas-js/chain-substrate

The Substrate session signer takes an injected polkadot-js extension, or generates a random Substrate keypair, and uses it to authenticate a new session.

It also handles verification of messages matching this authentication method.

Table of Contents

  • Installation
  • API

Installation

npm i @canvas-js/chain-atp

API

import type { Signature, SessionSigner, Action, Message, Session } from "@canvas-js/interfaces"
import { InjectedExtension } from "@polkadot/extension-inject/types"
import { KeypairType } from "@polkadot/util-crypto/types"
import type { SubstrateSessionData } from "./types.js"
type SubstrateSignerInit = {
  sessionDuration?: number
  extension?: InjectedExtension
  substrateKeyType?: KeypairType
}
export declare class SubstrateSigner implements SessionSigner {
  constructor(init?: SubstrateSignerInit)
  readonly match: (address: string) => boolean
  verifySession(topic: string, session: Session): Promise<void>
  getSession(
    topic: string,
    options?: {
      chain?: string
      timestamp?: number
      fromCache?: boolean
    },
  ): Promise<Session<SubstrateSessionData>>
  sign(message: Message<Action | Session | Snapshot>): Signature
  clear(topic: string): Promise<void>
}

FAQs

Package last updated on 09 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc