crypto-bot-api
Advanced tools
Comparing version 0.1.1 to 0.2.0
# Changelog | ||
### 0.2.0 (Dec 9, 2021) | ||
- Using mainnet endpoint for default | ||
### 0.1.1 (Dec 5, 2021) | ||
@@ -4,0 +8,0 @@ |
@@ -45,4 +45,4 @@ /// <reference types="node" /> | ||
* | ||
* Important: at the time of publication of version 0.1.0 (Dec 4, 2021), | ||
* test API servers do not accept self-signed certificates | ||
* Important: at the time of publication of version 0.2.0 (Dec 9, 2021), | ||
* API servers do not accept self-signed certificates | ||
* | ||
@@ -49,0 +49,0 @@ * @param serverOptions - Node.js built-in server options |
@@ -78,4 +78,4 @@ "use strict"; | ||
* | ||
* Important: at the time of publication of version 0.1.0 (Dec 4, 2021), | ||
* test API servers do not accept self-signed certificates | ||
* Important: at the time of publication of version 0.2.0 (Dec 9, 2021), | ||
* API servers do not accept self-signed certificates | ||
* | ||
@@ -82,0 +82,0 @@ * @param serverOptions - Node.js built-in server options |
@@ -64,3 +64,3 @@ import { Currencies, ExchangeRates, Me } from '../helpers/casts'; | ||
*/ | ||
constructor(apiKey: string, endpoint?: string); | ||
constructor(apiKey: string, endpoint?: 'mainnet' | 'testnet' | string); | ||
/** | ||
@@ -67,0 +67,0 @@ * Get API supported currencies infomation |
@@ -21,3 +21,3 @@ import { ApiMethod } from '../helpers/utils'; | ||
*/ | ||
constructor(apiKey: string, endpoint: string); | ||
constructor(apiKey: string, endpoint: 'mainnet' | 'testnet' | string); | ||
/** | ||
@@ -24,0 +24,0 @@ * Make request to backend API, handle errors and return result |
@@ -23,6 +23,4 @@ "use strict"; | ||
let url; | ||
// Mainnet disabled during api testing stage | ||
if (endpoint === 'mainnet' || endpoint === 'https://pay.crypt.bot/api') { | ||
throw new Error('Mainnet disabled during api testing stage,' | ||
+ "pass 'testnet' or endpoint url in second parameter"); | ||
if (endpoint === 'mainnet') { | ||
url = 'https://pay.crypt.bot/api'; | ||
} | ||
@@ -29,0 +27,0 @@ else if (endpoint === 'testnet') { |
{ | ||
"name": "crypto-bot-api", | ||
"version": "0.1.1", | ||
"version": "0.2.0", | ||
"description": "Simple and minimalistic client for Telegram CryptoBot Crypto Pay API", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -35,3 +35,3 @@ # Crypto Bot API | ||
const client = new CryptoBotAPI('1234:AAA...AAA', 'testnet'); | ||
const client = new CryptoBotAPI('1234:AAA...AAA'); | ||
@@ -47,3 +47,3 @@ const me = await client.getMe(); | ||
<script> | ||
var client = new CryptoBotAPI('1234:AAA...AAA', 'testnet'); | ||
var client = new CryptoBotAPI('1234:AAA...AAA'); | ||
@@ -56,3 +56,3 @@ client.getMe().then(function(me) { | ||
**Important: at the time of publication of version 0.1.1 (Dec 5, 2021), test API servers do not return header Access-Control-Allow-Origin, which allows make requests to API from third-party domains, so client request from website environment won't work (but its work in browser extensions, Electron and similar apps)** | ||
**Important: at the time of publication of version 0.2.0 (Dec 9, 2021), API servers do not return header Access-Control-Allow-Origin, which allows make requests to API from third-party domains, so client request from website environment won't work (but its work in browser extensions, Electron and similar apps)** | ||
@@ -67,3 +67,3 @@ More usage examples see in [examples](https://github.com/sergeiivankov/crypto-bot-api/tree/main/examples) project directory. | ||
**Important: at the time of publication of version 0.1.1 (Dec 5, 2021), test API servers do not accept self-signed certificates** | ||
**Important: at the time of publication of version 0.2.0 (Dec 9, 2021), API servers do not accept self-signed certificates** | ||
@@ -70,0 +70,0 @@ ## Documentation |
75847
1880