-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from holaplex/jul-27-release
Jul 27 release
- Loading branch information
Showing
5 changed files
with
287 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>", | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
|
||
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":"<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`). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
|
||
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": "<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>" | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
sidebar_position: 6 | ||
sidebar_position: 8 | ||
--- | ||
|
||
# Webhooks Overview | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters