Skip to content

Commit 5b6f975

Browse files
committed
solution: shortcut to convert Chain to Protobuf message
1 parent 0df4e8c commit 5b6f975

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

  • emerald-api/src/main/java/io/emeraldpay/api

emerald-api/src/main/java/io/emeraldpay/api/Chain.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
*/
1616
package io.emeraldpay.api;
1717

18+
import io.emeraldpay.api.proto.Common;
19+
1820
public enum Chain {
1921

2022
UNSPECIFIED(0, "UNSPECIFIED", "Unknown"),
@@ -103,4 +105,8 @@ public String getChainCode() {
103105
public String getChainName() {
104106
return fullname;
105107
}
108+
109+
public Common.ChainRef asChainRef() {
110+
return Common.ChainRef.forNumber(id);
111+
}
106112
}

0 commit comments

Comments
 (0)