diff --git a/@types/graphql.d.ts b/@types/graphql.d.ts index b41b9c8..45241fd 100644 --- a/@types/graphql.d.ts +++ b/@types/graphql.d.ts @@ -31,6 +31,15 @@ declare module '*/mint.graphql' { } +declare module '*/transfer.graphql' { + import { DocumentNode } from 'graphql'; + const defaultDocument: DocumentNode; + export const TransferAsset: DocumentNode; + + export default defaultDocument; +} + + declare module '*/collections.graphql' { import { DocumentNode } from 'graphql'; const defaultDocument: DocumentNode; diff --git a/holaplex.graphql b/holaplex.graphql index 5b8e7b0..3ab1126 100644 --- a/holaplex.graphql +++ b/holaplex.graphql @@ -1,15 +1,8 @@ -schema { - query: Query - mutation: Mutation -} +directive @defer(if: Boolean! = true, label: String) on FRAGMENT_SPREAD | INLINE_FRAGMENT -""" -Input required for accepting an invitation to the organization. -""" +"""Input required for accepting an invitation to the organization.""" input AcceptInviteInput { - """ - The ID of the invitation. - """ + """The ID of the invitation.""" invite: UUID! } @@ -17,9 +10,7 @@ input AcceptInviteInput { The response returned after accepting an invitation to the organization. """ type AcceptInvitePayload { - """ - The invitation to the organization that has been accepted. - """ + """The invitation to the organization that has been accepted.""" invite: Invite! } @@ -27,17 +18,13 @@ type AcceptInvitePayload { An access token used to authenticate and authorize access to the Hub API. """ type AccessToken { - """ - A string representing the access token used to authenticate requests. - """ + """A string representing the access token used to authenticate requests.""" accessToken: String! - """ - A timestamp indicating when the access token will expire. - """ + + """A timestamp indicating when the access token will expire.""" expiresAt: NaiveDateTime! - """ - A string indicating the type of access token, such as "Bearer". - """ + + """A string indicating the type of access token, such as "Bearer".""" tokenType: String! } @@ -54,10 +41,9 @@ enum Action { Represents the cost of performing a certain action on different blockchains """ type ActionCost { - """ - enum that represents the type of action being performed. - """ + """enum that represents the type of action being performed.""" action: Action! + """ a vector of BlockchainCost structs that represents the cost of performing the action on each blockchain. """ @@ -67,38 +53,35 @@ type ActionCost { """ An enum type named Affiliation that defines a user's association to an organization. The enum is derived using a Union attribute. It has two variants, each containing an associated data type: """ -union Affiliation = Owner | Member +union Affiliation = Member | Owner -""" -Fireblocks-defined blockchain identifiers. -""" +"""Fireblocks-defined blockchain identifiers.""" enum AssetType { + """Ethereum Mainnet""" + ETH + """ - Mainnet Solana - """ - SOL - """ - Devnet Solana - Note: Holaplex uses `SOL_TEST` for provisioning wallets on its staging environment but still submits transactions to mainnet. + Note: Holaplex uses `ETH_TEST` for provisioning wallets on its staging environment but still submits transactions to mainnet. """ - SOL_TEST + ETH_TEST + + """Mainnet Polygon""" + MATIC + """ Ploygon Mumbai Testnet Note: Holaplex uses `MATIC_TEST` for provisioning wallets on its staging environment but still submits transactions to mainnet. """ MATIC_TEST + + """Mainnet Solana""" + SOL + """ - Mainnet Polygon - """ - MATIC - """ - Note: Holaplex uses `ETH_TEST` for provisioning wallets on its staging environment but still submits transactions to mainnet. - """ - ETH_TEST - """ - Ethereum Mainnet + Devnet Solana + Note: Holaplex uses `SOL_TEST` for provisioning wallets on its staging environment but still submits transactions to mainnet. """ - ETH + SOL_TEST } enum Blockchain { @@ -107,14 +90,13 @@ enum Blockchain { SOLANA } -""" -Represents the cost of performing an action on a specific blockchain -""" +"""Represents the cost of performing an action on a specific blockchain""" type BlockchainCost { """ enum that represents the blockchain on which the action is being performed. """ blockchain: Blockchain! + """ represents the cost in credits for performing the action on the blockchain. """ @@ -123,173 +105,159 @@ type BlockchainCost { type Collection { """ - The unique identifier for the collection. - """ - id: UUID! - """ - The blockchain of the collection. + The blockchain address of the collection used to view it in blockchain explorers. + On Solana this is the mint address. + On EVM chains it is the concatenation of the contract address and the token id `{contractAddress}:{tokenId}`. """ + address: String + + """The blockchain of the collection.""" blockchain: Blockchain! - """ - The total supply of the collection. Setting to `null` implies unlimited minting. - """ - supply: Int + """ The creation status of the collection. When the collection is in a `CREATED` status you can mint NFTs from the collection. """ creationStatus: CreationStatus! - """ - The blockchain address of the collection used to view it in blockchain explorers. - """ - address: String - """ - The current number of NFTs minted from the collection. - """ - totalMints: Int! - """ - The transaction signature of the collection. - """ - signature: String - """ - The royalties assigned to mints belonging to the collection expressed in basis points. - """ - sellerFeeBasisPoints: Int! + + """The list of attributed creators for the collection.""" + creators: [CollectionCreator!] + + """The list of current holders of NFTs from the collection.""" + holders: [Holder!] + + """The unique identifier for the collection.""" + id: UUID! + """ The metadata json associated to the collection. ## References [Metaplex v1.1.0 Standard](https://docs.metaplex.com/programs/token-metadata/token-standard) """ metadataJson: MetadataJson + """ The list of minted NFTs from the collection including the NFTs address and current owner's wallet address. """ mints: [CollectionMint!] + """ - The list of attributed creators for the collection. + A list of all NFT purchases from the collection, including both primary and secondary sales. """ - creators: [CollectionCreator!] + purchases: [Purchase!] + """ - The list of current holders of NFTs from the collection. + The royalties assigned to mints belonging to the collection expressed in basis points. """ - holders: [Holder!] + sellerFeeBasisPoints: Int! + + """The transaction signature of the collection.""" + signature: String + """ - A list of all NFT purchases from the collection, including both primary and secondary sales. + The total supply of the collection. Setting to `null` implies unlimited minting. """ - purchases: [Purchase!] + supply: Int + + """The current number of NFTs minted from the collection.""" + totalMints: Int! } type CollectionCreator { - collectionId: UUID! address: String! - verified: Boolean! + collectionId: UUID! share: Int! + verified: Boolean! } -""" -An attributed creator for a colleciton. -""" +"""An attributed creator for a colleciton.""" input CollectionCreatorInput { - """ - The wallet address of the creator. - """ + """The wallet address of the creator.""" address: String! + + """The share of royalties payout the creator should receive.""" + share: Int! + """ This field indicates whether the collection's creator has been verified. This feature is only supported on the Solana blockchain. ## References [Metaplex Token Metadata - Verify creator instruction](https://docs.metaplex.com/programs/token-metadata/instructions#verify-a-creator) """ verified: Boolean - """ - The share of royalties payout the creator should receive. - """ - share: Int! } -""" -Represents a single NFT minted from a collection. -""" +"""Represents a single NFT minted from a collection.""" type CollectionMint { """ - The unique ID of the minted NFT. - """ - id: UUID! - """ - The ID of the collection the NFT was minted from. + The address of the NFT + On Solana this is the mint address. + On EVM chains it is the concatenation of the contract address and the token id `{contractAddress}:{tokenId}`. """ + address: String + + """The collection the NFT was minted from.""" + collection: Collection + + """The ID of the collection the NFT was minted from.""" collectionId: UUID! - """ - The wallet address of the NFT. - """ - address: String! - """ - The wallet address of the owner of the NFT. - """ - owner: String! - """ - The status of the NFT creation. - """ - creationStatus: CreationStatus! - """ - The unique ID of the creator of the NFT. - """ - createdBy: UUID! - """ - The date and time when the NFT was created. - """ + + """The date and time when the NFT was created.""" createdAt: DateTime! - """ - The transaction signature associated with the NFT. - """ - signature: String - """ - The unique edition number of the NFT. - """ - edition: Int! - """ - The seller fee basis points (ie royalties) for the NFT. - """ - sellerFeeBasisPoints: Int! - """ - credits deduction id - """ + + """The unique ID of the creator of the NFT.""" + createdBy: UUID! + + """The status of the NFT creation.""" + creationStatus: CreationStatus! + + """credits deduction id""" creditsDeductionId: UUID - """ - The collection the NFT was minted from. - """ - collection: Collection + + """The unique edition number of the NFT.""" + edition: Int! + + """The unique ID of the minted NFT.""" + id: UUID! + """ The metadata json associated to the collection. [Metaplex v1.1.0 Standard](https://docs.metaplex.com/programs/token-metadata/token-standard) """ metadataJson: MetadataJson + + """The wallet address of the owner of the NFT.""" + owner: String! + + """The seller fee basis points (ie royalties) for the NFT.""" + sellerFeeBasisPoints: Int! + + """The transaction signature associated with the NFT.""" + signature: String } """ This struct represents the input for creating a new API credential, including the ID of the organization that the credential will be associated with and the friendly name assigned to the credential. """ input CreateCredentialInput { + """The friendly name assigned to the new API credential.""" + name: String! + """ The ID of the organization that the new API credential will be associated with. """ organization: UUID! - """ - The friendly name assigned to the new API credential. - """ - name: String! } """ The response payload returned after successfully creating an API credential. It includes the newly created Credential object, which represents the API credential, as well as an `AccessToken` object that can be used to authenticate requests to the Hub API. """ type CreateCredentialPayload { - """ - A `Credential` object representing the newly created API credential. - """ - credential: Credential! """ An `AccessToken` object that can be used to authenticate requests to the Hub API. """ accessToken: AccessToken! + + """A `Credential` object representing the newly created API credential.""" + credential: Credential! } """ @@ -306,43 +274,34 @@ input CreateCustomerInput { This response represents the payload returned after successfully creating a new `customer` record. It contains a single field customer which is a `Customer` object representing the newly created customer record. """ type CreateCustomerPayload { - """ - The customer record created by the create customer mutation. - """ + """The customer record created by the create customer mutation.""" customer: Customer! } -""" -Input for creating a customer wallet. -""" +"""Input for creating a customer wallet.""" input CreateCustomerWalletInput { - """ - The customer ID. - """ - customer: UUID! - """ - Blockchain for wallet creation. - """ + """Blockchain for wallet creation.""" assetType: AssetType! + + """The customer ID.""" + customer: UUID! } -""" -Response after wallet creation. -""" +"""Response after wallet creation.""" type CreateCustomerWalletPayload { wallet: Wallet! } input CreateDropInput { - project: UUID! - price: Int - sellerFeeBasisPoints: Int - supply: Int - startTime: DateTime - endTime: DateTime blockchain: Blockchain! creators: [CollectionCreatorInput!]! + endTime: DateTime metadataJson: MetadataJsonInput! + price: Int + project: UUID! + sellerFeeBasisPoints: Int + startTime: DateTime + supply: Int } type CreateDropPayload { @@ -358,45 +317,37 @@ type CreateOrganizationPayload { organization: Organization! } -""" -The input used for creating a project. -""" +"""The input used for creating a project.""" input CreateProjectInput { - """ - The ID of the organization the project belongs to. - """ - organization: UUID! """ The friendly name to denote the project from others belonging to the organization. """ name: String! - """ - The URL of the project's profile image. - """ + + """The ID of the organization the project belongs to.""" + organization: UUID! + + """The URL of the project's profile image.""" profileImageUrl: String } -""" -* The payload returned by the `createProject` mutation. -""" +"""* The payload returned by the `createProject` mutation.""" type CreateProjectPayload { - """ - * The project that was created. - """ + """* The project that was created.""" project: Project! } input CreateWebhookInput { - url: String! - organization: UUID! description: String! - projects: [UUID!]! filterTypes: [FilterType!]! + organization: UUID! + projects: [UUID!]! + url: String! } type CreateWebhookPayload { - webhook: Webhook! secret: String! + webhook: Webhook! } enum CreationStatus { @@ -412,82 +363,73 @@ enum CreationStatus { An `OAuth2` client application used for authentication with the Hub API. """ type Credential { - """ - A user-friendly name assigned to the credential. - """ - name: String! - """ - A unique identifier for the credential. - """ + """A unique identifier for the credential.""" clientId: String! - """ - The ID of the user who created the credential. - """ - createdById: UUID! - """ - The ID of the organization the credential belongs to. - """ - organizationId: UUID! - """ - The datetime in UTC when the credential was created. - """ + + """The datetime in UTC when the credential was created.""" createdAt: NaiveDateTime! - """ - This field represents the user who created the credential. - """ + + """This field represents the user who created the credential.""" createdBy: User + + """The ID of the user who created the credential.""" + createdById: UUID! + + """A user-friendly name assigned to the credential.""" + name: String! + + """The ID of the organization the credential belongs to.""" + organizationId: UUID! } type CreditDeposit { + cost: Float! + createdAt: DateTime! + credits: Int! id: UUID! - organization: UUID! initiatedBy: UUID! - credits: Int! - cost: Float! + organization: UUID! + perCreditCost: Float! reason: DepositReason! - createdAt: DateTime! - perCreditCost: Float! } type Credits { - id: UUID! balance: Int! deposits: [CreditDeposit!] + id: UUID! } """ A customer record represents a user in your service and is used to group custodial wallets within a specific project. This allows for easy management of wallets and associated assets for a particular customer within your service. """ type Customer { - """ - The unique identifier for the customer record. - """ - id: UUID! - """ - The ID of the project to which the customer record belongs. - """ - projectId: UUID! - """ - The datetime when the customer record was created. - """ - createdAt: NaiveDateTime! - """ - An optional datetime indicating the last time the customer record was updated. If the customer record has not been updated, this field will be `null`. - """ - updatedAt: NaiveDateTime """ Returns all the wallet addresses associated with the customer. The blockchain of the address is not included and they are in no particular order. In the future, the blockchain may be indicated with a pattern of {blockchain}:{address}. This field returns null when there is no treasury assigned to the customer yet. """ addresses: [String!] - """ - The NFTs owned by any of the customers' wallets. - """ + + """The datetime when the customer record was created.""" + createdAt: NaiveDateTime! + + """The unique identifier for the customer record.""" + id: UUID! + + """The NFTs owned by any of the customers' wallets.""" mints: [CollectionMint!] + + """The ID of the project to which the customer record belongs.""" + projectId: UUID! + """ The treasury assigned to the customer, which contains the customer's wallets. """ treasury: Treasury + + """ + An optional datetime indicating the last time the customer record was updated. If the customer record has not been updated, this field will be `null`. + """ + updatedAt: NaiveDateTime wallet(assetId: AssetType): [Wallet!] } @@ -507,23 +449,15 @@ type DeductionTotals { spent: Int! } -""" -The input for deleting a credential. -""" +"""The input for deleting a credential.""" input DeleteCredentialInput { - """ - The unique identifier assigned to the credential to be deleted. - """ + """The unique identifier assigned to the credential to be deleted.""" credential: String! } -""" -The response for deleting a credential. -""" +"""The response for deleting a credential.""" type DeleteCredentialPayload { - """ - The unique identifier assigned to the deleted credential. - """ + """The unique identifier assigned to the deleted credential.""" credential: String! } @@ -541,117 +475,94 @@ enum DepositReason { } type Drop { - """ - The unique identifier for the drop. - """ - id: UUID! - """ - The identifier of the project to which the drop is associated. - """ - projectId: UUID! - """ - The creation status of the drop. - """ + """The collection for which the drop is managing mints.""" + collection: Collection! + + """The date and time in UTC when the drop was created.""" + createdAt: DateTime! + + """The user id of the person who created the drop.""" + createdById: UUID! + + """The creation status of the drop.""" creationStatus: CreationStatus! - """ - The date and time in UTC when the drop is eligible for minting. A value of `null` means the drop can be minted immediately. - """ - startTime: DateTime + """ The end date and time in UTC for the drop. A value of `null` means the drop does not end until it is fully minted. """ endTime: DateTime + + """The unique identifier for the drop.""" + id: UUID! + pausedAt: DateTime + """ The cost to mint the drop in US dollars. When purchasing with crypto the user will be charged at the current conversion rate for the blockchain's native coin at the time of minting. """ price: Int! - """ - The user id of the person who created the drop. - """ - createdById: UUID! - """ - The date and time in UTC when the drop was created. - """ - createdAt: DateTime! - pausedAt: DateTime + + """The identifier of the project to which the drop is associated.""" + projectId: UUID! + + """A list of all NFT purchases from this drop.""" + purchases: [Purchase!] + """ The shutdown_at field represents the date and time in UTC when the drop was shutdown If it is null, the drop is currently not shutdown """ shutdownAt: DateTime + """ - The collection for which the drop is managing mints. - """ - collection: Collection! - """ - The current status of the drop. + The date and time in UTC when the drop is eligible for minting. A value of `null` means the drop can be minted immediately. """ + startTime: DateTime + + """The current status of the drop.""" status: DropStatus! - """ - A list of all NFT purchases from this drop. - """ - purchases: [Purchase!] } -""" -The different phases of a drop. -""" +"""The different phases of a drop.""" enum DropStatus { - """ - Actively minting. - """ - MINTING - """ - The minting process for the collection is complete. - """ - MINTED - """ - The drop is scheduled for minting. - """ - SCHEDULED - """ - The drop has expired and its end time has passed. - """ - EXPIRED - """ - The drop is still being created and is not ready to mint. - """ + """The drop is still being created and is not ready to mint.""" CREATING - """ - The drop is temporarily paused and cannot be minted at the moment. - """ + + """The drop has expired and its end time has passed.""" + EXPIRED + + """The creation process for the drop has failed""" + FAILED + + """The minting process for the collection is complete.""" + MINTED + + """Actively minting.""" + MINTING + + """The drop is temporarily paused and cannot be minted at the moment.""" PAUSED - """ - The drop is permanently shut down and can no longer be minted. - """ + + """The drop is scheduled for minting.""" + SCHEDULED + + """The drop is permanently shut down and can no longer be minted.""" SHUTDOWN - """ - The creation process for the drop has failed - """ - FAILED } """ The input for editing the name of an existing credential by providing the `client_id` of the credential and the new `name` to be assigned. """ input EditCredentialInput { - """ - A unique string identifier assigned to the credential during creation. - """ + """A unique string identifier assigned to the credential during creation.""" clientId: String! - """ - The new name to be assigned to the credential. - """ + + """The new name to be assigned to the credential.""" name: String! } -""" -The response for editing the name of a credential. -""" +"""The response for editing the name of a credential.""" type EditCredentialPayload { - """ - The updated credential with the edited name. - """ + """The updated credential with the edited name.""" credential: Credential! } @@ -676,231 +587,190 @@ type EditProjectPayload { } input EditWebhookInput { - webhook: UUID! - url: String! description: String! - projects: [UUID!]! - filterTypes: [FilterType!]! disabled: Boolean + filterTypes: [FilterType!]! + projects: [UUID!]! + url: String! + webhook: UUID! } type EditWebhookPayload { webhook: Webhook! } -""" -An event to which an external service can subscribe. -""" +"""An event to which an external service can subscribe.""" type EventType { - """ - Whether the event is archived or not. - """ + """Whether the event is archived or not.""" archived: Boolean - """ - The date and time when the event was created, in string format. - """ + + """The date and time when the event was created, in string format.""" createdAt: String! - """ - A description of the event. - """ + + """A description of the event.""" description: String! - """ - The name of the event. - """ + + """The name of the event.""" name: String! - """ - The JSON schema for the event payload. - """ + + """The JSON schema for the event payload.""" schemas: JSON! - """ - The date and time when the event was last updated, in string format. - """ + + """The date and time when the event was last updated, in string format.""" updatedAt: String! } -""" -An enumeration of event types that can be subscribed to by a webhook. -""" +"""An enumeration of event types that can be subscribed to by a webhook.""" enum FilterType { - """ - Event triggered when a new project is created - """ - PROJECT_CREATED - """ - Event triggered when a new customer is created - """ + """Event triggered when a new customer is created""" CUSTOMER_CREATED - """ - Event triggered when a new customer treasury is created - """ + + """Event triggered when a new customer treasury is created""" CUSTOMER_TREASURY_CREATED - """ - Event triggered when a new wallet is created for a project - """ - PROJECT_WALLET_CREATED - """ - Event triggered when a new wallet is created for a customer - """ + + """Event triggered when a new wallet is created for a customer""" CUSTOMER_WALLET_CREATED - """ - Event triggered when a new drop is created - """ + + """Event triggered when a new drop is created""" DROP_CREATED - """ - Event triggered when a new drop is minted - """ + + """Event triggered when a new drop is minted""" DROP_MINTED - """ - Event triggered when a mint has been successfully transfered - """ + + """Event triggered when a mint has been successfully transfered""" MINT_TRANSFERED + + """Event triggered when a new project is created""" + PROJECT_CREATED + + """Event triggered when a new wallet is created for a project""" + PROJECT_WALLET_CREATED } -""" -The holder of a collection. -""" +"""The holder of a collection.""" type Holder { - """ - The collection ID that the holder owns. - """ - collectionId: UUID! - """ - The wallet address of the holder. - """ + """The wallet address of the holder.""" address: String! - """ - The number of NFTs that the holder owns in the collection. - """ + + """The collection ID that the holder owns.""" + collectionId: UUID! + + """The specific mints from the collection that the holder owns.""" + mints: [UUID!]! + + """The number of NFTs that the holder owns in the collection.""" owns: Int! - """ - The specific mints from the collection that the holder owns. - """ - mints: [String!]! } -""" -An invitation sent to join a Holaplex organization. -""" +"""An invitation sent to join a Holaplex organization.""" type Invite { - """ - The ID of the invitation. - """ - id: UUID! - """ - The email address of the user being invited to become a member of the organization. - """ - email: String! - """ - The status of the invitation. - """ - status: InviteStatus! - """ - The ID of the organization to which the invitation belongs. - """ - organizationId: UUID! - """ - The ID of the user who created the invitation. - """ - createdBy: UUID! """ The datetime, in UTC, when the invitation to join the organization was created. """ createdAt: DateTime! + + """The ID of the user who created the invitation.""" + createdBy: UUID! + """ - The datetime, in UTC, when the invitation status was updated. + The email address of the user being invited to become a member of the organization. """ - updatedAt: DateTime + email: String! + + """The ID of the invitation.""" + id: UUID! + """ The member record that is generated after the invitation to join the organization is accepted. When the user has not accepted the invitation, this field returns `null`. """ member: Member - """ - The organization to which the invitation to join belongs. - """ + + """The organization to which the invitation to join belongs.""" organization: Organization + + """The ID of the organization to which the invitation belongs.""" + organizationId: UUID! + + """The status of the invitation.""" + status: InviteStatus! + + """The datetime, in UTC, when the invitation status was updated.""" + updatedAt: DateTime } -""" -Input required for inviting a member to the organization. -""" +"""Input required for inviting a member to the organization.""" input InviteMemberInput { - """ - The ID of the organization. - """ - organization: UUID! - """ - The email address of the invited user. - """ + """The email address of the invited user.""" email: String! + + """The ID of the organization.""" + organization: UUID! } -""" -The status of a member invitation. -""" +"""The status of a member invitation.""" enum InviteStatus { - """ - The member invitation has been accepted by the invited user. - """ + """The member invitation has been accepted by the invited user.""" ACCEPTED + """ The member invitation has been revoked by an existing member of the organization and is no longer valid. """ REVOKED - """ - The member invitation has been sent to the invited user. - """ + + """The member invitation has been sent to the invited user.""" SENT } -""" -A scalar that can represent any JSON value. -""" +"""A scalar that can represent any JSON value.""" scalar JSON """ A member of a Holaplex organization, representing an individual who has been granted access to the organization. """ type Member { + """The datetime, in UTC, when the member joined the organization.""" + createdAt: DateTime! + """ - The ID of the user who has been granted access to the Holaplex organization as a member. - """ - userId: UUID! - """ - The user identity who is a member of the organization. - """ - user: User - """ - The unique identifier of the member. + The datetime, in UTC, when the member was deactivated from the organization. """ + deactivatedAt: DateTime + + """The unique identifier of the member.""" id: UUID! + """ - The ID of the Holaplex organization to which the user has been granted access. - """ - organizationId: UUID! - """ - The datetime, in UTC, when the member joined the organization. - """ - createdAt: DateTime! - """ - The datetime, in UTC, when the member was revoked from the organization. + The invitation to join the Holaplex organization that the member accepted in order to gain access to the organization. """ - revokedAt: DateTime + invite: Invite + """ The ID of the invitation that the member accepted to join the organization. """ inviteId: UUID! - """ - The datetime, in UTC, when the member was deactivated from the organization. - """ - deactivatedAt: DateTime + """ The Holaplex organization to which the member belongs, representing an individual who has been granted access to the organization. """ organization: Organization + """ - The invitation to join the Holaplex organization that the member accepted in order to gain access to the organization. + The ID of the Holaplex organization to which the user has been granted access. """ - invite: Invite + organizationId: UUID! + + """ + The datetime, in UTC, when the member was revoked from the organization. + """ + revokedAt: DateTime + + """The user identity who is a member of the organization.""" + user: User + + """ + The ID of the user who has been granted access to the Holaplex organization as a member. + """ + userId: UUID! } """ @@ -909,53 +779,43 @@ The collection's associated metadata JSON. [Metaplex v1.1.0 Standard](https://docs.metaplex.com/programs/token-metadata/token-standard) """ type MetadataJson { - id: UUID! - identifier: String! - """ - The assigned name of the NFT. - """ - name: String! - """ - The URI for the complete metadata JSON. - """ - uri: String! - """ - The symbol of the NFT. - """ - symbol: String! - """ - The description of the NFT. - """ - description: String! - """ - The image URI for the NFT. - """ - imageOriginal: String! - """ - An optional animated version of the NFT art. - """ + """An optional animated version of the NFT art.""" animationUrl: String + attributes: [MetadataJsonAttribute!] + + """The description of the NFT.""" + description: String! + """ An optional URL where viewers can find more information on the NFT, such as the collection's homepage or Twitter page. """ externalUrl: String - attributes: [MetadataJsonAttribute!] + id: UUID! + identifier: String! image: String + + """The image URI for the NFT.""" + imageOriginal: String! + + """The assigned name of the NFT.""" + name: String! + + """The symbol of the NFT.""" + symbol: String! + + """The URI for the complete metadata JSON.""" + uri: String! } -""" -An attribute of the NFT. -""" +"""An attribute of the NFT.""" type MetadataJsonAttribute { id: UUID! metadataJsonId: UUID! - """ - The name of the attribute. - """ + + """The name of the attribute.""" traitType: String! - """ - The value of the attribute. - """ + + """The value of the attribute.""" value: String! } @@ -965,30 +825,30 @@ input MetadataJsonAttributeInput { } input MetadataJsonCollectionInput { - name: String family: String + name: String } input MetadataJsonFileInput { - uri: String fileType: String + uri: String } input MetadataJsonInput { - name: String! - symbol: String! - description: String! - image: String! animationUrl: String - collection: MetadataJsonCollectionInput attributes: [MetadataJsonAttributeInput!]! + collection: MetadataJsonCollectionInput + description: String! externalUrl: String + image: String! + name: String! properties: MetadataJsonPropertyInput + symbol: String! } input MetadataJsonPropertyInput { - files: [MetadataJsonFileInput!] category: String + files: [MetadataJsonFileInput!] } """ @@ -999,180 +859,191 @@ input MintDropInput { recipient: String! } -""" -Represents payload data for the `mint_edition` mutation -""" +"""Represents payload data for the `mint_edition` mutation""" type MintEditionPayload { collectionMint: CollectionMint! } type Mutation { """ - Create an API credential to authenticate and authorize API requests to the Holaplex Hub. - """ - createCredential(input: CreateCredentialInput!): CreateCredentialPayload! - """ - Edit the name assigned to the API credential. + Accept an invite to the organization. + # Error + This mutation will produce an error if it is unable to connect to the database or if the user's email does not match the invitation. """ - editCredential(input: EditCredentialInput!): EditCredentialPayload! + acceptInvite(input: AcceptInviteInput!): AcceptInvitePayload! + """ - Delete the OAuth2 API credential. + Create an API credential to authenticate and authorize API requests to the Holaplex Hub. """ - deleteCredential(input: DeleteCredentialInput!): DeleteCredentialPayload! + createCredential(input: CreateCredentialInput!): CreateCredentialPayload! + """ This mutation creates a customer record and a corresponding treasury that holds custodial wallets on behalf of a user. The treasury serves as a way to group the customer's wallets together. This makes it easier to manage wallets and associated assets for the user within a specific project. The customer and treasury are associated with the specified project ID. The response includes the newly created customer record. If there is an error connecting to the database or unable to emit a customer created event, the mutation will fail and an error will be returned. """ createCustomer(input: CreateCustomerInput!): CreateCustomerPayload! + + """ + Create a wallet for a customer and assign it to the customer's treasury account. + + # Errors + The mutation will result in an error if it is unable to interact with the database or communicate with Fireblocks. + """ + createCustomerWallet(input: CreateCustomerWalletInput!): CreateCustomerWalletPayload! + """ This mutation creates a new NFT drop and its associated collection. The drop returns immediately with a creation status of CREATING. You can [set up a webhook](https://docs.holaplex.dev/hub/For%20Developers/webhooks-overview) to receive a notification when the drop is ready to be minted. Error If the drop cannot be saved to the database or fails to be emitted for submission to the desired blockchain, the mutation will result in an error. """ createDrop(input: CreateDropInput!): CreateDropPayload! + """ - This mutation retries an existing drop. - The drop returns immediately with a creation status of CREATING. - You can [set up a webhook](https://docs.holaplex.dev/hub/For%20Developers/webhooks-overview) to receive a notification when the drop is ready to be minted. - Errors - The mutation will fail if the drop and its related collection cannot be located, - if the transaction response cannot be built, - or if the transaction event cannot be emitted. - """ - retryDrop(input: RetryDropInput!): CreateDropPayload! - """ - This mutation allows for the temporary blocking of the minting of editions and can be resumed by calling the resumeDrop mutation. - """ - pauseDrop(input: PauseDropInput!): PauseDropPayload! - """ - This mutation resumes a paused drop, allowing minting of editions to be restored - """ - resumeDrop(input: ResumeDropInput!): ResumeDropPayload! + This mutation creates a new Holaplex organization, with the user triggering the mutation automatically assigned as the owner of the organization. + # Errors + This mutation produces an error if it is unable to connect to the database, emit the organization creation event, or if the user is not set in the X-USER-ID header. """ - Shuts down a drop by writing the current UTC timestamp to the shutdown_at field of drop record. - Returns the `Drop` object on success. + createOrganization(input: CreateOrganizationInput!): CreateOrganizationPayload! + """ + This mutation creates a new project under the specified organization. + # Errors - Fails if the drop or collection is not found, or if updating the drop record fails. + This mutation produces an error if it is unable to connect to the database, emit the project creation event, or if the user is not set in the X-USER-ID header. """ - shutdownDrop(input: ShutdownDropInput!): ShutdownDropPayload! + createProject(input: CreateProjectInput!): CreateProjectPayload! + """ - This mutation allows updating a drop and it's associated collection by ID. - It returns an error if it fails to reach the database, emit update events or assemble the on-chain transaction. - Returns the `PatchDropPayload` object on success. + Res + + # Errors + This function fails if ... """ - patchDrop(input: PatchDropInput!): PatchDropPayload! + createWebhook(input: CreateWebhookInput!): CreateWebhookPayload! + """ - This mutation mints an NFT edition for a specific drop ID. The mint returns immediately with a creation status of CREATING. You can [set up a webhook](https://docs.holaplex.dev/hub/For%20Developers/webhooks-overview) to receive a notification when the mint is accepted by the blockchain. + Returns member object on success + # Errors - If the mint cannot be saved to the database or fails to be emitted for submission to the desired blockchain, the mutation will result in an error. + This code may result in an error if the update to the database fails or if it fails to produce an event. """ - mintEdition(input: MintDropInput!): MintEditionPayload! + deactivateMember(input: DeactivateMemberInput!): Member! + + """Delete the OAuth2 API credential.""" + deleteCredential(input: DeleteCredentialInput!): DeleteCredentialPayload! + """ - This mutation retries a mint which failed or is in pending state. The mint returns immediately with a creation status of CREATING. You can [set up a webhook](https://docs.holaplex.dev/hub/For%20Developers/webhooks-overview) to receive a notification when the mint is accepted by the blockchain. + Res + # Errors - If the mint cannot be saved to the database or fails to be emitted for submission to the desired blockchain, the mutation will result in an error. - """ - retryMint(input: RetryMintInput!): RetryMintPayload! + This function fails if ... """ - Transfers an asset from one user to another on a supported blockchain network. - - # Arguments + deleteWebhook(input: DeleteWebhookInput!): DeleteWebhookPayload! - * `self` - A reference to the current instance of the struct. - * `ctx` - A context object containing application context data. - * `input` - A TransferAssetInput struct containing the input data for the asset transfer. + """Edit the name assigned to the API credential.""" + editCredential(input: EditCredentialInput!): EditCredentialPayload! - # Returns + """This mutation edits the name or profile image of the organization.""" + editOrganization(input: EditOrganizationInput!): EditOrganizationPayload! - Returns a Result containing a TransferAssetPayload struct with the updated mint information upon success. + """This mutations edits the name and profile image of the project.""" + editProject(input: EditProjectInput!): EditProjectPayload! - # Errors - This function returns an error : - If the specified blockchain is not currently supported. - If the specified mint does not exist. - If there is an error while making a transfer request to the Solana blockchain. - If there is an error while sending the TransferAsset event to the event producer. - """ - transferAsset(input: TransferAssetInput!): TransferAssetPayload! """ - This mutation creates a new Holaplex organization, with the user triggering the mutation automatically assigned as the owner of the organization. + Res + # Errors - This mutation produces an error if it is unable to connect to the database, emit the organization creation event, or if the user is not set in the X-USER-ID header. - """ - createOrganization( - input: CreateOrganizationInput! - ): CreateOrganizationPayload! - """ - This mutation edits the name or profile image of the organization. - """ - editOrganization(input: EditOrganizationInput!): EditOrganizationPayload! + This function fails if ... """ - This mutation creates a new project under the specified organization. + editWebhook(input: EditWebhookInput!): EditWebhookPayload! - # Errors - This mutation produces an error if it is unable to connect to the database, emit the project creation event, or if the user is not set in the X-USER-ID header. - """ - createProject(input: CreateProjectInput!): CreateProjectPayload! - """ - This mutations edits the name and profile image of the project. - """ - editProject(input: EditProjectInput!): EditProjectPayload! """ To invite a person to the organization, provide their email address. # Error This mutation will produce an error if it is unable to connect to the database or if there is no associated user set in the X-USER-ID header. """ inviteMember(input: InviteMemberInput!): Invite! + mint: CollectionMint + """ - Accept an invite to the organization. - # Error - This mutation will produce an error if it is unable to connect to the database or if the user's email does not match the invitation. + This mutation mints an NFT edition for a specific drop ID. The mint returns immediately with a creation status of CREATING. You can [set up a webhook](https://docs.holaplex.dev/hub/For%20Developers/webhooks-overview) to receive a notification when the mint is accepted by the blockchain. + # Errors + If the mint cannot be saved to the database or fails to be emitted for submission to the desired blockchain, the mutation will result in an error. """ - acceptInvite(input: AcceptInviteInput!): AcceptInvitePayload! + mintEdition(input: MintDropInput!): MintEditionPayload! + """ - Returns member object on success + This mutation allows updating a drop and it's associated collection by ID. + It returns an error if it fails to reach the database, emit update events or assemble the on-chain transaction. + Returns the `PatchDropPayload` object on success. + """ + patchDrop(input: PatchDropInput!): PatchDropPayload! - # Errors - This code may result in an error if the update to the database fails or if it fails to produce an event. """ - deactivateMember(input: DeactivateMemberInput!): Member! + This mutation allows for the temporary blocking of the minting of editions and can be resumed by calling the resumeDrop mutation. """ - Returns member object on success + pauseDrop(input: PauseDropInput!): PauseDropPayload! + """ + Returns member object on success + # Errors This code may result in an error if the update to the database fails or if it fails to produce an event. """ reactivateMember(input: ReactivateMemberInput!): Member! - """ - Create a wallet for a customer and assign it to the customer's treasury account. - # Errors - The mutation will result in an error if it is unable to interact with the database or communicate with Fireblocks. """ - createCustomerWallet( - input: CreateCustomerWalletInput! - ): CreateCustomerWalletPayload! + This mutation resumes a paused drop, allowing minting of editions to be restored """ - Res + resumeDrop(input: ResumeDropInput!): ResumeDropPayload! - # Errors - This function fails if ... """ - createWebhook(input: CreateWebhookInput!): CreateWebhookPayload! + This mutation retries an existing drop. + The drop returns immediately with a creation status of CREATING. + You can [set up a webhook](https://docs.holaplex.dev/hub/For%20Developers/webhooks-overview) to receive a notification when the drop is ready to be minted. + Errors + The mutation will fail if the drop and its related collection cannot be located, + if the transaction response cannot be built, + or if the transaction event cannot be emitted. """ - Res + retryDrop(input: RetryDropInput!): CreateDropPayload! + """ + This mutation retries a mint which failed or is in pending state. The mint returns immediately with a creation status of CREATING. You can [set up a webhook](https://docs.holaplex.dev/hub/For%20Developers/webhooks-overview) to receive a notification when the mint is accepted by the blockchain. # Errors - This function fails if ... + If the mint cannot be saved to the database or fails to be emitted for submission to the desired blockchain, the mutation will result in an error. """ - deleteWebhook(input: DeleteWebhookInput!): DeleteWebhookPayload! + retryMint(input: RetryMintInput!): RetryMintPayload! + """ - Res + Shuts down a drop by writing the current UTC timestamp to the shutdown_at field of drop record. + Returns the `Drop` object on success. + + # Errors + Fails if the drop or collection is not found, or if updating the drop record fails. + """ + shutdownDrop(input: ShutdownDropInput!): ShutdownDropPayload! + """ + Transfers an asset from one user to another on a supported blockchain network. + + # Arguments + + * `self` - A reference to the current instance of the struct. + * `ctx` - A context object containing application context data. + * `input` - A TransferAssetInput struct containing the input data for the asset transfer. + + # Returns + + Returns a Result containing a TransferAssetPayload struct with the updated mint information upon success. + # Errors - This function fails if ... + This function returns an error : + If the specified blockchain is not currently supported. + If the specified mint does not exist. + If there is an error while making a transfer request to the Solana blockchain. + If there is an error while sending the TransferAsset event to the event producer. """ - editWebhook(input: EditWebhookInput!): EditWebhookPayload! + transferAsset(input: TransferAssetInput!): TransferAssetPayload! } """ @@ -1189,36 +1060,39 @@ A Holaplex organization is the top-level account within the Holaplex ecosystem. """ type Organization { """ - The unique identifier assigned to the Holaplex organization, which is used to distinguish it from other organizations within the Holaplex ecosystem. + The datetime, in UTC, when the Holaplex organization was created by its owner. """ - id: UUID! + createdAt: DateTime! + """ Get a single API credential by client ID. - + # Arguments - + * `ctx` - The GraphQL context object containing the database connection pool and other data. * `client_id` - The client ID of the API credential to retrieve. - + # Returns - + The API credential with the specified client ID. """ credential(clientId: String!): Credential! + """ Get a list of API credentials associated with this organization. - + # Arguments - + * `ctx` - The GraphQL context object containing the database connection pool and other data. * `limit` - Optional limit on the number of credentials to retrieve. * `offset` - Optional offset for the credentials to retrieve. - + # Returns - + A list of API credentials associated with this organization. """ credentials(limit: Int, offset: Int): [Credential!]! + """ Define an asynchronous function to load the credits for the organization Returns `Credits` object @@ -1226,6 +1100,12 @@ type Organization { returns error if credits_loader is not found in the context or if the loader fails to load the credits """ credits: Credits + + """ + The datetime, in UTC, when the Holaplex organization was deactivated by its owner. + """ + deactivatedAt: DateTime + """ Define an asynchronous function to load the total credits deducted for each action Returns `DeductionTotals` object @@ -1233,162 +1113,146 @@ type Organization { returns error if total_deductions_loader is not found in the context or if the loader fails to load the total deductions """ deductionTotals: [DeductionTotals!] + """ - The name given to the Holaplex organization, which is used to identify it within the Holaplex ecosystem and to its members and users. - """ - name: String! - """ - The datetime, in UTC, when the Holaplex organization was created by its owner. - """ - createdAt: DateTime! - """ - The datetime, in UTC, when the Holaplex organization was deactivated by its owner. + The unique identifier assigned to the Holaplex organization, which is used to distinguish it from other organizations within the Holaplex ecosystem. """ - deactivatedAt: DateTime + id: UUID! + """ - The optional profile image associated with the Holaplex organization, which can be used to visually represent the organization. + The invitations to join the Holaplex organization that have been sent to email addresses and are either awaiting or have been accepted by the recipients. """ - profileImageUrlOriginal: String + invites(status: InviteStatus): [Invite!]! + """ The members who have been granted access to the Holaplex organization, represented by individuals who have been invited and accepted the invitation to join the organization. """ members: [Member!] + + """ + The name given to the Holaplex organization, which is used to identify it within the Holaplex ecosystem and to its members and users. + """ + name: String! + """ The owner of the Holaplex organization, who has created the organization and has full control over its settings and members. """ owner: Owner + profileImageUrl: String + """ - The invitations to join the Holaplex organization that have been sent to email addresses and are either awaiting or have been accepted by the recipients. + The optional profile image associated with the Holaplex organization, which can be used to visually represent the organization. """ - invites(status: InviteStatus): [Invite!]! + profileImageUrlOriginal: String + """ The projects that have been created and are currently associated with the Holaplex organization, which are used to organize NFT campaigns or initiatives within the organization. """ projects: [Project!]! - profileImageUrl: String - """ - Retrieves a list of all webhooks associated with the organization. + """ + Retrieves a specific webhook associated with the organization, based on its ID. + # Arguments - + * `ctx` - The context object representing the current request. - + * `id` - The UUID of the Webhook to retrieve. + # Returns - - A vector of all Webhook objects associated with the Organization, or None if there are none. - + + The specified Webhook object, or None if it does not exist. + # Errors - + This function will return an error if the data context cannot be retrieved. """ - webhooks: [Webhook!] - """ - Retrieves a specific webhook associated with the organization, based on its ID. + webhook(id: UUID!): Webhook + """ + Retrieves a list of all webhooks associated with the organization. + # Arguments - + * `ctx` - The context object representing the current request. - * `id` - The UUID of the Webhook to retrieve. - + # Returns - - The specified Webhook object, or None if it does not exist. - + + A vector of all Webhook objects associated with the Organization, or None if there are none. + # Errors - + This function will return an error if the data context cannot be retrieved. """ - webhook(id: UUID!): Webhook + webhooks: [Webhook!] } """ The owner of the Holaplex organization, who is the individual that created the organization. """ type Owner { - """ - The ID of the user who created the Holaplex organization and serves as its owner. - """ - userId: UUID! - """ - The user identity associated with the owner of the organization. - """ - user: User + """The datetime, in UTC, when the organization was created.""" + createdAt: DateTime! + """ The unique identifier assigned to the record of the user who created the Holaplex organization and serves as its owner, which is used to distinguish their record from other records within the Holaplex ecosystem. """ id: UUID! + + """The Holaplex organization owned by the user.""" + organization: Organization + """ The ID assigned to the Holaplex organization owned by the user, which is used to distinguish it from other organizations within the Holaplex ecosystem." """ organizationId: UUID! + + """The user identity associated with the owner of the organization.""" + user: User + """ - The datetime, in UTC, when the organization was created. - """ - createdAt: DateTime! - """ - The Holaplex organization owned by the user. + The ID of the user who created the Holaplex organization and serves as its owner. """ - organization: Organization + userId: UUID! } -""" -Input object for patching a drop and associated collection by ID -""" +"""Input object for patching a drop and associated collection by ID""" input PatchDropInput { - """ - The unique identifier of the drop - """ + """The creators of the drop""" + creators: [CollectionCreatorInput!] + + """The new end time for the drop in UTC""" + endTime: DateTime + + """The unique identifier of the drop""" id: UUID! - """ - The new price for the drop in the native token of the blockchain - """ + + """The new metadata JSON for the drop""" + metadataJson: MetadataJsonInput + + """The new price for the drop in the native token of the blockchain""" price: Int - """ - The new start time for the drop in UTC - """ - startTime: DateTime - """ - The new end time for the drop in UTC - """ - endTime: DateTime - """ - The new seller fee basis points for the drop - """ + + """The new seller fee basis points for the drop""" sellerFeeBasisPoints: Int - """ - The new metadata JSON for the drop - """ - metadataJson: MetadataJsonInput - """ - The creators of the drop - """ - creators: [CollectionCreatorInput!] -} -""" -Represents the result of a successful patch drop mutation. -""" + """The new start time for the drop in UTC""" + startTime: DateTime +} + +"""Represents the result of a successful patch drop mutation.""" type PatchDropPayload { - """ - The drop that has been patched. - """ + """The drop that has been patched.""" drop: Drop! } -""" -Represents input fields for pausing a drop. -""" +"""Represents input fields for pausing a drop.""" input PauseDropInput { drop: UUID! } -""" -Represents the result of a successful pause drop mutation. -""" +"""Represents the result of a successful pause drop mutation.""" type PauseDropPayload { - """ - The drop that has been paused. - """ + """The drop that has been paused.""" drop: Drop! } @@ -1396,148 +1260,132 @@ type PauseDropPayload { A Holaplex project that belongs to an organization. Projects are used to group unique NFT campaigns or initiatives, and are used to assign objects that end customers will interact with, such as drops and wallets. """ type Project { - """ - The unique identifier assigned to the Holaplex project. - """ - id: UUID! - """ - Retrieve a customer record associated with the project, using its ID. - """ + """The datetime, in UTC, when the project was created.""" + createdAt: DateTime! + + """Retrieve a customer record associated with the project, using its ID.""" customer(id: UUID!): Customer - """ - Retrieve all customer records associated with a given project. - """ + + """Retrieve all customer records associated with a given project.""" customers: [Customer!] + """ - The drops associated with the project. - """ - drops: [Drop!] - """ - Look up a drop associated with the project by its ID. + The date and time in Coordinated Universal Time (UTC) when the Holaplex project was created. Once a project is deactivated, objects that were assigned to the project can no longer be interacted with. """ + deactivatedAt: DateTime + + """Look up a drop associated with the project by its ID.""" drop(id: UUID!): Drop + + """The drops associated with the project.""" + drops: [Drop!] + + """The unique identifier assigned to the Holaplex project.""" + id: UUID! + """ The friendly name assigned to the Holaplex project to differentiate it from other projects belonging to the organization. """ name: String! - """ - The ID of the Holaplex organization to which the project belongs. - """ + organization: Organization + + """The ID of the Holaplex organization to which the project belongs.""" organizationId: UUID! - """ - The datetime, in UTC, when the project was created. - """ - createdAt: DateTime! - """ - The date and time in Coordinated Universal Time (UTC) when the Holaplex project was created. Once a project is deactivated, objects that were assigned to the project can no longer be interacted with. - """ - deactivatedAt: DateTime + profileImageUrl: String + """ The optional profile image associated with the project, which can be used to visually represent the project. """ profileImageUrlOriginal: String - organization: Organization - profileImageUrl: String + """ The treasury assigned to the project, which contains the project's wallets. """ treasury: Treasury } -""" -Represents the purchase of an NFT. -""" +"""Represents the purchase of an NFT.""" type Purchase { - """ - The ID of the purchase. - """ + """The date and time when the purchase was created.""" + createdAt: DateTime! + + """The ID of the drop that facilitated the purchase, if any.""" + dropId: UUID + + """The ID of the purchase.""" id: UUID! - """ - The ID of the NFT being purchased. - """ + + """The ID of the NFT being purchased.""" mintId: UUID! - """ - The ID of the drop that facilitated the purchase, if any. - """ - dropId: UUID - """ - The wallet address of the buyer. - """ - wallet: String! - """ - The amount spent on the purchase. - """ + + """The amount spent on the purchase.""" spent: Int! - """ - The signature of the transaction, if any. - """ - txSignature: String - """ - The status of the creation of the NFT. - """ + + """The status of the creation of the NFT.""" status: CreationStatus! - """ - The date and time when the purchase was created. - """ - createdAt: DateTime! + + """The signature of the transaction, if any.""" + txSignature: String + + """The wallet address of the buyer.""" + wallet: String! } type Query { + collections: [CollectionMint] + """ Returns a list of `ActionCost` which represents the cost of each action on different blockchains. - + # Errors This function fails if it fails to get `CreditsClient` or if blockchain enum conversion fails. """ creditSheet: [ActionCost!]! + drop: Drop + """ - Retrieve a user identity by providing their ID. + Returns a list of event types that an external service can subscribe to. + + # Returns + + A vector of EventType objects representing the different event types that can be subscribed to. + + # Errors + + This function returns an error if there was a problem with retrieving the event types. """ - user(id: UUID!): User + eventTypes: [EventType!]! + + """Retrieve a member invitation by its ID.""" + invite(id: UUID!): Invite + me: User + """ Query an organization by its ID, this query returns `null` if the organization does not exist. """ organization(id: UUID!): Organization + """ Query a project by it's ID, this query returns `null` if the project does not exist. """ project(id: UUID!): Project - """ - Retrieve a member invitation by its ID. - """ - invite(id: UUID!): Invite - """ - Returns a list of event types that an external service can subscribe to. - - # Returns - - A vector of EventType objects representing the different event types that can be subscribed to. - - # Errors - This function returns an error if there was a problem with retrieving the event types. - """ - eventTypes: [EventType!]! + """Retrieve a user identity by providing their ID.""" + user(id: UUID!): User } input ReactivateMemberInput { id: UUID! } -""" -Represents input fields for resuming a paused drop. -""" +"""Represents input fields for resuming a paused drop.""" input ResumeDropInput { drop: UUID! } -""" -Represents the result of a successful resume drop mutation. -""" +"""Represents the result of a successful resume drop mutation.""" type ResumeDropPayload { - """ - The drop that has been resumed. - """ + """The drop that has been resumed.""" drop: Drop! } @@ -1552,27 +1400,19 @@ input RetryMintInput { id: UUID! } -""" -Represents payload data for `retry_mint` mutation -""" +"""Represents payload data for `retry_mint` mutation""" type RetryMintPayload { collectionMint: CollectionMint! } -""" -Represents the input fields for shutting down a drop -""" +"""Represents the input fields for shutting down a drop""" input ShutdownDropInput { drop: UUID! } -""" -Represents the result of a successful shutdown drop mutation -""" +"""Represents the result of a successful shutdown drop mutation""" type ShutdownDropPayload { - """ - Drop that has been shutdown - """ + """Drop that has been shutdown""" drop: Drop! } @@ -1589,63 +1429,24 @@ type TransferAssetPayload { A collection of wallets assigned to different entities in the Holaplex ecosystem. """ type Treasury { - """ - The unique identifier for the treasury. - """ + """The creation DateTimeWithTimeZone of the vault.""" + createdAt: DateTime! + + """The unique identifier for the treasury.""" id: UUID! + """ The associated Fireblocks vault ID. ## Reference [Vault Objects](https://docs.fireblocks.com/api/#vault-objects) """ vaultId: String! - """ - The creation DateTimeWithTimeZone of the vault. - """ - createdAt: DateTime! - """ - The treasury's associated wallets. - """ - wallets: [Wallet!] - """ - Lookup a wallet based on its `asset_type`. - """ + + """Lookup a wallet based on its `asset_type`.""" wallet(assetType: AssetType!): Wallet -} -""" -A unique user identity across the entire Holaplex ecosystem. A user can be associated with multiple organizations, but they are not required to have separate login credentials. -""" -type User { - """ - The unique identifier for the user identity. - """ - id: UUID! - """ - The first name of the user identity. - """ - firstName: String! - """ - The last name of the user identity. - """ - lastName: String! - """ - The email address associated with the user identity. - """ - email: String! - """ - The profile image associated with the user identity. - """ - profileImage: String - """ - The timestamp in UTC when the user identity was created. - """ - createdAt: String! - """ - The timestamp in UTC when the user identity was last updated. - """ - updatedAt: String! - affiliations: [Affiliation!]! + """The treasury's associated wallets.""" + wallets: [Wallet!] } """ @@ -1660,80 +1461,98 @@ entities without requiring a central allocating authority. """ scalar UUID +""" +A unique user identity across the entire Holaplex ecosystem. A user can be associated with multiple organizations, but they are not required to have separate login credentials. +""" +type User { + affiliations: [Affiliation!]! + + """The timestamp in UTC when the user identity was created.""" + createdAt: String! + + """The email address associated with the user identity.""" + email: String! + + """The first name of the user identity.""" + firstName: String! + + """The unique identifier for the user identity.""" + id: UUID! + image: String + + """The last name of the user identity.""" + lastName: String! + name: String + + """The profile image associated with the user identity.""" + profileImage: String + + """The timestamp in UTC when the user identity was last updated.""" + updatedAt: String! + wallet: Wallet +} + """ A blockchain wallet is a digital wallet that allows users to securely store, manage, and transfer their cryptocurrencies or other digital assets on a blockchain network. """ type Wallet { - """ - The wallet address. - """ + """The wallet address.""" address: String + + """The wallet's associated blockchain.""" + assetId: AssetType! + createdAt: DateTime! + createdBy: UUID! + deductionId: UUID + id: UUID! + """ The NFTs that were minted from Holaplex and are owned by the wallet's address. """ mints: [CollectionMint!] - treasuryId: UUID! - createdAt: DateTime! removedAt: DateTime - createdBy: UUID! - """ - The wallet's associated blockchain. - """ - assetId: AssetType! - id: UUID! - deductionId: UUID + treasuryId: UUID! } """ A webhook represents an endpoint registered to receive notifications for specific events within a project. """ type Webhook { - """ - Retrieves the ID of the user who created the webhook. - """ - createdById: UUID! - """ - The user who created the webhook. - """ - createdBy: User - """ - Retrieves the ID of the webhook. - """ - id: UUID! - """ - Retrieves the channels the webhook is subscribed to. - """ + """Retrieves the channels the webhook is subscribed to.""" channels: [String!]! - """ - This field specifies the list of projects for which an associated object will trigger a webhook event. - """ - projects: [Project!]! - """ - Retrieves the ID of the webhook's endpoint. - """ + + """Retrieves the creation datetime of the webhook.""" + createdAt: NaiveDateTime! + + """The user who created the webhook.""" + createdBy: User + + """Retrieves the ID of the user who created the webhook.""" + createdById: UUID! + + """Retrieves the webhook's description.""" + description: String! + + """Retrieves the ID of the webhook's endpoint.""" endpointId: String! - """ - Retrieves the URL of the webhook's endpoint. - """ - url: String! - """ - Retrieves the events the webhook is subscribed to. - """ + + """Retrieves the events the webhook is subscribed to.""" events: [FilterType!]! - """ - Retrieves the webhook's description. - """ - description: String! - """ - Retrieves the creation datetime of the webhook. - """ - createdAt: NaiveDateTime! - """ - Retrieves the ID of the organization the webhook belongs to. - """ + + """Retrieves the ID of the webhook.""" + id: UUID! + + """Retrieves the ID of the organization the webhook belongs to.""" organizationId: UUID! + """ - Retrieves the last update datetime of the webhook. + This field specifies the list of projects for which an associated object will trigger a webhook event. """ + projects: [Project!]! + + """Retrieves the last update datetime of the webhook.""" updatedAt: NaiveDateTime -} + + """Retrieves the URL of the webhook's endpoint.""" + url: String! +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 5123869..51dc7f4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35,6 +35,7 @@ "ramda": "^0.28.0", "react": "^18.2.0", "react-dom": "18.2.0", + "react-hook-form": "^7.45.0", "react-spinners": "^0.13.8", "react-toastify": "^9.1.3" }, @@ -11191,6 +11192,21 @@ "react": "^18.2.0" } }, + "node_modules/react-hook-form": { + "version": "7.45.0", + "resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.45.0.tgz", + "integrity": "sha512-AbHeZ4ad+0dEIknSW9dBgIwcvRDfZ1O97sgj75WaMdOX0eg8TBiUf9wxzVkIjZbk76BBIE9lmFOzyD4PN80ZQg==", + "engines": { + "node": ">=12.22.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/react-hook-form" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17 || ^18" + } + }, "node_modules/react-is": { "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", @@ -20660,6 +20676,12 @@ "scheduler": "^0.23.0" } }, + "react-hook-form": { + "version": "7.45.0", + "resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.45.0.tgz", + "integrity": "sha512-AbHeZ4ad+0dEIknSW9dBgIwcvRDfZ1O97sgj75WaMdOX0eg8TBiUf9wxzVkIjZbk76BBIE9lmFOzyD4PN80ZQg==", + "requires": {} + }, "react-is": { "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", diff --git a/package.json b/package.json index eccab3b..cfb45f5 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ "ramda": "^0.28.0", "react": "^18.2.0", "react-dom": "18.2.0", + "react-hook-form": "^7.45.0", "react-spinners": "^0.13.8", "react-toastify": "^9.1.3" }, diff --git a/src/app/Home.tsx b/src/app/Home.tsx index 60d74da..36c1267 100644 --- a/src/app/Home.tsx +++ b/src/app/Home.tsx @@ -184,7 +184,7 @@ export default function Home({ session }: HomeProps) { owns ? (
- + NFT claimed!
- Wallet address + Wallet address
{shorten(me?.wallet?.address as string)} @@ -69,6 +69,12 @@ export default function Collectibles() { {mint.metadataJson?.name} + + Transfer +
) )} diff --git a/src/app/collectibles/[collectible]/transfer/Transfer.tsx b/src/app/collectibles/[collectible]/transfer/Transfer.tsx new file mode 100644 index 0000000..cee6d83 --- /dev/null +++ b/src/app/collectibles/[collectible]/transfer/Transfer.tsx @@ -0,0 +1,125 @@ +'use client'; + +import { ApolloError, useMutation } from '@apollo/client'; +import { + TransferAssetInput, + TransferAssetPayload +} from '../../../../graphql.types'; +import { TransferAsset } from '../../../../mutations/transfer.graphql'; +import { useState } from 'react'; +import { useRouter } from 'next/navigation'; +import { useForm } from 'react-hook-form'; +import { Icon } from '../../../../components/Icon'; + +interface TransferAssetData { + transferAsset: TransferAssetPayload; +} + +interface TransferAssetVars { + input: TransferAssetInput; +} + +interface TransferForm { + wallet: string; +} + +export default function Transfer({ collectible }: { collectible: string }) { + const router = useRouter(); + const [nftSent, setNftSent] = useState(false); + + const { register, handleSubmit, formState, setError } = + useForm(); + + const [transferAsset, transferAssetResult] = useMutation< + TransferAssetData, + TransferAssetVars + >(TransferAsset); + + const submit = async ({ wallet }: TransferForm) => { + if (!wallet) return; + transferAsset({ + variables: { + input: { + id: collectible, + recipient: wallet + } + }, + onError: (error: ApolloError) => { + console.log('Error', error); + setError('root', { message: error.message }); + }, + onCompleted: () => { + setNftSent(true); + } + }); + }; + + const close = () => { + router.push('/collectibles'); + }; + + return ( +
+

+ Send this NFT to a Solana wallet +

+ {!nftSent ? ( +
+ + + {formState.errors.wallet?.message && ( + + {formState.errors.wallet?.message} + + )} + {formState.errors.root?.message && ( + + {formState.errors.root?.message} + + )} +
+ + +
+
+ ) : ( + <> + + NFT sent! It should be available in the destination wallet in just a + few moments. + + + + )} +
+ ); +} diff --git a/src/app/collectibles/[collectible]/transfer/page.tsx b/src/app/collectibles/[collectible]/transfer/page.tsx new file mode 100644 index 0000000..3218295 --- /dev/null +++ b/src/app/collectibles/[collectible]/transfer/page.tsx @@ -0,0 +1,15 @@ +import Transfer from './Transfer'; + +interface TransferPageProps { + params: { collectible: string }; +} + +export default function TransferPage({ + params: { collectible } +}: TransferPageProps): React.ReactNode { + return ( +
+ +
+ ); +} diff --git a/src/app/collectibles/default.tsx b/src/app/collectibles/default.tsx new file mode 100644 index 0000000..6ddf1b7 --- /dev/null +++ b/src/app/collectibles/default.tsx @@ -0,0 +1,3 @@ +export default function Default() { + return null; +} diff --git a/src/components/Icon.tsx b/src/components/Icon.tsx index 7414dc8..55eec83 100644 --- a/src/components/Icon.tsx +++ b/src/components/Icon.tsx @@ -6,6 +6,76 @@ export function Icon() { return
; } +function Loading({ className }: IconProps) { + return ( + + + + + + + + + + + ); +} +Icon.Loading = Loading; + function Success({ className }: IconProps) { return ( ; /** The blockchain of the collection. */ blockchain: Blockchain; @@ -183,8 +187,12 @@ export type CollectionCreatorInput = { /** Represents a single NFT minted from a collection. */ export type CollectionMint = { __typename?: 'CollectionMint'; - /** The wallet address of the NFT. */ - address: Scalars['String']; + /** + * The address of the NFT + * On Solana this is the mint address. + * On EVM chains it is the concatenation of the contract address and the token id `{contractAddress}:{tokenId}`. + */ + address?: Maybe; /** The collection the NFT was minted from. */ collection?: Maybe; /** The ID of the collection the NFT was minted from. */ @@ -575,7 +583,7 @@ export type Holder = { /** The collection ID that the holder owns. */ collectionId: Scalars['UUID']; /** The specific mints from the collection that the holder owns. */ - mints: Array; + mints: Array; /** The number of NFTs that the holder owns in the collection. */ owns: Scalars['Int']; }; @@ -1771,7 +1779,7 @@ export type CollectionCreatorResolvers = { - address?: Resolver; + address?: Resolver, ParentType, ContextType>; collection?: Resolver, ParentType, ContextType>; collectionId?: Resolver; createdAt?: Resolver; @@ -1935,7 +1943,7 @@ export type EventTypeResolvers = { address?: Resolver; collectionId?: Resolver; - mints?: Resolver, ParentType, ContextType>; + mints?: Resolver, ParentType, ContextType>; owns?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; diff --git a/src/mutations/transfer.graphql b/src/mutations/transfer.graphql new file mode 100644 index 0000000..e0e9464 --- /dev/null +++ b/src/mutations/transfer.graphql @@ -0,0 +1,8 @@ +mutation TransferAsset($input: TransferAssetInput!) { + transferAsset(input: $input) { + mint { + address + owner + } + } +} diff --git a/tailwind.config.js b/tailwind.config.js index 99355b9..a0cde42 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -7,7 +7,11 @@ module.exports = { cta: '#F6D357', backdrop: '#1A1A1D', contrast: ' #212122', - subtletext: '#BDBDBD' + neautraltext: '#BDBDBD', + subtletext: '#AAAAAA', + cellsubtle: '#2B2B2B', + success: '#628E36', + failure: '#E4584F' } } },