Skip to content

Commit 5135198

Browse files
fix build
1 parent 7e75ee5 commit 5135198

File tree

2 files changed

+55
-54
lines changed

2 files changed

+55
-54
lines changed

apps/dashboard/src/app/team/[team_slug]/[project_slug]/engine/lib/analytics.ts

Lines changed: 47 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import type { Transaction } from "thirdweb/dist/types/insight/get-transactions";
21
import { THIRDWEB_ENGINE_CLOUD_URL } from "../../../../../../@/constants/env";
32
import type { TransactionStats } from "../../../../../../types/analytics";
43
import { getAuthToken } from "../../../../../api/lib/getAuthToken";
@@ -147,6 +146,53 @@ export async function getTransactionsChart({
147146
}));
148147
}
149148

149+
type TransactionParam = {
150+
to: string;
151+
data: string;
152+
value: string;
153+
};
154+
155+
type ExecutionParams = {
156+
type: string;
157+
signerAddress: string;
158+
entrypointAddress: string;
159+
smartAccountAddress: string;
160+
};
161+
162+
type ExecutionResult = {
163+
status: string;
164+
};
165+
166+
type Transaction = {
167+
id: string;
168+
batchIndex: number;
169+
chainId: string;
170+
from: string;
171+
transactionParams: TransactionParam[];
172+
transactionHash: string | null;
173+
confirmedAt: string | null;
174+
confirmedAtBlockNumber: number | null;
175+
enrichedData: unknown[];
176+
executionParams: ExecutionParams;
177+
executionResult: ExecutionResult;
178+
createdAt: string;
179+
errorMessage: string | null;
180+
cancelledAt: string | null;
181+
};
182+
183+
type Pagination = {
184+
totalCount: string;
185+
page: number;
186+
limit: number;
187+
};
188+
189+
type TransactionsSearchResponse = {
190+
result: {
191+
transactions: Transaction[];
192+
pagination: Pagination;
193+
};
194+
};
195+
150196
export async function getSingleTransaction({
151197
teamId,
152198
clientId,
@@ -193,53 +239,6 @@ export async function getSingleTransaction({
193239
);
194240
}
195241

196-
type TransactionParam = {
197-
to: string;
198-
data: string;
199-
value: string;
200-
};
201-
202-
type ExecutionParams = {
203-
type: string;
204-
signerAddress: string;
205-
entrypointAddress: string;
206-
smartAccountAddress: string;
207-
};
208-
209-
type ExecutionResult = {
210-
status: string;
211-
};
212-
213-
type Transaction = {
214-
id: string;
215-
batchIndex: number;
216-
chainId: string;
217-
from: string;
218-
transactionParams: TransactionParam[];
219-
transactionHash: string | null;
220-
confirmedAt: string | null;
221-
confirmedAtBlockNumber: number | null;
222-
enrichedData: unknown[];
223-
executionParams: ExecutionParams;
224-
executionResult: ExecutionResult;
225-
createdAt: string;
226-
errorMessage: string | null;
227-
cancelledAt: string | null;
228-
};
229-
230-
type Pagination = {
231-
totalCount: string;
232-
page: number;
233-
limit: number;
234-
};
235-
236-
type TransactionsSearchResponse = {
237-
result: {
238-
transactions: Transaction[];
239-
pagination: Pagination;
240-
};
241-
};
242-
243242
const data = (await response.json()) as TransactionsSearchResponse;
244243

245244
return data.result.transactions[0];

apps/dashboard/src/app/team/[team_slug]/[project_slug]/engine/lib/vault-utils.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"use client";
2+
13
import type { Project } from "@/api/projects";
24
import { THIRDWEB_VAULT_URL } from "@/constants/env";
35
import {
@@ -13,16 +15,16 @@ const SERVER_WALLET_ACCESS_TOKEN_PURPOSE =
1315
export const SERVER_WALLET_MANAGEMENT_ACCESS_TOKEN_PURPOSE =
1416
"Management Token for Dashboard";
1517

16-
let vaultClient: VaultClient | null = null;
18+
let vc: VaultClient | null = null;
1719

1820
export async function initVaultClient() {
19-
if (vaultClient) {
20-
return vaultClient;
21+
if (vc) {
22+
return vc;
2123
}
22-
vaultClient = await createVaultClient({
24+
vc = await createVaultClient({
2325
baseUrl: THIRDWEB_VAULT_URL,
2426
});
25-
return vaultClient;
27+
return vc;
2628
}
2729

2830
export async function createWalletAccessToken(props: {
@@ -31,7 +33,7 @@ export async function createWalletAccessToken(props: {
3133
vaultClient: VaultClient;
3234
}) {
3335
return createAccessToken({
34-
client: vaultClient,
36+
client: props.vaultClient,
3537
request: {
3638
options: {
3739
expiresAt: new Date(

0 commit comments

Comments
 (0)