From f8427274cc7f77f5901ea732f79dd4d641adb956 Mon Sep 17 00:00:00 2001 From: junderw Date: Sat, 29 Dec 2018 23:00:32 +0900 Subject: [PATCH] Add a few type aliases to TransactionBuilder --- src/transaction_builder.ts | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/src/transaction_builder.ts b/src/transaction_builder.ts index 8977364..b3c6ee0 100644 --- a/src/transaction_builder.ts +++ b/src/transaction_builder.ts @@ -16,31 +16,36 @@ const typeforce = require('typeforce') const SCRIPT_TYPES = classify.types +type TxbSignatures = Array | Array +type TxbPubkeys = Array +type TxbWitness = Array +type TxbScriptType = string +type TxbScript = Buffer interface TxbInput { value?: number hasWitness?: boolean - signScript?: Buffer - signType?: string - prevOutScript?: Buffer - redeemScript?: Buffer - redeemScriptType?: string - prevOutType?: string - pubkeys?: Array - signatures?: Array | Array - witness?: Array - witnessScript?: Buffer - witnessScriptType?: string - script?: Buffer + signScript?: TxbScript + signType?: TxbScriptType + prevOutScript?: TxbScript + redeemScript?: TxbScript + redeemScriptType?: TxbScriptType + prevOutType?: TxbScriptType + pubkeys?: TxbPubkeys + signatures?: TxbSignatures + witness?: TxbWitness + witnessScript?: TxbScript + witnessScriptType?: TxbScriptType + script?: TxbScript sequence?: number - scriptSig?: Buffer + scriptSig?: TxbScript maxSignatures?: number } interface TxbOutput { type: string - pubkeys?: Array - signatures?: Array | Array + pubkeys?: TxbPubkeys + signatures?: TxbSignatures maxSignatures?: number }