customize_account
This commit is contained in:
parent
90dda262da
commit
b34b3b4cd5
2
.gitignore
vendored
2
.gitignore
vendored
@ -70,7 +70,7 @@ _desktop.ini
|
||||
/db.json
|
||||
|
||||
# wo
|
||||
envar-*.gitignore.js
|
||||
*.gitignore.*
|
||||
# 服务端
|
||||
/_archive/*
|
||||
/_datastore/*
|
||||
|
@ -8,7 +8,9 @@
|
||||
|
||||
# 自定义的后缀名,凡有 sfignore 后缀的都不进行同步
|
||||
*.sfignore
|
||||
*.sfignore.*
|
||||
*.sfignore/
|
||||
*.sfignore.*/
|
||||
|
||||
.DS_Store
|
||||
*/.DS_Store
|
||||
|
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
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成随机的字符串
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user