* 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
;
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
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
=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');
#
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, ...}
=head2 get_last_block
https://bitcoincore.org/en/doc/24.0.0/rpc/bl
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(