Step 2 - Curate Credentials
Supported Credential Data Sourcesโ
Currently we support curating credentials through multiple data sources:
- CSV file
- Subgraph endpoint
- GraphQL endpoint
- REST endpoint
CSV Credential Fileโ
Via Galaxy Dashboardโ
- The user can see and select all credentials from any user while creating the space campaign, but on the โCredentialโ - โMy Credential Listโ page, the user can only see and edit their own created credential list.
- The user can download the existing whitelist file
- The user can easily upload addresses in batches at once with the following file requirements:
- The file needs to be CSV format (Without Comma)
- Each address must not be duplicated
- The file should not contain headers
- The user can also create a reference link for credentials as needed.
Create/edit CSV Credentialsโ
- Click "Credential" to go to "My Credential List" page
- Click "Create New Credential"
- Fill up the Credential Title
- Select the deployed Network
- Upload the CSV file
- Error Alert if CSV file contained duplicated address and invalid address
- Fill up the Credential Description
- Fill up the reference link (If needed)
- Click "Create"
- Confirm to create the Credential by clicking "Sign" on the signature request
- Made a mistake? No worries! You can always come back to edit the credentials that you have created
Or check out this video for instructions: https://youtu.be/EeE2Ngv7oEo
Via credential update APIโ
Alternatively, you can call our credential API to skip the manual steps in the dashboard.
More info here
Subgraph/GraphQL Credential Endpointโ
๐ก We are adding Galaxy dashboard support to create subgraph Credentials in a self-serve fashion. Before that, please contact Galaxy team for assistance.
Subgraph and GraphQL typed Credentials consist of: endpoint, query, expression, and header. The only difference being subgraph is specific to the subgraphs hosted on thegraph. Galaxy will send query
to the endpoint
with header
, and process the returned data with expression
. For example:
endpoint:
https://api.xxx.com/cred/
header:
{"Authorization": "key"}
query:
query getEligibility($address: String!) {
campaignEligibility(address: $address) {
eligible
}
}
expression:
function(data){
if(data != null && data.campaignEligibility != null && data.campaignEligibility.eligible) {
return 1
}
return 0
}
When expression
returns 1, the address we checked is now confirmed to have this credential.
REST Credential Endpointโ
A REST typed credential endpoint consists of three parts: endpoint, header and expression. Similar to subgraph/graphql, Galaxy will send a GET
request to the endpoint
with header
, and process the returned data with expression
. For example:
endpoint ($address
will be swapped out with the wallet address we need to check):
https://api.xxx.com/cred/address=$address
header:
{"Authorization": "key"}
expression:
function(data){
if(data != null && data.campaignEligibility != null && data.campaignEligibility.eligible) {
return 1
}
return 0
}
When expression
returns 1, the address we checked is now confirmed to have this credential.