0.9.0 • Published 3 days ago

@canvas-js/chain-ethereum-viem v0.9.0

Weekly downloads
-
License
-
Repository
-
Last release
3 days ago

@canvas-js/chain-ethereum-viem

The Viem Ethereum signer takes a Viem WalletClient, or generates a random WalletClient, and uses it to sign a SIWE message authenticating a new session.

It also handles verification of messages matching this standard, and can be used in conjuction with @canvas-js/chain-ethereum.

Table of Contents

Installation

npm i @canvas-js/chain-ethereum-viem

API

import { WalletClient } from "viem";
import type { Signature, SessionSigner, Action, Message, Session } from "@canvas-js/interfaces";
import type { SIWESessionData } from "./types.js";
export interface SIWESignerViemInit {
    chainId?: number;
    signer?: WalletClient;
    sessionDuration?: number;
}
export declare class SIWESignerViem implements SessionSigner<SIWESessionData> {
    constructor(init?: SIWESignerViemInit);
    readonly match: (address: string) => boolean;
    verifySession(topic: string, session: Session<SIWESessionData>): Promise<void>;
    getSession(topic: string, options?: {
        timestamp?: number;
        fromCache?: boolean;
    }): Promise<Session<SIWESessionData>>;
    sign(message: Message<Action | Session>): Signature;
    clear(topic: string): Promise<void>;
}
0.8.27-patch.2

3 days ago

0.8.27-patch.3

3 days ago

0.8.27-patch.4

3 days ago

0.8.27-patch.5

3 days ago

0.8.27-patch.1

3 days ago

0.9.0

7 days ago

0.9.0-next.1

23 days ago

0.8.26-alpha.4

3 months ago

0.8.26-alpha.3

3 months ago

0.8.26-alpha.2

3 months ago

0.8.26

3 months ago

0.8.26-alpha.1

3 months ago

0.8.25

3 months ago

0.8.24

3 months ago

0.8.23

3 months ago

0.8.22

3 months ago

0.8.21

4 months ago

0.8.20

4 months ago

0.8.19

4 months ago

0.8.18

4 months ago

0.8.17

4 months ago

0.8.16

4 months ago

0.8.15

4 months ago