@sentio/sdk 1.35.1-rc.1 → 1.36.0-rc.1

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.
Files changed (86) hide show
  1. package/lib/aptos-codegen/codegen.d.ts +1 -0
  2. package/lib/aptos-codegen/codegen.js +9 -1
  3. package/lib/aptos-codegen/codegen.js.map +1 -1
  4. package/lib/core/base-processor-template.d.ts +8 -1
  5. package/lib/core/base-processor-template.js +13 -4
  6. package/lib/core/base-processor-template.js.map +1 -1
  7. package/lib/service.d.ts +1 -3
  8. package/lib/service.js +9 -41
  9. package/lib/service.js.map +1 -1
  10. package/lib/solana-codegen/codegen.d.ts +1 -0
  11. package/lib/{cli/build.js → solana-codegen/codegen.js} +3 -92
  12. package/lib/solana-codegen/codegen.js.map +1 -0
  13. package/lib/state/processor-state.d.ts +0 -5
  14. package/lib/state/processor-state.js +0 -5
  15. package/lib/state/processor-state.js.map +1 -1
  16. package/lib/test-abi-code-gen.js +4 -3
  17. package/lib/test-abi-code-gen.js.map +1 -1
  18. package/lib/testing/test-processor-server.d.ts +0 -2
  19. package/lib/testing/test-processor-server.js +7 -17
  20. package/lib/testing/test-processor-server.js.map +1 -1
  21. package/package.json +3 -11
  22. package/src/aptos-codegen/codegen.ts +8 -0
  23. package/src/core/base-processor-template.ts +14 -4
  24. package/src/service.ts +9 -57
  25. package/src/{cli/build.ts → solana-codegen/codegen.ts} +1 -113
  26. package/src/state/processor-state.ts +0 -11
  27. package/src/test-abi-code-gen.ts +2 -1
  28. package/src/testing/test-processor-server.ts +7 -19
  29. package/lib/cli/build.d.ts +0 -4
  30. package/lib/cli/build.js.map +0 -1
  31. package/lib/cli/cli.d.ts +0 -2
  32. package/lib/cli/cli.js +0 -186
  33. package/lib/cli/cli.js.map +0 -1
  34. package/lib/cli/commands/login-server.d.ts +0 -7
  35. package/lib/cli/commands/login-server.js +0 -133
  36. package/lib/cli/commands/login-server.js.map +0 -1
  37. package/lib/cli/commands/run-create.d.ts +0 -1
  38. package/lib/cli/commands/run-create.js +0 -111
  39. package/lib/cli/commands/run-create.js.map +0 -1
  40. package/lib/cli/commands/run-login.d.ts +0 -1
  41. package/lib/cli/commands/run-login.js +0 -136
  42. package/lib/cli/commands/run-login.js.map +0 -1
  43. package/lib/cli/commands/run-version.d.ts +0 -1
  44. package/lib/cli/commands/run-version.js +0 -39
  45. package/lib/cli/commands/run-version.js.map +0 -1
  46. package/lib/cli/config.d.ts +0 -14
  47. package/lib/cli/config.js +0 -64
  48. package/lib/cli/config.js.map +0 -1
  49. package/lib/cli/key.d.ts +0 -2
  50. package/lib/cli/key.js +0 -44
  51. package/lib/cli/key.js.map +0 -1
  52. package/lib/cli/upload.d.ts +0 -2
  53. package/lib/cli/upload.js +0 -189
  54. package/lib/cli/upload.js.map +0 -1
  55. package/lib/cli/utils.d.ts +0 -1
  56. package/lib/cli/utils.js +0 -16
  57. package/lib/cli/utils.js.map +0 -1
  58. package/lib/cli/webpack.config.js +0 -47
  59. package/src/cli/cli.ts +0 -184
  60. package/src/cli/commands/login-server.ts +0 -119
  61. package/src/cli/commands/run-create.ts +0 -115
  62. package/src/cli/commands/run-login.ts +0 -111
  63. package/src/cli/commands/run-version.ts +0 -32
  64. package/src/cli/config.ts +0 -72
  65. package/src/cli/key.ts +0 -43
  66. package/src/cli/upload.ts +0 -214
  67. package/src/cli/utils.ts +0 -10
  68. package/src/cli/webpack.config.js +0 -47
  69. package/templates/aptos/abis/aptos/souffle.json +0 -389
  70. package/templates/aptos/jest.config.js +0 -7
  71. package/templates/aptos/package.json +0 -20
  72. package/templates/aptos/sentio.yaml +0 -1
  73. package/templates/aptos/src/processor.ts +0 -13
  74. package/templates/aptos/tsconfig.json +0 -20
  75. package/templates/evm/abis/evm/x2y2.json +0 -296
  76. package/templates/evm/jest.config.js +0 -7
  77. package/templates/evm/package.json +0 -20
  78. package/templates/evm/sentio.yaml +0 -3
  79. package/templates/evm/src/processor.ts +0 -29
  80. package/templates/evm/tsconfig.json +0 -20
  81. package/templates/raw/jest.config.js +0 -7
  82. package/templates/raw/package.json +0 -20
  83. package/templates/raw/sentio.yaml +0 -3
  84. package/templates/raw/src/processor.ts +0 -0
  85. package/templates/raw/tsconfig.json +0 -20
  86. package/templates/raw/yarn.lock +0 -4095
@@ -1,296 +0,0 @@
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
- ]
@@ -1,7 +0,0 @@
1
- /** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
2
-
3
- module.exports = {
4
- preset: 'ts-jest',
5
- testEnvironment: 'node',
6
- modulePathIgnorePatterns: ["<rootDir>/dist/"]
7
- };
@@ -1,20 +0,0 @@
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
- }
@@ -1,3 +0,0 @@
1
- # Project name could be $org_or_user/$project_name or $project_name
2
- # If latter, will be treated the owner as api key's owner
3
- project: default
@@ -1,29 +0,0 @@
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
- )
@@ -1,20 +0,0 @@
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
- }
@@ -1,7 +0,0 @@
1
- /** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
2
-
3
- module.exports = {
4
- preset: 'ts-jest',
5
- testEnvironment: 'node',
6
- modulePathIgnorePatterns: ["<rootDir>/dist/"]
7
- };
@@ -1,20 +0,0 @@
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
- }
@@ -1,3 +0,0 @@
1
- # Project name could be $org_or_user/$project_name or $project_name
2
- # If latter, will be treated the owner as api key's owner
3
- project: default
File without changes
@@ -1,20 +0,0 @@
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
- }