soulseekah/phpeosio

A native EOSIO HTTP JSON RPC client

0.1.0 2021-12-13 23:34 UTC

This package is auto-updated.

Last update: 2024-04-20 02:32:33 UTC


README

A minimalistic and pure PHP implementation to interact with EOSIO blockchains via JSON RPC endpoints via HTTP.

Installation

composer require soulseekah/phpeosio

Usage

// Connect to local JSON RPC endpoint via HTTP
$client = new PHPEOSIO\Client( 'http://localhost:8888' );

// Add permission with private key
$client->add_key( 'soulseekah@active', '5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3' );

// Create, sign and push transaction
$client->push_transaction( 'eosio', 'bidname', [
	'bidder' => 'soulseekah',
	'newname' => 'phpeosio',
	'bid' => '1 EOS',
], 'soulseekah@active' );

// Send tokens via a transaction
$client->push_transaction( 'eosio.token', 'transfer', [
	'from': 'soulseekah',
	'to': 'eosio',
	'quantity': '10 EOS',
	'memo': 'Thank you for your service.',
], 'soulseekah@active' );

Methods

$client->get_info(); // Get chain info
$client->get_abi( $account ); // Get contract ABI
$client->get_table_rows( $account, $table, $scope ); // Get table rows