Metagraph Tokens
Connecting to a metagraph
const { dag4 } = require('@stardust-collective/dag4');
// Connect to Hypergraph on IntegrationNet or MainNet
dag4.account.connect({
networkVersion: '2.0',
beUrl: "https://be-integrationnet.constellationnetwork.io",
l0Url: "https://l0-lb-integrationnet.constellationnetwork.io",
l1Url: "https://l1-lb-integrationnet.constellationnetwork.io",
});
dag4.account.loginPrivateKey('MY-PRIVATE-KEY');
// Create a metagraphClient instance to connect to a specific metagraph
const metagraphClient = dag4.account.createMetagraphTokenClient({
beUrl: "https://be-integrationnet.constellationnetwork.io",
l0Url: ':metagraph-l0-endpoint',
l1Url: ':metagraph-currency-l1-endpoint',
metagraphId: ':metagraph-id'
});
// Make calls directly to the metagraph (check balance, send transactions, etc.)
await metagraphClient.getBalance();
// 100000Metagraph connection details
Send a single transaction
Generate bulk transactions offline and send
Last updated
Was this helpful?