Expand description

A CLI tool for collecting and aggregating a VASPs current on-chain assets into an easily digestible json output.

Example usage:

$ cargo run -p diem-assets-proof -- collect \
    --json-server 'https://testnet.diem.com/v1' \
    --parent-vasp 'ed34ba9396da470da8de0945555549f8' \
    --child-vasps 'f236d4d977cbf08fe6e8e796bb6b41bd' \
    --child-vasps 'ad8c1f9be3b9de371567eda247c1f290' \
    --child-vasps '228d25d0c232c010be8bc1613f833ea0'

{
  "diem_chain_id": 2,
  "diem_ledger_version": 88497519,
  "diem_ledger_timestampusec": 1616457122815922,
  "accumulator_root_hash": "75e03d04f13f15450807ced2d8707fd90b3a95d71ce981396deacf6134f20b64",
  "all_child_vasps_valid": true,
  "total_unfrozen_balances": {
    "XUS": 100000000000
  },
  "currencies": {
    "XDX": {
      "scaling_factor": 1000000,
      "fractional_part": 1000,
      "to_xdx_exchange_rate": 1.0
    },
    "XUS": {
      "scaling_factor": 1000000,
      "fractional_part": 100,
      "to_xdx_exchange_rate": 1.0
    }
  },
  "parent_vasp": {
    "address": "ED34BA9396DA470DA8DE0945555549F8",
    "balances": {
      "XUS": 70000000000
    },
    "human_name": "No. 63291 VASP",
    "base_url": "http://localhost:54330",
    "num_children": 3
  },
  "child_vasps": {
    "228D25D0C232C010BE8BC1613F833EA0": {
      "result": {
        "balances": {
          "XUS": 10000000000
        }
      }
    },
    "AD8C1F9BE3B9DE371567EDA247C1F290": {
      "result": {
        "balances": {
          "XUS": 10000000000
        }
      }
    },
    "F236D4D977CBF08FE6E8E796BB6B41BD": {
      "result": {
        "balances": {
          "XUS": 10000000000
        }
      }
    }
  }
}

Structs

  • A receipt containing the aggregate balance of a VASP and all of its child VASP accounts, in addition to each individual account’s balance and on-chain metadata.
  • A set of balances by currency.
  • A simplified view of a single child VASP account. Currently we only display the balances for each account.
  • A simplified view of the parent VASP account, ignoring irrelevant info like the sent/receive event keys.
  • A simplified view of the current on-chain currency metadata.
  • Truncated view of the [MetadataView].

Enums

Traits

  • A small trait abstracting over the Diem json-rpc client so we can mock during testing.

Functions