Skip to content

Releases: AmbireTech/ambire-common

v1.0.19

07 Aug 14:17
f71fd40
Compare
Choose a tag to compare

Changelog:

  • Add: Extension invite code in wallet rewards data

v2.18.0

31 Jul 14:15
42492c8
Compare
Choose a tag to compare
v2.18.0 Pre-release
Pre-release

Changelog:

  • Added: Basic NFT simulation diffs #893
  • Fixed: Prevent invoking updateAccountState twice when reloading the selected account, as it results in a withStatus error, indicating that an action has already been invoked #907
  • Fixed: Failing portolio tests #910
  • Fixed: Simulation gone on portfolio reload (Basic Account) #911

Full Changelog: v2.17.0...v2.18.0

v1.0.18

29 Jul 12:27
8adf125
Compare
Choose a tag to compare

Changelog:

  • Update paraswap router for humanizer

v2.17.0

25 Jul 13:31
003ea72
Compare
Choose a tag to compare
v2.17.0 Pre-release
Pre-release

Changelog:

  • Added: Portfolio lib error swallow test #889
  • Changed: Allow concurrent actions for some methods in accounts ctrl (because the actions may happen in very close succession during import) #877
  • Changed: Require all prerequisites needed in the Sign Message controller and improve the controller tests #880
    • Fixed: Require all prerequisites when initiating the controller (Accounts controller to have been loaded) and when signing (to have pulled at least once an account state for the network on which a sign message request gets received).
    • Change: Initiate a real AccountsController (instead of a dummy one) for the unit tests
    • Change: Migrate the pattern for writing tests to the one proposed here: AmbireTech/ambire-app#2454
  • Changed: Set only one network for continuous state updates after broadcasting an account op #876
  • Changed: Remove fallback error notes for the broadcast transaction flow #890
  • Changed: Humanizer: Delete some internal reliance on humanizerMeta #882
  • Changed: Humanizer: disable splitting and squashing calls #895
  • Changed: Move initiating an account adder with Ledger flow in the Main controller #897
  • Changed: Enhance errors thrown by Trezor #891
  • Changed: Portfolio block number for portfolio view #836
    • Changed: Update the portfolioView helper to compare latest and pending by blockNumber, in case we dont have signAccountOp active - in this case we always use pending state. Otherwise - get the pending state in case is newer than latest.
  • Fixed: Learned tokens: Remove non-ERC20s (by introducing a Self-cleaning mechanism for removing non-ERC20 items from the learned tokens) #879
  • Fixed: Taking gas price #875
    • Fixed: When broadcasting, take the gas price directly from gasFeePayment
    • Fixed: Adjust the RBF so it increases gas price, not amount
  • Fixed: React to incorrect user op nonce #881
  • Fixed: Sign message corner case when even after a force update the account state is still missing #885
  • Fixed: Remove onSignSuccess passing networks #883
  • Fixed: Filter out native erc20 representations #887
    • Fixed: Filter out native ERC20 representations from Portfolio, but allow them to be added as custom tokens.
    • Fixed: Refactor tokenFilter function to be a pure boolean filter. Instead of introducing side effects and mutating the token item by setting the isHidden flag, the tokenFilter function will now return a boolean value. The TokenResult[] array will be processed using reduce instead of filter since we are performing two actions: filtering tokens and mutating data.
    • Fixed: In PortfolioController, use the result of processTokens for setting both result.tokens: processedTokens and result.total: getTotal(processedTokens). Previously, for the total, we were passing the PortfolioLib result, not the already filtered tokens. It was working because of the isHidden mutation we were applying, but with the current changes, adding a new filtration rule would break the total calculations.
    • Added: Unit tests.* Bug / Persist the already imported account preferences on account re-import by @superKalo in #886
  • Fixed: 4337 gas price updates (gas prices were not updated every 12s on erc-4337 broadcast as they happened during estimation (which now happens once every 60s)) #867
    • introduce bundlerGasPrices that are fetched along with normal gas prices if the network is a 4337 one
    • if the estimation succeeds in estimating an ERC-4337 UserOp, update the gas prices by using the bundlerGasPrices
    • if the estimation does NOT succeed in estimating an ERC-4337 UserOp, update the gas prices by using our standard gas price mechanism
    • if supported, re-enable 4337 on a custom network. In the past, we used only 4337 and that was a problem as if the bundler fails, the user is stuck. Now we have EOA broadcast so re-enabling 4337 just gives more options to the user
  • Fixed: Estimate gas fallback (a state override fallback to estimateGas() that gets triggered if estimateGas returns insufficient funds when estimating with SA) #888
  • Fixed: rpc-down banners duplicate id #894
  • Fixed: Missing files and folders to .eslintignore #898
  • Fixed: Find activity by id could be string or number, handle both cases #901
  • Fixed: Duplicated TypeScript type was breaking the E2E tests #903
  • Fixed: Add WETH as a fee token on Aptimism and Arbitrum #902
  • Fixed: Pending actions order #896
  • Misc: Basic NFT simulation diffs were merged #874, than reverted #892 and moved to #893

