@0xsquid/react-hooks 8.8.1-beta-canton.4 → 8.8.1-beta-wallet-verification.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 (92) hide show
  1. package/dist/core/client/index.d.ts +0 -1
  2. package/dist/core/connectors/bitcoin/wallets/keplr.d.ts +2 -1
  3. package/dist/core/connectors/bitcoin/wallets/unisat.d.ts +3 -0
  4. package/dist/core/connectors/xrpl/CrossMark.d.ts +12 -0
  5. package/dist/core/connectors/xrpl/Xaman.d.ts +14 -0
  6. package/dist/core/connectors/xrpl/XamanQr.d.ts +20 -0
  7. package/dist/core/connectors/xrpl/XrplMetamaskSnap.d.ts +12 -0
  8. package/dist/core/connectors/xrpl/walletVerification.d.ts +2 -0
  9. package/dist/core/constants.d.ts +0 -2
  10. package/dist/core/types/bitcoin.d.ts +1 -0
  11. package/dist/core/types/config.d.ts +1 -0
  12. package/dist/core/types/event.d.ts +4 -1
  13. package/dist/core/types/index.d.ts +3 -2
  14. package/dist/core/types/solana.d.ts +11 -1
  15. package/dist/core/types/sui.d.ts +2 -1
  16. package/dist/core/types/wallet.d.ts +6 -9
  17. package/dist/core/types/walletVerificationSignature/bitcoin.d.ts +10 -0
  18. package/dist/core/types/walletVerificationSignature/chainTypes.d.ts +19 -0
  19. package/dist/core/types/walletVerificationSignature/cosmos.d.ts +10 -0
  20. package/dist/core/types/walletVerificationSignature/evm.d.ts +10 -0
  21. package/dist/core/types/walletVerificationSignature/index.d.ts +18 -0
  22. package/dist/core/types/walletVerificationSignature/request.d.ts +3 -0
  23. package/dist/core/types/walletVerificationSignature/sharedResult.d.ts +20 -0
  24. package/dist/core/types/walletVerificationSignature/solana.d.ts +10 -0
  25. package/dist/core/types/walletVerificationSignature/stellar.d.ts +10 -0
  26. package/dist/core/types/walletVerificationSignature/sui.d.ts +10 -0
  27. package/dist/core/types/walletVerificationSignature/types.d.ts +69 -0
  28. package/dist/core/types/walletVerificationSignature/xrpl.d.ts +12 -0
  29. package/dist/core/types/walletVerificationSignature.d.ts +1 -0
  30. package/dist/core/types/xrpl.d.ts +14 -0
  31. package/dist/hooks/chains/useSquidChains.d.ts +0 -1
  32. package/dist/hooks/index.d.ts +1 -1
  33. package/dist/hooks/store/useDepositAddressStore.d.ts +5 -23
  34. package/dist/hooks/store/useWalletStore.d.ts +1 -0
  35. package/dist/hooks/swap/useDepositAddress.d.ts +7 -6
  36. package/dist/hooks/tokens/useSquidTokens.d.ts +0 -1
  37. package/dist/hooks/wallet/useMultiChainWallet.d.ts +18 -44
  38. package/dist/hooks/wallet/useSigner.d.ts +1 -1
  39. package/dist/hooks/wallet/useWallet.d.ts +18 -48
  40. package/dist/hooks/wallet/useWalletVerificationSignature.d.ts +22 -0
  41. package/dist/hooks/wallet/useWalletVerificationSignature.test.d.ts +1 -0
  42. package/dist/hooks/wallet/walletVerification/signers/bitcoin.d.ts +2 -0
  43. package/dist/hooks/wallet/walletVerification/signers/cosmos.d.ts +2 -0
  44. package/dist/hooks/wallet/walletVerification/signers/evm.d.ts +2 -0
  45. package/dist/hooks/wallet/walletVerification/signers/index.d.ts +3 -0
  46. package/dist/hooks/wallet/walletVerification/signers/solana.d.ts +2 -0
  47. package/dist/hooks/wallet/walletVerification/signers/stellar.d.ts +2 -0
  48. package/dist/hooks/wallet/walletVerification/signers/sui.d.ts +2 -0
  49. package/dist/hooks/wallet/walletVerification/signers/types.d.ts +33 -0
  50. package/dist/hooks/wallet/walletVerification/signers/xrpl.d.ts +2 -0
  51. package/dist/{index-D5QOR7JT.js → index-CtXS5uny.js} +1424 -560
  52. package/dist/index-CtXS5uny.js.map +1 -0
  53. package/dist/{index-mgE1SeE-.js → index-z1nGQX9p.js} +1440 -560
  54. package/dist/index-z1nGQX9p.js.map +1 -0
  55. package/dist/{index.es-Cq4mUT_n.js → index.es-CBWh71yD.js} +2 -2
  56. package/dist/{index.es-Cq4mUT_n.js.map → index.es-CBWh71yD.js.map} +1 -1
  57. package/dist/{index.es-3JPbTFKq.js → index.es-D8CAnRf1.js} +2 -2
  58. package/dist/{index.es-3JPbTFKq.js.map → index.es-D8CAnRf1.js.map} +1 -1
  59. package/dist/index.esm.js +1 -1
  60. package/dist/index.js +30 -6
  61. package/dist/index.js.map +1 -1
  62. package/dist/{secretService-DOOg6zVn.js → secretService-B2i6U8uo.js} +2 -2
  63. package/dist/{secretService-DOOg6zVn.js.map → secretService-B2i6U8uo.js.map} +1 -1
  64. package/dist/{secretService-DWq78rM5.js → secretService-BFehLMb_.js} +2 -2
  65. package/dist/{secretService-DWq78rM5.js.map → secretService-BFehLMb_.js.map} +1 -1
  66. package/dist/server.d.ts +1 -1
  67. package/dist/server.esm.js +1 -8
  68. package/dist/server.esm.js.map +1 -1
  69. package/dist/server.js +0 -8
  70. package/dist/server.js.map +1 -1
  71. package/dist/services/external/index.d.ts +1 -1
  72. package/dist/services/external/xaman.d.ts +31 -11
  73. package/dist/services/external/xaman.test.d.ts +1 -0
  74. package/dist/services/index.d.ts +2 -0
  75. package/dist/services/internal/assetsService.d.ts +1 -10
  76. package/dist/services/internal/encodingService.d.ts +8 -0
  77. package/dist/services/internal/encodingService.test.d.ts +1 -0
  78. package/dist/services/internal/eventService.d.ts +3 -3
  79. package/dist/services/internal/evmService.d.ts +1 -0
  80. package/dist/services/internal/transactionService.d.ts +1 -5
  81. package/dist/{stellarService.client-C-pOt34O.js → stellarService.client-D20h9JPG.js} +2 -2
  82. package/dist/{stellarService.client-C-pOt34O.js.map → stellarService.client-D20h9JPG.js.map} +1 -1
  83. package/dist/{stellarService.client-DBROJ4yf.js → stellarService.client-yWCDuq6S.js} +2 -2
  84. package/dist/{stellarService.client-DBROJ4yf.js.map → stellarService.client-yWCDuq6S.js.map} +1 -1
  85. package/package.json +2 -2
  86. package/dist/core/types/canton.d.ts +0 -2
  87. package/dist/core/types/cosmos.d.ts +0 -5
  88. package/dist/hooks/transaction/useDepositTransactionStatus.d.ts +0 -25
  89. package/dist/hooks/transaction/useSwapStatusQuery.d.ts +0 -26
  90. package/dist/index-D5QOR7JT.js.map +0 -1
  91. package/dist/index-mgE1SeE-.js.map +0 -1
  92. 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 {};
@@ -1,4 +1,4 @@
1
- import type { IBitcoinProvider as KeplrBitcoinProvider } from "@keplr-wallet/types";
1
+ import { type IBitcoinProvider as KeplrBitcoinProvider } from "@keplr-wallet/types";
2
2
  import { BitcoinConnector } from "../../../../core/types/bitcoin";
3
3
  export declare class KeplrConnector implements BitcoinConnector {
4
4
  get getProvider(): KeplrBitcoinProvider;
@@ -8,4 +8,5 @@ export declare class KeplrConnector implements BitcoinConnector {
8
8
  requestAccount(): Promise<{
9
9
  address: string;
10
10
  }>;
11
+ signMessage(message: string): Promise<string>;
11
12
  }
@@ -1,7 +1,9 @@
1
1
  import { BitcoinConnector } from "../../../../core/types/bitcoin";
2
+ declare const UNISAT_BIP322_SIMPLE_SIGNATURE_TYPE: "bip322-simple";
2
3
  interface UnisatProvider {
3
4
  sendBitcoin: (to: string, amount: number) => Promise<string>;
4
5
  requestAccounts: () => Promise<string[]>;
6
+ signMessage?: (message: string, type?: typeof UNISAT_BIP322_SIMPLE_SIGNATURE_TYPE) => Promise<string>;
5
7
  }
6
8
  export declare class UnisatConnector implements BitcoinConnector {
7
9
  get getProvider(): UnisatProvider;
@@ -11,5 +13,6 @@ export declare class UnisatConnector implements BitcoinConnector {
11
13
  requestAccount(): Promise<{
12
14
  address: string;
13
15
  }>;
16
+ signMessage(message: string): Promise<string>;
14
17
  }
15
18
  export {};
@@ -1,3 +1,4 @@
1
+ import { WalletVerificationSignatureType } from "../../types/walletVerificationSignature";
1
2
  import { XrplConnector, XrplNetwork, XrplTransaction } from "../../types/xrpl";
2
3
  export declare class CrossmarkConnector implements XrplConnector {
3
4
  private getProvider;
@@ -9,5 +10,16 @@ export declare class CrossmarkConnector implements XrplConnector {
9
10
  hash: string;
10
11
  status: string;
11
12
  }>;
13
+ signOwnershipMessage({ address, message, }: {
14
+ address: string;
15
+ message: string;
16
+ }): Promise<{
17
+ signedPayload: string;
18
+ signedPayloadEncoding: "utf8-hex";
19
+ signature: string;
20
+ publicKey: string;
21
+ publicKeyEncoding: "hex";
22
+ signatureType: WalletVerificationSignatureType.XRPL;
23
+ }>;
12
24
  private getActiveNetwork;
13
25
  }
@@ -1,9 +1,11 @@
1
1
  import type { Xumm } from "xumm";
2
+ import { WalletVerificationSignatureType } from "../../types/walletVerificationSignature";
2
3
  import { XrplConnector, XrplNetwork, XrplTransaction } from "../../types/xrpl";
3
4
  export declare class XamanConnector implements XrplConnector {
4
5
  xumm: Xumm | null;
5
6
  private validateXummInitialized;
6
7
  private initializeXumm;
8
+ private runPayloadFlow;
7
9
  connect(): Promise<string>;
8
10
  signAndSubmit({ network, tx, }: {
9
11
  tx: XrplTransaction;
@@ -12,4 +14,16 @@ export declare class XamanConnector implements XrplConnector {
12
14
  hash: string;
13
15
  status: string;
14
16
  }>;
17
+ signOwnershipMessage({ address, message, }: {
18
+ address: string;
19
+ message: string;
20
+ }): Promise<{
21
+ signedPayload: string;
22
+ signedPayloadEncoding: "utf8-hex" | "xrpl-tx-hex";
23
+ signature?: string | undefined;
24
+ publicKey?: string | undefined;
25
+ publicKeyEncoding?: "hex" | undefined;
26
+ signatureType: WalletVerificationSignatureType.XRPL | WalletVerificationSignatureType.XAMAN;
27
+ signerAddress?: string | undefined;
28
+ }>;
15
29
  }
@@ -1,9 +1,17 @@
1
+ import { XamanClient } from "../../../services/external/xaman";
2
+ import { WalletVerificationSignatureType } from "../../types/walletVerificationSignature";
1
3
  import { XrplConnector, XrplNetwork, XrplTransaction } from "../../types/xrpl";
2
4
  export declare class XamanQrConnector implements XrplConnector {
5
+ private readonly xamanClient;
3
6
  cancelConnectQr: (() => void) | null;
4
7
  cancelSignAndSubmitQr: (() => void) | null;
8
+ cancelSignOwnershipQr: (() => void) | null;
9
+ constructor(xamanClient?: XamanClient);
5
10
  cancelConnect(): void;
6
11
  cancelSignAndSubmit(): void;
12
+ cancelSignOwnershipMessage(): void;
13
+ private getPayloadId;
14
+ private runQrFlow;
7
15
  connect(): Promise<string>;
8
16
  signAndSubmit({ tx, network, }: {
9
17
  tx: XrplTransaction;
@@ -12,4 +20,16 @@ export declare class XamanQrConnector implements XrplConnector {
12
20
  hash: string;
13
21
  status: string;
14
22
  }>;
23
+ signOwnershipMessage({ address, message, }: {
24
+ address: string;
25
+ message: string;
26
+ }): Promise<{
27
+ signedPayload: string;
28
+ signedPayloadEncoding: "utf8-hex" | "xrpl-tx-hex";
29
+ signature?: string | undefined;
30
+ publicKey?: string | undefined;
31
+ publicKeyEncoding?: "hex" | undefined;
32
+ signatureType: WalletVerificationSignatureType.XRPL | WalletVerificationSignatureType.XAMAN;
33
+ signerAddress?: string | undefined;
34
+ }>;
15
35
  }
@@ -1,4 +1,5 @@
1
1
  import type { EIP6963AnnounceProviderEvent, EIP6963RequestProviderEvent } from "@metamask/providers";
2
+ import { WalletVerificationSignatureType } from "../../types/walletVerificationSignature";
2
3
  import { XrplConnector, XrplNetwork, XrplTransaction } from "../../types/xrpl";
3
4
  declare enum EIP6963EventNames {
4
5
  Announce = "eip6963:announceProvider",
@@ -20,6 +21,17 @@ export declare class XrplMetamaskSnapConnector implements XrplConnector {
20
21
  hash: string;
21
22
  status: string;
22
23
  }>;
24
+ signOwnershipMessage({ address, message, }: {
25
+ address: string;
26
+ message: string;
27
+ }): Promise<{
28
+ signedPayload: string;
29
+ signedPayloadEncoding: "utf8-hex";
30
+ signature: string;
31
+ publicKey: string;
32
+ publicKeyEncoding: "hex";
33
+ signatureType: WalletVerificationSignatureType.XRPL;
34
+ }>;
23
35
  private initialize;
24
36
  private requestSnap;
25
37
  private getAccount;
@@ -0,0 +1,2 @@
1
+ import { WalletVerificationSignatureError } from "../../types/walletVerificationSignature";
2
+ export declare function createXrplActiveAccountMismatchError(walletName: string): WalletVerificationSignatureError;
@@ -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>;
@@ -5,4 +5,5 @@ export interface BitcoinConnector {
5
5
  requestAccount(): Promise<{
6
6
  address: string;
7
7
  }>;
8
+ signMessage?: (message: string) => Promise<string>;
8
9
  }
@@ -19,6 +19,7 @@ export interface AppConfig {
19
19
  */
20
20
  loadPreviousStateFromLocalStorage?: boolean;
21
21
  apiUrl?: string;
22
+ xamanApiUrl?: string;
22
23
  priceImpactWarnings?: {
23
24
  warning: number;
24
25
  critical: number;
@@ -17,6 +17,9 @@ export interface QrCodeData {
17
17
  matrix: Array<Array<boolean>>;
18
18
  deepLinkUrl: string;
19
19
  }
20
+ export type QrScannedAwaitingUserApprovalData = {
21
+ flow: "connect" | "sign";
22
+ };
20
23
  export type SwapEventPayload = BaseSwapEventParams & {
21
24
  quoteId: string;
22
25
  txHash: string;
@@ -86,7 +89,7 @@ export interface WidgetEventMap {
86
89
  qrCodeGeneratedForConnect: QrCodeData;
87
90
  qrCodeGeneratedForSign: QrCodeData;
88
91
  qrCodeGenerationFailedForSign: undefined;
89
- qrTxScannedAwaitingUserApproval: undefined;
92
+ qrScannedAwaitingUserApproval: QrScannedAwaitingUserApprovalData;
90
93
  }
91
94
  export type EventListenerFunction<T extends keyof WidgetEventMap> = (event: CustomEvent<WidgetEventMap[T]>) => void;
92
95
  export {};
@@ -1,10 +1,11 @@
1
1
  export type { AppConfig } from "./config";
2
2
  export { SquidStatusErrorType, TransactionErrorType, type SquidRouteError, type SquidRouteErrorType, type SquidStatusError, } from "./error";
3
- export type { QrCodeData } from "./event";
3
+ export type { QrCodeData, QrScannedAwaitingUserApprovalData } from "./event";
4
4
  export * from "./history";
5
5
  export type * from "./onramps/";
6
6
  export type { SwapParams } from "./swap";
7
7
  export type { Chain, Token, TrustLineAsset } from "./tokens";
8
8
  export { AxelarStatusResponseType, SendTransactionStatus, TransactionStatus, type PatchedRouteActionResponse, type TransactionParams, } from "./transaction";
9
- export type { AddressWithEns, BitcoinWallet, ConnectorID, CosmosWallet, EnsData, EnsSearchResult, FullAddressData, NetworkConfig, SolanaWallet, SupportedChain, Wallet, } from "./wallet";
9
+ export type { AddressWithEns, BitcoinWallet, ConnectorID, CosmosWallet, EnsData, EnsSearchResult, FullAddressData, NetworkConfig, SolanaWallet, SupportedChain, SuiWallet, Wallet, } from "./wallet";
10
+ export * from "./walletVerificationSignature";
10
11
  export { XamanXrplNetwork } from "./xrpl";
@@ -1,2 +1,12 @@
1
+ import type { SolanaSignMessageMethod } from "@solana/wallet-standard-features";
1
2
  import type { StandardWalletAdapter } from "@solana/wallet-standard-wallet-adapter-base";
2
- export type SolanaConnector = StandardWalletAdapter;
3
+ import type { Wallet as StandardWallet } from "@wallet-standard/core";
4
+ export type SolanaConnector = StandardWalletAdapter & {
5
+ wallet: StandardWallet & {
6
+ features: StandardWallet["features"] & {
7
+ "solana:signMessage"?: {
8
+ signMessage: SolanaSignMessageMethod;
9
+ };
10
+ };
11
+ };
12
+ };
@@ -1,4 +1,4 @@
1
- import type { StandardConnectInput, StandardEventsOnMethod, SuiSignTransactionMethod, WalletAccount as SuiWalletAccount } from "@mysten/wallet-standard";
1
+ import type { StandardConnectInput, StandardEventsOnMethod, SuiSignPersonalMessageMethod, SuiSignTransactionMethod, WalletAccount as SuiWalletAccount } from "@mysten/wallet-standard";
2
2
  export interface SuiAccount {
3
3
  account: SuiWalletAccount;
4
4
  }
@@ -6,6 +6,7 @@ export type SuiConnector = {
6
6
  connect: (params?: StandardConnectInput) => Promise<SuiAccount>;
7
7
  on: StandardEventsOnMethod;
8
8
  disconnect: () => Promise<void>;
9
+ signPersonalMessage?: SuiSignPersonalMessageMethod;
9
10
  signTransaction: SuiSignTransactionMethod;
10
11
  };
11
12
  export interface SuiCoinBalance {
@@ -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 {};
@@ -0,0 +1,10 @@
1
+ import { ChainType } from "@0xsquid/squid-types";
2
+ import { WalletVerificationSignatureType } from "./chainTypes";
3
+ import type { BaseWalletVerificationSignatureResult, BuildDetachedSignedPayloadWalletVerificationSignatureResultParams } from "./types";
4
+ export type BitcoinWalletVerificationSignatureResult = BaseWalletVerificationSignatureResult & {
5
+ chainType: ChainType.BTC;
6
+ signedPayload: string;
7
+ signature: string;
8
+ signatureType: WalletVerificationSignatureType.BITCOIN;
9
+ };
10
+ export declare const buildBitcoinWalletVerificationSignatureResult: (params: BuildDetachedSignedPayloadWalletVerificationSignatureResultParams) => BitcoinWalletVerificationSignatureResult;
@@ -0,0 +1,19 @@
1
+ export declare enum WalletVerificationSignatureType {
2
+ EVM = "eip191",
3
+ COSMOS = "cosmos-adr36",
4
+ BITCOIN = "bitcoin-bip322-simple",
5
+ SOLANA = "solana-ed25519",
6
+ SUI = "sui-personal-message",
7
+ XRPL = "xrpl-signin",
8
+ XAMAN = "xaman-signin",
9
+ STELLAR = "stellar-sep53"
10
+ }
11
+ export declare const WALLET_VERIFICATION_SIGNATURE_TYPE_BY_CHAIN_TYPE: {
12
+ readonly evm: WalletVerificationSignatureType.EVM;
13
+ readonly cosmos: WalletVerificationSignatureType.COSMOS;
14
+ readonly bitcoin: WalletVerificationSignatureType.BITCOIN;
15
+ readonly solana: WalletVerificationSignatureType.SOLANA;
16
+ readonly sui: WalletVerificationSignatureType.SUI;
17
+ readonly xrpl: WalletVerificationSignatureType.XRPL;
18
+ readonly stellar: WalletVerificationSignatureType.STELLAR;
19
+ };
@@ -0,0 +1,10 @@
1
+ import { ChainType } from "@0xsquid/squid-types";
2
+ import { WalletVerificationSignatureType } from "./chainTypes";
3
+ import type { BaseWalletVerificationSignatureResult, BuildDetachedSignedPayloadWalletVerificationSignatureResultParams } from "./types";
4
+ export type CosmosWalletVerificationSignatureResult = BaseWalletVerificationSignatureResult & {
5
+ chainType: ChainType.COSMOS;
6
+ signedPayload: string;
7
+ signature: string;
8
+ signatureType: WalletVerificationSignatureType.COSMOS;
9
+ };
10
+ export declare const buildCosmosWalletVerificationSignatureResult: (params: BuildDetachedSignedPayloadWalletVerificationSignatureResultParams) => CosmosWalletVerificationSignatureResult;
@@ -0,0 +1,10 @@
1
+ import { ChainType } from "@0xsquid/squid-types";
2
+ import { WalletVerificationSignatureType } from "./chainTypes";
3
+ import type { BaseWalletVerificationSignatureResult, BuildSignatureOnlyWalletVerificationSignatureResultParams } from "./types";
4
+ export type EvmWalletVerificationSignatureResult = BaseWalletVerificationSignatureResult & {
5
+ chainType: ChainType.EVM;
6
+ signedPayload: string;
7
+ signature: string;
8
+ signatureType: WalletVerificationSignatureType.EVM;
9
+ };
10
+ export declare const buildWalletVerificationSignatureResult: ({ address, message, signature, }: BuildSignatureOnlyWalletVerificationSignatureResultParams) => EvmWalletVerificationSignatureResult;
@@ -0,0 +1,18 @@
1
+ export * from "./bitcoin";
2
+ export * from "./chainTypes";
3
+ export * from "./cosmos";
4
+ export * from "./evm";
5
+ export * from "./request";
6
+ export * from "./solana";
7
+ export * from "./stellar";
8
+ export * from "./sui";
9
+ export * from "./types";
10
+ export * from "./xrpl";
11
+ import type { BitcoinWalletVerificationSignatureResult } from "./bitcoin";
12
+ import type { CosmosWalletVerificationSignatureResult } from "./cosmos";
13
+ import type { EvmWalletVerificationSignatureResult } from "./evm";
14
+ import type { SolanaWalletVerificationSignatureResult } from "./solana";
15
+ import type { StellarWalletVerificationSignatureResult } from "./stellar";
16
+ import type { SuiWalletVerificationSignatureResult } from "./sui";
17
+ import type { XrplWalletVerificationSignatureResult } from "./xrpl";
18
+ export type WalletVerificationSignatureResult = EvmWalletVerificationSignatureResult | CosmosWalletVerificationSignatureResult | BitcoinWalletVerificationSignatureResult | SolanaWalletVerificationSignatureResult | SuiWalletVerificationSignatureResult | XrplWalletVerificationSignatureResult | StellarWalletVerificationSignatureResult;
@@ -0,0 +1,3 @@
1
+ import { type WalletVerificationSignatureRequest } from "./types";
2
+ export declare const assertWalletVerificationSigningRequest: ({ message, chainType, }: WalletVerificationSignatureRequest) => void;
3
+ export declare const assertEvmVerificationSigningRequest: ({ message, chainType, }: WalletVerificationSignatureRequest) => void;
@@ -0,0 +1,20 @@
1
+ import { ChainType } from "@0xsquid/squid-types";
2
+ import type { BaseWalletVerificationSignatureResult, BuildSignatureOnlyWalletVerificationSignatureResultParams, BuildSignedPayloadWalletVerificationSignatureResultParams } from "./types";
3
+ import { WalletVerificationSignatureType } from "./chainTypes";
4
+ export declare function buildSignatureOnlyWalletVerificationSignatureResult<TChainType extends ChainType, TSignatureType extends WalletVerificationSignatureType>({ chainType, signatureType, address, message, signature, }: BuildSignatureOnlyWalletVerificationSignatureResultParams & {
5
+ chainType: TChainType;
6
+ signatureType: TSignatureType;
7
+ }): BaseWalletVerificationSignatureResult & {
8
+ chainType: TChainType;
9
+ signedPayload: string;
10
+ signature: string;
11
+ signatureType: TSignatureType;
12
+ };
13
+ export declare function buildSignedPayloadWalletVerificationSignatureResult<TChainType extends ChainType, TSignatureType extends WalletVerificationSignatureType>({ chainType, signatureType, address, message, signedPayload, signature, publicKey, publicKeyEncoding, signedPayloadEncoding, signerAddress, }: BuildSignedPayloadWalletVerificationSignatureResultParams & {
14
+ chainType: TChainType;
15
+ signatureType: TSignatureType;
16
+ }): BaseWalletVerificationSignatureResult & {
17
+ chainType: TChainType;
18
+ signedPayload: string;
19
+ signatureType: TSignatureType;
20
+ };
@@ -0,0 +1,10 @@
1
+ import { ChainType } from "@0xsquid/squid-types";
2
+ import { WalletVerificationSignatureType } from "./chainTypes";
3
+ import type { BaseWalletVerificationSignatureResult, BuildDetachedSignedPayloadWalletVerificationSignatureResultParams } from "./types";
4
+ export type SolanaWalletVerificationSignatureResult = BaseWalletVerificationSignatureResult & {
5
+ chainType: ChainType.SOLANA;
6
+ signedPayload: string;
7
+ signature: string;
8
+ signatureType: WalletVerificationSignatureType.SOLANA;
9
+ };
10
+ export declare const buildSolanaWalletVerificationSignatureResult: ({ address, message, signedPayload, signature, publicKey, publicKeyEncoding, signedPayloadEncoding, }: BuildDetachedSignedPayloadWalletVerificationSignatureResultParams) => SolanaWalletVerificationSignatureResult;
@@ -0,0 +1,10 @@
1
+ import { ChainType } from "@0xsquid/squid-types";
2
+ import { WalletVerificationSignatureType } from "./chainTypes";
3
+ import type { BaseWalletVerificationSignatureResult, BuildDetachedSignedPayloadWalletVerificationSignatureResultParams } from "./types";
4
+ export type StellarWalletVerificationSignatureResult = BaseWalletVerificationSignatureResult & {
5
+ chainType: ChainType.STELLAR;
6
+ signedPayload: string;
7
+ signature: string;
8
+ signatureType: WalletVerificationSignatureType.STELLAR;
9
+ };
10
+ export declare const buildStellarWalletVerificationSignatureResult: (params: BuildDetachedSignedPayloadWalletVerificationSignatureResultParams) => StellarWalletVerificationSignatureResult;
@@ -0,0 +1,10 @@
1
+ import { ChainType } from "@0xsquid/squid-types";
2
+ import { WalletVerificationSignatureType } from "./chainTypes";
3
+ import type { BaseWalletVerificationSignatureResult, BuildDetachedSignedPayloadWalletVerificationSignatureResultParams } from "./types";
4
+ export type SuiWalletVerificationSignatureResult = BaseWalletVerificationSignatureResult & {
5
+ chainType: ChainType.SUI;
6
+ signedPayload: string;
7
+ signature: string;
8
+ signatureType: WalletVerificationSignatureType.SUI;
9
+ };
10
+ export declare const buildSuiWalletVerificationSignatureResult: ({ address, message, signedPayload, signature, publicKey, publicKeyEncoding, signedPayloadEncoding, }: BuildDetachedSignedPayloadWalletVerificationSignatureResultParams) => SuiWalletVerificationSignatureResult;
@@ -0,0 +1,69 @@
1
+ import { ChainType } from "@0xsquid/squid-types";
2
+ import type { WalletVerificationSignatureType } from "./chainTypes";
3
+ export declare enum WalletVerificationSignatureErrorCode {
4
+ INVALID_MESSAGE = "INVALID_MESSAGE",
5
+ UNSUPPORTED_CHAIN_TYPE = "UNSUPPORTED_CHAIN_TYPE",
6
+ WALLET_NOT_CONNECTED = "WALLET_NOT_CONNECTED",
7
+ SIGNER_UNAVAILABLE = "SIGNER_UNAVAILABLE",
8
+ ACTIVE_ACCOUNT_MISMATCH = "ACTIVE_ACCOUNT_MISMATCH",
9
+ SIGNATURE_REJECTED = "SIGNATURE_REJECTED"
10
+ }
11
+ export declare class WalletVerificationSignatureError extends Error {
12
+ code: WalletVerificationSignatureErrorCode;
13
+ chainType?: ChainType;
14
+ cause?: unknown;
15
+ constructor({ code, message, chainType, cause, }: {
16
+ code: WalletVerificationSignatureErrorCode;
17
+ message: string;
18
+ chainType?: ChainType;
19
+ cause?: unknown;
20
+ });
21
+ }
22
+ export type WalletVerificationSignatureRequest = {
23
+ message: string;
24
+ } & ({
25
+ chainType: ChainType.COSMOS;
26
+ chainId: string;
27
+ networkPassphrase?: never;
28
+ } | {
29
+ chainType: ChainType.STELLAR;
30
+ chainId?: never;
31
+ networkPassphrase?: string;
32
+ } | {
33
+ chainType: ChainType.EVM | ChainType.BTC | ChainType.SOLANA | ChainType.SUI | ChainType.XRPL;
34
+ chainId?: never;
35
+ networkPassphrase?: never;
36
+ });
37
+ export type WalletVerificationSignatureMetadata = {
38
+ publicKey?: string;
39
+ publicKeyEncoding?: "base32" | "base58" | "base64" | "hex";
40
+ signedPayloadEncoding?: "base64" | "utf8-hex" | "xrpl-tx-hex";
41
+ signerAddress?: string;
42
+ };
43
+ export type BaseWalletVerificationSignatureResult = {
44
+ chainType: ChainType;
45
+ address: string;
46
+ message: string;
47
+ signedPayload: string;
48
+ signature?: string;
49
+ signatureType: WalletVerificationSignatureType;
50
+ metadata: WalletVerificationSignatureMetadata;
51
+ };
52
+ export type BuildSignatureOnlyWalletVerificationSignatureResultParams = {
53
+ address: string;
54
+ message: string;
55
+ signature: string;
56
+ };
57
+ export type BuildSignedPayloadWalletVerificationSignatureResultParams = {
58
+ address: string;
59
+ message: string;
60
+ signedPayload: string;
61
+ signature?: string;
62
+ publicKey?: string;
63
+ publicKeyEncoding?: "base32" | "base58" | "base64" | "hex";
64
+ signedPayloadEncoding: "base64" | "utf8-hex" | "xrpl-tx-hex";
65
+ signerAddress?: string;
66
+ };
67
+ export type BuildDetachedSignedPayloadWalletVerificationSignatureResultParams = BuildSignedPayloadWalletVerificationSignatureResultParams & {
68
+ signature: string;
69
+ };
@@ -0,0 +1,12 @@
1
+ import { ChainType } from "@0xsquid/squid-types";
2
+ import { WalletVerificationSignatureType } from "./chainTypes";
3
+ import type { BaseWalletVerificationSignatureResult, BuildSignedPayloadWalletVerificationSignatureResultParams } from "./types";
4
+ export type XrplWalletVerificationSignatureResult = BaseWalletVerificationSignatureResult & {
5
+ chainType: ChainType.XRPL;
6
+ signedPayload: string;
7
+ signatureType: WalletVerificationSignatureType.XRPL | WalletVerificationSignatureType.XAMAN;
8
+ };
9
+ export type BuildXrplWalletVerificationSignatureResultParams = BuildSignedPayloadWalletVerificationSignatureResultParams & {
10
+ signatureType: XrplWalletVerificationSignatureResult["signatureType"];
11
+ };
12
+ export declare const buildXrplWalletVerificationSignatureResult: (params: BuildXrplWalletVerificationSignatureResultParams) => XrplWalletVerificationSignatureResult;
@@ -0,0 +1 @@
1
+ export * from "./walletVerificationSignature/index";
@@ -1,3 +1,4 @@
1
+ import { WalletVerificationSignatureType } from "./walletVerificationSignature";
1
2
  interface IssuedCurrencyAmount {
2
3
  currency: string;
3
4
  issuer: string;
@@ -49,6 +50,19 @@ export type XrplEvents = {
49
50
  export type XrplConnectorOnMethod = <E extends keyof XrplEvents>(event: E, listener: (event: XrplEvents[E]) => void) => () => void;
50
51
  export interface XrplConnector {
51
52
  connect: () => Promise<string>;
53
+ signOwnershipMessage?: (_: {
54
+ message: string;
55
+ address: string;
56
+ }) => Promise<{
57
+ signedPayload: string;
58
+ signedPayloadEncoding: "utf8-hex" | "xrpl-tx-hex";
59
+ signature?: string;
60
+ publicKey?: string;
61
+ publicKeyEncoding?: "hex";
62
+ signatureType: WalletVerificationSignatureType.XRPL | WalletVerificationSignatureType.XAMAN;
63
+ signerAddress?: string;
64
+ }>;
65
+ cancelSignOwnershipMessage?: () => void;
52
66
  signAndSubmit: (_: {
53
67
  tx: XrplTransaction;
54
68
  network: XrplNetwork;
@@ -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";
@@ -56,5 +55,6 @@ export { useIntegratorContext } from "./wallet/useIntegratorContext";
56
55
  export { useMultiChainWallet } from "./wallet/useMultiChainWallet";
57
56
  export { useSigner } from "./wallet/useSigner";
58
57
  export { useWallet } from "./wallet/useWallet";
58
+ export { WalletVerificationSignatureError, WalletVerificationSignatureErrorCode, WalletVerificationSignatureType, buildBitcoinWalletVerificationSignatureResult, buildCosmosWalletVerificationSignatureResult, buildSolanaWalletVerificationSignatureResult, buildStellarWalletVerificationSignatureResult, buildSuiWalletVerificationSignatureResult, buildWalletVerificationSignatureResult, buildXrplWalletVerificationSignatureResult, useWalletVerificationSignature, type WalletVerificationSignatureRequest, type WalletVerificationSignatureResult, } from "./wallet/useWalletVerificationSignature";
59
59
  export { useWallets } from "./wallet/useWallets";
60
60
  export { useXrplTrustLine } from "./xrpl/useXrplTrustLine";
@@ -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 {};
@@ -11,6 +11,7 @@ export interface ConnectingWalletState {
11
11
  wallet: Wallet | undefined;
12
12
  status: ConnectingWalletStatus;
13
13
  qrData?: QrCodeData;
14
+ qrScanned?: boolean;
14
15
  }
15
16
  interface WalletStoreState {
16
17
  connectedWalletsByChainType: {