Get Outputs
You can learn more about Outputs in the Messages, Payloads and Transactions section.
There are three functions you can use to get Unspent Transaction Output (UTXO) outputs related an address.
- Java
- Nodejs
- Python
- Rust
- Wasm
Client.get_address().outputs(address: String, options: OutputOptions)
Client.getOutput(str)
Client.findOutputs(output_ids, addresses)
:
Client.get_address().outputs(address: String, options: OutputOptions)
This Client.get_address().outputs(address: String, options: OutputOptions)
expects an address in Bech32 format and will get all outputs that use a given address. You can use OutputOptions to limit the returned results.
loading...
Output example:
[
"0f2d5d2651f8061a9f5417d0658009f32b2e3f77f9706b0be3b4b3f466171f360000",
"7614ba900a90b130707766a660a454942ac7cc4adea3fb9ad0cdca90114417c20000",
"768c20c15a290e02a43b83263a98501b9d7eb0b57da40a9247289c672de63ea60000"
]
Client.getOutput(output_id: String)
The Client.getOutput(output_id: String)
function to get metadata about the an output_id
:
Client.findOutputs(output_ids:String[], addresses:String[])
The
Client.findOutputs(output_ids:String[], addresses:String[])
function expects an array of Strings representing the output ids to look up, as well as an array of Strings representing
the addresses to look up.
Client.getAddressOutputs(str)
Client.getOutput(str)
Client.findOutputs(output_ids (optional), addresses (optional))
:
Client.getAddressOutputs(str)
This Client.getAddressOutputs(str)
expects an address in Bech32 format and returns a str[]
of output_ids
.
loading...
Output example:
[
"0f2d5d2651f8061a9f5417d0658009f32b2e3f77f9706b0be3b4b3f466171f360000",
"7614ba900a90b130707766a660a454942ac7cc4adea3fb9ad0cdca90114417c20000",
"768c20c15a290e02a43b83263a98501b9d7eb0b57da40a9247289c672de63ea60000"
]
Client.getOutput(str)
You can use the Client.getOutput(str)
function to get metadata about the an output_id
:
loading...
Output example:
{
"messageId": "f303bc90a5ed3ef15af5fc6aa81a739978c59458a71e68ce8e380f1f534da1e6",
"transactionId": "0f2d5d2651f8061a9f5417d0658009f32b2e3f77f9706b0be3b4b3f466171f36",
"outputIndex": 0,
"isSpent": false,
"address": "atoi1qzt0nhsf38nh6rs4p6zs5knqp6psgha9wsv74uajqgjmwc75ugupx3y7x0r",
"amount": 1000000
}
Client.findOutputs(output_ids (optional), addresses (optional))
The function Client.findOutputs()
is a convenient shortcut combining both Client.getAddressOutputs(str)
and
Client.getOutput(str)
methods in a single call. It supports two arguments, a list of output_ids
or a list of
addresses
.
loading...
Output example:
[
{
"messageId": "f303bc90a5ed3ef15af5fc6aa81a739978c59458a71e68ce8e380f1f534da1e6",
"transactionId": "0f2d5d2651f8061a9f5417d0658009f32b2e3f77f9706b0be3b4b3f466171f36",
"outputIndex": 0,
"isSpent": false,
"address": "atoi1qzt0nhsf38nh6rs4p6zs5knqp6psgha9wsv74uajqgjmwc75ugupx3y7x0r",
"amount": 1000000
},
{
"messageId": "825266a79c0ffb6001ed263eb150357863b7d0052627c5766e8ef5acd6fed533",
"transactionId": "768c20c15a290e02a43b83263a98501b9d7eb0b57da40a9247289c672de63ea6",
"outputIndex": 0,
"isSpent": false,
"address": "atoi1qzt0nhsf38nh6rs4p6zs5knqp6psgha9wsv74uajqgjmwc75ugupx3y7x0r",
"amount": 1000000
}
]
messageId
: Refers to the encapsulating message in which the transaction was sent.transactionId
,outputIndex
: Refers to the output within theSignedTransaction
payload. There may be severaloutputs
involved in a single transaction, so thetransactionId
by itself would not be enough.output
: This section provides details about the iota address to which the given unspent transaction output is coupled with.amount
: States an amount of tokens related to theoutput
.isSpent
: Indicates whether the givenoutput
is a part of the actual ledger state or not. As mentioned in the Messages, Payloads, and Transactions section, if an output was already spent it is not part of the ledger state any more and is replaced by some otheroutput(s)
in the process.
Notice that the outputId
that was used in a function call to get output details is the same as a combination of the
transactionId
and outputIndex
. This way a transaction is tightly coupled with outputs
since the
SignedTransaction
payload is a main vehicle to create and spend outputs
, and everything is encapsulated in a
message.
Client.get_address_outputs(str)
Client.get_output(str)
Client.find_outputs(output_ids (optional), addresses (optional))
Client.get_address_outputs(address, options (optional))
The Client.get_address_outputs(str)
function expects an address in Bech32 format and returns a str[]
of
output_ids
.
loading...
Output example:
Output index: 0; raw transaction id: [162, 44, 186, 6, 103, 201, 34, 203, 177, 248, 189, 202, 249, 112, 178, 168, 129, 204, 214, 232, 142, 47, 204, 229, 3, 116, 222, 42, 172, 124, 55, 114]
`output_id` encoded in hex: a22cba0667c922cbb1f8bdcaf970b2a881ccd6e88e2fcce50374de2aac7c37720000
- The
UTXO
output is represented by outputindex
andtransaction_id
.transaction_id
is basically a list of 32bytes
.index
is 2-bytes (16bits)uint
. - The
index
andtransaction_id
are usually combined into single hex string of 68 characters = 32 * 2 chars (transaction_id
; 32 bytes in hex) + 4 chars (index
; 2 bytes in hex).
The resulting output_id
is the unique id of the given output
.
Client.get_output(output_id)
You can use the Client.get_output(output_id)
function to get metadata about the an output_id
:
loading...
Output example:
{
"message_id": "f303bc90a5ed3ef15af5fc6aa81a739978c59458a71e68ce8e380f1f534da1e6",
"transaction_id": "0f2d5d2651f8061a9f5417d0658009f32b2e3f77f9706b0be3b4b3f466171f36",
"output_index": 0,
"is_spent": false,
"address": "atoi1qzt0nhsf38nh6rs4p6zs5knqp6psgha9wsv74uajqgjmwc75ugupx3y7x0r",
"amount": 1000000
}
Client.find_outputs(output_ids (optional), addresses (optional))
The function Client.find_outputs(output_ids (optional), addresses (optional))
is a convenient shortcut combining both
Client.get_address_outputs(str)
and Client.get_output(str)
methods in a single call. It supports two arguments, a
list of output_ids
or a list of addresses
.
loading...
Output example:
[
{
"message_id": "f303bc90a5ed3ef15af5fc6aa81a739978c59458a71e68ce8e380f1f534da1e6",
"transaction_id": "0f2d5d2651f8061a9f5417d0658009f32b2e3f77f9706b0be3b4b3f466171f36",
"output_index": 0,
"is_spent": false,
"address": "atoi1qzt0nhsf38nh6rs4p6zs5knqp6psgha9wsv74uajqgjmwc75ugupx3y7x0r",
"amount": 1000000
},
{
"message_id": "825266a79c0ffb6001ed263eb150357863b7d0052627c5766e8ef5acd6fed533",
"transaction_id": "768c20c15a290e02a43b83263a98501b9d7eb0b57da40a9247289c672de63ea6",
"output_index": 0,
"is_spent": false,
"address": "atoi1qzt0nhsf38nh6rs4p6zs5knqp6psgha9wsv74uajqgjmwc75ugupx3y7x0r",
"amount": 1000000
}
]
message_id
: Refers to the encapsulating message in which the transaction was sent.transaction_id
,output_index
: Refers to the output within theSignedTransaction
payload. There may be severaloutputs
involved in a single transaction, so thetransaction_id
by itself would not be enough.output
: This section provides details about the iota address to which the given unspent transaction output is coupled with.amount
: States an amount of tokens related to theoutput
.is_spent
: Indicates whether the givenoutput
is a part of the actual ledger state or not. As mentioned in the Messages, Payloads, and Transactions section, if an output was already spent it is not part of the ledger state any more and is replaced by some otheroutput(s)
in the process.
Notice that the output_id
that was used in a function call to get output details is the same as a combination of the
transaction_id
and output index
. This way a transaction is tightly coupled with outputs
since the
SignedTransaction
payload is a main vehicle to create and spend outputs
, and everything is encapsulated in a
message
.
Client.get_address.get_output( output_id: &UtxoInput)
Client.get_output(output_id: &UtxoInput)
Client.find_outputs(outputs: &[UtxoInput], addresses: &[String])
:
Client.get_address.get_output( output_id: &UtxoInput)
The
Client.get_address.get_output( output_id: &UtxoInput)
function expects an address in Bech32 format and returns a str[]
of output_ids
.
loading...
Output example:
[
"0f2d5d2651f8061a9f5417d0658009f32b2e3f77f9706b0be3b4b3f466171f360000",
"7614ba900a90b130707766a660a454942ac7cc4adea3fb9ad0cdca90114417c20000",
"768c20c15a290e02a43b83263a98501b9d7eb0b57da40a9247289c672de63ea60000"
]
Client.get_output(output_id: &UtxoInput)
The
Client.get_output(output_id: &UtxoInput)
function finds an output by its transaction_id
and corresponding output_index
.
Client.find_outputs(outputs: &[UtxoInput], addresses: &[String])
The
Client.find_outputs(outputs: &[UtxoInput], addresses: &[String])
function supports two arguments, a list of outputs
or a list of addresses
and will return all the outputs related to
the requested criteria.
Client.getAddress().outputs(str)
Client.getOutput(str)
Client.findOutputs(output_ids (optional), addresses (optional))
Client.getAddress().outputs(str)
This
Client.getAddress().outputs(str)
expects an address in Bech32 format and returns a str[]
of output_ids
.
loading...
Output example:
[
"0f2d5d2651f8061a9f5417d0658009f32b2e3f77f9706b0be3b4b3f466171f360000",
"7614ba900a90b130707766a660a454942ac7cc4adea3fb9ad0cdca90114417c20000",
"768c20c15a290e02a43b83263a98501b9d7eb0b57da40a9247289c672de63ea60000"
]
Client.getOutput(str)
The function Client.getOutput(str)
can be
used to get metadata about the given output_id
:
loading...
Output example:
{
"messageId": "f303bc90a5ed3ef15af5fc6aa81a739978c59458a71e68ce8e380f1f534da1e6",
"transactionId": "0f2d5d2651f8061a9f5417d0658009f32b2e3f77f9706b0be3b4b3f466171f36",
"outputIndex": 0,
"isSpent": false,
"address": "atoi1qzt0nhsf38nh6rs4p6zs5knqp6psgha9wsv74uajqgjmwc75ugupx3y7x0r",
"amount": 1000000
}
Client.findOutputs(output_ids (optional), addresses (optional))
The function Client.findOutputs()
is a convenient shortcut combining both Client.getAddressOutputs(str)
and Client.getOutput(str)
methods in a single
call. It supports two arguments, a list of output_ids
or a list of addresses
.
loading...
Output example:
[
{
"messageId": "f303bc90a5ed3ef15af5fc6aa81a739978c59458a71e68ce8e380f1f534da1e6",
"transactionId": "0f2d5d2651f8061a9f5417d0658009f32b2e3f77f9706b0be3b4b3f466171f36",
"outputIndex": 0,
"isSpent": false,
"address": "atoi1qzt0nhsf38nh6rs4p6zs5knqp6psgha9wsv74uajqgjmwc75ugupx3y7x0r",
"amount": 1000000
},
{
"messageId": "825266a79c0ffb6001ed263eb150357863b7d0052627c5766e8ef5acd6fed533",
"transactionId": "768c20c15a290e02a43b83263a98501b9d7eb0b57da40a9247289c672de63ea6",
"outputIndex": 0,
"isSpent": false,
"address": "atoi1qzt0nhsf38nh6rs4p6zs5knqp6psgha9wsv74uajqgjmwc75ugupx3y7x0r",
"amount": 1000000
}
]
messageId
: Refers to the encapsulating message in which the transaction was sent.transactionId
,outputIndex
: Refers to the output within theSignedTransaction
payload. There may be severaloutputs
involved in a single transaction, so thetransactionId
by itself would not be enough.output
: This section provides details about the iota address to which the given unspent transaction output is coupled with.amount
: States an amount of tokens related to theoutput
.isSpent
: Indicates whether the givenoutput
is a part of the actual ledger state or not. As mentioned in the Messages, Payloads, and Transactions section, if an output was already spent it is not part of the ledger state any more and is replaced by some otheroutput(s)
in the process.
Notice that the outputId
that was used in a function call to get output details is the same as a combination of the
transactionId
and outputIndex
. This way a transaction is tightly coupled with outputs
since the
SignedTransaction
payload is a main vehicle to create and spend outputs
, and everything is encapsulated in a
message.