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

Function signatures for MsgExecuteContract inconsistent with Terra.js #9

Closed
przmyst opened this issue Sep 28, 2023 · 1 comment
Closed

Comments

@przmyst
Copy link
Contributor

przmyst commented Sep 28, 2023

Update documentation to specify that cosmes MsgExecuteContract takes an Object with sender, contract, msg, and funds properties vs 4 arguments with Terra.js MsgExecuteContract.

      const msgs = [
       //Does not work as expected with cosmes
        new MsgExecuteContract(
          'terra1u9k8h9e9u9jg7yq50myt8d20hhmwc0wyznf4yy',
          'terra136cqzlps72yma3z8pdlw43nnwvf6d2cn6jcf9a4zxtwmhx4hka7sw7ymdp',
          {
            swap: {
              offer_asset: {
                info: {
                  native_token: {
                    denom: 'uluna'
                  }
                },
                amount: 2000000000
              }
            }
          },
          { uluna: 2000000000}
        ),
       //Works with cosmes
        new MsgExecuteContract({
          sender: 'terra1u9k8h9e9u9jg7yq50myt8d20hhmwc0wyznf4yy',
          contract: 'terra136cqzlps72yma3z8pdlw43nnwvf6d2cn6jcf9a4zxtwmhx4hka7sw7ymdp',
          msg: {
            swap: {
              offer_asset: {
                info: {
                  native_token: {
                    denom: 'uluna'
                  }
                },
                amount: 2000000000
              },
            }
          },
          funds: [
            new Coin('uluna', 2000000000).toAmino()
          ]
        })
      ]
@AaronCQL
Copy link
Member

Closing in favour of #3. This library does indeed have a different function signature to both cosmjs and featherjs.

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