Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ computed_fields:
function:
name: input_unlocking_bytecode_pattern
schema: public
- name: unlocking_bytecode_hex
definition:
function:
name: input_unlocking_bytecode_hex
schema: public
- name: value_satoshis
definition:
function:
Expand All @@ -53,6 +58,7 @@ select_permissions:
computed_fields:
- redeem_bytecode_pattern
- unlocking_bytecode_pattern
- unlocking_bytecode_hex
- value_satoshis
filter: {}
limit: 1000
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ computed_fields:
function:
name: output_locking_bytecode_pattern
schema: public
- name: locking_bytecode_hex
definition:
function:
name: output_locking_bytecode_hex
schema: public
select_permissions:
- role: public
permission:
Expand All @@ -36,5 +41,6 @@ select_permissions:
- nonfungible_token_commitment
computed_fields:
- locking_bytecode_pattern
- locking_bytecode_hex
filter: {}
limit: 5000
Original file line number Diff line number Diff line change
Expand Up @@ -525,13 +525,27 @@ AS $$
$$;
COMMENT ON FUNCTION output_locking_bytecode_pattern (output) IS 'Extract the first byte of each instruction for the locking bytecode of an output. The resulting pattern excludes the contents of pushed values such that similar bytecode sequences produce the same pattern.';

CREATE FUNCTION output_locking_bytecode_hex(output_row output) RETURNS text
LANGUAGE sql IMMUTABLE
AS $$
SELECT encode($1.locking_bytecode, 'hex');
$$;
COMMENT ON FUNCTION output_locking_bytecode_hex (output) IS 'Transform output locking bytecode to hex string.';

CREATE FUNCTION input_unlocking_bytecode_pattern(input_row input) RETURNS text
LANGUAGE sql IMMUTABLE
AS $$
SELECT encode(parse_bytecode_pattern($1.unlocking_bytecode), 'hex');
$$;
COMMENT ON FUNCTION input_unlocking_bytecode_pattern (input) IS 'Extract the first byte of each instruction for the unlocking bytecode of an input. The resulting pattern excludes the contents of pushed values such that similar bytecode sequences produce the same pattern.';

CREATE FUNCTION input_unlocking_bytecode_hex(input_row input) RETURNS text
LANGUAGE sql IMMUTABLE
AS $$
SELECT encode($1.unlocking_bytecode, 'hex');
$$;
COMMENT ON FUNCTION input_unlocking_bytecode_hex (input) IS 'Transform input unlocking bytecode to hex string.';

CREATE FUNCTION parse_bytecode_pattern_with_pushdata_lengths(bytecode bytea) RETURNS bytea
LANGUAGE plpgsql IMMUTABLE
AS $$
Expand Down