@injectivelabs/wallet-turnkey 1.15.36 → 1.15.38

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.
@@ -90,12 +90,8 @@ class TurnkeyWallet {
90
90
  organizationId: actualOrganizationId,
91
91
  };
92
92
  }
93
- catch (e) {
94
- throw new exceptions_1.WalletException(new Error(e.message), {
95
- code: exceptions_1.UnspecifiedErrorCode,
96
- type: exceptions_1.ErrorType.WalletError,
97
- contextModule: 'turnkey-wallet-get-session',
98
- });
93
+ catch {
94
+ throw new exceptions_1.TurnkeyWalletSessionException(new Error('Session expired. Please login again.'));
99
95
  }
100
96
  }
101
97
  async getAccounts() {
@@ -171,7 +167,7 @@ class TurnkeyWallet {
171
167
  });
172
168
  const session = await this.turnkey?.getSession();
173
169
  if (!session) {
174
- throw new exceptions_1.WalletException(new Error('Failed to refresh session'));
170
+ throw new exceptions_1.TurnkeyWalletSessionException(new Error('Session expired. Please login again.'));
175
171
  }
176
172
  this.organizationId = session.organizationId;
177
173
  this.metadata.organizationId = session.organizationId;
@@ -87,12 +87,8 @@ export class TurnkeyWallet {
87
87
  organizationId: actualOrganizationId,
88
88
  };
89
89
  }
90
- catch (e) {
91
- throw new WalletException(new Error(e.message), {
92
- code: UnspecifiedErrorCode,
93
- type: ErrorType.WalletError,
94
- contextModule: 'turnkey-wallet-get-session',
95
- });
90
+ catch {
91
+ throw new TurnkeyWalletSessionException(new Error('Session expired. Please login again.'));
96
92
  }
97
93
  }
98
94
  async getAccounts() {
@@ -168,7 +164,7 @@ export class TurnkeyWallet {
168
164
  });
169
165
  const session = await this.turnkey?.getSession();
170
166
  if (!session) {
171
- throw new WalletException(new Error('Failed to refresh session'));
167
+ throw new TurnkeyWalletSessionException(new Error('Session expired. Please login again.'));
172
168
  }
173
169
  this.organizationId = session.organizationId;
174
170
  this.metadata.organizationId = session.organizationId;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@injectivelabs/wallet-turnkey",
3
3
  "description": "Turnkey wallet strategy for use with @injectivelabs/wallet-core.",
4
- "version": "1.15.36",
4
+ "version": "1.15.38",
5
5
  "sideEffects": false,
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -59,11 +59,11 @@
59
59
  "start": "node dist/index.js"
60
60
  },
61
61
  "dependencies": {
62
- "@injectivelabs/exceptions": "^1.15.33",
63
- "@injectivelabs/sdk-ts": "^1.15.36",
64
- "@injectivelabs/ts-types": "^1.15.34",
65
- "@injectivelabs/utils": "^1.15.34",
66
- "@injectivelabs/wallet-base": "^1.15.36",
62
+ "@injectivelabs/exceptions": "^1.15.35",
63
+ "@injectivelabs/sdk-ts": "^1.15.38",
64
+ "@injectivelabs/ts-types": "^1.15.36",
65
+ "@injectivelabs/utils": "^1.15.36",
66
+ "@injectivelabs/wallet-base": "^1.15.38",
67
67
  "@turnkey/sdk-browser": "5.2.3",
68
68
  "@turnkey/viem": "^0.9.9",
69
69
  "viem": "^2.31.3"
@@ -77,5 +77,5 @@
77
77
  "tsconfig-paths": "^4.2.0",
78
78
  "typescript": "^5.0.0"
79
79
  },
80
- "gitHead": "ac2df064aa01bc617fb79c547a085dae55c53703"
80
+ "gitHead": "2f6b7586dc08c30e83fe780a565571b73af6cacc"
81
81
  }