Skip to content

Commit

Permalink
refactor(sdk): add optional destination address arg to receive inscri…
Browse files Browse the repository at this point in the history
…ption (#58)

refactor: add option to pass optional destination address for inscription
  • Loading branch information
iamcrazycoder authored Sep 4, 2023
1 parent 68a82fd commit 2befd29
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/sdk/src/inscription/instant-buy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ export async function generateBuyerPsbt({
feeRate = 10,
network = "testnet",
sellerPsbt,
inscriptionOutPoint
inscriptionOutPoint,
inscriptionDestinationAddress
}: GenerateBuyerInstantBuyPsbtOptions) {
const networkObj = getNetwork(network)
const format = addressNameToType[pubKeyType]
Expand Down Expand Up @@ -114,7 +115,7 @@ export async function generateBuyerPsbt({

// Add ordinal output
psbt.addOutput({
address: address.address!,
address: inscriptionDestinationAddress || address.address!,
value: postage
})

Expand Down Expand Up @@ -310,6 +311,7 @@ export interface GenerateBuyerInstantBuyPsbtOptions {
feeRate?: number
inscriptionOutPoint: string
sellerPsbt: string
inscriptionDestinationAddress?: string
}

export interface GenerateRefundableUTXOsOptions {
Expand Down

0 comments on commit 2befd29

Please sign in to comment.