Skip to content

Commit

Permalink
Merge pull request #162 from holaplex/espi/charge-collection-compressed
Browse files Browse the repository at this point in the history
Charge separately for collections, mints, and compressed mints
  • Loading branch information
kespinola authored Aug 1, 2023
2 parents 18c8260 + e7eb3c0 commit fb9acf6
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 18 deletions.
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
8 changes: 8 additions & 0 deletions api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@ pub enum Actions {
RetryMint,
RetryDrop,
TransferAsset,
Mint,
MintCompressed,
CreateCollection,
RetryCollection,
}

impl From<Actions> for hub_core::credits::Action {
Expand All @@ -209,6 +213,10 @@ impl From<Actions> 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,
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions api/src/mutations/collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ impl Mutation {
balance,
collection: collection.id,
blockchain: input.blockchain,
action: Actions::CreateDrop,
action: Actions::CreateCollection,
})
.await?;

Expand Down Expand Up @@ -246,7 +246,7 @@ impl Mutation {
org_id,
collection: collection.id,
blockchain: collection.blockchain,
action: Actions::RetryDrop,
action: Actions::RetryCollection,
})
.await?;

Expand Down
6 changes: 5 additions & 1 deletion api/src/mutations/mint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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?;

Expand Down
38 changes: 29 additions & 9 deletions credits.toml
Original file line number Diff line number Diff line change
@@ -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
solana = 0
polygon = 0

[CreateCollection]
solana = 40
polygon = 0

[MintCompressed]
solana = 1
polygon = 0

[RetryCollection]
solana = 0
polygon = 0

0 comments on commit fb9acf6

Please sign in to comment.