Skip to content

Commit

Permalink
fix(sdk): exit when royalty is not defined (#86)
Browse files Browse the repository at this point in the history
fix: exit when royalty is not defined
  • Loading branch information
iamcrazycoder authored Oct 20, 2023
1 parent d5139f5 commit 95f30f7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/sdk/src/instant-trade/InstantTradeBuyerTxBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ export default class InstantTradeBuyerTxBuilder extends InstantTradeBuilder {

private decodeRoyalty() {
const royaltyOutput = (this.sellerPSBT.data.globalMap.unsignedTx as any).tx.outs[1]
if (!royaltyOutput) return

const scriptPayload = getScriptType(royaltyOutput.script, this.network).payload
const amount = royaltyOutput && royaltyOutput.value >= MINIMUM_AMOUNT_IN_SATS ? royaltyOutput.value : 0
const receiver = scriptPayload ? scriptPayload.address : null
Expand Down

0 comments on commit 95f30f7

Please sign in to comment.