Skip to content

[Question] Get borrower_info of previous block heights #54

@fentas

Description

@fentas

Hello, not sure if this is the right place for this question.
I am trying to get borrowed amount of previous block heights to calculate the occurred loan fees over time.

WIthout previous knowledge, I just was trying within dev tools to change the request as follows but it always returns the current block height. Ideas?

height=5971055;
address="terra...";
(await (await fetch("https://mantle.terra.dev/?borrow--borrower", {
  "headers": {
    "accept": "application/json",
    "content-type": "application/json"
  },
  "referrer": "https://app.anchorprotocol.com/",
  "referrerPolicy": "strict-origin-when-cross-origin",
  "body": "{\"query\":\"{\\n  marketBorrowerInfo: WasmContractsContractAddressStore(\\n    ContractAddress: \\\"terra1sepfj7s0aeg5967uxnfk4thzlerrsktkpelm5s\\\"\\n    QueryMsg: \\\"{\\\\\\\"borrower_info\\\\\\\":{\\\\\\\"borrower\\\\\\\":\\\\\\\""+address+"\\\\\\\",\\\\\\\"block_height\\\\\\\":"+height+"}}\\\"\\n  ) {\\n    Result\\n    Height\\n  }\\n}\\n\",\"variables\":{}}",
  "method": "POST",
  "mode": "cors",
  "credentials": "omit"
})).json()).data.marketBorrowerInfo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions