Created
November 25, 2020 05:12
-
-
Save askaaqib/af51dcf3336a7626097cc59951fc9c41 to your computer and use it in GitHub Desktop.
Fund Account - Stellar PHP API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
require "../vendor/autoload.php"; | |
// See 01-create-account.php for where this was generated | |
$publicAccountId = 'GCCZACJX7DHEWGK5WJ2ONRGAJN2RBGGCX3OO4NF66JMJ4MNACKED577A'; | |
// Use the testnet friendbot to add funds: | |
$response = file_get_contents('https://horizon-testnet.stellar.org/friendbot?addr=' . $publicAccountId); | |
// After a successful response, the account will have lumens from the testbot | |
if ($response !== false) { | |
print 'Success! Account is now funded.' . PHP_EOL; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment