diff --git a/.changeset/light-donuts-shake.md b/.changeset/light-donuts-shake.md new file mode 100644 index 0000000000..1421cf552c --- /dev/null +++ b/.changeset/light-donuts-shake.md @@ -0,0 +1,8 @@ +--- +"@clerk/clerk-js": patch +"@clerk/elements": patch +"@clerk/clerk-react": patch +"@clerk/types": patch +--- + +Drop support for deprecated Coinbase Web3 provider diff --git a/packages/clerk-js/src/core/clerk.ts b/packages/clerk-js/src/core/clerk.ts index 111d8690d9..0aa484da6a 100644 --- a/packages/clerk-js/src/core/clerk.ts +++ b/packages/clerk-js/src/core/clerk.ts @@ -20,7 +20,6 @@ import type { __experimental_UserVerificationModalProps, __experimental_UserVerificationProps, ActiveSessionResource, - AuthenticateWithCoinbaseParams, AuthenticateWithCoinbaseWalletParams, AuthenticateWithGoogleOneTapParams, AuthenticateWithMetamaskParams, @@ -75,7 +74,6 @@ import { createPageLifecycle, disabledOrganizationsFeature, errorThrower, - generateSignatureWithCoinbase, generateSignatureWithCoinbaseWallet, generateSignatureWithMetamask, getClerkQueryParam, @@ -1406,10 +1404,6 @@ export class Clerk implements ClerkInterface { await this.authenticateWithWeb3({ ...props, strategy: 'web3_metamask_signature' }); }; - public authenticateWithCoinbase = async (props: AuthenticateWithCoinbaseParams = {}): Promise => { - await this.authenticateWithWeb3({ ...props, strategy: 'web3_coinbase_signature' }); - }; - public authenticateWithCoinbaseWallet = async (props: AuthenticateWithCoinbaseWalletParams = {}): Promise => { await this.authenticateWithWeb3({ ...props, strategy: 'web3_coinbase_wallet_signature' }); }; @@ -1427,11 +1421,8 @@ export class Clerk implements ClerkInterface { const provider = strategy.replace('web3_', '').replace('_signature', '') as Web3Provider; const identifier = await getWeb3Identifier({ provider }); const generateSignature = - provider === 'metamask' - ? generateSignatureWithMetamask - : provider === 'coinbase' - ? generateSignatureWithCoinbase - : generateSignatureWithCoinbaseWallet; + provider === 'metamask' ? generateSignatureWithMetamask : generateSignatureWithCoinbaseWallet; + const navigate = (to: string) => customNavigate && typeof customNavigate === 'function' ? customNavigate(to) : this.navigate(to); diff --git a/packages/clerk-js/src/core/resources/SignIn.ts b/packages/clerk-js/src/core/resources/SignIn.ts index eaca28fe96..27bfc60da2 100644 --- a/packages/clerk-js/src/core/resources/SignIn.ts +++ b/packages/clerk-js/src/core/resources/SignIn.ts @@ -33,10 +33,8 @@ import type { } from '@clerk/types'; import { - generateSignatureWithCoinbase, generateSignatureWithCoinbaseWallet, generateSignatureWithMetamask, - getCoinbaseIdentifier, getCoinbaseWalletIdentifier, getMetamaskIdentifier, windowNavigate, @@ -116,9 +114,6 @@ export class SignIn extends BaseResource implements SignInResource { case 'web3_metamask_signature': config = { web3WalletId: factor.web3WalletId } as Web3SignatureConfig; break; - case 'web3_coinbase_signature': - config = { web3WalletId: factor.web3WalletId } as Web3SignatureConfig; - break; case 'web3_coinbase_wallet_signature': config = { web3WalletId: factor.web3WalletId } as Web3SignatureConfig; break; @@ -281,15 +276,6 @@ export class SignIn extends BaseResource implements SignInResource { }); }; - public authenticateWithCoinbase = async (): Promise => { - const identifier = await getCoinbaseIdentifier(); - return this.authenticateWithWeb3({ - identifier, - generateSignature: generateSignatureWithCoinbase, - strategy: 'web3_coinbase_signature', - }); - }; - public authenticateWithCoinbaseWallet = async (): Promise => { const identifier = await getCoinbaseWalletIdentifier(); return this.authenticateWithWeb3({ diff --git a/packages/clerk-js/src/core/resources/SignUp.ts b/packages/clerk-js/src/core/resources/SignUp.ts index c077807842..1700a4aa9f 100644 --- a/packages/clerk-js/src/core/resources/SignUp.ts +++ b/packages/clerk-js/src/core/resources/SignUp.ts @@ -24,10 +24,8 @@ import type { } from '@clerk/types'; import { - generateSignatureWithCoinbase, generateSignatureWithCoinbaseWallet, generateSignatureWithMetamask, - getCoinbaseIdentifier, getCoinbaseWalletIdentifier, getMetamaskIdentifier, windowNavigate, @@ -223,16 +221,6 @@ export class SignUp extends BaseResource implements SignUpResource { }); }; - public authenticateWithCoinbase = async (params?: SignUpAuthenticateWithWeb3Params): Promise => { - const identifier = await getCoinbaseIdentifier(); - return this.authenticateWithWeb3({ - identifier, - generateSignature: generateSignatureWithCoinbase, - unsafeMetadata: params?.unsafeMetadata, - strategy: 'web3_coinbase_signature', - }); - }; - public authenticateWithCoinbaseWallet = async ( params?: SignUpAuthenticateWithWeb3Params, ): Promise => { diff --git a/packages/clerk-js/src/ui/common/constants.ts b/packages/clerk-js/src/ui/common/constants.ts index 9084b4607d..535c3f3e1c 100644 --- a/packages/clerk-js/src/ui/common/constants.ts +++ b/packages/clerk-js/src/ui/common/constants.ts @@ -92,10 +92,6 @@ export const WEB3_PROVIDERS: Web3Providers = Object.freeze({ id: 'metamask', name: 'MetaMask', }, - coinbase: { - id: 'coinbase', - name: 'Coinbase Wallet', - }, coinbase_wallet: { id: 'coinbase_wallet', name: 'Coinbase Wallet', diff --git a/packages/clerk-js/src/utils/injectedWeb3Providers.ts b/packages/clerk-js/src/utils/injectedWeb3Providers.ts index 006d07b320..7ffbb49af8 100644 --- a/packages/clerk-js/src/utils/injectedWeb3Providers.ts +++ b/packages/clerk-js/src/utils/injectedWeb3Providers.ts @@ -1,4 +1,4 @@ -import type { CoinbaseWeb3Provider, MetamaskWeb3Provider } from '@clerk/types'; +import type { MetamaskWeb3Provider } from '@clerk/types'; //https://eips.ethereum.org/EIPS/eip-6963 @@ -27,12 +27,11 @@ interface EIP6963ProviderDetail { } type EIP6963AnnounceProviderEvent = CustomEvent; -type InjectedWeb3Provider = MetamaskWeb3Provider | CoinbaseWeb3Provider; +type InjectedWeb3Provider = MetamaskWeb3Provider; class InjectedWeb3Providers { #providers: EIP6963ProviderDetail[] = []; #providerIdMap: Record = { - coinbase: 'Coinbase Wallet', metamask: 'MetaMask', } as const; static #instance: InjectedWeb3Providers | null = null; diff --git a/packages/clerk-js/src/utils/web3.ts b/packages/clerk-js/src/utils/web3.ts index e1d0587cef..a3cd9626c1 100644 --- a/packages/clerk-js/src/utils/web3.ts +++ b/packages/clerk-js/src/utils/web3.ts @@ -46,10 +46,6 @@ export async function getMetamaskIdentifier(): Promise { return await getWeb3Identifier({ provider: 'metamask' }); } -export async function getCoinbaseIdentifier(): Promise { - return await getWeb3Identifier({ provider: 'coinbase' }); -} - export async function getCoinbaseWalletIdentifier(): Promise { return await getWeb3Identifier({ provider: 'coinbase_wallet' }); } @@ -63,10 +59,6 @@ export async function generateSignatureWithMetamask({ identifier, nonce }: Gener return await generateWeb3Signature({ identifier, nonce, provider: 'metamask' }); } -export async function generateSignatureWithCoinbase({ identifier, nonce }: GenerateSignatureParams): Promise { - return await generateWeb3Signature({ identifier, nonce, provider: 'coinbase' }); -} - export async function generateSignatureWithCoinbaseWallet({ identifier, nonce, diff --git a/packages/elements/src/internals/machines/sign-in/start.machine.ts b/packages/elements/src/internals/machines/sign-in/start.machine.ts index 8fbe74eec8..4c266e6ad3 100644 --- a/packages/elements/src/internals/machines/sign-in/start.machine.ts +++ b/packages/elements/src/internals/machines/sign-in/start.machine.ts @@ -29,9 +29,6 @@ export const SignInStartMachine = setup({ if (strategy === 'web3_metamask_signature') { return parent.getSnapshot().context.clerk.client.signIn.authenticateWithMetamask(); } - if (strategy === 'web3_coinbase_signature') { - return parent.getSnapshot().context.clerk.client.signIn.authenticateWithCoinbase(); - } if (strategy === 'web3_coinbase_wallet_signature') { return parent.getSnapshot().context.clerk.client.signIn.authenticateWithCoinbaseWallet(); } diff --git a/packages/elements/src/internals/machines/sign-in/verification.machine.ts b/packages/elements/src/internals/machines/sign-in/verification.machine.ts index 4e3d8170e5..88198151a8 100644 --- a/packages/elements/src/internals/machines/sign-in/verification.machine.ts +++ b/packages/elements/src/internals/machines/sign-in/verification.machine.ts @@ -448,17 +448,6 @@ export const SignInFirstFactorMachine = SignInVerificationMachine.provide({ break; } - case 'web3_coinbase_signature': { - const signature = fields.get('signature')?.value as string | undefined; - assertIsDefined(signature, 'Web3 Coinbase signature'); - - attemptParams = { - strategy, - signature, - } satisfies Web3Attempt; - - break; - } case 'web3_coinbase_wallet_signature': { const signature = fields.get('signature')?.value as string | undefined; assertIsDefined(signature, 'Web3 Coinbase Wallet signature'); diff --git a/packages/elements/src/internals/machines/sign-up/start.machine.ts b/packages/elements/src/internals/machines/sign-up/start.machine.ts index c4a1b6064e..3bec675f0e 100644 --- a/packages/elements/src/internals/machines/sign-up/start.machine.ts +++ b/packages/elements/src/internals/machines/sign-up/start.machine.ts @@ -39,9 +39,6 @@ export const SignUpStartMachine = setup({ if (strategy === 'web3_metamask_signature') { return parent.getSnapshot().context.clerk.client.signUp.authenticateWithMetamask(); } - if (strategy === 'web3_coinbase_signature') { - return parent.getSnapshot().context.clerk.client.signUp.authenticateWithCoinbase(); - } if (strategy === 'web3_coinbase_wallet_signature') { return parent.getSnapshot().context.clerk.client.signUp.authenticateWithCoinbaseWallet(); } diff --git a/packages/elements/src/react/hooks/use-third-party-provider.hook.ts b/packages/elements/src/react/hooks/use-third-party-provider.hook.ts index 070c244eb4..db199e914f 100644 --- a/packages/elements/src/react/hooks/use-third-party-provider.hook.ts +++ b/packages/elements/src/react/hooks/use-third-party-provider.hook.ts @@ -67,10 +67,6 @@ export const useThirdPartyProvider = < return ref.send({ type: 'AUTHENTICATE.WEB3', strategy: 'web3_metamask_signature' }); } - if (provider === 'coinbase') { - return ref.send({ type: 'AUTHENTICATE.WEB3', strategy: 'web3_coinbase_signature' }); - } - if (provider === 'coinbase_wallet') { return ref.send({ type: 'AUTHENTICATE.WEB3', strategy: 'web3_coinbase_wallet_signature' }); } diff --git a/packages/elements/src/react/utils/map-scope-to-strategy.ts b/packages/elements/src/react/utils/map-scope-to-strategy.ts index 8b85a452de..7ecf03a3bc 100644 --- a/packages/elements/src/react/utils/map-scope-to-strategy.ts +++ b/packages/elements/src/react/utils/map-scope-to-strategy.ts @@ -10,9 +10,6 @@ export function mapScopeToStrategy(scope: T): if (scope === 'provider:metamask') { return 'web3_metamask_signature'; } - if (scope === 'provider:coinbase') { - return 'web3_coinbase_signature'; - } if (scope === 'provider:coinbase_wallet') { return 'web3_coinbase_wallet_signature'; } diff --git a/packages/react/src/isomorphicClerk.ts b/packages/react/src/isomorphicClerk.ts index 79fdc63bca..1980487d81 100644 --- a/packages/react/src/isomorphicClerk.ts +++ b/packages/react/src/isomorphicClerk.ts @@ -6,7 +6,6 @@ import type { __experimental_UserVerificationModalProps, __experimental_UserVerificationProps, ActiveSessionResource, - AuthenticateWithCoinbaseParams, AuthenticateWithCoinbaseWalletParams, AuthenticateWithGoogleOneTapParams, AuthenticateWithMetamaskParams, @@ -96,7 +95,6 @@ type IsomorphicLoadedClerk = Without< | 'handleGoogleOneTapCallback' | 'handleUnauthenticated' | 'authenticateWithMetamask' - | 'authenticateWithCoinbase' | 'authenticateWithCoinbaseWallet' | 'authenticateWithWeb3' | 'authenticateWithGoogleOneTap' @@ -119,7 +117,6 @@ type IsomorphicLoadedClerk = Without< handleUnauthenticated: () => void; // TODO: Align Promise unknown authenticateWithMetamask: (params: AuthenticateWithMetamaskParams) => Promise; - authenticateWithCoinbase: (params: AuthenticateWithCoinbaseParams) => Promise; authenticateWithCoinbaseWallet: (params: AuthenticateWithCoinbaseWalletParams) => Promise; authenticateWithWeb3: (params: ClerkAuthenticateWithWeb3Params) => Promise; authenticateWithGoogleOneTap: ( @@ -1066,15 +1063,6 @@ export class IsomorphicClerk implements IsomorphicLoadedClerk { } }; - authenticateWithCoinbase = async (params: AuthenticateWithCoinbaseParams): Promise => { - const callback = () => this.clerkjs?.authenticateWithCoinbase(params); - if (this.clerkjs && this.#loaded) { - return callback() as Promise; - } else { - this.premountMethodCalls.set('authenticateWithCoinbase', callback); - } - }; - authenticateWithCoinbaseWallet = async (params: AuthenticateWithCoinbaseWalletParams): Promise => { const callback = () => this.clerkjs?.authenticateWithCoinbaseWallet(params); if (this.clerkjs && this.#loaded) { diff --git a/packages/types/src/clerk.ts b/packages/types/src/clerk.ts index d0696ebc3d..bec681a403 100644 --- a/packages/types/src/clerk.ts +++ b/packages/types/src/clerk.ts @@ -528,11 +528,6 @@ export interface Clerk { */ authenticateWithMetamask: (params?: AuthenticateWithMetamaskParams) => Promise; - /** - * Authenticates user using their Coinbase Wallet browser extension - */ - authenticateWithCoinbase: (params?: AuthenticateWithCoinbaseParams) => Promise; - /** * Authenticates user using their Coinbase Smart Wallet and browser extension */ @@ -1267,13 +1262,6 @@ export interface AuthenticateWithMetamaskParams { unsafeMetadata?: SignUpUnsafeMetadata; } -export interface AuthenticateWithCoinbaseParams { - customNavigate?: (to: string) => Promise; - redirectUrl?: string; - signUpContinueUrl?: string; - unsafeMetadata?: SignUpUnsafeMetadata; -} - export interface AuthenticateWithCoinbaseWalletParams { customNavigate?: (to: string) => Promise; redirectUrl?: string; diff --git a/packages/types/src/signIn.ts b/packages/types/src/signIn.ts index 7ed1f904a5..7a3b4dcd16 100644 --- a/packages/types/src/signIn.ts +++ b/packages/types/src/signIn.ts @@ -98,8 +98,6 @@ export interface SignInResource extends ClerkResource { authenticateWithMetamask: () => Promise; - authenticateWithCoinbase: () => Promise; - authenticateWithCoinbaseWallet: () => Promise; authenticateWithPasskey: (params?: AuthenticateWithPasskeyParams) => Promise; diff --git a/packages/types/src/signUp.ts b/packages/types/src/signUp.ts index 84470eb1ee..9f060bae84 100644 --- a/packages/types/src/signUp.ts +++ b/packages/types/src/signUp.ts @@ -93,7 +93,6 @@ export interface SignUpResource extends ClerkResource { ) => Promise; authenticateWithMetamask: (params?: SignUpAuthenticateWithWeb3Params) => Promise; - authenticateWithCoinbase: (params?: SignUpAuthenticateWithWeb3Params) => Promise; authenticateWithCoinbaseWallet: (params?: SignUpAuthenticateWithWeb3Params) => Promise; } diff --git a/packages/types/src/web3.ts b/packages/types/src/web3.ts index 62654037a9..78aede815c 100644 --- a/packages/types/src/web3.ts +++ b/packages/types/src/web3.ts @@ -7,10 +7,9 @@ export interface Web3ProviderData { } export type MetamaskWeb3Provider = 'metamask'; -export type CoinbaseWeb3Provider = 'coinbase'; export type CoinbaseWalletWeb3Provider = 'coinbase_wallet'; -export type Web3Provider = MetamaskWeb3Provider | CoinbaseWeb3Provider | CoinbaseWalletWeb3Provider; +export type Web3Provider = MetamaskWeb3Provider | CoinbaseWalletWeb3Provider; export const WEB3_PROVIDERS: Web3ProviderData[] = [ { @@ -18,11 +17,6 @@ export const WEB3_PROVIDERS: Web3ProviderData[] = [ strategy: 'web3_metamask_signature', name: 'MetaMask', }, - { - provider: 'coinbase', - strategy: 'web3_coinbase_signature', - name: 'Coinbase Wallet', - }, { provider: 'coinbase_wallet', strategy: 'web3_coinbase_wallet_signature',