Jump to content


Photo

rippleTop-lib - PHP library

rippleTop Lib PHP Code API

  • Please log in to reply
No replies to this topic

#1 Hurukan

Hurukan

    Administrator

  • Administrators
  • 2483 posts
  • LocationParis

Posted 04 June 2013 - 07:37 PM

rippleTop-lib is a PHP lib created by rippletop.com.

You can find it on github: https://github.com/b...n/rippleTop-lib

 

For the moment, it implements the following API:

  • account_info
  • account_lines
  • account_offers
  • tx

I have pasted some examples of PHP code using that lib ;)

 

account_info.php

https://ripple.com/wiki/RPC_API#account_info
require_once dirname(__FILE__).'/../ripple_top/ripple_top_rpc.php';

$ripple = new RippleTopRpcClient("http://s1.ripple.com:51234");
$resp = $ripple->account_info(array("account" => "rvFbbjmy7SbNzXafkzHrWwwkTyS6fQAYF"));
if ($resp['status'] != 'success') {
	// do something handle error
	var_dump($resp);
	exit;
}
var_dump($resp);

account_lines.php

https://ripple.com/wiki/RPC_API#account_lines
require_once dirname(__FILE__).'/../ripple_top/ripple_top_rpc.php';

$ripple = new RippleTopRpcClient("http://s1.ripple.com:51234");
$resp = $ripple->account_lines(array("account" => "rvFbbjmy7SbNzXafkzHrWwwkTyS6fQAYF"));
if ($resp['status'] != 'success') {
	// do something handle error
	var_dump($resp);
	exit;
}
var_dump($resp);

account_offers.php

https://ripple.com/wiki/RPC_API#account_offers
require_once dirname(__FILE__).'/../ripple_top/ripple_top_rpc.php';

$ripple = new RippleTopRpcClient("http://s1.ripple.com:51234");
$resp = $ripple->account_offers(array("account" => "rsKn8hGfNDAVuEdZ3NHXUqqZzp8uDiLUK9"));
if ($resp['status'] != 'success') {
	// do something handle error
	var_dump($resp);
	exit;
}
var_dump($resp);

tx.php

require_once dirname(__FILE__).'/../ripple_top/ripple_top_rpc.php';

$ripple = new RippleTopRpcClient("http://s1.ripple.com:51234");

$resp = $ripple->tx(array(
		"transaction" => "7B242CC8C65690CF8C95C03880E07AB5BEF84BF727AB8E39A7BC1F6CA4E633AA",
));
if ($resp['status'] != 'success') {
	// do something handle error
	var_dump($resp);
	exit;
}
var_dump($resp);

  • Koorg likes this

Ripple: Beyond Bitcoin

Wallet: rBYJAUMJN4di2EZUTHZ52TfCfzszAEXTG8

XRP Talk on Twitter - Facebook - Reddit - Weibo






Also tagged with one or more of these keywords: rippleTop, Lib, PHP, Code, API

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users