@0xsquid/react-hooks 8.11.0 → 8.11.1-beta-danal.1

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 (40) hide show
  1. package/dist/core/client/index.d.ts +1 -0
  2. package/dist/core/constants.d.ts +2 -0
  3. package/dist/core/types/danal.d.ts +1 -0
  4. package/dist/core/types/wallet.d.ts +7 -0
  5. package/dist/hooks/chains/useSquidChains.d.ts +1 -0
  6. package/dist/hooks/store/useDepositAddressStore.d.ts +6 -0
  7. package/dist/hooks/swap/useDepositAddress.d.ts +2 -0
  8. package/dist/hooks/tokens/useSquidTokens.d.ts +1 -0
  9. package/dist/hooks/wallet/useMultiChainWallet.d.ts +38 -0
  10. package/dist/hooks/wallet/useWallet.d.ts +42 -0
  11. package/dist/{index-BzTFES6t.js → index-BT6G_mgr.js} +143 -18
  12. package/dist/index-BT6G_mgr.js.map +1 -0
  13. package/dist/{index-D5bkikGx.js → index-D6rznmR_.js} +140 -19
  14. package/dist/index-D6rznmR_.js.map +1 -0
  15. package/dist/{index.es-DaKI7v5_.js → index.es-BZb8tg2z.js} +2 -2
  16. package/dist/{index.es-DaKI7v5_.js.map → index.es-BZb8tg2z.js.map} +1 -1
  17. package/dist/{index.es-wL3I3c3h.js → index.es-Dl19u5sy.js} +2 -2
  18. package/dist/{index.es-wL3I3c3h.js.map → index.es-Dl19u5sy.js.map} +1 -1
  19. package/dist/index.esm.js +1 -1
  20. package/dist/index.js +5 -1
  21. package/dist/index.js.map +1 -1
  22. package/dist/{secretService-BMH_eXJd.js → secretService-Dvc9Dg4U.js} +2 -2
  23. package/dist/{secretService-BMH_eXJd.js.map → secretService-Dvc9Dg4U.js.map} +1 -1
  24. package/dist/{secretService-D70MRo5w.js → secretService-TP5V9Jwg.js} +2 -2
  25. package/dist/{secretService-D70MRo5w.js.map → secretService-TP5V9Jwg.js.map} +1 -1
  26. package/dist/server.esm.js +6 -0
  27. package/dist/server.esm.js.map +1 -1
  28. package/dist/server.js +6 -0
  29. package/dist/server.js.map +1 -1
  30. package/dist/services/index.d.ts +1 -0
  31. package/dist/services/internal/danalService.d.ts +8 -0
  32. package/dist/services/internal/transactionService.d.ts +8 -0
  33. package/dist/{stellarService.client-DhwF4F1c.js → stellarService.client-WTkVJJhn.js} +2 -2
  34. package/dist/{stellarService.client-DhwF4F1c.js.map → stellarService.client-WTkVJJhn.js.map} +1 -1
  35. package/dist/{stellarService.client-BpCW1qZY.js → stellarService.client-c48cnGgL.js} +2 -2
  36. package/dist/{stellarService.client-BpCW1qZY.js.map → stellarService.client-c48cnGgL.js.map} +1 -1
  37. package/dist/tests/danalService.test.d.ts +1 -0
  38. package/package.json +2 -2
  39. package/dist/index-BzTFES6t.js.map +0 -1
  40. package/dist/index-D5bkikGx.js.map +0 -1
@@ -14,6 +14,7 @@ type ChainTypeToClient = {
14
14
  [ChainType.XRPL]: XrplRpcClient;
15
15
  [ChainType.STELLAR]: StellarRpcClient;
16
16
  [ChainType.CANTON]: null;
17
+ [ChainType.DANAL]: null;
17
18
  };
18
19
  export declare function getClient<T extends ChainType>(chain: ChainData): Promise<ChainTypeToClient[T]>;
19
20
  export {};
@@ -22,6 +22,7 @@ export declare const nativeSuiTokenAddress = "0x00000000000000000000000000000000
22
22
  export declare const nativeXrplTokenAddress = "xrp";
23
23
  export declare const nativeStellarTokenAddress = "CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA";
24
24
  export declare const nativeCantonTokenAddress = "DSO::1220b1431ef217342db44d516bb9befde802be7d8899637d290895fa58880f19accc";
25
+ export declare const nativeDanalTokenAddress = "pci";
25
26
  export declare const defaultSlippage: SlippageOption;
