@one_deploy/sdk 1.0.0 → 1.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.
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createClient } from '@supabase/supabase-js';
2
- import React2, { createContext, useState, useMemo, useEffect, useCallback, useContext, useRef } from 'react';
2
+ import React2, { createContext, useMemo, useState, useCallback, useEffect, useContext, useRef } from 'react';
3
3
  import { jsx, jsxs } from 'react/jsx-runtime';
4
4
  import { createThirdwebClient, prepareTransaction, toWei } from 'thirdweb';
5
5
  import { ThirdwebProvider, ConnectButton, PayEmbed, TransactionButton, useActiveAccount, useSendTransaction, useWalletBalance, MediaRenderer } from 'thirdweb/react';
@@ -1662,16 +1662,15 @@ function OneProvider({
1662
1662
  config: config2,
1663
1663
  autoFetchBalance = true
1664
1664
  }) {
1665
- const [isInitialized2, setIsInitialized] = useState(false);
1665
+ useMemo(() => {
1666
+ initOneSDK(config2);
1667
+ }, [config2]);
1668
+ const [isInitialized2, setIsInitialized] = useState(true);
1666
1669
  const engine = useMemo(() => createOneEngineClient({
1667
1670
  baseUrl: config2.oneEngineUrl,
1668
1671
  clientId: config2.oneClientId,
1669
1672
  secretKey: config2.oneSecretKey
1670
1673
  }), [config2]);
1671
- useEffect(() => {
1672
- initOneSDK(config2);
1673
- setIsInitialized(true);
1674
- }, [config2]);
1675
1674
  const [user, setUser] = useState(null);
1676
1675
  const [accessToken, setAccessToken] = useState(null);
1677
1676
  const [authLoading, setAuthLoading] = useState(true);