1.0.3 • Published 2 months ago
@honeycomb-finance/shared v1.0.3
Shared
Contains useful functions, contants and hooks, used in anothers packages.
Installation
yarn add @honeycomb-finance/shared
or
npm install @honeycomb-finance/shared
Install below dependancies as its peer dependancies
react
@pangolindex/sdk
Development
yarn install
yarn dev
and keep that terminal running
Getting Start
In your main file wrap your app with HoneycombProvider
and Web3ReactProvider
:
Use version 6.0.9 of @web3-react/core
package.
import { HoneycombProvider } from '@honeycomb-finance/honeycomb-provider';
import { NetworkContextName, useActiveWeb3React } from '@honeycomb-finance/shared';
import { Web3ReactProvider, createWeb3ReactRoot } from '@web3-react/core';
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
const Web3ProviderNetwork = createWeb3ReactRoot(NetworkContextName);
function getLibrary(provider: any): Web3Provider {
try {
const library = new Web3Provider(provider, 'any');
library.pollingInterval = 15000;
return library;
} catch (error) {
return provider;
}
}
// library -> web3.js provider
// chainId -> chain id with which user is connected
// account -> user's connected wallet address
// theme -> optional ( refer Theme guide to customize it )
ReactDOM.render(
<React.StrictMode>
<Web3ReactProvider getLibrary={getLibrary}>
<Web3ProviderNetwork getLibrary={getLibrary}>
<HoneycombProvider library={library} chainId={chainId} account={account} theme={theme}>
<App />
</HoneycombProvider>
</Web3ProviderNetwork>
</Web3ReactProvider>
</React.StrictMode>,
document.getElementById('root'),
);
1.0.2
2 months ago
1.0.3
2 months ago
1.0.1-internal-20231220160144
4 months ago
1.0.1-internal-20231220192401
4 months ago
0.1.0-internal-20231220125716
4 months ago
1.0.1
4 months ago
1.0.1-internal-20231219181808
4 months ago
1.0.0
4 months ago
1.0.0-rc.5
4 months ago
0.1.0-rc.4
5 months ago
0.1.0-internal-20231126132620
5 months ago
0.1.0-rc.3
5 months ago
0.1.0-internal-20231123134049
5 months ago
0.1.0-internal-20231122173717
5 months ago
0.1.0-rc.2
5 months ago
0.1.0-internal-20231120103858
5 months ago
0.1.0-internal-20231115133537
5 months ago
0.1.0-internal-20231108171900
6 months ago
0.1.0-internal-20231108140641
6 months ago
0.1.0-rc.1
6 months ago
0.1.0-internal-20231107124121
6 months ago
0.1.0-internal-20231018134906
6 months ago
0.1.0-rc.0
6 months ago
0.0.1-internal-20231010051505
7 months ago
0.0.1-internal-20230928134042
7 months ago
0.0.1-internal-20230928072245
7 months ago
0.0.1-internal-20230922074227
7 months ago
0.0.1-internal-20230921150858
7 months ago
0.0.1-internal-20230921064423
7 months ago
0.0.1-internal-20230920201500
7 months ago
0.0.1-internal-20230920184619
7 months ago
0.0.1-internal-20230920162910
7 months ago
0.0.1-internal-20230920083758
7 months ago