Skip to content

Commit

Permalink
update multi input locks networks
Browse files Browse the repository at this point in the history
  • Loading branch information
duanyytop committed Mar 8, 2024
1 parent ec07a01 commit d864f35
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/ckb/src/rgbpp/ckb-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const appendPaymasterCellAndSignCkbTx = async ({
ckbRawTx,
sumInputsCapacity,
paymasterCell,
isMainnet,
}: AppendPaymasterCellAndSignTxParams) => {
let rawTx = ckbRawTx;
const paymasterInput = { previousOutput: paymasterCell.outPoint, since: '0x0' };
Expand All @@ -58,12 +59,11 @@ export const appendPaymasterCellAndSignCkbTx = async ({

let keyMap = new Map<string, string>();
keyMap.set(scriptToHash(paymasterCell.output.lock), secp256k1PrivateKey);
// The 0x00 is placeholder for rpbpp cell and it has no effect on transaction signatures
keyMap.set('0x00', '');
keyMap.set(scriptToHash(getRgbppLockScript(isMainnet)), '');

const cells = ckbRawTx.inputs.map((input, index) => ({
outPoint: input.previousOutput,
lock: index === 0 ? paymasterCell.output.lock : getRgbppLockScript(false),
lock: index === 0 ? paymasterCell.output.lock : getRgbppLockScript(isMainnet),
}));

const transactionHash = rawTransactionToHash(rawTx);
Expand Down
1 change: 1 addition & 0 deletions packages/ckb/src/types/rgbpp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export interface AppendPaymasterCellAndSignTxParams {
ckbRawTx: CKBComponents.RawTransaction;
sumInputsCapacity: bigint;
paymasterCell: IndexerCell;
isMainnet?: boolean;
}

export interface SendCkbTxParams {
Expand Down

0 comments on commit d864f35

Please sign in to comment.