@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
- addAgentStatusChangedListener
- addAppChangedListener
- addEntanglementProofs
- addUpdatedListener
- byDID
- deleteEntanglementProofs
- entanglementProofPreFlight
- generate
- generateJwt
- getApps
- getEntanglementProofs
- import
- isLocked
- lock
- me
- mutatePublicPerspective
- permitCapability
- removeApp
- requestCapability
- revokeToken
- signMessage
- status
- subscribeAgentStatusChanged
- subscribeAgentUpdated
- subscribeAppsChanged
- unlock
- updateDirectMessageLanguage
- updatePublicPerspective
Constructors
constructor
• new AgentClient(client
, subscribe?
)
Parameters
Name | Type | Default value |
---|---|---|
client | ApolloClient <any > | undefined |
subscribe | boolean | true |
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
Name | Type |
---|---|
listener | any |
Returns
void
Defined in
agent/AgentClient.ts:399 (opens in a new tab)
addAppChangedListener
▸ addAppChangedListener(listener
): void
Parameters
Name | Type |
---|---|
listener | any |
Returns
void
Defined in
agent/AgentClient.ts:356 (opens in a new tab)
addEntanglementProofs
▸ addEntanglementProofs(proofs
): Promise
<EntanglementProof
[]>
Parameters
Name | Type |
---|---|
proofs | EntanglementProofInput [] |
Returns
Promise
<EntanglementProof
[]>
Defined in
agent/AgentClient.ts:290 (opens in a new tab)
addUpdatedListener
▸ addUpdatedListener(listener
): void
Parameters
Name | Type |
---|---|
listener | any |
Returns
void
Defined in
agent/AgentClient.ts:352 (opens in a new tab)
byDID
▸ byDID(did
): Promise
<Agent
>
Parameters
Name | Type |
---|---|
did | string |
Returns
Promise
<Agent
>
Defined in
agent/AgentClient.ts:200 (opens in a new tab)
deleteEntanglementProofs
▸ deleteEntanglementProofs(proofs
): Promise
<EntanglementProof
[]>
Parameters
Name | Type |
---|---|
proofs | EntanglementProofInput [] |
Returns
Promise
<EntanglementProof
[]>
Defined in
agent/AgentClient.ts:306 (opens in a new tab)
entanglementProofPreFlight
▸ entanglementProofPreFlight(deviceKey
, deviceKeyType
): Promise
<EntanglementProof
>
Parameters
Name | Type |
---|---|
deviceKey | string |
deviceKeyType | string |
Returns
Promise
<EntanglementProof
>
Defined in
agent/AgentClient.ts:335 (opens in a new tab)
generate
▸ generate(passphrase
): Promise
<AgentStatus
>
Parameters
Name | Type |
---|---|
passphrase | string |
Returns
Promise
<AgentStatus
>
Defined in
agent/AgentClient.ts:136 (opens in a new tab)
generateJwt
▸ generateJwt(requestId
, rand
): Promise
<string
>
Parameters
Name | Type |
---|---|
requestId | string |
rand | string |
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
Name | Type |
---|---|
args | InitializeArgs |
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
Name | Type |
---|---|
passphrase | string |
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
Name | Type |
---|---|
mutations | LinkMutations |
Returns
Promise
<Agent
>
Defined in
agent/AgentClient.ts:240 (opens in a new tab)
permitCapability
▸ permitCapability(auth
): Promise
<string
>
Parameters
Name | Type |
---|---|
auth | string |
Returns
Promise
<string
>
Defined in
agent/AgentClient.ts:436 (opens in a new tab)
removeApp
▸ removeApp(requestId
): Promise
<Apps
[]>
Parameters
Name | Type |
---|---|
requestId | string |
Returns
Promise
<Apps
[]>
Defined in
agent/AgentClient.ts:477 (opens in a new tab)
requestCapability
▸ requestCapability(authInfo
): Promise
<string
>
Parameters
Name | Type |
---|---|
authInfo | AuthInfoInput |
Returns
Promise
<string
>
Defined in
agent/AgentClient.ts:422 (opens in a new tab)
revokeToken
▸ revokeToken(requestId
): Promise
<Apps
[]>
Parameters
Name | Type |
---|---|
requestId | string |
Returns
Promise
<Apps
[]>
Defined in
agent/AgentClient.ts:491 (opens in a new tab)
signMessage
▸ signMessage(message
): Promise
<string
>
Parameters
Name | Type |
---|---|
message | string |
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
Name | Type | Default value |
---|---|---|
passphrase | string | undefined |
holochain | boolean | true |
Returns
Promise
<AgentStatus
>
Defined in
agent/AgentClient.ts:186 (opens in a new tab)
updateDirectMessageLanguage
▸ updateDirectMessageLanguage(directMessageLanguage
): Promise
<Agent
>
Parameters
Name | Type |
---|---|
directMessageLanguage | string |
Returns
Promise
<Agent
>
Defined in
agent/AgentClient.ts:271 (opens in a new tab)
updatePublicPerspective
▸ updatePublicPerspective(perspective
): Promise
<Agent
>
Parameters
Name | Type |
---|---|
perspective | PerspectiveInput |
Returns
Promise
<Agent
>