API Reference
classes
Agentclient

@coasys/ad4m / Exports / AgentClient

Class: AgentClient

Provides access to all functions regarding the local agent, such as generating, locking, unlocking, importing the DID keystore, as well as updating the publicly shared Agent expression.

Table of contents

Constructors

Properties

Methods

Constructors

constructor

• new AgentClient(client, subscribe?)

Parameters

NameTypeDefault value
clientApolloClient<any>undefined
subscribebooleantrue

Defined in

agent/AgentClient.ts:98 (opens in a new tab)

Properties

#agentStatusChangedCallbacks

• Private #agentStatusChangedCallbacks: AgentStatusChangedCallback[]

Defined in

agent/AgentClient.ts:95 (opens in a new tab)


#apolloClient

• Private #apolloClient: ApolloClient<any>

Defined in

agent/AgentClient.ts:92 (opens in a new tab)


#appsChangedCallback

• Private #appsChangedCallback: AgentAppsUpdatedCallback[]

Defined in

agent/AgentClient.ts:93 (opens in a new tab)


#hostingUserInfoChangedCallbacks

• Private #hostingUserInfoChangedCallbacks: HostingUserInfoChangedCallback[]

Defined in

agent/AgentClient.ts:96 (opens in a new tab)


#updatedCallbacks

• Private #updatedCallbacks: AgentUpdatedCallback[]

Defined in

agent/AgentClient.ts:94 (opens in a new tab)

Methods

addAgentStatusChangedListener

▸ addAgentStatusChangedListener(listener): void

Parameters

NameType
listenerany

Returns

void

Defined in

agent/AgentClient.ts:405 (opens in a new tab)


addAppChangedListener

▸ addAppChangedListener(listener): void

Parameters

NameType
listenerany

Returns

void

Defined in

agent/AgentClient.ts:362 (opens in a new tab)


addEntanglementProofs

▸ addEntanglementProofs(proofs): Promise<EntanglementProof[]>

Parameters

NameType
proofsEntanglementProofInput[]

Returns

Promise<EntanglementProof[]>

Defined in

agent/AgentClient.ts:296 (opens in a new tab)


addHostingUserInfoChangedListener

▸ addHostingUserInfoChangedListener(listener): void

Parameters

NameType
listenerHostingUserInfoChangedCallback

Returns

void

Defined in

agent/AgentClient.ts:428 (opens in a new tab)


addUpdatedListener

▸ addUpdatedListener(listener): void

Parameters

NameType
listenerany

Returns

void

Defined in

agent/AgentClient.ts:358 (opens in a new tab)


byDID

▸ byDID(did): Promise<Agent>

Parameters

NameType
didstring

Returns

Promise<Agent>

Defined in

agent/AgentClient.ts:206 (opens in a new tab)


createUser

▸ createUser(email, password, appInfo?): Promise<UserCreationResult>

Parameters

NameType
emailstring
passwordstring
appInfo?AuthInfoInput

Returns

Promise<UserCreationResult>

Defined in

agent/AgentClient.ts:564 (opens in a new tab)


deleteEntanglementProofs

▸ deleteEntanglementProofs(proofs): Promise<EntanglementProof[]>

Parameters

NameType
proofsEntanglementProofInput[]

Returns

Promise<EntanglementProof[]>

Defined in

agent/AgentClient.ts:312 (opens in a new tab)


entanglementProofPreFlight

▸ entanglementProofPreFlight(deviceKey, deviceKeyType): Promise<EntanglementProof>

Parameters

NameType
deviceKeystring
deviceKeyTypestring

Returns

Promise<EntanglementProof>

Defined in

agent/AgentClient.ts:341 (opens in a new tab)


generate

▸ generate(passphrase): Promise<AgentStatus>

Parameters

NameType
passphrasestring

Returns

Promise<AgentStatus>

Defined in

agent/AgentClient.ts:142 (opens in a new tab)


generateJwt

▸ generateJwt(requestId, rand): Promise<string>

Parameters

NameType
requestIdstring
randstring

Returns

Promise<string>

Defined in

agent/AgentClient.ts:481 (opens in a new tab)


getApps

▸ getApps(): Promise<Apps[]>

Returns

Promise<Apps[]>

Defined in

agent/AgentClient.ts:495 (opens in a new tab)


getEntanglementProofs

▸ getEntanglementProofs(): Promise<string[]>

Returns

Promise<string[]>

Defined in

agent/AgentClient.ts:328 (opens in a new tab)


hostingUserInfo

▸ hostingUserInfo(): Promise<HostingUserInfo>

Returns

Promise<HostingUserInfo>

Defined in

agent/AgentClient.ts:623 (opens in a new tab)


import

▸ import(args): Promise<AgentStatus>

Parameters

NameType
argsInitializeArgs

Returns

Promise<AgentStatus>

Defined in

agent/AgentClient.ts:158 (opens in a new tab)


