view release on metacpan or search on metacpan
lib/Finance/Alpaca.pm view on Meta::CPAN
return $ua;
}
has api_version => ( is => 'ro', isa => Enum [ 1, 2 ], required => 1, default => 2 );
has paper => ( is => 'rw', isa => Bool, required => 1, default => 0, coerce => 1 );
sub endpoint ($s) {
$s->paper ? 'https://paper-api.alpaca.markets' : '';
}
has keys => ( is => 'rwp', isa => ArrayRef [ Str, 2 ], predicate => 1 );
#
sub account ($s) {
my $tx = $s->ua->build_tx( GET => $s->endpoint . '/v2/account' );
$tx = $s->ua->start($tx);
return to_Account( $tx->result->json );
}
sub clock ($s) {
my $tx = $s->ua->build_tx( GET => $s->endpoint . '/v2/clock' );
$tx = $s->ua->start($tx);
return to_Clock( $tx->result->json );
}
sub calendar ( $s, %params ) {
my $params = '';
$params .= '?' . join '&', map {
$_ . '='
. ( ref $params{$_} eq 'Time::Moment' ? $params{$_}->to_string() : $params{$_} )
} keys %params if keys %params;
my $tx = $s->ua->build_tx( GET => $s->endpoint . '/v2/calendar' . $params );
$tx = $s->ua->start($tx);
return @{ ( ArrayRef [Calendar] )->assert_coerce( $tx->result->json ) };
}
sub assets ( $s, %params ) {
lib/Finance/Alpaca.pm view on Meta::CPAN
$_ . '='
. ( ref $params{$_} eq 'Time::Moment' ? $params{$_}->to_string() : $params{$_} )
} keys %params if keys %params;
return @{
( ArrayRef [Asset] )->assert_coerce(
$s->ua->get( $s->endpoint . '/v2/assets' . $params )->result->json
)
};
}
sub asset ( $s, $symbol_or_asset_id ) {
my $res = $s->ua->get( $s->endpoint . '/v2/assets/' . $symbol_or_asset_id )->result;
return $res->is_error ? () : to_Asset( $res->json );
}
sub bars ( $s, %params ) {
my $symbol = delete $params{symbol};
lib/Finance/Alpaca.pm view on Meta::CPAN
for ( keys %params ) {
$params{$_} = $params{$_}->to_string() if ref $params{$_} eq 'Time::Moment';
}
return @{
( ArrayRef [Order] )->assert_coerce(
$s->ua->get( $s->endpoint . '/v2/orders' => form => {%params} )->result->json
)
};
}
sub order_by_id ( $s, $order_id, $nested = 0 ) {
my $res
= $s->ua->get(
$s->endpoint . '/v2/orders/' . $order_id => form => ( $nested ? { nested => 1 } : () ) )
->result;
return $res->is_error ? () : to_Order( $res->json );
}
sub order_by_client_id ( $s, $order_id ) {
my $res
= $s->ua->get( $s->endpoint
. '/v2/orders:by_client_order_id' => form => { client_order_id => $order_id } )
->result;
return $res->is_error ? () : to_Order( $res->json );
}
sub create_order ( $s, %params ) {
$params{extended_hours} = ( !!$params{extended_hours} ) ? 'true' : 'false'
if defined $params{extended_hours};
my $res = $s->ua->post( $s->endpoint . '/v2/orders' => json => \%params )->result;
return $res->is_error ? $res->json : to_Order( $res->json );
}
sub replace_order ( $s, $order_id, %params ) {
$params{extended_hours} = ( !!$params{extended_hours} ) ? 'true' : 'false'
if defined $params{extended_hours};
my $res
= $s->ua->patch( $s->endpoint . '/v2/orders/' . $order_id => json => \%params )->result;
return $res->is_error ? $res->json : to_Order( $res->json );
}
sub cancel_orders ($s) {
my $res = $s->ua->delete( $s->endpoint . '/v2/orders' )->result;
return $res->is_error
? $res->json
: ( ArrayRef [ Dict [ body => Order, id => Uuid, status => Int ] ] )
->assert_coerce( $res->json );
}
sub cancel_order ( $s, $order_id ) {
my $res = $s->ua->delete( $s->endpoint . '/v2/orders/' . $order_id )->result;
return !$res->is_error;
}
sub positions ($s) {
return
@{ ( ArrayRef [Position] )
->assert_coerce( $s->ua->get( $s->endpoint . '/v2/positions' )->result->json ) };
}
sub position ( $s, $symbol_or_asset_id ) {
my $res = $s->ua->get( $s->endpoint . '/v2/positions/' . $symbol_or_asset_id )->result;
return $res->is_error ? () : to_Position( $res->json );
}
sub close_all_positions ( $s, $cancel_orders = !1 ) {
my $res
= $s->ua->delete(
$s->endpoint . '/v2/positions' . ( $cancel_orders ? '?cancel_orders=true' : '' ) )
->result;
return $res->is_error
? $res->json
: ( ArrayRef [ Dict [ body => Order, id => Uuid, status => Int ] ] )
->assert_coerce( $res->json );
}
sub close_position ( $s, $symbol_or_asset_id, $qty = () ) {
my $res
= $s->ua->get(
$s->endpoint . '/v2/positions/' . $symbol_or_asset_id . ( $qty ? '?qty=' . $qty : '' ) )
->result;
return $res->is_error ? () : to_Order( $res->json );
}
sub portfolio_history ( $s, %params ) {
lib/Finance/Alpaca.pm view on Meta::CPAN
$params{date_end}
= ref $params{date_end} eq 'Time::Moment'
? $params{date_end}->strftime('%F')
: $params{date_end}
if defined $params{date_end};
my $res = $s->ua->get( $s->endpoint . '/v2/account/portfolio/history' => json => \%params )
->result;
return $res->is_error ? $res->json : (
Dict [
base_value => Num,
equity => ArrayRef [Num],
lib/Finance/Alpaca.pm view on Meta::CPAN
}
sub watchlists ($s) {
return
@{ ( ArrayRef [Watchlist] )
->assert_coerce( $s->ua->get( $s->endpoint . '/v2/watchlists' )->result->json ) };
}
sub create_watchlist ( $s, $name, @symbols ) {
my $res
= $s->ua->post( $s->endpoint
. '/v2/watchlists' => json =>
{ name => $name, ( @symbols ? ( symbols => \@symbols ) : () ) } )->result;
return $res->is_error ? ( $res->json ) : to_Watchlist( $res->json );
}
sub delete_watchlist ( $s, $watchlist_id ) {
my $res = $s->ua->delete( $s->endpoint . '/v2/watchlists/' . $watchlist_id )->result;
return $res->is_error ? $res->json : 1;
}
sub watchlist ( $s, $watchlist_id ) {
my $res = $s->ua->get( $s->endpoint . '/v2/watchlists/' . $watchlist_id )->result;
return $res->is_error ? ( $res->json ) : to_Watchlist( $res->json );
}
sub update_watchlist ( $s, $watchlist_id, %params ) {
my $res
= $s->ua->put( $s->endpoint . '/v2/watchlists/' . $watchlist_id => json => {%params} )
->result;
return $res->is_error ? ( $res->json ) : to_Watchlist( $res->json );
}
sub add_to_watchlist ( $s, $watchlist_id, $symbol ) {
my $res
= $s->ua->post(
$s->endpoint . '/v2/watchlists/' . $watchlist_id => json => { symbol => $symbol } )
->result;
return $res->is_error ? ( $res->json ) : to_Watchlist( $res->json );
}
sub remove_from_watchlist ( $s, $watchlist_id, $symbol ) {
my $res = $s->ua->delete( $s->endpoint . '/v2/watchlists/' . $watchlist_id . '/' . $symbol )
->result;
return $res->is_error ? ( $res->json ) : to_Watchlist( $res->json );
}
sub configuration ($s) {
my $res = $s->ua->get( $s->endpoint . '/v2/account/configurations' )->result;
return $res->is_error ? ( $res->json ) : to_Configuration( $res->json );
}
sub modify_configuration ( $s, %params ) {
my $res = $s->ua->patch( $s->endpoint . '/v2/account/configurations' => json => {%params} )
->result;
return $res->is_error ? ( $res->json ) : to_Configuration( $res->json );
}
sub activities ( $s, %params ) {
lib/Finance/Alpaca.pm view on Meta::CPAN
: ref $params{$_} eq 'ARRAY' ? @{ $params{$_} }
: $params{$_}
)
} keys %params if keys %params;
my $res = $s->ua->get(
sprintf $s->endpoint . '/v2/account/activities%s',
$params ? $params : ''
)->result;
return $res->is_error
? $res->json
: map { $_->{activity_type} eq 'FILL' ? to_TradeActivity($_) : to_Activity($_) }
lib/Finance/Alpaca.pm view on Meta::CPAN
my $acct = $camelid->account( );
CORE::say sprintf 'I can%s short!', $acct->shorting_enabled ? '' : 'not';
Returns a L<Finance::Alpaca::Struct::Account> object.
The account endpoint serves important information related to an account,
including account status, funds available for trade, funds available for
withdrawal, and various flags relevant to an accountâs ability to trade.
=head2 C<clock( )>
lib/Finance/Alpaca.pm view on Meta::CPAN
$clock->timestamp->strftime('It is %l:%M:%S %p on a %A and the market is %%sopen!'),
$clock->is_open ? '' : 'not ';
Returns a L<Finance::Alpaca::Struct::Clock> object.
The clock endpoint serves the current market timestamp, whether or not the
market is currently open, as well as the times of the next market open and
close.
=head2 C<calendar( [...] )>
lib/Finance/Alpaca.pm view on Meta::CPAN
$day->date, $day->open;
}
Returns a list of L<Finance::Alpaca::Struct::Calendar> objects.
The calendar endpoint serves the full list of market days from 1970 to 2029.
The following parameters are accepted:
=over
lib/Finance/Alpaca.pm view on Meta::CPAN
say $_->symbol
for sort { $a->symbol cmp $b->symbol } @{ $camelid->assets( status => 'active' ) };
Returns a list of L<Finance::Alpaca::Struct::Asset> objects.
The assets endpoint serves as the master list of assets available for trade and
data consumption from Alpaca.
The following parameters are accepted:
=over
lib/Finance/Alpaca.pm view on Meta::CPAN
);
Returns a list of L<Finance::Alpaca::Struct::Bar> objects along with other
data.
The bar endpoint serves aggregate historical data for the requested securities.
The following parameters are accepted:
=over
lib/Finance/Alpaca.pm view on Meta::CPAN
);
Returns a list of L<Finance::Alpaca::Struct::Quote> objects along with other
data.
The bar endpoint serves quote (NBBO) historical data for the requested
security.
The following parameters are accepted:
=over
lib/Finance/Alpaca.pm view on Meta::CPAN
);
Returns a list of L<Finance::Alpaca::Struct::Trade> objects along with other
data.
The bar endpoint serves historical trade data for a given ticker symbol on a
specified date.
The following parameters are accepted:
=over
lib/Finance/Alpaca.pm view on Meta::CPAN
my @orders = $camelid->orders( status => 'open' );
Returns a list of L<Finance::Alpaca::Struct::Order> objects.
The orders endpoint returns a list of orders for the account, filtered by the
supplied parameters.
The following parameters are accepted:
=over
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Finance/Bitcoin/Feed/Site/CoinSetter/Socket.pm view on Meta::CPAN
return {} unless @pieces;
my $id = $pieces[1] || '';
$data = $pieces[4] || '';
my $packet = {
type => $packets[$pieces[0]],
endpoint => $pieces[3] || '',
};
# whether we need to acknowledge the packet
if ($id) {
$packet->{id} = $id;
view all matches for this distribution
view release on metacpan or search on metacpan
examples/FB_low_level_api.pl view on Meta::CPAN
use 5.010;
use Finance::Bitcoin::API;
my $creds = shift @ARGV or die "Please provide username:password as a parameter.\n";
my $uri = 'http://'.$creds.'@127.0.0.1:8332/';
my $api = Finance::Bitcoin::API->new( endpoint => $uri );
my $balance = $api->call('getbalance');
say($balance || $api->error);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Finance/CoinbasePro/Lite.pm view on Meta::CPAN
=head1 DESCRIPTION
Coinbase Pro, L<https://pro.coinbase.com>, is a US cryptocurrency exchange. This
module provides a Perl wrapper for Coinbase Pro's API. Please peruse the
Coinbase Pro API reference to see which API endpoints are available.
=head1 METHODS
=head2 new
view all matches for this distribution
view release on metacpan or search on metacpan
CompanyNames/TextSupport.pm view on Meta::CPAN
bemuse bemused bemusedly bemusement bemuses
bench benched bencher benchers benches benching benchings
benchmark benchmarked benchmarker benchmarkers benchmarking benchmarks
benchtest benchtests
bend bendability bendable bended bender benders bending bendings bends
bendpoint bendpoints
benediction benedictions
benefactor benefactors
benefical beneficial beneficially beneficials
benefication beneficiate beneficiated beneficiating beneficiation
beneficiares beneficiaries beneficiary
CompanyNames/TextSupport.pm view on Meta::CPAN
endotoxin endotoxins
endotracheal endotracheally
endow endowed endowing endowment endowments endows
endpiece endpieces
endplate endplates
endpoint endpoints
endring endrings
endset endsets
endurable endurance endurances endure endured endures enduring
endwall endwalls
enema enemas
CompanyNames/TextSupport.pm view on Meta::CPAN
endowed
endowing
endowment
endowments
endows
endpoint
ends
endurable
endurably
endurance
endure
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Finance/Dogecoin/API.pm view on Meta::CPAN
use LWP::UserAgent;
use LWP::Protocol::https;
use URI::QueryParam;
has 'api_key', is => 'ro', required => 1;
has 'endpoint', is => 'ro', default => sub { 'https://www.dogeapi.com/wow/' };
has 'json', is => 'ro', default => sub {
my $j = JSON->new; $j->allow_nonref; $j
};
has 'ua', is => 'ro', default => sub {
lib/Finance/Dogecoin/API.pm view on Meta::CPAN
sub request {
my ($self, $method, %params) = @_;
# manually setting the 'a' parameter avoids a weird behavior in LWP::UA
# which uppercases 'a'--not what the API expects or wants
my $uri = URI->new( $self->endpoint );
$uri->query_param( a => $method );
while (my ($key, $value) = each %params) {
$uri->query_param( $key => $value );
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Finance/GDAX/API/Order.pm view on Meta::CPAN
=head2 C<product_id>
A valid product id
The product_id must match a valid product. The products list is
available via the /products endpoint.
=head2 C<stp>
[optional] Self-trade prevention flag
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Finance/GDAX/Lite.pm view on Meta::CPAN
=head1 DESCRIPTION
L<https://gdax.com> is a US cryptocurrency exchange. This module provides a Perl
wrapper for GDAX's API. This module is an alternative to L<Finance::GDAX::API>
and is more lightweight/barebones (no entity objects, Moose, etc). Please peruse
the GDAX API reference to see which API endpoints are available.
=head1 METHODS
=head2 new
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Finance/MtGox.pm view on Meta::CPAN
sub _secret {
my ($self) = @_;
return $self->{secret};
}
# build a URI object for the endpoint of an API call
sub _build_api_method_uri {
my ( $self, $version, $name, $prefix ) = @_;
my $version_url_token = "api/" . $version;
$prefix = $prefix ? "$prefix/" : '';
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Finance/Robinhood.pm view on Meta::CPAN
#
has token => (is => 'ro', writer => '_set_token');
#
my $base = 'https://api.robinhood.com/';
# Different endpoints we can call for the API
my %endpoints = (
'accounts' => 'accounts/',
'accounts/positions' => 'accounts/%s/positions/',
'portfolios' => 'portfolios/',
'portfolios/historicals' => 'portfolios/historicals/',
'ach_deposit_schedules' => 'ach/deposit_schedules/',
lib/Finance/Robinhood.pm view on Meta::CPAN
'user/identity_mismatch' => 'user/identity_mismatch',
'watchlists' => 'watchlists/',
'watchlists/bulk_add' => 'watchlists/%s/bulk_add/'
);
sub endpoint {
$endpoints{$_[0]} ?
($DEV > 10 ?
'http://brokeback.dev.robinhood.com/'
: 'https://api.robinhood.com/'
)
. $endpoints{+shift}
: ();
}
#
# Send a username and password to Robinhood to get back a token.
#
lib/Finance/Robinhood.pm view on Meta::CPAN
my ($self, $username, $password) = @_;
# Make API Call
my ($status, $data, $raw)
= _send_request(undef, 'POST',
Finance::Robinhood::endpoint('login'),
{username => $username,
password => $password
}
);
lib/Finance/Robinhood.pm view on Meta::CPAN
my ($self) = @_;
# Make API Call
my ($status, $rt, $raw)
= $self->_send_request('POST',
Finance::Robinhood::endpoint('logout'));
return $status == 200 ?
# The old token is now invalid, so we might as well delete it
$self->_set_token(())
: ();
lib/Finance/Robinhood.pm view on Meta::CPAN
my ($email) = @_;
# Make API Call
my ($status, $rt, $raw)
= _send_request(undef, 'POST',
Finance::Robinhood::endpoint('password_reset/request'),
{email => $email});
return $status == 200;
}
sub change_password {
lib/Finance/Robinhood.pm view on Meta::CPAN
my ($user, $password, $token) = @_;
# Make API Call
my ($status, $rt, $raw)
= _send_request(undef, 'POST',
Finance::Robinhood::endpoint('password_reset'),
{username => $user,
password => $password,
token => $token
}
);
lib/Finance/Robinhood.pm view on Meta::CPAN
}
sub user_info {
my ($self) = @_;
my ($status, $data, $raw)
= $self->_send_request('GET', Finance::Robinhood::endpoint('user'));
return $status == 200 ?
map { $_ => $data->{$_} } qw[email id last_name first_name username]
: ();
}
sub user_id {
my ($self) = @_;
my ($status, $data, $raw)
= $self->_send_request('GET',
Finance::Robinhood::endpoint('user/id'));
return $status == 200 ? $data->{id} : ();
}
sub basic_info {
my ($self) = @_;
my ($status, $data, $raw)
= $self->_send_request('GET',
Finance::Robinhood::endpoint('user/basic_info'));
return $status != 200 ?
()
: ((map { $_ => _2_datetime(delete $data->{$_}) }
qw[date_of_birth updated_at]
),
lib/Finance/Robinhood.pm view on Meta::CPAN
sub additional_info {
my ($self) = @_;
my ($status, $data, $raw)
= $self->_send_request('GET',
Finance::Robinhood::endpoint(
'user/additional_info')
);
return $status != 200 ?
()
: ((map { $_ => _2_datetime(delete $data->{$_}) } qw[updated_at]),
lib/Finance/Robinhood.pm view on Meta::CPAN
sub employment_info {
my ($self) = @_;
my ($status, $data, $raw)
= $self->_send_request('GET',
Finance::Robinhood::endpoint('user/employment'));
return $status != 200 ?
()
: ((map { $_ => _2_datetime(delete $data->{$_}) } qw[updated_at]),
map { m[user] ? () : ($_ => $data->{$_}) } keys %$data);
}
sub investment_profile {
my ($self) = @_;
my ($status, $data, $raw)
= $self->_send_request('GET',
Finance::Robinhood::endpoint(
'user/investment_profile')
);
return $status != 200 ?
()
: ((map { $_ => _2_datetime(delete $data->{$_}) } qw[updated_at]),
lib/Finance/Robinhood.pm view on Meta::CPAN
sub identity_mismatch {
my ($self) = @_;
my ($status, $data, $raw)
= $self->_send_request('GET',
Finance::Robinhood::endpoint(
'user/identity_mismatch')
);
return $status == 200 ? $self->_paginate($data) : ();
}
sub accounts {
my ($self) = @_;
# TODO: Deal with next and previous results? Multiple accounts?
my $return = $self->_send_request('GET',
Finance::Robinhood::endpoint('accounts')
);
return $self->_paginate($return, 'Finance::Robinhood::Account');
}
#
# Returns the porfillo summery of an account by url.
lib/Finance/Robinhood.pm view on Meta::CPAN
my ($self) = @_;
# TODO: Deal with next and previous results? Multiple portfolios?
my $return =
$self->_send_request('GET',
Finance::Robinhood::endpoint('portfolios'));
return $self->_paginate($return, 'Finance::Robinhood::Portfolio');
}
sub instrument {
lib/Finance/Robinhood.pm view on Meta::CPAN
#my ($results) = $rh->instrument({cursor => 'cD04NjQ5'});
#my $msft = $rh->instrument({id => '50810c35-d215-4866-9758-0ada4ac79ffa'});
my $self = shift if ref $_[0] && ref $_[0] eq __PACKAGE__;
my ($type) = @_;
my $result = _send_request($self, 'GET',
Finance::Robinhood::endpoint('instruments')
. ( !defined $type ? ''
: !ref $type ? '?query=' . $type
: ref $type eq 'HASH'
&& defined $type->{cursor}
? '?cursor=' . $type->{cursor}
lib/Finance/Robinhood.pm view on Meta::CPAN
sub quote {
my $self = ref $_[0] ? shift : (); # might be undef but that's okay
#if (scalar @_ > 1 or wantarray) {
my $return =
_send_request($self, 'GET',
Finance::Robinhood::endpoint('quotes') . '?symbols=' . join ',',
@_);
return _paginate($self, $return, 'Finance::Robinhood::Quote');
#}
#my $quote =
# _send_request($self, 'GET',
# Finance::Robinhood::endpoint('quotes') . shift . '/');
#return $quote ?
# Finance::Robinhood::Quote->new($quote)
# : ();
}
lib/Finance/Robinhood.pm view on Meta::CPAN
my $self = ref $_[0] ? shift : (); # might be undef but that's okay
#if (scalar @_ > 1 or wantarray) {
my $return =
_send_request($self,
'GET',
Finance::Robinhood::endpoint('fundamentals')
. '?symbols='
. join ',',
@_
);
return _paginate($self, $return, 'Finance::Robinhood::Fundamentals');
#}
#my $quote =
# _send_request($self, 'GET',
# Finance::Robinhood::endpoint('quotes') . shift . '/');
#return $quote ?
# Finance::Robinhood::Quote->new($quote)
# : ();
}
lib/Finance/Robinhood.pm view on Meta::CPAN
my $fields = join '&', map { $_ . '=' . $fields{$_} }
grep { defined $fields{$_} } keys %fields;
my ($status, $data, $raw)
= _send_request($self,
'GET',
Finance::Robinhood::endpoint('quotes/historicals')
. "$symbol/"
. ($fields ? "?$fields" : '')
);
return if $status != 200;
for (@{$data->{historicals}}) {
lib/Finance/Robinhood.pm view on Meta::CPAN
}
sub locate_order {
my ($self, $order_id) = @_;
my $result = $self->_send_request('GET',
Finance::Robinhood::endpoint('orders') . $order_id . '/');
return $result ?
Finance::Robinhood::Order->new(rh => $self, %$result)
: ();
}
sub list_orders {
my ($self, $type) = @_;
my $result = $self->_send_request(
'GET',
Finance::Robinhood::endpoint('orders')
. (
ref $type
&& ref $type eq 'HASH'
&& defined $type->{cursor} ? '?cursor=' . $type->{cursor}
: ref $type && ref $type eq 'HASH' && defined $type->{'since'}
lib/Finance/Robinhood.pm view on Meta::CPAN
return $self->_paginate($result, 'Finance::Robinhood::Order');
}
# Methods under construction
sub cards {
return shift->_send_request('GET', Finance::Robinhood::endpoint('cards'));
}
sub dividends {
return
shift->_send_request('GET',
Finance::Robinhood::endpoint('dividends'));
}
sub notifications {
return
shift->_send_request('GET',
Finance::Robinhood::endpoint('notifications'));
}
sub notifications_devices {
return
shift->_send_request('GET',
Finance::Robinhood::endpoint(
'notifications/devices')
);
}
sub create_watchlist {
my ($self, $name) = @_;
my ($status, $result)
= $self->_send_request('POST',
Finance::Robinhood::endpoint('watchlists'),
{name => $name});
return $status == 201
?
Finance::Robinhood::Watchlist->new(rh => $self, %$result)
: ();
lib/Finance/Robinhood.pm view on Meta::CPAN
sub delete_watchlist {
my ($self, $watchlist) = @_;
my ($status, $result, $response)
= $self->_send_request('DELETE',
Finance::Robinhood::endpoint('watchlists')
. (ref $watchlist ?
$watchlist->name()
: $watchlist
)
. '/'
lib/Finance/Robinhood.pm view on Meta::CPAN
}
sub watchlists {
my ($self, $cursor) = @_;
my $result = $self->_send_request('GET',
Finance::Robinhood::endpoint(
'watchlists')
. (
ref $cursor
&& ref $cursor eq 'HASH'
&& defined $cursor->{cursor}
lib/Finance/Robinhood.pm view on Meta::CPAN
sub watchlist {
my ($self, $name) = @_;
my ($status, $result)
= $self->_send_request('GET',
Finance::Robinhood::endpoint('watchlists') . "$name/");
return $status == 200 ?
Finance::Robinhood::Watchlist->new(name => $name,
rh => $self,
%$result
)
lib/Finance/Robinhood.pm view on Meta::CPAN
sub markets {
my $self = ref $_[0] ? shift : (); # might be undef but that's okay
my ($symbol, $interval, $span) = @_;
my $result = _send_request(undef, 'GET',
Finance::Robinhood::endpoint('markets'));
return _paginate($self, $result, 'Finance::Robinhood::Market');
}
# TESTING!
# @GET("/documents/{id}/download/?redirect=False")
# Observable<DocumentDownloadResponse> getDocumentDownloadUrl(@Path("id") String str);
sub documents_download {
my ($s, $id, $redirect) = @_;
warn Finance::Robinhood::endpoint('documents/download');
my $result =
_send_request($s, 'GET',
sprintf Finance::Robinhood::endpoint('documents/download'),
$id, $redirect ? 'True' : 'False');
#return _paginate( $self, $result, 'Finance::Robinhood::Market' );
$result;
}
view all matches for this distribution
view release on metacpan or search on metacpan
0.002 2018-09-07 Released-By: PERLANCAR
- [bugfix] There's a hard limit on number of rows returned by
GetSecuritiesStock endpoint, iterate to get all results.
0.001 2018-09-07 Released-By: PERLANCAR
- First release.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/FixerIO/API.pm view on Meta::CPAN
You have to obtain your own API key from the fixer.io web site. There is a free option.
=head1 IMPLEMENTED ENDPOINTS
Please note that depending on your subscription plan, certain API endpoints may not be available.
=head2 LATEST RATES
Returns real-time exchange rate data for all available or a specific set of currencies.
view all matches for this distribution
view release on metacpan or search on metacpan
2.06 2011-10-13
* Added support for retrieving a photo by ID
* Added square and thumbnail sizes to photo URLs
2.07 2014-05-20
* use ssl api endpoint by default
* Fixed some typeos in Base _response_to_photos & added attributes
* added attributes to by_id in Photos as per issue #5
* Fix UTF8 test
2.08 2014-05-22
view all matches for this distribution
view release on metacpan or search on metacpan
scripts/ttfbuilder view on Meta::CPAN
$pt->{'loc'} = [0, 0];
}
}
($withx, $withy) = @{$pt->{'loc'}};
delete $aglyph->{'points'}{$attrs{'with'}} # delete if attaching to a real glyph
if (defined $curbase->{'glyph'} && (!ref $curbase->{'glyph'}{'endpoints'} || $curbase->{'glyph'}{'numPoints'} != scalar @{$curbase->{'glyph'}{'endPoints'}}));
} else
{
$withx = $currif->{'hmtx'}{'advance'}[$aglyph->{'gid'}] / 2 * $currif->{'scale'};
$withy = 0;
}
scripts/ttfbuilder view on Meta::CPAN
+ $g->{'offset'}[0];
if ($glyph = $g->{'glyph'})
{
$glyph->read->get_points;
$pathcount += scalar @{$glyph->{'endPoints'}} if (defined $glyph->{'endpoints'});
push (@{$g->{'glyph_list'}}, pos_glyphs($f, $g->{'gid'}, $glyph, @{$g->{'offset'}}, $g->{'scale'}, $s));
$xMin = $glyph->{'xMin'} * $s;
$yMin = $glyph->{'yMin'} * $s;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Font/TTF/Glyph.pm view on Meta::CPAN
=over 4
=item endPoints
An array of endpoints for each contour in the glyph. There are
C<numberOfContours> contours in a glyph. The number of points in a glyph is
equal to the highest endpoint of a contour.
=item numPoints
This is a generated value which contains the total number of points for this simple glyph.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Footprintless/Plugin/Atlassian/Confluence/Client.pm view on Meta::CPAN
return $self;
}
sub request {
my ( $self, $endpoint, $args, %response_options ) = @_;
my $response;
eval {
$logger->debugf( 'requesting %s', $endpoint );
my $http_request = $self->{request_builder}->$endpoint( ( $args ? @$args : () ) );
$http_request->authorization_basic( $self->{username}, $self->{password} );
if ( $logger->is_trace() ) {
$logger->trace(
join( '',
lib/Footprintless/Plugin/Atlassian/Confluence/Client.pm view on Meta::CPAN
$http_response->dump( maxlength => 500 ),
"\n---------------------- END RESPONSE --------------------\n" )
);
}
$response = $self->{response_parser}->$endpoint( $http_response, %response_options );
};
if ($@) {
if ( ref($@) eq 'HASH' && $@->{code} ) {
$response = $@;
}
lib/Footprintless/Plugin/Atlassian/Confluence/Client.pm view on Meta::CPAN
}
return $response;
}
sub request_all {
my ( $self, $endpoint, $args, @response_options ) = @_;
my $response = $self->request(
$endpoint,
[ @$args,
limit => 100,
start => 0
],
@response_options
lib/Footprintless/Plugin/Atlassian/Confluence/Client.pm view on Meta::CPAN
my $next = $response;
while ( $next->{success} && $next->{content}{_links}{next} ) {
my $limit = $response->{content}{limit};
$next = $self->request(
$endpoint,
[ @$args,
limit => $limit,
start => $next->{content}{start} + $limit,
],
@response_options
lib/Footprintless/Plugin/Atlassian/Confluence/Client.pm view on Meta::CPAN
=back
=head1 METHODS
=head2 request($endpoint, \@args, %response_options)
Generates a request by calling a method named C<$endpoint> on the request
builder, supplying it with C<@args>. The request is sent using the agent,
and the response is parsed by calling a method named C<$endpoint> on the
response parser, supplying it with C<%response_options>.
=head2 request_all($endpoint, \@args, %response_options)
Same as L<request/request($endpoint, \@args, %response_options)> except
that it will loop through I<all> pages until all results have been
returned. This method assumes that the last argument to request builder
will be an options hash that will be used as query parameters.
=head1 AUTHOR
view all matches for this distribution
view release on metacpan or search on metacpan
lib/FormValidator/Tiny.pm view on Meta::CPAN
must => number_in_range(100, '*')
must => number_in_range(100, 500)
must => number_in_range(exclusive => 100, exclusive => 500)
Returns a predicate for must that requires the integer to be within the given
range. The endpoints are inclusive by default. You can add the word "exclusive"
before a value to make the comparison exclusive instead. Using a '*' indicates
no limit at that end of the range.
=head2 one_of
view all matches for this distribution
view release on metacpan or search on metacpan
INTERPRETATION view on Meta::CPAN
- SCRIPTs see the outer interface of the proto even when doing
direct access, not the inside
2. TouchSensor
- isOver events are not generated when the user doesn't move the mouse.
if the user moves the mouse, the endpoint is compared with the current
isOver status and if it's different, an event is generated.
3. Mouse sensors
- spec is not explicit about events being generated only when
the geometry is at front - currently I only cast rays through
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Froody/API/Reflection.pm view on Meta::CPAN
<errors>
<error code="froody.error.notfound.errortype" message="Error Type not Found"/>
</errors>
</method>
<method name="froody.reflection.getSpecification">
<description>Request the full public specification for a froody endpoint.</description>
<response>
<spec>
<methods>
$METHOD_INFO
$METHOD_INFO
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Furl/S3.pm view on Meta::CPAN
use Furl::S3::Error;
use Params::Validate qw(:types validate_with validate_pos);
use URI::Escape qw(uri_escape_utf8);
use Carp ();
Class::Accessor::Lite->mk_accessors(qw(aws_access_key_id aws_secret_access_key secure furl endpoint));
our $VERSION = '0.02';
our $DEFAULT_ENDPOINT = 's3.amazonaws.com';
our $XMLNS = 'http://s3.amazonaws.com/doc/2006-03-01/';
lib/Furl/S3.pm view on Meta::CPAN
my %args = @_;
my $aws_access_key_id = delete $args{aws_access_key_id};
my $aws_secret_access_key = delete $args{aws_secret_access_key};
Carp::croak("aws_access_key_id and aws_secret_access_key are mandatory") unless $aws_access_key_id && $aws_secret_access_key;
my $secure = delete $args{secure} || '0';
my $endpoint = delete $args{endpoint} || $DEFAULT_ENDPOINT;
my $furl = Furl::HTTP->new(
agent => '$class/'. $VERSION,
%args,
header_format => HEADERS_AS_HASHREF,
);
my $self = bless {
endpoint => $endpoint,
secure => $secure,
aws_access_key_id => $aws_access_key_id,
aws_secret_access_key => $aws_secret_access_key,
furl => $furl,
}, $class;
lib/Furl/S3.pm view on Meta::CPAN
sub host_and_path_query {
my( $self, $bucket, $key, $params ) = @_;
my($host, $path_query);
$key = _normalize_key($key);
if ( is_dns_style($bucket) ) {
$host = join '.', $bucket, $self->endpoint;
$path_query = $self->_path_query( $key, $params );
}
else {
$host = $self->endpoint;
$path_query = $self->_path_query( join('/', $bucket, $key), $params );
}
$path_query =~ s{//}{/}g;
return ($host, $path_query);
}
lib/Furl/S3.pm view on Meta::CPAN
=item secure
boolean flag. uses SSL connection or not.
=item endpoint
S3 endpoint hostname. the default value is I<s3.amazonaws.com>
other parmeters are passed to Furl->new. see L<Furl> documents.
=back
view all matches for this distribution
view release on metacpan or search on metacpan
examples/webgui.pl view on Meta::CPAN
accidental corruption of data by reading old version. Depending on type of
database back-end, MySQL users might be out of luck.
=head2 recovering from errors
B<Transport endpoint is not connected> is very often error when Fuse perl
bindings exit without clean umount (through C<Fuse::DBI> C<umount> method or
with C<fusermount -u /mnt> command).
This script will automatically run C<fusermount -u /mnt> if it receives
above error on startup. If it fails, mount point is still in use (that
view all matches for this distribution
view release on metacpan or search on metacpan
resources/containers/docker/docker_inspect.json view on Meta::CPAN
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 0,
"ExitCode": 128,
"Error": "failed to create endpoint jolly_jepsen on network bridge: Error starting userland proxy: listen tcp 0.0.0.0:80: listen: address already in use",
"StartedAt": "0001-01-01T00:00:00Z",
"FinishedAt": "0001-01-01T00:00:00Z"
},
"Image": "sha256:e8ebb222f50c4b278c216a1e033b8098b9f2ec005bfe8542fcc041fda6e7d6cf",
"ResolvConfPath": "",
resources/containers/docker/docker_inspect.json view on Meta::CPAN
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 0,
"ExitCode": 128,
"Error": "failed to create endpoint loving_noyce on network bridge: Error starting userland proxy: listen tcp 0.0.0.0:80: listen: address already in use",
"StartedAt": "0001-01-01T00:00:00Z",
"FinishedAt": "0001-01-01T00:00:00Z"
},
"Image": "sha256:e8ebb222f50c4b278c216a1e033b8098b9f2ec005bfe8542fcc041fda6e7d6cf",
"ResolvConfPath": "",
view all matches for this distribution
view release on metacpan or search on metacpan
contrib/SynView/cgi-lib/DAS/GUS/Segment/Feature.pm view on Meta::CPAN
my $self = shift;
my ($recurse,$parent) = @_;
my ($start,$stop) = ($self->start,$self->stop);
# the defined() tests prevent uninitialized variable warnings,
# when dealing with clone objects whose endpoints may be undefined
($start,$stop) = ($stop,$start)
if defined($start) && defined($stop) && $start > $stop;
my $strand = ('-','.','+')[$self->strand+1];
my $ref = $self->refseq;
view all matches for this distribution
view release on metacpan or search on metacpan
my ($gobj, $gd, $left, $right, $top, $bottom, $gdta_x_axis) = @_;
my $clr = $gobj->set_clr(0xaa, 0xaa, 0xaa);
my $x = 10;
while ( $x < $#{ $data[1] }-10 ) {
# compute line endpoints from a datapoint
my @lhs = $gobj->val_to_pixel($x+1, $data[1][$x]);
# to a predicted endpoint, based on the moving average
my @rhs = $gobj->val_to_pixel($x+11, $data[1][$x] + 10*($mv_avg[$x] - $mv_avg[$x-1]));
print "adding line from data point (@lhs) to value predicted by mv_avg (@rhs)\n";
$gd->line(@lhs,@rhs,$clr);
view all matches for this distribution
view release on metacpan or search on metacpan
Graph/axestype.pm view on Meta::CPAN
return $self;
}
# CONTRIB Scott Prahl
#
# Calculate best endpoints and number of intervals for an axis and
# returns ($nice_min, $nice_max, $n), where $n is the number of
# intervals and
#
# $nice_min <= $min < $max <= $nice_max
#
Graph/axestype.pm view on Meta::CPAN
return ($best_min, $best_max, $best_num)
}
# CONTRIB Ben Tilly
#
# Calculate best endpoints and number of intervals for a pair of axes
# where it is trying to line up the scale of the two intervals. It
# returns ($nice_min_1, $nice_max_1, $nice_min_2, $nice_max_2, $n),
# where $n is the number of intervals and
#
# $nice_min_1 <= $min_1 < $max_1 <= $nice_max_1
view all matches for this distribution
view release on metacpan or search on metacpan
GH/Sim4/sim4.2002-03-03/sim4.init.c view on Meta::CPAN
* R direction of search; 0 - search the '+' strand only;
* 1 - search the '-' strand only; 2 - search both strands and
* report the best match. (R=2)
* D adjusts the range of diagonals in building the exons.
* H adjusts the re-linking weight factor
* A specifies the output format: exon endpoints only (A=0),
* alignment text (A=1), alignment in lav format (A=2) or both
* exon endpoints and alignment text (A=3, A=4). For A=3, positions
* in sequence 1 are given in the original sequence, and for A=4 in
* its reverse complement. A=5 prints the exon and CDS coordinates
* (the latter, if known) in the `exon file' format required by PipMaker.
* N if !=0, highly accurate exon detection is expected, for highly
* accurate sequence data.
GH/Sim4/sim4.2002-03-03/sim4.init.c view on Meta::CPAN
1 - search the '-' strand only; 2 - search both strands and \n\
report the best match. (R=2)\n\
D - bound for the range of diagonals within consecutive msps in an\n\
exon. (D=10)\n\
H - weight factor for MSP scores in relinking. (H=500)\n\
A - output format: exon endpoints only (A=0), alignment text (A=1),\n\
alignment in lav (block) format (A=2), or both exon endpoints\n\
and alignment text (A=3, A=4). If complement match, A=0,1,2,3\n\
give direct positions in the long sequence and complement \n\
positions in the short sequence. A=4 gives direct positions in \n\
the first sequence, regardless of the relative lengths.\n\
A=5 prints the exon and CDS coordinates (the latter, if known)\n\
GH/Sim4/sim4.2002-03-03/sim4.init.c view on Meta::CPAN
rf1 = seq_revcomp_inplace(rf1);
revseq1 = SEQ_CHARS(rf1);
if (rs.ali_flag==5) {
if (rs.CDS_to>len1)
fatal("Command line CDS endpoint exceeds sequence length.");
cds_gene = extract_tok(h1);
if (cds_gene==NULL) { /* no FastaA header */
cds_from = rs.CDS_from; cds_to = rs.CDS_to;
} else {
line = strstr(h1, "CDS=");
GH/Sim4/sim4.2002-03-03/sim4.init.c view on Meta::CPAN
} else {
cds_from = cds_to = 0;
}
}
if (cds_to>len1)
fatal("CDS endpoints exceed sequence length.");
}
}
if (rs.poly_flag && file_type==EST_GEN) {
get_polyAT(seq1,len1,&pT,&pA,BOTH_AT);
GH/Sim4/sim4.2002-03-03/sim4.init.c view on Meta::CPAN
cds_range(line+4, &cds_from, &cds_to);
} else {
cds_from = cds_to = 0;
}
}
if (cds_to>len2) fatal("CDS endpoints exceed sequence length.");
}
if (rs.poly_flag && file_type==GEN_EST) {
get_polyAT(seq2, len2, &pT, &pA, BOTH_AT);
}
GH/Sim4/sim4.2002-03-03/sim4.init.c view on Meta::CPAN
if (get_strargval('S', &(args->S))) {
cds_range(args->S, &(args->CDS_from), &(args->CDS_to));
if ((args->CDS_from<=0) || (args->CDS_to<=0) ||
(args->CDS_from>args->CDS_to))
fatal("Illegal endpoints for the CDS region.");
} else
args->S = NULL;
if (args->S && (args->ali_flag!=5))
fatal ("A=5 must accompany CDS specification.");
return;
}
/* extract the CDS endpoints from the command line specification <n1>..<n2> */
static void cds_range(char *line, int *from, int *to)
{
char *s = line;
if (line == NULL) fatal ("NULL CDS specification.");
GH/Sim4/sim4.2002-03-03/sim4.init.c view on Meta::CPAN
if (*s && !isspace((int)(*s)))
fatal ("Garbage at the end of the CDS numerical specification.");
/* now extract the CDS elements */
if (sscanf(line, "%d..%d", from, to)!=2)
fatal ("Error when reading the CDS endpoints.");
return;
}
static void add_offset_exons(Exon *exons, int offset)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Google/Ads/AdWords/AuthTokenHandler.pm view on Meta::CPAN
use Class::Std::Fast;
# Class methods from Google::Ads::Common::AuthTokenHandler
sub prepare_request {
my ($self, $endpoint, $http_headers, $envelope) = @_;
my $version = $self->get_api_client()->get_version();
if ($version gt Google::Ads::AdWords::Constants::LAST_SUPPORTED_CLIENT_LOGIN_VERSION) {
my $message = "ClientLogin is not supported in " . $version .
lib/Google/Ads/AdWords/AuthTokenHandler.pm view on Meta::CPAN
my $header = "<authToken xmlns=\"$xmlns\">" . $self->__get_auth_token() .
"</authToken>";
$envelope =~ s/(<RequestHeader [^>]+>)/$1${header}/;
return HTTP::Request->new('POST', $endpoint, $http_headers, $envelope);
}
sub _service {
return "adwords";
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Game/WordBrain/WordList.pm view on Meta::CPAN
endpiece
endplate
endplates
endplay
endpleasure
endpoint
endpoints
endrin
endrins
endrudge
endrumpf
ends
view all matches for this distribution
view release on metacpan or search on metacpan
nsis/ipc_run/Run.txt view on Meta::CPAN
that both stdout and stderr write to the created pipe.
=item Redirection Filters
Both input redirections and output redirections that use scalars or
subs as endpoints may have an arbitrary number of filter subs placed
between them and the child process. This is useful if you want to
receive output in chunks, or if you want to massage each chunk of
data sent to the child. To use this feature, you must use operator
syntax:
nsis/ipc_run/Run.txt view on Meta::CPAN
=back
=head1 FILTERS
These filters are used to modify input our output between a child
process and a scalar or subroutine endpoint.
=over
=item binary
nsis/ipc_run/Run.txt view on Meta::CPAN
in to one 'meta-harness'.
Allow a harness to be passed in place of an \@cmd. This would allow
multiple harnesses to be aggregated.
Ability to add external file descriptors w/ filter chains and endpoints.
Ability to add timeouts and timing generators (i.e. repeating timeouts).
High resolution timeouts.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Test/Games/BonDigi.pm view on Meta::CPAN
push @seq, $word;
}
alarm 0;
};
unlike($@, qr/Endless loop/, 'iterator correctly stops at given endpoint');
# Test iterator fixed part
is($seq[0], 'x', 'first word is "x"');
is($seq[1], 'y', 'then "y"');
is($seq[2], 'x', 'then "x" again');
view all matches for this distribution