Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

style(wallet): reformat wallet api and tests

Steven Enamakel8dc8715c157e
diff --git a/app/src/features/wallet/setupLocalWalletFromMnemonic.test.ts b/app/src/features/wallet/setupLocalWalletFromMnemonic.test.ts
index 692c7dd975..2f2dd97396 100644
--- a/app/src/features/wallet/setupLocalWalletFromMnemonic.test.ts
+++ b/app/src/features/wallet/setupLocalWalletFromMnemonic.test.ts
@@ -7,7 +7,9 @@ const mockEncryptSecret = vi.fn();
const mockDeriveRecoveryMaterial = vi.fn();
const canonicalSeed = Uint8Array.from(
- '5eb00bbddcf069084889a8ab9155568165f5c453ccb85e70811aaed6f6da5fc19a5ac40b389cd370d086206dec8aa6c43daea6690f20ad3d8d48b2d2ce9e38e4'.match(/.{2}/g) ?? [],
+ '5eb00bbddcf069084889a8ab9155568165f5c453ccb85e70811aaed6f6da5fc19a5ac40b389cd370d086206dec8aa6c43daea6690f20ad3d8d48b2d2ce9e38e4'.match(
+ /.{2}/g
+ ) ?? [],
byte => Number.parseInt(byte, 16)
);
const canonicalAccounts = [
diff --git a/app/src/services/walletApi.test.ts b/app/src/services/walletApi.test.ts
index 171aa16ef0..0018d12a83 100644
--- a/app/src/services/walletApi.test.ts
+++ b/app/src/services/walletApi.test.ts
@@ -33,7 +33,9 @@ describe('walletApi', () => {
});
it('generateRecoveryPhrase requests the module-owned 12-word phrase', async () => {
- mockCallCoreRpc.mockResolvedValueOnce({ result: { phrase: 'word1 ... word12', wordCount: 12 } });
+ mockCallCoreRpc.mockResolvedValueOnce({
+ result: { phrase: 'word1 ... word12', wordCount: 12 },
+ });
const { generateRecoveryPhrase } = await import('./walletApi');
const result = await generateRecoveryPhrase();
@@ -60,7 +62,9 @@ describe('walletApi', () => {
it('deriveRecoveryMaterial requests module-owned seed and account derivation', async () => {
const seed = Array.from({ length: 64 }, (_, index) => index);
- const accounts = [{ chain: 'evm' as const, address: '0xabc', derivationPath: "m/44'/60'/0'/0/0" }];
+ const accounts = [
+ { chain: 'evm' as const, address: '0xabc', derivationPath: "m/44'/60'/0'/0/0" },
+ ];
mockCallCoreRpc.mockResolvedValueOnce({ result: { seed, accounts } });
const { deriveRecoveryMaterial } = await import('./walletApi');
diff --git a/app/src/services/walletApi.ts b/app/src/services/walletApi.ts
index 96daec0ed3..ce559d568b 100644
--- a/app/src/services/walletApi.ts
+++ b/app/src/services/walletApi.ts
@@ -93,9 +93,7 @@ export const validateRecoveryPhrase = async (phrase: string): Promise<boolean> =
/** Derive the generic storage-key seed and public accounts through TinyWallet. */
export const deriveRecoveryMaterial = async (phrase: string): Promise<WalletRecoveryMaterial> => {
- const response = await callCoreRpc<{
- result: { seed: number[]; accounts: WalletAccount[] };
- }>({
+ const response = await callCoreRpc<{ result: { seed: number[]; accounts: WalletAccount[] } }>({
method: 'openhuman.wallet_derive_recovery_material',
params: { phrase },
});