Exemplo n.º 1
0
        /// <summary>
        /// Creates a transaction in the Partially Signed Transaction format.
        /// Implements the Creator role.
        /// </summary>
        /// <param name="pSBTInputs">The json objects.</param>
        /// <param name="pSBTOutputs">The outputs (key-value pairs), where none of the keys are duplicated.
        ///That is, each address can only appear once</param>
        /// <param name="hexData">Hex-encoded data.</param>
        /// <param name="locktime">Raw locktime. Non-0 value also locktime-activates inputs.</param>
        /// <param name="replaceable">Marks this transaction as BIP125 replaceable.
        ///Allows this transaction to be replaced by a transaction with higher fees. If provided, it is an error if explicit sequence numbers are incompatible.</param>
        /// <returns></returns>

        public async Task <string> CreatePSBT(List <PSBTInput> pSBTInputs, List <PSBTOutput> pSBTOutputs, string hexData, int locktime, bool replaceable)
        {
            CreatePSBT createPSBT = new CreatePSBT()
            {
                PSBT_Inputs = pSBTInputs, PSBT_Outputs = pSBTOutputs, Locktime = locktime, Replaceable = replaceable, Data = hexData
            };
            string response = await httpRequest.SendReq(MethodName.createpsbt, createPSBT);

            return(response);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates a transaction in the Partially Signed Transaction format.
        /// Implements the Creator role.
        /// </summary>
        /// <param name="pSBTInputs">The json objects.</param>
        /// <param name="pSBTOutputs">The outputs (key-value pairs), where none of the keys are duplicated.
        ///That is, each address can only appear once</param>
        /// <param name="hexData">Hex-encoded data.</param>
        /// <returns></returns>
        public async Task <string> CreatePSBT(List <PSBTInput> pSBTInputs, List <PSBTOutput> pSBTOutputs, string hexData)
        {
            CreatePSBT createPSBT = new CreatePSBT()
            {
                PSBT_Inputs = pSBTInputs, PSBT_Outputs = pSBTOutputs, Data = hexData
            };

            string response = await httpRequest.SendReq(MethodName.createpsbt, createPSBT);

            return(response);
        }