Giter VIP home page Giter VIP logo

bitsharesphp-ws's Introduction

BitsharesPHP-WS

A very basic implementation of bitsharesjs-ws written in pure PHP. Which "can be used to easily connect to and obtain data from the Bitshares blockchain via public apis or local nodes".

Installation

Download the package using Composer

composer require notorious/bitsharesphp-ws

Usage

Market API

app\BitsharesPHP\Example.php

<?php

namespace App\BitsharesPHP;

// Import the BitsharesClient class
use Notorious\BitsharesPHP\BitshareClient;

class Example {
  // Create local variable (Optional)
  private $client;
  
  function __construct() {
    // Instantiate the BitshareClient class instance 
    $this->client = new BitshareClient();
  }
  
  // Using CryptoBridge pairs, b-hash (HASH) and Bitcoin (BTC)
  public function echoMarketAPI() {
    //Grab the MarketAPI class instance from the client
    $market_api = $this->client->getMarketAPI();
    // Get Ticker Data
    echo $market_api->getTicker("BRIDGE.BTC", "BRIDGE.HASH");
    // Get Base Asset  => BRIDGE.BTC
    echo $market_api->getBase("BRIDGE.BTC", "BRIDGE.HASH");
    // Get Quote Asset => BRIDGE.HASH
    echo $market_api->getQuote("BRIDGE.BTC", "BRIDGE.HASH");
    // Get Lastest Price
    echo $market_api->getLatest("BRIDGE.BTC", "BRIDGE.HASH");
     // Get Current Lowest Bid
    echo $market_api->getLowestBid("BRIDGE.BTC", "BRIDGE.HASH");
     // Get Current Highest Bid
    echo $market_api->getHighestBid("BRIDGE.BTC", "BRIDGE.HASH");
     // Get Price Percent Change
    echo $market_api->getPercentChanged("BRIDGE.BTC", "BRIDGE.HASH");
     // Get Base Asset Volume
    echo $market_api->getBaseVolume("BRIDGE.BTC", "BRIDGE.HASH");
     // Get Quote Asset Volume
    echo $market_api->getQuoteVolume("BRIDGE.BTC", "BRIDGE.HASH");
  }
}

Assets

Coming Soon

Donations

Like the project? Well, I like coffee! So consider buying me a cup if this project helps you out!

  • BTC: 38DDHuLiRc2qLsksvEqujR7rBspBLwteSG
  • BCH: qp0xagl3cfxpjk26mxqvhkca4s6ws5a8cswg3kwyu9
  • ETH: 0xa8C90EF48D725fC17B53C7bFf952375eaD12A445
  • LTC: MQwhSbrY92nDyQAS9qobbTYYxh43n9nfNd

bitsharesphp-ws

bitsharesphp-ws's People

Contributors

skinnypetethegiraffe avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

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.