Skip to content

@ethersphere/bee-js v0.8.0

Compare
Choose a tag to compare
@bee-worker bee-worker released this 19 Apr 15:19
8087a81

☁️ 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