Address

The commands where under this section are used for address and balance actions.

Read more about Pirichain Wallet Structurearrow-up-right

Create New Address

post
/createNewAddress

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 Structurearrow-up-right page on whitepaper.

Body
languagestring ยท enum ยท nullableOptional

It can be used to specify in which language the secret words to be created will be.

Default: englishPossible values:
Responses
chevron-right
200

OK | Success

application/json
pristringRequired
pubstringRequired
wordsstringRequired
publicKeystringRequired
isCommercialbooleanOptional

Returns true if the created address is a commercial address. This field is only present for commercial addresses.

post
/createNewAddress
200

OK | Success

Convert To Commercial Address (TestNET)

post

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.

Body
addressstringRequired

PIRI Address

privateKeystringRequired

Private Key

aliasstring ยท max: 64Required

Commercial Alias of Address

Responses
chevron-right
200

OK

application/json; charset=utf-8
errorinteger ยท int32Required

Error status code. 0 indicates success, non-zero indicates an error.

txstringRequired

The transaction hash identifier for the completed token transfer transaction.

signstringRequired

The cryptographic signature of the transaction, ensuring its authenticity and integrity.

timeStampinteger ยท int64Required

The Unix timestamp (in milliseconds) when the transaction was processed.

post
/convertToCommercialWallet
200

OK

Rescue Private Key from Mnemonic Words

post
/rescuePrivateKey

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.

Body
wordsstringRequired

A string of 24 words with a space between them

Responses
chevron-right
200

OK

application/json; charset=utf-8
pristringRequired
post
/rescuePrivateKey
200

OK

Get Mnemonic Words from Private Key

post
/getMnemonic

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 Explanationarrow-up-right page

Body
privateKeystringRequired

Private Key of PIRI Address

languagestring ยท enum ยท nullableOptional

It can be used to indicate in which language the words to be retrieved will be.

Default: englishPossible values:
Responses
chevron-right
200

OK

application/json; charset=utf-8
errorinteger ยท int32Required
mnemonicstringRequired
post
/getMnemonic
200

OK

Get Balance for an Address

post
/getBalance

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.

Body
addressstringRequired

PIRI Address

assetIDnumberRequired

ID of asset | -1 should be sent for PIRI asset

Responses
chevron-right
200

OK

application/json; charset=utf-8
errorinteger ยท int32Required
namestringRequired
symbolstringRequired
logostringRequired

Asset logo URL or base64 encoded image data

assetIDinteger ยท int32Required
addressstringRequired
frozenstring[]Required

List of frozen amounts or details

balancestring ยท decimalRequired
post
/getBalance
200

OK

Get Asset List for an Address

post
/getBalanceList

This endpoint will provide a list of all assets belonging to a PIRI address.

A successful query result will look like the schema below.

Body
addressstringRequired

PIRI Address

Responses
chevron-right
200

OK

application/json; charset=utf-8
errorinteger ยท int32Required
namestringRequired
symbolstringRequired
logostringRequired

Asset logo URL or base64 encoded image data

assetIDinteger ยท int32Required
addressstringRequired
frozenstring[]Required

List of frozen amounts or details

balancestring ยท decimalRequired
post
/getBalanceList
200

OK

Get public key for an address

post
/getPubKey

Get the public key associated with a specific address.

Body
addressstringRequired

The address to get the public key for

Responses
chevron-right
200

Response with public key information or an error message.

application/json; charset=utf-8
errorinteger ยท enumRequired

Error code: 0 for success, 1 for not found.

Possible values:
datastringRequired

Public key as a hex string when found, or an error message when not found.

post
/getPubKey
200

Response with public key information or an error message.

Validate PIRI Address

post
/isValidAddress

This endpoint validates whether a given address is a valid PIRI address format.

Body
addressstringRequired

PIRI Address to validate

Example: PRTMPaWeNE...
Responses
chevron-right
200

Address validation result

application/json
booleanOptional

True if address is valid, false if invalid

post
/isValidAddress
200

Address validation result

Get detailed address information

post
/getDetailsOfAddress

Get detailed information about a specific address, such as transaction counts and deputy status.

Body
addressstringRequired

The address to get details for

Responses
chevron-right
200

Address details retrieved successfully

application/json; charset=utf-8
errorinteger ยท int32Optional

Error code, 0 for success

isDepbooleanOptional

Indicates if the address belongs to a deputy

depWebsitestringOptional

The website of the deputy, if applicable

verifiedbooleanOptional

Indicates if the address is verified

post
/getDetailsOfAddress
200

Address details retrieved successfully

Last updated