Skip to content

Commit 53adb48

Browse files
committed
Merge branch 'main' of https://github.com/thirdweb-dev/js into gi/portal-knowledge-base
2 parents eb9cd89 + 30fafd1 commit 53adb48

File tree

30 files changed

+862
-347
lines changed

30 files changed

+862
-347
lines changed

.changeset/open-readers-do.md

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

.changeset/stale-yaks-bathe.md

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

.changeset/ten-parrots-poke.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+
Fix siwe auth always forcing a switch chain call

.changeset/tidy-seas-sing.md

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

apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/(chainPage)/components/client/live-stats.tsx

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,21 @@ function useChainStatswithRPC(_rpcUrl: string) {
3232
method: "POST",
3333
body: JSON.stringify({
3434
jsonrpc: "2.0",
35-
method: "eth_blockNumber",
36-
params: [],
35+
method: "eth_getBlockByNumber",
36+
params: ["latest", false],
3737
id: 1,
3838
}),
3939
});
4040

4141
const json = await res.json();
4242
const latency = (performance.now() - startTimeStamp).toFixed(0);
4343

44+
const blockNumber = Number.parseInt(json.result.number, 16);
45+
const blockGasLimit = Number.parseInt(json.result.gasLimit, 16);
4446
return {
4547
latency,
46-
blockNumber: Number.parseInt(json.result, 16),
48+
blockNumber,
49+
blockGasLimit,
4750
};
4851
},
4952
refetchInterval: (query) => {
@@ -115,6 +118,21 @@ export function ChainLiveStats(props: { rpc: string }) {
115118
</div>
116119
)}
117120
</PrimaryInfoItem>
121+
122+
{/* Block Gas Limit */}
123+
<PrimaryInfoItem title="Block Gas Limit" titleIcon={<PulseDot />}>
124+
{stats.isError ? (
125+
<p className="fade-in-0 animate-in text-destructive-text">N/A</p>
126+
) : stats.data ? (
127+
<p className="fade-in-0 animate-in">
128+
{stats.data.blockGasLimit ?? "N/A"}
129+
</p>
130+
) : (
131+
<div className="flex h-[28px] w-[140px] py-1">
132+
<Skeleton className="h-full w-full" />
133+
</div>
134+
)}
135+
</PrimaryInfoItem>
118136
</>
119137
);
120138
}

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/connect/universal-bridge/webhooks/components/webhooks.client.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,14 +273,14 @@ function CreateWebhookButton(props: PropsWithChildren<PayWebhooksPageProps>) {
273273
/>
274274

275275
<section>
276-
<FormLabel>Secret Key</FormLabel>
276+
<FormLabel>Webhook Secret</FormLabel>
277277

278278
<CopyTextButton
279279
textToCopy={secret}
280280
className="!h-auto my-1 w-full justify-between truncate bg-card px-3 py-3 font-mono"
281281
textToShow={shortenString(secret)}
282282
copyIconPosition="right"
283-
tooltip="Copy Secret Key"
283+
tooltip="Copy Webhook Secret"
284284
/>
285285
<FormDescription>
286286
Passed as a bearer token in all webhook requests to verify the
@@ -293,7 +293,7 @@ function CreateWebhookButton(props: PropsWithChildren<PayWebhooksPageProps>) {
293293
setSecretStored(!!v);
294294
}}
295295
/>
296-
I confirm that I've securely stored my secret key
296+
I confirm that I've securely stored my webhook secret
297297
</CheckboxWithLabel>
298298
</section>
299299

apps/playground-web/src/app/insight/[blueprint_slug]/blueprint-playground.client.tsx

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ function modifyParametersForPlayground(_parameters: BlueprintParameter[]) {
109109
const parameters = [..._parameters];
110110

111111
// make chain query param required - its not required in open api spec - because it either has to be set in subdomain or as a query param
112-
const chainIdParameter = parameters.find((p) => p.name === "chain");
112+
const chainIdParameter = parameters.find((p) => p.name === "chain_id");
113113
if (chainIdParameter) {
114114
chainIdParameter.required = true;
115115
}
@@ -122,6 +122,12 @@ function modifyParametersForPlayground(_parameters: BlueprintParameter[]) {
122122
parameters.splice(clientIdParameterIndex, 1);
123123
}
124124

125+
// remove the chain parameter if it is present
126+
const chainParameterIndex = parameters.findIndex((p) => p.name === "chain");
127+
if (chainParameterIndex !== -1) {
128+
parameters.splice(chainParameterIndex, 1);
129+
}
130+
125131
return parameters;
126132
}
127133

@@ -163,7 +169,7 @@ function BlueprintPlaygroundUI(props: {
163169
values[param.name] = Math.floor(
164170
(Date.now() - 3 * 30 * 24 * 60 * 60 * 1000) / 1000,
165171
);
166-
} else if (param.name === "chain") {
172+
} else if (param.name === "chain_id") {
167173
values[param.name] = [];
168174
} else {
169175
values[param.name] = "";
@@ -466,7 +472,7 @@ function ParameterSection(props: {
466472
key={param.name}
467473
className={cn(
468474
"grid items-center",
469-
param.name === "chain"
475+
param.name === "chain_id"
470476
? "grid-cols-1 lg:grid-cols-2"
471477
: "grid-cols-2",
472478
)}
@@ -485,14 +491,14 @@ function ParameterSection(props: {
485491
)}
486492
</div>
487493
<div className="relative">
488-
{param.name === "chain" ? (
494+
{param.name === "chain_id" ? (
489495
<MultiNetworkSelector
490496
selectedBadgeClassName="bg-background"
491497
selectedChainIds={
492-
props.form.watch("chain") as number[]
498+
props.form.watch("chain_id") as number[]
493499
}
494500
onChange={(chainIds) => {
495-
props.form.setValue("chain", chainIds, {
501+
props.form.setValue("chain_id", chainIds, {
496502
shouldValidate: true,
497503
shouldDirty: true,
498504
});
@@ -821,6 +827,9 @@ function openAPIV3ParamToZodFormSchema(
821827
function createParametersFormSchema(parameters: BlueprintParameter[]) {
822828
const shape: z.ZodRawShape = {};
823829
for (const param of parameters) {
830+
if (param.deprecated) {
831+
continue;
832+
}
824833
const paramSchema = openAPIV3ParamToZodFormSchema(
825834
param.schema,
826835
!!param.required,

0 commit comments

Comments
 (0)