PHP code example of thesuperiorcoin / superior-php

1. Go to this page and download the library: Download thesuperiorcoin/superior-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/ */

    

thesuperiorcoin / superior-php example snippets



use Superior\Wallet;

$wallet = new Superior\Wallet();

$hostname = YOUR_WALLET_IP;
$port = YOUR_WALLET_PORT;
$wallet = new Superior\Wallet($hostname, $port);

$balance = $wallet->getBalance();

$address = $wallet->getAddress();

$tx_hash = $wallet->transfer($options);

$options = [
    'destinations' => (object) [
        'amount' => '1',
        'address' => '5QaiHzo64sLDo42ky98uXtJ3zswCdpUrk1q5nSidtqovjjiC7FmxRt84Zu3HkpYQX1PLDU72aQMK6Cif4muRxwt3RyZXY6y'
    ]
];

$tx_hash = $wallet->transferSplit($options);

$tx_hashes = $wallet->sweepDust();

$payments = $wallet->getPayments($payment_id);

$payments = $wallet->getBulkPayments($payment_id, $height);

$transfers = $wallet->incomingTransfers($type);

$key = $wallet->queryKey($type);

$integratedAddress = $wallet->integratedAddress($payment_id);

$splitIntegrated = $wallet->splitIntegrated($integrated_address);

$wallet->stopWallet();