diff --git a/src/Net.php b/src/Net.php index 4ddf6a4..cdc9290 100644 --- a/src/Net.php +++ b/src/Net.php @@ -95,6 +95,9 @@ class Net // new the method $methodClass = sprintf("\Web3\Methods\%s\%s", ucfirst($class[1]), ucfirst($name)); $methodObject = new $methodClass($method, $arguments); + $this->methods[$method] = $methodObject; + } else { + $methodObject = $this->methods[$method]; } $inputs = $methodObject->transform($arguments, $methodObject->inputFormatters); $methodObject->arguments = $inputs; diff --git a/src/Web3.php b/src/Web3.php index 48464ee..d2b46fb 100644 --- a/src/Web3.php +++ b/src/Web3.php @@ -128,6 +128,9 @@ class Web3 // new the method $methodClass = sprintf("\Web3\Methods\%s\%s", ucfirst($class[1]), ucfirst($name)); $methodObject = new $methodClass($method, $arguments); + $this->methods[$method] = $methodObject; + } else { + $methodObject = $this->methods[$method]; } $inputs = $methodObject->transform($arguments, $methodObject->inputFormatters); $methodObject->arguments = $inputs;