@eluvio/elv-client-js 4.2.20 → 4.2.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -680,7 +680,9 @@ exports.CopyContentObject = async function({libraryId, originalVersionHash, opti
680
680
  const userCapKey = `eluv.caps.iusr${this.utils.AddressToHash(this.signer.address)}`;
681
681
 
682
682
  if(metadata[userCapKey]) {
683
- const userConkKey = await this.Crypto.DecryptCap(metadata[userCapKey], this.signer._signingKey().privateKey);
683
+ const userConkKey = this.signer.remoteSigner ?
684
+ await this.signer.DecryptCap(metadata[userCapKey]) :
685
+ await this.Crypto.DecryptCap(metadata[userCapKey], this.signer._signingKey().privateKey);
684
686
  userConkKey.qid = objectId;
685
687
 
686
688
  await this.ReplaceMetadata({
@@ -733,7 +735,9 @@ exports.CreateNonOwnerCap = async function({objectId, libraryId, publicKey, writ
733
735
  throw Error("No user cap found for current user");
734
736
  }
735
737
 
736
- const userConk = await this.Crypto.DecryptCap(userCapValue, this.signer._signingKey().privateKey);
738
+ const userConk = this.signer.remoteSigner ?
739
+ await this.signer.DecryptCap(userCapValue) :
740
+ await this.Crypto.DecryptCap(userCapValue, this.signer._signingKey().privateKey);
737
741
 
738
742
  const publicAddress = this.utils.PublicKeyToAddress(publicKey);
739
743