mirror of
https://github.com/alexgo-io/stacks.js.git
synced 2026-04-29 09:45:50 +08:00
12 KiB
12 KiB
Changelog
All notable changes to the project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
[21.1.1] - 2020-08-24
Changed
- Persist etags in UserSession store so they don't always need to be fetched when the page is loaded.
[21.1.0] - 2020-06-05
Changed
- Static
storage/functions used byUserSessionare no longer globally exported, as they are wrapped by publicly accessibleUserSessionmethods. Functions that are no longer accesible aregetFileUrl,getFileContents,getFile,putFile,deleteFile, andlistFiles. - Removed various static functions that have been replaced by
UserSession. - Delete etags from cached
etagmap ondeleteFileso that new files with the same name can be subsequently created.
[21.0.0] - 2020-01-17
Added
- More Blockstack error codes.
putFileandencryptContentcan now optionally base64 encode data, for a ~33% size increase compared to the default hex encoding which has a 100% size increase.
Changed
putFileperforms client-side validation that data size is within the Gaia hub's reported maximum limit.- When a
stringvalue is passed toputFileand thecontentTypeoption is unspecified, it is set totext/plain; charset=UTF-8. getFilenow throws error on 404 instead of returning null.getFile,putFile,deleteFile,listfilesnow include error info upon failure.getFilecan now decrypt using a custom private key- Several cryptographic operations now use the native Web Crypto APIs when available. This primarily increases the performance of file encryption and decryption, and account seed phrase encryption and decryption.
- The following functions now return Promises:
handleSignedEncryptedContents,makeAuthResponse,encryptECIES,decryptECIES,encryptPrivateKey,decryptPrivateKey,encryptContent,decryptContent,aes256CbcEncrypt,aes256CbcDecrypt,hmacSha256. putfilenow prevents data corruption caused by race conditions by using etag values to verify that the client is updating the latest version of the file.putFilenow attempts to includeetagvalues in theIf-Matchheader of its request, and sets theIf-None-Matchheader to*if it is unaware of an etag for the file it is attempting to write.putFilenow returns anetagin addition to thepublicURLafter successfully writing a file.PreconditionFailedErrorthrown ifputFilereturns with a412response.
[19.4.0] - 2019-09-03
Changed
- Excluded unused bip39 wordlist from dist bundle, reducing bundle size.
[19.3.0] - 2019-08-21
Changed
- Fixed deprecated crypto warning in node.js usage.
handlePendingSignInnow throws an error when overwriting an existing user session. See issue #680- Updated jsontokens library to v2.
[19.2.2] - 2019-05-12
Changed
- Updated bitcoinjs-lib dependency to v5 and eliminates node-gyp errors on install
- Fixed bugs when running in a web worker
[19.2.0] - 2019-05-12
Added
- Method
deleteFile()is now implemented
Changed
- Fixed return type for BlockstackNetwork.getAccountTokens
- Property
manifestURIis now included in loaded manifest object - The
srcdirectory is now included in the npm package
[19.1.0] - 2019-03-29
Added
- Converted codebase to Typescript
- New
dist/blockstack.jsbundle with ES2015/ES6 support - `lib/**/*.js modules with Node v8.x support (ES2015/ES6 & CommonJS modules)
Changed
- Fixed protocol handler detection issues with modular usage of blockstack.js
[19.0.1] - 2019-03-12
Added
- New function
getFileUrl()will return a URL for reading a particular file from an applications' Gaia bucket.
Changed
- Fixed the email authentication scope
- Fixed multiple bugs with
redirectToSignIn()andmakeAuthRequest()
[19.0.0] - 2019-02-21
Added
- Moved common user session related functions into
UserSession. Session configuration is done through AppConfig objects. This change removes the library's dependency on browser environments. - List of functions moved: redirectToSignIn(), isUserSignedIn(), isSignInPending(), handlePendingSignIn(), loadUserData(), signUserOut(), getFile(), putFile(), encryptContent(), decryptContent(), listfile(), deleteFile()
- The public API will remain backward compatible until a future release.
Changed
loadUserData()now throws an error instead of returning null if no signed in user session is detected
[18.3.0] - 2019-01-29
Changed
- New method for auth protocol handler detection. This should fix sign in flows for most major web browsers and operating systems with both the native browser installed and not installed.
- NOTE: If you're using this version of blockstack.js with an old version of the native browser, the app will (1) open an auth handler in the native browser and (2) also redirect the original tab to browser.blockstack.org.
[18.2.1] - 2019-01-08
Added
- Added automatic retry logic to
putFilein the case of a failed storage call. This might be the case if there have been any token revokations. This new logic will catch the first failed write, construct (and cache) a new Gaia token, and then attempt the write again. This allows tokens to be revoked without any hiccups from a user experience standpoint.
[18.2.0] - 2018-12-20
Added
- Added an extra parameter to
makeAuthRequest, calledextraParams. This is a wildcard object, and all keys and values included in this argument will be included in thepayloadof anauthRequest. authRequestversion bumped to1.3.1from1.3.0.
[18.1.0] - 2018-10-24
Added
- The
BlockstackWalletclass inblockstack.jssupports generating private keys and addresses within the hierarchical derivation scheme used by the Blockstack Browser and supported by the Blockstack ecosystem. - A
listFilesfunction allows an application to list files in its Gaia storage bucket. - In the transaction generation library, the makeTX functions now take an optional 'buildIncomplete' argument, allowing you to get a serialized transaction which hasn't been fully signed yet.
- A
blockstackAPIUrlfield to the authentication response token that overrides the default inblockstack.config.networkallowing the user to specify their own Blockstack Core node. - A
gaiaAssociationTokenfield to the authentication response token which enables users to run private Gaia hubs without authorization each application address. - An option
contentTypeto theputFileoptionsobject that sets the Content-Type header for unencrypted data. Thanks to @muneebm for this!
Changed
- Fixed a bug in version checking during the authentication process that manifested itself when signing in with apps using very old versions of blockstack.js.
- Default redirect URI changed from origin plus trailing slash to the
origin. For example, app with origin
https://example.comdefault redirect URI which was previouslyhttps://example.com/is nowhttps://example.com. - Fixed a couple bugs in the transaction generation, networking code. First, coerce address now correctly coerces P2SH addresses. Second, bitcoinjs-lib recently switched to defaulting to version 2 transactions, which breaks our interoperability with a handful of other libraries. Finally, with this comes a little bit of refactoring, to reduce the repeated code in the transaction libraries.
- Increments the authentication process version to 1.3 in a backwards compatible change.
- When using the bitcoind client in development networks,
track which addresses we've already called
importaddresswith and do not retry.
[18.0.4] - 2018-08-06
Changed
- Resolve unsupported protocol error by redirecting to hosted authenticator on all mobile devices
[18.0.3] - 2018-08-01
Changed
- Resolve unsupported protocol error by redirecting to hosted authenticator on iOS
[18.0.2] - 2018-07-27
Changed
- Update
bitcoinjs-libto version 4.0.0.
[18.0.1] - 2018-07-27
Changed
- Switched from
cross-fetchtocross-fetch/polyfillto fix a bug that caused network requests to fail in node environments
[18.0.0]
Added
- Support for
verifyandsignkeywords ingetFileandputFilerespectively. This enables support for ECDSA signatures on SHA256 hashes in the storage operations, and works for encrypted and unencrypted files, in addition to multi-player reads (for unencrypted files). - New
TransactionSignerinterface to allow for different signing agents in thetransactionsfunctions (e.g., makePreorder). putFilecan now optionally take the public key for which you want to encrypt the file. Thanks to @bodymindarts for this!handlePendingSignInnow acceptstransitKeyas an optional 3rd parameter. This enables support for more complex sign in flows.
Changed
- The gaia hub connection functions now use a JWT for authentication,
the "v1" gaia authentication token. This is not a backwards
compatible change-- an app using this version of
blockstack.jswill refuse to downgrade to the old protocol version unless the old gaia authentication provides a very specific challenge text matching the normal gaia hub challenge text. encryptContentnow takes a public key instead of a private key to encrypt content for other users.- The validateProofs() method now handles errors in proof-checking more seamlessly, properly catching failed promises. Previous error cases which resulted in uncaught exception warnings and null responses should now behave correctly.
handlePendingSignInnow takes a second parameter which is the signed authentication response token. Thanks to @muneebm for this!- Fixed an issue in
ecPairToHexStringthat may result in generation of an incorrectly hex string encoding of the private key. - Proofs now support subdomains.
- Updated a number of dependencies to fix know vulnerablities.
- Switched from isomorphic-fetch to the better maintained cross-fetch which will improve functionality of the library in node environments.
[17.2.0]
Added
encryptContentanddecryptContentmethods for encrypting strings and buffers with specific keys, or by default, the appPrivateKey. Thanks to @nikkolasg and @nivas8292 for PRs on this work.- Functions in
transactionsto support namespace creation (NAMESPACE_PREORDER,NAMESPACE_REVEAL,NAMESPACE_IMPORT,ANNOUNCE, andNAMESPACE_READY). Thanks @jcnelson. - Support for
NAME_REVOKEtransactions. Thanks @jcnelson. transactions.AmountTypeFlow union type that captures both the type of JSON response from the stable/v1/prices/*RESTful endpoints on Blockstack Core, as well as the upcoming/v2/prices/*endpoints.- Support for setting
blockstack.jslogLevels viaconfig.logLevel. Supports strings:['debug', 'info', 'warn', 'error', 'none']and defaults todebug. If you do not wantblockstack.jsto print anything toconsole.log, use'none'. Thanks @hstove.
Changed
- Modified the transaction builders in
transactions.jsto accept a new flow typetransactions.AmountTypefor the price of a name or namespace. This makes them forwards-compatible with the next stable release of Blockstack Core. - Added inline documentation on the wire formats of all transactions.
Fixed
- Update to proof URLs for instagram proofs. Thanks @cponeill.
- Fixes to several safety checks. Thanks @jcnelson.
- Fixed error handling in proof validation -- several errors which would cause uncaught promise rejections now are handled correctly.
- Improved error handling in authentication -- if a user tries to sign in with an application is a different browser context, rather than experiencing a 'Key must be less than curve order' error, the authentication fails.