Coins.ph API wrapper for Node.js
The Coins.ph API Reference is a good resource to learn more about these APIs.
# Using npm
npm install --save coins-ph
# Using yarn
yarn add coins-phconst Coins = require("coins-ph");
let client = new Coins({
key: process.env.COINS_PW_KEY
, secret: process.env.COINS_PW_SECRET
// This is optional
, host: process.env.COINS_HOST || "https://coins.ph/"
});
client.cryptoAccounts({}, (err, data) => {
console.log(err || data);
// =>
// [ { id: 'ff...c9',
// name: 'Default Account',
// currency: 'BTC',
// balance: '0.09000000',
// pending_balance: '0.00000000',
// total_received: '0.10168800',
// default_address: '34SuY....yp6m' },
// { id: '787...283',
// name: 'Default Account',
// currency: 'CLP',
// balance: '0.00000000',
// pending_balance: '0.00000000',
// total_received: '0.00000000',
// default_address: 'bf...129' } ]
});
client.payinOutlets({ region: "PH" }, (err, data) => {
console.log(err || data);
// =>
// [ { id: '..._deposit',
// outlet_category: 'atm_deposit',
// payment_outlet_type: {...},
// amount_limits: [ [Object] ],
// denominations: [],
// name: '...',
// region: '...',
// verification_level_requirement: 0,
// help_text: '...',
// help_link: 'https://coinsph.zendesk.com/hc/en-us/articles/202637070',
// instructions: '...',
// payout_duration: null,
// is_express: false }, ... ]
});There are few ways to get help:
- Please post questions on Stack Overflow. You can open issues with questions, as long you add a link to your Stack Overflow question.
- For bug reports and feature requests, open issues. ๐
- For direct and quick help, you can use Codementor. ๐
Creates the instance of the Coins class.
- Object
options: An object containing: secret(String): The secret key (mandatory).key(String): The API key (mandatory)host(String): Thecoins.phhost (default:https://coins.ph/).
Create a new buyorder
- Object
data: The order data as documented here. - Function
cb: The callback function.
Mark a buy order as paid
- Object
data: The order data as documented here. - Function
cb: The callback function.
Retrieve an existing buyorder
- Object
data: The order data as documented here. - Function
cb: The callback function.
Create a new sellorder
- Object
data: The sell order data (documented here). - Function
cb: The callback function.
Validate field values
- Object
data: The post data (documented here). - Function
cb: The callback function.
Retrieve an existing sellorder
- Object
params: The sell order params (documented here). - Function
cb: The callback function.
Gets the transaction history (buyorders).
- Function
cb: The callback function.
Retrieve supported payin-outlets
- Object
params: The request params (documented here). - Function
cb: The callback function.
Retrieve current payin-outlet-fees
- Object
params: The request params (documented here). - Function
cb: The callback function.
Retrieve supported payin-outlet-categories
- Object
params: The request params (documented here). - Function
cb: The callback function.
Retrieve supported payout-outlets
- Object
params: The request params (documented here). - Function
cb: The callback function.
payoutOutletCategories Retrieve supported payout-outlet-categories
- Object
params: The request params (documented here). - Function
cb: The callback function.
payoutOutletFees Retrieve current payout-outlet-fees
- Object
params: The request params (documented here). - Function
cb: The callback function.
Create a new payment request
- Object
data: The request data (documented here). - Function
cb: The callback function.
Retrieve an existing or a list of existing payment requests
- Object
params: The request params (documented here). - Function
cb: The callback function.
Transfer funds between two accounts
- Object
data: The request data (documented here). - Function
cb: The callback function.
Get the list of transfers or a specific one.
- Object
params: The params object (documented here). - Function
cb: The callback function.
Retrieve existing crypto-accounts
- Object
params: The params object (documented here). - Function
cb: The callback function.
Convert funds between a user's accounts
- Object
data: The data object (documented here). - Function
cb: The callback function.
Retrieve current crypto-exchanges
- Object
params: The request params (documented here). - Function
cb: The callback function.
Retrieve existing crypto-routes
- Function
cb: The callback function.
Get the crypto payments or a specific one.
- Object
params: The request params (documented here). - Function
cb: The callback function.
Create a new user
- Object
data: The request data (documented here). - Function
cb: The callback function.
This is called internally.
- Number The
noncevalue.
Signs a request.
- String
url: The request url. - Object
body: The request data.
- Object An object containing:
signature(String): The HMAC signature.nonce(String): The stringified nonce value.
Low level function for making requests to the API endpoints.
- Object
options: An object containing the following fields: url(String): The api endpoint.method(String): The request method (default:get).params(Object): The params object.data(Object): The POST data object.responseField(String): The response field to take.version(String): The version endpoint (default:d/api). It could beapi/v2orapi/v3too, depending on the endpoint.- Function
cb: The callback function.
Have an idea? Found a bug? See how to contribute.
I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously, this takes time. You can integrate and use these projects in your applications for free! You can even change the source code and redistribute (even resell it).
However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:
-
Starring and sharing the projects you like ๐
-
โI love books! I will remember you after years if you buy me one. ๐ ๐
-
โYou can make one-time donations via PayPal. I'll probably buy a
coffeetea. ๐ต -
โSet up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone).
-
BitcoinโYou can send me bitcoins at this address (or scanning the code below):
1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6
Thanks! โค๏ธ

