customize_account
This commit is contained in:
14
ticc.js
14
ticc.js
@@ -941,6 +941,20 @@ class TicCrypto {
|
||||
return this.secword_to_account({ secword, coin, coinFamily, world, pass, pathSeed, pathIndex, path, tool, hasher })
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {*} param0
|
||||
* @returns
|
||||
* Example: ({addressFormat:'0x.*55$', coin:'PEX', coinFamily:'ETH})
|
||||
*/
|
||||
static customize_account ({ addressFormat = '^.*$', secwordFormat = '^.*$', ...rest } = {}) {
|
||||
let acc = this.randomize_account(rest)
|
||||
while (!new RegExp(addressFormat).test(acc.address) || !new RegExp(secwordFormat).test(acc.secword)) {
|
||||
acc = this.randomize_account(rest)
|
||||
}
|
||||
return acc
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成随机的字符串
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user