Skip to content

Commit 529ce1a

Browse files
feat: Update app-sdk sessionSig creation's resourceAbilityRequests to include the ability to decrypt access-control-condition restricted resources
- Facilitates Vincent Wrapped keys abilities being able to decrypt wrapped keys
1 parent 24381ec commit 529ce1a

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
app-sdk: minor
3+
---
4+
5+
#### Add support for Vincent Wrapped Keys
6+
7+
- Updated internal sessionSig creation so that the `resourceAbilityRequests` includes the ability to decrypt access-control-condition restricted resources

packages/libs/app-sdk/src/abilityClient/execute/generateVincentAbilitySessionSigs.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import type { LitNodeClient } from '@lit-protocol/lit-node-client';
77
import {
88
createSiweMessageWithRecaps,
99
generateAuthSig,
10+
LitAccessControlConditionResource,
1011
LitActionResource,
1112
LitPKPResource,
1213
} from '@lit-protocol/auth-helpers';
@@ -25,6 +26,11 @@ export const generateVincentAbilitySessionSigs = async ({
2526
resourceAbilityRequests: [
2627
{ resource: new LitPKPResource('*'), ability: LIT_ABILITY.PKPSigning },
2728
{ resource: new LitActionResource('*'), ability: LIT_ABILITY.LitActionExecution },
29+
// This is required for abilities that use Vincent Wrapped Keys to be able to decrypt the previously encrypted wrapped key
30+
{
31+
resource: new LitAccessControlConditionResource('*'),
32+
ability: LIT_ABILITY.AccessControlConditionDecryption,
33+
},
2834
],
2935
authNeededCallback: async ({ resourceAbilityRequests, uri }) => {
3036
const [walletAddress, nonce] = await Promise.all([

packages/libs/wrapped-keys/src/lib/lit-actions-client/get-solana-key-pair-from-wrapped-key.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export async function getSolanaKeyPairFromWrappedKey({
2323
delegatorAddress: string;
2424
ciphertext: string;
2525
dataToEncryptHash: string;
26-
evmContractConditions: any[];
26+
evmContractConditions: unknown[];
2727
}): Promise<Keypair> {
2828
const decryptedPrivateKey = await Lit.Actions.decryptAndCombine({
2929
accessControlConditions: evmContractConditions,

0 commit comments

Comments
 (0)