bee-js

Javascript client library for connecting to Bee decentralised storage

BSD-3-CLAUSE License

Downloads
6.2K
Stars
60
Committers
15
bee-js - @ethersphere/bee-js v1.0.0

Published by bee-worker over 3 years ago

This release bumps the supported Bee version to 1.0.0, which marks the mainnet launch of the project.

Miscellaneous Chores

bee-js - @ethersphere/bee-js v0.12.0

Published by bee-worker over 3 years ago

This is a compatibility release for the Bee 1.0.0-rc2. It also handles extended postage stamp information.

⚠ BREAKING CHANGES

  • use string instead of bigint (#345)

Features

  • add folder and collection size check utility functions (#349) (f289c81)
  • extend PostageBatch type and creation with new properties (#350) (7695e27)

Bug Fixes

Code Refactoring

bee-js - @ethersphere/bee-js v0.11.0

Published by bee-worker over 3 years ago

This release mainly brings internal improvements as we have attacked head-on our backlog with outstanding issues. But several changes introduce breaking changes so be aware and continue reading on!

🔎 Input validation

We implemented thorough input validation to catch problems even before sending requests to Bee and give better errors on what is wrong.

⚠ BREAKING CHANGES

  • Methods Bee.pin(), Bee.unpin(), Bee.pssSend() now return Promise<void> (#342)
  • Methods Bee.setJsonFeed(), SocWriter.upload(), FeedWriter.upload() now return directly the reference hash (string) instead of it being wrapped in object (#341)
  • The new input validation might require more thorough types specification

Features

Reverts

Code Refactoring

  • no generic BeeResponse returned from Bee class (#342) (d2a65ee)
  • no single-property object returned (#341) (572253c)

bee-js - @ethersphere/bee-js v0.10.0

Published by bee-worker over 3 years ago

We would like to introduce you to a new release that brings access to other new features of 0.6.0 Bee release and several other improvements. This version is compatible with 0.6.2 version of Bee.

⁉️ Improved error reporting

Until now most returned Errors contained very limited information on what actually went wrong as most of the problems originated directly from the Bee node. We improved our internal handling of these errors and now if Bee returns the reason for the error we pass it along with our thrown errors.

⛓ New endpoints

We have included support for the new Bee Debug's endpoints that exposes chain state with BeeDebug.getChainState() (/chainstate) and reserve state BeeDebug.getReserveState() (/reservestate).

♻️ Reupload support

Now you can re-upload content that you have locally pinned in your node to the network with Bee.reuploadPinnedData(). If the data is not pinned, then an error is thrown.

⛽️ Gas prices and limits for transactions

Now you can specify a gas price for methods that create transactions:

  • BeeDebug.cashoutLastCheque()
  • BeeDebug.depositTokens()
  • BeeDebug.withdrawTokens()

⚠ BREAKING CHANGES

  • Promise returning methods from now on never throw errors, but return rejected promise instead (#326)
  • BeeDebug.cashoutLastCheque() now directly returns the transaction hash as string and not object (#325)
  • BeeDebug.depositTokens() now directly returns the transaction hash as string and not object (#336)
  • BeeDebug.withdrawTokens() now directly returns the transaction hash as string and not object (#336)

Features

Bug Fixes

  • correctly return reject promise for promise returning fnc (#326) (d76ef2d)

bee-js - @ethersphere/bee-js v0.9.0

Published by bee-worker over 3 years ago

We would like to introduce you to this big release with many changes that follow the Bee's 0.6.0 release and is fully compatible with it. This release contains new features and breaking changes that depend on the new Bee version, so if you have not already read the Bee's release notes do so for a better understanding of changes!

💮 Postage Stamp support

One of the most significant changes in Bee is the support of Postage Stamps (read about them here). They are now required for all "write" operations like uploading files, writing to manifests, or sending PSS messages. You can now create a new postage batch with bee.createPostageBatch() method, but be aware this spends the Bee node's Ethereum and BZZ to create the batch with the on-chain transaction! Use with caution.

const bee = new Bee(...)

const batchId = await bee.createPostageBatch(10, 17) // example values
const reference = await bee.uploadData(batchId, 'Hello world')

📍 Pinning methods simplification

The new pinning API now doesn't distinguish between the underlying data structure, so you simply pin any type of content with one method bee.pin(reference) and unpin with bee.unpin(reference).

↺ Renaming and refactoring

Some endpoints were removed, and some properties renamed. We also used this opportunity to streamline our API. Please check breaking changes!


⚠️ BREAKING CHANGES

  • Removing bee.download*FromCollection method (#280)
  • Removed recursive flag from uploadFilesFromDirectory (#280)
  • Following methods are removed bee.pinFile(), bee.unpinFile(), bee.pinCollection() bee.unpinCollection(), bee.pinData(), bee.unpinData(), bee.pinChunk(), bee.unpinChunk(), bee. getChunkPinningStatus() (#293)
  • Following properties were converted from snake_case to camelCase (#301):
    • BeeDebug.getNodeAddresses(): public_key, pss_public_key
    • BeeDebug.getChequebookAddress(): chequebookaddress
    • BeeDebug.getAllSettlements(): total_received, total_sent

Features

Bug Fixes

  • if there are no postage stamps the getAllPostageBatch should return [] (#319) (82985d3)
  • last cheque peer response property case (#320) (c8f0cea)
  • shape of LastCashoutActionResponse for Bee 0.6.0 (#306) (d637379)
  • use bigint primitive (#287) (6e104dc)

Code Refactoring

bee-js - @ethersphere/bee-js v0.8.1

Published by bee-worker over 3 years ago

This is a small release that fixes two of our shortcomings. For details see below.

Bug Fixes

bee-js - @ethersphere/bee-js v0.8.0

Published by bee-worker over 3 years ago

☁️ High-level feed's API

We understand that the current Feed's API is rather a low level and to use it for simple tasks might be overwhelming. We designed high-level API, that works for JSON data (arrays, objects, etc.) in a very convenient way. See the example bellow:

await bee.setJsonFeed(
  'some cool arbitraty topic',
  { some: ['cool', { json: 'compatible' }, 'object']},
  { signer: '0x634fb5a872396d9693e5c9f9d7233cfa93f395c093371017ff44aa9ae6564cdd' }
)
const data = await bee.getJsonFeed(
  'some cool arbitraty topic',
  { signer: '0x634fb5a872396d9693e5c9f9d7233cfa93f395c093371017ff44aa9ae6564cdd' }
)
console.log(data)
// Prints: { some: ['cool', { json: 'compatible' }, 'object']}

⚠️ BigInt breaking change

JavaScript has limitations on how it can safely represent big numbers before floating errors come into the picture. Since the BZZ token has 16 decimal places we are able to safely represent only 0.9 BZZ which is not much. Because of this, we had to switch from using number to bigint type on money-related APIs that concerns balances, chequebook, and settlements.

⚙️ Internal refactors

As part of our internal code improvements, we have renamed all verify* functions into assert*. This mainly impacts BeeJS.Utils.Bytes namespace where for example verifyBytes was renamed to assertBytes. As part of this change also the order of parameters was changed and some return types as well. If you use TypeScript the changes should be caught by our typings, if you are using JavaScript please verify you are not using these functions or refactor your code appropriately.


⚠ BREAKING CHANGES

Features

Bug Fixes

Code Refactoring

bee-js - @ethersphere/bee-js v0.7.1

Published by bee-worker over 3 years ago

Bug Fixes

bee-js - @ethersphere/bee-js v0.7.0

Published by bee-worker over 3 years ago

⚠ BREAKING CHANGES

  • replaced getPssPublicKey with getNodeAddresses (#228)
  • isEthAddress to isHexEthAddress (#234)
  • hex string length support (#213)

Features

Bug Fixes

  • adding string type and assertions to Reference on API (#232) (3467e7d)

Code Refactoring

bee-js - @ethersphere/bee-js v0.6.0

Published by bee-worker over 3 years ago

⚠ BREAKING CHANGES

  • correct getChequebookBalance spelling (remove extra u) (#189)

Bug Fixes

  • no ethereum prefix for custom signers (#194) (2ee1eca)
  • pss: subscribe in browsers, removed readable in browsers (#180) (a88277d)
  • strip trailining slash in node url (#203) (8e81024)

Code Refactoring

  • correct getChequebookBalance spelling (remove extra u) (#189) (20efd70)
bee-js - bee-js v0.5.1

Published by vojtechsimetka over 3 years ago

Features

Bug Fixes


bee-js - bee-js v0.5.0

Published by bee-worker over 3 years ago

⚠ BREAKING CHANGES

  • breaking api changes (#105)

Features

Bug Fixes

Code Refactoring

bee-js - bee-js v0.4.2

Published by bee-worker over 3 years ago

Features

Bug Fixes

  • big file upload (#77) (a51e4a6), closes #75
  • collection upload with relative path (#73) (b8f5c90)
  • raise payment tolerance on tests (#64) (4c3043b)
  • remove postinstall (#74) (992a2de)
  • remove utf8-encoder package dependency (#82) (e5b9e12)
  • replace Buffer with Uint8Array so it's not used in browser (#84) (a59bcda)
  • upload collection with unicode filenames (#79) (c893e58)
  • websocket data buffer array typing (#89) (251a650)