Skip to content

Commit

Permalink
fix: fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
immortal-tofu committed Jun 27, 2024
1 parent 2d22c47 commit 74be999
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/sdk/reencrypt.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { bytesToBigInt, fromHexString } from '../utils';
import {
bytesToBigInt,
bigIntToBytes,
toHexString,
fromHexString,
} from '../utils';
import {
u8vec_to_cryptobox_pk,
default_client_for_centralized_kms,
Expand All @@ -18,11 +23,11 @@ export const reencryptRequest =
) => {
if (!gatewayUrl) throw new Error('You must provide a reencryption URL.');

const payload: { [key: string]: string } = {
signature,
user_address: userAddress,
enc_key: publicKey,
ciphertext_handle: handle.toString(),
const payload = {
signature: signature.replace(/^(0x)/, ''),
user_address: userAddress.replace(/^(0x)/, ''),
enc_key: publicKey.replace(/^(0x)/, ''),
ciphertext_handle: toHexString(bigIntToBytes(handle)),
eip712_verifying_contract: contractAddress,
};
const options = {
Expand Down

0 comments on commit 74be999

Please sign in to comment.