Skip to content

Commit

Permalink
return box confirmation state on get_utxos()
Browse files Browse the repository at this point in the history
  • Loading branch information
capt-nemo429 committed Oct 16, 2022
1 parent 214ff4e commit e1d9f62
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/background/ergoApiHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,16 @@ export async function handleGetBoxesRequest(
}
}

console.log("target", target);

const boxes = await fetchBoxes(session.walletId);
const selector = new BoxSelector(boxes.map((box) => new ErgoUnsignedInput(box)));

postConnectorResponse(
{
isSuccess: true,
data: selector.select(target).map((box) => box.toObject("EIP-12"))
data: selector.select(target).map((box) => ({
...box.toObject("EIP-12"),
confirmed: boxes.find((x) => x.boxId === box.boxId)?.confirmed || false
}))
},
request,
port
Expand Down

0 comments on commit e1d9f62

Please sign in to comment.