@silentswap/sdk 0.0.8 → 0.0.10

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/client.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { ENVIRONMENT, MAINNET_GATEWAY_ADDRESS, MAINNET_GATEWAY_PUBLIC_KEY, MAINNET_SILENTSWAP_API } from './constants.js';
2
+ const FETCH_TIMEOUT = 10_000;
2
3
  const ENVIRONMENT_CONFIGS = {
3
4
  [ENVIRONMENT.MAINNET]: {
4
5
  gatewayAddress: MAINNET_GATEWAY_ADDRESS,
@@ -28,6 +29,7 @@ class SilentSwapClient {
28
29
  const { config } = this;
29
30
  // submit GET request
30
31
  const res = await fetch(`${(config.baseUrl ?? MAINNET_SILENTSWAP_API) + path}?${new URLSearchParams(params).toString()}`, {
32
+ signal: AbortSignal.timeout(FETCH_TIMEOUT),
31
33
  ...init || {},
32
34
  method: 'GET',
33
35
  headers: {
@@ -72,6 +74,7 @@ class SilentSwapClient {
72
74
  const { config } = this;
73
75
  // submit POST request
74
76
  const res = await fetch((config.baseUrl ?? MAINNET_SILENTSWAP_API) + path, {
77
+ signal: AbortSignal.timeout(FETCH_TIMEOUT),
75
78
  ...init || {},
76
79
  method: 'POST',
77
80
  headers: {
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export type { SilentSwapClientConfig, SilentSwapClient, } from './client.js';
2
2
  export type * from './types/api.js';
3
+ export type { Caip19 } from './types/core.js';
3
4
  export type { EvmSigner } from './types/sdk.js';
4
5
  export * from './order.js';
5
6
  export * from './caip19.js';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@silentswap/sdk",
3
3
  "type": "module",
4
- "version": "0.0.8",
4
+ "version": "0.0.10",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
7
7
  "files": [