@mysten/dapp-kit-react 1.0.1 → 1.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  # dapp-kit-react
2
2
 
3
- React hooks and components for building decentralized applications on the
4
- [Sui](https://sui.io) blockchain. Built on top of
3
+ React hooks and components for building decentralized applications on the [Sui](https://sui.io)
4
+ blockchain. Built on top of
5
5
  [`@mysten/dapp-kit-core`](https://www.npmjs.com/package/@mysten/dapp-kit-core).
6
6
 
7
7
  Provides a `DAppKitProvider`, ready-to-use `ConnectButton` and `ConnectModal` components, and hooks
package/dist/index.d.mts CHANGED
@@ -1,5 +1,6 @@
1
- import * as _mysten_dapp_kit_core0 from "@mysten/dapp-kit-core";
1
+ import * as _mysten_dapp_kit_core6 from "@mysten/dapp-kit-core";
2
2
  import { DAppKit, DefaultExpectedDppKit, RegisteredDAppKit } from "@mysten/dapp-kit-core";
3
+ import * as react0 from "react";
3
4
  import { ComponentProps, PropsWithChildren } from "react";
4
5
  import * as _lit_react0 from "@lit/react";
5
6
  import { DAppKitConnectButton, DAppKitConnectModal } from "@mysten/dapp-kit-core/web";
@@ -24,6 +25,7 @@ declare function ConnectModal({
24
25
  }: ConnectModalProps): react_jsx_runtime0.JSX.Element;
25
26
  //#endregion
26
27
  //#region src/components/DAppKitProvider.d.ts
28
+ declare const DAppKitContext: react0.Context<_mysten_dapp_kit_core6.DAppKit<any, _mysten_dapp_kit_core6.ClientWithCoreApi> | null>;
27
29
  type DAppKitProviderProps = PropsWithChildren<{
28
30
  dAppKit: DefaultExpectedDppKit;
29
31
  }>;
@@ -41,7 +43,7 @@ type UseWalletsOptions<TDAppKit extends DAppKit> = {
41
43
  };
42
44
  declare function useWallets<TDAppKit extends DAppKit<any> = RegisteredDAppKit>({
43
45
  dAppKit
44
- }?: UseWalletsOptions<TDAppKit>): _mysten_dapp_kit_core0.UiWallet[];
46
+ }?: UseWalletsOptions<TDAppKit>): _mysten_dapp_kit_core6.UiWallet[];
45
47
  //#endregion
46
48
  //#region src/hooks/useWalletConnection.d.ts
47
49
  type UseWalletConnectionOptions<TDAppKit extends DAppKit<any>> = {
@@ -50,8 +52,8 @@ type UseWalletConnectionOptions<TDAppKit extends DAppKit<any>> = {
50
52
  declare function useWalletConnection<TDAppKit extends DAppKit = RegisteredDAppKit>({
51
53
  dAppKit
52
54
  }?: UseWalletConnectionOptions<TDAppKit>): {
53
- readonly wallet: _mysten_dapp_kit_core0.UiWallet;
54
- readonly account: _mysten_dapp_kit_core0.UiWalletAccount;
55
+ readonly wallet: _mysten_dapp_kit_core6.UiWallet;
56
+ readonly account: _mysten_dapp_kit_core6.UiWalletAccount;
55
57
  readonly status: "connected";
56
58
  readonly supportedIntents: string[];
57
59
  readonly isConnected: true;
@@ -68,8 +70,8 @@ declare function useWalletConnection<TDAppKit extends DAppKit = RegisteredDAppKi
68
70
  readonly isReconnecting: false;
69
71
  readonly isDisconnected: false;
70
72
  } | {
71
- readonly wallet: _mysten_dapp_kit_core0.UiWallet;
72
- readonly account: _mysten_dapp_kit_core0.UiWalletAccount;
73
+ readonly wallet: _mysten_dapp_kit_core6.UiWallet;
74
+ readonly account: _mysten_dapp_kit_core6.UiWalletAccount;
73
75
  readonly status: "reconnecting";
74
76
  readonly supportedIntents: string[];
75
77
  readonly isConnected: false;
@@ -93,7 +95,7 @@ type UseCurrentAccountOptions<TDAppKit extends DAppKit> = {
93
95
  };
94
96
  declare function useCurrentAccount<TDAppKit extends DAppKit<any> = RegisteredDAppKit>({
95
97
  dAppKit
96
- }?: UseCurrentAccountOptions<TDAppKit>): _mysten_dapp_kit_core0.UiWalletAccount | null;
98
+ }?: UseCurrentAccountOptions<TDAppKit>): _mysten_dapp_kit_core6.UiWalletAccount | null;
97
99
  //#endregion
98
100
  //#region src/hooks/useCurrentWallet.d.ts
99
101
  type UseCurrentWalletOptions<TDAppKit extends DAppKit> = {
@@ -101,7 +103,7 @@ type UseCurrentWalletOptions<TDAppKit extends DAppKit> = {
101
103
  };
102
104
  declare function useCurrentWallet<TDAppKit extends DAppKit<any> = RegisteredDAppKit>({
103
105
  dAppKit
104
- }?: UseCurrentWalletOptions<TDAppKit>): _mysten_dapp_kit_core0.UiWallet | null;
106
+ }?: UseCurrentWalletOptions<TDAppKit>): _mysten_dapp_kit_core6.UiWallet | null;
105
107
  //#endregion
106
108
  //#region src/hooks/useCurrentClient.d.ts
107
109
  type UseCurrentClientOptions<TDAppKit extends DAppKit<any>> = {
@@ -119,5 +121,5 @@ declare function useCurrentNetwork<TDAppKit extends DAppKit<any> = RegisteredDAp
119
121
  dAppKit
120
122
  }?: UseCurrentNetworkOptions<TDAppKit>): nanostores0.StoreValue<TDAppKit["stores"]["$currentNetwork"]>;
