@xswap-link/sdk 0.13.1 → 0.14.0
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/CHANGELOG.md +7 -0
- package/dist/index.d.mts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.global.js +85 -84
- package/dist/index.js +1553 -1458
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1542 -1444
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/assets/icons/AdjustmentsIcon.tsx +18 -0
- package/src/assets/icons/CaretDownIcon.tsx +12 -0
- package/src/assets/icons/CaretsUpDownIcon.tsx +13 -0
- package/src/assets/icons/ChainlinkMarkIcon.tsx +17 -0
- package/src/assets/icons/ClockIcon.tsx +18 -0
- package/src/assets/icons/WarningIcon.tsx +16 -0
- package/src/assets/icons/index.ts +6 -0
- package/src/components/Modal/index.tsx +2 -2
- package/src/components/PoweredBy/index.tsx +14 -5
- package/src/components/Swap/Header/Controls/index.tsx +50 -36
- package/src/components/Swap/Header/index.tsx +12 -5
- package/src/components/Swap/HistoryView/ActivityCard/index.tsx +212 -0
- package/src/components/Swap/HistoryView/index.tsx +24 -6
- package/src/components/Swap/ReorderButton/ReorderButton.tsx +5 -7
- package/src/components/Swap/SettingsView/Delivery/index.tsx +27 -28
- package/src/components/Swap/SettingsView/InfiniteApproval/index.tsx +27 -24
- package/src/components/Swap/SettingsView/Slippage/index.tsx +44 -43
- package/src/components/Swap/SettingsView/index.tsx +1 -1
- package/src/components/Swap/SwapView/FeesPanel/DeliveryInfo/index.tsx +9 -19
- package/src/components/Swap/SwapView/FeesPanel/Fee/index.tsx +4 -4
- package/src/components/Swap/SwapView/FeesPanel/Fees/index.tsx +5 -9
- package/src/components/Swap/SwapView/FeesPanel/index.tsx +21 -22
- package/src/components/Swap/SwapView/SwapButton/index.tsx +25 -6
- package/src/components/Swap/SwapView/SwapPanel/AmountPanel/Balance/index.tsx +56 -12
- package/src/components/Swap/SwapView/SwapPanel/AmountPanel/index.tsx +42 -41
- package/src/components/Swap/SwapView/SwapPanel/TokenPanel/TokenPicker/NetworkFilter/index.tsx +157 -0
- package/src/components/Swap/SwapView/SwapPanel/TokenPanel/TokenPicker/TokenItem/index.tsx +98 -55
- package/src/components/Swap/SwapView/SwapPanel/TokenPanel/TokenPicker/index.tsx +160 -239
- package/src/components/Swap/SwapView/SwapPanel/TokenPanel/index.tsx +57 -31
- package/src/components/Swap/SwapView/SwapPanel/UsdValue/index.tsx +27 -0
- package/src/components/Swap/SwapView/SwapPanel/WalletPanel/index.tsx +60 -49
- package/src/components/Swap/SwapView/SwapPanel/index.tsx +20 -25
- package/src/components/Swap/SwapView/WalletPicker/index.tsx +6 -1
- package/src/components/Swap/SwapView/index.tsx +2 -1
- package/src/components/Swap/index.tsx +4 -2
- package/src/components/ToggleButton/index.tsx +18 -15
- package/src/components/TxConfigForm/index.tsx +5 -5
- package/src/components/TxWidgetWC/index.tsx +4 -0
- package/src/components/TxWidgetWCWrapped/index.tsx +2 -0
- package/src/context/HistoryProvider.tsx +1 -0
- package/src/models/TransactionHistory.ts +1 -0
- package/src/models/payloads/ModalIntegrationPayload.ts +1 -0
- package/src/models/payloads/WidgetIntegrationPayload.ts +1 -0
- package/src/utils/index.ts +21 -0
- package/tailwind.config.js +2 -2
- package/src/components/Swap/SwapView/SwapPanel/ChainPanel/ChainPicker/ChainItem/index.tsx +0 -97
- package/src/components/Swap/SwapView/SwapPanel/ChainPanel/ChainPicker/index.tsx +0 -103
- package/src/components/Swap/SwapView/SwapPanel/ChainPanel/index.tsx +0 -65
- package/src/components/Swap/SwapView/SwapPanel/MaxPanel/index.tsx +0 -43
- package/src/components/Swap/SwapView/SwapPanel/TokenPanel/TokenPicker/QuickPickTokenItem/index.tsx +0 -37
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @xswap-link/xswap-sdk
|
|
2
2
|
|
|
3
|
+
## 0.14.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- fd459b4: Swap widget v2 redesign: new card layout with wallet chips on Source/Destination panels, MAX pill, merged token+network picker with embedded network filter and cross-side reset warnings, Preferences view (Fast Delivery / Persistent Access / Price Tolerance) with accent-blue toggles, My Activity view with new transaction cards, collapsible fee breakdown, accent-gradient CTA, Connect SUI Wallet button state, and a new optional `widgetTitle` prop.
|
|
8
|
+
- 69dd316: new token picker view
|
|
9
|
+
|
|
3
10
|
## 0.13.1
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -179,6 +179,7 @@ type ModalIntegrationPayload = {
|
|
|
179
179
|
srcToken?: string;
|
|
180
180
|
customContractCalls?: ContractCall[];
|
|
181
181
|
desc?: string;
|
|
182
|
+
widgetTitle?: string;
|
|
182
183
|
dstDisplayToken?: string;
|
|
183
184
|
lightTheme?: boolean;
|
|
184
185
|
defaultWalletPicker?: boolean;
|
|
@@ -217,6 +218,7 @@ type WidgetIntegrationPayload = {
|
|
|
217
218
|
srcToken?: string;
|
|
218
219
|
customContractCalls?: ContractCall[];
|
|
219
220
|
desc?: string;
|
|
221
|
+
widgetTitle?: string;
|
|
220
222
|
dstDisplayToken?: string;
|
|
221
223
|
lightTheme?: boolean;
|
|
222
224
|
defaultWalletPicker?: boolean;
|
|
@@ -391,6 +393,7 @@ type HistoryTransaction = {
|
|
|
391
393
|
type TransactionStatus = "IN_PROGRESS" | "DONE" | "REVERTED" | "NOT_FOUND";
|
|
392
394
|
type Transaction = {
|
|
393
395
|
messageId?: string;
|
|
396
|
+
receiver?: string;
|
|
394
397
|
hash: string;
|
|
395
398
|
timestamp: number;
|
|
396
399
|
sourceChainId: string;
|
|
@@ -423,6 +426,7 @@ type TxWidgetWCAttributes = {
|
|
|
423
426
|
"src-token": WidgetIntegrationPayload["srcToken"];
|
|
424
427
|
"custom-contract-calls": string | undefined;
|
|
425
428
|
desc: WidgetIntegrationPayload["desc"];
|
|
429
|
+
"widget-title": WidgetIntegrationPayload["widgetTitle"];
|
|
426
430
|
"dst-display-token": WidgetIntegrationPayload["dstDisplayToken"];
|
|
427
431
|
"light-theme": WidgetIntegrationPayload["lightTheme"];
|
|
428
432
|
"default-wallet-picker": WidgetIntegrationPayload["defaultWalletPicker"];
|
|
@@ -450,7 +454,7 @@ declare global {
|
|
|
450
454
|
}
|
|
451
455
|
}
|
|
452
456
|
}
|
|
453
|
-
declare const TxWidgetWCWrapped: ({ integratorId, dstChain, dstToken, srcChain, srcToken, customContractCalls, desc, dstDisplayToken, lightTheme, defaultWalletPicker, styles, onPendingTransactionsChange, dstTokenLocked, dstChainLocked, srcTokenLocked, srcChainLocked, onDstTokenChange, onDstChainChange, onSrcTokenChange, onSrcChainChange, onConnectWallet, bridge, override, integratorFee, integratorFeeReceiverAddress, highlightedDstTokens, wagmiConfig, }: WidgetIntegrationPayload) => react_jsx_runtime.JSX.Element;
|
|
457
|
+
declare const TxWidgetWCWrapped: ({ integratorId, dstChain, dstToken, srcChain, srcToken, customContractCalls, desc, widgetTitle, dstDisplayToken, lightTheme, defaultWalletPicker, styles, onPendingTransactionsChange, dstTokenLocked, dstChainLocked, srcTokenLocked, srcChainLocked, onDstTokenChange, onDstChainChange, onSrcTokenChange, onSrcChainChange, onConnectWallet, bridge, override, integratorFee, integratorFeeReceiverAddress, highlightedDstTokens, wagmiConfig, }: WidgetIntegrationPayload) => react_jsx_runtime.JSX.Element;
|
|
454
458
|
|
|
455
459
|
interface EvmHandlers {
|
|
456
460
|
onSuccess?: (data: ContractReceipt) => void;
|
|
@@ -512,7 +516,7 @@ declare const TxWidgetWC: CustomElementConstructor;
|
|
|
512
516
|
|
|
513
517
|
declare const XPay: {
|
|
514
518
|
openTransactionModal: ({ integratorId, dstChain, dstToken, srcChain, srcToken, customContractCalls, desc, dstDisplayToken, lightTheme, defaultWalletPicker, styles, onPendingTransactionsChange, dstTokenLocked, dstChainLocked, srcTokenLocked, srcChainLocked, onDstTokenChange, onDstChainChange, onSrcTokenChange, onSrcChainChange, bridge, highlightedDstTokens, wagmiConfig, }: ModalIntegrationPayload) => Promise<void>;
|
|
515
|
-
TxWidget: ({ integratorId, dstChain, dstToken, srcChain, srcToken, customContractCalls, desc, dstDisplayToken, lightTheme, defaultWalletPicker, styles, onPendingTransactionsChange, dstTokenLocked, dstChainLocked, srcTokenLocked, srcChainLocked, onDstTokenChange, onDstChainChange, onSrcTokenChange, onSrcChainChange, onConnectWallet, bridge, override, integratorFee, integratorFeeReceiverAddress, highlightedDstTokens, wagmiConfig, }: WidgetIntegrationPayload) => react_jsx_runtime.JSX.Element;
|
|
519
|
+
TxWidget: ({ integratorId, dstChain, dstToken, srcChain, srcToken, customContractCalls, desc, widgetTitle, dstDisplayToken, lightTheme, defaultWalletPicker, styles, onPendingTransactionsChange, dstTokenLocked, dstChainLocked, srcTokenLocked, srcChainLocked, onDstTokenChange, onDstChainChange, onSrcTokenChange, onSrcChainChange, onConnectWallet, bridge, override, integratorFee, integratorFeeReceiverAddress, highlightedDstTokens, wagmiConfig, }: WidgetIntegrationPayload) => react_jsx_runtime.JSX.Element;
|
|
516
520
|
TxWidgetWC: CustomElementConstructor;
|
|
517
521
|
};
|
|
518
522
|
|
package/dist/index.d.ts
CHANGED
|
@@ -179,6 +179,7 @@ type ModalIntegrationPayload = {
|
|
|
179
179
|
srcToken?: string;
|
|
180
180
|
customContractCalls?: ContractCall[];
|
|
181
181
|
desc?: string;
|
|
182
|
+
widgetTitle?: string;
|
|
182
183
|
dstDisplayToken?: string;
|
|
183
184
|
lightTheme?: boolean;
|
|
184
185
|
defaultWalletPicker?: boolean;
|
|
@@ -217,6 +218,7 @@ type WidgetIntegrationPayload = {
|
|
|
217
218
|
srcToken?: string;
|
|
218
219
|
customContractCalls?: ContractCall[];
|
|
219
220
|
desc?: string;
|
|
221
|
+
widgetTitle?: string;
|
|
220
222
|
dstDisplayToken?: string;
|
|
221
223
|
lightTheme?: boolean;
|
|
222
224
|
defaultWalletPicker?: boolean;
|
|
@@ -391,6 +393,7 @@ type HistoryTransaction = {
|
|
|
391
393
|
type TransactionStatus = "IN_PROGRESS" | "DONE" | "REVERTED" | "NOT_FOUND";
|
|
392
394
|
type Transaction = {
|
|
393
395
|
messageId?: string;
|
|
396
|
+
receiver?: string;
|
|
394
397
|
hash: string;
|
|
395
398
|
timestamp: number;
|
|
396
399
|
sourceChainId: string;
|
|
@@ -423,6 +426,7 @@ type TxWidgetWCAttributes = {
|
|
|
423
426
|
"src-token": WidgetIntegrationPayload["srcToken"];
|
|
424
427
|
"custom-contract-calls": string | undefined;
|
|
425
428
|
desc: WidgetIntegrationPayload["desc"];
|
|
429
|
+
"widget-title": WidgetIntegrationPayload["widgetTitle"];
|
|
426
430
|
"dst-display-token": WidgetIntegrationPayload["dstDisplayToken"];
|
|
427
431
|
"light-theme": WidgetIntegrationPayload["lightTheme"];
|
|
428
432
|
"default-wallet-picker": WidgetIntegrationPayload["defaultWalletPicker"];
|
|
@@ -450,7 +454,7 @@ declare global {
|
|
|
450
454
|
}
|
|
451
455
|
}
|
|
452
456
|
}
|
|
453
|
-
declare const TxWidgetWCWrapped: ({ integratorId, dstChain, dstToken, srcChain, srcToken, customContractCalls, desc, dstDisplayToken, lightTheme, defaultWalletPicker, styles, onPendingTransactionsChange, dstTokenLocked, dstChainLocked, srcTokenLocked, srcChainLocked, onDstTokenChange, onDstChainChange, onSrcTokenChange, onSrcChainChange, onConnectWallet, bridge, override, integratorFee, integratorFeeReceiverAddress, highlightedDstTokens, wagmiConfig, }: WidgetIntegrationPayload) => react_jsx_runtime.JSX.Element;
|
|
457
|
+
declare const TxWidgetWCWrapped: ({ integratorId, dstChain, dstToken, srcChain, srcToken, customContractCalls, desc, widgetTitle, dstDisplayToken, lightTheme, defaultWalletPicker, styles, onPendingTransactionsChange, dstTokenLocked, dstChainLocked, srcTokenLocked, srcChainLocked, onDstTokenChange, onDstChainChange, onSrcTokenChange, onSrcChainChange, onConnectWallet, bridge, override, integratorFee, integratorFeeReceiverAddress, highlightedDstTokens, wagmiConfig, }: WidgetIntegrationPayload) => react_jsx_runtime.JSX.Element;
|
|
454
458
|
|
|
455
459
|
interface EvmHandlers {
|
|
456
460
|
onSuccess?: (data: ContractReceipt) => void;
|
|
@@ -512,7 +516,7 @@ declare const TxWidgetWC: CustomElementConstructor;
|
|
|
512
516
|
|
|
513
517
|
declare const XPay: {
|
|
514
518
|
openTransactionModal: ({ integratorId, dstChain, dstToken, srcChain, srcToken, customContractCalls, desc, dstDisplayToken, lightTheme, defaultWalletPicker, styles, onPendingTransactionsChange, dstTokenLocked, dstChainLocked, srcTokenLocked, srcChainLocked, onDstTokenChange, onDstChainChange, onSrcTokenChange, onSrcChainChange, bridge, highlightedDstTokens, wagmiConfig, }: ModalIntegrationPayload) => Promise<void>;
|
|
515
|
-
TxWidget: ({ integratorId, dstChain, dstToken, srcChain, srcToken, customContractCalls, desc, dstDisplayToken, lightTheme, defaultWalletPicker, styles, onPendingTransactionsChange, dstTokenLocked, dstChainLocked, srcTokenLocked, srcChainLocked, onDstTokenChange, onDstChainChange, onSrcTokenChange, onSrcChainChange, onConnectWallet, bridge, override, integratorFee, integratorFeeReceiverAddress, highlightedDstTokens, wagmiConfig, }: WidgetIntegrationPayload) => react_jsx_runtime.JSX.Element;
|
|
519
|
+
TxWidget: ({ integratorId, dstChain, dstToken, srcChain, srcToken, customContractCalls, desc, widgetTitle, dstDisplayToken, lightTheme, defaultWalletPicker, styles, onPendingTransactionsChange, dstTokenLocked, dstChainLocked, srcTokenLocked, srcChainLocked, onDstTokenChange, onDstChainChange, onSrcTokenChange, onSrcChainChange, onConnectWallet, bridge, override, integratorFee, integratorFeeReceiverAddress, highlightedDstTokens, wagmiConfig, }: WidgetIntegrationPayload) => react_jsx_runtime.JSX.Element;
|
|
516
520
|
TxWidgetWC: CustomElementConstructor;
|
|
517
521
|
};
|
|
518
522
|
|