@@ -30,7 +30,7 @@ export const accountPlan = {
3030} as const ;
3131
3232type AccountStatus = ( typeof accountStatus ) [ keyof typeof accountStatus ] ;
33- export type AccountPlan = ( typeof accountPlan ) [ keyof typeof accountPlan ] ;
33+ type AccountPlan = ( typeof accountPlan ) [ keyof typeof accountPlan ] ;
3434
3535export type AuthorizedWallet = {
3636 id : string ;
@@ -498,51 +498,6 @@ export function useUpdateAccount() {
498498 } ) ;
499499}
500500
501- export function useUpdateAccountPlan ( waitForWebhook ?: boolean ) {
502- const { user } = useLoggedInUser ( ) ;
503- const queryClient = useQueryClient ( ) ;
504-
505- return useMutation ( {
506- mutationFn : async ( input : { plan : string ; feedback ?: string } ) => {
507- invariant ( user ?. address , "walletAddress is required" ) ;
508-
509- const res = await fetch ( `${ THIRDWEB_API_HOST } /v1/account/plan` , {
510- method : "PUT" ,
511-
512- headers : {
513- "Content-Type" : "application/json" ,
514- } ,
515- body : JSON . stringify ( input ) ,
516- } ) ;
517-
518- const json = await res . json ( ) ;
519-
520- if ( json . error ) {
521- throw new Error ( json . error . message ) ;
522- }
523-
524- // Wait for account plan to update via stripe webhook
525- // TODO: find a better way to notify the client that the plan has been updated
526- if ( waitForWebhook ) {
527- await new Promise ( ( resolve ) => setTimeout ( resolve , 1000 * 10 ) ) ;
528- }
529-
530- return json . data ;
531- } ,
532- onSuccess : async ( ) => {
533- return Promise . all ( [
534- // invalidate usage data as limits are different
535- queryClient . invalidateQueries ( {
536- queryKey : accountKeys . me ( user ?. address as string ) ,
537- } ) ,
538- queryClient . invalidateQueries ( {
539- queryKey : accountKeys . usage ( user ?. address as string ) ,
540- } ) ,
541- ] ) ;
542- } ,
543- } ) ;
544- }
545-
546501export function useUpdateNotifications ( ) {
547502 const { user } = useLoggedInUser ( ) ;
548503 const queryClient = useQueryClient ( ) ;
@@ -681,40 +636,6 @@ export function useResendEmailConfirmation() {
681636 } ) ;
682637}
683638
684- export function useCreatePaymentMethod ( ) {
685- const { user } = useLoggedInUser ( ) ;
686- const queryClient = useQueryClient ( ) ;
687-
688- return useMutation ( {
689- mutationFn : async ( paymentMethodId : string ) => {
690- invariant ( user ?. address , "walletAddress is required" ) ;
691-
692- const res = await fetch ( `${ THIRDWEB_API_HOST } /v1/account/paymentMethod` , {
693- method : "POST" ,
694-
695- headers : {
696- "Content-Type" : "application/json" ,
697- } ,
698- body : JSON . stringify ( {
699- paymentMethodId,
700- } ) ,
701- } ) ;
702- const json = await res . json ( ) ;
703-
704- if ( json . error ) {
705- throw new Error ( json . error . message ) ;
706- }
707-
708- return json . data ;
709- } ,
710- onSuccess : ( ) => {
711- return queryClient . invalidateQueries ( {
712- queryKey : accountKeys . me ( user ?. address as string ) ,
713- } ) ;
714- } ,
715- } ) ;
716- }
717-
718639export function useApiKeys ( ) {
719640 const { user, isLoggedIn } = useLoggedInUser ( ) ;
720641 return useQuery ( {
0 commit comments