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

BRC20 endpoints unable to read array of string in query params #392

Open
ECBSJ opened this issue Jan 11, 2025 · 1 comment
Open

BRC20 endpoints unable to read array of string in query params #392

ECBSJ opened this issue Jan 11, 2025 · 1 comment

Comments

@ECBSJ
Copy link

ECBSJ commented Jan 11, 2025

i can't seem to get any results returned back from this BRC-20 API endpoint when passing in tickers as an array of strings:

curl example:
curl -X GET "https://api.hiro.so/ordinals/v1/brc-20/tokens?ticker=%5B%22piza%22%2C%22pepe%22%5D"

js fetch example:

const baseUrl = "https://api.hiro.so/ordinals/v1/brc-20/tokens"
const params = new URLSearchParams({
  ticker: ["piza", "pepe"]
})
const urlWithParams = `${baseUrl}?${params.toString()}`

let result = await fetch(urlWithParams, {
  method: "GET",
  headers: {
    "Content-Type": "application/json",
    Accept: "application/json"
  }
})

let response = await result.json()
console.log(response)

response:
{"limit":20,"offset":0,"total":0,"results":[]}

ref:
https://docs.hiro.so/bitcoin/ordinals/api/brc20/get-brc20-tokens (e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@ECBSJ and others