File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { StatusCodes } from "http-status-codes";
33import { createCustomError } from "../../../server/middleware/error" ;
44import { abiSchema } from "../../../server/schemas/contract" ;
55import { getSdk } from "./get-sdk" ;
6+ import { ThirdwebSDK } from "@thirdweb-dev/sdk" ;
67
78const abiArraySchema = Type . Array ( abiSchema ) ;
89
@@ -21,7 +22,17 @@ export const getContract = async ({
2122 accountAddress,
2223 abi,
2324} : GetContractParams ) => {
24- const sdk = await getSdk ( { chainId, walletAddress, accountAddress } ) ;
25+ let sdk : ThirdwebSDK ;
26+
27+ try {
28+ sdk = await getSdk ( { chainId, walletAddress, accountAddress } ) ;
29+ } catch ( e ) {
30+ throw createCustomError (
31+ `Could not get SDK: ${ e } ` ,
32+ StatusCodes . BAD_REQUEST ,
33+ "INVALID_CHAIN_OR_WALLET_TYPE_FOR_ROUTE" ,
34+ ) ;
35+ }
2536
2637 try {
2738 if ( abi ) {
You can’t perform that action at this time.
0 commit comments