@0xsquid/react-hooks 8.8.1-beta-canton.4 → 8.9.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.
Files changed (47) hide show
  1. package/dist/core/client/index.d.ts +0 -1
  2. package/dist/core/constants.d.ts +0 -2
  3. package/dist/core/types/wallet.d.ts +6 -9
  4. package/dist/hooks/chains/useSquidChains.d.ts +0 -1
  5. package/dist/hooks/index.d.ts +0 -1
  6. package/dist/hooks/store/useDepositAddressStore.d.ts +5 -23
  7. package/dist/hooks/swap/useDepositAddress.d.ts +7 -6
  8. package/dist/hooks/tokens/useSquidTokens.d.ts +0 -1
  9. package/dist/hooks/wallet/useMultiChainWallet.d.ts +15 -41
  10. package/dist/hooks/wallet/useWallet.d.ts +15 -45
  11. package/dist/{index-D5QOR7JT.js → index-BL_AUWQg.js} +217 -394
  12. package/dist/index-BL_AUWQg.js.map +1 -0
  13. package/dist/{index-mgE1SeE-.js → index-DcBFug8t.js} +216 -396
  14. package/dist/index-DcBFug8t.js.map +1 -0
  15. package/dist/{index.es-3JPbTFKq.js → index.es-1XEAWjab.js} +2 -2
  16. package/dist/{index.es-3JPbTFKq.js.map → index.es-1XEAWjab.js.map} +1 -1
  17. package/dist/{index.es-Cq4mUT_n.js → index.es-DSQHpime.js} +2 -2
  18. package/dist/{index.es-Cq4mUT_n.js.map → index.es-DSQHpime.js.map} +1 -1
  19. package/dist/index.esm.js +1 -1
  20. package/dist/index.js +3 -6
  21. package/dist/index.js.map +1 -1
  22. package/dist/{secretService-DWq78rM5.js → secretService-B1SDXLS1.js} +2 -2
  23. package/dist/{secretService-DWq78rM5.js.map → secretService-B1SDXLS1.js.map} +1 -1
  24. package/dist/{secretService-DOOg6zVn.js → secretService-DxQ78j5I.js} +2 -2
  25. package/dist/{secretService-DOOg6zVn.js.map → secretService-DxQ78j5I.js.map} +1 -1
  26. package/dist/server.d.ts +1 -1
  27. package/dist/server.esm.js +1 -8
  28. package/dist/server.esm.js.map +1 -1
  29. package/dist/server.js +0 -8
  30. package/dist/server.js.map +1 -1
  31. package/dist/services/internal/assetsService.d.ts +1 -10
  32. package/dist/services/internal/solanaTokenProgramService.d.ts +9 -0
  33. package/dist/services/internal/transactionService.d.ts +1 -5
  34. package/dist/{stellarService.client-DBROJ4yf.js → stellarService.client-C4TLBEpm.js} +2 -2
  35. package/dist/{stellarService.client-DBROJ4yf.js.map → stellarService.client-C4TLBEpm.js.map} +1 -1
  36. package/dist/{stellarService.client-C-pOt34O.js → stellarService.client-CkP5ng2n.js} +2 -2
  37. package/dist/{stellarService.client-C-pOt34O.js.map → stellarService.client-CkP5ng2n.js.map} +1 -1
  38. package/dist/tests/rpcServiceSolana.test.d.ts +1 -0
  39. package/dist/tests/solanaTokenProgramService.test.d.ts +1 -0
  40. package/package.json +2 -2
  41. package/dist/core/types/canton.d.ts +0 -2
  42. package/dist/core/types/cosmos.d.ts +0 -5
  43. package/dist/hooks/transaction/useDepositTransactionStatus.d.ts +0 -25
  44. package/dist/hooks/transaction/useSwapStatusQuery.d.ts +0 -26
  45. package/dist/index-D5QOR7JT.js.map +0 -1
  46. package/dist/index-mgE1SeE-.js.map +0 -1
  47. package/dist/services/internal/cantonService.d.ts +0 -2
