wallaby-cash 2.3.6 → 2.3.7

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.
@@ -1,6 +1,5 @@
1
1
  import { Base } from '../../base';
2
- import { SignatureMessageResponse, WallabyConfig, AuthenticationResponse, AsymmetricKeyPair, PasskeyChallengeType } from '../../types';
3
- import { AuthenticationRequest } from './auth.model';
2
+ import { SignatureMessageResponse, WallabyConfig, AuthenticationResponse, AsymmetricKeyPair, GetSignatureOptions, AuthenticationRequest } from '../../types';
4
3
  import { GetPasskeyCredentialsData } from '../../generated/api';
5
4
  export declare class AuthService extends Base {
6
5
  private passkeyService;
@@ -39,7 +38,7 @@ export declare class AuthService extends Base {
39
38
  * @param { PasskeyChallengeType } passkeyChallengeType the type of passkey challenge to request, either for registration or authentication.
40
39
  * @returns the messaged, the hash, and the signature using the passed private key.
41
40
  */
42
- getSignature(deviceAuthKeys: AsymmetricKeyPair, passkeyChallengeType?: PasskeyChallengeType): Promise<SignatureMessageResponse>;
41
+ getSignature({ deviceAuthKeys, walletId, passkeyChallengeType, }: GetSignatureOptions): Promise<SignatureMessageResponse>;
43
42
  /**
44
43
  * Signs up a new user.
45
44
  *
@@ -1,7 +1,6 @@
1
1
  import { Base } from '../../base';
2
- import { WallabyConfig, TokenStandard, FeeEstimatesResponse, Transaction, BlockchainName, GetPendingTransactionsRequest, GetPendingTransactionsResponse, ResolvePendingTransactionRequest, ResolvePendingTransactionResponse, TransactionResponse } from '../../types';
2
+ import { WallabyConfig, TokenStandard, FeeEstimatesResponse, Transaction, BlockchainName, GetPendingTransactionsRequest, GetPendingTransactionsResponse, ResolvePendingTransactionRequest, ResolvePendingTransactionResponse, TransactionResponse, FeeEstimateRequest } from '../../types';
3
3
  import { CreateAllowanceRequest, TransactionStatusResponse, TransferRequest } from '../../types';
4
- import { FeeEstimateRequest } from './transactions.model';
5
4
  export declare class Transactions extends Base {
6
5
  private authService;
7
6
  private walletService;
@@ -18,7 +17,7 @@ export declare class Transactions extends Base {
18
17
  * @param {BlockchainName} blockchain
19
18
  * @returns {FeeEstimateRequest}
20
19
  */
21
- estimateFee({ originAddress, recipientAddress, amount, token, transactionType, }: FeeEstimateRequest): Promise<FeeEstimatesResponse | undefined>;
20
+ estimateFee({ originAddress, recipientAddress, amount, transactionType, token, }: FeeEstimateRequest): Promise<FeeEstimatesResponse | undefined>;
22
21
  /**
23
22
  *
24
23
  * @public
@@ -37,18 +37,6 @@ export declare class StorageService {
37
37
  checkBackupKeyShareExists(walletId: string): Promise<boolean>;
38
38
  checkSeedPhraseExists(walletId: string): Promise<boolean>;
39
39
  private getSeedPhraseV2KeyName;
40
- /**
41
- *
42
- * Stores Wallaby auth public key to local storage
43
- * @param wallabyAuthPubKey
44
- */
45
- setWallabyAuthPubKey(wallabyAuthPubKey: string): Promise<void>;
46
- /**
47
- *
48
- * Fetches Wallaby auth public key from local storage
49
- * @returns { string | undefined } Wallaby Auth Public key or undefined.
50
- */
51
- getWallabyAuthPubKey(): Promise<string | undefined>;
52
40
  /**
53
41
  * @deprecated This function is only used in tests, and should not be used anywhere else.
54
42
  * Encrypts and stores device auth private key
@@ -35,7 +35,7 @@ export declare class WalletDataService extends Base {
35
35
  * Note: Either chainName or tokenStandard must be provided.
36
36
  * @returns { FetchBalanceData } Returns an array of the requested tokens balances.
37
37
  */
38
- getMultiTokenBalances({ walletId, tokensAndAddressesList }: {
38
+ getMultiTokenBalances({ walletId, tokensAndAddressesList, }: {
39
39
  walletId?: string;
40
40
  tokensAndAddressesList: TokenBalanceRequest[];
41
41
  }): Promise<FetchBalanceData>;
@@ -1,5 +1,5 @@
1
1
  import { Base } from '../../base';
2
- import { ImportWalletRequest, CreateWalletRequest, Encrypted, WallabyConfig, AsymmetricKeyPair, ImportWalletResponse, RecoverWalletResponse } from '../../types';
2
+ import { ImportWalletRequest, CreateWalletRequest, Encrypted, WallabyConfig, ImportWalletResponse, RecoverWalletResponse } from '../../types';
3
3
  import { KeyShareDto } from '../../generated/api';
4
4
  export declare class WalletHandlersService extends Base {
5
5
  private authService;
@@ -58,19 +58,4 @@ export declare class WalletHandlersService extends Base {
58
58
  privateKey: string;
59
59
  };
60
60
  }): Promise<RecoverWalletResponse>;
61
- /**
62
- *
63
- * @param encryptedKeyShares - Encrypted key shares that are encrypted with the wallabyAuthPublicKey.
64
- * @param walletId - The ID of the wallet for which the seed phrase is being constructed.
65
- * @param deviceAuthKeys - The device authentication key pair used to sign the request.
66
- * @description This function constructs the seed phrase from encrypted key shares.
67
- * It retrieves the seed phrase by sending a request to the Wallaby API with the encrypted key shares.
68
- * The shares should be encrypted with the wallabyAuthPublicKey before passing them into this function.
69
- * @returns The function returns the encrypted seed phrase wrapped with client device public key.
70
- */
71
- handleConstructingSeedPhraseFromShares({ encryptedKeyShares, walletId, deviceAuthKeys, }: {
72
- encryptedKeyShares: Encrypted[];
73
- walletId: string;
74
- deviceAuthKeys: AsymmetricKeyPair;
75
- }): Promise<Encrypted>;
76
61
  }
@@ -95,6 +95,9 @@ export declare class WalletService extends Base {
95
95
  *
96
96
  * @param { RecoverWalletRequest } input - The request object containing the necessary parameters.
97
97
  * @returns { Promise<RecoverWalletResponse> } The response containing the recovered wallet details.
98
+ *
99
+ * @deprecated This function is deprecated and will be removed in the next major release. It only supports seed phrase recovery.
100
+ * Use `import` instead with the `RETURN_ONLY_ENCRYPTED_SEED_PHRASE` option to maintain the same behavior.
98
101
  */
99
102
  recover(input: RecoverWalletRequest): Promise<RecoverWalletResponse>;
100
103
  /**
@@ -193,7 +196,9 @@ export declare class WalletService extends Base {
193
196
  }): Promise<{
194
197
  isAccessVerified: boolean;
195
198
  }>;
196
- clearDevice(): Promise<void>;
199
+ clearDevice({ walletId }: {
200
+ walletId?: string;
201
+ }): Promise<void>;
197
202
  /**
198
203
  * Prepares authentication data and encrypted payload for any request.
199
204
  */
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wallaby-cash",
3
- "version": "2.3.6",
3
+ "version": "2.3.7",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git@github.com:WALLABY-WaaS/wallaby-sdk-js.git"
@@ -107,7 +107,6 @@
107
107
  "ethereum-cryptography": "^3.0.0",
108
108
  "js-base64": "^3.7.7",
109
109
  "jwt-decode": "^4.0.0",
110
- "lodash": "^4.17.23",
111
110
  "loglevel": "^1.9.2",
112
111
  "loglevel-plugin-prefix": "^0.8.4",
113
112
  "uuid": "^10.0.0"
@@ -1,4 +1,4 @@
1
- import { User, Base64URLString } from './common';
1
+ import { User, Base64URLString, AsymmetricKeyPair } from './common';
2
2
  /**
3
3
  * Local WebAuthn type definitions (duplicated from @simplewebauthn/browser to avoid dependency)
4
4
  * These match the WebAuthn specification and @simplewebauthn/browser types
@@ -158,7 +158,7 @@ export interface AuthenticationExtensionsClientOutputs {
158
158
  export interface RegistrationResponseJSON {
159
159
  id: Base64URLString;
160
160
  rawId: Base64URLString;
161
- response: AuthenticatorAttestationResponseJSON;
161
+ response: AuthenticatorAttestationResponseJSON | Record<string, unknown>;
162
162
  authenticatorAttachment?: AuthenticatorAttachment;
163
163
  clientExtensionResults: AuthenticationExtensionsClientOutputs;
164
164
  type: PublicKeyCredentialType;
@@ -207,7 +207,7 @@ export interface PublicKeyCredentialCreationOptionsJSON {
207
207
  export interface AuthenticationResponseJSON {
208
208
  id: Base64URLString;
209
209
  rawId: Base64URLString;
210
- response: AuthenticatorAssertionResponseJSON;
210
+ response: AuthenticatorAssertionResponseJSON | Record<string, unknown>;
211
211
  authenticatorAttachment?: AuthenticatorAttachment;
212
212
  clientExtensionResults: AuthenticationExtensionsClientOutputs;
213
213
  type: PublicKeyCredentialType;
@@ -232,6 +232,7 @@ export declare type SignatureMessageResponse = {
232
232
  hashedMessage: string;
233
233
  signature: string;
234
234
  challenge: Base64URLString;
235
+ wallabyAuthPubKey: string;
235
236
  authenticationOptions?: PublicKeyCredentialRequestOptionsJSON;
236
237
  registrationOptions?: PublicKeyCredentialCreationOptionsJSON;
237
238
  };
@@ -286,6 +287,11 @@ export declare enum PasskeyChallengeType {
286
287
  REGISTRATION = "webauthn.create",
287
288
  AUTHENTICATION = "webauthn.get"
288
289
  }
290
+ export type GetSignatureOptions = {
291
+ deviceAuthKeys: AsymmetricKeyPair;
292
+ walletId?: string;
293
+ passkeyChallengeType?: PasskeyChallengeType;
294
+ };
289
295
  export interface PRFExtension {
290
296
  prf?: {
291
297
  eval?: {
@@ -335,11 +341,7 @@ export declare type SignInRequest = {
335
341
  displayName?: string;
336
342
  };
337
343
  export declare type AuthenticationRequest = {
338
- nickname?: string;
339
- displayName?: string;
340
344
  password?: string;
341
- prfValue?: Uint8Array;
342
- clientSalt?: string;
343
345
  };
344
346
  export declare type AuthResponseData = {
345
347
  accessToken: string;
@@ -24,7 +24,6 @@ export declare enum LocalStorageItems {
24
24
  EncryptedAlgorandSeedPhrase = "encrypted-algorand-seedPhrase",
25
25
  EncryptedDevicePrivateKey = "encrypted-private-key",
26
26
  ClientAuthPublicKey = "client-auth-pub-key",
27
- WallabyAuthPubKey = "wallaby-auth-pub-key",
28
27
  ClientAuthToken = "republic-jwt",
29
28
  PasskeyCredential = "pass-key-credential",
30
29
  Blob = "blob"
@@ -64,13 +64,16 @@ export declare enum MultisigParticipantStatus {
64
64
  Rejected = "rejected"
65
65
  }
66
66
  export declare type FeeEstimateRequest = {
67
+ amount: string;
67
68
  originAddress: string;
68
69
  recipientAddress: string;
69
- amount: number;
70
- assetSymbol: string;
71
70
  transactionType: TransactionType;
72
- tokenStandard?: TokenStandard;
73
- blockchain?: BlockchainName;
71
+ token: {
72
+ symbol: string;
73
+ chainName?: BlockchainName;
74
+ tokenStandard?: TokenStandard;
75
+ slip44?: BlockchainSlip44;
76
+ };
74
77
  };
75
78
  export declare type FeeEstimatesResponse = {
76
79
  feePaymentSymbol: string;
@@ -175,7 +175,10 @@ export declare type CommonWalletRequest = {
175
175
  };
176
176
  export declare type ImportWalletRequest = CommonWalletRequest & {
177
177
  seedPhrase: string;
178
+ reference?: string;
178
179
  wallabyUserId?: string;
180
+ /** When set (e.g. re-import while a wallet id is already known), forwarded to `getSignature` so the server can scope the ephemeral key to this wallet. */
181
+ walletId?: string;
179
182
  };
180
183
  export declare type ImportWalletResponse = {
181
184
  wallabyAuthPubKey: string;
@@ -191,9 +194,6 @@ export declare type Wallet = {
191
194
  merchantId: string;
192
195
  revisionId: string;
193
196
  revisionName: string;
194
- evmAddress: string;
195
- btcAddress: string;
196
- algoAddress: string;
197
197
  hashedSeedPhrase: string;
198
198
  hashedSeedPhraseSalt: string;
199
199
  recoveryCount: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wallaby-cash",
3
- "version": "2.3.6",
3
+ "version": "2.3.7",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git@github.com:WALLABY-WaaS/wallaby-sdk-js.git"
@@ -107,7 +107,6 @@
107
107
  "ethereum-cryptography": "^3.0.0",
108
108
  "js-base64": "^3.7.7",
109
109
  "jwt-decode": "^4.0.0",
110
- "lodash": "^4.17.23",
111
110
  "loglevel": "^1.9.2",
112
111
  "loglevel-plugin-prefix": "^0.8.4",
113
112
  "uuid": "^10.0.0"
@@ -1,108 +0,0 @@
1
- import { User } from '../../types/common';
2
- export declare type SignatureMessageResponse = {
3
- message: string;
4
- hashedMessage: string;
5
- signature: string;
6
- /** @deprecated */
7
- error?: any;
8
- };
9
- export declare type AuthRequest = {
10
- password: string;
11
- /**
12
- * @deprecated
13
- */
14
- firstName?: string;
15
- /**
16
- * @deprecated
17
- */
18
- lastName?: string;
19
- /**
20
- * @deprecated
21
- */
22
- email?: string;
23
- };
24
- export declare type AuthResponse = {
25
- accessToken: string;
26
- user: User;
27
- signatureMessageResponse: SignatureMessageResponse;
28
- prfValue?: Uint8Array;
29
- password?: string;
30
- clientSalt?: string;
31
- /** @deprecated */
32
- error?: any;
33
- };
34
- export declare type ClientAuthPubKeyRequest = {
35
- password: string;
36
- userId: string;
37
- message: string;
38
- clientAuthPubKey: string;
39
- signature: string;
40
- newClientAuthPubKey: string;
41
- };
42
- export declare type ClientAuthPubKeyResponse = {
43
- user: User;
44
- /** @deprecated */
45
- error?: any;
46
- };
47
- export declare type RefreshAccessTokenResponse = {
48
- accessToken: string;
49
- idToken: string;
50
- /** @deprecated */
51
- error?: any;
52
- };
53
- export declare type SignatureResponse = {
54
- signature: string;
55
- hashedMessage: string;
56
- message: string;
57
- };
58
- export declare type Base64URLString = string;
59
- export interface PRFExtension {
60
- prf?: {
61
- eval?: {
62
- base64: Base64URLString;
63
- first: Uint8Array;
64
- second?: Uint8Array;
65
- };
66
- [key: string]: any;
67
- };
68
- }
69
- export type ExtendedAuthenticatorResponse = AuthenticatorResponse & {
70
- attestationObject: AuthenticatorAssertionResponse;
71
- signature: ArrayBuffer;
72
- authenticatorData: ArrayBuffer;
73
- userHandle: ArrayBuffer;
74
- };
75
- export type ExtendedAuthenticationExtensionsClientOutputs = AuthenticationExtensionsClientOutputs & PRFExtension;
76
- export type ExtendedAuthenticationExtensionsClientInputs = AuthenticationExtensionsClientInputs & PRFExtension;
77
- export declare enum PublicKeyCredentialAlgorithm {
78
- RS256 = -257,
79
- ES256 = -7
80
- }
81
- export declare enum TransportEnum {
82
- Usb = "usb",
83
- Nfc = "nfc",
84
- Ble = "ble",
85
- Internal = "internal",
86
- Hybrid = "hybrid"
87
- }
88
- export declare type SignInRequest = {
89
- password?: string;
90
- nickname?: string;
91
- displayName?: string;
92
- };
93
- export declare type AuthenticationRequest = {
94
- password?: string;
95
- };
96
- export declare type AuthenticationResponse = {
97
- accessToken: string;
98
- user: User;
99
- signatureMessageResponse: SignatureMessageResponse;
100
- nickname?: string;
101
- displayName?: string;
102
- password?: string;
103
- prfValue?: Uint8Array;
104
- wallabyAuthPublicKey: string;
105
- clientSalt: string;
106
- /** @deprecated */
107
- error?: any;
108
- };
@@ -1,22 +0,0 @@
1
- import { AuthenticationResponse } from '../auth/auth.model';
2
- import { BlockchainName, BlockchainSlip44, TokenStandard, TransactionType } from '../../types';
3
- export declare type FeeEstimateRequest = Omit<BaseTransactionRequest, keyof AuthenticationResponse>;
4
- export declare type BaseTransactionRequest = AuthenticationResponse & {
5
- amount: string;
6
- originAddress: string;
7
- recipientAddress: string;
8
- transactionType: TransactionType;
9
- token: {
10
- symbol: string;
11
- chainName?: BlockchainName;
12
- tokenStandard?: TokenStandard;
13
- slip44?: BlockchainSlip44.ETH;
14
- };
15
- };
16
- export type FeeEstimatesResponse = {
17
- feePaymentSymbol: string;
18
- fee: string;
19
- lowestFee: string;
20
- highestFee: string;
21
- error?: any;
22
- };