@@ -29,6 +29,7 @@ import {
2929 ParamNullError ,
3030 ParamsMissingError ,
3131 PRODUCT_IDS ,
32+ SIWE_URI_PREFIX ,
3233 UnknownError ,
3334 UnsupportedMethodError ,
3435 WalletSignatureNotFoundError ,
@@ -196,7 +197,7 @@ export class LitNodeClientNodeJs extends LitCore implements ILitNodeClient {
196197 }
197198
198199 const siweMessage = await createSiweMessageWithCapacityDelegation ( {
199- uri : 'lit:capability:delegation' ,
200+ uri : SIWE_URI_PREFIX . DELEGATION ,
200201 litNodeClient : this ,
201202 walletAddress : dAppOwnerWalletAddress ,
202203 nonce : await this . getLatestBlockhash ( ) ,
@@ -224,7 +225,7 @@ export class LitNodeClientNodeJs extends LitCore implements ILitNodeClient {
224225 * if not, generates one.
225226 * @return { SessionKeyPair } session key pair
226227 */
227- getSessionKey = ( ) : SessionKeyPair => {
228+ private _getSessionKey = ( ) : SessionKeyPair => {
228229 const storageKey = LOCAL_STORAGE_KEYS . SESSION_KEY ;
229230 const storedSessionKeyOrError = getStorageItem ( storageKey ) ;
230231
@@ -279,7 +280,6 @@ export class LitNodeClientNodeJs extends LitCore implements ILitNodeClient {
279280 return sessionCapabilityObject ;
280281 }
281282
282- // backward compatibility
283283 async generateSessionCapabilityObjectWithWildcards (
284284 litResources : ILitResource [ ]
285285 ) : Promise < ISessionCapabilityObject > {
@@ -1319,8 +1319,8 @@ export class LitNodeClientNodeJs extends LitCore implements ILitNodeClient {
13191319
13201320 // Try to get it from local storage, if not generates one~
13211321 const sessionKey : SessionKeyPair =
1322- params . sessionKey ?? this . getSessionKey ( ) ;
1323- const sessionKeyUri = this . getSessionKeyUri ( sessionKey . publicKey ) ;
1322+ params . sessionKey ?? this . _getSessionKey ( ) ;
1323+ const sessionKeyUri = this . _getSessionKeyUri ( sessionKey . publicKey ) ;
13241324
13251325 log (
13261326 `[signSessionKey] sessionKeyUri is not found in params, generating a new one` ,
@@ -1637,9 +1637,9 @@ export class LitNodeClientNodeJs extends LitCore implements ILitNodeClient {
16371637 ) : Promise < SessionSigsMap > => {
16381638 // -- prepare
16391639 // Try to get it from local storage, if not generates one~
1640- const sessionKey = params . sessionKey ?? this . getSessionKey ( ) ;
1640+ const sessionKey = params . sessionKey ?? this . _getSessionKey ( ) ;
16411641
1642- const sessionKeyUri = this . getSessionKeyUri ( sessionKey . publicKey ) ;
1642+ const sessionKeyUri = this . _getSessionKeyUri ( sessionKey . publicKey ) ;
16431643
16441644 // First get or generate the session capability object for the specified resources.
16451645 const sessionCapabilityObject = params . sessionCapabilityObject
@@ -1917,8 +1917,8 @@ export class LitNodeClientNodeJs extends LitCore implements ILitNodeClient {
19171917 * @param publicKey is the public key of the session key
19181918 * @returns { string } the session key uri
19191919 */
1920- getSessionKeyUri = ( publicKey : string ) : string => {
1921- return 'lit:session:' + publicKey ;
1920+ private _getSessionKeyUri = ( publicKey : string ) : string => {
1921+ return SIWE_URI_PREFIX . SESSION_KEY + publicKey ;
19221922 } ;
19231923
19241924 /**
0 commit comments