io.everitoken.sdk.java.abi.TransferAction Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of chain-sdk Show documentation
Show all versions of chain-sdk Show documentation
Official Java SDK for everiToken public chain. https://www.everitoken.io
package io.everitoken.sdk.java.abi;
import java.util.List;
import java.util.stream.Collectors;
import com.alibaba.fastjson.annotation.JSONField;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import io.everitoken.sdk.java.Address;
public class TransferAction extends Abi {
@JSONField(deserialize = false, serialize = false)
private static final String name = "transfer";
private final List to;
private final String memo;
private TransferAction(String domain, String tokenName, List to, String memo) {
super(name, tokenName, domain);
this.memo = memo;
this.to = to;
}
@NotNull
@Contract("_, _, _, _ -> new")
public static TransferAction of(String domain, String tokenName, List to, String memo) {
return new TransferAction(domain, tokenName, to.stream().map(Address::of).collect(Collectors.toList()), memo);
}
@Override
@JSONField(name = "name")
public String getKey() {
return super.getKey();
}
public String getMemo() {
return memo;
}
public List getTo() {
return to.stream().map(Address::toString).collect(Collectors.toList());
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy