@sentio/cli 3.5.1-rc.1 → 3.5.1-rc.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/lib/index.js +3455 -40503
- package/package.json +1 -1
- package/src/abi.ts +2 -35
- package/src/config.ts +1 -1
- package/templates/starknet/abis/starknet/sepolia/VoteContract-0x00cf88f7ecf1bf36e9262333879e2937611cd81758db64a169776a2710464391.json +0 -65
- package/templates/starknet/package.json +0 -19
- package/templates/starknet/sentio.yaml +0 -6
- package/templates/starknet/src/processor.ts +0 -5
- package/templates/starknet/tsconfig.json +0 -24
package/package.json
CHANGED
package/src/abi.ts
CHANGED
|
@@ -3,7 +3,7 @@ import process from 'process'
|
|
|
3
3
|
import path from 'path'
|
|
4
4
|
import fs from 'fs-extra'
|
|
5
5
|
import fetch from 'node-fetch'
|
|
6
|
-
import { AptosChainId, ChainId,
|
|
6
|
+
import { AptosChainId, ChainId, SuiChainId } from '@sentio/chain'
|
|
7
7
|
|
|
8
8
|
import type { Aptos } from '@aptos-labs/ts-sdk'
|
|
9
9
|
import type { IotaClient } from '@iota/iota-sdk/client'
|
|
@@ -11,7 +11,6 @@ import type { SuiJsonRpcClient } from '@mysten/sui/jsonRpc'
|
|
|
11
11
|
import { ReadKey } from './key.js'
|
|
12
12
|
import { Auth } from './commands/upload.js'
|
|
13
13
|
import { getApiUrl } from './utils.js'
|
|
14
|
-
import type { RpcProvider as Starknet } from 'starknet'
|
|
15
14
|
|
|
16
15
|
export async function getABI(
|
|
17
16
|
chain: ChainId,
|
|
@@ -135,30 +134,6 @@ export async function getABI(
|
|
|
135
134
|
console.log('aptos module not loaded')
|
|
136
135
|
}
|
|
137
136
|
|
|
138
|
-
// starknet
|
|
139
|
-
try {
|
|
140
|
-
const Starknet = (await import('starknet')).RpcProvider
|
|
141
|
-
let starknetClient: Starknet | undefined
|
|
142
|
-
|
|
143
|
-
switch (chain) {
|
|
144
|
-
case StarknetChainId.STARKNET_MAINNET:
|
|
145
|
-
starknetClient = new Starknet({
|
|
146
|
-
nodeUrl: 'https://starknet-mainnet.g.alchemy.com/starknet/version/rpc/v0_8/8sD5yitBslIYCPFzSq_Q1ObJHqPlZxFw'
|
|
147
|
-
})
|
|
148
|
-
break
|
|
149
|
-
case StarknetChainId.STARKNET_SEPOLIA:
|
|
150
|
-
starknetClient = new Starknet({
|
|
151
|
-
nodeUrl: 'https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/v0_8/8sD5yitBslIYCPFzSq_Q1ObJHqPlZxFw'
|
|
152
|
-
})
|
|
153
|
-
break
|
|
154
|
-
}
|
|
155
|
-
if (starknetClient) {
|
|
156
|
-
const clazz = await starknetClient.getClassAt(address, 'latest')
|
|
157
|
-
return { abi: clazz.abi, name }
|
|
158
|
-
}
|
|
159
|
-
} catch (e) {
|
|
160
|
-
console.log('starknet module not loaded')
|
|
161
|
-
}
|
|
162
137
|
|
|
163
138
|
// ethereum
|
|
164
139
|
try {
|
|
@@ -206,7 +181,7 @@ export async function getABI(
|
|
|
206
181
|
|
|
207
182
|
export function getABIFilePath(chain: string, name: string, address?: string, folder?: string): string {
|
|
208
183
|
let subpath
|
|
209
|
-
|
|
184
|
+
const filename = name ?? address
|
|
210
185
|
switch (chain) {
|
|
211
186
|
case AptosChainId.APTOS_MAINNET:
|
|
212
187
|
subpath = 'aptos'
|
|
@@ -235,14 +210,6 @@ export function getABIFilePath(chain: string, name: string, address?: string, fo
|
|
|
235
210
|
case SuiChainId.IOTA_TESTNET:
|
|
236
211
|
subpath = 'iota/testnet'
|
|
237
212
|
break
|
|
238
|
-
case StarknetChainId.STARKNET_MAINNET:
|
|
239
|
-
subpath = 'starknet'
|
|
240
|
-
filename = name && address ? `${name}-${address}` : (name ?? address)
|
|
241
|
-
break
|
|
242
|
-
case StarknetChainId.STARKNET_SEPOLIA:
|
|
243
|
-
subpath = 'starknet/sepolia'
|
|
244
|
-
filename = name && address ? `${name}-${address}` : (name ?? address)
|
|
245
|
-
break
|
|
246
213
|
default:
|
|
247
214
|
subpath = 'eth'
|
|
248
215
|
}
|
package/src/config.ts
CHANGED
|
@@ -10,7 +10,7 @@ const HostMap: { [host: string]: string } = {
|
|
|
10
10
|
prod: 'https://app.sentio.xyz'
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
export const CHAIN_TYPES = ['eth', 'solana', 'aptos', 'sui', 'iota', 'fuel'
|
|
13
|
+
export const CHAIN_TYPES = ['eth', 'solana', 'aptos', 'sui', 'iota', 'fuel']
|
|
14
14
|
|
|
15
15
|
export interface YamlContractConfig {
|
|
16
16
|
address: string
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"type": "impl",
|
|
4
|
-
"name": "VotingContractImpl",
|
|
5
|
-
"interface_name": "contracts::IVotingContract"
|
|
6
|
-
},
|
|
7
|
-
{
|
|
8
|
-
"type": "interface",
|
|
9
|
-
"name": "contracts::IVotingContract",
|
|
10
|
-
"items": [
|
|
11
|
-
{
|
|
12
|
-
"type": "function",
|
|
13
|
-
"name": "vote",
|
|
14
|
-
"inputs": [
|
|
15
|
-
{
|
|
16
|
-
"name": "vote",
|
|
17
|
-
"type": "core::felt252"
|
|
18
|
-
}
|
|
19
|
-
],
|
|
20
|
-
"outputs": [],
|
|
21
|
-
"state_mutability": "external"
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"type": "function",
|
|
25
|
-
"name": "get_votes",
|
|
26
|
-
"inputs": [],
|
|
27
|
-
"outputs": [
|
|
28
|
-
{
|
|
29
|
-
"type": "(core::felt252, core::felt252)"
|
|
30
|
-
}
|
|
31
|
-
],
|
|
32
|
-
"state_mutability": "view"
|
|
33
|
-
}
|
|
34
|
-
]
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
"type": "event",
|
|
38
|
-
"name": "contracts::VotingContract::VoteEvent",
|
|
39
|
-
"kind": "struct",
|
|
40
|
-
"members": [
|
|
41
|
-
{
|
|
42
|
-
"name": "voter",
|
|
43
|
-
"type": "core::starknet::contract_address::ContractAddress",
|
|
44
|
-
"kind": "key"
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
"name": "vote",
|
|
48
|
-
"type": "core::felt252",
|
|
49
|
-
"kind": "data"
|
|
50
|
-
}
|
|
51
|
-
]
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"type": "event",
|
|
55
|
-
"name": "contracts::VotingContract::Event",
|
|
56
|
-
"kind": "enum",
|
|
57
|
-
"variants": [
|
|
58
|
-
{
|
|
59
|
-
"name": "VoteEvent",
|
|
60
|
-
"type": "contracts::VotingContract::VoteEvent",
|
|
61
|
-
"kind": "nested"
|
|
62
|
-
}
|
|
63
|
-
]
|
|
64
|
-
}
|
|
65
|
-
]
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"private": true,
|
|
3
|
-
"name": "template-starknet",
|
|
4
|
-
"version": "1.0.0",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"build": "sentio build",
|
|
8
|
-
"gen": "sentio gen",
|
|
9
|
-
"test": "sentio test",
|
|
10
|
-
"upload": "sentio upload"
|
|
11
|
-
},
|
|
12
|
-
"dependencies": {
|
|
13
|
-
"@sentio/sdk": "workspace:*"
|
|
14
|
-
},
|
|
15
|
-
"devDependencies": {
|
|
16
|
-
"@sentio/cli": "workspace:*",
|
|
17
|
-
"typescript": "^5.5.2"
|
|
18
|
-
}
|
|
19
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"importHelpers": true,
|
|
4
|
-
"alwaysStrict": true,
|
|
5
|
-
"sourceMap": true,
|
|
6
|
-
"target": "esnext",
|
|
7
|
-
"esModuleInterop": true,
|
|
8
|
-
"noImplicitReturns": true,
|
|
9
|
-
"noImplicitAny": true,
|
|
10
|
-
"module": "nodenext",
|
|
11
|
-
"moduleResolution": "nodenext",
|
|
12
|
-
"strictNullChecks": true,
|
|
13
|
-
"stripInternal": true,
|
|
14
|
-
"noFallthroughCasesInSwitch": true,
|
|
15
|
-
"noEmitOnError": false,
|
|
16
|
-
"rootDir": "./src",
|
|
17
|
-
"outDir": "./dist",
|
|
18
|
-
"skipLibCheck": true,
|
|
19
|
-
"resolveJsonModule": true,
|
|
20
|
-
"experimentalDecorators": true,
|
|
21
|
-
"emitDecoratorMetadata": true
|
|
22
|
-
},
|
|
23
|
-
"exclude": ["dist"]
|
|
24
|
-
}
|