diff --git a/docs/hub/Guides/transfer-out-of-hub-wallet.md b/docs/hub/Guides/transfer-out-of-hub-wallet.md new file mode 100644 index 0000000..f09a0ca --- /dev/null +++ b/docs/hub/Guides/transfer-out-of-hub-wallet.md @@ -0,0 +1,62 @@ +--- +sidebar_position: 7 +--- + +# Transferring a token out of a Hub wallet + +In this guide, we'll use Hub API to transfer a Hub-minted token out of a Hub wallet. We'll add corresponding UI to our starter mint repos. The feature is available now via Hub API. + +## Prerequisites + +- A token minted out of a drop within [Holaplex Hub](https://hub.holaplex.com/) or via Hub API +- Access to the Holaplex Hub GraphQL API (an access token can be generated on Hub's "Credentials" page) +- Hub API Playground: [https://api.holaplex.com](https://api.holaplex.com/). You could also use a GraphQL client such as [Apollo Client](https://www.apollographql.com/client/) or a tool like [GraphQL Playground](https://github.com/graphql/graphql-playground) +- + +For all API requests to Hub, you'll need to include an authentication header of the form +``` + { + "Authorization": "" + } +``` + +The first step is creating a customer associated to a project in Hub. To do this, you need to send a `createCustomer` mutation with the required input parameters. + +## Mutation +```graphql +mutation TransferAsset($input:TransferAssetInput!) { + transferAsset(input:$input) { + mint { + id + address + } + } +} +``` + +### Variables +```json +{ + "input": { + "id": "", + "recipient":"" + } +} +``` + +### Response + +```json +{ + "data": { + "transferAsset": { + "mint": { + "id": "", + "address": "", + } + } + } +} +``` + + diff --git a/docs/hub/developers/create-collection-api.md b/docs/hub/developers/create-collection-api.md new file mode 100644 index 0000000..81652c5 --- /dev/null +++ b/docs/hub/developers/create-collection-api.md @@ -0,0 +1,87 @@ +--- +sidebar_position: 6 +--- + +Creating a Collection via API +============ + +Hub's API can be used to create a verified collection and then mint a token into that collection, on both Solana and Polygon. + +## Step 1: Authenticate + +All API calls need a header of the form +```json + { "Authorization": "Your_API_Token" } +``` + +To get an API token: + +   a. Log into [Hub](https://hub.holaplex.com/) + +   b. On your organization's page, open the "Credentials" tab + +   c. Click "Generate token" + + ## Step 2: GraphQL mutation + + A sample `createCollection` mutation: + ```graphql + mutation CreateCollection($input: CreateCollectionInput!) { + createCollection(input: $input) { + collection { + id + creationStatus + } + } + } + ``` + Variables: + ```json + { + "input": { + "project":"", + "blockchain": "SOLANA", + "creators":[ + { + "address": "", + "share": 100, + "verified": false + } + ], + "metadataJson": { + "name": "Collection name", + "symbol": "SYMBOL", + "description": "Collection description", + "image": "", + "attributes": [] + } + } +} + ``` + + Note the `creator` field `verified` can only be set to `true` when the creator is the treasury wallet. Otherwise, the `creator` input must have `"verified": false`. + + ## Step 3: Check status of collection creation + + To view the status of a collection created by the steps above, use the new collection's `id` that is returned when creating the collection to query: + ```graphql + query GetCollectionStatus($project: UUID!, $collection:UUID!) { + project(id: $project) { + id + name + collection(id: $collection) { + id + creationStatus + } + } + } + ``` + Variables: + ```json + { + "project": "", + "collection": "" + } + ``` + + Note that collections following these steps are assigned to a `project`. By default, each new `drop` is assigned a `collection` - _these_ collections can be queried under `drops` (`drops` are under `projects`). \ No newline at end of file diff --git a/docs/hub/developers/mint-to-collection-api.md b/docs/hub/developers/mint-to-collection-api.md new file mode 100644 index 0000000..6d5a3eb --- /dev/null +++ b/docs/hub/developers/mint-to-collection-api.md @@ -0,0 +1,114 @@ +--- +sidebar_position: 7 +--- + +Minting to a Collection via API +============ + +Hub's API can be used to create a verified collection on Solana and then mint a token into that collection, compressed or uncompressed. + +## Step 1: Authenticate + +All API calls need a header of the form +``` + { "Authorization": "Your_API_Token" } +``` + +To get an API token: + +   a. Log into [Hub](https://hub.holaplex.com/) + +   b. On your organization's page, open the "Credentials" tab + +   c. Click "Generate token" + + ## Step 2: GraphQL mutation + + A sample `mintToCollection` mutation: + ``` + mutation MintToCollection($input: MintToCollectionInput!) { + mintToCollection(input: $input) { + collectionMint { + id + creationStatus + compressed + } + } + } + ``` + Variables: + ``` + { + "input": { + "collection": "", + "recipient": "", + "compressed": false, + "creators":[ + { + "address": "", + "share": 100, + "verified": false + } + ], + "metadataJson": { + "name": "Token name", + "symbol": "SYMBOL", + "description": "Token description", + "image": "", + "attributes": [] + } + } + } + ``` + + Note the `creator` field `verified` can only be set to `true` when the creator is the project treasury wallet. Otherwise, the `creator` input must have `"verified": false`. + + ## Step 3: Check status of collection mint + + To view the status of a collection mint created by the steps above, use the collection's `id`: + ``` + query GetCollectionMintStatus($project: UUID!, $collection:UUID!) { + project(id: $project) { + id + name + collection(id: $collection) { + id + creationStatus, + mints { + id, + creationStatus + } + } + } + } + ``` + Variables: + ``` + { + "project": "", + "collection": "" + } + ``` + + ## Step 4: Retry a failed mint + + To retry a mint from collection that has failed, use the `retryMintToCollection` mutation: + ``` + mutation RetryMintToCollection($input: RetryMintEditionInput!) { + retryMintToCollection(input: $input) { + collectionMint { + id + creationStatus + compressed + } + } + } + ``` + Variables: + ``` + { + "input": { + "id":"" + } + } +``` \ No newline at end of file diff --git a/docs/hub/developers/webhooks-overview.md b/docs/hub/developers/webhooks-overview.md index c4404f2..a20d5dc 100644 --- a/docs/hub/developers/webhooks-overview.md +++ b/docs/hub/developers/webhooks-overview.md @@ -1,5 +1,5 @@ --- -sidebar_position: 6 +sidebar_position: 8 --- # Webhooks Overview diff --git a/docs/hub/release-notes.md b/docs/hub/release-notes.md index 50cf191..deed014 100644 --- a/docs/hub/release-notes.md +++ b/docs/hub/release-notes.md @@ -4,6 +4,29 @@ sidebar_position: 7 # Release Notes +## July 27, 2023 + +Features: + +- [Create collections](./developers/create-collection-api.md) (MCC on Solana) - `createCollection` mutation +- [Mint 1:1's to collections](./developers/mint-to-collection-api.md) - `mintToCollection` mutation +- Import collection (MCC on Solana) - `ImportSolanaCollection` mutation +- [Mint compressed NFTs](./developers/mint-to-collection-api.md) (set `"compressed": true` in `mintToCollection` mutation) + +Fixes: + +- Mutations `retryDrop` and `retryMint` now reset the drop/mint status +- Email verification + +## July 6, 2023 + +Features: + +- [Transfer tokens out of Hub-created wallets](./Guides/transfer-out-of-hub-wallet.md) + - Hub verifies before charging that the NFT to be transferred was created by Hub + - When someone transfer a token, we charge credits immediately + - Hub will show a token as transferred once the on-chain transaction is complete + ## June 27, 2023 *Polygon support is here*