Skip to content

Commit

Permalink
add submitpackage methods
Browse files Browse the repository at this point in the history
replace colon with semicolon

remove venv and html

add submitpackage methods
  • Loading branch information
f321x committed Feb 6, 2025
1 parent 37ea4b2 commit 14386d6
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/protocol-changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -175,3 +175,12 @@ New methods
-----------

* :func:`blockchain.name.get_value_proof` to resolve a name (with proof). Name index coins (e.g. Namecoin) only.


Version 1.4.4
=============

New methods
-----------

* :func:`blockchain.transaction.broadcast_package` to broadcast a package of transactions (submitpackage).
64 changes: 64 additions & 0 deletions docs/protocol-methods.rst
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,70 @@ Protocol version 1.0 returning an error as the result:

"258: txn-mempool-conflict"

blockchain.transaction.broadcast_package
========================================

Broadcast a package of transactions to the network (submitpackage). The package must consist of a child with its parents,
and none of the parents may depend on one another.

**Signature**

.. function:: blockchain.transaction.broadcast_package([raw_txs]; verbose=false)

*[raw_txs]*

An array of raw transactions as hexadecimal strings.

*verbose*

Whether a verbose coin-specific response is required.

**Result**

If *verbose* is :const:`false`:

The package_msg and replaced_txs, a list of txids of replaced transactions.

If *verbose* is :const:`true`:

The Bitcoin Core daemon result according to its RPC API documentation.

**Result Example**

When *verbose* is :const:`false`::

{
"package_msg": "success",
"replaced-transactions": []
}

When *verbose* is :const:`true`::

{ (json object)
"package_msg" : "str", (string) The transaction package result message. "success" indicates all transactions were accepted into or are already in the mempool.
"tx-results" : { (json object) transaction results keyed by wtxid
"wtxid" : { (json object) transaction wtxid
"txid" : "hex", (string) The transaction hash in hex
"other-wtxid" : "hex", (string, optional) The wtxid of a different transaction with the same txid but different witness found in the mempool. This means the submitted transaction was ignored.
"vsize" : n, (numeric, optional) Sigops-adjusted virtual transaction size.
"fees" : { (json object, optional) Transaction fees
"base" : n, (numeric) transaction fee in BTC
"effective-feerate" : n, (numeric, optional) if the transaction was not already in the mempool, the effective feerate in BTC per KvB. For example, the package feerate and/or feerate with modified fees from prioritisetransaction.
"effective-includes" : [ (json array, optional) if effective-feerate is provided, the wtxids of the transactions whose fees and vsizes are included in effective-feerate.
"hex", (string) transaction wtxid in hex
...
]
},
"error" : "str" (string, optional) The transaction error string, if it was rejected by the mempool
},
...
},
"replaced-transactions" : [ (json array, optional) List of txids of replaced transactions
"hex", (string) The transaction id
...
]
}

blockchain.transaction.get
==========================

Expand Down

0 comments on commit 14386d6

Please sign in to comment.