Releases: ethersphere/bee-js
@ethersphere/bee-js v0.9.0
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 fromuploadFilesFromDirectory
(#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
- gas price for postage batch creation (#312) (7e47e09)
- limit postage depth (#318) (e9a4758)
- postage stamp support (#290) (da50ad6)
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
@ethersphere/bee-js v0.8.1
@ethersphere/bee-js v0.8.0
☁️ 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
- enable setting default headers (#271) (21d63e3)
- expose pinning functions (#262) (8a4274e)
- high-level json feed api (#246) (4b22563)
Bug Fixes
Code Refactoring
@ethersphere/bee-js v0.7.1
@ethersphere/bee-js v0.7.0
⚠ BREAKING CHANGES
- replaced
getPssPublicKey
withgetNodeAddresses
(#228) - isEthAddress to isHexEthAddress (#234)
- hex string length support (#213)
Features
- add supported bee version to package.json (#240) (7bc26e5)
- data helpers for downloaded bytes (#219) (3af3826)
- default signer on bee instance (#224) (de46e8f)
- ethereum wallet signer utility (#230) (94bc9f4)
- expose external types (#235) (5c1ddac)
- hex string length support (#213) (53a2c25)
- improved signer interface and validation (#223) (769476d)
- missing endpoints on Bee and BeeDebug class (#207) (bad1cae)
- replaced
getPssPublicKey
withgetNodeAddresses
(#228) (2932725)
Bug Fixes
Code Refactoring
@ethersphere/bee-js v0.6.0
bee-js v0.5.1
Features
- axios options (#134) (6e5fb05)
- eth utils for PSS (#149) (7cbe2ee)
- expose the getPeers function on
BeeDebug
(#155) (fcfa547) - expose types for BeeDebug (#158) (1f3051e)
- exposing soc interface (#147) (7897163)
- feed interface (#136) (021af95)
- feeds endpoint (#125) (6b0a59b)
Bug Fixes
- bee.sh (#131) (113b66c)
- bump elliptic version to 6.5.4 (#142) (d6ac8b0)
- release 0.5.1 (#145) (b0a2168)
- remove automatic content-type header on file upload (#139) (393d068), closes #138
bee-js v0.5.0
⚠ BREAKING CHANGES
- breaking api changes (#105)
Features
- balance, chequebook and settlements endpoint on BeeDebug (#101) (7a77050)
- balances and consumed endpoint (#96) (162e9b3)
- chequebook api (#97) (f7b77f4)
- export utils and types (#123) (fb1ed72)
- settlements endpoints (#98) (892ce1b)
- uploadFile support for File type (#93) (02202e9)
Bug Fixes
- missing content-disposition causes failure (#116) (2c85db0)
- typescript configuration (#120) (e665107)
Code Refactoring
bee-js v0.4.2
Features
- Bee class functionality with error handling (#15) (038f013)
- bmt hasher (#65) (5cac9b2)
- bytes module (#50) (9ec08bd)
- chunk API module (#60) (110b092)
- module collection (#28) (e4ed0bd)
- pinning for files and collections (#45) (c6fcc21)
- pss send and subscribe (#49) (c0b2ac1)
- repo setup, adds tag and file api wrapper (#1) (d1d1484)
- single owner chunks (#69) (e152206)
- tar upload in the browser (#35) (4787428)
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)