Skip to content

Commit 55788d5

Browse files
guggioGoodforGod
authored andcommitted
[2.0.0-SNAPSHOT]
Refactoring of token transfers - Inclusion of tokenID in Erc721 transfers - Support for Erc1155 transfers (cherry picked from commit ca4b7d5)
1 parent bf9f02b commit 55788d5

File tree

7 files changed

+128
-33
lines changed

7 files changed

+128
-33
lines changed
+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
package io.api.etherscan.model;
2+
3+
public abstract class BaseTxToken extends BaseTx {
4+
5+
private long nonce;
6+
private String blockHash;
7+
private String tokenName;
8+
private String tokenSymbol;
9+
private int transactionIndex;
10+
private long gasPrice;
11+
private long cumulativeGasUsed;
12+
private long confirmations;
13+
14+
public long getNonce() {
15+
return nonce;
16+
}
17+
18+
public String getBlockHash() {
19+
return blockHash;
20+
}
21+
22+
public String getTokenName() {
23+
return tokenName;
24+
}
25+
26+
public String getTokenSymbol() {
27+
return tokenSymbol;
28+
}
29+
30+
public int getTransactionIndex() {
31+
return transactionIndex;
32+
}
33+
34+
public long getGasPrice() {
35+
return gasPrice;
36+
}
37+
38+
public long getCumulativeGasUsed() {
39+
return cumulativeGasUsed;
40+
}
41+
42+
public long getConfirmations() {
43+
return confirmations;
44+
}
45+
46+
@Override
47+
public String toString() {
48+
return "BaseTxToken{" +
49+
"nonce=" + nonce +
50+
", blockHash='" + blockHash + '\'' +
51+
", tokenName='" + tokenName + '\'' +
52+
", tokenSymbol='" + tokenSymbol + '\'' +
53+
", transactionIndex=" + transactionIndex +
54+
", gasPrice=" + gasPrice +
55+
", cumulativeGasUsed=" + cumulativeGasUsed +
56+
", confirmations=" + confirmations +
57+
'}' + super.toString();
58+
}
59+
}

Diff for: src/main/java/io/api/etherscan/model/TxErc1155.java

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package io.api.etherscan.model;
2+
3+
import java.math.BigInteger;
4+
5+
public class TxErc1155 extends BaseTxToken {
6+
7+
private BigInteger tokenID;
8+
private BigInteger tokenValue;
9+
10+
public BigInteger getTokenID() {
11+
return tokenID;
12+
}
13+
14+
public BigInteger getTokenValue() {
15+
return tokenValue;
16+
}
17+
18+
@Override
19+
public String toString() {
20+
return "TxErc1155{" +
21+
"tokenID=" + tokenID +
22+
", tokenValue=" + tokenValue +
23+
'}' + super.toString();
24+
}
25+
}

Diff for: src/main/java/io/api/etherscan/model/TxErc20.java

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package io.api.etherscan.model;
2+
3+
import java.math.BigInteger;
4+
5+
public class TxErc20 extends BaseTxToken {
6+
7+
private BigInteger tokenDecimal;
8+
9+
public BigInteger getTokenDecimal() {
10+
return tokenDecimal;
11+
}
12+
13+
@Override
14+
public String toString() {
15+
return "TxErc20{" +
16+
"tokenDecimal=" + tokenDecimal +
17+
'}' + super.toString();
18+
}
19+
}

Diff for: src/main/java/io/api/etherscan/model/TxErc721.java

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package io.api.etherscan.model;
2+
3+
import java.math.BigInteger;
4+
5+
public class TxErc721 extends BaseTxToken {
6+
7+
private BigInteger tokenID;
8+
private BigInteger tokenDecimal;
9+
10+
public BigInteger getTokenID() {
11+
return tokenID;
12+
}
13+
14+
public BigInteger getTokenDecimal() {
15+
return tokenDecimal;
16+
}
17+
18+
@Override
19+
public String toString() {
20+
return "TxErc721{" +
21+
"tokenID=" + tokenID +
22+
", tokenDecimal=" + tokenDecimal +
23+
'}' + super.toString();
24+
}
25+
}

Diff for: src/main/java/io/goodforgod/api/etherscan/model/response/TxErc1155ResponseTO.java

-11
This file was deleted.

Diff for: src/main/java/io/goodforgod/api/etherscan/model/response/TxErc20ResponseTO.java

-11
This file was deleted.

Diff for: src/main/java/io/goodforgod/api/etherscan/model/response/TxErc721ResponseTO.java

-11
This file was deleted.

0 commit comments

Comments
 (0)