@aurora-is-near/intents-swap-widget 2.6.2 → 2.6.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.
@@ -1,89 +1,25 @@
1
1
  import { Chains, DefaultChainsFilter } from './chain';
2
2
  import { Token } from './token';
3
- /**
4
- * Configuration object for the Swap Widget.
5
- */
6
3
  export type WidgetConfig = {
7
- /**
8
- * Display name of the embedding application.
9
- * @example 'Calyx'
10
- */
11
4
  appName: string;
12
- /**
13
- * URL to the application icon.
14
- */
15
5
  appIcon: string;
16
- /**
17
- * Wallet type used for user intent signing.
18
- *
19
- * 'evm' = MetaMask / Rainbow / WalletConnect
20
- * 'near' = NEAR Wallet / MyNearWallet
21
- * 'sol' = Phantom / Solflare
22
- */
23
6
  intentsAccountType: 'evm' | 'near' | 'sol';
24
- /**
25
- * The chains supported by the connected wallet.
26
- */
27
7
  walletSupportedChains: ReadonlyArray<Chains>;
28
- /**
29
- * Currently connected wallet address (optional).
30
- * Used to pre-fill balances or display connected state.
31
- */
32
8
  walletAddress?: string | null;
33
- /**
34
- * Default maximum slippage tolerance (e.g. 0.01 = 1%).
35
- */
36
9
  defaultMaxSlippage: number;
37
- /**
38
- * If true, automatically switches target tokens to match available liquidity.
39
- */
40
10
  enableAutoTokensSwitching?: boolean;
41
- /**
42
- * Whether to show "intent tokens" (internal, platform-specific assets).
43
- */
44
11
  showIntentTokens: boolean;
45
- /**
46
- * Explicit list of allowed token asset IDs.
47
- * If set, the widget will only display tokens from this list.
48
- */
49
12
  allowedTokensList?: string[];
50
- /** Allowed source token asset IDs. */
51
13
  allowedSourceTokensList?: string[];
52
- /** Allowed target token asset IDs. */
53
14
  allowedTargetTokensList?: string[];
54
- /**
55
- * Predicate to filter tokens dynamically.
56
- * Called for every token before display.
57
- */
58
15
  filterTokens: (token: Token) => boolean;
59
- /**
60
- * Order in which chains appear in dropdowns and selectors.
61
- */
62
16
  chainsOrder: Chains[];
63
- /** List of allowed chains (global). */
64
17
  allowedChainsList?: Chains[];
65
- /** Allowed source chains. */
66
18
  allowedSourceChainsList?: Chains[];
67
- /** Allowed target chains. */
68
19
  allowedTargetChainsList?: Chains[];
69
- /**
70
- * Defines chain filtering logic for source and target chains.
71
- *
72
- * - `external`: filter applied to wallet or external assets
73
- * - `intents`: filter applied to intent-based chains
74
- */
75
20
  chainsFilter: {
76
21
  source: DefaultChainsFilter;
77
22
  target: DefaultChainsFilter;
78
23
  };
79
- /**
80
- * URL of any 1Click quote proxy endpoint.
81
- *
82
- * By default we will use the public 1Click quote URL. For the case where you
83
- * want to apply your own quote logic you can provide your own proxy URL here.
84
- *
85
- * @example
86
- * https://my.1click-proxy.com/quote
87
- */
88
24
  oneClickApiQuoteProxyUrl: string;
89
25
  };
@@ -2,5 +2,6 @@ export * from './chain';
2
2
  export * from './token';
3
3
  export * from './quote';
4
4
  export * from './transfer';
5
+ export * from './config';
5
6
  export type { QuoteTransferArgs } from '../hooks/useMakeQuoteTransfer';
6
7
  export type { IntentsTransferArgs } from '../hooks/useMakeIntentsTransfer';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aurora-is-near/intents-swap-widget",
3
- "version": "2.6.2",
3
+ "version": "2.6.4",
4
4
  "description": "Provides components and hooks to build your own Intents swap widget",
5
5
  "author": "Maksim Vashchuk",
6
6
  "license": "MIT",
@@ -1,131 +1,37 @@
1
1
  import { Chains, DefaultChainsFilter } from './chain';
2
2
  import { Token } from './token';
3
3
 
4
- /**
5
- * Configuration object for the Swap Widget.
6
- */
7
4
  export type WidgetConfig = {
8
- // ────────────────────────────────
9
5
  // Application metadata
10
- // ────────────────────────────────
11
-
12
- /**
13
- * Display name of the embedding application.
14
- * @example 'Calyx'
15
- */
16
6
  appName: string;
17
-
18
- /**
19
- * URL to the application icon.
20
- */
21
7
  appIcon: string;
22
8
 
23
- // ────────────────────────────────
24
9
  // Connected wallet
25
- // ────────────────────────────────
26
-
27
- /**
28
- * Wallet type used for user intent signing.
29
- *
30
- * 'evm' = MetaMask / Rainbow / WalletConnect
31
- * 'near' = NEAR Wallet / MyNearWallet
32
- * 'sol' = Phantom / Solflare
33
- */
34
10
  intentsAccountType: 'evm' | 'near' | 'sol';
35
-
36
- /**
37
- * The chains supported by the connected wallet.
38
- */
39
11
  walletSupportedChains: ReadonlyArray<Chains>;
40
-
41
- /**
42
- * Currently connected wallet address (optional).
43
- * Used to pre-fill balances or display connected state.
44
- */
45
12
  walletAddress?: string | null;
46
13
 
47
- // ────────────────────────────────
48
14
  // Quotes & Transfers
49
- // ────────────────────────────────
50
-
51
- /**
52
- * Default maximum slippage tolerance (e.g. 0.01 = 1%).
53
- */
54
15
  defaultMaxSlippage: number;
55
-
56
- /**
57
- * If true, automatically switches target tokens to match available liquidity.
58
- */
59
16
  enableAutoTokensSwitching?: boolean;
60
17
 
61
- // ────────────────────────────────
62
- // 🪙 Tokens filtering
63
- // ────────────────────────────────
64
-
65
- /**
66
- * Whether to show "intent tokens" (internal, platform-specific assets).
67
- */
18
+ // Tokens filtering
68
19
  showIntentTokens: boolean;
69
-
70
- /**
71
- * Explicit list of allowed token asset IDs.
72
- * If set, the widget will only display tokens from this list.
73
- */
74
- allowedTokensList?: string[];
75
-
76
- /** Allowed source token asset IDs. */
20
+ allowedTokensList?: string[]; // assetIDs
77
21
  allowedSourceTokensList?: string[];
78
-
79
- /** Allowed target token asset IDs. */
80
22
  allowedTargetTokensList?: string[];
81
-
82
- /**
83
- * Predicate to filter tokens dynamically.
84
- * Called for every token before display.
85
- */
86
23
  filterTokens: (token: Token) => boolean;
87
24
 
88
- // ────────────────────────────────
89
25
  // Chains filtering
90
- // ────────────────────────────────
91
-
92
- /**
93
- * Order in which chains appear in dropdowns and selectors.
94
- */
95
26
  chainsOrder: Chains[];
96
-
97
- /** List of allowed chains (global). */
98
27
  allowedChainsList?: Chains[];
99
-
100
- /** Allowed source chains. */
101
28
  allowedSourceChainsList?: Chains[];
102
-
103
- /** Allowed target chains. */
104
29
  allowedTargetChainsList?: Chains[];
105
-
106
- /**
107
- * Defines chain filtering logic for source and target chains.
108
- *
109
- * - `external`: filter applied to wallet or external assets
110
- * - `intents`: filter applied to intent-based chains
111
- */
112
30
  chainsFilter: {
113
31
  source: DefaultChainsFilter;
114
32
  target: DefaultChainsFilter;
115
33
  };
116
34
 
117
- // ────────────────────────────────
118
- // 🌐 1Click API
119
- // ────────────────────────────────
120
-
121
- /**
122
- * URL of any 1Click quote proxy endpoint.
123
- *
124
- * By default we will use the public 1Click quote URL. For the case where you
125
- * want to apply your own quote logic you can provide your own proxy URL here.
126
- *
127
- * @example
128
- * https://my.1click-proxy.com/quote
129
- */
35
+ // 1Click API
130
36
  oneClickApiQuoteProxyUrl: string;
131
37
  };
@@ -2,6 +2,7 @@ export * from './chain';
2
2
  export * from './token';
3
3
  export * from './quote';
4
4
  export * from './transfer';
5
+ export * from './config';
5
6
 
6
7
  export type { QuoteTransferArgs } from '../hooks/useMakeQuoteTransfer';
7
8
  export type { IntentsTransferArgs } from '../hooks/useMakeIntentsTransfer';