PHP code example of ardenthq / arkvault-url

1. Go to this page and download the library: Download ardenthq/arkvault-url library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ardenthq / arkvault-url example snippets


use Ardenthq\UrlBuilder\UrlBuilder;

$builder = new UrlBuilder();

$transferUrl = $builder->generateTransfer('DM7UiH4b2rW2Nv11Wu6ToiZi8MJhGCEWhP');
// > https://app.arkvault.io/#/?method=transfer&recipient=DM7UiH4b2rW2Nv11Wu6ToiZi8MJhGCEWhP&coin=ARK&nethash=6e84d08bd299ed97c212c886c98a57e36545c8f5d645ca7eeae63a8bd62d8988

$transferUrl = $builder->generateTransfer('DM7UiH4b2rW2Nv11Wu6ToiZi8MJhGCEWhP', [
  'amount' => 12.50,
  'memo' => 'My custom message'
]);
// > https://app.arkvault.io/#/?method=transfer&recipient=DM7UiH4b2rW2Nv11Wu6ToiZi8MJhGCEWhP&coin=ARK&nethash=6e84d08bd299ed97c212c886c98a57e36545c8f5d645ca7eeae63a8bd62d8988&amount=12.5&memo=My+custom+message

$voteUrl = $builder->generateVote('benchdark');
// > https://app.arkvault.io/#/?method=vote&nethash=6e84d08bd299ed97c212c886c98a57e36545c8f5d645ca7eeae63a8bd62d8988&delegate=benchdark

$signUrl = $builder->generateMessageSign('message', ['address' => 'address']);
// > https://app.arkvault.io/#/?coin=ARK&nethash=6e84d08bd299ed97c212c886c98a57e36545c8f5d645ca7eeae63a8bd62d8988&method=sign&message=test&address=address

$verifyUrl = $builder->generateMessageVerify(
	message: 'hello world',
	signatory: '025f81956d5826bad7d30daed2b5c8c98e72046c1ec8323da336445476183fb7ca',
	signature: '22f8ef55e8120fbf51e2407c808a1cc98d7ef961646226a3d3fad606437f8ba49ab68dc33c6d4a478f954c72e9bac2b4a4fe48baa70121a311a875dba1527d9d'
);
// > https://app.arkvault.io/#/?coin=ARK&nethash=6e84d08bd299ed97c212c886c98a57e36545c8f5d645ca7eeae63a8bd62d8988&method=verify&message=hello+world&signatory=025f81956d5826bad7d30daed2b5c8c98e72046c1ec8323da336445476183fb7ca&signature=22f8ef55e8120fbf51e2407c808a1cc98d7ef961646226a3d3fad606437f8ba49ab68dc33c6d4a478f954c72e9bac2b4a4fe48baa70121a311a875dba1527d9d

// Custom coin
$builder->setCoin("Custom"); // Defaults to "ARK"

// Pass a custom nethash for the network
$builder->setNetwork("0123..ef)"; // Defaults to ARK's mainnet nethash

// Or pass the network using the `Networks` enum
// Import enum: `use Ardenthq\UrlBuilder\Enums\Networks;`
$builder->setNetwork(Networks::ARKDevnet);

// Change the base URL by passing it into the constructor
new URLBuilder("https://your-url.com"); // Defaults to app.arkvault.io
bash
composer analyse