Skip to content

Commit e2b5eac

Browse files
committed
Update CryptAPI endpoints to use new api.cryptapi.io domain and fix URL paths
1 parent 0d9fa12 commit e2b5eac

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

HUMAN-TODO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# todo
22

3-
- [ ] use new cryptapi.io api endpoints
3+
44
- [ ] call cryptoapi convert endpoint to convert app cost to user's desired currency
55
- [ ] show that in qrcode and payment screens so they pay the exact balance
66
- [ ] speed up build. (currently takes 67 seconds)

src/services/payment-service.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ export const paymentService = {
239239

240240
// Generate a curl command for manual testing of the CryptAPI endpoint
241241
try {
242-
const baseURL = 'https://cryptapi.io/api/';
242+
const baseURL = 'https://api.cryptapi.io/';
243243
const testCoin = coin || 'btc';
244244
const testAddress = process.env.BITCOIN_ADDRESS || "bc1q254klmlgtanf8xez28gy7r0enpyhk88r2499pt";
245245
const callbackUrl = 'https://pdf.profullstack.com/api/1/payment-callback';

src/utils/cryptapi-wrapper.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ export function createCryptAPIClient() {
2626
console.log(` - Options: ${util.inspect(options, { depth: null })}`);
2727

2828
// Construct the full URL that will be called
29-
const baseURL = 'https://cryptapi.io/api/';
30-
const endpoint = `/${coin}/create`;
29+
const baseURL = 'https://api.cryptapi.io/';
30+
const endpoint = `${coin}/create`;
3131

3232
// Build query parameters
3333
const queryParams = new URLSearchParams();
@@ -47,7 +47,7 @@ export function createCryptAPIClient() {
4747
}
4848
}
4949

50-
const fullURL = `${baseURL}${coin}/create?${queryParams.toString()}`;
50+
const fullURL = `${baseURL}${endpoint}?${queryParams.toString()}`;
5151
console.log(`CryptAPI Wrapper: Full URL that will be called: ${fullURL}`);
5252

5353
// Generate a curl command for manual testing

0 commit comments

Comments
 (0)