Javascript client library for connecting to Bee decentralised storage
BSD-3-CLAUSE License
Published by bee-worker over 3 years ago
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.
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!
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)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.
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)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!
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)Published by bee-worker over 3 years ago
Published by bee-worker over 3 years ago
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.
Published by bee-worker over 3 years ago
Published by bee-worker over 3 years ago
getPssPublicKey
with getNodeAddresses
(#228)getPssPublicKey
with getNodeAddresses
(#228) (2932725)Published by bee-worker over 3 years ago
Published by vojtechsimetka over 3 years ago
BeeDebug
(#155) (fcfa547)Published by bee-worker over 3 years ago
Published by bee-worker over 3 years ago