@xswap-link/sdk 0.6.9 → 0.6.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xswap-link/sdk",
3
- "version": "0.6.9",
3
+ "version": "0.6.10",
4
4
  "description": "JavaScript SDK for XSwap platform",
5
5
  "homepage": "https://github.com/xswap-link/xswap-sdk",
6
6
  "repository": {
@@ -31,7 +31,7 @@ export const ChainPanel = ({ chain, type }: Props) => {
31
31
 
32
32
  const projectSelectedDestinationChain = useMemo(
33
33
  () => type === "destination" && dstChainProvided,
34
- [dstChainProvided],
34
+ [type, dstChainProvided],
35
35
  );
36
36
 
37
37
  // select chain from user wallet
@@ -31,7 +31,7 @@ export const TokenPanel = ({ chain, token, type }: Props) => {
31
31
 
32
32
  const projectSelectedDestinationToken = useMemo(
33
33
  () => type === "destination" && dstTokenProvided,
34
- [dstTokenProvided],
34
+ [type, dstTokenProvided],
35
35
  );
36
36
 
37
37
  const { openModal, closeModal } = useModal();
@@ -122,10 +122,10 @@ export type TxWidgetWCAttributes = {
122
122
  "dst-token": WidgetIntegrationPayload["dstToken"];
123
123
  "src-chain": WidgetIntegrationPayload["srcChain"];
124
124
  "src-token": WidgetIntegrationPayload["srcToken"];
125
- "custom-contract-calls": WidgetIntegrationPayload["customContractCalls"];
125
+ "custom-contract-calls": string | undefined;
126
126
  desc: WidgetIntegrationPayload["desc"];
127
127
  "dst-display-token": WidgetIntegrationPayload["dstDisplayToken"];
128
128
  "light-theme": WidgetIntegrationPayload["lightTheme"];
129
129
  "default-wallet-picker": WidgetIntegrationPayload["defaultWalletPicker"];
130
- styles: WidgetIntegrationPayload["styles"];
130
+ styles: string | undefined;
131
131
  };
@@ -43,12 +43,12 @@ export const TxWidgetWCWrapped = ({
43
43
  dst-token={dstToken}
44
44
  src-chain={srcChain}
45
45
  src-token={srcToken}
46
- custom-contract-calls={customContractCalls}
46
+ custom-contract-calls={JSON.stringify(customContractCalls)}
47
47
  desc={desc}
48
48
  dst-display-token={dstDisplayToken}
49
49
  light-theme={lightTheme}
50
50
  default-wallet-picker={defaultWalletPicker}
51
- styles={styles}
51
+ styles={typeof styles === "string" ? styles : JSON.stringify(styles)}
52
52
  ></xpay-widget>
53
53
  );
54
54
  };
@@ -1,4 +1,4 @@
1
- import { ContractCall } from "@src/models";
1
+ import { ContractCall, ModalIntegrationStyles } from "@src/models";
2
2
 
3
3
  export type WidgetIntegrationPayload = {
4
4
  integratorId: string;
@@ -11,5 +11,5 @@ export type WidgetIntegrationPayload = {
11
11
  dstDisplayToken?: string;
12
12
  lightTheme?: boolean;
13
13
  defaultWalletPicker?: boolean;
14
- styles?: string;
14
+ styles?: ModalIntegrationStyles | string;
15
15
  };