Getting Started

This guide shows you how to connect to and interact with the ƒxyz Network infrastructure.

Authentication

All API requests require authentication using Privy JWT tokens:

# Endpoint
POST https://api.fxyz.network/graphql

# Headers
Authorization: Bearer <privy-jwt-token>
Content-Type: application/json

Get Access

Contact our team for API access and wallet setup assistance

Basic Network Query

Start by exploring the network graph structure:

query NetworkStatus {
  neo4jStatus {
    connected
    version
  }
  networkGraph(limit: 10) {
    nodes {
      id
      type
      labels
    }
    links {
      source
      target
      type
    }
    metadata {
      nodeCount
      linkCount
      lastUpdated
    }
  }
}

Investment Data

Query current network investment metrics:

query InvestmentData {
  investmentData {
    tokenName
    tokenSymbol
    currentRound
    roundRaised
    roundTarget
    investorCount
    currentPrice
    marketCap
  }
}

User Portfolio (Authenticated)

Access your personal portfolio data:

query MyPortfolio {
  getUserPortfolio {
    success
    data {
      user {
        privyDid
        email
        wallets
      }
      vouchers {
        id
        code
        amount
        status
        redeemed
      }
      balances {
        encryptedBalance
        elGamalPublicKey
        tokenAccount
      }
      summary {
        totalInvestments
        totalVouchers
        hasConfidentialBalance
      }
    }
  }
}

Voucher Operations

Claim a Voucher

mutation ClaimVoucher($code: String!, $wallet: String!) {
  claimVoucher(voucherCode: $code, walletAddress: $wallet) {
    success
    voucher {
      code
      amount
      status
    }
    message
  }
}

Redeem ƒ Tokens

mutation RedeemVoucher($wallet: String!, $elGamalKey: String!) {
  redeemVoucher(walletAddress: $wallet, elGamalPublicKey: $elGamalKey) {
    success
    redemption {
      amount
      txSignature
      walletAddress
    }
    message
  }
}

Real-Time Subscriptions

Subscribe to live network updates:

subscription NetworkUpdates {
  networkUpdated {
    nodes {
      id
      type
    }
    metadata {
      lastUpdated
    }
  }
}

Development Tools

SDK Integration Examples

React with URQL

import { Client, Provider, cacheExchange, fetchExchange } from 'urql';

const client = new Client({
  url: 'https://api.fxyz.network/graphql',
  exchanges: [cacheExchange, fetchExchange],
  fetchOptions: () => ({
    headers: {
      authorization: `Bearer ${privyToken}`,
    },
  }),
});

function App() {
  return (
    <Provider value={client}>
      <YourComponents />
    </Provider>
  );
}

Node.js with GraphQL Request

import { GraphQLClient } from 'graphql-request';

const client = new GraphQLClient('https://api.fxyz.network/graphql', {
  headers: {
    authorization: `Bearer ${process.env.PRIVY_TOKEN}`,
  },
});

const data = await client.request(`
  query {
    networkGraph(limit: 5) {
      metadata {
        nodeCount
        linkCount
      }
    }
  }
`);

Error Handling

Common response patterns:

// Success Response
{
  "data": {
    "getUserPortfolio": {
      "success": true,
      "data": { /* portfolio data */ }
    }
  }
}

// Error Response
{
  "data": {
    "getUserPortfolio": {
      "success": false,
      "error": "Authentication required"
    }
  }
}

// GraphQL Error
{
  "errors": [
    {
      "message": "Admin access required",
      "path": ["allVouchers"]
    }
  ]
}

Next Steps

  1. Authenticate: Set up Privy authentication in your application
  2. Explore: Use the GraphQL playground to test queries
  3. Build: Integrate the API into your application
  4. Monitor: Subscribe to real-time updates for live data

Need Help?

Join our Discord or email support for technical assistance

Getting Started

This guide shows you how to connect to and interact with the ƒxyz Network infrastructure.

Authentication

All API requests require authentication using Privy JWT tokens:

# Endpoint
POST https://api.fxyz.network/graphql

# Headers
Authorization: Bearer <privy-jwt-token>
Content-Type: application/json

Get Access

Contact our team for API access and wallet setup assistance

Basic Network Query

Start by exploring the network graph structure:

query NetworkStatus {
  neo4jStatus {
    connected
    version
  }
  networkGraph(limit: 10) {
    nodes {
      id
      type
      labels
    }
    links {
      source
      target
      type
    }
    metadata {
      nodeCount
      linkCount
      lastUpdated
    }
  }
}

Investment Data

Query current network investment metrics:

query InvestmentData {
  investmentData {
    tokenName
    tokenSymbol
    currentRound
    roundRaised
    roundTarget
    investorCount
    currentPrice
    marketCap
  }
}

User Portfolio (Authenticated)

Access your personal portfolio data:

query MyPortfolio {
  getUserPortfolio {
    success
    data {
      user {
        privyDid
        email
        wallets
      }
      vouchers {
        id
        code
        amount
        status
        redeemed
      }
      balances {
        encryptedBalance
        elGamalPublicKey
        tokenAccount
      }
      summary {
        totalInvestments
        totalVouchers
        hasConfidentialBalance
      }
    }
  }
}

Voucher Operations

Claim a Voucher

mutation ClaimVoucher($code: String!, $wallet: String!) {
  claimVoucher(voucherCode: $code, walletAddress: $wallet) {
    success
    voucher {
      code
      amount
      status
    }
    message
  }
}

Redeem ƒ Tokens

mutation RedeemVoucher($wallet: String!, $elGamalKey: String!) {
  redeemVoucher(walletAddress: $wallet, elGamalPublicKey: $elGamalKey) {
    success
    redemption {
      amount
      txSignature
      walletAddress
    }
    message
  }
}

Real-Time Subscriptions

Subscribe to live network updates:

subscription NetworkUpdates {
  networkUpdated {
    nodes {
      id
      type
    }
    metadata {
      lastUpdated
    }
  }
}

Development Tools

SDK Integration Examples

React with URQL

import { Client, Provider, cacheExchange, fetchExchange } from 'urql';

const client = new Client({
  url: 'https://api.fxyz.network/graphql',
  exchanges: [cacheExchange, fetchExchange],
  fetchOptions: () => ({
    headers: {
      authorization: `Bearer ${privyToken}`,
    },
  }),
});

function App() {
  return (
    <Provider value={client}>
      <YourComponents />
    </Provider>
  );
}

Node.js with GraphQL Request

import { GraphQLClient } from 'graphql-request';

const client = new GraphQLClient('https://api.fxyz.network/graphql', {
  headers: {
    authorization: `Bearer ${process.env.PRIVY_TOKEN}`,
  },
});

const data = await client.request(`
  query {
    networkGraph(limit: 5) {
      metadata {
        nodeCount
        linkCount
      }
    }
  }
`);

Error Handling

Common response patterns:

// Success Response
{
  "data": {
    "getUserPortfolio": {
      "success": true,
      "data": { /* portfolio data */ }
    }
  }
}

// Error Response
{
  "data": {
    "getUserPortfolio": {
      "success": false,
      "error": "Authentication required"
    }
  }
}

// GraphQL Error
{
  "errors": [
    {
      "message": "Admin access required",
      "path": ["allVouchers"]
    }
  ]
}

Next Steps

  1. Authenticate: Set up Privy authentication in your application
  2. Explore: Use the GraphQL playground to test queries
  3. Build: Integrate the API into your application
  4. Monitor: Subscribe to real-time updates for live data

Need Help?

Join our Discord or email support for technical assistance