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:93 (opens in a new tab)

Properties

#agentStatusChangedCallbacks

Private #agentStatusChangedCallbacks: AgentStatusChangedCallback[]

Defined in

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


#apolloClient

Private #apolloClient: ApolloClient<any>

Defined in

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


#appsChangedCallback

Private #appsChangedCallback: AgentAppsUpdatedCallback[]

Defined in

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


#updatedCallbacks

Private #updatedCallbacks: AgentUpdatedCallback[]

Defined in

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

Methods

addAgentStatusChangedListener

addAgentStatusChangedListener(listener): void

Parameters

NameType
listenerany

Returns

void

Defined in

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


addAppChangedListener

addAppChangedListener(listener): void

Parameters

NameType
listenerany

Returns

void

Defined in

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


addEntanglementProofs

addEntanglementProofs(proofs): Promise<EntanglementProof[]>

Parameters

NameType
proofsEntanglementProofInput[]

Returns

Promise<EntanglementProof[]>

Defined in

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


addUpdatedListener

addUpdatedListener(listener): void

Parameters

NameType
listenerany

Returns

void

Defined in

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


byDID

byDID(did): Promise<Agent>

Parameters

NameType
didstring

Returns

Promise<Agent>

Defined in

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


deleteEntanglementProofs

deleteEntanglementProofs(proofs): Promise<EntanglementProof[]>

Parameters

NameType
proofsEntanglementProofInput[]

Returns

Promise<EntanglementProof[]>

Defined in

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


entanglementProofPreFlight

entanglementProofPreFlight(deviceKey, deviceKeyType): Promise<EntanglementProof>

Parameters

NameType
deviceKeystring
deviceKeyTypestring

Returns

Promise<EntanglementProof>

Defined in

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


generate

generate(passphrase): Promise<AgentStatus>

Parameters

NameType
passphrasestring

Returns

Promise<AgentStatus>

Defined in

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


generateJwt

generateJwt(requestId, rand): Promise<string>

Parameters

NameType
requestIdstring
randstring

Returns

Promise<string>

Defined in

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


getApps

getApps(): Promise<Apps[]>

Returns

Promise<Apps[]>

Defined in

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


getEntanglementProofs

getEntanglementProofs(): Promise<string[]>

Returns

Promise<string[]>

Defined in

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


import

import(args): Promise<AgentStatus>

Parameters

NameType
argsInitializeArgs

Returns

Promise<AgentStatus>

Defined in

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


isLocked

isLocked(): Promise<boolean>

Returns

Promise<boolean>

Defined in

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


lock

lock(passphrase): Promise<AgentStatus>

Parameters

NameType
passphrasestring

Returns

Promise<AgentStatus>

Defined in

agent/AgentClient.ts:172 (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:112 (opens in a new tab)


mutatePublicPerspective

mutatePublicPerspective(mutations): Promise<Agent>

Parameters

NameType
mutationsLinkMutations

Returns

Promise<Agent>

Defined in

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


permitCapability

permitCapability(auth): Promise<string>

Parameters

NameType
authstring

Returns

Promise<string>

Defined in

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


removeApp

removeApp(requestId): Promise<Apps[]>

Parameters

NameType
requestIdstring

Returns

Promise<Apps[]>

Defined in

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


requestCapability

requestCapability(authInfo): Promise<string>

Parameters

NameType
authInfoAuthInfoInput

Returns

Promise<string>

Defined in

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


revokeToken

revokeToken(requestId): Promise<Apps[]>

Parameters

NameType
requestIdstring

Returns

Promise<Apps[]>

Defined in

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


signMessage

signMessage(message): Promise<string>

Parameters

NameType
messagestring

Returns

Promise<string>

Defined in

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


status

status(): Promise<AgentStatus>

Returns

Promise<AgentStatus>

Defined in

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


subscribeAgentStatusChanged

subscribeAgentStatusChanged(): void

Returns

void

Defined in

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


subscribeAgentUpdated

subscribeAgentUpdated(): void

Returns

void

Defined in

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


subscribeAppsChanged

subscribeAppsChanged(): void

Returns

void

Defined in

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


unlock

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

Parameters

NameTypeDefault value
passphrasestringundefined
holochainbooleantrue

Returns

Promise<AgentStatus>

Defined in

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


updateDirectMessageLanguage

updateDirectMessageLanguage(directMessageLanguage): Promise<Agent>

Parameters

NameType
directMessageLanguagestring

Returns

Promise<Agent>

Defined in

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


updatePublicPerspective

updatePublicPerspective(perspective): Promise<Agent>

Parameters

NameType
perspectivePerspectiveInput

Returns

Promise<Agent>

Defined in

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