@xswap-link/sdk 0.10.13 → 0.10.14

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xswap-link/sdk",
3
- "version": "0.10.13",
3
+ "version": "0.10.14",
4
4
  "description": "JavaScript SDK for XSwap platform",
5
5
  "homepage": "https://github.com/xswap-link/xswap-sdk",
6
6
  "repository": {
@@ -1,12 +1,9 @@
1
- import { Buffer } from "buffer";
2
-
3
- // Conditionally polyfill Node.js Buffer for browser environments.
4
- // To enable this, set: window.XSwapSDKConfig = { enableBufferPolyfill: true } before loading the SDK.
5
- const shouldPolyfill =
6
- typeof window !== "undefined" &&
7
- typeof window.Buffer === "undefined" &&
8
- window?.XSwapSDKConfig?.enableBufferPolyfill === true;
9
-
10
- if (shouldPolyfill) {
11
- window.Buffer = Buffer;
1
+ if (typeof globalThis.Buffer === "undefined") {
2
+ import("buffer")
3
+ .then(({ Buffer }) => {
4
+ globalThis.Buffer = Buffer;
5
+ })
6
+ .catch((err) => {
7
+ console.error("Failed to load Buffer polyfill:", err);
8
+ });
12
9
  }