@inco/js 0.1.9 → 0.1.10
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/dist/generated/abis/lightning.d.ts +23092 -0
- package/dist/generated/inco-lite-environments.d.ts +260 -0
- package/dist/generated/lightning.d.ts +243 -0
- package/dist/index.cjs +54336 -21094
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +73223 -22075
- package/dist/lite/advancedacl/index.d.ts +2 -0
- package/dist/lite/advancedacl/session-key.d.ts +28 -0
- package/dist/lite/advancedacl/types.d.ts +15 -0
- package/dist/lite/deployments.d.ts +2 -2
- package/dist/lite/inco-lite-environment.d.ts +23 -0
- package/dist/lite/index.cjs +2323 -1052
- package/dist/lite/index.d.ts +1 -1
- package/dist/lite/index.mjs +2429 -1051
- package/dist/reencryption/index.cjs +221 -31
- package/dist/reencryption/index.mjs +221 -31
- package/dist/reencryption/reencrypt.d.ts +20 -0
- package/dist/viem.d.ts +43 -0
- package/package.json +30 -30
@@ -0,0 +1,28 @@
|
|
1
|
+
import { Client } from '@connectrpc/connect';
|
2
|
+
import { Account, Address, Chain, Hex, Transport, WalletClient } from 'viem';
|
3
|
+
import { SupportedFheType } from '../../encryption';
|
4
|
+
import { EciesScheme } from '../../encryption/encryption';
|
5
|
+
import { KmsService } from '../../generated/es/inco/kms/lite/v1/kms_service_pb';
|
6
|
+
import { ReencryptFnArgs } from '../../reencryption';
|
7
|
+
import { Secp256k1Keypair } from '../ecies';
|
8
|
+
import { AllowanceVoucher, AllowanceVoucherWithSig } from './types';
|
9
|
+
export interface Session {
|
10
|
+
decrypter: Address;
|
11
|
+
expiresAt: bigint;
|
12
|
+
}
|
13
|
+
export declare function createAllowanceVoucher(incoLiteAddress: Address, sharerWalletClient: WalletClient<Transport, Chain, Account>, verifyingContract: Address, callFunction: Hex, sharerArgData: Hex): Promise<AllowanceVoucher>;
|
14
|
+
export declare function grantSessionKey({ chainId, incoLiteAddress, sessionVerifierContractAddress, ephemeralAddress, sharerWalletClient, expiresAt, }: {
|
15
|
+
chainId: bigint;
|
16
|
+
incoLiteAddress: Address;
|
17
|
+
sessionVerifierContractAddress: Address;
|
18
|
+
ephemeralAddress: Address;
|
19
|
+
sharerWalletClient: WalletClient<Transport, Chain, Account>;
|
20
|
+
expiresAt: bigint;
|
21
|
+
}): Promise<AllowanceVoucherWithSig>;
|
22
|
+
export interface SessionKeyReencryptorArgs {
|
23
|
+
chainId: bigint;
|
24
|
+
ephemeralKeypair: Secp256k1Keypair;
|
25
|
+
kmsConnectRpcEndpointOrClient: string | Client<typeof KmsService>;
|
26
|
+
allowanceVoucherWithSig: AllowanceVoucherWithSig;
|
27
|
+
}
|
28
|
+
export declare function sessionKeyReencryptor({ chainId, kmsConnectRpcEndpointOrClient, ephemeralKeypair, allowanceVoucherWithSig, }: SessionKeyReencryptorArgs): Promise<(<T extends SupportedFheType>({ handle }: ReencryptFnArgs<EciesScheme, T>) => Promise<import("../../encryption").PlaintextOf<1, 0 | 5 | 8>>)>;
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { Address, Hex } from 'viem';
|
2
|
+
export type AllowanceVoucher = {
|
3
|
+
sessionNonce: Hex;
|
4
|
+
verifyingContract: Address;
|
5
|
+
callFunction: Hex;
|
6
|
+
sharerArgData: Hex;
|
7
|
+
};
|
8
|
+
export interface AllowanceVoucherWithSig {
|
9
|
+
sharer: Address;
|
10
|
+
voucher: AllowanceVoucher;
|
11
|
+
voucherSignature: Hex;
|
12
|
+
}
|
13
|
+
export interface AllowanceProof extends AllowanceVoucherWithSig {
|
14
|
+
requesterArgData: Uint8Array;
|
15
|
+
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { Chainish } from '../chain';
|
2
|
-
import {
|
2
|
+
import { lightningDeployments } from '../generated/lightning';
|
3
3
|
export type Address = `0x${string}`;
|
4
|
-
export type IncoLiteDeployment = (typeof
|
4
|
+
export type IncoLiteDeployment = (typeof lightningDeployments)[number];
|
5
5
|
export declare function getActiveIncoLiteDeployment(chain: Chainish): IncoLiteDeployment;
|
6
6
|
export declare function getIncoLiteDeployments(chainId: Chainish): readonly IncoLiteDeployment[];
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { Chainish } from '../chain';
|
2
|
+
import { IncoLiteEnvironments } from '../generated/inco-lite-environments';
|
3
|
+
export type Address = `0x${string}`;
|
4
|
+
export type IncoLiteVersion = {
|
5
|
+
major: number;
|
6
|
+
minor: number;
|
7
|
+
patch: number;
|
8
|
+
salt: string;
|
9
|
+
};
|
10
|
+
export type IncoLiteDeployment = {
|
11
|
+
name: string;
|
12
|
+
chainId: number;
|
13
|
+
deployedAtAddress: Address;
|
14
|
+
deployer: Address;
|
15
|
+
extraSalt: string;
|
16
|
+
decryptSigner: Address;
|
17
|
+
eciesPublicKey: string;
|
18
|
+
version: IncoLiteVersion;
|
19
|
+
timestamp: number;
|
20
|
+
};
|
21
|
+
export type IncoLiteChainId = keyof typeof IncoLiteEnvironments;
|
22
|
+
export declare function getActiveIncoLiteDeployment(chain: Chainish): IncoLiteDeployment;
|
23
|
+
export declare function getIncoLiteDeployments(chainId: Chainish): readonly IncoLiteDeployment[];
|