Current section

Files

Jump to
nimiq_rpc src nimiq_rpc@primitives@transaction.erl
Raw

src/nimiq_rpc@primitives@transaction.erl

-module(nimiq_rpc@primitives@transaction).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]).
-define(FILEPATH, "src/nimiq_rpc/primitives/transaction.gleam").
-export([decoder/0]).
-export_type([transaction/0]).
-type transaction() :: {transaction,
binary(),
integer(),
integer(),
integer(),
binary(),
integer(),
binary(),
integer(),
integer(),
integer(),
binary(),
binary(),
integer(),
integer(),
integer(),
binary(),
boolean(),
integer(),
list(binary())}.
-file("src/nimiq_rpc/primitives/transaction.gleam", 27).
-spec decoder() -> gleam@dynamic@decode:decoder(transaction()).
decoder() ->
gleam@dynamic@decode:field(
<<"blockNumber"/utf8>>,
{decoder, fun gleam@dynamic@decode:decode_int/1},
fun(Block_number) ->
gleam@dynamic@decode:field(
<<"confirmations"/utf8>>,
{decoder, fun gleam@dynamic@decode:decode_int/1},
fun(Confirmations) ->
gleam@dynamic@decode:field(
<<"executionResult"/utf8>>,
{decoder, fun gleam@dynamic@decode:decode_bool/1},
fun(Execution_result) ->
gleam@dynamic@decode:field(
<<"fee"/utf8>>,
{decoder, fun gleam@dynamic@decode:decode_int/1},
fun(Fee) ->
gleam@dynamic@decode:field(
<<"flags"/utf8>>,
{decoder,
fun gleam@dynamic@decode:decode_int/1},
fun(Flags) ->
gleam@dynamic@decode:field(
<<"from"/utf8>>,
{decoder,
fun gleam@dynamic@decode:decode_string/1},
fun(From) ->
gleam@dynamic@decode:field(
<<"fromType"/utf8>>,
{decoder,
fun gleam@dynamic@decode:decode_int/1},
fun(From_type) ->
gleam@dynamic@decode:field(
<<"hash"/utf8>>,
{decoder,
fun gleam@dynamic@decode:decode_string/1},
fun(Hash) ->
gleam@dynamic@decode:field(
<<"networkId"/utf8>>,
{decoder,
fun gleam@dynamic@decode:decode_int/1},
fun(
Network_id
) ->
gleam@dynamic@decode:field(
<<"proof"/utf8>>,
{decoder,
fun gleam@dynamic@decode:decode_string/1},
fun(
Proof
) ->
gleam@dynamic@decode:field(
<<"recipientData"/utf8>>,
{decoder,
fun gleam@dynamic@decode:decode_string/1},
fun(
Recipient_data
) ->
gleam@dynamic@decode:field(
<<"relatedAddresses"/utf8>>,
gleam@dynamic@decode:list(
{decoder,
fun gleam@dynamic@decode:decode_string/1}
),
fun(
Related_addresses
) ->
gleam@dynamic@decode:field(
<<"senderData"/utf8>>,
{decoder,
fun gleam@dynamic@decode:decode_string/1},
fun(
Sender_data
) ->
gleam@dynamic@decode:field(
<<"size"/utf8>>,
{decoder,
fun gleam@dynamic@decode:decode_int/1},
fun(
Size
) ->
gleam@dynamic@decode:field(
<<"timestamp"/utf8>>,
{decoder,
fun gleam@dynamic@decode:decode_int/1},
fun(
Timestamp
) ->
gleam@dynamic@decode:field(
<<"to"/utf8>>,
{decoder,
fun gleam@dynamic@decode:decode_string/1},
fun(
To
) ->
gleam@dynamic@decode:field(
<<"toType"/utf8>>,
{decoder,
fun gleam@dynamic@decode:decode_int/1},
fun(
To_type
) ->
gleam@dynamic@decode:field(
<<"validityStartHeight"/utf8>>,
{decoder,
fun gleam@dynamic@decode:decode_int/1},
fun(
Validity_start_height
) ->
gleam@dynamic@decode:field(
<<"value"/utf8>>,
{decoder,
fun gleam@dynamic@decode:decode_int/1},
fun(
Value
) ->
gleam@dynamic@decode:success(
{transaction,
Hash,
Timestamp,
Block_number,
Confirmations,
From,
From_type,
To,
To_type,
Value,
Fee,
Sender_data,
Recipient_data,
Flags,
Validity_start_height,
Network_id,
Proof,
Execution_result,
Size,
Related_addresses}
)
end
)
end
)
end
)
end
)
end
)
end
)
end
)
end
)
end
)
end
)
end
)
end
)
end
)
end
)
end
)
end
)
end
)
end
)
end
).