@inco/js 0.6.9 → 0.7.1
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 +8 -8
- package/dist/cjs/advancedacl/session-key.d.ts +39 -26
- package/dist/cjs/advancedacl/session-key.js +53 -136
- package/dist/cjs/attestedcompute/attested-compute.d.ts +6 -6
- package/dist/cjs/attestedcompute/attested-compute.js +5 -35
- package/dist/cjs/attesteddecrypt/attested-decrypt.d.ts +36 -21
- package/dist/cjs/attesteddecrypt/attested-decrypt.js +107 -108
- package/dist/cjs/attesteddecrypt/types.d.ts +4 -4
- package/dist/cjs/generated/es/inco/covalidator/compute/v1/types_pb.d.ts +15 -1
- package/dist/cjs/generated/es/inco/covalidator/compute/v1/types_pb.js +1 -1
- package/dist/cjs/generated/es/inco/kms/lite/v1/kms_service_pb.d.ts +13 -5
- package/dist/cjs/generated/es/inco/kms/lite/v1/kms_service_pb.js +3 -4
- package/dist/cjs/generated/lightning.d.ts +40 -0
- package/dist/cjs/generated/lightning.js +43 -1
- package/dist/cjs/generated/local-node.d.ts +11 -7
- package/dist/cjs/generated/local-node.js +28 -8
- package/dist/cjs/kms/client.d.ts +8 -4
- package/dist/cjs/kms/client.js +9 -4
- package/dist/cjs/kms/quorumClient.d.ts +58 -0
- package/dist/cjs/kms/quorumClient.js +378 -0
- package/dist/cjs/kms/thresholdPromises.d.ts +7 -0
- package/dist/cjs/kms/thresholdPromises.js +52 -0
- package/dist/cjs/lite/ecies.d.ts +2 -0
- package/dist/cjs/lite/ecies.js +5 -2
- package/dist/cjs/lite/index.d.ts +0 -1
- package/dist/cjs/lite/index.js +1 -2
- package/dist/cjs/lite/lightning.d.ts +110 -74
- package/dist/cjs/lite/lightning.js +272 -127
- package/dist/cjs/local/local-node.d.ts +1 -2
- package/dist/cjs/local/local-node.js +2 -3
- package/dist/cjs/test/mocks.d.ts +3 -0
- package/dist/cjs/test/mocks.js +19 -1
- package/dist/cjs/viem.d.ts +2 -4
- package/dist/cjs/viem.js +6 -2
- package/dist/esm/advancedacl/session-key.d.ts +39 -26
- package/dist/esm/advancedacl/session-key.js +44 -126
- package/dist/esm/attestedcompute/attested-compute.d.ts +6 -6
- package/dist/esm/attestedcompute/attested-compute.js +6 -36
- package/dist/esm/attesteddecrypt/attested-decrypt.d.ts +36 -21
- package/dist/esm/attesteddecrypt/attested-decrypt.js +106 -108
- package/dist/esm/attesteddecrypt/types.d.ts +4 -4
- package/dist/esm/generated/es/inco/covalidator/compute/v1/types_pb.d.ts +15 -1
- package/dist/esm/generated/es/inco/covalidator/compute/v1/types_pb.js +1 -1
- package/dist/esm/generated/es/inco/kms/lite/v1/kms_service_pb.d.ts +13 -5
- package/dist/esm/generated/es/inco/kms/lite/v1/kms_service_pb.js +2 -3
- package/dist/esm/generated/lightning.d.ts +40 -0
- package/dist/esm/generated/lightning.js +43 -1
- package/dist/esm/generated/local-node.d.ts +11 -7
- package/dist/esm/generated/local-node.js +28 -8
- package/dist/esm/kms/client.d.ts +8 -4
- package/dist/esm/kms/client.js +8 -4
- package/dist/esm/kms/quorumClient.d.ts +58 -0
- package/dist/esm/kms/quorumClient.js +374 -0
- package/dist/esm/kms/thresholdPromises.d.ts +7 -0
- package/dist/esm/kms/thresholdPromises.js +49 -0
- package/dist/esm/lite/ecies.d.ts +2 -0
- package/dist/esm/lite/ecies.js +4 -2
- package/dist/esm/lite/index.d.ts +0 -1
- package/dist/esm/lite/index.js +1 -2
- package/dist/esm/lite/lightning.d.ts +110 -74
- package/dist/esm/lite/lightning.js +276 -131
- package/dist/esm/local/local-node.d.ts +1 -2
- package/dist/esm/local/local-node.js +2 -3
- package/dist/esm/test/mocks.d.ts +3 -0
- package/dist/esm/test/mocks.js +17 -1
- package/dist/esm/viem.d.ts +2 -4
- package/dist/esm/viem.js +6 -2
- package/dist/types/advancedacl/session-key.d.ts +39 -26
- package/dist/types/attestedcompute/attested-compute.d.ts +6 -6
- package/dist/types/attesteddecrypt/attested-decrypt.d.ts +36 -21
- package/dist/types/attesteddecrypt/types.d.ts +4 -4
- package/dist/types/generated/es/inco/covalidator/compute/v1/types_pb.d.ts +15 -1
- package/dist/types/generated/es/inco/kms/lite/v1/kms_service_pb.d.ts +13 -5
- package/dist/types/generated/lightning.d.ts +40 -0
- package/dist/types/generated/local-node.d.ts +11 -7
- package/dist/types/kms/client.d.ts +8 -4
- package/dist/types/kms/quorumClient.d.ts +58 -0
- package/dist/types/kms/thresholdPromises.d.ts +7 -0
- package/dist/types/lite/ecies.d.ts +2 -0
- package/dist/types/lite/index.d.ts +0 -1
- package/dist/types/lite/lightning.d.ts +110 -74
- package/dist/types/local/local-node.d.ts +1 -2
- package/dist/types/test/mocks.d.ts +3 -0
- package/dist/types/viem.d.ts +2 -4
- package/package.json +6 -3
- package/dist/cjs/attestedreveal/attested-reveal.d.ts +0 -21
- package/dist/cjs/attestedreveal/attested-reveal.js +0 -69
- package/dist/cjs/attestedreveal/index.d.ts +0 -1
- package/dist/cjs/attestedreveal/index.js +0 -18
- package/dist/cjs/attestedreveal/types.d.ts +0 -7
- package/dist/cjs/attestedreveal/types.js +0 -16
- package/dist/cjs/generated/es/cosmos_proto/cosmos_pb.d.ts +0 -174
- package/dist/cjs/generated/es/cosmos_proto/cosmos_pb.js +0 -118
- package/dist/cjs/generated/es/inco/fhe/v1/types_pb.d.ts +0 -419
- package/dist/cjs/generated/es/inco/fhe/v1/types_pb.js +0 -136
- package/dist/cjs/lite/reencrypt.d.ts +0 -21
- package/dist/cjs/lite/reencrypt.js +0 -141
- package/dist/esm/attestedreveal/attested-reveal.d.ts +0 -21
- package/dist/esm/attestedreveal/attested-reveal.js +0 -66
- package/dist/esm/attestedreveal/index.d.ts +0 -1
- package/dist/esm/attestedreveal/index.js +0 -2
- package/dist/esm/attestedreveal/types.d.ts +0 -7
- package/dist/esm/attestedreveal/types.js +0 -12
- package/dist/esm/generated/es/cosmos_proto/cosmos_pb.d.ts +0 -174
- package/dist/esm/generated/es/cosmos_proto/cosmos_pb.js +0 -115
- package/dist/esm/generated/es/inco/fhe/v1/types_pb.d.ts +0 -419
- package/dist/esm/generated/es/inco/fhe/v1/types_pb.js +0 -133
- package/dist/esm/lite/reencrypt.d.ts +0 -21
- package/dist/esm/lite/reencrypt.js +0 -131
- package/dist/types/attestedreveal/attested-reveal.d.ts +0 -21
- package/dist/types/attestedreveal/index.d.ts +0 -1
- package/dist/types/attestedreveal/types.d.ts +0 -7
- package/dist/types/generated/es/cosmos_proto/cosmos_pb.d.ts +0 -174
- package/dist/types/generated/es/inco/fhe/v1/types_pb.d.ts +0 -419
- package/dist/types/lite/reencrypt.d.ts +0 -21
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { Account, Chain, PublicClient, Transport, WalletClient } from 'viem';
|
|
1
|
+
import { Account, Chain, GetContractReturnType, PublicClient, Transport, WalletClient } from 'viem';
|
|
2
2
|
import { AllowanceVoucherWithSig } from '../advancedacl/types.js';
|
|
3
3
|
import { AttestedComputeOP } from '../attestedcompute/types.js';
|
|
4
|
-
import { DecryptionAttestation } from '../attesteddecrypt/index.js';
|
|
4
|
+
import { DecryptionAttestation, EncryptedDecryptionAttestation } from '../attesteddecrypt/index.js';
|
|
5
5
|
import { Address, HexString } from '../binary.js';
|
|
6
|
-
import { EciesScheme,
|
|
6
|
+
import { EciesScheme, SupportedFheType } from '../encryption/index.js';
|
|
7
|
+
import { incoVerifierAbi } from '../generated/abis/verifier.js';
|
|
7
8
|
import { lightningDeployments } from '../generated/lightning.js';
|
|
8
9
|
import { localNodeLightningConfig } from '../generated/local-node.js';
|
|
10
|
+
import { FheType } from '../handle.js';
|
|
9
11
|
import { LocalNodeEnv } from '../local/index.js';
|
|
10
|
-
import type { Reencryptor } from '../reencryption/index.js';
|
|
11
12
|
import { BackoffConfig } from '../retry.js';
|
|
12
13
|
import { Secp256k1Keypair } from './ecies.js';
|
|
13
14
|
type TupleToUnion<T> = T extends readonly unknown[] ? T[number] : never;
|
|
@@ -23,6 +24,7 @@ export type SupportedNativeType = boolean | bigint | number;
|
|
|
23
24
|
export type EncryptionContext = {
|
|
24
25
|
accountAddress: string;
|
|
25
26
|
dappAddress: string;
|
|
27
|
+
handleType: FheType;
|
|
26
28
|
};
|
|
27
29
|
export type DeploymentSlice = {
|
|
28
30
|
executorAddress: string;
|
|
@@ -31,22 +33,35 @@ export type DeploymentSlice = {
|
|
|
31
33
|
export type CustomConfig = {
|
|
32
34
|
executorAddress: string;
|
|
33
35
|
chainId: number;
|
|
34
|
-
|
|
36
|
+
covalidatorUrls: string[];
|
|
37
|
+
signers?: Address[];
|
|
35
38
|
hostChainRpcUrl?: string;
|
|
36
39
|
senderPrivateKey?: HexString;
|
|
37
40
|
};
|
|
38
41
|
export type CustomDeployment = DeploymentSlice & CustomConfig;
|
|
42
|
+
export type IncoVerifierConfig = {
|
|
43
|
+
threshold: number;
|
|
44
|
+
signers: Address[];
|
|
45
|
+
eciesPubKey: HexString;
|
|
46
|
+
};
|
|
47
|
+
type LocalNodeEnvFileSource = {
|
|
48
|
+
filePath: string;
|
|
49
|
+
};
|
|
39
50
|
/**
|
|
40
51
|
* The Lightning class provides a convenient way to interact with the Inco Lightning contract by binding to a specific
|
|
41
52
|
* deployment.
|
|
42
53
|
*/
|
|
43
54
|
export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
|
|
44
55
|
private readonly _deployment;
|
|
45
|
-
readonly
|
|
56
|
+
private readonly covalidatorUrls;
|
|
57
|
+
private readonly signers;
|
|
58
|
+
private readonly threshold;
|
|
59
|
+
private readonly eciesPubKey;
|
|
46
60
|
readonly executorAddress: Address;
|
|
47
61
|
readonly chainId: bigint;
|
|
48
62
|
private readonly ephemeralKeypair;
|
|
49
|
-
private readonly
|
|
63
|
+
private readonly kmsQuorumClient;
|
|
64
|
+
private readonly encryptor;
|
|
50
65
|
private constructor();
|
|
51
66
|
/**
|
|
52
67
|
* Get a Lightning instance bound to the latest Lightning deployment for the Base Sepolia testnet.
|
|
@@ -73,7 +88,7 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
|
|
|
73
88
|
*
|
|
74
89
|
* @param filePath the path to the file containing the environment variables in dotenv format
|
|
75
90
|
*/
|
|
76
|
-
static localNodeFromEnv(
|
|
91
|
+
static localNodeFromEnv(source?: string | Buffer | LocalNodeEnvFileSource): Promise<Lightning<CustomDeployment>>;
|
|
77
92
|
/**
|
|
78
93
|
* Get a Lightning deployment by name or executor address on a particular chain.
|
|
79
94
|
*
|
|
@@ -87,7 +102,6 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
|
|
|
87
102
|
* additional fields past will be made available as part of the `deployment` property.
|
|
88
103
|
*/
|
|
89
104
|
static custom<T extends CustomConfig>(config: T): Promise<Lightning<DeploymentSlice & T>>;
|
|
90
|
-
static getEciesPublicKey(client: PublicClient, executorAddress: Address): Promise<HexString>;
|
|
91
105
|
/**
|
|
92
106
|
* Get the latest deployment for a given pepper, which usually denotes a family of deployments distinct from their
|
|
93
107
|
* version such as 'devnet', 'testnet', 'mainnet', etc.
|
|
@@ -102,7 +116,7 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
|
|
|
102
116
|
* will not be compatible with the new version.
|
|
103
117
|
*
|
|
104
118
|
* @param pepper the pepper to use to filter the deployments
|
|
105
|
-
* @param
|
|
119
|
+
* @param chain the chain to use to filter the deployments
|
|
106
120
|
*/
|
|
107
121
|
static latest<P extends Pepper>(pepper: P, chainId: ChainId): Promise<Lightning<Deployment>>;
|
|
108
122
|
get deployment(): T;
|
|
@@ -112,17 +126,13 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
|
|
|
112
126
|
* @param value a boolean or numeric value to encrypt
|
|
113
127
|
* @param accountAddress the address of the account interacting with the dapp contract, normally an Externally Owned Account (EOA)
|
|
114
128
|
* @param dappAddress the address of the dapp contract that interacts with the Inco Lightning contract or library
|
|
129
|
+
* @param handleType (optional) the handle type to be used for encrypting the value - this is required in case of non-default handle types
|
|
130
|
+
* default handle types:
|
|
131
|
+
* - boolean -> handleTypes.ebool
|
|
132
|
+
* - number | bigint -> handleTypes.euint256
|
|
133
|
+
* @returns a promise that resolves to the encrypted value as a HexString
|
|
115
134
|
*/
|
|
116
|
-
encrypt<T extends SupportedNativeType>(value: T, { accountAddress, dappAddress }: EncryptionContext
|
|
117
|
-
/**
|
|
118
|
-
* Obtain a reencryptor for a particular Externally Owned Account (EOA) to request decrypted values.
|
|
119
|
-
* The account associated with the walletClient must have permissions to decrypt the handle or ciphertext passed
|
|
120
|
-
* to the reencryptor function.
|
|
121
|
-
*
|
|
122
|
-
* @param walletClient the wallet client to use for signing the reencrypt request.
|
|
123
|
-
*/
|
|
124
|
-
getReencryptor(walletClient: WalletClient<Transport, Chain, Account>): Promise<Reencryptor<EciesScheme>>;
|
|
125
|
-
getEncryptor(eciesPubkey: HexString): Encryptor<EciesScheme>;
|
|
135
|
+
encrypt<T extends SupportedNativeType>(value: T, { accountAddress, dappAddress, handleType }: EncryptionContext): Promise<HexString>;
|
|
126
136
|
/**
|
|
127
137
|
* Grants a session key allowance voucher for secure reencryption operations.
|
|
128
138
|
*
|
|
@@ -147,24 +157,6 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
|
|
|
147
157
|
* ```
|
|
148
158
|
*/
|
|
149
159
|
grantSessionKeyAllowanceVoucher(walletClient: WalletClient<Transport, Chain, Account>, granteeAddress: string, expiresAt: Date, sessionVerifierAddress: string): Promise<AllowanceVoucherWithSig>;
|
|
150
|
-
/**
|
|
151
|
-
* Creates a session key reencryptor for secure data reencryption operations.
|
|
152
|
-
*
|
|
153
|
-
* This method returns a reencryptor instance that can be used to perform reencryption
|
|
154
|
-
* operations using session keys. The reencryptor is configured with the provided
|
|
155
|
-
* allowance voucher and ephemeral keypair for secure communication.
|
|
156
|
-
*
|
|
157
|
-
* @param allowanceVoucherWithSig - The signed allowance voucher obtained from grantSessionKeyAllowanceVoucher
|
|
158
|
-
* @param ephemeralKeypair - The ephemeral keypair used for secure communication with the KMS make sure it has allowance to voucher
|
|
159
|
-
* @returns A reencryptor instance configured for session key operations
|
|
160
|
-
*
|
|
161
|
-
* @example
|
|
162
|
-
* ```typescript
|
|
163
|
-
* const reencryptor = await lightning.getSessionKeyRencryptor(voucher, ephemeralKeypair);
|
|
164
|
-
* const decryptedValue = await reencryptor({handle: resultHandle});
|
|
165
|
-
* ```
|
|
166
|
-
*/
|
|
167
|
-
getSessionKeyRencryptor(allowanceVoucherWithSig: AllowanceVoucherWithSig, ephemeralKeypair: Secp256k1Keypair): Promise<(<T_1 extends SupportedFheType>({ handle, }: import("../reencryption/types.js").ReencryptFnArgs<EciesScheme, T_1>) => Promise<PlaintextOf<1, 0 | 5 | 7 | 8>>)>;
|
|
168
160
|
/**
|
|
169
161
|
* Updates the active session nonce for the given wallet client.
|
|
170
162
|
*
|
|
@@ -176,35 +168,68 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
|
|
|
176
168
|
*/
|
|
177
169
|
updateActiveVouchersSessionNonce(walletClient: WalletClient<Transport, Chain, Account>): Promise<HexString>;
|
|
178
170
|
/**
|
|
179
|
-
*
|
|
171
|
+
* Requests attested decrypts signed by the covalidator using a wallet client.
|
|
180
172
|
*
|
|
181
|
-
* @param walletClient
|
|
182
|
-
* @param handles -
|
|
183
|
-
* @param backoffConfig
|
|
184
|
-
* @returns The decryption attestations
|
|
173
|
+
* @param walletClient Wallet used to sign the EIP-712 request.
|
|
174
|
+
* @param handles 32-byte handles to decrypt.
|
|
175
|
+
* @param backoffConfig Optional retry configuration.
|
|
185
176
|
*
|
|
186
|
-
* @example
|
|
187
|
-
* ```
|
|
188
|
-
* const
|
|
189
|
-
*
|
|
177
|
+
* @example Plaintext results
|
|
178
|
+
* ```ts
|
|
179
|
+
* const attestations = await lightning.attestedDecrypt(walletClient, [handle]);
|
|
180
|
+
* console.log(attestations[0].plaintext.value);
|
|
181
|
+
* ```
|
|
182
|
+
*
|
|
183
|
+
* @example Reencrypt for a delegate
|
|
184
|
+
* ```ts
|
|
185
|
+
* const encrypted = await lightning.attestedDecrypt(walletClient, [handle], delegatePubKey);
|
|
186
|
+
* console.log(encrypted[0].encryptedPlaintext.ciphertext.value);
|
|
187
|
+
* ```
|
|
188
|
+
*
|
|
189
|
+
* @example Reencrypt and decrypt locally
|
|
190
|
+
* ```ts
|
|
191
|
+
* const decrypted = await lightning.attestedDecrypt(
|
|
192
|
+
* walletClient,
|
|
193
|
+
* [handle],
|
|
194
|
+
* keypair.encodePublicKey(),
|
|
195
|
+
* keypair,
|
|
196
|
+
* );
|
|
197
|
+
* console.log(decrypted[0].plaintext.value);
|
|
190
198
|
* ```
|
|
191
199
|
*/
|
|
192
200
|
attestedDecrypt(walletClient: WalletClient<Transport, Chain, Account>, handles: HexString[], backoffConfig?: Partial<BackoffConfig>): Promise<Array<DecryptionAttestation<EciesScheme, SupportedFheType>>>;
|
|
201
|
+
attestedDecrypt(walletClient: WalletClient<Transport, Chain, Account>, handles: HexString[], reencryptPubKey: Uint8Array, backoffConfig?: Partial<BackoffConfig>): Promise<Array<EncryptedDecryptionAttestation<EciesScheme, SupportedFheType>>>;
|
|
202
|
+
attestedDecrypt(walletClient: WalletClient<Transport, Chain, Account>, handles: HexString[], reencryptPubKey: Uint8Array, reencryptKeypair: Secp256k1Keypair, backoffConfig?: Partial<BackoffConfig>): Promise<Array<DecryptionAttestation<EciesScheme, SupportedFheType>>>;
|
|
193
203
|
/**
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
*
|
|
204
|
+
* Requests attested decrypts using a voucher-backed session key.
|
|
205
|
+
*
|
|
206
|
+
* @param ephemeralKeypair Session keypair matching the voucher grantee.
|
|
207
|
+
* @param allowanceVoucherWithSig Signed allowance voucher.
|
|
208
|
+
* @param handles Handles to decrypt.
|
|
209
|
+
* @param options Optional reencryption/backoff configuration.
|
|
198
210
|
*
|
|
199
|
-
* @
|
|
200
|
-
*
|
|
201
|
-
*
|
|
202
|
-
*
|
|
203
|
-
*
|
|
211
|
+
* @example Plaintext results
|
|
212
|
+
* ```ts
|
|
213
|
+
* const attestations = await lightning.attestedDecryptWithVoucher(
|
|
214
|
+
* ephemeralKeypair,
|
|
215
|
+
* voucher,
|
|
216
|
+
* [handle],
|
|
217
|
+
* );
|
|
218
|
+
* ```
|
|
204
219
|
*
|
|
205
|
-
* @
|
|
220
|
+
* @example Reencrypt for a delegate
|
|
221
|
+
* ```ts
|
|
222
|
+
* const encrypted = await lightning.attestedDecryptWithVoucher(
|
|
223
|
+
* ephemeralKeypair,
|
|
224
|
+
* voucher,
|
|
225
|
+
* [handle],
|
|
226
|
+
* { reencryptPubKey: delegateKeypair.encodePublicKey() },
|
|
227
|
+
* );
|
|
228
|
+
* ```
|
|
206
229
|
*/
|
|
207
|
-
|
|
230
|
+
attestedDecryptWithVoucher(ephemeralKeypair: Secp256k1Keypair, allowanceVoucherWithSig: AllowanceVoucherWithSig, handles: HexString[], backoffConfig?: Partial<BackoffConfig>): Promise<Array<DecryptionAttestation<EciesScheme, SupportedFheType>>>;
|
|
231
|
+
attestedDecryptWithVoucher(ephemeralKeypair: Secp256k1Keypair, allowanceVoucherWithSig: AllowanceVoucherWithSig, handles: HexString[], reencryptPubKey: Uint8Array, backoffConfig?: Partial<BackoffConfig>): Promise<Array<EncryptedDecryptionAttestation<EciesScheme, SupportedFheType>>>;
|
|
232
|
+
attestedDecryptWithVoucher(ephemeralKeypair: Secp256k1Keypair, allowanceVoucherWithSig: AllowanceVoucherWithSig, handles: HexString[], reencryptPubKey: Uint8Array, reencryptKeypair: Secp256k1Keypair, backoffConfig?: Partial<BackoffConfig>): Promise<Array<DecryptionAttestation<EciesScheme, SupportedFheType>>>;
|
|
208
233
|
/**
|
|
209
234
|
* Get an attested compute for the given wallet client.
|
|
210
235
|
*
|
|
@@ -227,22 +252,20 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
|
|
|
227
252
|
*/
|
|
228
253
|
attestedCompute(walletClient: WalletClient<Transport, Chain, Account>, lhsHandle: HexString, op: AttestedComputeOP, rhsPlaintext: bigint | boolean, backoffConfig?: Partial<BackoffConfig>): Promise<DecryptionAttestation<EciesScheme, SupportedFheType>>;
|
|
229
254
|
/**
|
|
230
|
-
*
|
|
231
|
-
* @dev This method is used when you want to perform attested compute
|
|
232
|
-
* via an ephemeral session key and an allowance voucher. The session
|
|
233
|
-
* key setup is typically faster and more flexible than using a wallet.
|
|
234
|
-
*
|
|
235
|
-
* @param ephemeralKeypair The ephemeral Secp256k1 keypair used for secure communication.
|
|
236
|
-
* @param lhsHandle The handle to compute on
|
|
237
|
-
* @param op The operation to perform
|
|
238
|
-
* @param rhsPlaintext The plaintext to compute with
|
|
239
|
-
* @param allowanceVoucherWithSig The signed allowance voucher, obtained from
|
|
240
|
-
* `grantSessionKeyAllowanceVoucher`, proving the session key's compute rights.
|
|
241
|
-
* @param backoffConfig Optional configuration for retry and backoff strategy.
|
|
255
|
+
* Performs attested compute via a voucher-backed session key.
|
|
242
256
|
*
|
|
243
|
-
* @
|
|
257
|
+
* @example
|
|
258
|
+
* ```ts
|
|
259
|
+
* const attestation = await lightning.attestedComputeWithVoucher(
|
|
260
|
+
* ephemeralKeypair,
|
|
261
|
+
* voucher,
|
|
262
|
+
* lhsHandle,
|
|
263
|
+
* AttestedComputeSupportedOps.Eq,
|
|
264
|
+
* true,
|
|
265
|
+
* );
|
|
266
|
+
* ```
|
|
244
267
|
*/
|
|
245
|
-
|
|
268
|
+
attestedComputeWithVoucher(ephemeralKeypair: Secp256k1Keypair, allowanceVoucherWithSig: AllowanceVoucherWithSig, lhsHandle: HexString, op: AttestedComputeOP, rhsPlaintext: bigint | boolean, backoffConfig?: Partial<BackoffConfig>): Promise<DecryptionAttestation<EciesScheme, SupportedFheType>>;
|
|
246
269
|
/**
|
|
247
270
|
* Get an decryption of publicly revealed handles.
|
|
248
271
|
*
|
|
@@ -260,10 +283,23 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
|
|
|
260
283
|
/**
|
|
261
284
|
* Get the GRPC endpoint for the covalidator that services this deployment.
|
|
262
285
|
*/
|
|
263
|
-
static
|
|
286
|
+
static getCovalidatorUrls(deployment: DeploymentSlice & {
|
|
264
287
|
pepper: string;
|
|
265
|
-
}): string;
|
|
288
|
+
}, threshold: number): string[];
|
|
266
289
|
private static isIdByName;
|
|
267
290
|
private static plaintextFromValue;
|
|
291
|
+
static getEciesPublicKey(client: PublicClient, executorAddress: Address): Promise<HexString>;
|
|
292
|
+
static getIncoVerifierContract(client: PublicClient, executorAddress: Address): Promise<GetContractReturnType<typeof incoVerifierAbi, PublicClient, Address>>;
|
|
293
|
+
/**
|
|
294
|
+
* Retrieves the verifier contract details including threshold, signers, and ECIES public key from the Inco Verifier contract.
|
|
295
|
+
*
|
|
296
|
+
* @param executorAddress The address of the Inco Lightning executor contract.
|
|
297
|
+
* @param client The public client to interact with the blockchain.
|
|
298
|
+
* @returns An object containing the threshold, signers, and ECIES public key.
|
|
299
|
+
*/
|
|
300
|
+
private static getVerifierContractDetails;
|
|
301
|
+
private static getChainConfig;
|
|
302
|
+
private static supportsThresholdRetrieval;
|
|
303
|
+
private static getDefaultThresholdAndSigners;
|
|
268
304
|
}
|
|
269
305
|
export {};
|
|
@@ -4,13 +4,12 @@ export declare const LocalNodeEnv: Schema.Struct<{
|
|
|
4
4
|
STATE_DUMP: typeof Schema.String;
|
|
5
5
|
EXECUTOR_ADDRESS: Schema.brand<Schema.filter<Schema.TemplateLiteral<`0x${string}`>>, "Address">;
|
|
6
6
|
ECIES_PUBLIC_KEY: Schema.TemplateLiteral<`0x${string}`>;
|
|
7
|
-
CALLBACK_ADDRESS: Schema.TemplateLiteral<`0x${string}`>;
|
|
8
7
|
SENDER_ADDRESS: Schema.brand<Schema.filter<Schema.TemplateLiteral<`0x${string}`>>, "Address">;
|
|
9
8
|
SENDER_PRIVATE_KEY: Schema.TemplateLiteral<`0x${string}`>;
|
|
9
|
+
EIP712_SIGNER_ADDRESS: Schema.optional<Schema.TemplateLiteral<`0x${string}`>>;
|
|
10
10
|
PEPPER: typeof Schema.String;
|
|
11
11
|
COVALIDATOR_ECIES_PRIVATE_KEY: Schema.TemplateLiteral<`0x${string}`>;
|
|
12
12
|
COVALIDATOR_EIP712_PRIVATE_SIGNING_KEY: Schema.TemplateLiteral<`0x${string}`>;
|
|
13
|
-
COVALIDATOR_CALLBACK_PRIVATE_KEY: Schema.TemplateLiteral<`0x${string}`>;
|
|
14
13
|
COVALIDATOR_ACL_ADDR: Schema.brand<Schema.filter<Schema.TemplateLiteral<`0x${string}`>>, "Address">;
|
|
15
14
|
COVALIDATOR_INCO_EXECUTOR_ADDR: Schema.brand<Schema.filter<Schema.TemplateLiteral<`0x${string}`>>, "Address">;
|
|
16
15
|
COVALIDATOR_DECRYPTION_HANDLER_ADDR: Schema.brand<Schema.filter<Schema.TemplateLiteral<`0x${string}`>>, "Address">;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Account, Chain, Transport, WalletClient } from 'viem';
|
|
2
2
|
import { vi } from 'vitest';
|
|
3
3
|
import { KmsClient } from '../kms/client.js';
|
|
4
|
+
import { KmsQuorumClient } from '../kms/quorumClient.js';
|
|
4
5
|
interface MinimalKmsClient {
|
|
5
6
|
attestedCompute: ReturnType<typeof vi.fn>;
|
|
6
7
|
attestedDecrypt: ReturnType<typeof vi.fn>;
|
|
@@ -8,5 +9,7 @@ interface MinimalKmsClient {
|
|
|
8
9
|
reencrypt: ReturnType<typeof vi.fn>;
|
|
9
10
|
}
|
|
10
11
|
export declare function createMockKmsClient(): MinimalKmsClient & KmsClient;
|
|
12
|
+
export declare function createMockQuorumClient(): KmsQuorumClient;
|
|
13
|
+
export declare function setupMockInQuorumClient(quorumClient: KmsQuorumClient, mockKmsClient: MinimalKmsClient & KmsClient): void;
|
|
11
14
|
export declare function createTestWalletClient(): WalletClient<Transport, Chain, Account>;
|
|
12
15
|
export {};
|
package/dist/types/viem.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Chain } from 'viem';
|
|
1
2
|
import { Chainish } from './chain.js';
|
|
2
3
|
export declare const chains: {
|
|
3
4
|
sepolia: {
|
|
@@ -777,7 +778,4 @@ export declare const chains: {
|
|
|
777
778
|
readonly network: "worldchain-sepolia";
|
|
778
779
|
};
|
|
779
780
|
};
|
|
780
|
-
|
|
781
|
-
export type ViemChain = (typeof chains)[ChainName];
|
|
782
|
-
export declare function getViemChain(chainish: Chainish): ViemChain;
|
|
783
|
-
export {};
|
|
781
|
+
export declare function getViemChain(chainish: Chainish): Chain;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inco/js",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"repository": "https://github.com/Inco-fhevm/inco-monorepo",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"effect": "^3.17.13",
|
|
97
97
|
"elliptic": "^6.6.1",
|
|
98
98
|
"sha3": "^2.1.4",
|
|
99
|
-
"viem": "^2.
|
|
99
|
+
"viem": "^2.39.3"
|
|
100
100
|
},
|
|
101
101
|
"devDependencies": {
|
|
102
102
|
"@inco/pega": "0.0.0",
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
"@vitest/coverage-istanbul": "3.1.1",
|
|
106
106
|
"@wagmi/cli": "^2.2.0",
|
|
107
107
|
"eslint": "^9.30.1",
|
|
108
|
-
"eslint-plugin-
|
|
108
|
+
"eslint-plugin-require-extensions": "^0.1.3",
|
|
109
109
|
"ts-proto": "^2.6.1",
|
|
110
110
|
"typescript": "^5.7.3",
|
|
111
111
|
"vitest": "^3.0.4"
|
|
@@ -113,5 +113,8 @@
|
|
|
113
113
|
"publishConfig": {
|
|
114
114
|
"access": "public",
|
|
115
115
|
"registry": "https://registry.npmjs.org/"
|
|
116
|
+
},
|
|
117
|
+
"browser": {
|
|
118
|
+
"fs/promises": false
|
|
116
119
|
}
|
|
117
120
|
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { DecryptionAttestation } from '../attesteddecrypt/types.js';
|
|
2
|
-
import { HexString } from '../binary.js';
|
|
3
|
-
import { SupportedChainId } from '../chain.js';
|
|
4
|
-
import { EciesScheme, SupportedFheType } from '../encryption/encryption.js';
|
|
5
|
-
import type { KmsClient } from '../kms/client.js';
|
|
6
|
-
import type { BackoffConfig } from '../retry.js';
|
|
7
|
-
/**
|
|
8
|
-
* Just like attestedDecrypt, attestedReveal multiple revealed handles in a single attested request.
|
|
9
|
-
* Returns an array of attestations aligned with the response ordering.
|
|
10
|
-
* Handles must be revealed ahead of time using the .reveal() on-chain call.
|
|
11
|
-
*
|
|
12
|
-
* @param args - The arguments for creating the attested reveal function
|
|
13
|
-
* @returns A function that can reveal handles and return an attestation
|
|
14
|
-
* @throws {AttestedRevealError} If the creation fails
|
|
15
|
-
*/
|
|
16
|
-
export declare function attestedReveal({ handles, backoffConfig, chainId, kmsConnectRpcEndpointOrClient, }: {
|
|
17
|
-
handles: HexString[];
|
|
18
|
-
backoffConfig?: Partial<BackoffConfig> | undefined;
|
|
19
|
-
chainId: SupportedChainId;
|
|
20
|
-
kmsConnectRpcEndpointOrClient?: string | KmsClient;
|
|
21
|
-
}): Promise<Array<DecryptionAttestation<EciesScheme, SupportedFheType>>>;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.attestedReveal = attestedReveal;
|
|
4
|
-
const protobuf_1 = require("@bufbuild/protobuf");
|
|
5
|
-
const binary_js_1 = require("../binary.js");
|
|
6
|
-
const chain_js_1 = require("../chain.js");
|
|
7
|
-
const encryption_js_1 = require("../encryption/encryption.js");
|
|
8
|
-
const kms_service_pb_js_1 = require("../generated/es/inco/kms/lite/v1/kms_service_pb.js");
|
|
9
|
-
const handle_js_1 = require("../handle.js");
|
|
10
|
-
const client_js_1 = require("../kms/client.js");
|
|
11
|
-
const retry_js_1 = require("../retry.js");
|
|
12
|
-
const types_js_1 = require("./types.js");
|
|
13
|
-
/**
|
|
14
|
-
* Validates a handle format.
|
|
15
|
-
* @param handle - The handle to validate
|
|
16
|
-
* @throws {AttestedRevealError} If the handle format is invalid
|
|
17
|
-
*/
|
|
18
|
-
function validateHandle(handle) {
|
|
19
|
-
if (!handle.startsWith('0x') || handle.length !== 2 + 2 * 32) {
|
|
20
|
-
throw new types_js_1.AttestedRevealError('Invalid handle format: must be a 32-byte hex string with 0x prefix');
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Just like attestedDecrypt, attestedReveal multiple revealed handles in a single attested request.
|
|
25
|
-
* Returns an array of attestations aligned with the response ordering.
|
|
26
|
-
* Handles must be revealed ahead of time using the .reveal() on-chain call.
|
|
27
|
-
*
|
|
28
|
-
* @param args - The arguments for creating the attested reveal function
|
|
29
|
-
* @returns A function that can reveal handles and return an attestation
|
|
30
|
-
* @throws {AttestedRevealError} If the creation fails
|
|
31
|
-
*/
|
|
32
|
-
async function attestedReveal({ handles, backoffConfig, chainId, kmsConnectRpcEndpointOrClient, }) {
|
|
33
|
-
try {
|
|
34
|
-
handles.forEach(validateHandle);
|
|
35
|
-
const kmsClient = (0, client_js_1.getKmsClient)(kmsConnectRpcEndpointOrClient ||
|
|
36
|
-
(0, client_js_1.defaultCovalidatorGrpc)((0, chain_js_1.getSupportedChain)(chainId)));
|
|
37
|
-
const attestedRevealRequest = (0, protobuf_1.create)(kms_service_pb_js_1.AttestedRevealRequestSchema, {
|
|
38
|
-
handles: handles,
|
|
39
|
-
});
|
|
40
|
-
const response = await (0, retry_js_1.retryWithBackoff)(async () => {
|
|
41
|
-
return await kmsClient.attestedReveal(attestedRevealRequest);
|
|
42
|
-
}, backoffConfig);
|
|
43
|
-
if (response.decryptionAttestations.length !== handles.length) {
|
|
44
|
-
throw new types_js_1.AttestedRevealError(`Expected ${handles.length} decryption attestations in response, got ${response.decryptionAttestations.length}`);
|
|
45
|
-
}
|
|
46
|
-
const results = response.decryptionAttestations.map((att) => {
|
|
47
|
-
if (att.value === undefined) {
|
|
48
|
-
throw new types_js_1.AttestedRevealError('No value in attestation');
|
|
49
|
-
}
|
|
50
|
-
const plaintext = att.value.value;
|
|
51
|
-
const h = att.handle;
|
|
52
|
-
const handleType = (0, handle_js_1.getHandleType)(h);
|
|
53
|
-
const bigIntValue = (0, binary_js_1.bytesToBigInt)(plaintext.value);
|
|
54
|
-
return {
|
|
55
|
-
handle: h,
|
|
56
|
-
plaintext: (0, encryption_js_1.bigintToPlaintext)(encryption_js_1.encryptionSchemes.ecies, handleType, bigIntValue),
|
|
57
|
-
covalidatorSignature: att.signature,
|
|
58
|
-
};
|
|
59
|
-
});
|
|
60
|
-
return results;
|
|
61
|
-
}
|
|
62
|
-
catch (error) {
|
|
63
|
-
if (error instanceof types_js_1.AttestedRevealError) {
|
|
64
|
-
throw error;
|
|
65
|
-
}
|
|
66
|
-
throw new types_js_1.AttestedRevealError('Failed to reveal handles', error);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXR0ZXN0ZWQtcmV2ZWFsLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2F0dGVzdGVkcmV2ZWFsL2F0dGVzdGVkLXJldmVhbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQTRDQSx3Q0E4REM7QUExR0QsaURBQTRDO0FBRTVDLDRDQUF3RDtBQUN4RCwwQ0FBa0U7QUFDbEUsK0RBS3FDO0FBQ3JDLDBGQUk0RDtBQUM1RCw0Q0FBNkM7QUFFN0MsZ0RBQXdFO0FBRXhFLDBDQUErQztBQUMvQyx5Q0FBaUQ7QUFFakQ7Ozs7R0FJRztBQUNILFNBQVMsY0FBYyxDQUFDLE1BQWM7SUFDcEMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxVQUFVLENBQUMsSUFBSSxDQUFDLElBQUksTUFBTSxDQUFDLE1BQU0sS0FBSyxDQUFDLEdBQUcsQ0FBQyxHQUFHLEVBQUUsRUFBRSxDQUFDO1FBQzdELE1BQU0sSUFBSSw4QkFBbUIsQ0FDM0Isb0VBQW9FLENBQ3JFLENBQUM7SUFDSixDQUFDO0FBQ0gsQ0FBQztBQUVEOzs7Ozs7OztHQVFHO0FBQ0ksS0FBSyxVQUFVLGNBQWMsQ0FBQyxFQUNuQyxPQUFPLEVBQ1AsYUFBYSxFQUNiLE9BQU8sRUFDUCw2QkFBNkIsR0FNOUI7SUFDQyxJQUFJLENBQUM7UUFDSCxPQUFPLENBQUMsT0FBTyxDQUFDLGNBQWMsQ0FBQyxDQUFDO1FBQ2hDLE1BQU0sU0FBUyxHQUFHLElBQUEsd0JBQVksRUFDNUIsNkJBQTZCO1lBQzNCLElBQUEsa0NBQXNCLEVBQUMsSUFBQSw0QkFBaUIsRUFBQyxPQUFPLENBQUMsQ0FBQyxDQUNyRCxDQUFDO1FBRUYsTUFBTSxxQkFBcUIsR0FBMEIsSUFBQSxpQkFBTSxFQUN6RCwrQ0FBMkIsRUFDM0I7WUFDRSxPQUFPLEVBQUUsT0FBTztTQUNqQixDQUNGLENBQUM7UUFFRixNQUFNLFFBQVEsR0FBRyxNQUFNLElBQUEsMkJBQWdCLEVBQUMsS0FBSyxJQUFJLEVBQUU7WUFDakQsT0FBTyxNQUFNLFNBQVMsQ0FBQyxjQUFjLENBQUMscUJBQXFCLENBQUMsQ0FBQztRQUMvRCxDQUFDLEVBQUUsYUFBYSxDQUFDLENBQUM7UUFFbEIsSUFBSSxRQUFRLENBQUMsc0JBQXNCLENBQUMsTUFBTSxLQUFLLE9BQU8sQ0FBQyxNQUFNLEVBQUUsQ0FBQztZQUM5RCxNQUFNLElBQUksOEJBQW1CLENBQzNCLFlBQVksT0FBTyxDQUFDLE1BQU0sNkNBQTZDLFFBQVEsQ0FBQyxzQkFBc0IsQ0FBQyxNQUFNLEVBQUUsQ0FDaEgsQ0FBQztRQUNKLENBQUM7UUFFRCxNQUFNLE9BQU8sR0FDWCxRQUFRLENBQUMsc0JBQXNCLENBQUMsR0FBRyxDQUFDLENBQUMsR0FBRyxFQUFFLEVBQUU7WUFDMUMsSUFBSSxHQUFHLENBQUMsS0FBSyxLQUFLLFNBQVMsRUFBRSxDQUFDO2dCQUM1QixNQUFNLElBQUksOEJBQW1CLENBQUMseUJBQXlCLENBQUMsQ0FBQztZQUMzRCxDQUFDO1lBQ0QsTUFBTSxTQUFTLEdBQUcsR0FBRyxDQUFDLEtBQUssQ0FBQyxLQUFrQixDQUFDO1lBQy9DLE1BQU0sQ0FBQyxHQUFHLEdBQUcsQ0FBQyxNQUFtQixDQUFDO1lBQ2xDLE1BQU0sVUFBVSxHQUFHLElBQUEseUJBQWEsRUFBQyxDQUFDLENBQUMsQ0FBQztZQUNwQyxNQUFNLFdBQVcsR0FBRyxJQUFBLHlCQUFhLEVBQUMsU0FBUyxDQUFDLEtBQUssQ0FBQyxDQUFDO1lBQ25ELE9BQU87Z0JBQ0wsTUFBTSxFQUFFLENBQUM7Z0JBQ1QsU0FBUyxFQUFFLElBQUEsaUNBQWlCLEVBQzFCLGlDQUFpQixDQUFDLEtBQUssRUFDdkIsVUFBOEIsRUFDOUIsV0FBVyxDQUNaO2dCQUNELG9CQUFvQixFQUFFLEdBQUcsQ0FBQyxTQUFTO2FBQ3BDLENBQUM7UUFDSixDQUFDLENBQUMsQ0FBQztRQUVMLE9BQU8sT0FBTyxDQUFDO0lBQ2pCLENBQUM7SUFBQyxPQUFPLEtBQUssRUFBRSxDQUFDO1FBQ2YsSUFBSSxLQUFLLFlBQVksOEJBQW1CLEVBQUUsQ0FBQztZQUN6QyxNQUFNLEtBQUssQ0FBQztRQUNkLENBQUM7UUFDRCxNQUFNLElBQUksOEJBQW1CLENBQUMsMEJBQTBCLEVBQUUsS0FBSyxDQUFDLENBQUM7SUFDbkUsQ0FBQztBQUNILENBQUMifQ==
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './types.js';
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./types.js"), exports);
|
|
18
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvYXR0ZXN0ZWRyZXZlYWwvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLDZDQUEyQiJ9
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AttestedRevealError = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Custom error class for attested reveal operations.
|
|
6
|
-
*/
|
|
7
|
-
class AttestedRevealError extends Error {
|
|
8
|
-
cause;
|
|
9
|
-
constructor(message, cause) {
|
|
10
|
-
super(message);
|
|
11
|
-
this.cause = cause;
|
|
12
|
-
this.name = 'AttestedRevealError';
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
exports.AttestedRevealError = AttestedRevealError;
|
|
16
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvYXR0ZXN0ZWRyZXZlYWwvdHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUE7O0dBRUc7QUFDSCxNQUFhLG1CQUFvQixTQUFRLEtBQUs7SUFHMUI7SUFGbEIsWUFDRSxPQUFlLEVBQ0MsS0FBZTtRQUUvQixLQUFLLENBQUMsT0FBTyxDQUFDLENBQUM7UUFGQyxVQUFLLEdBQUwsS0FBSyxDQUFVO1FBRy9CLElBQUksQ0FBQyxJQUFJLEdBQUcscUJBQXFCLENBQUM7SUFDcEMsQ0FBQztDQUNGO0FBUkQsa0RBUUMifQ==
|