@usecapsule/user-management-client
Advanced tools
Comparing version 1.11.0 to 1.12.0
@@ -51,2 +51,3 @@ "use strict"; | ||
SignatureScheme["CGGMP"] = "CGGMP"; | ||
SignatureScheme["ED25519"] = "ED25519"; | ||
})(SignatureScheme || (exports.SignatureScheme = SignatureScheme = {})); | ||
@@ -249,4 +250,4 @@ var Chain; | ||
}); | ||
this.preSignMessage = (userId, walletId, tx) => __awaiter(this, void 0, void 0, function* () { | ||
const body = { message: tx }; | ||
this.preSignMessage = (userId, walletId, message, scheme) => __awaiter(this, void 0, void 0, function* () { | ||
const body = { message, scheme }; | ||
const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/messages/sign`, body); | ||
@@ -377,4 +378,4 @@ return res.data; | ||
resendVerificationCode(_a) { | ||
var { userId } = _a, rest = __rest(_a, ["userId"]); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
var { userId } = _a, rest = __rest(_a, ["userId"]); | ||
const res = yield this.baseRequest.post(`/users/${userId}/resend-verification-code`, rest); | ||
@@ -386,4 +387,4 @@ return res; | ||
resendVerificationCodeByPhone(_a) { | ||
var { userId } = _a, rest = __rest(_a, ["userId"]); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
var { userId } = _a, rest = __rest(_a, ["userId"]); | ||
const res = yield this.baseRequest.post(`/users/${userId}/resend-verification-code-by-phone`, rest); | ||
@@ -457,3 +458,3 @@ return res; | ||
// GET /recovery/users/:userId/wallets/:walletId/key-shares | ||
recoverUserShare(userId, walletId) { | ||
recoverUserShares(userId, walletId) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -539,4 +540,4 @@ const res = yield this.baseRequest.get(`/recovery/users/${userId}/wallets/${walletId}/key-shares?type=USER&encryptor=RECOVERY`); | ||
} | ||
createOnRampPurchase(userId_1, walletId_1, provider_1, asset_1) { | ||
return __awaiter(this, arguments, void 0, function* (userId, walletId, provider, asset, testMode = false) { | ||
createOnRampPurchase(userId, walletId, provider, asset, testMode = false) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/purchases`, { | ||
@@ -563,4 +564,4 @@ provider, | ||
distributeCapsuleShare(_a) { | ||
var { userId, walletId } = _a, rest = __rest(_a, ["userId", "walletId"]); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
var { userId, walletId } = _a, rest = __rest(_a, ["userId", "walletId"]); | ||
const body = rest; | ||
@@ -577,2 +578,14 @@ const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/capsule-share/distribute`, body); | ||
} | ||
persistRecoveryPublicKeys(userId, publicKeys) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const res = yield this.baseRequest.post(`/users/${userId}/recovery-public-keys`, { publicKeys }); | ||
return res.data; | ||
}); | ||
} | ||
getRecoveryPublicKeys(userId) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const res = yield this.baseRequest.get(`/users/${userId}/recovery-public-keys`); | ||
return res.data; | ||
}); | ||
} | ||
uploadEncryptedWalletPrivateKey(userId, encryptedWalletPrivateKey, encryptionKeyHash, biometricPublicKey) { | ||
@@ -579,0 +592,0 @@ return __awaiter(this, void 0, void 0, function* () { |
@@ -45,2 +45,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
SignatureScheme["CGGMP"] = "CGGMP"; | ||
SignatureScheme["ED25519"] = "ED25519"; | ||
})(SignatureScheme || (SignatureScheme = {})); | ||
@@ -243,4 +244,4 @@ export var Chain; | ||
}); | ||
this.preSignMessage = (userId, walletId, tx) => __awaiter(this, void 0, void 0, function* () { | ||
const body = { message: tx }; | ||
this.preSignMessage = (userId, walletId, message, scheme) => __awaiter(this, void 0, void 0, function* () { | ||
const body = { message, scheme }; | ||
const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/messages/sign`, body); | ||
@@ -371,4 +372,4 @@ return res.data; | ||
resendVerificationCode(_a) { | ||
var { userId } = _a, rest = __rest(_a, ["userId"]); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
var { userId } = _a, rest = __rest(_a, ["userId"]); | ||
const res = yield this.baseRequest.post(`/users/${userId}/resend-verification-code`, rest); | ||
@@ -380,4 +381,4 @@ return res; | ||
resendVerificationCodeByPhone(_a) { | ||
var { userId } = _a, rest = __rest(_a, ["userId"]); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
var { userId } = _a, rest = __rest(_a, ["userId"]); | ||
const res = yield this.baseRequest.post(`/users/${userId}/resend-verification-code-by-phone`, rest); | ||
@@ -451,3 +452,3 @@ return res; | ||
// GET /recovery/users/:userId/wallets/:walletId/key-shares | ||
recoverUserShare(userId, walletId) { | ||
recoverUserShares(userId, walletId) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -533,4 +534,4 @@ const res = yield this.baseRequest.get(`/recovery/users/${userId}/wallets/${walletId}/key-shares?type=USER&encryptor=RECOVERY`); | ||
} | ||
createOnRampPurchase(userId_1, walletId_1, provider_1, asset_1) { | ||
return __awaiter(this, arguments, void 0, function* (userId, walletId, provider, asset, testMode = false) { | ||
createOnRampPurchase(userId, walletId, provider, asset, testMode = false) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/purchases`, { | ||
@@ -557,4 +558,4 @@ provider, | ||
distributeCapsuleShare(_a) { | ||
var { userId, walletId } = _a, rest = __rest(_a, ["userId", "walletId"]); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
var { userId, walletId } = _a, rest = __rest(_a, ["userId", "walletId"]); | ||
const body = rest; | ||
@@ -571,2 +572,14 @@ const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/capsule-share/distribute`, body); | ||
} | ||
persistRecoveryPublicKeys(userId, publicKeys) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const res = yield this.baseRequest.post(`/users/${userId}/recovery-public-keys`, { publicKeys }); | ||
return res.data; | ||
}); | ||
} | ||
getRecoveryPublicKeys(userId) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const res = yield this.baseRequest.get(`/users/${userId}/recovery-public-keys`); | ||
return res.data; | ||
}); | ||
} | ||
uploadEncryptedWalletPrivateKey(userId, encryptedWalletPrivateKey, encryptionKeyHash, biometricPublicKey) { | ||
@@ -573,0 +586,0 @@ return __awaiter(this, void 0, void 0, function* () { |
@@ -99,3 +99,4 @@ export declare const USER_NOT_VERIFIED = "user must verify biometrics"; | ||
DKLS = "DKLS", | ||
CGGMP = "CGGMP" | ||
CGGMP = "CGGMP", | ||
ED25519 = "ED25519" | ||
} | ||
@@ -132,2 +133,3 @@ interface walletEntity { | ||
email: string; | ||
scheme?: SignatureScheme; | ||
} | ||
@@ -162,2 +164,3 @@ interface claimPreGenWalletBody { | ||
encryptor: (typeof EncryptorType)[keyof typeof EncryptorType]; | ||
recoveryPublicKeyId?: string; | ||
} | ||
@@ -230,3 +233,3 @@ export declare enum EncryptorType { | ||
recoveryInit: (email: string) => Promise<any>; | ||
preSignMessage: (userId: string, walletId: string, tx: string) => Promise<any>; | ||
preSignMessage: (userId: string, walletId: string, message: string, scheme?: SignatureScheme) => Promise<any>; | ||
deleteSelf: (userId: string) => Promise<any>; | ||
@@ -263,3 +266,3 @@ uploadKeyshares(userId: string, walletId: string, encryptedKeyshares: encryptedKeyshare[]): Promise<any>; | ||
finalizeRecovery(userId: string, walletId: string): Promise<import("axios").AxiosResponse<any, any>>; | ||
recoverUserShare(userId: string, walletId: string): Promise<import("axios").AxiosResponse<any, any>>; | ||
recoverUserShares(userId: string, walletId: string): Promise<import("axios").AxiosResponse<any, any>>; | ||
verifyEmailForRecovery(email: string, verificationCode: string): Promise<import("axios").AxiosResponse<any, any>>; | ||
@@ -285,2 +288,14 @@ verifyPhoneForRecovery(phone: string, countryCode: string, verificationCode: string): Promise<import("axios").AxiosResponse<any, any>>; | ||
keepSessionAlive(userId: string): Promise<any>; | ||
persistRecoveryPublicKeys(userId: string, publicKeys: string[]): Promise<{ | ||
recoveryPublicKeys: { | ||
id: string; | ||
publicKey: string; | ||
}[]; | ||
}>; | ||
getRecoveryPublicKeys(userId: string): Promise<{ | ||
recoveryPublicKeys: { | ||
id: string; | ||
publicKey: string; | ||
}[]; | ||
}>; | ||
uploadEncryptedWalletPrivateKey(userId: string, encryptedWalletPrivateKey: string, encryptionKeyHash: string, biometricPublicKey: string): Promise<any>; | ||
@@ -287,0 +302,0 @@ getEncryptedWalletPrivateKeys(userId: string, encryptionKeyHash: string): Promise<any>; |
{ | ||
"name": "@usecapsule/user-management-client", | ||
"version": "1.11.0", | ||
"version": "1.12.0", | ||
"main": "dist/cjs/index.js", | ||
@@ -33,3 +33,3 @@ "module": "dist/esm/index.js", | ||
}, | ||
"gitHead": "54583552fc3189bc0a05118322188971ad79fc7a" | ||
"gitHead": "41dd49a5be1ebb9a723a52a40b2b65c15acc2379" | ||
} |
70207
1537