UNPKG

@lido-sdk/react

Version:

This project is being slowly deprecated and may not receive further updates. Check out [modern Lido SDK](https://github.com/lidofinance/lido-ethereum-sdk/pulls) to access latest functionality. It is actively maintained and is built for interacting with Li

20 lines (13 loc) 612 B
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var react = require('react'); var invariant = require('tiny-invariant'); var SDK = require('../context/SDK.js'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var invariant__default = /*#__PURE__*/_interopDefaultLegacy(invariant); const useSDK = () => { const contextValue = react.useContext(SDK.SDKContext); invariant__default["default"](contextValue, 'useSDK was used outside of SDKContext'); return contextValue; }; exports.useSDK = useSDK;