bnb-chain / greenfield-js-sdk

JS SDK for Greenfield

Home Page:https://docs.bnbchain.org/greenfield-js-sdk/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Weird behaviour for downloadFile

AndrewChupin opened this issue · comments

I have store "open-store" with some files there, I can get info for such files, but when I'm trying to download it I get an error.
Actually all operations with "authType" or "privateKey" is failing.
I've changed private key, just for you to understand format.

Client info:

    const client = Client.create(
        "https://gnfd-testnet-fullnode-tendermint-us.bnbchain.org:443",
        "greenfield_5600-1",
    );

Code:
image

Error:
image

commented

object.downloadFile is for use in the browser.

If you want to download file on Nodejs, you can use client.object.getObject.

ref: https://docs.bnbchain.org/greenfield-docs/docs/tutorials/dapp/js-file-management/overview/#41-download-object

Screenshot 2024-01-23 at 11 43 07

What should be the private key format??

I've tried with 0x, but it also isn't working. I used same format in ./gnfd-cmd and downloaded this file with same PK

Added 0x one more time and now it works, thanks