This website acts as an editor for the Solana Data Program V0. It allows the user to view/edit the data and associated metadata for a given Data Account or upload your own file using the Solana Data Program
-
Quine NFT: This NFT was uploaded and managed completely by SolD
-
Quine NFT Image: This screen showcases the
HTML
image data of the Quine NFT image that uploaded using SolD -
Quine NFT Metadata: This screen showcases the
JSON
metadata of the Quine NFT that uploaded using SolD -
Authority page: This screen showcases the various data accounts that belong to the authority
PublicKey
- Select the Solana cluster (
Mainnet Beta
,Devnet
,Testnet
,Custom
) on the top right - To view the details regarding the Data Account:
- Enter the
PublicKey
of the data account in the search bar and search for it - Navigate to
/<Data Account PublicKey>?cluster=<Cluster Name>
- Enter the
- If the Data Account is valid, you should be able to view the metadata associated with the Data Account like its
Authority
,Data Status
,Serialization Status
, etc., and itsData
will be displayed in the format as specified by theData Type
- On error, you will be met with an informative error message
- Select the Solana cluster (
Mainnet Beta
,Devnet
,Testnet
,Custom
) on the top right - To access the Upload page:
- Click on the
Get Started!
button on the home page - Search for
upload
in the search bar - Navigate to
/upload
- Click on the
- In the Upload page, you will be met with various options:
- Sign in with your wallet that will act as the
Fee Payer
for the transactions - Enter the
Authority
of the Data Account. Only theAuthority
can make changes to the Data Account - Choose the file you wish to upload
- On uploading the file, the
Data Type
andInitial Size
will autopopulate based on the file, however they can be overridden - If not satisfied with the autopopulated
Data Type
, you may choose a different type - If you wish for the account to not be realloc-ed and remain a static size, leave the
Dynamic/Static
checkbox unchecked - Enter the initial size in bytes to allocate to the Data Account
- Once satisfied with all the options, click on the
Confirm Upload
button to upload the file - You should receive a prompt to sign the transactions
- Once signed, the Data Account will be created (and the created Data Account
PublicKey
will be displayed) and initialized (with the PDA) and finally the file would be uploaded in chunks together. You should be able to track the progress via the progress bar - Once the upload is complete, you can navigate to the link to view the Data Account details
- On error, you will be met with an informative error message
- Sign in with your wallet that will act as the
- Go to the Data Account details page
- Choose the
Data Type
you wish to set - Click on the Edit button and make changes
- Once satisfied with your changes, click Save
- This will ask you to sign on the transaction if you are logged in as the authority. Otherwise, it will display an error
- Once the transaction goes through, the page will reload and you can see the changes being reflected
- Enter
authority/<Authority PublicKey>
in the search bar - This will index the Data Program and return a list of all the data accounts that have given
PublicKey
as theirAuthority
- You can sort by
Data Account
,Data Type
, and/orData Status
- Clicking on a particular Data Account will take you to its Data Account details page
- If you are logged in as the authority:
- You can individually Finalize the data or Close the data account to reclaim its SOL
- Alternatively, you can select multiple accounts and finalize/close them all at once by clicking on the
Actions
dropdown button and following the prompts
NOTE: The Finalize action cannot be reverted. Once finalized, the data can no longer be updated.
- Go to the Data Account details page
- Ensure the Data Account
Data Status
is not alreadyFINALIZED
- Click on the
Actions
dropdown button next to theData Status
- Ensure you are logged in as the authority. Otherwise, the button will be disabled
- Once logged in as the authority, click on the
Finalize
button - This will open a modal that will ask you to confirm that you want to finalize the data. Click
Yes, I'm sure...
- This will ask you to sign on the transaction if you are logged in as the authority. Otherwise, it will display an error
- Once the transaction goes through, the page will reload and you can see the changes being reflected
NOTE: The Close action cannot be reverted. Once closed, the data account and the associated metadata account will no longer exist.
- Go to the Data Account details page
- Click on the
Actions
dropdown button next to theData Status
- Ensure you are logged in as the authority. Otherwise, the button will be disabled
- Once logged in as the authority, click on the
Close
button - This will open a modal that will ask you to confirm that you want to close the accounts and reclaim SOL. Click
Yes, I'm sure...
- This will ask you to sign on the transaction if you are logged in as the authority. Otherwise, it will display an error
- Once the transaction goes through, the page will reload and you can see the changes being reflected
With the website running, you can also navigate to the following API route(s):
Use this API route to get the associated metadata (extracted from the PDA) for a given Data Account
-
URL
/api/meta/{dataAccount}?cluster={clusterName}
-
Method:
GET
-
URL Params
Required:
dataAccount=<PublicKey>
-
Query String Params
Required:
clusterName=<"Mainnet Beta" | "Devnet" | "Testnet" | "Custom">
-
Success Response:
- Code: 200
Content:{ data_status: DataStatusOption; serialization_status: SerializationStatusOption; authority: string; is_dynamic: boolean; data_version: number; data_type: number; bump_seed: number; }
- Code: 200
-
Error Response:
- Code: 400 BAD REQUEST
Content:{ error: "Invalid Cluster" }
: if the clusterName is invalid OR{ error: "Invalid Data Account PublicKey" }
: if no dataAccount was provided or if the data account is not a valid base58 PublicKey OR{ error: "No metadata corresponding to the Data Account" }
: if the dataAccount PDA does not exist or if it has no metadata
OR
- Code: 405 METHOD NOT ALLOWED
Content:{ error : "Unsupported Method" }
: if the API is accessed by any method other than GET
- Code: 400 BAD REQUEST
-
Sample Call:
fetch( `/api/meta/HoyEJgwKhQG1TPRB2ziBU9uGziwy4f25kDcnKDNgsCkg?cluster=Devnet` ).then((res) => { if (!res.ok) { res.json().then(({ error }: ApiError) => { console.error(error); }); } else { res.json().then((account_meta: IDataAccountMeta) => { console.log(account_meta); }); } });
Use this API route to get the data for a given Data Account.
-
URL
/api/data/{dataAccount}?cluster={clusterName}&ext={mimeType}
-
Method:
GET
-
URL Params
Required:
dataAccount=<PublicKey>
-
Query String Params
Required:
clusterName=<"Mainnet Beta" | "Devnet" | "Testnet" | "Custom">
Optional
mimeType=<any valid MIME type
-
Success Response:
- Code: 200
Content:Buffer;
- Code: 200
-
Error Response:
- Code: 400 BAD REQUEST
Content:{ error: "Invalid Cluster" }
: if the clusterName is invalid OR{ error: "Invalid Data Account PublicKey" }
: if no dataAccount was provided or if the data account is not a valid base58 PublicKey OR{ error: "No data corresponding to the Data Account" }
: if the dataAccount does not exist or if it has no data
OR
- Code: 405 METHOD NOT ALLOWED
Content:{ error : "Unsupported Method" }
: if the API is accessed by any method other than GET
- Code: 400 BAD REQUEST
-
Sample Call:
fetch( `/api/data/HoyEJgwKhQG1TPRB2ziBU9uGziwy4f25kDcnKDNgsCkg?cluster=Devnet&ext=text/html` ).then((res) => { if (!res.ok) { res.json().then(({ error }: ApiError) => { console.error(error); }); } else { res.text().then((data: string) => { console.log(data); }); } });
- Install the dependencies:
npm install
- Run the development server:
npm run dev
- Navigate to http://localhost:3000