Created
October 16, 2020 08:19
-
-
Save clockworkgr/d34434d4e0536c63d30ceecf2dfd1376 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ChainTypes.operations = { | |
transfer: 0, | |
order_create: 1, | |
order_cancel: 2, | |
order_update: 3, | |
account_create: 4, | |
account_update: 5, | |
account_whitelist: 6, | |
account_transfer: 7, | |
asset_create: 8, | |
asset_update: 9, | |
asset_issue: 10, | |
asset_reserve: 11, | |
asset_fund_fee_pool: 12, | |
witness_update: 13, | |
proposal_create: 14, | |
proposal_update: 15, | |
proposal_delete: 16, | |
withdraw_permission_create: 17, | |
withdraw_permission_update: 18, | |
withdraw_permission_claim: 19, | |
withdraw_permission_delete: 20, | |
vesting_balance_create: 21, | |
vesting_balance_withdraw: 22, | |
worker_create: 23, | |
custom: 24, | |
assert: 25, | |
override_transfer: 26, | |
transfer_to_blind: 27, | |
blind_transfer: 28, | |
transfer_from_blind: 29, | |
asset_claim_fees: 30, | |
asset_claim_pool: 31, | |
asset_update_issuer: 32, | |
htlc_create: 33, | |
htlc_redeem: 34, | |
htlc_extend: 35, | |
custom_authority_create: 36, | |
custom_authority_update: 37, | |
custom_authority_delete: 38, | |
asset_lockup: 39, | |
asset_unlock: 40, | |
asset_cancel_unlock: 41, | |
account_update_candidate: 42, | |
account_update_votes: 43, | |
market_create: 44, | |
market_update: 45 | |
}; | |
export const account_create_operation_account_create_fees = new Serializer("account_create_operation_account_create_fees", { | |
basic_fee: uint64, | |
premium_fee: uint64, | |
price_per_kbyte: uint32, | |
}); | |
export const asset_create_operation_asset_create_fees = new Serializer("asset_create_operation_asset_create_fees", { | |
symbol3: uint64, | |
symbol4: uint64, | |
long_symbol: uint64, | |
price_per_kbyte: uint32, | |
}); | |
export const worker_create_operation_worker_create_fees = new Serializer("worker_create_operation_worker_create_fees", { | |
fee: uint64, | |
}); | |
export const transfer_to_blind_operation_transfer_to_blind_fees = new Serializer("transfer_to_blind_operation_transfer_to_blind_fees", { | |
fee: uint64, | |
price_per_output: uint32, | |
}); | |
export const blind_transfer_operation_blind_transfer_fees = new Serializer("blind_transfer_operation_blind_transfer_fees", { | |
fee: uint64, | |
price_per_output: uint32, | |
}); | |
export const transfer_from_blind_operation_transfer_from_blind_fees = new Serializer("transfer_from_blind_operation_transfer_from_blind_fees", { | |
fee: uint64, | |
}); | |
export const custom_authority_create_operation_custom_authority_create_fees = new Serializer("custom_authority_create_operation_custom_authority_create_fees", { | |
basic_fee: uint64, | |
price_per_byte: uint32, | |
}); | |
export const custom_authority_update_operation_custom_authority_update_fees = new Serializer("custom_authority_update_operation_custom_authority_update_fees", { | |
basic_fee: uint64, | |
price_per_byte: uint32, | |
}); | |
var fee_parameters = static_variant([ | |
account_create_operation_account_create_fees, | |
asset_create_operation_asset_create_fees, | |
worker_create_operation_worker_create_fees, | |
transfer_to_blind_operation_transfer_to_blind_fees, | |
blind_transfer_operation_blind_transfer_fees, | |
transfer_from_blind_operation_transfer_from_blind_fees, | |
custom_authority_create_operation_custom_authority_create_fees, | |
custom_authority_update_operation_custom_authority_update_fees | |
]); | |
export const fee_schedule = new Serializer("fee_schedule", { | |
parameters: set(fee_parameters), | |
scale: uint32, | |
}); | |
export const block_id = new Serializer("block_id", { | |
block_num: varuint64, | |
block_hash: bytes(20), | |
}); | |
export const asset = new Serializer("asset", { | |
amount: int64, | |
asset_id: protocol_id_type("asset"), | |
}); | |
export const transaction_fee = new Serializer("transaction_fee", { | |
amount: asset, | |
payer: protocol_id_type("account"), | |
}); | |
export const void_result = new Serializer("void_result", { | |
}); | |
var operation_result = static_variant([ | |
void_result, | |
object_id, | |
asset | |
]); | |
export const processed_transaction = new Serializer("processed_transaction", { | |
ref_block_num: uint16, | |
ref_block_prefix: uint32, | |
expiration: time_point_sec, | |
operations: array(operation), | |
fee: optional(transaction_fee), | |
extensions: set(future_extensions), | |
signatures: array(bytes(65)), | |
operation_results: array(operation_result), | |
}); | |
export const signed_block = new Serializer("signed_block", { | |
previous: block_id, | |
timestamp: time_point_sec, | |
witness: protocol_id_type("witness"), | |
transaction_merkle_root: bytes(20), | |
extensions: extension([ | |
{ | |
name: "witness_consensus_version", | |
type: consensus_upgrade | |
}, | |
{ | |
name: "future_active_witnesses", | |
type: set(protocol_id_type("witness")) | |
} | |
]), | |
witness_signature: bytes(65), | |
transactions: array(array(processed_transaction)), | |
}); | |
export const block_header = new Serializer("block_header", { | |
previous: block_id, | |
timestamp: time_point_sec, | |
witness: protocol_id_type("witness"), | |
transaction_merkle_root: bytes(20), | |
extensions: extension([ | |
{ | |
name: "witness_consensus_version", | |
type: consensus_upgrade | |
}, | |
{ | |
name: "future_active_witnesses", | |
type: set(protocol_id_type("witness")) | |
} | |
]), | |
}); | |
export const signed_block_header = new Serializer("signed_block_header", { | |
previous: block_id, | |
timestamp: time_point_sec, | |
witness: protocol_id_type("witness"), | |
transaction_merkle_root: bytes(20), | |
extensions: extension([ | |
{ | |
name: "witness_consensus_version", | |
type: consensus_upgrade | |
}, | |
{ | |
name: "future_active_witnesses", | |
type: set(protocol_id_type("witness")) | |
} | |
]), | |
witness_signature: bytes(65), | |
}); | |
export const public_key = new Serializer("public_key", { | |
key_data: bytes(33), | |
}); | |
export const memo_data = new Serializer("memo_data", { | |
from: public_key, | |
to: public_key, | |
nonce: uint64, | |
message: bytes(), | |
}); | |
var memo = static_variant([ | |
string, | |
memo_data | |
]); | |
export const transfer = new Serializer("transfer", { | |
from: protocol_id_type("account"), | |
to: protocol_id_type("account"), | |
amount: asset, | |
memo: optional(memo), | |
extensions: set(future_extensions), | |
}); | |
export const price = new Serializer("price", { | |
base: asset, | |
quote: asset, | |
}); | |
export const limit_sell_order = new Serializer("limit_sell_order", { | |
amount: asset, | |
price: price, | |
fill_or_kill: bool, | |
}); | |
export const limit_buy_order = new Serializer("limit_buy_order", { | |
amount: asset, | |
price: price, | |
fill_or_kill: bool, | |
}); | |
var static_variant([ | |
limit_sell_order, | |
limit_buy_order | |
]); = static_variant([ | |
limit_sell_order, | |
limit_buy_order | |
]); | |
export const order_create = new Serializer("order_create", { | |
owner: protocol_id_type("account"), | |
custom_id: optional(uint32), | |
offer: static_variant([ | |
limit_sell_order, | |
limit_buy_order | |
]);, | |
expiration: time_point_sec, | |
extensions: set(future_extensions), | |
}); | |
export const order_cancel = new Serializer("order_cancel", { | |
owner: protocol_id_type("account"), | |
order: protocol_id_type("market_order"), | |
extensions: set(future_extensions), | |
}); | |
export const order_update = new Serializer("order_update", { | |
owner: protocol_id_type("account"), | |
order_id: protocol_id_type("market_order"), | |
delta_amount: optional(int64), | |
new_price: optional(price), | |
new_expiration: optional(time_point_sec), | |
extensions: set(future_extensions), | |
}); | |
export const authority = new Serializer("authority", { | |
weight_threshold: uint32, | |
account_auths: map(protocol_id_type("account"), uint16), | |
key_auths: map(public_key, uint16), | |
}); | |
export const no_special_authority = new Serializer("no_special_authority", { | |
}); | |
export const top_holders_special_authority = new Serializer("top_holders_special_authority", { | |
asset: protocol_id_type("asset"), | |
num_top_holders: uint8, | |
}); | |
export const elected_special_authority = new Serializer("elected_special_authority", { | |
entity: protocol_id_type("elected_entity"), | |
}); | |
var special_authority = static_variant([ | |
no_special_authority, | |
top_holders_special_authority, | |
elected_special_authority | |
]); | |
export const account_options = new Serializer("account_options", { | |
memo_key: public_key, | |
extensions: set(future_extensions), | |
}); | |
export const buyback_account_options = new Serializer("buyback_account_options", { | |
asset_to_buy: protocol_id_type("asset"), | |
asset_to_buy_issuer: protocol_id_type("account"), | |
markets: set(protocol_id_type("asset")), | |
}); | |
export const account_create = new Serializer("account_create", { | |
fee: asset, | |
registrar: protocol_id_type("account"), | |
referrer: protocol_id_type("account"), | |
referrer_percent: uint16, | |
name: string, | |
owner: authority, | |
active: authority, | |
owner_special_authority: optional(special_authority), | |
active_special_authority: optional(special_authority), | |
options: account_options, | |
buyback_options: optional(buyback_account_options), | |
extensions: set(future_extensions), | |
}); | |
export const account_update = new Serializer("account_update", { | |
account: protocol_id_type("account"), | |
owner: optional(authority), | |
active: optional(authority), | |
owner_special_authority: optional(special_authority), | |
active_special_authority: optional(special_authority), | |
new_options: optional(account_options), | |
extensions: set(future_extensions), | |
}); | |
export const account_whitelist = new Serializer("account_whitelist", { | |
authorizing_account: protocol_id_type("account"), | |
account_to_list: protocol_id_type("account"), | |
new_listing: uint8, | |
extensions: set(future_extensions), | |
}); | |
export const account_transfer = new Serializer("account_transfer", { | |
account_id: protocol_id_type("account"), | |
new_owner: protocol_id_type("account"), | |
extensions: set(future_extensions), | |
}); | |
export const asset_options = new Serializer("asset_options", { | |
max_supply: int64, | |
issuer_permissions: uint16, | |
flags: uint16, | |
core_exchange_rate: price, | |
whitelist_authorities: set(protocol_id_type("account")), | |
blacklist_authorities: set(protocol_id_type("account")), | |
whitelist_markets: set(protocol_id_type("asset")), | |
blacklist_markets: set(protocol_id_type("asset")), | |
description: string, | |
extensions: set(future_extensions), | |
}); | |
export const asset_create = new Serializer("asset_create", { | |
fee: asset, | |
issuer: protocol_id_type("account"), | |
symbol: string, | |
precision: uint8, | |
common_options: asset_options, | |
extensions: set(future_extensions), | |
}); | |
export const asset_update = new Serializer("asset_update", { | |
issuer: protocol_id_type("account"), | |
asset_to_update: protocol_id_type("asset"), | |
new_options: asset_options, | |
extensions: set(future_extensions), | |
}); | |
export const asset_issue = new Serializer("asset_issue", { | |
issuer: protocol_id_type("account"), | |
asset_to_issue: asset, | |
issue_to_account: protocol_id_type("account"), | |
memo: optional(memo_data), | |
extensions: set(future_extensions), | |
}); | |
export const asset_reserve = new Serializer("asset_reserve", { | |
payer: protocol_id_type("account"), | |
amount_to_reserve: asset, | |
extensions: set(future_extensions), | |
}); | |
export const asset_fund_fee_pool = new Serializer("asset_fund_fee_pool", { | |
from_account: protocol_id_type("account"), | |
asset_id: protocol_id_type("asset"), | |
amount: int64, | |
extensions: set(future_extensions), | |
}); | |
export const witness_update = new Serializer("witness_update", { | |
witness_account: protocol_id_type("account"), | |
url: optional(string), | |
signing_key: optional(public_key), | |
}); | |
export const proposal_create = new Serializer("proposal_create", { | |
creator: protocol_id_type("account"), | |
expiration_time: time_point_sec, | |
proposed_ops: array(operation), | |
review_period_seconds: optional(uint32), | |
creator_approves: bool, | |
extensions: set(future_extensions), | |
}); | |
export const proposal_update = new Serializer("proposal_update", { | |
proposal: protocol_id_type("proposal"), | |
active_approvals_to_add: set(protocol_id_type("account")), | |
active_approvals_to_remove: set(protocol_id_type("account")), | |
owner_approvals_to_add: set(protocol_id_type("account")), | |
owner_approvals_to_remove: set(protocol_id_type("account")), | |
key_approvals_to_add: set(public_key), | |
key_approvals_to_remove: set(public_key), | |
extensions: set(future_extensions), | |
}); | |
export const proposal_delete = new Serializer("proposal_delete", { | |
deleter: protocol_id_type("account"), | |
using_owner_authority: bool, | |
proposal: protocol_id_type("proposal"), | |
extensions: set(future_extensions), | |
}); | |
export const withdraw_permission_create = new Serializer("withdraw_permission_create", { | |
withdraw_from_account: protocol_id_type("account"), | |
authorized_account: protocol_id_type("account"), | |
withdrawal_limit: asset, | |
withdrawal_period_sec: uint32, | |
periods_until_expiration: uint32, | |
period_start_time: time_point_sec, | |
}); | |
export const withdraw_permission_update = new Serializer("withdraw_permission_update", { | |
withdraw_from_account: protocol_id_type("account"), | |
authorized_account: protocol_id_type("account"), | |
permission_to_update: protocol_id_type("withdraw_permission"), | |
withdrawal_limit: asset, | |
withdrawal_period_sec: uint32, | |
period_start_time: time_point_sec, | |
periods_until_expiration: uint32, | |
}); | |
export const withdraw_permission_claim = new Serializer("withdraw_permission_claim", { | |
withdraw_permission: protocol_id_type("withdraw_permission"), | |
withdraw_from_account: protocol_id_type("account"), | |
withdraw_to_account: protocol_id_type("account"), | |
amount_to_withdraw: asset, | |
memo: optional(memo_data), | |
}); | |
export const withdraw_permission_delete = new Serializer("withdraw_permission_delete", { | |
withdraw_from_account: protocol_id_type("account"), | |
authorized_account: protocol_id_type("account"), | |
withdrawal_permission: protocol_id_type("withdraw_permission"), | |
}); | |
export const linear_vesting_policy_initializer = new Serializer("linear_vesting_policy_initializer", { | |
begin_timestamp: time_point_sec, | |
vesting_cliff_seconds: uint32, | |
vesting_duration_seconds: uint32, | |
}); | |
export const cdd_vesting_policy_initializer = new Serializer("cdd_vesting_policy_initializer", { | |
start_claim: time_point_sec, | |
vesting_seconds: uint32, | |
}); | |
export const instant_vesting_policy_initializer = new Serializer("instant_vesting_policy_initializer", { | |
}); | |
var vesting_policy_initializer = static_variant([ | |
linear_vesting_policy_initializer, | |
cdd_vesting_policy_initializer, | |
instant_vesting_policy_initializer | |
]); | |
export const vesting_balance_create = new Serializer("vesting_balance_create", { | |
creator: protocol_id_type("account"), | |
owner: protocol_id_type("account"), | |
amount: asset, | |
policy: vesting_policy_initializer, | |
}); | |
export const vesting_balance_withdraw = new Serializer("vesting_balance_withdraw", { | |
vesting_balance: protocol_id_type("vesting_balance"), | |
owner: protocol_id_type("account"), | |
amount: asset, | |
}); | |
export const refund_worker_initializer = new Serializer("refund_worker_initializer", { | |
}); | |
export const vesting_balance_worker_initializer = new Serializer("vesting_balance_worker_initializer", { | |
pay_vesting_period_days: uint16, | |
}); | |
export const burn_worker_initializer = new Serializer("burn_worker_initializer", { | |
}); | |
var worker_initializer = static_variant([ | |
refund_worker_initializer, | |
vesting_balance_worker_initializer, | |
burn_worker_initializer | |
]); | |
export const worker_create = new Serializer("worker_create", { | |
fee: asset, | |
owner: protocol_id_type("account"), | |
work_begin_date: time_point_sec, | |
work_end_date: time_point_sec, | |
daily_pay: int64, | |
name: string, | |
url: string, | |
initializer: worker_initializer, | |
}); | |
export const custom = new Serializer("custom", { | |
required_auths: set(protocol_id_type("account")), | |
id: uint16, | |
data: bytes(), | |
}); | |
export const account_name_eq_lit_predicate = new Serializer("account_name_eq_lit_predicate", { | |
account_id: protocol_id_type("account"), | |
name: string, | |
}); | |
export const asset_symbol_eq_lit_predicate = new Serializer("asset_symbol_eq_lit_predicate", { | |
asset_id: protocol_id_type("asset"), | |
symbol: string, | |
}); | |
export const block_id_predicate = new Serializer("block_id_predicate", { | |
id: block_id, | |
}); | |
export const account_authorities_match_predicate = new Serializer("account_authorities_match_predicate", { | |
account_id: protocol_id_type("account"), | |
owner: optional(authority), | |
active: optional(authority), | |
owner_special_authority: optional(special_authority), | |
active_special_authority: optional(special_authority), | |
no_custom_authorities: bool, | |
}); | |
export const asset_issuer_is_account_predicate = new Serializer("asset_issuer_is_account_predicate", { | |
asset_id: protocol_id_type("asset"), | |
issuer_id: protocol_id_type("account"), | |
}); | |
export const asset_precision_predicate = new Serializer("asset_precision_predicate", { | |
asset_id: protocol_id_type("asset"), | |
precision: uint8, | |
}); | |
export const head_block_time_ge_time_predicate = new Serializer("head_block_time_ge_time_predicate", { | |
min_time: time_point_sec, | |
}); | |
var predicate = static_variant([ | |
account_name_eq_lit_predicate, | |
asset_symbol_eq_lit_predicate, | |
block_id_predicate, | |
account_authorities_match_predicate, | |
asset_issuer_is_account_predicate, | |
asset_precision_predicate, | |
head_block_time_ge_time_predicate | |
]); | |
export const assert = new Serializer("assert", { | |
predicates: array(predicate), | |
extensions: set(future_extensions), | |
}); | |
export const override_transfer = new Serializer("override_transfer", { | |
issuer: protocol_id_type("account"), | |
from: protocol_id_type("account"), | |
to: protocol_id_type("account"), | |
amount: asset, | |
memo: optional(memo), | |
extensions: set(future_extensions), | |
}); | |
export const stealth_confirmation = new Serializer("stealth_confirmation", { | |
one_time_key: public_key, | |
to: optional(public_key), | |
encrypted_memo: bytes(), | |
}); | |
export const blind_output = new Serializer("blind_output", { | |
commitment: bytes(33), | |
range_proof: bytes(), | |
owner: authority, | |
stealth_memo: optional(stealth_confirmation), | |
}); | |
export const transfer_to_blind = new Serializer("transfer_to_blind", { | |
fee: asset, | |
amount: asset, | |
from: protocol_id_type("account"), | |
blinding_factor: bytes(32), | |
outputs: array(blind_output), | |
}); | |
export const blind_input = new Serializer("blind_input", { | |
commitment: bytes(33), | |
owner: authority, | |
}); | |
export const blind_transfer = new Serializer("blind_transfer", { | |
fee: asset, | |
inputs: array(blind_input), | |
outputs: array(blind_output), | |
}); | |
export const transfer_from_blind = new Serializer("transfer_from_blind", { | |
fee: asset, | |
amount: asset, | |
to: protocol_id_type("account"), | |
blinding_factor: bytes(32), | |
inputs: array(blind_input), | |
}); | |
export const asset_claim_fees = new Serializer("asset_claim_fees", { | |
issuer: protocol_id_type("account"), | |
amount_to_claim: asset, | |
extensions: set(future_extensions), | |
}); | |
export const asset_claim_pool = new Serializer("asset_claim_pool", { | |
issuer: protocol_id_type("account"), | |
asset_id: protocol_id_type("asset"), | |
amount_to_claim: asset, | |
extensions: set(future_extensions), | |
}); | |
export const asset_update_issuer = new Serializer("asset_update_issuer", { | |
issuer: protocol_id_type("account"), | |
asset_to_update: protocol_id_type("asset"), | |
new_issuer: protocol_id_type("account"), | |
extensions: set(future_extensions), | |
}); | |
var htlc_hash = static_variant([ | |
bytes(20), | |
bytes(20), | |
bytes(32) | |
]); | |
export const htlc_create = new Serializer("htlc_create", { | |
from: protocol_id_type("account"), | |
to: protocol_id_type("account"), | |
amount: asset, | |
preimage_hash: htlc_hash, | |
preimage_size: uint16, | |
claim_period_seconds: uint32, | |
extensions: set(future_extensions), | |
}); | |
export const htlc_redeem = new Serializer("htlc_redeem", { | |
htlc_id: protocol_id_type("htlc"), | |
redeemer: protocol_id_type("account"), | |
preimage: bytes(), | |
extensions: set(future_extensions), | |
}); | |
export const htlc_extend = new Serializer("htlc_extend", { | |
htlc_id: protocol_id_type("htlc"), | |
update_issuer: protocol_id_type("account"), | |
seconds_to_add: uint32, | |
extensions: set(future_extensions), | |
}); | |
export const void = new Serializer("void", { | |
}); | |
export const restriction = new Serializer("restriction", { | |
member_index: varuint64, | |
restriction_type: varuint64, | |
argument: restriction_argument, | |
extensions: set(future_extensions), | |
}); | |
var restriction_argument = static_variant([ | |
void, | |
bool, | |
int64, | |
string, | |
time_point_sec, | |
public_key, | |
bytes(20), | |
bytes(32), | |
bytes(20), | |
hash160, | |
protocol_id_type("account"), | |
protocol_id_type("asset"), | |
protocol_id_type("htlc"), | |
protocol_id_type("custom_authority"), | |
protocol_id_type("proposal"), | |
protocol_id_type("withdraw_permission"), | |
protocol_id_type("vesting_balance"), | |
protocol_id_type("market"), | |
protocol_id_type("market_order"), | |
set(bool), | |
set(int64), | |
set(string), | |
set(time_point_sec), | |
set(public_key), | |
set(bytes(32)), | |
set(protocol_id_type("account")), | |
set(protocol_id_type("asset")), | |
set(protocol_id_type("htlc")), | |
set(protocol_id_type("market_order")), | |
set(protocol_id_type("custom_authority")), | |
set(protocol_id_type("proposal")), | |
set(protocol_id_type("withdraw_permission")), | |
set(protocol_id_type("vesting_balance")), | |
array(restriction), | |
array(array(restriction)), | |
pair(int64, array(restriction)) | |
]); | |
export const custom_authority_create = new Serializer("custom_authority_create", { | |
fee: asset, | |
account: protocol_id_type("account"), | |
enabled: bool, | |
valid_from: time_point_sec, | |
valid_to: time_point_sec, | |
operation_type: varuint64, | |
auth: authority, | |
restrictions: array(restriction), | |
extensions: set(future_extensions), | |
}); | |
export const custom_authority_update = new Serializer("custom_authority_update", { | |
fee: asset, | |
account: protocol_id_type("account"), | |
authority_to_update: protocol_id_type("custom_authority"), | |
new_enabled: optional(bool), | |
new_valid_from: optional(time_point_sec), | |
new_valid_to: optional(time_point_sec), | |
new_auth: optional(authority), | |
restrictions_to_remove: set(uint16), | |
restrictions_to_add: array(restriction), | |
extensions: set(future_extensions), | |
}); | |
export const custom_authority_delete = new Serializer("custom_authority_delete", { | |
account: protocol_id_type("account"), | |
authority_to_delete: protocol_id_type("custom_authority"), | |
extensions: set(future_extensions), | |
}); | |
export const asset_lockup = new Serializer("asset_lockup", { | |
owner: protocol_id_type("account"), | |
amount: int64, | |
extensions: set(future_extensions), | |
}); | |
export const asset_unlock = new Serializer("asset_unlock", { | |
owner: protocol_id_type("account"), | |
amount: int64, | |
fast: bool, | |
extensions: set(future_extensions), | |
}); | |
export const asset_cancel_unlock = new Serializer("asset_cancel_unlock", { | |
owner: protocol_id_type("account"), | |
unlock_id: protocol_id_type("asset_unlock"), | |
amount: int64, | |
extensions: set(future_extensions), | |
}); | |
export const account_update_candidate = new Serializer("account_update_candidate", { | |
candidate: protocol_id_type("account"), | |
entity: protocol_id_type("elected_entity"), | |
url: string, | |
withdraw: bool, | |
pause: bool, | |
extensions: set(future_extensions), | |
}); | |
export const account_update_votes = new Serializer("account_update_votes", { | |
voter: protocol_id_type("account"), | |
updates: map(protocol_id_type("elected_entity"), account_update_votes_operation_vote_update), | |
extensions: set(future_extensions), | |
}); | |
export const market_fee = new Serializer("market_fee", { | |
maker_fee_pct: uint16, | |
taker_fee_pct: uint16, | |
min_quote_fee: int64, | |
min_base_fee: int64, | |
max_quote_fee: int64, | |
max_base_fee: int64, | |
quote_issuer_fee_pct: uint16, | |
base_issuer_fee_pct: uint16, | |
extensions: set(future_extensions), | |
}); | |
export const market_options = new Serializer("market_options", { | |
flags: uint16, | |
min_quote_increment: int64, | |
min_base_increment: int64, | |
extensions: set(future_extensions), | |
}); | |
export const market_create = new Serializer("market_create", { | |
base_id: protocol_id_type("asset"), | |
quote_id: protocol_id_type("asset"), | |
fees: market_fee, | |
options: market_options, | |
extensions: set(future_extensions), | |
}); | |
export const market_update = new Serializer("market_update", { | |
market_id: protocol_id_type("market"), | |
new_fees: optional(market_fee), | |
new_options: optional(market_options), | |
delete_market: bool, | |
extensions: set(future_extensions), | |
}); | |
var operation = static_variant([ | |
transfer, | |
order_create, | |
order_cancel, | |
order_update, | |
account_create, | |
account_update, | |
account_whitelist, | |
account_transfer, | |
asset_create, | |
asset_update, | |
asset_issue, | |
asset_reserve, | |
asset_fund_fee_pool, | |
witness_update, | |
proposal_create, | |
proposal_update, | |
proposal_delete, | |
withdraw_permission_create, | |
withdraw_permission_update, | |
withdraw_permission_claim, | |
withdraw_permission_delete, | |
vesting_balance_create, | |
vesting_balance_withdraw, | |
worker_create, | |
custom, | |
assert, | |
override_transfer, | |
transfer_to_blind, | |
blind_transfer, | |
transfer_from_blind, | |
asset_claim_fees, | |
asset_claim_pool, | |
asset_update_issuer, | |
htlc_create, | |
htlc_redeem, | |
htlc_extend, | |
custom_authority_create, | |
custom_authority_update, | |
custom_authority_delete, | |
asset_lockup, | |
asset_unlock, | |
asset_cancel_unlock, | |
account_update_candidate, | |
account_update_votes, | |
market_create, | |
market_update | |
]); | |
export const transaction = new Serializer("transaction", { | |
ref_block_num: uint16, | |
ref_block_prefix: uint32, | |
expiration: time_point_sec, | |
operations: array(operation), | |
fee: optional(transaction_fee), | |
extensions: set(future_extensions), | |
}); | |
export const signed_transaction = new Serializer("signed_transaction", { | |
ref_block_num: uint16, | |
ref_block_prefix: uint32, | |
expiration: time_point_sec, | |
operations: array(operation), | |
fee: optional(transaction_fee), | |
extensions: set(future_extensions), | |
signatures: array(bytes(65)), | |
}); | |
export const consensus_version = new Serializer("consensus_version", { | |
major: varuint64, | |
minor: varuint64, | |
}); | |
export const consensus_upgrade = new Serializer("consensus_upgrade", { | |
target_version: consensus_version, | |
upgrade_not_before: time_point_sec, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment