mirror of
https://github.com/pezkuwichain/pezkuwi-ui.git
synced 2026-05-31 12:11:04 +00:00
Internal ss58Format handling (#283)
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^2.4.1",
|
||||
"@polkadot/types": "^1.3.1",
|
||||
"@polkadot/types": "^1.4.0-beta.5",
|
||||
"@polkadot/util": "^2.4.1",
|
||||
"@types/ledgerhq__hw-transport-node-hid": "^4.21.1",
|
||||
"@types/ledgerhq__hw-transport-u2f": "^4.21.1",
|
||||
|
||||
@@ -30,8 +30,6 @@ export default class Base {
|
||||
|
||||
protected _store!: KeyringStore;
|
||||
|
||||
private _ss58Format?: Prefix;
|
||||
|
||||
constructor () {
|
||||
this._accounts = accounts;
|
||||
this._addresses = addresses;
|
||||
@@ -96,8 +94,10 @@ export default class Base {
|
||||
return password.length > 0 && password.length <= MAX_PASS_LEN;
|
||||
}
|
||||
|
||||
public setSS58Format (ss58Format: Prefix): void {
|
||||
this._ss58Format = ss58Format;
|
||||
public setSS58Format (ss58Format?: Prefix): void {
|
||||
if (this._keyring && ss58Format) {
|
||||
this._keyring.setSS58Format(ss58Format);
|
||||
}
|
||||
}
|
||||
|
||||
public setDevMode (isDevelopment: boolean): void {
|
||||
@@ -105,7 +105,7 @@ export default class Base {
|
||||
}
|
||||
|
||||
protected initKeyring (options: KeyringOptions): void {
|
||||
const keyring = testKeyring({ ss58Format: this._ss58Format, ...options }, true);
|
||||
const keyring = testKeyring(options, true);
|
||||
|
||||
if (isBoolean(options.isDevelopment)) {
|
||||
this.setDevMode(options.isDevelopment);
|
||||
|
||||
Reference in New Issue
Block a user