Skip to content

Commit

Permalink
Merge pull request #107 from CharlieC3/master
Browse files Browse the repository at this point in the history
fix: update API paths to use API domain
  • Loading branch information
wileyj authored Jan 16, 2024
2 parents 8ec82d0 + 32e9c3e commit 0b2f8fa
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/lookups.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import logger from 'winston'
export async function isSubdomainRegistered(fullyQualifiedAddress: String) {

try {
const nameInfoUrl = bskConfig.network.coreApiUrl + '/v1/names/' + fullyQualifiedAddress
const nameInfoUrl = bskConfig.network.blockstackAPIUrl + '/v1/names/' + fullyQualifiedAddress
const nameInfoRequest = await fetch(nameInfoUrl)
const { status } = nameInfoRequest
if (status == 200) {
Expand Down
4 changes: 2 additions & 2 deletions src/operations.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export async function submitUpdate(
throw new Error('Invalid domain name')
}

const nameInfoUrl = bskConfig.network.coreApiUrl + '/v1/names/' + domainName
const nameInfoUrl = bskConfig.network.blockstackAPIUrl + '/v1/names/' + domainName
const nameInfoRequest = await fetch(nameInfoUrl)
const nameInfo = await nameInfoRequest.json()

Expand Down Expand Up @@ -267,7 +267,7 @@ export async function checkTransactions(
if (!tx.blockHeight || tx.blockHeight <= 0) {
// const txInfo = await bskConfig.network.getTransactionInfo(tx.txHash)
const url = new URL(
bskConfig.network.coreApiUrl + `/extended/v1/tx/0x${tx.txHash}`
bskConfig.network.blockstackAPIUrl + `/extended/v1/tx/0x${tx.txHash}`
);
const httpRequest = await fetch(url);
const reqText = await httpRequest.text();
Expand Down
1 change: 1 addition & 0 deletions tests/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { StacksMainnet } from '@stacks/network'
nock.disableNetConnect()

bskConfig.network = new StacksMainnet()
bskConfig.network.blockstackAPIUrl = bskConfig.network.coreApiUrl

unitTestLookups()
unitTestOperations()
Expand Down

0 comments on commit 0b2f8fa

Please sign in to comment.