@0xsquid/react-hooks 8.9.0 → 8.9.1-beta-canton-wallet-connection.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 (68) hide show
  1. package/dist/core/canton/cantonConnector.d.ts +28 -0
  2. package/dist/core/canton/cip103Client.d.ts +20 -0
  3. package/dist/core/client/index.d.ts +1 -0
  4. package/dist/core/constants.d.ts +3 -0
  5. package/dist/core/fallbackWallets.d.ts +16 -0
  6. package/dist/core/providers/CantonProvider.d.ts +19 -0
  7. package/dist/core/types/canton.d.ts +58 -0
  8. package/dist/core/types/cosmos.d.ts +5 -0
  9. package/dist/core/types/wallet.d.ts +15 -7
  10. package/dist/core/wallets.d.ts +5 -0
  11. package/dist/hooks/canton/useCanton.d.ts +2 -0
  12. package/dist/hooks/canton/useCantonWallets.d.ts +8 -0
  13. package/dist/hooks/chains/useSquidChains.d.ts +1 -0
  14. package/dist/hooks/index.d.ts +1 -0
  15. package/dist/hooks/store/useDepositAddressStore.d.ts +18 -5
  16. package/dist/hooks/swap/useDepositAddress.d.ts +6 -7
  17. package/dist/hooks/tokens/useBalance.d.ts +1 -0
  18. package/dist/hooks/tokens/useNativeBalance.d.ts +1 -0
  19. package/dist/hooks/tokens/useSquidTokens.d.ts +1 -0
  20. package/dist/hooks/transaction/useDepositTransactionStatus.d.ts +20 -0
  21. package/dist/hooks/transaction/useSwapStatusQuery.d.ts +29 -0
  22. package/dist/hooks/wallet/useMultiChainWallet.d.ts +55 -29
  23. package/dist/hooks/wallet/useSigner.d.ts +1 -0
  24. package/dist/hooks/wallet/useWallet.d.ts +59 -29
  25. package/dist/hooks/xrpl/useXrplWallets.d.ts +2 -2
  26. package/dist/{index-BL_AUWQg.js → index-B8h1ypYK.js} +1364 -195
  27. package/dist/index-B8h1ypYK.js.map +1 -0
  28. package/dist/{index-DcBFug8t.js → index-doLvokYY.js} +1349 -177
  29. package/dist/index-doLvokYY.js.map +1 -0
  30. package/dist/{index.es-1XEAWjab.js → index.es-CuIvGVFi.js} +4 -3
  31. package/dist/index.es-CuIvGVFi.js.map +1 -0
  32. package/dist/{index.es-DSQHpime.js → index.es-reWGC10l.js} +4 -3
  33. package/dist/index.es-reWGC10l.js.map +1 -0
  34. package/dist/index.esm.js +3 -2
  35. package/dist/index.esm.js.map +1 -1
  36. package/dist/index.js +9 -5
  37. package/dist/index.js.map +1 -1
  38. package/dist/{secretService-B1SDXLS1.js → secretService-3g7QoMaM.js} +4 -3
  39. package/dist/{secretService-B1SDXLS1.js.map → secretService-3g7QoMaM.js.map} +1 -1
  40. package/dist/{secretService-DxQ78j5I.js → secretService-DMcFUD-e.js} +4 -3
  41. package/dist/{secretService-DxQ78j5I.js.map → secretService-DMcFUD-e.js.map} +1 -1
  42. package/dist/server.d.ts +1 -1
  43. package/dist/server.esm.js +7 -1
  44. package/dist/server.esm.js.map +1 -1
  45. package/dist/server.js +7 -0
  46. package/dist/server.js.map +1 -1
  47. package/dist/services/external/onrampAdapter.d.ts +3 -4
  48. package/dist/services/external/rpcService.d.ts +17 -0
  49. package/dist/services/internal/assetsService.d.ts +10 -1
  50. package/dist/services/internal/cantonDamlValue.d.ts +75 -0
  51. package/dist/services/internal/cantonService.d.ts +64 -0
  52. package/dist/services/internal/cantonTransferService.d.ts +93 -0
  53. package/dist/services/internal/transactionService.d.ts +5 -1
  54. package/dist/services/internal/walletService.d.ts +3 -6
  55. package/dist/{stellarService.client-C4TLBEpm.js → stellarService.client-DLPxIX3n.js} +5 -4
  56. package/dist/{stellarService.client-C4TLBEpm.js.map → stellarService.client-DLPxIX3n.js.map} +1 -1
  57. package/dist/{stellarService.client-CkP5ng2n.js → stellarService.client-DMdUVPJ8.js} +5 -4
  58. package/dist/{stellarService.client-CkP5ng2n.js.map → stellarService.client-DMdUVPJ8.js.map} +1 -1
  59. package/dist/tests/cantonService.test.d.ts +1 -0
  60. package/dist/tests/cantonTransferService.test.d.ts +1 -0
  61. package/dist/tests/cip103Client.test.d.ts +1 -0
  62. package/dist/tests/fallbackWallets.test.d.ts +1 -0
  63. package/dist/tests/wallets.test.d.ts +1 -0
  64. package/package.json +3 -2
  65. package/dist/index-BL_AUWQg.js.map +0 -1
  66. package/dist/index-DcBFug8t.js.map +0 -1
  67. package/dist/index.es-1XEAWjab.js.map +0 -1
  68. package/dist/index.es-DSQHpime.js.map +0 -1
@@ -0,0 +1,28 @@
1
+ import type { CantonAccount, CantonConnectResult, CantonConnector, CantonConnectorEvent, CantonConnectorEventHandler, CantonLedgerApiParams, CantonPrepareExecuteAndWaitResult, CantonPrepareExecuteParams } from "../types/canton";
2
+ import { AnnouncedCantonProvider } from "./cip103Client";
3
+ /**
4
+ * Browser-extension Canton connector: wraps one discovered CIP-103 provider
5
+ * (bound to its announce `target`) and exposes the lifecycle methods.
6
+ */
7
+ export declare class CantonBrowserConnector implements CantonConnector {
8
+ readonly providerId: string;
9
+ readonly name: string;
10
+ readonly target: string | undefined;
11
+ private readonly client;
12
+ private readonly listeners;
13
+ private _accounts;
14
+ constructor(provider: AnnouncedCantonProvider, win?: Window);
15
+ get accounts(): CantonAccount[];
16
+ get address(): string | undefined;
17
+ connect(): Promise<CantonConnectResult>;
18
+ /** Silent connect: read accounts without prompting; throws if not connected. */
19
+ autoConnect(): Promise<CantonConnectResult>;
20
+ disconnect(): Promise<void>;
21
+ ledgerApi<T = unknown>(params: CantonLedgerApiParams): Promise<T>;
22
+ prepareExecuteAndWait(params: CantonPrepareExecuteParams): Promise<CantonPrepareExecuteAndWaitResult>;
23
+ getAccounts(): Promise<CantonAccount[]>;
24
+ on<E extends CantonConnectorEvent>(event: E, handler: CantonConnectorEventHandler<E>): void;
25
+ off<E extends CantonConnectorEvent>(event: E, handler: CantonConnectorEventHandler<E>): void;
26
+ private emit;
27
+ private refreshAccounts;
28
+ }
@@ -0,0 +1,20 @@
1
+ export declare const CANTON_REQUEST_PROVIDER_EVENT = "canton:requestProvider";
2
+ export declare const CANTON_ANNOUNCE_PROVIDER_EVENT = "canton:announceProvider";
3
+ export interface AnnouncedCantonProvider {
4
+ /** Stable identifier for the wallet/extension. */
5
+ id: string;
6
+ /** Display name for pickers. */
7
+ name: string;
8
+ /** Optional icon (data URL or https URL). */
9
+ icon?: string;
10
+ /** Routing key for the postMessage transport (defaults to `id`). */
11
+ target?: string;
12
+ }
13
+ /**
14
+ * CIP-103 browser-wallet discovery (EIP-6963-style).
15
+ * The wallet dispatches `canton:announceProvider` and dApps
16
+ * dispatch `canton:requestProvider` to ask installed wallets to re-announce.
17
+ * Each announcement carries a `target` we route through Sigilry's `WindowTransport`,
18
+ * so multiple extensions coexist without contending on the `window.canton` global.
19
+ */
20
+ export declare function discoverCantonProviders(timeoutMs?: number, win?: Window): Promise<AnnouncedCantonProvider[]>;
@@ -13,6 +13,7 @@ type ChainTypeToClient = {
13
13
  [ChainType.SUI]: SuiClient;
14
14
  [ChainType.XRPL]: XrplRpcClient;
15
15
  [ChainType.STELLAR]: StellarRpcClient;
16
+ [ChainType.CANTON]: null;
16
17
  };
17
18
  export declare function getClient<T extends ChainType>(chain: ChainData): Promise<ChainTypeToClient[T]>;
18
19
  export {};
