-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from TomAFrench/typescript
migration to TypeScript
- Loading branch information
Showing
90 changed files
with
2,307 additions
and
2,031 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,3 +23,6 @@ yarn-error.log* | |
# subgraph | ||
/packages/subgraph/build/ | ||
/packages/subgraph/src/types/ | ||
|
||
# now | ||
.now |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
module.exports = { | ||
"env": { | ||
"es6": true, | ||
"browser": true | ||
}, | ||
"extends": [ | ||
'eslint:recommended', | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:@typescript-eslint/recommended-requiring-type-checking", | ||
"prettier/@typescript-eslint", // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier | ||
"plugin:prettier/recommended" // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array. | ||
], | ||
// "ignorePatterns": [], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"project": "./tsconfig.json", | ||
"tsconfigRootDir": __dirname, | ||
"sourceType": "module" | ||
}, | ||
"plugins": [ | ||
"@typescript-eslint", | ||
], | ||
"rules": { | ||
"import/extensions": [ | ||
"error", | ||
"ignorePackages", | ||
{ | ||
"js": "never", | ||
"ts": "never" | ||
} | ||
] | ||
}, | ||
"settings": { | ||
'import/resolver': { | ||
node: { | ||
extensions: ['.js', '.ts'] | ||
}, | ||
}, | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"ACE": "0x065178E11D516D115eA9437336f8d1bF4178f48c", | ||
"AztecStreamer": "0x15b1E0446b3f96C2C49Aa2d4E280f4613082449E" | ||
"NoteStream": "0xCcb98Efa4eA6a3814ece095f73264c43D7D50071" | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import NoteStreamABI from "../abis/NoteStream.json"; | ||
// import mainnetAddresses from "./addresses/mainnet"; | ||
import rinkebyAddresses from "../addresses/rinkeby.json"; | ||
|
||
export type Address = string; | ||
|
||
export interface Deployment { | ||
ACE: Address; | ||
NoteStream: Address; | ||
} | ||
|
||
export const abis: object = { | ||
NoteStream: NoteStreamABI, | ||
}; | ||
|
||
/** | ||
* Used to get addresses of contracts that have been deployed to either the | ||
* Ethereum mainnet or a supported testnet. Throws if there are no known | ||
* contracts deployed on the corresponding network. | ||
* @param networkId The desired networkId. | ||
* @returns The set of addresses for contracts which have been deployed on the | ||
* given networkId. | ||
*/ | ||
export const getContractAddressesForNetwork = ( | ||
networkId: number | ||
): Deployment => { | ||
switch (networkId) { | ||
// case 1: | ||
// return mainnetAddresses; | ||
case 4: | ||
return rinkebyAddresses; | ||
default: | ||
throw new Error( | ||
`Unknown network id (${networkId}). No known NoteStream contracts have been deployed on this network.` | ||
); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"compilerOptions": { | ||
/* Basic Options */ | ||
"lib": [ | ||
"ES2015", | ||
"DOM" | ||
], | ||
"module": "ES2015", | ||
"outDir": "lib", | ||
"sourceMap": true, | ||
"target": "ES2015", | ||
"declaration": true, | ||
/* Strict Type-Checking Options */ | ||
"noImplicitAny": true, | ||
"strict": true, | ||
/* Module Resolution Options */ | ||
"esModuleInterop": true, | ||
"moduleResolution": "node", | ||
"resolveJsonModule": true, | ||
"skipLibCheck": false, | ||
/* Advanced Options */ | ||
"forceConsistentCasingInFileNames": true, | ||
}, | ||
"include": [ | ||
"./src/**/*", | ||
"./lib/**/*" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
module.exports = { | ||
"env": { | ||
"es6": true, | ||
}, | ||
"extends": [ | ||
'eslint:recommended', | ||
"plugin:prettier/recommended" // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array. | ||
], | ||
"rules": { | ||
"import/extensions": [ | ||
"error", | ||
"ignorePackages", | ||
{ | ||
"js": "never", | ||
"ts": "never" | ||
} | ||
], | ||
"import/no-extraneous-dependencies": ["error", {"devDependencies": ["**/*.js"]}] | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
5a62ac7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to following URLs: