mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2026-08-19 01:02:37 +00:00
Re-level non-docs content to top of repo and rename content→docs
This commit is contained in:
26
_code-samples/get-started/php/base.php
Normal file
26
_code-samples/get-started/php/base.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
// Use the Composer autoloader
|
||||
require __DIR__ . '/vendor/autoload.php';
|
||||
|
||||
// Imports
|
||||
use XRPL_PHP\Client\JsonRpcClient;
|
||||
use XRPL_PHP\Wallet\Wallet;
|
||||
use function XRPL_PHP\Sugar\fundWallet;
|
||||
|
||||
// Create a client using the Testnet
|
||||
$client = new JsonRpcClient("https://s.altnet.rippletest.net:51234");
|
||||
|
||||
// Create a new wallet
|
||||
$wallet = Wallet::generate();
|
||||
|
||||
// Fund (and activate) the wallet
|
||||
fundWallet($client, $wallet);
|
||||
|
||||
// print wallet properties
|
||||
print_r([
|
||||
'publicKey' => $wallet->getPublicKey(),
|
||||
'privateKey' => $wallet->getPrivateKey(),
|
||||
'classicAddress' => $wallet->getAddress(),
|
||||
'seed' => $wallet->getSeed()
|
||||
]);
|
||||
Reference in New Issue
Block a user