Skip to content

Commit 6180116

Browse files
authored
Merge branch 'main' into yash/deploy-config-updates-2
2 parents 8b74c20 + 9fcf1b8 commit 6180116

File tree

8 files changed

+96
-57
lines changed

8 files changed

+96
-57
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,6 @@ export type RotateSecretKeyAPIReturnType = {
371371
data: {
372372
secret: string;
373373
secretMasked: string;
374-
secretHash: string;
375374
};
376375
};
377376

apps/dashboard/src/app/login/LoginPage.tsx

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const LazyOnboardingUI = lazy(
2424
() => import("./onboarding/on-boarding-ui.client"),
2525
);
2626

27-
const wallets = [
27+
const loginOptions = [
2828
inAppWallet({
2929
auth: {
3030
options: [
@@ -45,9 +45,27 @@ const wallets = [
4545
createWallet("io.zerion.wallet"),
4646
];
4747

48+
const inAppWalletLoginOptions = [
49+
inAppWallet({
50+
auth: {
51+
options: [
52+
"google",
53+
"apple",
54+
"facebook",
55+
"github",
56+
"email",
57+
"phone",
58+
"passkey",
59+
"wallet",
60+
],
61+
},
62+
}),
63+
];
64+
4865
export function LoginAndOnboardingPage(props: {
4966
account: Account | undefined;
5067
redirectPath: string;
68+
loginWithInAppWallet: boolean;
5169
}) {
5270
return (
5371
<div className="relative flex min-h-dvh flex-col overflow-hidden bg-background">
@@ -91,6 +109,7 @@ export function LoginAndOnboardingPage(props: {
91109
<LoginAndOnboardingPageContent
92110
account={props.account}
93111
redirectPath={props.redirectPath}
112+
loginWithInAppWallet={props.loginWithInAppWallet}
94113
/>
95114
</div>
96115
);
@@ -99,6 +118,7 @@ export function LoginAndOnboardingPage(props: {
99118
export function LoginAndOnboardingPageContent(props: {
100119
account: Account | undefined;
101120
redirectPath: string;
121+
loginWithInAppWallet: boolean;
102122
}) {
103123
return (
104124
<div className="relative flex grow flex-col">
@@ -114,6 +134,7 @@ export function LoginAndOnboardingPageContent(props: {
114134
<PageContent
115135
redirectPath={props.redirectPath}
116136
account={props.account}
137+
loginWithInAppWallet={props.loginWithInAppWallet}
117138
/>
118139
</ClientOnly>
119140
</main>
@@ -139,6 +160,7 @@ function LoadingCard() {
139160
function PageContent(props: {
140161
redirectPath: string;
141162
account: Account | undefined;
163+
loginWithInAppWallet: boolean;
142164
}) {
143165
const [screen, setScreen] = useState<
144166
| { id: "login" }
@@ -190,7 +212,12 @@ function PageContent(props: {
190212
}
191213

192214
if (connectionStatus !== "connected" || screen.id === "login") {
193-
return <CustomConnectEmbed onLogin={onLogin} />;
215+
return (
216+
<CustomConnectEmbed
217+
onLogin={onLogin}
218+
loginWithInAppWallet={props.loginWithInAppWallet}
219+
/>
220+
);
194221
}
195222

196223
if (screen.id === "onboarding") {
@@ -215,6 +242,7 @@ function PageContent(props: {
215242

216243
function CustomConnectEmbed(props: {
217244
onLogin: () => void;
245+
loginWithInAppWallet: boolean;
218246
}) {
219247
const { theme } = useTheme();
220248
const client = useThirdwebClient();
@@ -257,7 +285,9 @@ function CustomConnectEmbed(props: {
257285
return isLoggedInResult;
258286
},
259287
}}
260-
wallets={wallets}
288+
wallets={
289+
props.loginWithInAppWallet ? inAppWalletLoginOptions : loginOptions
290+
}
261291
client={client}
262292
modalSize="wide"
263293
theme={getSDKTheme(theme === "light" ? "light" : "dark")}

apps/dashboard/src/app/login/page.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@ import { isValidEncodedRedirectPath } from "./isValidEncodedRedirectPath";
44

55
export default async function Page(props: {
66
searchParams: Promise<{
7-
next?: string;
7+
next: string | string[] | undefined;
8+
"in-app-wallet": string | string[] | undefined;
89
}>;
910
}) {
10-
const nextPath = (await props.searchParams).next;
11+
const searchParams = await props.searchParams;
12+
const nextPath =
13+
typeof searchParams.next === "string" ? searchParams.next : undefined;
1114
const account = await getRawAccount();
1215

1316
// don't redirect away from login page if authToken is already present and onboarding is done
@@ -20,6 +23,10 @@ export default async function Page(props: {
2023
nextPath && isValidEncodedRedirectPath(nextPath) ? nextPath : "/team";
2124

2225
return (
23-
<LoginAndOnboardingPage account={account} redirectPath={redirectPath} />
26+
<LoginAndOnboardingPage
27+
account={account}
28+
redirectPath={redirectPath}
29+
loginWithInAppWallet={searchParams["in-app-wallet"] === "true"}
30+
/>
2431
);
2532
}

apps/dashboard/src/app/nebula-app/login/NebulaLoginPage.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export function NebulaLoginPage(props: {
5353

5454
{showPage === "connect" && (
5555
<LoginAndOnboardingPageContent
56+
loginWithInAppWallet={false}
5657
account={props.account}
5758
redirectPath={
5859
message ? `/?prompt=${encodeURIComponent(message)}` : "/"

apps/dashboard/src/app/team/[team_slug]/[project_slug]/settings/ProjectGeneralSettingsPage.stories.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,8 @@ function Story(props: {
7676
await new Promise((resolve) => setTimeout(resolve, 1000));
7777
return {
7878
data: {
79-
secret: new Array(86).fill("x").join(""),
80-
secretHash: new Array(64).fill("x").join(""),
81-
secretMasked: "123...4567",
79+
secret: `sk_${new Array(86).fill("x").join("")}`,
80+
secretMasked: "sk_123...4567",
8281
},
8382
};
8483
}}

packages/thirdweb/src/utils/bytecode/resolveImplementation.test.ts

Lines changed: 48 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -20,54 +20,57 @@ import { getContract } from "../../contract/contract.js";
2020
import { deployContract } from "../../contract/deployment/deploy-with-abi.js";
2121
import { resolveImplementation } from "./resolveImplementation.js";
2222

23-
describe("Resolve implementation", async () => {
24-
it("should extract implementation address for minimal proxy contract", async () => {
25-
const resolved = resolveImplementation(NFT_DROP_CONTRACT);
26-
expect((await resolved).address).to.equal(NFT_DROP_IMPLEMENTATION);
27-
});
28-
29-
it("should extract implementation address for matic proxy contract", async () => {
30-
const resolved = resolveImplementation(POLYGON_USDT_PROXY_CONTRACT);
31-
expect((await resolved).address).to.equal(
32-
POLYGON_USDT_IMPLEMENTATION.toLowerCase(),
33-
);
34-
});
35-
36-
it("should extract implementation address for base USDC proxy contract", async () => {
37-
const resolved = resolveImplementation(BASE_USDC_PROXY_CONTRACT);
38-
expect((await resolved).address).to.equal(
39-
BASE_USDC_IMPLEMENTATION.toLowerCase(),
40-
);
41-
});
42-
43-
it("should extract implementation address for ERC1967 proxy contract", async () => {
44-
const implementationAddress = await deployContract({
45-
client: TEST_CLIENT,
46-
chain: ANVIL_CHAIN,
47-
account: TEST_ACCOUNT_A,
48-
bytecode: DUMMY_BYTECODE,
49-
abi: [],
23+
describe.runIf(process.env.TW_SECRET_KEY)(
24+
"Resolve implementation",
25+
async () => {
26+
it("should extract implementation address for minimal proxy contract", async () => {
27+
const resolved = resolveImplementation(NFT_DROP_CONTRACT);
28+
expect((await resolved).address).to.equal(NFT_DROP_IMPLEMENTATION);
5029
});
5130

52-
const proxyAddress = await deployContract({
53-
client: TEST_CLIENT,
54-
chain: ANVIL_CHAIN,
55-
account: TEST_ACCOUNT_A,
56-
bytecode: ERC1967_PROXY_BYTECODE,
57-
abi: ERC1967_PROXY_CONSTRUCTOR_ABI as Abi,
58-
constructorParams: {
59-
logic: implementationAddress,
60-
data: "0x",
61-
},
31+
it("should extract implementation address for matic proxy contract", async () => {
32+
const resolved = resolveImplementation(POLYGON_USDT_PROXY_CONTRACT);
33+
expect((await resolved).address).to.equal(
34+
POLYGON_USDT_IMPLEMENTATION.toLowerCase(),
35+
);
6236
});
6337

64-
const proxy = getContract({
65-
chain: ANVIL_CHAIN,
66-
address: proxyAddress,
67-
client: TEST_CLIENT,
38+
it("should extract implementation address for base USDC proxy contract", async () => {
39+
const resolved = resolveImplementation(BASE_USDC_PROXY_CONTRACT);
40+
expect((await resolved).address).to.equal(
41+
BASE_USDC_IMPLEMENTATION.toLowerCase(),
42+
);
6843
});
6944

70-
const resolved = await resolveImplementation(proxy);
71-
expect(resolved.address).to.equal(implementationAddress);
72-
});
73-
});
45+
it("should extract implementation address for ERC1967 proxy contract", async () => {
46+
const implementationAddress = await deployContract({
47+
client: TEST_CLIENT,
48+
chain: ANVIL_CHAIN,
49+
account: TEST_ACCOUNT_A,
50+
bytecode: DUMMY_BYTECODE,
51+
abi: [],
52+
});
53+
54+
const proxyAddress = await deployContract({
55+
client: TEST_CLIENT,
56+
chain: ANVIL_CHAIN,
57+
account: TEST_ACCOUNT_A,
58+
bytecode: ERC1967_PROXY_BYTECODE,
59+
abi: ERC1967_PROXY_CONSTRUCTOR_ABI as Abi,
60+
constructorParams: {
61+
logic: implementationAddress,
62+
data: "0x",
63+
},
64+
});
65+
66+
const proxy = getContract({
67+
chain: ANVIL_CHAIN,
68+
address: proxyAddress,
69+
client: TEST_CLIENT,
70+
});
71+
72+
const resolved = await resolveImplementation(proxy);
73+
expect(resolved.address).to.equal(implementationAddress);
74+
});
75+
},
76+
);

packages/thirdweb/src/wallets/smart/smart-wallet-integration-v07.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const contract = getContract({
4949
address: "0xe2cb0eb5147b42095c2FfA6F7ec953bb0bE347D8",
5050
});
5151

52-
describe.sequential(
52+
describe.runIf(process.env.TW_SECRET_KEY).sequential(
5353
"SmartWallet 0.7 core tests",
5454
{
5555
timeout: 240_000,

packages/thirdweb/src/wallets/smart/smart-wallet-modular.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const client = TEST_CLIENT;
2828
const DEFAULT_FACTORY_ADDRESS = "0xB1846E893CA01c5Dcdaa40371C1e13f2e0Df5717";
2929
const DEFAULT_VALIDATOR_ADDRESS = "0x7D3631d823e0De311DC86f580946EeF2eEC81fba";
3030

31-
describe.sequential(
31+
describe.runIf(process.env.TW_SECRET_KEY).sequential(
3232
"SmartWallet modular tests",
3333
{
3434
retry: 0,

0 commit comments

Comments
 (0)