Get the Solana program address that would be created with a given seed.
This is useful for knowing the program ID before deployment, which is required
for compile-time program ID embedding in Solana programs (e.g., declare_id!() in Anchor).
The function retrieves the main Solana address for the account and uses it as the
payer/base address for deriving the program address.
Return: JSON object containing the Solana smart contract transaction data.
-----------Request--------------
# Close buffer accounts (safe after deployment)
closeSolanaBpfLoaderAccounts(
account_id=1,
destination_address="9ncuu1WkE3eVx9VJPkq3yJqX1ZdykAoTtMsn7VqZURqK",
specific_from_address="6jNyFbaWhwvcEvQrF6gRVbv3y7Bc9mesBS5EZacaeKgM",
buffer_accounts=[
'BhmMTpP8r3hVkEsNWfWc3kuJZG8QnJ2zRAVxLqzstd',
'CvNS4AqAgWgtWvWcn8dBK2CNLj7XcYiUvYCyZmG5Jfuu'
],
description="Clean up deployment buffers"
)
# Close a program data account with different authority
closeSolanaBpfLoaderAccounts(
account_id=1,
destination_address="9ncuu1WkE3eVx9VJPkq3yJqX1ZdykAoTtMsn7VqZURqK",
specific_from_address="6jNyFbaWhwvcEvQrF6gRVbv3y7Bc9mesBS5EZacaeKgM",
authority_address="7xJ8k9mKpqL3nMvW5YaZbF2hR8cNtP4qS6dG1fVeUwXy",
program_data_account="8pQ2mN9rLkJ5tY7wX3vB6aS4cFdH1eG8uR2nT5kMjWxZ",
program_address="DjVE6JNiYqPL8EmdCB4mqF3YccmTWnVY8CfQwqbS4rYs",
description="Remove test program"
)
# Close both buffers and program data in one transaction
closeSolanaBpfLoaderAccounts(
account_id=1,
destination_address="9ncuu1WkE3eVx9VJPkq3yJqX1ZdykAoTtMsn7VqZURqK",
specific_from_address="6jNyFbaWhwvcEvQrF6gRVbv3y7Bc9mesBS5EZacaeKgM",
buffer_accounts=['BhmMTpP8r3hVkEsNWfWc3kuJZG8QnJ2zRAVxLqzstd'],
program_data_account="8pQ2mN9rLkJ5tY7wX3vB6aS4cFdH1eG8uR2nT5kMjWxZ",
program_address="DjVE6JNiYqPL8EmdCB4mqF3YccmTWnVY8CfQwqbS4rYs",
description="Clean up all test accounts"
)
----------------Response ------------
{
Function Data:{
"ApprovalRequestStatus": 3,
"CoinType": "SOL",
"Transactions": [
{
"AmountToTransfer": "0",
"DestinationAddress": "egQf....Q5DA"
}
]
},
"Meta": {
"AccessToken": "6276...79fe",
"Destination": "0453...9d56",
"Source": "fc581...42f3",
"Time": "2025-02-10 13:05:23.729"
}
}
account_idintegerThe account ID to get the main Solana address from.
destination_addressstringWhere to send the reclaimed SOL.
specific_from_addressstringThe payer address for the transaction fees.
buffer_accountsarrayList of buffer account addresses to close.
program_data_accountstringThe program data account address to close.
program_addressstring<p>The program address associated with the program_data_account. Required if program_data_account is provided.</p>
authority_addressstring<p>The authority that can close these accounts (must sign). If None, uses specific_from_address as the authority.</p>
descriptionstringText for describing the transaction in your records.