PHP code example of xrpl / xumm-sdk-php

1. Go to this page and download the library: Download xrpl/xumm-sdk-php 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/ */

    

xrpl / xumm-sdk-php example snippets


// Either pass API credentials through the constructor 
$sdk = new XummSdk($apiKey, $apiSecret);

// Or set them as environment variables. See .env.example for the expected variable names.
// Note: the .env file is mostly applicable when contributing to the SDK itself.  
$sdk = XummSdk();

$sdk->createPayload(
    new Payload(
        transactionBody: [
            'TransactionType' => 'Payment',
            'Destination' => 'rPdvC6ccq8hCdPKSPJkPmyZ4Mi1oG2FFkT',
            'Fee' => '12'
        ],
        customMeta: new CustomMeta(identifier: 'my-custom-identifier'),
    )
);

composer