soulseekah/phpeosio

EOSIO HTTP JSON RPC 客户端

0.1.0 2021-12-13 23:34 UTC

This package is auto-updated.

Last update: 2024-09-20 03:30:50 UTC


README

一个简约且纯粹的PHP实现,用于通过HTTP JSON RPC端点与EOSIO区块链进行交互。

安装

composer require soulseekah/phpeosio

用法

// Connect to local JSON RPC endpoint via HTTP
$client = new PHPEOSIO\Client( 'https://: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' );

方法

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