Metagraph Tokens
Metagraph tokens work in much the same way as DAG. They share a common transaction format and API interface. Both DAG and metagraph tokens use DAG addresses for their balance maps so a single public/private keypair can control DAG and metagraph token accounts.
Minimum Version
You will need version 2.1.1 or higher in order to interact with metagraph token networks.
Connecting to a metagraph
In order to interact with a metagraph token you will need to first need to create a connection to the Hypergraph, then create a metagraph client instance to connect to the metagraph and send transactions.
The example below connects to IntegrationNet. Fill in :metagraph-l0-endpoint
, :metagraph-currency-l1-endpoint
, and :metagraph-id
in the code below with the correct details for the metagraph you are connecting to.
Metagraph connection details
A list of existing metagraphs can be found on the DAG Explorer. On each metagraph's page you'll find the Metagraph ID, as well as L0 and currency L1 endpoints, which are necessary for configuring your metagraph client to connect to a specific metagraph network.
Send a single transaction
The metagraph client has all the same methods as dag4.account
except transferDag
becomes transfer
and transferDagBatch
becomes transferBatch
.
Generate bulk transactions offline and send
Transaction Fees
Note that transaction fees on metagraph networks are paid in the network's metagraph token, not in DAG.
Last updated
Was this helpful?