=> $class,
operator => $operator,
};
bless( $ref, $obj );
return $ref;
}
# }}}
sub TO_JSON {
my ($self) = @_;
return { %{$self} };
}
1;
__END__
=head1 NAME
Travel::Status::DE::HAFAS
rning them asynchronously.
=over 4
=back
=cut
no indirect;
use URI;
use JSON::MaybeUTF8 qw(encode_json_utf8 decode_json_utf8);
use Protocol::WebSocket::Request;
use Ryu::Async;
use curry;
use Fut
my ($self, undef, $frame) = @_;
$self->source->emit(decode_json_utf8($frame));
}
),
on_ping_frame => $self->$
client request
my $request_call = {
id => 1,
method => $method,
jsonrpc => '2.0',
params => [@params],
};
await $self->websocket_client->connect(
;
use parent qw(Net::Async::Blockchain::Client::RPC);
sub jsonrpc { return '2.0' }
=head2 call
https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_call
=over 4
=back
L<Future>
=cut
sub call {
st('eth_call', @params);
}
=head2 get_transaction_receipt
https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_gettransactionreceipt
=over 4
=back
L<Future>
=cut
sub get_transaction_receipt {
('eth_getTransactionReceipt', @params);
}
=head2 accounts
https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_accounts
=over 4
=back
L<Future>
=cut
sub accounts {
my ($self) = @_;
return
--#
log_info create anno.json
if [ -e [% opt.data.0.dir -%]/anno.json ]; then
cp [% opt.data.0.dir -%]/anno.json anno.json;
else
if [ -e [% opt.data.0.dir -%]/cds.json ]; then
cp [% o
-%]/cds.json cds.json;
else
spanr gff --tag CDS \
[% opt.data.0.dir -%]/*.gff \
-o cds.json
fi
if [ -e [% opt.data.0.dir -%]/repeat.json ]; then
c
.dir -%]/repeat.json repeat.json;
else
spanr gff \
[% opt.data.0.dir -%]/*.rm.gff \
-o repeat.json
fi
# create empty cds.json or repeat.json
spanr geno
f->{plural} = [];
$self->{use_json} = 1;
$self->{_init_strict_use_sub} = 1;
$self->{_init_params_order} = [qw( category path domain locale plural use_json )];
$self->SUPER::init( @_ )
? $self->category : () ), "${dom}.po" );
my $path_json = $base->join( $base, $lang, ( $self->category ? $self->category : () ), "${dom}.json" );
my $path_mo = $base->join( $base, $lang, ( $
my $po;
if( $self->use_json && $path_json->exists )
{
$file = $path_json;
$po = Text::PO->new( domain => $dom, use_json => 1, debug => $self->debug ) ||
ic type instead (requires Types v2);
also, the Types generic constructor should prolly accept the JSON int array, so
that users at least have a simple way to manually get a unified API.
=item * Gener
at the top of the list.)
=item * Refactor Node etc. to match the Jolt data structures instead of JSON;
refactor Record to be implemented as just a single array representing the row,
with the (C<get("
e check if for DELETE requests, accepting only Jolt yields an
octet-stream response that contains JSON; if so, perhaps add to #12644 report
=back
=head2 L<Neo4j::Driver::ResultSummary>
=over
=item
* C<params> (any parameter required by the RPC call)
=back
L<Future> - node response as decoded json
=head1 INHERITED METHODS
=over 4
=item L<IO::Async::Notifier>
L<add_child|IO::Async::Notifier
=back
=cut
no indirect;
use Future::AsyncAwait;
use Net::Async::HTTP;
use JSON::MaybeUTF8 qw(encode_json_utf8 decode_json_utf8);
use IO::Async::Notifier;
use parent qw(IO::Async::Notifier);
use c
ded json
=cut
async sub _request {
my ($self, $method, @params) = @_;
my $obj = {
id => 1,
method => $method,
params => [@params],
};
# for Geth JSON-RP
be exactly "jsonrpc": "2.0"
$obj->{jsonrpc} = $self->jsonrpc if $self->can('jsonrpc');
my @post_params = ($self->endpoint, encode_json_utf8($obj), content_type => 'application/json');
#
em * C<txid> The transaction id
=item * C<verbose> If false, return a string, otherwise return a json object
=item * C<blockhash> The block in which to look for the transaction
=back
L<Future> - r
block hash
=item * C<verbosity> 0 for hex-encoded data, 1 for a JSON object, 2 for JSON object with transaction data, and 3 for JSON object with transaction data including prevout information for in
lidateaddress/
=over 4
=item * C<address> - the bitcoin address to validate
=back
L<Future> - json {isvalid : true|false, ...}
=head2 get_last_block
https://bitcoincore.org/en/doc/24.0.0/rpc/bl
https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_call
=over 4
=back
L<Future>
=head2 get_transaction_receipt
https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_gettransactionreceipt
=over 4
s
https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_accounts
=over 4
=back
L<Future>
=head2 get_block_by_hash
https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getblockbyhash
=over 4
=back
https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getblockbynumber
=over 4
=back
L<Future>
=head2 get_last_block
https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_blocknumber
=over 4
=back
em * C<txid> The transaction id
=item * C<verbose> If false, return a string, otherwise return a json object
=item * C<blockhash> The block in which to look for the transaction
=back
L<Future> - r
block hash
=item * C<verbosity> 0 for hex-encoded data, 1 for a JSON object, 2 for JSON object with transaction data, and 3 for JSON object with transaction data including prevout information for in
lidateaddress/
=over 4
=item * C<address> - the bitcoin address to validate
=back
L<Future> - json {isvalid : true|false, ...}
=cut
sub validate_address {
my ($self, @params) = @_;
retu
ber larger than this', { default => 0 }, ],
[ 'debug', 'write a file of exactmatch.json for debugging', ],
{ show_defaults => 1, }
);
}
sub usage_desc {
return "egaz ex
xactmatch.json
#----------------------------#
# YAML::Syck can't Dump Tie::IxHash
if ($opt->{debug}) {
Path::Tiny::path("exactmatch.json")->spew(
JSON::to_json(
n would do so.)
#
# Here currently using
# v1 JSON for info (company name, exchange, decimals)
# v8 JSON for historical daily data
# v7 JSON for latest quote
#
# Each seem to be without pr
of these methods returns results in JSON format.
# The "download" URL form(s), as distinct from "chart", were/are CSV
# but might be restricted access now.
#
# JSON has prices put through single-preci
ps to jump through.
# It seemed to be sometimes on the v7 download, maybe always on v11.
# The v7 JSON has been fine asking for the latest few days daily data,
# but not sure about bigger historical d
on_error} = 0;
# $d->{net_module} = 'Neo4j::Driver::Net::HTTP::AnyEvent';
# $d->{jolt} = 'ndjson'; # 'ndjson' might be problematic for some reason ... whatever, it's unsupported anyway
#XXX $d->sessi
if defined $v && ! _looks_like_number $v;
$t = ref($v) if ref($v);
$t .= " \\$v" if ref($v) eq 'JSON::PP::Boolean';
$t .= " " . $v->id . " " . join ",", map {":$_"} $v->labels if ref($v) eq 'Neo4j:
false|builtin/"false">) are only available
starting with Perl v5.36. On older Perls, L<JSON::PP>::true
and L<JSON::PP>::false are used instead. These are blessed
objects overloaded to evaluate correct
pressions. If necessary, you can force
conversion of such values into the correct type by using
L<JSON::Types> or with simple unary coercions like this:
$number = 0 + $scalar;
$string = '' . $scal
n/"false"> in query parameters
requires recent enough JSON module versions
(S<L<Cpanel::JSON::XS> 4.38> / S<L<JSON::PP> 4.11>).
=back
=head2 JSON networking
For connecting to a Neo4j server earlier
config(jolt => undef); # prefer Jolt v2 (the default)
$d->config(jolt => 0); # accept only JSON
$d->config(jolt => 1); # accept only Jolt v2
# Accept only Jolt and request ...
$d->con
ig(jolt => 'ndjson'); # newline delimited mode (non RFC)
Since driver S<version 0.24>, the
L<Jolt|https://neo4j.com/docs/http-api/4.3/actions/result-format/#_jolt>
response format (JSON Bolt) is pre
ferred for HTTP connections
because the older REST-style JSON response format has several
known issues and is much slower than Jolt.
This option is no longer useful. The driver will pick the fastest
the same, but it should be good enough for us.
# (original idea from https://github.com/makamaka/JSON-PP/commit/87bd6a4)
sub _SvNIOKp {
no warnings 'numeric';
return length( (my $string = '') & shi
un($tx, @statements);
# Parsing a JSON result
die unless $helper->{http_agent}->http_header->{success};
$json_coder = $helper->{http_agent}->json_coder;
$json_coder->decode( $helper->{http_agent
on-3.4.1>)
to obtain a suitable response from the Neo4j server. The driver
supports both Jolt and JSON as result formats. There is also
a fallback result handler, which is used to parse error
messages
s compatibility,
a lot of the internal data structures currently (0.52) match the
format of Neo4j JSON responses.
The first HTTP connection to a Neo4j server is always made to the
L<Discovery API|htt
) = @$statement;
my $json = { statement => '' . $cypher };
$json->{resultDataContents} = $RESULT_DATA_CONTENTS;
$json->{includeStats} = \1 if $self->{return_stats};
$json->{parameters} = $parame
ters if %$parameters;
return $json;
}
sub _begin {
my ($self) = @_;
# no-op for HTTP
return $self;
}
sub _run_autocommit {
my ($self, $query, @parameters) = @_;
$self->{transaction_end
+ $scalar,
string => '' . $scalar,
true => builtin::true, # or JSON::PP::true
false => builtin::false, # or JSON::PP::false
null => undef,
list => [ ],
map => { },
};
tions will use B<Jolt> (JSON Bolt) when offered by the server.
For older Neo4j servers (before S<version 4.2>), the driver
will automatically fall back to slower REST-style JSON.
The driver also supp