@reef-chain/react-lib 2.5.3 → 2.5.5
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/components/AccountSelector/AccountSelector.d.ts +6 -4
- package/dist/components/AccountSelector/MetaMaskIcon.d.ts +5 -0
- package/dist/hooks/useInitReefState.d.ts +5 -4
- package/dist/hooks/useInjectExtension.d.ts +6 -3
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +4 -4
- package/dist/index.modern.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import "./AccountSelector.css";
|
|
2
2
|
import { AccountCreationData } from "@reef-chain/ui-kit/dist/ui-kit/components/organisms/AccountSelector/AccountSelector";
|
|
3
3
|
import { ReefSigner } from "../../state";
|
|
4
|
+
import { extension as reefExt } from "@reef-chain/util-lib";
|
|
4
5
|
export type Network = "mainnet" | "testnet";
|
|
5
6
|
export type Language = "en" | "hi";
|
|
6
7
|
interface AccountSelector {
|
|
8
|
+
injectedExtensions?: reefExt.InjectedExtension[];
|
|
9
|
+
selExtName?: string;
|
|
10
|
+
selectExtension?: (name: string) => void;
|
|
7
11
|
accounts: ReefSigner[];
|
|
8
12
|
selectedSigner?: ReefSigner;
|
|
9
13
|
selectAccount: (index: number, signer: ReefSigner) => void;
|
|
@@ -14,15 +18,13 @@ interface AccountSelector {
|
|
|
14
18
|
showBalance?: (...args: any[]) => any;
|
|
15
19
|
availableNetworks: Network[];
|
|
16
20
|
showSnapOptions?: boolean;
|
|
17
|
-
isDefaultWallet?: boolean;
|
|
18
21
|
onRename?: (address: string, newName: string) => any;
|
|
19
|
-
onExport?: (address: string) => any;
|
|
22
|
+
onExport?: (address: string, password: string) => any;
|
|
20
23
|
onImport?: (...args: any[]) => any;
|
|
21
24
|
onForget?: (address: string) => any;
|
|
22
|
-
onDefaultWalletSelect?: (isDefault: boolean) => any;
|
|
23
25
|
onUpdateMetadata?: (network: Network) => any;
|
|
24
26
|
onStartAccountCreation?: () => Promise<AccountCreationData>;
|
|
25
27
|
onConfirmAccountCreation?: (seed: string, name: string) => any;
|
|
26
28
|
}
|
|
27
|
-
export declare const AccountSelector: ({ selectedSigner, accounts, selectAccount, selectedNetwork, onNetworkSelect, onLanguageSelect, isBalanceHidden, showBalance, availableNetworks, showSnapOptions,
|
|
29
|
+
export declare const AccountSelector: ({ selectedSigner, injectedExtensions, selExtName, selectExtension, accounts, selectAccount, selectedNetwork, onNetworkSelect, onLanguageSelect, isBalanceHidden, showBalance, availableNetworks, showSnapOptions, onRename, onExport, onImport, onForget, onUpdateMetadata, onStartAccountCreation, onConfirmAccountCreation, }: AccountSelector) => JSX.Element;
|
|
28
30
|
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { reefState, network as nw, extension as extReef } from
|
|
2
|
-
import { Provider } from
|
|
3
|
-
import { ReefSigner } from
|
|
1
|
+
import { reefState, network as nw, extension as extReef } from "@reef-chain/util-lib";
|
|
2
|
+
import { Provider } from "@reef-chain/evm-provider";
|
|
3
|
+
import { ReefSigner } from "../state";
|
|
4
4
|
type Network = nw.Network;
|
|
5
|
+
export declare const SELECTED_ADDRESS_IDENT = "selected_address_reef";
|
|
5
6
|
interface State {
|
|
6
7
|
error: {
|
|
7
8
|
code?: number;
|
|
@@ -14,7 +15,7 @@ interface State {
|
|
|
14
15
|
signers: ReefSigner[];
|
|
15
16
|
selectedReefSigner?: ReefSigner;
|
|
16
17
|
reefState: any;
|
|
17
|
-
|
|
18
|
+
extensions: extReef.InjectedExtension[];
|
|
18
19
|
}
|
|
19
20
|
export interface InitReefStateOptions {
|
|
20
21
|
network?: Network;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { extension as extReef } from
|
|
1
|
+
import { extension as extReef } from "@reef-chain/util-lib";
|
|
2
|
+
export interface ExtensionWithAccounts {
|
|
3
|
+
extension: extReef.InjectedExtension;
|
|
4
|
+
accounts: extReef.InjectedAccountWithMeta[];
|
|
5
|
+
}
|
|
2
6
|
export declare const useInjectExtension: (appDisplayName: string) => [
|
|
3
|
-
|
|
4
|
-
extReef.InjectedExtension | undefined,
|
|
7
|
+
ExtensionWithAccounts[],
|
|
5
8
|
boolean,
|
|
6
9
|
{
|
|
7
10
|
code?: number;
|