@berachain/wagmi 0.2.0-beta.2 → 0.3.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.
Files changed (36) hide show
  1. package/dist/{BeraWagmi-4czj_EN4.d.ts → BeraWagmi-8ToIEnAn.d.ts} +18 -19
  2. package/dist/{BeraWagmi-Cgyr2tEA.d.cts → BeraWagmi-DqUsx-wd.d.cts} +18 -19
  3. package/dist/chunk-3MA6ZB64.cjs +1 -0
  4. package/dist/chunk-3VNWHDTQ.cjs +1 -0
  5. package/dist/chunk-HH2ZYQRJ.mjs +1 -0
  6. package/dist/chunk-YYGDSOWD.mjs +1 -0
  7. package/dist/config/index.cjs +1 -1
  8. package/dist/config/index.d.cts +13 -18
  9. package/dist/config/index.d.ts +13 -18
  10. package/dist/config/index.mjs +1 -1
  11. package/dist/context/index.cjs +1 -1
  12. package/dist/context/index.d.cts +8 -6
  13. package/dist/context/index.d.ts +8 -6
  14. package/dist/context/index.mjs +1 -1
  15. package/dist/core/thirdweb/index.cjs +1 -0
  16. package/dist/core/thirdweb/index.d.cts +74 -0
  17. package/dist/core/thirdweb/index.d.ts +74 -0
  18. package/dist/core/thirdweb/index.mjs +1 -0
  19. package/dist/hooks/index.cjs +1 -1
  20. package/dist/hooks/index.d.cts +23 -4
  21. package/dist/hooks/index.d.ts +23 -4
  22. package/dist/hooks/index.mjs +1 -1
  23. package/package.json +12 -8
  24. package/src/config/defaultWagmiConfig.ts +23 -142
  25. package/src/context/BeraWagmi.tsx +39 -104
  26. package/src/context/LightweightAccountProvider.tsx +9 -2
  27. package/src/context/WagmiProvider.tsx +30 -17
  28. package/src/context/useThirdweb.tsx +29 -23
  29. package/src/core/thirdweb/index.ts +61 -0
  30. package/src/hooks/index.ts +3 -1
  31. package/src/hooks/useBeraWallet.ts +2 -1
  32. package/src/hooks/useCapabilities.ts +34 -0
  33. package/dist/chunk-24VBIB22.cjs +0 -1
  34. package/dist/chunk-CPC3I7WV.cjs +0 -1
  35. package/dist/chunk-YGBWE4UM.mjs +0 -1
  36. package/dist/chunk-ZKXXJYGS.mjs +0 -1
@@ -1,8 +1,7 @@
1
1
  import { PropsWithChildren } from 'react';
2
- import { Address, GetCapabilitiesReturnType, Chain } from 'viem';
2
+ import { Address, Chain } from 'viem';
3
3
  import { UseWalletClientReturnType } from 'wagmi';
4
- import { EdgeConfigSchema } from '@berachain/config/internal/edge-config';
5
- import { getConfig } from './config/index.js';
4
+ import { getConfig, ThirdwebConfig } from './config/index.js';
6
5
 
7
6
  declare function useBeraWagmi(): BeraWagmiApi;
