@pear-protocol/exchanges-sdk 0.1.4 → 0.1.5

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.
@@ -26,7 +26,7 @@ function createLighterHelper(sdk) {
26
26
  },
27
27
  async connectWallet(walletClient, params) {
28
28
  const apiKeys = await fetchApiKeys(params.accountIndex);
29
- const apiKeyIndex = apiKeys.length === 0 ? 3 : apiKeys.reduce((max, k) => k.api_key_index > max ? k.api_key_index : max, 0) + 1;
29
+ const apiKeyIndex = Math.max(4, ...apiKeys.map((k) => k.api_key_index + 1));
30
30
  const { privateKey, messageToSign, txInfo } = await sdk.core.misc.lighter.createApiKey({
31
31
  accountIndex: params.accountIndex,
32
32
  apiKeyIndex
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pear-protocol/exchanges-sdk",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Pear Protocol Exchanges SDK",
5
5
  "private": false,
6
6
  "type": "module",