@pear-protocol/symmio-client 0.3.15 → 0.3.17

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/README.md CHANGED
@@ -7,7 +7,7 @@ Pear Protocol's standalone SDK for **Symmio** — account management via MultiAc
7
7
  ## Installation
8
8
 
9
9
  ```bash
10
- npm install @pear-protocol/symmio-client viem
10
+ bun add @pear-protocol/symmio-client viem
11
11
  ```
12
12
 
13
13
  `viem` is a peer dependency and must be installed alongside `@pear-protocol/symmio-client`.
@@ -265,13 +265,13 @@ This package uses Changesets for versioning and npm publishing.
265
265
 
266
266
  ```bash
267
267
  # create a release note for your change
268
- npm run changeset
268
+ bun run changeset
269
269
 
270
- # apply pending version bumps and refresh package-lock.json
271
- npm run version-packages
270
+ # apply pending version bumps and refresh bun.lock
271
+ bun run version-packages
272
272
 
273
273
  # publish the package to npm
274
- npm run release
274
+ bun run release
275
275
  ```
276
276
 
277
277
  The GitHub Actions release workflow expects an `NPM_TOKEN` repository secret with publish access to `@pear-protocol/symmio-client`.
package/dist/index.js CHANGED
@@ -23282,6 +23282,7 @@ var SymmioSDKError = class extends Error {
23282
23282
  this.code = code;
23283
23283
  this.name = "SymmioSDKError";
23284
23284
  }
23285
+ code;
23285
23286
  };
23286
23287
  function validateAddress(address, name) {
23287
23288
  if (!viem.isAddress(address)) {
@@ -24741,15 +24742,24 @@ function readTimestamp(source) {
24741
24742
  const parsed = Number(timestamp);
24742
24743
  return Number.isFinite(parsed) ? parsed : void 0;
24743
24744
  }
24745
+ function hasAccountDataShape(value) {
24746
+ return isRecord(value) && ("equity" in value || "maintenanceMargin" in value || "availableForOrder" in value || "totalLocked" in value);
24747
+ }
24744
24748
  function getSymmAccountData(response) {
24745
24749
  if (!isRecord(response)) {
24746
24750
  return void 0;
24747
24751
  }
24748
24752
  const data = response.data;
24749
24753
  if (isRecord(data)) {
24750
- return data;
24754
+ if (hasAccountDataShape(data.accountData)) {
24755
+ return data.accountData;
24756
+ }
24757
+ if (hasAccountDataShape(data)) {
24758
+ return data;
24759
+ }
24760
+ return void 0;
24751
24761
  }
24752
- if ("equity" in response || "maintenanceMargin" in response || "availableForOrder" in response || "totalLocked" in response) {
24762
+ if (hasAccountDataShape(response)) {
24753
24763
  return response;
24754
24764
  }
24755
24765
  return void 0;