@sentio/cli 1.0.0
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/lib/build.d.ts +2 -0
- package/lib/build.js +78 -0
- package/lib/build.js.map +1 -0
- package/lib/cli +47 -0
- package/lib/cli.d.ts +2 -0
- package/lib/cli.js +186 -0
- package/lib/cli.js.map +1 -0
- package/lib/commands/login-server.d.ts +7 -0
- package/lib/commands/login-server.js +133 -0
- package/lib/commands/login-server.js.map +1 -0
- package/lib/commands/run-create.d.ts +1 -0
- package/lib/commands/run-create.js +111 -0
- package/lib/commands/run-create.js.map +1 -0
- package/lib/commands/run-login.d.ts +1 -0
- package/lib/commands/run-login.js +136 -0
- package/lib/commands/run-login.js.map +1 -0
- package/lib/commands/run-version.d.ts +1 -0
- package/lib/commands/run-version.js +39 -0
- package/lib/commands/run-version.js.map +1 -0
- package/lib/config.d.ts +14 -0
- package/lib/config.js +64 -0
- package/lib/config.js.map +1 -0
- package/lib/key.d.ts +2 -0
- package/lib/key.js +44 -0
- package/lib/key.js.map +1 -0
- package/lib/upload.d.ts +2 -0
- package/lib/upload.js +189 -0
- package/lib/upload.js.map +1 -0
- package/lib/utils.d.ts +1 -0
- package/lib/utils.js +16 -0
- package/lib/utils.js.map +1 -0
- package/package.json +64 -0
- package/src/build.ts +93 -0
- package/src/cli.ts +184 -0
- package/src/commands/login-server.ts +119 -0
- package/src/commands/run-create.ts +116 -0
- package/src/commands/run-login.ts +111 -0
- package/src/commands/run-version.ts +32 -0
- package/src/config.ts +72 -0
- package/src/key.ts +43 -0
- package/src/upload.ts +214 -0
- package/src/utils.ts +10 -0
- package/src/webpack.config.js +47 -0
- package/templates/aptos/.gitignore +107 -0
- package/templates/aptos/abis/aptos/souffle.json +389 -0
- package/templates/aptos/jest.config.js +7 -0
- package/templates/aptos/package.json +20 -0
- package/templates/aptos/sentio.yaml +1 -0
- package/templates/aptos/src/processor.test.ts +14 -0
- package/templates/aptos/src/processor.ts +13 -0
- package/templates/aptos/tsconfig.json +20 -0
- package/templates/evm/.gitignore +107 -0
- package/templates/evm/abis/evm/x2y2.json +296 -0
- package/templates/evm/jest.config.js +7 -0
- package/templates/evm/package.json +20 -0
- package/templates/evm/sentio.yaml +3 -0
- package/templates/evm/src/processor.test.ts +29 -0
- package/templates/evm/src/processor.ts +29 -0
- package/templates/evm/tsconfig.json +20 -0
- package/templates/raw/.gitignore +107 -0
- package/templates/raw/jest.config.js +7 -0
- package/templates/raw/package.json +20 -0
- package/templates/raw/sentio.yaml +3 -0
- package/templates/raw/src/processor.test.ts +14 -0
- package/templates/raw/src/processor.ts +0 -0
- package/templates/raw/tsconfig.json +20 -0
- package/templates/raw/yarn.lock +4095 -0
- package/tsconfig.json +13 -0
- package/yarn.lock +7037 -0
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"inputs": [
|
|
4
|
+
{ "internalType": "address", "name": "_x2y2Token", "type": "address" },
|
|
5
|
+
{
|
|
6
|
+
"internalType": "address",
|
|
7
|
+
"name": "_tokenSplitter",
|
|
8
|
+
"type": "address"
|
|
9
|
+
},
|
|
10
|
+
{ "internalType": "uint256", "name": "_startBlock", "type": "uint256" },
|
|
11
|
+
{
|
|
12
|
+
"internalType": "uint256[]",
|
|
13
|
+
"name": "_rewardsPerBlockForStaking",
|
|
14
|
+
"type": "uint256[]"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"internalType": "uint256[]",
|
|
18
|
+
"name": "_rewardsPerBlockForOthers",
|
|
19
|
+
"type": "uint256[]"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"internalType": "uint256[]",
|
|
23
|
+
"name": "_periodLengthesInBlocks",
|
|
24
|
+
"type": "uint256[]"
|
|
25
|
+
},
|
|
26
|
+
{ "internalType": "uint256", "name": "_numberPeriods", "type": "uint256" }
|
|
27
|
+
],
|
|
28
|
+
"stateMutability": "nonpayable",
|
|
29
|
+
"type": "constructor"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"anonymous": false,
|
|
33
|
+
"inputs": [
|
|
34
|
+
{
|
|
35
|
+
"indexed": true,
|
|
36
|
+
"internalType": "address",
|
|
37
|
+
"name": "user",
|
|
38
|
+
"type": "address"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"indexed": false,
|
|
42
|
+
"internalType": "uint256",
|
|
43
|
+
"name": "harvestedAmount",
|
|
44
|
+
"type": "uint256"
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
"name": "Compound",
|
|
48
|
+
"type": "event"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"anonymous": false,
|
|
52
|
+
"inputs": [
|
|
53
|
+
{
|
|
54
|
+
"indexed": true,
|
|
55
|
+
"internalType": "address",
|
|
56
|
+
"name": "user",
|
|
57
|
+
"type": "address"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"indexed": false,
|
|
61
|
+
"internalType": "uint256",
|
|
62
|
+
"name": "amount",
|
|
63
|
+
"type": "uint256"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"indexed": false,
|
|
67
|
+
"internalType": "uint256",
|
|
68
|
+
"name": "harvestedAmount",
|
|
69
|
+
"type": "uint256"
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
"name": "Deposit",
|
|
73
|
+
"type": "event"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"anonymous": false,
|
|
77
|
+
"inputs": [
|
|
78
|
+
{
|
|
79
|
+
"indexed": true,
|
|
80
|
+
"internalType": "uint256",
|
|
81
|
+
"name": "currentPhase",
|
|
82
|
+
"type": "uint256"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"indexed": false,
|
|
86
|
+
"internalType": "uint256",
|
|
87
|
+
"name": "startBlock",
|
|
88
|
+
"type": "uint256"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"indexed": false,
|
|
92
|
+
"internalType": "uint256",
|
|
93
|
+
"name": "rewardPerBlockForStaking",
|
|
94
|
+
"type": "uint256"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"indexed": false,
|
|
98
|
+
"internalType": "uint256",
|
|
99
|
+
"name": "rewardPerBlockForOthers",
|
|
100
|
+
"type": "uint256"
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
"name": "NewRewardsPerBlock",
|
|
104
|
+
"type": "event"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"anonymous": false,
|
|
108
|
+
"inputs": [
|
|
109
|
+
{
|
|
110
|
+
"indexed": true,
|
|
111
|
+
"internalType": "address",
|
|
112
|
+
"name": "user",
|
|
113
|
+
"type": "address"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"indexed": false,
|
|
117
|
+
"internalType": "uint256",
|
|
118
|
+
"name": "amount",
|
|
119
|
+
"type": "uint256"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"indexed": false,
|
|
123
|
+
"internalType": "uint256",
|
|
124
|
+
"name": "harvestedAmount",
|
|
125
|
+
"type": "uint256"
|
|
126
|
+
}
|
|
127
|
+
],
|
|
128
|
+
"name": "Withdraw",
|
|
129
|
+
"type": "event"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"inputs": [],
|
|
133
|
+
"name": "NUMBER_PERIODS",
|
|
134
|
+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
135
|
+
"stateMutability": "view",
|
|
136
|
+
"type": "function"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"inputs": [],
|
|
140
|
+
"name": "PRECISION_FACTOR",
|
|
141
|
+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
142
|
+
"stateMutability": "view",
|
|
143
|
+
"type": "function"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"inputs": [],
|
|
147
|
+
"name": "START_BLOCK",
|
|
148
|
+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
149
|
+
"stateMutability": "view",
|
|
150
|
+
"type": "function"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"inputs": [],
|
|
154
|
+
"name": "accTokenPerShare",
|
|
155
|
+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
156
|
+
"stateMutability": "view",
|
|
157
|
+
"type": "function"
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"inputs": [{ "internalType": "address", "name": "user", "type": "address" }],
|
|
161
|
+
"name": "calculatePendingRewards",
|
|
162
|
+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
163
|
+
"stateMutability": "view",
|
|
164
|
+
"type": "function"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"inputs": [],
|
|
168
|
+
"name": "currentPhase",
|
|
169
|
+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
170
|
+
"stateMutability": "view",
|
|
171
|
+
"type": "function"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"inputs": [{ "internalType": "uint256", "name": "amount", "type": "uint256" }],
|
|
175
|
+
"name": "deposit",
|
|
176
|
+
"outputs": [],
|
|
177
|
+
"stateMutability": "nonpayable",
|
|
178
|
+
"type": "function"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"inputs": [],
|
|
182
|
+
"name": "endBlock",
|
|
183
|
+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
184
|
+
"stateMutability": "view",
|
|
185
|
+
"type": "function"
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"inputs": [],
|
|
189
|
+
"name": "harvestAndCompound",
|
|
190
|
+
"outputs": [],
|
|
191
|
+
"stateMutability": "nonpayable",
|
|
192
|
+
"type": "function"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"inputs": [],
|
|
196
|
+
"name": "lastRewardBlock",
|
|
197
|
+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
198
|
+
"stateMutability": "view",
|
|
199
|
+
"type": "function"
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"inputs": [],
|
|
203
|
+
"name": "rewardPerBlockForOthers",
|
|
204
|
+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
205
|
+
"stateMutability": "view",
|
|
206
|
+
"type": "function"
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"inputs": [],
|
|
210
|
+
"name": "rewardPerBlockForStaking",
|
|
211
|
+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
212
|
+
"stateMutability": "view",
|
|
213
|
+
"type": "function"
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
217
|
+
"name": "stakingPeriod",
|
|
218
|
+
"outputs": [
|
|
219
|
+
{
|
|
220
|
+
"internalType": "uint256",
|
|
221
|
+
"name": "rewardPerBlockForStaking",
|
|
222
|
+
"type": "uint256"
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"internalType": "uint256",
|
|
226
|
+
"name": "rewardPerBlockForOthers",
|
|
227
|
+
"type": "uint256"
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"internalType": "uint256",
|
|
231
|
+
"name": "periodLengthInBlock",
|
|
232
|
+
"type": "uint256"
|
|
233
|
+
}
|
|
234
|
+
],
|
|
235
|
+
"stateMutability": "view",
|
|
236
|
+
"type": "function"
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"inputs": [],
|
|
240
|
+
"name": "tokenSplitter",
|
|
241
|
+
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
242
|
+
"stateMutability": "view",
|
|
243
|
+
"type": "function"
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"inputs": [],
|
|
247
|
+
"name": "totalAmountStaked",
|
|
248
|
+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
249
|
+
"stateMutability": "view",
|
|
250
|
+
"type": "function"
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
"inputs": [],
|
|
254
|
+
"name": "updatePool",
|
|
255
|
+
"outputs": [],
|
|
256
|
+
"stateMutability": "nonpayable",
|
|
257
|
+
"type": "function"
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
"inputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
261
|
+
"name": "userInfo",
|
|
262
|
+
"outputs": [
|
|
263
|
+
{ "internalType": "uint256", "name": "amount", "type": "uint256" },
|
|
264
|
+
{ "internalType": "uint256", "name": "rewardDebt", "type": "uint256" }
|
|
265
|
+
],
|
|
266
|
+
"stateMutability": "view",
|
|
267
|
+
"type": "function"
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
"inputs": [{ "internalType": "uint256", "name": "amount", "type": "uint256" }],
|
|
271
|
+
"name": "withdraw",
|
|
272
|
+
"outputs": [],
|
|
273
|
+
"stateMutability": "nonpayable",
|
|
274
|
+
"type": "function"
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"inputs": [],
|
|
278
|
+
"name": "withdrawAll",
|
|
279
|
+
"outputs": [],
|
|
280
|
+
"stateMutability": "nonpayable",
|
|
281
|
+
"type": "function"
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"inputs": [],
|
|
285
|
+
"name": "x2y2Token",
|
|
286
|
+
"outputs": [
|
|
287
|
+
{
|
|
288
|
+
"internalType": "contract IMintableERC20",
|
|
289
|
+
"name": "",
|
|
290
|
+
"type": "address"
|
|
291
|
+
}
|
|
292
|
+
],
|
|
293
|
+
"stateMutability": "view",
|
|
294
|
+
"type": "function"
|
|
295
|
+
}
|
|
296
|
+
]
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "template-evm",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"test": "jest",
|
|
7
|
+
"gen": "sentio gen",
|
|
8
|
+
"build": "sentio build",
|
|
9
|
+
"upload": "sentio upload"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@sentio/sdk": "^1.0.0-development"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"@types/jest": "^29.0.0",
|
|
16
|
+
"jest": "^29.0.0",
|
|
17
|
+
"ts-jest": "^29.0.0",
|
|
18
|
+
"typescript": "^4.7.2"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { TestProcessorServer, firstCounterValue } from '@sentio/sdk/lib/testing'
|
|
2
|
+
import { mockTransferLog } from '@sentio/sdk/lib/builtin/erc20/test-utils'
|
|
3
|
+
import { BigNumber } from 'ethers'
|
|
4
|
+
|
|
5
|
+
describe('Test Processor', () => {
|
|
6
|
+
const service = new TestProcessorServer(() => require('./processor'))
|
|
7
|
+
|
|
8
|
+
beforeAll(async () => {
|
|
9
|
+
await service.start()
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
test('has valid config', async () => {
|
|
13
|
+
const config = await service.getConfig({})
|
|
14
|
+
expect(config.contractConfigs.length > 0).toBeTruthy()
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
test('check transfer event handling', async () => {
|
|
18
|
+
const resp = await service.testLog(
|
|
19
|
+
mockTransferLog('0x1e4ede388cbc9f4b5c79681b7f94d36a11abebc9', {
|
|
20
|
+
from: '0x0000000000000000000000000000000000000000',
|
|
21
|
+
to: '0xb329e39ebefd16f40d38f07643652ce17ca5bac1',
|
|
22
|
+
value: BigNumber.from(10n ** 18n * 10n),
|
|
23
|
+
})
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
const tokenCounter = firstCounterValue(resp.result, 'token')
|
|
27
|
+
expect(tokenCounter).toEqual(10n)
|
|
28
|
+
})
|
|
29
|
+
})
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Counter, Gauge } from '@sentio/sdk'
|
|
2
|
+
import { token } from '@sentio/sdk/lib/utils'
|
|
3
|
+
import { ERC20Processor } from '@sentio/sdk/lib/builtin/erc20'
|
|
4
|
+
import { X2y2Processor } from './types/x2y2'
|
|
5
|
+
|
|
6
|
+
const rewardPerBlock = Gauge.register('reward_per_block', {
|
|
7
|
+
description: 'rewards for each block grouped by phase',
|
|
8
|
+
unit: 'x2y2',
|
|
9
|
+
})
|
|
10
|
+
const tokenCounter = Counter.register('token')
|
|
11
|
+
|
|
12
|
+
X2y2Processor.bind({ address: '0xB329e39Ebefd16f40d38f07643652cE17Ca5Bac1' }).onBlockInterval(async (_, ctx) => {
|
|
13
|
+
const phase = (await ctx.contract.currentPhase()).toString()
|
|
14
|
+
const reward = token.scaleDown(await ctx.contract.rewardPerBlockForStaking(), 18)
|
|
15
|
+
rewardPerBlock.record(ctx, reward, { phase })
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
const filter = ERC20Processor.filters.Transfer(
|
|
19
|
+
'0x0000000000000000000000000000000000000000',
|
|
20
|
+
'0xb329e39ebefd16f40d38f07643652ce17ca5bac1'
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
ERC20Processor.bind({ address: '0x1e4ede388cbc9f4b5c79681b7f94d36a11abebc9' }).onEventTransfer(
|
|
24
|
+
async (event, ctx) => {
|
|
25
|
+
const val = token.scaleDown(event.args.value, 18)
|
|
26
|
+
tokenCounter.add(ctx, val)
|
|
27
|
+
},
|
|
28
|
+
filter // filter is an optional parameter
|
|
29
|
+
)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"alwaysStrict": true,
|
|
4
|
+
"sourceMap": true,
|
|
5
|
+
"target": "esnext",
|
|
6
|
+
"esModuleInterop": true,
|
|
7
|
+
"noImplicitReturns": true,
|
|
8
|
+
"noImplicitAny": true,
|
|
9
|
+
"module": "commonjs",
|
|
10
|
+
"moduleResolution": "node",
|
|
11
|
+
"strictNullChecks": true,
|
|
12
|
+
"stripInternal": true,
|
|
13
|
+
"noFallthroughCasesInSwitch": true,
|
|
14
|
+
"noEmitOnError": true,
|
|
15
|
+
"outDir": "dist",
|
|
16
|
+
"rootDir": "./src",
|
|
17
|
+
"skipLibCheck": true
|
|
18
|
+
},
|
|
19
|
+
"exclude": ["dist"]
|
|
20
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
.idea
|
|
2
|
+
src/types
|
|
3
|
+
|
|
4
|
+
# Logs
|
|
5
|
+
logs
|
|
6
|
+
*.log
|
|
7
|
+
npm-debug.log*
|
|
8
|
+
yarn-debug.log*
|
|
9
|
+
yarn-error.log*
|
|
10
|
+
lerna-debug.log*
|
|
11
|
+
|
|
12
|
+
# Diagnostic reports (https://nodejs.org/api/report.html)
|
|
13
|
+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
|
14
|
+
|
|
15
|
+
# Runtime data
|
|
16
|
+
pids
|
|
17
|
+
*.pid
|
|
18
|
+
*.seed
|
|
19
|
+
*.pid.lock
|
|
20
|
+
|
|
21
|
+
# Directory for instrumented libs generated by jscoverage/JSCover
|
|
22
|
+
lib-cov
|
|
23
|
+
|
|
24
|
+
# Coverage directory used by tools like istanbul
|
|
25
|
+
coverage
|
|
26
|
+
*.lcov
|
|
27
|
+
|
|
28
|
+
# nyc test coverage
|
|
29
|
+
.nyc_output
|
|
30
|
+
|
|
31
|
+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
|
32
|
+
.grunt
|
|
33
|
+
|
|
34
|
+
# Bower dependency directory (https://bower.io/)
|
|
35
|
+
bower_components
|
|
36
|
+
|
|
37
|
+
# node-waf configuration
|
|
38
|
+
.lock-wscript
|
|
39
|
+
|
|
40
|
+
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
|
41
|
+
build/Release
|
|
42
|
+
|
|
43
|
+
# Dependency directories
|
|
44
|
+
node_modules/
|
|
45
|
+
jspm_packages/
|
|
46
|
+
|
|
47
|
+
# TypeScript v1 declaration files
|
|
48
|
+
typings/
|
|
49
|
+
|
|
50
|
+
# TypeScript cache
|
|
51
|
+
*.tsbuildinfo
|
|
52
|
+
|
|
53
|
+
# Optional npm cache directory
|
|
54
|
+
.npm
|
|
55
|
+
|
|
56
|
+
# Optional eslint cache
|
|
57
|
+
.eslintcache
|
|
58
|
+
|
|
59
|
+
# Microbundle cache
|
|
60
|
+
.rpt2_cache/
|
|
61
|
+
.rts2_cache_cjs/
|
|
62
|
+
.rts2_cache_es/
|
|
63
|
+
.rts2_cache_umd/
|
|
64
|
+
|
|
65
|
+
# Optional REPL history
|
|
66
|
+
.node_repl_history
|
|
67
|
+
|
|
68
|
+
# Output of 'npm pack'
|
|
69
|
+
*.tgz
|
|
70
|
+
|
|
71
|
+
# Yarn Integrity file
|
|
72
|
+
.yarn-integrity
|
|
73
|
+
|
|
74
|
+
# dotenv environment variables file
|
|
75
|
+
.env
|
|
76
|
+
.env.test
|
|
77
|
+
|
|
78
|
+
# parcel-bundler cache (https://parceljs.org/)
|
|
79
|
+
.cache
|
|
80
|
+
|
|
81
|
+
# Next.js build output
|
|
82
|
+
.next
|
|
83
|
+
|
|
84
|
+
# Nuxt.js build / generate output
|
|
85
|
+
.nuxt
|
|
86
|
+
dist
|
|
87
|
+
|
|
88
|
+
# Gatsby files
|
|
89
|
+
.cache/
|
|
90
|
+
# Comment in the public line in if your project uses Gatsby and *not* Next.js
|
|
91
|
+
# https://nextjs.org/blog/next-9-1#public-directory-support
|
|
92
|
+
# public
|
|
93
|
+
|
|
94
|
+
# vuepress build output
|
|
95
|
+
.vuepress/dist
|
|
96
|
+
|
|
97
|
+
# Serverless directories
|
|
98
|
+
.serverless/
|
|
99
|
+
|
|
100
|
+
# FuseBox cache
|
|
101
|
+
.fusebox/
|
|
102
|
+
|
|
103
|
+
# DynamoDB Local files
|
|
104
|
+
.dynamodb/
|
|
105
|
+
|
|
106
|
+
# TernJS port file
|
|
107
|
+
.tern-port
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "template-raw",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"test": "jest",
|
|
7
|
+
"gen": "sentio gen",
|
|
8
|
+
"build": "sentio build",
|
|
9
|
+
"upload": "sentio upload"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@sentio/sdk": "^1.0.0-development"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"@types/jest": "^29.0.0",
|
|
16
|
+
"jest": "^29.0.0",
|
|
17
|
+
"ts-jest": "^29.0.0",
|
|
18
|
+
"typescript": "^4.7.2"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TestProcessorServer } from '@sentio/sdk/lib/testing'
|
|
2
|
+
|
|
3
|
+
describe('Test Processor', () => {
|
|
4
|
+
const service = new TestProcessorServer(() => require('./processor'))
|
|
5
|
+
|
|
6
|
+
beforeAll(async () => {
|
|
7
|
+
await service.start()
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
test('has valid config', async () => {
|
|
11
|
+
// const config = await service.getConfig({})
|
|
12
|
+
// expect(config.contractConfigs.length > 0).toBeTruthy()
|
|
13
|
+
})
|
|
14
|
+
})
|
|
File without changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"alwaysStrict": true,
|
|
4
|
+
"sourceMap": true,
|
|
5
|
+
"target": "esnext",
|
|
6
|
+
"esModuleInterop": true,
|
|
7
|
+
"noImplicitReturns": true,
|
|
8
|
+
"noImplicitAny": true,
|
|
9
|
+
"module": "commonjs",
|
|
10
|
+
"moduleResolution": "node",
|
|
11
|
+
"strictNullChecks": true,
|
|
12
|
+
"stripInternal": true,
|
|
13
|
+
"noFallthroughCasesInSwitch": true,
|
|
14
|
+
"noEmitOnError": true,
|
|
15
|
+
"outDir": "dist",
|
|
16
|
+
"rootDir": "./src",
|
|
17
|
+
"skipLibCheck": true
|
|
18
|
+
},
|
|
19
|
+
"exclude": ["dist"]
|
|
20
|
+
}
|