🌐
Typescript / Javascript SDK
  • 👋Phantasma - TS
  • 🎆Quick Start
  • Setup
    • 🛠️Setup
  • Shared Methods
    • ☁️PhantasmaAPI
    • 🔗PhantasmaLink
    • 📝ScriptBuilder
      • Create a Script
  • Backend
    • ⚙️Backend
    • 📄Examples
      • Creating a new Address
      • Importing a Wallet
      • Create Script Call
      • Create a Transaction
      • Sign a Transaction
      • Send a Transaction
      • Get a Transaction
      • Invoke a Script
      • Get User Balances
      • Transfer Tokens
      • Decode Transfer Events
      • Get a Block by Height
      • Get data from new Blocks
  • Frontend
    • 🖥️Frontend
    • 📄Examples
      • Connect to the wallet
      • Invoking a Script
      • Sending a transaction
  • Resources
    • 👻Getting Started
    • 👻About Phantasma
    • 🧑‍🤝‍🧑For new Soldiers
    • 👨‍💻For Developers
Powered by GitBook
On this page
  • Testnet Configurations
  • Mainnet Configurations
  1. Shared Methods

PhantasmaAPI

PreviousSetupNextPhantasmaLink

Last updated 1 year ago

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

  • RPC URL -> It can used anyone of this

    • https://pharpc1.phantasma.io/rpc

    • https://pharpc2.phantasma.io/rpc

    • https://pharpc3.phantasma.io/rpc

    • https://pharpc4.phantasma.io/rpc

  • Peers URL ->

  • Nexus Name -> mainnet

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');
☁️
https://getpeers.phantasma.io/mainnet-getpeers.json