All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.everitoken.sdk.java.abi.TransferAction Maven / Gradle / Ivy

There is a newer version: 1.4.6
Show newest version
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