Skip to content

Conversation

@dynst
Copy link
Contributor

@dynst dynst commented Nov 11, 2025

Part of #1750. Most warnings were in the ledger-amino web code.

declare const window: any;
declare const document: any;
const getElement = (id: string): HTMLInputElement => {
const e = document.getElementById(id);
Copy link
Member

Choose a reason for hiding this comment

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

Does this compile? How does TS know document.getElementById exists here?

Copy link
Member

Choose a reason for hiding this comment

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

Nevermind, in ledger-amino we have DOM types due to

    "lib": ["es2020", "dom"]

Copy link
Member

@webmaster128 webmaster128 left a comment

Choose a reason for hiding this comment

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

Nice

Copy link
Member

@webmaster128 webmaster128 left a comment

Choose a reason for hiding this comment

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

Thank you.

I will merge this manually to resolve the conflict from renaming cosmwasm-stargate

return account ? accountFromAny(account) : null;
} catch (error: any) {
if (/rpc error: code = NotFound/i.test(error.toString())) {
if (/rpc error: code = NotFound/i.test(String(error))) {
Copy link
Member

@webmaster128 webmaster128 Nov 12, 2025

Choose a reason for hiding this comment

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

Here we can also use the solution from the other getAccount implementation:

    } catch (error) {
      assert(error instanceof Error);
      if (/rpc error: code = NotFound/i.test(error.toString())) {
        return null;
      }

It avoids the any type and uses unknown instead. Any preference?

@webmaster128 webmaster128 merged commit 1ec76c0 into cosmos:main Nov 12, 2025
13 checks passed
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

Successfully merging this pull request may close these issues.

2 participants