⛽NEW ERA SPL SOLANA
The code initiates the asynchronous distribution of an SPL token on the 7H platform. Below, you can find the general workflow of the code and the functionality it provides:
Initiating Token Distribution:
The
fetch
library is used to send a POST request to a specific API endpoint on the 7H platform. This request initiates the asynchronous distribution of an SPL token.The request includes information such as the name, symbol, and base URI of the token.
Checking Distribution Status:
The response from the sent request is used to check the status of the distribution process. Initially, the distribution process is started, and a unique identifier called uuid is obtained.
Periodically Checking Distribution Status:
At regular intervals (using
setInterval
), the status of the distribution process is queried from the 7H platform. ThefetchStatus
function asynchronously checks the status of the distribution process.
Displaying Status Updates:
If the distribution process is still ongoing (status: active, delayed, or waiting), the status and any developments are printed to the console.
If the distribution process is completed (status: completed), the status and the address of the deployed contract are printed to the console, and the status polling is stopped (using
clearInterval
).
This code is used to monitor the distribution of SPL tokens on the 7H platform and display the results on the console. For the code to function correctly, a specific API key is required (marked as <<API_KEY>>).
The 7H API offers functionalities for SPL contract deployment and management, encompassing the creation of new SPL contracts, updating token information (e.g., metadata URL), and listing existing token contracts.
7H SPL Model The 7H API employs an SPL model with the following attributes:
Field | Description | Type | Optional |
---|---|---|---|
id | A unique identifier for recognizing the SPL contract within 7H. | string | No |
contract address | A unique identifier for recognizing the SPL contract within the 7H platform and Solana blockchain. | string | No |
name | The token name of the contract. | string | No |
symbol | The token symbol of the contract. | string | No |
base_uri | The base URI of the contract. This should have a trailing slash. The URL for each token is base_uri + token_id. | string | No |
royalty_basis_points | The royalty basis points for the contract. This is the percentage of the sale price that the creator will receive. Example: 1000 basis points correspond to a 10% royalty. | number | Yes |
royalty_address_recipient | The wallet address that will receive the royalty payments. | string | Yes |
max limit | The maximum number of tokens that can be minted. | number | Yes |
transfer_restricted | If true, the tokens are transfer restricted. If false, the tokens are transferable. Default is false. | boolean | Yes |
transfer_allowlist | The list of wallet addresses that are allowed to transfer the tokens. This is only used if transfer_restricted is true. Default is an empty list. | [string] | Yes |
7H SPL API Methods The 7H API provides the following methods for creating and managing SPL tokens:
Deploy New 7H Token:
Method: POST
Description: Deploy a new SPL token with the specified name, symbol, and token parameters.
List 7H Tokens:
Method: GET
Description: Retrieve a list of all SPL contracts within the 7H organization.
Update 7H Token:
Method: PATCH
Description: Update transfer restrictions and base URI for a specific SPL contract.
Mint 7H Token:
Method: POST
Description: Mint a new SPL token to a specified wallet address.
Transfer 7H Token:
Method: POST
Description: Transfer an SPL token from one wallet address to another.
Last updated