Skip to main content

The Map object

A Map is an abstraction that represents of a group of Runes3 objects indexed by some key (think a JS object with the keys to the values being something special). They are used to represent the output of a query that returns many of an Object type. For example:

  • an Account can have many Rune balances, which will be indexed by the Rune's protocol id (block:tx)
  • an Account can have many Utxos, which are indexed by the utxo's id (txid:vout), etc.
  • A Transaction can have many Utxos, which are indexed by the utxo's id (txid:vout), etc.

Usage

Runes3 uses javascript Maps. You can view extensive documentation of Javascript's Map class here.

//Under the hood these are the types that represent the map
//Runes3 takes care of this for you
map = new Map<string, Object>();