Transactions#
- class defichain.ocean.Transactions(ocean)#
- get(id: str) {} #
Get a Transaction
- Parameters:
id (str) – (required) id of transaction to query
- Returns:
(json string) {id: str, order: int, block: {hash: str, height: int, time: int, medianTime: int}, txid: str, hash: str, version: int, size: int, vSize: int, weight: int, lockTime: int, vinCount: int, voutCount: int, totalVoutValue: str}
- Example:
>>> ocean.transactions.get("8d654cdaeba4633aa08e46f1aa258aae7234e89945145f61bc1bd5b342df1069")
- getVins(txid: str, size: int = 30, next: str | None = None) {} #
Get a list of vins of a Transaction
- Parameters:
txid (str) – (required) txid of the transaction
size (int) – (optional) size to query
next (str) – (optional) next token for next slice of vin
- Returns:
(json string) {id: str, txid: str, coinbase: str, vout: {id: str, txid: str, n: int, value: str, tokenId: int, script: {hex: str}}, script: {hex: str}, txInWitness: str[], sequence: str}
- Example:
>>> ocean.transactions.getVins("8d654cdaeba4633aa08e46f1aa258aae7234e89945145f61bc1bd5b342df1069")
- getVouts(txid: str, size: int = 30, next: str | None = None) {} #
Get a list of vouts of a Transaction
- Parameters:
txid (str) – (required) txid of the transaction
size (int) – (optional) size to query
next (str) – (optional) next token for next slice of vout
- Returns:
(json string) {id: str, txid: str, n: int, value: str, tokenId: int, script: {hex: str, type: str}}
- Example:
>>> ocean.transactions.getVouts("8d654cdaeba4633aa08e46f1aa258aae7234e89945145f61bc1bd5b342df1069")