AccountsModule
@liquidium/client / AccountsModule
Class: AccountsModule
Defined in: packages/client/src/modules/accounts/accounts.ts:30
Profile lifecycle and linked-wallet helpers.
Constructors
Constructor
new AccountsModule(
canisterContext):AccountsModule
Defined in: packages/client/src/modules/accounts/accounts.ts:31
Parameters
canisterContext
CanisterContext
Returns
AccountsModule
Methods
createProfile()
createProfile(
params):Promise<string>
Defined in: packages/client/src/modules/accounts/accounts.ts:60
Creates a Liquidium profile using the provided wallet adapter.
This is the convenience form of prepareCreateProfile(...) plus execution.
Parameters
params
Wallet account, signing chain, and walletAdapter with signMessage.
Returns
Promise<string>
The new profile principal as text.
Throws
LiquidiumError If SDK validation or protocol submission fails.
Throws
Error If the wallet adapter rejects message signing.
getProfileId()
getProfileId(
walletAddress):Promise<string|null>
Defined in: packages/client/src/modules/accounts/accounts.ts:79
Resolves the Liquidium profile id linked to a wallet address.
Parameters
walletAddress
string
Wallet address string as registered with the protocol.
Returns
Promise<string | null>
Profile principal text, or null if none exists.
getWalletNonce()
getWalletNonce(
walletAddress):Promise<bigint>
Defined in: packages/client/src/modules/accounts/accounts.ts:132
Returns the current nonce for a wallet address.
This is mainly useful for custom signing flows built on prepared actions.
Parameters
walletAddress
string
Wallet address used in get_nonce on the lending canister.
Returns
Promise<bigint>
The next signing nonce as a bigint.
listLinkedWallets()
listLinkedWallets(
profileId):Promise<Wallet[]>
Defined in: packages/client/src/modules/accounts/accounts.ts:151
Lists the wallets currently linked to a profile.
Parameters
profileId
string
The Liquidium profile principal text.
Returns
Promise<Wallet[]>
The wallets currently linked to the requested profile.
prepareCreateProfile()
prepareCreateProfile(
options):Promise<CreateAccountAction>
Defined in: packages/client/src/modules/accounts/accounts.ts:43
Prepares a profile-creation action that can be signed and submitted later.
Use this when you need direct control over the signing flow.
Parameters
options
account is the wallet address that will own the new profile.
Returns
Promise<CreateAccountAction>
A signable CreateAccountAction with submit wired to the canister.
Throws
LiquidiumError If account validation or protocol preparation fails.
profileExists()
profileExists(
profileId):Promise<boolean>
Defined in: packages/client/src/modules/accounts/accounts.ts:107
Checks whether a profile is registered with the protocol.
Production profile registration always links an initial wallet, and the protocol prevents removal of a profile's final wallet. This method uses that invariant because the current canister API has no direct existence query.
Parameters
profileId
string
The Liquidium profile principal text.
Returns
Promise<boolean>
true when the profile has at least one linked wallet.