Skip to content

Commit

Permalink
Originator
Browse files Browse the repository at this point in the history
  • Loading branch information
ty-everett committed Feb 22, 2025
1 parent 03d9981 commit 774d5b6
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/script/templates/PushDrop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const createMinimallyEncodedScriptChunk = (

export default class PushDrop implements ScriptTemplate {
wallet: WalletInterface
originator?: string

/**
* Decodes a PushDrop script back into its token fields and the locking public key. If a signature was present, it will be the last field returned.
Expand Down Expand Up @@ -105,9 +106,11 @@ export default class PushDrop implements ScriptTemplate {
* Constructs a new instance of the PushDrop class.
*
* @param {WalletInterface} wallet - The wallet interface used for creating signatures and accessing public keys.
* @param {string} originator — The originator to use with Wallet requests
*/
constructor(wallet: WalletInterface) {
constructor(wallet: WalletInterface, originator?: string) {
this.wallet = wallet
this.originator = originator
}

/**
Expand Down Expand Up @@ -135,7 +138,7 @@ export default class PushDrop implements ScriptTemplate {
keyID,
counterparty,
forSelf
})
}, this.originator)
const lockChunks: Array<{ op: number, data?: number[] }> = []
const pushDropChunks: Array<{ op: number, data?: number[] }> = []
lockChunks.push({
Expand All @@ -150,7 +153,7 @@ export default class PushDrop implements ScriptTemplate {
protocolID,
keyID,
counterparty
})
}, this.originator)
fields.push(signature)
}
for (const field of fields) {
Expand Down Expand Up @@ -263,7 +266,7 @@ export default class PushDrop implements ScriptTemplate {
protocolID,
keyID,
counterparty
})
}, this.originator)
const signature = Signature.fromDER([...bareSignature])
const txSignature = new TransactionSignature(
signature.r,
Expand Down

0 comments on commit 774d5b6

Please sign in to comment.