@canvas-js/chain-cosmos
TypeScript icon, indicating that this package has built-in type declarations

0.10.0-beta.1 • Public • Published

@canvas-js/chain-cosmos

The Cosmos session signer takes an injected Cosmos signer, which may be an EthereumSigner, AminoSigner, or BytesSigner, and uses it to authenticate a new session.

It also handles verification of messages matching any of these authentication methods.

Table of Contents

Installation

npm i @canvas-js/chain-cosmos

API

import type { Signature, SessionSigner, Action, Message, Session } from "@canvas-js/interfaces";
import { CosmosSessionData, ExternalCosmosSigner } from "./types.js";
export interface CosmosSignerInit {
    signer?: ExternalCosmosSigner;
    sessionDuration?: number;
    bech32Prefix?: string;
}
export declare class CosmosSigner implements SessionSigner {
    constructor({ signer, sessionDuration, bech32Prefix }?: CosmosSignerInit);

    readonly match: (address: string) => boolean;
    verifySession(topic: string, session: Session): Promise<void>;
    getSession(topic: string, options?: {
        timestamp?: number;
        fromCache?: boolean;
    }): Promise<Session<CosmosSessionData>>;
    sign(message: Message<Action | Session>): Signature;
    clear(topic: string): Promise<void>;
}

Readme

Keywords

none

Package Sidebar

Install

npm i @canvas-js/chain-cosmos

Weekly Downloads

92

Version

0.10.0-beta.1

License

none

Unpacked Size

26.7 kB

Total Files

22

Last publish

Collaborators

  • rjwebb
  • joelg
  • raykyri