@bitpay-labs/bitcore-wallet-service 11.5.2 → 11.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/src/externalservices/coingecko.ts +448 -368
- package/src/lib/common/utils.ts +37 -32
- package/src/lib/tss.ts +18 -10
- package/test/integration/externalservices/coinGecko.test.ts +811 -156
- package/test/utils.test.ts +5 -0
- package/ts_build/package.json +3 -3
- package/ts_build/src/externalservices/coingecko.d.ts +24 -20
- package/ts_build/src/externalservices/coingecko.d.ts.map +1 -1
- package/ts_build/src/externalservices/coingecko.js +356 -306
- package/ts_build/src/externalservices/coingecko.js.map +1 -1
- package/ts_build/src/lib/common/index.d.ts +2 -2
- package/ts_build/src/lib/common/utils.d.ts +2 -2
- package/ts_build/src/lib/common/utils.d.ts.map +1 -1
- package/ts_build/src/lib/common/utils.js +28 -29
- package/ts_build/src/lib/common/utils.js.map +1 -1
- package/ts_build/src/lib/tss.d.ts.map +1 -1
- package/ts_build/src/lib/tss.js +2 -10
- package/ts_build/src/lib/tss.js.map +1 -1
- package/ts_build/test/integration/externalservices/coinGecko.test.d.ts +1 -1
- package/ts_build/test/integration/externalservices/coinGecko.test.d.ts.map +1 -1
- package/ts_build/test/integration/externalservices/coinGecko.test.js +710 -149
- package/ts_build/test/integration/externalservices/coinGecko.test.js.map +1 -1
- package/ts_build/test/utils.test.js +4 -0
- package/ts_build/test/utils.test.js.map +1 -1
- package/scripts/delme.ts +0 -468
- package/scripts/findEmail.js +0 -32
- package/scripts/getSolStats2.js +0 -81
- package/scripts/walletStats.js +0 -290
- package/src/types/emailservice.d.ts +0 -11
- package/src/types/notifications.d.ts +0 -8
- package/src/types/pushnotificationservice.d.ts +0 -51
- package/ts_build/scripts/delme.d.ts +0 -2
- package/ts_build/scripts/delme.d.ts.map +0 -1
- package/ts_build/scripts/delme.js +0 -453
- package/ts_build/scripts/delme.js.map +0 -1
package/scripts/delme.ts
DELETED
|
@@ -1,468 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
-
import util from 'util';
|
|
3
|
-
import config from '../src/config';
|
|
4
|
-
import { Utils } from '../src/lib/common/utils';
|
|
5
|
-
import { WalletService } from '../src/lib/server';
|
|
6
|
-
|
|
7
|
-
const blockNumMatic = 82201162;
|
|
8
|
-
const walletMatic = {
|
|
9
|
-
// '_id': new ObjectId('640a43c9249466e07c048b97'),
|
|
10
|
-
version: '1.0.0',
|
|
11
|
-
createdOn: 1678394313,
|
|
12
|
-
id: 'cb33017f-7c32-4d45-a9bf-95766f2dac7e',
|
|
13
|
-
name: '{"iv":"cZR/hmCEgJpni8R9hhI8FA==","v":1,"iter":1,"ks":128,"ts":64,"mode":"ccm","adata":"","cipher":"aes","ct":"DoJjXAxNG27O7z254rW2"}',
|
|
14
|
-
m: 1,
|
|
15
|
-
n: 1,
|
|
16
|
-
singleAddress: true,
|
|
17
|
-
status: 'complete',
|
|
18
|
-
publicKeyRing: [{
|
|
19
|
-
xPubKey: 'xpub6CdH8xymHYr8dxepCAvH9yb218GsctjsvymJfcJS96AuUTmyRRjve9a646q8raFsRze8TTTzg96MQUV1SHKdsQ4f6g9X9qEy9aRAnpimKCv',
|
|
20
|
-
requestPubKey: '03c542e68412656dde7e3a8e921b0fcc79ae3551f9c18d846418aa083196205f66'
|
|
21
|
-
}],
|
|
22
|
-
copayers: [{
|
|
23
|
-
version: 2,
|
|
24
|
-
createdOn: 1678394314,
|
|
25
|
-
coin: 'matic',
|
|
26
|
-
chain: 'matic',
|
|
27
|
-
id: 'aad3b01693471df8b7a821e7c589c75f1d59ce1a006d388e1a39bac916a376ee',
|
|
28
|
-
name: '{"iv":"0yDs+rDCHVdggS0UlF9srg==","v":1,"iter":1,"ks":128,"ts":64,"mode":"ccm","adata":"","cipher":"aes","ct":"kvFasruPaeSimQ=="}',
|
|
29
|
-
xPubKey: 'xpub6CdH8xymHYr8dxepCAvH9yb218GsctjsvymJfcJS96AuUTmyRRjve9a646q8raFsRze8TTTzg96MQUV1SHKdsQ4f6g9X9qEy9aRAnpimKCv',
|
|
30
|
-
requestPubKey: '03c542e68412656dde7e3a8e921b0fcc79ae3551f9c18d846418aa083196205f66',
|
|
31
|
-
signature: '30450221009844d8d58785437c7bafb95595905cc0e2508834fc7d5552af5bda71b336e801022060893eaf5338c95caf7ea153a669b8b9f712e7511c32a4cf842a2115001c3dae',
|
|
32
|
-
requestPubKeys: [{
|
|
33
|
-
key: '03c542e68412656dde7e3a8e921b0fcc79ae3551f9c18d846418aa083196205f66',
|
|
34
|
-
signature: '30450221009844d8d58785437c7bafb95595905cc0e2508834fc7d5552af5bda71b336e801022060893eaf5338c95caf7ea153a669b8b9f712e7511c32a4cf842a2115001c3dae'
|
|
35
|
-
}],
|
|
36
|
-
customData: '{"iv":"xYHBIqtExrnUzf8FsjNDgA==","v":1,"iter":1,"ks":128,"ts":64,"mode":"ccm","adata":"","cipher":"aes","ct":"bVTf8+hzoiIyEaZmP8/bODUtQazHosfPJXjMzJU4AB7acAJtD6aN4l332bRrD0jIkIDRJ1e2c+bNpldPdtRzfR1dQ7U68SgQmehyBripAo0KdmNB4IeYxRM7NK8="}'
|
|
37
|
-
}],
|
|
38
|
-
pubKey: '030c897893ca0762265a7d3fd24e51bef28461c9271b14ec00af580e22885948a3',
|
|
39
|
-
coin: 'matic',
|
|
40
|
-
chain: 'matic',
|
|
41
|
-
network: 'livenet',
|
|
42
|
-
derivationStrategy: 'BIP44',
|
|
43
|
-
addressType: 'P2PKH',
|
|
44
|
-
addressManager: {
|
|
45
|
-
receiveAddressIndex: 1,
|
|
46
|
-
changeAddressIndex: 0,
|
|
47
|
-
version: 2,
|
|
48
|
-
derivationStrategy: 'BIP44',
|
|
49
|
-
copayerIndex: 2147483647,
|
|
50
|
-
skippedPaths: [ ]
|
|
51
|
-
},
|
|
52
|
-
scanStatus: null,
|
|
53
|
-
beRegistered: true,
|
|
54
|
-
beAuthPrivateKey2: 'ba4e9c8a7197c843b3ee2361a4f865c132b27ea3cb2494142eee1a33469a7ec7',
|
|
55
|
-
beAuthPublicKey2: '046b174d5da36115f9ec8ff1fe4e7b908480ead75a2aacf5200baeac9f777f3c98cafa8dbc60b0b3c3043850035da261e6cb16e6700da83366d65779f25693ccd6',
|
|
56
|
-
nativeCashAddr: null,
|
|
57
|
-
usePurpose48: false,
|
|
58
|
-
isShared: false
|
|
59
|
-
} as any;
|
|
60
|
-
|
|
61
|
-
const blockNumEth = 24385699 - 100000;
|
|
62
|
-
const walletEth = {
|
|
63
|
-
// '_id': ObjectId('5da5fbe2cd2ac8e362bca4ef'),
|
|
64
|
-
'version': '1.0.0',
|
|
65
|
-
'createdOn': 1571159010,
|
|
66
|
-
'id': 'ae4f5c42-18e3-48ce-af67-966566f8b2b1',
|
|
67
|
-
'name': '{"iv":"T3wYU3B0/0MrAaP8RP+8aQ==","v":1,"iter":1,"ks":128,"ts":64,"mode":"ccm","adata":"","cipher":"aes","ct":"4VpOcx/gjcdPXBXp7pJVGlq27oyGqg=="}',
|
|
68
|
-
'm': 1,
|
|
69
|
-
'n': 1,
|
|
70
|
-
'singleAddress': true,
|
|
71
|
-
'status': 'complete',
|
|
72
|
-
'publicKeyRing': [
|
|
73
|
-
{
|
|
74
|
-
'xPubKey': 'xpub6CdH8xymHYr8dxepCAvH9yb218GsctjsvymJfcJS96AuUTmyRRjve9a646q8raFsRze8TTTzg96MQUV1SHKdsQ4f6g9X9qEy9aRAnpimKCv',
|
|
75
|
-
'requestPubKey': '03c542e68412656dde7e3a8e921b0fcc79ae3551f9c18d846418aa083196205f66'
|
|
76
|
-
}
|
|
77
|
-
],
|
|
78
|
-
'copayers': [
|
|
79
|
-
{
|
|
80
|
-
'version': 2,
|
|
81
|
-
'createdOn': 1571159010,
|
|
82
|
-
'coin': 'eth',
|
|
83
|
-
'chain': 'eth',
|
|
84
|
-
'id': 'f6c9b1e1fd98eab80d0f446c31977a8929e60596b148c5a88a4a11038f8e53f2',
|
|
85
|
-
'name': '{"iv":"y2Ew6BtOaRytS+SfpRMIFg==","v":1,"iter":1,"ks":128,"ts":64,"mode":"ccm","adata":"","cipher":"aes","ct":"6CyJssgIVmahgg=="}',
|
|
86
|
-
'xPubKey': 'xpub6CdH8xymHYr8dxepCAvH9yb218GsctjsvymJfcJS96AuUTmyRRjve9a646q8raFsRze8TTTzg96MQUV1SHKdsQ4f6g9X9qEy9aRAnpimKCv',
|
|
87
|
-
'requestPubKey': '03c542e68412656dde7e3a8e921b0fcc79ae3551f9c18d846418aa083196205f66',
|
|
88
|
-
'signature': '3044022066b1324a57778f3a8ffd088125793a2ea123bf3ef2803d7ffb596ca623ebf72b022047f2bcd6dac387dfe0f928e3f8e4581d9e71c9147ab67dbf0675464c7a631481',
|
|
89
|
-
'requestPubKeys': [
|
|
90
|
-
{
|
|
91
|
-
'key': '03c542e68412656dde7e3a8e921b0fcc79ae3551f9c18d846418aa083196205f66',
|
|
92
|
-
'signature': '3044022066b1324a57778f3a8ffd088125793a2ea123bf3ef2803d7ffb596ca623ebf72b022047f2bcd6dac387dfe0f928e3f8e4581d9e71c9147ab67dbf0675464c7a631481'
|
|
93
|
-
}
|
|
94
|
-
],
|
|
95
|
-
'customData': '{"iv":"0y5GugSpqkBZOR1BotyEhA==","v":1,"iter":1,"ks":128,"ts":64,"mode":"ccm","adata":"","cipher":"aes","ct":"qKde97/wGa20j75xkaknmFnCibmaEfK73lM0aGj8af4KWBisElkruF139k1d8U7bJk2YnUK8Ae3qNI8SX2LWcXAwwhWe0+j395RV81MI9eVhy1+DCTJ/SToCcMU="}'
|
|
96
|
-
}
|
|
97
|
-
],
|
|
98
|
-
'pubKey': '024c71fc87f58ce1f1670ffd48fd5ad945b345b1c213c5325585a4887243fa94c8',
|
|
99
|
-
'coin': 'eth',
|
|
100
|
-
'chain': 'eth',
|
|
101
|
-
'network': 'livenet',
|
|
102
|
-
'derivationStrategy': 'BIP44',
|
|
103
|
-
'addressType': 'P2PKH',
|
|
104
|
-
'addressManager': {
|
|
105
|
-
'receiveAddressIndex': 1,
|
|
106
|
-
'changeAddressIndex': 0,
|
|
107
|
-
'version': 2,
|
|
108
|
-
'derivationStrategy': 'BIP44',
|
|
109
|
-
'copayerIndex': 2147483647,
|
|
110
|
-
'skippedPaths': [ ]
|
|
111
|
-
},
|
|
112
|
-
'scanStatus': 'success',
|
|
113
|
-
'beRegistered': true,
|
|
114
|
-
'beAuthPrivateKey2': 'bd7f1c717a721e45f32a9e584fe98a59ef042247921847d4f7fb40f5a27a6e05',
|
|
115
|
-
'beAuthPublicKey2': '04929b7f6db4061576a95db638374aacaa6c086e73573e5c7a967d05a87f06dcf2535a473971f3a915b0aec57dbb11c23dfaaff72fc4ef3dea9f6fa91f28eaeb5f',
|
|
116
|
-
'nativeCashAddr': null,
|
|
117
|
-
'usePurpose48': false,
|
|
118
|
-
'isShared': false
|
|
119
|
-
} as any;
|
|
120
|
-
|
|
121
|
-
const blockNumBtc = 935033 - 1000;
|
|
122
|
-
const walletBtc = {
|
|
123
|
-
// '_id': ObjectId('61113ff9249466e07c971489'),
|
|
124
|
-
'version': '1.0.0',
|
|
125
|
-
'createdOn': 1628520441,
|
|
126
|
-
'id': '399e6996-31c4-4142-ae56-2eba330983e0',
|
|
127
|
-
'name': '{"iv":"U0CX86BpjVYWYTDRJVm4tA==","v":1,"iter":1,"ks":128,"ts":64,"mode":"ccm","adata":"","cipher":"aes","ct":"AfHaBby46S1jiI1NXJrkbPr4ooU="}',
|
|
128
|
-
'm': 2,
|
|
129
|
-
'n': 3,
|
|
130
|
-
'singleAddress': false,
|
|
131
|
-
'status': 'complete',
|
|
132
|
-
'publicKeyRing': [
|
|
133
|
-
{
|
|
134
|
-
'xPubKey': 'xpub6BjADLWSXuFFnRnNqZisVZY8TdUJ57EjDoJQKost3n12EGEky4tMSbUx7u1hUuGWHSs7JueAdBc9RALbXZ7ULD5UVj2dcSGxMnGLzA4poa9',
|
|
135
|
-
'requestPubKey': '02b8e3d11c6754fa23f618eb97a96f908d6d9dbad71a7105c25f3eb3efe61c8e22'
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
'xPubKey': 'xpub6DRoQVLTSSrzp65hTqFJCrzMpXNNmC6tVtpzBa3Qw1BmB3sLJN5zkCzLjeiGWSPARRf7QT45H22PYkG3NsRz8FunNbUZk9yFXbFxfty6V78',
|
|
139
|
-
'requestPubKey': '020979ef238dbf236c9c600a796f5671ed28b10a6b1c60f8dd09e584f30ad34377'
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
'xPubKey': 'xpub6DU9eWKd5XvhDmVV4a8ZEswH1Y1wGXK7JwwJCvMs9TzHyVKXdsRVyFqEbZiudMkBSssjmcN3TiVPesAUgQ1cFTxytUU3eD7KsFgqnWcNtpw',
|
|
143
|
-
'requestPubKey': '038148dc6c8fd757344a987c54d6801f997e47b1bb1117ff1e5efe7eb8d781e178'
|
|
144
|
-
}
|
|
145
|
-
],
|
|
146
|
-
'hardwareSourcePublicKey': null,
|
|
147
|
-
'clientDerivedPublicKey': null,
|
|
148
|
-
'copayers': [
|
|
149
|
-
{
|
|
150
|
-
'version': 2,
|
|
151
|
-
'createdOn': 1628520441,
|
|
152
|
-
'coin': 'btc',
|
|
153
|
-
'chain': 'btc',
|
|
154
|
-
'xPubKey': 'xpub6BjADLWSXuFFnRnNqZisVZY8TdUJ57EjDoJQKost3n12EGEky4tMSbUx7u1hUuGWHSs7JueAdBc9RALbXZ7ULD5UVj2dcSGxMnGLzA4poa9',
|
|
155
|
-
'hardwareSourcePublicKey': null,
|
|
156
|
-
'clientDerivedPublicKey': null,
|
|
157
|
-
'id': 'b1336ebcc685bb4c31b7c559a881c9b4e7cdd18f944a640d40e4e7edcfd490ea',
|
|
158
|
-
'name': '{"iv":"tw9+ekkyDH+vat+eAZRT+A==","v":1,"iter":1,"ks":128,"ts":64,"mode":"ccm","adata":"","cipher":"aes","ct":"1nCJcTGiLPDh8l20"}',
|
|
159
|
-
'requestPubKey': '02b8e3d11c6754fa23f618eb97a96f908d6d9dbad71a7105c25f3eb3efe61c8e22',
|
|
160
|
-
'signature': '304502210099408a3952f547020ba69f4b17239137cd96c64915e9e88c19ca1e24c99fd9730220260e336340c819e04f9744a7e50165b26ea30d95634c4c6122a8d13c9b1ed187',
|
|
161
|
-
'requestPubKeys': [
|
|
162
|
-
{
|
|
163
|
-
'key': '02b8e3d11c6754fa23f618eb97a96f908d6d9dbad71a7105c25f3eb3efe61c8e22',
|
|
164
|
-
'signature': '304502210099408a3952f547020ba69f4b17239137cd96c64915e9e88c19ca1e24c99fd9730220260e336340c819e04f9744a7e50165b26ea30d95634c4c6122a8d13c9b1ed187'
|
|
165
|
-
}
|
|
166
|
-
],
|
|
167
|
-
'customData': '{"iv":"kVtmzCj6wKIJgVT3xrf4Vg==","v":1,"iter":1,"ks":128,"ts":64,"mode":"ccm","adata":"","cipher":"aes","ct":"BnfWnMJcJ3IF6Uz2wRuixhR3QFi1G9LSt/lRTAYz8UqPbgal3XK04nvL/fnHeL4PjX2zyMMwGMeryfTsUischj4+rGJhJgkOPVyZRDdk3la5uOGnZjpo+9NNvA0="}'
|
|
168
|
-
},
|
|
169
|
-
{
|
|
170
|
-
'version': 2,
|
|
171
|
-
'createdOn': 1628522672,
|
|
172
|
-
'coin': 'btc',
|
|
173
|
-
'chain': 'btc',
|
|
174
|
-
'xPubKey': 'xpub6DRoQVLTSSrzp65hTqFJCrzMpXNNmC6tVtpzBa3Qw1BmB3sLJN5zkCzLjeiGWSPARRf7QT45H22PYkG3NsRz8FunNbUZk9yFXbFxfty6V78',
|
|
175
|
-
'hardwareSourcePublicKey': null,
|
|
176
|
-
'clientDerivedPublicKey': null,
|
|
177
|
-
'id': 'e55be465b22c08fb0aacd966aeb0a1e82619c76fdced4312cee611211b876fe3',
|
|
178
|
-
'name': '{"iv":"XBIBxys708Hd55IDxo7iPw==","v":1,"iter":1,"ks":128,"ts":64,"mode":"ccm","adata":"","cipher":"aes","ct":"Ct8QTE78/WjRr9XjiCyjcbela3Y="}',
|
|
179
|
-
'requestPubKey': '020979ef238dbf236c9c600a796f5671ed28b10a6b1c60f8dd09e584f30ad34377',
|
|
180
|
-
'signature': '3044022018cbd5e42ed2057665b4a0ca2e793b3cb1b7d5b1ff7d1b41ea24e4ddb98543f602201c20a96298fd3855fc87797eb7558a21cc2c869a17dd8f9cfecbb151bd6dd179',
|
|
181
|
-
'requestPubKeys': [
|
|
182
|
-
{
|
|
183
|
-
'key': '020979ef238dbf236c9c600a796f5671ed28b10a6b1c60f8dd09e584f30ad34377',
|
|
184
|
-
'signature': '3044022018cbd5e42ed2057665b4a0ca2e793b3cb1b7d5b1ff7d1b41ea24e4ddb98543f602201c20a96298fd3855fc87797eb7558a21cc2c869a17dd8f9cfecbb151bd6dd179'
|
|
185
|
-
}
|
|
186
|
-
],
|
|
187
|
-
'customData': '{"iv":"E1YZ9cnDf6kZKG2UeKt3cg==","v":1,"iter":1,"ks":128,"ts":64,"mode":"ccm","adata":"","cipher":"aes","ct":"406EUtTpEY4+KuDVA++MhmioU6/Uo4vjmgTzYWb5pz27513NblVdhW5bgAdT/07G6qcst2InGDmqaYRfHu9dVdyHAoIB8fTtadOrYqbkLQ9xANh3WWSKJvcGCyA="}'
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
'version': 2,
|
|
191
|
-
'createdOn': 1628533075,
|
|
192
|
-
'coin': 'btc',
|
|
193
|
-
'chain': 'btc',
|
|
194
|
-
'xPubKey': 'xpub6DU9eWKd5XvhDmVV4a8ZEswH1Y1wGXK7JwwJCvMs9TzHyVKXdsRVyFqEbZiudMkBSssjmcN3TiVPesAUgQ1cFTxytUU3eD7KsFgqnWcNtpw',
|
|
195
|
-
'hardwareSourcePublicKey': null,
|
|
196
|
-
'clientDerivedPublicKey': null,
|
|
197
|
-
'id': '292f586a8af2a5eb7c6f17ec2b17405d39bdab2282a8e029bad61069766f1032',
|
|
198
|
-
'name': '{"iv":"yaFM2RAwO/DdphyDtyagjw==","v":1,"iter":1,"ks":128,"ts":64,"mode":"ccm","adata":"","cipher":"aes","ct":"sQdNzxpzgPqbEyFlgoyuvV4EnPHo"}',
|
|
199
|
-
'requestPubKey': '038148dc6c8fd757344a987c54d6801f997e47b1bb1117ff1e5efe7eb8d781e178',
|
|
200
|
-
'signature': '3044022010767e996ad8999e058c36571e974155db489ed3cf70a63185f5e8f09258ee7702202753996cc134b9b68dcbe5df8e93ad4b124738f42b0f538ec588cca572ffb3a5',
|
|
201
|
-
'requestPubKeys': [
|
|
202
|
-
{
|
|
203
|
-
'key': '038148dc6c8fd757344a987c54d6801f997e47b1bb1117ff1e5efe7eb8d781e178',
|
|
204
|
-
'signature': '3044022010767e996ad8999e058c36571e974155db489ed3cf70a63185f5e8f09258ee7702202753996cc134b9b68dcbe5df8e93ad4b124738f42b0f538ec588cca572ffb3a5'
|
|
205
|
-
}
|
|
206
|
-
],
|
|
207
|
-
'customData': '{"iv":"zI4Medx7fK4BK9OMyczQ5g==","v":1,"iter":1,"ks":128,"ts":64,"mode":"ccm","adata":"","cipher":"aes","ct":"/8JXe0Hnyndp6uTr6iINqXhPpyX6AYvM4bjwYOXWk2yubM1y214aH/YZCs5nlhHjPjzGAgAcAk3Ol6U17EG7Jlz20zHDTYs/T/jf/JIMYN4psQKM5GZh0Wzhy9Q="}'
|
|
208
|
-
}
|
|
209
|
-
],
|
|
210
|
-
'pubKey': '02697fb1edefc7c372d9e11168010703f249ac1ad36bc3230a946d052a7ab29cc2',
|
|
211
|
-
'coin': 'btc',
|
|
212
|
-
'chain': 'btc',
|
|
213
|
-
'network': 'livenet',
|
|
214
|
-
'derivationStrategy': 'BIP44',
|
|
215
|
-
'addressType': 'P2WSH',
|
|
216
|
-
'addressManager': {
|
|
217
|
-
'version': 2,
|
|
218
|
-
'derivationStrategy': 'BIP44',
|
|
219
|
-
'receiveAddressIndex': 7175,
|
|
220
|
-
'changeAddressIndex': 5967,
|
|
221
|
-
'copayerIndex': 2147483647,
|
|
222
|
-
'skippedPaths': [ ]
|
|
223
|
-
},
|
|
224
|
-
'scanStatus': 'success',
|
|
225
|
-
'beRegistered': true,
|
|
226
|
-
'beAuthPrivateKey2': 'd4ce40d204545239e66756334808e5c0bf0f21111587c90b89656e6b1de4857f',
|
|
227
|
-
'beAuthPublicKey2': '04ca2e03518cb5ed979599d4c88c8111da0348d881f56d08e6d3012505ce0fac882cd45623459955ffcc64f44728adf0bb37aceb771e735ff54da317387cd80d2b',
|
|
228
|
-
'nativeCashAddr': null,
|
|
229
|
-
'usePurpose48': true,
|
|
230
|
-
'isShared': true
|
|
231
|
-
} as any;
|
|
232
|
-
|
|
233
|
-
const blockNumArb = 428651733 - 1000000;
|
|
234
|
-
const walletArb = {
|
|
235
|
-
// '_id': ObjectId('66aa41d9e2e4ed45a073645c'),
|
|
236
|
-
'version': '1.0.0',
|
|
237
|
-
'createdOn': 1722434009,
|
|
238
|
-
'id': 'f2abe53c-767c-47d4-aa51-14903a07f700',
|
|
239
|
-
'name': '{"iv":"QWYNWVqp3EpbyOzvotMcaA==","v":1,"iter":1,"ks":128,"ts":64,"mode":"ccm","adata":"","cipher":"aes","ct":"5QJVrBScF3D6/dfQk1Xitg=="}',
|
|
240
|
-
'm': 1,
|
|
241
|
-
'n': 1,
|
|
242
|
-
'singleAddress': true,
|
|
243
|
-
'status': 'complete',
|
|
244
|
-
'publicKeyRing': [
|
|
245
|
-
{
|
|
246
|
-
'xPubKey': 'xpub6CdH8xymHYr8dxepCAvH9yb218GsctjsvymJfcJS96AuUTmyRRjve9a646q8raFsRze8TTTzg96MQUV1SHKdsQ4f6g9X9qEy9aRAnpimKCv',
|
|
247
|
-
'requestPubKey': '03c542e68412656dde7e3a8e921b0fcc79ae3551f9c18d846418aa083196205f66'
|
|
248
|
-
}
|
|
249
|
-
],
|
|
250
|
-
'copayers': [
|
|
251
|
-
{
|
|
252
|
-
'version': 2,
|
|
253
|
-
'createdOn': 1722434009,
|
|
254
|
-
'coin': 'eth',
|
|
255
|
-
'chain': 'arb',
|
|
256
|
-
'id': '50bcb307189452fac9192ff0ee5415a7cef742ef86bc540d2c125fa01d6b40ac',
|
|
257
|
-
'name': '{"iv":"zndSqKYx7mFtMOTN+Jq8uQ==","v":1,"iter":1,"ks":128,"ts":64,"mode":"ccm","adata":"","cipher":"aes","ct":"1rGtaZJHjnN/HQ=="}',
|
|
258
|
-
'xPubKey': 'xpub6CdH8xymHYr8dxepCAvH9yb218GsctjsvymJfcJS96AuUTmyRRjve9a646q8raFsRze8TTTzg96MQUV1SHKdsQ4f6g9X9qEy9aRAnpimKCv',
|
|
259
|
-
'hardwareSourcePublicKey': null,
|
|
260
|
-
'requestPubKey': '03c542e68412656dde7e3a8e921b0fcc79ae3551f9c18d846418aa083196205f66',
|
|
261
|
-
'signature': '3045022100d2c5820d533fb25ed5df430fd81950dc9d5250aa360dfdb9abd2fd62b4574ef402206a76d7c4ce80a49afd73a5220550260d574f516d9fe2f573301f54344cd9a0b3',
|
|
262
|
-
'requestPubKeys': [
|
|
263
|
-
{
|
|
264
|
-
'key': '03c542e68412656dde7e3a8e921b0fcc79ae3551f9c18d846418aa083196205f66',
|
|
265
|
-
'signature': '3045022100d2c5820d533fb25ed5df430fd81950dc9d5250aa360dfdb9abd2fd62b4574ef402206a76d7c4ce80a49afd73a5220550260d574f516d9fe2f573301f54344cd9a0b3'
|
|
266
|
-
}
|
|
267
|
-
],
|
|
268
|
-
'customData': '{"iv":"TFMLOFiw2ZBsylrWKKK6AA==","v":1,"iter":1,"ks":128,"ts":64,"mode":"ccm","adata":"","cipher":"aes","ct":"d+WLHgY65hN/5WkX/RIQkW5hcPY61yoOzvGoCeIKsgjt2lb5dwg+C278gD1Sofg0883zFEXUpvNmd4hOjaCKGXhAn1Hyd4xrZQffH6zQC6as0SY6yvQlndpDU2s="}'
|
|
269
|
-
}
|
|
270
|
-
],
|
|
271
|
-
'pubKey': '02048572afee700d823a5c2567b3dac574883563c8c421b149fb04bbbe143982f2',
|
|
272
|
-
'coin': 'eth',
|
|
273
|
-
'chain': 'arb',
|
|
274
|
-
'network': 'livenet',
|
|
275
|
-
'derivationStrategy': 'BIP44',
|
|
276
|
-
'addressType': 'P2PKH',
|
|
277
|
-
'addressManager': {
|
|
278
|
-
'receiveAddressIndex': 1,
|
|
279
|
-
'changeAddressIndex': 0,
|
|
280
|
-
'version': 2,
|
|
281
|
-
'derivationStrategy': 'BIP44',
|
|
282
|
-
'copayerIndex': 2147483647,
|
|
283
|
-
'skippedPaths': [ ]
|
|
284
|
-
},
|
|
285
|
-
'scanStatus': null,
|
|
286
|
-
'beRegistered': true,
|
|
287
|
-
'beAuthPrivateKey2': 'bd7f1c717a721e45f32a9e584fe98a59ef042247921847d4f7fb40f5a27a6e05',
|
|
288
|
-
'beAuthPublicKey2': '04929b7f6db4061576a95db638374aacaa6c086e73573e5c7a967d05a87f06dcf2535a473971f3a915b0aec57dbb11c23dfaaff72fc4ef3dea9f6fa91f28eaeb5f',
|
|
289
|
-
'nativeCashAddr': null,
|
|
290
|
-
'usePurpose48': false,
|
|
291
|
-
'hardwareSourcePublicKey': null,
|
|
292
|
-
'isShared': false
|
|
293
|
-
} as any;
|
|
294
|
-
|
|
295
|
-
const blockNumOp = 147319027 - 1000000;
|
|
296
|
-
const walletOp = {
|
|
297
|
-
// '_id': ObjectId('66cca89ee2e4ed45a0814816'),
|
|
298
|
-
'version': '1.0.0',
|
|
299
|
-
'createdOn': 1724688542,
|
|
300
|
-
'id': '90e1ca90-fbf7-4a6a-96af-6aa94e82b914',
|
|
301
|
-
'name': '{"iv":"SWseT/hsNn3cEpeKAa489w==","v":1,"iter":1,"ks":128,"ts":64,"mode":"ccm","adata":"","cipher":"aes","ct":"AqV9odvrA90b+qCuyYhh3g=="}',
|
|
302
|
-
'm': 1,
|
|
303
|
-
'n': 1,
|
|
304
|
-
'singleAddress': true,
|
|
305
|
-
'status': 'complete',
|
|
306
|
-
'publicKeyRing': [
|
|
307
|
-
{
|
|
308
|
-
'xPubKey': 'xpub6CdH8xymHYr8dxepCAvH9yb218GsctjsvymJfcJS96AuUTmyRRjve9a646q8raFsRze8TTTzg96MQUV1SHKdsQ4f6g9X9qEy9aRAnpimKCv',
|
|
309
|
-
'requestPubKey': '03c542e68412656dde7e3a8e921b0fcc79ae3551f9c18d846418aa083196205f66'
|
|
310
|
-
}
|
|
311
|
-
],
|
|
312
|
-
'copayers': [
|
|
313
|
-
{
|
|
314
|
-
'version': 2,
|
|
315
|
-
'createdOn': 1724688542,
|
|
316
|
-
'coin': 'eth',
|
|
317
|
-
'chain': 'op',
|
|
318
|
-
'id': '8873b673b98ee79e2c7756a94b4d1cdb4e42db1898ee3991d7b70feea09ad4fe',
|
|
319
|
-
'name': '{"iv":"wf1WOHW1u8G0BAC5t7LtFQ==","v":1,"iter":1,"ks":128,"ts":64,"mode":"ccm","adata":"","cipher":"aes","ct":"osOpFssR/7qIsg=="}',
|
|
320
|
-
'xPubKey': 'xpub6CdH8xymHYr8dxepCAvH9yb218GsctjsvymJfcJS96AuUTmyRRjve9a646q8raFsRze8TTTzg96MQUV1SHKdsQ4f6g9X9qEy9aRAnpimKCv',
|
|
321
|
-
'hardwareSourcePublicKey': null,
|
|
322
|
-
'requestPubKey': '03c542e68412656dde7e3a8e921b0fcc79ae3551f9c18d846418aa083196205f66',
|
|
323
|
-
'signature': '304402201ce38bb12f3b6a78989f2eb95e99e8ec2cded99dd7ed620ade3804b65aa881d3022062fb32f586b4dcfec3f6a8c8b307adcbd219de686bfb494efb315e8dda8acc12',
|
|
324
|
-
'requestPubKeys': [
|
|
325
|
-
{
|
|
326
|
-
'key': '03c542e68412656dde7e3a8e921b0fcc79ae3551f9c18d846418aa083196205f66',
|
|
327
|
-
'signature': '304402201ce38bb12f3b6a78989f2eb95e99e8ec2cded99dd7ed620ade3804b65aa881d3022062fb32f586b4dcfec3f6a8c8b307adcbd219de686bfb494efb315e8dda8acc12'
|
|
328
|
-
}
|
|
329
|
-
],
|
|
330
|
-
'customData': '{"iv":"qsHNNQ/3SQZINziarcHCjg==","v":1,"iter":1,"ks":128,"ts":64,"mode":"ccm","adata":"","cipher":"aes","ct":"5bWvgZG7ORuxxWOxcTmvADwFZqDTWXj6FS9clQVkhgeXBtUWLMi2CHdmn/H+s/01V1H2QtN6Z6dLO35T1m7qGBbh88j/dsgjB7acZrWVmOT127/j+q0Zp3CpLM8="}'
|
|
331
|
-
}
|
|
332
|
-
],
|
|
333
|
-
'pubKey': '03468fad64fcf177989464d0f6a98e6d2db1a8278cfcb4fb5bf630cd02dcfc2591',
|
|
334
|
-
'coin': 'eth',
|
|
335
|
-
'chain': 'op',
|
|
336
|
-
'network': 'livenet',
|
|
337
|
-
'derivationStrategy': 'BIP44',
|
|
338
|
-
'addressType': 'P2PKH',
|
|
339
|
-
'addressManager': {
|
|
340
|
-
'receiveAddressIndex': 1,
|
|
341
|
-
'changeAddressIndex': 0,
|
|
342
|
-
'version': 2,
|
|
343
|
-
'derivationStrategy': 'BIP44',
|
|
344
|
-
'copayerIndex': 2147483647,
|
|
345
|
-
'skippedPaths': [ ]
|
|
346
|
-
},
|
|
347
|
-
'scanStatus': null,
|
|
348
|
-
'beRegistered': true,
|
|
349
|
-
'beAuthPrivateKey2': 'bd7f1c717a721e45f32a9e584fe98a59ef042247921847d4f7fb40f5a27a6e05',
|
|
350
|
-
'beAuthPublicKey2': '04929b7f6db4061576a95db638374aacaa6c086e73573e5c7a967d05a87f06dcf2535a473971f3a915b0aec57dbb11c23dfaaff72fc4ef3dea9f6fa91f28eaeb5f',
|
|
351
|
-
'nativeCashAddr': null,
|
|
352
|
-
'usePurpose48': false,
|
|
353
|
-
'hardwareSourcePublicKey': null,
|
|
354
|
-
'isShared': false
|
|
355
|
-
} as any;
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
const blockNumBase = 41723745 - 1000000;
|
|
360
|
-
const walletBase = {
|
|
361
|
-
// '_id': ObjectId('66cca512e2e4ed45a08146a6'),
|
|
362
|
-
'version': '1.0.0',
|
|
363
|
-
'createdOn': 1724687634,
|
|
364
|
-
'id': '055f8169-c60c-4af4-acf6-90380f3bf4e0',
|
|
365
|
-
'name': '{"iv":"hfJgxmSTKcZMALCHetBfdA==","v":1,"iter":1,"ks":128,"ts":64,"mode":"ccm","adata":"","cipher":"aes","ct":"QwJKUuKAmYjkuR8IsqMLTA=="}',
|
|
366
|
-
'm': 1,
|
|
367
|
-
'n': 1,
|
|
368
|
-
'singleAddress': true,
|
|
369
|
-
'status': 'complete',
|
|
370
|
-
'publicKeyRing': [
|
|
371
|
-
{
|
|
372
|
-
'xPubKey': 'xpub6CdH8xymHYr8dxepCAvH9yb218GsctjsvymJfcJS96AuUTmyRRjve9a646q8raFsRze8TTTzg96MQUV1SHKdsQ4f6g9X9qEy9aRAnpimKCv',
|
|
373
|
-
'requestPubKey': '03c542e68412656dde7e3a8e921b0fcc79ae3551f9c18d846418aa083196205f66'
|
|
374
|
-
}
|
|
375
|
-
],
|
|
376
|
-
'copayers': [
|
|
377
|
-
{
|
|
378
|
-
'version': 2,
|
|
379
|
-
'createdOn': 1724687634,
|
|
380
|
-
'coin': 'eth',
|
|
381
|
-
'chain': 'base',
|
|
382
|
-
'id': 'd929d5d7b28e9c71d5a22dfd7d89aef279982d717ec22233952a42b609edeaec',
|
|
383
|
-
'name': '{"iv":"yS+ng43o6kJjtgR5ciy5hQ==","v":1,"iter":1,"ks":128,"ts":64,"mode":"ccm","adata":"","cipher":"aes","ct":"yTgE6tuNRce+ig=="}',
|
|
384
|
-
'xPubKey': 'xpub6CdH8xymHYr8dxepCAvH9yb218GsctjsvymJfcJS96AuUTmyRRjve9a646q8raFsRze8TTTzg96MQUV1SHKdsQ4f6g9X9qEy9aRAnpimKCv',
|
|
385
|
-
'hardwareSourcePublicKey': null,
|
|
386
|
-
'requestPubKey': '03c542e68412656dde7e3a8e921b0fcc79ae3551f9c18d846418aa083196205f66',
|
|
387
|
-
'signature': '3044022042cd9c1666bba3da69f4b39cb0303858d62317ae71cd6a0a84bbdd331bdaac6f022008af12eb21ea255fb8a6a803f61638202f5cb98c5ce2375addc5137f604d06ad',
|
|
388
|
-
'requestPubKeys': [
|
|
389
|
-
{
|
|
390
|
-
'key': '03c542e68412656dde7e3a8e921b0fcc79ae3551f9c18d846418aa083196205f66',
|
|
391
|
-
'signature': '3044022042cd9c1666bba3da69f4b39cb0303858d62317ae71cd6a0a84bbdd331bdaac6f022008af12eb21ea255fb8a6a803f61638202f5cb98c5ce2375addc5137f604d06ad'
|
|
392
|
-
}
|
|
393
|
-
],
|
|
394
|
-
'customData': '{"iv":"0tox54o7GN+miq1hJtMViA==","v":1,"iter":1,"ks":128,"ts":64,"mode":"ccm","adata":"","cipher":"aes","ct":"va9GOHyjuD5mjdEQQtUr8WylQ6uauek1irQ7MxlpBb2qcUP0IQBhCdawsYZ+VrgcraMv6v2qHR/hcBBUitzzO2TFZaJ9mitsnLj/RJpMmNc7cNIoel3xNgpzInA="}'
|
|
395
|
-
}
|
|
396
|
-
],
|
|
397
|
-
'pubKey': '039538f77ec6bb87dc3884bc0f983d9f8bb1146dcb16df78c86131b008f8380647',
|
|
398
|
-
'coin': 'eth',
|
|
399
|
-
'chain': 'base',
|
|
400
|
-
'network': 'livenet',
|
|
401
|
-
'derivationStrategy': 'BIP44',
|
|
402
|
-
'addressType': 'P2PKH',
|
|
403
|
-
'addressManager': {
|
|
404
|
-
'receiveAddressIndex': 1,
|
|
405
|
-
'changeAddressIndex': 0,
|
|
406
|
-
'version': 2,
|
|
407
|
-
'derivationStrategy': 'BIP44',
|
|
408
|
-
'copayerIndex': 2147483647,
|
|
409
|
-
'skippedPaths': [ ]
|
|
410
|
-
},
|
|
411
|
-
'scanStatus': null,
|
|
412
|
-
'beRegistered': true,
|
|
413
|
-
'beAuthPrivateKey2': 'bd7f1c717a721e45f32a9e584fe98a59ef042247921847d4f7fb40f5a27a6e05',
|
|
414
|
-
'beAuthPublicKey2': '04929b7f6db4061576a95db638374aacaa6c086e73573e5c7a967d05a87f06dcf2535a473971f3a915b0aec57dbb11c23dfaaff72fc4ef3dea9f6fa91f28eaeb5f',
|
|
415
|
-
'nativeCashAddr': null,
|
|
416
|
-
'usePurpose48': false,
|
|
417
|
-
'hardwareSourcePublicKey': null,
|
|
418
|
-
'isShared': false
|
|
419
|
-
} as any;
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
WalletService.initialize({
|
|
423
|
-
fiatRateService: 'ignore',
|
|
424
|
-
messageBroker: { onMessage: () => {} },
|
|
425
|
-
storage: 'ignore',
|
|
426
|
-
blockchainExplorerOpts: config.blockchainExplorerOpts
|
|
427
|
-
}, async (err) => {
|
|
428
|
-
if (err) {
|
|
429
|
-
console.error(err);
|
|
430
|
-
return;
|
|
431
|
-
}
|
|
432
|
-
const server = WalletService.getInstance();
|
|
433
|
-
|
|
434
|
-
const txs = await Promise.all([
|
|
435
|
-
(async () => {
|
|
436
|
-
const bc = await server._getBlockchainExplorer(walletBtc.chain, walletBtc.network);
|
|
437
|
-
return util.promisify(bc.getTransactions).call(bc, walletBtc, blockNumBtc);
|
|
438
|
-
})(),
|
|
439
|
-
(async () => {
|
|
440
|
-
const bc = await server._getBlockchainExplorer(walletEth.chain, walletEth.network);
|
|
441
|
-
return util.promisify(bc.getTransactions).call(bc, walletEth, blockNumEth);
|
|
442
|
-
})(),
|
|
443
|
-
(async () => {
|
|
444
|
-
const bc = await server._getBlockchainExplorer(walletMatic.chain, walletMatic.network);
|
|
445
|
-
return util.promisify(bc.getTransactions).call(bc, walletMatic, blockNumMatic);
|
|
446
|
-
})(),
|
|
447
|
-
(async () => {
|
|
448
|
-
const bc = await server._getBlockchainExplorer(walletArb.chain, walletArb.network);
|
|
449
|
-
return util.promisify(bc.getTransactions).call(bc, walletArb, blockNumArb);
|
|
450
|
-
})(),
|
|
451
|
-
(async () => {
|
|
452
|
-
const bc = await server._getBlockchainExplorer(walletOp.chain, walletOp.network);
|
|
453
|
-
return util.promisify(bc.getTransactions).call(bc, walletOp, blockNumOp);
|
|
454
|
-
})(),
|
|
455
|
-
(async () => {
|
|
456
|
-
const bc = await server._getBlockchainExplorer(walletBase.chain, walletBase.network);
|
|
457
|
-
return util.promisify(bc.getTransactions).call(bc, walletBase, blockNumBase);
|
|
458
|
-
})(),
|
|
459
|
-
|
|
460
|
-
]);
|
|
461
|
-
|
|
462
|
-
console.log(walletBtc.chain, 'DESC:', txs[0].every((t, i) => t.height >= (txs[0][i+1]?.height || 0)));
|
|
463
|
-
console.log(walletEth.chain, 'DESC:', txs[1].every((t, i) => t.height >= (txs[1][i+1]?.height || 0)));
|
|
464
|
-
console.log(walletMatic.chain, 'DESC:', txs[2].every((t, i) => t.height >= (txs[2][i+1]?.height || 0)));
|
|
465
|
-
console.log(walletArb.chain, 'DESC:', txs[3].every((t, i) => t.height >= (txs[3][i+1]?.height || 0)));
|
|
466
|
-
console.log(walletOp.chain, 'DESC:', txs[4].every((t, i) => t.height >= (txs[4][i+1]?.height || 0)));
|
|
467
|
-
console.log(walletBase.chain, 'DESC:', txs[5].every((t, i) => t.height >= (txs[5][i+1]?.height || 0)));
|
|
468
|
-
});
|
package/scripts/findEmail.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import config from '../ts_build/src/config.js';
|
|
3
|
-
import { BWS } from '../ts_build/src/index.js';
|
|
4
|
-
|
|
5
|
-
const storage = new BWS.Storage();
|
|
6
|
-
storage.connect(config.default.storageOpts, async (err) => {
|
|
7
|
-
if (err) {
|
|
8
|
-
console.log(err);
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
function done(err) {
|
|
13
|
-
if (err) { console.log(err); }
|
|
14
|
-
storage.disconnect(() => { console.log('done'); });
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
try {
|
|
18
|
-
let i = 0;
|
|
19
|
-
const prefsStream = storage.db.collection(BWS.Storage.collections.PREFERENCES).find({});
|
|
20
|
-
for await (const pref of prefsStream) {
|
|
21
|
-
if (pref.email === 'hugo@hmtrading.com') {
|
|
22
|
-
console.log(`${pref.walletId}\t${pref.email}`);
|
|
23
|
-
}
|
|
24
|
-
if (++i % 1000 === 0) {
|
|
25
|
-
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
return done();
|
|
29
|
-
} catch (err) {
|
|
30
|
-
return done(err);
|
|
31
|
-
}
|
|
32
|
-
});
|
package/scripts/getSolStats2.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import fs from 'fs';
|
|
3
|
-
import request from 'request-promise-native';
|
|
4
|
-
import { Storage } from '../../ts_build/src';
|
|
5
|
-
import config from '../../ts_build/src/config';
|
|
6
|
-
|
|
7
|
-
const format = (bal, num) => Intl.NumberFormat('en-US', { minimumFractionDigits: num }).format(bal / Math.pow(10, num));
|
|
8
|
-
|
|
9
|
-
const storage = new Storage();
|
|
10
|
-
storage.connect(config.storageOpts, async (err) => {
|
|
11
|
-
if (err) {
|
|
12
|
-
console.log(err);
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
function done(err) {
|
|
17
|
-
if (err) { console.log(err); }
|
|
18
|
-
storage.disconnect(() => { console.log('done'); });
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
try {
|
|
22
|
-
const walletIds = fs.readFileSync('./output-getSolStats.txt', 'utf8').split('\n').filter(Boolean);
|
|
23
|
-
const walletCnt = walletIds.length;
|
|
24
|
-
|
|
25
|
-
let count = 0;
|
|
26
|
-
let countNoAddy = 0;
|
|
27
|
-
let totalCount = 0;
|
|
28
|
-
let balanceSOL = 0;
|
|
29
|
-
let balanceUSDC = 0;
|
|
30
|
-
let balanceUSDT = 0;
|
|
31
|
-
for (const walletId of walletIds) {
|
|
32
|
-
await new Promise(resolve => setTimeout(resolve, 80)); // sleep 80ms
|
|
33
|
-
|
|
34
|
-
totalCount++;
|
|
35
|
-
if (totalCount % 100 === 0) {
|
|
36
|
-
process.stdout.write(`Processed ${count}/${totalCount}/${walletCnt} wallets (${(totalCount / walletCnt * 100).toFixed(1)}%)` +
|
|
37
|
-
` -- ${format(balanceSOL, 9)}/${format(balanceUSDC, 6)}/${format(balanceUSDT, 6)}\r`); // shows how fast things are working
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
count++;
|
|
41
|
-
const address = await storage.db.collection(Storage.collections.ADDRESSES).findOne({ walletId: walletId });
|
|
42
|
-
if (!address) {
|
|
43
|
-
countNoAddy++;
|
|
44
|
-
continue;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const [res, resUSDC, resUSDT] = await Promise.all([
|
|
48
|
-
request(`https://api-sol.bitcore.io/api/SOL/mainnet/address/${address.address}/balance`, { json: true }),
|
|
49
|
-
request(`https://api-sol.bitcore.io/api/SOL/mainnet/address/${address.address}/balance?tokenAddress=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v`, { json: true })
|
|
50
|
-
.catch(err => {
|
|
51
|
-
if (err.message.includes('ATA not initialized')) {
|
|
52
|
-
return { balance: 0 };
|
|
53
|
-
}
|
|
54
|
-
throw err;
|
|
55
|
-
}),
|
|
56
|
-
request(`https://api-sol.bitcore.io/api/SOL/mainnet/address/${address.address}/balance?tokenAddress=Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB`, { json: true })
|
|
57
|
-
.catch(err => {
|
|
58
|
-
if (err.message.includes('ATA not initialized')) {
|
|
59
|
-
return { balance: 0 };
|
|
60
|
-
}
|
|
61
|
-
throw err;
|
|
62
|
-
})
|
|
63
|
-
]);
|
|
64
|
-
balanceSOL += parseInt(res.balance);
|
|
65
|
-
balanceUSDC += parseInt(resUSDC.balance);
|
|
66
|
-
balanceUSDT += parseInt(resUSDT.balance);
|
|
67
|
-
}
|
|
68
|
-
process.stdout.write('\n');
|
|
69
|
-
|
|
70
|
-
console.log('Wallets with no address: ' + countNoAddy);
|
|
71
|
-
console.log('Wallets: ' + count);
|
|
72
|
-
console.log('Balance: ' + format(balanceSOL, 9) + ' SOL');
|
|
73
|
-
console.log('Balance: ' + format(balanceUSDC, 6) + ' USDC');
|
|
74
|
-
console.log('Balance: ' + format(balanceUSDT, 6) + ' USDT');
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
return done();
|
|
78
|
-
} catch (err) {
|
|
79
|
-
return done(err);
|
|
80
|
-
}
|
|
81
|
-
});
|