New account ${name} added for ${ledger}.
+You may now close this site and relaunch AlgoSigner.
++ Insert the hardware device and verify the Algorand application is open. +
++ ${error !== undefined && error.length > 0 && error} +
+diff --git a/.gitignore b/.gitignore index 03f510d4..f3e80fa7 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ **/packages/dapp/lib .DS_Store test*.png -**/coverage \ No newline at end of file +**/coverage +**/test-project/results \ No newline at end of file diff --git a/README.md b/README.md index bb45ac0a..a1df1756 100644 --- a/README.md +++ b/README.md @@ -10,39 +10,20 @@ _This is the preferred solution for end-users, updates will be automatically ins Developers working with dApps may also install directly from the release package, or by downloading the project and building it. -## 1.5.0 Release +## 1.6.0 Release -This release features the new v2 Signing functionality for dApp developers. Designed to meet the upcoming Algorand Foundation standards it will greatly simplifying complex signing scenarios like Multisignature and Atomic. Encoding is standardized and new helper functions simplify the complexity. +### Functionality +Added ability to use a Ledger device to add public addresses into AlgoSigner and for signing pay and asset transactions. For information about it how to use you can refer to the new readme. -[v2 AlgoSigner methods](docs/dApp-integration.md) +- [Ledger Readme](docs/ledger.md) -The v1 Atomic transaction functionality will start warning extension users in the next major release and be deprecated entirely in two releases. - -### 1.5.1 Patch - -Improved Application Transaction workflow: - -- `AppOnComplete` now defaults to 0. -- Improved readability on `AppArgs` during signing. The base64-encoded version will be shown. - -### 1.5.2 Patch - -v2 Signing Improvements: - -- Add informational tooltip on Multisig transactions. -- Correctly fetch Asset Unit Name and Decimals Display Amount for AxferTxs. -- `AppIndex` now defaults to 0. -- Improved readability on `AppApprovalProgram` && `AppClearProgram` during signing. The base64-encoded version will be shown. - -Other Usability Improvements: - -- Enabled the option to remove the last selected word when confirming the Mnemonic during Account Creation. -- Fixed bug that prevented Mnemonics with repeated words to be correctly confirmed during Account Creation. -- Added scrollbar to transaction overview section of all signing methods. This helps with better visualization of transactions with many fields, such as Application Transactions. -- UX Improvements for the Network Config screen: - - Added links to the documentation regarding custom networks. - - More responsive tooltip explaining the Network Headers field. - - UI Layout improvements. +### Various Fixes +- UI general improvements +- Improved validation handling in v2 signing +- Modified asset verification to use algod +- Fixed issue with 404's from asset lookups +- Modify transactions without an amount to default to 0 +- Fixed issue with creating assets that have zero decimals ## New Users diff --git a/docs/ledger.md b/docs/ledger.md new file mode 100644 index 00000000..22074fc7 --- /dev/null +++ b/docs/ledger.md @@ -0,0 +1,66 @@ +# AlgoSigner Ledger Periphreral Hardware Actions + +## Overview:
Transaction failed with the following error: @@ -130,14 +140,9 @@ const AddAssetConfirm: FunctionalComponent = (props: any) => {
${error}
New account ${name} added for ${ledger}.
+You may now close this site and relaunch AlgoSigner.
++ Insert the hardware device and verify the Algorand application is open. +
++ ${error !== undefined && error.length > 0 && error} +
++ ${tx.assetIndex} +
+ `; + if (isLedgerBaseSupported(ledger)) { + assetIndex = html` + + ${tx.assetIndex} + + `; + } + const midsection = html`Asset:
- - ${tx.assetIndex} - + ${assetIndex}${!estFee || tx['flatFee'] ? 'Fee:' : 'Estimated fee:'}
diff --git a/packages/ui/src/components/SignTransaction/TxAxfer.ts b/packages/ui/src/components/SignTransaction/TxAxfer.ts index 1ad77ed7..ef98e172 100644 --- a/packages/ui/src/components/SignTransaction/TxAxfer.ts +++ b/packages/ui/src/components/SignTransaction/TxAxfer.ts @@ -1,11 +1,32 @@ import { html } from 'htm/preact'; import { FunctionalComponent } from 'preact'; import TxTemplate from './Common/TxTemplate'; +import { isLedgerBaseSupported } from '@algosigner/common/utils'; const TxAxfer: FunctionalComponent = (props: any) => { const { tx, account, ledger, vo, dt, estFee, da, un, msig } = props; const fee = estFee ? estFee : tx['fee']; + let assetIndex = html` ++ ${tx.assetIndex} +
+ `; + if (isLedgerBaseSupported(ledger)) { + assetIndex = html` + + ${tx.assetIndex} + + `; + } + const midsection = html`@@ -32,16 +53,7 @@ const TxAxfer: FunctionalComponent = (props: any) => { `}
Asset:
- - ${tx.assetIndex} - + ${assetIndex}${!estFee || tx['flatFee'] ? 'Fee:' : 'Estimated fee:'}
diff --git a/packages/ui/src/components/TransactionDetail/TxAcfg.test.ts b/packages/ui/src/components/TransactionDetail/TxAcfg.test.ts index 555ea9aa..da95b323 100644 --- a/packages/ui/src/components/TransactionDetail/TxAcfg.test.ts +++ b/packages/ui/src/components/TransactionDetail/TxAcfg.test.ts @@ -1,3 +1,6 @@ +/** + * @jest-environment jsdom + */ import { shallow } from 'enzyme'; import { html } from 'htm/preact'; import TxAcfg from './TxAcfg'; diff --git a/packages/ui/src/components/TransactionDetail/TxAfrz.test.ts b/packages/ui/src/components/TransactionDetail/TxAfrz.test.ts index 2c20084b..0895f04b 100644 --- a/packages/ui/src/components/TransactionDetail/TxAfrz.test.ts +++ b/packages/ui/src/components/TransactionDetail/TxAfrz.test.ts @@ -1,3 +1,6 @@ +/** + * @jest-environment jsdom + */ import { shallow } from 'enzyme'; import { html } from 'htm/preact'; import TxAfrz from './TxAfrz'; diff --git a/packages/ui/src/components/TransactionDetail/TxAxfer.test.ts b/packages/ui/src/components/TransactionDetail/TxAxfer.test.ts index d4103162..287d569c 100644 --- a/packages/ui/src/components/TransactionDetail/TxAxfer.test.ts +++ b/packages/ui/src/components/TransactionDetail/TxAxfer.test.ts @@ -1,3 +1,6 @@ +/** + * @jest-environment jsdom + */ import { shallow } from 'enzyme'; import { html } from 'htm/preact'; import TxAxfer from './TxAxfer'; diff --git a/packages/ui/src/components/TransactionDetail/TxPay.test.ts b/packages/ui/src/components/TransactionDetail/TxPay.test.ts index eb588fed..9e24bda6 100644 --- a/packages/ui/src/components/TransactionDetail/TxPay.test.ts +++ b/packages/ui/src/components/TransactionDetail/TxPay.test.ts @@ -1,3 +1,6 @@ +/** + * @jest-environment jsdom + */ import { shallow } from 'enzyme'; import { html } from 'htm/preact'; import TxPay from './TxPay'; diff --git a/packages/ui/src/index.js b/packages/ui/src/index.js index d5727386..bc925896 100644 --- a/packages/ui/src/index.js +++ b/packages/ui/src/index.js @@ -22,7 +22,9 @@ import AddAsset from 'pages/AddAsset'; import SignTransaction from 'pages/SignTransaction'; import SignWalletTransaction from 'pages/SignWalletTransaction'; import SignMultisigTransaction from 'pages/SignMultisigTransaction'; - +import LinkHardwareAccount from 'pages/LinkHardwareAccount'; +import LedgerHardwareConnector from 'components/LedgerDevice/LedgerHardwareConnector'; +import LedgerHardwareSign from 'components/LedgerDevice/LedgerHardwareSign'; import { StoreProvider } from 'services/StoreContext'; require('./styles.scss'); @@ -57,6 +59,9 @@ const App = () => { <${Account} path="/:ledger/:address" /> <${AddAsset} path="/:ledger/:address/add-asset" /> <${SendAlgos} path="/:ledger/:address/send" /> + <${LedgerHardwareConnector} path="/:ledger/ledger-hardware-connector" /> + <${LedgerHardwareSign} path="/:ledger/ledger-hardware-sign" /> + <${LinkHardwareAccount} path="/:ledger/link-hardware-account" /> ${Router}>+ The extension will close and a new tab will be created to connect the Ledger device. +
+Transaction sent with ID
${txId}