@certik/skynet 0.7.10 → 0.7.14
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/.editorconfig +6 -0
- package/.eslintrc.js +13 -13
- package/CHANGELOG.md +18 -0
- package/README.md +23 -23
- package/abi.js +227 -227
- package/address.js +18 -18
- package/block.js +83 -83
- package/dynamodb.js +456 -456
- package/examples/deploy-consumer +0 -0
- package/examples/deploy-indexer +0 -0
- package/examples/deploy-mode-indexer +0 -0
- package/examples/deploy-producer +0 -0
- package/examples/indexer +0 -0
- package/examples/kafka-consumer +0 -0
- package/examples/kafka-producer +1 -1
- package/examples/mode-indexer +0 -0
- package/inquiry.js +14 -14
- package/kafka.js +129 -113
- package/labelling.js +40 -4
- package/metric.js +65 -65
- package/package.json +2 -2
- package/price.js +48 -48
- package/primitive.js +77 -77
- package/rateLimit.js +21 -21
- package/s3.js +93 -93
- package/scan.js +67 -67
- package/sqs.js +12 -12
- package/token.js +44 -44
- package/transaction.js +47 -47
- package/util.js +58 -58
package/.editorconfig
ADDED
package/.eslintrc.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
env: {
|
|
3
|
-
node: true,
|
|
4
|
-
browser: true,
|
|
5
|
-
commonjs: true,
|
|
6
|
-
es2021: true
|
|
7
|
-
},
|
|
8
|
-
extends: "eslint:recommended",
|
|
9
|
-
parserOptions: {
|
|
10
|
-
ecmaVersion: 12
|
|
11
|
-
},
|
|
12
|
-
rules: {}
|
|
13
|
-
};
|
|
1
|
+
module.exports = {
|
|
2
|
+
env: {
|
|
3
|
+
node: true,
|
|
4
|
+
browser: true,
|
|
5
|
+
commonjs: true,
|
|
6
|
+
es2021: true
|
|
7
|
+
},
|
|
8
|
+
extends: "eslint:recommended",
|
|
9
|
+
parserOptions: {
|
|
10
|
+
ecmaVersion: 12
|
|
11
|
+
},
|
|
12
|
+
rules: {}
|
|
13
|
+
};
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.7.14
|
|
4
|
+
|
|
5
|
+
- Fix missing require in `labelling.js`
|
|
6
|
+
- Only keep distinct tags in `labelling.js`
|
|
7
|
+
|
|
8
|
+
## 0.7.13
|
|
9
|
+
|
|
10
|
+
- Update `labelling.js` to support auto db entry creation and address label fetching.
|
|
11
|
+
|
|
12
|
+
## 0.7.12
|
|
13
|
+
|
|
14
|
+
- Fixed a bug in `kafka.js`
|
|
15
|
+
|
|
16
|
+
## 0.7.11
|
|
17
|
+
|
|
18
|
+
- Added low level API for sending and receiving messages directly from kafka instance.
|
|
19
|
+
- Added unit tests for `kafka.js`
|
|
20
|
+
|
|
3
21
|
## 0.7.10
|
|
4
22
|
|
|
5
23
|
Added `reset` option to producer in `kafka`
|
package/README.md
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
# Skynet Shared JS functions Library
|
|
2
|
-
|
|
3
|
-
## Usage
|
|
4
|
-
|
|
5
|
-
```
|
|
6
|
-
yarn add @certik/skynet
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
const { scanWholeTable } = require("@certik/skynet/dynamodb");
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Test
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
yarn test
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Publish
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
yarn publish --access public
|
|
23
|
-
```
|
|
1
|
+
# Skynet Shared JS functions Library
|
|
2
|
+
|
|
3
|
+
## Usage
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
yarn add @certik/skynet
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
const { scanWholeTable } = require("@certik/skynet/dynamodb");
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Test
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
yarn test
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Publish
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
yarn publish --access public
|
|
23
|
+
```
|
package/abi.js
CHANGED
|
@@ -1,227 +1,227 @@
|
|
|
1
|
-
const ERC20 = [
|
|
2
|
-
{
|
|
3
|
-
constant: true,
|
|
4
|
-
inputs: [],
|
|
5
|
-
name: "name",
|
|
6
|
-
outputs: [
|
|
7
|
-
{
|
|
8
|
-
name: "",
|
|
9
|
-
type: "string"
|
|
10
|
-
}
|
|
11
|
-
],
|
|
12
|
-
payable: false,
|
|
13
|
-
stateMutability: "view",
|
|
14
|
-
type: "function"
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
constant: false,
|
|
18
|
-
inputs: [
|
|
19
|
-
{
|
|
20
|
-
name: "_spender",
|
|
21
|
-
type: "address"
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
name: "_value",
|
|
25
|
-
type: "uint256"
|
|
26
|
-
}
|
|
27
|
-
],
|
|
28
|
-
name: "approve",
|
|
29
|
-
outputs: [
|
|
30
|
-
{
|
|
31
|
-
name: "",
|
|
32
|
-
type: "bool"
|
|
33
|
-
}
|
|
34
|
-
],
|
|
35
|
-
payable: false,
|
|
36
|
-
stateMutability: "nonpayable",
|
|
37
|
-
type: "function"
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
constant: true,
|
|
41
|
-
inputs: [],
|
|
42
|
-
name: "totalSupply",
|
|
43
|
-
outputs: [
|
|
44
|
-
{
|
|
45
|
-
name: "",
|
|
46
|
-
type: "uint256"
|
|
47
|
-
}
|
|
48
|
-
],
|
|
49
|
-
payable: false,
|
|
50
|
-
stateMutability: "view",
|
|
51
|
-
type: "function"
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
constant: false,
|
|
55
|
-
inputs: [
|
|
56
|
-
{
|
|
57
|
-
name: "_from",
|
|
58
|
-
type: "address"
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
name: "_to",
|
|
62
|
-
type: "address"
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
name: "_value",
|
|
66
|
-
type: "uint256"
|
|
67
|
-
}
|
|
68
|
-
],
|
|
69
|
-
name: "transferFrom",
|
|
70
|
-
outputs: [
|
|
71
|
-
{
|
|
72
|
-
name: "",
|
|
73
|
-
type: "bool"
|
|
74
|
-
}
|
|
75
|
-
],
|
|
76
|
-
payable: false,
|
|
77
|
-
stateMutability: "nonpayable",
|
|
78
|
-
type: "function"
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
constant: true,
|
|
82
|
-
inputs: [],
|
|
83
|
-
name: "decimals",
|
|
84
|
-
outputs: [
|
|
85
|
-
{
|
|
86
|
-
name: "",
|
|
87
|
-
type: "uint8"
|
|
88
|
-
}
|
|
89
|
-
],
|
|
90
|
-
payable: false,
|
|
91
|
-
stateMutability: "view",
|
|
92
|
-
type: "function"
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
constant: true,
|
|
96
|
-
inputs: [
|
|
97
|
-
{
|
|
98
|
-
name: "_owner",
|
|
99
|
-
type: "address"
|
|
100
|
-
}
|
|
101
|
-
],
|
|
102
|
-
name: "balanceOf",
|
|
103
|
-
outputs: [
|
|
104
|
-
{
|
|
105
|
-
name: "balance",
|
|
106
|
-
type: "uint256"
|
|
107
|
-
}
|
|
108
|
-
],
|
|
109
|
-
payable: false,
|
|
110
|
-
stateMutability: "view",
|
|
111
|
-
type: "function"
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
constant: true,
|
|
115
|
-
inputs: [],
|
|
116
|
-
name: "symbol",
|
|
117
|
-
outputs: [
|
|
118
|
-
{
|
|
119
|
-
name: "",
|
|
120
|
-
type: "string"
|
|
121
|
-
}
|
|
122
|
-
],
|
|
123
|
-
payable: false,
|
|
124
|
-
stateMutability: "view",
|
|
125
|
-
type: "function"
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
constant: false,
|
|
129
|
-
inputs: [
|
|
130
|
-
{
|
|
131
|
-
name: "_to",
|
|
132
|
-
type: "address"
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
name: "_value",
|
|
136
|
-
type: "uint256"
|
|
137
|
-
}
|
|
138
|
-
],
|
|
139
|
-
name: "transfer",
|
|
140
|
-
outputs: [
|
|
141
|
-
{
|
|
142
|
-
name: "",
|
|
143
|
-
type: "bool"
|
|
144
|
-
}
|
|
145
|
-
],
|
|
146
|
-
payable: false,
|
|
147
|
-
stateMutability: "nonpayable",
|
|
148
|
-
type: "function"
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
constant: true,
|
|
152
|
-
inputs: [
|
|
153
|
-
{
|
|
154
|
-
name: "_owner",
|
|
155
|
-
type: "address"
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
name: "_spender",
|
|
159
|
-
type: "address"
|
|
160
|
-
}
|
|
161
|
-
],
|
|
162
|
-
name: "allowance",
|
|
163
|
-
outputs: [
|
|
164
|
-
{
|
|
165
|
-
name: "",
|
|
166
|
-
type: "uint256"
|
|
167
|
-
}
|
|
168
|
-
],
|
|
169
|
-
payable: false,
|
|
170
|
-
stateMutability: "view",
|
|
171
|
-
type: "function"
|
|
172
|
-
},
|
|
173
|
-
{
|
|
174
|
-
payable: true,
|
|
175
|
-
stateMutability: "payable",
|
|
176
|
-
type: "fallback"
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
anonymous: false,
|
|
180
|
-
inputs: [
|
|
181
|
-
{
|
|
182
|
-
indexed: true,
|
|
183
|
-
name: "owner",
|
|
184
|
-
type: "address"
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
indexed: true,
|
|
188
|
-
name: "spender",
|
|
189
|
-
type: "address"
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
indexed: false,
|
|
193
|
-
name: "value",
|
|
194
|
-
type: "uint256"
|
|
195
|
-
}
|
|
196
|
-
],
|
|
197
|
-
name: "Approval",
|
|
198
|
-
type: "event"
|
|
199
|
-
},
|
|
200
|
-
{
|
|
201
|
-
anonymous: false,
|
|
202
|
-
inputs: [
|
|
203
|
-
{
|
|
204
|
-
indexed: true,
|
|
205
|
-
name: "from",
|
|
206
|
-
type: "address"
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
indexed: true,
|
|
210
|
-
name: "to",
|
|
211
|
-
type: "address"
|
|
212
|
-
},
|
|
213
|
-
{
|
|
214
|
-
indexed: false,
|
|
215
|
-
name: "value",
|
|
216
|
-
type: "uint256"
|
|
217
|
-
}
|
|
218
|
-
],
|
|
219
|
-
name: "Transfer",
|
|
220
|
-
type: "event"
|
|
221
|
-
}
|
|
222
|
-
];
|
|
223
|
-
|
|
224
|
-
module.exports = {
|
|
225
|
-
ERC20,
|
|
226
|
-
BEP20: ERC20
|
|
227
|
-
};
|
|
1
|
+
const ERC20 = [
|
|
2
|
+
{
|
|
3
|
+
constant: true,
|
|
4
|
+
inputs: [],
|
|
5
|
+
name: "name",
|
|
6
|
+
outputs: [
|
|
7
|
+
{
|
|
8
|
+
name: "",
|
|
9
|
+
type: "string"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
payable: false,
|
|
13
|
+
stateMutability: "view",
|
|
14
|
+
type: "function"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
constant: false,
|
|
18
|
+
inputs: [
|
|
19
|
+
{
|
|
20
|
+
name: "_spender",
|
|
21
|
+
type: "address"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: "_value",
|
|
25
|
+
type: "uint256"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
name: "approve",
|
|
29
|
+
outputs: [
|
|
30
|
+
{
|
|
31
|
+
name: "",
|
|
32
|
+
type: "bool"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
payable: false,
|
|
36
|
+
stateMutability: "nonpayable",
|
|
37
|
+
type: "function"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
constant: true,
|
|
41
|
+
inputs: [],
|
|
42
|
+
name: "totalSupply",
|
|
43
|
+
outputs: [
|
|
44
|
+
{
|
|
45
|
+
name: "",
|
|
46
|
+
type: "uint256"
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
payable: false,
|
|
50
|
+
stateMutability: "view",
|
|
51
|
+
type: "function"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
constant: false,
|
|
55
|
+
inputs: [
|
|
56
|
+
{
|
|
57
|
+
name: "_from",
|
|
58
|
+
type: "address"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: "_to",
|
|
62
|
+
type: "address"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: "_value",
|
|
66
|
+
type: "uint256"
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
name: "transferFrom",
|
|
70
|
+
outputs: [
|
|
71
|
+
{
|
|
72
|
+
name: "",
|
|
73
|
+
type: "bool"
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
payable: false,
|
|
77
|
+
stateMutability: "nonpayable",
|
|
78
|
+
type: "function"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
constant: true,
|
|
82
|
+
inputs: [],
|
|
83
|
+
name: "decimals",
|
|
84
|
+
outputs: [
|
|
85
|
+
{
|
|
86
|
+
name: "",
|
|
87
|
+
type: "uint8"
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
payable: false,
|
|
91
|
+
stateMutability: "view",
|
|
92
|
+
type: "function"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
constant: true,
|
|
96
|
+
inputs: [
|
|
97
|
+
{
|
|
98
|
+
name: "_owner",
|
|
99
|
+
type: "address"
|
|
100
|
+
}
|
|
101
|
+
],
|
|
102
|
+
name: "balanceOf",
|
|
103
|
+
outputs: [
|
|
104
|
+
{
|
|
105
|
+
name: "balance",
|
|
106
|
+
type: "uint256"
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
payable: false,
|
|
110
|
+
stateMutability: "view",
|
|
111
|
+
type: "function"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
constant: true,
|
|
115
|
+
inputs: [],
|
|
116
|
+
name: "symbol",
|
|
117
|
+
outputs: [
|
|
118
|
+
{
|
|
119
|
+
name: "",
|
|
120
|
+
type: "string"
|
|
121
|
+
}
|
|
122
|
+
],
|
|
123
|
+
payable: false,
|
|
124
|
+
stateMutability: "view",
|
|
125
|
+
type: "function"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
constant: false,
|
|
129
|
+
inputs: [
|
|
130
|
+
{
|
|
131
|
+
name: "_to",
|
|
132
|
+
type: "address"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
name: "_value",
|
|
136
|
+
type: "uint256"
|
|
137
|
+
}
|
|
138
|
+
],
|
|
139
|
+
name: "transfer",
|
|
140
|
+
outputs: [
|
|
141
|
+
{
|
|
142
|
+
name: "",
|
|
143
|
+
type: "bool"
|
|
144
|
+
}
|
|
145
|
+
],
|
|
146
|
+
payable: false,
|
|
147
|
+
stateMutability: "nonpayable",
|
|
148
|
+
type: "function"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
constant: true,
|
|
152
|
+
inputs: [
|
|
153
|
+
{
|
|
154
|
+
name: "_owner",
|
|
155
|
+
type: "address"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
name: "_spender",
|
|
159
|
+
type: "address"
|
|
160
|
+
}
|
|
161
|
+
],
|
|
162
|
+
name: "allowance",
|
|
163
|
+
outputs: [
|
|
164
|
+
{
|
|
165
|
+
name: "",
|
|
166
|
+
type: "uint256"
|
|
167
|
+
}
|
|
168
|
+
],
|
|
169
|
+
payable: false,
|
|
170
|
+
stateMutability: "view",
|
|
171
|
+
type: "function"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
payable: true,
|
|
175
|
+
stateMutability: "payable",
|
|
176
|
+
type: "fallback"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
anonymous: false,
|
|
180
|
+
inputs: [
|
|
181
|
+
{
|
|
182
|
+
indexed: true,
|
|
183
|
+
name: "owner",
|
|
184
|
+
type: "address"
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
indexed: true,
|
|
188
|
+
name: "spender",
|
|
189
|
+
type: "address"
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
indexed: false,
|
|
193
|
+
name: "value",
|
|
194
|
+
type: "uint256"
|
|
195
|
+
}
|
|
196
|
+
],
|
|
197
|
+
name: "Approval",
|
|
198
|
+
type: "event"
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
anonymous: false,
|
|
202
|
+
inputs: [
|
|
203
|
+
{
|
|
204
|
+
indexed: true,
|
|
205
|
+
name: "from",
|
|
206
|
+
type: "address"
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
indexed: true,
|
|
210
|
+
name: "to",
|
|
211
|
+
type: "address"
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
indexed: false,
|
|
215
|
+
name: "value",
|
|
216
|
+
type: "uint256"
|
|
217
|
+
}
|
|
218
|
+
],
|
|
219
|
+
name: "Transfer",
|
|
220
|
+
type: "event"
|
|
221
|
+
}
|
|
222
|
+
];
|
|
223
|
+
|
|
224
|
+
module.exports = {
|
|
225
|
+
ERC20,
|
|
226
|
+
BEP20: ERC20
|
|
227
|
+
};
|
package/address.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
function parseAddress(address) {
|
|
2
|
-
const parts = address.split(":");
|
|
3
|
-
|
|
4
|
-
if (parts.length === 2) {
|
|
5
|
-
return [parts[0], parts[1].toLowerCase()];
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
return ["eth", address.toLowerCase()];
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
function composeAddress(protocol, addr) {
|
|
12
|
-
return `${protocol}:${addr}`;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
module.exports = {
|
|
16
|
-
parseAddress,
|
|
17
|
-
composeAddress
|
|
18
|
-
};
|
|
1
|
+
function parseAddress(address) {
|
|
2
|
+
const parts = address.split(":");
|
|
3
|
+
|
|
4
|
+
if (parts.length === 2) {
|
|
5
|
+
return [parts[0], parts[1].toLowerCase()];
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
return ["eth", address.toLowerCase()];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function composeAddress(protocol, addr) {
|
|
12
|
+
return `${protocol}:${addr}`;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
module.exports = {
|
|
16
|
+
parseAddress,
|
|
17
|
+
composeAddress
|
|
18
|
+
};
|