CryptoTron
view release on metacpan or search on metacpan
lib/CryptoTron/ClaimReward.pm view on Meta::CPAN
# @argument $content Response content (scalar) #
# @return $json_encode Encoded content (scalar) #
# ---------------------------------------------------------------------------- #
sub encode {
# Assign the argument to the local variable.
my $content = $_[0];
# Set up the options for the Perl module JSON::PP.
my $json = 'JSON::PP'->new->pretty;
# Decode the content from the response.
my $json_decode = $json->decode($content);
# Encode the decoded content from the response.
my $json_encode = $json->encode($json_decode);
# Return the encoded content.
return $json_encode;
};
# ---------------------------------------------------------------------------- #
# Subroutine get_response() #
# #
# Description: #
# The subroutine is using the HTTP method POST to retrieve the response from #
lib/CryptoTron/ClaimReward.pm view on Meta::CPAN
# ---------------------------------------------------------------------------- #
# Subroutine parse_txID() #
# ---------------------------------------------------------------------------- #
sub parse_txID {
# Assign the subroutine argument to the local variable.
my $json_data = $_[0];
# Set up the options for the Perl module JSON::PP.
my $json = 'JSON::PP'->new->pretty;
# Decode the JSON data.
my $decoded = $json->decode($json_data);
# Extract the txID from the JSON data.
my $txID = $decoded->{'txID'};
# Return the extracted txID.
return $txID;
};
# ---------------------------------------------------------------------------- #
# Subroutine parse_raw_data_hex() #
# ---------------------------------------------------------------------------- #
sub parse_raw_data_hex {
# Assign the subroutine argument to the local variable.
my $json_data = $_[0];
# Set up the options for the Perl module JSON::PP.
my $json = 'JSON::PP'->new->pretty;
# Decode the JSON data.
my $decoded = $json->decode($json_data);
# Extract the raw_data from the JSON data.
my $raw_data_hex = $decoded->{'raw_data_hex'};
# Return the extracted raw data.
return $raw_data_hex;
};
# ---------------------------------------------------------------------------- #
# Subroutine parse_raw_data() #
# ---------------------------------------------------------------------------- #
sub parse_raw_data {
# Assign the subroutine argument to the local variable.
my $json_data = $_[0];
# Set up the options for the Perl module JSON::PP.
my $json = 'JSON::PP'->new->pretty;
# Decode the JSON data.
my $decoded = $json->decode($json_data);
# Extract the raw_data from the JSON data.
my $raw_data = $decoded->{'raw_data'};
#$raw_data = to_json($raw_data);
$raw_data = encode_json($raw_data);
# Return the extracted raw data.
return $raw_data;
};
1;
__END__
( run in 1.671 second using v1.01-cache-2.11-cpan-26ccb49234f )