121
123
  //#endregion
122
- export { ConnectButton, type ConnectButtonProps, ConnectModal, type ConnectModalProps, DAppKitProvider, type DAppKitProviderProps, useCurrentAccount, useCurrentClient, useCurrentNetwork, useCurrentWallet, useDAppKit, useWalletConnection, useWallets };
124
+ export { ConnectButton, type ConnectButtonProps, ConnectModal, type ConnectModalProps, DAppKitContext, DAppKitProvider, type DAppKitProviderProps, useCurrentAccount, useCurrentClient, useCurrentNetwork, useCurrentWallet, useDAppKit, useWalletConnection, useWallets };
123
125
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/components/ConnectButton.tsx","../src/components/ConnectModal.tsx","../src/components/DAppKitProvider.tsx","../src/hooks/useDAppKit.ts","../src/hooks/useWallets.ts","../src/hooks/useWalletConnection.ts","../src/hooks/useCurrentAccount.ts","../src/hooks/useCurrentWallet.ts","../src/hooks/useCurrentClient.ts","../src/hooks/useCurrentNetwork.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;KASY,kBAAA,GAAqB,sBAAsB;cAEjD,wBAAsB,WAAA,CAAA,kBAAA;iBAMZ,aAAA;;;GAAsC,qBAAkB,kBAAA,CAAA,GAA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AD,sBAAA,CAAe,QAAA;;;KCL7B,yCAAyC;YAC1C;;iBAGK,kCAAkC,eAAe;;IAE9D,wBAAwB,YAEyB,WAAW;;;KCRnD,0CAA0C;YAC3C;;iBAGK,mCAAmC,eAAe;;IAE/D,yBAAyB,YAAc,WAAA,CAAA,WAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/components/ConnectButton.tsx","../src/components/ConnectModal.tsx","../src/components/DAppKitProvider.tsx","../src/hooks/useDAppKit.ts","../src/hooks/useWallets.ts","../src/hooks/useWalletConnection.ts","../src/hooks/useCurrentAccount.ts","../src/hooks/useCurrentWallet.ts","../src/hooks/useCurrentClient.ts","../src/hooks/useCurrentNetwork.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;KASY,kBAAA,GAAqB,sBAAsB;cAEjD,wBAAsB,WAAA,CAAA,kBAAA;iBAMZ,aAAA;;;GAAsC,qBAAkB,kBAAA,CAAA,GAAA,CAAA;;;KCR5D,iBAAA,GAAoB,sBAAsB;cAEhD,uBAAqB,WAAA,CAAA,kBAAA;iBAMX,YAAA;;;GAAqC,oBAAiB,kBAAA,CAAA,GAAA,CAAA;;;cCVzD,gBAAc,MAAA,CAAA,QAAA,sBAAA,CAAA,aAAoD,sBAAA,CAApD,iBAAA;KAEf,oBAAA,GAAuB;WACzB;;iBAGM,eAAA;;;GAAuC,uBAAoB,kBAAA,CAAA,GAAA,CAAA;;;iBCN3D,4BAA4B,eAAe,6BAA6B,WAAQ;;;KCApF,mCAAmC;YACpC;;iBAGK,4BAA4B,eAAe;;IAExD,kBAAkB,YAAD,sBAAA,CAAe,QAAA;;;KCNvB,4CAA4C;YAC7C;;iBAGK,qCAAqC,UAAU;;IAE5D,2BAA2B;mBAAD,sBAAA,CAAA;;;;;;;ELJjB,SAAA,cAAkB,EAAA,KAAA;AAAiD,CAAA,GAEzE;EAMU,SAAA,MAAA,EAAa,IAAA;EAAG,SAAA,OAAA,EAAA,IAAA;EAAsB,SAAA,MAAA,EAAA,YAAA;EAAkB,SAAA,gBAAA,EAAA,SAAA,EAAA;EAAA,SAAA,WAAA,EAAA,KAAA;;;;ACRxE,CAAA,GAAY;EAEN,SAAA,MAAA,iCAAqB;EAMX,SAAA,OAAY,wCAAA;EAAG,SAAA,MAAA,EAAA,cAAA;EAAsB,SAAA,gBAAA,EAAA,MAAA,EAAA;EAAiB,SAAA,WAAA,EAAA,KAAA;EAAA,SAAA,YAAA,EAAA,KAAA;;;;ECVzD,SAAA,MAAA,EAAkE,IAAA;EAAA,SAAA,OAAA,EAAA,IAApD;EAAA,SAAA,MAAA,EAAA,cAAA;EAAA,SAAA,gBAAA,EAAA,SAAA,EAAA;EAAA,SAAA,WAAA,EAAA,KAAA;EAEf,SAAA,YAAA,EAAoB,KAAA;EAIhB,SAAA,cAAe,EAAA,KAAA;EAAG,SAAA,cAAA,EAAA,IAAA;CAAS;;;KIP/B,0CAA0C;YAC3C;;iBAGK,mCAAmC,eAAe;;IAE/D,yBAAyB,YAAD,sBAAA,CAAe,eAAA;;;KCN9B,yCAAyC;YAC1C;;iBAGK,kCAAkC,eAAe;;IAE9D,wBAAwB,YAAD,sBAAA,CAAe,QAAA;;;KCL7B,yCAAyC;YAC1C;;iBAGK,kCAAkC,eAAe;;IAE9D,wBAAwB,YAEyB,WAAW;;;KCRnD,0CAA0C;YAC3C;;iBAGK,mCAAmC,eAAe;;IAE/D,yBAAyB,YAAc,WAAA,CAAA,WAAA"}
package/dist/index.mjs CHANGED
@@ -92,5 +92,5 @@ function useCurrentNetwork({ dAppKit } = {}) {
92
92
  }
