mirror of
https://github.com/pezkuwichain/pezkuwi-apps.git
synced 2026-11-02 14:41:06 +00:00
feat: initial Pezkuwi Apps rebrand from polkadot-apps
Rebranded terminology: - Polkadot → Pezkuwi - Kusama → Dicle - Westend → Zagros - Rococo → PezkuwiChain - Substrate → Bizinikiwi - parachain → teyrchain Custom logos with Kurdistan brand colors (#e6007a → #86e62a): - bizinikiwi-hexagon.svg - sora-bizinikiwi.svg - hezscanner.svg - heztreasury.svg - pezkuwiscan.svg - pezkuwistats.svg - pezkuwiassembly.svg - pezkuwiholic.svg
This commit is contained in:
commit
d21bfb1320
5867 files changed
+329019
No files matched your search
@@ -0,0 +1,42 @@
|
||||
// Copyright 2017-2025 @pezkuwi/apps authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore Warned on by nodenext resolution (while package does build in bundler mode)
|
||||
import type { KeyringJson, KeyringStore } from '@pezkuwi/ui-keyring/types';
|
||||
import type { AccountStoreApi } from '../api/account-store-api.js';
|
||||
|
||||
export class RemoteElectronStore implements KeyringStore {
|
||||
readonly #accountStore: AccountStoreApi;
|
||||
|
||||
constructor (accountStore: AccountStoreApi) {
|
||||
this.#accountStore = accountStore;
|
||||
}
|
||||
|
||||
all (cb: (key: string, value: KeyringJson) => void): void {
|
||||
this.#accountStore.all()
|
||||
.then((result: { key: string, value: KeyringJson }[]) => result?.forEach(({ key, value }) => cb(key, value)))
|
||||
.catch((e: Error) => {
|
||||
throw new Error(`error getting all accounts: ${e.message}`);
|
||||
});
|
||||
}
|
||||
|
||||
get (key: string, cb: (value: KeyringJson) => void): void {
|
||||
this.#accountStore.get(key)
|
||||
.then(cb).catch((e: Error) => {
|
||||
throw new Error(`error storing account: ${e.message}`);
|
||||
});
|
||||
}
|
||||
|
||||
remove (key: string, cb: (() => void) | undefined): void {
|
||||
this.#accountStore.remove(key).then(cb).catch((e: Error) => {
|
||||
throw new Error(`error removing account: ${e.message}`);
|
||||
});
|
||||
}
|
||||
|
||||
set (key: string, value: KeyringJson, cb: (() => void) | undefined): void {
|
||||
this.#accountStore.set(key, value).then(cb).catch((e: Error) => {
|
||||
throw new Error(`error saving account: ${e.message}`);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user