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

Getting date.getTime is not a function #84

Open
shukr-acharya opened this issue Jan 22, 2024 · 3 comments
Open

Getting date.getTime is not a function #84

shukr-acharya opened this issue Jan 22, 2024 · 3 comments

Comments

@shukr-acharya
Copy link

Getting date.getTime is not a function error from toTimestamp present in helpers.ts
On broadcasting '/cosmos.authz.v1beta1.MsgGrant' message
On 16.9.0 osmojs version

function toTimestamp(date) {
      const seconds = numberToLong(date.getTime() / 1e3);
      const nanos = date.getTime() % 1e3 * 1e6;
      return {
        seconds,
        nanos
      };
    }
@Zetazzz
Copy link
Collaborator

Zetazzz commented Jan 22, 2024

Hi

Is it possible that the expiration field's set to a string while it's type's date?

@shukr-acharya
Copy link
Author

we provide expiration time in seconds (number)

@Zetazzz
Copy link
Collaborator

Zetazzz commented Jan 25, 2024

we provide expiration time in seconds (number)

I see, please set the expiration field a Date type. I mean, expiration seconds can be transferred to an expiration Date

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