26 namespace graphene {
namespace wallet {
namespace detail {
31 : (--_builder_transactions.end())->
first + 1;
32 _builder_transactions[trx_handle] = {};
39 FC_ASSERT(_builder_transactions.count(transaction_handle) > 0);
40 _builder_transactions[transaction_handle].operations.emplace_back(op);
44 uint32_t operation_index,
const operation& new_op)
46 FC_ASSERT(_builder_transactions.count(handle) > 0);
48 FC_ASSERT( operation_index < trx.operations.size());
49 trx.operations[operation_index] = new_op;
54 FC_ASSERT(_builder_transactions.count(handle) > 0);
56 auto fee_asset_obj =
get_asset(fee_asset);
59 auto gprops =
_remote_db->get_global_properties().parameters;
60 if( fee_asset_obj.get_id() != asset_id_type() )
62 for(
auto& op : _builder_transactions[handle].operations )
63 total_fee += gprops.get_current_fees().set_fee( op, fee_asset_obj.options.core_exchange_rate );
65 FC_ASSERT((total_fee * fee_asset_obj.options.core_exchange_rate).amount <=
66 get_object(fee_asset_obj.dynamic_asset_data_id).fee_pool,
67 "Cannot pay fees in ${asset}, as this asset's fee pool is insufficiently funded.",
68 (
"asset", fee_asset_obj.symbol));
70 for(
auto& op : _builder_transactions[handle].operations )
71 total_fee += gprops.get_current_fees().set_fee( op );
79 FC_ASSERT(_builder_transactions.count(handle) > 0);
80 return _builder_transactions[handle];
84 transaction_handle,
bool broadcast )
86 FC_ASSERT(_builder_transactions.count(transaction_handle) > 0);
88 return _builder_transactions[transaction_handle] =
93 transaction_handle,
const vector<public_key_type>& signing_keys,
bool broadcast)
95 FC_ASSERT(_builder_transactions.count(transaction_handle) > 0);
97 return _builder_transactions[transaction_handle] =
98 sign_transaction2(_builder_transactions[transaction_handle], signing_keys, broadcast);
102 time_point_sec expiration, uint32_t review_period_seconds,
bool broadcast)
108 string account_name_or_id, time_point_sec expiration, uint32_t review_period_seconds,
bool broadcast )
110 FC_ASSERT(_builder_transactions.count(handle) > 0);
113 pcop.expiration_time = expiration;
117 if( review_period_seconds )
118 pcop.review_period_seconds = review_period_seconds;
120 _remote_db->get_global_properties().parameters.get_current_fees().set_fee( trx.
operations.front() );
127 _builder_transactions.erase(handle);
extended_asset_object get_asset(asset_id_type id) const
signed_transaction sign_transaction2(signed_transaction tx, const vector< public_key_type > &signing_keys=vector< public_key_type >(), bool broadcast=false)
necessary to support nested operations inside the proposal_create_operation
vector< operation > operations
void remove_builder_transaction(transaction_handle_type handle)
fc::static_variant< transfer_operation, limit_order_create_operation, limit_order_cancel_operation, call_order_update_operation, fill_order_operation, account_create_operation, account_update_operation, account_whitelist_operation, account_upgrade_operation, account_transfer_operation, asset_create_operation, asset_update_operation, asset_update_bitasset_operation, asset_update_feed_producers_operation, asset_issue_operation, asset_reserve_operation, asset_fund_fee_pool_operation, asset_settle_operation, asset_global_settle_operation, asset_publish_feed_operation, witness_create_operation, witness_update_operation, proposal_create_operation, proposal_update_operation, proposal_delete_operation, withdraw_permission_create_operation, withdraw_permission_update_operation, withdraw_permission_claim_operation, withdraw_permission_delete_operation, committee_member_create_operation, committee_member_update_operation, committee_member_update_global_parameters_operation, vesting_balance_create_operation, vesting_balance_withdraw_operation, worker_create_operation, custom_operation, assert_operation, balance_claim_operation, override_transfer_operation, transfer_to_blind_operation, blind_transfer_operation, transfer_from_blind_operation, asset_settle_cancel_operation, asset_claim_fees_operation, fba_distribute_operation, bid_collateral_operation, execute_bid_operation, asset_claim_pool_operation, asset_update_issuer_operation, htlc_create_operation, htlc_redeem_operation, htlc_redeemed_operation, htlc_extend_operation, htlc_refund_operation, custom_authority_create_operation, custom_authority_update_operation, custom_authority_delete_operation, ticket_create_operation, ticket_update_operation, liquidity_pool_create_operation, liquidity_pool_delete_operation, liquidity_pool_deposit_operation, liquidity_pool_withdraw_operation, liquidity_pool_exchange_operation, samet_fund_create_operation, samet_fund_delete_operation, samet_fund_update_operation, samet_fund_borrow_operation, samet_fund_repay_operation, credit_offer_create_operation, credit_offer_delete_operation, credit_offer_update_operation, credit_offer_accept_operation, credit_deal_repay_operation, credit_deal_expired_operation >
transaction_handle_type begin_builder_transaction()
groups operations that should be applied atomically
The proposal_create_operation creates a transaction proposal, for use in multi-sig scenariosCreates a...
signed_transaction propose_builder_transaction(transaction_handle_type handle, time_point_sec expiration=time_point::now()+fc::minutes(1), uint32_t review_period_seconds=0, bool broadcast=true)
object_id< SpaceID, TypeID > get_id() const
fc::api< database_api > _remote_db
signed_transaction sign_transaction(signed_transaction tx, bool broadcast=false)
#define FC_ASSERT(TEST,...)
Checks a condition and throws an assert_exception if the test is FALSE.
signed_transaction sign_builder_transaction(transaction_handle_type transaction_handle, bool broadcast=true)
adds a signature to a transaction
signed_transaction propose_builder_transaction2(transaction_handle_type handle, string account_name_or_id, time_point_sec expiration=time_point::now()+fc::minutes(1), uint32_t review_period_seconds=0, bool broadcast=true)
signed_transaction sign_builder_transaction2(transaction_handle_type transaction_handle, const vector< public_key_type > &signing_keys=vector< public_key_type >(), bool broadcast=true)
at< List, 0 > first
Get the type at the beginning of the list.
graphene::db::object_downcast_t< const ID & > get_object(const ID &id) const
typename impl::transform< List, Transformer >::type transform
Transform elements of a typelist.
transaction preview_builder_transaction(transaction_handle_type handle)
uint32_t transaction_handle_type
account_object get_account(account_id_type id) const
account_id_type fee_paying_account
void add_operation_to_builder_transaction(transaction_handle_type transaction_handle, const operation &op)
void replace_operation_in_builder_transaction(transaction_handle_type handle, uint32_t operation_index, const operation &new_op)
asset set_fees_on_builder_transaction(transaction_handle_type handle, string fee_asset=GRAPHENE_SYMBOL)