Skip to content

Commit

Permalink
Merge pull request #48 from holaplex/jul-27-release
Browse files Browse the repository at this point in the history
Jul 27 release
  • Loading branch information
mackenziewildman authored Jul 28, 2023
2 parents ccfaa67 + 031fcc7 commit cc83080
Show file tree
Hide file tree
Showing 5 changed files with 287 additions and 1 deletion.
62 changes: 62 additions & 0 deletions docs/hub/Guides/transfer-out-of-hub-wallet.md
Original file line number Diff line number Diff line change
@@ -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": "<access-token>"
}
```

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": "<mint-id>",
"recipient":"<destination-wallet-address>"
}
}
```

### Response

```json
{
"data": {
"transferAsset": {
"mint": {
"id": "<mint-id>",
"address": "<token-address>",
}
}
}
}
```


87 changes: 87 additions & 0 deletions docs/hub/developers/create-collection-api.md
Original file line number Diff line number Diff line change
@@ -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:

&nbsp; a. Log into [Hub](https://hub.holaplex.com/)

&nbsp; b. On your organization's page, open the "Credentials" tab

&nbsp; 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":"<PROJECT_ID>",
"blockchain": "SOLANA",
"creators":[
{
"address": "<CREATOR_WALLET_ADDRESS>",
"share": 100,
"verified": false
}
],
"metadataJson": {
"name": "Collection name",
"symbol": "SYMBOL",
"description": "Collection description",
"image": "<LINK_TO_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": "<PROJECT_ID>",
"collection": "<COLLECTION_ID>"
}
```

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`).
114 changes: 114 additions & 0 deletions docs/hub/developers/mint-to-collection-api.md
Original file line number Diff line number Diff line change
@@ -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:

&nbsp; a. Log into [Hub](https://hub.holaplex.com/)

&nbsp; b. On your organization's page, open the "Credentials" tab

&nbsp; 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": "<COLLECTION_ID>",
"recipient": "<RECIPIENT_WALLET_ADDRESS>",
"compressed": false,
"creators":[
{
"address": "<CREATOR_WALLET_ADDRESS>",
"share": 100,
"verified": false
}
],
"metadataJson": {
"name": "Token name",
"symbol": "SYMBOL",
"description": "Token description",
"image": "<LINK_TO_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": "<PROJECT_ID>",
"collection": "<COLLECTION_ID>"
}
```

## 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":"<MINT_ID>"
}
}
```
2 changes: 1 addition & 1 deletion docs/hub/developers/webhooks-overview.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 6
sidebar_position: 8
---

# Webhooks Overview
Expand Down
23 changes: 23 additions & 0 deletions docs/hub/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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*
Expand Down

0 comments on commit cc83080

Please sign in to comment.