More details in tx signing section. First pass as a tx creation sample in JS using bitcoinjs.