How to get values from nested json in php

I have this json file { "success": true, "data": { "total": "2", "returned": 2, "start": 0, "limit": 10, "transactions": [ { "id": "16393567", "type": "Credit", "currency": "BTC", "amount": "0.00019449", "when": "2021-09-03 10:27:48", "rental": "3411209", "rig": "205363", "status": "Pending", "pending_seconds": "716202" }, { "id": "16377905", "type": "Credit", "currency": "BTC", "amount": "0.00000203", "when": "2021-09-01 11:42:47", "rental": "3408621", … Read more

Decode a prepended VarInt from a byte stream of unknown size in javascript/Nodejs

I am writing a small utility library for me to request server status of a given minecraft host in js on node. I am using the Server List Ping Protocol as outlined here (https://wiki.vg/Server_List_Ping) and got it mostly working as expected, albeit having big trouble working with unsupported Data Types (VarInt) and had to scour the internet to find a way of converting js nums into VarInts in order to craft the necessary packet buffers: