Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Api.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM das-api/builder AS files
FROM rust:1.81-slim-bullseye
FROM rust:1.82-slim-bullseye
ARG APP=/usr/src/app
RUN apt update \
&& apt install -y curl ca-certificates tzdata \
Expand Down
4 changes: 2 additions & 2 deletions Builder.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.81-bullseye AS builder
FROM rust:1.82-bullseye AS builder
RUN apt-get update -y && \
apt-get install -y build-essential make git

Expand All @@ -21,6 +21,6 @@ WORKDIR /rust
RUN --mount=type=cache,target=/rust/target,id=das-rust \
cargo build --release --bins && cp `find /rust/target/release -maxdepth 1 -type f | sed 's/^\.\///' | grep -v "\." ` /rust/bins

FROM rust:1.81-slim-bullseye as final
FROM rust:1.82-slim-bullseye as final
COPY --from=builder /rust/bins /das/
CMD echo "Built the DAS API bins!"
2 changes: 1 addition & 1 deletion Ingest.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM das-api/builder AS files
FROM rust:1.81-slim-bullseye
FROM rust:1.82-slim-bullseye
ARG APP=/usr/src/app
RUN apt update \
&& apt install -y curl ca-certificates tzdata \
Expand Down
2 changes: 1 addition & 1 deletion Load.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM das-api/builder AS files
FROM rust:1.81-slim-bullseye
FROM rust:1.82-slim-bullseye
ARG APP=/usr/src/app
RUN apt update \
&& apt install -y curl ca-certificates tzdata \
Expand Down
2 changes: 1 addition & 1 deletion Migrator.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM das-api/builder AS files

FROM rust:1.81-bullseye
FROM rust:1.82-bullseye
COPY init.sql /init.sql
ENV INIT_FILE_PATH=/init.sql
COPY --from=files /das/migration /bins/migration
Expand Down
4 changes: 2 additions & 2 deletions Proxy.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM rust:1.81-bullseye AS builder
RUN cargo install wasm-pack
FROM rust:1.82-bullseye AS builder
RUN cargo install wasm-pack --version 0.13.1

RUN mkdir /rust
COPY ./Cargo.toml /rust
Expand Down
2 changes: 1 addition & 1 deletion blockbuster/src/programs/bubblegum/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use mpl_bubblegum::{
types::{BubblegumEventType, MetadataArgs, UpdateArgs},
};
pub use mpl_bubblegum::{
types::{LeafSchema, UseMethod},
types::{LeafSchema, UseMethod, Version},
InstructionName, LeafSchemaEvent, ID,
};
use solana_sdk::pubkey::Pubkey;
Expand Down
174 changes: 88 additions & 86 deletions digital_asset_types/src/dao/generated/sea_orm_active_enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,80 @@
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "task_status")]
pub enum TaskStatus {
#[sea_orm(string_value = "failed")]
Failed,
#[sea_orm(string_value = "pending")]
Pending,
#[sea_orm(string_value = "running")]
Running,
#[sea_orm(string_value = "success")]
Success,
}
#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "mutability")]
pub enum Mutability {
#[sea_orm(string_value = "immutable")]
Immutable,
#[sea_orm(string_value = "mutable")]
Mutable,
#[sea_orm(string_value = "unknown")]
Unknown,
}
#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(
rs_type = "String",
db_type = "Enum",
enum_name = "specification_versions"
)]
pub enum SpecificationVersions {
#[sea_orm(string_value = "unknown")]
Unknown,
#[sea_orm(string_value = "v0")]
V0,
#[sea_orm(string_value = "v1")]
V1,
#[sea_orm(string_value = "v2")]
V2,
}
#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(
rs_type = "String",
db_type = "Enum",
enum_name = "v1_account_attachments"
)]
pub enum V1AccountAttachments {
#[sea_orm(string_value = "edition")]
Edition,
#[sea_orm(string_value = "edition_marker")]
EditionMarker,
#[sea_orm(string_value = "master_edition_v1")]
MasterEditionV1,
#[sea_orm(string_value = "master_edition_v2")]
MasterEditionV2,
#[sea_orm(string_value = "token_inscription")]
TokenInscription,
#[sea_orm(string_value = "unknown")]
Unknown,
}
#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(
rs_type = "String",
db_type = "Enum",
enum_name = "royalty_target_type"
)]
pub enum RoyaltyTargetType {
#[sea_orm(string_value = "creators")]
Creators,
#[sea_orm(string_value = "fanout")]
Fanout,
#[sea_orm(string_value = "single")]
Single,
#[sea_orm(string_value = "unknown")]
Unknown,
}
#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(
rs_type = "String",
Expand All @@ -16,6 +90,8 @@ pub enum SpecificationAssetClass {
FungibleToken,
#[sea_orm(string_value = "IDENTITY_NFT")]
IdentityNft,
#[sea_orm(string_value = "MPL_BUBBLEGUM_V2")]
MplBubblegumV2,
#[sea_orm(string_value = "MPL_CORE_ASSET")]
MplCoreAsset,
#[sea_orm(string_value = "MPL_CORE_COLLECTION")]
Expand All @@ -36,46 +112,14 @@ pub enum SpecificationAssetClass {
Unknown,
}
#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(
rs_type = "String",
db_type = "Enum",
enum_name = "royalty_target_type"
)]
pub enum RoyaltyTargetType {
#[sea_orm(string_value = "creators")]
Creators,
#[sea_orm(string_value = "fanout")]
Fanout,
#[sea_orm(string_value = "single")]
Single,
#[sea_orm(string_value = "unknown")]
Unknown,
}
#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "owner_type")]
pub enum OwnerType {
#[sea_orm(string_value = "single")]
Single,
#[sea_orm(string_value = "token")]
Token,
#[sea_orm(string_value = "unknown")]
Unknown,
}
#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(
rs_type = "String",
db_type = "Enum",
enum_name = "specification_versions"
)]
pub enum SpecificationVersions {
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "chain_mutability")]
pub enum ChainMutability {
#[sea_orm(string_value = "immutable")]
Immutable,
#[sea_orm(string_value = "mutable")]
Mutable,
#[sea_orm(string_value = "unknown")]
Unknown,
#[sea_orm(string_value = "v0")]
V0,
#[sea_orm(string_value = "v1")]
V1,
#[sea_orm(string_value = "v2")]
V2,
}
#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "instruction")]
Expand Down Expand Up @@ -142,54 +186,12 @@ pub enum Instruction {
VerifyCreatorV2,
}
#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "mutability")]
pub enum Mutability {
#[sea_orm(string_value = "immutable")]
Immutable,
#[sea_orm(string_value = "mutable")]
Mutable,
#[sea_orm(string_value = "unknown")]
Unknown,
}
#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "task_status")]
pub enum TaskStatus {
#[sea_orm(string_value = "failed")]
Failed,
#[sea_orm(string_value = "pending")]
Pending,
#[sea_orm(string_value = "running")]
Running,
#[sea_orm(string_value = "success")]
Success,
}
#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(
rs_type = "String",
db_type = "Enum",
enum_name = "v1_account_attachments"
)]
pub enum V1AccountAttachments {
#[sea_orm(string_value = "edition")]
Edition,
#[sea_orm(string_value = "edition_marker")]
EditionMarker,
#[sea_orm(string_value = "master_edition_v1")]
MasterEditionV1,
#[sea_orm(string_value = "master_edition_v2")]
MasterEditionV2,
#[sea_orm(string_value = "token_inscription")]
TokenInscription,
#[sea_orm(string_value = "unknown")]
Unknown,
}
#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "chain_mutability")]
pub enum ChainMutability {
#[sea_orm(string_value = "immutable")]
Immutable,
#[sea_orm(string_value = "mutable")]
Mutable,
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "owner_type")]
pub enum OwnerType {
#[sea_orm(string_value = "single")]
Single,
#[sea_orm(string_value = "token")]
Token,
#[sea_orm(string_value = "unknown")]
Unknown,
}
17 changes: 15 additions & 2 deletions digital_asset_types/src/dapi/common/asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ pub fn v1_content_from_json(asset_data: &asset_data::Model) -> Result<Content, D
links.insert(f.to_string(), l.to_owned());
}
}
let _metadata = safe_select(selector, "description");
let category = safe_select(selector, "$.properties.category").cloned();

let mut actual_files: HashMap<String, File> = HashMap::new();
if let Some(files) = selector("$.properties.files[*]")
.ok()
Expand Down Expand Up @@ -280,6 +281,7 @@ pub fn v1_content_from_json(asset_data: &asset_data::Model) -> Result<Content, D
files: Some(files),
metadata: meta,
links: Some(links),
category,
})
}

Expand Down Expand Up @@ -380,7 +382,16 @@ pub fn asset_to_rpc(asset: FullAsset, options: &Options) -> Result<RpcAsset, DbE
let rpc_authorities = to_authority(authorities);
let rpc_creators = to_creators(creators);
let rpc_groups = to_grouping(groups, options)?;
let interface = get_interface(&asset)?;

// Hardcode interface if it's a BubblegumV2 asset that was indexed before the specific
// interface was created. We infer this by checking if the asset is compressed and has
// a saved collection hash.
let interface = if asset.compressed && asset.collection_hash.is_some() {
Interface::MplBubblegumV2
} else {
get_interface(&asset)?
};

