wallaby-cash 3.2.0 → 3.2.1
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.
- package/dist/base.d.ts +8 -1
- package/dist/helpers/auth-refresh-error.d.ts +4 -0
- package/dist/helpers/dedupe-manager.service.d.ts +18 -0
- package/dist/index.cjs.js +271 -70
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +271 -70
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +271 -70
- package/dist/index.js.map +1 -1
- package/dist/lib/auth/auth.service.d.ts +7 -0
- package/dist/lib/utils/is-jwt-expired.d.ts +8 -0
- package/dist/lib/wallet/wallet-handlers.service.d.ts +4 -2
- package/dist/package.json +8 -6
- package/dist/types/auth.d.ts +1 -1
- package/dist/types/error-response-codes.d.ts +8 -0
- package/dist/types/wallet.d.ts +3 -3
- package/package.json +5 -3
|
@@ -15,6 +15,13 @@ export declare class AuthService extends Base {
|
|
|
15
15
|
* @returns { boolean } Returns true if the user is authenticated, false otherwise.
|
|
16
16
|
*/
|
|
17
17
|
validateSession(): Promise<boolean>;
|
|
18
|
+
/**
|
|
19
|
+
* @description Refreshes auth tokens using the stored refresh token.
|
|
20
|
+
*/
|
|
21
|
+
refreshAuthTokens(): Promise<{
|
|
22
|
+
accessToken: string;
|
|
23
|
+
refreshToken: string;
|
|
24
|
+
}>;
|
|
18
25
|
/**
|
|
19
26
|
* @description Validates the user's password by decrypting the stored private key.
|
|
20
27
|
* @returns { boolean } Returns true if the password is valid, false otherwise.
|
|
@@ -7,6 +7,14 @@
|
|
|
7
7
|
export declare function jwtHasExpired(jwt: string | null): boolean;
|
|
8
8
|
export declare function jwtHasSameUser(jwt: string | null, userId: string): boolean;
|
|
9
9
|
export declare function userIsMfaVerified(jwt: string): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Checks if a given JWT will expire within the given threshold.
|
|
12
|
+
*
|
|
13
|
+
* @param jwt - The JWT string to check. If null, the function returns false.
|
|
14
|
+
* @param thresholdSeconds - Number of seconds before expiry to consider "near expiry".
|
|
15
|
+
* @returns `true` if the JWT expires within `thresholdSeconds` seconds, otherwise `false`.
|
|
16
|
+
*/
|
|
17
|
+
export declare function isJwtNearExpiry(jwt: string | null, thresholdSeconds: number): boolean;
|
|
10
18
|
/**
|
|
11
19
|
* Calculates the remaining time in milliseconds until a given JWT expires.
|
|
12
20
|
*
|
|
@@ -7,7 +7,9 @@ export declare class WalletHandlersService extends Base {
|
|
|
7
7
|
handleImportWallet(deviceAuthKeys: {
|
|
8
8
|
publicKey: string;
|
|
9
9
|
privateKey: string;
|
|
10
|
-
}, importWalletInput: ImportWalletRequest
|
|
10
|
+
}, importWalletInput: ImportWalletRequest & {
|
|
11
|
+
reference: string;
|
|
12
|
+
}): Promise<ImportWalletResponse>;
|
|
11
13
|
/**
|
|
12
14
|
* Handles the creation of a wallet, including generating signatures, validating input,
|
|
13
15
|
* and processing the wallet creation response.
|
|
@@ -26,7 +28,7 @@ export declare class WalletHandlersService extends Base {
|
|
|
26
28
|
wallabyAuthPubKey: string;
|
|
27
29
|
assets: Array<import("../../types").UserAsset>;
|
|
28
30
|
encryptedSeed?: Encrypted;
|
|
29
|
-
shares?:
|
|
31
|
+
shares?: KeyShareDto[];
|
|
30
32
|
encryptedBackupShare?: Encrypted | SymmetricEncrypted;
|
|
31
33
|
reference: string;
|
|
32
34
|
wallet: import("../../types").Wallet;
|
package/dist/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wallaby-cash",
|
|
3
|
-
"version": "3.1
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
|
-
"url": "
|
|
6
|
+
"url": "https://github.com/WALLABY-WaaS/wallaby-sdk-js"
|
|
7
7
|
},
|
|
8
8
|
"main": "./dist/index.cjs.js",
|
|
9
9
|
"module": "./dist/index.esm.js",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"docs:generate": "npx typedoc",
|
|
49
49
|
"generate:types": "node scripts/generate-api-types.mjs",
|
|
50
50
|
"generate:types:local": "node scripts/generate-api-types.mjs --local",
|
|
51
|
-
"release": "npm publish
|
|
51
|
+
"release": "npm publish",
|
|
52
52
|
"release:alpha": "npm run build && npm publish --tag alpha",
|
|
53
53
|
"release:native": "npm run build && npm publish --tag native",
|
|
54
54
|
"release:beta": "npm run build && npm publish --tag beta",
|
|
@@ -125,19 +125,21 @@
|
|
|
125
125
|
}
|
|
126
126
|
},
|
|
127
127
|
"overrides": {
|
|
128
|
+
"@babel/core": "^7.29.6",
|
|
128
129
|
"lodash": "^4.18.0",
|
|
129
130
|
"@tootallnate/once": "^3.0.1",
|
|
130
131
|
"markdown-it": "^14.1.1",
|
|
131
132
|
"defu": "^6.1.5",
|
|
132
133
|
"diff": "^5.2.2",
|
|
133
|
-
"tar": "^7.5.
|
|
134
|
+
"tar": "^7.5.16",
|
|
134
135
|
"jsdom": {
|
|
135
136
|
"ws": "^8.20.1"
|
|
136
137
|
},
|
|
137
138
|
"undici": "^7.19.0",
|
|
138
|
-
"js-yaml": "^4.
|
|
139
|
+
"js-yaml": "^4.2.0",
|
|
139
140
|
"pbkdf2": "^3.1.3",
|
|
140
|
-
"esbuild": "^0.
|
|
141
|
+
"esbuild": "^0.28.1",
|
|
142
|
+
"form-data": "^4.0.6",
|
|
141
143
|
"ws": "^8.20.1",
|
|
142
144
|
"@octokit/core": "^6.1.0",
|
|
143
145
|
"@octokit/request": "^8.4.1",
|
package/dist/types/auth.d.ts
CHANGED
|
@@ -10,12 +10,19 @@ export declare enum ErrorResponseCodes {
|
|
|
10
10
|
'auth_api_jwt_invalid' = "auth_api_jwt_invalid",
|
|
11
11
|
'auth_api_jwt_not_active' = "auth_api_jwt_not_active",
|
|
12
12
|
'auth_api_jwt_not_provided' = "auth_api_jwt_not_provided",
|
|
13
|
+
'auth_api_jwt_expired' = "auth_api_jwt_expired",
|
|
14
|
+
'auth_api_unauthorized' = "auth_api_unauthorized",
|
|
15
|
+
'auth_refresh_token_not_found' = "auth_refresh_token_not_found",
|
|
16
|
+
'auth_refresh_token_expired' = "auth_refresh_token_expired",
|
|
17
|
+
'auth_refresh_token_reuse_detected' = "auth_refresh_token_reuse_detected",
|
|
13
18
|
'auth_client_jwt_invalid' = "auth_client_jwt_invalid",
|
|
14
19
|
'auth_client_jwt_missing_external_id_payload' = "auth_client_jwt_missing_external_id_payload",
|
|
15
20
|
'auth_client_jwt_missing_exp_payload' = "auth_client_jwt_missing_exp_payload",
|
|
16
21
|
'auth_client_jwt_external_id_not_match' = "auth_client_jwt_external_id_not_match",
|
|
17
22
|
'auth_client_jwt_expired' = "auth_client_jwt_expired",
|
|
18
23
|
'auth_client_jwt_not_provided' = "auth_client_jwt_not_provided",
|
|
24
|
+
'auth_client_jwt_invalid_auth_type' = "auth_client_jwt_invalid_auth_type",
|
|
25
|
+
'auth_client_jwt_invalid_passkey' = "auth_client_jwt_invalid_passkey",
|
|
19
26
|
'auth_client_pub_key_and_message_not_match' = "auth_client_pub_key_and_message_not_match",
|
|
20
27
|
'auth_client_pub_key_and_message_expired' = "auth_client_pub_key_and_message_expired",
|
|
21
28
|
'auth_client_pub_key_and_message_signature_failed' = "auth_client_pub_key_and_message_signature_failed",
|
|
@@ -40,6 +47,7 @@ export declare enum ErrorResponseCodes {
|
|
|
40
47
|
'sdk_seed_phrase_not_found' = "sdk_seed_phrase_not_found",
|
|
41
48
|
'sdk_private_key_decryption_failed' = "sdk_private_key_decryption_failed",
|
|
42
49
|
'sdk_private_key_not_found' = "sdk_private_key_not_found",
|
|
50
|
+
'sdk_refresh_token_missing' = "sdk_refresh_token_missing",
|
|
43
51
|
'sdk_missing_parameter' = "sdk_missing_parameter",
|
|
44
52
|
'sdk_invalid_parameter' = "sdk_invalid_parameter",
|
|
45
53
|
'sdk_wrong_password' = "sdk_wrong_password",
|
package/dist/types/wallet.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UpdateUserAssetRequestDto, WalletAddress } from '../generated/api';
|
|
1
|
+
import { KeyShareDto, UpdateUserAssetRequestDto, WalletAddress } from '../generated/api';
|
|
2
2
|
import { AuthenticationResponse, AuthResponse } from './auth';
|
|
3
3
|
import { UserAsset, TokenStandard, User, BlockchainName, Encrypted, BasicQueryOptions, AssetConfig } from './common';
|
|
4
4
|
import { Merchant } from './merchants';
|
|
@@ -153,7 +153,7 @@ export declare type CreateWalletResponse = {
|
|
|
153
153
|
wallabyAuthPubKey: string;
|
|
154
154
|
assets: Array<UserAsset>;
|
|
155
155
|
encryptedSeed?: Encrypted;
|
|
156
|
-
shares?:
|
|
156
|
+
shares?: KeyShareDto[];
|
|
157
157
|
encryptedBackupShare?: Encrypted | SymmetricEncrypted;
|
|
158
158
|
standardSeedPhrase?: string;
|
|
159
159
|
reference: string;
|
|
@@ -188,7 +188,7 @@ export declare type ImportWalletResponse = {
|
|
|
188
188
|
assets: Array<UserAsset>;
|
|
189
189
|
walletAddressesInfo: WalletAddressesInfoEntry[];
|
|
190
190
|
encryptedSeed?: Encrypted;
|
|
191
|
-
shares?:
|
|
191
|
+
shares?: KeyShareDto[];
|
|
192
192
|
encryptedBackupShare?: Encrypted | SymmetricEncrypted;
|
|
193
193
|
wallet: Wallet;
|
|
194
194
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wallaby-cash",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/WALLABY-WaaS/wallaby-sdk-js"
|
|
@@ -125,19 +125,21 @@
|
|
|
125
125
|
}
|
|
126
126
|
},
|
|
127
127
|
"overrides": {
|
|
128
|
+
"@babel/core": "^7.29.6",
|
|
128
129
|
"lodash": "^4.18.0",
|
|
129
130
|
"@tootallnate/once": "^3.0.1",
|
|
130
131
|
"markdown-it": "^14.1.1",
|
|
131
132
|
"defu": "^6.1.5",
|
|
132
133
|
"diff": "^5.2.2",
|
|
133
|
-
"tar": "^7.5.
|
|
134
|
+
"tar": "^7.5.16",
|
|
134
135
|
"jsdom": {
|
|
135
136
|
"ws": "^8.20.1"
|
|
136
137
|
},
|
|
137
138
|
"undici": "^7.19.0",
|
|
138
|
-
"js-yaml": "^4.
|
|
139
|
+
"js-yaml": "^4.2.0",
|
|
139
140
|
"pbkdf2": "^3.1.3",
|
|
140
141
|
"esbuild": "^0.28.1",
|
|
142
|
+
"form-data": "^4.0.6",
|
|
141
143
|
"ws": "^8.20.1",
|
|
142
144
|
"@octokit/core": "^6.1.0",
|
|
143
145
|
"@octokit/request": "^8.4.1",
|