diff options
author | Fabio Berger <me@fabioberger.com> | 2018-10-18 00:13:32 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-10-18 00:13:32 +0800 |
commit | f7de26f65c4aebcf5d27dab07f4b75081b48d7ac (patch) | |
tree | 90aeda9b80dc2f39f1db14fcfcfd77832afbfdf7 | |
parent | 852f50d1a0e2d7f6c95231406c8604f9e56dc1dc (diff) | |
download | dexon-0x-contracts-f7de26f65c4aebcf5d27dab07f4b75081b48d7ac.tar.gz dexon-0x-contracts-f7de26f65c4aebcf5d27dab07f4b75081b48d7ac.tar.zst dexon-0x-contracts-f7de26f65c4aebcf5d27dab07f4b75081b48d7ac.zip |
chore: make abi `type` prop always of type string to fix TypeDoc issue related to reading in artifacts from JSON files
-rw-r--r-- | packages/ethereum-types/src/index.ts | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/packages/ethereum-types/src/index.ts b/packages/ethereum-types/src/index.ts index ddd472010..eff38711a 100644 --- a/packages/ethereum-types/src/index.ts +++ b/packages/ethereum-types/src/index.ts @@ -20,7 +20,9 @@ export type ConstructorStateMutability = 'nonpayable' | 'payable'; export type StateMutability = 'pure' | 'view' | ConstructorStateMutability; export interface MethodAbi { - type: 'function'; // We hardcode this here b/c doc pages cannot render an enum value + // Ideally this would be set to: `'function'` but then TS complains when artifacts are loaded + // from JSON files, and this value has type `string` not type `'function'` + type: string; name: string; inputs: DataItem[]; outputs: DataItem[]; @@ -30,14 +32,18 @@ export interface MethodAbi { } export interface ConstructorAbi { - type: 'constructor'; // We hardcode this here b/c doc pages cannot render an enum value + // Ideally this would be set to: `'constructor'` but then TS complains when artifacts are loaded + // from JSON files, and this value has type `string` not type `'constructor'` + type: string; inputs: DataItem[]; payable: boolean; stateMutability: ConstructorStateMutability; } export interface FallbackAbi { - type: 'fallback'; // We hardcode this here b/c doc pages cannot render an enum value + // Ideally this would be set to: `'fallback'` but then TS complains when artifacts are loaded + // from JSON files, and this value has type `string` not type `'fallback'` + type: string; payable: boolean; } @@ -46,7 +52,9 @@ export interface EventParameter extends DataItem { } export interface EventAbi { - type: 'event'; // We hardcode this here b/c doc pages cannot render an enum value + // Ideally this would be set to: `'event'` but then TS complains when artifacts are loaded + // from JSON files, and this value has type `string` not type `'event'` + type: string; name: string; inputs: EventParameter[]; anonymous: boolean; |