26
27
  export declare const destinationAddressResetValue = "null";
27
28
  export declare const fallbackAddressResetValue = "null";
@@ -83,6 +84,7 @@ export declare const CHAIN_IDS: {
83
84
  readonly STELLAR: "stellar-mainnet";
84
85
  readonly STELLAR_TESTNET: "stellar-testnet";
85
86
  readonly CANTON: "canton";
87
+ readonly DANAL_TESTNET: "danal-testnet";
86
88
  };
87
89
  export declare const chainTypeToDefaultChainIdMap: Record<ChainType, string>;
88
90
  export declare const chainTypeToNativeTokenAddressMap: Record<ChainType, string>;
@@ -0,0 +1 @@
1
+ export type DanalConnector = null;
@@ -2,6 +2,7 @@ import type { ChainType } from "@0xsquid/squid-types";
2
2
  import { BitcoinConnector } from "./bitcoin";
3
3
  import { CantonConnector } from "./canton";
4
4
  import { CosmosConnector } from "./cosmos";
5
+ import { DanalConnector } from "./danal";
5
6
  import { EvmConnector } from "./evm";
6
7
  import { SolanaConnector } from "./solana";
7
8
  import { StellarConnector } from "./stellar";
@@ -62,6 +63,10 @@ export type CantonWallet = Wallet & {
62
63
  type: ChainType.CANTON;
63
64
  connector: ConnectorByChainType[ChainType.CANTON];
64
65
  };
66
+ export type DanalWallet = Wallet & {
67
+ type: ChainType.DANAL;
68
+ connector: ConnectorByChainType[ChainType.DANAL];
69
+ };
65
70
  export type SupportedChain = {
66
71
  chainType: ChainType;
67
72
  chains?: string[];
@@ -144,6 +149,7 @@ export interface ChainTypeToWalletState {
144
149
  [ChainType.XRPL]: BaseWalletState<XrplWallet>;
145
150
  [ChainType.STELLAR]: BaseWalletState<StellarWallet>;
146
151
  [ChainType.CANTON]: BaseWalletState<CantonWallet>;
152
+ [ChainType.DANAL]: BaseWalletState<DanalWallet>;
147
153
  }
148
154
  interface ConnectorByChainType extends Record<ChainType, unknown> {
149
155
  [ChainType.EVM]: EvmConnector;
@@ -154,5 +160,6 @@ interface ConnectorByChainType extends Record<ChainType, unknown> {
154
160
  [ChainType.XRPL]: XrplConnector;
155
161
  [ChainType.STELLAR]: StellarConnector;
156
162
  [ChainType.CANTON]: CantonConnector;
163
+ [ChainType.DANAL]: DanalConnector;
157
164
  }
158
165
  export {};
@@ -13,6 +13,7 @@ export declare const useSquidChains: (direction?: SwapDirection) => {
13
13
  xrplChains: ChainData[];
14
14
  stellarChains: ChainData[];
15
15
  cantonChains: ChainData[];
16
+ danalChains: ChainData[];
16
17
  getChainType: (chainId?: string) => ChainType | undefined;
17
18
  findChain: (chainId: string | undefined) => ChainData | undefined;
18
19
  };
@@ -15,8 +15,14 @@ export type PaymentMethod = "connectedWallet" | "depositAddress";
15
15
  interface DepositAddressStore {
16
16
  deposit: DepositData | null;
17
17
  selectedPaymentMethod: PaymentMethod;
18
+ /**
19
+ * Deposit transaction hash entered manually by the user, for chains where
20
+ * the app cannot obtain it (e.g. Danal). Used as transactionId for /status
21
+ */
22
+ userDepositTxId: string | null;
18
23
  setDeposit(data: DepositData | null): void;
19
24
  setPaymentMethod(method: PaymentMethod): void;
25
+ setUserDepositTxId(txId: string | null): void;
20
26
  }
21
27
  export declare const useDepositAddressStore: import("zustand").UseBoundStore<import("zustand").StoreApi<DepositAddressStore>>;
22
28
  export {};
@@ -12,4 +12,6 @@ export declare function useDepositAddress(squidRoute?: RouteResponse["route"]):
12
12
  depositAddress: string | undefined;
13
13
  closeDepositChannel: () => void;
14
14
  depositData: import("../store/useDepositAddressStore").DepositData | null;
15
+ userDepositTxId: string | null;
16
+ setUserDepositTxId: (txId: string | null) => void;
15
17
  };
@@ -14,4 +14,5 @@ export declare const useSquidTokens: (direction?: SwapDirection) => {
14
14
  xrplTokens: Token[];
15
15
  stellarTokens: Token[];
16
16
  cantonTokens: Token[];
17
+ danalTokens: Token[];
17
18
  };
@@ -314,5 +314,43 @@ export declare const useMultiChainWallet: (chain: ChainData | undefined) => {
314
314
  } & {
315
315
  type: ChainType.CANTON;
316
316
  connector: import("../../core/types/canton").CantonConnector;
317
+ }) | ({
318
+ name: string;
319
+ connectorId: import("../../core/types/wallet").ConnectorID;
320
+ connectorName: string;
321
+ icon: string | undefined;
322
+ windowFlag: import("../../core/types/wallet").WindowWalletFlag;
323
+ isMobile?: boolean | undefined;
324
+ isQrWallet?: boolean | undefined;
325
+ isInstalled?: (() => boolean) | undefined;
326
+ skipInstallCheck?: boolean | undefined;
327
+ rdns?: string | undefined;
328
+ links?: import("../../core/types/wallet").WalletLinks | undefined;
329
+ } & {
330
+ isMultiChain: true;
331
+ supportedNetworks: import("../../core/types/wallet").NetworkConfig[];
332
+ } & {
333
+ type: ChainType.DANAL;
334
+ connector: null;
335
+ }) | ({
336
+ name: string;
337
+ connectorId: import("../../core/types/wallet").ConnectorID;
338
+ connectorName: string;
339
+ icon: string | undefined;
340
+ windowFlag: import("../../core/types/wallet").WindowWalletFlag;
341
+ isMobile?: boolean | undefined;
342
+ isQrWallet?: boolean | undefined;
343
+ isInstalled?: (() => boolean) | undefined;
344
+ skipInstallCheck?: boolean | undefined;
345
+ rdns?: string | undefined;
346
+ links?: import("../../core/types/wallet").WalletLinks | undefined;
347
+ } & {
348
+ isMultiChain?: false | undefined;
349
+ } & {
350
+ type: ChainType.DANAL;
351
+ connector: null;
352
+ } & {
353
+ type: ChainType.DANAL;
354
+ connector: null;
317
355
  }) | undefined;
