Skip to content

Commit f9d7935

Browse files
joaquim-vergesd4mr
andauthored
Update engine API (#7427)
Signed-off-by: Prithvish Baidya <[email protected]> Co-authored-by: Prithvish Baidya <[email protected]>
1 parent acd5656 commit f9d7935

File tree

43 files changed

+3493
-2616
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+3493
-2616
lines changed

.changeset/heavy-banks-think.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@thirdweb-dev/engine": minor
3+
---
4+
5+
New engine v3 APIs - see changelog for breaking changes

.changeset/lovely-brooms-relax.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+
Support latest engine API

apps/dashboard/biome.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.0.0/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.0.4/schema.json",
33
"extends": "//"
44
}

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/analytics/tx-table/types.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,14 @@ type ExecutionResult4337Serialized =
3434
}
3535
| {
3636
status: "FAILED";
37-
error: string;
37+
error: {
38+
stage: string;
39+
message: string;
40+
errorCode: string;
41+
inner_error: object;
42+
nonce_used: string;
43+
account_address: string;
44+
};
3845
}
3946
| {
4047
status: "SUBMITTED";

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/tx/[id]/transaction-details-ui.tsx

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { format, formatDistanceToNowStrict } from "date-fns";
44
import { ExternalLinkIcon, InfoIcon } from "lucide-react";
55
import Link from "next/link";
6-
import { type ThirdwebClient, toEther } from "thirdweb";
6+
import { hexToNumber, isHex, type ThirdwebClient, toEther } from "thirdweb";
77
import type { Project } from "@/api/projects";
88
import { WalletAddress } from "@/components/blocks/wallet-address";
99
import { Badge } from "@/components/ui/badge";
@@ -43,10 +43,14 @@ export function TransactionDetailsUI({
4343
const status = executionResult?.status as keyof typeof statusDetails;
4444
const errorMessage =
4545
executionResult && "error" in executionResult
46-
? executionResult.error
46+
? executionResult.error.message
4747
: executionResult && "revertData" in executionResult
4848
? executionResult.revertData?.revertReason
4949
: null;
50+
const errorDetails =
51+
executionResult && "error" in executionResult
52+
? executionResult.error
53+
: undefined;
5054

5155
const chain = chainId ? idToChain.get(Number.parseInt(chainId)) : undefined;
5256
const explorer = chain?.explorers?.[0];
@@ -64,7 +68,7 @@ export function TransactionDetailsUI({
6468
// Gas information
6569
const gasUsed =
6670
executionResult && "actualGasUsed" in executionResult
67-
? `${executionResult.actualGasUsed}`
71+
? `${isHex(executionResult.actualGasUsed) ? hexToNumber(executionResult.actualGasUsed) : executionResult.actualGasUsed}`
6872
: "N/A";
6973

7074
const gasCost =
@@ -244,9 +248,16 @@ export function TransactionDetailsUI({
244248
</CardTitle>
245249
</CardHeader>
246250
<CardContent>
247-
<div className="rounded-md bg-destructive/10 p-4 text-destructive">
248-
{errorMessage}
249-
</div>
251+
{errorDetails ? (
252+
<CodeClient
253+
code={JSON.stringify(errorDetails, null, 2)}
254+
lang="json"
255+
/>
256+
) : (
257+
<div className="rounded-md bg-destructive/10 p-4 text-destructive">
258+
{errorMessage}
259+
</div>
260+
)}
250261
</CardContent>
251262
</Card>
252263
)}
@@ -328,7 +339,9 @@ export function TransactionDetailsUI({
328339
Block Number
329340
</div>
330341
<div className="text-sm md:w-2/3">
331-
{transaction.confirmedAtBlockNumber}
342+
{isHex(transaction.confirmedAtBlockNumber)
343+
? hexToNumber(transaction.confirmedAtBlockNumber)
344+
: transaction.confirmedAtBlockNumber}
332345
</div>
333346
</div>
334347
)}

apps/nebula/biome.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.0.0/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.0.4/schema.json",
33
"extends": "//"
44
}

apps/playground-web/biome.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.0.0/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.0.4/schema.json",
33
"extends": "//"
44
}

apps/portal/biome.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.0.0/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.0.4/schema.json",
33
"extends": "//"
44
}

apps/wallet-ui/biome.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.0.0/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.0.4/schema.json",
33
"extends": "//"
44
}

biome.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.0.0/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.0.4/schema.json",
33
"assist": {
44
"actions": {
55
"source": {

0 commit comments

Comments
 (0)