NebulousLabs / skynet-js

A Javascript module made to simplify communication with Sia Skynet portals from the browser.
https://nebulouslabs.github.io/skynet-js/
MIT License
32 stars 12 forks source link

v2.1.1 uploadFile returning undefined #112

Closed Delivator closed 3 years ago

Delivator commented 4 years ago

Using the code from the SDK documentation

async function uploadExample() {
  try {
    const { skylink } = await client.uploadFile(file);
  } catch (error) {
    console.log(error)
  }
}

return undefined on successful upload

Delivator commented 4 years ago

Looks like it works with out the curly braces around skylink, eg.: const skylink = await client.uploadFile(file); So the documentation is just outdated.

mrcnski commented 3 years ago

Good catch, thanks 👍 Fixed