按照这里的文档,我正在使用TronGrid API对我的事务进行签名/广播:https://developers.tron.network/docs/api-sign-flow
但是,当我尝试使用API:https://api.trongrid.io/wallet/gettransactionsign
对我的事务进行签名时,我得到404Not Found。
即使使用他们的API explorer“试一下”功能,我仍然得到404:
有人知道这是为什么吗?
发布于 2021-04-27 15:19:29
出于安全原因,该方法在api.trongrid.io下已弃用,请将wallet/gettransactionsign与本地节点一起使用,或以编程方式对事务进行签名:
对于PHP,示例:
首先:$transaction -> "/wallet/createtransaction“
然后:
$signature = Support\Secp::sign($transaction['txID'], $this->privateKey);
public static function sign(string $message, string $privateKey): string
{
$secp = new Secp256k1();
/** @var Signature $sign */
$sign = $secp->sign($message, $privateKey, ['canonical' => false]);
return $sign->toHex() . bin2hex(implode('', array_map('chr', [$sign->getRecoveryParam()])));
}
最后:$result -> "/wallet/broadcasttransaction“
https://stackoverflow.com/questions/66633139
复制相似问题