Giter Club home page Giter Club logo

buda-sdk's Introduction

Contributors Forks Stargazers Issues MIT License PHP Composer

Description

Este proyecto tiene como finalidad generar un SDK en PHP para utilizar los endpoints del sitio Buda.com Por ahora el proyecto está generado con el Codegen de Tsukiro que podrá ser cambiado en un futuro Release.

Requirements

PHP 5.5 and later

Installation & Usage

Composer

Puedes instalar el proyecto utilizando composer (v2)

Puedes añadir la siguiente linea de comandos a tu composer.json:

{
  "require": {
    "tsukiro/buda-sdk": "*@dev"
  }
}

Luego ejecuta composer install

Tests

To run the unit tests:

composer install
./vendor/bin/phpunit

Getting Started

Luego de haber seguido los pasos del procedimiento de instalación puedes hacer lo suguiente:

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Tsukiro\Client\Api\BudaApi();

try {
    $apiInstance->setApiKey("YOUR_APIKEY");
    $apiInstance->setSecret("YOUR_SECRET");
    $response =  $apiInstance->getBalance();
    list($body, $statusCode, $headers) = $response;

} catch (Exception $e) {
    echo 'Exception when calling BudaApi->apiV2BalancesGet: ', $e->getMessage(), PHP_EOL;
}

$apiInstance = new Tsukiro\Client\Api\BudaApi();

try {
    $response = $apiInstance->getMarkets();
    list($markets, $statusCode, $headers) = $response;
} catch (Exception $e) {
    echo 'Exception when calling BudaApi->getMarkets: ', $e->getMessage(), PHP_EOL;
}

$apiInstance = new Tsukiro\Client\Api\BudaApi();
$market_id = "market_id_example"; // string | Market ID obtenido desde le metodo getMarkets o desde tu base de datos

try {
    $response = $apiInstance->getTicker($market_id);
    list($ticker, $statusCode, $headers) = $response;
} catch (Exception $e) {
    echo 'Exception when calling BudaApi->apiV2MarketsMarketIdTickerGet: ', $e->getMessage(), PHP_EOL;
}
?>

Documentation for API Endpoints

All URIs are relative to https://www.buda.com

Class Method HTTP request Description
BudaApi getBalances GET /api/v2/balances
BudaApi getMarkets GET /api/v2/markets
BudaApi getTicker GET /api/v2/markets/{market_id}/ticker

Documentation For Authorization

Para las rutas que requieran autenticación como lo es getBalances debes setear tu apikey y tu secret, las funciones que se hayan desarrollado automáticamente generarán el nonce y signature necesarios para comunicarse con los endpoints de buda

    $apiInstance->setApiKey("YOUR_APIKEY");
    $apiInstance->setSecret("YOUR_SECRET");

buda-sdk's People

Contributors

tsukiro avatar

Stargazers

 avatar

Watchers

 avatar

buda-sdk's Issues

Responder body con formato JSON

Is your feature request related to a problem? Please describe.
Cuando los metodos responden con el body de Buda viene en texto plano y se sabe que es un JSON

Describe the solution you'd like
Simplemente agregar un json_decode en el metodo que devuelve el body

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.