0.12.1 • Published 8 months ago

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

Weekly downloads
-
License
-
Repository
-
Last release
8 months 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.13.0-next.16

8 months ago

0.13.0-next.15

8 months ago

0.13.0-next.14

8 months ago

0.13.0-next.13

8 months ago

0.12.1

8 months ago

0.13.0-next.12

8 months ago

0.13.0-next.11

8 months ago

0.13.0-next.10

8 months ago

0.13.0-next.9

8 months ago

0.13.0-next.8

8 months ago

0.11.0

9 months ago

0.12.0

8 months ago

0.13.0-next.1

9 months ago

0.13.0-next.3

9 months ago

0.13.0-next.2

9 months ago

0.13.0-next.5

8 months ago

0.13.0-next.4

9 months ago

0.13.0-next.7

8 months ago

0.13.0-next.6

8 months ago

0.10.10

10 months ago

0.10.0-alpha.1

1 year ago

0.8.29

1 year ago

0.10.9

10 months ago

0.10.1

11 months ago

0.10.0-beta.2

1 year ago

0.10.2

11 months ago

0.10.0-beta.3

12 months ago

0.10.3

11 months ago

0.10.4

11 months ago

0.10.0-beta.1

1 year ago

0.10.5

11 months ago

0.10.6

10 months ago

0.10.7

10 months ago

0.10.0-beta.4

1 year ago

0.10.8

10 months ago

0.10.0

12 months ago

0.8.28

1 year ago

0.8.27-patch.21

1 year ago

0.8.27-patch.14

1 year ago

0.8.27-patch.13

1 year ago

0.8.27-patch.16

1 year ago

0.8.27-patch.15

1 year ago

0.8.27-patch.10

1 year ago

0.8.27-patch.6

1 year ago

0.8.27-patch.7

1 year ago

0.8.27-patch.12

1 year ago

0.8.27-patch.8

1 year ago

0.8.27-patch.11

1 year ago

0.8.27-patch.9

1 year ago

0.8.27-patch.20

1 year ago

0.9.1

1 year ago

0.8.27-patch.18

1 year ago

0.8.27-patch.17

1 year ago

0.8.27-patch.19

1 year ago

0.8.27-patch.2

1 year ago

0.8.27-patch.3

1 year ago

0.8.27-patch.4

1 year ago

0.8.27-patch.5

1 year ago

0.8.27-patch.1

1 year ago

0.9.0

1 year ago

0.9.0-next.1

1 year ago

0.8.26-alpha.4

1 year ago

0.8.26-alpha.3

1 year ago

0.8.26-alpha.2

1 year ago

0.8.26

1 year ago

0.8.26-alpha.1

1 year ago

0.8.25

1 year ago

0.8.24

1 year ago

0.8.23

1 year ago

0.8.22

1 year ago

0.8.21

1 year ago

0.8.20

1 year ago

0.8.19

1 year ago

0.8.18

1 year ago

0.8.17

1 year ago

0.8.16

1 year ago

0.8.15

2 years ago