@interfold/sdk 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -1
- package/dist/contracts/index.cjs +4 -6
- package/dist/contracts/index.cjs.map +1 -1
- package/dist/contracts/index.d.ts +2 -2
- package/dist/contracts/index.js +4 -6
- package/dist/contracts/index.js.map +1 -1
- package/dist/crypto/index.cjs +27 -26
- package/dist/crypto/index.cjs.map +1 -1
- package/dist/crypto/index.js +26 -25
- package/dist/crypto/index.js.map +1 -1
- package/dist/events/index.cjs +6 -1
- package/dist/events/index.cjs.map +1 -1
- package/dist/events/index.d.ts +4 -1
- package/dist/events/index.js +6 -1
- package/dist/events/index.js.map +1 -1
- package/dist/index.cjs +54 -34
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +11 -4
- package/dist/index.js +53 -33
- package/dist/index.js.map +1 -1
- package/dist/{types-kialnw3s.d.ts → types-s67c2A1z.d.ts} +1 -3
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PublicClient, WalletClient, Chain, Hash, Abi, Log, Address } from 'viem';
|
|
2
|
-
import { C as ContractAddresses, E as E3, a as E3RequestParams, F as FailureReason, b as E3Stage } from './types-
|
|
3
|
-
export { c as CommitteeSize, v as validateCommitteeSize } from './types-
|
|
2
|
+
import { C as ContractAddresses, E as E3, a as E3RequestParams, F as FailureReason, b as E3Stage } from './types-s67c2A1z.js';
|
|
3
|
+
export { c as CommitteeSize, v as validateCommitteeSize } from './types-s67c2A1z.js';
|
|
4
4
|
import { ThresholdBfvParamsPresetName, BfvParams, EncryptedValueAndPublicInputs, VerifiableEncryptionResult } from './crypto/index.js';
|
|
5
5
|
export { ThresholdBfvParamsPresetNames, computePublicKeyCommitment, encryptNumber, encryptNumberAndGenInputs, encryptNumberAndGenProof, encryptVector, encryptVectorAndGenInputs, encryptVectorAndGenProof, generateProof, generatePublicKey, getThresholdBfvParamsSet } from './crypto/index.js';
|
|
6
6
|
import { AllEventTypes, EventCallback } from './events/index.js';
|
|
@@ -27,6 +27,14 @@ declare class InterfoldSDK {
|
|
|
27
27
|
getThresholdBfvParamsSet(): Promise<BfvParams>;
|
|
28
28
|
generatePublicKey(): Promise<Uint8Array>;
|
|
29
29
|
computePublicKeyCommitment(publicKey: Uint8Array): Promise<Uint8Array>;
|
|
30
|
+
/**
|
|
31
|
+
* Validate serialized BFV public-key bytes before using them for encryption.
|
|
32
|
+
*
|
|
33
|
+
* `CommitteePublished.publicKey` is an untrusted transport value. Consumers
|
|
34
|
+
* must compare its semantic BFV commitment with the event's on-chain
|
|
35
|
+
* `pkCommitment` before accepting it.
|
|
36
|
+
*/
|
|
37
|
+
validatePublicKeyCommitment(publicKey: Uint8Array, expectedCommitment: Uint8Array): Promise<boolean>;
|
|
30
38
|
encryptNumber(data: bigint, publicKey: Uint8Array): Promise<Uint8Array>;
|
|
31
39
|
encryptVector(data: BigUint64Array, publicKey: Uint8Array): Promise<Uint8Array>;
|
|
32
40
|
encryptNumberAndGenInputs(data: bigint, publicKey: Uint8Array): Promise<EncryptedValueAndPublicInputs>;
|
|
@@ -41,11 +49,10 @@ declare class InterfoldSDK {
|
|
|
41
49
|
paramSet: number;
|
|
42
50
|
computeProviderParams: `0x${string}`;
|
|
43
51
|
customParams?: `0x${string}`;
|
|
44
|
-
proofAggregationEnabled?: boolean;
|
|
45
52
|
gasLimit?: bigint;
|
|
46
53
|
}): Promise<Hash>;
|
|
47
54
|
getE3PublicKey(e3Id: bigint): Promise<`0x${string}`>;
|
|
48
|
-
publishCiphertextOutput(e3Id: bigint, ciphertextOutput: `0x${string}`, proof: `0x${string}`, gasLimit?: bigint): Promise<Hash>;
|
|
55
|
+
publishCiphertextOutput(e3Id: bigint, ciphertextOutput: `0x${string}`, ciphertextCommitment: `0x${string}`, proof: `0x${string}`, gasLimit?: bigint): Promise<Hash>;
|
|
49
56
|
getE3(e3Id: bigint): Promise<E3>;
|
|
50
57
|
getE3Quote(params: E3RequestParams): Promise<bigint>;
|
|
51
58
|
getFailureReason(e3Id: bigint): Promise<FailureReason>;
|