bancor-api-node
NodeJS client for the Bancor API.
Table of Contents
Installation
npm install bancor-api-node
API
tickerBySymbol
This function returns a ticker showing price (low, high, current), supply, and volume of specified currency.
Parameters
currencyId
String Input desired currency.fromCurrencyId
String The price of first currency is displayed in this currency.callback
callback Callback function.
Examples
bancor name: 'OmiseGo' symbol: 'OMG' code: 'OMG' decimals: 18 price24hHigh: 0 price24hLow: 0 price: 005595976535725013 price24h: 0044364364108873615 totalSupply: '140245398245132780789239631' volume24h: '119202620641242380323' }
Returns object JSON object.
ticker
This function returns a ticker showing price (low, high, current), supply, and volume of specified currency.
Parameters
currencyId
String Input desired currency id.fromCurrencyId
String The price of first currency is displayed in this currency.callback
callback Callback function.
Examples
bancor name: 'OmiseGo' symbol: 'OMG' code: 'OMG' decimals: 18 price24hHigh: 0 price24hLow: 0 price: 005595976535725013 price24h: 0044364364108873615 totalSupply: '140245398245132780789239631' volume24h: '119202620641242380323' }
Returns object JSON object.
rate
This function returns a the current price of the specified currency.
Parameters
fromCurrencyCode
toCurrencyCode
callback
callback Callback function.currencyId
String Input desired currency.fromCurrencyId
String The price of first currency is displayed in this currency.
Examples
bancor "data":"USD":103387
Returns object JSON object.
tokens
This function returns a list of tokens on Bancor.
Parameters
limit
number Maximum number of tokens to list.skip
number Skip this number of tokens.fromCurrencyCode
String Currency to display prices in.includeTotal
boolean Include total.includePrice24H
boolean Include 24 hour price.includePrice
boolean Include price.includePriceHistory
boolean Include price history.callback
callback Callback function.
Examples
bancordata: currencies: page: Object price: '5a1327c9c92a1700011c7baf': 0030692632427397986'5a03590f08849f0001097d29': 013846103543655108'5a3cb6868fb75500011ab51d': 023149159025255506'5a174c5145a97200011ad30a': 0021382577804332024'5a1d8d7b634e00000187855b': 0000043367446001951'59d27d45acb3c12634d19efb': 006530552814813005'5a048e3078658d0001ffdab8': 007528024881828617'59d745ff90509add31e9db14': 17961486298296112'5a1af60e9f604e00011f09eb': 0015107538325629414'5a2cfacad0129700019a7270': 000890152494283532'594bb7e468a95e00203b048d': 03726407497709882'5a086f93875e890001605abc': 1'5a3800604b02a6ad9f85324f': 0007558379155117594'5a37e92fed8a500001de70da': 003601647227852549 price24h: '5a086f93875e890001605abc': 1'594bb7e468a95e00203b048d': 037856454757867614'59d27d45acb3c12634d19efb': 0059521291958231165'5a3cb6868fb75500011ab51d': 0'5a174c5145a97200011ad30a': 0022126351058902722'5a048e3078658d0001ffdab8': 006775040652793572'5a1d8d7b634e00000187855b': 000005011696895057975'5a37e92fed8a500001de70da': 003556953896192395'5a3800604b02a6ad9f85324f': 0009187771984328866'5a03590f08849f0001097d29': 01434845498812609'5a1af60e9f604e00011f09eb': 0016895927407386328'5a2cfacad0129700019a7270': 000920144823242839'59d745ff90509add31e9db14': 22540613848221113'5a1327c9c92a1700011c7baf': 002289891182252949 priceHistory7d: {} }
Returns object JSON object.
relays
This function returns a list of relays on Bancor.
Parameters
limit
number Maximum number of tokens to list.skip
number Skip this number of tokens.fromCurrencyCode
String Currency to display prices in.includeTotal
boolean Include total.includePrice24H
boolean Include 24 hour price.includePrice
boolean Include price.includePriceHistory
boolean Include price history.callback
callback Callback function.
Examples
bancordata: currencies: page: Object price: '594bb7e468a95e00203b048d': 03726407497709882'5a1af60e9f604e00011f09eb': 0015107538325629414'5a174c5145a97200011ad30a': 0021382577804332024'59d745ff90509add31e9db14': 17961486298296112'5a3800604b02a6ad9f85324f': 0007558379155117594'5a3cb6868fb75500011ab51d': 023149159025255506'5a086f93875e890001605abc': 1'5a1d8d7b634e00000187855b': 0000043367446001951'5a048e3078658d0001ffdab8': 007528024881828617'5a37e92fed8a500001de70da': 003601647227852549'5a03590f08849f0001097d29': 013846103543655108'59d27d45acb3c12634d19efb': 006530552814813005'5a1327c9c92a1700011c7baf': 0030692632427397986'5a2cfacad0129700019a7270': 000890152494283532 price24h: '5a086f93875e890001605abc': 1'594bb7e468a95e00203b048d': 037856454757867614'59d27d45acb3c12634d19efb': 0059521291958231165'5a3cb6868fb75500011ab51d': 0'5a2cfacad0129700019a7270': 000920144823242839'5a03590f08849f0001097d29': 01434845498812609'59d745ff90509add31e9db14': 22540613848221113'5a37e92fed8a500001de70da': 003556953896192395'5a1327c9c92a1700011c7baf': 002289891182252949'5a048e3078658d0001ffdab8': 006775040652793572'5a174c5145a97200011ad30a': 0022126351058902722'5a1d8d7b634e00000187855b': 000005011696895057975'5a1af60e9f604e00011f09eb': 0016895927407386328'5a3800604b02a6ad9f85324f': 0009187771984328866 priceHistory7d: {} }
Returns object JSON object.
currencies
This function can be used to search for a token or list all tokens.
Parameters
name
String Search string, leave blank for list tokens.limit
number Maximum number of tokens to list.skip
number Skip this number of tokens.callback
callback Callback function.
Examples
bancor data: currencies: includeTotal: falseskip: 0limit: 20total: nullpage: Object
Returns object JSON object.
Future Work
- Offline Symbol lookup table
- Add further APIs (community/bounty)
- Payment APIs
Tip Jar
- ETH - 0xA1975D105949cC3d3b4637aC893A4Fe1b06aABAa