near-sdk-js icon indicating copy to clipboard operation
near-sdk-js copied to clipboard

near-sdk-js ABI support

Open exalate-issue-sync[bot] opened this issue 3 years ago • 6 comments

Remain work for this ticket:

  • update to use latest abi
  • add abi test as in rust sdk

exalate-issue-sync[bot] avatar Sep 23 '22 07:09 exalate-issue-sync[bot]

ABI generation is done in #301 and available in 0.7. Great job @itegulov ! I have the same question as Serhii's: do you think it's possible to test ABI somehow?

ailisp avatar Jan 17 '23 01:01 ailisp

My suggestions woul be:

  • keep hardcoded file in the repo and compare it to the generated one (ideally, multiple files that cover all the edge cases)
  • once we have proper implementation of the client code generation, we can create an end to end integration test

volovyks avatar Jan 18 '23 13:01 volovyks

Yes, what @volovyks suggests would be ideal. We have a comprehensive set of Rust ABI generation tests under https://github.com/near/cargo-near/tree/main/integration-tests/tests/abi; it might make sense to port them here as well.

NAJ support for ABI is coming soon (https://github.com/near/near-api-js/pull/1045), we will be able to test it e2e after it is released.

itegulov avatar Jan 19 '23 01:01 itegulov

Hello, please help me to solve this problem. All programs have been upgraded to the final version. However, the error still exists. :~/near/hello-near# cargo near deploy rezoo.testnet without-init-call network-config testnet sign-with-keychain send • Checking the host environment...done • Collecting cargo project metadata...done • Generating ABI │ Finished dev [unoptimized] target(s) in 0.28s • Extracting ABI...failed Here is the console command if you ever need to re-run it again: cargo near deploy rezoo.testnet without-init-call network-config testnet sign-with-keychain send

Error: 0: expected schema_version to be ~0.4, but got 0.3.0: consider re-generating your ABI file with a newer version of SDK and cargo-near

Location: /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-near-0.6.1/src/util/mod.rs:307

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.

Rezaheydariii avatar Mar 11 '24 12:03 Rezaheydariii

@Rezaheydariii Thanks for reporting. We're working on a fix.

ailisp avatar Apr 19 '24 09:04 ailisp

@Rezaheydariii Your error is a cargo near problem and not related to near-sdk-js. Please ask by creating an issue here: https://github.com/near/cargo-near

ailisp avatar May 10 '24 08:05 ailisp