Address
The commands where under this section are used for address and balance actions.
Read more about Pirichain Wallet Structure
This endpoint is used to create a PIRI address. The successful result of a query includes the following information:
pri: Private Key. This information is the most crucial for the privacy of the PIRI address. The basic security of the address depends on this information. Transactions related to the address, scenario creation, data sending and decryption, token creation, and more, require this information or the signature generated with it.
pub: The PIRI address information in base58 format. It consists of 43 characters. It starts with PRTM and is followed by one of the letters P, Q, or R, totaling 43 characters. It is case-sensitive and is required for all address-based operations in the PIRI network. This information is public.
words: A text sequence consisting of 24 words. Just like the Private Key information, it requires privacy. Additionally, this information can provide access to the Private Key information. It should be stored with high confidentiality.
publicKey: This is a general and public information associated with the PIRI address. It is commonly used, especially in shared key generation stages.
In addition, during the address creation process, if the "isCommercial" parameter is used and set to true:
isCommercial: It returns true. This information represents whether a PIRI address is of commercial nature. Additionally, it is possible to convert a non-commercial PIRI address into a commercial address, but this can only be done once and in a one-way manner.
To get more information about PIRI Wallet Structure, please visit Pirichain Wallet Structure page on whitepaper.
It can be used to specify in which language the secret words to be created will be.
english
Possible values: OK | Success
POST /createNewAddress HTTP/1.1
Host: core.pirichain.com
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 22
"language='english'"
OK | Success
{
"pri": "<private key>",
"pub": "PRTMPZzikg...",
"words": "<secret words>",
"publicKey": "0432b..."
}
This endpoint converts a PIRI address (individual wallet) that has not been previously converted to a commercial wallet into a commercial wallet. This operation is unidirectional, and it is not possible to convert a PIRI address that has been converted to a commercial wallet back into an individual wallet.
Especially in the context of Dynamic Settlement, this conversion, which is useful for commercial purposes, also automatically carries the Public Key information associated with the address.
One important point to be especially mindful of is that there is no possibility of transferring or sending data between these two different wallet types. In other words, it is not possible to transfer to or send data to an individual address from a commercial address, and vice versa. Individual and commercial addresses can only perform transfers and data exchange within their own types.
PIRI Address
Private Key
Commercial Alias of Address
OK
POST /convertToCommercialWallet HTTP/1.1
Host: core.pirichain.com
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 53
"address='text'&privateKey='text'&alias='text'"
OK
{
"error": 0,
"tx": "d357d...",
"sign": "30450...",
"timeStamp": 1663766042014
}
This endpoint is used to retrieve the Private Key information associated with a PIRI address. The PIRI address system uses a set of 24 words from the bip39 library. The words are case-sensitive and should be sent with spaces between them.
If the sent words are complete and arranged to represent a PIRI address as per the following schema, information will be returned.
A string of 24 words with a space between them
OK
POST /rescuePrivateKey HTTP/1.1
Host: core.pirichain.com
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 16
"words='text'"
OK
{
"pri": "<private key>",
"base58": {
"pub": "04443...",
"base58": "PRTMR5pDra..."
}
}
This endpoint is used to retrieve 24 words that compose a PIRI address. It takes the Private Key information related to the PIRI address as a parameter and returns a result based on the following schema.
Additionally, this endpoint also accepts the "language" parameter as optional. While its default value is set to "english," one of the language choices listed in the table can also be sent as the parameter value.
For more detailed information about transaction tables related to the bip39 library, you can visit Bip39 Explanation page
Private Key of PIRI Address
It can be used to indicate in which language the words to be retrieved will be.
english
Possible values: OK
POST /getMnemonic HTTP/1.1
Host: core.pirichain.com
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 42
"privateKey='text'&language='english'"
OK
{
"error": 0,
"mnemonic": "<secret words>"
}
This endpoint returns the quantity of a specific asset associated with a PIRI address. The type of this asset is provided through the assetID parameter. In different systems, this information is also referred to as the contract address for the asset type. In the PIRI network, there is no contract address for an asset; instead, the assetID value is used.
For the PIRI asset, this value is -1. For other assets (Tokens), the relevant values can be seen through the listTokens endpoint.
A successful query will result in the following schema, as shown below.
PIRI Address
ID of asset | -1 should be sent for PIRI asset
OK
POST /getBalance HTTP/1.1
Host: core.pirichain.com
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 30
"address='text'&assetID=1"
OK
{
"error": 0,
"name": "PIRI",
"symbol": "PIRI",
"logo": "/images/piri.png",
"assetID": -1,
"address": "PRTMPaWeNE...",
"frozen": [],
"balance": "100000.00000000"
}
This endpoint will provide a list of all assets belonging to a PIRI address.
A successful query result will look like the schema below.
PIRI Address
OK
POST /getBalanceList HTTP/1.1
Host: core.pirichain.com
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 18
"address='text'"
OK
[
{
"error": 0,
"name": "PIRI",
"symbol": "PIRI",
"logo": "/images/piri.png",
"assetID": -1,
"address": "PRTMPaWeNE...",
"frozen": [],
"balance": "100000.00000000"
},
{
"error": 0,
"name": "PiriPepeKing",
"symbol": "PPK",
"logo": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...",
"assetID": 10018,
"address": "PRTMPaWeNE...",
"frozen": [],
"balance": "10000.00000000"
}
]
Get the public key associated with a specific address.
The address to get the public key for
Response with public key information or an error message.
POST /getPubKey HTTP/1.1
Host: core.pirichain.com
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 18
"address='text'"
Response with public key information or an error message.
{
"error": 0,
"data": "04a14c2b9a71652a395818325131589754b492b983112281b214b4912b983112281b214b4912b9831122"
}
This endpoint validates whether a given address is a valid PIRI address format.
PIRI Address to validate
PRTMPaWeNE...
Address validation result
True if address is valid, false if invalid
POST /isValidAddress HTTP/1.1
Host: core.pirichain.com
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 27
"address='PRTMPaWeNE...'"
Address validation result
true
Get detailed information about a specific address, such as transaction counts and deputy status.
The address to get details for
Address details retrieved successfully
POST /getDetailsOfAddress HTTP/1.1
Host: core.pirichain.com
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 18
"address='text'"
Address details retrieved successfully
{
"error": 0,
"inOutAddr": {
"in": 150,
"out": 75
},
"isDep": true,
"depWebsite": "https://pirichain.com",
"verified": true
}
Was this helpful?