Fix cw20-base helpers.ts and point to heldernet#201
Conversation
ethanfrey
left a comment
There was a problem hiding this comment.
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
| readonly networkId: string | ||
| readonly feeToken: string | ||
| readonly gasPrice: number | ||
| readonly gasPrice: GasPrice |
There was a problem hiding this comment.
This changed. Is this using 0.22 still? or 0.23?
There was a problem hiding this comment.
This is for v0.23.0
| // 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.
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.
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});
~~~~~~~
ethanfrey
left a comment
There was a problem hiding this comment.
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.