Skip to content

Commit

Permalink
fix: add bigint parameter on encrypt64
Browse files Browse the repository at this point in the history
  • Loading branch information
immortal-tofu committed Feb 19, 2024
1 parent 43a1b3f commit 56b9ec3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/sdk/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export type FhevmInstance = {
encrypt8: (value: number) => Uint8Array;
encrypt16: (value: number) => Uint8Array;
encrypt32: (value: number) => Uint8Array;
encrypt64: (value: number) => Uint8Array;
encrypt64: (value: number | bigint) => Uint8Array;
generateToken: (
options: GeneratePublicKeyParams & {
force?: boolean;
Expand Down Expand Up @@ -148,7 +148,8 @@ export const createInstance = async (

encrypt64(value) {
if (value == null) throw new Error('Missing value');
if (typeof value !== 'number') throw new Error('Value must be a number');
if (typeof value !== 'number' && typeof value !== 'bigint')
throw new Error('Value must be a number or a bigint');
if (!tfheCompactPublicKey)
throw new Error(
'Your instance has been created without the public blockchain key',
Expand Down

0 comments on commit 56b9ec3

Please sign in to comment.