@xswap-link/sdk 0.9.1 → 0.9.3
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 +12 -0
- package/dist/index.d.mts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.global.js +92 -683
- package/dist/index.js +7 -7
- package/dist/index.mjs +7 -7
- package/package.json +3 -1
- package/src/components/Swap/SwapView/SwapButton/index.tsx +13 -5
- package/src/components/TxConfigForm/index.tsx +8 -1
- package/src/components/TxWidgetWC/index.tsx +2 -0
- package/src/components/TxWidgetWCWrapped/index.tsx +3 -0
- package/src/config/wagmiConfig.ts +7 -5
- package/src/context/SwapProvider.tsx +18 -0
- package/src/models/payloads/ModalIntegrationPayload.ts +1 -0
- package/src/models/payloads/WidgetIntegrationPayload.ts +1 -0
- package/src/types/global.d.ts +1 -0
- package/src/utils/validation.ts +7 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @xswap-link/xswap-sdk
|
|
2
2
|
|
|
3
|
+
## 0.9.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 6529933: fix: change condition for srcToken in bridge validation
|
|
8
|
+
|
|
9
|
+
## 0.9.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- b098740: feat: add onWalletConnect callback"
|
|
14
|
+
|
|
3
15
|
## 0.9.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -193,6 +193,7 @@ type ModalIntegrationPayload = {
|
|
|
193
193
|
symbol: string;
|
|
194
194
|
} | undefined) => void;
|
|
195
195
|
onSrcChainChange?: (chain: string | undefined) => void;
|
|
196
|
+
onConnectWallet?: () => void;
|
|
196
197
|
bridge?: boolean;
|
|
197
198
|
};
|
|
198
199
|
|
|
@@ -223,6 +224,7 @@ type WidgetIntegrationPayload = {
|
|
|
223
224
|
symbol: string;
|
|
224
225
|
} | undefined) => void;
|
|
225
226
|
onSrcChainChange?: (chain: string | undefined) => void;
|
|
227
|
+
onConnectWallet?: () => void;
|
|
226
228
|
bridge?: boolean;
|
|
227
229
|
};
|
|
228
230
|
|
|
@@ -419,7 +421,7 @@ declare global {
|
|
|
419
421
|
}
|
|
420
422
|
}
|
|
421
423
|
}
|
|
422
|
-
declare const TxWidgetWCWrapped: ({ integratorId, dstChain, dstToken, srcChain, srcToken, customContractCalls, desc, dstDisplayToken, lightTheme, defaultWalletPicker, styles, onPendingTransactionsChange, dstTokenLocked, dstChainLocked, srcTokenLocked, srcChainLocked, onDstTokenChange, onDstChainChange, onSrcTokenChange, onSrcChainChange, bridge, }: WidgetIntegrationPayload) => react_jsx_runtime.JSX.Element;
|
|
424
|
+
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, }: WidgetIntegrationPayload) => react_jsx_runtime.JSX.Element;
|
|
423
425
|
|
|
424
426
|
interface EvmHandlers {
|
|
425
427
|
onSuccess?: (data: ContractReceipt) => void;
|
|
@@ -481,7 +483,7 @@ declare const TxWidgetWC: CustomElementConstructor;
|
|
|
481
483
|
|
|
482
484
|
declare const XPay: {
|
|
483
485
|
openTransactionModal: ({ integratorId, dstChain, dstToken, srcChain, srcToken, customContractCalls, desc, dstDisplayToken, lightTheme, defaultWalletPicker, styles, onPendingTransactionsChange, dstTokenLocked, dstChainLocked, srcTokenLocked, srcChainLocked, onDstTokenChange, onDstChainChange, onSrcTokenChange, onSrcChainChange, bridge, }: ModalIntegrationPayload) => Promise<void>;
|
|
484
|
-
TxWidget: ({ integratorId, dstChain, dstToken, srcChain, srcToken, customContractCalls, desc, dstDisplayToken, lightTheme, defaultWalletPicker, styles, onPendingTransactionsChange, dstTokenLocked, dstChainLocked, srcTokenLocked, srcChainLocked, onDstTokenChange, onDstChainChange, onSrcTokenChange, onSrcChainChange, bridge, }: WidgetIntegrationPayload) => react_jsx_runtime.JSX.Element;
|
|
486
|
+
TxWidget: ({ integratorId, dstChain, dstToken, srcChain, srcToken, customContractCalls, desc, dstDisplayToken, lightTheme, defaultWalletPicker, styles, onPendingTransactionsChange, dstTokenLocked, dstChainLocked, srcTokenLocked, srcChainLocked, onDstTokenChange, onDstChainChange, onSrcTokenChange, onSrcChainChange, onConnectWallet, bridge, }: WidgetIntegrationPayload) => react_jsx_runtime.JSX.Element;
|
|
485
487
|
TxWidgetWC: CustomElementConstructor;
|
|
486
488
|
};
|
|
487
489
|
|
package/dist/index.d.ts
CHANGED
|
@@ -193,6 +193,7 @@ type ModalIntegrationPayload = {
|
|
|
193
193
|
symbol: string;
|
|
194
194
|
} | undefined) => void;
|
|
195
195
|
onSrcChainChange?: (chain: string | undefined) => void;
|
|
196
|
+
onConnectWallet?: () => void;
|
|
196
197
|
bridge?: boolean;
|
|
197
198
|
};
|
|
198
199
|
|
|
@@ -223,6 +224,7 @@ type WidgetIntegrationPayload = {
|
|
|
223
224
|
symbol: string;
|
|
224
225
|
} | undefined) => void;
|
|
225
226
|
onSrcChainChange?: (chain: string | undefined) => void;
|
|
227
|
+
onConnectWallet?: () => void;
|
|
226
228
|
bridge?: boolean;
|
|
227
229
|
};
|
|
228
230
|
|
|
@@ -419,7 +421,7 @@ declare global {
|
|
|
419
421
|
}
|
|
420
422
|
}
|
|
421
423
|
}
|
|
422
|
-
declare const TxWidgetWCWrapped: ({ integratorId, dstChain, dstToken, srcChain, srcToken, customContractCalls, desc, dstDisplayToken, lightTheme, defaultWalletPicker, styles, onPendingTransactionsChange, dstTokenLocked, dstChainLocked, srcTokenLocked, srcChainLocked, onDstTokenChange, onDstChainChange, onSrcTokenChange, onSrcChainChange, bridge, }: WidgetIntegrationPayload) => react_jsx_runtime.JSX.Element;
|
|
424
|
+
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, }: WidgetIntegrationPayload) => react_jsx_runtime.JSX.Element;
|
|
423
425
|
|
|
424
426
|
interface EvmHandlers {
|
|
425
427
|
onSuccess?: (data: ContractReceipt) => void;
|
|
@@ -481,7 +483,7 @@ declare const TxWidgetWC: CustomElementConstructor;
|
|
|
481
483
|
|
|
482
484
|
declare const XPay: {
|
|
483
485
|
openTransactionModal: ({ integratorId, dstChain, dstToken, srcChain, srcToken, customContractCalls, desc, dstDisplayToken, lightTheme, defaultWalletPicker, styles, onPendingTransactionsChange, dstTokenLocked, dstChainLocked, srcTokenLocked, srcChainLocked, onDstTokenChange, onDstChainChange, onSrcTokenChange, onSrcChainChange, bridge, }: ModalIntegrationPayload) => Promise<void>;
|
|
484
|
-
TxWidget: ({ integratorId, dstChain, dstToken, srcChain, srcToken, customContractCalls, desc, dstDisplayToken, lightTheme, defaultWalletPicker, styles, onPendingTransactionsChange, dstTokenLocked, dstChainLocked, srcTokenLocked, srcChainLocked, onDstTokenChange, onDstChainChange, onSrcTokenChange, onSrcChainChange, bridge, }: WidgetIntegrationPayload) => react_jsx_runtime.JSX.Element;
|
|
486
|
+
TxWidget: ({ integratorId, dstChain, dstToken, srcChain, srcToken, customContractCalls, desc, dstDisplayToken, lightTheme, defaultWalletPicker, styles, onPendingTransactionsChange, dstTokenLocked, dstChainLocked, srcTokenLocked, srcChainLocked, onDstTokenChange, onDstChainChange, onSrcTokenChange, onSrcChainChange, onConnectWallet, bridge, }: WidgetIntegrationPayload) => react_jsx_runtime.JSX.Element;
|
|
485
487
|
TxWidgetWC: CustomElementConstructor;
|
|
486
488
|
};
|
|
487
489
|
|