Skip to content

Commit

Permalink
Add operations:
Browse files Browse the repository at this point in the history
set_account_price
set_subaccount_price
buy_account
  • Loading branch information
username committed Mar 2, 2021
1 parent ec0ac7b commit eda3512
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions class/VIZ/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -1079,6 +1079,50 @@ function build_paid_subscribe($subscriber,$account,$level,$amount,$period,$auto_
$raw.=$this->encode_bool($auto_renewal);
return [$json,$raw];
}
function build_set_account_price($account,$account_seller,$account_offer_price,$account_on_sale){
$json='["set_account_price",{';
$json.='"account":"'.$account.'"';
$json.=',"account_seller":"'.$account_seller.'"';
$json.=',"account_offer_price":"'.$account_offer_price.'"';
$json.=',"account_on_sale":'.($account_on_sale?'true':'false').'';
$json.='}]';
$raw='36';//operation number is 54
$raw.=$this->encode_string($account);
$raw.=$this->encode_string($account_seller);
$raw.=$this->encode_asset($account_offer_price);
$raw.=$this->encode_bool($account_on_sale);
return [$json,$raw];
}
function build_set_subaccount_price($account,$subaccount_seller,$subaccount_offer_price,$subaccount_on_sale){
$json='["set_subaccount_price",{';
$json.='"account":"'.$account.'"';
$json.=',"subaccount_seller":"'.$subaccount_seller.'"';
$json.=',"subaccount_offer_price":"'.$subaccount_offer_price.'"';
$json.=',"subaccount_on_sale":'.($subaccount_on_sale?'true':'false').'';
$json.='}]';
$raw='37';//operation number is 55
$raw.=$this->encode_string($account);
$raw.=$this->encode_string($subaccount_seller);
$raw.=$this->encode_asset($subaccount_offer_price);
$raw.=$this->encode_bool($subaccount_on_sale);
return [$json,$raw];
}
function build_buy_account($buyer,$account,$account_offer_price,$account_authorities_key,$tokens_to_shares){
$json='["buy_account",{';
$json.='"buyer":"'.$buyer.'"';
$json.=',"account":"'.$account.'"';
$json.=',"account_offer_price":"'.$account_offer_price.'"';
$json.=',"account_authorities_key":"'.$account_authorities_key.'"';
$json.=',"tokens_to_shares":"'.$tokens_to_shares.'"';
$json.='}]';
$raw='38';//operation number is 56
$raw.=$this->encode_string($buyer);
$raw.=$this->encode_string($account);
$raw.=$this->encode_asset($account_offer_price);
$raw.=$this->encode_public_key($account_authorities_key);
$raw.=$this->encode_asset($tokens_to_shares);
return [$json,$raw];
}
function build_proposal_create($author,$title,$memo,$expiration_time,$proposed_operations=[],$review_period_time=false){
$json='["proposal_create",{';
$json.='"author":"'.$author.'"';
Expand Down

0 comments on commit eda3512

Please sign in to comment.