let content = get_content(&data);
let mut chain_data_selector_fn = jsonpath_lib::selector(&data.chain_data);
let chain_data_selector = &mut chain_data_selector_fn;
Expand Down Expand Up @@ -508,11 +519,13 @@ pub fn asset_to_rpc(asset: FullAsset, options: &Options) -> Result<RpcAsset, DbE
.map(|o| bs58::encode(o).into_string())
.unwrap_or("".to_string()),
}),

supply: match interface {
Interface::V1NFT
| Interface::LEGACY_NFT
| Interface::Nft
| Interface::ProgrammableNFT
| Interface::MplBubblegumV2
| Interface::Custom => Some(Supply {
edition_nonce,
print_current_supply: 0,
Expand Down
37 changes: 23 additions & 14 deletions digital_asset_types/src/rpc/asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ pub enum Interface {
MplCoreAsset,
#[serde(rename = "MplCoreCollection")]
MplCoreCollection,
#[serde(rename = "MplBubblegumV2")]
MplBubblegumV2,
#[default]
#[serde(rename = "Custom")]
Custom,
Expand All @@ -55,20 +57,21 @@ pub enum Interface {
impl From<(Option<&SpecificationVersions>, &SpecificationAssetClass)> for Interface {
fn from(i: (Option<&SpecificationVersions>, &SpecificationAssetClass)) -> Self {
match i {
(_, SpecificationAssetClass::FungibleAsset) => Interface::FungibleAsset,
(_, SpecificationAssetClass::FungibleToken) => Interface::FungibleToken,
(_, SpecificationAssetClass::MplBubblegumV2) => Interface::MplBubblegumV2,
(_, SpecificationAssetClass::MplCoreAsset) => Interface::MplCoreAsset,
(_, SpecificationAssetClass::MplCoreCollection) => Interface::MplCoreCollection,
(Some(SpecificationVersions::V0), SpecificationAssetClass::Nft) => {
Interface::LEGACY_NFT
}
(Some(SpecificationVersions::V1), SpecificationAssetClass::Nft) => Interface::V1NFT,
(Some(SpecificationVersions::V1), SpecificationAssetClass::PrintableNft) => {
Interface::V1NFT
}
(Some(SpecificationVersions::V0), SpecificationAssetClass::Nft) => {
Interface::LEGACY_NFT
}
(Some(SpecificationVersions::V1), SpecificationAssetClass::ProgrammableNft) => {
Interface::ProgrammableNFT
}
(_, SpecificationAssetClass::MplCoreAsset) => Interface::MplCoreAsset,
(_, SpecificationAssetClass::MplCoreCollection) => Interface::MplCoreCollection,
(_, SpecificationAssetClass::FungibleAsset) => Interface::FungibleAsset,
(_, SpecificationAssetClass::FungibleToken) => Interface::FungibleToken,
_ => Interface::Custom,
}
}
Expand All @@ -78,16 +81,20 @@ impl From<Interface> for (SpecificationVersions, SpecificationAssetClass) {
fn from(interface: Interface) -> (SpecificationVersions, SpecificationAssetClass) {
match interface {
Interface::V1NFT => (SpecificationVersions::V1, SpecificationAssetClass::Nft),
Interface::LEGACY_NFT => (SpecificationVersions::V0, SpecificationAssetClass::Nft),
Interface::ProgrammableNFT => (
SpecificationVersions::V1,
SpecificationAssetClass::ProgrammableNft,
),
Interface::V1PRINT => (SpecificationVersions::V1, SpecificationAssetClass::Print),
Interface::LEGACY_NFT => (SpecificationVersions::V0, SpecificationAssetClass::Nft),
Interface::FungibleAsset => (
SpecificationVersions::V1,
SpecificationAssetClass::FungibleAsset,
),
Interface::FungibleToken => (
SpecificationVersions::V1,
SpecificationAssetClass::FungibleToken,
),
Interface::ProgrammableNFT => (
SpecificationVersions::V1,
SpecificationAssetClass::ProgrammableNft,
),
Interface::MplCoreAsset => (
SpecificationVersions::V1,
SpecificationAssetClass::MplCoreAsset,
Expand All @@ -96,9 +103,9 @@ impl From<Interface> for (SpecificationVersions, SpecificationAssetClass) {
SpecificationVersions::V1,
SpecificationAssetClass::MplCoreCollection,
),
Interface::FungibleToken => (
Interface::MplBubblegumV2 => (
SpecificationVersions::V1,
SpecificationAssetClass::FungibleToken,
SpecificationAssetClass::MplBubblegumV2,
),
_ => (SpecificationVersions::V1, SpecificationAssetClass::Unknown),
}
Expand Down Expand Up @@ -180,6 +187,8 @@ pub struct Content {
pub metadata: MetadataMap,
#[serde(skip_serializing_if = "Option::is_none")]
pub links: Option<Links>,
#[serde(skip_serializing_if = "Option::is_none")]
pub category: Option<Value>,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
Expand Down
Loading