From 0733158ac2af85b526138adca5feea933540b691 Mon Sep 17 00:00:00 2001 From: vantuz-subhuman Date: Thu, 1 Aug 2024 10:15:55 +0300 Subject: [PATCH 1/3] ledger and yoroi-lib update --- .../api/ada/transactions/shelley/ledgerTx.js | 10 +++++----- .../ada/transactions/shelley/ledgerTx.test.js | 4 ++-- .../connect/operation/send/SendTxHintBlock.js | 17 ++++++++++------- .../ledger/components/manual-test/TestBlock.js | 11 +++++------ packages/yoroi-extension/package-lock.json | 18 +++++++++--------- packages/yoroi-extension/package.json | 4 ++-- 6 files changed, 33 insertions(+), 31 deletions(-) diff --git a/packages/yoroi-extension/app/api/ada/transactions/shelley/ledgerTx.js b/packages/yoroi-extension/app/api/ada/transactions/shelley/ledgerTx.js index abd381b30e..50014aa467 100644 --- a/packages/yoroi-extension/app/api/ada/transactions/shelley/ledgerTx.js +++ b/packages/yoroi-extension/app/api/ada/transactions/shelley/ledgerTx.js @@ -24,7 +24,7 @@ import { TransactionSigningMode, TxOutputDestinationType, TxAuxiliaryDataType, - StakeCredentialParamsType, + CredentialParamsType, CIP36VoteRegistrationFormat, TxRequiredSignerType, DatumType, @@ -329,7 +329,7 @@ function formatLedgerWithdrawals( result.push({ amount: withdrawalAmount.to_str(), stakeCredential: { - type: StakeCredentialParamsType.KEY_PATH, + type: CredentialParamsType.KEY_PATH, keyPath: addressing.path, }, }); @@ -366,7 +366,7 @@ function formatLedgerCertificates( type: CertificateType.STAKE_REGISTRATION, params: { stakeCredential: { - type: StakeCredentialParamsType.KEY_PATH, + type: CredentialParamsType.KEY_PATH, keyPath: getPath(registrationCert.stake_credential()), }, } @@ -379,7 +379,7 @@ function formatLedgerCertificates( type: CertificateType.STAKE_DEREGISTRATION, params: { stakeCredential: { - type: StakeCredentialParamsType.KEY_PATH, + type: CredentialParamsType.KEY_PATH, keyPath: getPath(deregistrationCert.stake_credential()), }, }, @@ -392,7 +392,7 @@ function formatLedgerCertificates( type: CertificateType.STAKE_DELEGATION, params: { stakeCredential: { - type: StakeCredentialParamsType.KEY_PATH, + type: CredentialParamsType.KEY_PATH, keyPath: getPath(delegationCert.stake_credential()), }, poolKeyHashHex: Buffer.from(delegationCert.pool_keyhash().to_bytes()).toString('hex'), diff --git a/packages/yoroi-extension/app/api/ada/transactions/shelley/ledgerTx.test.js b/packages/yoroi-extension/app/api/ada/transactions/shelley/ledgerTx.test.js index 6329ea8328..a8d1deac88 100644 --- a/packages/yoroi-extension/app/api/ada/transactions/shelley/ledgerTx.test.js +++ b/packages/yoroi-extension/app/api/ada/transactions/shelley/ledgerTx.test.js @@ -19,7 +19,7 @@ import { CertificateType, TransactionSigningMode, TxOutputDestinationType, - StakeCredentialParamsType, + CredentialParamsType, } from '@cardano-foundation/ledgerjs-hw-app-cardano'; import type { DeviceOwnedAddress, SignTransactionRequest } from '@cardano-foundation/ledgerjs-hw-app-cardano'; import { networks } from '../../lib/storage/database/prepackaged/networks'; @@ -418,7 +418,7 @@ test('Create Ledger transaction', async () => { certificates: [{ params: { stakeCredential: { - type: StakeCredentialParamsType.KEY_PATH, + type: CredentialParamsType.KEY_PATH, keyPath: [ WalletTypePurpose.CIP1852, CoinTypes.CARDANO, diff --git a/packages/yoroi-extension/ledger/components/connect/operation/send/SendTxHintBlock.js b/packages/yoroi-extension/ledger/components/connect/operation/send/SendTxHintBlock.js index 8f503c67d3..c0a9f30418 100644 --- a/packages/yoroi-extension/ledger/components/connect/operation/send/SendTxHintBlock.js +++ b/packages/yoroi-extension/ledger/components/connect/operation/send/SendTxHintBlock.js @@ -14,7 +14,7 @@ import { AddressType, CertificateType, TxAuxiliaryDataType, - StakeCredentialParamsType, + CredentialParamsType, } from '@cardano-foundation/ledgerjs-hw-app-cardano'; import { pathToString, @@ -209,10 +209,11 @@ export default class SendTxHintBlock extends React.Component { if (request.cert.type === CertificateType.STAKE_REGISTRATION) { const { params } = request.cert; - if (request.cert.params.stakeCredential.type !== StakeCredentialParamsType.KEY_PATH) { + if (params.stakeCredential.type !== CredentialParamsType.KEY_PATH) { throw new Error('unsupported stake credential type'); } - const { keyPath } = request.cert.params.stakeCredential; + // $FLowIgnore + const { keyPath } = params.stakeCredential; const imgRegister = require(`../../../../assets/img/nano-${this.props.deviceCode}/hint-registration.png`); const imgRegisterConfirm = require(`../../../../assets/img/nano-${this.props.deviceCode}/hint-registration-confirm.png`); const firstStep = request.getAndIncrementStep(); @@ -245,10 +246,11 @@ export default class SendTxHintBlock extends React.Component { } if (request.cert.type === CertificateType.STAKE_DELEGATION) { const { params } = request.cert; - if (request.cert.params.stakeCredential.type !== StakeCredentialParamsType.KEY_PATH) { + if (params.stakeCredential.type !== CredentialParamsType.KEY_PATH) { throw new Error('unsupported stake credential type'); } - const { keyPath } = request.cert.params.stakeCredential; + // $FLowIgnore + const { keyPath } = params.stakeCredential; const imgDelegatePool = require(`../../../../assets/img/nano-${this.props.deviceCode}/hint-delegation-pool.png`); const imgDelegateConfirm = require(`../../../../assets/img/nano-${this.props.deviceCode}/hint-delegation-confirm.png`); const firstStep = request.getAndIncrementStep(); @@ -298,10 +300,11 @@ export default class SendTxHintBlock extends React.Component { } if (request.cert.type === CertificateType.STAKE_DEREGISTRATION) { const { params } = request.cert; - if (request.cert.params.stakeCredential.type !== StakeCredentialParamsType.KEY_PATH) { + if (params.stakeCredential.type !== CredentialParamsType.KEY_PATH) { throw new Error('unsupported stake credential type'); } - const { keyPath } = request.cert.params.stakeCredential; + // $FLowIgnore + const { keyPath } = params.stakeCredential; const imgDeregister = require(`../../../../assets/img/nano-${this.props.deviceCode}/hint-deregister-key.png`); const imgDeregisterConfirm = require(`../../../../assets/img/nano-${this.props.deviceCode}/hint-deregister-confirm.png`); const firstStep = request.getAndIncrementStep(); diff --git a/packages/yoroi-extension/ledger/components/manual-test/TestBlock.js b/packages/yoroi-extension/ledger/components/manual-test/TestBlock.js index 9c51731681..e47473b744 100644 --- a/packages/yoroi-extension/ledger/components/manual-test/TestBlock.js +++ b/packages/yoroi-extension/ledger/components/manual-test/TestBlock.js @@ -7,13 +7,12 @@ import React from 'react'; import type { Node } from 'react'; import { observer } from 'mobx-react'; import { - utils, AddressType, CertificateType, TransactionSigningMode, TxAuxiliaryDataType, TxOutputDestinationType, - StakeCredentialParamsType, + CredentialParamsType, CIP36VoteRegistrationFormat, } from '@cardano-foundation/ledgerjs-hw-app-cardano'; @@ -374,7 +373,7 @@ export default class TestBlock extends React.Component { type: CertificateType.STAKE_REGISTRATION, params: { stakeCredential: { - type: StakeCredentialParamsType.KEY_PATH, + type: CredentialParamsType.KEY_PATH, keyPath: strToPath("1852'/1815'/0'/2/0"), }, } @@ -383,7 +382,7 @@ export default class TestBlock extends React.Component { type: CertificateType.STAKE_DELEGATION, params: { stakeCredential: { - type: StakeCredentialParamsType.KEY_PATH, + type: CredentialParamsType.KEY_PATH, keyPath: strToPath("1852'/1815'/0'/2/0"), }, poolKeyHashHex: 'df1750df9b2df285fcfb50f4740657a18ee3af42727d410c37b86207', @@ -393,14 +392,14 @@ export default class TestBlock extends React.Component { type: CertificateType.STAKE_DEREGISTRATION, params: { stakeCredential: { - type: StakeCredentialParamsType.KEY_PATH, + type: CredentialParamsType.KEY_PATH, keyPath: strToPath("1852'/1815'/0'/2/0"), }, }, }], withdrawals: [{ stakeCredential: { - type: StakeCredentialParamsType.KEY_PATH, + type: CredentialParamsType.KEY_PATH, keyPath: strToPath("1852'/1815'/0'/2/0"), }, amount: '1000000', diff --git a/packages/yoroi-extension/package-lock.json b/packages/yoroi-extension/package-lock.json index 18d3385f52..977d0907d1 100644 --- a/packages/yoroi-extension/package-lock.json +++ b/packages/yoroi-extension/package-lock.json @@ -10,7 +10,7 @@ "license": "MIT", "dependencies": { "@amplitude/analytics-browser": "^2.1.3", - "@cardano-foundation/ledgerjs-hw-app-cardano": "6.0.0", + "@cardano-foundation/ledgerjs-hw-app-cardano": "7.1.3", "@emotion/react": "^11.4.1", "@emotion/styled": "^11.3.0", "@emurgo/cardano-message-signing-browser": "1.0.1", @@ -19,7 +19,7 @@ "@emurgo/cip4-js": "1.0.5", "@emurgo/cross-csl-browser": "4.4.0", "@emurgo/yoroi-eutxo-txs": "0.0.2-alpha.8", - "@emurgo/yoroi-lib": "0.15.5", + "@emurgo/yoroi-lib": "0.15.6", "@ledgerhq/hw-transport-u2f": "5.36.0-deprecated", "@ledgerhq/hw-transport-webauthn": "5.36.0-deprecated", "@ledgerhq/hw-transport-webhid": "5.51.1", @@ -2064,9 +2064,9 @@ "dev": true }, "node_modules/@cardano-foundation/ledgerjs-hw-app-cardano": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/@cardano-foundation/ledgerjs-hw-app-cardano/-/ledgerjs-hw-app-cardano-6.0.0.tgz", - "integrity": "sha512-aiWlERF5sXMzygE62YH9AXrVePu5ZG+QKGv/ZhvYec35vUhDFJK8qPiLzXmTy6MdoDKSqbYVRPd6jY3KKs5pOg==", + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/@cardano-foundation/ledgerjs-hw-app-cardano/-/ledgerjs-hw-app-cardano-7.1.3.tgz", + "integrity": "sha512-1cW5WgF2pkla2pvNp/lGsPfdDh8FjnRRLUaHsyxgZd2NNtr939F9k5R/ExCuJS0Ish4wnArucbPAZ15Cq7PIUA==", "dependencies": { "@ledgerhq/hw-transport": "^6.27.10", "base-x": "^3.0.5", @@ -2639,11 +2639,11 @@ } }, "node_modules/@emurgo/yoroi-lib": { - "version": "0.15.5", - "resolved": "https://registry.npmjs.org/@emurgo/yoroi-lib/-/yoroi-lib-0.15.5.tgz", - "integrity": "sha512-Fq6MN/l5Na14d3LOsnT7xzKDky1ugbKxQ6+zzxchZkcF+w0OXGtK4sFGXccR47E7JhRLhjLqOzKSKhKGkTVt+A==", + "version": "0.15.6", + "resolved": "https://registry.npmjs.org/@emurgo/yoroi-lib/-/yoroi-lib-0.15.6.tgz", + "integrity": "sha512-JX6PUaXRgpefDdtBw12jE6TYgp1fd4WXAMp9kj7EuT+FET3324iX8hRXNE5c1bS0wz9j1Qh3xwzWgiEtK7iJBw==", "dependencies": { - "@cardano-foundation/ledgerjs-hw-app-cardano": "^6.0.0", + "@cardano-foundation/ledgerjs-hw-app-cardano": "^7.1.3", "@emurgo/cross-csl-core": "4.4.0", "@noble/hashes": "^1.3.2", "axios": "^0.24.0", diff --git a/packages/yoroi-extension/package.json b/packages/yoroi-extension/package.json index 41903f2fc2..141a8e40d4 100644 --- a/packages/yoroi-extension/package.json +++ b/packages/yoroi-extension/package.json @@ -139,7 +139,7 @@ }, "dependencies": { "@amplitude/analytics-browser": "^2.1.3", - "@cardano-foundation/ledgerjs-hw-app-cardano": "6.0.0", + "@cardano-foundation/ledgerjs-hw-app-cardano": "7.1.3", "@emotion/react": "^11.4.1", "@emotion/styled": "^11.3.0", "@emurgo/cardano-message-signing-browser": "1.0.1", @@ -148,7 +148,7 @@ "@emurgo/cip4-js": "1.0.5", "@emurgo/cross-csl-browser": "4.4.0", "@emurgo/yoroi-eutxo-txs": "0.0.2-alpha.8", - "@emurgo/yoroi-lib": "0.15.5", + "@emurgo/yoroi-lib": "0.15.6", "@ledgerhq/hw-transport-u2f": "5.36.0-deprecated", "@ledgerhq/hw-transport-webauthn": "5.36.0-deprecated", "@ledgerhq/hw-transport-webhid": "5.51.1", From 2ebc3ef1b79534c7ade8c91d347d432f5fb426c3 Mon Sep 17 00:00:00 2001 From: vantuz-subhuman Date: Thu, 1 Aug 2024 10:27:28 +0300 Subject: [PATCH 2/3] yoroi-lib update --- packages/yoroi-extension/package-lock.json | 8 ++++---- packages/yoroi-extension/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/yoroi-extension/package-lock.json b/packages/yoroi-extension/package-lock.json index 977d0907d1..2b8059d7f4 100644 --- a/packages/yoroi-extension/package-lock.json +++ b/packages/yoroi-extension/package-lock.json @@ -19,7 +19,7 @@ "@emurgo/cip4-js": "1.0.5", "@emurgo/cross-csl-browser": "4.4.0", "@emurgo/yoroi-eutxo-txs": "0.0.2-alpha.8", - "@emurgo/yoroi-lib": "0.15.6", + "@emurgo/yoroi-lib": "0.15.7", "@ledgerhq/hw-transport-u2f": "5.36.0-deprecated", "@ledgerhq/hw-transport-webauthn": "5.36.0-deprecated", "@ledgerhq/hw-transport-webhid": "5.51.1", @@ -2639,9 +2639,9 @@ } }, "node_modules/@emurgo/yoroi-lib": { - "version": "0.15.6", - "resolved": "https://registry.npmjs.org/@emurgo/yoroi-lib/-/yoroi-lib-0.15.6.tgz", - "integrity": "sha512-JX6PUaXRgpefDdtBw12jE6TYgp1fd4WXAMp9kj7EuT+FET3324iX8hRXNE5c1bS0wz9j1Qh3xwzWgiEtK7iJBw==", + "version": "0.15.7", + "resolved": "https://registry.npmjs.org/@emurgo/yoroi-lib/-/yoroi-lib-0.15.7.tgz", + "integrity": "sha512-mrT+v1dJvxu+fy+Lm50eKi44bYiVqrN2vjAGSe5gLiondqzpV6cp3luIBWstFm1Ba0rXc67BBs8vCeXhjp3fJQ==", "dependencies": { "@cardano-foundation/ledgerjs-hw-app-cardano": "^7.1.3", "@emurgo/cross-csl-core": "4.4.0", diff --git a/packages/yoroi-extension/package.json b/packages/yoroi-extension/package.json index 141a8e40d4..611a805b79 100644 --- a/packages/yoroi-extension/package.json +++ b/packages/yoroi-extension/package.json @@ -148,7 +148,7 @@ "@emurgo/cip4-js": "1.0.5", "@emurgo/cross-csl-browser": "4.4.0", "@emurgo/yoroi-eutxo-txs": "0.0.2-alpha.8", - "@emurgo/yoroi-lib": "0.15.6", + "@emurgo/yoroi-lib": "0.15.7", "@ledgerhq/hw-transport-u2f": "5.36.0-deprecated", "@ledgerhq/hw-transport-webauthn": "5.36.0-deprecated", "@ledgerhq/hw-transport-webhid": "5.51.1", From 6dbdd126530985675f8b08b750d8d00af8a1a89f Mon Sep 17 00:00:00 2001 From: vantuz-subhuman Date: Thu, 1 Aug 2024 12:24:13 +0300 Subject: [PATCH 3/3] Version bump: 5.2.300 --- packages/yoroi-extension/package-lock.json | 4 ++-- packages/yoroi-extension/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/yoroi-extension/package-lock.json b/packages/yoroi-extension/package-lock.json index 2b8059d7f4..6b72bd2bd4 100644 --- a/packages/yoroi-extension/package-lock.json +++ b/packages/yoroi-extension/package-lock.json @@ -1,12 +1,12 @@ { "name": "yoroi", - "version": "5.2.200", + "version": "5.2.300", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "yoroi", - "version": "5.2.200", + "version": "5.2.300", "license": "MIT", "dependencies": { "@amplitude/analytics-browser": "^2.1.3", diff --git a/packages/yoroi-extension/package.json b/packages/yoroi-extension/package.json index 611a805b79..1f0e3a7f3d 100644 --- a/packages/yoroi-extension/package.json +++ b/packages/yoroi-extension/package.json @@ -1,6 +1,6 @@ { "name": "yoroi", - "version": "5.2.200", + "version": "5.2.300", "description": "Cardano ADA wallet", "scripts": { "dev-mv2": "rimraf dev/ && NODE_OPTIONS=--openssl-legacy-provider babel-node scripts-mv2/build --type=debug --env 'mainnet'",