forked from rohenaz/bmap-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
queries.ts
66 lines (60 loc) · 1.2 KB
/
queries.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import { config } from './config.js'
// OP_RETURN Protocol prefixes
const prefixes = {
bitcom: '$',
bitkey: '13SrNDkVzY5bHBRKNu5iXTQ7K7VqTh5tJC',
bitpic: '18pAqbYqhzErT6Zk3a5dwxHtB9icv8jH2p',
map: '1PuQa7K62MiKCtssSLKy1kh56WWU7MtUR5',
ron: '1GvFYzwtFix3qSAZhESQVTz9DeudHZNoh1',
}
// BitQuery
const query = {
v: 3,
q: {
find: {
$and: [
{
'out.tape.cell.s': {
$in: [
prefixes.map,
prefixes.bitkey,
prefixes.bitpic,
prefixes.ron,
prefixes.bitcom,
],
},
},
{ 'blk.i': { $gt: config.from } },
],
},
sort: { 'blk.i': 1 },
project: { out: 1, tx: 1, blk: 1, in: 1 },
},
}
const sock = {
v: 3,
q: {
find: {
'out.tape.cell.s': {
$in: [
prefixes.map,
prefixes.bitkey,
prefixes.bitpic,
prefixes.ron,
prefixes.bitcom,
],
},
},
},
}
const defaultQuery = {
v: 3,
q: {
find: {
'blk.t': { $gt: Math.floor(new Date().getTime() / 1000 - 86400) },
},
limit: 10,
project: { out: 0, in: 0 },
},
}
export { query, prefixes, defaultQuery, sock }