Getting Started
Start building with ƒxyz Network API and tools
Getting Started
This guide shows you how to connect to and interact with ƒxyz Network infrastructure.
Authentication
All API requests require authentication using Privy JWT tokens:
# Endpoint
POST https://api.fxyz.network/api/graphql
# Headers
Authorization: Bearer <privy-jwt-token>
Content-Type: application/jsonGet Access: Contact our team for API access and wallet setup assistance at [email protected]
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
GraphQL Playground
Interactive API explorer (requires authentication)
Schema Reference
Complete GraphQL schema documentation
SDK Integration Examples
React with URQL
import { Client, Provider, cacheExchange, fetchExchange } from 'urql';
const client = new Client({
url: 'https://api.fxyz.network/api/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/api/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
- Authenticate: Set up Privy authentication in your application
- Explore: Use the GraphQL playground to test queries
- Build: Integrate the API into your application
- Monitor: Subscribe to real-time updates for live data
Need Help? Join our Discord or email [email protected] for technical assistance