From 41b68384e1c7c738559db4ef4e2d04daedcb2556 Mon Sep 17 00:00:00 2001 From: Mackenzie Wildman Date: Wed, 26 Jul 2023 11:59:13 -0700 Subject: [PATCH 1/7] docs for create collection --- docs/hub/developers/create-collection-api.md | 87 ++++++++++++++++++++ docs/hub/developers/webhooks-overview.md | 2 +- 2 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 docs/hub/developers/create-collection-api.md diff --git a/docs/hub/developers/create-collection-api.md b/docs/hub/developers/create-collection-api.md new file mode 100644 index 0000000..05a5c09 --- /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 +``` + { "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: + ``` + mutation CreateCollection($input: CreateCollectionInput!) { + createCollection(input: $input) { + collection { + id + creationStatus + } + } + } + ``` + Variables: + ``` + { + "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: + ``` + query GetCollectionStatus($project: UUID!, $collection:UUID!) { + project(id: $project) { + id + name + collection(id: $collection) { + id + creationStatus + } + } + } + ``` + Variables: + ``` + { + "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/webhooks-overview.md b/docs/hub/developers/webhooks-overview.md index c4404f2..cd61bc6 100644 --- a/docs/hub/developers/webhooks-overview.md +++ b/docs/hub/developers/webhooks-overview.md @@ -1,5 +1,5 @@ --- -sidebar_position: 6 +sidebar_position: 7 --- # Webhooks Overview From d8bd45398fcabdc76a889fe6b3c767b27b59a7a7 Mon Sep 17 00:00:00 2001 From: Mackenzie Wildman Date: Wed, 26 Jul 2023 14:22:05 -0700 Subject: [PATCH 2/7] add page to mint to collection --- docs/hub/developers/mint-to-collection-api.md | 114 ++++++++++++++++++ docs/hub/developers/webhooks-overview.md | 2 +- 2 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 docs/hub/developers/mint-to-collection-api.md 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..d370737 --- /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 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 +``` + { "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 cd61bc6..a20d5dc 100644 --- a/docs/hub/developers/webhooks-overview.md +++ b/docs/hub/developers/webhooks-overview.md @@ -1,5 +1,5 @@ --- -sidebar_position: 7 +sidebar_position: 8 --- # Webhooks Overview From d0552cabcec00bacb2c689c820b0d063a32158e1 Mon Sep 17 00:00:00 2001 From: Mackenzie Wildman Date: Thu, 27 Jul 2023 14:53:52 -0700 Subject: [PATCH 3/7] jul 27 release notes --- docs/hub/release-notes.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/hub/release-notes.md b/docs/hub/release-notes.md index 50cf191..d58aa6b 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 (MCC on Solana) - `createCollection` mutation +- Mint 1:1's to collections - `mintToCollection` mutation +- Import collection (MCC on Solana) - `ImportSolanaCollection` mutation +- Mint compressed NFTs (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 + - 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* From ce57a5cf5b381ae441f34f2cb0c1572086227bdc Mon Sep 17 00:00:00 2001 From: Mackenzie Wildman Date: Thu, 27 Jul 2023 15:03:09 -0700 Subject: [PATCH 4/7] add links to release notes --- docs/hub/release-notes.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/hub/release-notes.md b/docs/hub/release-notes.md index d58aa6b..deed014 100644 --- a/docs/hub/release-notes.md +++ b/docs/hub/release-notes.md @@ -8,10 +8,10 @@ sidebar_position: 7 Features: -- Create collections (MCC on Solana) - `createCollection` mutation -- Mint 1:1's to collections - `mintToCollection` mutation +- [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 (set `"compressed": true` in `mintToCollection` mutation) +- [Mint compressed NFTs](./developers/mint-to-collection-api.md) (set `"compressed": true` in `mintToCollection` mutation) Fixes: @@ -22,7 +22,7 @@ Fixes: Features: -- Transfer tokens out of Hub-created wallets +- [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 From 969be73de628a2a71cc45fd3a95e098c6fb4585f Mon Sep 17 00:00:00 2001 From: Mackenzie Wildman Date: Thu, 27 Jul 2023 15:04:54 -0700 Subject: [PATCH 5/7] add compressed to mint info --- docs/hub/developers/mint-to-collection-api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/hub/developers/mint-to-collection-api.md b/docs/hub/developers/mint-to-collection-api.md index d370737..6d5a3eb 100644 --- a/docs/hub/developers/mint-to-collection-api.md +++ b/docs/hub/developers/mint-to-collection-api.md @@ -5,7 +5,7 @@ sidebar_position: 7 Minting to 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. +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 From 5e046248a23d86c6793b2318a6fd3745330849ea Mon Sep 17 00:00:00 2001 From: Mackenzie Wildman Date: Thu, 27 Jul 2023 15:07:01 -0700 Subject: [PATCH 6/7] add guide for transfer --- docs/hub/Guides/transfer-out-of-hub-wallet.md | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 docs/hub/Guides/transfer-out-of-hub-wallet.md 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": "", + } + } + } +} +``` + + From 031fcc711da83e821de5dd3c86fecf0c27e0a0a5 Mon Sep 17 00:00:00 2001 From: Mackenzie Wildman Date: Thu, 27 Jul 2023 18:00:18 -0700 Subject: [PATCH 7/7] specify code block language --- docs/hub/developers/create-collection-api.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/hub/developers/create-collection-api.md b/docs/hub/developers/create-collection-api.md index 05a5c09..81652c5 100644 --- a/docs/hub/developers/create-collection-api.md +++ b/docs/hub/developers/create-collection-api.md @@ -10,7 +10,7 @@ Hub's API can be used to create a verified collection and then mint a token into ## Step 1: Authenticate All API calls need a header of the form -``` +```json { "Authorization": "Your_API_Token" } ``` @@ -25,7 +25,7 @@ To get an API token: ## Step 2: GraphQL mutation A sample `createCollection` mutation: - ``` + ```graphql mutation CreateCollection($input: CreateCollectionInput!) { createCollection(input: $input) { collection { @@ -36,7 +36,7 @@ To get an API token: } ``` Variables: - ``` + ```json { "input": { "project":"", @@ -64,7 +64,7 @@ To get an API token: ## 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 @@ -77,7 +77,7 @@ To get an API token: } ``` Variables: - ``` + ```json { "project": "", "collection": ""