throw new TypeError(`Invalid index ${index} when creating Account ${address}`)\r
}\r
this.#a = address\r
+ .replace(PREFIX, '')\r
+ .replace(PREFIX_LEGACY, '')\r
this.#pub = publicKey\r
this.#prv = privateKey ?? null\r
this.#i = index\r
static fromAddress (address: string, index?: number): Account {\r
Account.#isInternal = true\r
Account.validate(address)\r
- address = address\r
- .replace(PREFIX, '')\r
- .replace(PREFIX_LEGACY, '')\r
const publicKey = Account.#addressToKey(address)\r
const account = new this(address, publicKey, undefined, index)\r
return account\r
}\r
\r
/**\r
- * Asynchronously instantiates an Account object from its public and private\r
+ * Instantiates an Account object from its public and private\r
* keys.\r
*\r
* WARNING: The validity of the keys is checked, but they are assumed to have\r
* @param {number} [index] - Account number used when deriving the key\r
* @returns {Promise<Account>} The instantiated Account object\r
*/\r
- static fromKnownKeys (publicKey: string, privateKey: string, index?: number): Account {\r
+ static fromKeypair (publicKey: string, privateKey: string, index?: number): Account {\r
Account.#isInternal = true\r
Account.#validateKey(publicKey)\r
Account.#validateKey(privateKey)\r