You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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.
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:
The text was updated successfully, but these errors were encountered: