#Soroban contract bindings typescript error

53 messages · Page 1 of 1 (latest)

heady sierra
#

Document link: https://soroban.stellar.org/docs/getting-started/create-an-app

In section 4, Create an APP in section Generate an NPM package for the Hello World contract:
I'm running the following command:

./soroban contract bindings typescript
--network testnet
--contract-id $(cat .soroban/hello-id)
--output-dir hello-soroban-client

The error I receive is as follows:
error: jsonrpc error: ErrorObject { code: InvalidParams, message: "cannot unmarshal key value AAAABgAAAAEp0SRPKSPNVUrzu8Ivh3Hzq/ZIC+Gfnj1SmxYkYVe9lAAAABQAAAABAAAAAA== at index 0", data: None }

There is a value in hello-id CAU5CJCPFER42VKK6O54EL4HOHZ2X5SIBPQZ7HR5KKNRMJDBK66ZJYZT

I reran the command with the --very-verbose option which produced the following:

./soroban --very-verbose contract bindings typescript
--network testnet
--contract-id $(cat .soroban/hello-id)
--output-dir hello-soroban-client
2023-11-04T03:21:05.865481Z TRACE soroban_cli::commands::contract::fetch: network=Network { rpc_url: "https://soroban-testnet.stellar.org:443", network_passphrase: "Test SDF Network ; September 2015" }
2023-11-04T03:21:05.865643Z TRACE soroban_cli::rpc: uri=https://soroban-testnet.stellar.org:443/
2023-11-04T03:21:05.865676Z TRACE soroban_cli::rpc: Getting network
error: jsonrpc error: ErrorObject { code: InvalidParams, message: "cannot unmarshal key value AAAABgAAAAEp0SRPKSPNVUrzu8Ivh3Hzq/ZIC+Gfnj1SmxYkYVe9lAAAABQAAAABAAAAAA== at index 0", data: None }

I'm new to this and just following the documentation with the goal of learning. I don't mind getting in the weeds but I do need
someone to point me in the right direction. Thanks.

Make a frontend web app that interacts with your smart contracts.

plush marsh
#

in that guide it's using a custom version of soroban-cli but i don't think you need to do that anymore, and it might be outdated. i'd suggest using the normal soroban-cli

#

@errant fox

heady sierra
placid pivot
#

If you need help or guidance, just let me know here.

heady sierra
errant fox
#

Currently the version you need is 20.0.0-rc4.1. Is that the one you used?

plush marsh
#

I think he use the one on your repo. We need to update those docs

heady sierra
plush marsh
#

you could do cargo install --locked --version 20.0.0-rc4.1 soroban-cli

#

that should upgrade it

heady sierra
heady sierra
plush marsh
#

oh let me check the latest version

#

4.1 you'd need to install from github following how it works in that guide you were following

#

the latest version on crates.io is 20.0.0-rc-4

#

you should be fine with that

heady sierra
plush marsh
#

if you wanna use rc-4.1 yeah but you need to use the repo from stellar

#

i will give you the url one sec

#

there's a tag calleed v20.0.0-rc.4.1

#

4.0 will be fine if you dont feel like doing all that

#

oh but this one has updated ts bindings

#

so definitely yeah use that

#

the rc-4.1

#

I'm not sure who the maintainer is to get the new release uploaded to crates.io but maybe @hoary bobcat can ask for us

#

actually there's an easier way then in that guide

#

I think at least

#

I haven't actually tried that it might not work since soroban-cli is a sub directory

heady sierra
plush marsh
#

just fyi...

#

the 4.1 does have updated typesccript bindings code

#

so you do probably wanna use it lol

#

but yeah it's not on crates.io and 4 is better than 2 so shrug.

heady sierra
#

Exactly how do I get 4.1?

plush marsh
#

either by following the part in the docs from create-an-dapp that tells about using the custo version of soroban-cli OR if you can get cargo install --git https://github.com/stellar/soroban-tools to work but it gave an error for me

#

instead of that line it would look like this:

#

install_soroban = "install --git https://github.com/stellar/soroban-tools --branch v20.0.0-rc.4.1 --root ./target soroban-cli --debug"

heady sierra
#

Fantastic. Let me go to work. Again, thanks.

plush marsh
#

anytime good luck

hoary bobcat
plush marsh
#

AH! Sorry about that!

plush marsh
heady sierra
# hoary bobcat This command has a typo in it which is why it wasn't working for y'all. You don'...

Thanks, but what goes into the config.toml file? What I have there currently is:
[alias] # command aliases
install_soroban = "install --git https://github.com/stellar/soroban-tools --branch release/v20.0.0-rc.4.1 --root ./target soroban-cli --debug"

GitHub

CLI and RPC Server for Soroban Contracts. Contribute to stellar/soroban-tools development by creating an account on GitHub.

hoary bobcat
plush marsh