kpcyrd/crypto-detect
function run(arg)
m = regex_find('^(bc1|[13])[a-zA-HJ-NP-Z0-9]{25,39}$', arg['value'])
if m then
db_update('cryptoaddr', arg, {
currency='btc',
denominator=8,
})
end
m = regex_find('^4[0-9AB][1-9A-HJ-NP-Za-km-z]{93}$', arg['value'])
if m then
db_update('cryptoaddr', arg, {
currency='xmr',
denominator=12,
})
end
m = regex_find('^t[13][a-zA-Z0-9]{33}$', arg['value'])
if m then
db_update('cryptoaddr', arg, {
currency='zec',
denominator=8,
})
end
m = regex_find('^0x[a-fA-F0-9]{40}$', arg['value'])
if m then
db_update('cryptoaddr', arg, {
currency='eth',
denominator=18,
})
end
m = regex_find('^D{1}[5-9A-HJ-NP-U]{1}[1-9A-HJ-NP-Za-km-z]{32}$', arg['value'])
if m then
db_update('cryptoaddr', arg, {
currency='doge',
denominator=8,
})
end
end