Skip to content

Commit

Permalink
refactor: Remove witnessIndex for ckb demo
Browse files Browse the repository at this point in the history
  • Loading branch information
duanyytop committed Jul 3, 2024
1 parent c48c154 commit edf875c
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions examples/ckb-demo/src/pages/SignCkbRawTx/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)
}
Expand All @@ -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)
}
Expand Down

0 comments on commit edf875c

Please sign in to comment.