view release on metacpan or search on metacpan
lib/Blockchain/Ethereum/ABI/Decoder.pm view on Meta::CPAN
=over 4
=back
Returns an array reference containing all decoded values
=head1 AUTHOR
Reginaldo Costa <refeco@cpan.org>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Blockchain/Ethereum/Keystore/Keyfile.pm view on Meta::CPAN
sub import_file {
my ($self, $file_path, $password) = @_;
my $content = read_file($file_path);
my $decoded = $self->_json->decode(lc $content);
return $self->_from_object($decoded, $password);
}
sub _from_object {
my ($self, $object, $password) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Blockchain/Ethereum/RLP.pm view on Meta::CPAN
my $tx_params = ['0x9', '0x4a817c800', '0x5208', '0x3535353535353535353535353535353535353535', '0xde0b6b3a7640000', '0x', '0x1', '0x', '0x'];
my $encoded = $rlp->encode($params); #ec098504a817c800825208943535353535353535353535353535353535353535880de0b6b3a764000080018080
my $encoded_tx_params = 'ec098504a817c800825208943535353535353535353535353535353535353535880de0b6b3a764000080018080';
my $decoded = $rlp->decode(pack "H*", $encoded_tx_params); #['0x9', '0x4a817c800', '0x5208', '0x3535353535353535353535353535353535353535', '0xde0b6b3a7640000', '0x', '0x1', '0x', '0x']
=head1 METHODS
=head2 encode
view all matches for this distribution
view release on metacpan or search on metacpan
t/eip1559.t view on Meta::CPAN
'02f901c3820539808009831de2b98080b90170608060405234801561001057600080fd5b50610150806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80632e64cec11461003b5780636057361d14610059575b600080fd5b610043610075565b604...
);
my $rlp = Blockchain::Ethereum::RLP->new();
# substring to remove the 02
my $decoded = $rlp->decode(substr($raw_transaction, 1));
is hex $decoded->[-3], 0, 'correct eip155 v value for contract creation transaction';
};
subtest "eth transfer" => sub {
my $transaction = Blockchain::Ethereum::Transaction::EIP1559->new(
t/eip1559.t view on Meta::CPAN
'02f86c820539018009825208943535353535353535353535353535353535353535880de0b6b3a764000080c080a070816c3d026c13a53e98e5dc414398e9dcdf23e440e777114a3e04810e0dfb5da07d732e6b7f847b06d2baed033772d78407da8f4010fa9300df79f2209ba4c7a0'
);
my $rlp = Blockchain::Ethereum::RLP->new();
# substring to remove the 02
my $decoded = $rlp->decode(substr($raw_transaction, 1));
is hex $decoded->[-3], 0, 'correct eip155 v value for contract creation transaction';
};
done_testing;
view all matches for this distribution
view release on metacpan or search on metacpan
t/sysinfos/ProxySG-4006060000--20090307-165730UTC.sysinfo view on Meta::CPAN
(summary)
)
)
(exception.content_encoding_error
(contact)
(details "Server response could not be decoded using encoding type returned by server.")
(format)
(help "This is typically caused by a Web Site presenting a content encoding header of one type, and then encoding the data differently.")
(summary "Content Encoding Error")
(http
(code "502")
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bluesky/Poster.pm view on Meta::CPAN
}),
);
unless ($res->is_success) {
if(my $logger = $self->{'logger'}) {
$logger->error('Login failed: ', $res->status_line, "\n", $res->decoded_content());
}
croak('Login failed: ', $res->status_line, "\n", $res->decoded_content());
}
$self->{session} = $self->{json}->decode($res->decoded_content);
}
=head2 post($text)
Posts the given text to your Bluesky feed.
lib/Bluesky/Poster.pm view on Meta::CPAN
Content => $self->{json}->encode($payload),
);
unless ($res->is_success) {
if(my $logger = $self->{'logger'}) {
$logger->error('Post failed: ' . $res->status_line . "\n" . $res->decoded_content());
}
croak('Post failed: ', $res->status_line, "\n", $res->decoded_content());
}
return $self->{json}->decode($res->decoded_content);
}
sub _iso8601 {
my $t = $_[0];
my @gmt = gmtime($t);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/BmltClient/ApiClient.pm view on Meta::CPAN
return undef;
} elsif ( (substr($class, 0, 5)) eq 'HASH[') { #hash
if ($class =~ /^HASH\[(.*),(.*)\]$/) {
my ($key_type, $type) = ($1, $2);
my %hash;
my $decoded_data = decode_json $data;
foreach my $key (keys %$decoded_data) {
if (ref $decoded_data->{$key} eq 'HASH') {
$hash{$key} = $self->deserialize($type, encode_json $decoded_data->{$key});
} else {
$hash{$key} = $self->deserialize($type, $decoded_data->{$key});
}
}
return \%hash;
} else {
#TODO log error
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bot/Babelfish.pm view on Meta::CPAN
=item non_unicode_version()
This function returns a printable version of the given string
(with a European value of "printable" C<:-)>. More precisely,
if the string only contains Latin-1 characters, it is returned
decoded from internal Perl format. If the string contains
others characters outside Latin-1, it's converted using
C<Text::Unidecode>.
=cut
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bot/BasicBot.pm view on Meta::CPAN
}
else {
push @r, decode_irc($_);
}
}
#warn Dumper({ decoded => \@r });
return @r;
}
sub charset_encode {
my $self = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bot/Cobalt/Plugin/YouTube.pm view on Meta::CPAN
logger->debug("youtube_plug_resp_recv for $req_url");
return PLUGIN_EAT_ALL unless $response->is_success;
my $content = $response->decoded_content;
my $html = HTML::TokeParser->new( \$content );
my ($title, $short_url);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bot/Cobalt/IRC/Event/Topic.pm view on Meta::CPAN
This is the L<Bot::Cobalt::IRC::Event::Channel> subclass for channel topic
changes.
=head2 topic
Returns the new channel topic, as an (undecoded and non-stripped)
string.
=head2 stripped
Returns the color- and formatting-stripped topic string.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bot/IRC/X/Feeds.pm view on Meta::CPAN
for my $url ( @{ $bot->store->get('urls') || [] } ) {
my $res = $ua->get( $url->{url} );
next unless ( $res->is_success );
eval {
$rss->parse( $res->decoded_content );
};
if ($@) {
warn $@;
next;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/BrandMeister/API.pm view on Meta::CPAN
my($res) = $ua->request($req);
print('Request status line: '.$res->status_line."\n") if($self->{DEBUG}) ;
if (!$res->is_success) {
return($res->status_line);
};
$self->{_JSONRESPONSEREF} = $jsonresobj->decode($res->decoded_content);
return(0);
};
=head2 json_response
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Brightcove/MAPI.pm view on Meta::CPAN
my $url = URI->new($self->read_api_url);
$url->query_form(%$params);
my $res = $self->user_agent->get($url->as_string);
if ($res->is_success) {
return decode_json($res->decoded_content);
} else {
confess $res->status_line;
}
}
lib/Brightcove/MAPI.pm view on Meta::CPAN
Content => [ json => $jsonrpc ]
);
}
if ($res->is_success) {
my $content = $res->decoded_content;
return decode_json($content);
} else {
confess $res->status_line;
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
0.08 2018-06-25 17:03:25+01:00 Europe/London
- Updated for more recent dependancies
0.07 2016-06-30 10:46:21+01:00 Europe/London
- Add role to be consumed by users
- Ensured that data is decoded on receive
0.06 2016-04-22 14:45:38+01:00 Europe/London
- Updated to Broadworks Release 20 SP1
0.05 2015-10-19 11:09:00+01:00 Europe/London
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Browsermob/Server.pm view on Meta::CPAN
my $self = shift;
my $ua = $self->ua;
my $res = $ua->get('http://' . $self->server_addr . ':' . $self->server_port . '/proxy');
if ($res->is_success) {
my $list = from_json($res->decoded_content)->{proxyList};
my @proxies = map {
$_->{port};
} @$list;
view all matches for this distribution
view release on metacpan or search on metacpan
share/stub.pl view on Meta::CPAN
}
close $out;
while ( my $len = read( DATA, my $buf, 4081 ) ) {
my $decoded = MIME::Base64::decode_base64($buf);
syswrite( $in, $decoded ) or die("Failed to syswrite(): $!");
}
close $in;
waitpid( $pid, 0 );
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bundle/WATERKIP/CLI/Azure/Password.pm view on Meta::CPAN
my $ua = LWP::UserAgent->new();
$ua->default_header("Authorization", "Bearer $token");
my $res = $ua->get($self->_cli_args->{use_at});
if($res->is_success) {
say $res->decoded_content;
return;
}
say $token;
die $res->status_line;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Business/BR/CNJ/NumberExtractor.pm view on Meta::CPAN
die $req->status_line if !$req->is_success;
# text/html
if ( $req->header( 'Content-type' ) eq 'text/html' ) {
my $dom = Mojo::DOM->new( $req->decoded_content );
return cnj_extract_numbers( $dom->all_text );
# Everything else
} else {
return cnj_extract_numbers( $req->decoded_content );
}
}
1;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Business/Bitcoin/Request.pm view on Meta::CPAN
}
sub _decode58 {
my $todecode = shift;
$todecode =~ tr/A-HJ-NP-Za-km-z/a-km-zA-HJ-NP-Z/;
my $decoded = decode_base58($todecode);
}
sub _encode58 {
my $encoded = encode_base58(shift);
$encoded =~ tr/a-km-zA-HJ-NP-Z/A-HJ-NP-Za-km-z/;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Business/Bitpay.pm view on Meta::CPAN
my $http_response = $self->{ua}->request($self->prepare_request(@_));
Carp::croak($http_response->status_line)
unless $http_response->is_success;
my $response = decode_json($http_response->decoded_content);
if (my $error = $response->{error}) {
my $messages = $error->{messages};
Carp::croak("$error->{message}: ",
join(', ', map {"$_ ($messages->{$_})"} keys %$messages));
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Business/CPI/Gateway/PayPal/IPN.pm view on Meta::CPAN
has is_valid => (
is => 'lazy',
default => sub {
my $self = shift;
for ($self->response->decoded_content) {
return 0 if /^INVALID$/;
return 1 if /^VERIFIED$/;
die "Vague response: " . $_;
}
view all matches for this distribution
view release on metacpan or search on metacpan
bin/postdanmark.pl view on Meta::CPAN
my $ua = LWP::UserAgent->new;
my $response = $ua->get($url);
if ( $response->is_success ) {
my $content = $response->decoded_content;
my $ctx = Digest::MD5->new;
$ctx->add($content);
my $digest = $ctx->hexdigest;
view all matches for this distribution
view release on metacpan or search on metacpan
t/002-Spec-analysis.t view on Meta::CPAN
my $edi = Business::EDI->new('d08a') or die "Business::EDI->new('d08a') failed";
ok($perl = ordrsp_data, "DATA handle read and decode" );
$perl or die "DATA handle not decoded successfully";
# note("ref(\$obj): " . ref($perl));
# note(" \$obj : " . $perl );
$Data::Dumper::Indent = 1;
view all matches for this distribution
view release on metacpan or search on metacpan
DirectConnect.pm view on Meta::CPAN
This method will return the value for an item returned from FedEx. Refer to
the C<Business::FedEx::Constants> %FE_RE hash to see all possible values.
=item $t->rbuf()
Returns the decoded string portion of the FedEx reply.
=item $t->hash_ret()
Returns a hash of the FedEx reply values
view all matches for this distribution
view release on metacpan or search on metacpan
zlib/contrib/blast/blast.c view on Meta::CPAN
* more "natural" ordering starting with all zeros and incrementing.
*/
local int decode(struct state *s, struct huffman *h)
{
int len; /* current number of bits in code */
int code; /* len bits being decoded */
int first; /* first code of length len */
int count; /* number of codes of length len */
int index; /* index of first code of length len in symbol table */
int bitbuf; /* bits from stream */
int left; /* bits left in next or left to process */
zlib/contrib/blast/blast.c view on Meta::CPAN
*/
local int decomp(struct state *s)
{
int lit; /* true if literals are coded */
int dict; /* log2(dictionary size) - 6 */
int symbol; /* decoded symbol, extra bits for distance */
int len; /* length for copy */
unsigned dist; /* distance for copy */
int copy; /* copy counter */
unsigned char *from, *to; /* copy pointers */
static int virgin = 1; /* build tables once */
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Business/MollieAPI.pm view on Meta::CPAN
my $self = shift;
my $req = shift;
$req->header('Authorization', 'Bearer ' . $self->api_key);
my $ua = LWP::UserAgent->new();
my $res = $ua->request($req);
my $data = decode_json($res->decoded_content);
$self->log_response({ request => $req, response => $res });
return $data;
}
1;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Business/Mondo/Client.pm view on Meta::CPAN
Make a request to the Mondo API:
my $data = $Client->api_get( 'location',\%params );
May return a the decoded response data as a hash/array/string depending
on the reposonse type
=cut
sub api_get {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Business/Monzo/Client.pm view on Meta::CPAN
Make a request to the Monzo API:
my $data = $Client->api_get( 'location',\%params );
May return a the decoded response data as a hash/array/string depending
on the reposonse type
=cut
sub api_get {
view all matches for this distribution
view release on metacpan or search on metacpan
my $paircodeResponse = '{"data":[{"policies":[{"policy":"id", "method":"require", "params":["TfLAXsWtvWpSgqMYjJ1QvJEx2Bdob1mDeK4"]}], "resource":"Gd1q7mZJQU5zGoHAFsh1bmYEcWYQnzHZW6sjWatxtEr2", "token":"9nYwJ7KRRAcH1rXwJZRonXYrJJjcwAUowTC63UVLSYaC...
my $invoiceResponse = '{"facade":"pos/invoice", "data": {"url":"https://paul.bp:8088/invoice?id=FAdAZK8FwmHyUZSzRvT9GW", "status":"new", "btcPrice":"0.035314", "btcDue":"0.035314", "price":10, "currency":"USD", "exRates":{"USD":283.1700000000001}...
my $getTokens = '{"data": [{"pos/invoice":"7zjXTgeWaTj7xXNBA1qV7iBGGHJZNiLjPXNquHdk8BUN"}, {"pos":"HwC497kDGihPFUDiPfbedj6etbrVHyKQaiFHPGspYHHV"}]}';
my $httpd = run_http_server {
my $request = shift;
my $decoded = decode_json($request->content) if $request->content;
my $uri = $request->uri;
my $method = $request->method;
if ($uri->path eq '/postthis') {
}
return do {
if ($method eq "POST") {
if( $uri->path eq '/postthis' && $decoded->{"token"} && $decoded->{"facade"} ) {
[
200,
[ 'Content-Type' => 'application/json' ],
[ '{"facade":"correct", "token":"correct"}']
]
} elsif( $decoded->{"pairingCode"} && $uri->path eq '/tokens' ) {
[
200,
[ 'Content-Type' => 'application/json' ],
[ $paircodeResponse ]
]
view all matches for this distribution