☁️PhantasmaAPI

Here's how to setup a simple connection to the Phantasma Blockchain API

The first thing to do is to create an instance of the PhantasmaAPI.

  • It will receive as parameters, the RPC URL, the Peers URL or undefined, and the Nexus Name

Testnet Configurations

  • RPC URL -> https://testnet.phantasma.io/rpc

  • Peers URL -> undefined

  • Nexus Name -> testnet

It should look like this

import { PhantasmaAPI } from 'phantasma-ts';
let phantasmaAPI = new PhantasmaAPI('https://testnet.phantasma.io/rpc', undefined, 'testnet');

Mainnet Configurations

It should look like this

import { PhantasmaAPI } from 'phantasma-ts';
let phantasmaAPI = new PhantasmaAPI('https://pharpc1.phantasma.io/rpc', 'https://getpeers.phantasma.io/mainnet-getpeers.json', 'testnet');

Last updated