@phala/dstack-sdk
Version:
DStack SDK
49 lines • 1.65 kB
TypeScript
export declare const __version__ = "0.2.1";
export interface DeriveKeyResponse {
key: string;
certificate_chain: string[];
asUint8Array: (max_length?: number) => Uint8Array;
}
export type Hex = `0x${string}`;
export type TdxQuoteHashAlgorithms = 'sha256' | 'sha384' | 'sha512' | 'sha3-256' | 'sha3-384' | 'sha3-512' | 'keccak256' | 'keccak384' | 'keccak512' | 'raw';
export interface EventLog {
imr: number;
event_type: number;
digest: string;
event: string;
event_payload: string;
}
export interface TcbInfo {
mrtd: string;
rootfs_hash: string;
rtmr0: string;
rtmr1: string;
rtmr2: string;
rtmr3: string;
event_log: EventLog[];
}
export interface TappdInfoResponse {
app_id: string;
instance_id: string;
app_cert: string;
tcb_info: TcbInfo;
app_name: string;
public_logs: boolean;
public_sysinfo: boolean;
}
export interface TdxQuoteResponse {
quote: Hex;
event_log: string;
replayRtmrs: () => string[];
}
export declare function to_hex(data: string | Buffer | Uint8Array): string;
export declare function send_rpc_request<T = any>(endpoint: string, path: string, payload: string, timeoutMs?: number): Promise<T>;
export declare class TappdClient {
private endpoint;
constructor(endpoint?: string);
deriveKey(path?: string, subject?: string, alt_names?: string[]): Promise<DeriveKeyResponse>;
tdxQuote(report_data: string | Buffer | Uint8Array, hash_algorithm?: TdxQuoteHashAlgorithms): Promise<TdxQuoteResponse>;
info(): Promise<TappdInfoResponse>;
isReachable(): Promise<boolean>;
}
//# sourceMappingURL=index.d.ts.map