Getting Started / Bắt đầu
English
Welcome to OlymPay
Prerequisites
Quick Setup
1. Install Dependencies
npm install @olympay/sdk
# or
yarn add @olympay/sdknpm install @olympay/sdk
# or
yarn add @olympay/sdkimport { OlymPaySDK } from '@olympay/sdk';
const olymPay = new OlymPaySDK({
network: 'mainnet', // or 'testnet'
apiKey: 'your-api-key'
});// Connect user's wallet
const wallet = await olymPay.connectWallet();
// Get wallet address
const address = wallet.getAddress();// Create a payment
const payment = await olymPay.createPayment({
amount: '100.00',
currency: 'USD',
recipient: '0x...',
description: 'Payment for services'
});
// Execute the payment
const result = await payment.execute();npm install @olympay/sdk
# hoặc
yarn add @olympay/sdkimport { OlymPaySDK } from '@olympay/sdk';
const olymPay = new OlymPaySDK({
network: 'mainnet', // hoặc 'testnet'
apiKey: 'your-api-key'
});// Kết nối ví của người dùng
const wallet = await olymPay.connectWallet();
// Lấy địa chỉ ví
const address = wallet.getAddress();// Tạo thanh toán
const payment = await olymPay.createPayment({
amount: '100.00',
currency: 'USD',
recipient: '0x...',
description: 'Thanh toán cho dịch vụ'
});
// Thực hiện thanh toán
const result = await payment.execute();