Class: AgentData
@web3-storage/access.AgentData
Implements
Constructors
constructor
• new AgentData(data
, options?
)
Parameters
Name | Type |
---|---|
data | AgentDataModel |
options? | AgentDataOptions |
Defined in
packages/access-client/src/agent-data.js:17
Properties
#save
• Private
#save: (data
: AgentDataExport
) => void
| Promise
<void
>
Type declaration
▸ (data
): void
| Promise
<void
>
Parameters
Name | Type |
---|---|
data | AgentDataExport |
Returns
void
| Promise
<void
>
Defined in
packages/access-client/src/agent-data.js:11
currentSpace
• currentSpace: undefined
| `did:${string}:${string}`
Defined in
packages/access-client/src/agent-data.js:22
packages/access-client/src/agent-data.js:123
delegations
• delegations: Map
<string
, { delegation
: Delegation
<Capabilities
> ; meta
: DelegationMeta
}>
Defined in
packages/access-client/src/agent-data.js:21
meta
• meta: AgentMeta
Defined in
packages/access-client/src/agent-data.js:18
principal
• principal: Signer
<`did:${string}:${string}`, SigAlg
>
Defined in
packages/access-client/src/agent-data.js:19
spaces
• spaces: Map
<`did:${string}:${string}`, SpaceMeta
>
Defined in
packages/access-client/src/agent-data.js:20
Methods
addDelegation
▸ addDelegation(delegation
, meta?
): Promise
<void
>
Parameters
Name | Type |
---|---|
delegation | Delegation <Capabilities > |
meta? | DelegationMeta |
Returns
Promise
<void
>
Defined in
packages/access-client/src/agent-data.js:131
addSpace
▸ addSpace(did
, meta
, proof?
): Promise
<void
>
Parameters
Name | Type |
---|---|
did | `did:${string}:${string}` |
meta | SpaceMeta |
proof? | Delegation <Capabilities > |
Returns
Promise
<void
>
Defined in
packages/access-client/src/agent-data.js:114
export
▸ export(): AgentDataExport
Export data in a format safe to pass to structuredClone()
.
Returns
AgentDataExport
Defined in
packages/access-client/src/agent-data.js:88
removeDelegation
▸ removeDelegation(cid
): Promise
<void
>
Parameters
Name | Type |
---|---|
cid | Link <Capabilities , MulticodecCode <number , string >, SigAlg > |
Returns
Promise
<void
>
Defined in
packages/access-client/src/agent-data.js:142
setCurrentSpace
▸ setCurrentSpace(did
): Promise
<void
>
Parameters
Name | Type |
---|---|
did | `did:${string}:${string}` |
Returns
Promise
<void
>
Defined in
packages/access-client/src/agent-data.js:122
create
▸ Static
create(init?
, options?
): Promise
<AgentData
>
Create a new AgentData instance from the passed initialization data.
Parameters
Name | Type |
---|---|
init? | Partial <AgentDataModel > |
options? | AgentDataOptions |
Returns
Promise
<AgentData
>
Defined in
packages/access-client/src/agent-data.js:33
fromExport
▸ Static
fromExport(raw
, options?
): AgentData
Instantiate AgentData from previously exported data.
Parameters
Name | Type |
---|---|
raw | AgentDataExport |
options? | AgentDataOptions |