Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples are wrong #30

Open
soccerarenadev opened this issue Jul 7, 2022 · 0 comments
Open

Examples are wrong #30

soccerarenadev opened this issue Jul 7, 2022 · 0 comments

Comments

@soccerarenadev
Copy link

Examples in this section:
https://nftstorage.github.io/ucan.storage/#saving-and-loading-keypairs

Have some errors.

This line:
await fs.promises.writeFile(kp.export())
is missing an argument (outputFilename).

The function loadKeyPairFromFile gets this error:

/nft-storage-quickstart/node_modules/ucan-storage/src/encoding.js:38
      throw new SyntaxError(`Non-${name} character`)
            ^

SyntaxError: Non-base64pad character
    at decode (/nft-storage-quickstart/node_modules/ucan-storage/src/encoding.js:38:13)
    at Object.decode (/nft-storage-quickstart/node_modules/ucan-storage/src/encoding.js:123:14)
    at Function.fromExportedKey (nft-storage-quickstart/node_modules/ucan-storage/src/keypair.js:42:34)
    at loadKeyPairFromFile (/nft-storage-quickstart/test.mjs:22:20)
    at async /nft-storage-quickstart/test.mjs:64:10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant