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

games.mythical.saga.sdk.client.model.SagaPlayerWallet Maven / Gradle / Ivy

There is a newer version: 1.1.30
Show newest version
package games.mythical.saga.sdk.client.model;

import games.mythical.proto_util.ProtoUtil;
import games.mythical.saga.sdk.proto.api.playerwallet.PlayerWalletProto;
import games.mythical.saga.sdk.util.ConversionUtils;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import games.mythical.proto_util.dto.DtoExclude;
import java.time.Instant;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class SagaPlayerWallet {
    private String traceId;
    private String oauthId;
    private String address;
    private String balanceInWei;
    private String withdrawableLimitInWei;
    @DtoExclude
    private Instant createdAt;
    @DtoExclude
    private Instant updatedAt;

    public static SagaPlayerWallet fromProto(PlayerWalletProto proto) {
        var playerwallet = ProtoUtil.toDto(proto, SagaPlayerWallet.class);

        var createdAt = ConversionUtils.protoTimestampToInstant(proto.getCreatedAt());
        playerwallet.setCreatedAt(createdAt);

        var updatedAt = ConversionUtils.protoTimestampToInstant(proto.getUpdatedAt());
        playerwallet.setUpdatedAt(updatedAt);

        return playerwallet;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy