properly identify methods to interact with
This commit is contained in:
parent
cefb33b593
commit
7d83843b96
|
@ -32,10 +32,10 @@ export const getMethodSignatureAndSignatureHash = (
|
|||
|
||||
export const extractUsefulMethods = (abi: AbiItem[]): AbiItemExtended[] => {
|
||||
return abi
|
||||
.filter(({ constant, name, type }) => type === 'function' && !!name && typeof constant === 'boolean')
|
||||
.filter(({ stateMutability, name, type }) => type === 'function' && !!name && stateMutability !== 'pure')
|
||||
.map(
|
||||
(method): AbiItemExtended => ({
|
||||
action: method.constant ? 'read' : 'write',
|
||||
action: method.stateMutability === 'view' ? 'read' : 'write',
|
||||
...getMethodSignatureAndSignatureHash(method),
|
||||
...method,
|
||||
}),
|
||||
|
|
Loading…
Reference in New Issue