getQueryUserAccountFunction
Import:@umbra-privacy/sdk
GetQueryUserAccountFunctionArgs
client: IUmbraClient
GetQueryUserAccountFunctionDeps
accountInfoProvider?: AccountInfoProviderFunction
Returns
QueryUserAccountFunction
QueryUserAccountResult
A discriminated union:{ state: "exists"; data: EncryptedUserAccount }- The user is registered and the account was decoded.{ state: "non_existent" }- No user account exists at this address.
EncryptedUserAccount
Fields of the decoded on-chain account:versionByte: U8- Schema version.canonicalBump: U8- PDA canonical bump.isInitialised: boolean- Whether the account has been initialised.isActiveForAnonymousUsage: boolean- Whether anonymous (mixer) usage is enabled.isUserCommitmentRegistered: boolean- Whether the Poseidon commitment has been registered.isUserAccountX25519KeyRegistered: boolean- Whether the X25519 public key has been registered.x25519PublicKey: X25519PublicKey- The user’s X25519 public key (used for UTXO encryption).userCommitment: PoseidonHash- The user’s on-chain Poseidon commitment.generationIndex: U128- Current generation index used in key derivation.randomGenerationSeed: U256LeBytes- Current random generation seed.
Errors
ThrowsQueryError. See Errors.
Example
getQueryEncryptedBalanceFunction
Import:@umbra-privacy/sdk
GetQueryEncryptedBalanceFunctionArgs
client: IUmbraClient
GetQueryEncryptedBalanceFunctionDeps
accountInfoProvider?: AccountInfoProviderFunctionrcDecryptor?: RcDecryptorFunction- Override the Rescue cipher decryptor used for shared-mode balance decryption.
Returns
QueryEncryptedBalanceFunction
Map keyed by mint address. Each entry is one of:
QueryEncryptedBalanceResult
A discriminated union per mint:{ state: "shared"; balance: U64 }- Shared-mode account.balanceis the decrypted token amount in base units.{ state: "mxe" }- MXE-mode account. Balance is encrypted for the Arcium network and cannot be read client-side.{ state: "uninitialized" }- The encrypted token account exists but has not been initialised for this mint.{ state: "non_existent" }- No encrypted token account exists for this mint.
Errors
ThrowsQueryError. See Errors.
Example
QueryError
Thrown by both query functions. Stage values:"initialization" | "pda-derivation" | "account-fetch" | "account-decode" | "key-derivation" | "decryption"
"key-derivation"and"decryption"are only reachable fromgetQueryEncryptedBalanceFunction(shared-mode decryption path).