93
93
 
94
94
  //#endregion
95
- export { ConnectButton, ConnectModal, DAppKitProvider, useCurrentAccount, useCurrentClient, useCurrentNetwork, useCurrentWallet, useDAppKit, useWalletConnection, useWallets };
95
+ export { ConnectButton, ConnectModal, DAppKitContext, DAppKitProvider, useCurrentAccount, useCurrentClient, useCurrentNetwork, useCurrentWallet, useDAppKit, useWalletConnection, useWallets };
96
96
  //# sourceMappingURL=index.mjs.map
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@mysten/dapp-kit-react",
3
3
  "author": "Mysten Labs <build@mystenlabs.com>",
4
4
  "description": "React bindings for @mysten/dapp-kit-core",
5
- "version": "1.0.1",
5
+ "version": "1.1.0",
6
6
  "license": "Apache-2.0",
7
7
  "files": [
8
8
  "LICENSE",
@@ -16,7 +16,8 @@
16
16
  "exports": {
17
17
  ".": {
18
18
  "types": "./dist/index.d.mts",
19
- "import": "./dist/index.mjs"
19
+ "import": "./dist/index.mjs",
20
+ "default": "./dist/index.mjs"
20
21
  }
21
22
  },
22
23
  "repository": {
@@ -39,7 +40,7 @@
39
40
  "@lit/react": "^1.0.8",
40
41
  "@nanostores/react": "^1.0.0",
41
42
  "nanostores": "^1.1.0",
42
- "@mysten/dapp-kit-core": "^1.0.1"
43
+ "@mysten/dapp-kit-core": "^1.1.0"
43
44
  },
44
45
  "peerDependencies": {
45
46
  "@types/react": ">=17.0.0",
package/src/index.ts CHANGED
@@ -9,7 +9,7 @@ export type { ConnectButtonProps } from './components/ConnectButton.js';
9
9
  export { ConnectModal } from './components/ConnectModal.js';
10
10
  export type { ConnectModalProps } from './components/ConnectModal.js';
11
11
 
12
- export { DAppKitProvider } from './components/DAppKitProvider.js';
12
+ export { DAppKitProvider, DAppKitContext } from './components/DAppKitProvider.js';
13
13
  export type { DAppKitProviderProps } from './components/DAppKitProvider.js';
14
14
 
15
15
  export { useDAppKit } from './hooks/useDAppKit.js';