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

CAP-58: Add support to deploy with/without params to typescript bindings #1562

Open
leighmcculloch opened this issue Aug 25, 2024 · 2 comments
Assignees

Comments

@leighmcculloch
Copy link
Member

leighmcculloch commented Aug 25, 2024

CAP-58 is in protocol v22 and adds support for calling a constructor as part of the deploy process.

From the bindings perspective this means that the deploy can have required parameters same to how an invoke can have required parameters. So the ability to use the contract interface to determine which parameters are required is needed on the deploy command.

Given the deploy of a contract becomes a typed interface much like an invoke, ideally the typescript contract bindings offer a way to deploy a contract and specify the parameters / functions in the same way a contract call does.

Blocked by:

@chadoh
Copy link
Contributor

chadoh commented Aug 26, 2024

Not sure it makes sense to add any typings for this. We don't currently have any TS typings around deploys, unless you're considering a deploy-like method in a factory contract. A Contract Client and its TS Typings are usually generated for an existing, deployed contract, and have so far focused on helping people build apps/scripts that interact with that contract. This seems like it would focus on a different workflow: given a local Wasm file, help people create a (ts-)node script that facilitates deploying that Wasm file. Given that the CLI will already people to help you do this in a single command, I'm not sure how useful such TS types would be.

@leighmcculloch
Copy link
Member Author

leighmcculloch commented Aug 26, 2024

unless you're considering a deploy-like method in a factory contract

Constructors remove most needs for a factory contract, and so for flows that currently call a factory contract to deploy with typed inputs, I think that same flow should work for a direct deploy with a constructor with typed inputs.

The current client code that takes a contract and typed inputs is helping to create a transaction that'll be simulated and submitted. That's no different to a direct deploy transaction? We're helping someone take a contract, and helping them form a transaction.

given a local Wasm file

Contracts can be installed then deployed, so the contract may not be a local file, it may be a installed contract.

@janewang janewang assigned fnando and chadoh and unassigned fnando Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

No branches or pull requests

3 participants