Skip to main content
This page is under construction. A full API reference documenting all functions, parameters, and return types will be added here.

Entrypoints

EntrypointContents
@cofhe/sdkCore types: Encryptable, FheTypes, EncryptStep, CofheError, CofheErrorCode, isCofheError, assertCorrectEncryptedItemInput
@cofhe/sdk/webcreateCofheConfig, createCofheClient (browser defaults)
@cofhe/sdk/nodecreateCofheConfig, createCofheClient (Node.js defaults)
@cofhe/sdk/permitsPermitUtils, setPermit, setActivePermitHash, getPermit, getActivePermitHash
@cofhe/sdk/adaptersEthers5Adapter, Ethers6Adapter, WagmiAdapter, HardhatSignerAdapter
@cofhe/sdk/chainschains, getChainById, getChainByName, hardhat

Core types

Encryptable

Factory for creating encryptable input items.
MethodInput typeSolidity param
Encryptable.bool(value)booleanInEbool
Encryptable.uint8(value)bigint | stringInEuint8
Encryptable.uint16(value)bigint | stringInEuint16
Encryptable.uint32(value)bigint | stringInEuint32
Encryptable.uint64(value)bigint | stringInEuint64
Encryptable.uint128(value)bigint | stringInEuint128
Encryptable.address(value)bigint | stringInEaddress
Encryptable.create(type, value)variesvaries

FheTypes

Enum of supported FHE types used with decryptForView.
ValueJS return type
FheTypes.Boolboolean
FheTypes.Uint8bigint
FheTypes.Uint16bigint
FheTypes.Uint32bigint
FheTypes.Uint64bigint
FheTypes.Uint128bigint
FheTypes.Uint160string (checksummed address)

EncryptedItemInput

EncryptStep

Enum values fired during the encryption pipeline:
ValueDescription
EncryptStep.InitTfheInitialize TFHE WASM module
EncryptStep.FetchKeysFetch FHE public key and CRS
EncryptStep.PackPack plaintext values
EncryptStep.ProveGenerate ZK proof
EncryptStep.VerifySubmit to CoFHE verifier