Cardinal-Cryptography / Cardinal-Cryptography/ink-wrapper

Generate CLI tool.

Open
#41 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
12
Forks
4
PR merge metrics
No merged PRs in 30d

Description

We could extend the tool with the CLI companion (one binary for every contract) exposing contract's methods. This is useful at the very least when testing the contract manually.

--------------------------------------------

Given a contract's metadata (`metadata.json` file) we can already (using current version of `ink-wrapper`) generate a _library_ that is capable of interacting with the contract on chain. It's currently required that this code is put in a bigger context, like a daemon process, bot (or end-2-end test). It shouldn't be difficult to generate a standalone CLI tool that wraps the library and allows for interacting with the contract directly (akin to `cargo contract call`) while providing an interface that is generated from its metadata.

Assuming a PSP22 contract metadata (with the usual set of methods), the imaginary CLI API could look like the following:
```sh
my-psp22

balance-of
my-psp22
total-supply
my-psp22
transfer
my-psp22
transfer-from
my-psp22
approve
...
```

all of the input arguments can be type-checked since the information about the type is present in contract's metadata.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.