Skip to content

Commit 5da34c8

Browse files
committed
Add method to BitboxNetwork class:
* getTransactionDetails
1 parent 47a8bf6 commit 5da34c8

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lib/bitboxnetwork.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,18 @@ export class BitboxNetwork implements SlpValidator {
3333
return this.slp.parseSlpOutputScript(txn.outputs[0]._scriptBuffer);
3434
}
3535

36+
async getTransactionDetails(txid: string) {
37+
let txn: any = (await this.BITBOX.Transaction.details([ txid ]))[0];
38+
try {
39+
txn.tokenInfo = await this.getTokenInformation(txid);
40+
txn.tokenIsValid = await this.validator.isValidSlpTxid(txid);
41+
} catch(_) {
42+
txn.tokenInfo = null;
43+
txn.tokenIsValid = false;
44+
}
45+
return txn;
46+
}
47+
3648
async getUtxos(address: string) {
3749
// must be a cash or legacy addr
3850
let res: AddressUtxoResult;

0 commit comments

Comments
 (0)