Skip to content

Commit b05fec2

Browse files
committed
refactor: rename "ckbRawTx" to "ckbVirtualTx" in the IsomorphicTransaction type
1 parent 69e9954 commit b05fec2

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Diff for: src/routes/rgbpp/address.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ const addressRoutes: FastifyPluginCallback<Record<never, never>, Server, ZodType
250250

251251
async function getIsomorphicTx(btcTx: BTCTransaction) {
252252
const isomorphicTx: IsomorphicTransaction = {
253-
ckbRawTx: undefined,
253+
ckbVirtualTx: undefined,
254254
ckbTx: undefined,
255255
status: { confirmed: false },
256256
};
@@ -262,13 +262,13 @@ const addressRoutes: FastifyPluginCallback<Record<never, never>, Server, ZodType
262262
const job = await fastify.transactionProcessor.getTransactionRequest(btcTx.txid);
263263
if (job) {
264264
const { ckbRawTx } = job.data.ckbVirtualResult;
265-
isomorphicTx.ckbRawTx = ckbRawTx;
265+
isomorphicTx.ckbVirtualTx = ckbRawTx;
266266
// if the job is completed, get the ckb tx hash and fetch the ckb tx
267267
const state = await job.getState();
268268
if (state === 'completed') {
269269
const ckbTx = await fastify.ckb.rpc.getTransaction(job.returnvalue);
270270
// remove ckbRawTx to reduce response size
271-
isomorphicTx.ckbRawTx = undefined;
271+
isomorphicTx.ckbVirtualTx = undefined;
272272
setCkbTxAndStatus(ckbTx);
273273
}
274274
return isomorphicTx;
@@ -350,19 +350,19 @@ const addressRoutes: FastifyPluginCallback<Record<never, never>, Server, ZodType
350350
let txs = await Promise.all(
351351
btcTxs.map(async (btcTx) => {
352352
const isomorphicTx = await getIsomorphicTx(btcTx);
353-
const isRgbpp = isomorphicTx.ckbRawTx || isomorphicTx.ckbTx;
353+
const isRgbpp = isomorphicTx.ckbVirtualTx || isomorphicTx.ckbTx;
354354
if (!isRgbpp) {
355355
return {
356356
btcTx,
357357
isRgbpp: false,
358358
} as const;
359359
}
360360

361-
const inputOutpoints = isomorphicTx.ckbRawTx?.inputs || isomorphicTx.ckbTx?.inputs || [];
361+
const inputOutpoints = isomorphicTx.ckbVirtualTx?.inputs || isomorphicTx.ckbTx?.inputs || [];
362362
const inputs = await fastify.ckb.getInputCellsByOutPoint(
363363
inputOutpoints.map((input) => input.previousOutput) as CKBComponents.OutPoint[],
364364
);
365-
const outputs = isomorphicTx.ckbRawTx?.outputs || isomorphicTx.ckbTx?.outputs || [];
365+
const outputs = isomorphicTx.ckbVirtualTx?.outputs || isomorphicTx.ckbTx?.outputs || [];
366366

367367
return {
368368
btcTx,

Diff for: src/routes/rgbpp/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export const XUDTBalance = z.object({
9696
export type XUDTBalance = z.infer<typeof XUDTBalance>;
9797

9898
export const IsomorphicTransaction = z.object({
99-
ckbRawTx: CKBRawTransaction.optional(),
99+
ckbVirtualTx: CKBRawTransaction.optional(),
100100
ckbTx: CKBTransaction.optional(),
101101
inputs: z.array(OutputCell).optional(),
102102
outputs: z.array(OutputCell).optional(),

0 commit comments

Comments
 (0)