Skip to content

Commit

Permalink
Allow user to copy the raw transaction from the app peercoin#5
Browse files Browse the repository at this point in the history
  • Loading branch information
Matvei Vasily committed Jan 14, 2020
1 parent 140eca2 commit 5b866f4
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ export class Document {
addUri(uri: string, spender: Spender): Promise<TxId> {
return this.considerAddingUri(uri, spender).commit();
}

getRawTransaction(hash: HexHashes, spender: Spender): RawOrHex {
return this.considerUpdatingContent(hash, spender).getRawTransaction();
}
}

export class Update {
Expand Down Expand Up @@ -303,6 +307,15 @@ export class Update {
return retTxId;
}

getRawTransaction(): RawOrHex {
let rawTx: RawOrHex = "";
for (const tx of this.queue) {
rawTx = (tx as any).toBuffer().toString('hex');
}

return rawTx;
}

abort() {
this.spender.unallocate(this.undo);
this.reset();
Expand Down

0 comments on commit 5b866f4

Please sign in to comment.