mirror of
https://github.com/pezkuwichain/pezkuwi-ui.git
synced 2026-06-15 13:01:06 +00:00
Bump dev (w/ eslint adjustments) (#750)
This commit is contained in:
@@ -1,24 +1,12 @@
|
||||
// Copyright 2017-2023 @polkadot/react-qr authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
const ADDRESS_PREFIX = 'substrate';
|
||||
const SEED_PREFIX = 'secret';
|
||||
const FRAME_SIZE = 1024;
|
||||
const SUBSTRATE_ID = new Uint8Array([0x53]);
|
||||
const CRYPTO_SR25519 = new Uint8Array([0x01]);
|
||||
const CMD_SIGN_TX = new Uint8Array([0]);
|
||||
const CMD_SIGN_TX_HASH = new Uint8Array([1]);
|
||||
const CMD_SIGN_IMMORTAL_TX = new Uint8Array([2]);
|
||||
const CMD_SIGN_MSG = new Uint8Array([3]);
|
||||
|
||||
export {
|
||||
ADDRESS_PREFIX,
|
||||
CMD_SIGN_TX,
|
||||
CMD_SIGN_TX_HASH,
|
||||
CMD_SIGN_IMMORTAL_TX,
|
||||
CMD_SIGN_MSG,
|
||||
CRYPTO_SR25519,
|
||||
FRAME_SIZE,
|
||||
SEED_PREFIX,
|
||||
SUBSTRATE_ID
|
||||
};
|
||||
export const ADDRESS_PREFIX = 'substrate';
|
||||
export const SEED_PREFIX = 'secret';
|
||||
export const FRAME_SIZE = 1024;
|
||||
export const SUBSTRATE_ID = new Uint8Array([0x53]);
|
||||
export const CRYPTO_SR25519 = new Uint8Array([0x01]);
|
||||
export const CMD_SIGN_TX = new Uint8Array([0]);
|
||||
export const CMD_SIGN_TX_HASH = new Uint8Array([1]);
|
||||
export const CMD_SIGN_IMMORTAL_TX = new Uint8Array([2]);
|
||||
export const CMD_SIGN_MSG = new Uint8Array([3]);
|
||||
|
||||
@@ -5,6 +5,6 @@ import { Keyring } from './Keyring.js';
|
||||
|
||||
export { packageInfo } from './packageInfo.js';
|
||||
|
||||
const keyring = new Keyring();
|
||||
export const keyring = new Keyring();
|
||||
|
||||
export { Keyring, keyring };
|
||||
export { Keyring };
|
||||
|
||||
@@ -15,26 +15,20 @@ function toHex (address: string): string {
|
||||
);
|
||||
}
|
||||
|
||||
const accountKey = (address: string): string =>
|
||||
`${ACCOUNT_PREFIX}${toHex(address)}`;
|
||||
export function accountKey (address: string): string {
|
||||
return `${ACCOUNT_PREFIX}${toHex(address)}`;
|
||||
}
|
||||
|
||||
const addressKey = (address: string): string =>
|
||||
`${ADDRESS_PREFIX}${toHex(address)}`;
|
||||
export function addressKey (address: string): string {
|
||||
return `${ADDRESS_PREFIX}${toHex(address)}`;
|
||||
}
|
||||
|
||||
const contractKey = (address: string): string =>
|
||||
`${CONTRACT_PREFIX}${toHex(address)}`;
|
||||
export function contractKey (address: string): string {
|
||||
return `${CONTRACT_PREFIX}${toHex(address)}`;
|
||||
}
|
||||
|
||||
const accountRegex = new RegExp(`^${ACCOUNT_PREFIX}0x[0-9a-f]*`, '');
|
||||
export const accountRegex = new RegExp(`^${ACCOUNT_PREFIX}0x[0-9a-f]*`, '');
|
||||
|
||||
const addressRegex = new RegExp(`^${ADDRESS_PREFIX}0x[0-9a-f]*`, '');
|
||||
export const addressRegex = new RegExp(`^${ADDRESS_PREFIX}0x[0-9a-f]*`, '');
|
||||
|
||||
const contractRegex = new RegExp(`^${CONTRACT_PREFIX}0x[0-9a-f]*`, '');
|
||||
|
||||
export {
|
||||
accountKey,
|
||||
accountRegex,
|
||||
addressKey,
|
||||
addressRegex,
|
||||
contractKey,
|
||||
contractRegex
|
||||
};
|
||||
export const contractRegex = new RegExp(`^${CONTRACT_PREFIX}0x[0-9a-f]*`, '');
|
||||
|
||||
@@ -4,4 +4,4 @@
|
||||
import { accountKey } from '../defaults.js';
|
||||
import { genericSubject } from './genericSubject.js';
|
||||
|
||||
export const accounts = genericSubject(accountKey, true);
|
||||
export const accounts = /*#__PURE__*/ genericSubject(accountKey, true);
|
||||
|
||||
@@ -4,4 +4,4 @@
|
||||
import { addressKey } from '../defaults.js';
|
||||
import { genericSubject } from './genericSubject.js';
|
||||
|
||||
export const addresses = genericSubject(addressKey);
|
||||
export const addresses = /*#__PURE__*/ genericSubject(addressKey);
|
||||
|
||||
@@ -4,4 +4,4 @@
|
||||
import { contractKey } from '../defaults.js';
|
||||
import { genericSubject } from './genericSubject.js';
|
||||
|
||||
export const contracts = genericSubject(contractKey);
|
||||
export const contracts = /*#__PURE__*/ genericSubject(contractKey);
|
||||
|
||||
@@ -15,7 +15,7 @@ interface Result {
|
||||
contracts: SubjectInfo;
|
||||
}
|
||||
|
||||
export const obervableAll = combineLatest([
|
||||
export const obervableAll = /*#__PURE__*/ combineLatest([
|
||||
accounts.subject,
|
||||
addresses.subject,
|
||||
contracts.subject
|
||||
|
||||
@@ -6,8 +6,6 @@ import { objectSpread } from '@polkadot/util';
|
||||
|
||||
type ChainDef = string[];
|
||||
|
||||
const chains: Record <string, ChainDef> = selectableNetworks
|
||||
export const chains: Record <string, ChainDef> = /*#__PURE__*/ selectableNetworks
|
||||
.filter((n) => n.genesisHash.length)
|
||||
.reduce((chains, { genesisHash, network }) => objectSpread(chains, { [network]: genesisHash }), {});
|
||||
|
||||
export { chains };
|
||||
|
||||
@@ -3,10 +3,12 @@
|
||||
|
||||
import type { Option } from '../types.js';
|
||||
|
||||
export const ENDPOINTS: Option[] = [{
|
||||
info: 'local',
|
||||
text: 'Local Node (Own, 127.0.0.1:9944)',
|
||||
value: 'ws://127.0.0.1:9944/'
|
||||
}];
|
||||
export const ENDPOINTS: Option[] = [
|
||||
{
|
||||
info: 'local',
|
||||
text: 'Local Node (Own, 127.0.0.1:9944)',
|
||||
value: 'ws://127.0.0.1:9944/'
|
||||
}
|
||||
];
|
||||
|
||||
export const ENDPOINT_DEFAULT = ENDPOINTS[0];
|
||||
|
||||
@@ -3,15 +3,15 @@
|
||||
|
||||
import type { Option } from '../types.js';
|
||||
|
||||
import { CRYPTOS, CRYPTOS_ETH, CRYPTOS_LEDGER } from './crypto.js';
|
||||
import { ENDPOINT_DEFAULT, ENDPOINTS } from './endpoints.js';
|
||||
import { LEDGER_CONN, LEDGER_CONN_DEFAULT } from './ledger.js';
|
||||
import { PREFIX_DEFAULT, PREFIXES } from './ss58.js';
|
||||
import { ICON_DEFAULT, ICON_DEFAULT_HOST, ICONS, NOTIFICATION_DEFAULT, UIMODE_DEFAULT, UIMODES, UITHEME_DEFAULT, UITHEMES } from './ui.js';
|
||||
export { CRYPTOS, CRYPTOS_ETH, CRYPTOS_LEDGER } from './crypto.js';
|
||||
export { ENDPOINT_DEFAULT, ENDPOINTS } from './endpoints.js';
|
||||
export { LEDGER_CONN, LEDGER_CONN_DEFAULT } from './ledger.js';
|
||||
export { PREFIX_DEFAULT, PREFIXES } from './ss58.js';
|
||||
export { ICON_DEFAULT, ICON_DEFAULT_HOST, ICONS, NOTIFICATION_DEFAULT, UIMODE_DEFAULT, UIMODES, UITHEME_DEFAULT, UITHEMES } from './ui.js';
|
||||
|
||||
const CAMERA_DEFAULT = 'off';
|
||||
export const CAMERA_DEFAULT = 'off';
|
||||
|
||||
const CAMERA: Option[] = [
|
||||
export const CAMERA: Option[] = [
|
||||
{
|
||||
info: 'on',
|
||||
text: 'Allow camera access',
|
||||
@@ -24,11 +24,11 @@ const CAMERA: Option[] = [
|
||||
}
|
||||
];
|
||||
|
||||
const LANGUAGE_DEFAULT = 'default';
|
||||
export const LANGUAGE_DEFAULT = 'default';
|
||||
|
||||
const LOCKING_DEFAULT = 'session';
|
||||
export const LOCKING_DEFAULT = 'session';
|
||||
|
||||
const LOCKING: Option[] = [
|
||||
export const LOCKING: Option[] = [
|
||||
{
|
||||
info: 'session',
|
||||
text: 'Once per session',
|
||||
@@ -41,9 +41,9 @@ const LOCKING: Option[] = [
|
||||
}
|
||||
];
|
||||
|
||||
const METADATA_UP_DEFAULT = 'off';
|
||||
export const METADATA_UP_DEFAULT = 'off';
|
||||
|
||||
const METADATA_UP: Option[] = [
|
||||
export const METADATA_UP: Option[] = [
|
||||
{
|
||||
info: 'off',
|
||||
text: 'Do not auto-update extension metadata',
|
||||
@@ -56,9 +56,9 @@ const METADATA_UP: Option[] = [
|
||||
}
|
||||
];
|
||||
|
||||
const STORAGE_DEFAULT = 'off';
|
||||
export const STORAGE_DEFAULT = 'off';
|
||||
|
||||
const STORAGE: Option[] = [
|
||||
export const STORAGE: Option[] = [
|
||||
{
|
||||
info: 'on',
|
||||
text: 'Allow local in-browser account storage',
|
||||
@@ -70,32 +70,3 @@ const STORAGE: Option[] = [
|
||||
value: 'off'
|
||||
}
|
||||
];
|
||||
|
||||
export {
|
||||
CAMERA_DEFAULT,
|
||||
CAMERA,
|
||||
CRYPTOS,
|
||||
CRYPTOS_ETH,
|
||||
CRYPTOS_LEDGER,
|
||||
ENDPOINT_DEFAULT,
|
||||
ENDPOINTS,
|
||||
ICON_DEFAULT,
|
||||
ICON_DEFAULT_HOST,
|
||||
ICONS,
|
||||
LANGUAGE_DEFAULT,
|
||||
LEDGER_CONN_DEFAULT,
|
||||
LEDGER_CONN,
|
||||
LOCKING_DEFAULT,
|
||||
LOCKING,
|
||||
METADATA_UP,
|
||||
METADATA_UP_DEFAULT,
|
||||
NOTIFICATION_DEFAULT,
|
||||
PREFIX_DEFAULT,
|
||||
PREFIXES,
|
||||
STORAGE,
|
||||
STORAGE_DEFAULT,
|
||||
UIMODE_DEFAULT,
|
||||
UIMODES,
|
||||
UITHEME_DEFAULT,
|
||||
UITHEMES
|
||||
};
|
||||
|
||||
@@ -5,13 +5,13 @@ import type { Option } from '../types.js';
|
||||
|
||||
import { isPolkadot } from './type.js';
|
||||
|
||||
const LANGUAGE_DEFAULT = 'default';
|
||||
export const LANGUAGE_DEFAULT = 'default';
|
||||
|
||||
const UIMODE_DEFAULT = !isPolkadot && typeof window !== 'undefined' && window.location.host.includes('ui-light')
|
||||
export const UIMODE_DEFAULT = !isPolkadot && typeof window !== 'undefined' && window.location.host.includes('ui-light')
|
||||
? 'light'
|
||||
: 'full';
|
||||
|
||||
const UIMODES: Option[] = [
|
||||
export const UIMODES: Option[] = [
|
||||
{
|
||||
info: 'full',
|
||||
text: 'Fully featured',
|
||||
@@ -24,11 +24,11 @@ const UIMODES: Option[] = [
|
||||
}
|
||||
];
|
||||
|
||||
const UITHEME_DEFAULT = isPolkadot
|
||||
export const UITHEME_DEFAULT = isPolkadot
|
||||
? 'polkadot'
|
||||
: 'substrate';
|
||||
|
||||
const UITHEMES: Option[] = [
|
||||
export const UITHEMES: Option[] = [
|
||||
{
|
||||
info: 'polkadot',
|
||||
text: 'Polkadot',
|
||||
@@ -41,13 +41,13 @@ const UITHEMES: Option[] = [
|
||||
}
|
||||
];
|
||||
|
||||
const ICON_DEFAULT = 'default';
|
||||
export const ICON_DEFAULT = 'default';
|
||||
|
||||
const ICON_DEFAULT_HOST = isPolkadot
|
||||
export const ICON_DEFAULT_HOST = isPolkadot
|
||||
? 'polkadot'
|
||||
: 'substrate';
|
||||
|
||||
const ICONS: Option[] = [
|
||||
export const ICONS: Option[] = [
|
||||
{
|
||||
info: 'default',
|
||||
text: 'Default for the connected node',
|
||||
@@ -70,16 +70,4 @@ const ICONS: Option[] = [
|
||||
}
|
||||
];
|
||||
|
||||
const NOTIFICATION_DEFAULT = 'popup';
|
||||
|
||||
export {
|
||||
ICON_DEFAULT,
|
||||
ICON_DEFAULT_HOST,
|
||||
ICONS,
|
||||
LANGUAGE_DEFAULT,
|
||||
NOTIFICATION_DEFAULT,
|
||||
UIMODE_DEFAULT,
|
||||
UIMODES,
|
||||
UITHEME_DEFAULT,
|
||||
UITHEMES
|
||||
};
|
||||
export const NOTIFICATION_DEFAULT = 'popup';
|
||||
|
||||
Reference in New Issue
Block a user