From e7eb3c060741be0c98f5f284c49de9b729ea45f4 Mon Sep 17 00:00:00 2001 From: Kyle Espinola Date: Tue, 1 Aug 2023 15:33:53 +0200 Subject: [PATCH] feat: charge separately for collections, mints, and compressed mints --- Cargo.lock | 10 ++++----- api/Cargo.toml | 2 +- api/src/lib.rs | 8 +++++++ api/src/mutations/collection.rs | 4 ++-- api/src/mutations/mint.rs | 6 +++++- credits.toml | 38 +++++++++++++++++++++++++-------- 6 files changed, 50 insertions(+), 18 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f3111c1..66f4940 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1635,8 +1635,8 @@ dependencies = [ [[package]] name = "holaplex-hub-core" -version = "0.2.1" -source = "git+https://github.com/holaplex/hub-core?branch=stable#c8eaef51ea8729686a1d74e2e8d9fc1a14f4dcb8" +version = "0.3.1" +source = "git+https://github.com/holaplex/hub-core?branch=stable#64b4ace7aa493d2fa0ab8d1e2a132f0dec98029a" dependencies = [ "anyhow", "async-trait", @@ -1670,7 +1670,7 @@ dependencies = [ [[package]] name = "holaplex-hub-core-build" version = "0.2.1" -source = "git+https://github.com/holaplex/hub-core?branch=stable#c8eaef51ea8729686a1d74e2e8d9fc1a14f4dcb8" +source = "git+https://github.com/holaplex/hub-core?branch=stable#64b4ace7aa493d2fa0ab8d1e2a132f0dec98029a" dependencies = [ "anyhow", "dotenv", @@ -1688,8 +1688,8 @@ dependencies = [ [[package]] name = "holaplex-hub-core-schemas" -version = "0.2.1" -source = "git+https://github.com/holaplex/hub-core?branch=stable#c8eaef51ea8729686a1d74e2e8d9fc1a14f4dcb8" +version = "0.3.1" +source = "git+https://github.com/holaplex/hub-core?branch=stable#64b4ace7aa493d2fa0ab8d1e2a132f0dec98029a" dependencies = [ "holaplex-hub-core-build", "prost", diff --git a/api/Cargo.toml b/api/Cargo.toml index 80a395f..d9eac55 100644 --- a/api/Cargo.toml +++ b/api/Cargo.toml @@ -42,7 +42,7 @@ strum = { version = "0.24.1", features = ["derive"] } [dependencies.hub-core] package = "holaplex-hub-core" -version = "0.2.1" +version = "0.3.1" git = "https://github.com/holaplex/hub-core" branch = "stable" features = ["kafka", "credits", "asset_proxy"] diff --git a/api/src/lib.rs b/api/src/lib.rs index 31b5dd4..d3ec7cd 100644 --- a/api/src/lib.rs +++ b/api/src/lib.rs @@ -199,6 +199,10 @@ pub enum Actions { RetryMint, RetryDrop, TransferAsset, + Mint, + MintCompressed, + CreateCollection, + RetryCollection, } impl From for hub_core::credits::Action { @@ -209,6 +213,10 @@ impl From for hub_core::credits::Action { Actions::RetryMint => hub_core::credits::Action::RetryMint, Actions::RetryDrop => hub_core::credits::Action::RetryDrop, Actions::TransferAsset => hub_core::credits::Action::TransferAsset, + Actions::Mint => hub_core::credits::Action::Mint, + Actions::MintCompressed => hub_core::credits::Action::MintCompressed, + Actions::CreateCollection => hub_core::credits::Action::CreateCollection, + Actions::RetryCollection => hub_core::credits::Action::RetryCollection, } } } diff --git a/api/src/mutations/collection.rs b/api/src/mutations/collection.rs index a3894c8..052b962 100644 --- a/api/src/mutations/collection.rs +++ b/api/src/mutations/collection.rs @@ -130,7 +130,7 @@ impl Mutation { balance, collection: collection.id, blockchain: input.blockchain, - action: Actions::CreateDrop, + action: Actions::CreateCollection, }) .await?; @@ -246,7 +246,7 @@ impl Mutation { org_id, collection: collection.id, blockchain: collection.blockchain, - action: Actions::RetryDrop, + action: Actions::RetryCollection, }) .await?; diff --git a/api/src/mutations/mint.rs b/api/src/mutations/mint.rs index bda35df..277df84 100644 --- a/api/src/mutations/mint.rs +++ b/api/src/mutations/mint.rs @@ -457,7 +457,11 @@ impl Mutation { org_id, mint: collection_mint_model.id, blockchain: collection.blockchain, - action: Actions::MintEdition, + action: if compressed { + Actions::MintCompressed + } else { + Actions::Mint + }, }) .await?; diff --git a/credits.toml b/credits.toml index d4e037c..2eb9c0e 100644 --- a/credits.toml +++ b/credits.toml @@ -1,19 +1,39 @@ [MintEdition] -solana = 5 -polygon = 10 +solana = 60 +polygon = 25 + +[Mint] +solana = 60 +polygon = 25 [CreateDrop] -solana = 5 -polygon = 15 +solana = 40 +polygon = 40 [RetryMint] -solana = 5 -polygon = 10 +solana = 0 +polygon = 0 [TransferAsset] -solana = 5 +solana = 10 +polygon = 10 + +[CreateWallet] +solana = 10 polygon = 10 [RetryDrop] -solana = 5 -polygon = 10 \ No newline at end of file +solana = 0 +polygon = 0 + +[CreateCollection] +solana = 40 +polygon = 0 + +[MintCompressed] +solana = 1 +polygon = 0 + +[RetryCollection] +solana = 0 +polygon = 0 \ No newline at end of file