TelePay client library for the Dart language, so you can easely process cryptocurrency payments using the REST API.
Package | Pub |
---|---|
telepay | |
telepay_dio | |
telepay_http | |
telepay_hooks | (Coming soon) |
- WebHooks (Coming soon)
- All Metods
Add to dependencies on pubspec.yaml
:
dependencies:
telepay_dio: <version>
The first thing is to create an instance of TelePayDio
for later use, which receives two parameters, your secret API key and an instance of Dio.
final telepay = TelePayDio(secretApiKey: 'your_secret_api_key', dio: Dio());
π¨ WARNING π¨
Your secretApiKey
is confidential and meant to be used by you. Anyone who has your project key can access your merchant. Please, do not share it or commit it in your code.
Get the current merchant info.
final me = await telepay.getMe();
Get all the assets suported by TelePay.
final assets = await telepay.getAssets();
Get the balance of the all your wallets.
final balance = await telepay.getBalance();
Get all the invoices the your merchant.
final invoices = await telepay.getInvoices();
Creates an invoice, associated to your merchant.
final invoiceCreate = await telepay.createInvoice(
const CreateInvoice(
asset: 'TON',
blockchain: 'TON',
network: 'testnet',
amount: 3.5,
),
);
Get a specific invoice etails, by invoice number.
final invoice = await telepay.getInvoice('YYXZT1U7Q2P8');
Cancel invoice, by its number.
final invoiceCancel = await telepay.cancelInvoice('FNGUA7LR6B');
Delete invoice, by its number.
final isDelete = await telepay.deleteInvoice('FNGUA7LR6BYYY');
Create a tranferent between internal wallets, thsi is a off-chain operation
final transfer = await telepay.transfer(
const CreateTransfer(
asset: 'TON',
blockchain: 'TON',
network: 'testnet',
amount: 3.5,
username: 'yeikel16',
),
);
Get minimum fee for a specific asset for withdraw.
final withdrawMin =
await telepay.getWithdrawMinimum('TON', 'TON', 'testnet');
Get estimated withdraw fee, composed of blockchain fee and processing fee.
final withdrawFee = await telepay.getWithdrawFee(
const CreateWithdraw(
asset: 'TON',
blockchain: 'TON',
network: 'testnet',
amount: 5.2,
toAddress: 'EQAwEl_ExMqFJIjfitPRPTdV_B9KTgHG-YognX6iKRWHdpX1',
),
);
Withdraw funds to a specific address
final withdraw = await telepay.withdraw(
const CreateWithdraw(
asset: 'TON',
blockchain: 'TON',
network: 'testnet',
amount: 5.2,
toAddress: 'EQAwEl_ExMqFJIjfitPRPTdV_B9KTgHG-YognX6iKRWHdpX1',
),
);
To run all unit tests use the following command:
dart test --coverage="/coveraga" --test-randomize-ordering-seed random
To view the generated coverage report you can use coverde.
# Filter the tested files.
coverde filter -f \.g\.dart
# Generate Coverage Report and open in browser.
coverde report -l
If you want to report a problem or would like to add a new feature, feel free to open an issue on GitHub. Pull requests are also welcome.
The library is made by (emoji key):
Yeikel Uriarte Arteaga π» |
Luis Antonio Correa Leyva π» |
Carlos Lugones π§βπ« |
This project follows the all-contributors specification. Contributions of any kind welcome!