You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 21, 2019. It is now read-only.
foreach($response['result'] as $txinfo)
{
// make sure the order was placed before it was paid on the blockchain, sanity check incase hash's match but tx is for wrong order.
// also make sure this tx is confirmed on the blockchain before processing it
if($txinfo['is_confirmed'] == true)
{
$timeStamp = $txinfo['timestamp'];
$trxId = $txinfo['trx_id'];
foreach($txinfo['ledger_entries'] as $tx) {
//$txTime = strtotime($tx['timestamp']);
// echo 'time: ' . $txTime;
$toaccount = $tx['to_account'];
$txSymbol = btsGetAssetNameById($tx['amount']['asset_id'], $rpcUser, $rpcPass, $rpcPort);
$memo = $tx['memo'];
if($txSymbol != $asset && !$demoMode)
{
continue;
}
// sanity check, tx to account should match your configured account in admin settings
if($toaccount != $account)
{
continue;
}
// if this TX doesn't have the hash of the open order we are checking, skip this order
if(strpos($memo, $orderEHASH) == FALSE)
{
continue;
}
$accumulatedAmountPaid += ($tx['amount']['amount']/100000);
}
}
}
This is my code to run over all orders using wallet_account_transaction_history... notice the call to btsGetAssetNameById? its another RPC call... can we do something like tx['amount']['asset']['id'] or tx['amount']['asset_id'] as is for id and tx['amount']['asset']['name'] or tx['amount']['asset_name'] for asset name to avoid another rpc call? Just another child json tag for the asset. The later of maybe including asset_name might be the easiest.
Thanks!
The text was updated successfully, but these errors were encountered:
While this would be convenient, I am concerned it would further slow down RPC's (by adding lookups and increasing response size)
I use a locally cached identity maps for these type of static data.. I would prefer the core to be fast and lean, and these "convenience" features to be implemented in PHP/Ruby/Python/etc wrappers.
This is my code to run over all orders using wallet_account_transaction_history... notice the call to btsGetAssetNameById? its another RPC call... can we do something like tx['amount']['asset']['id'] or tx['amount']['asset_id'] as is for id and tx['amount']['asset']['name'] or tx['amount']['asset_name'] for asset name to avoid another rpc call? Just another child json tag for the asset. The later of maybe including asset_name might be the easiest.
Thanks!
The text was updated successfully, but these errors were encountered: