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

io.provenance.explorer.model.GrantsModels.kt Maven / Gradle / Ivy

The newest version!
package io.provenance.explorer.model

import io.provenance.explorer.model.base.CoinStr
import org.joda.time.DateTime

//region Authz Grant
data class GrantData(
    val granter: String,
    val grantee: String,
    val expiration: DateTime,
    val type: String,
    val authorization: AuthzGrant?
)

open class AuthzGrant

data class GenericAuth(
    val msg: String
) : AuthzGrant()

data class CountAuth(
    val msg: String,
    val allowedAuthCount: Int
) : AuthzGrant()

data class SendAuth(
    val spendLimits: List
) : AuthzGrant()

data class StakeAuth(
    val authorizationType: String,
    val allowList: List? = null,
    val denyList: List? = null,
    val maxTokens: CoinStr? = null
) : AuthzGrant()

data class MarkerTransferAuth(
    val transferLimits: List
) : AuthzGrant()

//endregion

//region Feegrant
data class FeegrantData(
    val granter: String,
    val grantee: String,
    val type: String,
    val allowance: Allowance?
)

open class Allowance

data class BasicAllowance(
    val spendLimits: List,
    val expiration: DateTime? = null
) : Allowance()

data class PeriodicAllowance(
    val basicAllowance: BasicAllowance,
    val period: String, // duration in seconds
    val spendLimit: List,
    val spendRemaining: List,
    val periodReset: DateTime
) : Allowance()

data class AllowedMsgAllowance(
    val allowance: Allowance,
    val allowedMsgs: List
) : Allowance()

//endregion




© 2015 - 2024 Weber Informatics LLC | Privacy Policy