docs icon indicating copy to clipboard operation
docs copied to clipboard

cleanup openapi spec across repos

Open ryanwaits opened this issue 11 months ago • 3 comments

There have been a number of minor copy issues that have popped up when fetching openapi specs, need to dedicate some time to clean these up for docs automation.

ryanwaits avatar Dec 09 '24 15:12 ryanwaits

Dev suggested we give a better explanation of what the transaction_payload property should be when passing into the https://api.hiro.so/v2/fees/transaction endpoint. He stated that it wasn't clear enough.

here's more context in this Discord message.

let transaction: StacksTransactionWire
let txlength = estimateTransactionByteLength(transaction)

const json = {
  **transaction_payload: bytesToHex(serializePayloadBytes(transaction.payload)),**
  estimated_len: txlength
}

let response = await fetch("https://api.hiro.so/v2/fees/transaction", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify(json)
})
let result = await response.json()

I guess it's not obvious that one should be grabbing the payload property of the StacksTransactionWire class after it's constructed.

Image

ECBSJ avatar Dec 09 '24 17:12 ECBSJ

In the NFT metadata endpoint page, the example NFT contract using in the API Playground portion of this endpoint page is returning an error:

❯ curl -X GET "https:// api.hiro .so /metadata/v1/nft/SP497E7RX3233ATBS2AB9G4WTHB63X5PBSP5VGAQ.boomboxes-cycle-12/35"

{"error":"Token error","message":"Metadata could not be processed because the server responded with an error"}

Side notes:

  • calling the get-token-uri function directly from contract returns proper response
  • this issue was flagged by a dev in the Discord

ECBSJ avatar Mar 13 '25 21:03 ECBSJ

The query param for this RPC endpoint https://api.hiro.so/v2/contracts/call-read/{contract_address}/{contract_name}/{function_name} takes in a tip param. But it doesn't take in the Stacks block height nor hash, but rather the index_block_hash.

This index_block_hash can be found calling another endpoint https://api.hiro.so/extended/v2/blocks/{height_or_hash}.

Let's add some verbage for this in the docs page below for the tip query param: https://docs.hiro.so/stacks/rpc-api/smart-contracts/read-only

Image

ECBSJ avatar Apr 12 '25 01:04 ECBSJ