Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/violet-tables-travel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"thirdweb": patch
---

Updated dependencies
6 changes: 3 additions & 3 deletions apps/dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"ioredis": "^5.4.1",
"ipaddr.js": "^2.2.0",
"lucide-react": "0.468.0",
"next": "15.1.3",
"next": "15.1.4",
"next-plausible": "^3.12.4",
"next-themes": "^0.4.4",
"nextjs-toploader": "^1.6.12",
Expand Down Expand Up @@ -104,8 +104,8 @@
"devDependencies": {
"@chakra-ui/cli": "^2.4.1",
"@chromatic-com/storybook": "3.2.2",
"@next/bundle-analyzer": "15.1.0",
"@next/eslint-plugin-next": "15.1.3",
"@next/bundle-analyzer": "15.1.4",
"@next/eslint-plugin-next": "15.1.4",
"@playwright/test": "1.49.1",
"@storybook/addon-essentials": "8.4.7",
"@storybook/addon-interactions": "8.4.7",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
toTokens,
toUnits,
} from "thirdweb";
import { getContract } from "thirdweb/contract";
import type { OverrideEntry } from "thirdweb/dist/types/utils/extensions/drops/types";
import type { Prettify } from "thirdweb/dist/types/utils/type-utils";
import { getContractMetadata } from "thirdweb/extensions/common";
Expand Down Expand Up @@ -71,7 +72,10 @@ export async function getClaimPhasesInLegacyFormat(
conditions.map(async (condition) => {
const [currencyMetadata, metadata, contractMetadata] = await Promise.all([
await ERC20Ext.getCurrencyMetadata({
contract: { ...options.contract, address: condition.currency },
contract: getContract({
...options.contract,
address: condition.currency,
}),
}).then((m) => ({
...m,
displayValue: toTokens(condition.pricePerToken, m.decimals),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import { ScrollShadow } from "@/components/ui/ScrollShadow/ScrollShadow";
import { Alert, AlertTitle } from "@/components/ui/alert";
import type { Account as TWAccount } from "@3rdweb-sdk/react/hooks/useApi";
import { CircleSlash } from "lucide-react";
import type { ContractOptions } from "thirdweb";
import type { ThirdwebContract } from "thirdweb/contract";
import type { Account } from "thirdweb/wallets";
import { ModuleCard } from "./module-card";
import { useAllModuleContractInfo } from "./moduleContractInfo";

export const InstalledModulesTable = (props: {
contract: ContractOptions;
contract: ThirdwebContract;
installedModules: {
data?: string[];
isPending: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ import { FormProvider, type UseFormReturn, useForm } from "react-hook-form";
import { toast } from "sonner";
import {
type Chain,
type ContractOptions,
type ThirdwebClient,
type ThirdwebContract,
getContract,
sendTransaction,
waitForReceipt,
} from "thirdweb";
Expand Down Expand Up @@ -47,7 +48,7 @@ type FormData = {
};

type InstallModuleFormProps = {
contract: ContractOptions;
contract: ThirdwebContract;
refetchModules: () => void;
account: Account;
installedModules: {
Expand Down Expand Up @@ -180,11 +181,13 @@ export const InstallModuleForm = (props: InstallModuleFormProps) => {

return Promise.all(
moduleAddress.map(async (address) => {
const result = await resolveImplementation({
client,
address,
chain: contract.chain,
});
const result = await resolveImplementation(
getContract({
client,
address,
chain: contract.chain,
}),
);

if (!result) {
throw new Error("Failed to fetch bytecode for module");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { Suspense, useEffect, useState } from "react";
import { ErrorBoundary, type FallbackProps } from "react-error-boundary";
import { toast } from "sonner";
import {
type ContractOptions,
type ThirdwebContract,
getContract,
sendTransaction,
waitForReceipt,
Expand All @@ -35,7 +35,7 @@ import { useModuleContractInfo } from "./moduleContractInfo";

type ModuleCardProps = {
moduleAddress: string;
contract: ContractOptions;
contract: ThirdwebContract;
onRemoveModule: () => void;
ownerAccount: Account | undefined;
allModuleContractInfo: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { CircleAlertIcon, ExternalLinkIcon, InfoIcon } from "lucide-react";
import Link from "next/link";
import { useCallback, useMemo } from "react";
import { FormProvider, type UseFormReturn, useForm } from "react-hook-form";
import { ZERO_ADDRESS } from "thirdweb";
import { ZERO_ADDRESS, getContract } from "thirdweb";
import type { FetchDeployMetadataResult } from "thirdweb/contract";
import {
deployContractfromDeployMetadata,
Expand Down Expand Up @@ -567,11 +567,13 @@ export const CustomContractForm: React.FC<CustomContractFormProps> = ({
const contractAddr = await deployMutation.mutateAsync(formData);

// send verification request - no need to await
verifyContract({
address: contractAddr,
chain: walletChain,
client: thirdwebClient,
});
verifyContract(
getContract({
address: contractAddr,
chain: walletChain,
client: thirdwebClient,
}),
);

trackEvent({
category: "custom-contract",
Expand Down
6 changes: 3 additions & 3 deletions apps/playground-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"fix": "eslint ./src --fix"
},
"dependencies": {
"@abstract-foundation/agw-client": "^1.0.1",
"@abstract-foundation/agw-react": "^1.0.1",
"@abstract-foundation/agw-client": "^1.3.0",
"@abstract-foundation/agw-react": "^1.4.1",
"@radix-ui/react-accordion": "^1.2.2",
"@radix-ui/react-checkbox": "^1.1.3",
"@radix-ui/react-dialog": "1.1.4",
Expand All @@ -34,7 +34,7 @@
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"lucide-react": "0.468.0",
"next": "15.1.3",
"next": "15.1.4",
"next-themes": "^0.4.4",
"prettier": "3.3.3",
"react": "19.0.0",
Expand Down
6 changes: 3 additions & 3 deletions apps/portal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@dirtycajunrice/klee": "^1.0.6",
"@mdx-js/loader": "^2.3.0",
"@mdx-js/react": "^2.3.0",
"@next/mdx": "15.1.0",
"@next/mdx": "15.1.4",
"@radix-ui/react-dialog": "1.1.4",
"@radix-ui/react-dropdown-menu": "^2.1.3",
"@radix-ui/react-select": "^2.1.3",
Expand All @@ -35,7 +35,7 @@
"flexsearch": "^0.7.43",
"github-slugger": "^2.0.0",
"lucide-react": "0.468.0",
"next": "15.1.3",
"next": "15.1.4",
"nextjs-toploader": "^1.6.12",
"node-html-parser": "^6.1.13",
"posthog-js": "1.67.1",
Expand All @@ -53,7 +53,7 @@
"typedoc-better-json": "0.9.4"
},
"devDependencies": {
"@next/eslint-plugin-next": "15.1.3",
"@next/eslint-plugin-next": "15.1.4",
"@types/flexsearch": "^0.7.6",
"@types/mdx": "^2.0.13",
"@types/node": "22.10.2",
Expand Down
4 changes: 2 additions & 2 deletions apps/wallet-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"clsx": "^2.1.1",
"cmdk": "^1.0.4",
"lucide-react": "0.468.0",
"next": "15.1.3",
"next": "15.1.4",
"next-themes": "^0.4.4",
"react": "19.0.0",
"react-dom": "19.0.0",
Expand All @@ -35,7 +35,7 @@
"zod": "3.24.1"
},
"devDependencies": {
"@next/eslint-plugin-next": "15.1.3",
"@next/eslint-plugin-next": "15.1.4",
"@types/node": "22.10.2",
"@types/react": "19.0.2",
"@types/react-dom": "19.0.3",
Expand Down
4 changes: 2 additions & 2 deletions packages/thirdweb/.size-limit.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{
"name": "thirdweb (cjs)",
"path": "./dist/cjs/exports/thirdweb.js",
"limit": "120 kB"
"limit": "121 kB"
},
{
"name": "thirdweb (minimal + tree-shaking)",
Expand All @@ -19,7 +19,7 @@
{
"name": "thirdweb/chains (tree-shaking)",
"path": "./dist/esm/exports/chains.js",
"limit": "600 B",
"limit": "650 B",
"import": "{ ethereum }"
},
{
Expand Down
78 changes: 20 additions & 58 deletions packages/thirdweb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,63 +132,25 @@
},
"typesVersions": {
"*": {
"adapters/*": [
"./dist/types/exports/adapters/*.d.ts"
],
"auth": [
"./dist/types/exports/auth.d.ts"
],
"chains": [
"./dist/types/exports/chains.d.ts"
],
"contract": [
"./dist/types/exports/contract.d.ts"
],
"deploys": [
"./dist/types/exports/deploys.d.ts"
],
"event": [
"./dist/types/exports/event.d.ts"
],
"extensions/*": [
"./dist/types/exports/extensions/*.d.ts"
],
"pay": [
"./dist/types/exports/pay.d.ts"
],
"react": [
"./dist/types/exports/react.d.ts"
],
"react-native": [
"./dist/types/exports/react-native.d.ts"
],
"rpc": [
"./dist/types/exports/rpc.d.ts"
],
"storage": [
"./dist/types/exports/storage.d.ts"
],
"transaction": [
"./dist/types/exports/transaction.d.ts"
],
"utils": [
"./dist/types/exports/utils.d.ts"
],
"wallets": [
"./dist/types/exports/wallets.d.ts"
],
"wallets/*": [
"./dist/types/exports/wallets/*.d.ts"
],
"modules": [
"./dist/types/exports/modules.d.ts"
],
"social": [
"./dist/types/exports/social.d.ts"
],
"ai": [
"./dist/types/exports/ai.d.ts"
]
"adapters/*": ["./dist/types/exports/adapters/*.d.ts"],
"auth": ["./dist/types/exports/auth.d.ts"],
"chains": ["./dist/types/exports/chains.d.ts"],
"contract": ["./dist/types/exports/contract.d.ts"],
"deploys": ["./dist/types/exports/deploys.d.ts"],
"event": ["./dist/types/exports/event.d.ts"],
"extensions/*": ["./dist/types/exports/extensions/*.d.ts"],
"pay": ["./dist/types/exports/pay.d.ts"],
"react": ["./dist/types/exports/react.d.ts"],
"react-native": ["./dist/types/exports/react-native.d.ts"],
"rpc": ["./dist/types/exports/rpc.d.ts"],
"storage": ["./dist/types/exports/storage.d.ts"],
"transaction": ["./dist/types/exports/transaction.d.ts"],
"utils": ["./dist/types/exports/utils.d.ts"],
"wallets": ["./dist/types/exports/wallets.d.ts"],
"wallets/*": ["./dist/types/exports/wallets/*.d.ts"],
"modules": ["./dist/types/exports/modules.d.ts"],
"social": ["./dist/types/exports/social.d.ts"],
"ai": ["./dist/types/exports/ai.d.ts"]
}
},
"browser": {
Expand Down Expand Up @@ -228,7 +190,7 @@
"mipd": "0.0.7",
"ox": "0.4.2",
"uqr": "0.1.2",
"viem": "2.21.55"
"viem": "2.22.15"
},
"peerDependencies": {
"@aws-sdk/client-lambda": "^3",
Expand Down
5 changes: 3 additions & 2 deletions packages/thirdweb/src/adapters/viem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { getRpcClient } from "../rpc/rpc.js";
import { estimateGas } from "../transaction/actions/estimate-gas.js";
import { sendTransaction } from "../transaction/actions/send-transaction.js";
import { prepareTransaction } from "../transaction/prepare-transaction.js";
import { getAddress } from "../utils/address.js";
import type { Account } from "../wallets/interfaces/wallet.js";

/**
Expand Down Expand Up @@ -201,7 +202,7 @@ export async function toViemContract<const TAbi extends Abi>(options: {
thirdwebContract: ThirdwebContract<TAbi>;
}): Promise<GetContractReturnType<TAbi>> {
return {
address: options.thirdwebContract.address,
address: getAddress(options.thirdwebContract.address),
abi: await resolveContractAbi(options.thirdwebContract),
};
}
Expand Down Expand Up @@ -310,7 +311,7 @@ function toViemWalletClient(options: ToViemWalletClientOptions): WalletClient {

return createWalletClient({
transport,
account: account.address,
account: getAddress(account.address),
chain: viemChain,
key: "thirdweb-wallet",
});
Expand Down
6 changes: 4 additions & 2 deletions packages/thirdweb/src/auth/verify-hash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { type ThirdwebContract, getContract } from "../contract/contract.js";
import { isValidSignature } from "../extensions/erc1271/__generated__/isValidSignature/read/isValidSignature.js";
import { eth_call } from "../rpc/actions/eth_call.js";
import { getRpcClient } from "../rpc/rpc.js";
import type { Address } from "../utils/address.js";
import { isZkSyncChain } from "../utils/any-evm/zksync/isZkSyncChain.js";
import { isContractDeployed } from "../utils/bytecode/is-contract-deployed.js";
import { fromBytes } from "../utils/encoding/from-bytes.js";
Expand All @@ -27,7 +28,8 @@ export type VerifyHashParams = {
};
};

const ZKSYNC_VALIDATOR_ADDRESS = "0xfB688330379976DA81eB64Fe4BF50d7401763B9C";
const ZKSYNC_VALIDATOR_ADDRESS: Address =
"0xfB688330379976DA81eB64Fe4BF50d7401763B9C";

/**
* @description Verify that an address created the provided signature for a given hash using [ERC-6492](https://eips.ethereum.org/EIPS/eip-6492). This function is interoperable with all wallet types, including EOAs.
Expand Down Expand Up @@ -120,7 +122,7 @@ export async function verifyHash({
})();

let verificationData: {
to?: string;
to?: Address;
data: Hex;
};

Expand Down
16 changes: 16 additions & 0 deletions packages/thirdweb/src/chains/chain-definitions/abstract.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { defineChain } from "../utils.js";

/**
* @chain
*/
export const abstract = /* @__PURE__ */ defineChain({
id: 2741,
name: "Abstract",
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
blockExplorers: [
{
name: "Abstract Block Explorer",
url: "https://explorer.abs.xyz",
},
],
});
Loading
Loading