aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-09-04 18:57:03 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-01-10 18:24:35 +0800
commitbe20e04c7b45f1f0a3da84968aeb684e731e5a9a (patch)
treee28b5f7c8b1cecacd6185bcd1989eac9df255fd8 /packages
parentd9df82f31d8bbb4d195da3c4ca647551a0452f44 (diff)
downloaddexon-sol-tools-be20e04c7b45f1f0a3da84968aeb684e731e5a9a.tar
dexon-sol-tools-be20e04c7b45f1f0a3da84968aeb684e731e5a9a.tar.gz
dexon-sol-tools-be20e04c7b45f1f0a3da84968aeb684e731e5a9a.tar.bz2
dexon-sol-tools-be20e04c7b45f1f0a3da84968aeb684e731e5a9a.tar.lz
dexon-sol-tools-be20e04c7b45f1f0a3da84968aeb684e731e5a9a.tar.xz
dexon-sol-tools-be20e04c7b45f1f0a3da84968aeb684e731e5a9a.tar.zst
dexon-sol-tools-be20e04c7b45f1f0a3da84968aeb684e731e5a9a.zip
Extend Abi types
Diffstat (limited to 'packages')
-rw-r--r--packages/web3-typescript-typings/index.d.ts29
1 files changed, 21 insertions, 8 deletions
diff --git a/packages/web3-typescript-typings/index.d.ts b/packages/web3-typescript-typings/index.d.ts
index 49319d597..4841e093f 100644
--- a/packages/web3-typescript-typings/index.d.ts
+++ b/packages/web3-typescript-typings/index.d.ts
@@ -42,15 +42,28 @@ declare module 'web3' {
namespace Web3 {
type ContractAbi = AbiDefinition[];
- type AbiDefinition = FunctionDescription|EventDescription;
+ type AbiDefinition = FunctionAbi|EventAbi;
- interface FunctionDescription {
- type: 'function'|'constructor'|'fallback';
- name?: string;
+ type FunctionAbi = MethodAbi|ConstructorAbi|FallbackAbi;
+
+ interface MethodAbi {
+ type: 'function';
+ name: string;
inputs: FunctionParameter[];
- outputs?: FunctionParameter[];
- constant?: boolean;
- payable?: boolean;
+ outputs: FunctionParameter[];
+ constant: boolean;
+ payable: boolean;
+ }
+
+ interface ConstructorAbi {
+ type: 'constructor';
+ inputs: FunctionParameter[];
+ payable: boolean;
+ }
+
+ interface FallbackAbi {
+ type: 'fallback';
+ payable: boolean;
}
interface EventParameter {
@@ -59,7 +72,7 @@ declare module 'web3' {
indexed: boolean;
}
- interface EventDescription {
+ interface EventAbi {
type: 'event';
name: string;
inputs: EventParameter[];