Skip to content

Commit

Permalink
tiny cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
shamilovtim committed Oct 23, 2024
1 parent f511185 commit 30b2109
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions packages/agent/src/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,8 @@ async function initClient({
const normalizedPermissionRequests = permissionRequests.map(
({ protocolDefinition, permissions }) =>
WalletConnect.createPermissionRequestForProtocol({
definition : protocolDefinition,
permissions : permissions ?? [
'read',
'write',
'delete',
'query',
'subscribe',
],
definition: protocolDefinition,
permissions,
})
);

Expand Down Expand Up @@ -256,9 +250,17 @@ function createPermissionRequestForProtocol({
/** The protocol definition for the protocol being requested */
definition: DwnProtocolDefinition;

/** The permissions being requested for the protocol */
permissions: Permission[];
/** The permissions being requested for the protocol. Defaults to all. */
permissions?: Permission[];
}) {
permissions ??= [
'read',
'write',
'delete',
'query',
'subscribe',
];

const requests: DwnPermissionScope[] = [];

// Add the ability to query for the specific protocol
Expand Down

0 comments on commit 30b2109

Please sign in to comment.