Skip to content

Examples are wrong #30

@soccerarenadev

Description

@soccerarenadev

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions