wallaby-cash 2.0.1-alpha.2 → 2.0.1-alpha.21

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.
Files changed (37) hide show
  1. package/README.md +5 -1
  2. package/dist/helpers/base64.d.ts +2 -2
  3. package/dist/helpers/json-safe-parse.d.ts +1 -0
  4. package/dist/index.cjs.js +2564 -2074
  5. package/dist/index.cjs.js.map +1 -1
  6. package/dist/index.d.ts +6 -1
  7. package/dist/index.esm.js +2564 -2075
  8. package/dist/index.esm.js.map +1 -1
  9. package/dist/index.js +2564 -2075
  10. package/dist/index.js.map +1 -1
  11. package/dist/lib/auth/auth.service.d.ts +48 -0
  12. package/dist/lib/transactions/index.d.ts +3 -3
  13. package/dist/lib/utils/cipher.service.d.ts +101 -54
  14. package/dist/lib/utils/constants.d.ts +3 -0
  15. package/dist/lib/wallet/index.d.ts +2 -0
  16. package/dist/lib/wallet/wallet-data.service.d.ts +89 -0
  17. package/dist/lib/wallet/wallet-handlers.service.d.ts +71 -0
  18. package/dist/lib/wallet/wallet.service.d.ts +83 -122
  19. package/dist/package.json +13 -2
  20. package/dist/routes/wallet.d.ts +5 -0
  21. package/dist/types/auth.d.ts +4 -0
  22. package/dist/types/base.d.ts +10 -0
  23. package/dist/types/common.d.ts +1 -1
  24. package/dist/types/storage.d.ts +3 -0
  25. package/dist/types/transactions.d.ts +4 -1
  26. package/dist/types/wallet.d.ts +32 -3
  27. package/package.json +13 -2
  28. package/dist/tests/__mocks__/localStorageMock.d.ts +0 -10
  29. package/dist/tests/data/assets.d.ts +0 -89
  30. package/dist/tests/data/auth.d.ts +0 -11
  31. package/dist/tests/data/config.d.ts +0 -2
  32. package/dist/tests/data/credentials.data.d.ts +0 -12
  33. package/dist/tests/data/index.d.ts +0 -7
  34. package/dist/tests/data/merchants.d.ts +0 -8
  35. package/dist/tests/data/system.d.ts +0 -47
  36. package/dist/tests/data/user.d.ts +0 -32
  37. package/dist/tests/data/wallet.data.d.ts +0 -69
@@ -25,9 +25,23 @@ export declare class AuthService extends Base {
25
25
  }): Promise<SignatureMessageResponse>;
26
26
  signUp(input: AuthenticationRequest): Promise<AuthResponse>;
27
27
  signIn(input: SignInRequest): Promise<AuthResponse>;
28
+ checkPrfCompatibility(input: {
29
+ nickname: string;
30
+ displayName: string;
31
+ }): Promise<boolean>;
28
32
  private handleSignInWithPassword;
29
33
  private handlePasskeyRegistration;
30
34
  private handleSignInWithPasskey;
35
+ storeDeviceKeyPair({ deviceAuthKeyPair, credentialsKeyPair, }: {
36
+ deviceAuthKeyPair: {
37
+ publicKey: string;
38
+ privateKey: string;
39
+ };
40
+ credentialsKeyPair: {
41
+ publicKey: string;
42
+ privateKey: string;
43
+ };
44
+ }): Promise<void>;
31
45
  /**
32
46
  *
33
47
  * @public
@@ -46,6 +60,40 @@ export declare class AuthService extends Base {
46
60
  }): Promise<ClientAuthPubKeyResponse | undefined>;
47
61
  private handleSignUpWithPassword;
48
62
  private handleSignUpWithPasskey;
63
+ /**
64
+ * @description
65
+ * Constructs the public key object for passkey authentication.
66
+ * @param {PublicKeyCredential} credential User's nickname
67
+ * @param {string} randomSignatureMessage Random signature message
68
+ * @param {Uint8Array} firstSalt First salt
69
+ * @throws {Error} If any of the required parameters are missing
70
+ * @throws {Error} If the credential rawId is not valid
71
+ * @throws {Error} If the relying party ID is not a valid domain, so ensure to pass `hostname` to the sdk's constructor
72
+ * @returns {PublicKeyCredentialCreationOptions} The public key credential creation options
73
+ */
49
74
  private constructPasskeyAuthenticationPublicKey;
75
+ /**
76
+ * @description
77
+ * Constructs the public key object for passkey registration.
78
+ * @param {string} nickname User's nickname
79
+ * @param {string} displayName User's display name
80
+ * @param {string} randomSignatureMessage Random signature message
81
+ * @param {Uint8Array} firstSalt First salt
82
+ * @throws {Error} If any of the required parameters are missing
83
+ * @throws {Error} If the relying party ID is not a valid domain, so ensure to pass `hostname` to the sdk's constructor
84
+ * @returns {PublicKeyCredentialCreationOptions} The public key credential creation options
85
+ */
50
86
  private constructPasskeyRegistrationPublicKey;
87
+ /**
88
+ *
89
+ * basically we need to send just localhost instead of window.location.hostname which will return `http://localhost:3000`
90
+ * The authenticator will reject the request if the rpId is not a valid domain, the following error is thrown:
91
+ * SecurityError: The relying party ID is not a registrable domain suffix of, nor equal to the current domain. Subsequently, an attempt to fetch the .well-known/webauthn resource of the claimed RP ID failed.
92
+ *
93
+ * For more on this, see:
94
+ * https://www.w3.org/TR/webauthn-2/#webauthn-relying-party
95
+ *
96
+ * @returns {string} The relying party ID
97
+ */
98
+ private getRelyingPartyId;
51
99
  }
@@ -62,8 +62,8 @@ export declare class Transactions extends Base {
62
62
  * @param {string} password
63
63
  * @returns {TransactionResponse} Transaction object which contains the transaction hash and status
64
64
  */
65
- transfer({ originAddress, recipientAddress, amount, assetId, reference, encryptionMechanism, wallabyAuthPublicKey, prfValue, memo, password, }: TransferRequest): Promise<TransactionResponse | undefined>;
66
- transferWithShares({ originAddress, recipientAddress, amount, assetId, reference, encryptionMechanism, prfValue, memo, password, wallabyAuthPublicKey, }: TransferRequest): Promise<TransactionResponse | undefined>;
65
+ transfer({ originAddress, recipientAddress, amount, assetId, reference, encryptionMechanism, wallabyAuthPublicKey, prfValue, memo, password, clientSalt, }: TransferRequest): Promise<TransactionResponse | undefined>;
66
+ transferWithShares({ originAddress, recipientAddress, amount, assetId, reference, encryptionMechanism, prfValue, memo, password, clientSalt, wallabyAuthPublicKey, }: TransferRequest): Promise<TransactionResponse | undefined>;
67
67
  /**
68
68
  *
69
69
  * @public
@@ -79,5 +79,5 @@ export declare class Transactions extends Base {
79
79
  * @returns {CreateAllowanceResponse}
80
80
  *
81
81
  */
82
- createAllowance({ password, prfValue, encryptionMechanism, wallabyAuthPublicKey, ownerAddress, spenderAddress, amount, assetId, suiObjectId, contractAddress, reference, memo, }: CreateAllowanceRequest): Promise<TransactionResponse | undefined>;
82
+ createAllowance({ password, prfValue, clientSalt, encryptionMechanism, wallabyAuthPublicKey, ownerAddress, spenderAddress, amount, assetId, suiObjectId, contractAddress, chainName, assetSymbol, reference, memo, }: CreateAllowanceRequest): Promise<TransactionResponse | undefined>;
83
83
  }
