Skip to main content
Main TypeScript SDK class.
import { Privora } from '@privora/sdk';

const privora = await Privora.connect('http://localhost:8899');

Static Methods

connect

static async connect(url: string): Promise<Privora>
Connect to sequencer and fetch public key.

withoutKey

static withoutKey(url: string): Privora
Create without fetching key.

Properties

connection

get connection(): Connection
Underlying Solana Connection.

Methods

encrypt

encrypt<T extends EncryptedType>(value: number, type: T): PendingEncrypted<T>
Encrypt a value.

encryptBatch

encryptBatch<T extends EncryptedType>(
  inputs: Array<{ value: number; type: T }>
): Array<PendingEncrypted<T>>

submit

async submit<T extends EncryptedType>(
  encrypted: Encrypted<T> | PendingEncrypted<T>
): Promise<string>
Submit encrypted data, return hash.

submitBatch

async submitBatch<T extends EncryptedType>(
  encrypted: Array<Encrypted<T> | PendingEncrypted<T>>
): Promise<string[]>

getFheData

async getFheData(hash: string): Promise<Uint8Array>

userCrypto

userCrypto(keypair: Keypair): UserCrypto

transaction

transaction(): TransactionBuilder

getLatestBlockhash

async getLatestBlockhash(): Promise<{ blockhash: string; lastValidBlockHeight: number }>

getBalance

async getBalance(pubkey: PublicKey | string): Promise<number>

requestAirdrop

async requestAirdrop(pubkey: PublicKey | string, lamports: number): Promise<string>

getMinimumBalanceForRentExemption

async getMinimumBalanceForRentExemption(dataLength: number): Promise<number>