@ethersphere/bee-js
Advanced tools
Changelog
1.2.0 (2021-08-24)
This is mainly a compatibility release with Bee 1.1.0 release.
The Stamps API was moved to Debug API and on normal API it is now deprecated. Moreover, Bee provides more information on Debug API with for example batchTtl
that gives an estimation for how long the batch will be valid.
New Debug API was added that allows you to manage pending transactions and do things like:
Changelog
1.1.0 (2021-07-16)
This is a small incremental release that brings two new features.
If you need to know what exact HTTP requests bee-js
sends to Bee you can now register hooks for outgoing requests and incoming responses using Utils.Hooks
interface.
Be aware! These listeners listen to all outgoing bee-js
's requests/responses, so if you have multiple Bee
/BeeDebug
instances for different Bee nodes, than all requests will be forwarded to your callbacks!
With the 1.0
Bee release few new endpoints related to Tags were introduced that allows you to list, update and delete tags.
Changelog
0.12.0 (2021-06-17)
This is a compatibility release for the Bee 1.0.0-rc2. It also handles extended postage stamp information.
Changelog
0.11.0 (2021-06-09)
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!
We implemented thorough input validation to catch problems even before sending requests to Bee and give better errors on what is wrong.
Bee.pin()
, Bee.unpin()
, Bee.pssSend()
now return Promise<void>
(#342)Bee.setJsonFeed()
, SocWriter.upload()
, FeedWriter.upload()
now return directly the reference hash (string) instead of it being wrapped in object (#341)Changelog
0.10.0 (2021-06-01)
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.
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.
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
).
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.
Now you can specify a gas price for methods that create transactions:
BeeDebug.cashoutLastCheque()
BeeDebug.depositTokens()
BeeDebug.withdrawTokens()
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)Changelog
0.9.0 (2021-05-20)
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!
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')
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)
.
Some endpoints were removed, and some properties renamed. We also used this opportunity to streamline our API. Please check breaking changes!
bee.download*FromCollection
method (#280)recursive
flag from uploadFilesFromDirectory
(#280)bee.pinFile()
, bee.unpinFile()
, bee.pinCollection()
bee.unpinCollection()
, bee.pinData()
, bee.unpinData()
, bee.pinChunk()
, bee.unpinChunk()
, bee. getChunkPinningStatus()
(#293)BeeDebug.getNodeAddresses()
: public_key
, pss_public_key
BeeDebug.getChequebookAddress()
: chequebookaddress
BeeDebug.getAllSettlements()
: total_received
, total_sent
LastCashoutActionResponse
for Bee 0.6.0 (#306) (d637379)Changelog
0.8.0 (2021-04-19)
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 changeJavaScript 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.
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.