@@ -13,7 +13,6 @@ type ChainTypeToClient = {
13
13
  [ChainType.SUI]: SuiClient;
14
14
  [ChainType.XRPL]: XrplRpcClient;
15
15
  [ChainType.STELLAR]: StellarRpcClient;
16
- [ChainType.CANTON]: null;
17
16
  };
18
17
  export declare function getClient<T extends ChainType>(chain: ChainData): Promise<ChainTypeToClient[T]>;
19
18
  export {};
@@ -21,7 +21,6 @@ export declare const nativeBitcoinTokenAddress = "satoshi";
21
21
  export declare const nativeSuiTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI";
22
22
  export declare const nativeXrplTokenAddress = "xrp";
23
23
  export declare const nativeStellarTokenAddress = "CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA";
24
- export declare const nativeCantonTokenAddress = "DSO::1220b1431ef217342db44d516bb9befde802be7d8899637d290895fa58880f19accc";
25
24
  export declare const defaultSlippage: SlippageOption;
26
25
  export declare const destinationAddressResetValue = "null";
27
26
  export declare const fallbackAddressResetValue = "null";
@@ -81,7 +80,6 @@ export declare const CHAIN_IDS: {
81
80
  readonly XRPL_TESTNET: "xrpl-testnet";
82
81
  readonly STELLAR: "stellar-mainnet";
83
82
  readonly STELLAR_TESTNET: "stellar-testnet";
84
- readonly CANTON: "canton";
85
83
  };
86
84
  export declare const chainTypeToDefaultChainIdMap: Record<ChainType, string>;
87
85
  export declare const chainTypeToNativeTokenAddressMap: Record<ChainType, string>;
@@ -1,7 +1,5 @@
1
1
  import type { ChainType } from "@0xsquid/squid-types";
2
2
  import { BitcoinConnector } from "./bitcoin";
3
- import { CantonConnector } from "./canton";
4
- import { CosmosConnector } from "./cosmos";
5
3
  import { EvmConnector } from "./evm";
6
4
  import { SolanaConnector } from "./solana";
7
5
  import { StellarConnector } from "./stellar";
