@xswap-link/sdk 0.12.0 → 0.12.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 +7 -4
- package/dist/index.d.ts +7 -4
- package/dist/index.global.js +739 -404
- package/dist/index.js +35 -20
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +36 -21
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/Swap/SwapView/SwapPanel/AmountPanel/index.tsx +1 -1
- package/src/components/TxConfigForm/index.tsx +8 -2
- package/src/components/TxWidgetWCWrapped/index.tsx +6 -0
- package/src/config/wagmiConfig.ts +2 -1
- package/src/context/SwapProvider.tsx +16 -14
- package/src/models/payloads/ModalIntegrationPayload.ts +2 -0
- package/src/models/payloads/WidgetIntegrationPayload.ts +2 -0
- package/src/services/integrations/transactions.ts +2 -0
- package/src/types/global.d.ts +2 -0
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { Config } from '@wagmi/core';
|
|
2
3
|
import { BigNumber, ContractReceipt, ContractTransaction } from 'ethers';
|
|
3
4
|
import { TransactionResponse } from '@ethersproject/providers';
|
|
4
5
|
import { VersionedTransaction } from '@solana/web3.js';
|
|
@@ -206,6 +207,7 @@ type ModalIntegrationPayload = {
|
|
|
206
207
|
integratorFee?: number;
|
|
207
208
|
integratorFeeReceiverAddress?: string;
|
|
208
209
|
highlightedDstTokens?: string[];
|
|
210
|
+
wagmiConfig?: Config;
|
|
209
211
|
};
|
|
210
212
|
|
|
211
213
|
type WidgetIntegrationPayload = {
|
|
@@ -243,6 +245,7 @@ type WidgetIntegrationPayload = {
|
|
|
243
245
|
integratorFee?: number;
|
|
244
246
|
integratorFeeReceiverAddress?: string;
|
|
245
247
|
highlightedDstTokens?: string[];
|
|
248
|
+
wagmiConfig?: Config;
|
|
246
249
|
};
|
|
247
250
|
|
|
248
251
|
type Protocol = {
|
|
@@ -448,7 +451,7 @@ declare global {
|
|
|
448
451
|
}
|
|
449
452
|
}
|
|
450
453
|
}
|
|
451
|
-
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, }: WidgetIntegrationPayload) => react_jsx_runtime.JSX.Element;
|
|
454
|
+
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;
|
|
452
455
|
|
|
453
456
|
interface EvmHandlers {
|
|
454
457
|
onSuccess?: (data: ContractReceipt) => void;
|
|
@@ -504,13 +507,13 @@ type TxStats = {
|
|
|
504
507
|
cashback?: string;
|
|
505
508
|
};
|
|
506
509
|
|
|
507
|
-
declare const openTransactionModal: ({ integratorId, dstChain, dstToken, srcChain, srcToken, customContractCalls, desc, dstDisplayToken, lightTheme, defaultWalletPicker, styles, onPendingTransactionsChange, dstTokenLocked, dstChainLocked, srcTokenLocked, srcChainLocked, onDstTokenChange, onDstChainChange, onSrcTokenChange, onSrcChainChange, bridge, highlightedDstTokens, }: ModalIntegrationPayload) => Promise<void>;
|
|
510
|
+
declare const 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>;
|
|
508
511
|
|
|
509
512
|
declare const TxWidgetWC: CustomElementConstructor;
|
|
510
513
|
|
|
511
514
|
declare const XPay: {
|
|
512
|
-
openTransactionModal: ({ integratorId, dstChain, dstToken, srcChain, srcToken, customContractCalls, desc, dstDisplayToken, lightTheme, defaultWalletPicker, styles, onPendingTransactionsChange, dstTokenLocked, dstChainLocked, srcTokenLocked, srcChainLocked, onDstTokenChange, onDstChainChange, onSrcTokenChange, onSrcChainChange, bridge, highlightedDstTokens, }: ModalIntegrationPayload) => Promise<void>;
|
|
513
|
-
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, }: WidgetIntegrationPayload) => react_jsx_runtime.JSX.Element;
|
|
515
|
+
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>;
|
|
516
|
+
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;
|
|
514
517
|
TxWidgetWC: CustomElementConstructor;
|
|
515
518
|
};
|
|
516
519
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { Config } from '@wagmi/core';
|
|
2
3
|
import { BigNumber, ContractReceipt, ContractTransaction } from 'ethers';
|
|
3
4
|
import { TransactionResponse } from '@ethersproject/providers';
|
|
4
5
|
import { VersionedTransaction } from '@solana/web3.js';
|
|
@@ -206,6 +207,7 @@ type ModalIntegrationPayload = {
|
|
|
206
207
|
integratorFee?: number;
|
|
207
208
|
integratorFeeReceiverAddress?: string;
|
|
208
209
|
highlightedDstTokens?: string[];
|
|
210
|
+
wagmiConfig?: Config;
|
|
209
211
|
};
|
|
210
212
|
|
|
211
213
|
type WidgetIntegrationPayload = {
|
|
@@ -243,6 +245,7 @@ type WidgetIntegrationPayload = {
|
|
|
243
245
|
integratorFee?: number;
|
|
244
246
|
integratorFeeReceiverAddress?: string;
|
|
245
247
|
highlightedDstTokens?: string[];
|
|
248
|
+
wagmiConfig?: Config;
|
|
246
249
|
};
|
|
247
250
|
|
|
248
251
|
type Protocol = {
|
|
@@ -448,7 +451,7 @@ declare global {
|
|
|
448
451
|
}
|
|
449
452
|
}
|
|
450
453
|
}
|
|
451
|
-
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, }: WidgetIntegrationPayload) => react_jsx_runtime.JSX.Element;
|
|
454
|
+
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;
|
|
452
455
|
|
|
453
456
|
interface EvmHandlers {
|
|
454
457
|
onSuccess?: (data: ContractReceipt) => void;
|
|
@@ -504,13 +507,13 @@ type TxStats = {
|
|
|
504
507
|
cashback?: string;
|
|
505
508
|
};
|
|
506
509
|
|
|
507
|
-
declare const openTransactionModal: ({ integratorId, dstChain, dstToken, srcChain, srcToken, customContractCalls, desc, dstDisplayToken, lightTheme, defaultWalletPicker, styles, onPendingTransactionsChange, dstTokenLocked, dstChainLocked, srcTokenLocked, srcChainLocked, onDstTokenChange, onDstChainChange, onSrcTokenChange, onSrcChainChange, bridge, highlightedDstTokens, }: ModalIntegrationPayload) => Promise<void>;
|
|
510
|
+
declare const 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>;
|
|
508
511
|
|
|
509
512
|
declare const TxWidgetWC: CustomElementConstructor;
|
|
510
513
|
|
|
511
514
|
declare const XPay: {
|
|
512
|
-
openTransactionModal: ({ integratorId, dstChain, dstToken, srcChain, srcToken, customContractCalls, desc, dstDisplayToken, lightTheme, defaultWalletPicker, styles, onPendingTransactionsChange, dstTokenLocked, dstChainLocked, srcTokenLocked, srcChainLocked, onDstTokenChange, onDstChainChange, onSrcTokenChange, onSrcChainChange, bridge, highlightedDstTokens, }: ModalIntegrationPayload) => Promise<void>;
|
|
513
|
-
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, }: WidgetIntegrationPayload) => react_jsx_runtime.JSX.Element;
|
|
515
|
+
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>;
|
|
516
|
+
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;
|
|
514
517
|
TxWidgetWC: CustomElementConstructor;
|
|
515
518
|
};
|
|
516
519
|
|