isLocked

▸ isLocked(): Promise<boolean>

Returns

Promise<boolean>

Defined in

agent/AgentClient.ts:536 (opens in a new tab)


lock

▸ lock(passphrase): Promise<AgentStatus>

Parameters

NameType
passphrasestring

Returns

Promise<AgentStatus>

Defined in

agent/AgentClient.ts:178 (opens in a new tab)


loginUser

▸ loginUser(email, password): Promise<string>

Parameters

NameType
emailstring
passwordstring

Returns

Promise<string>

Defined in

agent/AgentClient.ts:580 (opens in a new tab)


me

▸ me(): Promise<Agent>

Returns the Agent expression of the local agent as it is shared publicly via the AgentLanguage.

I.e. this is the users profile.

Returns

Promise<Agent>

Defined in

agent/AgentClient.ts:118 (opens in a new tab)


mutatePublicPerspective

▸ mutatePublicPerspective(mutations): Promise<Agent>

Parameters

NameType
mutationsLinkMutations

Returns

Promise<Agent>

Defined in

agent/AgentClient.ts:246 (opens in a new tab)


permitCapability

▸ permitCapability(auth): Promise<string>

Parameters

NameType
authstring

Returns

Promise<string>

Defined in

agent/AgentClient.ts:467 (opens in a new tab)


removeApp

▸ removeApp(requestId): Promise<Apps[]>

Parameters

NameType
requestIdstring

Returns

Promise<Apps[]>

Defined in

agent/AgentClient.ts:508 (opens in a new tab)


requestCapability

▸ requestCapability(authInfo): Promise<string>

Parameters

NameType
authInfoAuthInfoInput

Returns

Promise<string>

Defined in

agent/AgentClient.ts:453 (opens in a new tab)


requestLoginVerification

▸ requestLoginVerification(email, appInfo?): Promise<VerificationRequestResult>

Parameters

NameType
emailstring
appInfo?AuthInfoInput

Returns

Promise<VerificationRequestResult>

Defined in

agent/AgentClient.ts:592 (opens in a new tab)


requestPayment

▸ requestPayment(amountHOT): Promise<PaymentRequestResult>

Parameters

NameType
amountHOTstring

Returns

Promise<PaymentRequestResult>

Defined in

agent/AgentClient.ts:651 (opens in a new tab)


revokeToken

▸ revokeToken(requestId): Promise<Apps[]>

Parameters

NameType
requestIdstring

Returns

Promise<Apps[]>

Defined in

agent/AgentClient.ts:522 (opens in a new tab)


setHotWalletAddress

▸ setHotWalletAddress(address): Promise<boolean>

Parameters

NameType
addressstring

Returns

Promise<boolean>

Defined in

agent/AgentClient.ts:639 (opens in a new tab)


signMessage

▸ signMessage(message): Promise<string>

Parameters

NameType
messagestring

Returns

Promise<string>

Defined in

agent/AgentClient.ts:549 (opens in a new tab)


status

▸ status(): Promise<AgentStatus>

Returns

Promise<AgentStatus>

Defined in

agent/AgentClient.ts:129 (opens in a new tab)


subscribeAgentStatusChanged

▸ subscribeAgentStatusChanged(): void

Returns

void

Defined in

agent/AgentClient.ts:409 (opens in a new tab)


subscribeAgentUpdated

▸ subscribeAgentUpdated(): void

Returns

void

Defined in

agent/AgentClient.ts:366 (opens in a new tab)


subscribeAppsChanged

▸ subscribeAppsChanged(): void

Returns

void

Defined in

agent/AgentClient.ts:385 (opens in a new tab)


subscribeHostingUserInfoChanged

▸ subscribeHostingUserInfoChanged(): void

Returns

void

Defined in

agent/AgentClient.ts:432 (opens in a new tab)


unlock

▸ unlock(passphrase, holochain?): Promise<AgentStatus>

Parameters

NameTypeDefault value
passphrasestringundefined
holochainbooleantrue

Returns

Promise<AgentStatus>

Defined in

agent/AgentClient.ts:192 (opens in a new tab)


updateDirectMessageLanguage

▸ updateDirectMessageLanguage(directMessageLanguage): Promise<Agent>

Parameters

NameType
directMessageLanguagestring

Returns

Promise<Agent>

Defined in

agent/AgentClient.ts:277 (opens in a new tab)


updatePublicPerspective

▸ updatePublicPerspective(perspective): Promise<Agent>

Parameters

NameType
perspectivePerspectiveInput

Returns

Promise<Agent>

Defined in

agent/AgentClient.ts:220 (opens in a new tab)


verifyEmailCode

▸ verifyEmailCode(email, code, verificationType): Promise<string>

Parameters

NameType
emailstring
codestring
verificationTypestring

Returns

Promise<string>

Defined in

agent/AgentClient.ts:609 (opens in a new tab)