From 423668d1f1dbc762742ae75ebab248ff0adec2f9 Mon Sep 17 00:00:00 2001 From: RetricSu Date: Wed, 23 Oct 2024 11:38:23 +0800 Subject: [PATCH] fix(ccc): use completeInputsByCapacity --- examples/simple-transfer/lib.ts | 2 +- examples/store-data-on-cell/lib.ts | 2 +- examples/xudt/lib.ts | 2 +- website/docs/dapp/create-token.mdx | 2 +- website/docs/dapp/transfer-ckb.mdx | 2 +- website/docs/dapp/write-message.mdx | 2 +- website/docs/sdk-and-devtool/ccc.mdx | 4 ++-- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/simple-transfer/lib.ts b/examples/simple-transfer/lib.ts index 3def435e..d5969ac3 100644 --- a/examples/simple-transfer/lib.ts +++ b/examples/simple-transfer/lib.ts @@ -49,7 +49,7 @@ export async function transfer( }); // Complete missing parts for transaction - await tx.completeInputsAll(signer); + await tx.completeInputsByCapacity(signer); await tx.completeFeeBy(signer, 1000); const txHash = await signer.sendTransaction(tx); console.log( diff --git a/examples/store-data-on-cell/lib.ts b/examples/store-data-on-cell/lib.ts index 76b09024..e3572f2f 100644 --- a/examples/store-data-on-cell/lib.ts +++ b/examples/store-data-on-cell/lib.ts @@ -60,7 +60,7 @@ export async function buildMessageTx( }); // Complete missing parts for transaction - await tx.completeInputsAll(signer); + await tx.completeInputsByCapacity(signer); await tx.completeFeeBy(signer, 1000); const txHash = await signer.sendTransaction(tx); alert(`The transaction hash is ${txHash}`); diff --git a/examples/xudt/lib.ts b/examples/xudt/lib.ts index c05ec85f..f173cc10 100644 --- a/examples/xudt/lib.ts +++ b/examples/xudt/lib.ts @@ -46,7 +46,7 @@ export async function issueToken(privKey: string, amount: string) { // additional 0.001 ckb for tx fee // Complete missing parts for transaction - await tx.completeInputsAll(signer); + await tx.completeInputsByCapacity(signer); await tx.completeFeeBy(signer, 1000); const txHash = await signer.sendTransaction(tx); console.log( diff --git a/website/docs/dapp/create-token.mdx b/website/docs/dapp/create-token.mdx index 3f58be6b..6f594ceb 100644 --- a/website/docs/dapp/create-token.mdx +++ b/website/docs/dapp/create-token.mdx @@ -102,7 +102,7 @@ Next, to complete our `issueToken` function, we just use the `helpers.Transactio await tx.addCellDepsOfKnownScripts(signer.client, ccc.KnownScript.XUdt); // additional 0.001 ckb for tx fee // Complete missing parts for transaction - await tx.completeInputsAll(signer); + await tx.completeInputsByCapacity(signer); await tx.completeFeeBy(signer, 1000); ... diff --git a/website/docs/dapp/transfer-ckb.mdx b/website/docs/dapp/transfer-ckb.mdx index c9e3f033..5811653c 100644 --- a/website/docs/dapp/transfer-ckb.mdx +++ b/website/docs/dapp/transfer-ckb.mdx @@ -126,7 +126,7 @@ Next, we need to complete the inputs of the transaction. //.... // Complete missing parts for transaction -await tx.completeInputsAll(signer); +await tx.completeInputsByCapacity(signer); await tx.completeFeeBy(signer, 1000); ``` diff --git a/website/docs/dapp/write-message.mdx b/website/docs/dapp/write-message.mdx index 2968d5b1..68b503f5 100644 --- a/website/docs/dapp/write-message.mdx +++ b/website/docs/dapp/write-message.mdx @@ -105,7 +105,7 @@ Next, we ask CCC to complete the transaction for us with transaction fee: ```ts // Complete missing parts for transaction -await tx.completeInputsAll(signer); +await tx.completeInputsByCapacity(signer); await tx.completeFeeBy(signer, 1000); ``` diff --git a/website/docs/sdk-and-devtool/ccc.mdx b/website/docs/sdk-and-devtool/ccc.mdx index 681df2d5..662c0adb 100644 --- a/website/docs/sdk-and-devtool/ccc.mdx +++ b/website/docs/sdk-and-devtool/ccc.mdx @@ -347,7 +347,7 @@ return; }); // Complete missing parts for transaction - await tx.completeInputsAll(signer); + await tx.completeInputsByCapacity(signer); // Change all balance to the first output await tx.completeFeeChangeToOutput(signer, 0, 1000); const amount = ccc.fixedPointToString(tx.outputs[0].capacity); @@ -1396,7 +1396,7 @@ export default function Transfer() { ccc.KnownScript.NervosDao, ); - await tx.completeInputsAll(signer); + await tx.completeInputsByCapacity(signer); await tx.completeFeeChangeToOutput(signer, 0, 1000); const amount = ccc.fixedPointToString(tx.outputs[0].capacity);