-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(auth): set defaults for eip4361 providers
- Loading branch information
1 parent
952d131
commit 1f19192
Showing
5 changed files
with
35 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
import {ethers} from "ethers"; | ||
|
||
import { EIP4361AuthProvider } from './providers/eip4361'; | ||
import { EIP4361AuthProvider, EIP4361AuthProviderParams } from './providers/eip4361'; | ||
import { EIP712AuthProvider } from './providers/eip712'; | ||
import { AuthProviders, EIP4361_AUTH_METHOD, EIP712_AUTH_METHOD } from './types'; | ||
|
||
export const makeAuthProviders = (provider: ethers.providers.Provider, signer?: ethers.Signer): AuthProviders => { | ||
export const makeAuthProviders = ( | ||
provider: ethers.providers.Provider, | ||
signer?: ethers.Signer, | ||
siweDefaultParams?: EIP4361AuthProviderParams | ||
): AuthProviders => { | ||
return { | ||
[EIP712_AUTH_METHOD]: signer ? new EIP712AuthProvider(provider, signer) : undefined, | ||
[EIP4361_AUTH_METHOD]: signer ? new EIP4361AuthProvider(provider, signer) : undefined | ||
[EIP4361_AUTH_METHOD]: signer ? new EIP4361AuthProvider(provider, signer, siweDefaultParams) : undefined | ||
} as AuthProviders; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters