public function AccountPermissionUpdate($privateKey, $toAddress) { $record = TronServiceExtension::GetRecord(); $transactionClient = $record->TronClient->GetTransaction(); $account = new TronAccount($privateKey, TronNetwork::MainNet);

$transactionExtention = $transactionClient->CreateAccountPermissionUpdateTransaction($account->Address, $toAddress);

$transactionSigned = $transactionClient->GetTransactionSign($transactionExtention->Transaction, $privateKey);
$returnObj = $transactionClient->BroadcastTransaction($transactionSigned);

return [
    'Result' => $returnObj->Result,
    'Message' => $returnObj->Message,
    'TransactionId' => $transactionExtention->Transaction->GetTxid()
];
public static class TronServiceExtension private static IServiceProvider AddTronNet IServiceCollection services = new ServiceCollection; servicesAddTronNetx = xNe

原文地址: https://www.cveoy.top/t/topic/iH7p 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录