Main API
Browser-compatible JavaScript API client for AzothPay Streaming payments, subscriptions, and revenue splits with no axios dependency.
📦 Installation
npm install @azothpay/api ethers🚀 Quick Start
import { AzothPayApiClient } from '@azothpay/api/browser';
import { ethers } from 'ethers';
// 1. Connect user wallet (MetaMask / WalletConnect)
const provider = new ethers.providers.Web3Provider(window.ethereum);
const signer = provider.getSigner();
// 2. Create AzothPay client
const client = new AzothPayApiClient(
'https://azothpay.com', // production endpoint
'bsc-usdc', // 'bsc-usdc' | 'bsc-usdt' | 'pol-usdc'| 'pol-usdt'
'your-api-key' // issued after KYB and onboarding
);
// 3. Create and send a subscription in one call
const receipt = await client.createSubscriptionAndSend(
{
author: '0x742d35Cc6634C0532925a3b8D4C9f2a93A9E3F1A', // creator or merchant address
subscriptionRate: '50000000000000000000', // 50 USDT (18 decimals)
projectId: 0
},
signer,
1 // number of confirmations
);⚙️ Client Initialization
Constructor Parameters
Param
Type
Required
Description
🔎 API Introspection
getAvailableContracts()
Method
Returns
Description
📰 Subscriptions
Method
Params
Returns
Description
💸 Payments & Funds
One-off payments
Method
Params
Returns
Description
Deposits & withdrawals
Method
Params
Returns
Descriptions
Balance & active streams
Method
Params
Returns
Descriptions
⚡ Advanced Operations
Method
Params
Description
✍️ Manual Signing & Sending
Signing helpers
Method
Description
🔧 Provider & HTTP Configuration
HTTP settings
🚨 Error Handling
ℹ️ Meta-transactions
Meta API📬 Support & Contacts
Last updated