xboston / metahash
This package is abandoned and no longer maintained.
No replacement package was suggested.
MetaHash Cryptocurrency PHP SDK
v0.5
2022-02-01 16:25 UTC
Requires
- php: >=8.0.2
- ext-gmp: *
- ext-json: *
- guzzlehttp/guzzle: ^7.4
- mdanter/ecc: ^1.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.5
- ghostff/dump7: ^1.0
- overtrue/phplint: ^4.1
- phpstan/phpstan: ^1.4
- squizlabs/php_codesniffer: ^3.6
This package is auto-updated.
Last update: 2022-11-29 18:15:52 UTC
README
An unofficial PHP library for #MetaHash blockchain.
Requirements
- PHP 8.0.2+
- ext-gmp
- ext-curl
- composer
Installation
You can install this package with Composer. You only need to require xboston/metahash.
composer require xboston/metahash
Information
Methods
- fetch-balance
- fetch-balances
- fetch-history
- get-address-delegations
- get-tx
- get-block-by-hash
- get-block-by-number
- get-last-txs
- get-blocks
- get-dump-block-by-number
- get-dump-block-by-hash
- get-count-blocks
- get-forging-sum
- get-last-node-stat-result
- get-last-node-stat-trust
- get-last-node-stat-count
- get-last-nodes-stats-count
- get-all-last-nodes-count
- get-nodes-raiting
- get-common-balance
- status
- mhc_send
- getinfo
Extra Methods
- generateKey
- getNonce
Usage
You can find usage examples in the examples folder.
Examples
<?php use Metahash\MetaHash; $metaHash = new MetaHash(); $balance = $metaHash->fetchBalance('0x00fa2a5279f8f0fd2f0f9d3280ad70403f01f9d62f52373833'); print_r($balance);
Console examples
git clone git@github.com:xboston/metahash-php.git
cd metahash-php
composer install
php examples/cli.php method=generate
php examples/cli.php method=fetch-balance address=0x00fa2a5279f8f0fd2f0f9d3280ad70403f01f9d62f52373833
php examples/cli.php method=fetch-balances address=0x00fa2a5279f8f0fd2f0f9d3280ad70403f01f9d62f52373833,0x0039f42ad734606d250ea0b0151d4aeab6b4edc6587c4b27ef
php examples/cli.php method=fetch-history address=0x00fa2a5279f8f0fd2f0f9d3280ad70403f01f9d62f52373833
php examples/cli.php method=get-tx hash=bc4a521c1d0d958e2c00e9cdf90a66b15df918cd22e3c408b0f793d913fc7626
php examples/cli.php method=get-last-txs
Server mode examples
git clone git@github.com:xboston/metahash-php.git
cd metahash-php
composer install
cd examples
php -S localhost:8000
open in browser: http://localhost:8000/
or http://localhost:8000/wallets.php
License
This package is released under the MIT license.