Go SDK
High-performance, zero-dependency SDK designed for backend services and microservice architectures.
Smart Routing
The Go SDK features a unified Client that automatically routes requests based on the authentication options provided during initialization (WithBearerAuth).
- Authenticated Mode: Targets
/v2endpoints for Agent-led execution. - Public Mode: Targets
/apiendpoints for public intent creation.
Multi-Chain Support
All payments settle on Base, while the payer can pay from multiple source chains via payer_chain.
Use chain constants from the SDK instead of hardcoded strings:
resp, err := client.CreateIntent(ctx, &pay.CreateIntentRequest{
Email: "merchant@example.com",
Amount: "100.50",
PayerChain: pay.ChainBase, // use constants instead of bare strings
})
Intent Status Constants
Use status constants instead of raw strings when checking intent status:
intent, err := client.GetIntent(ctx, intentID)
switch intent.Status {
case pay.StatusBaseSettled:
// Payment complete
case pay.StatusExpired, pay.StatusVerificationFailed:
// Terminal failure
}