@graphprotocol/graph-cli 0.68.0-alpha-20240130135702-4d53709 → 0.68.0-alpha-20240208230340-9ea4027
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/CHANGELOG.md
CHANGED
|
@@ -1,13 +1,28 @@
|
|
|
1
1
|
# @graphprotocol/graph-cli
|
|
2
2
|
|
|
3
|
-
## 0.68.0-alpha-
|
|
3
|
+
## 0.68.0-alpha-20240208230340-9ea4027
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
7
|
-
- [#
|
|
8
|
-
[`
|
|
9
|
-
Thanks [@
|
|
10
|
-
|
|
7
|
+
- [#1548](https://github.com/graphprotocol/graph-tooling/pull/1548)
|
|
8
|
+
[`9ea4027`](https://github.com/graphprotocol/graph-tooling/commit/9ea4027dd041bbb4dac74fccafb051db9e78d2dd)
|
|
9
|
+
Thanks [@lutter](https://github.com/lutter)! - Make validations more lenient to allow aggregations
|
|
10
|
+
and Int8 ids
|
|
11
|
+
|
|
12
|
+
## 0.67.4
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [`f49aab9`](https://github.com/graphprotocol/graph-tooling/commit/f49aab98d643ba6d8c3708772bed8318825effed)
|
|
17
|
+
Thanks [@saihaj](https://github.com/saihaj)! - fix blast testnet etherscan and RPC URL
|
|
18
|
+
|
|
19
|
+
## 0.67.3
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- [#1579](https://github.com/graphprotocol/graph-tooling/pull/1579)
|
|
24
|
+
[`bc61adb`](https://github.com/graphprotocol/graph-tooling/commit/bc61adb8ae4f6ba8b467e98ed390a96029b702d8)
|
|
25
|
+
Thanks [@saihaj](https://github.com/saihaj)! - fix line and linea-goerli API URLs
|
|
11
26
|
|
|
12
27
|
## 0.67.2
|
|
13
28
|
|
|
@@ -91,7 +91,6 @@ vitest_1.describe.concurrent('Schema code generator', () => {
|
|
|
91
91
|
|
|
92
92
|
# New scalars
|
|
93
93
|
int8: Int8!
|
|
94
|
-
timestamp: Timestamp!
|
|
95
94
|
}
|
|
96
95
|
|
|
97
96
|
type Wallet @entity {
|
|
@@ -297,26 +296,6 @@ vitest_1.describe.concurrent('Schema code generator', () => {
|
|
|
297
296
|
returnType: undefined,
|
|
298
297
|
body: `
|
|
299
298
|
this.set('int8', Value.fromI64(value))
|
|
300
|
-
`,
|
|
301
|
-
},
|
|
302
|
-
{
|
|
303
|
-
name: 'get timestamp',
|
|
304
|
-
params: [],
|
|
305
|
-
returnType: new typescript_1.NamedType('i64'),
|
|
306
|
-
body: `let value = this.get('timestamp')
|
|
307
|
-
if (!value || value.kind == ValueKind.NULL) {
|
|
308
|
-
return 0
|
|
309
|
-
} else {
|
|
310
|
-
return value.toI64()
|
|
311
|
-
}
|
|
312
|
-
`,
|
|
313
|
-
},
|
|
314
|
-
{
|
|
315
|
-
name: 'set timestamp',
|
|
316
|
-
params: [new typescript_1.Param('value', new typescript_1.NamedType('i64'))],
|
|
317
|
-
returnType: undefined,
|
|
318
|
-
body: `
|
|
319
|
-
this.set('timestamp', Value.fromI64(value))
|
|
320
299
|
`,
|
|
321
300
|
},
|
|
322
301
|
{
|
|
@@ -258,7 +258,6 @@ const VALUE_TO_ASSEMBLYSCRIPT = [
|
|
|
258
258
|
['[Boolean]', 'Array<boolean>', (code) => `${code}.toBooleanArray()`],
|
|
259
259
|
['[Int]', 'Array<i32>', (code) => `${code}.toI32Array()`],
|
|
260
260
|
['[Int8]', 'Array<i64>', (code) => `${code}.toI64Array()`],
|
|
261
|
-
['[Timestamp]', 'Array<i64>', (code) => `${code}.toI64Array()`],
|
|
262
261
|
['[BigInt]', 'Array<BigInt>', (code) => `${code}.toBigIntArray()`],
|
|
263
262
|
['[ID]', 'Array<string>', (code) => `${code}.toStringArray()`],
|
|
264
263
|
['[String]', 'Array<string>', (code) => `${code}.toStringArray()`],
|
|
@@ -273,7 +272,6 @@ const VALUE_TO_ASSEMBLYSCRIPT = [
|
|
|
273
272
|
['ID', 'string', (code) => `${code}.toString()`],
|
|
274
273
|
['String', 'string', (code) => `${code}.toString()`],
|
|
275
274
|
['BigDecimal', 'BigDecimal', (code) => `${code}.toBigDecimal()`],
|
|
276
|
-
['Timestamp', 'i64', (code) => `${code}.toI64()`],
|
|
277
275
|
[/.*/, 'string', (code) => `${code}.toString()`],
|
|
278
276
|
];
|
|
279
277
|
/**
|
|
@@ -290,7 +288,6 @@ const ASSEMBLYSCRIPT_TO_VALUE = [
|
|
|
290
288
|
['Array<Array<boolean>>', '[[Boolean]]', (code) => `Value.fromBooleanMatrix(${code})`],
|
|
291
289
|
['Array<Array<i32>>', '[[Int]]', (code) => `Value.fromI32Matrix(${code})`],
|
|
292
290
|
['Array<Array<i64>>', '[[Int8]]', (code) => `Value.fromI64Matrix(${code})`],
|
|
293
|
-
['Array<Array<i64>>', '[[Timestamp]]', (code) => `Value.fromI64Matrix(${code})`],
|
|
294
291
|
['Array<Array<BigInt>>', '[[BigInt]]', (code) => `Value.fromBigIntMatrix(${code})`],
|
|
295
292
|
['Array<Array<string>>', '[[String]]', (code) => `Value.fromStringMatrix(${code})`],
|
|
296
293
|
['Array<Array<string>>', '[[ID]]', (code) => `Value.fromStringMatrix(${code})`],
|
|
@@ -308,7 +305,6 @@ const ASSEMBLYSCRIPT_TO_VALUE = [
|
|
|
308
305
|
['Array<boolean>', '[Boolean]', (code) => `Value.fromBooleanArray(${code})`],
|
|
309
306
|
['Array<i32>', '[Int]', (code) => `Value.fromI32Array(${code})`],
|
|
310
307
|
['Array<i64>', '[Int8]', (code) => `Value.fromI64Array(${code})`],
|
|
311
|
-
['Array<i64>', '[Timestamp]', (code) => `Value.fromI64Array(${code})`],
|
|
312
308
|
['Array<BigInt>', '[BigInt]', (code) => `Value.fromBigIntArray(${code})`],
|
|
313
309
|
['Array<string>', '[String]', (code) => `Value.fromStringArray(${code})`],
|
|
314
310
|
['Array<string>', '[ID]', (code) => `Value.fromStringArray(${code})`],
|
|
@@ -321,7 +317,6 @@ const ASSEMBLYSCRIPT_TO_VALUE = [
|
|
|
321
317
|
['boolean', 'Boolean', (code) => `Value.fromBoolean(${code})`],
|
|
322
318
|
['i32', 'Int', (code) => `Value.fromI32(${code})`],
|
|
323
319
|
['i64', 'Int8', (code) => `Value.fromI64(${code})`],
|
|
324
|
-
['i64', 'Timestamp', (code) => `Value.fromI64(${code})`],
|
|
325
320
|
['BigInt', 'BigInt', (code) => `Value.fromBigInt(${code})`],
|
|
326
321
|
['string', 'String', (code) => `Value.fromString(${code})`],
|
|
327
322
|
['string', 'ID', (code) => `Value.fromString(${code})`],
|
|
@@ -178,6 +178,12 @@ const getEtherscanLikeAPIUrl = (network) => {
|
|
|
178
178
|
return `https://api-sepolia.scrollscan.dev/api`;
|
|
179
179
|
case 'scroll':
|
|
180
180
|
return `https://blockscout.scroll.io/api`;
|
|
181
|
+
case 'linea':
|
|
182
|
+
return `https://api.lineascan.build/api`;
|
|
183
|
+
case 'linea-goerli':
|
|
184
|
+
return `https://api.linea-goerli.build/api`;
|
|
185
|
+
case 'blast-testnet':
|
|
186
|
+
return `https://api.routescan.io/v2/network/testnet/evm/168587773/etherscan/api`;
|
|
181
187
|
default:
|
|
182
188
|
return `https://api-${network}.etherscan.io/api`;
|
|
183
189
|
}
|
|
@@ -260,6 +266,12 @@ const getPublicRPCEndpoint = (network) => {
|
|
|
260
266
|
return 'https://rpc.ankr.com/scroll_sepolia_testnet';
|
|
261
267
|
case 'scroll':
|
|
262
268
|
return 'https://rpc.ankr.com/scroll';
|
|
269
|
+
case 'linea':
|
|
270
|
+
return 'https://linea-mainnet.public.blastapi.io';
|
|
271
|
+
case 'linea-goerli':
|
|
272
|
+
return 'https://linea-goerli.public.blastapi.io';
|
|
273
|
+
case 'blast-testnet':
|
|
274
|
+
return 'https://sepolia.blast.io';
|
|
263
275
|
default:
|
|
264
276
|
throw new Error(`Unknown network: ${network}`);
|
|
265
277
|
}
|
|
@@ -44,7 +44,6 @@ const BUILTIN_SCALAR_TYPES = [
|
|
|
44
44
|
'Bytes',
|
|
45
45
|
'ID',
|
|
46
46
|
'Int8',
|
|
47
|
-
'Timestamp',
|
|
48
47
|
];
|
|
49
48
|
// Type suggestions for common mistakes
|
|
50
49
|
const TYPE_SUGGESTIONS = [
|
|
@@ -65,8 +64,6 @@ const TYPE_SUGGESTIONS = [
|
|
|
65
64
|
['Float', 'BigDecimal'],
|
|
66
65
|
['int', 'Int'],
|
|
67
66
|
['int8', 'Int8'],
|
|
68
|
-
['timestamp', 'Timestamp'],
|
|
69
|
-
['ts', 'Timestamp'],
|
|
70
67
|
['uint', 'BigInt'],
|
|
71
68
|
['owner', 'String'],
|
|
72
69
|
['Owner', 'String'],
|
|
@@ -108,13 +105,13 @@ const parseSchema = (doc) => {
|
|
|
108
105
|
};
|
|
109
106
|
const validateEntityDirective = (def) => {
|
|
110
107
|
validateDebugger('Validating entity directive for %s', def?.name?.value);
|
|
111
|
-
return def.directives.find((directive) => directive.name.value === 'entity')
|
|
108
|
+
return def.directives.find((directive) => directive.name.value === 'entity' || directive.name.value === 'aggregation')
|
|
112
109
|
? List()
|
|
113
110
|
: immutable_1.default.fromJS([
|
|
114
111
|
{
|
|
115
112
|
loc: def.loc,
|
|
116
113
|
entity: def.name.value,
|
|
117
|
-
message: `Defined without @entity directive`,
|
|
114
|
+
message: `Defined without @entity or @aggregation directive`,
|
|
118
115
|
},
|
|
119
116
|
]);
|
|
120
117
|
};
|
|
@@ -135,7 +132,8 @@ const validateEntityID = (def) => {
|
|
|
135
132
|
idField.type.type.kind === 'NamedType' &&
|
|
136
133
|
(idField.type.type.name.value === 'ID' ||
|
|
137
134
|
idField.type.type.name.value === 'Bytes' ||
|
|
138
|
-
idField.type.type.name.value === 'String'
|
|
135
|
+
idField.type.type.name.value === 'String' ||
|
|
136
|
+
idField.type.type.name.value === 'Int8')) {
|
|
139
137
|
validateDebugger('Entity %s has valid id field', def?.name?.value);
|
|
140
138
|
return List();
|
|
141
139
|
}
|
|
@@ -144,7 +142,7 @@ const validateEntityID = (def) => {
|
|
|
144
142
|
{
|
|
145
143
|
loc: idField.loc,
|
|
146
144
|
entity: def.name.value,
|
|
147
|
-
message: `Field 'id': Entity ids must be of type Bytes! or String!`,
|
|
145
|
+
message: `Field 'id': Entity ids must be of type Int8!, Bytes! or String!`,
|
|
148
146
|
},
|
|
149
147
|
]);
|
|
150
148
|
};
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED