The Server SDK is currently experimental and not ready for production use.
Getting Started with Phantom Server SDK
Please reach out to partnerships@phantom.com for access.Installation
Install the Server SDK using your preferred package manager:Prerequisites
Before using the SDK, you need:-
Phantom Organization Credentials
- Organization ID
- Organization Private Key (base58 encoded)
- App ID
- Node.js version 16 or higher
Security First
The private key for your organization is meant to be stored ONLY on your server in a secure environment.
- NEVER expose this key in client-side code
- NEVER commit it to version control
- Always use environment variables or secret management systems
Quick Start
1. Set up Environment Variables
Create a.env
file in your project root:
2. Initialize the SDK
Network Support
The SDK supports multiple blockchain networks through theNetworkId
enum:
Solana Networks
NetworkId.SOLANA_MAINNET
- Solana Mainnet-BetaNetworkId.SOLANA_DEVNET
- Solana DevnetNetworkId.SOLANA_TESTNET
- Solana Testnet
Ethereum Networks
NetworkId.ETHEREUM_MAINNET
- Ethereum MainnetNetworkId.ETHEREUM_GOERLI
- Goerli TestnetNetworkId.ETHEREUM_SEPOLIA
- Sepolia Testnet
Other EVM Networks
NetworkId.POLYGON_MAINNET
- Polygon MainnetNetworkId.POLYGON_MUMBAI
- Mumbai TestnetNetworkId.OPTIMISM_MAINNET
- Optimism MainnetNetworkId.ARBITRUM_ONE
- Arbitrum OneNetworkId.BASE_MAINNET
- Base Mainnet
Future Support
NetworkId.BITCOIN_MAINNET
- Bitcoin MainnetNetworkId.SUI_MAINNET
- Sui Mainnet
Usage Examples
Creating a Wallet
Signing and Sending Transactions
Solana - Native Web3.js Transaction Objects
Ethereum/EVM - Transaction Objects
Raw Formats - Hex Strings and Bytes
Signing Messages
Managing Wallets
Next Steps
- Create and manage wallets
- Sign and send transactions
- Sign messages for authentication
- Explore the complete API reference
Troubleshooting
Common Issues
-
“organizationId and appId are required”
- Ensure all required config parameters are provided
- Check for typos in parameter names
-
“Failed to create wallet”
- Verify your organization credentials are correct
- Check network connectivity to the API endpoint
- Ensure your organization has wallet creation permissions
-
Transaction signing fails
- Verify the wallet ID exists and belongs to your organization
- Check that the transaction is properly formatted
- Ensure you’re using the correct network ID
-
“Unsupported network ID”
- Use one of the predefined
NetworkId
enum values - Check that the network is supported for your operation
- Use one of the predefined
Getting Help
- Review the example applications
- Contact Phantom support for organization-specific issues