Coder Social home page Coder Social logo

rippled-php's Introduction

rippled-php

Build Status Coverage Status Latest Stable Version Latest Unstable Version

This is a PHP library for communicating with the XRP Ledger.

In addition to wrapping the rippled API, it validates method/transaction parameters and normalizes responses.

Refer to the API Documentation in the Ripple Developer Portal for methods, parameters, and expected responses.

Dependencies

This project implements PSR-7 via the use of HTTPLUG so the developer can select the HTTP Client best suited for their architecture.

If you do not have a preference, simply run the command below and proceed to the installation section.

composer require php-http/guzzle6-adapter php-http/message

Installation

composer require foxrp/rippled-php

QuickStart

Retrieve Balance

<?php

use FOXRP\Rippled\Client;

$client = new Client('https://s1.ripple.com:51234');

$balance = null;

$response = $client->send('account_info', [
    'account' => 'rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn'
]);

// Set balance if successful.
if ($response->isSuccess()) {
    $data = $response->getResult();
    $balance = $data['account_data']['Balance'];
}

See Exception Handling for more control over handling errors.

Documentation

Unit Testing

Run the unit test suite:

make test

Run test coverage:

make cov

Once you run the coverage command, open tests/coverage/index.html to view the report.

Functional Testing

Functional tests run code against a live server. Of course this should be run against a test server.

If you don't already have test accounts, create 2 and note the account id and secret for each.

https://developers.ripple.com/xrp-test-net-faucet.html

The functional test suite loads endpoint and account info from .env.test.

If you haven't already, copy .env.test.dist to .env.test and add your account info.

FOXRP_ACCT_1_ID requires 100 XRP for the tests.

Use the following command to run the functional test suite.

make testf

Contribute

PRs & New Issues are welcome!

XRP Tip Jar: rwSZu5vAgPEdoDpYx9qZtqtHRDcFwCooqw

rippled-php's People

Contributors

mikemilano 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.