@sip-protocol/sdk 0.1.1 → 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.
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
@@ -2104,6 +2104,8 @@ var NEARIntentsAdapter = class {
2104
2104
  );
2105
2105
  const deadline = new Date(Date.now() + this.defaultDeadlineOffset * 1e3).toISOString();
2106
2106
  return {
2107
+ dry: false,
2108
+ // Explicitly set to false for real quotes (1Click API requires boolean)
2107
2109
  swapType: import_types3.OneClickSwapType.EXACT_INPUT,
2108
2110
  originAsset,
2109
2111
  destinationAsset,
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
@@ -1914,6 +1914,8 @@ var NEARIntentsAdapter = class {
1914
1914
  );
1915
1915
  const deadline = new Date(Date.now() + this.defaultDeadlineOffset * 1e3).toISOString();
1916
1916
  return {
1917
+ dry: false,
1918
+ // Explicitly set to false for real quotes (1Click API requires boolean)
1917
1919
  swapType: OneClickSwapType.EXACT_INPUT,
1918
1920
  originAsset,
1919
1921
  destinationAsset,
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.5",
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",
@@ -26,6 +26,17 @@
26
26
  "dist",
27
27
  "src"
28
28
  ],
29
+ "scripts": {
30
+ "build": "tsup src/index.ts --format cjs,esm --dts",
31
+ "dev": "tsup src/index.ts --format cjs,esm --dts --watch",
32
+ "lint": "eslint --ext .ts src/",
33
+ "typecheck": "tsc --noEmit",
34
+ "clean": "rm -rf dist",
35
+ "test": "vitest",
36
+ "test:coverage": "vitest run --coverage",
37
+ "bench": "vitest bench --config vitest.bench.config.ts",
38
+ "bench:json": "vitest bench --config vitest.bench.config.ts --outputJson benchmarks/results.json"
39
+ },
29
40
  "dependencies": {
30
41
  "@aztec/bb.js": "^0.63.1",
31
42
  "@noble/ciphers": "^2.0.1",
@@ -33,7 +44,7 @@
33
44
  "@noble/hashes": "^1.3.3",
34
45
  "@noir-lang/noir_js": "^1.0.0-beta.15",
35
46
  "@noir-lang/types": "1.0.0-beta.15",
36
- "@sip-protocol/types": "0.1.1"
47
+ "@sip-protocol/types": "workspace:*"
37
48
  },
38
49
  "devDependencies": {
39
50
  "@vitest/coverage-v8": "1.6.1",
@@ -49,16 +60,5 @@
49
60
  "stealth-addresses",
50
61
  "zcash"
51
62
  ],
52
- "license": "MIT",
53
- "scripts": {
54
- "build": "tsup src/index.ts --format cjs,esm --dts",
55
- "dev": "tsup src/index.ts --format cjs,esm --dts --watch",
56
- "lint": "eslint src/",
57
- "typecheck": "tsc --noEmit",
58
- "clean": "rm -rf dist",
59
- "test": "vitest",
60
- "test:coverage": "vitest run --coverage",
61
- "bench": "vitest bench --config vitest.bench.config.ts",
62
- "bench:json": "vitest bench --config vitest.bench.config.ts --outputJson benchmarks/results.json"
63
- }
64
- }
63
+ "license": "MIT"
64
+ }
@@ -456,6 +456,7 @@ export class NEARIntentsAdapter {
456
456
  // Use ORIGIN_CHAIN for deposits from external chains
457
457
  // Use DESTINATION_CHAIN for sending to external chains
458
458
  return {
459
+ dry: false, // Explicitly set to false for real quotes (1Click API requires boolean)
459
460
  swapType: OneClickSwapType.EXACT_INPUT,
460
461
  originAsset,
461
462
  destinationAsset,
@@ -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
  /**
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 RECTOR Labs
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.