From edf875cb44f249df49759ac2e5fef25c1a999856 Mon Sep 17 00:00:00 2001 From: Dylan Duan Date: Wed, 3 Jul 2024 13:41:40 +0800 Subject: [PATCH] refactor: Remove witnessIndex for ckb demo --- examples/ckb-demo/src/pages/SignCkbRawTx/index.tsx | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/examples/ckb-demo/src/pages/SignCkbRawTx/index.tsx b/examples/ckb-demo/src/pages/SignCkbRawTx/index.tsx index 734b9a0..585687c 100644 --- a/examples/ckb-demo/src/pages/SignCkbRawTx/index.tsx +++ b/examples/ckb-demo/src/pages/SignCkbRawTx/index.tsx @@ -132,7 +132,7 @@ export function SignCkbRawTx() { toast({ status: 'error', title: 'Xudt type script cannot be empty' }) return } - const { rawTx, listPackage, witnessIndex } = await buildMakerTx({ + const { rawTx, listPackage } = await buildMakerTx({ collector: dexCollector, // @ts-ignore joyID: joyID as DexJoyIDConfig, @@ -145,9 +145,7 @@ export function SignCkbRawTx() { status: 'info', title: `List package is: ${listPackage / BigInt(10 ** 8)}CKB`, }) - const signedTx = await signRawTransaction(rawTx, ckbAddress!, { - witnessIndex, - }) + const signedTx = await signRawTransaction(rawTx, ckbAddress!) const hash = await collector.getCkb().rpc.sendTransaction(signedTx) setListHash(hash) } @@ -164,16 +162,14 @@ export function SignCkbRawTx() { const orderOutPoints = [ bytes.hexify(blockchain.OutPoint.pack(orderOutPoint)), ] - const { rawTx, witnessIndex } = await buildCancelTx({ + const { rawTx } = await buildCancelTx({ collector: dexCollector, // @ts-ignore joyID: joyID as DexJoyIDConfig, seller: ckbAddress!, orderOutPoints, }) - const signedTx = await signRawTransaction(rawTx, ckbAddress!, { - witnessIndex, - }) + const signedTx = await signRawTransaction(rawTx, ckbAddress!) const hash = await collector.getCkb().rpc.sendTransaction(signedTx) setCancelHash(hash) }