Updated on 2026-08-14

This commit is contained in:
Tangem 2023-08-04 15:48:39 +08:00
parent ff985dec4e
commit cd78832ff1
30 changed files with 89 additions and 23 deletions

1
domain/tokens/models/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/build

View file

@ -0,0 +1,4 @@
plugins {
alias(deps.plugins.kotlin.jvm)
id("configuration")
}

View file

@ -0,0 +1,29 @@
package com.tangem.domain.tokens.models
/**
* Represents a blockchain network, identified by a unique ID and a human-readable name.
*
* @property id The unique identifier of the network, encapsulated as an inline value class.
* @property name The human-readable name of the network, such as "Ethereum" or "Bitcoin".
*
* @throws IllegalArgumentException If the name or ID is blank.
*/
data class Network(val id: ID, val name: String) {
init {
require(name.isNotBlank()) { "Network name must not be blank" }
}
/**
* Represents a unique identifier for a network.
*
* @property value The string value of the network ID.
*/
@JvmInline
value class ID(val value: String) {
init {
require(value.isNotBlank()) { "Network ID must not be blank" }
}
}
}