{% macro render( index, input, tx, sats_addr_prefix, tokens_addr_prefix, token_icon_url) %} {% let token_entry = input.token|find_token_entry(token_entries) %} {% let genesis_info = token_entry|token_entry_genesis_info %} {% let is_token = input.token|check_is_token %} {% let destination = input.output_script | destination_from_script(is_token, sats_addr_prefix, tokens_addr_prefix) %} {% let decoded_input_script = input.input_script|get_script %} {% let prev_out = input.prev_out|unwrap %}
{% if prev_out|check_is_coinbase %}
Coinbase
{% else %}
{{ index }}
{% match destination %} {% when Destination::Address with (address) %}
Copy to clipboard
{{ address.as_str() }} {% when Destination::P2PK with (pubkey) %} Pubkey: {{ pubkey|hexify_u8_vector }} {% when Destination::Unknown with (_bytes) %} Unknown {% when Destination::Nulldata with (_ops) %} Unreachable {% endmatch %}
{% match input.token %} {% when Some with (slp_token) %} {% match genesis_info %} {% when Some with (genesis_info) %} {% if slp_token.amount > 0 || slp_token.is_mint_baton %} {% if slp_token.is_mint_baton %}
Mint baton
{% else %} {{ slp_token.amount | to_i128 | render_token_amount(genesis_info.decimals) | safe }} {{ genesis_info.token_ticker|string_from_lossy_utf8 }} {% endif %} {% endif %} {% match token_entry %} {% when Some with (token_entry) %} {% when None %} {% endmatch %}
{{ input.value|render_sats|safe }} XEC
{% when None %} {{ input.value|render_sats|safe }} XEC {% when None %} {% endmatch %} {% when None %} {{ input.value|render_sats|safe }} XEC {% endmatch %}
{% endif %}
{% endmacro %}