Core Functions API
The core functions of the Gx402 SDK provide the essential x402 functionality for games, focusing on seamless payment processing and multi-chain integration.initialize()
Initialize the Gx402 SDK with configuration options. This sets up the necessary infrastructure for x402 payment processing and multi-chain support.JavaScript/WebGL
Configuration Options
apiKey(string, required): Your Gx402 API keyenvironment(string): ‘production’ or ‘development’ (default: ‘production’)enableRealtimeSync(boolean): Enable real-time synchronization (default: false)debug(boolean): Enable debug logging (default: false)
Unity (C#)
Unreal Engine (C++)
processX402Data()
Process game data with x402 functionality. This function leverages the built-in x402 facilitator infrastructure to handle micropayments and other x402 protocol interactions.JavaScript
Parameters
params(Object): Processing parametersdata(any): Game data to processoptions(Object, optional): Processing optionsfeature(string): Specific x402 feature to usesync(boolean): Whether to sync the resultencrypt(boolean): Whether to encrypt the data
Returns
Promise<any>: Processed data with x402 enhancements
Unity (C#)
Parameters
object gameData: Game data to process with x402
Returns
object: Processed data with x402 enhancements