-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from Blackmorse/contract_creation
Contract creation API
- Loading branch information
Showing
10 changed files
with
204 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 85 additions & 0 deletions
85
src/main/java/io/goodforgod/api/etherscan/model/ContractCreation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
package io.goodforgod.api.etherscan.model; | ||
|
||
import java.util.Objects; | ||
|
||
public class ContractCreation { | ||
|
||
private final String contractAddress; | ||
private final String contractCreator; | ||
private final String txHash; | ||
|
||
private ContractCreation(String contractAddress, String contractCreator, String txHash) { | ||
this.contractAddress = contractAddress; | ||
this.contractCreator = contractCreator; | ||
this.txHash = txHash; | ||
} | ||
|
||
public String getContractAddress() { | ||
return contractAddress; | ||
} | ||
|
||
public String getContractCreator() { | ||
return contractCreator; | ||
} | ||
|
||
public String getTxHash() { | ||
return txHash; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) | ||
return true; | ||
if (o == null || getClass() != o.getClass()) | ||
return false; | ||
ContractCreation that = (ContractCreation) o; | ||
return Objects.equals(contractAddress, that.contractAddress) && Objects.equals(contractCreator, that.contractCreator) | ||
&& Objects.equals(txHash, that.txHash); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(contractAddress, contractCreator, txHash); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "ContractCreation{" + | ||
"contractAddress='" + contractAddress + '\'' + | ||
", contractCreator='" + contractCreator + '\'' + | ||
", txHash='" + txHash + '\'' + | ||
'}'; | ||
} | ||
|
||
public static ContractCreationBuilder builder() { | ||
return new ContractCreationBuilder(); | ||
} | ||
|
||
public static final class ContractCreationBuilder { | ||
|
||
private String contractAddress; | ||
private String contractCreator; | ||
private String txHash; | ||
|
||
private ContractCreationBuilder() {} | ||
|
||
public ContractCreationBuilder withContractAddress(String contractAddress) { | ||
this.contractAddress = contractAddress; | ||
return this; | ||
} | ||
|
||
public ContractCreationBuilder withContractCreator(String contractCreator) { | ||
this.contractCreator = contractCreator; | ||
return this; | ||
} | ||
|
||
public ContractCreationBuilder withTxHash(String txHash) { | ||
this.txHash = txHash; | ||
return this; | ||
} | ||
|
||
public ContractCreation build() { | ||
return new ContractCreation(contractAddress, contractCreator, txHash); | ||
} | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
src/main/java/io/goodforgod/api/etherscan/model/response/ContractCreationResponseTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package io.goodforgod.api.etherscan.model.response; | ||
|
||
public class ContractCreationResponseTO extends BaseListResponseTO<ContractCreationTO> {} |
20 changes: 20 additions & 0 deletions
20
src/main/java/io/goodforgod/api/etherscan/model/response/ContractCreationTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package io.goodforgod.api.etherscan.model.response; | ||
|
||
public class ContractCreationTO { | ||
|
||
private String contractAddress; | ||
private String contractCreator; | ||
private String txHash; | ||
|
||
public String getContractAddress() { | ||
return contractAddress; | ||
} | ||
|
||
public String getContractCreator() { | ||
return contractCreator; | ||
} | ||
|
||
public String getTxHash() { | ||
return txHash; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters