-
Notifications
You must be signed in to change notification settings - Fork 359
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
Fix cw20-base helpers.ts and point to heldernet #201
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Please double-check the cosmjs version and update the header if needed.
Otherwise, feel free to merge and I will look into InitMsg later
@@ -20,24 +20,29 @@ interface Options { | |||
readonly httpUrl: string | |||
readonly networkId: string | |||
readonly feeToken: string | |||
readonly gasPrice: number | |||
readonly gasPrice: GasPrice |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changed. Is this using 0.22 still? or 0.23?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for v0.23.0
@@ -202,7 +181,7 @@ interface CW20Contract { | |||
// codeId must come from a previous deploy | |||
// label is the public name of the contract in listing | |||
// if you set admin, you can run migrations on this contract (likely client.senderAddress) | |||
instantiate: (codeId: number, initMsg: InitMsg, label: string, admin?: string) => Promise<CW20Instance> | |||
instantiate: (codeId: number, initMsg: Record<string, unknown>, label: string, admin?: string) => Promise<CW20Instance> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The TS compiler forces this on you?
Ideally it would auto downcast InitMsg to this more general Record<string, unknown>
. And nice to have the clarity in the contract-specific API. If you have TS issues, leave it and I can look into it later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the error I get with v0.23:
../../../../../.npm/_npx/10245/lib/node_modules/@cosmjs/cli/[eval].ts:307:53 - error TS2345: Argument of type 'InitMsg' is not assignable to parameter of type 'Record<string, unknown>'.
Index signature is missing in type 'InitMsg'.
307 const result = await client.instantiate(codeId, initMsg, label, { memo: `Init ${label}`, admin});
~~~~~~~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, and can you update https://github.com/CosmWasm/cosmwasm-plus/tree/v0.2.1/contracts/cw20-base
to v0.3.2
?
I think it is the same public interface, but good to keep using the most recent versions. I have done some minor bug fixes on that contract
@ethanfrey I don't know which version of |
I'll merge this (doesn't have to be correct) and update shortly with the v0.4.0 release |
This change is required for coralnet to heldernet update in docs.