MCPcopy Create free account
hub / github.com/citp/BlockSci / AddAddressMethods

Class AddAddressMethods

blockscipy/src/scripts/address_proxy_py.cpp:47–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45};
46
47struct AddAddressMethods {
48 template <typename FuncApplication>
49 void operator()(FuncApplication func) {
50 func(property_tag, "address_num", &AnyScript::getScriptNum, "The internal identifier of the address");
51 func(property_tag, "type", &AnyScript::getType, "The type of address");
52 func(property_tag, "full_type", &AnyScript::fullType, "The full type of the address");
53 func(property_tag, "raw_type", +[](AnyScript &address) {
54 return static_cast<int64_t>(address.getType());
55 }, "The type of address");
56 func(method_tag, "equiv", &AnyScript::getEquivAddresses, "Returns a list of all addresses equivalent to this address", pybind11::arg("equiv_script") = true);
57 func(method_tag, "balance", &AnyScript::calculateBalance, "Calculates the balance held by this address at the height (Defaults to the full chain)", pybind11::arg("height") = -1);
58
59 func(method_tag, "out_txes_count", +[](AnyScript &address) -> int64_t {
60 pybind11::print("Warning: `out_txes_count` is deprecated. Use `output_txes_count` instead.");
61 return ranges::distance(address.getOutputTransactions());
62 }, "Return the number of transactions where this address appeared in an output");
63 func(method_tag, "output_txes_count", +[](AnyScript &address) -> int64_t {
64 return ranges::distance(address.getOutputTransactions());
65 }, "Return the number of transactions where this address appeared in an output");
66
67 func(method_tag, "in_txes_count", +[](AnyScript &address) -> int64_t {
68 pybind11::print("Warning: `in_txes_count` is deprecated. Use `input_txes_count` instead.");
69 return ranges::distance(address.getInputTransactions());
70 }, "Return the number of transactions where this address appeared in an input");
71 func(method_tag, "input_txes_count", +[](AnyScript &address) -> int64_t {
72 return ranges::distance(address.getInputTransactions());
73 }, "Return the number of transactions where this address was an input");
74
75 func(property_tag, "first_tx", &AnyScript::getFirstTransaction, "Get the first transaction that was sent to a type equivalent address");
76 func(property_tag, "revealed_tx", &AnyScript::getTransactionRevealed, "The transaction where a type equivalent address was first revealed");
77 func(property_tag, "has_been_spent", &AnyScript::hasBeenSpent, "Check if a type equivalent address has ever been spent");
78
79 func(property_tag, "outs", +[](AnyScript &address) -> RawIterator<Output> {
80 pybind11::print("Warning: `outs` is deprecated. Use `outputs` instead.");
81 return address.getOutputs();
82 }, "Returns a iterator over all outputs sent to this address");
83 func(property_tag, "outputs", +[](AnyScript &address) -> RawIterator<Output> {
84 return address.getOutputs();
85 }, "Returns a iterator over all outputs sent to this address");
86
87 func(property_tag, "ins", +[](AnyScript &address) -> RawIterator<Input> {
88 pybind11::print("Warning: `ins` is deprecated. Use `inputs` instead.");
89 return address.getInputs();
90 }, "Returns an iterator over all inputs spent from this address");
91 func(property_tag, "inputs", +[](AnyScript &address) -> RawIterator<Input> {
92 return address.getInputs();
93 }, "Returns an iterator over all inputs spent from this address");
94
95 func(property_tag, "out_txes", +[](AnyScript &address) -> RawIterator<Transaction> {
96 pybind11::print("Warning: `out_txes` is deprecated. Use `output_txes` instead.");
97 return address.getOutputTransactions();
98 }, "Returns an iterator over all transactions where this address appeared in an output");
99 func(property_tag, "output_txes", +[](AnyScript &address) -> RawIterator<Transaction> {
100 return address.getOutputTransactions();
101 }, "Returns an iterator over all transactions where this address appeared in an output");
102
103 func(property_tag, "in_txes", +[](AnyScript &address) -> RawIterator<Transaction> {
104 pybind11::print("Warning: `in_txes` is deprecated. Use `input_txes` instead.");

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected