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
import { promisify } from '@0xproject/utils'; | |
import { BigNumber } from 'bignumber.js'; | |
import * as Web3 from 'web3'; | |
import { {{contractName}} as ContractArtifacts } from '../abi/ts/{{contractName}}'; | |
import { BaseContract, CONTRACT_WRAPPER_ERRORS } from '@your-project/base-contract'; | |
import { TxData, TxDataPayable, classUtils } from '@your-project/types'; | |
import { Web3Utils } from '../../utils/Web3Utils'; |
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
Show hidden characters
{ | |
"compilerOptions": { | |
"outDir": "./dist", | |
"sourceMap": true, | |
"noImplicitAny": false, | |
"lib": ["dom", "es2015", "es2016", "es2017"], | |
"module": "commonjs", | |
"baseUrl": "src/", | |
"rootDir": "src/", | |
"target": "es5", |
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
{ | |
"name": "@your-project/types", | |
"version": "0.2.0", | |
"description": "", | |
"main": "dist/index.js", | |
"types": "dist/index.d.ts", | |
"scripts": { | |
"clean": "rimraf rm -rf dist", | |
"build": "npm run clean && tsc" | |
}, |
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
import { BigNumber } from "bignumber.js"; | |
import * as _ from "lodash"; | |
export interface TxData { | |
from?: string; | |
gas?: BigNumber; | |
gasPrice?: BigNumber; | |
nonce?: BigNumber; | |
} |
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
{ | |
"compilerOptions": { | |
"module": "commonjs", | |
"target": "es5", | |
"lib": ["dom", "es2015", "es2016", "es2017"], | |
"sourceMap": true, | |
"declaration": true, | |
"experimentalDecorators": true, | |
"downlevelIteration": true, | |
"noImplicitReturns": true, |
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
{ | |
"compilerOptions": { | |
"module": "commonjs", | |
"target": "es5", | |
"lib": ["dom", "es2015", "es2016", "es2017"], | |
"sourceMap": true, | |
"declaration": true, | |
"experimentalDecorators": true, | |
"downlevelIteration": true, | |
"noImplicitReturns": true, |
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
{ | |
"name": "@your-project/base-contract", | |
"version": "0.2.0", | |
"description": "", | |
"main": "dist/index.js", | |
"types": "dist/index.d.ts", | |
"scripts": { | |
"clean": "rimraf rm -rf dist", | |
"build": "npm run clean && tsc" |
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
import * as _ from "lodash"; | |
import * as Web3 from "web3"; | |
import { BigNumber } from "bignumber.js"; | |
import { TxData, TxDataPayable } from '@your-project/types'; | |
export const CONTRACT_WRAPPER_ERRORS = { | |
CONTRACT_NOT_FOUND_ON_NETWORK: (contractName: string, networkId: number) => | |
`Unable to find address for contract ${contractName} on network with id ${networkId}`, |
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
public {{this.name}} = { | |
async callAsync( | |
{{> typed_params inputs=inputs}} | |
defaultBlock?: any, | |
): Promise<{{> return_type outputs=outputs}}> { | |
const self = this as {{contractName}}Contract; | |
const result = await promisify<{{> return_type outputs=outputs}}>( | |
self.web3ContractInstance.{{this.name}}.call, | |
self.web3ContractInstance, | |
)( |
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
{{#each inputs}} | |
{{name}}, | |
{{/each}} |
OlderNewer