UNPKG
@gateway.fm/gtw-dvf-client-js
Version:
latest (3.1.7)
3.1.7
3.1.6
3.1.5
DVF client js lib with gateway.fm rpc endpoints
github.com/gateway-fm/gtw-dvf-client-js
@gateway.fm/gtw-dvf-client-js
/
src
/
lib
/
validators
/
amount.js
16 lines
(12 loc)
•
306 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
const
DVFError
=
require
(
'../dvf/DVFError'
)
module
.
exports
=
(
dvf, amount
) =>
{
if
(amount &&
typeof
amount ===
'string'
) { amount = +(amount) }
if
(!amount) {
throw
new
DVFError
(
'ERR_AMOUNT_MISSING'
) }
if
(amount && amount ==
0
) {
throw
new
DVFError
(
'ERR_INVALID_AMOUNT'
) } }