Skip to content

Upstream useful helpers into @cosmjs/cli #385

Open
@ethanfrey

Description

In CosmWasm/cw-plus#46 I went to make the easiest intro to using the cw20-base contract via @cosmjs/cli. However, the setup code we have by default wasn't the simplest, so I refactored this along the way.

In particular, please look at this code section: https://github.com/CosmWasm/cosmwasm-plus/blob/master/contracts/cw20-base/helpers.ts#L19-L134

It allows us to simply const client = await useOptions(coralnetOptions).setup(password); and create or recover a password-encrypted key, configured with all chain-specific options. We can provide different options, like gaiaFlexOptions for easy drop-in. I also worked to limit the number of top-level exports to avoid name-space pollution.

However, I would rather not copy this code in each contract we support with helpers and wanted to upstream it to @cosmjs/cli. I was thinking to keep the actual concrete options in the contract helpers for now, until we figure out how to do mix ins (options from testnets dir, cw20-base bindings here, cw1-subkeys bindings here...).

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions