diff --git a/setup.md b/setup.md new file mode 100644 index 0000000..3e6b32a --- /dev/null +++ b/setup.md @@ -0,0 +1,66 @@ +# Setup Guide: Chimoney Interledger Wallet Payout Integration + +## Step 1: Create Chimoney Account & Get API Key +- Sign up at [chimoney.io/developers](https://chimoney.io/developers) +- Go to Dashboard → API Keys +- Copy your sandbox or production `x-api-key` + +## Step 2: Setup Development Environment +```bash +mkdir chimoney-interledger-payout +cd chimoney-interledger-payout +npm init -y +npm install axios dotenv +``` + +## Step 3: Store API Key Securely +Create a `.env` file: +``` +CHIMONEY_API_KEY=your_api_key_here +``` + +Use it in your code: +```javascript +require('dotenv').config(); +const apiKey = process.env.CHIMONEY_API_KEY; +``` + +## Step 4: Get Interledger Wallet +- Sign up at [rafiki.money](https://rafiki.money) +- Use an address like `username.rfi.ilp.network` + +## Step 5: Make Your First Test Call +```javascript +const axios = require('axios'); +require('dotenv').config(); + +const apiKey = process.env.CHIMONEY_API_KEY; + +async function sendInterledgerPayout() { + const url = 'https://api.chimoney.io/v0.2/payouts/interledger'; + const data = { + walletAddress: 'example.rfi.ilp.network', + amount: 10, + currency: 'USD', + reason: 'Test payout from setup guide' + }; + const headers = { + 'Content-Type': 'application/json', + 'x-api-key': apiKey, + }; + + try { + const response = await axios.post(url, data, { headers }); + if (response.status === 200 && response.data.success) { + console.log('✅ Setup Successful!'); + console.log('Reference:', response.data.reference); + } else { + console.error('❌ Setup failed:', response.data.message); + } + } catch (error) { + console.error('🚨 Error:', error.response?.data || error.message); + } +} + +sendInterledgerPayout(); +``` \ No newline at end of file diff --git a/tutorial.md b/tutorial.md new file mode 100644 index 0000000..396d3b6 --- /dev/null +++ b/tutorial.md @@ -0,0 +1,61 @@ +# Tutorial Guide: Integrate Payout to Interledger Wallet API + +## Pre-requisites +- Node.js and npm installed +- Chimoney Developer Account +- Chimoney API Key +- Interledger-compatible wallet (e.g. Rafiki) +- Basic JavaScript knowledge + +## Step 1: Install Axios +```bash +npm install axios +``` + +## Step 2: Create the Function +```javascript +const axios = require('axios'); +const apiKey = 'YOUR_CHIMONEY_API_KEY'; + +async function sendInterledgerPayout(walletAddress, amount, currency, reason) { + const url = 'https://api.chimoney.io/v0.2/payouts/interledger'; + const headers = { + 'Content-Type': 'application/json', + 'x-api-key': apiKey, + }; + const data = { walletAddress, amount, currency, reason }; + + try { + const response = await axios.post(url, data, { headers }); + if (response.status === 200 && response.data.success) { + console.log('✅ Payout Successful!'); + console.log('Transaction Reference:', response.data.reference); + } else { + console.error('❌ Error:', response.data.message || response.data.error); + } + } catch (error) { + console.error('🚨 Network Error:', error.response?.data || error.message); + } +} +``` + +## Step 3: Example Usage +```javascript +sendInterledgerPayout( + 'kenny.rfi.ilp.network', + 25, + 'USD', + 'DAO Translation Bounty' +); +``` + +## Sample Response +```json +{ + "success": true, + "message": "Payout sent successfully", + "reference": "CHM-kjs728s9hds", + "amount": 25, + "currency": "USD" +} +``` \ No newline at end of file diff --git a/use-case.md b/use-case.md new file mode 100644 index 0000000..30b8ba8 --- /dev/null +++ b/use-case.md @@ -0,0 +1,24 @@ +# Use Case: Seamless Global Payouts with Interledger + +## Introduction +As the global economy becomes increasingly digital, the need for borderless financial transactions has never been greater. From Web3 DAOs to remote-first startups, organizations are tapping into international communities for talent, creativity, and innovation. + +But here’s the catch: many contributors around the world don’t have access to traditional banking systems. High remittance fees, delayed payments, and limited access to global platforms remain key barriers. + +**Chimoney’s `Payout to Interledger Wallet Address` endpoint solves this problem** by enabling businesses to send payments directly to Interledger-compatible wallets. This ensures fast, inclusive, and low-fee global payouts—all with a simple API call. + +## Real-World Scenario: Paying Remote Hackathon Winners + +Let’s say you’re hosting a global hackathon with winners in Kenya, Brazil, and the Philippines. Rather than worry about currency conversion or bank delays, you choose to pay all winners via Interledger wallets. + +**Without Chimoney:** +- Manual processes +- Expensive third-party remittance tools +- Long wait times +- Limited visibility and compliance headaches + +**With Chimoney:** +- Automated payouts via API +- Recipients use Interledger wallets (e.g. `user.rfi.ilp.network`) +- Instant, direct payments +- Built-in tracking, transparency, and tax handling \ No newline at end of file