From 9f46e05e184eed959b265cd0cab9523f652e0a41 Mon Sep 17 00:00:00 2001 From: TejasvOnly Date: Fri, 20 Sep 2024 06:47:42 -0700 Subject: [PATCH] chore: rebase and update submodule --- apps/node/src/index.ts | 129 ++++++++++++++++++++--------------------- pnpm-lock.yaml | 41 ++++++++++++- submodules/common | 2 +- 3 files changed, 101 insertions(+), 71 deletions(-) diff --git a/apps/node/src/index.ts b/apps/node/src/index.ts index 33ebfb28..9965c8ca 100644 --- a/apps/node/src/index.ts +++ b/apps/node/src/index.ts @@ -1,5 +1,5 @@ import DeviceConnection, { - updateLogger as updateLoggerHid, + updateLogger as updateLoggerHid, } from '@cypherock/sdk-hw-hid'; import DeviceConnectionSerialport from '@cypherock/sdk-hw-serialport'; import { ManagerApp, updateLogger } from '@cypherock/sdk-app-manager'; @@ -17,72 +17,67 @@ import { createServiceLogger } from './logger'; import { InheritanceApp } from '@cypherock/sdk-app-inheritance'; const run = async () => { - updateLogger(createServiceLogger); - updateLoggerCore(createServiceLogger); - updateLoggerHid(createServiceLogger); - - setBitcoinJSLib(bitcoinJsLib); - setEthersLib(ethers); - setNearApiJs(nearApiJs); - setSolanaWeb3(solanaWeb3); - - let connection: IDeviceConnection; - - try { - connection = await DeviceConnection.create(); - } catch (error) { - connection = await DeviceConnectionSerialport.create(); - } - - console.log('started'); - - const managerApp = await ManagerApp.create(connection); - - const { walletList } = await managerApp.getWallets(); - - const inheritanceApp = await InheritanceApp.create(connection); - - setTimeout(async () => { - //console.log('aborting'); - //await inheritanceApp.abort(); - //console.log('aborted'); - }, 3000); - - //console.log(walletList[1].id.join(',')); - const walletId = walletList[1].id; - - //await inheritanceApp.authWallet({ - // challenge: walletId, - // walletId: walletId, - // withPublicKey: true, - // type: 'wallet-based', - //}); - - await inheritanceApp.testSessionStart(); - - const thing = await inheritanceApp.encryptMessagesWithPin({ - walletId: walletId, - messages: [ - { - value: 'test message', - verifyOnDevice: false, - }, - { - value: - 'Lorem ipsum dolor sit amet, -=test "device" consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', - verifyOnDevice: true, - }, - ], - }); - - const output = await inheritanceApp.decryptMessagesWithPin({ - walletId: walletId, - encryptedData: thing.encryptedPacket, - }); - - await inheritanceApp.testSessionStop(); - - console.log(JSON.stringify(output)); + updateLogger(createServiceLogger); + updateLoggerCore(createServiceLogger); + updateLoggerHid(createServiceLogger); + + setBitcoinJSLib(bitcoinJsLib); + setEthersLib(ethers); + setNearApiJs(nearApiJs); + setSolanaWeb3(solanaWeb3); + + let connection: IDeviceConnection; + + try { + connection = await DeviceConnection.create(); + } catch (error) { + connection = await DeviceConnectionSerialport.create(); + } + + console.log('started'); + + const managerApp = await ManagerApp.create(connection); + + const { walletList } = await managerApp.getWallets(); + + const inheritanceApp = await InheritanceApp.create(connection); + + setTimeout(async () => { + //console.log('aborting'); + //await inheritanceApp.abort(); + //console.log('aborted'); + }, 3000); + + //console.log(walletList[1].id.join(',')); + const walletId = walletList[1].id; + + //await inheritanceApp.authWallet({ + // challenge: walletId, + // walletId: walletId, + // withPublicKey: true, + // type: 'wallet-based', + //}); + + await inheritanceApp.testSessionStart(); + + const thing = await inheritanceApp.encryptMessagesWithPin({ + walletId: walletId, + messages: { + 2: { + value: 'test value', + verifyOnDevice: true, + }, + }, + }); + + const output = await inheritanceApp.decryptMessagesWithPin({ + walletId: walletId, + encryptedData: thing.encryptedPacket, + }); + + await inheritanceApp.testSessionStop(); + + console.log(JSON.stringify(output)); }; run(); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 99b9af9a..fcaf26ef 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,4 +1,4 @@ -lockfileVersion: '6.1' +lockfileVersion: '6.0' settings: autoInstallPeers: true @@ -706,7 +706,7 @@ importers: version: link:../util axios: specifier: ^1.3.4 - version: 1.7.0 + version: 1.7.3 compare-versions: specifier: 6.0.0-rc.1 version: 6.0.0-rc.1 @@ -5200,7 +5200,7 @@ packages: dependencies: confusing-browser-globals: 1.0.11 eslint: 7.32.0 - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@5.62.0)(eslint-import-resolver-typescript@3.6.1)(eslint@7.32.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@5.62.0)(eslint@7.32.0) object.assign: 4.1.5 object.entries: 1.1.8 semver: 6.3.1 @@ -5334,6 +5334,41 @@ packages: - eslint-import-resolver-webpack - supports-color + /eslint-plugin-import@2.29.1(@typescript-eslint/parser@5.62.0)(eslint@7.32.0): + resolution: {integrity: sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==} + engines: {node: '>=4'} + peerDependencies: + '@typescript-eslint/parser': '*' + eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 + peerDependenciesMeta: + '@typescript-eslint/parser': + optional: true + dependencies: + '@typescript-eslint/parser': 5.62.0(eslint@7.32.0)(typescript@4.9.5) + array-includes: 3.1.8 + array.prototype.findlastindex: 1.2.5 + array.prototype.flat: 1.3.2 + array.prototype.flatmap: 1.3.2 + debug: 3.2.7 + doctrine: 2.1.0 + eslint: 7.32.0 + eslint-import-resolver-node: 0.3.9 + eslint-module-utils: 2.8.1(@typescript-eslint/parser@5.62.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@7.32.0) + hasown: 2.0.2 + is-core-module: 2.15.0 + is-glob: 4.0.3 + minimatch: 3.1.2 + object.fromentries: 2.0.8 + object.groupby: 1.0.3 + object.values: 1.2.0 + semver: 6.3.1 + tsconfig-paths: 3.15.0 + transitivePeerDependencies: + - eslint-import-resolver-typescript + - eslint-import-resolver-webpack + - supports-color + dev: true + /eslint-plugin-jsx-a11y@6.9.0(eslint@7.32.0): resolution: {integrity: sha512-nOFOCaJG2pYqORjK19lqPqxMO/JpvdCZdPtNdxY3kvom3jTvkAbOvQvD8wuD0G8BYR0IGAGYDlzqWJOh/ybn2g==} engines: {node: '>=4.0'} diff --git a/submodules/common b/submodules/common index 321df93d..312f77bf 160000 --- a/submodules/common +++ b/submodules/common @@ -1 +1 @@ -Subproject commit 321df93d93a2b53a2f344f734f12dcc998218c90 +Subproject commit 312f77bf0f5a842efb04c7c131bfc522b983441a