@reef-knot/web3-react 1.0.1 → 1.0.2
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/context/connectors.d.ts +3 -3
- package/dist/context/connectors.d.ts.map +1 -1
- package/dist/context/connectors.js +3 -6
- package/dist/context/web3.d.ts +2 -2
- package/dist/context/web3.d.ts.map +1 -1
- package/dist/context/web3.js +7 -16
- package/dist/hooks/useConnectors.js +0 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { InjectedConnector } from '@web3-react/injected-connector';
|
|
3
3
|
import { WalletLinkConnector } from '@web3-react/walletlink-connector';
|
|
4
4
|
import { SafeAppConnector } from '@gnosis.pm/safe-apps-web3-react';
|
|
@@ -20,7 +20,7 @@ export type ConnectorsContextValue = {
|
|
|
20
20
|
gnosis?: SafeAppConnector;
|
|
21
21
|
};
|
|
22
22
|
export type Connector = keyof ConnectorsContextValue;
|
|
23
|
-
export declare const ConnectorsContext:
|
|
24
|
-
declare const _default:
|
|
23
|
+
export declare const ConnectorsContext: React.Context<ConnectorsContextValue>;
|
|
24
|
+
declare const _default: React.MemoExoticComponent<React.FC<ConnectorsContextProps>>;
|
|
25
25
|
export default _default;
|
|
26
26
|
//# sourceMappingURL=connectors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connectors.d.ts","sourceRoot":"","sources":["../../src/context/connectors.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"connectors.d.ts","sourceRoot":"","sources":["../../src/context/connectors.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAK5D,MAAM,WAAW,sBAAsB;IACrC,cAAc,EAAE,MAAM,CAAC;IACvB,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,UAAU,EAAE,mBAAmB,CAAC;IAChC,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,UAAU,EAAE,sBAAsB,CAAC;IACnC,MAAM,EAAE,iBAAiB,CAAC;IAC1B,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,MAAM,sBAAsB,CAAC;AAErD,eAAO,MAAM,iBAAiB,uCAA8C,CAAC;;AA+E7E,wBAAoE"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { memo, createContext, useMemo } from 'react';
|
|
1
|
+
import React, { memo, createContext, useMemo } from 'react';
|
|
3
2
|
import { InjectedConnector } from '@web3-react/injected-connector';
|
|
4
3
|
import { WalletLinkConnector } from '@web3-react/walletlink-connector';
|
|
5
4
|
import { SafeAppConnector } from '@gnosis.pm/safe-apps-web3-react';
|
|
@@ -68,11 +67,9 @@ var ProviderConnectors = props => {
|
|
|
68
67
|
})
|
|
69
68
|
}), [appLogoUrl, appName, rpc, defaultChainId, supportedChainIds]);
|
|
70
69
|
useAutoConnect(connectors);
|
|
71
|
-
return
|
|
70
|
+
return /*#__PURE__*/React.createElement(ConnectorsContext.Provider, {
|
|
72
71
|
value: connectors
|
|
73
|
-
},
|
|
74
|
-
children: children
|
|
75
|
-
}));
|
|
72
|
+
}, children);
|
|
76
73
|
};
|
|
77
74
|
const ProviderConnectors$1 = /*#__PURE__*/memo(ProviderConnectors);
|
|
78
75
|
|
package/dist/context/web3.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { CHAINS } from '@lido-sdk/constants';
|
|
3
3
|
import { SWRConfiguration } from 'swr';
|
|
4
4
|
import { ConnectorsContextProps } from './connectors';
|
|
@@ -9,6 +9,6 @@ export interface ProviderWeb3Props extends ConnectorsContextProps {
|
|
|
9
9
|
pollingInterval?: number;
|
|
10
10
|
onError?: (error: unknown) => void;
|
|
11
11
|
}
|
|
12
|
-
declare const _default:
|
|
12
|
+
declare const _default: React.MemoExoticComponent<React.FC<ProviderWeb3Props>>;
|
|
13
13
|
export default _default;
|
|
14
14
|
//# sourceMappingURL=web3.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web3.d.ts","sourceRoot":"","sources":["../../src/context/web3.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"web3.d.ts","sourceRoot":"","sources":["../../src/context/web3.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAOxC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAI7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAC;AAEvC,OAA2B,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAE1E,MAAM,WAAW,iBAAkB,SAAQ,sBAAsB;IAC/D,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACpC;;AAiED,wBAAyD"}
|
package/dist/context/web3.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { __rest } from '../_virtual/_tslib.js';
|
|
2
|
-
import {
|
|
3
|
-
import { memo } from 'react';
|
|
2
|
+
import React, { memo } from 'react';
|
|
4
3
|
import invariant from 'tiny-invariant';
|
|
5
4
|
import { Web3Provider } from '@ethersproject/providers';
|
|
6
5
|
import { CHAINS } from '@lido-sdk/constants';
|
|
@@ -34,16 +33,14 @@ var ProviderSDK = props => {
|
|
|
34
33
|
invariant(rpc[CHAINS.Mainnet], 'RPC url for mainnet is not provided');
|
|
35
34
|
var providerRpc = getStaticRpcBatchProvider(chainId, rpc[chainId], 0, pollingInterval);
|
|
36
35
|
var providerMainnetRpc = getStaticRpcBatchProvider(CHAINS.Mainnet, rpc[CHAINS.Mainnet], 0, pollingInterval);
|
|
37
|
-
return
|
|
36
|
+
return /*#__PURE__*/React.createElement(ProviderSDK$1, Object.assign({
|
|
38
37
|
chainId: chainId,
|
|
39
38
|
supportedChainIds: supportedChainIds,
|
|
40
39
|
providerWeb3: library,
|
|
41
40
|
providerRpc: providerRpc,
|
|
42
41
|
providerMainnetRpc: providerMainnetRpc,
|
|
43
42
|
account: account !== null && account !== void 0 ? account : undefined
|
|
44
|
-
}, rest,
|
|
45
|
-
children: children
|
|
46
|
-
}));
|
|
43
|
+
}, rest), children);
|
|
47
44
|
};
|
|
48
45
|
var ProviderWeb3 = props => {
|
|
49
46
|
var {
|
|
@@ -62,17 +59,11 @@ var ProviderWeb3 = props => {
|
|
|
62
59
|
appLogoUrl,
|
|
63
60
|
defaultChainId
|
|
64
61
|
};
|
|
65
|
-
return
|
|
62
|
+
return /*#__PURE__*/React.createElement(Web3ReactProvider, {
|
|
66
63
|
getLibrary: getLibrary
|
|
67
|
-
}, {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}, sdkProps, {
|
|
71
|
-
children: jsx(ProviderConnectors, Object.assign({}, connectorsProps, {
|
|
72
|
-
children: children
|
|
73
|
-
}))
|
|
74
|
-
}))
|
|
75
|
-
}));
|
|
64
|
+
}, /*#__PURE__*/React.createElement(ProviderSDK, Object.assign({
|
|
65
|
+
rpc: rpc
|
|
66
|
+
}, sdkProps), /*#__PURE__*/React.createElement(ProviderConnectors, Object.assign({}, connectorsProps), children)));
|
|
76
67
|
};
|
|
77
68
|
const web3 = /*#__PURE__*/memo(ProviderWeb3);
|
|
78
69
|
|