Skip to content

Commit

Permalink
refactor: auth wallet params
Browse files Browse the repository at this point in the history
  • Loading branch information
irshadjsr21 committed Aug 10, 2024
1 parent 34202a6 commit 560187d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions packages/app-inheritance/src/operations/authWallet/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ export const authWallet = async (
assert(params, 'Params should be defined');
assert(params.walletId, 'walletId should be defined');
assert(params.challenge, 'challenge should be defined');
assert(params.isPublickey, 'isPublickey should be defined');
assert(
typeof params.isPublicKey === 'boolean',
'isPublicKey should be defined',
);
assert(
params.walletId.length === WALLET_ID_LENGTH,
`Wallet Id should be exactly ${WALLET_ID_LENGTH} bytes`,
Expand All @@ -49,7 +52,11 @@ export const authWallet = async (
});

await helper.sendQuery({
initiate: params,
initiate: {
challenge: params.challenge,
walletId: params.walletId,
isPublickey: params.isPublicKey,
},
});

const result = await helper.waitForResult();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ export const WALLET_ID_LENGTH = 32;
export interface IAuthWalletParams {
challenge: Uint8Array;
walletId: Uint8Array;
isPublickey: boolean;
isPublicKey: boolean;
onEvent?: AuthWalletEventHandler;
}

0 comments on commit 560187d

Please sign in to comment.