mirror of
https://github.com/LBRYFoundation/lbry.com.git
synced 2025-08-23 17:47:26 +00:00
24 lines
No EOL
552 B
PHP
24 lines
No EOL
552 B
PHP
<?php
|
|
|
|
|
|
class LBRY
|
|
{
|
|
public static function getApiUrl($endpoint)
|
|
{
|
|
return Config::get('lbry_api_server') . $endpoint;
|
|
}
|
|
|
|
public static function getLBCtoUSDRate()
|
|
{
|
|
$response = CurlWithCache::get(static::getApiUrl('/lbc/exchange_rate'), [], [
|
|
'cache' => 3600, //one hour
|
|
'json_response' => true
|
|
]);
|
|
return $response['data']['lbc_usd'] ?? 0;
|
|
}
|
|
|
|
public static function unsubscribe($email)
|
|
{
|
|
return Curl::post(static::getApiUrl('/user_unsubscribe/new'), ['email' => $email], ['json_response' => true]);
|
|
}
|
|
} |