@sip-protocol/sdk 0.1.1 → 0.1.4

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/index.js CHANGED
@@ -1616,7 +1616,7 @@ var OneClickClient = class {
1616
1616
  this.baseUrl = config.baseUrl ?? DEFAULTS.baseUrl;
1617
1617
  this.jwtToken = config.jwtToken;
1618
1618
  this.timeout = config.timeout ?? DEFAULTS.timeout;
1619
- this.fetchFn = config.fetch ?? globalThis.fetch;
1619
+ this.fetchFn = config.fetch ?? globalThis.fetch.bind(globalThis);
1620
1620
  }
1621
1621
  /**
1622
1622
  * Get all supported tokens
package/dist/index.mjs CHANGED
@@ -1419,7 +1419,7 @@ var OneClickClient = class {
1419
1419
  this.baseUrl = config.baseUrl ?? DEFAULTS.baseUrl;
1420
1420
  this.jwtToken = config.jwtToken;
1421
1421
  this.timeout = config.timeout ?? DEFAULTS.timeout;
1422
- this.fetchFn = config.fetch ?? globalThis.fetch;
1422
+ this.fetchFn = config.fetch ?? globalThis.fetch.bind(globalThis);
1423
1423
  }
1424
1424
  /**
1425
1425
  * Get all supported tokens
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sip-protocol/sdk",
3
- "version": "0.1.1",
3
+ "version": "0.1.4",
4
4
  "description": "Core SDK for Shielded Intents Protocol - Privacy layer for cross-chain transactions",
5
5
  "author": "SIP Protocol <hello@sip-protocol.org>",
6
6
  "homepage": "https://sip-protocol.org",
@@ -67,7 +67,9 @@ export class OneClickClient {
67
67
  this.baseUrl = config.baseUrl ?? DEFAULTS.baseUrl
68
68
  this.jwtToken = config.jwtToken
69
69
  this.timeout = config.timeout ?? DEFAULTS.timeout
70
- this.fetchFn = config.fetch ?? globalThis.fetch
70
+ // Bind fetch to globalThis to preserve 'this' context in browsers
71
+ // Without this, fetch() throws "Illegal invocation" when assigned to a property
72
+ this.fetchFn = config.fetch ?? globalThis.fetch.bind(globalThis)
71
73
  }
72
74
 
73
75
  /**