Skip to content
Snippets Groups Projects
Commit e9fad3e0 authored by Mahdi Yari's avatar Mahdi Yari
Browse files

rebranding serializer

parent cb9aa177
No related branches found
No related tags found
1 merge request!7Rebrand hf24
...@@ -33,6 +33,10 @@ static_variant [ ...@@ -33,6 +33,10 @@ static_variant [
import types from "./types" import types from "./types"
import SerializerImpl from "./serializer" import SerializerImpl from "./serializer"
import config from "../../../config"
const hiveVar = config.get("rebranded_api") ? "hive" : "steem"
const hbdVar = config.get("rebranded_api") ? "hbd" : "sbd"
const { const {
//id_type, //id_type,
...@@ -88,7 +92,7 @@ const allowed_vote_assets = new Serializer(1, { ...@@ -88,7 +92,7 @@ const allowed_vote_assets = new Serializer(1, {
const smt_generation_unit = new Serializer( const smt_generation_unit = new Serializer(
"smt_generation_unit", { "smt_generation_unit", {
steem_unit: map((string), (uint16)), [hiveVar + "_unit"]: map((string), (uint16)),
token_unit: map((string), (uint16)) token_unit: map((string), (uint16))
}); });
...@@ -332,7 +336,7 @@ let chain_properties = new Serializer( ...@@ -332,7 +336,7 @@ let chain_properties = new Serializer(
"chain_properties", { "chain_properties", {
account_creation_fee: asset, account_creation_fee: asset,
maximum_block_size: uint32, maximum_block_size: uint32,
sbd_interest_rate: uint16 [hbdVar + "_interest_rate"]: uint16
} }
); );
...@@ -407,7 +411,7 @@ let comment_options = new Serializer( ...@@ -407,7 +411,7 @@ let comment_options = new Serializer(
author: string, author: string,
permlink: string, permlink: string,
max_accepted_payout: asset, max_accepted_payout: asset,
percent_steem_dollars: uint16, ["percent_" + hiveVar + "_dollars"]: uint16,
allow_votes: bool, allow_votes: bool,
allow_curation_rewards: bool, allow_curation_rewards: bool,
extensions: set(static_variant([ extensions: set(static_variant([
...@@ -488,8 +492,8 @@ let escrow_transfer = new Serializer( ...@@ -488,8 +492,8 @@ let escrow_transfer = new Serializer(
"escrow_transfer", { "escrow_transfer", {
from: string, from: string,
to: string, to: string,
sbd_amount: asset, [hbdVar + "_amount"]: asset,
steem_amount: asset, [hiveVar + "_amount"]: asset,
escrow_id: uint32, escrow_id: uint32,
agent: string, agent: string,
fee: asset, fee: asset,
...@@ -517,8 +521,8 @@ let escrow_release = new Serializer( ...@@ -517,8 +521,8 @@ let escrow_release = new Serializer(
who: string, who: string,
receiver: string, receiver: string,
escrow_id: uint32, escrow_id: uint32,
sbd_amount: asset, [hbdVar + "_amount"]: asset,
steem_amount: asset [hiveVar + "_amount"]: asset
} }
); );
...@@ -629,8 +633,8 @@ let set_reset_account = new Serializer( ...@@ -629,8 +633,8 @@ let set_reset_account = new Serializer(
let claim_reward_balance = new Serializer( let claim_reward_balance = new Serializer(
"claim_reward_balance", { "claim_reward_balance", {
account: string, account: string,
reward_steem: asset, ["reward_" + hiveVar]: asset,
reward_sbd: asset, ["reward_" + hbdVar]: asset,
reward_vests: asset reward_vests: asset
} }
); );
...@@ -745,7 +749,7 @@ let smt_setup = new Serializer( ...@@ -745,7 +749,7 @@ let smt_setup = new Serializer(
contribution_begin_time: time_point_sec, contribution_begin_time: time_point_sec,
contribution_end_time: time_point_sec, contribution_end_time: time_point_sec,
launch_time: time_point_sec, launch_time: time_point_sec,
steem_units_min: int64, [hiveVar + "_units_min"]: int64,
min_unit_ratio: uint32, min_unit_ratio: uint32,
max_unit_ratio: uint32, max_unit_ratio: uint32,
extensions: set(future_extensions) extensions: set(future_extensions)
...@@ -777,7 +781,7 @@ let smt_setup_ico_tier = new Serializer( ...@@ -777,7 +781,7 @@ let smt_setup_ico_tier = new Serializer(
"smt_setup_ico_tier", { "smt_setup_ico_tier", {
control_account: string, control_account: string,
symbol: asset_symbol, symbol: asset_symbol,
steem_units_cap: int64, [hiveVar + "_units_cap"]: int64,
generation_policy: static_variant([ generation_policy: static_variant([
smt_capped_generation_policy smt_capped_generation_policy
]), ]),
...@@ -834,8 +838,8 @@ let author_reward = new Serializer( ...@@ -834,8 +838,8 @@ let author_reward = new Serializer(
"author_reward", { "author_reward", {
author: string, author: string,
permlink: string, permlink: string,
sbd_payout: asset, [hbdVar + "_payout"]: asset,
steem_payout: asset, [hiveVar + "_payout"]: asset,
vesting_payout: asset vesting_payout: asset
} }
); );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment