{"id":22302977,"url":"https://github.com/xrplwin/xrpl-txmutationparser","last_synced_at":"2026-02-01T03:32:57.654Z","repository":{"id":65395713,"uuid":"561034115","full_name":"XRPLWin/XRPL-TxMutationParser","owner":"XRPLWin","description":"Parse XRPL transaction to context aware object. ","archived":false,"fork":false,"pushed_at":"2025-07-13T06:45:48.000Z","size":114,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-13T07:28:57.287Z","etag":null,"topics":["parser","php","php8","transaction","xrpl"],"latest_commit_sha":null,"homepage":"https://playground.xrpl.win/play/xrpl-transaction-mutation-parser","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/XRPLWin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-02T19:53:20.000Z","updated_at":"2025-07-13T06:44:16.000Z","dependencies_parsed_at":"2023-11-07T19:45:47.225Z","dependency_job_id":"14da5787-d1f9-4212-93f6-7bc7464baada","html_url":"https://github.com/XRPLWin/XRPL-TxMutationParser","commit_stats":{"total_commits":38,"total_committers":1,"mean_commits":38.0,"dds":0.0,"last_synced_commit":"8540d060bf5354ab2e5923f2f692533e4a19f322"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"purl":"pkg:github/XRPLWin/XRPL-TxMutationParser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XRPLWin%2FXRPL-TxMutationParser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XRPLWin%2FXRPL-TxMutationParser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XRPLWin%2FXRPL-TxMutationParser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XRPLWin%2FXRPL-TxMutationParser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/XRPLWin","download_url":"https://codeload.github.com/XRPLWin/XRPL-TxMutationParser/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XRPLWin%2FXRPL-TxMutationParser/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267623130,"owners_count":24117131,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["parser","php","php8","transaction","xrpl"],"created_at":"2024-12-03T18:42:18.786Z","updated_at":"2026-02-01T03:32:57.623Z","avatar_url":"https://github.com/XRPLWin.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CI workflow](https://github.com/XRPLWin/XRPL-TxMutationParser/actions/workflows/main.yml/badge.svg)](https://github.com/XRPLWin/XRPL-TxMutationParser/actions/workflows/main.yml)\n[![GitHub license](https://img.shields.io/github/license/XRPLWin/XRPL-TxMutationParser)](https://github.com/XRPLWin/XRPL-TxMutationParser/blob/main/LICENSE)\n[![Total Downloads](https://img.shields.io/packagist/dt/xrplwin/xrpl-txmutationparser.svg?style=flat)](https://packagist.org/packages/xrplwin/xrpl-txmutationparser)\n\n# XRPL Transaction Mutation Parser for PHP\n\n## Demo\n\nSee this in action on [XRPLWin Playground](https://playground.xrpl.win/play/xrpl-transaction-mutation-parser)\n\n## Description\n\nParse XRPL transaction to context aware object for visual representation. It takes a XRPL transaction (outcome, meta) and an XRPL account. The XRPL account is the context from which the XPRL transaction is to be interpreted.\n\nThe account can be the sender, recipient, or an intermediate account. An intermediate account applies if e.g. there's a trade happening, touching your own offer asynchronously. You put up an offer and at some point down the road it gets (possibly partially) consumed. Alternatively, you can be an Intermediate account if you are a regular key signer or if something is rippling through your account.\n\nThe lib. then parses everything, performs all logic (include fee or not, etc.) and returns an object that is ready for use in e.g. an event list, or transaction details view, with all relevant objects parsed \u0026 calculated.\n\nThis is PHP port of https://github.com/XRPL-Labs/TxMutationParser by [@XRPL Labs](https://github.com/XRPL-Labs)\n\n### Note\n\nThis package is provided as is, please test it yourself first.  \nFound a bug? [Report issue here](https://github.com/XRPLWin/XRPL-TxMutationParser/issues/new)\n\n## Requirements\n- PHP 8.1 or higher\n- [Composer](https://getcomposer.org/)\n\n## Installation\nTo install run\n\n```\ncomposer require xrplwin/xrpl-txmutationparser\n```\n\n## Usage\n```PHP\nuse XRPLWin\\XRPLTxMutatationParser\\TxMutationParser;\n\n$referenceAccount = \"rA...\";\n$tx = (object)[ // Full XRPL transaction, containing Account, Destination, meta, ...)\n    \"Account\": \"rA...\",\n    \"Amount\": \"100300000\",\n    \"Destination\": \"rD....\",\n    \"Fee\": \"10000\",\n    ...\n    \"meta\" =\u003e [ ... ],\n    ...\n];\n\n//Enable to include trading fees calculation in allBalanceChanges results\n$calculateTradingFees = false;\n\n$TxMutationParser = new TxMutationParser($referenceAccount, $tx, $calculateTradingFees);\n$parsedTransaction = $TxMutationParserRef-\u003eresult();\n\nprint_r($parsedTransaction); \n```\n\nA sample response (as JSON):\n\n```javascript\n{\n  self: {\n    feePayer: true,\n    account: 'rA...',\n    balanceChangesExclFee: [ [Object], [Object], ... ],\n    balanceChanges: [ [Object], [Object], ... ],\n    tradingFees: [ [Object], ... ] //Optional\n  },\n  type: 'TRADE',\n  eventList: {\n    primary: { ... },\n    secondary: { ... },\n  },\n  eventFlow: {\n    start: {\n      account: 'rB...',\n      mutation: [Object]\n    },\n    intermediate: {\n      account: 'rA...',\n      mutations: {'in' =\u003e ?Object, 'out' =\u003e ?Object}\n    },\n    end: {\n      account: 'rC...',\n      mutation: [Object]\n    }\n  },\n  allBalanceChanges: {\n    rB: [ [Object], [Object], ... ],\n    rA: [ [Object], [Object], ... ],\n    rC: [ [Object], ... ]\n  }\n}\n```\n\n## Scenario's (data contents)\n\n#### Event List (`eventList`, e.g. a list with transactions belonging to the context account)\n\nIf no balance changes to your context account applied: empty. If only one relevant change (e.g. payment in / out): only the `eventList.primary` object exists. If a trade happened and your account both sent and received / exchanged something, the `eventList.primary` object is the main balance change. For reference, the `eventList.secondary` value can be displayed as well.\n\n`eventList.secondary.counterparty` can be array of counterparties if viewing account is issuer and multi balances of currency is adjusted (rippled) trough multiple parties ([see sample here](https://playground.xrpl.win/play/xrpl-transaction-mutation-parser?hash=A357FD7C8F0BBE7120E62FD603ACBE98819BC623D5D12BD81AC68564393A7792\u0026ref=rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq)) where `eventList.secondary.value` is SUM of balance changes of that currency - this behaviour is different from XRPL Labs package.\n\nA common scenario where the `eventList` is completely empty, is if your context account is eg. the account an issued currency\nrippled through, or the context account is the regular key, signing the transaction parsed.\n\n#### Event Flow (`eventFlow`, e.g. transaction details page viewed by the context account)\n\nThe `eventFlow` object can contain a `eventFlow.start`, `eventFlow.intermediate` and `eventFlow.end` object. The `start` and `end` object can contain a `mutation` (one, so e.g. `eventFlow.start.mutation`).\n\nThe `eventFlow.intermediate` object can contain multiple `mutations`, an `in` and `out` (or only `in`, or (more commonly) only `out`) mutation: `eventFlow.intermediate.mutations.in` / `eventFlow.intermediate.mutations.out`.\n\nThe `eventFlow` object can contain **only** a `intermediate` object (so no `start` and `end` object) if:\n\n- The transaction is of the mutation type `SET` (e.g. Regular Key set, AccountSet, putting up an XRPL offer, etc.)\n- The context account is the issuer of a transaction, and the transaction is rippling through\n- The context account is the signer using a regular key, and no balance changes apply to the context account\n\n##### Display logic:\n\nAlways show then in this order (if present)\n\n- start\n- intermediate\n- end\n\n... And only (but always) show them if they are present.\n\n\n#### Balance changes (`allBalanceChanges`)\nAll Balance Changes returns balance changes for every participant. If `calculateTradingFees` enabled, balance changes also include trading fee calculations. \n\n## Running tests\nRun all tests in \"tests\" directory.\n```\ncomposer test\n```\nor\n```\n./vendor/bin/phpunit --testdox\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxrplwin%2Fxrpl-txmutationparser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxrplwin%2Fxrpl-txmutationparser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxrplwin%2Fxrpl-txmutationparser/lists"}