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

0.13.14 • Public • Published

@canvas-js/chain-ethereum

The Ethers (v6) Ethereum signer takes an ethers signer, or generates a random ethers.Wallet, 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-viem.

Table of Contents

Installation

npm i @canvas-js/chain-ethereum

API

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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.10.0-beta.30beta
0.10.0-alpha.10alpha
0.13.14107latest
0.14.0-next.21next

Version History

VersionDownloads (Last 7 Days)Published
0.14.0-next.21
0.13.14107
0.13.130
0.14.0-next.10
0.13.120
0.13.110
0.14.0-next.00
0.13.100
0.13.90
0.13.8-next.10
0.13.8-next.00
0.13.70
0.13.60
0.13.50
0.13.4-next.00
0.13.30
0.13.20
0.13.10
0.13.00
0.12.60
0.13.0-next.170
0.12.50
0.12.40
0.12.30
0.12.3-next.40
0.12.3-next.30
0.12.3-next.20
0.12.3-next.10
0.12.3-next.00
0.12.20
0.13.0-next.160
0.13.0-next.151
0.13.0-next.140
0.13.0-next.130
0.12.10
0.13.0-next.120
0.13.0-next.110
0.13.0-next.100
0.13.0-next.90
0.13.0-next.80
0.13.0-next.70
0.13.0-next.60
0.13.0-next.50
0.12.00
0.13.0-next.40
0.13.0-next.30
0.13.0-next.20
0.13.0-next.10
0.11.00
0.10.100
0.10.91
0.10.81
0.10.70
0.10.60
0.10.50
0.10.40
0.10.30
0.10.20
0.10.10
0.10.00
0.10.0-beta.30
0.10.0-beta.41
0.10.0-beta.21
0.10.0-beta.10
0.10.0-alpha.10
0.8.291
0.8.280
0.8.27-patch.210
0.8.27-patch.200
0.8.27-patch.190
0.8.27-patch.180
0.8.27-patch.170
0.8.27-patch.160
0.8.27-patch.150
0.8.27-patch.140
0.8.27-patch.130
0.8.27-patch.120
0.8.27-patch.110
0.8.27-patch.100
0.8.27-patch.90
0.8.27-patch.80
0.8.27-patch.70
0.8.27-patch.60
0.9.10
0.8.27-patch.50
0.8.27-patch.40
0.8.27-patch.30
0.8.27-patch.20
0.8.27-patch.10
0.9.00
0.9.0-next.10
0.8.26-main-488c798d0
0.8.260
0.8.26-alpha.40
0.8.26-alpha.30
0.8.26-alpha.20
0.8.26-alpha.10
0.8.250
0.8.240
0.8.230
0.8.220
0.8.210
0.8.200
0.8.190
0.8.180
0.8.170
0.8.160
0.8.150
0.8.140
0.8.14-alpha.10
0.8.130
0.8.120
0.8.110
0.8.100
0.8.90
0.8.80
0.8.70
0.8.60
0.8.50
0.8.40
0.8.30
0.8.20
0.8.2-patch.10
0.8.2-alpha.10
0.8.10
0.8.00
0.7.30
0.7.20
0.7.2-alpha.70
0.7.2-alpha.60
0.7.2-alpha.50
0.7.2-alpha.40
0.7.2-alpha.30
0.7.2-alpha.20
0.7.2-alpha.10
0.7.10
0.7.00
0.6.10
0.6.00
0.5.10
0.5.00
0.6.0-alpha70
0.6.0-alpha60
0.6.0-alpha50
0.6.0-alpha40
0.6.0-alpha30
0.6.0-alpha20
0.6.0-alpha10
0.5.0-alpha40
0.5.0-alpha30
0.5.0-alpha20
0.5.0-alpha0
0.4.110
0.4.100
0.4.90
0.4.80
0.4.70
0.4.60
0.4.50
0.4.40
0.4.30
0.4.20
0.4.10
0.4.00
0.3.30
0.3.20
0.3.10
0.3.00
0.2.20
0.2.10
0.2.00
0.1.30
0.1.20
0.1.10
0.1.00
0.0.530
0.0.520
0.0.510
0.0.500
0.0.50-pre40
0.0.50-pre30
0.0.50-pre20
0.0.50-pre0

Package Sidebar

Install

npm i @canvas-js/chain-ethereum

Weekly Downloads

114

Version

0.13.14

License

none

Unpacked Size

45.8 kB

Total Files

32

Last publish

Collaborators

  • joelg
  • raykyri
  • rjwebb