@@ -32,7 +30,12 @@ export declare enum WindowWalletFlag {
32
30
  export type ConnectorID = "metamask" | "coinbase" | "walletConnect" | "keplr" | "cosmostation" | "leap" | "ctrl" | "bitget" | "rabby" | "okx" | "injected" | "trustwallet" | "exodus" | "rainbow" | "phantom" | "backpack" | "unisat" | "xrpl-metamask-snap" | "crossmark" | "xaman-xapp" | "xaman-qr" | "joey" | "girin" | "bifrost" | "brave" | "tokenpocket" | "nightly" | "cryptodotcom" | "freighter" | "xBull" | "lobstr" | "albedo" | "hanaWallet" | "hotWallet";
33
31
  export type EvmWallet = Wallet & {
34
32
  type: ChainType.EVM;
35
- connector: ConnectorByChainType[ChainType.EVM];
33
+ connector: EvmConnector;
34
+ };
35
+ type CosmosConnector = () => {
36
+ id: string;
37
+ name: string;
38
+ provider: any;
36
39
  };
37
40
  export type CosmosWallet = Wallet & {
38
41
  type: ChainType.COSMOS;
@@ -58,10 +61,6 @@ export type StellarWallet = Wallet & {
58
61
  type: ChainType.STELLAR;
59
62
  connector: ConnectorByChainType[ChainType.STELLAR];
60
63
  };
61
- export type CantonWallet = Wallet & {
62
- type: ChainType.CANTON;
63
- connector: ConnectorByChainType[ChainType.CANTON];
64
- };
65
64
  export type SupportedChain = {
66
65
  chainType: ChainType;
67
66
  chains?: string[];
@@ -138,7 +137,6 @@ export interface ChainTypeToWalletState {
138
137
  [ChainType.SUI]: BaseWalletState<SuiWallet> & SuiAccount;
139
138
  [ChainType.XRPL]: BaseWalletState<XrplWallet>;
140
139
  [ChainType.STELLAR]: BaseWalletState<StellarWallet>;
141
- [ChainType.CANTON]: BaseWalletState<CantonWallet>;
142
140
  }
143
141
  interface ConnectorByChainType extends Record<ChainType, unknown> {
144
142
  [ChainType.EVM]: EvmConnector;
@@ -148,6 +146,5 @@ interface ConnectorByChainType extends Record<ChainType, unknown> {
148
146
  [ChainType.SUI]: SuiConnector;
149
147
  [ChainType.XRPL]: XrplConnector;
150
148
  [ChainType.STELLAR]: StellarConnector;
151
- [ChainType.CANTON]: CantonConnector;
152
149
  }
153
150
  export {};
@@ -12,7 +12,6 @@ export declare const useSquidChains: (direction?: SwapDirection) => {
12
12
  suiChains: ChainData[];
13
13
  xrplChains: ChainData[];
14
14
  stellarChains: ChainData[];
15
- cantonChains: ChainData[];
16
15
  getChainType: (chainId?: string) => ChainType | undefined;
17
16
  findChain: (chainId: string | undefined) => ChainData | undefined;
18
17
  };
@@ -37,7 +37,6 @@ export { useSendTransaction } from "./transaction/send/useSendTransaction";
37
37
  export { useSendTransactionGas } from "./transaction/send/useSendTransactionGas";
38
38
  export { useAllTransactionsStatus } from "./transaction/useAllTransactionsStatus";
39
39
  export { useApproval } from "./transaction/useApproval";
40
- export { useDepositTransactionStatus } from "./transaction/useDepositTransactionStatus";
41
40
  export { useEstimate } from "./transaction/useEstimate";
42
41
  export { useEstimatePriceImpact } from "./transaction/useEstimatePriceImpact";
43
42
  export { useExecuteTransaction } from "./transaction/useExecuteTransaction";
@@ -1,27 +1,9 @@
1
- export interface DepositData {
2
- depositAddress: string;
3
- amount: string;
4
- /**
5
- * Identifier sent to backend to check for deposit status
6
- */
7
- statusTrackingId: string;
8
- /**
9
- * Memo to be sent with the deposit transaction on-chain
10
- * Used by backend to track and index deposits
11
- */
12
- memo?: string;
13
- }
14
- export type PaymentMethod = "connectedWallet" | "depositAddress";
1
+ import { DepositAddressResponse } from "@0xsquid/squid-types";
15
2
  interface DepositAddressStore {
16
- deposit: DepositData | null;
17
- /**
18
- * Raw user intent — which payment method the user picked.
19
- * NOT whether deposit is actually usable on the current source chain;
20
- * that is derived in `useDepositAddress` via `isDepositAddressActive`.
21
- */
22
- selectedPaymentMethod: PaymentMethod;
23
- setDeposit(data: DepositData | null): void;
24
- setPaymentMethod(method: PaymentMethod): void;
3
+ deposit: DepositAddressResponse | null;
4
+ isEnabled: boolean;
5
+ setDeposit(data: DepositAddressResponse | null): void;
6
+ toggleDepositFlow(enabled: boolean): void;
25
7
  }
26
8
  export declare const useDepositAddressStore: import("zustand").UseBoundStore<import("zustand").StoreApi<DepositAddressStore>>;
27
9
  export {};
@@ -1,15 +1,16 @@
1
1
  import { RouteResponse } from "@0xsquid/squid-types";
2
- import { PaymentMethod } from "../store/useDepositAddressStore";
3
2
  export declare function useDepositAddress(squidRoute?: RouteResponse["route"]): {
4
- paymentMethod: PaymentMethod;
5
- isDepositAddressActive: boolean;
3
+ isEnabled: boolean;
6
4
  isAvailableAsPaymentMethod: boolean;
7
5
  swapWillGenerateDepositAddress: boolean;
8
- setPaymentMethod: (method: PaymentMethod) => void;
9
- getRouteWithDeposit: import("@tanstack/react-query").UseMutationResult<void, unknown, {
6
+ enable: () => void;
7
+ disable: () => void;
8
+ getRouteWithDeposit: import("@tanstack/react-query").UseMutationResult<{
9
+ depositAddress: import("@0xsquid/squid-types").ChainflipDepositAddressResponse;
10
+ }, unknown, {
10
11
  route: RouteResponse["route"];
11
12
  }, unknown>;
12
13
  depositAddress: string | undefined;
13
14
  closeDepositChannel: () => void;
14
- depositData: import("../store/useDepositAddressStore").DepositData | null;
15
+ depositData: import("@0xsquid/squid-types").ChainflipDepositAddressResponse | null;
15
16
  };
@@ -13,5 +13,4 @@ export declare const useSquidTokens: (direction?: SwapDirection) => {
13
13
  suiTokens: Token[];
14
14
  xrplTokens: Token[];
15
15
  stellarTokens: Token[];
16
- cantonTokens: Token[];
17
16
  };
@@ -65,7 +65,11 @@ export declare const useMultiChainWallet: (chain: ChainData | undefined) => {
65
65
  supportedNetworks: import("../../core/types/wallet").NetworkConfig[];
66
66
  } & {
67
67
  type: ChainType.COSMOS;
68
- connector: import("../../core/types/cosmos").CosmosConnector;
68
+ connector: () => {
69
+ id: string;
70
+ name: string;
71
+ provider: any;
72
+ };
69
73
  }) | ({
70
74
  name: string;
71
75
  connectorId: import("../../core/types/wallet").ConnectorID;
@@ -82,10 +86,18 @@ export declare const useMultiChainWallet: (chain: ChainData | undefined) => {
82
86
  isMultiChain?: false | undefined;
83
87
  } & {
84
88
  type: ChainType.COSMOS;
85
- connector: import("../../core/types/cosmos").CosmosConnector;
89
+ connector: () => {
90
+ id: string;
91
+ name: string;
92
+ provider: any;
93
+ };
86
94
  } & {
87
95
  type: ChainType.COSMOS;
88
- connector: import("../../core/types/cosmos").CosmosConnector;
96
+ connector: () => {
97
+ id: string;
98
+ name: string;
99
+ provider: any;
100
+ };
89
101
  }) | ({
90
102
  name: string;
91
103
  connectorId: import("../../core/types/wallet").ConnectorID;
@@ -276,43 +288,5 @@ export declare const useMultiChainWallet: (chain: ChainData | undefined) => {
276
288
  } & {
277
289
  type: ChainType.STELLAR;
278
290
  connector: import("../../core/types/stellar").StellarConnector;
279
- }) | ({
280
- name: string;
281
- connectorId: import("../../core/types/wallet").ConnectorID;
282
- connectorName: string;
283
- icon: string | undefined;
284
- windowFlag: import("../../core/types/wallet").WindowWalletFlag;
285
- isMobile?: boolean | undefined;
286
- isQrWallet?: boolean | undefined;
287
- isInstalled?: (() => boolean) | undefined;
288
- skipInstallCheck?: boolean | undefined;
289
- rdns?: string | undefined;
290
- url?: string | undefined;
291
- } & {
292
- isMultiChain: true;
293
- supportedNetworks: import("../../core/types/wallet").NetworkConfig[];
294
- } & {
295
- type: ChainType.CANTON;
296
- connector: import("../../core/types/canton").CantonConnector;
297
- }) | ({
298
- name: string;
299
- connectorId: import("../../core/types/wallet").ConnectorID;
300
- connectorName: string;
301
- icon: string | undefined;
302
- windowFlag: import("../../core/types/wallet").WindowWalletFlag;
303
- isMobile?: boolean | undefined;
304
- isQrWallet?: boolean | undefined;
305
- isInstalled?: (() => boolean) | undefined;
306
- skipInstallCheck?: boolean | undefined;
307
- rdns?: string | undefined;
308
- url?: string | undefined;
309
- } & {
310
- isMultiChain?: false | undefined;
311
- } & {
312
- type: ChainType.CANTON;
313
- connector: import("../../core/types/canton").CantonConnector;
314
- } & {
315
- type: ChainType.CANTON;
316
- connector: import("../../core/types/canton").CantonConnector;
317
291
  }) | undefined;
318
292
  };
@@ -65,7 +65,11 @@ export declare const useWallet: () => {
65
65
  supportedNetworks: import("../../core/types/wallet").NetworkConfig[];
66
66
  } & {
67
67
  type: ChainType.COSMOS;
68
- connector: import("../../core/types/cosmos").CosmosConnector;
68
+ connector: () => {
69
+ id: string;
70
+ name: string;
71
+ provider: any;
72
+ };
69
73
  }) | ({
70
74
  name: string;
71
75
  connectorId: import("../../core/types/wallet").ConnectorID;
@@ -82,10 +86,18 @@ export declare const useWallet: () => {
82
86
  isMultiChain?: false | undefined;
83
87
  } & {
84
88
  type: ChainType.COSMOS;
85
- connector: import("../../core/types/cosmos").CosmosConnector;
89
+ connector: () => {
90
+ id: string;
91
+ name: string;
92
+ provider: any;
93
+ };
86
94
  } & {
87
95
  type: ChainType.COSMOS;
88
- connector: import("../../core/types/cosmos").CosmosConnector;
96
+ connector: () => {
97
+ id: string;
98
+ name: string;
99
+ provider: any;
100
+ };
89
101
  });
90
102
  address: string;
91
103
  }>;
@@ -299,48 +311,6 @@ export declare const useWallet: () => {
299
311
  });
300
312
  address: string;
301
313
  }>;
302
- canton: Partial<{
303
- wallet: ({
304
- name: string;
305
- connectorId: import("../../core/types/wallet").ConnectorID;
306
- connectorName: string;
307
- icon: string | undefined;
308
- windowFlag: import("../../core/types/wallet").WindowWalletFlag;
309
- isMobile?: boolean | undefined;
310
- isQrWallet?: boolean | undefined;
311
- isInstalled?: (() => boolean) | undefined;
312
- skipInstallCheck?: boolean | undefined;
313
- rdns?: string | undefined;
314
- url?: string | undefined;
315
- } & {
316
- isMultiChain: true;
317
- supportedNetworks: import("../../core/types/wallet").NetworkConfig[];
318
- } & {
319
- type: ChainType.CANTON;
320
- connector: import("../../core/types/canton").CantonConnector;
321
- }) | ({
322
- name: string;
323
- connectorId: import("../../core/types/wallet").ConnectorID;
324
- connectorName: string;
325
- icon: string | undefined;
326
- windowFlag: import("../../core/types/wallet").WindowWalletFlag;
327
- isMobile?: boolean | undefined;
328
- isQrWallet?: boolean | undefined;
329
- isInstalled?: (() => boolean) | undefined;
330
- skipInstallCheck?: boolean | undefined;
331
- rdns?: string | undefined;
332
- url?: string | undefined;
333
- } & {
334
- isMultiChain?: false | undefined;
335
- } & {
336
- type: ChainType.CANTON;
337
- connector: import("../../core/types/canton").CantonConnector;
338
- } & {
339
- type: ChainType.CANTON;
340
- connector: import("../../core/types/canton").CantonConnector;
341
- });
342
- address: string;
343
- }>;
344
314
  };
345
315
  connectedAddresses: Record<ChainType, string | undefined>;
346
316
  connectingWalletState: import("../store/useWalletStore").ConnectingWalletState;