318
356
  };
@@ -341,6 +341,48 @@ export declare const useWallet: () => {
341
341
  });
342
342
  address: string;
343
343
  }>;
344
+ danal: Partial<{
345
+ wallet: ({
346
+ name: string;
347
+ connectorId: import("../../core/types/wallet").ConnectorID;
348
+ connectorName: string;
349
+ icon: string | undefined;
350
+ windowFlag: import("../../core/types/wallet").WindowWalletFlag;
351
+ isMobile?: boolean | undefined;
352
+ isQrWallet?: boolean | undefined;
353
+ isInstalled?: (() => boolean) | undefined;
354
+ skipInstallCheck?: boolean | undefined;
355
+ rdns?: string | undefined;
356
+ links?: import("../../core/types/wallet").WalletLinks | undefined;
357
+ } & {
358
+ isMultiChain: true;
359
+ supportedNetworks: import("../../core/types/wallet").NetworkConfig[];
360
+ } & {
361
+ type: ChainType.DANAL;
362
+ connector: null;
363
+ }) | ({
364
+ name: string;
365
+ connectorId: import("../../core/types/wallet").ConnectorID;
366
+ connectorName: string;
367
+ icon: string | undefined;
368
+ windowFlag: import("../../core/types/wallet").WindowWalletFlag;
369
+ isMobile?: boolean | undefined;
370
+ isQrWallet?: boolean | undefined;
371
+ isInstalled?: (() => boolean) | undefined;
372
+ skipInstallCheck?: boolean | undefined;
373
+ rdns?: string | undefined;
374
+ links?: import("../../core/types/wallet").WalletLinks | undefined;
375
+ } & {
376
+ isMultiChain?: false | undefined;
377
+ } & {
378
+ type: ChainType.DANAL;
379
+ connector: null;
380
+ } & {
381
+ type: ChainType.DANAL;
382
+ connector: null;
383
+ });
384
+ address: string;
385
+ }>;
344
386
  };
345
387
  connectedAddresses: Record<ChainType, string | undefined>;
346
388
  connectingWalletState: import("../store/useWalletStore").ConnectingWalletState;