Esempio n. 1
0
    public static Transaction BuildTxnFromUtxo(Key spender, UTXO utxo, byte[][] msg)
    {
        // Debug.Log($"Building utxo with: {JsonConvert.SerializeObject(utxo)}");

        return(BuildTxn(utxo.ToCoin(spender), spender,
                        new[] // Outs
        {
            new KeyValuePair <Script, Money>(TxNullDataTemplate.Instance.GenerateScriptPubKey(msg), Money.Zero)
        }));
    }
Esempio n. 2
0
    public static Transaction BuildSubmitTxnFromUtxo(Key spender, UTXO utxo, byte[][] msg, string payeeAddr, long funds)
    {
        // Debug.Log($"Building utxo with: {JsonConvert.SerializeObject(utxo)}");
        var payeeAddress = new BitcoinPubKeyAddress(payeeAddr);

        return(BuildTxn(utxo.ToCoin(spender), spender,
                        new[] // Outs
        {
            new KeyValuePair <Script, Money>(TxNullDataTemplate.Instance.GenerateScriptPubKey(msg), Money.Zero),
            new KeyValuePair <Script, Money>(payeeAddress.ScriptPubKey, new Money(funds, MoneyUnit.Satoshi))
        }));
    }
Esempio n. 3
0
 public static Coin ToCoin(this UTXO utxo, Key owner)
 {
     return(utxo.ToCoin(owner.ScriptPubKey));
 }