Releases: ArweaveTeam/arweave-js
Drop NodeJS v16 Support
Maintenance Release
- fix tests with nodejs v20 LTS
- remove v16 support
- extra wallet generation tests
Potentially breaking fix
Patch includes:
- README edits
- New argument check for node-driver
hash
function.
Point 2 enforces not using strings in nodejs environments without type-checking (e.g. SW contracts).
Meaning: don’t allow string as data
argument for hash(data: Uint8Array, algorithm?: string): Promise<Uint8Array>;
This ensures both code portability for browser execution, and future proofing against arweave-js upgrading to use NodeJS Web Crypto API.
Fix error handling
This maintenance release closes 4 long standing open issues:
TypeError: Cannot read properties of undefined (reading 'replace')
occurred when no wallet was found tosign
transactions. We now do some jwk checks and close a logic opening which would result in anundefined
object being treated as a jwk object, and return a more meaningful error.arweave.api
now decodes retrieved text txs with specifiedcharset
in it's Content-Type header (as opposed to defaulting all text to UTF-8).- Throw an error when
getPrice
receives a bad response from the server. - Throw an error when
getTransactionAnchor
receives a bad response from the server.
v1.13.0
Arweave.init changes
- improved host detection
- clips off subdomain so that ArNS domains can use the gateway
Arweave.api
- expose web stream
v1.12.4
Release Notes
This update allows arweave-js to run in modern environments such as Chrome Extension Manifest V3.
Rationale: It seems like the industry is moving towards dropping the original XmlHttpRequest API in favour of Fetch API. Examples include the above browser extensions standard and web workers, which only support Fetch API.
Why not add a package like node-fetch
? To simplify, rather than adding more complications to our inherited code, but PRs welcome.
Added dependency
Fetch API. Available in all modern browsers. Available as standard since node v18+ (*opt-in experimental since node v16.5).
Removed dependencies
Axios, node:utils (polyfill)
*Notes for NodeJS v16.5 - v17
To run with node v16.5+, you need to specify the --experimental-fetch
flag in your app.
Examples
These can be added to your packages.json
start script, or Dockerfile entrypoint
node
node --experimental-fetch --no-warnings <your-app.js>
ts-node
NODE_OPTIONS='--experimental-fetch --no-warnings' ts-node experimental-fetch.ts <your-app.ts>
Update September 2023
- NodeJS 16 is generally being deprecated because concerns about SSL security updates.
- Announcement: https://nodejs.org/en/blog/announcements/nodejs16-eol?utm_content=263954443
1.9.1
Improved support for larger transactions.
1.8.0
Added support for chunked uploads
1.7.1
Version bump 1.7.1
1.7.0
Added support for v2 transaction format