Skip to main content

Library Reference

Complete API reference for the Inco Lightning SDK.

Types

Encrypted data types and input functions

Operations

Arithmetic, comparison, bitwise, and control flow

Account Structs

CPI account structures for operations

Quick Reference

Types

TypeDescription
Euint128Handle to encrypted unsigned 128-bit integer
EboolHandle to encrypted boolean

Input Functions

FunctionDescription
new_euint128Create encrypted u128 from ciphertext
new_eboolCreate encrypted bool from ciphertext
as_euint128Convert plaintext u128 to encrypted handle
as_eboolConvert plaintext bool to encrypted handle

Operations

FunctionDescription
e_addAddition
e_subSubtraction
e_mulMultiplication
e_remRemainder
e_ge, e_gt, e_le, e_lt, e_eqComparisons
e_and, e_or, e_not, e_shl, e_shrBitwise
e_randRandom number generation
e_selectConditional selection

Access Control

FunctionDescription
allowGrant/revoke decryption access
is_allowedCheck decryption permission
is_validsignatureVerify attestation signatures
Every operation that produces a new handle requires calling allow() to grant decryption access. Use the remaining_accounts pattern to pass allowance PDAs and grant access in the same transaction. See Access Control for simulation patterns.

Account Structs

StructUsed For
OperationAll encrypted operations
AllowGranting/revoking access
IsAllowedChecking permissions
VerifySignatureAttestation verification