Getting Started
The Galliun Payment SDK provides a TypeScript interface to interact with the Galliun Payment Protocol smart contracts.
Installation
npm install @galliun/galliun-payment-sdk
# or
yarn add @galliun/galliun-payment-sdkInitialization
The main entry point is the PaymentClient class which provides access to all protocol features:
import { PaymentClient } from '@galliun/payment-sdk';
const client = new PaymentClient({
network: 'mainnet', // or 'testnet', 'devnet'
packageId: '0x...', // Protocol package ID
configId: '0x...', // Protocol config ID
adminCapId: '0x...', // Optional: Admin capability ID
sender: '0x...', // Optional: Default sender address
signTransaction: async (tx) => {
// Your transaction signing logic
return signedTx;
},
});you can find the contract addresses in the PAYMENT_IDS
Required Parameters
network: The Sui network to connect to ('mainnet' or 'testnet')packageId: The protocol package IDconfigId: The protocol configuration object IDsignTransaction: Function to sign transactions
Optional Parameters
adminCapId: Admin capability ID (only needed for admin operations)sender: Default sender addresssuiClient: Custom Sui client instance
Available Managers
The client provides specialized managers for different protocol features:
Each manager provides specific methods for its domain. See the respective documentation sections for details:
Error Handling
The SDK throws typed errors for various failure cases. Always wrap SDK calls in try-catch blocks:
Next Steps
Learn about Bill Management
Explore Payment Requests
Set up Product Management
Read the API Reference
Last updated