docs: add official CrowdNode docs to help output
[crowdnode.js/.git] / types.js
1 /**
2  * @typedef {Object} CoreUtxo
3  * @property {String} txId
4  * @property {Number} outputIndex
5  * @property {String} address
6  * @property {String} script
7  * @property {Number} satoshis
8  */
9
10 /**
11  * @typedef {Object} InsightUtxo
12  * @property {String} address
13  * @property {String} txid
14  * @property {Number} vout
15  * @property {String} scriptPubKey
16  * @property {Number} amount
17  * @property {Number} satoshis
18  * @property {Number} height
19  * @property {Number} confirmations
20  */
21
22 /**
23  * @typedef {Object} SocketIoConnect
24  * @property {String} sid
25  * @property {Array<String>} upgrades
26  * @property {Number} pingInterval
27  * @property {Number} pingTimeout
28  */
29
30 /**
31  * @typedef {[InsightSocketEventName, InsightSocketEventData]} InsightPush
32  */
33
34 /**
35  * @typedef {String} InsightSocketEventName
36  */
37
38 /**
39  * @typedef {String} Base58CheckAddr
40  */
41
42 /**
43  * @typedef InstantBalance
44  * @property {String} addrStr
45  * @property {Number} balance
46  * @property {Number} balanceSat
47  * @property {Number} _utxoCount
48  * @property {Array<Number>} _utxoAmounts
49  */
50
51 /**
52  * @typedef InsightBalance
53  * @property {String} addrStr
54  * @property {Number} balance
55  * @property {Number} balanceSat
56  * @property {Number} totalReceived
57  * @property {Number} totalReceivedSat
58  * @property {Number} totalSent
59  * @property {Number} totalSentSat
60  * @property {Number} unconfirmedBalance
61  * @property {Number} unconfirmedBalanceSat
62  * @property {Number} unconfirmedAppearances
63  * @property {Number} txAppearances
64  */
65
66 /**
67  * @typedef {Object} InsightSocketEventData
68  * @property {String} txid - hex
69  * @property {Number} valueOut - float
70  * @property {Array<Record<Base58CheckAddr, Number>>} vout - addr and duffs
71  * @property {Boolean} isRBF
72  * @property {Boolean} txlock
73  *
74  * @example
75  *   {
76  *     txid: 'd2cc7cb8e8d2149f8c4475aee6797b4732eab020f8eb24e8912d0054787b0966',
77  *     valueOut: 0.00099775,
78  *     vout: [
79  *       { XcacUoyPYLokA1fZjc9ZfpV7hvALrDrERA: 40000 },
80  *       { Xo6M4MxnHWzrksja6JnFjHuSa35SMLQ9J3: 59775 }
81  *     ],
82  *     isRBF: false,
83  *     txlock: true
84  *   }
85  */
86
87 /**
88  * @typedef {Object} InsightTxResponse
89  * @property {Number} pagesTotal
90  * @property {Array<InsightTx>} txs
91  */
92
93 /**
94  * @typedef {Object} InsightTx
95  * @property {Number} confirmations
96  * @property {Number} time
97  * @property {Boolean} txlock
98  * @property {Number} version
99  * @property {Array<InsightTxVin>} vin
100  * @property {Array<InsightTxVout>} vout
101  */
102
103 /**
104  * @typedef {Object} InsightTxVin
105  * @property {String} addr
106  */
107
108 /**
109  * @typedef {Object} InsightTxVout
110  * @property {String} value
111  * @property {Object} scriptPubKey
112  * @property {Array<String>} scriptPubKey.addresses
113  */
114
115 /**
116  * @typedef {Object} SocketPayment
117  * @property {String} address - base58check pay-to address
118  * @property {Number} satoshis - duffs, duh
119  * @property {Number} timestamp - in milliseconds since epoch
120  * @property {String} txid - in hex
121  * @property {Boolean} txlock
122  */
123
124 /**
125  * @typedef {Object} CrowdNodeBalance
126  * @property {String} DashAddress - base58check
127  * @property {Number} TotalBalance - float, on hot or cold wallet
128  * @property {Number} TotalActiveBalance - float, on cold wallet
129  * @property {Number} TotalDividend - staking interest earned
130  * @property {String} UpdatedOn - ISO timestamp
131  * @property {Number} UpdateOnUnixTime - seconds since Unix epoch
132  */
133
134 /**
135  * @typedef {Object} CookieStore
136  * @property {CookieStoreSet} set
137  * @property {CookieStoreGet} get
138  */
139
140 /**
141  * @typedef {Function} CookieStoreSet
142  * @param {String} url
143  * @param {import('http').IncomingMessage} resp
144  * @returns {Promise<void>}
145  */
146
147 /**
148  * @typedef {Function} CookieStoreGet
149  * @param {String} url
150  * @returns {Promise<String>}
151  */