Skip to content

Commit a179bf1

Browse files
authored
Merge branch 'main' into yash/stylus-cli-erc20
2 parents 92ee251 + 44a7460 commit a179bf1

File tree

11 files changed

+62
-35
lines changed

11 files changed

+62
-35
lines changed

.changeset/clear-books-allow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
Adds `country` to onramp parameters

.changeset/tricky-points-tease.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
Remove unnecessary Switch Network button in PayEmbed

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectSidebarLayout.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import { FullWidthSidebarLayout } from "@/components/blocks/SidebarLayout";
33
import { Badge } from "@/components/ui/badge";
44
import {
5-
BellIcon,
65
BookTextIcon,
76
BoxIcon,
87
CoinsIcon,
@@ -95,16 +94,17 @@ export function ProjectSidebarLayout(props: {
9594
icon: NebulaIcon,
9695
tracking: tracking("nebula"),
9796
},
98-
{
99-
href: `${layoutPath}/webhooks`,
100-
label: (
101-
<span className="flex items-center gap-2">
102-
Webhooks <Badge>New</Badge>
103-
</span>
104-
),
105-
icon: BellIcon,
106-
tracking: tracking("webhooks"),
107-
},
97+
// Commented until we solve the scrolling issue
98+
// {
99+
// href: `${layoutPath}/webhooks`,
100+
// label: (
101+
// <span className="flex items-center gap-2">
102+
// Webhooks <Badge>New</Badge>
103+
// </span>
104+
// ),
105+
// icon: BellIcon,
106+
// tracking: tracking("webhooks"),
107+
// },
108108
]}
109109
footerSidebarLinks={[
110110
{

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/components/FilterDetailsStep.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ export function FilterDetailsStep({
323323
: null}
324324
</SelectValue>
325325
</SelectTrigger>
326-
<SelectContent>
326+
<SelectContent className="max-h-60 overflow-y-auto">
327327
{eventSignatures.map((event) => {
328328
// Truncate the hash for display purposes
329329
const truncatedHash = truncateMiddle(
@@ -373,7 +373,7 @@ export function FilterDetailsStep({
373373
: null}
374374
</SelectValue>
375375
</SelectTrigger>
376-
<SelectContent className="max-w-[600px]">
376+
<SelectContent className="max-h-60 max-w-[600px] overflow-y-auto">
377377
{functionSignatures.map((func) => (
378378
<SelectItem
379379
key={func.signature}

apps/playground-web/src/app/insight/insightBlueprints.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ export const insightBlueprints: MinimalBlueprintSpec[] = [
5959
id: "tokens",
6060
name: "Tokens",
6161
paths: [
62+
{
63+
name: "Get token owners by contract",
64+
path: "/v1/tokens/owners",
65+
deprecated: false,
66+
},
6267
{
6368
name: "Get token transfers by transaction",
6469
path: "/v1/tokens/transfers/transaction/{transaction_hash}",
@@ -126,7 +131,7 @@ export const insightBlueprints: MinimalBlueprintSpec[] = [
126131
deprecated: false,
127132
},
128133
{
129-
name: "Get NFTs by owner",
134+
name: "Get NFTs",
130135
path: "/v1/nfts",
131136
deprecated: false,
132137
},

packages/thirdweb/src/bridge/Onramp.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ interface OnrampApiRequestBody {
5353
maxSteps?: number;
5454
excludeChainIds?: string;
5555
paymentLinkId?: string;
56+
country?: string;
5657
}
5758

5859
/**
@@ -107,6 +108,22 @@ interface OnrampApiRequestBody {
107108
* }
108109
* ```
109110
*
111+
* ### Global Support
112+
*
113+
* For the best user experience, specify the user's `country` code in your request. This will return an error if the user's country is not supported by the provider.
114+
*
115+
* ```typescript
116+
* const preparedOnramp = await Bridge.Onramp.prepare({
117+
* client: thirdwebClient,
118+
* onramp: "stripe",
119+
* chainId: ethereum.id,
120+
* tokenAddress: NATIVE_TOKEN_ADDRESS,
121+
* receiver: "0x...", // receiver's address
122+
* amount: toWei("10"), // 10 of the destination token
123+
* country: "AU" // User's country code
124+
* });
125+
* ```
126+
*
110127
* @param options - The options for preparing the onramp.
111128
* @param options.client - Your thirdweb client.
112129
* @param options.onramp - The onramp provider to use (e.g., "stripe", "coinbase", "transak").
@@ -121,6 +138,7 @@ interface OnrampApiRequestBody {
121138
* @param [options.currency] - The currency for the onramp (e.g., "USD", "GBP"). Defaults to user's preferred or "USD".
122139
* @param [options.maxSteps] - Maximum number of post-onramp steps.
123140
* @param [options.excludeChainIds] - Chain IDs to exclude from the route (string or array of strings).
141+
* @param [options.country] - The user's country code (e.g. "US", "JP"). Defaults to "US". We highly recommend this be set (based on the user's IP address).
124142
*
125143
* @returns A promise that resolves to the prepared onramp details, including the link and quote.
126144
* @throws Will throw an error if there is an issue preparing the onramp.
@@ -145,6 +163,7 @@ export async function prepare(
145163
maxSteps,
146164
excludeChainIds,
147165
paymentLinkId,
166+
country,
148167
} = options;
149168

150169
const clientFetch = getClientFetch(client);
@@ -186,6 +205,9 @@ export async function prepare(
186205
if (paymentLinkId !== undefined) {
187206
apiRequestBody.paymentLinkId = paymentLinkId;
188207
}
208+
if (country !== undefined) {
209+
apiRequestBody.country = country;
210+
}
189211

190212
const response = await clientFetch(url, {
191213
method: "POST",
@@ -247,6 +269,7 @@ export declare namespace prepare {
247269
currency?: string;
248270
maxSteps?: number;
249271
excludeChainIds?: string | string[];
272+
country?: string;
250273
/**
251274
* @hidden
252275
*/

packages/thirdweb/src/bridge/Webhook.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,13 @@ export type WebhookPayload = Exclude<
6060
>;
6161

6262
/**
63-
* Parses an incoming webhook from thirdweb.
63+
* Parses an incoming Universal Bridge webhook payload.
6464
*
6565
* @param payload - The raw text body received from thirdweb.
6666
* @param headers - The webhook headers received from thirdweb.
6767
* @param secret - The webhook secret to verify the payload with.
68+
* @beta
69+
* @bridge Webhook
6870
*/
6971
export async function parse(
7072
/**

packages/thirdweb/src/extensions/prebuilts/deploy-published.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ export async function deployContractfromDeployMetadata(
308308
method,
309309
params: normalizeFunctionParams(method, initializeParams),
310310
});
311-
// asumption here is that the factory address returns the deployed proxy address
311+
// assumption here is that the factory address returns the deployed proxy address
312312
const address = await simulateTransaction({
313313
transaction: deployTx,
314314
});

packages/thirdweb/src/extensions/prebuilts/get-required-transactions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ async function getTransactionsForImplementation(options: {
140140
options;
141141

142142
if (deployMetadata.name === "MarketplaceV3") {
143-
return getTransactionsForMaketplaceV3(options);
143+
return getTransactionsForMarketplaceV3(options);
144144
}
145145

146146
if (deployMetadata.routerType === "dynamic") {
@@ -173,7 +173,7 @@ async function getTransactionsForImplementation(options: {
173173
return result ? [result] : [];
174174
}
175175

176-
async function getTransactionsForMaketplaceV3(options: {
176+
async function getTransactionsForMarketplaceV3(options: {
177177
chain: Chain;
178178
client: ThirdwebClient;
179179
}): Promise<DeployTransactionResult[]> {

packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.tsx

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import {
2121
} from "../../../../components/Drawer.js";
2222
import { Spacer } from "../../../../components/Spacer.js";
2323
import { Spinner } from "../../../../components/Spinner.js";
24-
import { SwitchNetworkButton } from "../../../../components/SwitchNetwork.js";
2524
import { Container } from "../../../../components/basic.js";
2625
import { Button } from "../../../../components/buttons.js";
2726
import { Text } from "../../../../components/text.js";
@@ -171,8 +170,6 @@ export function SwapScreenContent(props: {
171170
(swapRequired && !quoteQuery.data) ||
172171
isNotEnoughBalance ||
173172
allowanceQuery.isLoading;
174-
const switchChainRequired =
175-
props.payer.wallet.getChain()?.id !== fromChain?.id;
176173

177174
const errorMsg =
178175
!quoteQuery.isLoading && quoteQuery.error
@@ -319,19 +316,6 @@ export function SwapScreenContent(props: {
319316
>
320317
Pay with another token
321318
</Button>
322-
) : switchChainRequired &&
323-
fromChain &&
324-
!quoteQuery.isLoading &&
325-
!allowanceQuery.isLoading &&
326-
!isNotEnoughBalance &&
327-
!quoteQuery.error ? (
328-
<SwitchNetworkButton
329-
variant="accent"
330-
fullWidth
331-
switchChain={async () => {
332-
await props.payer.wallet.switchChain(fromChain);
333-
}}
334-
/>
335319
) : (
336320
<Button
337321
variant={disableContinue ? "outline" : "accent"}
@@ -340,6 +324,9 @@ export function SwapScreenContent(props: {
340324
disabled={disableContinue}
341325
onClick={async () => {
342326
if (!disableContinue) {
327+
if (props.payer.wallet.getChain()?.id !== fromChain?.id) {
328+
await props.payer.wallet.switchChain(fromChain);
329+
}
343330
showSwapFlow();
344331
trackPayEvent({
345332
event: "confirm_swap_quote",

packages/thirdweb/src/utils/extensions/drops/process-override-list.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export async function processOverrideList(options: {
9090
client: options.client,
9191
files: [stringify(options.overrides)],
9292
});
93-
// 7. assmeble the final sharded merkle tree info
93+
// 7. assemble the final sharded merkle tree info
9494
const shardedMerkleInfo: ShardedMerkleTreeInfo = {
9595
merkleRoot: tree.getHexRoot(),
9696
baseUri,

0 commit comments

Comments
 (0)