soroban-cli icon indicating copy to clipboard operation
soroban-cli copied to clipboard

Deprecate `bindings json` command

Open Ifropc opened this issue 6 months ago • 2 comments

Background:

I like the idea of using the raw XDR<>JSON for the interface format.

There is actually another JSON format we invented at some point, that is visible with this command:

❯ stellar contract bindings json --wasm test_empty.wasm
[
  {
    "type": "function",
    "doc": "",
    "name": "empty",
    "inputs": [],
    "outputs": []
  }
]

The json command really doesn't belong in the bindings command, because bindings is for generating actual clients, and the JSON is clearly not a client. So I think we can deprecate the bindings json command.

The question becomes should we keep this JSON interface format around, or abandon it for the XDR/JSON.

Realistically the two formats don't look that different, and so the value in maintaining the other format that I'm not sure many people know exists has little value.

$ wasm-cs test_empty.wasm read contractspecv0 -f binary | stellar xdr decode --input stream --type ScSpecEntry --output json-formatted
{
  "function_v0": {
    "doc": "",
    "name": "empty",
    "inputs": [],
    "outputs": []
  }
}

Originally posted by @leighmcculloch in https://github.com/stellar/stellar-cli/pull/1532#discussion_r1708395883

Ifropc avatar Aug 08 '24 23:08 Ifropc