mirror of
https://github.com/pezkuwichain/pezkuwi-ui.git
synced 2026-06-13 18:01:02 +00:00
Support for multi genesisHash in keyring accounts (#481)
* Support for multi genesisHash in keyring accounts * genesis * Only single in keyring
This commit is contained in:
@@ -28,6 +28,8 @@ export class Base {
|
||||
|
||||
protected _genesisHash?: string;
|
||||
|
||||
protected _genesisHashAdd: string[] = [];
|
||||
|
||||
constructor () {
|
||||
this.#accounts = accounts;
|
||||
this.#addresses = addresses;
|
||||
@@ -59,6 +61,12 @@ export class Base {
|
||||
return this._genesisHash;
|
||||
}
|
||||
|
||||
public get genesisHashes (): string[] {
|
||||
return this._genesisHash
|
||||
? [this._genesisHash, ...this._genesisHashAdd]
|
||||
: [...this._genesisHashAdd];
|
||||
}
|
||||
|
||||
public decodeAddress = (key: string | Uint8Array, ignoreChecksum?: boolean, ss58Format?: Prefix): Uint8Array => {
|
||||
return this.keyring.decodeAddress(key, ignoreChecksum, ss58Format);
|
||||
};
|
||||
@@ -115,6 +123,7 @@ export class Base {
|
||||
? options.genesisHash.toString()
|
||||
: options.genesisHash.toHex()
|
||||
);
|
||||
this._genesisHashAdd = options.genesisHashAdd || [];
|
||||
this._store = options.store || this._store;
|
||||
|
||||
this.addAccountPairs();
|
||||
|
||||
Reference in New Issue
Block a user