PHP code example of xrplwin / xrpl-nfttxmutationparser
1. Go to this page and download the library: Download xrplwin/xrpl-nfttxmutationparser 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/ */
xrplwin / xrpl-nfttxmutationparser example snippets
use XRPLWin\XRPLNFTTxMutatationParser\NFTTxMutationParser;
$txResult = [
"Account" => "rBcd..."
"Fee" => "1000",
//...
];
$parser = new NFTTxMutationParser(
"rAbc...", //This is reference account
(object)$txResult //This is transaction result
);
$parsedTransaction = $parser->result();
print_r($parsedTransaction);
/*
┐
├ Output for $parsedTransaction:
├ Array (
├ [nft] => 00082710...
├ [nfts] => []
├ [context] => null
├ [ref] => Array
├ (
├ [account] => rAbc...
├ [nft] => 00082710...
├ [nfts] => []
├ [direction] => IN
├ [roles] => Array
├ (
├ [0] => OWNER
├ )
├ )
├ )
┴
*/