@xswap-link/sdk 0.12.1 → 0.13.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.
@@ -11,12 +11,12 @@ jobs:
11
11
  - uses: actions/checkout@v3
12
12
  - uses: pnpm/action-setup@v4
13
13
  with:
14
- version: 7
15
- - uses: actions/setup-node@v3
14
+ version: 9
15
+ - uses: actions/setup-node@v4
16
16
  with:
17
- node-version: 18.x
17
+ node-version: 20.x
18
18
  cache: "pnpm"
19
19
 
20
- - run: pnpm install
20
+ - run: pnpm install --frozen-lockfile
21
21
  - run: pnpm run lint && pnpm run build
22
22
  # - run: pnpm run test
@@ -19,13 +19,13 @@ jobs:
19
19
  - uses: actions/checkout@v3
20
20
  - uses: pnpm/action-setup@v4
21
21
  with:
22
- version: 7
23
- - uses: actions/setup-node@v3
22
+ version: 9
23
+ - uses: actions/setup-node@v4
24
24
  with:
25
- node-version: 18.x
25
+ node-version: 20.x
26
26
  cache: "pnpm"
27
27
 
28
- - run: pnpm install
28
+ - run: pnpm install --frozen-lockfile
29
29
 
30
30
  - name: Create Release Pull Request or Publish
31
31
  id: changesets
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @xswap-link/xswap-sdk
2
2
 
3
+ ## 0.13.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 82769c2: added support for aliases in bridge tokens, removed customXSwapRouter logic
8
+
9
+ ## 0.12.2
10
+
11
+ ### Patch Changes
12
+
13
+ - 0283187: fix connect wallet, fix getTokenBalance
14
+
3
15
  ## 0.12.1
4
16
 
5
17
  ### Patch Changes
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';
@@ -13,7 +14,6 @@ type Contracts = Partial<{
13
14
  declare enum ContractName {
14
15
  USDC = "USDC",
15
16
  BatchQuery = "BatchQuery",
16
- CustomXSwapRouter = "CustomXSwapRouter",
17
17
  FeeCollector = "FeeCollector",
18
18
  StakingCosmicCadets = "StakingCosmicCadets",
19
19
  StakingSolarDivision = "StakingSolarDivision",
@@ -206,6 +206,7 @@ type ModalIntegrationPayload = {
206
206
  integratorFee?: number;
207
207
  integratorFeeReceiverAddress?: string;
208
208
  highlightedDstTokens?: string[];
209
+ wagmiConfig?: Config;
209
210
  };
210
211
 
211
212
  type WidgetIntegrationPayload = {
@@ -243,6 +244,7 @@ type WidgetIntegrationPayload = {
243
244
  integratorFee?: number;
244
245
  integratorFeeReceiverAddress?: string;
245
246
  highlightedDstTokens?: string[];
247
+ wagmiConfig?: Config;
246
248
  };
247
249
 
248
250
  type Protocol = {
@@ -448,7 +450,7 @@ declare global {
448
450
  }
449
451
  }
450
452
  }
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;
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;
452
454
 
453
455
  interface EvmHandlers {
454
456
  onSuccess?: (data: ContractReceipt) => void;
@@ -504,13 +506,13 @@ type TxStats = {
504
506
  cashback?: string;
505
507
  };
506
508
 
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>;
509
+ 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
510
 
509
511
  declare const TxWidgetWC: CustomElementConstructor;
510
512
 
511
513
  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;
514
+ 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;
514
516
  TxWidgetWC: CustomElementConstructor;
515
517
  };
516
518
 
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';
@@ -13,7 +14,6 @@ type Contracts = Partial<{
13
14
  declare enum ContractName {
14
15
  USDC = "USDC",
15
16
  BatchQuery = "BatchQuery",
16
- CustomXSwapRouter = "CustomXSwapRouter",
17
17
  FeeCollector = "FeeCollector",
18
18
  StakingCosmicCadets = "StakingCosmicCadets",
19
19
  StakingSolarDivision = "StakingSolarDivision",
@@ -206,6 +206,7 @@ type ModalIntegrationPayload = {
206
206
  integratorFee?: number;
207
207
  integratorFeeReceiverAddress?: string;
208
208
  highlightedDstTokens?: string[];
209
+ wagmiConfig?: Config;
209
210
  };
210
211
 
211
212
  type WidgetIntegrationPayload = {
@@ -243,6 +244,7 @@ type WidgetIntegrationPayload = {
243
244
  integratorFee?: number;
244
245
  integratorFeeReceiverAddress?: string;
245
246
  highlightedDstTokens?: string[];
247
+ wagmiConfig?: Config;
246
248
  };
247
249
 
248
250
  type Protocol = {
@@ -448,7 +450,7 @@ declare global {
448
450
  }
449
451
  }
450
452
  }
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;
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;
452
454
 
453
455
  interface EvmHandlers {
454
456
  onSuccess?: (data: ContractReceipt) => void;
@@ -504,13 +506,13 @@ type TxStats = {
504
506
  cashback?: string;
505
507
  };
506
508
 
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>;
509
+ 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
510
 
509
511
  declare const TxWidgetWC: CustomElementConstructor;
510
512
 
511
513
  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;
514
+ 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;
514
516
  TxWidgetWC: CustomElementConstructor;
515
517
  };
516
518