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

tx.search === LCDResponseError: Status 403 - None #339

Closed
kartzke opened this issue Sep 23, 2022 · 1 comment
Closed

tx.search === LCDResponseError: Status 403 - None #339

kartzke opened this issue Sep 23, 2022 · 1 comment

Comments

@kartzke
Copy link

kartzke commented Sep 23, 2022

Hi, I am trying to query transactions on columbus-5 using the Terra SDK's, but I can't get a simple request to work, I keep getting LCDResponseError: Status 403 - None.

Is there anything special I need to do? I don't see anything about an API key or permissions in the docs. Here's the basic code I'm using, most of which is copy/pasta from the docs.

import fetch from "isomorphic-fetch";
import { Coins, LCDClient } from "@terra-money/terra.js";

const lcd = async function() { 
    try{const gasPrices = await(
        await fetch("https://columbus-api.terra.dev/gas-prices", {
          redirect: "follow",
        })
      ).json();
      
      const gasPricesCoins = new Coins(gasPrices);
      
      const lcd = new LCDClient({
        URL: "https://columbus-lcd.terra.dev/",
        chainID: "columbus-5",
        gasPrices: gasPricesCoins,
        gasAdjustment: "1.5",
        gas: 10000000,
        isClassic: true, // false by default, change to true if you want to interact with Terra Classic
      });
      return lcd}
      catch(err) {
        console.error(`🚫 Error:`, err)
      }
  }

lcd().then(client => console.log( client.tx.search({"message.sender": "terra14gct05rklfakrqey072hpc8x63wjkzr5mcgfpw"}) ))

This resulted in a get request to: https://columbus-lcd.terra.dev/cosmos/tx/v1beta1/txs?message.sender=terra14gct05rklfakrqey072hpc8x63wjkzr5mcgfpw

@Vritra4
Copy link
Contributor

Vritra4 commented Sep 24, 2022

your codes have no problem but public LCDs don’t accept requests to search tx. i think you need to run your own node.

@Vritra4 Vritra4 closed this as completed Sep 25, 2022
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