Api/AlgorandApi
// Set your API Keys 👇 here
$sdk = new \Tatum\Sdk();
// MainNet API Call
$sdk->mainnet()->api()->algorand();
// TestNet API Call
$sdk->testnet()->api()->algorand();
Methods
Method | Description |
---|---|
algorandBroadcast() | Broadcast signed Algorand transaction |
algorandGenerateAddress() | Generate Algorand account address from private key |
algorandGenerateWallet() | Generate Algorand wallet |
algorandGetBalance() | Get Algorand Account balance |
algorandGetBlock() | Get Algorand block by block round number |
algorandGetCurrentBlock() | Get current block number |
algorandGetTransaction() | Get Algorand Transaction |
receiveAlgorandAsset() | Enable receiving asset on account |
receiveAlgorandAssetKMS() | Enable receiving asset on account |
transferAlgorandBlockchain() | Send Algos to an Algorand account |
transferAlgorandBlockchainKMS() | Send Algos to an Algorand account |
algorandBroadcast()
Example
#️⃣ Execute command in terminal
Request
POST
/v3/algorand/broadcast
Type signature
(new \Tatum\Sdk())->{mainnet/testnet}()->api()->algorand()->algorandBroadcast(
\Tatum\Model\BroadcastKMS $broadcast_kms
): \Tatum\Model\AlgoTransactionHashKMS
Parameters
Name | Type | Description | Notes |
---|---|---|---|
$broadcast_kms | \Tatum\Model\BroadcastKMS |
Return type
\Tatum\Model\AlgoTransactionHashKMS
Description
Broadcast signed Algorand transaction
2 credits per API call.
Broadcast signed transaction to Algorand blockchain. This method is used internally from Tatum KMS or Tatum client libraries. It is possible to create custom signing mechanism and use this method only for broadcasting data to the blockchain.
algorandGenerateAddress()
Example
#️⃣ Execute command in terminal
Request
GET
/v3/algorand/address/{priv}
Type signature
(new \Tatum\Sdk())->{mainnet/testnet}()->api()->algorand()->algorandGenerateAddress(
string $priv
): \Tatum\Model\AlgorandGenerateAddress200Response
Parameters
Name | Type | Description | Notes |
---|---|---|---|
$priv | string | private key of wallet. |
Return type
\Tatum\Model\AlgorandGenerateAddress200Response
Description
Generate Algorand account address from private key
1 credit per API call.
Generate Algorand account deposit address from private key.
algorandGenerateWallet()
Example
#️⃣ Execute command in terminal
Request
GET
/v3/algorand/wallet
Type signature
(new \Tatum\Sdk())->{mainnet/testnet}()->api()->algorand()->algorandGenerateWallet(
[ string $mnemonic ]
): \Tatum\Model\AlgoWallet
Parameters
Name | Type | Description | Notes |
---|---|---|---|
$mnemonic | string | Mnemonic to use for generation of extended public and private keys. | [optional] |
Return type
Description
Generate Algorand wallet
1 credit per API call.
Tatum supports Algorand wallets.
algorandGetBalance()
Example
#️⃣ Execute command in terminal
Request
GET
/v3/algorand/account/balance/{address}
Type signature
(new \Tatum\Sdk())->{mainnet/testnet}()->api()->algorand()->algorandGetBalance(
string $address
): \Tatum\Model\AlgorandGetBalance200Response
Parameters
Name | Type | Description | Notes |
---|---|---|---|
$address | string | Account address you want to get balance of |
Return type
\Tatum\Model\AlgorandGetBalance200Response
Description
Get Algorand Account balance
1 credit per API call.
Get Algorand account balance in ALGO.
algorandGetBlock()
Example
#️⃣ Execute command in terminal
Request
GET
/v3/algorand/block/{roundNumber}
Type signature
(new \Tatum\Sdk())->{mainnet/testnet}()->api()->algorand()->algorandGetBlock(
float $round_number
): \Tatum\Model\AlgoBlock
Parameters
Name | Type | Description | Notes |
---|---|---|---|
$round_number | float | Block round number |
Return type
Description
Get Algorand block by block round number
1 credit per API call.
Get Algorand block by block round number.
algorandGetCurrentBlock()
Example
#️⃣ Execute command in terminal
Request
GET
/v3/algorand/block/current
Type signature
(new \Tatum\Sdk())->{mainnet/testnet}()->api()->algorand()->algorandGetCurrentBlock(): float
Parameters
This endpoint does not need any parameter.
Return type
float
Description
Get current block number
1 credit per API call.
Get Algorand current block number. This is the number of the latest block in the blockchain.
algorandGetTransaction()
Example
#️⃣ Execute command in terminal
Request
GET
/v3/algorand/transaction/{txid}
Type signature
(new \Tatum\Sdk())->{mainnet/testnet}()->api()->algorand()->algorandGetTransaction(
string $txid
): \Tatum\Model\AlgoTx
Parameters
Name | Type | Description | Notes |
---|---|---|---|
$txid | string | Transaction id |
Return type
Description
Get Algorand Transaction
1 credit per API call.
Get Algorand transaction by transaction id.
receiveAlgorandAsset()
Example
#️⃣ Execute command in terminal
Request
POST
/v3/algorand/asset/receive
Type signature
(new \Tatum\Sdk())->{mainnet/testnet}()->api()->algorand()->receiveAlgorandAsset(
\Tatum\Model\ReceiveAlgorandAsset $receive_algorand_asset
): \Tatum\Model\TransactionSigned
Parameters
Name | Type | Description | Notes |
---|---|---|---|
$receive_algorand_asset | \Tatum\Model\ReceiveAlgorandAsset |
Return type
\Tatum\Model\TransactionSigned
Description
Enable receiving asset on account
2 credits per API call.
Enable accepting Algorand asset on the sender account. This operation needs the private key of the blockchain address. No one should ever send it’s own private keys to the internet because there is a strong possibility of stealing keys and loss of funds. In this method, it is possible to enter privateKey or signatureId. PrivateKey should be used only for quick development on testnet versions of blockchain when there is no risk of losing funds. In production, Tatum KMS should be used for the highest security standards, and signatureId should be present in the request. Alternatively, using the Tatum client library for supported languages.
receiveAlgorandAssetKMS()
Example
#️⃣ Execute command in terminal
Request
POST
/v3/algorand/asset/receive
Type signature
(new \Tatum\Sdk())->{mainnet/testnet}()->api()->algorand()->receiveAlgorandAssetKMS(
\Tatum\Model\ReceiveAlgorandAssetKMS $receive_algorand_asset_kms
): \Tatum\Model\TransactionSigned
Parameters
Name | Type | Description | Notes |
---|---|---|---|
$receive_algorand_asset_kms | \Tatum\Model\ReceiveAlgorandAssetKMS |
Return type
\Tatum\Model\TransactionSigned
Description
Enable receiving asset on account
transferAlgorandBlockchain()
Example
#️⃣ Execute command in terminal
Request
POST
/v3/algorand/transaction
Type signature
(new \Tatum\Sdk())->{mainnet/testnet}()->api()->algorand()->transferAlgorandBlockchain(
\Tatum\Model\TransferAlgorandBlockchain $transfer_algorand_blockchain
): \Tatum\Model\TransactionSigned
Parameters
Name | Type | Description | Notes |
---|---|---|---|
$transfer_algorand_blockchain | \Tatum\Model\TransferAlgorandBlockchain |
Return type
\Tatum\Model\TransactionSigned
Description
Send Algos to an Algorand account
2 credits per API call
Send Algos from one Algorand address to the other one.
Signing a transaction
When sending Algos, you are charged a fee for the transaction, and you must sign the transaction with the private key of the blockchain address from which the fee will be deducted.
Providing the private key in the API is not a secure way of signing transactions, because the private key can be stolen or exposed. Your private keys should never leave your security perimeter. You should use the private keys only for testing a solution you are building on the testnet of a blockchain.
For signing transactions on the mainnet, we strongly recommend that you use the Tatum Key Management System (KMS) and provide the signature ID instead of the private key in the API. Alternatively, you can use the Tatum JavaScript client.
transferAlgorandBlockchainKMS()
Example
#️⃣ Execute command in terminal
Request
POST
/v3/algorand/transaction
Type signature
(new \Tatum\Sdk())->{mainnet/testnet}()->api()->algorand()->transferAlgorandBlockchainKMS(
\Tatum\Model\TransferAlgorandBlockchainKMS $transfer_algorand_blockchain_kms
): \Tatum\Model\TransactionSigned
Parameters
Name | Type | Description | Notes |
---|---|---|---|
$transfer_algorand_blockchain_kms | \Tatum\Model\TransferAlgorandBlockchainKMS |
Return type
\Tatum\Model\TransactionSigned
Description
Send Algos to an Algorand account