-
Notifications
You must be signed in to change notification settings - Fork 33
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
Misbehavior With Amino Types #12
Comments
thanks! great info. I'm also curious, how are you creating the related: |
Ye, ofc that's how I create |
ok so @DavideSegullo as an interface, you're essentially passing in durations as objects. This does make sense. For context, we used strings because I had originally reverse engineered the code from osmosis-frontend which used strings. I'll be updating this after HackWasm! Thanks for the details :) |
I add that also the message MsgCreateGauge presents the problem of duration |
Thanks! Will be able to sort this out soon, it's on my todo list! |
Running into this same issue. I'm working around it by sending a plain number instead of a string: const duration: 126000
{
/**
* Marking as 'any' because Duration type definition in telescope is wrong.
* @see https://github.com/osmosis-labs/osmojs/issues/12
* @see https://github.com/osmosis-labs/telescope/issues/211
*/
duration: duration as any,
} |
please try the new release candidate @JoseRFelix @DavideSegullo
example here https://github.com/cosmology-tech/cosmology/blob/main/packages/cli/src/commands/lock.ts#L113-L116 const msg = lockTokens({
owner: account.address,
coins,
duration: Duration.fromPartial({
seconds: Long.fromString(duration),
nanos: 0
})
}); |
Hello, I'm using osmojs for sinfonia-ui, but I found two errors inside the AminoConverter:
/osmosis.lockup.MsgLockTokens
should produce as a return for the "toAmino" function an object with the following structure:Although, it returns an object with the following structure:
As it's possible to see, here the duration field is returned as an object with
seconds
andnanos
attributes, instead of a single string.That's how I implemented it on sinfonia:
https://github.com/bitsongofficial/sinfonia-ui/blob/9aaa13947b971d220ae64600704645faf2133efb/src/signing/amino-types.ts#L89
/osmosis.lockup.MsgBeginUnlocking
seems to be wrong, it isn'tosmosis/lockup/begin-unlocking
as in line 24, since on osmosis it's defined such asosmosis/lockup/begin-unlock-period-lock
as in line 14. You could get another reference directly from the osmosis frontendThe text was updated successfully, but these errors were encountered: