@aurora-is-near/intents-swap-widget 2.6.3 → 2.6.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/types/config.d.ts
CHANGED
|
@@ -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
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a = () => typeof window > "u" ? !1 : new URLSearchParams(window.location.search).get("widget") === "debug";
|
|
2
2
|
export {
|
|
3
|
-
|
|
3
|
+
a as isDebug
|
|
4
4
|
};
|
|
5
5
|
//# sourceMappingURL=isDebug.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isDebug.js","sources":["../../../src/utils/checkers/isDebug.ts"],"sourcesContent":["export const isDebug = () => {\n const searchParams = new URLSearchParams(window.location.search);\n\n return searchParams.get('widget') === 'debug';\n};\n"],"names":["isDebug"],"mappings":"AAAO,MAAMA,IAAU,
|
|
1
|
+
{"version":3,"file":"isDebug.js","sources":["../../../src/utils/checkers/isDebug.ts"],"sourcesContent":["export const isDebug = (): boolean => {\n if (typeof window === 'undefined') {\n return false;\n }\n\n const searchParams = new URLSearchParams(window.location.search);\n\n return searchParams.get('widget') === 'debug';\n};\n"],"names":["isDebug"],"mappings":"AAAO,MAAMA,IAAU,MACjB,OAAO,SAAW,MACb,KAGY,IAAI,gBAAgB,OAAO,SAAS,MAAM,EAE3C,IAAI,QAAQ,MAAM;"}
|
package/package.json
CHANGED
package/src/types/config.ts
CHANGED
|
@@ -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
|
};
|