siwe icon indicating copy to clipboard operation
siwe copied to clipboard

Viem support?

Open mlenser opened this issue 1 year ago • 13 comments

Is there any plan to support Viem? It's made by the wagmi team as an alternative to ethers.

mlenser avatar Jul 13 '23 14:07 mlenser

I created a viem version here https://github.com/feelsgoodman-web3/siwveim

conwayconstar avatar Jul 31 '23 22:07 conwayconstar

Hello, we are discussing how to address this, since the library went through an audit it gets a little more complicated to replace such a vital library. Hope you understand!

w4ll3 avatar Aug 01 '23 17:08 w4ll3

in the end, we should 👍 maybe @conwayconstar create a PR?

reslear avatar Dec 25 '23 23:12 reslear

It would be awesome to have viem support or directly replace ethers.

nfts2me avatar Jan 09 '24 11:01 nfts2me

+1 vote to have viem support 🙏🏼

FrancoAguzzi avatar Mar 23 '24 19:03 FrancoAguzzi

So i write small lib, also welcome to testing simplified siwe with Viem 2

https://github.com/reslear/simple-siwe

Comparison

Package Install size Linting Engine Parser
simple-siwe v0.1.4 install size average Viem v2 own (beta)
eip-login v0.1.0 install size average Viem v2 -
siwviem v1.3.0 install size high Viem v1 @spruceid/siwe-parser
siwe v2.3.2 install size high ethersjs @spruceid/siwe-parser
siwe-viem v0.1.0 install size high Viem v2 @spruceid/siwe-parser

reslear avatar Apr 18 '24 03:04 reslear

any update on this?

2facedsquid avatar Apr 23 '24 15:04 2facedsquid

We are not planning to add support for viem but would welcome a contribution. As this library already supports both ethers.js v5 and v6 I believe the "crypto backend" is abstracted enough to make such addition relatively easily, unless I'm missing something.

sbihel avatar Apr 23 '24 16:04 sbihel

Say no more!

conwayconstar avatar Apr 23 '24 17:04 conwayconstar

We are not planning to add support for viem but would welcome a contribution. As this library already supports both ethers.js v5 and v6 I believe the "crypto backend" is abstracted enough to make such addition relatively easily, unless I'm missing something.

I'd say that you are missing what we believe is very important. Quite a lot of websites use Viem/Wagmi. And quite a lot, like us, the only usage of ethers is from this package, leading to an unnecesary increase of package downloading from the users which leads to a worse user experience, specially on smartphones / contries with slow Internet connections.

nfts2me avatar Apr 23 '24 19:04 nfts2me

@nfts2me Yes and no, there's also a deps problem (like parsers based on apg-js), See my Comparison above packages on viem ~2mb.

however siwe 2.8mb + parser 2.66 + ethers 18.8MB = ~23mb

hence the motivation to make https://github.com/reslear/simple-siwe a scaled-down copy without dependencies

reslear avatar Apr 23 '24 20:04 reslear

Good news https://github.com/wevm/viem/pull/2280

reslear avatar May 20 '24 22:05 reslear

we can close the subject @sbihel

reslear avatar Jun 06 '24 14:06 reslear