@0xsquid/react-hooks 8.10.0 → 8.11.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.
- package/dist/core/canton/cantonConnector.d.ts +2 -1
- package/dist/core/canton/injectedCantonProvider.d.ts +31 -0
- package/dist/core/connectors/bitcoin/wallets/keplr.d.ts +3 -0
- package/dist/core/connectors/bitcoin/wallets/phantom.d.ts +3 -1
- package/dist/core/connectors/bitcoin/wallets/unisat.d.ts +15 -0
- package/dist/core/index.d.ts +1 -1
- package/dist/core/types/bitcoin.d.ts +3 -0
- package/dist/hooks/canton/useCantonWallets.d.ts +4 -2
- package/dist/{index-Dzir2lUQ.js → index-BzTFES6t.js} +297 -115
- package/dist/index-BzTFES6t.js.map +1 -0
- package/dist/{index-BlB3yIoX.js → index-D5bkikGx.js} +297 -116
- package/dist/index-D5bkikGx.js.map +1 -0
- package/dist/{index.es-BPXYaraD.js → index.es-DaKI7v5_.js} +2 -2
- package/dist/{index.es-BPXYaraD.js.map → index.es-DaKI7v5_.js.map} +1 -1
- package/dist/{index.es-DwtZr7bN.js → index.es-wL3I3c3h.js} +2 -2
- package/dist/{index.es-DwtZr7bN.js.map → index.es-wL3I3c3h.js.map} +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/{secretService-eiBnD7dI.js → secretService-BMH_eXJd.js} +2 -2
- package/dist/{secretService-eiBnD7dI.js.map → secretService-BMH_eXJd.js.map} +1 -1
- package/dist/{secretService-ICina23f.js → secretService-D70MRo5w.js} +2 -2
- package/dist/{secretService-ICina23f.js.map → secretService-D70MRo5w.js.map} +1 -1
- package/dist/services/internal/cantonService.d.ts +17 -1
- package/dist/{stellarService.client-VOmCOPzL.js → stellarService.client-BpCW1qZY.js} +2 -2
- package/dist/{stellarService.client-VOmCOPzL.js.map → stellarService.client-BpCW1qZY.js.map} +1 -1
- package/dist/{stellarService.client-Bjc92sC_.js → stellarService.client-DhwF4F1c.js} +2 -2
- package/dist/{stellarService.client-Bjc92sC_.js.map → stellarService.client-DhwF4F1c.js.map} +1 -1
- package/dist/tests/injectedCantonProvider.test.d.ts +1 -0
- package/package.json +1 -1
- package/dist/index-BlB3yIoX.js.map +0 -1
- package/dist/index-Dzir2lUQ.js.map +0 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type CantonClient } from "@sigilry/dapp";
|
|
1
2
|
import type { CantonAccount, CantonConnectResult, CantonConnector, CantonConnectorEvent, CantonConnectorEventHandler, CantonLedgerApiParams, CantonPrepareExecuteAndWaitResult, CantonPrepareExecuteParams } from "../types/canton";
|
|
2
3
|
import { AnnouncedCantonProvider } from "./cip103Client";
|
|
3
4
|
/**
|
|
@@ -11,7 +12,7 @@ export declare class CantonBrowserConnector implements CantonConnector {
|
|
|
11
12
|
private readonly client;
|
|
12
13
|
private readonly listeners;
|
|
13
14
|
private _accounts;
|
|
14
|
-
constructor(provider: AnnouncedCantonProvider, win?: Window);
|
|
15
|
+
constructor(provider: AnnouncedCantonProvider, win?: Window, client?: CantonClient);
|
|
15
16
|
get accounts(): CantonAccount[];
|
|
16
17
|
get address(): string | undefined;
|
|
17
18
|
connect(): Promise<CantonConnectResult>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { CantonClient, SpliceProvider } from "@sigilry/dapp";
|
|
2
|
+
import type { ConnectorID } from "../types/wallet";
|
|
3
|
+
export interface InjectedCantonWalletConfig {
|
|
4
|
+
connectorId: ConnectorID;
|
|
5
|
+
name: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
/** Dot-path to the injected CIP-103 provider on `window` (e.g. `nightly.canton`). */
|
|
8
|
+
windowPath: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* CIP-103 wallets that expose their provider as an injected `window` global
|
|
12
|
+
* instead of participating in the `canton:announceProvider` discovery protocol.
|
|
13
|
+
* Add an entry to support a new one.
|
|
14
|
+
*/
|
|
15
|
+
export declare const INJECTED_CANTON_WALLETS: InjectedCantonWalletConfig[];
|
|
16
|
+
export interface DiscoveredInjectedCantonWallet {
|
|
17
|
+
config: InjectedCantonWalletConfig;
|
|
18
|
+
provider: SpliceProvider;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Adapts an injected CIP-103 `SpliceProvider` (the normative `request` API) to
|
|
22
|
+
* the {@link CantonClient} surface consumed by `CantonBrowserConnector`, so
|
|
23
|
+
* injected wallets reuse the same connector as announce-discovered ones.
|
|
24
|
+
*/
|
|
25
|
+
export declare function cantonClientFromSpliceProvider(provider: SpliceProvider): CantonClient;
|
|
26
|
+
/**
|
|
27
|
+
* Detect installed injected Canton wallets by walking each registered
|
|
28
|
+
* `windowPath`, mirroring the `definedInWindow` install check used for other
|
|
29
|
+
* non-autodiscovered wallets.
|
|
30
|
+
*/
|
|
31
|
+
export declare function discoverInjectedCantonWallets(win?: Window): DiscoveredInjectedCantonWallet[];
|
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
import { BitcoinConnector } from "../../../../core/types/bitcoin";
|
|
2
|
+
interface UnisatSignPsbtOptions {
|
|
3
|
+
autoFinalized?: boolean;
|
|
4
|
+
toSignInputs?: Array<{
|
|
5
|
+
index: number;
|
|
6
|
+
address?: string;
|
|
7
|
+
publicKey?: string;
|
|
8
|
+
sighashTypes?: number[];
|
|
9
|
+
disableTweakSigner?: boolean;
|
|
10
|
+
}>;
|
|
11
|
+
}
|
|
2
12
|
interface UnisatProvider {
|
|
3
13
|
sendBitcoin: (to: string, amount: number) => Promise<string>;
|
|
4
14
|
requestAccounts: () => Promise<string[]>;
|
|
15
|
+
signPsbt: (psbtHex: string, options?: UnisatSignPsbtOptions) => Promise<string>;
|
|
16
|
+
pushPsbt: (psbtHex: string) => Promise<string>;
|
|
5
17
|
}
|
|
6
18
|
export declare class UnisatConnector implements BitcoinConnector {
|
|
7
19
|
get getProvider(): UnisatProvider;
|
|
@@ -11,5 +23,8 @@ export declare class UnisatConnector implements BitcoinConnector {
|
|
|
11
23
|
requestAccount(): Promise<{
|
|
12
24
|
address: string;
|
|
13
25
|
}>;
|
|
26
|
+
signPsbt(psbtHex: string): Promise<{
|
|
27
|
+
txHash: string;
|
|
28
|
+
}>;
|
|
14
29
|
}
|
|
15
30
|
export {};
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { CHAIN_IDS,
|
|
1
|
+
export { CHAIN_IDS, DEFAULT_LOCALE, DEFAULT_ROUTE_REFETCH_INTERVAL, chainTypeToNativeTokenAddressMap, chainTypeToZeroAddressMap, destinationAddressResetValue, fallbackAddressResetValue, nativeBitcoinTokenAddress, nativeCantonTokenAddress, nativeCosmosTokenAddress, nativeEvmTokenAddress, nativeSolanaTokenAddress, nativeStellarTokenAddress, nativeSuiTokenAddress, nativeXrplTokenAddress, } from "./constants";
|
|
2
2
|
export { CosmosProvider, useCosmosContext } from "./providers/CosmosProvider";
|
|
3
3
|
export { QueryKeys } from "./queries/queries-keys";
|
|
4
4
|
export * from "./types";
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { CantonWallet } from "../../core/types/wallet";
|
|
2
2
|
/**
|
|
3
|
-
* Discovers Canton browser-extension wallets
|
|
4
|
-
* (on mount and on
|
|
3
|
+
* Discovers Canton browser-extension wallets and maps each to a
|
|
4
|
+
* {@link CantonWallet}: CIP-103 announce-protocol wallets (on mount and on
|
|
5
|
+
* window focus), plus injected wallets that ship the CIP-103 RPC surface as a
|
|
6
|
+
* `window` global instead of announcing (see `INJECTED_CANTON_WALLETS`).
|
|
5
7
|
*/
|
|
6
8
|
export declare function useCantonWallets(): {
|
|
7
9
|
wallets: CantonWallet[];
|