EncryptedType
Copy
type EncryptedType = 'u8' | 'u32' | 'u64';
PendingEncrypted
Copy
interface PendingEncrypted<T extends EncryptedType> {
type: T;
data: Uint8Array;
withUserRecovery(userCrypto: UserCrypto): Encrypted<T>;
}
Encrypted
Copy
interface Encrypted<T extends EncryptedType> {
type: T;
data: Uint8Array;
userRecovery?: UserRecoveryData;
}
UserRecoveryData
Copy
interface UserRecoveryData {
ciphertext: Uint8Array;
nonce: Uint8Array;
}
EncryptionInput
Copy
interface EncryptionInput<T extends EncryptedType = EncryptedType> {
value: number;
type: T;
}
UserCrypto
Copy
class UserCrypto {
constructor(keypair: Keypair);
/** Decrypt user recovery data */
decryptRecovery(recovery: UserRecoveryData): Uint8Array;
/** Decrypt data encrypted to self */
decryptFromSelf(ciphertext: Uint8Array, nonce: Uint8Array): Uint8Array | null;
/** Decrypt data from MPC decryption */
decryptFromMPC(
ciphertext: Uint8Array,
nonce: Uint8Array,
ephemeralPubkey: Uint8Array
): Uint8Array;
/** Encrypt data to self for recovery */
encryptToSelf(plaintext: Uint8Array): { ciphertext: Uint8Array; nonce: Uint8Array };
}
TransactionBuilder
Copy
class TransactionBuilder {
add(instruction: TransactionInstruction): TransactionBuilder;
withFheData(hashes: string[]): TransactionBuilder;
sign(signer: Keypair): TransactionBuilder;
send(): Promise<string>;
build(): Promise<Transaction>;
}
Account Types
CreateAccountParams
Copy
interface CreateAccountParams {
/** The connection to use for rent calculation */
connection: Connection;
/** The payer for the account creation */
payer: PublicKey;
/** The new account's keypair */
newAccountPubkey: PublicKey;
/** Size of account data in bytes */
space: number;
/** Program that will own the account */
programId: PublicKey;
}
BuildCreateAccountInstructionParams
Copy
interface BuildCreateAccountInstructionParams {
/** The payer for the account creation */
payer: PublicKey;
/** The new account's public key */
newAccountPubkey: PublicKey;
/** Lamports to transfer to the new account */
lamports: number;
/** Size of account data in bytes */
space: number;
/** Program that will own the account */
programId: PublicKey;
}
RPC Types
SendTransactionConfig
Copy
interface SendTransactionConfig {
/** Skip preflight transaction checks */
skipPreflight?: boolean;
/** Preflight commitment level */
preflightCommitment?: Commitment;
/** Maximum retries */
maxRetries?: number;
}
Re-exported Solana Types
For convenience, these Solana web3.js types are re-exported from@privora/sdk:
Copy
export type { Keypair, PublicKey, Transaction, TransactionInstruction } from '@solana/web3.js';