Full Changelog: v2.16.0...v2.17.0

v2.16.0

15 Jul 14:55
55ba19c
Compare
Choose a tag to compare
v2.16.0 Pre-release
Pre-release

Changelog:

  • Added: Claim Wallet Rewards (sign account op function in transfer helpers to claim wallet rewards) #850
  • Added: Remove account #793 and #859
    • Add: removeAccount method to the main ctrl which calls the method removeAccountData on all sub-controllers.
    • Add: removeAccountData method to relevant sub-controllers
    • Change: Reduced repetition in activity.test.ts
  • Added: Humanizer modules #852
    • Basic socket/bungee module
    • Squash wrap topup for native
    • Properly squash uniswap's swaps and send in one multicall, but not from separate calls
  • Added: Learn new tokens from trace call #840
    • abstract getAccountOpsForSimulation
    • return a boolean on learnTokens indicating whether they have learned something new or not
    • implement debug_traceCall: 1) the original call for EOA 2) wrapping the calls into execute/deployAndExecute for SA 3) using state override where possible for giving funds to the broadcasting account so it doesn't break with insufficient funds 4) calling getBalances at the end to figure out which addresses are tokens
    • pass the tokens from debug_traceCall to learnTokens. If something new has been learned, update the portfolio along with the pending state
  • Added: RBF 🎉 #831
    • when 15 minutes pass and the txn is still BroadcastButNotConfirmed, switch it to BroadcastButStuck. Before, it was switched to Rejected
    • create a getNotConfirmedOpIfAny in activity.ts. For SA, it checks the last BroadcastButNotConfirmed/BroadcastButStuck txn's nonce and compares. For EOAs, it gets all the BroadcastButNotConfirmed/BroadcastButStuck txns for the EOA + all the SA as the EOA could've broadcast a txn there. It returns the op with the highest nonce
    • it disregards 4337 broadcasts as they shouldn't have an RBF (bundler should always broadcast)
    • in the case of RBF, in signAccountOp.ts it uses the gas estimation from the stuck account op increased by 12.5% OR the new estimation, whichever is higher
    • upon broadcast, if the broadcast fails with "replacement fee too low", the signedAccountOp's gas fee payment is taken, increased by 12.5% and used for estimation IF the provided estimation from estimate.ts is lower than it. This repeats until a successful broadcast
  • Added: Wrap native gas tank #833
    • add Calls as a separate action and handle it
    • when doing a native token top up, do a wrap before it
  • Added: Humanizer type 'message' for hex messages #870
  • Changed: Improve UX when there is a slow or not working RPC #827
  • Changed: Sign message flow improvements by moving logic to the Main controller (that gets executed in the background) #851 and #857
    • Changed: Improve the sign message flow by moving to the Main controller (background) the logic that signs and then "broadcasts" the signed message. Previously this logic was triggered by the extension front-end (on controller update), which we agreed is not a reliable pattern.
    • Changed: Prioritize to resolve the successfully signed message quicker and then add it to the Activity controller later.
    • Changed: Migrate the sign message method to the withStatus wrapper (for more consistent status and error handling).
    • Fixed: Sign message flow was misleadingly re-using the broadcastStatus used for the Account Op broadcasting flow.
  • Changed: Shorten unknown custom error message: #865
  • Changed: Improve portfolio related UX when an RPC is down (Fixes 1, 2 and 4 from AmbireTech/ambire-app#2434) #855
  • Changed: Do not show nonce discrepancy error #868
  • Changed: Temporary skip ud reverse lookup test in domains.test.ts #871
  • Changed: Reject all requests except sign-account-op on window close #862
  • Changed: Sign (and broadcast) account op flow improvements #861
    • Added: Expose the fee payer key during the account op broadcast (that temporarily gets automatically selected to be the key with the same type as the signing key or the first key available).
    • Changed: Migrate the Main controller broadcastAccountOp method to the withStatus wrapper (for more consistent status and error handling).
    • Changed: Improve the broadcast signed account op flow by introducing handleSignAccountOp (similar to the handleSignMessage) instead of listening on controller update.
    • Change: Improve a bit the broadcast error messages (shorten the account or key addresses, add a generic contact support to the ones that have not, tweak the wording a bit for some)
  • Changed: Silence the "Please wait for the completion of the previous action..." warn in production #873
  • Fixed: Eslint not working with node_modules installed (when ambire-common is used as a submodule, not standalone) #854
  • Fixed: Account Adder controller issue when adding accounts and figuring out which are the new ones #853
  • Fixed: Selecting a default account after adding new accounts was not working after you add your first account #860
  • Fixed: Remove fallback typed message humanizer module as it appears buggy #863
  • Fixed: Re-estimate on nonce discrepancy #858
    • on nonce discrepancy, re-estimate immediately;
    • only dispatch a call for portfolio update only if we've really learned a new token
  • Fixed: Estimation nonce #864
    • when Estimation.sol returns an error, do not return a -1 subtracted nonce;
    • use the nonce from the estimation only if it is bigger than the one in the account state
  • Fixed: None state-override RPCs (if state override is not supported by the network, do not perform simulation; also, get the balances in a way that doesn't break the portfolio) #824
  • Fixed: Verifying messages with state override only when supported #849
  • Fixed: Add guard for data === null in txn requests #856
  • Fixed: Forever pending dApp request if account state is missing #866
  • Fixed: All providers marked as !isWorking on updateAccountState call #869
  • Fixed: When a dApp requested to connect and the extension was not yet initialized, the request would hang in the wallet without providing a proper response to the dApp #878

Full Changelog: v2.15.1...v2.16.0

v2.15.1

03 Jul 12:28
71b86b7
Compare
Choose a tag to compare
v2.15.1 Pre-release
Pre-release

Changelog:

  • Changed: Update error message for wrong signer requested on signing #848
  • Fixed: Sign EP authorization only once #847

Full Changelog: v2.15.0...v2.15.1

v2.15.0

03 Jul 08:06
a6bfa3b
Compare
Choose a tag to compare
v2.15.0 Pre-release
Pre-release

Changelog:

  • Add: BroadcastButStuck transaction status (after a quarter passes, set the txn status to "BroadcastButStuck" instead of "Failure") #835
  • Added: Errors on wrong signer requested by dapp for signing #845
  • Fixed: Portfolio updates, when to do a SignAccountOp destroy, additional hints in simulation #838
    • Fixed: additionalHints not caught in simulation sometimes so make the comparison lower case;
    • Fixed: limit portfolio updates to the current network on sign account op interactions;
    • Fixed: destroy the sign account op on reject (on reject there was a case where destroy was not fired)
  • Fixed: SA estimateGas not deployed (when doing a smart account estimateGas, if the account is not deployed, do a deployAndExecute estimation) #839
  • Fixed: Humanizer: bug fixes #837
    • Support refundETH and exactInputSingle and unknown calls
    • fix swap/wrap reducer to preserve extra humanization elements when squashing
    • fix tests
    • fix recipient to not be displayed in cases of recipient = address(0) or address(1)
  • Fixed: Custom RPC providers for networks supported by default aren't persisted after extension reload #842
  • Fixed: Wrong banner (pending dApp requests) when Benzin is opened #843
  • Fixed: Account Adder inconsistent (occasionally failing) test #844
  • Fixed: Return back from EstimationError #846

Full Changelog: v2.14.0...v2.15.0

v2.14.0

26 Jun 14:43
1f7516a
Compare
Choose a tag to compare
v2.14.0 Pre-release
Pre-release

Changelog:

  • Added: Entry point 0.7.0 🎉 #749
  • Added: New action toast message (on action-window open) #783
  • Added: Humanizer modules: curve, trader joe, across, kyberswap, 1inch #819
  • Added: Add extra networks as consts for the deployed benzin humanization #832
  • Changed: Refactoring Accounts #817 and #829
    • Added a required key preferences to the Account interface
    • Introduced a new AccountsController that combines and encapsulates the common logic for accounts from the MainController and
    • SettingsController
    • Expose the forceEmitUpdate method publicly for each class, allowing it to be called externally
  • Changed: Improvements for the updateSelectedAccount mechanism #826
    • Add AccountsController to the PortfolioController as a prop when constructing
    • Remove the accounts prop from updateSelectedAccount in favor of getting it from the accounts ctrl directly in the portfolio
    • portfolio tests code optimizations
  • Changed: Humanizer: file structure improvements #818
    • Move all humanizer module tests to their respective folder.
    • Fix dependency cycles
    • Improving readability/modularity
  • Changed: Environment variables changes #823
    • Get VELCRO_URL from env or tests/config
    • Get relayerUrl in tests from tests/config.
  • Changed: Improve simulations #825
    • Simulate only for the currently active accountOp for Basic Accounts
    • Remove redundant FE code from common and move to ambire-app
    • Fix: account in dApps does not change on accountSelect
    • Improve simulation calculations in portfolio
  • Fixed: Portfolio controller race conditions ⚡ #808
    • Fix: Implement a queue to prevent race conditions when calling updateSelectedAccount. All calls are queued by network and account. Each time updateSelectedAccount is invoked to update the latest or pending state, the call is added to the queue. If a previous call is still running, the new call will be queued and executed only after the first one completes, regardless of whether it succeeds or fails. Before implementing this queue, multiple updateSelectedAccount calls made in a short period of time could cause the response of the latest call to be overwritten by a slower previous call.
    • Add a Jest test to ensure that the portfolio controller queue's logic chains the requests in order.
    • Change: Pull out updatePortfolioState as a controller method, instead of an inner function of updateSelectedAccount, for better readability.
    • Document how we should refactor portfolio force updates and apply account ops intent optimization once we implement issue #2335.
    • Ensure the queue doesn't result in a memory leak. What's the difference between this article (https://cribl.io/blog/promise-chaining-memory-leak/) and our implementation? First of all, our portfolio method will always resolve, so we can't end up in a promise chain waiting for the first promise to resolve. Second, in the article, they are creating a recursive queue—if the promise doesn't resolve, they add the same method again to be invoked, and they do this for hundreds of calls. In our case, we don't have recursion. We simply chain the next portfolio update and don't retry the same method if it fails.
  • Fixed: Portfolio additional assigning criticalError on an empty error object (causing a glitch that the extension shows that the gas tank and rewards networks are not loaded, where they actually are) #816
  • Fixed: withStatus not working with minification #820 and #828
  • Fixed: L2 broadcast no ERC-4337 #830
    • EP authorization only for 0.7.0 accounts
    • 0.6.0 accounts can only broadcast with EOA - fix the L2 broadcast so txns are successfull by including estimate_gas in the erc-4337 estimation if there's no erc 4337 estimation
    • Remove the custom Arbitrum estimation and rely on estimate_gas instead
  • Fixed: All controllers fetch ref should come from the Main controller #815
    • Added: Expose the verified invite code (inside the Invite controller)
    • Changed: Update the node-fetch lib (and types) to the latest (lib used for the unit tests only now)
    • Fixed: All controllers should use the fetch ref incoming from the MainController. This wasn't the case, causing some of the logic to use the global (native) fetch, and others - to use the node-fetch import (which also shouldn't be the case, except for the tests where this doesn't matter).

Full Changelog: v2.13.0...v2.14.0

v1.0.17

17 Jun 15:18
1f4e9b2
Compare
Choose a tag to compare

Changelog:

  • Fix / Not Full Tokens List On Cached Response Data #821

v2.13.0

13 Jun 09:56
f4db404
Compare
Choose a tag to compare
v2.13.0 Pre-release
Pre-release

Changelog:

  • Changed: Migrated logic from extension's background service: DappsController, state of the dApps that have permission to interact with Ambire (part of the DappsController) and Session - a class responsible for the active communication sessions between dApps and Ambire extension #813
  • Fixed: When adding a custom network, add the feeOption to the correct place #814
  • Fixed: Humanization for Permit2 swap and bug fix (swapping non-native ERC-20 with UniSwap) #810

Full Changelog: v2.12.0...v2.13.0