@suilend/sui-fe-next 3.0.0 → 3.0.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.
@@ -1,6 +1,7 @@
1
1
  import { PropsWithChildren } from "react";
2
2
  import { SuiGraphQLClient } from "@mysten/sui/graphql";
3
3
  import { SuiGrpcClient } from "@mysten/sui/grpc";
4
+ import { SuiJsonRpcClient } from "@mysten/sui/jsonRpc";
4
5
  import { Explorer, ExplorerId, Rpc, RpcId } from "@suilend/sui-fe";
5
6
  interface SettingsContext {
6
7
  rpc: Rpc;
@@ -10,6 +11,7 @@ interface SettingsContext {
10
11
  setExplorerId: (id: ExplorerId) => void;
11
12
  gasBudget: string;
12
13
  setGasBudget: (value: string) => void;
14
+ suiJsonRpcClient: SuiJsonRpcClient;
13
15
  suiGrpcClient: SuiGrpcClient;
14
16
  suiGraphQLClient: SuiGraphQLClient;
15
17
  }
@@ -12,6 +12,7 @@ var __assign = (this && this.__assign) || function () {
12
12
  import { createContext, useContext, useMemo } from "react";
13
13
  import { SuiGraphQLClient } from "@mysten/sui/graphql";
14
14
  import { SuiGrpcClient } from "@mysten/sui/grpc";
15
+ import { SuiJsonRpcClient } from "@mysten/sui/jsonRpc";
15
16
  import { useLocalStorage } from "usehooks-ts";
16
17
  import { EXPLORERS, RPCS, RPC_GRAPHQL_URL, RpcId, } from "@suilend/sui-fe";
17
18
  var defaultContextValue = {
@@ -30,6 +31,10 @@ var defaultContextValue = {
30
31
  setGasBudget: function () {
31
32
  throw Error("SettingsContextProvider not initialized");
32
33
  },
34
+ suiJsonRpcClient: new SuiJsonRpcClient({
35
+ url: "https://fullnode.mainnet.sui.io:443",
36
+ network: "mainnet",
37
+ }),
33
38
  suiGrpcClient: new SuiGrpcClient({
34
39
  baseUrl: "https://fullnode.mainnet.sui.io:443",
35
40
  network: "mainnet",
@@ -60,6 +65,7 @@ export function SettingsContextProvider(_a) {
60
65
  // Gas budget
61
66
  var _e = useLocalStorage("gasBudget", defaultContextValue.gasBudget), gasBudget = _e[0], setGasBudget = _e[1];
62
67
  // Sui clients
68
+ var suiJsonRpcClient = useMemo(function () { return new SuiJsonRpcClient({ url: rpc.url, network: "mainnet" }); }, [rpc.url]);
63
69
  var suiGrpcClient = useMemo(function () { return new SuiGrpcClient({ baseUrl: rpc.url, network: "mainnet" }); }, [rpc.url]);
64
70
  var suiGraphQLClient = useMemo(function () { return new SuiGraphQLClient({ url: RPC_GRAPHQL_URL, network: "mainnet" }); }, []);
65
71
  // Context
@@ -71,6 +77,7 @@ export function SettingsContextProvider(_a) {
71
77
  setExplorerId: setExplorerId,
72
78
  gasBudget: gasBudget,
73
79
  setGasBudget: setGasBudget,
80
+ suiJsonRpcClient: suiJsonRpcClient,
74
81
  suiGrpcClient: suiGrpcClient,
75
82
  suiGraphQLClient: suiGraphQLClient,
76
83
  }); }, [
@@ -81,6 +88,7 @@ export function SettingsContextProvider(_a) {
81
88
  setExplorerId,
82
89
  gasBudget,
83
90
  setGasBudget,
91
+ suiJsonRpcClient,
84
92
  suiGrpcClient,
85
93
  suiGraphQLClient,
86
94
  ]);
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@suilend/sui-fe-next","version":"3.0.0","private":false,"description":"A collection of TypeScript frontend components and hooks","author":"Suilend","license":"MIT","main":"./index.js","exports":{".":"./index.js","./contexts/WalletContext":"./contexts/WalletContext.jsx","./contexts/SettingsContext":"./contexts/SettingsContext.jsx","./contexts":"./contexts/index.js","./fetchers":"./fetchers/index.js","./fetchers/useFetchBalances":"./fetchers/useFetchBalances.js","./hooks/useRefreshOnBalancesChange":"./hooks/useRefreshOnBalancesChange.js","./hooks/useLedgerHashDialog":"./hooks/useLedgerHashDialog.js","./hooks/useIsAndroid":"./hooks/useIsAndroid.jsx","./hooks/useCoinMetadataMap":"./hooks/useCoinMetadataMap.js","./hooks":"./hooks/index.js","./hooks/useIsTouchscreen":"./hooks/useIsTouchscreen.jsx","./hooks/useIsiOS":"./hooks/useIsiOS.jsx","./hooks/keypair":"./hooks/keypair.js","./lib/track":"./lib/track.js","./lib":"./lib/index.js","./lib/router":"./lib/router.js","./lib/toasts":"./lib/toasts.jsx","./lib/connector":"./lib/connector.js"},"types":"./index.js","scripts":{"build":"rm -rf ./dist && bun tsc","eslint":"eslint --fix src/","prettier":"prettier --write src/","lint":"bun eslint && bun prettier && bun tsc --noEmit","release":"bun run build && bun ./release.js && cd ./dist && npm publish --access public"},"repository":{"type":"git","url":"git+https://github.com/suilend/sui-fe.git"},"bugs":{"url":"https://github.com/suilend/sui-fe/issues"},"dependencies":{"@reown/appkit":"^1.8.10","@reown/appkit-common":"^1.8.10","@reown/appkit-universal-connector":"^1.8.10","@tanstack/react-query":"^5.60.2","@wallet-standard/app":"^1.1.0","@walletconnect/universal-provider":"2.21.1","bignumber.js":"^9.1.2","launchdarkly-react-client-sdk":"^3.6.0","lodash":"^4.17.21","mixpanel-browser":"^2.72.0","next":"^15.0.3","react":"18.3.1","react-dom":"18.3.1","react-responsive":"^10.0.0","sonner":"1.4.41","swr":"^2.2.5","tailwind-merge":"^2.5.4","usehooks-ts":"^3.1.1"},"devDependencies":{"@tsconfig/next":"^2.0.3","@types/lodash":"^4.17.13","@types/node":"^22.9.0","@types/react":"^18.3.12","@types/react-dom":"^18.3.1","@typescript-eslint/eslint-plugin":"^8.14.0","@typescript-eslint/parser":"^8.14.0","eslint":"^9.14.0","eslint-config-next":"^15.0.3","eslint-config-prettier":"^9.1.0","eslint-plugin-import":"^2.31.0","eslint-plugin-prettier":"^5.2.1","prettier":"^3.3.3","ts-node":"^10.9.2","typescript":"^5.6.3"},"peerDependencies":{"@mysten/dapp-kit-core":"1.3.0","@mysten/dapp-kit-react":"2.0.1","@mysten/sui":"2.15.0","@mysten/wallet-standard":"0.20.0","@suilend/sui-fe":"3.0.1"}}
1
+ {"name":"@suilend/sui-fe-next","version":"3.0.1","private":false,"description":"A collection of TypeScript frontend components and hooks","author":"Suilend","license":"MIT","main":"./index.js","exports":{".":"./index.js","./contexts/WalletContext":"./contexts/WalletContext.jsx","./contexts/SettingsContext":"./contexts/SettingsContext.jsx","./contexts":"./contexts/index.js","./fetchers":"./fetchers/index.js","./fetchers/useFetchBalances":"./fetchers/useFetchBalances.js","./hooks/useRefreshOnBalancesChange":"./hooks/useRefreshOnBalancesChange.js","./hooks/useLedgerHashDialog":"./hooks/useLedgerHashDialog.js","./hooks/useIsAndroid":"./hooks/useIsAndroid.jsx","./hooks/useCoinMetadataMap":"./hooks/useCoinMetadataMap.js","./hooks":"./hooks/index.js","./hooks/useIsTouchscreen":"./hooks/useIsTouchscreen.jsx","./hooks/useIsiOS":"./hooks/useIsiOS.jsx","./hooks/keypair":"./hooks/keypair.js","./lib/track":"./lib/track.js","./lib":"./lib/index.js","./lib/router":"./lib/router.js","./lib/toasts":"./lib/toasts.jsx","./lib/connector":"./lib/connector.js"},"types":"./index.js","scripts":{"build":"rm -rf ./dist && bun tsc","eslint":"eslint --fix src/","prettier":"prettier --write src/","lint":"bun eslint && bun prettier && bun tsc --noEmit","release":"bun run build && bun ./release.js && cd ./dist && npm publish --access public"},"repository":{"type":"git","url":"git+https://github.com/suilend/sui-fe.git"},"bugs":{"url":"https://github.com/suilend/sui-fe/issues"},"dependencies":{"@reown/appkit":"^1.8.10","@reown/appkit-common":"^1.8.10","@reown/appkit-universal-connector":"^1.8.10","@tanstack/react-query":"^5.60.2","@wallet-standard/app":"^1.1.0","@walletconnect/universal-provider":"2.21.1","bignumber.js":"^9.1.2","launchdarkly-react-client-sdk":"^3.6.0","lodash":"^4.17.21","mixpanel-browser":"^2.72.0","next":"^15.0.3","react":"18.3.1","react-dom":"18.3.1","react-responsive":"^10.0.0","sonner":"1.4.41","swr":"^2.2.5","tailwind-merge":"^2.5.4","usehooks-ts":"^3.1.1"},"devDependencies":{"@tsconfig/next":"^2.0.3","@types/lodash":"^4.17.13","@types/node":"^22.9.0","@types/react":"^18.3.12","@types/react-dom":"^18.3.1","@typescript-eslint/eslint-plugin":"^8.14.0","@typescript-eslint/parser":"^8.14.0","eslint":"^9.14.0","eslint-config-next":"^15.0.3","eslint-config-prettier":"^9.1.0","eslint-plugin-import":"^2.31.0","eslint-plugin-prettier":"^5.2.1","prettier":"^3.3.3","ts-node":"^10.9.2","typescript":"^5.6.3"},"peerDependencies":{"@mysten/dapp-kit-core":"1.3.0","@mysten/dapp-kit-react":"2.0.1","@mysten/sui":"2.15.0","@mysten/wallet-standard":"0.20.0","@suilend/sui-fe":"3.0.1"}}