Private
agentHolds the instance of a Web5Agent that represents the current execution context for
the DwnApi
. This agent is used to process DWN requests.
Private
connectedThe DID of the DWN tenant under which operations are being performed.
Private
Optional
delegate(optional) The DID of the signer when signing with permissions
Private
permissionsHolds the instance of AgentPermissionsApi that helps when dealing with permissions protocol records
Beta
API to interact with Grants
NOTE: This is an EXPERIMENTAL API that will change behavior.
Currently only supports issuing requests, grants, revokes and queries on behalf without permissions or impersonation. If the agent is connected to a delegateDid, the delegateDid will be used to sign/author the underlying records. If the agent is not connected to a delegateDid, the connectedDid will be used to sign/author the underlying records.
Grant permission for a specific scope to a grantee DID.
Query permission grants. You can filter by grantee, grantor, protocol and specify if you want to query a remote DWN.
Query permission requests. You can filter by protocol and specify if you want to query a remote DWN.
Request permission for a specific scope.
API to interact with DWN protocols (e.g., dwn.protocols.configure()
).
Configure method, used to setup a new protocol (or update) with the passed definitions
Query the available protocols
API to interact with DWN records (e.g., dwn.records.create()
).
Alias for the write
method
Write a record based on an existing one (useful for updating an existing record)
Delete a record
Query a single or multiple records based on the given filter
Read a single record based on the given filter
Subscribes to records based on the given filter and emits events to the subscriptionHandler
.
the subscription status and the subscription object used to close the subscription.
must include the message
with the subscription filter and the subscriptionHandler
to process the events.
Writes a record to the DWN
As a convenience, the Record instance returned will cache a copy of the data. This is done
to maintain consistency with other DWN methods, like RecordsQuery, that include relatively
small data payloads when returning RecordsWrite message properties. Regardless of data
size, methods such as record.data.stream()
will return the data when called even if it
requires fetching from the DWN datastore.
Interface to interact with DWN Records and Protocols