Skip to content

Commit fe53dfa

Browse files
Update dependencies and clean unused (#2328)
* Remove kyb/kyc, update stripe * Knip cleanup, improve stripe init * Update dependencies * Remove unused campaign * eslint * unused * Update dependencies * Missing a focuslock here * Add a spinner to wait for the page to reload * Update stripe again * format * Update dependencies again * update * Update lock * Nightly * Recover file * format * update * Run install
1 parent 1219561 commit fe53dfa

File tree

113 files changed

+1639
-5472
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+1639
-5472
lines changed

.eslintrc.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ module.exports = {
55
"plugin:import/typescript",
66
"plugin:prettier/recommended",
77
"plugin:react/recommended",
8-
"plugin:@next/next/recommended",
9-
"next/core-web-vitals",
8+
"plugin:@next/next/recommended"
109
],
1110
rules: {
1211
// typescript
@@ -153,7 +152,7 @@ module.exports = {
153152
],
154153
},
155154
parser: "@typescript-eslint/parser",
156-
plugins: ["@typescript-eslint", "import", "inclusive-language", "react"],
155+
plugins: ["@typescript-eslint", "import", "inclusive-language", "react", "react-hooks"],
157156
parserOptions: {
158157
ecmaVersion: 2019,
159158
ecmaFeatures: {

@3rdweb-sdk/react/hooks/useApi.ts

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ interface WalletStats {
232232
}[];
233233
}
234234

235-
export interface BillingProduct {
235+
interface BillingProduct {
236236
name: string;
237237
id: string;
238238
}
@@ -392,41 +392,6 @@ export function useUpdateAccount() {
392392
);
393393
}
394394

395-
export function useGrantCredits() {
396-
const { user } = useLoggedInUser();
397-
const queryClient = useQueryClient();
398-
399-
return useMutationWithInvalidate(
400-
async (input: { customPromoType: string }) => {
401-
invariant(user?.address, "walletAddress is required");
402-
403-
const res = await fetch(`${THIRDWEB_API_HOST}/v1/account/grantCredits`, {
404-
method: "POST",
405-
credentials: "include",
406-
headers: {
407-
"Content-Type": "application/json",
408-
},
409-
body: JSON.stringify(input),
410-
});
411-
412-
const json = await res.json();
413-
414-
if (json.error) {
415-
throw new Error(json.error.message);
416-
}
417-
418-
return json.data.credits as BillingCredit[];
419-
},
420-
{
421-
onSuccess: () => {
422-
return queryClient.invalidateQueries(
423-
accountKeys.credits(user?.address as string),
424-
);
425-
},
426-
},
427-
);
428-
}
429-
430395
export function useUpdateAccountPlan() {
431396
const { user } = useLoggedInUser();
432397
const queryClient = useQueryClient();

@3rdweb-sdk/react/hooks/useEngine.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export function useEngineLatestVersion() {
118118
});
119119
}
120120

121-
export interface UpdateVersionInput {
121+
interface UpdateVersionInput {
122122
engineId: string;
123123
}
124124

@3rdweb-sdk/react/hooks/usePayments.ts

Lines changed: 0 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -486,52 +486,6 @@ export function usePaymentsRemoveCheckout(contractAddress: string) {
486486
);
487487
}
488488

489-
export function usePaymentsUploadKybFiles() {
490-
const { token } = useApiAuthToken();
491-
const fetchFromPaymentsAPI = usePaymentsApi();
492-
const queryClient = useQueryClient();
493-
const address = useAddress();
494-
495-
return useMutationWithInvalidate(
496-
async (input: { files: File[] }) => {
497-
invariant(token, "No token found");
498-
invariant(address, "No wallet address found");
499-
invariant(input.files.length > 0, "No files found");
500-
501-
for (const file of input.files) {
502-
const url = await fetchFromPaymentsAPI(
503-
token,
504-
"POST",
505-
"storage/generate-signed-url",
506-
{ fileName: file.name, fileType: file.type },
507-
{ isGenerateSignedUrl: true },
508-
);
509-
510-
if (!url) {
511-
throw new Error("Unable to generate presigned URL");
512-
}
513-
514-
const res = await fetch(url, {
515-
method: "PUT",
516-
headers: { "Content-Type": file.type },
517-
body: file,
518-
});
519-
520-
if (res.status !== 200) {
521-
throw new Error(`Unexpected status ${res.status}`);
522-
}
523-
}
524-
},
525-
{
526-
onSuccess: () => {
527-
return queryClient.invalidateQueries(
528-
paymentsKeys.kybStatus(address as string),
529-
);
530-
},
531-
},
532-
);
533-
}
534-
535489
const getBlobFromBase64Image = async (strBase64: string): Promise<Blob> => {
536490
if (!strBase64.startsWith("data:image/")) {
537491
return Promise.reject("Invalid base64 image format");
@@ -658,76 +612,6 @@ export function usePaymentsUpdateSellerById(id: string) {
658612
);
659613
}
660614

661-
export function usePaymentsKybStatus() {
662-
const { token } = useApiAuthToken();
663-
const fetchFromPaymentsAPI = usePaymentsApi();
664-
const address = useAddress();
665-
666-
return useQuery(
667-
paymentsKeys.kybStatus(address as string),
668-
async () => {
669-
invariant(token, "No token found");
670-
invariant(address, "No wallet address found");
671-
return fetchFromPaymentsAPI(
672-
token,
673-
"GET",
674-
"seller-verification/seller-document-count",
675-
undefined,
676-
{ isSellerDocumentCount: true },
677-
);
678-
},
679-
{ enabled: !!address && !!token },
680-
);
681-
}
682-
683-
export function usePaymentsGetVerificationSession(sellerId: string) {
684-
const { token } = useApiAuthToken();
685-
const fetchFromPaymentsAPI = usePaymentsApi();
686-
const address = useAddress();
687-
688-
return useQuery(
689-
paymentsKeys.verificationSession(address as string),
690-
async () => {
691-
invariant(token, "No token found");
692-
invariant(address, "No wallet address found");
693-
invariant(sellerId, "No sellerId found");
694-
return fetchFromPaymentsAPI(
695-
token,
696-
"POST",
697-
"seller-verification/create-verification-session",
698-
{ sellerId },
699-
{ isCreateVerificationSession: true },
700-
);
701-
},
702-
{ enabled: !!address && !!sellerId && !!token },
703-
);
704-
}
705-
706-
export function usePaymentsKycStatus(sessionId: string) {
707-
const { token } = useApiAuthToken();
708-
const fetchFromPaymentsAPI = usePaymentsApi();
709-
const address = useAddress();
710-
711-
return useQuery(
712-
paymentsKeys.kycStatus(address as string),
713-
async () => {
714-
invariant(token, "No token found");
715-
invariant(address, "No wallet address found");
716-
invariant(sessionId, "No sessionId found");
717-
return fetchFromPaymentsAPI(
718-
token,
719-
"POST",
720-
"seller-verification/status",
721-
{
722-
verificationSessionId: sessionId,
723-
},
724-
{ isSellerVerificationStatus: true },
725-
);
726-
},
727-
{ enabled: !!address && !!token },
728-
);
729-
}
730-
731615
export function usePaymentsEnabledContracts() {
732616
const address = useAddress();
733617
const { paymentsSellerId } = useApiAuthToken();

@3rdweb-sdk/react/hooks/useRegistry.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { getContract } from "thirdweb";
1414
import { defineDashboardChain, thirdwebClient } from "lib/thirdweb-client";
1515
import { BasicContract } from "contract-ui/types/types";
1616

17-
export const MULTICHAIN_REGISTRY_ADDRESS =
17+
const MULTICHAIN_REGISTRY_ADDRESS =
1818
"0xcdAD8FA86e18538aC207872E8ff3536501431B73";
1919

2020
const registryContract = getContract({
@@ -23,7 +23,7 @@ const registryContract = getContract({
2323
chain: defineDashboardChain(polygon.id),
2424
});
2525

26-
export function useMultiChainRegContractList(walletAddress?: string) {
26+
function useMultiChainRegContractList(walletAddress?: string) {
2727
return useQuery(
2828
["dashboard-registry", walletAddress, "multichain-contract-list"],
2929
async () => {

0 commit comments

Comments
 (0)