Skip to content

Commit

Permalink
Update generateTxb.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
daoauth committed Dec 24, 2024
1 parent 831bb95 commit 63e44d8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/ptb-builder/src/utilities/ptb/generateTxb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ const genereateCommand = (
throw new Error(`Invalid parameters for ${node.type}`);
}
case PTBNodeType.MergeCoins: {
const destination = inputs[0][0];
const destination = connvert(inputs[0][0], dictionary);
const sources = inputs[1].map((v) => connvert(v, dictionary));
if (destination && dictionary[destination]) {
if (destination) {
tx.mergeCoins(
dictionary[destination] as TransactionObjectArgument,
destination as TransactionObjectArgument,
sources as TransactionObjectArgument[],
);
return { tx };
Expand All @@ -81,11 +81,11 @@ const genereateCommand = (
}
case PTBNodeType.TransferObjects: {
const objects = inputs[1].map((v) => connvert(v, dictionary));
const address = inputs[0][0];
if (address && dictionary[address]) {
const address = connvert(inputs[0][0], dictionary);
if (address) {
tx.transferObjects(
objects as TransactionObjectArgument[],
dictionary[address] as TransactionObjectArgument,
address as TransactionObjectArgument,
);
return { tx };
}
Expand Down

0 comments on commit 63e44d8

Please sign in to comment.