Skip to content

Commit 6a05c59

Browse files
authored
Merge branch 'main' into yash/interop-module-support
2 parents 03f7d46 + 01d0666 commit 6a05c59

File tree

18 files changed

+179
-98
lines changed

18 files changed

+179
-98
lines changed

apps/dashboard/src/app/account/settings/AccountSettingsPage.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@ export function AccountSettingsPage(props: {
3636
client={props.client}
3737
defaultTeamSlug={props.defaultTeamSlug}
3838
defaultTeamName={props.defaultTeamName}
39+
cancelSubscriptions={async () => {
40+
const res = await apiServerProxy({
41+
method: "DELETE",
42+
pathname: `/v1/teams/${props.defaultTeamSlug}/subscriptions`,
43+
});
44+
45+
if (!res.ok) {
46+
throw new Error(res.error);
47+
}
48+
}}
3949
onAccountDeleted={async () => {
4050
await doLogout();
4151
if (activeWallet) {

apps/dashboard/src/app/account/settings/AccountSettingsPageUI.stories.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ function Variants() {
143143
onAccountDeleted={() => {
144144
console.log("Account deleted");
145145
}}
146+
cancelSubscriptions={async () => {
147+
await new Promise((resolve) => setTimeout(resolve, 1000));
148+
}}
146149
/>
147150
<Toaster richColors />
148151
</div>

apps/dashboard/src/app/account/settings/AccountSettingsPageUI.tsx

Lines changed: 49 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import type { Account } from "@3rdweb-sdk/react/hooks/useApi";
3838
import { zodResolver } from "@hookform/resolvers/zod";
3939
import { useMutation } from "@tanstack/react-query";
4040
import { REGEXP_ONLY_DIGITS_AND_CHARS } from "input-otp";
41-
import { EllipsisIcon, ExternalLinkIcon } from "lucide-react";
41+
import { CircleXIcon, EllipsisIcon, ExternalLinkIcon } from "lucide-react";
4242
import Link from "next/link";
4343
import { useState } from "react";
4444
import { useForm } from "react-hook-form";
@@ -64,6 +64,7 @@ export function AccountSettingsPageUI(props: {
6464
defaultTeamSlug: string;
6565
defaultTeamName: string;
6666
redirectToBillingPortal: BillingBillingPortalAction;
67+
cancelSubscriptions: () => Promise<void>;
6768
}) {
6869
return (
6970
<div className="flex flex-col gap-8">
@@ -89,6 +90,7 @@ export function AccountSettingsPageUI(props: {
8990
defaultTeamSlug={props.defaultTeamSlug}
9091
defaultTeamName={props.defaultTeamName}
9192
redirectToBillingPortal={props.redirectToBillingPortal}
93+
cancelSubscriptions={props.cancelSubscriptions}
9294
/>
9395
</div>
9496
);
@@ -207,6 +209,7 @@ function DeleteAccountCard(props: {
207209
defaultTeamSlug: string;
208210
defaultTeamName: string;
209211
redirectToBillingPortal: BillingBillingPortalAction;
212+
cancelSubscriptions: () => Promise<void>;
210213
}) {
211214
const title = "Delete Account";
212215
const description = (
@@ -230,6 +233,10 @@ function DeleteAccountCard(props: {
230233
},
231234
});
232235

236+
const cancelSubscriptions = useMutation({
237+
mutationFn: props.cancelSubscriptions,
238+
});
239+
233240
function handleDelete() {
234241
deleteAccount.mutate();
235242
}
@@ -264,25 +271,47 @@ function DeleteAccountCard(props: {
264271
<Alert variant="destructive">
265272
<AlertTitle>Failed to delete account</AlertTitle>
266273
<AlertDescription>
267-
<span className="mb-1 block">
268-
Your default team "{props.defaultTeamName}" has active
269-
subscriptions. These subscriptions have to be cancelled
270-
first before deleting account
271-
</span>
272-
<span className="mb-4 block">
273-
Reach out to support to help you cancel them
274-
</span>
275-
<Button
276-
variant="default"
277-
asChild
278-
size="sm"
279-
className="gap-2"
280-
>
281-
<Link href="/support/create-ticket">
282-
Contact Support
283-
<ExternalLinkIcon className="size-4" />
284-
</Link>
285-
</Button>
274+
<div className="mb-4">
275+
<span className="block">
276+
Your default team "{props.defaultTeamName}" has active
277+
subscriptions. These subscriptions have to be cancelled
278+
before deleting account
279+
</span>
280+
</div>
281+
282+
<div className="flex flex-col gap-3 lg:flex-row">
283+
<Button
284+
variant="default"
285+
size="sm"
286+
className="gap-2"
287+
onClick={() => {
288+
const promise = cancelSubscriptions.mutateAsync();
289+
toast.promise(promise, {
290+
success: "Subscriptions cancelled successfully",
291+
error: "Failed to cancel subscriptions",
292+
});
293+
}}
294+
>
295+
{cancelSubscriptions.isPending ? (
296+
<Spinner className="size-4" />
297+
) : (
298+
<CircleXIcon className="size-4" />
299+
)}
300+
Cancel subscriptions
301+
</Button>
302+
303+
<Button
304+
variant="outline"
305+
asChild
306+
size="sm"
307+
className="gap-2"
308+
>
309+
<Link href="/support/create-ticket" target="_blank">
310+
Contact Support
311+
<ExternalLinkIcon className="size-4" />
312+
</Link>
313+
</Button>
314+
</div>
286315
</AlertDescription>
287316
</Alert>
288317
</div>

apps/dashboard/src/app/team/[team_slug]/[project_slug]/connect/account-abstraction/factories/page.tsx

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,19 +115,23 @@ async function AsyncYourFactories(props: {
115115
authToken: props.authToken,
116116
});
117117

118-
const client = getThirdwebClient();
118+
const client = getThirdwebClient(props.authToken);
119119

120120
const factories = (
121121
await Promise.all(
122122
deployedContracts.map(async (c) => {
123-
const contract = getContract({
124-
// eslint-disable-next-line no-restricted-syntax
125-
chain: defineChain(Number(c.chainId)),
126-
address: c.contractAddress,
127-
client,
128-
});
129-
const m = await getCompilerMetadata(contract);
130-
return m.name.indexOf("AccountFactory") > -1 ? c : null;
123+
try {
124+
const contract = getContract({
125+
// eslint-disable-next-line no-restricted-syntax
126+
chain: defineChain(Number(c.chainId)),
127+
address: c.contractAddress,
128+
client,
129+
});
130+
const m = await getCompilerMetadata(contract);
131+
return m.name.indexOf("AccountFactory") > -1 ? c : null;
132+
} catch {
133+
return null;
134+
}
131135
}),
132136
)
133137
).filter((f) => f !== null);

apps/dashboard/src/components/settings/ApiKeys/Alerts.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,10 @@ export const SmartWalletsBillingAlert = ({
4444
<AlertTitle>Account Abstraction on Mainnet</AlertTitle>
4545
<AlertDescription>
4646
<Text as="span" pr={1}>
47-
You&apos;ve enabled Account Abstraction for one of your API keys
48-
and haven&apos;t added a payment method.
47+
You&apos;ve enabled Account Abstraction for one of your API keys.
4948
<br />
50-
To use them on Mainnet,
51-
</Text>
49+
To enable AA on mainnet chains,
50+
</Text>{" "}
5251
<TrackedLink
5352
href="/team/~/~/settings/billing"
5453
category="api_keys"
@@ -57,7 +56,7 @@ export const SmartWalletsBillingAlert = ({
5756
color="blue.500"
5857
>
5958
<Text as="span" color="blue.500">
60-
add a payment method.
59+
subscribe to a billing plan.
6160
</Text>
6261
</TrackedLink>
6362
</AlertDescription>

apps/portal/src/app/connect/account-abstraction/infrastructure/page.mdx

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,42 @@ With a thirdweb API key, you get access to bundler and paymaster infrastructure
2727

2828
To support a chain not listed, [contact us](https://thirdweb.com/contact-us).
2929

30+
## Using Paymaster & Bundler URL
31+
32+
To use the Paymaster & Bundler URL for thirdweb, you can follow the guide below:
33+
34+
### URL Pattern
35+
36+
The URL pattern is predictable for all chains and is used for both paymaster and bundler operations:
37+
38+
```
39+
https://<chain_id>.bundler.thirdweb.com/v2/<thirdweb-client-id>
40+
```
41+
42+
Replace `<chain_id>` with the appropriate chain ID and `<thirdweb-client-id>` with your thirdweb client ID.
43+
44+
### Client ID in Header
45+
46+
You can also pass the client ID via the header:
47+
48+
```
49+
x-client-id: <your_thirdweb_client_id>
50+
```
51+
52+
### Frontend Calls
53+
54+
For frontend calls, the calling domain needs to be allowlisted. This can be done from the thirdweb dashboard in the API key settings.
55+
56+
### Backend Usage
57+
58+
For backend usage, the secret key is required as a header, and the client ID can be omitted:
59+
60+
```
61+
x-secret-key: <your_thirdweb_secret_key>
62+
```
63+
64+
Make sure to replace the placeholders with your actual values. This guide will help you set up and use Paymaster & Bundler URLs effectively with thirdweb.
65+
3066
## Using a Custom Bundler
3167

3268
Smart accounts are free to use with your own account abstraction infrastructure. To use your own paymaster & bundler,

apps/portal/src/app/connect/pay/customization/connectbutton/page.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import { createMetadata, DocImage } from "@doc";
22
export const metadata = createMetadata({
33
image: {
4-
title: "thirdweb Pay - Customize ConnectButton",
4+
title: "thirdweb Universal Bridge - Customize ConnectButton",
55
icon: "thirdweb",
66
},
7-
title: "thirdweb Pay - Customize ConnectButton - thirdweb",
7+
title: "thirdweb Universal Bridge - Customize ConnectButton - thirdweb",
88
description:
9-
"thirdweb Pay - Customizing ConnectButton onramps and crypto purchase flows",
9+
"thirdweb Universal Bridge - Customizing ConnectButton onramps and crypto purchase flows",
1010
});
1111

1212
# Customize ConnectButton
1313

14-
Learn how to customize Pay within the `ConnectButton` interface. You can find a selection of popular customizations below. For the full list of props, you can [view the full reference](/references/typescript/v5/ConnectButtonProps).
14+
Learn how to customize Universal Bridge within the `ConnectButton` interface. You can find a selection of popular customizations below. For the full list of props, you can [view the full reference](/references/typescript/v5/ConnectButtonProps).
1515

1616
---
1717

@@ -39,7 +39,7 @@ You can enable users to select your token on a given chain by passing an array o
3939

4040
## Prefill Destination Token
4141

42-
In the case you want your users to purchase your token by default in your application, you can choose to pre-fill the Pay purchase flow with `prefillBuy` .
42+
In the case you want your users to purchase your token by default in your application, you can choose to pre-fill the Universal Bridge purchase flow with `prefillBuy` .
4343

4444
For example, if you wanted users to only purchase Ethereum on Base network, you could do as follows:
4545

@@ -137,7 +137,7 @@ In some cases, you may only want to show users fiat or crypto payment options fo
137137

138138
## Theme
139139

140-
You can set the theme for the Pay component, which is set to `"dark"` by default. theme can be set to either `"dark"` , `"light"` or a custom theme object.
140+
You can set the theme for the Universal Bridge component, which is set to `"dark"` by default. theme can be set to either `"dark"` , `"light"` or a custom theme object.
141141

142142
We have [`lightTheme`](/references/typescript/v5/lightTheme) or [`darkTheme`](/references/typescript/v5/darkTheme) providers that you can override to kickstart customization.
143143

apps/portal/src/app/connect/pay/customization/payembed/page.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { createMetadata, DocImage } from "@doc";
22
export const metadata = createMetadata({
33
image: {
4-
title: "thirdweb Pay - Customize PayEmbed",
4+
title: "thirdweb Universal Bridge - Customize PayEmbed",
55
icon: "thirdweb",
66
},
7-
title: "thirdweb Pay - Customize PayEmbed - thirdweb",
7+
title: "thirdweb Universal Bridge - Customize PayEmbed - thirdweb",
88
description:
9-
"thirdweb Pay - Customizing embeddable onramps and crypto purchase flows",
9+
"thirdweb Universal Bridge - Customizing embeddable onramps and crypto purchase flows",
1010
});
1111

1212
# PayEmbed Customization
@@ -129,7 +129,7 @@ In some cases, you may only want to show users fiat or crypto payment options fo
129129

130130
## Theme
131131

132-
You can set the theme for the Pay component, which is set to `"dark"` by default. theme can be set to either `"dark"` , `"light"` or a custom theme object.
132+
You can set the theme for the component, which is set to `"dark"` by default. theme can be set to either `"dark"` , `"light"` or a custom theme object.
133133

134134
We have [`lightTheme`](/references/typescript/v5/lightTheme) or [`darkTheme`](/references/typescript/v5/darkTheme) providers that you can override to kickstart customization.
135135

apps/portal/src/app/connect/pay/customization/send-transaction/page.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import { createMetadata, DocImage } from "@doc";
22
export const metadata = createMetadata({
33
image: {
4-
title: "thirdweb Pay - Customize sendTransaction",
4+
title: "thirdweb Universal Bridge - Customize sendTransaction",
55
icon: "thirdweb",
66
},
7-
title: "thirdweb Pay - Customize sendTransaction - thirdweb",
7+
title: "thirdweb Universal Bridge - Customize sendTransaction - thirdweb",
88
description:
9-
"thirdweb Pay - Customizing point of sale onramps and crypto purchase flows",
9+
"thirdweb Universal Bridge- Customizing point of sale onramps and crypto purchase flows",
1010
});
1111

1212
# useSendTransaction Customization
1313

14-
Learn how to customize the Pay interface when executing a transaction with `useSendTransaction`. You can find a selection of popular customizations below. For the full list of props, you can [view the full reference](/references/typescript/v5/SendTransactionConfig).
14+
Learn how to customize the Universal Bridge interface when executing a transaction with `useSendTransaction`. You can find a selection of popular customizations below. For the full list of props, you can [view the full reference](/references/typescript/v5/SendTransactionConfig).
1515

1616
---
1717

@@ -123,7 +123,7 @@ const { mutate: sendTransaction } = useSendTransaction({
123123

124124
## Theme
125125

126-
You can set the theme for the Pay component, which is set to `"dark"` by default. theme can be set to either `"dark"` , `"light"` or a custom theme object.
126+
You can set the theme for the component, which is set to `"dark"` by default. theme can be set to either `"dark"` , `"light"` or a custom theme object.
127127

128128
We have [`lightTheme`](/references/typescript/v5/lightTheme) or [`darkTheme`](/references/typescript/v5/darkTheme) providers that you can override to kickstart customization.
129129

apps/portal/src/app/connect/pay/faqs/page.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,15 @@ All other tokens will require an additional Buy With Crypto step.
8585
Users will be required to complete KYC verification for their first purchase using 'Buy with Fiat.' After that, no further KYC will be needed for future purchases on the same platform.
8686
</Details>
8787

88-
<Details summary="What cryptocurrencies does Pay support?">
89-
Pay can support any currency on our [supported chains](/connect/pay/supported-chains).
88+
<Details summary="What cryptocurrencies does Universal Bridge support?">
89+
Universal Bridge can support any currency on our [supported chains](/connect/pay/supported-chains).
9090
</Details>
9191

92-
<Details summary="How are cryptocurrency prices set in thirdweb Pay?">
92+
<Details summary="How are cryptocurrency prices set in thirdweb Universal Bridge?">
9393
Prices are set depending on the liquidity provider used to route your transaction.
9494
</Details>
9595

96-
<Details summary="Does thirdweb Pay offer fiat payouts?">
96+
<Details summary="Does thirdweb Universal Bridge offer fiat payouts?">
9797
Fiat payouts are not currently available.
9898
</Details>
9999

0 commit comments

Comments
 (0)