Commit Graph

44 Commits

Author SHA1 Message Date
Peter Sanderson
4b17096edc fix: fix the polyfill madness with web3 library
fix correct explanation
2026-02-12 11:51:16 +01:00
Marek Polak
a134ecf679 fix(storage): clean hopefully legacy code 2025-10-31 13:09:55 +01:00
Jiri Zbytovsky
d33a9bfbeb chore: optimize storageActions by making isAccessible sync 2025-10-02 14:30:14 +02:00
Jiri Zbytovsky
b0cdbcdefb chore(suite): cleanup suite storage from unused native files 2025-10-02 11:24:30 +02:00
Jiri Zbytovsky
e241f5a8f2 fix(suite): basic handling of some migration errors 2025-05-01 13:12:41 +02:00
Jiri Zbytovsky
c4f29700b1 chore(suite): simplify isDBAvailable 2025-04-03 11:34:30 +02:00
Jiri Zbytovsky
53bd828542 chore(suite): remove SuiteStorage BroadcastChannel 2025-04-03 11:34:30 +02:00
yanas
b96c899ebb chore(packages): autofix for sort-imports eslint rule 2025-01-30 16:34:04 +01:00
Jiri Zbytovsky
8564f359e1 chore(suite): bump idb 2025-01-09 16:48:10 +01:00
Peter Sanderson
e22b683733 chore: enable import/order rule for whole codebase 2024-11-06 18:20:26 +01:00
Marek Polak
ccd578e6fc refactor(suite-storage): use createLazy for db creation 2024-07-01 11:39:41 +02:00
Peter Sanderson
c82455e746 chore(suite): autofix newlines 2024-02-20 14:54:29 +01:00
Daniel Suchý
44fa12a79d chore(repo): ESLint refactor + speed up 70% (#11143)
* chore: eslint speedup

* chore: disable some react rules for class components

* chore: fix startup command

* chore(deps): dedupe
2024-02-12 20:18:19 +01:00
Martin Varmuza
d7721d1828 feat(suite-storage): ensure db is not accessed before migration is done 2023-06-23 11:23:29 +02:00
Daniel Suchý
b23f7b7bfa chore: Upgrade to TS 4.9 (#6932) 2022-11-23 18:18:23 +01:00
mroz
ca61568992 chore(env-utils): isFirefox util 2022-09-01 12:02:18 +02:00
Daniel Suchý
50ce258b0f chore(lint): enforce usage of @ts-expect-error 2022-08-21 10:56:43 +02:00
Szymon Lesisz
5757d357b1 chore(suite-storage): move "isDBAccessible" method from suite actions 2022-07-01 13:13:58 +02:00
Daniel Suchý
182439a7f1 chore: TS refactor to composite project, upgrade to TS 4.5 (#4851) 2022-02-24 10:49:03 +01:00
Daniel Suchý
6253be3f9f chore: Prettier refactor, update, add CI check (#4950)
* chore: remove redundant prettier, gitignore files

* fix: Fix missign html opening tag

* chore: upgrade prettier

* chore(ci): Add prettier check to CI

* chore(eslint): turn off prettier-eslint

* chore: fix formatting of translations

* chore: run prettier over whole codebase
2022-02-17 18:15:59 +01:00
Matej Kriz
3b62745211 fix(suite-storage): handle termination of indexdb
- remove the reference so DB is open again on next operation
- catch other possible errors and just report them to Sentry and console
2021-09-30 13:34:54 +02:00
Szymon Lesisz
c6694afef6 chore: update prettier and eslint 2021-08-12 15:34:23 +02:00
Szymon Lesisz
999fe10b7e chore: update typescript@4.3.5
- fixed electron (suite-desktop) menu

- idb dependency update required (typescipt related fixes in their lib)

- fixed Intl.DateTimeFormat default values
2021-08-10 10:32:49 +02:00
Szymon Lesisz
78736782fb chore: update eslint 2021-04-15 10:56:18 +02:00
slowbackspace
44e1c8d8f1 fix(suite): UI to inform user about db upgrade being blocked by another instance 2021-02-25 14:04:00 +01:00
slowbackspace
d95c1bd528 fix(storage): check if IDB is supported before each db operation (no support in ff incognito/tor browser) 2021-02-15 11:11:46 +01:00
Maroš
ded416ef0e fix(suite): add missing await to isDBAvailable() (#2996) 2020-11-17 18:38:25 +01:00
martin
29c759985e chore(eslint): add require-await rule 2020-11-13 13:29:47 +01:00
slowbackspace
f6e405d39f chore: fix lint 2020-09-21 16:32:51 +02:00
slowbackspace
e97f6c1646 fix: revert removing key param, add upsert as 4th param to addItem 2020-09-21 16:32:51 +02:00
slowbackspace
a237fd66ed fix: handle upsert in addItems just like in addItem 2020-09-21 16:32:51 +02:00
Vladimir Volek
aed67d5819 Remove redux from send form (#1966)
* save draft

* cleanup

* adjust reducer for more data

* prepare reducer and dispatch

* remove only existing draft

* save selectef fee to reducer

* fix address state loaded from cache

* remove amount tooltip

* cleanup

* reset form context and delete draft

* do not save sendContext in draft

* selected fee cache

* Update useActions.ts

* last selected fee action

* fee cache per coin

* load and save draft in toplevel index + isDirty validation removed (use required)

* add select bar

* add select bar to the root

* move to component

* cleanup

* input new design

* better input

* add transfer icon

* another recipient button

* active state for select bar

* fees and select bar design

* fix selectBar active value

* confirm on trezor component

* center cancel

* selectbar selected value

* center selectbar option

* persist only fee label

* add missing param

* add runtime exception handling to Transation

* merge FormContext with SendContext, use as one

* remove advanced form, add custom actions

* show add recipient only for bitcoin

* add header for addresses

* connect fees to selected fee

* fee level from connect

* prepare fees and total sent

* Amount + Fiat relation and validation

* fee recalculation

* fix cached error in Amount + Fiat calculation

* estimated time, fee units

* total sent prepare

* update custom fee with selected level

* add custom fee input

* remove old component

* position fee

* Remove unused component

* Prepare review transaction modal

* Add eth fees layout

* Add missing pading

* Add coin actions buttons

* Add coin actions

* Refactor header

* Add input addon, refactor

* Label align, correct Labels

* Add select input

* Implement SelectInput into send

* Position labels

* Output reponsivity

* Style textarea, add nolabel prop to input

* Fix main background

* update react-hook-form@6.0.x + add @testing-library/react

* implement "compose" with deboucing + changes required by react-hook-form

* Add eth Data

* Make active max always visible

* Add token balance

* Add reserve exaplanation tooltip

* Style select, dropdown indicator visible on hover

* Position bitcoin actions

* Remove label from header in input

* Fix receive input header

* Fix undefined component

* Select bar same as small input

* Fix labels and fee

* Add custom fee units

* Add plcaholder for bitcoin actions, fix Select Bar value

* Split bitcoin actions

* Add locktime components, refactor

* Add OP return skeleton

* Add OP return components

* Style select options

* Select disabled with one option

* add @testing-library/user-event

* Create useSendForm.test.tsx

* update sendForm hook and actions

* update sendform components

* update modals (ReviewTransaction)

* move ReviewButton action to hook

* cleanup in ReviewButton

* move Fiat from Amount calculation to hook

* Fix fee box

* Fix modal elements

* Add modal icons, add states

* update @testing-library packages

* add data-test attributes to inputs and buttons

* add "set-max" tests

* Fix storybook build

* Fix searchable input select

* composeTransaction after render-tick (useEffect)

* clear composeErrors on every onComposeRequest

* useValid outputs and saveDraft when switching fees

* OP_RETURN output

* OP_RETURN in ReviewTransaction modal

* move OpReturn to Output/components

* add RBF and locktime support

* remove RBF check from Locktime

* temporary remove tests

* Update trezorConnectActions.ts

* rework ReviewTransaction modal

* Update trezorConnectActions.ts

* openDeferredModal typed (QrReader + ReviewTransaction)

* fix "set-max" when amount field has error

* create useDebounce hook

* split useSendForm to smaller chunks

* remove unused props from send/index

* split sendFormActions into coinspecific chunks

* ethereum fees

* ReviewTransaction with ripple (fee on front)

* destination tag input + ReviewTransaction

* xrp destination tag with draft

* create resetDefaultValue method in hook

* eth send with data

* remove gasLimit input from custom fees

* unify composeTransaction params

* fix feePerByte float from connect response

* add getDefaultValue hook utility

* add wallet-component/InputError

* remove Ethfees

* CoinActions > Options

* erc20 support

* disable EthData if Erc20 is set

* Update yarn.lock

* remove unnecessary changes

* remove unnecessary changes 2

* fix components/Input invalid merge

* remove z-index from Input addon (breaks select searchable)

* broadcast disabled logic

* format precomposedTx "max" option

* update types in Fees SelectBar component

* update options in Header

* connect 8.1.12

* ConfirmOnDevice component shift "complete" step

* ReviewTx modal with details

* use TR_TRANSACTION_DETAILS text in reviewModal

* move common animation const to suite-config

* expandable data in ReviewTransaction

* unify errors and cleanup transalations used in send form

* remove "validator" and "@types/validator" packages

* remove unwanted changes in Input component

* remove unwanted changes from FresAddress (account/receive) and Input component

* fix sendFormUtils types

* fix useSendForm test (part1)

* fix #2224

* fix overflow in token select

* rename send form types

* remove send/Container and move props formatting to useSendFormHook

* fix useSendForm types and fixtures

* tmp any in storage.sendform (will be refactored)

* enable lint and ts checks

* enable hook unit tests

* add getItemsWithKeys to @suite-storage

* sendform in indexeddb

* fix tests

* remove unused const FROM_STORAGE

* move "lastUsedFeeLevel" from send to "walletSettings"

* lastUsedFeeLevel logic

* lastUsedFeeLevel in indexedDB

* db migration + typefix

* fix useSendForm tests

* XRP reserve errors

* fix SelectInput flexWrap

* update libs

* increase typing delay in useSendForm test

* add defaultValue to Contoller (react-hook-form@6.5.2)

* composeTransactions returns ExtendedMessageDescriptor (transaltion) in error

* fix invalid import after merge

* update react-hook-form

* use Account.key instead of getAccountKey

* Update storageActions.test.ts

* update send/Header

* remove unexpected (after merge) components changes

* fix default fiat currency option

* display tx size with EstimatedMiningTime

* hanlde Fee change and update fields values

* temporary disable Labeling in send-form

* use trezor-address-validator package

* handle TrezorConnect.composeTransaction errors with Toast

* add missing TrezorConnect.payload.error to useSendForm tests

* update storage version + create storage changelog

* cleanup and comments in all sendFromActions

* update dependencies

* move EstimatedMiningTime to sub-components of Fee

* allow ETH custom fee as decimals

* conditionally precompose tx on changeFeeLevel

* add ImportTransaction prototype

* add SendRaw

* fix ReviewModal css + Fiat value in Fee

* styles fixes in Fees, Options and SendRaw (flex wrap)

* switch fo fixed connect

* eth pending nonce

* Toast notification on ERC20 transfer

* fix ETH Data default amount value

* remove Tooltips from amount and address + remove plural recipment

* Update trezorConnectActions.ts

* disable "import tx" for now

* update send docs

* Update SEND.md

* move ImportTransaction to a separate sub-hook useSendFormImport

* add send form architecture docs

* add send docs diagram sourcefile

* move Output > ComposeOutput transform to utils, fix multioutput cornercase

* fix FeeLevel changed (same same but different)

* move optionsBuilders from utils to relevant components

* replace sendFormUtils.findValidOutputs with coinSpecific utils

* Update SEND.md

* validate Fiat decimals

* reset Output values onOutputRemove

* unify Raw/EthData/OpReturn data validation

* Fix/new sendform ui enhancements (#2281)

* update styles review tx modal

* fix few message ids

* truncate address insteaf of overflowing if neccessary even on large screens

* more improvements to ReviewTransaction modal

* cancel marginTop if crypto and fiat amounts ae side by side

* Send form design improvements

* fix Fiat > Amount errors relation

* Update SEND.md

* validate max Locktime

* update connect@8.1.13

* update EthData size limit

* fix input inneraddon overflow

Co-authored-by: Szymon Lesisz <sz.lesisz@gmail.com>
Co-authored-by: slowbackspace <slowbackspace@gmail.com>
2020-09-03 15:54:19 +02:00
Maroš
807a4ec1b8 Drop whole db instead of just clearing object stores on "Clear storage" (#2266)
* remove database instead of just clearing object stores in Error boundary

* delete db on "clear storage" action in settings
2020-08-31 10:11:59 +02:00
Maroš
534573ffe4 Update/ts39 (#2019)
* bump ts

* bump idb

* fix ts errors

* fix ts

* fix ts errors

* TODO: resolve these ts-ignores

* naive ts fix

* update jest related deps

* use babel-jest instead of ts-jest in suite

* fix Translation component

* worakround for mocking 'elementToImageData'

* fix using function not scoped to jest.mock

* TODO: resolve mocked goto not being called in suiteMIddleware

* workaround for spying on goto() in suiteMiddleware

* fix ts

* ts workaround

* review fixes

* nicer import, typo
2020-06-16 16:25:22 +02:00
Maroš
664a977aef Clear storage and restart app on db version downgrade (#1905)
* clear storage and restart app on db version downgrade

* ts-ignore window in suite-native
2020-05-26 19:47:38 +02:00
Maroš
148a6b7b6e add clear storage btn (#1369)
* add clear storage btn

* fix removeStores method

* fix path to allow space

* Revert "fix path to allow space"

This reverts commit 6c1bb781c9.

* fix ts

* implement fullblown app restart via ipc

* fix removeStores usage

* fix lint, messages

* add redirection for web
2020-03-25 10:51:41 +01:00
Maroš
1b75de908d add polyfill for broadcast channel (#1267) 2020-02-28 13:03:53 +01:00
martin
ba7c684a1c fool ts in storage 2019-11-28 15:38:05 +01:00
martin
5e4cb8d3dc Fix typescript in react-native (#785)
* fix react-native ts

* remove react-native-svg

* fix resolvers

* better imports, remove console

* put back @trezor/components

* remove react-native-svg from package.json

* patch trezor-connect temporarily

* svgs work

* use same version of react-native-svg

* fix lint

* fix ts

* add index.d.ts for native with .svg module

* fix lint
2019-11-27 10:06:52 +01:00
Maroš
835bf92143 Fix txs history (#810)
* count only non empty indices, always fetch txs on incomplete pages

* store index of the tx inside the reducer

* fake native implementation to return the same interface

* concat promises

* fix ts
2019-11-22 11:35:56 +01:00
Maroš
1bc7122184 Store remembered device, discovery, accounts, txs in db (#713)
* remove all items matching index key

* remember device, discovery, accounts

* add upsert param in 'addItems' method

* fake interface for RN

* save changes to stored accounts, discovery

* add comment

* upgrade idb

* support es2019 syntax

* storage: better TS, hopefully better 'addItems' method

* rename storageMiddleware and move under suite

* save txs

* fix ts

* fix ts

* error log

* save device to db as disconnected

* allow to use es2019 syntax (array.flat())

* invalidate txs in db on block mined in case of outdated account

* remove sendForm draft on form clear

* clear sendform on forget device

* fix type in NoSSR component

* add unit test for storageActions

* fix sortByTimestamp util func for devices

* bump to node 12

* bump node engine

* fix more sorts

* fix suiteMiddleware unit test

* upgrade canvas

* update yarn.lock

* fix ts

* add clearStores method

* fix jest not resolving tx.done when there was no operation within transaction

* remove todo

* fix duplicate import

* better types

* use new types

* remove device instances

* fix missing import

* fix typo

* selective store updates

* add deviceState back to send form state

* delete account txs on account removal (app settings coin switch)

* add test for updating the db on device change

* add device test

* bump node

* bump image
2019-11-06 16:29:53 +01:00
slowbackspace
41c1e30f35 add removeItemByPK, removeItemByIndex, fix typos 2019-10-21 14:25:39 +02:00
Maroš
d03df2dc88 tx history (#505)
* wip

* revert brain fart change

* fix lint

* fix lint

* wip

* fix Link for non-internal href

* fix cursor iterating past the end

* basic txs fetching from blockbook

* cache txs per page

* fix pagination overflow

* ripple pagination proof of concept

* fix type

* update marker inside the account WIP

* fix account update

* remove console.log

* merge related fixes

* fix ripple pagination

* remove uneccessary check for the accountType in account filter

* add todo

* remove tsignore

* add tsignore

* more descriptive name for  updateReducersOnMessage func

* comment some unused tx actions

* cleanup

* fix lint after merge

* fix lint

* fix link

* fix lint

* xrp limit pagination

* fix lint

* fix ts errors

* add intl, fix loading

* add symbol to tx amount

* remove grouping

* add account update action

* fix lint

* add reducerUtils test

* fix ts

* trim fixtures

* trim fixtures

* fix lint

* fix lint

* fix lint

* add getWalletAccount mock

* bolder font for pagination actions

* loader fixed on top instead of vertically centered

* remove duplicite logic

* reuse getDiscoveryForDevice from discoveryActions

* index transactions inside the object by a hash of the account

* fix lint

* make page param mandatory in fetchTransactions

* fix tests

* show previous pages in ripple pagination

* fix key prop for list

* add transaction.add and .remove cases in tx reducer

* fix lint

* cleanup

* add token txs

* fix lint

* format tokens amount

* add token icons

* review fixes

* fix ts

* fix after merge
2019-09-25 14:04:46 +02:00
Maroš
4c487e74a7 Suite storage refactor (#431)
* separate db to package

* add ci tasks

* add native storage

* ts fixes

* make suite-storage private package

* add paths to tsconfig

* merged native/web suite-storage to one package

* improvements

* remove unneeded babel resolvers

* fix imports

* same interface for native

* refactor using ts generics

* fix upserting with addItem()

* cleanup

* fix txid index

* fix dispatching WALLET.INIT

* fix some types

* remove copied idb type utils

* rename build task

* add suite-storage to artifacts

* trim .gitignore

* remove ds_store, that is handled by global .gitignore

* fix tsconfig for suite-native
2019-08-29 12:53:28 +02:00