make transactionBuilder.inputs public to generate SourceOutputs
For walletConnect signing with SIGHASH_UTXOS, users need access to the transactions' sourceOutputs.
It is easy to generate sourceOutputs with the transactionBuilder.inputs
but transactionBuilder.inputs is currently a private property.
// Generate source outputs from inputs (for signing with SIGHASH_UTXOS)
const sourceOutputs = this.inputs.map((input) => {
const sourceOutput = {
amount: input.satoshis,
to: input.unlocker.generateLockingBytecode(),
token: input.token,
};
return cashScriptOutputToLibauthOutput(sourceOutput);
});
releated to issue https://github.com/CashScript/cashscript/issues/191 "Create a way for the advanced transaction builder to communicate with WalletConnect for signing"
somewhat related, the ninjas.cash mint used the following code when constructing the listSourceOutputs for walletconnect
contract: {
abiFunction: transaction.abiFunction,
redeemScript: contract.redeemScript,
artifact: contract.artifact,
}
https://github.com/cashninjas/ninjas.cash/blob/ee64614776d95389dcb1389e9760be574aea8c0a/js/mint.js#L260
however as Salemkode pointed out transaction.abiFunction is private in TS
transactionBuilder.inputs and transaction.abiFunction are now public in v0.10.0 😄
so this issue can be closed now 👍 pinging @salemkode