aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeonid <logvinov.leon@gmail.com>2018-02-21 02:55:29 +0800
committerGitHub <noreply@github.com>2018-02-21 02:55:29 +0800
commit097fc477a2e06b8004d98e77dc17d98ab26ab3f1 (patch)
tree9c8f33bafb1fb2eef5bfcaaefed781ccae6ffba9
parent3a36e0621f0ad0c77c14a04bdaa85131b57ef0ea (diff)
parentf60b00d116e525e5b789684e68b1541cedba1665 (diff)
downloaddexon-sol-tools-097fc477a2e06b8004d98e77dc17d98ab26ab3f1.tar
dexon-sol-tools-097fc477a2e06b8004d98e77dc17d98ab26ab3f1.tar.gz
dexon-sol-tools-097fc477a2e06b8004d98e77dc17d98ab26ab3f1.tar.bz2
dexon-sol-tools-097fc477a2e06b8004d98e77dc17d98ab26ab3f1.tar.lz
dexon-sol-tools-097fc477a2e06b8004d98e77dc17d98ab26ab3f1.tar.xz
dexon-sol-tools-097fc477a2e06b8004d98e77dc17d98ab26ab3f1.tar.zst
dexon-sol-tools-097fc477a2e06b8004d98e77dc17d98ab26ab3f1.zip
Merge pull request #401 from 0xProject/feature/web3-abi-v2-types
Add types for ABIv2
-rw-r--r--packages/deployer/src/utils/encoder.ts2
-rw-r--r--packages/web3-typescript-typings/CHANGELOG.md4
-rw-r--r--packages/web3-typescript-typings/index.d.ts13
3 files changed, 11 insertions, 8 deletions
diff --git a/packages/deployer/src/utils/encoder.ts b/packages/deployer/src/utils/encoder.ts
index d5f807774..e3acde252 100644
--- a/packages/deployer/src/utils/encoder.ts
+++ b/packages/deployer/src/utils/encoder.ts
@@ -9,7 +9,7 @@ export const encoder = {
const constructorTypes: string[] = [];
_.each(abi, (element: Web3.AbiDefinition) => {
if (element.type === AbiType.Constructor) {
- _.each(element.inputs, (input: Web3.FunctionParameter) => {
+ _.each(element.inputs, (input: Web3.DataItem) => {
constructorTypes.push(input.type);
});
}
diff --git a/packages/web3-typescript-typings/CHANGELOG.md b/packages/web3-typescript-typings/CHANGELOG.md
index 5f74ceef0..74dc8748f 100644
--- a/packages/web3-typescript-typings/CHANGELOG.md
+++ b/packages/web3-typescript-typings/CHANGELOG.md
@@ -1,5 +1,9 @@
# CHANGELOG
+## v0.10.0 - _TBD, 2018_
+
+ * Support ABIv2 (#401)
+
## v0.9.11 - _February 16, 2018_
* Fix `web3.net.peerCount` to be of type number instead of boolean (#397)
diff --git a/packages/web3-typescript-typings/index.d.ts b/packages/web3-typescript-typings/index.d.ts
index 915c73b90..6155d10f0 100644
--- a/packages/web3-typescript-typings/index.d.ts
+++ b/packages/web3-typescript-typings/index.d.ts
@@ -62,8 +62,8 @@ declare module 'web3' {
interface MethodAbi {
type: AbiType.Function;
name: string;
- inputs: FunctionParameter[];
- outputs: FunctionParameter[];
+ inputs: DataItem[];
+ outputs: DataItem[];
constant: boolean;
stateMutability: StateMutability;
payable: boolean;
@@ -71,7 +71,7 @@ declare module 'web3' {
interface ConstructorAbi {
type: AbiType.Constructor;
- inputs: FunctionParameter[];
+ inputs: DataItem[];
payable: boolean;
stateMutability: ConstructorStateMutability;
}
@@ -81,9 +81,7 @@ declare module 'web3' {
payable: boolean;
}
- interface EventParameter {
- name: string;
- type: string;
+ interface EventParameter extends DataItem {
indexed: boolean;
}
@@ -94,9 +92,10 @@ declare module 'web3' {
anonymous: boolean;
}
- interface FunctionParameter {
+ interface DataItem {
name: string;
type: string;
+ components: DataItem[];
}
interface ContractInstance {