sed -i 's/^var /const /'
This commit is contained in:
parent
93b1ae4303
commit
91b8823aa8
37 changed files with 197 additions and 197 deletions
src
12
src/types.js
12
src/types.js
|
@ -1,6 +1,6 @@
|
|||
var typeforce = require('typeforce')
|
||||
const typeforce = require('typeforce')
|
||||
|
||||
var UINT31_MAX = Math.pow(2, 31) - 1
|
||||
const UINT31_MAX = Math.pow(2, 31) - 1
|
||||
function UInt31 (value) {
|
||||
return typeforce.UInt32(value) && value <= UINT31_MAX
|
||||
}
|
||||
|
@ -10,16 +10,16 @@ function BIP32Path (value) {
|
|||
}
|
||||
BIP32Path.toJSON = function () { return 'BIP32 derivation path' }
|
||||
|
||||
var SATOSHI_MAX = 21 * 1e14
|
||||
const SATOSHI_MAX = 21 * 1e14
|
||||
function Satoshi (value) {
|
||||
return typeforce.UInt53(value) && value <= SATOSHI_MAX
|
||||
}
|
||||
|
||||
// external dependent types
|
||||
var ECPoint = typeforce.quacksLike('Point')
|
||||
const ECPoint = typeforce.quacksLike('Point')
|
||||
|
||||
// exposed, external API
|
||||
var Network = typeforce.compile({
|
||||
const Network = typeforce.compile({
|
||||
messagePrefix: typeforce.oneOf(typeforce.Buffer, typeforce.String),
|
||||
bip32: {
|
||||
public: typeforce.UInt32,
|
||||
|
@ -31,7 +31,7 @@ var Network = typeforce.compile({
|
|||
})
|
||||
|
||||
// extend typeforce types with ours
|
||||
var types = {
|
||||
const types = {
|
||||
BIP32Path: BIP32Path,
|
||||
Buffer256bit: typeforce.BufferN(32),
|
||||
ECPoint: ECPoint,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue