@pezkuwi/ui-keyring 3.16.6
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/README.md +136 -0
- package/build/Base.d.ts +30 -0
- package/build/Base.js +109 -0
- package/build/Keyring.d.ts +49 -0
- package/build/Keyring.js +304 -0
- package/build/LICENSE +201 -0
- package/build/README.md +136 -0
- package/build/bundle-pezkuwi-ui-keyring.js +2751 -0
- package/build/bundle.d.ts +4 -0
- package/build/bundle.js +4 -0
- package/build/cjs/Base.d.ts +30 -0
- package/build/cjs/Base.js +113 -0
- package/build/cjs/Keyring.d.ts +49 -0
- package/build/cjs/Keyring.js +308 -0
- package/build/cjs/bundle.d.ts +4 -0
- package/build/cjs/bundle.js +8 -0
- package/build/cjs/defaults.d.ts +6 -0
- package/build/cjs/defaults.js +28 -0
- package/build/cjs/index.d.ts +4 -0
- package/build/cjs/index.js +7 -0
- package/build/cjs/observable/accounts.d.ts +1 -0
- package/build/cjs/observable/accounts.js +6 -0
- package/build/cjs/observable/addresses.d.ts +1 -0
- package/build/cjs/observable/addresses.js +6 -0
- package/build/cjs/observable/contracts.d.ts +1 -0
- package/build/cjs/observable/contracts.js +6 -0
- package/build/cjs/observable/env.d.ts +6 -0
- package/build/cjs/observable/env.js +12 -0
- package/build/cjs/observable/genericSubject.d.ts +2 -0
- package/build/cjs/observable/genericSubject.js +47 -0
- package/build/cjs/observable/index.d.ts +8 -0
- package/build/cjs/observable/index.js +16 -0
- package/build/cjs/observable/types.d.ts +15 -0
- package/build/cjs/observable/types.js +2 -0
- package/build/cjs/options/index.d.ts +15 -0
- package/build/cjs/options/index.js +116 -0
- package/build/cjs/options/item.d.ts +2 -0
- package/build/cjs/options/item.js +16 -0
- package/build/cjs/options/types.d.ts +15 -0
- package/build/cjs/options/types.js +2 -0
- package/build/cjs/package.json +3 -0
- package/build/cjs/packageDetect.d.ts +1 -0
- package/build/cjs/packageDetect.js +6 -0
- package/build/cjs/packageInfo.d.ts +6 -0
- package/build/cjs/packageInfo.js +4 -0
- package/build/cjs/stores/Browser.d.ts +7 -0
- package/build/cjs/stores/Browser.js +24 -0
- package/build/cjs/stores/File.d.ts +12 -0
- package/build/cjs/stores/File.js +72 -0
- package/build/cjs/stores/index.d.ts +2 -0
- package/build/cjs/stores/index.js +7 -0
- package/build/cjs/types.d.ts +78 -0
- package/build/cjs/types.js +2 -0
- package/build/defaults.d.ts +6 -0
- package/build/defaults.js +22 -0
- package/build/index.d.ts +4 -0
- package/build/index.js +4 -0
- package/build/observable/accounts.d.ts +1 -0
- package/build/observable/accounts.js +3 -0
- package/build/observable/addresses.d.ts +1 -0
- package/build/observable/addresses.js +3 -0
- package/build/observable/contracts.d.ts +1 -0
- package/build/observable/contracts.js +3 -0
- package/build/observable/env.d.ts +6 -0
- package/build/observable/env.js +9 -0
- package/build/observable/genericSubject.d.ts +2 -0
- package/build/observable/genericSubject.js +44 -0
- package/build/observable/index.d.ts +8 -0
- package/build/observable/index.js +13 -0
- package/build/observable/types.d.ts +15 -0
- package/build/observable/types.js +1 -0
- package/build/options/index.d.ts +15 -0
- package/build/options/index.js +112 -0
- package/build/options/item.d.ts +2 -0
- package/build/options/item.js +13 -0
- package/build/options/types.d.ts +15 -0
- package/build/options/types.js +1 -0
- package/build/package.json +355 -0
- package/build/packageDetect.d.ts +1 -0
- package/build/packageDetect.js +4 -0
- package/build/packageInfo.d.ts +6 -0
- package/build/packageInfo.js +1 -0
- package/build/stores/Browser.d.ts +7 -0
- package/build/stores/Browser.js +19 -0
- package/build/stores/File.d.ts +12 -0
- package/build/stores/File.js +67 -0
- package/build/stores/index.d.ts +2 -0
- package/build/stores/index.js +2 -0
- package/build/types.d.ts +78 -0
- package/build/types.js +1 -0
- package/build-tsc/Base.d.ts +30 -0
- package/build-tsc/Keyring.d.ts +49 -0
- package/build-tsc/bundle.d.ts +4 -0
- package/build-tsc/defaults.d.ts +6 -0
- package/build-tsc/index.d.ts +4 -0
- package/build-tsc/observable/accounts.d.ts +1 -0
- package/build-tsc/observable/addresses.d.ts +1 -0
- package/build-tsc/observable/contracts.d.ts +1 -0
- package/build-tsc/observable/env.d.ts +6 -0
- package/build-tsc/observable/genericSubject.d.ts +2 -0
- package/build-tsc/observable/index.d.ts +8 -0
- package/build-tsc/observable/types.d.ts +15 -0
- package/build-tsc/options/index.d.ts +15 -0
- package/build-tsc/options/item.d.ts +2 -0
- package/build-tsc/options/types.d.ts +15 -0
- package/build-tsc/packageDetect.d.ts +1 -0
- package/build-tsc/packageInfo.d.ts +6 -0
- package/build-tsc/stores/Browser.d.ts +7 -0
- package/build-tsc/stores/File.d.ts +12 -0
- package/build-tsc/stores/index.d.ts +2 -0
- package/build-tsc/types.d.ts +78 -0
- package/build-tsc-cjs/Base.js +113 -0
- package/build-tsc-cjs/Keyring.js +308 -0
- package/build-tsc-cjs/bundle.js +8 -0
- package/build-tsc-cjs/defaults.js +28 -0
- package/build-tsc-cjs/index.js +7 -0
- package/build-tsc-cjs/observable/accounts.js +6 -0
- package/build-tsc-cjs/observable/addresses.js +6 -0
- package/build-tsc-cjs/observable/contracts.js +6 -0
- package/build-tsc-cjs/observable/env.js +12 -0
- package/build-tsc-cjs/observable/genericSubject.js +47 -0
- package/build-tsc-cjs/observable/index.js +16 -0
- package/build-tsc-cjs/observable/types.js +2 -0
- package/build-tsc-cjs/options/index.js +116 -0
- package/build-tsc-cjs/options/item.js +16 -0
- package/build-tsc-cjs/options/types.js +2 -0
- package/build-tsc-cjs/packageDetect.js +6 -0
- package/build-tsc-cjs/packageInfo.js +4 -0
- package/build-tsc-cjs/stores/Browser.js +24 -0
- package/build-tsc-cjs/stores/File.js +72 -0
- package/build-tsc-cjs/stores/index.js +7 -0
- package/build-tsc-cjs/types.js +2 -0
- package/build-tsc-esm/Base.js +109 -0
- package/build-tsc-esm/Keyring.js +304 -0
- package/build-tsc-esm/bundle.js +4 -0
- package/build-tsc-esm/defaults.js +22 -0
- package/build-tsc-esm/index.js +4 -0
- package/build-tsc-esm/observable/accounts.js +3 -0
- package/build-tsc-esm/observable/addresses.js +3 -0
- package/build-tsc-esm/observable/contracts.js +3 -0
- package/build-tsc-esm/observable/env.js +9 -0
- package/build-tsc-esm/observable/genericSubject.js +44 -0
- package/build-tsc-esm/observable/index.js +13 -0
- package/build-tsc-esm/observable/types.js +1 -0
- package/build-tsc-esm/options/index.js +112 -0
- package/build-tsc-esm/options/item.js +13 -0
- package/build-tsc-esm/options/types.js +1 -0
- package/build-tsc-esm/packageDetect.js +4 -0
- package/build-tsc-esm/packageInfo.js +1 -0
- package/build-tsc-esm/stores/Browser.js +19 -0
- package/build-tsc-esm/stores/File.js +67 -0
- package/build-tsc-esm/stores/index.js +2 -0
- package/build-tsc-esm/types.js +1 -0
- package/package.json +41 -0
- package/src/Base.ts +156 -0
- package/src/Keyring.ts +420 -0
- package/src/bundle.ts +10 -0
- package/src/defaults.ts +34 -0
- package/src/index.ts +10 -0
- package/src/json.d.ts +11 -0
- package/src/observable/accounts.ts +7 -0
- package/src/observable/addresses.ts +7 -0
- package/src/observable/contracts.ts +7 -0
- package/src/observable/env.ts +15 -0
- package/src/observable/genericSubject.ts +66 -0
- package/src/observable/index.ts +28 -0
- package/src/observable/types.ts +21 -0
- package/src/options/index.ts +150 -0
- package/src/options/item.ts +22 -0
- package/src/options/types.ts +23 -0
- package/src/packageDetect.ts +12 -0
- package/src/packageInfo.ts +6 -0
- package/src/stores/Browser.ts +28 -0
- package/src/stores/File.ts +94 -0
- package/src/stores/index.ts +5 -0
- package/src/types.ts +91 -0
- package/tsconfig.build.json +14 -0
- package/tsconfig.build.tsbuildinfo +1 -0
- package/tsconfig.spec.json +16 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { combineLatest, map } from 'rxjs';
|
|
2
|
+
import { accounts } from './accounts.js';
|
|
3
|
+
import { addresses } from './addresses.js';
|
|
4
|
+
import { contracts } from './contracts.js';
|
|
5
|
+
export const obervableAll = /*#__PURE__*/ combineLatest([
|
|
6
|
+
accounts.subject,
|
|
7
|
+
addresses.subject,
|
|
8
|
+
contracts.subject
|
|
9
|
+
]).pipe(map(([accounts, addresses, contracts]) => ({
|
|
10
|
+
accounts,
|
|
11
|
+
addresses,
|
|
12
|
+
contracts
|
|
13
|
+
})));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { BehaviorSubject } from 'rxjs';
|
|
2
|
+
import type { KeypairType } from '@pezkuwi/util-crypto/types';
|
|
3
|
+
import type { KeyringSectionOption } from '../options/types.js';
|
|
4
|
+
import type { KeyringJson, KeyringStore } from '../types.js';
|
|
5
|
+
export interface SingleAddress {
|
|
6
|
+
json: KeyringJson;
|
|
7
|
+
option: KeyringSectionOption;
|
|
8
|
+
type?: KeypairType | undefined;
|
|
9
|
+
}
|
|
10
|
+
export type SubjectInfo = Record<string, SingleAddress>;
|
|
11
|
+
export interface AddressSubject {
|
|
12
|
+
add: (store: KeyringStore, address: string, json: KeyringJson, type?: KeypairType) => SingleAddress;
|
|
13
|
+
remove: (store: KeyringStore, address: string) => void;
|
|
14
|
+
subject: BehaviorSubject<SubjectInfo>;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { KeyringStruct } from '../types.js';
|
|
2
|
+
import type { KeyringOptionInstance, KeyringOptions, KeyringSectionOption } from './types.js';
|
|
3
|
+
import { BehaviorSubject } from 'rxjs';
|
|
4
|
+
export declare class KeyringOption implements KeyringOptionInstance {
|
|
5
|
+
#private;
|
|
6
|
+
readonly optionsSubject: BehaviorSubject<KeyringOptions>;
|
|
7
|
+
createOptionHeader(name: string): KeyringSectionOption;
|
|
8
|
+
init(keyring: KeyringStruct): void;
|
|
9
|
+
clear(): void;
|
|
10
|
+
private linkItems;
|
|
11
|
+
private addAccounts;
|
|
12
|
+
private addAddresses;
|
|
13
|
+
private addContracts;
|
|
14
|
+
private emptyOptions;
|
|
15
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { BehaviorSubject } from 'rxjs';
|
|
2
|
+
import { obervableAll } from '../observable/index.js';
|
|
3
|
+
let hasCalledInitOptions = false;
|
|
4
|
+
const sortByName = (a, b) => {
|
|
5
|
+
const valueA = a.option.name;
|
|
6
|
+
const valueB = b.option.name;
|
|
7
|
+
return valueA.localeCompare(valueB);
|
|
8
|
+
};
|
|
9
|
+
const sortByCreated = (a, b) => {
|
|
10
|
+
const valueA = a.json.meta.whenCreated || 0;
|
|
11
|
+
const valueB = b.json.meta.whenCreated || 0;
|
|
12
|
+
if (valueA < valueB) {
|
|
13
|
+
return 1;
|
|
14
|
+
}
|
|
15
|
+
if (valueA > valueB) {
|
|
16
|
+
return -1;
|
|
17
|
+
}
|
|
18
|
+
return 0;
|
|
19
|
+
};
|
|
20
|
+
export class KeyringOption {
|
|
21
|
+
#allSub = null;
|
|
22
|
+
optionsSubject = new BehaviorSubject(this.emptyOptions());
|
|
23
|
+
createOptionHeader(name) {
|
|
24
|
+
return {
|
|
25
|
+
key: `header-${name.toLowerCase()}`,
|
|
26
|
+
name,
|
|
27
|
+
value: null
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
init(keyring) {
|
|
31
|
+
if (hasCalledInitOptions) {
|
|
32
|
+
throw new Error('Unable to initialise options more than once');
|
|
33
|
+
}
|
|
34
|
+
this.#allSub = obervableAll.subscribe(() => {
|
|
35
|
+
const opts = this.emptyOptions();
|
|
36
|
+
this.addAccounts(keyring, opts);
|
|
37
|
+
this.addAddresses(keyring, opts);
|
|
38
|
+
this.addContracts(keyring, opts);
|
|
39
|
+
opts.address = this.linkItems({ Addresses: opts.address, Recent: opts.recent });
|
|
40
|
+
opts.account = this.linkItems({ Accounts: opts.account, Development: opts.testing });
|
|
41
|
+
opts.contract = this.linkItems({ Contracts: opts.contract });
|
|
42
|
+
opts.all = [].concat(opts.account, opts.address);
|
|
43
|
+
opts.allPlus = [].concat(opts.account, opts.address, opts.contract);
|
|
44
|
+
this.optionsSubject.next(opts);
|
|
45
|
+
});
|
|
46
|
+
hasCalledInitOptions = true;
|
|
47
|
+
}
|
|
48
|
+
clear() {
|
|
49
|
+
if (this.#allSub) {
|
|
50
|
+
this.#allSub.unsubscribe();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
linkItems(items) {
|
|
54
|
+
return Object.keys(items).reduce((result, header) => {
|
|
55
|
+
const options = items[header];
|
|
56
|
+
return result.concat(options.length
|
|
57
|
+
? [this.createOptionHeader(header)]
|
|
58
|
+
: [], options);
|
|
59
|
+
}, []);
|
|
60
|
+
}
|
|
61
|
+
addAccounts(keyring, options) {
|
|
62
|
+
const available = keyring.accounts.subject.getValue();
|
|
63
|
+
Object
|
|
64
|
+
.values(available)
|
|
65
|
+
.sort(sortByName)
|
|
66
|
+
.forEach(({ json: { meta: { isTesting = false } }, option }) => {
|
|
67
|
+
if (!isTesting) {
|
|
68
|
+
options.account.push(option);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
options.testing.push(option);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
addAddresses(keyring, options) {
|
|
76
|
+
const available = keyring.addresses.subject.getValue();
|
|
77
|
+
Object
|
|
78
|
+
.values(available)
|
|
79
|
+
.filter(({ json }) => !!json.meta.isRecent)
|
|
80
|
+
.sort(sortByCreated)
|
|
81
|
+
.forEach(({ option }) => {
|
|
82
|
+
options.recent.push(option);
|
|
83
|
+
});
|
|
84
|
+
Object
|
|
85
|
+
.values(available)
|
|
86
|
+
.filter(({ json }) => !json.meta.isRecent)
|
|
87
|
+
.sort(sortByName)
|
|
88
|
+
.forEach(({ option }) => {
|
|
89
|
+
options.address.push(option);
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
addContracts(keyring, options) {
|
|
93
|
+
const available = keyring.contracts.subject.getValue();
|
|
94
|
+
Object
|
|
95
|
+
.values(available)
|
|
96
|
+
.sort(sortByName)
|
|
97
|
+
.forEach(({ option }) => {
|
|
98
|
+
options.contract.push(option);
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
emptyOptions() {
|
|
102
|
+
return {
|
|
103
|
+
account: [],
|
|
104
|
+
address: [],
|
|
105
|
+
all: [],
|
|
106
|
+
allPlus: [],
|
|
107
|
+
contract: [],
|
|
108
|
+
recent: [],
|
|
109
|
+
testing: []
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { isUndefined } from '@pezkuwi/util';
|
|
2
|
+
export function createOptionItem(address, _name) {
|
|
3
|
+
const name = isUndefined(_name)
|
|
4
|
+
? ((address.length > 15)
|
|
5
|
+
? `${address.slice(0, 6)}…${address.slice(-6)}`
|
|
6
|
+
: address)
|
|
7
|
+
: _name;
|
|
8
|
+
return {
|
|
9
|
+
key: address,
|
|
10
|
+
name,
|
|
11
|
+
value: address
|
|
12
|
+
};
|
|
13
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { KeyringItemType, KeyringStruct } from '../types.js';
|
|
2
|
+
export interface KeyringSectionOption {
|
|
3
|
+
key: string | null;
|
|
4
|
+
name: string;
|
|
5
|
+
value: string | null;
|
|
6
|
+
}
|
|
7
|
+
export type KeyringSectionOptions = KeyringSectionOption[];
|
|
8
|
+
export type KeyringOptions = {
|
|
9
|
+
[type in KeyringItemType | 'all' | 'allPlus' | 'recent' | 'testing']: KeyringSectionOptions;
|
|
10
|
+
};
|
|
11
|
+
export type KeyringOption$Type = keyof KeyringOptions;
|
|
12
|
+
export interface KeyringOptionInstance {
|
|
13
|
+
createOptionHeader: (name: string) => KeyringSectionOption;
|
|
14
|
+
init: (keyring: KeyringStruct) => void;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
{
|
|
2
|
+
"author": "Jaco Greeff <jacogr@gmail.com>",
|
|
3
|
+
"bugs": "https://github.com/pezkuwichain/ui/issues",
|
|
4
|
+
"engines": {
|
|
5
|
+
"node": ">=18"
|
|
6
|
+
},
|
|
7
|
+
"homepage": "https://github.com/pezkuwichain/ui/tree/master/packages/ui-keyring#readme",
|
|
8
|
+
"license": "Apache-2.0",
|
|
9
|
+
"name": "@pezkuwi/ui-keyring",
|
|
10
|
+
"repository": {
|
|
11
|
+
"directory": "packages/ui-keyring",
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/pezkuwichain/ui.git"
|
|
14
|
+
},
|
|
15
|
+
"sideEffects": [
|
|
16
|
+
"./packageDetect.js",
|
|
17
|
+
"./cjs/packageDetect.js"
|
|
18
|
+
],
|
|
19
|
+
"type": "module",
|
|
20
|
+
"version": "3.16.6",
|
|
21
|
+
"main": "./cjs/index.js",
|
|
22
|
+
"module": "./index.js",
|
|
23
|
+
"types": "./index.d.ts",
|
|
24
|
+
"exports": {
|
|
25
|
+
"./cjs/package.json": "./cjs/package.json",
|
|
26
|
+
"./cjs/*": "./cjs/*.js",
|
|
27
|
+
".": {
|
|
28
|
+
"module": {
|
|
29
|
+
"types": "./index.d.ts",
|
|
30
|
+
"default": "./index.js"
|
|
31
|
+
},
|
|
32
|
+
"require": {
|
|
33
|
+
"types": "./cjs/index.d.ts",
|
|
34
|
+
"default": "./cjs/index.js"
|
|
35
|
+
},
|
|
36
|
+
"default": {
|
|
37
|
+
"types": "./index.d.ts",
|
|
38
|
+
"default": "./index.js"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"./Base": {
|
|
42
|
+
"module": {
|
|
43
|
+
"types": "./Base.d.ts",
|
|
44
|
+
"default": "./Base.js"
|
|
45
|
+
},
|
|
46
|
+
"require": {
|
|
47
|
+
"types": "./cjs/Base.d.ts",
|
|
48
|
+
"default": "./cjs/Base.js"
|
|
49
|
+
},
|
|
50
|
+
"default": {
|
|
51
|
+
"types": "./Base.d.ts",
|
|
52
|
+
"default": "./Base.js"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"./bundle": {
|
|
56
|
+
"module": {
|
|
57
|
+
"types": "./bundle.d.ts",
|
|
58
|
+
"default": "./bundle.js"
|
|
59
|
+
},
|
|
60
|
+
"require": {
|
|
61
|
+
"types": "./cjs/bundle.d.ts",
|
|
62
|
+
"default": "./cjs/bundle.js"
|
|
63
|
+
},
|
|
64
|
+
"default": {
|
|
65
|
+
"types": "./bundle.d.ts",
|
|
66
|
+
"default": "./bundle.js"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"./defaults": {
|
|
70
|
+
"module": {
|
|
71
|
+
"types": "./defaults.d.ts",
|
|
72
|
+
"default": "./defaults.js"
|
|
73
|
+
},
|
|
74
|
+
"require": {
|
|
75
|
+
"types": "./cjs/defaults.d.ts",
|
|
76
|
+
"default": "./cjs/defaults.js"
|
|
77
|
+
},
|
|
78
|
+
"default": {
|
|
79
|
+
"types": "./defaults.d.ts",
|
|
80
|
+
"default": "./defaults.js"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"./Keyring": {
|
|
84
|
+
"module": {
|
|
85
|
+
"types": "./Keyring.d.ts",
|
|
86
|
+
"default": "./Keyring.js"
|
|
87
|
+
},
|
|
88
|
+
"require": {
|
|
89
|
+
"types": "./cjs/Keyring.d.ts",
|
|
90
|
+
"default": "./cjs/Keyring.js"
|
|
91
|
+
},
|
|
92
|
+
"default": {
|
|
93
|
+
"types": "./Keyring.d.ts",
|
|
94
|
+
"default": "./Keyring.js"
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"./observable": {
|
|
98
|
+
"module": {
|
|
99
|
+
"types": "./observable/index.d.ts",
|
|
100
|
+
"default": "./observable/index.js"
|
|
101
|
+
},
|
|
102
|
+
"require": {
|
|
103
|
+
"types": "./cjs/observable/index.d.ts",
|
|
104
|
+
"default": "./cjs/observable/index.js"
|
|
105
|
+
},
|
|
106
|
+
"default": {
|
|
107
|
+
"types": "./observable/index.d.ts",
|
|
108
|
+
"default": "./observable/index.js"
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"./observable/accounts": {
|
|
112
|
+
"module": {
|
|
113
|
+
"types": "./observable/accounts.d.ts",
|
|
114
|
+
"default": "./observable/accounts.js"
|
|
115
|
+
},
|
|
116
|
+
"require": {
|
|
117
|
+
"types": "./cjs/observable/accounts.d.ts",
|
|
118
|
+
"default": "./cjs/observable/accounts.js"
|
|
119
|
+
},
|
|
120
|
+
"default": {
|
|
121
|
+
"types": "./observable/accounts.d.ts",
|
|
122
|
+
"default": "./observable/accounts.js"
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
"./observable/addresses": {
|
|
126
|
+
"module": {
|
|
127
|
+
"types": "./observable/addresses.d.ts",
|
|
128
|
+
"default": "./observable/addresses.js"
|
|
129
|
+
},
|
|
130
|
+
"require": {
|
|
131
|
+
"types": "./cjs/observable/addresses.d.ts",
|
|
132
|
+
"default": "./cjs/observable/addresses.js"
|
|
133
|
+
},
|
|
134
|
+
"default": {
|
|
135
|
+
"types": "./observable/addresses.d.ts",
|
|
136
|
+
"default": "./observable/addresses.js"
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
"./observable/contracts": {
|
|
140
|
+
"module": {
|
|
141
|
+
"types": "./observable/contracts.d.ts",
|
|
142
|
+
"default": "./observable/contracts.js"
|
|
143
|
+
},
|
|
144
|
+
"require": {
|
|
145
|
+
"types": "./cjs/observable/contracts.d.ts",
|
|
146
|
+
"default": "./cjs/observable/contracts.js"
|
|
147
|
+
},
|
|
148
|
+
"default": {
|
|
149
|
+
"types": "./observable/contracts.d.ts",
|
|
150
|
+
"default": "./observable/contracts.js"
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
"./observable/env": {
|
|
154
|
+
"module": {
|
|
155
|
+
"types": "./observable/env.d.ts",
|
|
156
|
+
"default": "./observable/env.js"
|
|
157
|
+
},
|
|
158
|
+
"require": {
|
|
159
|
+
"types": "./cjs/observable/env.d.ts",
|
|
160
|
+
"default": "./cjs/observable/env.js"
|
|
161
|
+
},
|
|
162
|
+
"default": {
|
|
163
|
+
"types": "./observable/env.d.ts",
|
|
164
|
+
"default": "./observable/env.js"
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
"./observable/genericSubject": {
|
|
168
|
+
"module": {
|
|
169
|
+
"types": "./observable/genericSubject.d.ts",
|
|
170
|
+
"default": "./observable/genericSubject.js"
|
|
171
|
+
},
|
|
172
|
+
"require": {
|
|
173
|
+
"types": "./cjs/observable/genericSubject.d.ts",
|
|
174
|
+
"default": "./cjs/observable/genericSubject.js"
|
|
175
|
+
},
|
|
176
|
+
"default": {
|
|
177
|
+
"types": "./observable/genericSubject.d.ts",
|
|
178
|
+
"default": "./observable/genericSubject.js"
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
"./observable/types": {
|
|
182
|
+
"module": {
|
|
183
|
+
"types": "./observable/types.d.ts",
|
|
184
|
+
"default": "./observable/types.js"
|
|
185
|
+
},
|
|
186
|
+
"require": {
|
|
187
|
+
"types": "./cjs/observable/types.d.ts",
|
|
188
|
+
"default": "./cjs/observable/types.js"
|
|
189
|
+
},
|
|
190
|
+
"default": {
|
|
191
|
+
"types": "./observable/types.d.ts",
|
|
192
|
+
"default": "./observable/types.js"
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
"./options": {
|
|
196
|
+
"module": {
|
|
197
|
+
"types": "./options/index.d.ts",
|
|
198
|
+
"default": "./options/index.js"
|
|
199
|
+
},
|
|
200
|
+
"require": {
|
|
201
|
+
"types": "./cjs/options/index.d.ts",
|
|
202
|
+
"default": "./cjs/options/index.js"
|
|
203
|
+
},
|
|
204
|
+
"default": {
|
|
205
|
+
"types": "./options/index.d.ts",
|
|
206
|
+
"default": "./options/index.js"
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
"./options/item": {
|
|
210
|
+
"module": {
|
|
211
|
+
"types": "./options/item.d.ts",
|
|
212
|
+
"default": "./options/item.js"
|
|
213
|
+
},
|
|
214
|
+
"require": {
|
|
215
|
+
"types": "./cjs/options/item.d.ts",
|
|
216
|
+
"default": "./cjs/options/item.js"
|
|
217
|
+
},
|
|
218
|
+
"default": {
|
|
219
|
+
"types": "./options/item.d.ts",
|
|
220
|
+
"default": "./options/item.js"
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
"./options/types": {
|
|
224
|
+
"module": {
|
|
225
|
+
"types": "./options/types.d.ts",
|
|
226
|
+
"default": "./options/types.js"
|
|
227
|
+
},
|
|
228
|
+
"require": {
|
|
229
|
+
"types": "./cjs/options/types.d.ts",
|
|
230
|
+
"default": "./cjs/options/types.js"
|
|
231
|
+
},
|
|
232
|
+
"default": {
|
|
233
|
+
"types": "./options/types.d.ts",
|
|
234
|
+
"default": "./options/types.js"
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
"./package.json": {
|
|
238
|
+
"require": "./cjs/package.json",
|
|
239
|
+
"default": "./package.json"
|
|
240
|
+
},
|
|
241
|
+
"./packageDetect": {
|
|
242
|
+
"module": {
|
|
243
|
+
"types": "./packageDetect.d.ts",
|
|
244
|
+
"default": "./packageDetect.js"
|
|
245
|
+
},
|
|
246
|
+
"require": {
|
|
247
|
+
"types": "./cjs/packageDetect.d.ts",
|
|
248
|
+
"default": "./cjs/packageDetect.js"
|
|
249
|
+
},
|
|
250
|
+
"default": {
|
|
251
|
+
"types": "./packageDetect.d.ts",
|
|
252
|
+
"default": "./packageDetect.js"
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
"./packageInfo.js": {
|
|
256
|
+
"module": {
|
|
257
|
+
"types": "./packageInfo.d.ts",
|
|
258
|
+
"default": "./packageInfo.js"
|
|
259
|
+
},
|
|
260
|
+
"require": {
|
|
261
|
+
"types": "./cjs/packageInfo.d.ts",
|
|
262
|
+
"default": "./cjs/packageInfo.js"
|
|
263
|
+
},
|
|
264
|
+
"default": {
|
|
265
|
+
"types": "./packageInfo.d.ts",
|
|
266
|
+
"default": "./packageInfo.js"
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
"./packageInfo": {
|
|
270
|
+
"module": {
|
|
271
|
+
"types": "./packageInfo.d.ts",
|
|
272
|
+
"default": "./packageInfo.js"
|
|
273
|
+
},
|
|
274
|
+
"require": {
|
|
275
|
+
"types": "./cjs/packageInfo.d.ts",
|
|
276
|
+
"default": "./cjs/packageInfo.js"
|
|
277
|
+
},
|
|
278
|
+
"default": {
|
|
279
|
+
"types": "./packageInfo.d.ts",
|
|
280
|
+
"default": "./packageInfo.js"
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
"./stores": {
|
|
284
|
+
"module": {
|
|
285
|
+
"types": "./stores/index.d.ts",
|
|
286
|
+
"default": "./stores/index.js"
|
|
287
|
+
},
|
|
288
|
+
"require": {
|
|
289
|
+
"types": "./cjs/stores/index.d.ts",
|
|
290
|
+
"default": "./cjs/stores/index.js"
|
|
291
|
+
},
|
|
292
|
+
"default": {
|
|
293
|
+
"types": "./stores/index.d.ts",
|
|
294
|
+
"default": "./stores/index.js"
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
"./stores/Browser": {
|
|
298
|
+
"module": {
|
|
299
|
+
"types": "./stores/Browser.d.ts",
|
|
300
|
+
"default": "./stores/Browser.js"
|
|
301
|
+
},
|
|
302
|
+
"require": {
|
|
303
|
+
"types": "./cjs/stores/Browser.d.ts",
|
|
304
|
+
"default": "./cjs/stores/Browser.js"
|
|
305
|
+
},
|
|
306
|
+
"default": {
|
|
307
|
+
"types": "./stores/Browser.d.ts",
|
|
308
|
+
"default": "./stores/Browser.js"
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
"./stores/File": {
|
|
312
|
+
"module": {
|
|
313
|
+
"types": "./stores/File.d.ts",
|
|
314
|
+
"default": "./stores/File.js"
|
|
315
|
+
},
|
|
316
|
+
"require": {
|
|
317
|
+
"types": "./cjs/stores/File.d.ts",
|
|
318
|
+
"default": "./cjs/stores/File.js"
|
|
319
|
+
},
|
|
320
|
+
"default": {
|
|
321
|
+
"types": "./stores/File.d.ts",
|
|
322
|
+
"default": "./stores/File.js"
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
"./types": {
|
|
326
|
+
"module": {
|
|
327
|
+
"types": "./types.d.ts",
|
|
328
|
+
"default": "./types.js"
|
|
329
|
+
},
|
|
330
|
+
"require": {
|
|
331
|
+
"types": "./cjs/types.d.ts",
|
|
332
|
+
"default": "./cjs/types.js"
|
|
333
|
+
},
|
|
334
|
+
"default": {
|
|
335
|
+
"types": "./types.d.ts",
|
|
336
|
+
"default": "./types.js"
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
},
|
|
340
|
+
"dependencies": {
|
|
341
|
+
"@pezkuwi/keyring": "^14.0.5",
|
|
342
|
+
"@pezkuwi/ui-settings": "3.16.6",
|
|
343
|
+
"@pezkuwi/util": "^14.0.5",
|
|
344
|
+
"@pezkuwi/util-crypto": "^14.0.5",
|
|
345
|
+
"mkdirp": "^3.0.1",
|
|
346
|
+
"rxjs": "^7.8.1",
|
|
347
|
+
"store": "^2.0.12",
|
|
348
|
+
"tslib": "^2.8.1"
|
|
349
|
+
},
|
|
350
|
+
"peerDependencies": {
|
|
351
|
+
"@pezkuwi/keyring": "*",
|
|
352
|
+
"@pezkuwi/ui-settings": "*",
|
|
353
|
+
"@pezkuwi/util": "*"
|
|
354
|
+
}
|
|
355
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const packageInfo = { name: '@pezkuwi/ui-keyring', path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto', type: 'esm', version: '3.16.6' };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { KeyringJson, KeyringStore } from '../types.js';
|
|
2
|
+
export declare class BrowserStore implements KeyringStore {
|
|
3
|
+
all(fn: (key: string, value: KeyringJson) => void): void;
|
|
4
|
+
get(key: string, fn: (value: KeyringJson) => void): void;
|
|
5
|
+
remove(key: string, fn?: () => void): void;
|
|
6
|
+
set(key: string, value: KeyringJson, fn?: () => void): void;
|
|
7
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import store from 'store';
|
|
2
|
+
export class BrowserStore {
|
|
3
|
+
all(fn) {
|
|
4
|
+
store.each((value, key) => {
|
|
5
|
+
fn(key, value);
|
|
6
|
+
});
|
|
7
|
+
}
|
|
8
|
+
get(key, fn) {
|
|
9
|
+
fn(store.get(key));
|
|
10
|
+
}
|
|
11
|
+
remove(key, fn) {
|
|
12
|
+
store.remove(key);
|
|
13
|
+
fn && fn();
|
|
14
|
+
}
|
|
15
|
+
set(key, value, fn) {
|
|
16
|
+
store.set(key, value);
|
|
17
|
+
fn && fn();
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { KeyringJson, KeyringStore } from '../types.js';
|
|
2
|
+
export declare class FileStore implements KeyringStore {
|
|
3
|
+
#private;
|
|
4
|
+
constructor(path: string);
|
|
5
|
+
private validateKey;
|
|
6
|
+
all(fn: (key: string, value: KeyringJson) => void): void;
|
|
7
|
+
get(key: string, fn: (value: KeyringJson) => void): void;
|
|
8
|
+
remove(key: string, fn?: () => void): void;
|
|
9
|
+
set(key: string, value: KeyringJson, fn?: () => void): void;
|
|
10
|
+
private _getPath;
|
|
11
|
+
private _readKey;
|
|
12
|
+
}
|