eosapi icon indicating copy to clipboard operation
eosapi copied to clipboard

abi_json_to_bin deprecation

Open Bes0n opened this issue 2 years ago • 1 comments

abi_json_to_bin has been deprecated - https://eosnetwork.com/blog/leap-v3-1-release-features/#29-abi-conversion-apis-are-deprecated

Hence it's not possible to use following function

    def abi_json_to_bin(self, code: str, action: str, args: Dict) -> bytes:
        url = self.rpc_host + "/v1/chain/abi_json_to_bin"
        post_data = {
            "code": code,
            "action": action,
            "args": args,
        }
        resp = self.post(url, post_data)
        binargs = resp.json().get("binargs")
        if binargs is None:
            raise NodeException("eos node error, not find binargs", resp)
        return bytes.fromhex(binargs)

If you curl the path you're getting following error:

$ curl https://waxapi.ledgerwise.io/v1/chain/abi_json_to_bin
{"code":404,"message":"Not Found","error":{"code":0,"name":"exception","what":"unspecified","details":[{"message":"Unknown Endpoint","file":"beast_http_session.hpp","line_number":204,"method":"handle_request"}]}}

Bes0n avatar Jan 19 '24 19:01 Bes0n

Hi!

The issue arises because the abi_json_to_bin API has been deprecated and removed starting from LEAP 3.1, which caused problems when calling /v1/chain/abi_json_to_bin.

To resolve this, I used the third-party library antelopy, which provides the necessary functionality for working with ABI and converting ABI from JSON to binary format.

Here’s the link to my fork with the fix: alsekaram/eosapi_async.

I recommend updating to this version to avoid the issue.

alsekaram avatar Sep 15 '24 13:09 alsekaram