Skip to content

Commit

Permalink
Merge pull request #50 from ckb-cell/fix/paymaster-change
Browse files Browse the repository at this point in the history
fix(rgbpp-sdk/ckb): Update paymaster tx change capacity
  • Loading branch information
ahonn authored Mar 25, 2024
2 parents c1e5d6c + 4dafcfc commit 2913020
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/ckb/src/rgbpp/ckb-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ export const appendPaymasterCellAndSignCkbTx = async ({
if (inputsCapacity <= sumOutputsCapacity) {
throw new InputsCapacityNotEnoughError('The sum of inputs capacity is not enough');
}
const changeCapacity = inputsCapacity - sumOutputsCapacity - estimatedTxFee;
rawTx.outputs[rawTx.outputs.length - 1].capacity = append0x(changeCapacity.toString(16));
const lastOutputCapacity = BigInt(rawTx.outputs[rawTx.outputs.length - 1].capacity) - estimatedTxFee;
rawTx.outputs[rawTx.outputs.length - 1].capacity = append0x(lastOutputCapacity.toString(16));

let keyMap = new Map<string, string>();
keyMap.set(scriptToHash(paymasterCell.output.lock), secp256k1PrivateKey);
Expand Down

1 comment on commit 2913020

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[{"name":"@rgbpp-sdk/btc","version":"0.0.0-snap-20240325112732"},{"name":"@rgbpp-sdk/ckb","version":"0.0.0-snap-20240325112732"}]

Please sign in to comment.