lighthouse-encryption-sdk-browser
Version:
Encryption SDK: Build your trustless, decentralized and fault resistance Application using distributed key shades with threshold cryptography
85 lines (84 loc) • 2.33 kB
TypeScript
export interface KeyShard {
key: string;
index: string;
}
export type ErrorValue = string | string[] | number | boolean | null | object | any;
export interface GeneratedKey {
masterKey: string | null;
keyShards: Array<KeyShard>;
}
export interface GenerateInput {
threshold?: number;
keyCount?: number;
}
export interface AuthMessage {
message: string | null;
error: string | ErrorValue | null;
}
export interface RecoveredKey {
masterKey: string | null;
error: string | ErrorValue | null;
}
export interface RecoverShards {
shards: KeyShard[];
error: ErrorValue;
}
type WithPrefix<T extends string> = `${T}${string}`;
export type SignedMessage = string;
export type JWT = WithPrefix<'jwt:'>;
export type AuthToken = SignedMessage | JWT;
export interface LightHouseSDKResponse {
isSuccess: boolean;
error: ErrorValue;
}
export type ChainType = "EVM" | "evm" | "solana" | "SOLANA";
export type DecryptionType = "ADDRESS" | "ACCESS_CONDITIONS";
export interface ReturnValueTest {
comparator: '==' | '>=' | '<=' | '!=' | '>' | '<';
value: number | string | Array<any>;
}
export interface EVMCondition {
id: number;
standardContractType: 'ERC20' | 'ERC721' | 'ERC1155' | 'Custom' | '';
contractAddress?: string;
chain: string;
method: string;
parameters?: Array<any>;
returnValueTest: ReturnValueTest;
inputArrayType?: Array<string>;
outputType?: string;
}
export interface SolanaCondition {
id: number;
contractAddress?: string;
chain: string;
method: string;
standardContractType: 'spl-token' | '';
parameters?: Array<any>;
pdaInterface: {
offset?: number;
selector?: string;
};
returnValueTest: ReturnValueTest;
}
export type Condition = EVMCondition | SolanaCondition;
export interface UpdateConditionSchema {
chainType: 'EVM' | 'SOLANA';
conditions: Condition[];
decryptionType: 'ADDRESS' | 'ACCESS_CONDITIONS';
address: string;
cid: string;
aggregator?: string;
}
export interface AccessConditionSchema extends UpdateConditionSchema {
keyShards: Array<any>;
}
export interface IGetAccessCondition {
aggregator: string;
conditions?: Condition[];
conditionsSolana: any[];
sharedTo: any[];
owner: string;
cid: string;
}
export {};