@usecapsule/web-sdk
Advanced tools
Comparing version 1.9.0 to 1.10.0
@@ -7,2 +7,3 @@ /// <reference types="node" /> | ||
export declare class WebUtils implements PlatformUtils { | ||
getPrivateKey(ctx: Ctx, userId: string, walletId: string, share: string, sessionCookie: string): Promise<string>; | ||
keygen(ctx: Ctx, userId: string, secretKey: string | null, // should be acceptable as null in RN as we don't pre-gen them | ||
@@ -9,0 +10,0 @@ sessionCookie: string, emailProps?: BackupKitEmailProps): Promise<{ |
@@ -5,2 +5,3 @@ import { LocalStorage } from './LocalStorage.js'; | ||
import { signMessage, sendTransaction, signTransaction } from './wallet/signing.js'; | ||
import { getPrivateKey } from './wallet/privateKey.js'; | ||
export class WebUtils { | ||
@@ -14,2 +15,5 @@ constructor() { | ||
} | ||
getPrivateKey(ctx, userId, walletId, share, sessionCookie) { | ||
return getPrivateKey(ctx, userId, walletId, share, sessionCookie); | ||
} | ||
keygen(ctx, userId, secretKey, // should be acceptable as null in RN as we don't pre-gen them | ||
@@ -16,0 +20,0 @@ sessionCookie, emailProps = {}) { |
@@ -14,1 +14,2 @@ import { Ctx, SignatureRes } from '@usecapsule/core-sdk'; | ||
export declare function refresh(ctx: Ctx, share: string, walletId: string, userId: string): Promise<string>; | ||
export declare function getPrivateKey(ctx: Ctx, share: string, walletId: string, userId: string): Promise<string>; |
@@ -182,1 +182,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
} | ||
export function getPrivateKey(ctx, share, walletId, userId) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const capsuleShare = yield ctx.capsuleClient.getCapsuleShare(userId, walletId); | ||
if (!capsuleShare) { | ||
return ''; | ||
} | ||
return new Promise((resolve, reject) => global.getPrivateKey(share, capsuleShare, (err, result) => { | ||
if (err) { | ||
reject(err); | ||
} | ||
resolve(result); | ||
})); | ||
}); | ||
} |
@@ -62,2 +62,6 @@ // ANY CHANGES TO THIS FILE REQUIRE A REBUILD OF THE WORKER | ||
} | ||
case 'GET_PRIVATE_KEY': { | ||
const { share, walletId, userId } = params; | ||
return yield walletUtils.getPrivateKey(ctx, share, walletId, userId); | ||
} | ||
default: { | ||
@@ -64,0 +68,0 @@ throw new Error(`functionType: ${functionType} not supported`); |
{ | ||
"name": "@usecapsule/web-sdk", | ||
"version": "1.9.0", | ||
"version": "1.10.0", | ||
"type": "module", | ||
@@ -11,4 +11,4 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@usecapsule/core-sdk": "1.8.0", | ||
"@usecapsule/user-management-client": "1.5.0", | ||
"@usecapsule/core-sdk": "1.9.0", | ||
"@usecapsule/user-management-client": "1.6.0", | ||
"assert": "^2.1.0", | ||
@@ -36,3 +36,3 @@ "base64url": "3.0.1", | ||
], | ||
"gitHead": "18b6d11b654f3c05995e1a5dff9f0dedcbc37c0a" | ||
"gitHead": "9f19a2e9224958e127ed0cdfa3550d1b832b6361" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
92705
36
1625
+ Added@usecapsule/core-sdk@1.9.0(transitive)
+ Added@usecapsule/user-management-client@1.6.0(transitive)
- Removed@usecapsule/core-sdk@1.8.0(transitive)
- Removed@usecapsule/user-management-client@1.5.0(transitive)
Updated@usecapsule/core-sdk@1.9.0