diff --git a/files/grest/rpc/transactions/tx_cbor.sql b/files/grest/rpc/transactions/tx_cbor.sql index 33f86e9d..932ace53 100644 --- a/files/grest/rpc/transactions/tx_cbor.sql +++ b/files/grest/rpc/transactions/tx_cbor.sql @@ -1,14 +1,25 @@ CREATE OR REPLACE FUNCTION grest.tx_cbor(_tx_hashes text []) RETURNS TABLE ( tx_hash text, + block_hash text, + block_height word31type, + epoch_no word31type, + absolute_slot word63type, + tx_timestamp integer, cbor text ) LANGUAGE sql STABLE AS $$ SELECT - ENCODE(tx.hash::bytea, 'hex') AS tx_hash, - ENCODE(tx_cbor.bytes::bytea, 'hex') AS tx_cbor + ENCODE(tx.hash::bytea, 'hex'), + ENCODE(block.hash, 'hex'), + block.block_no, + block.epoch_no, + block.slot_no, + EXTRACT(EPOCH FROM block.time)::integer, + ENCODE(tx_cbor.bytes::bytea, 'hex') FROM public.tx + INNER JOIN block ON block.id = tx.block_id LEFT JOIN public.tx_cbor ON tx.id = tx_cbor.tx_id WHERE tx.hash::bytea = ANY( SELECT diff --git a/specs/results/koiosapi-guild.yaml b/specs/results/koiosapi-guild.yaml index 7cbda1c5..18c1a66a 100644 --- a/specs/results/koiosapi-guild.yaml +++ b/specs/results/koiosapi-guild.yaml @@ -4777,6 +4777,16 @@ components: properties: tx_hash: $ref: "#/components/schemas/tx_info/items/properties/tx_hash" + block_hash: + $ref: "#/components/schemas/blocks/items/properties/hash" + block_height: + $ref: "#/components/schemas/blocks/items/properties/block_height" + epoch_no: + $ref: "#/components/schemas/blocks/items/properties/epoch_no" + absolute_slot: + $ref: "#/components/schemas/blocks/items/properties/abs_slot" + tx_timestamp: + $ref: "#/components/schemas/tx_info/items/properties/tx_timestamp" cbor: type: string description: CBOR encoded raw transaction. diff --git a/specs/results/koiosapi-mainnet.yaml b/specs/results/koiosapi-mainnet.yaml index d3563a92..0f2bdd33 100644 --- a/specs/results/koiosapi-mainnet.yaml +++ b/specs/results/koiosapi-mainnet.yaml @@ -4777,6 +4777,16 @@ components: properties: tx_hash: $ref: "#/components/schemas/tx_info/items/properties/tx_hash" + block_hash: + $ref: "#/components/schemas/blocks/items/properties/hash" + block_height: + $ref: "#/components/schemas/blocks/items/properties/block_height" + epoch_no: + $ref: "#/components/schemas/blocks/items/properties/epoch_no" + absolute_slot: + $ref: "#/components/schemas/blocks/items/properties/abs_slot" + tx_timestamp: + $ref: "#/components/schemas/tx_info/items/properties/tx_timestamp" cbor: type: string description: CBOR encoded raw transaction. diff --git a/specs/results/koiosapi-preprod.yaml b/specs/results/koiosapi-preprod.yaml index 8f0179e2..8e847755 100644 --- a/specs/results/koiosapi-preprod.yaml +++ b/specs/results/koiosapi-preprod.yaml @@ -4777,6 +4777,16 @@ components: properties: tx_hash: $ref: "#/components/schemas/tx_info/items/properties/tx_hash" + block_hash: + $ref: "#/components/schemas/blocks/items/properties/hash" + block_height: + $ref: "#/components/schemas/blocks/items/properties/block_height" + epoch_no: + $ref: "#/components/schemas/blocks/items/properties/epoch_no" + absolute_slot: + $ref: "#/components/schemas/blocks/items/properties/abs_slot" + tx_timestamp: + $ref: "#/components/schemas/tx_info/items/properties/tx_timestamp" cbor: type: string description: CBOR encoded raw transaction. diff --git a/specs/results/koiosapi-preview.yaml b/specs/results/koiosapi-preview.yaml index c443228e..2c85bf0c 100644 --- a/specs/results/koiosapi-preview.yaml +++ b/specs/results/koiosapi-preview.yaml @@ -4777,6 +4777,16 @@ components: properties: tx_hash: $ref: "#/components/schemas/tx_info/items/properties/tx_hash" + block_hash: + $ref: "#/components/schemas/blocks/items/properties/hash" + block_height: + $ref: "#/components/schemas/blocks/items/properties/block_height" + epoch_no: + $ref: "#/components/schemas/blocks/items/properties/epoch_no" + absolute_slot: + $ref: "#/components/schemas/blocks/items/properties/abs_slot" + tx_timestamp: + $ref: "#/components/schemas/tx_info/items/properties/tx_timestamp" cbor: type: string description: CBOR encoded raw transaction. diff --git a/specs/templates/4-api-schemas.yaml b/specs/templates/4-api-schemas.yaml index d30da201..c2dc285d 100644 --- a/specs/templates/4-api-schemas.yaml +++ b/specs/templates/4-api-schemas.yaml @@ -1942,6 +1942,16 @@ schemas: properties: tx_hash: $ref: "#/components/schemas/tx_info/items/properties/tx_hash" + block_hash: + $ref: "#/components/schemas/blocks/items/properties/hash" + block_height: + $ref: "#/components/schemas/blocks/items/properties/block_height" + epoch_no: + $ref: "#/components/schemas/blocks/items/properties/epoch_no" + absolute_slot: + $ref: "#/components/schemas/blocks/items/properties/abs_slot" + tx_timestamp: + $ref: "#/components/schemas/tx_info/items/properties/tx_timestamp" cbor: type: string description: CBOR encoded raw transaction.