|
1 | | -import type { Transaction } from "thirdweb/dist/types/insight/get-transactions"; |
2 | 1 | import { THIRDWEB_ENGINE_CLOUD_URL } from "../../../../../../@/constants/env"; |
3 | 2 | import type { TransactionStats } from "../../../../../../types/analytics"; |
4 | 3 | import { getAuthToken } from "../../../../../api/lib/getAuthToken"; |
@@ -147,6 +146,53 @@ export async function getTransactionsChart({ |
147 | 146 | })); |
148 | 147 | } |
149 | 148 |
|
| 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 | + |
150 | 196 | export async function getSingleTransaction({ |
151 | 197 | teamId, |
152 | 198 | clientId, |
@@ -193,53 +239,6 @@ export async function getSingleTransaction({ |
193 | 239 | ); |
194 | 240 | } |
195 | 241 |
|
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 | | - |
243 | 242 | const data = (await response.json()) as TransactionsSearchResponse; |
244 | 243 |
|
245 | 244 | return data.result.transactions[0]; |
|
0 commit comments