8
7
  interface BeraWagmiApi {
@@ -23,18 +22,7 @@ interface BeraWagmiApi {
23
22
  */
24
23
  isEmbeddedWallet: boolean;
25
24
  connectorName: string | null;
26
- flags: {
27
- getSupportsAtomic: (chainId: number) => boolean;
28
- };
29
- /**
30
- * Wallet provider capabilities for the current account.
31
- *
32
- * Status can be:
33
- * - supported: User has enabled the feature.
34
- * - ready: The wallet provider is ready to use the feature.
35
- * - unsupported: The wallet provider does not support the feature.
36
- */
37
- capabilities: GetCapabilitiesReturnType | undefined;
25
+ connectionId: string;
38
26
  /**
39
27
  * Wallet to display.
40
28
  *
@@ -63,6 +51,10 @@ interface BeraWagmiApi {
63
51
  isEmbeddedWalletsEnabled: boolean;
64
52
  isConnected: boolean;
65
53
  isConnecting: boolean;
54
+ flags: {
55
+ disableEip5792: boolean;
56
+ disable5792Upgrade: boolean;
57
+ };
66
58
  walletClient: UseWalletClientReturnType["data"];
67
59
  connectWallet: () => Promise<void> | void;
68
60
  disconnect(): void;
@@ -75,12 +67,16 @@ interface BeraWagmiApi {
75
67
  /**
76
68
  * List of external chains that are whitelisted for that app.
77
69
  */
78
- externalChainList: Chain[];
70
+ chains: Chain[];
71
+ defaultChainId: ChainId;
72
+ }
73
+ declare enum ChainId {
74
+ MAINNET = 80094,
75
+ BEPOLIA = 80069
79
76
  }
80
77
  interface IBeraWagmiProviderProps extends PropsWithChildren {
81
78
  config: ReturnType<typeof getConfig>;
82
79
  theme?: "dark" | "light" | "auto";
83
- isEmbeddedWalletsEnabled: boolean;
84
80
  disableEip5792: boolean;
85
81
  /**
86
82
  * Whether to disable the 5792 upgrade for users that haven't upgraded yet.
@@ -90,13 +86,16 @@ interface IBeraWagmiProviderProps extends PropsWithChildren {
90
86
  disable5792Upgrade?: boolean;
91
87
  accountOverride?: Address;
92
88
  onSmartAccountRejection?: () => void;
93
- edgeConfigChainList: EdgeConfigSchema["wagmi"]["externalChainList"];
94
89
  /**
95
90
  * Event triggered when a wallet is connected manually.
96
91
  *
97
92
  * This is not triggered when a wallet connect automatically after a refresh.
98
93
  */
99
94
  onConnectedWallet?: () => void;
95
+ chains: Chain[];
96
+ defaultChain: Chain;
97
+ thirdweb: ThirdwebConfig;
98
+ publicJsonRpcUrl: string;
100
99
  }
101
100
 
102
- export { type BeraWagmiApi as B, type IBeraWagmiProviderProps as I, useBeraWagmi as u };
101
+ export { type BeraWagmiApi as B, ChainId as C, type IBeraWagmiProviderProps as I, useBeraWagmi as u };
@@ -1,8 +1,7 @@
1
1
  import { PropsWithChildren } from 'react';
2
- import { Address, GetCapabilitiesReturnType, Chain } from 'viem';
2
+ import { Address, Chain } from 'viem';
3
3
  import { UseWalletClientReturnType } from 'wagmi';
4
- import { EdgeConfigSchema } from '@berachain/config/internal/edge-config';
5
- import { getConfig } from './config/index.cjs';
4
+ import { getConfig, ThirdwebConfig } from './config/index.cjs';
6
5
 
7
6
  declare function useBeraWagmi(): BeraWagmiApi;
8
7
  interface BeraWagmiApi {
@@ -23,18 +22,7 @@ interface BeraWagmiApi {
23
22
  */
24
23
  isEmbeddedWallet: boolean;
25
24
  connectorName: string | null;
26
- flags: {
27
- getSupportsAtomic: (chainId: number) => boolean;
28
- };
29
- /**
30
- * Wallet provider capabilities for the current account.
31
- *
32
- * Status can be:
33
- * - supported: User has enabled the feature.
34
- * - ready: The wallet provider is ready to use the feature.
35
- * - unsupported: The wallet provider does not support the feature.
36
- */
37
- capabilities: GetCapabilitiesReturnType | undefined;
25
+ connectionId: string;
38
26
  /**
39
27
  * Wallet to display.
40
28
  *
@@ -63,6 +51,10 @@ interface BeraWagmiApi {
63
51
  isEmbeddedWalletsEnabled: boolean;
64
52
  isConnected: boolean;
65
53
  isConnecting: boolean;
54
+ flags: {
55
+ disableEip5792: boolean;
56
+ disable5792Upgrade: boolean;
57
+ };
66
58
  walletClient: UseWalletClientReturnType["data"];
67
59
  connectWallet: () => Promise<void> | void;
68
60
  disconnect(): void;
@@ -75,12 +67,16 @@ interface BeraWagmiApi {
75
67
  /**
76
68
  * List of external chains that are whitelisted for that app.
77
69
  */
78
- externalChainList: Chain[];
70
+ chains: Chain[];
71
+ defaultChainId: ChainId;
72
+ }
73
+ declare enum ChainId {
74
+ MAINNET = 80094,
75
+ BEPOLIA = 80069
79
76
  }
80
77
  interface IBeraWagmiProviderProps extends PropsWithChildren {
81
78
  config: ReturnType<typeof getConfig>;
82
79
  theme?: "dark" | "light" | "auto";
83
- isEmbeddedWalletsEnabled: boolean;
84
80
  disableEip5792: boolean;
85
81
  /**
86
82
  * Whether to disable the 5792 upgrade for users that haven't upgraded yet.
@@ -90,13 +86,16 @@ interface IBeraWagmiProviderProps extends PropsWithChildren {
90
86
  disable5792Upgrade?: boolean;
91
87
  accountOverride?: Address;
92
88
  onSmartAccountRejection?: () => void;
93
- edgeConfigChainList: EdgeConfigSchema["wagmi"]["externalChainList"];
94
89
  /**
95
90
  * Event triggered when a wallet is connected manually.
96
91
  *
97
92
  * This is not triggered when a wallet connect automatically after a refresh.
98
93
  */
99
94
  onConnectedWallet?: () => void;
95
+ chains: Chain[];
96
+ defaultChain: Chain;
97
+ thirdweb: ThirdwebConfig;
98
+ publicJsonRpcUrl: string;
100
99
  }
101
100
 
102
- export { type BeraWagmiApi as B, type IBeraWagmiProviderProps as I, useBeraWagmi as u };
101
+ export { type BeraWagmiApi as B, ChainId as C, type IBeraWagmiProviderProps as I, useBeraWagmi as u };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _wagmiadapter = require('@thirdweb-dev/wagmi-adapter');var _thirdweb = require('thirdweb');var _wallets = require('thirdweb/wallets');var _wagmi = require('wagmi');function A({thirdweb:t,transports:l={},defaultChain:a,chains:r=[]}){let o=_thirdweb.createThirdwebClient.call(void 0, {clientId:t.clientId}),s=!!_optionalChain([a, 'access', _ => _.contracts, 'optionalAccess', _2 => _2.multicall3]),n={mode:"EIP7702",sponsorGas:t.sponsorGas},c=_wallets.inAppWallet.call(void 0, {executionMode:n}),i=[..._wallets.getInstalledWallets.call(void 0, ),_wallets.createWallet.call(void 0, "io.rabby"),_wallets.createWallet.call(void 0, "io.metamask"),_wallets.createWallet.call(void 0, "com.coinbase.wallet"),_wallets.createWallet.call(void 0, "walletConnect")].filter((d,p,f)=>f.findIndex(m=>m.id===d.id)===p);return{wallets:t.embeddedWallets?[c,...i]:i,executionMode:n,client:o,wagmi:_wagmi.createConfig.call(void 0, {chains:[a,...r],ssr:!0,connectors:[_wagmiadapter.inAppWalletConnector.call(void 0, {client:o,executionMode:n})],storage:_wagmi.createStorage.call(void 0, {key:"wagmi-berachain-thirdweb",storage:typeof window<"u"?localStorage:void 0}),batch:{multicall:s?{wait:15}:void 0},transports:l})}}exports.a = A;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _wagmi = require('wagmi');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var x=_react.createContext.call(void 0, void 0);function T({children:e,address:n,defaultChainId:o}){return _jsxruntime.jsx.call(void 0, x.Provider,{value:{address:n,defaultChainId:o},children:e})}function I(){let e=_react.useContext.call(void 0, x);if(!e)throw new Error("LightweightAccountContext not found");let{address:n,defaultChainId:o}=e;return{isConnected:!!n,address:n,defaultChainId:o}}var _immutable = require('swr/immutable'); var _immutable2 = _interopRequireDefault(_immutable);var _ens = require('viem/ens');var _thirdweb = require('thirdweb');var _react3 = require('thirdweb/react');function N({config:e,theme:n,chains:o,chain:t,publicJsonRpcUrl:u}){let{connectors:C,connect:b}=_wagmi.useConnect.call(void 0, ),i=_react3.useActiveWallet.call(void 0, ),r=_react3.useActiveAccount.call(void 0, ),{disconnect:w}=_react3.useDisconnect.call(void 0, ),{data:g}=_react3.useWalletInfo.call(void 0, _optionalChain([i, 'optionalAccess', _2 => _2.id])),d=_react.useMemo.call(void 0, ()=>_thirdweb.defineChain.call(void 0, {id:t.id,blockExplorers:t.blockExplorers,blockTime:t.blockTime,ensTlds:t.ensTlds,testnet:t.testnet,contracts:t.contracts,nativeCurrency:t.nativeCurrency,name:t.name,rpcUrls:{default:{http:[u]}}}),[u,t]),m={client:e.client,chain:d,wallets:e.wallets};async function p(a){let l=C.find(s=>s.id==="in-app-wallet");if(l){let s={withCapabilities:!0,wallet:a};b({connector:l,chainId:t.id,...s})}else console.error("no tw connector found")}let{isLoading:A}=_react3.useAutoConnect.call(void 0, {...m,onConnect:p}),W=_react.useMemo.call(void 0, ()=>crypto.randomUUID(),[_optionalChain([i, 'optionalAccess', _3 => _3.id]),_optionalChain([r, 'optionalAccess', _4 => _4.address])]),{connect:v}=_react3.useConnectModal.call(void 0, );return{async connect(){let a=await v({...m,wallets:e.wallets,theme:n==="auto"?void 0:n,size:"compact",chains:[d,...o.map(l=>_thirdweb.defineChain.call(void 0, {id:l.id}))]});await p(a)},disconnect(){i&&w(i)},isConnecting:A,connectionId:W,connectorName:_nullishCoalesce(_optionalChain([g, 'optionalAccess', _5 => _5.name]), () => (null)),isEmbeddedWallet:_optionalChain([g, 'optionalAccess', _6 => _6.id])==="inApp",wallet:r,DebugConnectButton(){return _jsxruntime.jsx.call(void 0, _react3.ConnectButton,{...m,connectModal:{size:"compact"},onConnect:a=>p(a)})}}}function f(){let e=_react.useContext.call(void 0, k);if(!e)throw new Error("BeraWagmiContext not found");return e}var k=_react.createContext.call(void 0, void 0);function ke({children:e,config:n,disableEip5792:o,disable5792Upgrade:t,theme:u,accountOverride:C,onSmartAccountRejection:b,chains:i,defaultChain:r,thirdweb:w,publicJsonRpcUrl:g}){let{wallet:d,connect:m,DebugConnectButton:p,connectionId:A,disconnect:W,connectorName:v,isEmbeddedWallet:a,isConnecting:l}=N({config:n,theme:u,chains:i,chain:r,publicJsonRpcUrl:g}),{address:s,chainId:y}=_wagmi.useAccount.call(void 0, ),{disconnect:D}=_wagmi.useDisconnect.call(void 0, ),S=_wagmi.usePublicClient.call(void 0, ),c=_react.useMemo.call(void 0, ()=>{if(!(!s||!d))return _nullishCoalesce(C, () => (s))},[C,s,d]),{data:h}=_wagmi.useEnsName.call(void 0, {config:n.wagmi,chainId:r.id,address:c}),{data:P}=_immutable2.default.call(void 0, c?["BeraWagmiProvider_code",c,y]:null,([K,j,ge])=>_optionalChain([S, 'optionalAccess', _7 => _7.getCode, 'call', _8 => _8({address:j})]),{refreshInterval:6e4}),[O,_]=_react.useMemo.call(void 0, ()=>P?P.startsWith("0xef01")?[!1,!0]:[!0,!1]:[!1,!1],[P]),{data:E}=_wagmi.useWalletClient.call(void 0, ),q=_react.useMemo.call(void 0, ()=>{try{return h?_ens.normalize.call(void 0, h):void 0}catch (e2){}},[h]),J=_wagmi.useEnsAvatar.call(void 0, {name:q});return _jsxruntime.jsx.call(void 0, k.Provider,{value:{flags:{disableEip5792:o,disable5792Upgrade:!!t},walletClient:E,onSmartAccountRejection:()=>{_optionalChain([b, 'optionalCall', _9 => _9()])},isEmbeddedWalletsEnabled:_nullishCoalesce(w.embeddedWallets, () => (!0)),isConnecting:l,isConnected:!!c&&!!E,DebugConnectButton:p,account:d&&y&&c?{connectionId:A,chainId:y,connectorName:v,isEmbeddedWallet:a,wallet:{address:c,ensName:_nullishCoalesce(_optionalChain([h, 'optionalAccess', _10 => _10.replace, 'call', _11 => _11(".bera",".\u{1F43B}\u26D3\uFE0F")]), () => (null)),ensAvatar:_nullishCoalesce(J.data, () => (null)),has7702Authorization:_,isContract:O}}:void 0,connectWallet:async()=>{console.log("connectWallet.called"),await m()},disconnect:()=>{D(),W()},chains:i,defaultChainId:r.id},children:_jsxruntime.jsx.call(void 0, T,{address:c,defaultChainId:r.id,children:e})})}function ue(){let{account:e,isConnected:n}=f();return{...e,isConnected:n}}function fe({chainId:e}){let{flags:n,account:o}=f(),{data:t}=_wagmi.useCapabilities.call(void 0, {account:_optionalChain([o, 'optionalAccess', _12 => _12.wallet, 'optionalAccess', _13 => _13.address]),scopeKey:_optionalChain([o, 'optionalAccess', _14 => _14.connectionId]),query:{retry:3},chainId:e});return{supportsAtomic:_react.useMemo.call(void 0, ()=>n.disableEip5792||!t?!1:_optionalChain([t, 'optionalAccess', _15 => _15.atomic, 'optionalAccess', _16 => _16.status])==="supported"||!n.disable5792Upgrade&&_optionalChain([t, 'optionalAccess', _17 => _17.atomic, 'optionalAccess', _18 => _18.status])==="ready",[t,n.disableEip5792,n.disable5792Upgrade,e]),capabilities:t}}function He(e){let{defaultChainId:n}=I(),{chainId:o,...t}=_nullishCoalesce(e, () => ({}));return _wagmi.usePublicClient.call(void 0, {chainId:_nullishCoalesce(o, () => (n)),...t})}exports.a = I; exports.b = ue; exports.c = fe; exports.d = He; exports.e = _wagmi.useBlockNumber; exports.f = _wagmi.useChains; exports.g = _wagmi.useConfig; exports.h = _wagmi.useEnsAvatar; exports.i = _wagmi.useEnsName; exports.j = _wagmi.useSwitchChain; exports.k = _wagmi.useTransactionReceipt; exports.l = f; exports.m = ke;
@@ -0,0 +1 @@
1
+ import{usePublicClient as Ce}from"wagmi";import{useContext as H}from"react";import{createContext as F}from"react";import{jsx as G}from"react/jsx-runtime";var x=F(void 0);function T({children:e,address:n,defaultChainId:o}){return G(x.Provider,{value:{address:n,defaultChainId:o},children:e})}function I(){let e=H(x);if(!e)throw new Error("LightweightAccountContext not found");let{address:n,defaultChainId:o}=e;return{isConnected:!!n,address:n,defaultChainId:o}}import{useBlockNumber as Xe,useChains as Ye,useConfig as Ze,useEnsAvatar as z,useEnsName as M,useSwitchChain as $e,useTransactionReceipt as et}from"wagmi";import{createContext as oe,useContext as ie,useMemo as B}from"react";import re from"swr/immutable";import{normalize as ae}from"viem/ens";import{useAccount as se,useDisconnect as ce,usePublicClient as de,useWalletClient as le}from"wagmi";import{useMemo as U}from"react";import{defineChain as R}from"thirdweb";import{ConnectButton as Q,useActiveAccount as V,useActiveWallet as X,useAutoConnect as Y,useConnectModal as Z,useDisconnect as $,useWalletInfo as ee}from"thirdweb/react";import{useConnect as te}from"wagmi";import{jsx as ne}from"react/jsx-runtime";function N({config:e,theme:n,chains:o,chain:t,publicJsonRpcUrl:u}){let{connectors:C,connect:b}=te(),i=X(),r=V(),{disconnect:w}=$(),{data:g}=ee(i?.id),d=U(()=>R({id:t.id,blockExplorers:t.blockExplorers,blockTime:t.blockTime,ensTlds:t.ensTlds,testnet:t.testnet,contracts:t.contracts,nativeCurrency:t.nativeCurrency,name:t.name,rpcUrls:{default:{http:[u]}}}),[u,t]),m={client:e.client,chain:d,wallets:e.wallets};async function p(a){let l=C.find(s=>s.id==="in-app-wallet");if(l){let s={withCapabilities:!0,wallet:a};b({connector:l,chainId:t.id,...s})}else console.error("no tw connector found")}let{isLoading:A}=Y({...m,onConnect:p}),W=U(()=>crypto.randomUUID(),[i?.id,r?.address]),{connect:v}=Z();return{async connect(){let a=await v({...m,wallets:e.wallets,theme:n==="auto"?void 0:n,size:"compact",chains:[d,...o.map(l=>R({id:l.id}))]});await p(a)},disconnect(){i&&w(i)},isConnecting:A,connectionId:W,connectorName:g?.name??null,isEmbeddedWallet:g?.id==="inApp",wallet:r,DebugConnectButton(){return ne(Q,{...m,connectModal:{size:"compact"},onConnect:a=>p(a)})}}}import{jsx as L}from"react/jsx-runtime";function f(){let e=ie(k);if(!e)throw new Error("BeraWagmiContext not found");return e}var k=oe(void 0);function ke({children:e,config:n,disableEip5792:o,disable5792Upgrade:t,theme:u,accountOverride:C,onSmartAccountRejection:b,chains:i,defaultChain:r,thirdweb:w,publicJsonRpcUrl:g}){let{wallet:d,connect:m,DebugConnectButton:p,connectionId:A,disconnect:W,connectorName:v,isEmbeddedWallet:a,isConnecting:l}=N({config:n,theme:u,chains:i,chain:r,publicJsonRpcUrl:g}),{address:s,chainId:y}=se(),{disconnect:D}=ce(),S=de(),c=B(()=>{if(!(!s||!d))return C??s},[C,s,d]),{data:h}=M({config:n.wagmi,chainId:r.id,address:c}),{data:P}=re(c?["BeraWagmiProvider_code",c,y]:null,([K,j,ge])=>S?.getCode({address:j}),{refreshInterval:6e4}),[O,_]=B(()=>P?P.startsWith("0xef01")?[!1,!0]:[!0,!1]:[!1,!1],[P]),{data:E}=le(),q=B(()=>{try{return h?ae(h):void 0}catch{}},[h]),J=z({name:q});return L(k.Provider,{value:{flags:{disableEip5792:o,disable5792Upgrade:!!t},walletClient:E,onSmartAccountRejection:()=>{b?.()},isEmbeddedWalletsEnabled:w.embeddedWallets??!0,isConnecting:l,isConnected:!!c&&!!E,DebugConnectButton:p,account:d&&y&&c?{connectionId:A,chainId:y,connectorName:v,isEmbeddedWallet:a,wallet:{address:c,ensName:h?.replace(".bera",".\u{1F43B}\u26D3\uFE0F")??null,ensAvatar:J.data??null,has7702Authorization:_,isContract:O}}:void 0,connectWallet:async()=>{console.log("connectWallet.called"),await m()},disconnect:()=>{D(),W()},chains:i,defaultChainId:r.id},children:L(T,{address:c,defaultChainId:r.id,children:e})})}function ue(){let{account:e,isConnected:n}=f();return{...e,isConnected:n}}import{useMemo as me}from"react";import{useCapabilities as pe}from"wagmi";function fe({chainId:e}){let{flags:n,account:o}=f(),{data:t}=pe({account:o?.wallet?.address,scopeKey:o?.connectionId,query:{retry:3},chainId:e});return{supportsAtomic:me(()=>n.disableEip5792||!t?!1:t?.atomic?.status==="supported"||!n.disable5792Upgrade&&t?.atomic?.status==="ready",[t,n.disableEip5792,n.disable5792Upgrade,e]),capabilities:t}}function He(e){let{defaultChainId:n}=I(),{chainId:o,...t}=e??{};return Ce({chainId:o??n,...t})}export{I as a,ue as b,fe as c,He as d,Xe as e,Ye as f,Ze as g,z as h,M as i,$e as j,et as k,f as l,ke as m};
@@ -0,0 +1 @@
1
+ import{inAppWalletConnector as g}from"@thirdweb-dev/wagmi-adapter";import{createThirdwebClient as C}from"thirdweb";import{createWallet as e,getInstalledWallets as b,inAppWallet as u}from"thirdweb/wallets";import{createConfig as h,createStorage as w}from"wagmi";function A({thirdweb:t,transports:l={},defaultChain:a,chains:r=[]}){let o=C({clientId:t.clientId}),s=!!a.contracts?.multicall3,n={mode:"EIP7702",sponsorGas:t.sponsorGas},c=u({executionMode:n}),i=[...b(),e("io.rabby"),e("io.metamask"),e("com.coinbase.wallet"),e("walletConnect")].filter((d,p,f)=>f.findIndex(m=>m.id===d.id)===p);return{wallets:t.embeddedWallets?[c,...i]:i,executionMode:n,client:o,wagmi:h({chains:[a,...r],ssr:!0,connectors:[g({client:o,executionMode:n})],storage:w({key:"wagmi-berachain-thirdweb",storage:typeof window<"u"?localStorage:void 0}),batch:{multicall:s?{wait:15}:void 0},transports:l})}}export{A as a};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk24VBIB22cjs = require('../chunk-24VBIB22.cjs');exports.chain = _chunk24VBIB22cjs.a; exports.chainIdToName = _chunk24VBIB22cjs.d; exports.defaultBeraNetworkConfig = _chunk24VBIB22cjs.b; exports.externalChains = _chunk24VBIB22cjs.c; exports.getConfig = _chunk24VBIB22cjs.e;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk3MA6ZB64cjs = require('../chunk-3MA6ZB64.cjs');exports.getConfig = _chunk3MA6ZB64cjs.a;
@@ -1,25 +1,20 @@
1
1
  import * as thirdweb from 'thirdweb';
2
2
  import * as thirdweb_wallets from 'thirdweb/wallets';
3
- import { Chain } from 'viem';
3
+ import { Transport, Chain } from 'viem';
4
4
  import { Config } from 'wagmi';
5
5
 
6
- /**
7
- * Using default viem chain definition since it also includes ens and other metadata
8
- */
9
- declare const chain: Chain;
10
- declare const defaultBeraNetworkConfig: NetworkConfig;
11
- interface NetworkConfig {
12
- chain: Chain;
13
- }
14
- /**
15
- * Exporting this is helpful for the multi-chain zap, to get the list of chains that we want to support.
16
- */
17
- declare const externalChains: Chain[];
18
- declare const chainIdToName: Record<Chain["id"], string>;
19
- declare function getConfig({ sponsorGas, enableEmbeddedWallets, }: {
6
+ interface ThirdwebConfig {
20
7
  sponsorGas?: boolean;
21
- enableEmbeddedWallets: boolean;
22
- }): {
8
+ embeddedWallets?: boolean;
9
+ clientId: string;
10
+ }
11
+ interface BeraWagmiConfig {
12
+ thirdweb: ThirdwebConfig;
13
+ transports?: Record<number, Transport>;
14
+ chains?: Chain[];
15
+ defaultChain: Chain;
16
+ }
17
+ declare function getConfig({ thirdweb, transports, defaultChain: chain, chains, }: BeraWagmiConfig): {
23
18
  wallets: thirdweb_wallets.Wallet[];
24
19
  executionMode: {
25
20
  readonly mode: "EIP7702";
@@ -29,4 +24,4 @@ declare function getConfig({ sponsorGas, enableEmbeddedWallets, }: {
29
24
  wagmi: Config;
30
25
  };
31
26
 
32
- export { type NetworkConfig, chain, chainIdToName, defaultBeraNetworkConfig, externalChains, getConfig };
27
+ export { type BeraWagmiConfig, type ThirdwebConfig, getConfig };
@@ -1,25 +1,20 @@
1
1
  import * as thirdweb from 'thirdweb';
2
2
  import * as thirdweb_wallets from 'thirdweb/wallets';
3
- import { Chain } from 'viem';
3
+ import { Transport, Chain } from 'viem';
4
4
  import { Config } from 'wagmi';
5
5
 
6
- /**
7
- * Using default viem chain definition since it also includes ens and other metadata
8
- */
9
- declare const chain: Chain;
10
- declare const defaultBeraNetworkConfig: NetworkConfig;
11
- interface NetworkConfig {
12
- chain: Chain;
13
- }
14
- /**
15
- * Exporting this is helpful for the multi-chain zap, to get the list of chains that we want to support.
16
- */
17
- declare const externalChains: Chain[];
18
- declare const chainIdToName: Record<Chain["id"], string>;
19
- declare function getConfig({ sponsorGas, enableEmbeddedWallets, }: {
6
+ interface ThirdwebConfig {
20
7
  sponsorGas?: boolean;
21
- enableEmbeddedWallets: boolean;
22
- }): {
8
+ embeddedWallets?: boolean;
9
+ clientId: string;
10
+ }
11
+ interface BeraWagmiConfig {
12
+ thirdweb: ThirdwebConfig;
13
+ transports?: Record<number, Transport>;
14
+ chains?: Chain[];
15
+ defaultChain: Chain;
16
+ }
17
+ declare function getConfig({ thirdweb, transports, defaultChain: chain, chains, }: BeraWagmiConfig): {
23
18
  wallets: thirdweb_wallets.Wallet[];
24
19
  executionMode: {
25
20
  readonly mode: "EIP7702";
@@ -29,4 +24,4 @@ declare function getConfig({ sponsorGas, enableEmbeddedWallets, }: {
29
24
  wagmi: Config;
30
25
  };
31
26
 
32
- export { type NetworkConfig, chain, chainIdToName, defaultBeraNetworkConfig, externalChains, getConfig };
27
+ export { type BeraWagmiConfig, type ThirdwebConfig, getConfig };
@@ -1 +1 @@
1
- import{a,b,c,d,e}from"../chunk-ZKXXJYGS.mjs";export{a as chain,d as chainIdToName,b as defaultBeraNetworkConfig,c as externalChains,e as getConfig};
1
+ import{a as o}from"../chunk-YYGDSOWD.mjs";export{o as getConfig};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";var _chunkCPC3I7WVcjs = require('../chunk-CPC3I7WV.cjs');var _chunk24VBIB22cjs = require('../chunk-24VBIB22.cjs');var _react = require('react');var _reactquery = require('@tanstack/react-query');var _porto = require('porto');var _react3 = require('thirdweb/react');var _wagmi = require('wagmi');var _jsxruntime = require('react/jsx-runtime');var c=new _reactquery.QueryClient;_porto.Porto.create();function w({sponsorGas:n,...r}){let o=_react.useMemo.call(void 0, ()=>_chunk24VBIB22cjs.e.call(void 0, {sponsorGas:n,enableEmbeddedWallets:r.isEmbeddedWalletsEnabled}),[]);return _jsxruntime.jsx.call(void 0, _react3.ThirdwebProvider,{children:_jsxruntime.jsx.call(void 0, _wagmi.WagmiProvider,{config:o.wagmi,reconnectOnMount:!1,children:_jsxruntime.jsx.call(void 0, _reactquery.QueryClientProvider,{client:c,children:_jsxruntime.jsx.call(void 0, _chunkCPC3I7WVcjs.l,{...r,config:o})})})})}exports.WagmiProvider = w;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";var _chunk3MA6ZB64cjs = require('../chunk-3MA6ZB64.cjs');var _chunk3VNWHDTQcjs = require('../chunk-3VNWHDTQ.cjs');var _react = require('react');var _reactquery = require('@tanstack/react-query');var _react3 = require('thirdweb/react');var _wagmi = require('wagmi');var _jsxruntime = require('react/jsx-runtime');var u=new _reactquery.QueryClient;function h({transports:n,defaultChain:e,chains:i,thirdweb:o,...f}){let t=_react.useMemo.call(void 0, ()=>_chunk3MA6ZB64cjs.a.call(void 0, {thirdweb:o,transports:n,defaultChain:e,chains:i}),[e,o,n,i]);return _jsxruntime.jsx.call(void 0, _react3.ThirdwebProvider,{children:_jsxruntime.jsx.call(void 0, _wagmi.WagmiProvider,{config:t.wagmi,reconnectOnMount:!1,children:_jsxruntime.jsx.call(void 0, _reactquery.QueryClientProvider,{client:u,children:_jsxruntime.jsx.call(void 0, _chunk3VNWHDTQcjs.m,{...f,thirdweb:o,chains:i,defaultChain:e,config:t})})})})}exports.WagmiProvider = h;
@@ -1,15 +1,17 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { I as IBeraWagmiProviderProps } from '../BeraWagmi-Cgyr2tEA.cjs';
2
+ import { Transport, Chain } from 'viem';
3
+ import { I as IBeraWagmiProviderProps } from '../BeraWagmi-DqUsx-wd.cjs';
3
4
  import 'react';
4
- import 'viem';
5
5
  import 'wagmi';
6
- import '@berachain/config/internal/edge-config';
7
6
  import '../config/index.cjs';
8
7
  import 'thirdweb';
9
8
  import 'thirdweb/wallets';
10
9
 
11
- declare function WagmiProvider({ sponsorGas, ...beraWagmiProps }: Omit<IBeraWagmiProviderProps, "config"> & {
12
- sponsorGas?: boolean;
13
- }): react_jsx_runtime.JSX.Element;
10
+ type WagmiProviderProps = Omit<IBeraWagmiProviderProps, "config" | "defaultChain"> & {
11
+ transports?: Record<number, Transport>;
12
+ defaultChain: Chain;
13
+ chains?: Chain[];
14
+ };
15
+ declare function WagmiProvider({ transports, defaultChain, chains, thirdweb, ...beraWagmiProps }: WagmiProviderProps): react_jsx_runtime.JSX.Element;
14
16
 
15
17
  export { WagmiProvider };
@@ -1,15 +1,17 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { I as IBeraWagmiProviderProps } from '../BeraWagmi-4czj_EN4.js';
2
+ import { Transport, Chain } from 'viem';
3
+ import { I as IBeraWagmiProviderProps } from '../BeraWagmi-8ToIEnAn.js';
3
4
  import 'react';
4
- import 'viem';
5
5
  import 'wagmi';
6
- import '@berachain/config/internal/edge-config';
7
6
  import '../config/index.js';
8
7
  import 'thirdweb';
9
8
  import 'thirdweb/wallets';
10
9
 
11
- declare function WagmiProvider({ sponsorGas, ...beraWagmiProps }: Omit<IBeraWagmiProviderProps, "config"> & {
12
- sponsorGas?: boolean;
13
- }): react_jsx_runtime.JSX.Element;
10
+ type WagmiProviderProps = Omit<IBeraWagmiProviderProps, "config" | "defaultChain"> & {
11
+ transports?: Record<number, Transport>;
12
+ defaultChain: Chain;
13
+ chains?: Chain[];
14
+ };
15
+ declare function WagmiProvider({ transports, defaultChain, chains, thirdweb, ...beraWagmiProps }: WagmiProviderProps): react_jsx_runtime.JSX.Element;
14
16
 
15
17
  export { WagmiProvider };
@@ -1 +1 @@
1
- "use client";import{l as t}from"../chunk-YGBWE4UM.mjs";import{e as i}from"../chunk-ZKXXJYGS.mjs";import{useMemo as m}from"react";import{QueryClient as a,QueryClientProvider as d}from"@tanstack/react-query";import{Porto as s}from"porto";import{ThirdwebProvider as f}from"thirdweb/react";import{WagmiProvider as l}from"wagmi";import{jsx as e}from"react/jsx-runtime";var c=new a;s.create();function w({sponsorGas:n,...r}){let o=m(()=>i({sponsorGas:n,enableEmbeddedWallets:r.isEmbeddedWalletsEnabled}),[]);return e(f,{children:e(l,{config:o.wagmi,reconnectOnMount:!1,children:e(d,{client:c,children:e(t,{...r,config:o})})})})}export{w as WagmiProvider};
1
+ "use client";import{a as m}from"../chunk-YYGDSOWD.mjs";import{m as a}from"../chunk-HH2ZYQRJ.mjs";import{useMemo as p}from"react";import{QueryClient as d,QueryClientProvider as g}from"@tanstack/react-query";import{ThirdwebProvider as s}from"thirdweb/react";import{WagmiProvider as P}from"wagmi";import{jsx as r}from"react/jsx-runtime";var u=new d;function h({transports:n,defaultChain:e,chains:i,thirdweb:o,...f}){let t=p(()=>m({thirdweb:o,transports:n,defaultChain:e,chains:i}),[e,o,n,i]);return r(s,{children:r(P,{config:t.wagmi,reconnectOnMount:!1,children:r(g,{client:u,children:r(a,{...f,thirdweb:o,chains:i,defaultChain:e,config:t})})})})}export{h as WagmiProvider};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _viem = require('viem');var _erc4337 = require('thirdweb/extensions/erc4337');var _inapp = require('thirdweb/wallets/in-app');function s(e=32){return _viem.toHex.call(void 0, n(e))}function n(e=32){return globalThis.crypto.getRandomValues(new Uint8Array(e))}var i=[{name:"limitType",type:"uint8"},{name:"limit",type:"uint256"},{name:"period",type:"uint256"}],r= exports.ConstraintRequest =[{name:"condition",type:"uint8"},{name:"index",type:"uint64"},{name:"refValue",type:"bytes32"},{name:"limit",type:"UsageLimit"}],o= exports.CallSpecRequest =[{name:"target",type:"address"},{name:"selector",type:"bytes4"},{name:"maxValuePerUse",type:"uint256"},{name:"valueLimit",type:"UsageLimit"},{name:"constraints",type:"Constraint[]"}],p= exports.TransferSpecRequest =[{name:"target",type:"address"},{name:"maxValuePerUse",type:"uint256"},{name:"valueLimit",type:"UsageLimit"}],m= exports.SessionSpecRequest =[{name:"signer",type:"address"},{name:"isWildcard",type:"bool"},{name:"expiresAt",type:"uint256"},{name:"callPolicies",type:"CallSpec[]"},{name:"transferPolicies",type:"TransferSpec[]"},{name:"uid",type:"bytes32"}];exports.CallSpecRequest = o; exports.ConstraintRequest = r; exports.SessionSpecRequest = m; exports.TransferSpecRequest = p; exports.UsageLimitRequest = i; exports.createSessionKey = _inapp.createSessionKey; exports.getAllActiveSigners = _erc4337.getAllActiveSigners; exports.randomBytesHex = s;
@@ -0,0 +1,74 @@
1
+ export { getAllActiveSigners } from 'thirdweb/extensions/erc4337';
2
+ export { Condition, CreateSessionKeyOptions, GetCallPoliciesForSignerParams, LimitType, createSessionKey } from 'thirdweb/wallets/in-app';
3
+
4
+ declare function randomBytesHex(length?: number): `0x${string}`;
5
+ declare const UsageLimitRequest: readonly [{
6
+ readonly name: "limitType";
7
+ readonly type: "uint8";
8
+ }, {
9
+ readonly name: "limit";
10
+ readonly type: "uint256";
11
+ }, {
12
+ readonly name: "period";
13
+ readonly type: "uint256";
14
+ }];
15
+ declare const ConstraintRequest: readonly [{
16
+ readonly name: "condition";
17
+ readonly type: "uint8";
18
+ }, {
19
+ readonly name: "index";
20
+ readonly type: "uint64";
21
+ }, {
22
+ readonly name: "refValue";
23
+ readonly type: "bytes32";
24
+ }, {
25
+ readonly name: "limit";
26
+ readonly type: "UsageLimit";
27
+ }];
28
+ declare const CallSpecRequest: readonly [{
29
+ readonly name: "target";
30
+ readonly type: "address";
31
+ }, {
32
+ readonly name: "selector";
33
+ readonly type: "bytes4";
34
+ }, {
35
+ readonly name: "maxValuePerUse";
36
+ readonly type: "uint256";
37
+ }, {
38
+ readonly name: "valueLimit";
39
+ readonly type: "UsageLimit";
40
+ }, {
41
+ readonly name: "constraints";
42
+ readonly type: "Constraint[]";
43
+ }];
44
+ declare const TransferSpecRequest: readonly [{
45
+ readonly name: "target";
46
+ readonly type: "address";
47
+ }, {
48
+ readonly name: "maxValuePerUse";
49
+ readonly type: "uint256";
50
+ }, {
51
+ readonly name: "valueLimit";
52
+ readonly type: "UsageLimit";
53
+ }];
54
+ declare const SessionSpecRequest: readonly [{
55
+ readonly name: "signer";
56
+ readonly type: "address";
57
+ }, {
58
+ readonly name: "isWildcard";
59
+ readonly type: "bool";
60
+ }, {
61
+ readonly name: "expiresAt";
62
+ readonly type: "uint256";
63
+ }, {
64
+ readonly name: "callPolicies";
65
+ readonly type: "CallSpec[]";
66
+ }, {
67
+ readonly name: "transferPolicies";
68
+ readonly type: "TransferSpec[]";
69
+ }, {
70
+ readonly name: "uid";
71
+ readonly type: "bytes32";
72
+ }];
73
+
74
+ export { CallSpecRequest, ConstraintRequest, SessionSpecRequest, TransferSpecRequest, UsageLimitRequest, randomBytesHex };
@@ -0,0 +1,74 @@
1
+ export { getAllActiveSigners } from 'thirdweb/extensions/erc4337';
2
+ export { Condition, CreateSessionKeyOptions, GetCallPoliciesForSignerParams, LimitType, createSessionKey } from 'thirdweb/wallets/in-app';
3
+
4
+ declare function randomBytesHex(length?: number): `0x${string}`;
5
+ declare const UsageLimitRequest: readonly [{
6
+ readonly name: "limitType";
7
+ readonly type: "uint8";
8
+ }, {
9
+ readonly name: "limit";
10
+ readonly type: "uint256";
11
+ }, {
12
+ readonly name: "period";
13
+ readonly type: "uint256";
14
+ }];
15
+ declare const ConstraintRequest: readonly [{
16
+ readonly name: "condition";
17
+ readonly type: "uint8";
18
+ }, {
19
+ readonly name: "index";
20
+ readonly type: "uint64";
21
+ }, {
22
+ readonly name: "refValue";
23
+ readonly type: "bytes32";
24
+ }, {
25
+ readonly name: "limit";
26
+ readonly type: "UsageLimit";
27
+ }];
28
+ declare const CallSpecRequest: readonly [{
29
+ readonly name: "target";
30
+ readonly type: "address";
31
+ }, {
32
+ readonly name: "selector";
33
+ readonly type: "bytes4";
34
+ }, {
35
+ readonly name: "maxValuePerUse";
36
+ readonly type: "uint256";
37
+ }, {
38
+ readonly name: "valueLimit";
39
+ readonly type: "UsageLimit";
40
+ }, {
41
+ readonly name: "constraints";
42
+ readonly type: "Constraint[]";
43
+ }];
44
+ declare const TransferSpecRequest: readonly [{
45
+ readonly name: "target";
46
+ readonly type: "address";
47
+ }, {
48
+ readonly name: "maxValuePerUse";
49
+ readonly type: "uint256";
50
+ }, {
51
+ readonly name: "valueLimit";
52
+ readonly type: "UsageLimit";
53
+ }];
54
+ declare const SessionSpecRequest: readonly [{
55
+ readonly name: "signer";
56
+ readonly type: "address";
57
+ }, {
58
+ readonly name: "isWildcard";
59
+ readonly type: "bool";
60
+ }, {
61
+ readonly name: "expiresAt";
62
+ readonly type: "uint256";
63
+ }, {
64
+ readonly name: "callPolicies";
65
+ readonly type: "CallSpec[]";
66
+ }, {
67
+ readonly name: "transferPolicies";
68
+ readonly type: "TransferSpec[]";
69
+ }, {
70
+ readonly name: "uid";
71
+ readonly type: "bytes32";
72
+ }];
73
+
74
+ export { CallSpecRequest, ConstraintRequest, SessionSpecRequest, TransferSpecRequest, UsageLimitRequest, randomBytesHex };
@@ -0,0 +1 @@
1
+ import{toHex as t}from"viem";import{getAllActiveSigners as l}from"thirdweb/extensions/erc4337";import{createSessionKey as d}from"thirdweb/wallets/in-app";function s(e=32){return t(n(e))}function n(e=32){return globalThis.crypto.getRandomValues(new Uint8Array(e))}var i=[{name:"limitType",type:"uint8"},{name:"limit",type:"uint256"},{name:"period",type:"uint256"}],r=[{name:"condition",type:"uint8"},{name:"index",type:"uint64"},{name:"refValue",type:"bytes32"},{name:"limit",type:"UsageLimit"}],o=[{name:"target",type:"address"},{name:"selector",type:"bytes4"},{name:"maxValuePerUse",type:"uint256"},{name:"valueLimit",type:"UsageLimit"},{name:"constraints",type:"Constraint[]"}],p=[{name:"target",type:"address"},{name:"maxValuePerUse",type:"uint256"},{name:"valueLimit",type:"UsageLimit"}],m=[{name:"signer",type:"address"},{name:"isWildcard",type:"bool"},{name:"expiresAt",type:"uint256"},{name:"callPolicies",type:"CallSpec[]"},{name:"transferPolicies",type:"TransferSpec[]"},{name:"uid",type:"bytes32"}];export{o as CallSpecRequest,r as ConstraintRequest,m as SessionSpecRequest,p as TransferSpecRequest,i as UsageLimitRequest,d as createSessionKey,l as getAllActiveSigners,s as randomBytesHex};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkCPC3I7WVcjs = require('../chunk-CPC3I7WV.cjs');require('../chunk-24VBIB22.cjs');exports.useBeraAccount = _chunkCPC3I7WVcjs.a; exports.useBeraWagmi = _chunkCPC3I7WVcjs.k; exports.useBeraWallet = _chunkCPC3I7WVcjs.b; exports.useBlockNumber = _chunkCPC3I7WVcjs.d; exports.useChains = _chunkCPC3I7WVcjs.e; exports.useConfig = _chunkCPC3I7WVcjs.f; exports.useEnsAvatar = _chunkCPC3I7WVcjs.g; exports.useEnsName = _chunkCPC3I7WVcjs.h; exports.usePublicClient = _chunkCPC3I7WVcjs.c; exports.useSwitchChain = _chunkCPC3I7WVcjs.i; exports.useTransactionReceipt = _chunkCPC3I7WVcjs.j;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk3VNWHDTQcjs = require('../chunk-3VNWHDTQ.cjs');exports.useBeraAccount = _chunk3VNWHDTQcjs.b; exports.useBeraWagmi = _chunk3VNWHDTQcjs.l; exports.useBeraWallet = _chunk3VNWHDTQcjs.a; exports.useBlockNumber = _chunk3VNWHDTQcjs.e; exports.useCapabilities = _chunk3VNWHDTQcjs.c; exports.useChains = _chunk3VNWHDTQcjs.f; exports.useConfig = _chunk3VNWHDTQcjs.g; exports.useEnsAvatar = _chunk3VNWHDTQcjs.h; exports.useEnsName = _chunk3VNWHDTQcjs.i; exports.usePublicClient = _chunk3VNWHDTQcjs.d; exports.useSwitchChain = _chunk3VNWHDTQcjs.j; exports.useTransactionReceipt = _chunk3VNWHDTQcjs.k;
@@ -1,10 +1,9 @@
1
1
  import { UsePublicClientParameters, UsePublicClientReturnType } from 'wagmi';
2
2
  export { useBlockNumber, useChains, useConfig, useEnsAvatar, useEnsName, useSwitchChain, useTransactionReceipt } from 'wagmi';
3
- import { B as BeraWagmiApi } from '../BeraWagmi-Cgyr2tEA.cjs';
4
- export { u as useBeraWagmi } from '../BeraWagmi-Cgyr2tEA.cjs';
3
+ import { B as BeraWagmiApi, C as ChainId } from '../BeraWagmi-DqUsx-wd.cjs';
4
+ export { u as useBeraWagmi } from '../BeraWagmi-DqUsx-wd.cjs';
5
5
  import 'react';
6
6
  import 'viem';
7
- import '@berachain/config/internal/edge-config';
8
7
  import '../config/index.cjs';
9
8
  import 'thirdweb';
10
9
  import 'thirdweb/wallets';
@@ -16,8 +15,28 @@ declare function useBeraAccount(): Partial<NonNullable<BeraWagmiApi["account"]>>
16
15
  declare function useBeraWallet(): {
17
16
  readonly isConnected: boolean;
18
17
  readonly address: `0x${string}` | undefined;
18
+ readonly defaultChainId: ChainId;
19
+ };
20
+
21
+ declare function useCapabilities({ chainId }: {
22
+ chainId: number;
23
+ }): {
24
+ supportsAtomic: boolean;
25
+ capabilities: {
26
+ [x: string]: any;
27
+ atomic?: {
28
+ status: "supported" | "ready" | "unsupported";
29
+ } | undefined;
30
+ unstable_addSubAccount?: {
31
+ keyTypes: ("address" | "p256" | "webcrypto-p256" | "webauthn-p256")[];
32
+ supported: boolean;
33
+ } | undefined;
34
+ paymasterService?: {
35
+ supported: boolean;
36
+ } | undefined;
37
+ } | undefined;
19
38
  };
20
39
 
21
40
  declare function usePublicClient(args?: UsePublicClientParameters): UsePublicClientReturnType;
22
41
 
23
- export { useBeraAccount, useBeraWallet, usePublicClient };
42
+ export { useBeraAccount, useBeraWallet, useCapabilities, usePublicClient };
@@ -1,10 +1,9 @@
1
1
  import { UsePublicClientParameters, UsePublicClientReturnType } from 'wagmi';
2
2
  export { useBlockNumber, useChains, useConfig, useEnsAvatar, useEnsName, useSwitchChain, useTransactionReceipt } from 'wagmi';
3
- import { B as BeraWagmiApi } from '../BeraWagmi-4czj_EN4.js';
4
- export { u as useBeraWagmi } from '../BeraWagmi-4czj_EN4.js';
3
+ import { B as BeraWagmiApi, C as ChainId } from '../BeraWagmi-8ToIEnAn.js';
4
+ export { u as useBeraWagmi } from '../BeraWagmi-8ToIEnAn.js';
5
5
  import 'react';
6
6
  import 'viem';
7
- import '@berachain/config/internal/edge-config';
8
7
  import '../config/index.js';
9
8
  import 'thirdweb';
10
9
  import 'thirdweb/wallets';
@@ -16,8 +15,28 @@ declare function useBeraAccount(): Partial<NonNullable<BeraWagmiApi["account"]>>
16
15
  declare function useBeraWallet(): {
17
16
  readonly isConnected: boolean;
18
17
  readonly address: `0x${string}` | undefined;
18
+ readonly defaultChainId: ChainId;
19
+ };
20
+
21
+ declare function useCapabilities({ chainId }: {
22
+ chainId: number;
23
+ }): {
24
+ supportsAtomic: boolean;
25
+ capabilities: {
26
+ [x: string]: any;
27
+ atomic?: {
28
+ status: "supported" | "ready" | "unsupported";
29
+ } | undefined;
30
+ unstable_addSubAccount?: {
31
+ keyTypes: ("address" | "p256" | "webcrypto-p256" | "webauthn-p256")[];
32
+ supported: boolean;
33
+ } | undefined;
34
+ paymasterService?: {
35
+ supported: boolean;
36
+ } | undefined;
37
+ } | undefined;
19
38
  };
20
39
 
21
40
  declare function usePublicClient(args?: UsePublicClientParameters): UsePublicClientReturnType;
22
41
 
23
- export { useBeraAccount, useBeraWallet, usePublicClient };
42
+ export { useBeraAccount, useBeraWallet, useCapabilities, usePublicClient };
@@ -1 +1 @@
1
- import{a,b,c,d,e,f,g,h,i,j,k}from"../chunk-YGBWE4UM.mjs";import"../chunk-ZKXXJYGS.mjs";export{a as useBeraAccount,k as useBeraWagmi,b as useBeraWallet,d as useBlockNumber,e as useChains,f as useConfig,g as useEnsAvatar,h as useEnsName,c as usePublicClient,i as useSwitchChain,j as useTransactionReceipt};
1
+ import{a,b,c,d,e,f,g,h,i,j,k,l}from"../chunk-HH2ZYQRJ.mjs";export{b as useBeraAccount,l as useBeraWagmi,a as useBeraWallet,e as useBlockNumber,c as useCapabilities,f as useChains,g as useConfig,h as useEnsAvatar,i as useEnsName,d as usePublicClient,j as useSwitchChain,k as useTransactionReceipt};