@usecapsule/core-sdk
Advanced tools
Comparing version 1.15.0 to 1.16.0
@@ -29,3 +29,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.EmailTheme = exports.STORAGE_PREFIX = exports.transmissionUtilsRetrieve = exports.decryptPrivateKeyAndDecryptShare = exports.decryptPrivateKey = exports.encryptPrivateKey = exports.getSHA256HashHex = exports.getPublicKeyFromSignature = exports.getDerivedPrivateKeyAndDecrypt = exports.encodePrivateKeyToPemHex = exports.encryptWithDerivedPublicKey = exports.getPublicKeyHex = exports.getAsymmetricKeyPair = exports.decryptWithPrivateKey = exports.decryptWithKeyPair = exports.getBaseUrl = exports.mpcComputationClient = exports.initClient = exports.WalletType = exports.RecoveryStatus = exports.KeyContainer = exports.distributeNewShare = void 0; | ||
exports.EmailTheme = exports.PregenIdentifierType = exports.STORAGE_PREFIX = exports.transmissionUtilsRetrieve = exports.decryptPrivateKeyAndDecryptShare = exports.decryptPrivateKey = exports.encryptPrivateKey = exports.getSHA256HashHex = exports.getPublicKeyFromSignature = exports.getDerivedPrivateKeyAndDecrypt = exports.encodePrivateKeyToPemHex = exports.encryptWithDerivedPublicKey = exports.getPublicKeyHex = exports.getAsymmetricKeyPair = exports.decryptWithPrivateKey = exports.decryptWithKeyPair = exports.getBaseUrl = exports.mpcComputationClient = exports.initClient = exports.WalletType = exports.RecoveryStatus = exports.KeyContainer = exports.distributeNewShare = void 0; | ||
__exportStar(require("./definitions.js"), exports); | ||
@@ -39,2 +39,3 @@ __exportStar(require("./types/index.js"), exports); | ||
Object.defineProperty(exports, "STORAGE_PREFIX", { enumerable: true, get: function () { return CoreCapsule_js_1.PREFIX; } }); | ||
Object.defineProperty(exports, "PregenIdentifierType", { enumerable: true, get: function () { return CoreCapsule_js_1.PregenIdentifierType; } }); | ||
var CoreCapsule_js_2 = require("./CoreCapsule.js"); | ||
@@ -41,0 +42,0 @@ Object.defineProperty(exports, "RecoveryStatus", { enumerable: true, get: function () { return CoreCapsule_js_2.RecoveryStatus; } }); |
@@ -5,3 +5,3 @@ export * from './definitions.js'; | ||
export { KeyContainer } from './shares/KeyContainer.js'; | ||
import { CoreCapsule, PREFIX as STORAGE_PREFIX } from './CoreCapsule.js'; | ||
import { CoreCapsule, PREFIX as STORAGE_PREFIX, PregenIdentifierType } from './CoreCapsule.js'; | ||
export { RecoveryStatus, WalletType } from './CoreCapsule.js'; | ||
@@ -18,4 +18,4 @@ export { initClient } from './external/capsuleClient.js'; | ||
export { retrieve as transmissionUtilsRetrieve } from './transmission/transmissionUtils.js'; | ||
export { STORAGE_PREFIX }; | ||
export { STORAGE_PREFIX, PregenIdentifierType }; | ||
export { EmailTheme } from '@usecapsule/user-management-client'; | ||
export default CoreCapsule; |
@@ -1,2 +0,2 @@ | ||
import { EmailTheme, OnRampPurchase } from '@usecapsule/user-management-client'; | ||
import { EmailTheme, OnRampPurchase, WalletEntity } from '@usecapsule/user-management-client'; | ||
import { pki } from 'node-forge'; | ||
@@ -25,2 +25,6 @@ import { Ctx, OnRampAssetProp, OnRampProviderProp } from './definitions.js'; | ||
} | ||
export declare enum PregenIdentifierType { | ||
EMAIL = "EMAIL", | ||
PHONE = "PHONE" | ||
} | ||
export interface Wallet { | ||
@@ -428,4 +432,5 @@ id: string; | ||
* | ||
* @param email - the email of the user the pregen wallet is associated with. | ||
* @param pregenIdentifier - the identifier of the user the pregen wallet is associated with. | ||
* @param walletId - the wallet id | ||
* @param pregenIdentifierType - the identifier type of the user the pregen wallet is associated with. | ||
* @returns - recovery share. | ||
@@ -449,29 +454,40 @@ **/ | ||
* | ||
* @param email - string | ||
* @param pregenIdentifier - string | ||
* @param pregenIdentifierType - PregenIdentifierType | ||
* @returns [wallet, recoveryShare] | ||
**/ | ||
createWalletPreGen(email: string, useSolana?: boolean): Promise<Wallet>; | ||
createWalletPreGen(pregenIdentifier: string, useSolana?: boolean, pregenIdentifierType?: PregenIdentifierType): Promise<Wallet>; | ||
/** | ||
* Claims a pregenerated wallet. | ||
* | ||
* @param email string the email of the user claiming the wallet | ||
* @param pregenIdentifier string the identifier of the user claiming the wallet | ||
* @param pregenIdentifierType type of the identifier of the user claiming the wallet | ||
* @returns [wallet, recoveryShare] | ||
**/ | ||
claimPregenWallet(email: string): Promise<[Wallet, string]>; | ||
claimPregenWallet(pregenIdentifier: string, pregenIdentifierType?: PregenIdentifierType): Promise<[Wallet, string]>; | ||
/** | ||
* Updates a pregenerated wallet email. | ||
* Updates a pregenerated wallet identifier. | ||
* | ||
* @param newEmail - string | ||
* @param newIdentifier - string | ||
* @param walletId - string | ||
* @returns Promise<void> | ||
**/ | ||
updateWalletEmailPreGen(newEmail: string, walletId?: string): Promise<void>; | ||
updateWalletIdentifierPreGen(newIdentifier: string, walletId?: string, type?: PregenIdentifierType): Promise<void>; | ||
/** | ||
* Checks if Pregen Wallet exists for the email and partnerId | ||
* Checks if Pregen Wallet exists for the identifier and partnerId | ||
* | ||
* @param email string the email of the user claiming the wallet | ||
* @param pregenIdentifier string the identifier of the user claiming the wallet | ||
* @param pregenIdentifierType type of the string of the identifier of the user claiming the wallet | ||
* @returns Promise<boolean> | ||
**/ | ||
hasPregenWallet(email: string): Promise<boolean>; | ||
hasPregenWallet(pregenIdentifier: string, pregenIdentifierType?: PregenIdentifierType): Promise<boolean>; | ||
/** | ||
* Get pregen wallets for the identifier | ||
* | ||
* @param {string} pregenIdentifier - the identifier of the user claiming the wallet | ||
* @param {PregenIdentifierType} pregenIdentifierType - type of the identifier of the user claiming the wallet | ||
* @returns {Promise<WalletEntity[]>} Promise of pregen wallets | ||
**/ | ||
getPregenWallets(pregenIdentifier: string, pregenIdentifierType?: PregenIdentifierType): Promise<WalletEntity[]>; | ||
/** | ||
* Returns a base64 encoded wallet | ||
@@ -478,0 +494,0 @@ * |
@@ -6,3 +6,3 @@ export * from './definitions.js'; | ||
export { KeyContainer } from './shares/KeyContainer.js'; | ||
import { CoreCapsule, PREFIX as STORAGE_PREFIX } from './CoreCapsule.js'; | ||
import { CoreCapsule, PREFIX as STORAGE_PREFIX, PregenIdentifierType } from './CoreCapsule.js'; | ||
export { RecoveryStatus, WalletType } from './CoreCapsule.js'; | ||
@@ -21,4 +21,4 @@ export type { Wallet, ConstructorOpts } from './CoreCapsule.js'; | ||
export { retrieve as transmissionUtilsRetrieve } from './transmission/transmissionUtils.js'; | ||
export { STORAGE_PREFIX }; | ||
export { STORAGE_PREFIX, PregenIdentifierType }; | ||
export { EmailTheme } from '@usecapsule/user-management-client'; | ||
export default CoreCapsule; |
@@ -6,2 +6,3 @@ /// <reference types="node" /> | ||
import { StorageUtils } from './StorageUtils.js'; | ||
import { PregenIdentifierType } from './CoreCapsule.js'; | ||
export interface PlatformUtils { | ||
@@ -14,3 +15,3 @@ getPrivateKey(ctx: Ctx, userId: string, walletId: string, share: string, sessionCookie: string): Promise<string>; | ||
}>; | ||
preKeygen(ctx: Ctx, partnerId: string, email: string, secretKey: string | null, // should be acceptable as null in RN as we don't pre-gen them | ||
preKeygen(ctx: Ctx, partnerId: string, pregenIdentifier: string, pregenIdentifierType: PregenIdentifierType, secretKey: string | null, // should be acceptable as null in RN as we don't pre-gen them | ||
sessionCookie: string): Promise<{ | ||
@@ -33,3 +34,3 @@ signer: string; | ||
ed25519Sign(ctx: Ctx, userId: string, walletId: string, share: string, base64Bytes: string, sessionCookie: string): Promise<SignatureRes>; | ||
ed25519PreKeygen(ctx: Ctx, email: string, sessionCookie: string): Promise<{ | ||
ed25519PreKeygen(ctx: Ctx, pregenIdentifier: string, pregenIdentifierType: PregenIdentifierType, sessionCookie: string): Promise<{ | ||
signer: string; | ||
@@ -36,0 +37,0 @@ walletId: string; |
{ | ||
"name": "@usecapsule/core-sdk", | ||
"version": "1.15.0", | ||
"version": "1.16.0", | ||
"main": "dist/cjs/index.js", | ||
@@ -11,6 +11,7 @@ "module": "dist/esm/index.js", | ||
"@celo/utils": "^3.2.0", | ||
"@usecapsule/user-management-client": "1.12.0", | ||
"@usecapsule/user-management-client": "1.13.0", | ||
"base64url": "^3.0.1", | ||
"buffer": "6.0.3", | ||
"ethereumjs-util": "7.1.5", | ||
"libphonenumber-js": "1.11.2", | ||
"node-forge": "^1.3.1" | ||
@@ -38,3 +39,3 @@ }, | ||
}, | ||
"gitHead": "41dd49a5be1ebb9a723a52a40b2b65c15acc2379" | ||
"gitHead": "3776532fb0aa1dec9c952a5c35d4340af7dd0a0e" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
246026
5295
7
+ Addedlibphonenumber-js@1.11.2
+ Added@usecapsule/user-management-client@1.13.0(transitive)
+ Addedlibphonenumber-js@1.11.2(transitive)
- Removed@usecapsule/user-management-client@1.12.0(transitive)