Skip to content

Commit

Permalink
chore: undo testing code
Browse files Browse the repository at this point in the history
  • Loading branch information
TejasvOnly committed Nov 21, 2024
1 parent 6a1c7c0 commit ba0e40c
Showing 1 changed file with 16 additions and 39 deletions.
55 changes: 16 additions & 39 deletions apps/node/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { setEthersLib } from '@cypherock/sdk-app-evm';
import { setNearApiJs } from '@cypherock/sdk-app-near';
import { setSolanaWeb3 } from '@cypherock/sdk-app-solana';
import { ethers } from 'ethers';
import { InheritanceApp } from '@cypherock/sdk-app-inheritance';
import { createServiceLogger } from './logger';

const run = async () => {
Expand All @@ -33,51 +32,29 @@ const run = async () => {
} 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',
// });
const deviceInfo = await managerApp.getDeviceInfo();

await inheritanceApp.startSession();
console.log(deviceInfo);

const thing = await inheritanceApp.encryptMessagesWithPin({
walletId,
messages: {
2: {
value: 'test value',
verifyOnDevice: true,
},
},
});
await managerApp.authDevice();

const output = await inheritanceApp.decryptMessagesWithPin({
walletId,
encryptedData: thing.encryptedPacket,
});
await managerApp.trainCard({ onWallets: async () => true });

await inheritanceApp.closeSession();
await managerApp.authCard();

console.log(JSON.stringify(output));
// await managerApp.updateFirmware({
// getDevices: async () => [
// ...(await DeviceConnection.list()),
// ...(await DeviceConnectionSerialport.list()),
// ],
// createConnection: async d =>
// d.type === 'hid'
// ? DeviceConnection.connect(d)
// : DeviceConnectionSerialport.connect(d),
// allowPrerelease: true,
// }); console.log('started');
};

run();

0 comments on commit ba0e40c

Please sign in to comment.