@xswap-link/sdk 0.9.0 → 0.9.2
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 +8 -4
- package/dist/index.d.ts +8 -4
- package/dist/index.global.js +92 -683
- package/dist/index.js +7 -7
- package/dist/index.mjs +9 -9
- package/package.json +3 -1
- package/src/components/Swap/SwapView/SwapButton/index.tsx +13 -5
- package/src/components/Swap/SwapView/SwapPanel/ChainPanel/ChainPicker/ChainItem/index.tsx +51 -59
- package/src/components/Swap/SwapView/SwapPanel/TokenPanel/TokenPicker/TokenItem/index.tsx +36 -11
- package/src/components/Swap/SwapView/SwapPanel/TokenPanel/TokenPicker/index.tsx +26 -6
- package/src/components/Swap/SwapView/SwapPanel/TokenPanel/index.tsx +5 -1
- package/src/components/Swap/SwapView/SwapPanel/index.tsx +1 -1
- package/src/components/Swap/SwapView/index.tsx +2 -2
- package/src/components/Tooltip/index.tsx +1 -1
- 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 +45 -38
- package/src/models/TokenData.ts +3 -1
- package/src/models/payloads/GetPricesPayload.ts +1 -1
- 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/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -106,7 +106,7 @@ type GetLeaderboardChangePayload = {
|
|
|
106
106
|
};
|
|
107
107
|
|
|
108
108
|
type GetPricesPayload = {
|
|
109
|
-
chainId: string;
|
|
109
|
+
chainId: string[];
|
|
110
110
|
currency?: string;
|
|
111
111
|
};
|
|
112
112
|
|
|
@@ -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
|
|
|
@@ -311,7 +313,9 @@ type Prices = {
|
|
|
311
313
|
prices: TokenPrices;
|
|
312
314
|
};
|
|
313
315
|
type TokenPrices = {
|
|
314
|
-
[
|
|
316
|
+
[chainId: string]: {
|
|
317
|
+
[tokenAddress: string]: string;
|
|
318
|
+
};
|
|
315
319
|
};
|
|
316
320
|
type TokenBalances = {
|
|
317
321
|
[tokenAddress: string]: BigNumber | undefined;
|
|
@@ -417,7 +421,7 @@ declare global {
|
|
|
417
421
|
}
|
|
418
422
|
}
|
|
419
423
|
}
|
|
420
|
-
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;
|
|
421
425
|
|
|
422
426
|
interface EvmHandlers {
|
|
423
427
|
onSuccess?: (data: ContractReceipt) => void;
|
|
@@ -479,7 +483,7 @@ declare const TxWidgetWC: CustomElementConstructor;
|
|
|
479
483
|
|
|
480
484
|
declare const XPay: {
|
|
481
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>;
|
|
482
|
-
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;
|
|
483
487
|
TxWidgetWC: CustomElementConstructor;
|
|
484
488
|
};
|
|
485
489
|
|
package/dist/index.d.ts
CHANGED
|
@@ -106,7 +106,7 @@ type GetLeaderboardChangePayload = {
|
|
|
106
106
|
};
|
|
107
107
|
|
|
108
108
|
type GetPricesPayload = {
|
|
109
|
-
chainId: string;
|
|
109
|
+
chainId: string[];
|
|
110
110
|
currency?: string;
|
|
111
111
|
};
|
|
112
112
|
|
|
@@ -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
|
|
|
@@ -311,7 +313,9 @@ type Prices = {
|
|
|
311
313
|
prices: TokenPrices;
|
|
312
314
|
};
|
|
313
315
|
type TokenPrices = {
|
|
314
|
-
[
|
|
316
|
+
[chainId: string]: {
|
|
317
|
+
[tokenAddress: string]: string;
|
|
318
|
+
};
|
|
315
319
|
};
|
|
316
320
|
type TokenBalances = {
|
|
317
321
|
[tokenAddress: string]: BigNumber | undefined;
|
|
@@ -417,7 +421,7 @@ declare global {
|
|
|
417
421
|
}
|
|
418
422
|
}
|
|
419
423
|
}
|
|
420
|
-
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;
|
|
421
425
|
|
|
422
426
|
interface EvmHandlers {
|
|
423
427
|
onSuccess?: (data: ContractReceipt) => void;
|
|
@@ -479,7 +483,7 @@ declare const TxWidgetWC: CustomElementConstructor;
|
|
|
479
483
|
|
|
480
484
|
declare const XPay: {
|
|
481
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>;
|
|
482
|
-
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;
|
|
483
487
|
TxWidgetWC: CustomElementConstructor;
|
|
484
488
|
};
|
|
485
489
|
|