![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
surbtc-rest-client
Advanced tools
A Node.js client library for interacting with surbtc REST API.
This nodejs module connects to surbtc api in order to get quotes and execute orders.
npm install surbtc-rest-client
var surBtcRestClient = require("surbtc-rest-client");
var client = new surBtcRestClient({
api: 'http://surbtc.com/api/v1',
secret: 'apiKey',
params: {}
});
client.getMarkets(function(err, res){
})
Response:
{
success: true,
markets: [
{ name: , base_currency: , quote_currency: }
],
statusCode: 200
}
marketId: string - required
type: string - required
marketOrder: boolean - optional
client.getExchangeFee(marketId, type, marketOrder, function(err, res){
})
Response:
{
success: true,
fee_percentage: { value: },
statusCode: 200
}
client.generateUUID(function(err, res){
})
marketId: string - required
client.getOrderBook(marketId, function (err, res){
})
Response:
{
success: true,
order_book: {
asks: [amount, limit],
bids: [amount, limit]
}
}
Returns the number of fiat equivalent to amount
BTC on the marketId
market.
type=ask => fiat that I would get for amount
BTC
type=bid => fiat I have to pay to get amount
BTC
marketId: string - required
type: string - required
amount: Number - required
client.getQuotation(marketId, type, amount, function(err, res){
})
Response:
{
success: true,
quotation: {
type: type,
reverse: false,
amount: amount,
order_amount: [ amount, currency ],
base_balance_change: [ amount, currency ],
quote_balance_change: [ -amount, currency ],
fee: [ fee, currency ],
incomplete: false
},
statusCode: 200
}
Returns the number of BTC equivalent to amount
of fiat on the marketId
market.
type=ask => BTC I would get for amount
fiat
type=bid => BTC I have to pay to get amount
fiat
marketId: string - required
type: string - required
amount: Number - required
client.getReverseQuotation(marketId, type, amount, function(err, res){
})
Response:
{
success: true,
quotation: {
type: type,
reverse: true,
amount: amount,
order_amount: [ amount, currency ],
base_balance_change: [ amount, currency ],
quote_balance_change: [ -amount, currency ],
fee: [ fee, currency ],
incomplete: false
},
statusCode: 200
}
marketId: string - required
order: order: { type:, limit:, amount:, original_amount:, price_type: }
client.createOrder(marketId, order, function(err, res){
})
Response:
{
success: true,
order: {
id: ,
type: ,
state: ,
limit: ,
amount: ,
original_amount: ,
created_at: ,
market_id: ,
paid_fee: ,
total_exchanged: ,
fee_currency: ,
price_type: ,
weighted_quotation: ,
account_id:
}
}
client.getOrders(marketId, function(err, res){
})
Response:
{
success: true,
orders: [],
meta: {}
}
client.getOrdersByState(marketId, state, function(err, res){
})
Response:
{
success: true,
orders: [],
meta: {}
}
client.getOrderId(orderId, function(err, res){
})
Response:
{
success: true,
order: {
id:
type:
state:
limit:
amount:
original_amount:
created_at:
market_id:
paid_fee:
total_exchanged:
fee_currency:
price_type:
weighted_quotation:
account_id:
}
}
client.cancelOrderId(orderId, function(err, res){
})
Response:
{
success: true,
order: {
id:
type:
state:
limit:
amount:
original_amount:
created_at:
market_id:
paid_fee:
total_exchanged:
fee_currency:
price_type:
weighted_quotation:
account_id:
}
}
client.createAndConfirmOrder(marketId, order, function(err, res){
})
Response:
{
success: true,
order: {
id:
type:
state:
limit:
amount:
original_amount:
created_at:
market_id:
paid_fee:
total_exchanged:
fee_currency:
price_type:
weighted_quotation:
account_id:
}
}
var opts = {
bank_name: 'Banco Santander',
bank_account_holder_name: 'jaime echegaray',
bank_account_holder_id: '157715003',
bank_account_type: 'Cuenta Corriente',
bank_account_number: 123456,
bank_currency: 'cop',
email: '',
phone: ''
}
client.registerBankAccount(opts, function(err, res){
})
Response:
{ success: true,
fiat_account:
{ id: 943,
account_number: '123456',
account_type: 'Cuenta Corriente',
bank_id: 56,
created_at: '2016-09-06T18:13:16.864Z',
currency: 'COP',
document_number: '157715003',
email: '',
full_name: 'jaime echegaray',
national_number_identifier: null,
phone: '',
updated_at: '2016-09-06T18:13:16.864Z',
bank_name: 'Banco Santander' },
statusCode: 200 }
amount in currency standard precision
var opts = {
amount: 1000,
currency: 'CLP',
}
client.registerDeposit(opts, function(err, res){
})
Response:
{ success: true,
deposit:
{ id: 2869,
state: 'pending_confirmation',
amount: 1000000,
currency: 'CLP',
created_at: '2016-10-05T19:02:49.696Z',
deposit_data:
{ type: 'FiatDepositData',
id: 1530,
created_at: '2016-10-05T19:02:49.673Z',
updated_at: '2016-10-05T19:02:49.673Z' }
},
statusCode: 200 }
amount in currency standard precision
var opts = {
amount: 1,
currency: 'BTC',
target_address: ''
}
client.requestWithdrawal(opts, function(err, res){
})
Response:
{ success: true,
withdrawal:
{ id: 2869,
state: 'pending_preparation',
amount: 100000000,
currency: 'BTC',
created_at: '2016-10-05T19:02:49.696Z',
require_manual_approval: false,
statusCode: 200 }
http://bluebirdjs.com/docs/api/promise.promisify.html http://bluebirdjs.com/docs/api/promise.promisifyall.html
Should cancel order if not traded after X seconds?
get pending withdrawals https://stg.surbtc.com/api/v1/withdrawals/current_unconfirmed?currency=COP
get bitcoin pending withdrawals https://stg.surbtc.com/api/v1/withdrawals/current_unconfirmed?currency=BTC
Los withdrawals se limpian cuando la transaccion tiene una confirmacion. ~6 minutos en testnet
get per currency account (retrieves last only) https://stg.surbtc.com/api/v1/fiat_accounts/CLP?api_key=a061fc555331d1285a89b012676d6e7c
FAQs
A Node.js client library for interacting with surbtc REST API.
The npm package surbtc-rest-client receives a total of 2 weekly downloads. As such, surbtc-rest-client popularity was classified as not popular.
We found that surbtc-rest-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.