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

Support passing contract invocation args as JSON #1280

Open
leighmcculloch opened this issue Apr 8, 2024 · 0 comments
Open

Support passing contract invocation args as JSON #1280

leighmcculloch opened this issue Apr 8, 2024 · 0 comments
Assignees

Comments

@leighmcculloch
Copy link
Member

leighmcculloch commented Apr 8, 2024

This idea was shared or formed from some combination of @janewang @chadoh @willemneal (sorry I missed who put this in the doc but I think it was one of you!). I'm moving it here because the doc was focused on capturing the status quo.

Currently invoking a contract has the following format. It is elegant and meets most needs:

soroban contract invoke --id C123… -- do_something \
   --num 1 \
   --complex_arg '{ "field": 1 }'

There are situations where it may be helpful to form a single JSON blob for the args and pass them in as a single value either via an arg:

soroban contract invoke --id C123... \
   --args-json ‘{“method”: “do_something”, “args”: {“num”: 1, “complex_arg”: {“field”: 1}}’

or via stdin:

soroban contract invoke --id C123... -- do_something  << -
   {“num”: 1, “complex_arg”: {“field”: 1}}
-
@willemneal willemneal self-assigned this Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

2 participants