Files
Aaron Cox c13fc2e32f 0.3.0 - Release (#27)
* Generalized the abiProvider on a Session/TransactContext

It was very specifically acting as an ABICache instance, but the session kit shouldn't need it to be a cache. The developer establishing the session should be able to make that decision on how ABIs are fetched.

* Basic UI interface for the browser implementation to use

* Fixed bundle build

* Resolved issue where LoginOptions weren't setting the permission

* Added onTransact and onTransactResult as UI event triggers

* Added bundled build for unpkg

* Removed unpkg build steps

* Added WalletPluginConfig and WalletPluginMetadata

These interfaces are used to help dictate how the WalletPlugin behaves and what is shown in the UserInterface.

* Added appName options to the Session

* Added istanbul ignores to lifted code from ESR

* Major rewrite of the login method and its interactions with the UI

* Remove failing test against fetch

* Added cjs build back in

* Adjusting types and modifiers for plugin implementations

* Migrated WalletPluginPrivateKey to standalone repo

* Formatting

* Added rollup-plugin-cleanup to clear comments from build

Decided against a terser since we still want code to be readable for developers who are debugging, but the comments aren't exactly needed. Developers in their own applications should handle tersing the code in their production builds.

* Pass on adding more comments for typedoc

* Split arguments and options for Session constructor (#30)

This change moves the required parameters into the SessionArgs as the first value of the constructor, and then moves all optional values as SessionArgs into the 2nd parameter of the constructor.

The goal is to make it easier to understand which values are required and which values are optional when manually creating a Session.

* Forcing everything up to 0.6.8

* Following new constructor patterns

1st - subject matter of the call (if specific)
2nd - context (if exists)
3rd - options (if exists)

* Removed context from options

* Adding chain to TransactContext

* Cleanup

* Very generic prompt code

* Upgraded privatekey plugin for tests

* UI: Added countdown element type and made body optional

* Reworked login to match UI selections

* Mock the onError event

* Added supportedChains parameter

* SessionKit now optionally accepts `allowModify`

* [BREAKING] Changed WalletPlugin.sign() response format

The response from the `sign` method of the WalletPlugin has been modified from a Signature to an object. This allows the WalletPlugin to modify the transaction as long as the `allowModify` flag allows it.

* Added SessionStorage interface and BrowserLocalStorage implementation

* Wrapping the transact call in a try/catch block for error handling

* Fixing unit tests w/ dep upgrade

* Formatting for typedoc

* Initial storage and restore methods

* Test cleanup

* Split storage into its own file

* Split login into its own file

* Split wallet into its own file

* Split ui into its own file

* Reworked walletPlugin serialization

Extending the abstract class now gives the individual WalletPlugin the serialization method.

* Updating wallet-plugin-privatekey for tests

* Reworked login user interaction flow

The previous iteration of the user interaction flow did not allow for flexibility in changing menus. The interface was unable to go back and forth between the wallet, chain, and permission selection steps. This delegates all of those events to the user interface itself and all values are returned at once to pass to the selected wallet plugin.

* Updated dev dependencies

* Removed default UserInterface and UserInterfaceHeadless

The requirement to have a `ui` element has been removed, and all attempts to use the `ui` are now conditional based on it existing. The `login` method of the SessionKit now checks to make sure it exists before attempting to log a user in.

* Added restore, logout, persistSession, and getSessions to Kit

* Automatically flip the `allowModify` flag to false after the first signature

This will prevent either the wallet or other plugins from modifying the transaction and invalidating any future signatures.

* Updated core

* Set broadcast to false on all ESR payloads

* Updating test data since ESR payload was modified.

* Always resolve requests to the chain for this session.

* Reworking wallet serialization and data storage

* Adding new accounts and reworking for new session constructor

* Updating private key plugin for tests

* Utilize cancelable promises for the UI prompt call

* fix: making UI login response fields optional

* Add the createRequest method to the TransactContext

* Fixed mock context

* Set a flag on Cancelable promises to allow them to be silent

* Adding appName to login context

* Allow void responses from TransactHook calls

* Pass TransactResult to the afterBroadcast hooks

* Add an optional ExplorerDefinition for each ChainDefinition

* Adding close element and renaming button to link

* Filter out unknown wallets from getSessions

* Add appName to TransactContext

* Adding base esrOptions to LoginContext

* Reworked events and added a few additional points to interact

* Removed the remaining status calls

* Moved all variable/flag definitions to the top of the transact call

* Localization support for UserInterface implementations.

* Allow passing a WalletPlugin ID to Login to select automatically

* Add onSign events to transact flow

* Allow translations from a WalletPlugin

* Create a type for the translate function on the UI

* Version 0.3.0

---------

Co-authored-by: dafuga <danielfugere28@gmail.com>
2023-03-03 12:19:26 -05:00

30 lines
1.6 KiB
Plaintext

Copyright (c) 2023 Greymass Inc. All Rights Reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistribution of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistribution in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.
YOU ACKNOWLEDGE THAT THIS SOFTWARE IS NOT DESIGNED, LICENSED OR INTENDED FOR USE
IN THE DESIGN, CONSTRUCTION, OPERATION OR MAINTENANCE OF ANY MILITARY FACILITY.