@@ -21,6 +21,7 @@ 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";
24
25
  export declare const defaultSlippage: SlippageOption;
25
26
  export declare const destinationAddressResetValue = "null";
26
27
  export declare const fallbackAddressResetValue = "null";
@@ -32,6 +33,7 @@ export declare const DEFAULT_ROUTE_REFETCH_INTERVAL = 30000;
32
33
  export declare const SOLANA_RPC_URL = "https://meredith-ute2ko-fast-mainnet.helius-rpc.com";
33
34
  export declare const INTEGRATOR_ID = "squid-widget-playground-local-cd33cba6-7e12-4fcc-8d5d-35e286f655ea";
34
35
  export declare const DEFAULT_COUNTRY_CODE = "US";
36
+ export declare const CANTON_AMULET_REGISTRY_URL = "/api/canton/scan-proxy";
35
37
  export declare const CHAIN_IDS: {
36
38
  readonly OSMOSIS: "osmosis-1";
37
39
  readonly INJECTIVE: "injective-1";
@@ -80,6 +82,7 @@ export declare const CHAIN_IDS: {
80
82
  readonly XRPL_TESTNET: "xrpl-testnet";
81
83
  readonly STELLAR: "stellar-mainnet";
82
84
  readonly STELLAR_TESTNET: "stellar-testnet";
85
+ readonly CANTON: "canton";
83
86
  };
84
87
  export declare const chainTypeToDefaultChainIdMap: Record<ChainType, string>;
85
88
  export declare const chainTypeToNativeTokenAddressMap: Record<ChainType, string>;
@@ -0,0 +1,16 @@
1
+ import { ChainType } from "@0xsquid/squid-types";
2
+ import type { WalletLinks } from "./types/wallet";
3
+ export type FallbackWalletConfig = {
4
+ chainType: ChainType;
5
+ id: string;
6
+ name: string;
7
+ connectorName: string;
8
+ icon: string;
9
+ links: WalletLinks;
10
+ };
11
+ /**
12
+ * Wallets to show regardless of whether they're detected.
13
+ * Useful when we want to link to the browser extension store
14
+ * for wallets that are automatically discovered (i.e. EVM, SOLANA, CANTON...)
15
+ */
16
+ export declare const fallbackWallets: FallbackWalletConfig[];
@@ -0,0 +1,19 @@
1
+ import { ChainType } from "@0xsquid/squid-types";
2
+ import { UseMutationResult } from "@tanstack/react-query";
3
+ import React, { ReactNode } from "react";
4
+ import { CantonConnector } from "../types/canton";
5
+ import { CantonWallet, ConnectWalletResult } from "../types/wallet";
6
+ export interface ICantonContextData {
7
+ connectCanton: UseMutationResult<ConnectWalletResult<ChainType.CANTON>, unknown, {
8
+ wallet: CantonWallet;
9
+ }, unknown>;
10
+ disconnectCanton: () => Promise<void>;
11
+ autoConnectCanton: () => Promise<void>;
12
+ signer: CantonConnector | undefined;
13
+ wallets: CantonWallet[];
14
+ }
15
+ export declare const CantonContext: React.Context<ICantonContextData | undefined>;
16
+ export declare const CantonProvider: React.FC<{
17
+ children: ReactNode;
18
+ }>;
19
+ export declare const useCantonContext: () => ICantonContextData;
@@ -0,0 +1,58 @@
1
+ import type { CantonClient } from "@sigilry/dapp";
2
+ export interface CantonLedgerApiParams {
3
+ requestMethod: "get" | "post" | "patch" | "put" | "delete";
4
+ resource: string;
5
+ body?: Record<string, unknown>;
6
+ query?: Record<string, unknown>;
7
+ path?: Record<string, unknown>;
8
+ }
9
+ export interface CantonAccount {
10
+ partyId: string;
11
+ primary?: boolean;
12
+ hint?: string;
13
+ namespace?: string;
14
+ networkId?: string;
15
+ }
16
+ export interface CantonInstrument {
17
+ admin: string;
18
+ id: string;
19
+ }
20
+ export interface CantonHolding {
21
+ contractId: string;
22
+ instrument: CantonInstrument;
23
+ amount: string;
24
+ locked: boolean;
25
+ }
26
+ export interface CantonDisclosedContract {
27
+ templateId?: string;
28
+ contractId?: string;
29
+ createdEventBlob: string;
30
+ synchronizerId?: string;
31
+ }
32
+ export type CantonPrepareExecuteParams = Parameters<CantonClient["prepareExecuteAndWait"]>[0];
33
+ export type CantonPrepareExecuteAndWaitResult = Awaited<ReturnType<CantonClient["prepareExecuteAndWait"]>>;
34
+ export interface CantonConnectorEventMap {
35
+ connect: [address: string];
36
+ disconnect: [];
37
+ }
38
+ export type CantonConnectorEvent = keyof CantonConnectorEventMap;
39
+ export type CantonConnectorEventHandler<E extends CantonConnectorEvent> = (...args: CantonConnectorEventMap[E]) => void;
40
+ export interface CantonConnectResult {
41
+ address: string;
42
+ accounts: CantonAccount[];
43
+ }
44
+ export interface CantonConnector {
45
+ readonly providerId: string;
46
+ readonly name: string;
47
+ readonly target: string | undefined;
48
+ connect(): Promise<CantonConnectResult>;
49
+ autoConnect(): Promise<CantonConnectResult>;
50
+ disconnect(): Promise<void>;
51
+ ledgerApi<T = unknown>(params: CantonLedgerApiParams): Promise<T>;
52
+ prepareExecuteAndWait(params: CantonPrepareExecuteParams): Promise<CantonPrepareExecuteAndWaitResult>;
53
+ getAccounts(): Promise<CantonAccount[]>;
54
+ on<E extends CantonConnectorEvent>(event: E, handler: CantonConnectorEventHandler<E>): void;
55
+ off<E extends CantonConnectorEvent>(event: E, handler: CantonConnectorEventHandler<E>): void;
56
+ readonly accounts: CantonAccount[];
57
+ readonly address: string | undefined;
58
+ }
@@ -0,0 +1,5 @@
1
+ export type CosmosConnector = () => {
2
+ id: string;
3
+ name: string;
4
+ provider: any;
5
+ };
@@ -1,5 +1,7 @@
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";
3
5
  import { EvmConnector } from "./evm";
4
6
  import { SolanaConnector } from "./solana";
5
7
  import { StellarConnector } from "./stellar";
@@ -30,12 +32,7 @@ export declare enum WindowWalletFlag {
30
32
  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";
31
33
  export type EvmWallet = Wallet & {
32
34
  type: ChainType.EVM;
33
- connector: EvmConnector;
34
- };
35
- type CosmosConnector = () => {
36
- id: string;
37
- name: string;
38
- provider: any;
35
+ connector: ConnectorByChainType[ChainType.EVM];
39
36
  };
40
37
  export type CosmosWallet = Wallet & {
41
38
  type: ChainType.COSMOS;
@@ -61,6 +58,10 @@ export type StellarWallet = Wallet & {
61
58
  type: ChainType.STELLAR;
62
59
  connector: ConnectorByChainType[ChainType.STELLAR];
63
60
  };
61
+ export type CantonWallet = Wallet & {
62
+ type: ChainType.CANTON;
63
+ connector: ConnectorByChainType[ChainType.CANTON];
64
+ };
64
65
  export type SupportedChain = {
65
66
  chainType: ChainType;
66
67
  chains?: string[];
@@ -71,6 +72,11 @@ export type NetworkConfig = {
71
72
  connector: ConnectorByChainType[T];
72
73
  };
73
74
  }[ChainType];
75
+ export type WalletLinks = {
76
+ website?: string;
77
+ chrome?: string;
78
+ firefox?: string;
79
+ };
74
80
  export type Wallet = {
75
81
  name: string;
76
82
  connectorId: ConnectorID;
@@ -82,7 +88,7 @@ export type Wallet = {
82
88
  isInstalled?: () => boolean;
83
89
  skipInstallCheck?: boolean;
84
90
  rdns?: string;
85
- url?: string;
91
+ links?: WalletLinks;
86
92
  } & ({
87
93
  isMultiChain: true;
88
94
  supportedNetworks: NetworkConfig[];
@@ -137,6 +143,7 @@ export interface ChainTypeToWalletState {
137
143
  [ChainType.SUI]: BaseWalletState<SuiWallet> & SuiAccount;
138
144
  [ChainType.XRPL]: BaseWalletState<XrplWallet>;
139
145
  [ChainType.STELLAR]: BaseWalletState<StellarWallet>;
146
+ [ChainType.CANTON]: BaseWalletState<CantonWallet>;
140
147
  }
141
148
  interface ConnectorByChainType extends Record<ChainType, unknown> {
142
149
  [ChainType.EVM]: EvmConnector;
@@ -146,5 +153,6 @@ interface ConnectorByChainType extends Record<ChainType, unknown> {
146
153
  [ChainType.SUI]: SuiConnector;
147
154
  [ChainType.XRPL]: XrplConnector;
148
155
  [ChainType.STELLAR]: StellarConnector;
156
+ [ChainType.CANTON]: CantonConnector;
149
157
  }
150
158
  export {};
@@ -1,6 +1,11 @@
1
1
  import { ConnectorID } from "./types";
2
2
  import { Wallet, XrplWallet } from "./types/wallet";
3
3
  export declare const walletIconBaseUrl = "https://raw.githubusercontent.com/0xsquid/assets/main/images/webp128/wallets";
4
+ /**
5
+ * Dynamically accesses a nested property of an object based on a dot-separated string path.
6
+ * Returns the value of the property if found, otherwise undefined.
7
+ */
8
+ export declare const accessProperty: (object: Record<string, any>, path: string) => any;
4
9
  export declare const xrplWallets: XrplWallet[];
5
10
  export declare const multiChainWallets: Wallet[];
6
11
  export declare const singleChainWallets: Wallet[];
@@ -0,0 +1,2 @@
1
+ import { ICantonContextData } from "../../core/providers/CantonProvider";
2
+ export declare function useCanton(): ICantonContextData;
@@ -0,0 +1,8 @@
1
+ import { CantonWallet } from "../../core/types/wallet";
2
+ /**
3
+ * Discovers Canton browser-extension wallets via the CIP-103 announce protocol
4
+ * (on mount and on window focus) and maps each to a {@link CantonWallet}.
5
+ */
6
+ export declare function useCantonWallets(): {
7
+ wallets: CantonWallet[];
8
+ };
@@ -12,6 +12,7 @@ export declare const useSquidChains: (direction?: SwapDirection) => {
12
12
  suiChains: ChainData[];
13
13
  xrplChains: ChainData[];
14
14
  stellarChains: ChainData[];
15
+ cantonChains: ChainData[];
15
16
  getChainType: (chainId?: string) => ChainType | undefined;
16
17
  findChain: (chainId: string | undefined) => ChainData | undefined;
17
18
  };
@@ -37,6 +37,7 @@ 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";
40
41
  export { useEstimate } from "./transaction/useEstimate";
41
42
  export { useEstimatePriceImpact } from "./transaction/useEstimatePriceImpact";
42
43
  export { useExecuteTransaction } from "./transaction/useExecuteTransaction";
@@ -1,9 +1,22 @@
1
- import { DepositAddressResponse } from "@0xsquid/squid-types";
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";
2
15
  interface DepositAddressStore {
3
- deposit: DepositAddressResponse | null;
4
- isEnabled: boolean;
5
- setDeposit(data: DepositAddressResponse | null): void;
6
- toggleDepositFlow(enabled: boolean): void;
16
+ deposit: DepositData | null;
17
+ selectedPaymentMethod: PaymentMethod;
18
+ setDeposit(data: DepositData | null): void;
19
+ setPaymentMethod(method: PaymentMethod): void;
7
20
  }
8
21
  export declare const useDepositAddressStore: import("zustand").UseBoundStore<import("zustand").StoreApi<DepositAddressStore>>;
9
22
  export {};
@@ -1,16 +1,15 @@
1
1
  import { RouteResponse } from "@0xsquid/squid-types";
2
+ import { PaymentMethod } from "../store/useDepositAddressStore";
2
3
  export declare function useDepositAddress(squidRoute?: RouteResponse["route"]): {
3
- isEnabled: boolean;
4
+ paymentMethod: PaymentMethod;
5
+ isDepositAddressActive: boolean;
4
6
  isAvailableAsPaymentMethod: boolean;
5
7
  swapWillGenerateDepositAddress: boolean;
6
- enable: () => void;
7
- disable: () => void;
8
- getRouteWithDeposit: import("@tanstack/react-query").UseMutationResult<{
9
- depositAddress: import("@0xsquid/squid-types").ChainflipDepositAddressResponse;
10
- }, unknown, {
8
+ setPaymentMethod: (method: PaymentMethod) => void;
9
+ getRouteWithDeposit: import("@tanstack/react-query").UseMutationResult<void, unknown, {
11
10
  route: RouteResponse["route"];
12
11
  }, unknown>;
13
12
  depositAddress: string | undefined;
14
13
  closeDepositChannel: () => void;
15
- depositData: import("@0xsquid/squid-types").ChainflipDepositAddressResponse | null;
14
+ depositData: import("../store/useDepositAddressStore").DepositData | null;
16
15
  };
@@ -17,4 +17,5 @@ export declare const useBitcoinBalance: ({ userAddress, chain, }: UseBalanceOpti
17
17
  export declare const useSuiBalance: ({ chain, token, userAddress, enabled, refreshIntervalMs, }: UseBalanceOptions) => UseBalanceResult;
18
18
  export declare const useXrplBalance: ({ userAddress, chain, enabled, token, refreshIntervalMs, }: UseBalanceOptions) => UseBalanceResult;
19
19
  export declare const useStellarBalance: ({ userAddress, chain, enabled, token, refreshIntervalMs, }: UseBalanceOptions) => UseBalanceResult;
20
+ export declare const useCantonBalance: ({ chain, token, userAddress, enabled, refreshIntervalMs, }: UseBalanceOptions) => UseBalanceResult;
20
21
  export {};
@@ -18,6 +18,7 @@ export declare const useSolanaNativeBalance: ({ chain, address, }: UseNativeBala
18
18
  export declare const useSuiNativeBalance: ({ address, chain, }: UseNativeBalanceOptions) => UseNativeBalanceResult;
19
19
  export declare const useXrplNativeBalance: ({ address, chain, }: UseNativeBalanceOptions) => UseNativeBalanceResult;
20
20
  export declare const useStellarNativeBalance: ({ address, chain, }: UseNativeBalanceOptions) => UseNativeBalanceResult;
21
+ export declare const useCantonNativeBalance: ({ address, chain, }: UseNativeBalanceOptions) => UseNativeBalanceResult;
21
22
  export declare const useNativeBalance: (chain?: ChainData) => {
22
23
  nativeBalance: Balance | undefined;
23
24
  nativeBalanceFormatted: string | undefined;
@@ -13,4 +13,5 @@ export declare const useSquidTokens: (direction?: SwapDirection) => {
13
13
  suiTokens: Token[];
14
14
  xrplTokens: Token[];
15
15
  stellarTokens: Token[];
16
+ cantonTokens: Token[];
16
17
  };
@@ -0,0 +1,20 @@
1
+ import { RouteResponse } from "@0xsquid/squid-types";
2
+ import { SwapTransactionForStatus } from "../../core/types/transaction";
3
+ interface UseDepositTransactionStatusParams {
4
+ transaction?: SwapTransactionForStatus;
5
+ route?: RouteResponse["route"];
6
+ retry?: number;
7
+ refetchOnWindowFocus?: "always" | boolean;
8
+ enabled?: boolean;
9
+ onReceived?: () => void;
10
+ }
11
+ /**
12
+ * Tracks a deposit address intent before it becomes a persisted swap history item.
13
+ *
14
+ * Once the source deposit is received, it registers the transaction in the transaction
15
+ * and history stores, then signals the view via `onReceived` to navigate.
16
+ */
17
+ export declare const useDepositTransactionStatus: ({ transaction, route, retry, refetchOnWindowFocus, enabled, onReceived, }: UseDepositTransactionStatusParams) => {
18
+ transactionStatusQuery: import("@tanstack/react-query").UseQueryResult<import("@0xsquid/squid-types").StatusResponse, Error>;
19
+ };
20
+ export {};
@@ -0,0 +1,29 @@
1
+ import { StatusResponse } from "@0xsquid/squid-types";
2
+ import { SwapTransactionForStatus, TransactionStatus } from "../../core/types/transaction";
3
+ interface UseSwapStatusQueryParams {
4
+ transaction?: SwapTransactionForStatus;
5
+ retry?: number;
6
+ refetchOnWindowFocus?: "always" | boolean;
7
+ enabled?: boolean;
8
+ /**
9
+ * Fires on every successful status response, with the raw status string.
10
+ * Use for non-terminal transitions (e.g. a deposit being received).
11
+ */
12
+ onStatus?: (params: {
13
+ status: string;
14
+ statusResponse: StatusResponse;
15
+ }) => void;
16
+ /**
17
+ * Fires on terminal status transitions
18
+ */
19
+ onEndStatus?: (params: {
20
+ status: TransactionStatus;
21
+ statusResponse: StatusResponse;
22
+ }) => void;
23
+ onNotFound?: () => void;
24
+ onError?: () => void;
25
+ }
26
+ export declare const useSwapStatusQuery: ({ transaction, retry, refetchOnWindowFocus, enabled, onStatus, onEndStatus, onNotFound, onError, }: UseSwapStatusQueryParams) => {
27
+ transactionStatusQuery: import("@tanstack/react-query").UseQueryResult<StatusResponse, Error>;
28
+ };
29
+ export {};
@@ -21,7 +21,7 @@ export declare const useMultiChainWallet: (chain: ChainData | undefined) => {
21
21
  isInstalled?: (() => boolean) | undefined;
22
22
  skipInstallCheck?: boolean | undefined;
23
23
  rdns?: string | undefined;
24
- url?: string | undefined;
24
+ links?: import("../../core/types/wallet").WalletLinks | undefined;
25
25
  } & {
26
26
  isMultiChain: true;
27
27
  supportedNetworks: import("../../core/types/wallet").NetworkConfig[];
@@ -39,7 +39,7 @@ export declare const useMultiChainWallet: (chain: ChainData | undefined) => {
39
39
  isInstalled?: (() => boolean) | undefined;
40
40
  skipInstallCheck?: boolean | undefined;
41
41
  rdns?: string | undefined;
42
- url?: string | undefined;
42
+ links?: import("../../core/types/wallet").WalletLinks | undefined;
43
43
  } & {
44
44
  isMultiChain?: false | undefined;
45
45
  } & {
@@ -59,17 +59,13 @@ export declare const useMultiChainWallet: (chain: ChainData | undefined) => {
59
59
  isInstalled?: (() => boolean) | undefined;
60
60
  skipInstallCheck?: boolean | undefined;
61
61
  rdns?: string | undefined;
62
- url?: string | undefined;
62
+ links?: import("../../core/types/wallet").WalletLinks | undefined;
63
63
  } & {
64
64
  isMultiChain: true;
65
65
  supportedNetworks: import("../../core/types/wallet").NetworkConfig[];
66
66
  } & {
67
67
  type: ChainType.COSMOS;
68
- connector: () => {
69
- id: string;
70
- name: string;
71
- provider: any;
72
- };
68
+ connector: import("../../core/types/cosmos").CosmosConnector;
73
69
  }) | ({
74
70
  name: string;
75
71
  connectorId: import("../../core/types/wallet").ConnectorID;
@@ -81,23 +77,15 @@ export declare const useMultiChainWallet: (chain: ChainData | undefined) => {
81
77
  isInstalled?: (() => boolean) | undefined;
82
78
  skipInstallCheck?: boolean | undefined;
83
79
  rdns?: string | undefined;
84
- url?: string | undefined;
80
+ links?: import("../../core/types/wallet").WalletLinks | undefined;
85
81
  } & {
86
82
  isMultiChain?: false | undefined;
87
83
  } & {
88
84
  type: ChainType.COSMOS;
89
- connector: () => {
90
- id: string;
91
- name: string;
92
- provider: any;
93
- };
85
+ connector: import("../../core/types/cosmos").CosmosConnector;
94
86
  } & {
95
87
  type: ChainType.COSMOS;
96
- connector: () => {
97
- id: string;
98
- name: string;
99
- provider: any;
100
- };
88
+ connector: import("../../core/types/cosmos").CosmosConnector;
101
89
  }) | ({
102
90
  name: string;
103
91
  connectorId: import("../../core/types/wallet").ConnectorID;
@@ -109,7 +97,7 @@ export declare const useMultiChainWallet: (chain: ChainData | undefined) => {
109
97
  isInstalled?: (() => boolean) | undefined;
110
98
  skipInstallCheck?: boolean | undefined;
111
99
  rdns?: string | undefined;
112
- url?: string | undefined;
100
+ links?: import("../../core/types/wallet").WalletLinks | undefined;
113
101
  } & {
114
102
  isMultiChain: true;
115
103
  supportedNetworks: import("../../core/types/wallet").NetworkConfig[];
@@ -127,7 +115,7 @@ export declare const useMultiChainWallet: (chain: ChainData | undefined) => {
127
115
  isInstalled?: (() => boolean) | undefined;
128
116
  skipInstallCheck?: boolean | undefined;
129
117
  rdns?: string | undefined;
130
- url?: string | undefined;
118
+ links?: import("../../core/types/wallet").WalletLinks | undefined;
131
119
  } & {
132
120
  isMultiChain?: false | undefined;
133
121
  } & {
@@ -147,7 +135,7 @@ export declare const useMultiChainWallet: (chain: ChainData | undefined) => {
147
135
  isInstalled?: (() => boolean) | undefined;
148
136
  skipInstallCheck?: boolean | undefined;
149
137
  rdns?: string | undefined;
150
- url?: string | undefined;
138
+ links?: import("../../core/types/wallet").WalletLinks | undefined;
151
139
  } & {
152
140
  isMultiChain: true;
153
141
  supportedNetworks: import("../../core/types/wallet").NetworkConfig[];
@@ -165,7 +153,7 @@ export declare const useMultiChainWallet: (chain: ChainData | undefined) => {
165
153
  isInstalled?: (() => boolean) | undefined;
166
154
  skipInstallCheck?: boolean | undefined;
167
155
  rdns?: string | undefined;
168
- url?: string | undefined;
156
+ links?: import("../../core/types/wallet").WalletLinks | undefined;
169
157
  } & {
170
158
  isMultiChain?: false | undefined;
171
159
  } & {
@@ -185,7 +173,7 @@ export declare const useMultiChainWallet: (chain: ChainData | undefined) => {
185
173
  isInstalled?: (() => boolean) | undefined;
186
174
  skipInstallCheck?: boolean | undefined;
187
175
  rdns?: string | undefined;
188
- url?: string | undefined;
176
+ links?: import("../../core/types/wallet").WalletLinks | undefined;
189
177
  } & {
190
178
  isMultiChain: true;
191
179
  supportedNetworks: import("../../core/types/wallet").NetworkConfig[];
@@ -203,7 +191,7 @@ export declare const useMultiChainWallet: (chain: ChainData | undefined) => {
203
191
  isInstalled?: (() => boolean) | undefined;
204
192
  skipInstallCheck?: boolean | undefined;
205
193
  rdns?: string | undefined;
206
- url?: string | undefined;
194
+ links?: import("../../core/types/wallet").WalletLinks | undefined;
207
195
  } & {
208
196
  isMultiChain?: false | undefined;
209
197
  } & {
@@ -223,7 +211,7 @@ export declare const useMultiChainWallet: (chain: ChainData | undefined) => {
223
211
  isInstalled?: (() => boolean) | undefined;
224
212
  skipInstallCheck?: boolean | undefined;
225
213
  rdns?: string | undefined;
226
- url?: string | undefined;
214
+ links?: import("../../core/types/wallet").WalletLinks | undefined;
227
215
  } & {
228
216
  isMultiChain: true;
229
217
  supportedNetworks: import("../../core/types/wallet").NetworkConfig[];
@@ -241,7 +229,7 @@ export declare const useMultiChainWallet: (chain: ChainData | undefined) => {
241
229
  isInstalled?: (() => boolean) | undefined;
242
230
  skipInstallCheck?: boolean | undefined;
243
231
  rdns?: string | undefined;
244
- url?: string | undefined;
232
+ links?: import("../../core/types/wallet").WalletLinks | undefined;
245
233
  } & {
246
234
  isMultiChain?: false | undefined;
247
235
  } & {
@@ -261,7 +249,7 @@ export declare const useMultiChainWallet: (chain: ChainData | undefined) => {
261
249
  isInstalled?: (() => boolean) | undefined;
262
250
  skipInstallCheck?: boolean | undefined;
263
251
  rdns?: string | undefined;
264
- url?: string | undefined;
252
+ links?: import("../../core/types/wallet").WalletLinks | undefined;
265
253
  } & {
266
254
  isMultiChain: true;
267
255
  supportedNetworks: import("../../core/types/wallet").NetworkConfig[];
@@ -279,7 +267,7 @@ export declare const useMultiChainWallet: (chain: ChainData | undefined) => {
279
267
  isInstalled?: (() => boolean) | undefined;
280
268
  skipInstallCheck?: boolean | undefined;
281
269
  rdns?: string | undefined;
282
- url?: string | undefined;
270
+ links?: import("../../core/types/wallet").WalletLinks | undefined;
283
271
  } & {
284
272
  isMultiChain?: false | undefined;
285
273
  } & {
@@ -288,5 +276,43 @@ export declare const useMultiChainWallet: (chain: ChainData | undefined) => {
288
276
  } & {
289
277
  type: ChainType.STELLAR;
290
278
  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
+ links?: import("../../core/types/wallet").WalletLinks | 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
+ links?: import("../../core/types/wallet").WalletLinks | 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;
291
317
  }) | undefined;
292
318
  };
@@ -11,4 +11,5 @@ export declare const useSigner: ({ chain }: {
11
11
  suiSigner: import("../../core/types/sui").SuiConnector | undefined;
12
12
  xrplSigner: import("../../core/types/xrpl").XrplConnector | undefined;
13
13
  stellarSigner: import("../../core/types/stellar").StellarConnector | undefined;
14
+ cantonSigner: import("../../core/types/canton").CantonConnector | undefined;
14
15
  };