1.0.0 • Published 1 year ago
walletcore.io v1.0.0
walletcore.io
A Node.js Module wrapper for the WalletCore,io API, allowing you to interact with cryptocurrency wallets and transactions.
Installation
npm install walletcore.io
Usage
const WalletCoreAPI = require('walletcore.io');
const api = new WalletCoreAPI();
// Setup with your API keys
api.setup('your_private_key', 'your_public_key');
// Example: Get a callback address
api.getCallbackAddress('BTC')
.then(result => console.log(result))
.catch(error => console.error(error));
// Example: Create a withdrawal
api.createWithdrawal(0.001, 'BTC', 'btc_address_here')
.then(result => console.log(result))
.catch(error => console.error(error));
// Example: Get transaction history
api.getHistory()
.then(result => console.log(result))
.catch(error => console.error(error));
API Reference
setup(privateKey, publicKey)
Set up the API with your private and public keys.
getCallbackAddress(currency, ipnUrl = '')
Get a callback address for receiving payments.
- currency: The cryptocurrency to create a receiving address for.
- ipnUrl: (Optional) IPN handler URL for transaction notices.
createWithdrawal(amount, currency, address, ipnUrl = '')
Create a withdrawal from your account to a specified address.
- amount: The amount of the transaction (floating point to 8 decimals).
- currency: The cryptocurrency to withdraw.
- address: The address to send the coins to.
- ipnUrl: (Optional) IPN handler URL for transaction notices.
getHistory(currency = 'ALL')
Get transaction history for your account.
- currency: (Optional) The cryptocurrency to get history for. Defaults to 'ALL'.
Testing
To run the tests, update the test.js file with your API keys and run:
node test.js
1.0.0
1 year ago