PHP code example of psychicat / monero-php

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

    

psychicat / monero-php example snippets



use Monero\Wallet;

$wallet = new Monero\Wallet();

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

$balance = $wallet->getBalance();

$address = $wallet->getAddress();

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

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

$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();