@graphprotocol/graph-cli 0.28.0 → 0.28.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.
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # The Graph CLI (graph-cli)
2
2
 
3
3
  [![npm (scoped)](https://img.shields.io/npm/v/@graphprotocol/graph-cli.svg)](https://www.npmjs.com/package/@graphprotocol/graph-cli)
4
- [![Build Status](https://travis-ci.org/graphprotocol/graph-cli.svg?branch=master)](https://travis-ci.org/graphprotocol/graph-cli)
4
+ [![Build Status](https://travis-ci.org/graphprotocol/graph-cli.svg?branch=main)](https://travis-ci.org/graphprotocol/graph-cli)
5
5
 
6
6
  ## The Graph Command Line Interface
7
7
 
@@ -57,9 +57,9 @@ If you are ready to dive into the details of building a subgraph from scratch, t
57
57
 
58
58
  The steps to create a new version of the `graph-cli` are:
59
59
 
60
- 1. Decide which version number you'll be rolling out. You can check the differences between the current `master` branch and the latest release.
60
+ 1. Decide which version number you'll be rolling out. You can check the differences between the current `main` branch and the latest release.
61
61
  2. Create a PR with the commit generated by `npm version <VERSION> [<PREID>]`.
62
- 3. Once that's approved and merged to `master`, you can publish it to `npm` and push the git tags as well.
62
+ 3. Once that's approved and merged to `main`, you can publish it to `npm` and push the git tags as well.
63
63
  4. Last but not least, create a Github Release refering to the pushed git tag, linking to the PRs involved.
64
64
 
65
65
  Helpful links:
@@ -84,7 +84,7 @@ npm version minor
84
84
  git push --set-upstream <REMOTE> <BRANCH>
85
85
  ```
86
86
 
87
- Once that's approved and merged, you can update your local `master` and:
87
+ Once that's approved and merged, you can update your local `main` and:
88
88
 
89
89
  ```
90
90
  npm publish
@@ -106,7 +106,7 @@ npm version preminor --preid alpha
106
106
  git push --set-upstream <REMOTE> <BRANCH>
107
107
  ```
108
108
 
109
- Once that's approved and merged, you can update your local `master` and:
109
+ Once that's approved and merged, you can update your local `main` and:
110
110
 
111
111
  ```
112
112
  npm publish --tag alpha
@@ -128,7 +128,7 @@ npm version prerelease --preid alpha
128
128
  git push --set-upstream <REMOTE> <BRANCH>
129
129
  ```
130
130
 
131
- Once that's approved and merged, you can update your local `master` and:
131
+ Once that's approved and merged, you can update your local `main` and:
132
132
 
133
133
  ```
134
134
  npm publish --tag alpha
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphprotocol/graph-cli",
3
- "version": "0.28.0",
3
+ "version": "0.28.1",
4
4
  "license": "(Apache-2.0 OR MIT)",
5
5
  "description": "CLI for building for and deploying to The Graph",
6
6
  "dependencies": {
@@ -71,7 +71,7 @@ module.exports = {
71
71
  // because that would mean the CLI would generate code to
72
72
  // the wrong AssemblyScript version.
73
73
  await assertManifestApiVersion(manifest, '0.0.5')
74
- await assertGraphTsVersion(path.dirname(manifest), '0.22.0')
74
+ await assertGraphTsVersion(path.dirname(manifest), '0.25.0')
75
75
 
76
76
  const dataSourcesAndTemplates = await DataSourcesExtractor.fromFilePath(manifest)
77
77
 
@@ -200,7 +200,7 @@ module.exports = {
200
200
  // because that would mean the CLI would try to compile code
201
201
  // using the wrong AssemblyScript compiler.
202
202
  await assertManifestApiVersion(manifest, '0.0.5')
203
- await assertGraphTsVersion(path.dirname(manifest), '0.22.0')
203
+ await assertGraphTsVersion(path.dirname(manifest), '0.25.0')
204
204
 
205
205
  const dataSourcesAndTemplates = await DataSourcesExtractor.fromFilePath(manifest)
206
206
 
@@ -285,6 +285,7 @@ const getEtherscanLikeAPIUrl = (network) => {
285
285
  case "mumbai": return `https://api-testnet.polygonscan.com/api`;
286
286
  case "aurora": return `https://api.aurorascan.dev/api`;
287
287
  case "aurora-testnet": return `https://api-testnet.aurorascan.dev/api`;
288
+ case "optimism-kovan": return `https://api-kovan-optimistic.etherscan.io/api`;
288
289
  default: return `https://api-${network}.etherscan.io/api`;
289
290
  }
290
291
  }
@@ -7,7 +7,6 @@ const NearSubgraph = require('./near/subgraph')
7
7
  const TendermintSubgraph = require('./tendermint/subgraph')
8
8
  const EthereumContract = require('./ethereum/contract')
9
9
  const NearContract = require('./near/contract')
10
- const TendermintContract = require('./tendermint/contract')
11
10
  const EthereumManifestScaffold = require('./ethereum/scaffold/manifest')
12
11
  const NearManifestScaffold = require('./near/scaffold/manifest')
13
12
  const EthereumMappingScaffold = require('./ethereum/scaffold/mapping')
@@ -104,6 +103,17 @@ module.exports = class Protocol {
104
103
  }
105
104
  }
106
105
 
106
+ hasContract() {
107
+ switch (this.name) {
108
+ case 'ethereum':
109
+ return true
110
+ case 'near':
111
+ return true
112
+ case 'tendermint':
113
+ return false
114
+ }
115
+ }
116
+
107
117
  hasEvents() {
108
118
  switch (this.name) {
109
119
  case 'ethereum':
@@ -185,7 +195,7 @@ module.exports = class Protocol {
185
195
  case 'near':
186
196
  return NearContract
187
197
  case 'tendermint':
188
- return TendermintContract
198
+ return null
189
199
  }
190
200
  }
191
201
 
package/src/subgraph.js CHANGED
@@ -158,6 +158,10 @@ At least one such handler must be defined.`,
158
158
  }
159
159
 
160
160
  static validateContractValues(manifest, protocol) {
161
+ if (!protocol.hasContract()){
162
+ return immutable.List()
163
+ }
164
+
161
165
  return validation.validateContractValues(manifest, protocol)
162
166
  }
163
167
 
@@ -1,12 +0,0 @@
1
- module.exports = class TendermintContract {
2
- static identifierName() {
3
- return 'address'
4
- }
5
-
6
- validate() {
7
- return {
8
- valid: true,
9
- error: null,
10
- }
11
- }
12
- }