@bootnodedev/canton-connect 0.3.1 → 0.4.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/README.md +6 -5
- package/dist/index.d.ts +13 -13
- package/dist/testing/index.d.ts +5 -5
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -44,15 +44,16 @@ switching only once those gaps close. Until then, the machine earns its cost.
|
|
|
44
44
|
|
|
45
45
|
## Status
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
Published to npm as `@bootnodedev/canton-connect`. Also consumed by `dapp/frontend` in this repo,
|
|
48
|
+
which links the local folder while its version satisfies the declared range.
|
|
48
49
|
|
|
49
50
|
## Install
|
|
50
51
|
|
|
51
52
|
Peers a consumer installs beside it: `@canton-network/dapp-sdk`, `@canton-network/core-types`,
|
|
52
|
-
`react` 19 and `@walletconnect/sign-client`. The last is
|
|
53
|
-
it statically at the top of its bundle (checked on 1.5.1), so it has to
|
|
54
|
-
you set `walletConnectProjectId`. Only the session is lazy:
|
|
55
|
-
starts, not at import.
|
|
53
|
+
`react` 19 and `@walletconnect/sign-client`. The last is required here, though `dapp-sdk` marks it
|
|
54
|
+
optional: `dapp-sdk` imports it statically at the top of its bundle (checked on 1.5.1), so it has to
|
|
55
|
+
be present whether or not you set `walletConnectProjectId`. Only the session is lazy:
|
|
56
|
+
`SignClient.init()` runs when a pairing starts, not at import.
|
|
56
57
|
|
|
57
58
|
## Usage
|
|
58
59
|
|
package/dist/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ import { JSX, ReactNode } from "react";
|
|
|
15
15
|
*
|
|
16
16
|
* @category Hooks
|
|
17
17
|
*/
|
|
18
|
-
declare const useCantonConnectContext: () => CantonConnectContextValue;
|
|
18
|
+
export declare const useCantonConnectContext: () => CantonConnectContextValue;
|
|
19
19
|
/**
|
|
20
20
|
* Props for {@link CantonConnectProvider}. `config` is read once, when the connection actor is
|
|
21
21
|
* created: a `walletPicker` or `additionalAdapters` swapped later reaches `config` on the context,
|
|
@@ -43,7 +43,7 @@ interface CantonConnectProviderProps {
|
|
|
43
43
|
*
|
|
44
44
|
* @category Components
|
|
45
45
|
*/
|
|
46
|
-
declare const CantonConnectProvider: ({ config, children }: CantonConnectProviderProps) => JSX.Element;
|
|
46
|
+
export declare const CantonConnectProvider: ({ config, children }: CantonConnectProviderProps) => JSX.Element;
|
|
47
47
|
//#endregion
|
|
48
48
|
//#region src/connectError.d.ts
|
|
49
49
|
/**
|
|
@@ -56,7 +56,7 @@ declare const CantonConnectProvider: ({ config, children }: CantonConnectProvide
|
|
|
56
56
|
*
|
|
57
57
|
* @category Errors
|
|
58
58
|
*/
|
|
59
|
-
declare class ConnectCancelledError extends Error {
|
|
59
|
+
export declare class ConnectCancelledError extends Error {
|
|
60
60
|
constructor(cause?: unknown);
|
|
61
61
|
}
|
|
62
62
|
//#endregion
|
|
@@ -92,7 +92,7 @@ interface UseConnectResult {
|
|
|
92
92
|
*
|
|
93
93
|
* @category Hooks
|
|
94
94
|
*/
|
|
95
|
-
declare const useConnect: () => UseConnectResult;
|
|
95
|
+
export declare const useConnect: () => UseConnectResult;
|
|
96
96
|
//#endregion
|
|
97
97
|
//#region src/hooks/useDisconnect.d.ts
|
|
98
98
|
/**
|
|
@@ -118,7 +118,7 @@ interface UseDisconnectResult {
|
|
|
118
118
|
*
|
|
119
119
|
* @category Hooks
|
|
120
120
|
*/
|
|
121
|
-
declare const useDisconnect: () => UseDisconnectResult;
|
|
121
|
+
export declare const useDisconnect: () => UseDisconnectResult;
|
|
122
122
|
//#endregion
|
|
123
123
|
//#region src/hooks/useExecute.d.ts
|
|
124
124
|
/**
|
|
@@ -150,7 +150,7 @@ interface UseExecuteResult {
|
|
|
150
150
|
*
|
|
151
151
|
* @category Hooks
|
|
152
152
|
*/
|
|
153
|
-
declare const useExecute: () => UseExecuteResult;
|
|
153
|
+
export declare const useExecute: () => UseExecuteResult;
|
|
154
154
|
//#endregion
|
|
155
155
|
//#region src/hooks/useLedger.d.ts
|
|
156
156
|
/**
|
|
@@ -180,7 +180,7 @@ interface UseLedgerResult {
|
|
|
180
180
|
*
|
|
181
181
|
* @category Hooks
|
|
182
182
|
*/
|
|
183
|
-
declare const useLedger: () => UseLedgerResult;
|
|
183
|
+
export declare const useLedger: () => UseLedgerResult;
|
|
184
184
|
//#endregion
|
|
185
185
|
//#region src/hooks/useParty.d.ts
|
|
186
186
|
/**
|
|
@@ -206,7 +206,7 @@ interface UsePartyResult {
|
|
|
206
206
|
*
|
|
207
207
|
* @category Hooks
|
|
208
208
|
*/
|
|
209
|
-
declare const useParty: () => UsePartyResult;
|
|
209
|
+
export declare const useParty: () => UsePartyResult;
|
|
210
210
|
//#endregion
|
|
211
211
|
//#region src/hooks/usePartyType.d.ts
|
|
212
212
|
/**
|
|
@@ -236,7 +236,7 @@ interface UsePartyTypeResult {
|
|
|
236
236
|
*
|
|
237
237
|
* @category Hooks
|
|
238
238
|
*/
|
|
239
|
-
declare const usePartyType: () => UsePartyTypeResult;
|
|
239
|
+
export declare const usePartyType: () => UsePartyTypeResult;
|
|
240
240
|
//#endregion
|
|
241
241
|
//#region src/hooks/useSignMessage.d.ts
|
|
242
242
|
/**
|
|
@@ -264,7 +264,7 @@ interface UseSignMessageResult {
|
|
|
264
264
|
*
|
|
265
265
|
* @category Hooks
|
|
266
266
|
*/
|
|
267
|
-
declare const useSignMessage: () => UseSignMessageResult;
|
|
267
|
+
export declare const useSignMessage: () => UseSignMessageResult;
|
|
268
268
|
//#endregion
|
|
269
269
|
//#region src/hooks/useWalletStatus.d.ts
|
|
270
270
|
/**
|
|
@@ -292,7 +292,7 @@ interface UseWalletStatusResult {
|
|
|
292
292
|
*
|
|
293
293
|
* @category Hooks
|
|
294
294
|
*/
|
|
295
|
-
declare const useWalletStatus: () => UseWalletStatusResult;
|
|
295
|
+
export declare const useWalletStatus: () => UseWalletStatusResult;
|
|
296
296
|
//#endregion
|
|
297
297
|
//#region src/mock/mockAdapter.d.ts
|
|
298
298
|
/**
|
|
@@ -341,6 +341,6 @@ interface MockAdapter extends ProviderAdapter {
|
|
|
341
341
|
*
|
|
342
342
|
* @category Utilities
|
|
343
343
|
*/
|
|
344
|
-
declare const createMockAdapter: (options?: CreateMockAdapterOptions) => MockAdapter;
|
|
344
|
+
export declare const createMockAdapter: (options?: CreateMockAdapterOptions) => MockAdapter;
|
|
345
345
|
//#endregion
|
|
346
|
-
export {
|
|
346
|
+
export type { CantonConnectConfig, CantonConnectContextValue, CantonConnectProviderProps, ConnectionInput, ConnectionStatus, ConnectionSubscription, CreateMockAdapterOptions, InitOptions, LedgerApiParams, MockAccount, MockAdapter, Party, PartyType, PrepareExecuteParams, TxStatusSnapshot, UseConnectResult, UseDisconnectResult, UseExecuteResult, UseLedgerResult, UsePartyResult, UsePartyTypeResult, UseSignMessageResult, UseWalletStatusResult, WalletSdk };
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ import { JSX, ReactNode } from "react";
|
|
|
14
14
|
*
|
|
15
15
|
* @category Utilities
|
|
16
16
|
*/
|
|
17
|
-
declare const createAutoPicker: (pick?: string) => WalletPickerFn;
|
|
17
|
+
export declare const createAutoPicker: (pick?: string) => WalletPickerFn;
|
|
18
18
|
//#endregion
|
|
19
19
|
//#region src/testing/fakeSession.d.ts
|
|
20
20
|
/**
|
|
@@ -50,7 +50,7 @@ interface FakeSessionProviderProps {
|
|
|
50
50
|
*
|
|
51
51
|
* @category Components
|
|
52
52
|
*/
|
|
53
|
-
declare const FakeSessionProvider: ({ children, connectError, isLocked, party, readingAccounts, sdk, status: initialStatus }: FakeSessionProviderProps) => JSX.Element;
|
|
53
|
+
export declare const FakeSessionProvider: ({ children, connectError, isLocked, party, readingAccounts, sdk, status: initialStatus }: FakeSessionProviderProps) => JSX.Element;
|
|
54
54
|
//#endregion
|
|
55
55
|
//#region src/testing/fakeWallet.d.ts
|
|
56
56
|
/**
|
|
@@ -109,7 +109,7 @@ interface FakeWallet {
|
|
|
109
109
|
*
|
|
110
110
|
* @category Utilities
|
|
111
111
|
*/
|
|
112
|
-
declare const createFakeWallet: (options: FakeWalletOptions) => FakeWallet;
|
|
112
|
+
export declare const createFakeWallet: (options: FakeWalletOptions) => FakeWallet;
|
|
113
113
|
//#endregion
|
|
114
114
|
//#region src/testing/pause.d.ts
|
|
115
115
|
/**
|
|
@@ -122,6 +122,6 @@ declare const createFakeWallet: (options: FakeWalletOptions) => FakeWallet;
|
|
|
122
122
|
*
|
|
123
123
|
* @category Utilities
|
|
124
124
|
*/
|
|
125
|
-
declare const pause: (ms: number) => Promise<unknown>;
|
|
125
|
+
export declare const pause: (ms: number) => Promise<unknown>;
|
|
126
126
|
//#endregion
|
|
127
|
-
export {
|
|
127
|
+
export type { FakeSessionProviderProps, FakeWallet, FakeWalletAccount, FakeWalletOptions };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bootnodedev/canton-connect",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "wagmi-style React hooks for connecting Canton dApps to CIP-0103 wallets",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -58,16 +58,16 @@
|
|
|
58
58
|
"@types/react": "^19.2.17",
|
|
59
59
|
"@types/react-dom": "^19.2.3",
|
|
60
60
|
"@vitejs/plugin-react": "^6.0.4",
|
|
61
|
-
"@vitest/coverage-v8": "^
|
|
61
|
+
"@vitest/coverage-v8": "^5.0.0",
|
|
62
62
|
"@walletconnect/sign-client": "^2.23.9",
|
|
63
63
|
"@walletconnect/types": "^2.23.9",
|
|
64
64
|
"jsdom": "^30.0.0",
|
|
65
65
|
"react": "^19.2.8",
|
|
66
66
|
"react-dom": "^19.2.8",
|
|
67
|
-
"tsdown": "^0.
|
|
67
|
+
"tsdown": "^0.23.0",
|
|
68
68
|
"typescript": "^5.9.3",
|
|
69
69
|
"vite": "^8.1.5",
|
|
70
|
-
"vitest": "^
|
|
70
|
+
"vitest": "^5.0.0"
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
73
|
"@xstate/react": "^6.1.0",
|