-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update specs/addendum to koios-1.0.11rc (#233)
- Loading branch information
Showing
9 changed files
with
489 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,23 @@ | ||
CREATE OR REPLACE FUNCTION grest.plutus_script_list() | ||
RETURNS TABLE ( | ||
script_hash text, | ||
creation_tx_hash text | ||
creation_tx_hash text, | ||
type text, | ||
size word31type | ||
) | ||
LANGUAGE plpgsql | ||
AS $$ | ||
BEGIN | ||
RETURN QUERY | ||
SELECT | ||
ENCODE(script.hash, 'hex') AS script_hash, | ||
ENCODE(tx.hash, 'hex') AS creation_tx_hash | ||
FROM script | ||
INNER JOIN tx ON tx.id = script.tx_id | ||
WHERE script.type IN ('plutusV1', 'plutusV2'); | ||
ENCODE(s.hash,'hex')::text AS script_hash, | ||
ENCODE(tx.hash,'hex')::text AS creation_tx_hash, | ||
s.type::text AS type, | ||
s.serialised_size AS size | ||
FROM script AS s | ||
INNER JOIN tx ON tx.id = s.tx_id | ||
WHERE s.type IN ('plutusV1', 'plutusV2'); | ||
END; | ||
$$; | ||
|
||
COMMENT ON FUNCTION grest.plutus_script_list IS 'Get a list of all plutus script hashes with creation tx hash.'; --noqa: LT01 | ||
COMMENT ON FUNCTION grest.plutus_script_list IS 'Get a list of all plutus script hashes with creation tx hash.'; --noqa: LT01 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
CREATE OR REPLACE FUNCTION grest.script_info(_script_hashes text []) | ||
RETURNS TABLE ( | ||
script_hash text, | ||
creation_tx_hash text, | ||
type text, | ||
value jsonb, | ||
bytes text, | ||
size word31type | ||
) | ||
LANGUAGE plpgsql | ||
AS $$ | ||
DECLARE | ||
_script_hashes_decoded bytea[]; | ||
BEGIN | ||
SELECT INTO _script_hashes_decoded ARRAY_AGG(DECODE(s_hash, 'hex')) | ||
FROM UNNEST(_script_hashes) AS s_hash; | ||
RETURN QUERY | ||
SELECT | ||
ENCODE(s.hash,'hex') AS script_hash, | ||
ENCODE(tx.hash,'hex') AS creation_tx_hash, | ||
s.type::text AS type, | ||
s.json AS value, | ||
ENCODE(s.bytes,'hex')::text AS bytes, | ||
s.serialised_size AS size | ||
FROM script AS s | ||
INNER JOIN tx ON tx.id = s.tx_id | ||
WHERE s.hash = ANY(_script_hashes_decoded) | ||
; | ||
END; | ||
$$; | ||
|
||
COMMENT ON FUNCTION grest.script_info IS 'Get information about a given script FROM hashes.'; -- noqa: LT01 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.