Skip to content

Commit

Permalink
Add SetWhitelistedApproval message
Browse files Browse the repository at this point in the history
  • Loading branch information
luca992 committed Mar 26, 2023
1 parent 1ab810a commit 5c40e8b
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 3 deletions.
5 changes: 2 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ com-vanniktech-maven-publish = { id = "com.vanniktech.maven.publish", version.re

kotlin = "1.8.10"
agp = "7.3.1"
vanniktech-publish = "0.24.0"
vanniktech-publish = "0.25.1"
swift-package = "2.1.1"
okio = "3.3.0"
ktor = "2.2.4"
kotlinx-datetime = "0.4.0"
kotlinx-serialization = "1.5.0"
kotlinx-coroutines = "1.6.4"

androidx-activity = "1.6.1"
androidx-activity = "1.7.0"
androidx-lifecycle = "2.5.1"
androidx-startup = "1.1.1"
androidx-appcompat = "1.6.1"
Expand All @@ -31,7 +31,6 @@ kermit = "1.2.2"
getenv = "0.1.0"

compose-jb = "1.3.1"
bootstrap-compose = "0.1.10"

bignum = "0.3.8"
libsodium = "0.8.8"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ object Snip721Msgs {
@SerialName("remove_minters") val removeMinters: RemoveMinters? = null,
@SerialName("set_minters") val setMinters: SetMinters? = null,
@SerialName("make_ownership_private") val makeOwnershipPrivate: MakeOwnershipPrivate? = null,
@SerialName("set_whitelisted_approval") val setWhitelistedApproval: SetWhitelistedApproval? = null,
@SerialName("transfer_nft") val transferNft: TransferNft? = null,
) {
@Serializable
Expand Down Expand Up @@ -324,6 +325,24 @@ object Snip721Msgs {
val padding: String? = null
)

@Serializable
data class SetWhitelistedApproval(
/// address being granted/revoked permission
val address: String,
/// optional token id to apply approval/revocation to
val token_id: String? = null,
/// optional permission level for viewing the owner
val view_owner: AccessLevel? = null,
/// optional permission level for viewing private metadata
val view_private_metadata: AccessLevel? = null,
/// optional permission level for transferring
val transfer: AccessLevel? = null,
/// optional expiration
val expires: Expiration? = null,
/// optional message length padding
val padding: String? = null,
)

@Serializable
data class TransferNft(
/// recipient of the transfer
Expand All @@ -336,6 +355,25 @@ object Snip721Msgs {
/// optional message length padding
val padding: String? = null,
)

@Serializable
enum class AccessLevel {
/// approve permission only for the specified token
@SerialName("approve_token")
ApproveToken,

/// grant permission for all tokens
@SerialName("all")
All,

/// revoke permission only for the specified token
@SerialName("revoke_token")
RevokeToken,

/// remove all permissions for this address
@SerialName("none")
None,
}
}

@Serializable
Expand All @@ -345,6 +383,7 @@ object Snip721Msgs {
@SerialName("remove_minters") val removeMinters: RemoveMinters? = null,
@SerialName("set_minters") val setMinters: SetMinters? = null,
@SerialName("make_ownership_private") val makeOwnershipPrivate: MakeOwnershipPrivate? = null,
@SerialName("set_whitelisted_approval") val setWhitelistedApproval: SetWhitelistedApproval? = null,
@SerialName("transfer_nft") val transferNft: TransferNft? = null,
) {

Expand Down Expand Up @@ -378,6 +417,11 @@ object Snip721Msgs {
val status: ResponseStatus,
)

@Serializable
data class SetWhitelistedApproval(
val status: ResponseStatus,
)

@Serializable
data class TransferNft(
val status: ResponseStatus,
Expand Down

0 comments on commit 5c40e8b

Please sign in to comment.