Skip to content

Commit 04a98bd

Browse files
committed
merge main
2 parents eb1a069 + 86f205e commit 04a98bd

File tree

69 files changed

+700
-473
lines changed

Some content is hidden

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

69 files changed

+700
-473
lines changed

.changeset/friendly-lamps-think.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/short-carrots-smile.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

apps/dashboard/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"ioredis": "^5.4.1",
6969
"ipaddr.js": "^2.2.0",
7070
"lucide-react": "0.468.0",
71-
"next": "15.1.3",
71+
"next": "15.1.4",
7272
"next-plausible": "^3.12.4",
7373
"next-themes": "^0.4.4",
7474
"nextjs-toploader": "^1.6.12",
@@ -104,8 +104,8 @@
104104
"devDependencies": {
105105
"@chakra-ui/cli": "^2.4.1",
106106
"@chromatic-com/storybook": "3.2.2",
107-
"@next/bundle-analyzer": "15.1.0",
108-
"@next/eslint-plugin-next": "15.1.3",
107+
"@next/bundle-analyzer": "15.1.4",
108+
"@next/eslint-plugin-next": "15.1.4",
109109
"@playwright/test": "1.49.1",
110110
"@storybook/addon-essentials": "8.4.7",
111111
"@storybook/addon-interactions": "8.4.7",

apps/dashboard/src/@/components/blocks/NetworkSelectors.tsx

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ type Option = { label: string; value: string };
1616
export function MultiNetworkSelector(props: {
1717
selectedChainIds: number[];
1818
onChange: (chainIds: number[]) => void;
19+
disableChainId?: boolean;
20+
className?: string;
1921
}) {
2022
const { allChains, idToChain } = useAllChainsData();
2123

@@ -53,16 +55,24 @@ export function MultiNetworkSelector(props: {
5355
return (
5456
<div className="flex justify-between gap-4">
5557
<span className="flex grow gap-2 truncate text-left">
58+
<ChainIcon
59+
className="size-5"
60+
ipfsSrc={chain.icon?.url}
61+
loading="lazy"
62+
/>
5663
{cleanChainName(chain.name)}
5764
</span>
58-
<Badge variant="outline" className="gap-2">
59-
<span className="text-muted-foreground">Chain ID</span>
60-
{chain.chainId}
61-
</Badge>
65+
66+
{!props.disableChainId && (
67+
<Badge variant="outline" className="gap-2">
68+
<span className="text-muted-foreground">Chain ID</span>
69+
{chain.chainId}
70+
</Badge>
71+
)}
6272
</div>
6373
);
6474
},
65-
[idToChain],
75+
[idToChain, props.disableChainId],
6676
);
6777

6878
return (
@@ -79,6 +89,7 @@ export function MultiNetworkSelector(props: {
7989
disabled={allChains.length === 0}
8090
overrideSearchFn={searchFn}
8191
renderOption={renderOption}
92+
className={props.className}
8293
/>
8394
);
8495
}
@@ -143,7 +154,7 @@ export function SingleNetworkSelector(props: {
143154
ipfsSrc={chain.icon?.url}
144155
loading="lazy"
145156
/>
146-
{chain.name}
157+
{cleanChainName(chain.name)}
147158
</span>
148159

149160
{!props.disableChainId && (
@@ -168,6 +179,7 @@ export function SingleNetworkSelector(props: {
168179
onValueChange={(chainId) => {
169180
props.onChange(Number(chainId));
170181
}}
182+
closeOnSelect={true}
171183
placeholder={isLoadingChains ? "Loading Chains..." : "Select Chain"}
172184
overrideSearchFn={searchFn}
173185
renderOption={renderOption}

apps/dashboard/src/@/components/blocks/select-with-search.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ interface SelectWithSearchProps
3333
popoverContentClassName?: string;
3434
side?: "left" | "right" | "top" | "bottom";
3535
align?: "center" | "start" | "end";
36+
closeOnSelect?: boolean;
3637
}
3738

3839
export const SelectWithSearch = React.forwardRef<
@@ -50,6 +51,7 @@ export const SelectWithSearch = React.forwardRef<
5051
overrideSearchFn,
5152
popoverContentClassName,
5253
searchPlaceholder,
54+
closeOnSelect,
5355
...props
5456
},
5557
ref,
@@ -177,7 +179,12 @@ export const SelectWithSearch = React.forwardRef<
177179
key={option.value}
178180
role="option"
179181
aria-selected={isSelected}
180-
onClick={() => onValueChange(option.value)}
182+
onClick={() => {
183+
onValueChange(option.value);
184+
if (closeOnSelect) {
185+
setIsPopoverOpen(false);
186+
}
187+
}}
181188
variant="ghost"
182189
className="flex w-full cursor-pointer justify-start gap-3 rounded-sm px-3 py-2 text-left"
183190
ref={

apps/dashboard/src/@3rdweb-sdk/react/hooks/useEngine.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
import type { ResultItem } from "app/team/[team_slug]/(team)/~/engine/(instance)/[engineId]/metrics/components/StatusCodes";
1111
import type { EngineBackendWalletType } from "lib/engine";
1212
import { useState } from "react";
13-
import { useActiveAccount, useActiveWalletChain } from "thirdweb/react";
13+
import { useActiveAccount } from "thirdweb/react";
1414
import invariant from "tiny-invariant";
1515
import type { EngineStatus } from "../../../app/team/[team_slug]/(team)/~/engine/(instance)/[engineId]/overview/components/transactions-table";
1616
import { engineKeys } from "../cache-keys";
@@ -469,12 +469,12 @@ export function useEngineBackendWalletBalance(params: {
469469
instanceUrl: string;
470470
address: string;
471471
authToken: string;
472+
chainId: number;
472473
}) {
473-
const { instanceUrl, address, authToken } = params;
474-
const chainId = useActiveWalletChain()?.id;
474+
const { instanceUrl, address, authToken, chainId } = params;
475475

476476
return useQuery({
477-
queryKey: engineKeys.backendWalletBalance(address, chainId || 1),
477+
queryKey: engineKeys.backendWalletBalance(address, chainId),
478478
queryFn: async () => {
479479
invariant(chainId, "chainId is required");
480480

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/_components/claim-conditions/claim-conditions-form/hooks.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
toTokens,
55
toUnits,
66
} from "thirdweb";
7+
import { getContract } from "thirdweb/contract";
78
import type { OverrideEntry } from "thirdweb/dist/types/utils/extensions/drops/types";
89
import type { Prettify } from "thirdweb/dist/types/utils/type-utils";
910
import { getContractMetadata } from "thirdweb/extensions/common";
@@ -71,7 +72,10 @@ export async function getClaimPhasesInLegacyFormat(
7172
conditions.map(async (condition) => {
7273
const [currencyMetadata, metadata, contractMetadata] = await Promise.all([
7374
await ERC20Ext.getCurrencyMetadata({
74-
contract: { ...options.contract, address: condition.currency },
75+
contract: getContract({
76+
...options.contract,
77+
address: condition.currency,
78+
}),
7579
}).then((m) => ({
7680
...m,
7781
displayValue: toTokens(condition.pricePerToken, m.decimals),

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/embed/embed-setup.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ export const EmbedSetup: React.FC<EmbedSetupProps> = ({
323323
apiKeys.refetch();
324324
}}
325325
enableNebulaServiceByDefault={false}
326+
teamSlug={undefined}
326327
/>
327328

328329
<Alert variant="warning">

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/modules/components/InstalledModulesTable.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import { ScrollShadow } from "@/components/ui/ScrollShadow/ScrollShadow";
44
import { Alert, AlertTitle } from "@/components/ui/alert";
55
import type { Account as TWAccount } from "@3rdweb-sdk/react/hooks/useApi";
66
import { CircleSlash } from "lucide-react";
7-
import type { ContractOptions } from "thirdweb";
7+
import type { ThirdwebContract } from "thirdweb/contract";
88
import type { Account } from "thirdweb/wallets";
99
import { ModuleCard } from "./module-card";
1010
import { useAllModuleContractInfo } from "./moduleContractInfo";
1111

1212
export const InstalledModulesTable = (props: {
13-
contract: ContractOptions;
13+
contract: ThirdwebContract;
1414
installedModules: {
1515
data?: string[];
1616
isPending: boolean;

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/modules/components/ModuleForm.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ import { FormProvider, type UseFormReturn, useForm } from "react-hook-form";
1515
import { toast } from "sonner";
1616
import {
1717
type Chain,
18-
type ContractOptions,
1918
type ThirdwebClient,
19+
type ThirdwebContract,
20+
getContract,
2021
sendTransaction,
2122
waitForReceipt,
2223
} from "thirdweb";
@@ -47,7 +48,7 @@ type FormData = {
4748
};
4849

4950
type InstallModuleFormProps = {
50-
contract: ContractOptions;
51+
contract: ThirdwebContract;
5152
refetchModules: () => void;
5253
account: Account;
5354
installedModules: {
@@ -180,11 +181,13 @@ export const InstallModuleForm = (props: InstallModuleFormProps) => {
180181

181182
return Promise.all(
182183
moduleAddress.map(async (address) => {
183-
const result = await resolveImplementation({
184-
client,
185-
address,
186-
chain: contract.chain,
187-
});
184+
const result = await resolveImplementation(
185+
getContract({
186+
client,
187+
address,
188+
chain: contract.chain,
189+
}),
190+
);
188191

189192
if (!result) {
190193
throw new Error("Failed to fetch bytecode for module");

0 commit comments

Comments
 (0)