Skip to content

Commit

Permalink
feat(clerk-js,types): Introduce Coinbase Wallet Web3 provider types (#…
Browse files Browse the repository at this point in the history
…4028)

Co-authored-by: Lennart <lekoarts@gmail.com>
  • Loading branch information
chanioxaris and LekoArts authored Aug 27, 2024
1 parent c3adac0 commit 0158c77
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/cuddly-mails-lie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@clerk/clerk-js": patch
"@clerk/types": patch
---

Introduce Coinbase Wallet Web3 provider types
4 changes: 4 additions & 0 deletions packages/clerk-js/src/ui/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ export const WEB3_PROVIDERS: Web3Providers = Object.freeze({
id: 'metamask',
name: 'MetaMask',
},
coinbase: {
id: 'coinbase',
name: 'Coinbase Wallet',
},
});

export function getWeb3ProviderData(name: Web3Provider): Web3ProviderData | undefined | null {
Expand Down
8 changes: 7 additions & 1 deletion packages/types/src/web3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,21 @@ export interface Web3ProviderData {
}

export type MetamaskWeb3Provider = 'metamask';
export type CoinbaseWeb3Provider = 'coinbase';

export type Web3Provider = MetamaskWeb3Provider;
export type Web3Provider = MetamaskWeb3Provider | CoinbaseWeb3Provider;

export const WEB3_PROVIDERS: Web3ProviderData[] = [
{
provider: 'metamask',
strategy: 'web3_metamask_signature',
name: 'MetaMask',
},
{
provider: 'coinbase',
strategy: 'web3_coinbase_signature',
name: 'Coinbase Wallet',
},
];

interface getWeb3ProviderDataProps {
Expand Down

0 comments on commit 0158c77

Please sign in to comment.