siwe icon indicating copy to clipboard operation
siwe copied to clipboard

Change Provider configuration to allow plain RPC URL property

Open MidnightLightning opened this issue 2 years ago • 0 comments

The SiweMessage.verify function takes an optional second parameter of additional options, which includes a provider property to include an EthersJS Provider. Additionally, the SiweMessage.validate function takes an EthersJS Provider as a second property.

If a project wishes to supply those parameters, they must include EthersJS as a dependency in their project. In all other use cases, the implementing application doesn't need to know about EthersJS at all. (somewhat related to #151)

I believe the key piece of data the SIWE needs from the client is what RPC endpoint to call in order to make on-chain requests. Can those parameters be changed to be string inputs of an RPC URL rather than full Provider objects? Or allow the provider property to be sent as a string or a Provider, so implementing clients can choose?

MidnightLightning avatar Oct 06 '23 05:10 MidnightLightning