From d732baa04abb5547fe018d1447add5136738151b Mon Sep 17 00:00:00 2001 From: boston Date: Wed, 17 Jul 2019 15:50:20 +0300 Subject: [PATCH] payment example --- examples/payment.php | 22 ++++++++++++++++++++++ examples/undelegate.php | 3 +-- 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 examples/payment.php diff --git a/examples/payment.php b/examples/payment.php new file mode 100644 index 0000000..16e42b9 --- /dev/null +++ b/examples/payment.php @@ -0,0 +1,22 @@ +setNetwork(MetaHash::NETWORK_MAIN); + + +$fromPrivateKey = '30740201010420f882269a823c7a1721a0b0b1b7c2de2f9c13a744ef7c8b7dd3a95a09b421b277a00706052b8104000aa14403420004ac0925d33c19e35f2025c4738dba3b32e046e9f0d83930f7c6539fc9975adedcef18123797d7f99778e7cdd801996f88058a8e8fb1cfeadadb1bffd049907250'; + + +$fromAddress ='0x00e327ebc4691ae115a7146384732308d8bc11280e3922aa44'; +$toAddress = '0x00fa2a5279f8f0fd2f0f9d3280ad70403f01f9d62f52373833'; +$amount = 0; +$data = 'send via https://github.com/xboston/php-metahash'; + +$nonce = $metaHash->getNonce($fromAddress); +$sendTx = $metaHash->sendTx($fromPrivateKey, $toAddress, $amount, $data, $nonce); + +\var_dump('sendTx', $sendTx); diff --git a/examples/undelegate.php b/examples/undelegate.php index 8fed2ad..14f47a0 100644 --- a/examples/undelegate.php +++ b/examples/undelegate.php @@ -2,7 +2,6 @@ require __DIR__.'/../vendor/autoload.php'; -use Dump\Dump; use Metahash\MetaHash; $youAddress ='0x00e327ebc4691ae115a7146384732308d8bc11280e3922aa44'; @@ -19,4 +18,4 @@ $nonce = $metaHash->getNonce($youAddress); $sendTx = $metaHash->sendTx($youPrivateKey, $undelegateNodeAddress, 0, $command, $nonce); -Dump::d('sendTx', $sendTx); +\var_dump('sendTx', $sendTx);