Skip to content

Commit

Permalink
chore: upgrade @zondax/ledger-stacks
Browse files Browse the repository at this point in the history
  • Loading branch information
kyranjamie committed Sep 6, 2022
1 parent f66b88e commit fddf99e
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 47 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"@styled-system/theme-get": "5.1.2",
"@tippyjs/react": "4.2.6",
"@vkontakte/vk-qr": "2.0.13",
"@zondax/ledger-blockstack": "0.22.8",
"@zondax/ledger-stacks": "1.0.1",
"are-passive-events-supported": "1.1.1",
"argon2-browser": "1.18.0",
"assert": "2.0.0",
Expand Down
27 changes: 0 additions & 27 deletions src/app/common/actions/finalize-message-signature.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import StacksApp from '@zondax/ledger-blockstack';
import StacksApp from '@zondax/ledger-stacks';
import ecdsaFormat from 'ecdsa-sig-formatter';
import { sha256 } from 'sha.js';
import { getIdentityDerivationPath } from '../../ledger-utils';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect, useState } from 'react';
import { Outlet, useLocation } from 'react-router-dom';
import { LedgerError } from '@zondax/ledger-blockstack';
import { LedgerError } from '@zondax/ledger-stacks';
import { getAddressFromPublicKey, TransactionVersion } from '@stacks/transactions';
import get from 'lodash.get';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState } from 'react';
import { Outlet, useLocation } from 'react-router-dom';
import { LedgerError } from '@zondax/ledger-blockstack';
import { LedgerError } from '@zondax/ledger-stacks';
import get from 'lodash.get';

import { delay } from '@app/common/utils';
Expand All @@ -22,9 +22,9 @@ import { useLedgerAnalytics } from '../../hooks/use-ledger-analytics.hook';
import { LedgerMessageSigningContext, LedgerMsgSigningProvider } from './ledger-sign-msg.context';

import { useLocationStateWithCache } from '@app/common/hooks/use-location-state';
import { finalizeMessageSignature } from '@app/common/actions/finalize-message-signature';
import { useSignatureRequestSearchParams } from '@app/store/signatures/requests.hooks';
import { signatureVrsToRsv } from '@stacks/common';
import { finalizeMessageSignature } from '@shared/actions/finalize-message-signature';

export function LedgerSignMsgContainer() {
useScrollLock(true);
Expand Down Expand Up @@ -83,7 +83,7 @@ export function LedgerSignMsgContainer() {
if (resp.returnCode === LedgerError.TransactionRejected) {
ledgerNavigate.toOperationRejectedStep(`Message signing operation rejected`);
ledgerAnalytics.utf8MessageSignedOnLedgerRejected();
finalizeMessageSignature(requestToken, tabId, 'cancel');
finalizeMessageSignature({ requestPayload: requestToken, tabId, data: 'cancel' });
return;
}
if (resp.returnCode !== LedgerError.NoErrors) {
Expand All @@ -94,9 +94,13 @@ export function LedgerSignMsgContainer() {

ledgerAnalytics.utf8MessageSignedOnLedgerSuccessfully();

finalizeMessageSignature(requestToken, tabId, {
signature: signatureVrsToRsv(resp.signatureVRS.toString('hex')),
publicKey: account.stxPublicKey,
finalizeMessageSignature({
requestPayload: requestToken,
tabId,
data: {
signature: signatureVrsToRsv(resp.signatureVRS.toString('hex')),
publicKey: account.stxPublicKey,
},
});

await stacksApp.transport.close();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState } from 'react';
import { Outlet, useNavigate } from 'react-router-dom';
import { LedgerError } from '@zondax/ledger-blockstack';
import { LedgerError } from '@zondax/ledger-stacks';
import toast from 'react-hot-toast';

import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { delay } from '@app/common/utils';
import * as secp from '@noble/secp256k1';
import { logger } from '@shared/logger';
import { AddressVersion } from '@stacks/transactions';
import StacksApp from '@zondax/ledger-blockstack';
import StacksApp from '@zondax/ledger-stacks';

import {
getIdentityDerivationPath,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect, useState } from 'react';
import { Outlet, useLocation, useNavigate } from 'react-router-dom';
import { LedgerError } from '@zondax/ledger-blockstack';
import { LedgerError } from '@zondax/ledger-stacks';
import get from 'lodash.get';

import { delay } from '@app/common/utils';
Expand Down
2 changes: 1 addition & 1 deletion src/app/features/ledger/ledger-utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState } from 'react';
import Transport from '@ledgerhq/hw-transport-webusb';
import StacksApp, { LedgerError, ResponseVersion } from '@zondax/ledger-blockstack';
import StacksApp, { LedgerError, ResponseVersion } from '@zondax/ledger-stacks';
import { compare } from 'compare-versions';

import {
Expand Down
15 changes: 8 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6523,14 +6523,15 @@
resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d"
integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==

"@zondax/ledger-blockstack@0.22.8":
version "0.22.8"
resolved "https://registry.yarnpkg.com/@zondax/ledger-blockstack/-/ledger-blockstack-0.22.8.tgz#55da2eca342bc7c3a9a112cd5a36047b063fb1d3"
integrity sha512-syUw2Oi6hDAD4TX1XN+Y5UPDbKeKbcVnxRy3YdBPN87sTDyqFcEeEE/88S93oNuL889TQSVVpw29xRwo3IcvBg==
"@zondax/ledger-stacks@1.0.1":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@zondax/ledger-stacks/-/ledger-stacks-1.0.1.tgz#1940893bd1da89eec8d1a20f44cab755245c345a"
integrity sha512-zHUgKajVGfyAoCcavocqS3nRdisZ4EYn/hXbK6Z3MfV2lGm6mYRLqOROwSZe/EDSVgV4+pHoka6F+w35rCuXbw==
dependencies:
"@babel/runtime" "^7.12.5"
"@ledgerhq/hw-transport" "^5.51.1"
"@stacks/transactions" "^4.1.0"
varuint-bitcoin "^1.1.2"

JSONStream@^1.3.5:
version "1.3.5"
Expand Down Expand Up @@ -9502,9 +9503,9 @@ ee-first@1.1.1:
integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==

electron-to-chromium@^1.4.17, electron-to-chromium@^1.4.202:
version "1.4.227"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.227.tgz#28e46e2a701fed3188db3ca7bf0a3a475e484046"
integrity sha512-I9VVajA3oswIJOUFg2PSBqrHLF5Y+ahIfjOV9+v6uYyBqFZutmPxA6fxocDUUmgwYevRWFu1VjLyVG3w45qa/g==
version "1.4.226"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.226.tgz#837ea1d19b8305a913cd5f31d135681c4b6d63b1"
integrity sha512-CvevLaSiUp0u12K0e+QhMX1hn724nSUNO9ToBek+FMHk/5RofrQs5MChjrD0re0IwqxDFxFMSZD+uic05i2Z5w==

electron@^18.0.1:
version "18.3.9"
Expand Down

0 comments on commit fddf99e

Please sign in to comment.