Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update API paths to use API domain #107

Merged
merged 2 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't this be easy to change the env var to STACKS_API_URL etc, vs continuing to use the BLOCKSTACK_API_URL?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe, but it's not a high enough priority for us to invest more resources in at the moment.


unitTestLookups()
unitTestOperations()
Expand Down
Loading