@@ -1,17 +1,22 @@
1
- import { DeviceInformation, SignatureResponse, EncryptionMechanism, Encrypted } from '../../types';
1
+ import { SignatureResponse, EncryptionMechanism, Encrypted } from '../../types';
2
+ type KeyDerivationOptions = {
3
+ encryptionMechanism: EncryptionMechanism;
4
+ password?: string;
5
+ salt?: string;
6
+ prfValue?: Uint8Array;
7
+ };
2
8
  export declare class Cipher {
3
- private device;
4
- constructor(device: Promise<DeviceInformation>);
9
+ constructor();
5
10
  /**
6
11
  * @description Signs a message using the provided private key.
7
12
  *
8
13
  * @param {string} message - A random string.
9
- * @param {string} privateKey - The private key to sign the message with.
10
- * @returns { Object } The signed message, including the original message, the signature, and the hashed message.
14
+ * @param {string} signingKey - The private key to sign the message with.
15
+ * @returns { SignatureResponse } The signed message, including the original message, the signature, and the hashed message.
11
16
  */
12
- sign({ message, privateKey }: {
17
+ sign({ message, signingKey }: {
13
18
  message: string;
14
- privateKey: string;
19
+ signingKey: string;
15
20
  }): SignatureResponse;
16
21
  /**
17
22
  * @description Encrypts the data with the given key material.
@@ -19,63 +24,105 @@ export declare class Cipher {
19
24
  * @param { Uint8Array } inputKeyMaterial
20
25
  * @returns The encrypted data as a string or undefined if it can't encrypt it.
21
26
  */
22
- encrypt: ({ data, inputKeyMaterial }: {
27
+ encrypt({ data, encryptionKey }: {
23
28
  data: string;
24
- inputKeyMaterial: Uint8Array;
25
- }) => Promise<Encrypted | undefined>;
29
+ encryptionKey: string;
30
+ }): Promise<Encrypted | undefined>;
26
31
  /**
27
32
  * @description Decrypts the data with the given key material.
28
33
  * @param { string } cipherText
29
- * @param { Uint8Array } inputKeyMaterial
30
- * @returns The decrypted data as a string or undefined if it can't decrypt it.
34
+ * @param { string } decryptionKey
35
+ * @returns The decrypted data as a string.
36
+ * @throws `Please make sure the password is correct.` if the decryption fails.
31
37
  */
32
- decrypt: ({ cipherText, inputKeyMaterial }: {
33
- cipherText: string;
34
- inputKeyMaterial: Uint8Array;
35
- }) => Promise<string | undefined>;
36
- deriveKeyPairFromPassKey({ inputKeyMaterial }: {
37
- inputKeyMaterial: Uint8Array;
38
- }): Promise<{
39
- privateKey: string;
40
- publicKey: string;
41
- }>;
42
- deriveKeyPairFromPassword({ password, salt }: {
43
- password: string;
44
- salt: string;
45
- }): Promise<{
38
+ decrypt({ cipherText, decryptionKey }: {
39
+ cipherText: Encrypted;
40
+ decryptionKey: string;
41
+ }): Promise<string>;
42
+ getCredentialsKeyPair(options: KeyDerivationOptions): Promise<{
46
43
  privateKey: string;
47
44
  publicKey: string;
48
45
  }>;
49
46
  /**
50
- *
51
- * @description it prepares the seed phrase for transport by unwrapping it twice.
52
- * The first layer is encrypted with the device's private key.
53
- * The second layer is encrypted with the user's password.
54
- * Then it gets wrapped by the wallaby's public key.
55
- * @param { string } password
56
- * @returns Ready to transport seed phrase encrypted with wallaby's public key.
47
+ * @description Prepares data for transport by encrypting it with the provided public key.
48
+ * @param {string} data - Plain text data to be encrypted with Wallaby public key.
49
+ * @param {string} wallabyPublicKey - The public key to encrypt the data with.
50
+ * @returns {Promise<string>} The encrypted data.
51
+ * @throws Error if the data could not be encrypted.
57
52
  */
58
- prepDataForTransport({ storedEncryptedData, password, prfValue, encryptionMechanism, wallabyAuthPublicKey, getUserSalt, }: {
59
- storedEncryptedData: string;
60
- encryptionMechanism: EncryptionMechanism;
61
- wallabyAuthPublicKey: string;
62
- prfValue?: Uint8Array;
63
- password?: string;
64
- getUserSalt?: () => Promise<string>;
53
+ prepareDataForTransport({ data, wallabyPublicKey }: {
54
+ data: string;
55
+ wallabyPublicKey: string;
65
56
  }): Promise<Encrypted>;
66
- getInputKeyMaterial({ password, salt, prfValue, encryptionMechanism, }: {
67
- encryptionMechanism: EncryptionMechanism;
68
- password?: string;
69
- salt?: string;
70
- prfValue?: Uint8Array;
71
- }): Promise<Uint8Array>;
72
- prepDataForDisplay({ storedEncryptedData, password, prfValue, decryptedDevicePrivateKey, encryptionMechanism, salt, }: {
73
- storedEncryptedData: string;
74
- encryptionMechanism: EncryptionMechanism;
75
- decryptedDevicePrivateKey: string;
76
- wallabyAuthPublicKey: string;
77
- prfValue?: Uint8Array;
78
- password?: string;
79
- salt?: string;
57
+ prepareStoredDataForTransport({ storedEncryptedData, encryptedDevicePrivateKey, wallabyPublicKey, options, }: {
58
+ storedEncryptedData: Encrypted;
59
+ encryptedDevicePrivateKey: Encrypted;
60
+ wallabyPublicKey: string;
61
+ options: KeyDerivationOptions;
62
+ }): Promise<Encrypted>;
63
+ prepareDecryptedDataForStorage({ decryptedData, credentialsKeyPair, deviceKeyPair, }: {
64
+ decryptedData: string;
65
+ credentialsKeyPair: {
66
+ publicKey: string;
67
+ privateKey: string;
68
+ };
69
+ deviceKeyPair: {
70
+ publicKey: string;
71
+ privateKey: string;
72
+ };
73
+ }): Promise<Encrypted | undefined>;
74
+ prepareTransportDataForStorage({ transportData, credentialsKeyPair, deviceKeyPair, }: {
75
+ transportData: Encrypted;
76
+ credentialsKeyPair: {
77
+ publicKey: string;
78
+ privateKey: string;
79
+ };
80
+ deviceKeyPair: {
81
+ publicKey: string;
82
+ privateKey: string;
83
+ };
84
+ }): Promise<Encrypted | undefined>;
85
+ /**
86
+ * @description Decrypts the data from the server using the user's credentials.
87
+ * @param { Encrypted } encryptedData Any data wrapped on Wallaby server using the `clientAuthPubKey` for this device.
88
+ * @param { Encrypted } encryptedDevicePrivateKey To use this function you need to fetch the device private key from `storageService.fetch(storageService.fetch(LocalStorageItems.EncryptedDevicePrivateKey))`
89
+ * @param { Object } options Options to determine the derivation method to get the credentials based key pair. It already assumes the user has authenticated with wallaby.
90
+ * @returns The decrypted data as a string or undefined if it can't decrypt it.
91
+ * @throws Error if the data could not be decrypted.
92
+ */
93
+ displayDataFromServer({ encryptedData, encryptedDevicePrivateKey, options, }: {
94
+ encryptedData: Encrypted;
95
+ encryptedDevicePrivateKey: Encrypted;
96
+ options: KeyDerivationOptions;
97
+ }): Promise<string>;
98
+ /**
99
+ * @description Decrypts the data from the local storage using the user's credentials and the device private key.
100
+ * - First layer of decryption using the user credentials crypto key (password or passkey)
101
+ * - Second layer of decryption using the device private key
102
+ * @param { Encrypted } storedEncryptedData Any data that is double wrapped using before storing in localStorage (i.e encrypted key shares or encrypted seed phrase).
103
+ * @param { Encrypted } encryptedDevicePrivateKey To use this function you need to fetch the device private key from `storageService.fetch(storageService.fetch(LocalStorageItems.EncryptedDevicePrivateKey))`
104
+ * @param { Object } options Options to determine the derivation method to get the credentials based key pair. It already assumes the user has authenticated with wallaby.
105
+ * @returns The decrypted data as a string or undefined if it can't decrypt it.
106
+ * @throws Error if the data could not be decrypted.
107
+ */
108
+ displayStoredData({ storedEncryptedData, encryptedDevicePrivateKey, options, }: {
109
+ storedEncryptedData: Encrypted;
110
+ encryptedDevicePrivateKey: Encrypted;
111
+ options: KeyDerivationOptions;
80
112
  }): Promise<string>;
113
+ /**
114
+ * @description Derives a key pair from the provided passkey.
115
+ * @param {Object} params
116
+ * @param {Uint8Array} params.inputKeyMaterial - The input key material.
117
+ * @returns {Promise<{ privateKey: string; publicKey: string }>} The derived key pair.
118
+ */
119
+ private deriveKeyPairFromPasskey;
120
+ /**
121
+ * @description Derives a key pair from the provided password and salt.
122
+ * @param {string} password - The password.
123
+ * @param {string} salt - The salt.
124
+ * @returns {Promise<{ privateKey: string; publicKey: string }>} The derived key pair.
125
+ */
126
+ private deriveKeyPairFromPassword;
81
127
  }
128
+ export {};
@@ -14,6 +14,9 @@ export declare const SALT_BITE_SIZE = 32;
14
14
  export declare const IV_BYTE_SIZE = 12;
15
15
  export declare const PUBLIC_KEY_CREDENTIAL_TIMEOUT = 60000;
16
16
  export declare const DEFAULT_ENTROPY_BYTES = 32;
17
+ export declare const PBKDF2_ITERATIONS = 131072;
18
+ export declare const DEFAULT_PRIMARY_SHARE_INDEX = 0;
19
+ export declare const DEFAULT_BACKUP_SHARE_INDEX = 1;
17
20
  /**
18
21
  * In the options for a Web Authentication credential registration request, the caller can specify a list of cryptographic algorithm identifiers in the pubKeyCredParams field.
19
22
  If left unspecified, Chrome uses the default values of ES256 (-7) and RS256 (-257).
@@ -1 +1,3 @@
1
1
  export * from './wallet.service';
2
+ export * from './wallet-data.service';
3
+ export * from './wallet-handlers.service';
@@ -0,0 +1,89 @@
1
+ import { Base } from '../../base';
2
+ import { AddTokenToWalletRequest, AddTokenToWalletResponse, QueryUserRequest, QueryWalletRequest, TokenBalanceRequest, TokenBalanceResponse, UpdateAssetRequest, UpdateAssetResponse, UserAssetsResponse, UserWalletsResponse, WallabyConfig, WalletAssetsResponse } from '../../types';
3
+ export declare class WalletDataService extends Base {
4
+ constructor(config: WallabyConfig);
5
+ /**
6
+ *
7
+ * @public
8
+ * Create a newly fresh wallet, returns asset list and encrypted seedPhrase
9
+ * @param { string } address Wallet address
10
+ * @param { string } symbol Token symbol
11
+ * @param { BlockchainName } chainName the chain name enum. i.e. 'ETHEREUM', 'BITCOIN'
12
+ * @returns { CreateWalletResponse } The wallet has been created successfully
13
+ */
14
+ getTokenBalance({ address, symbol, tokenStandard, chainName, }: TokenBalanceRequest): Promise<TokenBalanceResponse | undefined>;
15
+ /**
16
+ *
17
+ * @public
18
+ * Fetches the balances for a group of tokens in bulk.
19
+ * Takes an array of addresses and tokens and return their balances.
20
+ * @param { string } address Wallet address
21
+ * @param { string } symbol Token symbol
22
+ * @param { BlockchainName } chainName the chain name enum. i.e. 'ETHEREUM', 'BITCOIN'
23
+ * @returns { TokenBalanceResponse[] } Returns an array of the requested tokens balances.
24
+ */
25
+ getMultiTokenBalances(tokensAndAddressesList: TokenBalanceRequest[]): Promise<TokenBalanceResponse | undefined>;
26
+ /**
27
+ *
28
+ * @public
29
+ * Fetches the balances for all tokens in a specific wallet.
30
+ * @param { string } walletId Wallet address
31
+ * @returns { TokenBalanceResponse[] } Returns an array of the requested tokens balances.
32
+ */
33
+ getWalletBalances({ walletId }: {
34
+ walletId: string;
35
+ }): Promise<TokenBalanceResponse[]>;
36
+ /**
37
+ *
38
+ * Get all user assets across all wallets by specifying user id
39
+ * @param userId Wallaby's user ID
40
+ * @param queryOptions Optional query options
41
+ * @returns {UserWalletsResponse} Returns an array of user assets by specifying user id
42
+ */
43
+ getUserAssets({ userId, queryOptions }: QueryUserRequest): Promise<UserAssetsResponse | undefined>;
44
+ /**
45
+ *
46
+ * Get all wallets belonging to a user.
47
+ * @param userId Wallaby's user ID
48
+ * @returns {UserWalletsResponse} Returns an array of user wallets by specifying user ID
49
+ */
50
+ getUserWallets({ userId, queryOptions }: QueryUserRequest): Promise<UserWalletsResponse | undefined>;
51
+ /**
52
+ *
53
+ * Get all assets that exist in a certain wallet, by specifying a wallet ID
54
+ * @param walletId Wallaby's wallet ID
55
+ * @param { BasicQueryOptions } queryOptions Optional query options
56
+ * @returns { WalletAssetsResponse } Returns all assets belonging in a certain wallet ID
57
+ */
58
+ getWalletAssets({ walletId, queryOptions }: QueryWalletRequest): Promise<WalletAssetsResponse | undefined>;
59
+ /**
60
+ * Adds a token to the wallet.
61
+ *
62
+ * @param {string} params.assetConfigId - The asset configuration ID.
63
+ * @param {string} params.walletId - The wallet ID.
64
+ * @param {string} params.userId - The user ID.
65
+ * @param {Object} params.config - The configuration object.
66
+ * @param {string} [params.config.contractAddress] - The contract address.
67
+ * @param {string} [params.config.suiObjectId] - The Sui object ID.
68
+ * @param {string} params.config.chainName - The name of the blockchain.
69
+ *
70
+ * @returns {Promise<AddTokenToWalletResponse>} The response from adding the token to the wallet.
71
+ *
72
+ * @throws {Error} If required parameters are missing or invalid.
73
+ */
74
+ addTokenToWallet({ assetConfigId, walletId, userId, config, }: AddTokenToWalletRequest): Promise<AddTokenToWalletResponse>;
75
+ /**
76
+ * Updates a wallet asset.
77
+ *
78
+ * @param {string} params.assetConfigId - Config ID for the user asset.
79
+ * @param {string} params.walletId - Wallet ID to which the asset belongs.
80
+ * @param {string} params.assetName - Asset name.
81
+ * @param {boolean} params.isVisible - Asset visibility toggle.
82
+ * @param {string} params.assetSymbol - Asset symbol.
83
+ *
84
+ * @returns {Promise<UpdateAssetResponse>} The response from updating the wallet token.
85
+ *
86
+ * @throws {Error} If required parameters are missing or invalid.
87
+ */
88
+ updateAsset({ assetConfigId, walletId, ...assetConfig }: UpdateAssetRequest): Promise<UpdateAssetResponse>;
89
+ }
@@ -0,0 +1,71 @@
1
+ import { Base } from '../../base';
2
+ import { ImportWalletRequest, CreateWalletRequest, Encrypted, RecoverWalletResponse, WallabyConfig, Share } from '../../types';
3
+ export declare class WalletHandlersService extends Base {
4
+ private authService;
5
+ private cipher;
6
+ constructor(config: WallabyConfig);
7
+ handleImportWallet(deviceAuthKeys: {
8
+ publicKey: string;
9
+ privateKey: string;
10
+ }, importWalletInput: ImportWalletRequest): Promise<{
11
+ wallabyAuthPubKey: string;
12
+ assets: Array<import("../../types").UserAsset>;
13
+ walletAddressInfo?: import("../../types").WalletAddressInfo;
14
+ encryptedSeed: Encrypted;
15
+ shares: Share[];
16
+ wallet: import("../../types").Wallet;
17
+ error?: any;
18
+ }>;
19
+ /**
20
+ * Handles the creation of a wallet, including generating signatures, validating input,
21
+ * and processing the wallet creation response.
22
+ * @private
23
+ * @param {Object} deviceAuthKeys - The device authentication key pair. { publicKey: string, privateKey: string}
24
+ * @param {CreateWalletRequest} walletCreationInput - The input parameters for wallet creation.
25
+ * @returns {Promise<Omit<CreateWalletResponse, 'standardSeedPhrase'> & { standardSeedPhrase?: string }>}
26
+ * The response from the wallet creation process, including the decrypted seed phrase if applicable.
27
+ * @throws {Error} If key share options are required but not provided, or if the number of shares is less than the threshold.
28
+ */
29
+ handleWalletCreation(deviceAuthKeys: {
30
+ publicKey: string;
31
+ privateKey: string;
32
+ }, walletCreationInput: CreateWalletRequest): Promise<{
33
+ standardSeedPhrase: string | undefined;
34
+ error?: any;
35
+ wallabyAuthPubKey: string;
36
+ assets: Array<import("../../types").UserAsset>;
37
+ encryptedSeed: Encrypted;
38
+ shares: Array<Share>;
39
+ reference: string;
40
+ wallet: import("../../types").Wallet;
41
+ }>;
42
+ handleKeySharesFromResponse({ keyShares, devicePrivateKey, credentialsKeyPair, }: {
43
+ keyShares: Share[];
44
+ devicePrivateKey: string;
45
+ credentialsKeyPair: {
46
+ publicKey: string;
47
+ privateKey: string;
48
+ };
49
+ }): Promise<void[]>;
50
+ handleSeedPhraseFromResponse({ encryptedSeed, devicePrivateKey, credentialsKeyPair, storeSeedPhrase, }: {
51
+ encryptedSeed: Encrypted;
52
+ devicePrivateKey: string;
53
+ credentialsKeyPair: {
54
+ publicKey: string;
55
+ privateKey: string;
56
+ };
57
+ storeSeedPhrase: boolean;
58
+ }): Promise<string>;
59
+ handleRecoverFromSeedPhrase({ encryptedSeedPhrase, deviceAuthKeys, }: {
60
+ encryptedSeedPhrase: Encrypted;
61
+ deviceAuthKeys: {
62
+ publicKey: string;
63
+ privateKey: string;
64
+ };
65
+ }): Promise<RecoverWalletResponse>;
66
+ handleConstructingSeedPhraseFromShares({ encryptedKeyShares, walletId, deviceAuthPublicKey, }: {
67
+ encryptedKeyShares: Encrypted[];
68
+ walletId: string;
69
+ deviceAuthPublicKey: string;
70
+ }): Promise<Encrypted>;
71
+ }