From 72e926b0f4e6fa2728deeedaa022ba1c559f5a76 Mon Sep 17 00:00:00 2001 From: polyprogrammist Date: Mon, 11 Dec 2023 22:20:10 -0500 Subject: [PATCH 01/10] tmp --- generate_all.ts | 5 + generated_block.ts | 10647 +++-------------------------------- generated_test.ts | 2058 +------ src/codegen/CodeBuilder.ts | 64 + src/codegen/combinator.ts | 2 +- src/codegen/field.ts | 2 +- src/codegen/helpers.ts | 2 +- src/codegen/main.ts | 5 +- src/codegen/tsgen.ts | 254 +- src/codegen/util.ts | 2 +- 10 files changed, 1180 insertions(+), 11861 deletions(-) create mode 100644 src/codegen/CodeBuilder.ts diff --git a/generate_all.ts b/generate_all.ts index 574d695..c670477 100644 --- a/generate_all.ts +++ b/generate_all.ts @@ -6,6 +6,7 @@ import { parse } from './src' import { ast } from './src' import { generate } from './src/codegen/main' import { Program } from './src/ast/nodes' +import { CodeBuilder } from './src/codegen/CodeBuilder' const fixturesDir = path.resolve(__dirname, 'tests/fixtures') @@ -25,3 +26,7 @@ function generateCode(filename: string) { // generateCode('my') generateCode('block') generateCode('test') + +// let cb = new CodeBuilder(); + +// fs.writeFile('tmp.ts', cb.render(), () => { }); diff --git a/generated_block.ts b/generated_block.ts index f29c485..a242c49 100644 --- a/generated_block.ts +++ b/generated_block.ts @@ -2,9879 +2,774 @@ import { Builder } from 'ton' import { Slice } from 'ton' import { beginCell } from 'ton' import { BitString } from 'ton' -export interface Unit { - readonly kind: 'Unit'; - }; -export interface True { - readonly kind: 'True'; - }; -export type Bool = Bool_bool_false | Bool_bool_true; -export interface Bool_bool_false { - readonly kind: 'Bool_bool_false'; - }; -export interface Bool_bool_true { - readonly kind: 'Bool_bool_true'; - }; -export interface BoolFalse { - readonly kind: 'BoolFalse'; - }; -export interface BoolTrue { - readonly kind: 'BoolTrue'; - }; -export type Maybe = Maybe_nothing | Maybe_just; -export interface Maybe_nothing { - readonly kind: 'Maybe_nothing'; - }; -export interface Maybe_just { - readonly kind: 'Maybe_just'; - readonly value: X; - }; -export type Either = Either_left | Either_right; -export interface Either_left { - readonly kind: 'Either_left'; - readonly value: X; - }; -export interface Either_right { - readonly kind: 'Either_right'; - readonly value: Y; - }; -export interface Both { - readonly kind: 'Both'; - readonly first: X; - readonly second: Y; - }; -export interface Bit { - readonly kind: 'Bit'; - readonly anon0: number; - }; -export interface Hashmap { - readonly kind: 'Hashmap'; - readonly n: number; - readonly l: number; - readonly m: number; - readonly label: HmLabel; - readonly node: HashmapNode; - }; -export type HashmapNode = HashmapNode_hmn_leaf | HashmapNode_hmn_fork; -export interface HashmapNode_hmn_leaf { - readonly kind: 'HashmapNode_hmn_leaf'; - readonly value: X; - }; -export interface HashmapNode_hmn_fork { - readonly kind: 'HashmapNode_hmn_fork'; - readonly n: number; - readonly left: Hashmap; - readonly right: Hashmap; - }; -export type HmLabel = HmLabel_hml_short | HmLabel_hml_long | HmLabel_hml_same; -export interface HmLabel_hml_short { - readonly kind: 'HmLabel_hml_short'; - readonly m: number; - readonly n: number; - readonly len: Unary; - readonly s: Array; - }; -export interface HmLabel_hml_long { - readonly kind: 'HmLabel_hml_long'; - readonly m: number; - readonly n: number; - readonly s: Array; - }; -export interface HmLabel_hml_same { - readonly kind: 'HmLabel_hml_same'; - readonly m: number; - readonly v: BitString; - readonly n: number; - }; -export type Unary = Unary_unary_zero | Unary_unary_succ; -export interface Unary_unary_zero { - readonly kind: 'Unary_unary_zero'; - }; -export interface Unary_unary_succ { - readonly kind: 'Unary_unary_succ'; - readonly n: number; - readonly x: Unary; - }; -export type HashmapE = HashmapE_hme_empty | HashmapE_hme_root; -export interface HashmapE_hme_empty { - readonly kind: 'HashmapE_hme_empty'; - readonly n: number; - }; -export interface HashmapE_hme_root { - readonly kind: 'HashmapE_hme_root'; - readonly n: number; - readonly root: Hashmap; - }; -export interface BitstringSet { - readonly kind: 'BitstringSet'; - readonly n: number; - readonly _: Hashmap; - }; -export interface HashmapAug { - readonly kind: 'HashmapAug'; - readonly n: number; - readonly l: number; - readonly m: number; - readonly label: HmLabel; - readonly node: HashmapAugNode; - }; -export type HashmapAugNode = HashmapAugNode_ahmn_leaf | HashmapAugNode_ahmn_fork; -export interface HashmapAugNode_ahmn_leaf { - readonly kind: 'HashmapAugNode_ahmn_leaf'; - readonly extra: Y; - readonly value: X; - }; -export interface HashmapAugNode_ahmn_fork { - readonly kind: 'HashmapAugNode_ahmn_fork'; - readonly n: number; - readonly left: HashmapAug; - readonly right: HashmapAug; - readonly extra: Y; - }; -export type HashmapAugE = HashmapAugE_ahme_empty | HashmapAugE_ahme_root; -export interface HashmapAugE_ahme_empty { - readonly kind: 'HashmapAugE_ahme_empty'; - readonly n: number; - readonly extra: Y; - }; -export interface HashmapAugE_ahme_root { - readonly kind: 'HashmapAugE_ahme_root'; - readonly n: number; - readonly root: HashmapAug; - readonly extra: Y; - }; -export interface VarHashmap { - readonly kind: 'VarHashmap'; - readonly n: number; - readonly l: number; - readonly m: number; - readonly label: HmLabel; - readonly node: VarHashmapNode; - }; -export type VarHashmapNode = VarHashmapNode_vhmn_leaf | VarHashmapNode_vhmn_fork | VarHashmapNode_vhmn_cont; -export interface VarHashmapNode_vhmn_leaf { - readonly kind: 'VarHashmapNode_vhmn_leaf'; - readonly n: number; - readonly value: X; - }; -export interface VarHashmapNode_vhmn_fork { - readonly kind: 'VarHashmapNode_vhmn_fork'; - readonly n: number; - readonly left: VarHashmap; - readonly right: VarHashmap; - readonly value: Maybe; - }; -export interface VarHashmapNode_vhmn_cont { - readonly kind: 'VarHashmapNode_vhmn_cont'; - readonly n: number; - readonly branch: BitString; - readonly child: VarHashmap; - readonly value: X; - }; -export type VarHashmapE = VarHashmapE_vhme_empty | VarHashmapE_vhme_root; -export interface VarHashmapE_vhme_empty { - readonly kind: 'VarHashmapE_vhme_empty'; - readonly n: number; - }; -export interface VarHashmapE_vhme_root { - readonly kind: 'VarHashmapE_vhme_root'; - readonly n: number; - readonly root: VarHashmap; - }; -export interface PfxHashmap { - readonly kind: 'PfxHashmap'; - readonly n: number; - readonly l: number; - readonly m: number; - readonly label: HmLabel; - readonly node: PfxHashmapNode; - }; -export type PfxHashmapNode = PfxHashmapNode_phmn_leaf | PfxHashmapNode_phmn_fork; -export interface PfxHashmapNode_phmn_leaf { - readonly kind: 'PfxHashmapNode_phmn_leaf'; - readonly n: number; - readonly value: X; - }; -export interface PfxHashmapNode_phmn_fork { - readonly kind: 'PfxHashmapNode_phmn_fork'; - readonly n: number; - readonly left: PfxHashmap; - readonly right: PfxHashmap; - }; -export type PfxHashmapE = PfxHashmapE_phme_empty | PfxHashmapE_phme_root; -export interface PfxHashmapE_phme_empty { - readonly kind: 'PfxHashmapE_phme_empty'; - readonly n: number; - }; -export interface PfxHashmapE_phme_root { - readonly kind: 'PfxHashmapE_phme_root'; - readonly n: number; - readonly root: PfxHashmap; - }; -export type MsgAddressExt = MsgAddressExt_addr_none | MsgAddressExt_addr_extern; -export interface MsgAddressExt_addr_none { - readonly kind: 'MsgAddressExt_addr_none'; - }; -export interface MsgAddressExt_addr_extern { - readonly kind: 'MsgAddressExt_addr_extern'; - readonly len: number; - readonly external_address: BitString; - }; -export interface Anycast { - readonly kind: 'Anycast'; - readonly depth: number; - readonly rewrite_pfx: BitString; - }; -export type MsgAddressInt = MsgAddressInt_addr_std | MsgAddressInt_addr_var; -export interface MsgAddressInt_addr_std { - readonly kind: 'MsgAddressInt_addr_std'; - readonly anycast: Maybe; - readonly workchain_id: number; - readonly address: BitString; - }; -export interface MsgAddressInt_addr_var { - readonly kind: 'MsgAddressInt_addr_var'; - readonly anycast: Maybe; - readonly addr_len: number; - readonly workchain_id: number; - readonly address: BitString; - }; -export type MsgAddress = MsgAddress__ | MsgAddress__1; -export interface MsgAddress__ { - readonly kind: 'MsgAddress__'; - readonly _: MsgAddressInt; - }; -export interface MsgAddress__1 { - readonly kind: 'MsgAddress__1'; - readonly _: MsgAddressExt; - }; -export interface VarUInteger { - readonly kind: 'VarUInteger'; - readonly n: number; - readonly len: number; - readonly value: number; - }; -export interface VarInteger { - readonly kind: 'VarInteger'; - readonly n: number; - readonly len: number; - readonly value: number; - }; -export interface Grams { - readonly kind: 'Grams'; - readonly amount: VarUInteger; - }; -export interface ExtraCurrencyCollection { - readonly kind: 'ExtraCurrencyCollection'; - readonly dict: HashmapE; - }; -export interface CurrencyCollection { - readonly kind: 'CurrencyCollection'; - readonly grams: Grams; - readonly other: ExtraCurrencyCollection; - }; -export type CommonMsgInfo = CommonMsgInfo_int_msg_info | CommonMsgInfo_ext_in_msg_info | CommonMsgInfo_ext_out_msg_info; -export interface CommonMsgInfo_int_msg_info { - readonly kind: 'CommonMsgInfo_int_msg_info'; - readonly ihr_disabled: Bool; - readonly bounce: Bool; - readonly bounced: Bool; - readonly src: MsgAddressInt; - readonly dest: MsgAddressInt; - readonly value: CurrencyCollection; - readonly ihr_fee: Grams; - readonly fwd_fee: Grams; - readonly created_lt: number; - readonly created_at: number; - }; -export interface CommonMsgInfo_ext_in_msg_info { - readonly kind: 'CommonMsgInfo_ext_in_msg_info'; - readonly src: MsgAddressExt; - readonly dest: MsgAddressInt; - readonly import_fee: Grams; - }; -export interface CommonMsgInfo_ext_out_msg_info { - readonly kind: 'CommonMsgInfo_ext_out_msg_info'; - readonly src: MsgAddressInt; - readonly dest: MsgAddressExt; - readonly created_lt: number; - readonly created_at: number; - }; -export type CommonMsgInfoRelaxed = CommonMsgInfoRelaxed_int_msg_info | CommonMsgInfoRelaxed_ext_out_msg_info; -export interface CommonMsgInfoRelaxed_int_msg_info { - readonly kind: 'CommonMsgInfoRelaxed_int_msg_info'; - readonly ihr_disabled: Bool; - readonly bounce: Bool; - readonly bounced: Bool; - readonly src: MsgAddress; - readonly dest: MsgAddressInt; - readonly value: CurrencyCollection; - readonly ihr_fee: Grams; - readonly fwd_fee: Grams; - readonly created_lt: number; - readonly created_at: number; - }; -export interface CommonMsgInfoRelaxed_ext_out_msg_info { - readonly kind: 'CommonMsgInfoRelaxed_ext_out_msg_info'; - readonly src: MsgAddress; - readonly dest: MsgAddressExt; - readonly created_lt: number; - readonly created_at: number; - }; -export interface TickTock { - readonly kind: 'TickTock'; - readonly tick: Bool; - readonly tock: Bool; - }; -export interface StateInit { - readonly kind: 'StateInit'; - readonly split_depth: Maybe; - readonly special: Maybe; - readonly code: Maybe; - readonly data: Maybe; - readonly library: HashmapE; - }; -export interface SimpleLib { - readonly kind: 'SimpleLib'; - readonly public0: Bool; - readonly root: Slice; - }; -export interface Message { - readonly kind: 'Message'; - readonly info: CommonMsgInfo; - readonly init: Maybe>; - readonly body: Either; - }; -export interface MessageRelaxed { - readonly kind: 'MessageRelaxed'; - readonly info: CommonMsgInfoRelaxed; - readonly init: Maybe>; - readonly body: Either; - }; -export interface MessageAny { - readonly kind: 'MessageAny'; - readonly anon0: Message; - }; -export type IntermediateAddress = IntermediateAddress_interm_addr_regular | IntermediateAddress_interm_addr_simple | IntermediateAddress_interm_addr_ext; -export interface IntermediateAddress_interm_addr_regular { - readonly kind: 'IntermediateAddress_interm_addr_regular'; - readonly use_dest_bits: number; - }; -export interface IntermediateAddress_interm_addr_simple { - readonly kind: 'IntermediateAddress_interm_addr_simple'; - readonly workchain_id: number; - readonly addr_pfx: number; - }; -export interface IntermediateAddress_interm_addr_ext { - readonly kind: 'IntermediateAddress_interm_addr_ext'; - readonly workchain_id: number; - readonly addr_pfx: number; - }; -export interface MsgEnvelope { - readonly kind: 'MsgEnvelope'; - readonly cur_addr: IntermediateAddress; - readonly next_addr: IntermediateAddress; - readonly fwd_fee_remaining: Grams; - readonly msg: Message; - }; -export type InMsg = InMsg_msg_import_ext | InMsg_msg_import_ihr | InMsg_msg_import_imm | InMsg_msg_import_fin | InMsg_msg_import_tr | InMsg_msg_discard_fin | InMsg_msg_discard_tr; -export interface InMsg_msg_import_ext { - readonly kind: 'InMsg_msg_import_ext'; - readonly msg: Message; - readonly transaction: Transaction; - }; -export interface InMsg_msg_import_ihr { - readonly kind: 'InMsg_msg_import_ihr'; - readonly msg: Message; - readonly transaction: Transaction; - readonly ihr_fee: Grams; - readonly proof_created: Slice; - }; -export interface InMsg_msg_import_imm { - readonly kind: 'InMsg_msg_import_imm'; - readonly in_msg: MsgEnvelope; - readonly transaction: Transaction; - readonly fwd_fee: Grams; - }; -export interface InMsg_msg_import_fin { - readonly kind: 'InMsg_msg_import_fin'; - readonly in_msg: MsgEnvelope; - readonly transaction: Transaction; - readonly fwd_fee: Grams; - }; -export interface InMsg_msg_import_tr { - readonly kind: 'InMsg_msg_import_tr'; - readonly in_msg: MsgEnvelope; - readonly out_msg: MsgEnvelope; - readonly transit_fee: Grams; - }; -export interface InMsg_msg_discard_fin { - readonly kind: 'InMsg_msg_discard_fin'; - readonly in_msg: MsgEnvelope; - readonly transaction_id: number; - readonly fwd_fee: Grams; - }; -export interface InMsg_msg_discard_tr { - readonly kind: 'InMsg_msg_discard_tr'; - readonly in_msg: MsgEnvelope; - readonly transaction_id: number; - readonly fwd_fee: Grams; - readonly proof_delivered: Slice; - }; -export interface ImportFees { - readonly kind: 'ImportFees'; - readonly fees_collected: Grams; - readonly value_imported: CurrencyCollection; - }; -export interface InMsgDescr { - readonly kind: 'InMsgDescr'; - readonly anon0: HashmapAugE; - }; -export type OutMsg = OutMsg_msg_export_ext | OutMsg_msg_export_imm | OutMsg_msg_export_new | OutMsg_msg_export_tr | OutMsg_msg_export_deq | OutMsg_msg_export_deq_short | OutMsg_msg_export_tr_req | OutMsg_msg_export_deq_imm; -export interface OutMsg_msg_export_ext { - readonly kind: 'OutMsg_msg_export_ext'; - readonly msg: Message; - readonly transaction: Transaction; - }; -export interface OutMsg_msg_export_imm { - readonly kind: 'OutMsg_msg_export_imm'; - readonly out_msg: MsgEnvelope; - readonly transaction: Transaction; - readonly reimport: InMsg; - }; -export interface OutMsg_msg_export_new { - readonly kind: 'OutMsg_msg_export_new'; - readonly out_msg: MsgEnvelope; - readonly transaction: Transaction; - }; -export interface OutMsg_msg_export_tr { - readonly kind: 'OutMsg_msg_export_tr'; - readonly out_msg: MsgEnvelope; - readonly imported: InMsg; - }; -export interface OutMsg_msg_export_deq { - readonly kind: 'OutMsg_msg_export_deq'; - readonly out_msg: MsgEnvelope; - readonly import_block_lt: number; - }; -export interface OutMsg_msg_export_deq_short { - readonly kind: 'OutMsg_msg_export_deq_short'; - readonly msg_env_hash: BitString; - readonly next_workchain: number; - readonly next_addr_pfx: number; - readonly import_block_lt: number; - }; -export interface OutMsg_msg_export_tr_req { - readonly kind: 'OutMsg_msg_export_tr_req'; - readonly out_msg: MsgEnvelope; - readonly imported: InMsg; - }; -export interface OutMsg_msg_export_deq_imm { - readonly kind: 'OutMsg_msg_export_deq_imm'; - readonly out_msg: MsgEnvelope; - readonly reimport: InMsg; - }; -export interface EnqueuedMsg { - readonly kind: 'EnqueuedMsg'; - readonly enqueued_lt: number; - readonly out_msg: MsgEnvelope; - }; -export interface OutMsgDescr { - readonly kind: 'OutMsgDescr'; - readonly anon0: HashmapAugE; - }; -export interface OutMsgQueue { - readonly kind: 'OutMsgQueue'; - readonly anon0: HashmapAugE; - }; -export interface ProcessedUpto { - readonly kind: 'ProcessedUpto'; - readonly last_msg_lt: number; - readonly last_msg_hash: BitString; - }; -export interface ProcessedInfo { - readonly kind: 'ProcessedInfo'; - readonly anon0: HashmapE; - }; -export interface IhrPendingSince { - readonly kind: 'IhrPendingSince'; - readonly import_lt: number; - }; -export interface IhrPendingInfo { - readonly kind: 'IhrPendingInfo'; - readonly anon0: HashmapE; - }; -export interface OutMsgQueueInfo { - readonly kind: 'OutMsgQueueInfo'; - readonly out_queue: OutMsgQueue; - readonly proc_info: ProcessedInfo; - readonly ihr_pending: IhrPendingInfo; - }; -export interface StorageUsed { - readonly kind: 'StorageUsed'; - readonly _cells: VarUInteger; - readonly bits: VarUInteger; - readonly public_cells: VarUInteger; - }; -export interface StorageUsedShort { - readonly kind: 'StorageUsedShort'; - readonly _cells: VarUInteger; - readonly bits: VarUInteger; - }; -export interface StorageInfo { - readonly kind: 'StorageInfo'; - readonly used: StorageUsed; - readonly last_paid: number; - readonly due_payment: Maybe; - }; -export type Account = Account_account_none | Account_account; -export interface Account_account_none { - readonly kind: 'Account_account_none'; - }; -export interface Account_account { - readonly kind: 'Account_account'; - readonly addr: MsgAddressInt; - readonly storage_stat: StorageInfo; - readonly storage: AccountStorage; - }; -export interface AccountStorage { - readonly kind: 'AccountStorage'; - readonly last_trans_lt: number; - readonly balance: CurrencyCollection; - readonly state: AccountState; - }; -export type AccountState = AccountState_account_uninit | AccountState_account_active | AccountState_account_frozen; -export interface AccountState_account_uninit { - readonly kind: 'AccountState_account_uninit'; - }; -export interface AccountState_account_active { - readonly kind: 'AccountState_account_active'; - readonly _: StateInit; - }; -export interface AccountState_account_frozen { - readonly kind: 'AccountState_account_frozen'; - readonly state_hash: BitString; - }; -export type AccountStatus = AccountStatus_acc_state_uninit | AccountStatus_acc_state_frozen | AccountStatus_acc_state_active | AccountStatus_acc_state_nonexist; -export interface AccountStatus_acc_state_uninit { - readonly kind: 'AccountStatus_acc_state_uninit'; - }; -export interface AccountStatus_acc_state_frozen { - readonly kind: 'AccountStatus_acc_state_frozen'; - }; -export interface AccountStatus_acc_state_active { - readonly kind: 'AccountStatus_acc_state_active'; - }; -export interface AccountStatus_acc_state_nonexist { - readonly kind: 'AccountStatus_acc_state_nonexist'; - }; -export interface ShardAccount { - readonly kind: 'ShardAccount'; - readonly account: Account; - readonly last_trans_hash: BitString; - readonly last_trans_lt: number; - }; -export interface DepthBalanceInfo { - readonly kind: 'DepthBalanceInfo'; - readonly split_depth: number; - readonly balance: CurrencyCollection; - }; -export interface ShardAccounts { - readonly kind: 'ShardAccounts'; - readonly anon0: HashmapAugE; - }; -export interface Transaction { - readonly kind: 'Transaction'; - readonly account_addr: BitString; - readonly lt: number; - readonly prev_trans_hash: BitString; - readonly prev_trans_lt: number; - readonly now: number; - readonly outmsg_cnt: number; - readonly orig_status: AccountStatus; - readonly end_status: AccountStatus; - readonly in_msg: Maybe>; - readonly out_msgs: HashmapE>; - readonly total_fees: CurrencyCollection; - readonly state_update: HASH_UPDATE; - readonly description: TransactionDescr; - }; -export interface MERKLE_UPDATE { - readonly kind: 'MERKLE_UPDATE'; - readonly old_hash: BitString; - readonly new_hash: BitString; - readonly old: X; - readonly new0: X; - }; -export interface HASH_UPDATE { - readonly kind: 'HASH_UPDATE'; - readonly old_hash: BitString; - readonly new_hash: BitString; - }; -export interface MERKLE_PROOF { - readonly kind: 'MERKLE_PROOF'; - readonly virtual_hash: BitString; - readonly depth: number; - readonly virtual_root: X; - }; -export interface AccountBlock { - readonly kind: 'AccountBlock'; - readonly account_addr: BitString; - readonly transactions: HashmapAug; - readonly state_update: HASH_UPDATE; - }; -export interface ShardAccountBlocks { - readonly kind: 'ShardAccountBlocks'; - readonly anon0: HashmapAugE; - }; -export interface TrStoragePhase { - readonly kind: 'TrStoragePhase'; - readonly storage_fees_collected: Grams; - readonly storage_fees_due: Maybe; - readonly status_change: AccStatusChange; - }; -export type AccStatusChange = AccStatusChange_acst_unchanged | AccStatusChange_acst_frozen | AccStatusChange_acst_deleted; -export interface AccStatusChange_acst_unchanged { - readonly kind: 'AccStatusChange_acst_unchanged'; - }; -export interface AccStatusChange_acst_frozen { - readonly kind: 'AccStatusChange_acst_frozen'; - }; -export interface AccStatusChange_acst_deleted { - readonly kind: 'AccStatusChange_acst_deleted'; - }; -export interface TrCreditPhase { - readonly kind: 'TrCreditPhase'; - readonly due_fees_collected: Maybe; - readonly credit: CurrencyCollection; - }; -export type TrComputePhase = TrComputePhase_tr_phase_compute_skipped | TrComputePhase_tr_phase_compute_vm; -export interface TrComputePhase_tr_phase_compute_skipped { - readonly kind: 'TrComputePhase_tr_phase_compute_skipped'; - readonly reason: ComputeSkipReason; - }; -export interface TrComputePhase_tr_phase_compute_vm { - readonly kind: 'TrComputePhase_tr_phase_compute_vm'; - readonly success: Bool; - readonly msg_state_used: Bool; - readonly account_activated: Bool; - readonly gas_fees: Grams; - readonly gas_used: VarUInteger; - readonly gas_limit: VarUInteger; - readonly gas_credit: Maybe; - readonly mode: number; - readonly exit_code: number; - readonly exit_arg: Maybe; - readonly vm_steps: number; - readonly vm_init_state_hash: BitString; - readonly vm_final_state_hash: BitString; - }; -export type ComputeSkipReason = ComputeSkipReason_cskip_no_state | ComputeSkipReason_cskip_bad_state | ComputeSkipReason_cskip_no_gas; -export interface ComputeSkipReason_cskip_no_state { - readonly kind: 'ComputeSkipReason_cskip_no_state'; - }; -export interface ComputeSkipReason_cskip_bad_state { - readonly kind: 'ComputeSkipReason_cskip_bad_state'; - }; -export interface ComputeSkipReason_cskip_no_gas { - readonly kind: 'ComputeSkipReason_cskip_no_gas'; - }; -export interface TrActionPhase { - readonly kind: 'TrActionPhase'; - readonly success: Bool; - readonly valid: Bool; - readonly no_funds: Bool; - readonly status_change: AccStatusChange; - readonly total_fwd_fees: Maybe; - readonly total_action_fees: Maybe; - readonly result_code: number; - readonly result_arg: Maybe; - readonly tot_actions: number; - readonly spec_actions: number; - readonly skipped_actions: number; - readonly msgs_created: number; - readonly action_list_hash: BitString; - readonly tot_msg_size: StorageUsedShort; - }; -export type TrBouncePhase = TrBouncePhase_tr_phase_bounce_negfunds | TrBouncePhase_tr_phase_bounce_nofunds | TrBouncePhase_tr_phase_bounce_ok; -export interface TrBouncePhase_tr_phase_bounce_negfunds { - readonly kind: 'TrBouncePhase_tr_phase_bounce_negfunds'; - }; -export interface TrBouncePhase_tr_phase_bounce_nofunds { - readonly kind: 'TrBouncePhase_tr_phase_bounce_nofunds'; - readonly msg_size: StorageUsedShort; - readonly req_fwd_fees: Grams; - }; -export interface TrBouncePhase_tr_phase_bounce_ok { - readonly kind: 'TrBouncePhase_tr_phase_bounce_ok'; - readonly msg_size: StorageUsedShort; - readonly msg_fees: Grams; - readonly fwd_fees: Grams; - }; -export type TransactionDescr = TransactionDescr_trans_ord | TransactionDescr_trans_storage | TransactionDescr_trans_tick_tock | TransactionDescr_trans_split_prepare | TransactionDescr_trans_split_install | TransactionDescr_trans_merge_prepare | TransactionDescr_trans_merge_install; -export interface TransactionDescr_trans_ord { - readonly kind: 'TransactionDescr_trans_ord'; - readonly credit_first: Bool; - readonly storage_ph: Maybe; - readonly credit_ph: Maybe; - readonly compute_ph: TrComputePhase; - readonly action: Maybe; - readonly aborted: Bool; - readonly bounce: Maybe; - readonly destroyed: Bool; - }; -export interface TransactionDescr_trans_storage { - readonly kind: 'TransactionDescr_trans_storage'; - readonly storage_ph: TrStoragePhase; - }; -export interface TransactionDescr_trans_tick_tock { - readonly kind: 'TransactionDescr_trans_tick_tock'; - readonly is_tock: Bool; - readonly storage_ph: TrStoragePhase; - readonly compute_ph: TrComputePhase; - readonly action: Maybe; - readonly aborted: Bool; - readonly destroyed: Bool; - }; -export interface TransactionDescr_trans_split_prepare { - readonly kind: 'TransactionDescr_trans_split_prepare'; - readonly split_info: SplitMergeInfo; - readonly storage_ph: Maybe; - readonly compute_ph: TrComputePhase; - readonly action: Maybe; - readonly aborted: Bool; - readonly destroyed: Bool; - }; -export interface TransactionDescr_trans_split_install { - readonly kind: 'TransactionDescr_trans_split_install'; - readonly split_info: SplitMergeInfo; - readonly prepare_transaction: Transaction; - readonly installed: Bool; - }; -export interface TransactionDescr_trans_merge_prepare { - readonly kind: 'TransactionDescr_trans_merge_prepare'; - readonly split_info: SplitMergeInfo; - readonly storage_ph: TrStoragePhase; - readonly aborted: Bool; - }; -export interface TransactionDescr_trans_merge_install { - readonly kind: 'TransactionDescr_trans_merge_install'; - readonly split_info: SplitMergeInfo; - readonly prepare_transaction: Transaction; - readonly storage_ph: Maybe; - readonly credit_ph: Maybe; - readonly compute_ph: TrComputePhase; - readonly action: Maybe; - readonly aborted: Bool; - readonly destroyed: Bool; - }; -export interface SplitMergeInfo { - readonly kind: 'SplitMergeInfo'; - readonly cur_shard_pfx_len: number; - readonly acc_split_depth: number; - readonly this_addr: BitString; - readonly sibling_addr: BitString; - }; -export interface SmartContractInfo { - readonly kind: 'SmartContractInfo'; - readonly actions: number; - readonly msgs_sent: number; - readonly unixtime: number; - readonly block_lt: number; - readonly trans_lt: number; - readonly rand_seed: BitString; - readonly balance_remaining: CurrencyCollection; - readonly myself: MsgAddressInt; - }; -export type OutList = OutList_out_list_empty | OutList_out_list; -export interface OutList_out_list_empty { - readonly kind: 'OutList_out_list_empty'; - }; -export interface OutList_out_list { - readonly kind: 'OutList_out_list'; - readonly n: number; - readonly prev: OutList; - readonly action: OutAction; - }; -export type OutAction = OutAction_action_send_msg | OutAction_action_set_code | OutAction_action_reserve_currency | OutAction_action_change_library; -export interface OutAction_action_send_msg { - readonly kind: 'OutAction_action_send_msg'; - readonly mode: number; - readonly out_msg: MessageRelaxed; - }; -export interface OutAction_action_set_code { - readonly kind: 'OutAction_action_set_code'; - readonly new_code: Slice; - }; -export interface OutAction_action_reserve_currency { - readonly kind: 'OutAction_action_reserve_currency'; - readonly mode: number; - readonly currency: CurrencyCollection; - }; -export interface OutAction_action_change_library { - readonly kind: 'OutAction_action_change_library'; - readonly mode: number; - readonly libref: LibRef; - }; -export type LibRef = LibRef_libref_hash | LibRef_libref_ref; -export interface LibRef_libref_hash { - readonly kind: 'LibRef_libref_hash'; - readonly lib_hash: BitString; - }; -export interface LibRef_libref_ref { - readonly kind: 'LibRef_libref_ref'; - readonly library: Slice; - }; -export interface OutListNode { - readonly kind: 'OutListNode'; - readonly prev: Slice; - readonly action: OutAction; - }; -export interface ShardIdent { - readonly kind: 'ShardIdent'; - readonly shard_pfx_bits: number; - readonly workchain_id: number; - readonly shard_prefix: number; - }; -export interface ExtBlkRef { - readonly kind: 'ExtBlkRef'; - readonly end_lt: number; - readonly seq_no: number; - readonly root_hash: BitString; - readonly file_hash: BitString; - }; -export interface BlockIdExt { - readonly kind: 'BlockIdExt'; - readonly shard_id: ShardIdent; - readonly seq_no: number; - readonly root_hash: BitString; - readonly file_hash: BitString; - }; -export interface BlkMasterInfo { - readonly kind: 'BlkMasterInfo'; - readonly master: ExtBlkRef; - }; -export interface ShardStateUnsplit { - readonly kind: 'ShardStateUnsplit'; - readonly global_id: number; - readonly shard_id: ShardIdent; - readonly seq_no: number; - readonly vert_seq_no: number; - readonly gen_utime: number; - readonly gen_lt: number; - readonly min_ref_mc_seqno: number; - readonly out_msg_queue_info: OutMsgQueueInfo; - readonly before_split: number; - readonly accounts: ShardAccounts; - readonly overload_history: number; - readonly underload_history: number; - readonly total_balance: CurrencyCollection; - readonly total_validator_fees: CurrencyCollection; - readonly libraries: HashmapE; - readonly master_ref: Maybe; - readonly custom: Maybe; - }; -export type ShardState = ShardState__ | ShardState_split_state; -export interface ShardState__ { - readonly kind: 'ShardState__'; - readonly anon0: ShardStateUnsplit; - }; -export interface ShardState_split_state { - readonly kind: 'ShardState_split_state'; - readonly left: ShardStateUnsplit; - readonly right: ShardStateUnsplit; - }; -export interface LibDescr { - readonly kind: 'LibDescr'; - readonly lib: Slice; - readonly publishers: Hashmap; - }; -export interface BlockInfo { - readonly kind: 'BlockInfo'; - readonly version: number; - readonly not_master: number; - readonly after_merge: number; - readonly before_split: number; - readonly after_split: number; - readonly want_split: Bool; - readonly want_merge: Bool; - readonly key_block: Bool; - readonly vert_seqno_incr: number; - readonly flags: number; - readonly seq_no: number; - readonly vert_seq_no: number; - readonly prev_seq_no: number; - readonly shard: ShardIdent; - readonly gen_utime: number; - readonly start_lt: number; - readonly end_lt: number; - readonly gen_validator_list_hash_short: number; - readonly gen_catchain_seqno: number; - readonly min_ref_mc_seqno: number; - readonly prev_key_block_seqno: number; - readonly gen_software: GlobalVersion | undefined; - readonly master_ref: BlkMasterInfo | undefined; - readonly prev_ref: BlkPrevInfo; - readonly prev_vert_ref: BlkPrevInfo | undefined; - }; -export type BlkPrevInfo = BlkPrevInfo_prev_blk_info | BlkPrevInfo_prev_blks_info; -export interface BlkPrevInfo_prev_blk_info { - readonly kind: 'BlkPrevInfo_prev_blk_info'; - readonly prev: ExtBlkRef; - }; -export interface BlkPrevInfo_prev_blks_info { - readonly kind: 'BlkPrevInfo_prev_blks_info'; - readonly prev1: ExtBlkRef; - readonly prev2: ExtBlkRef; - }; -export interface Block { - readonly kind: 'Block'; - readonly global_id: number; - readonly info: BlockInfo; - readonly value_flow: ValueFlow; - readonly state_update: MERKLE_UPDATE; - readonly extra: BlockExtra; - }; -export interface BlockExtra { - readonly kind: 'BlockExtra'; - readonly in_msg_descr: InMsgDescr; - readonly out_msg_descr: OutMsgDescr; - readonly account_blocks: ShardAccountBlocks; - readonly rand_seed: BitString; - readonly created_by: BitString; - readonly custom: Maybe; - }; -export interface ValueFlow { - readonly kind: 'ValueFlow'; - readonly from_prev_blk: CurrencyCollection; - readonly to_next_blk: CurrencyCollection; - readonly imported: CurrencyCollection; - readonly exported: CurrencyCollection; - readonly fees_collected: CurrencyCollection; - readonly fees_imported: CurrencyCollection; - readonly recovered: CurrencyCollection; - readonly created: CurrencyCollection; - readonly minted: CurrencyCollection; - }; -export type BinTree = BinTree_bt_leaf | BinTree_bt_fork; -export interface BinTree_bt_leaf { - readonly kind: 'BinTree_bt_leaf'; - readonly leaf: X; - }; -export interface BinTree_bt_fork { - readonly kind: 'BinTree_bt_fork'; - readonly left: BinTree; - readonly right: BinTree; - }; -export type FutureSplitMerge = FutureSplitMerge_fsm_none | FutureSplitMerge_fsm_split | FutureSplitMerge_fsm_merge; -export interface FutureSplitMerge_fsm_none { - readonly kind: 'FutureSplitMerge_fsm_none'; - }; -export interface FutureSplitMerge_fsm_split { - readonly kind: 'FutureSplitMerge_fsm_split'; - readonly split_utime: number; - readonly interval: number; - }; -export interface FutureSplitMerge_fsm_merge { - readonly kind: 'FutureSplitMerge_fsm_merge'; - readonly merge_utime: number; - readonly interval: number; - }; -export type ShardDescr = ShardDescr_shard_descr | ShardDescr_shard_descr_new; -export interface ShardDescr_shard_descr { - readonly kind: 'ShardDescr_shard_descr'; - readonly seq_no: number; - readonly reg_mc_seqno: number; - readonly start_lt: number; - readonly end_lt: number; - readonly root_hash: BitString; - readonly file_hash: BitString; - readonly before_split: Bool; - readonly before_merge: Bool; - readonly want_split: Bool; - readonly want_merge: Bool; - readonly nx_cc_updated: Bool; - readonly flags: number; - readonly next_catchain_seqno: number; - readonly next_validator_shard: number; - readonly min_ref_mc_seqno: number; - readonly gen_utime: number; - readonly split_merge_at: FutureSplitMerge; - readonly fees_collected: CurrencyCollection; - readonly funds_created: CurrencyCollection; - }; -export interface ShardDescr_shard_descr_new { - readonly kind: 'ShardDescr_shard_descr_new'; - readonly seq_no: number; - readonly reg_mc_seqno: number; - readonly start_lt: number; - readonly end_lt: number; - readonly root_hash: BitString; - readonly file_hash: BitString; - readonly before_split: Bool; - readonly before_merge: Bool; - readonly want_split: Bool; - readonly want_merge: Bool; - readonly nx_cc_updated: Bool; - readonly flags: number; - readonly next_catchain_seqno: number; - readonly next_validator_shard: number; - readonly min_ref_mc_seqno: number; - readonly gen_utime: number; - readonly split_merge_at: FutureSplitMerge; - readonly fees_collected: CurrencyCollection; - readonly funds_created: CurrencyCollection; - }; -export interface ShardHashes { - readonly kind: 'ShardHashes'; - readonly anon0: HashmapE>; - }; -export type BinTreeAug = BinTreeAug_bta_leaf | BinTreeAug_bta_fork; -export interface BinTreeAug_bta_leaf { - readonly kind: 'BinTreeAug_bta_leaf'; - readonly extra: Y; - readonly leaf: X; - }; -export interface BinTreeAug_bta_fork { - readonly kind: 'BinTreeAug_bta_fork'; - readonly left: BinTreeAug; - readonly right: BinTreeAug; - readonly extra: Y; - }; -export interface ShardFeeCreated { - readonly kind: 'ShardFeeCreated'; - readonly fees: CurrencyCollection; - readonly create: CurrencyCollection; - }; -export interface ShardFees { - readonly kind: 'ShardFees'; - readonly anon0: HashmapAugE; - }; -export interface ConfigParams { - readonly kind: 'ConfigParams'; - readonly config_addr: BitString; - readonly config: Hashmap; - }; -export interface ValidatorInfo { - readonly kind: 'ValidatorInfo'; - readonly validator_list_hash_short: number; - readonly catchain_seqno: number; - readonly nx_cc_updated: Bool; - }; -export interface ValidatorBaseInfo { - readonly kind: 'ValidatorBaseInfo'; - readonly validator_list_hash_short: number; - readonly catchain_seqno: number; - }; -export interface KeyMaxLt { - readonly kind: 'KeyMaxLt'; - readonly key: Bool; - readonly max_end_lt: number; - }; -export interface KeyExtBlkRef { - readonly kind: 'KeyExtBlkRef'; - readonly key: Bool; - readonly blk_ref: ExtBlkRef; - }; -export interface OldMcBlocksInfo { - readonly kind: 'OldMcBlocksInfo'; - readonly anon0: HashmapAugE; - }; -export interface Counters { - readonly kind: 'Counters'; - readonly last_updated: number; - readonly total: number; - readonly cnt2048: number; - readonly cnt65536: number; - }; -export interface CreatorStats { - readonly kind: 'CreatorStats'; - readonly mc_blocks: Counters; - readonly shard_blocks: Counters; - }; -export type BlockCreateStats = BlockCreateStats_block_create_stats | BlockCreateStats_block_create_stats_ext; -export interface BlockCreateStats_block_create_stats { - readonly kind: 'BlockCreateStats_block_create_stats'; - readonly counters: HashmapE; - }; -export interface BlockCreateStats_block_create_stats_ext { - readonly kind: 'BlockCreateStats_block_create_stats_ext'; - readonly counters: HashmapAugE; - }; -export interface McStateExtra { - readonly kind: 'McStateExtra'; - readonly shard_hashes: ShardHashes; - readonly config: ConfigParams; - readonly flags: number; - readonly validator_info: ValidatorInfo; - readonly prev_blocks: OldMcBlocksInfo; - readonly after_key_block: Bool; - readonly last_key_block: Maybe; - readonly block_create_stats: BlockCreateStats | undefined; - readonly global_balance: CurrencyCollection; - }; -export interface SigPubKey { - readonly kind: 'SigPubKey'; - readonly pubkey: BitString; - }; -export interface CryptoSignatureSimple { - readonly kind: 'CryptoSignatureSimple'; - readonly R: BitString; - readonly s: BitString; - }; -export type CryptoSignature = CryptoSignature__ | CryptoSignature_chained_signature; -export interface CryptoSignature__ { - readonly kind: 'CryptoSignature__'; - readonly anon0: CryptoSignatureSimple; - }; -export interface CryptoSignature_chained_signature { - readonly kind: 'CryptoSignature_chained_signature'; - readonly signed_cert: SignedCertificate; - readonly temp_key_signature: CryptoSignatureSimple; - }; -export interface CryptoSignaturePair { - readonly kind: 'CryptoSignaturePair'; - readonly node_id_short: BitString; - readonly sign: CryptoSignature; - }; -export interface Certificate { - readonly kind: 'Certificate'; - readonly temp_key: SigPubKey; - readonly valid_since: number; - readonly valid_until: number; - }; -export interface CertificateEnv { - readonly kind: 'CertificateEnv'; - readonly certificate: Certificate; - }; -export interface SignedCertificate { - readonly kind: 'SignedCertificate'; - readonly certificate: Certificate; - readonly certificate_signature: CryptoSignature; - }; -export interface McBlockExtra { - readonly kind: 'McBlockExtra'; - readonly key_block: number; - readonly shard_hashes: ShardHashes; - readonly shard_fees: ShardFees; - readonly prev_blk_signatures: HashmapE; - readonly recover_create_msg: Maybe; - readonly mint_msg: Maybe; - readonly config: ConfigParams | undefined; - }; -export type ValidatorDescr = ValidatorDescr_validator | ValidatorDescr_validator_addr; -export interface ValidatorDescr_validator { - readonly kind: 'ValidatorDescr_validator'; - readonly public_key: SigPubKey; - readonly weight: number; - }; -export interface ValidatorDescr_validator_addr { - readonly kind: 'ValidatorDescr_validator_addr'; - readonly public_key: SigPubKey; - readonly weight: number; - readonly adnl_addr: BitString; - }; -export type ValidatorSet = ValidatorSet_validators | ValidatorSet_validators_ext; -export interface ValidatorSet_validators { - readonly kind: 'ValidatorSet_validators'; - readonly utime_since: number; - readonly utime_until: number; - readonly total: number; - readonly main: number; - readonly list: Hashmap; - }; -export interface ValidatorSet_validators_ext { - readonly kind: 'ValidatorSet_validators_ext'; - readonly utime_since: number; - readonly utime_until: number; - readonly total: number; - readonly main: number; - readonly total_weight: number; - readonly list: HashmapE; - }; -export type ConfigParam = ConfigParam__ | ConfigParam__1 | ConfigParam__2 | ConfigParam__3 | ConfigParam__4 | ConfigParam__5 | ConfigParam__6 | ConfigParam__7 | ConfigParam__8 | ConfigParam__9 | ConfigParam__10 | ConfigParam__11 | ConfigParam__12 | ConfigParam__13 | ConfigParam__14 | ConfigParam__15 | ConfigParam__16 | ConfigParam__17 | ConfigParam__24 | ConfigParam__25 | ConfigParam__26 | ConfigParam__27 | ConfigParam__28 | ConfigParam__29 | ConfigParam__30 | ConfigParam__31 | ConfigParam__32 | ConfigParam__33 | ConfigParam__34 | ConfigParam__35 | ConfigParam__36 | ConfigParam__37 | ConfigParam_config_mc_gas_prices | ConfigParam_config_gas_prices | ConfigParam_config_mc_block_limits | ConfigParam_config_block_limits | ConfigParam_config_mc_fwd_prices | ConfigParam_config_fwd_prices; -export interface ConfigParam__ { - readonly kind: 'ConfigParam__'; - readonly config_addr: BitString; - }; -export interface ConfigParam__1 { - readonly kind: 'ConfigParam__1'; - readonly elector_addr: BitString; - }; -export interface ConfigParam__2 { - readonly kind: 'ConfigParam__2'; - readonly minter_addr: BitString; - }; -export interface ConfigParam__3 { - readonly kind: 'ConfigParam__3'; - readonly fee_collector_addr: BitString; - }; -export interface ConfigParam__4 { - readonly kind: 'ConfigParam__4'; - readonly dns_root_addr: BitString; - }; -export interface ConfigParam__5 { - readonly kind: 'ConfigParam__5'; - readonly mint_new_price: Grams; - readonly mint_add_price: Grams; - }; -export interface ConfigParam__6 { - readonly kind: 'ConfigParam__6'; - readonly to_mint: ExtraCurrencyCollection; - }; -export interface ConfigParam__7 { - readonly kind: 'ConfigParam__7'; - readonly anon0: GlobalVersion; - }; -export interface ConfigParam__8 { - readonly kind: 'ConfigParam__8'; - readonly mandatory_params: Hashmap; - }; -export interface ConfigParam__9 { - readonly kind: 'ConfigParam__9'; - readonly critical_params: Hashmap; - }; -export interface ConfigParam__10 { - readonly kind: 'ConfigParam__10'; - readonly anon0: ConfigVotingSetup; - }; -export interface ConfigParam__11 { - readonly kind: 'ConfigParam__11'; - readonly workchains: HashmapE; - }; -export interface ConfigParam__12 { - readonly kind: 'ConfigParam__12'; - readonly anon0: ComplaintPricing; - }; -export interface ConfigParam__13 { - readonly kind: 'ConfigParam__13'; - readonly anon0: BlockCreateFees; - }; -export interface ConfigParam__14 { - readonly kind: 'ConfigParam__14'; - readonly validators_elected_for: number; - readonly elections_start_before: number; - readonly elections_end_before: number; - readonly stake_held_for: number; - }; -export interface ConfigParam__15 { - readonly kind: 'ConfigParam__15'; - readonly max_validators: number; - readonly max_main_validators: number; - readonly min_validators: number; - }; -export interface ConfigParam__16 { - readonly kind: 'ConfigParam__16'; - readonly min_stake: Grams; - readonly max_stake: Grams; - readonly min_total_stake: Grams; - readonly max_stake_factor: number; - }; -export interface ConfigParam__17 { - readonly kind: 'ConfigParam__17'; - readonly anon0: Hashmap; - }; -export interface ConfigParam__24 { - readonly kind: 'ConfigParam__24'; - readonly anon0: CatchainConfig; - }; -export interface ConfigParam__25 { - readonly kind: 'ConfigParam__25'; - readonly anon0: ConsensusConfig; - }; -export interface ConfigParam__26 { - readonly kind: 'ConfigParam__26'; - readonly fundamental_smc_addr: HashmapE; - }; -export interface ConfigParam__27 { - readonly kind: 'ConfigParam__27'; - readonly prev_validators: ValidatorSet; - }; -export interface ConfigParam__28 { - readonly kind: 'ConfigParam__28'; - readonly prev_temp_validators: ValidatorSet; - }; -export interface ConfigParam__29 { - readonly kind: 'ConfigParam__29'; - readonly cur_validators: ValidatorSet; - }; -export interface ConfigParam__30 { - readonly kind: 'ConfigParam__30'; - readonly cur_temp_validators: ValidatorSet; - }; -export interface ConfigParam__31 { - readonly kind: 'ConfigParam__31'; - readonly next_validators: ValidatorSet; - }; -export interface ConfigParam__32 { - readonly kind: 'ConfigParam__32'; - readonly next_temp_validators: ValidatorSet; - }; -export interface ConfigParam__33 { - readonly kind: 'ConfigParam__33'; - readonly anon0: HashmapE; - }; -export interface ConfigParam__34 { - readonly kind: 'ConfigParam__34'; - readonly anon0: MisbehaviourPunishmentConfig; - }; -export interface ConfigParam__35 { - readonly kind: 'ConfigParam__35'; - readonly anon0: OracleBridgeParams; - }; -export interface ConfigParam__36 { - readonly kind: 'ConfigParam__36'; - readonly anon0: OracleBridgeParams; - }; -export interface ConfigParam__37 { - readonly kind: 'ConfigParam__37'; - readonly anon0: OracleBridgeParams; - }; -export interface ConfigParam_config_mc_gas_prices { - readonly kind: 'ConfigParam_config_mc_gas_prices'; - readonly anon0: GasLimitsPrices; - }; -export interface ConfigParam_config_gas_prices { - readonly kind: 'ConfigParam_config_gas_prices'; - readonly anon0: GasLimitsPrices; - }; -export interface ConfigParam_config_mc_block_limits { - readonly kind: 'ConfigParam_config_mc_block_limits'; - readonly anon0: BlockLimits; - }; -export interface ConfigParam_config_block_limits { - readonly kind: 'ConfigParam_config_block_limits'; - readonly anon0: BlockLimits; - }; -export interface ConfigParam_config_mc_fwd_prices { - readonly kind: 'ConfigParam_config_mc_fwd_prices'; - readonly anon0: MsgForwardPrices; - }; -export interface ConfigParam_config_fwd_prices { - readonly kind: 'ConfigParam_config_fwd_prices'; - readonly anon0: MsgForwardPrices; - }; -export interface GlobalVersion { - readonly kind: 'GlobalVersion'; - readonly version: number; - readonly capabilities: number; - }; -export interface ConfigProposalSetup { - readonly kind: 'ConfigProposalSetup'; - readonly min_tot_rounds: number; - readonly max_tot_rounds: number; - readonly min_wins: number; - readonly max_losses: number; - readonly min_store_sec: number; - readonly max_store_sec: number; - readonly bit_price: number; - readonly _cell_price: number; - }; -export interface ConfigVotingSetup { - readonly kind: 'ConfigVotingSetup'; - readonly normal_params: ConfigProposalSetup; - readonly critical_params: ConfigProposalSetup; - }; -export interface ConfigProposal { - readonly kind: 'ConfigProposal'; - readonly param_id: number; - readonly param_value: Maybe; - readonly if_hash_equal: Maybe; - }; -export interface ConfigProposalStatus { - readonly kind: 'ConfigProposalStatus'; - readonly expires: number; - readonly proposal: ConfigProposal; - readonly is_critical: Bool; - readonly voters: HashmapE; - readonly remaining_weight: number; - readonly validator_set_id: number; - readonly rounds_remaining: number; - readonly wins: number; - readonly losses: number; - }; -export type WorkchainFormat = WorkchainFormat_wfmt_basic | WorkchainFormat_wfmt_ext; -export interface WorkchainFormat_wfmt_basic { - readonly kind: 'WorkchainFormat_wfmt_basic'; - readonly vm_version: number; - readonly vm_mode: number; - }; -export interface WorkchainFormat_wfmt_ext { - readonly kind: 'WorkchainFormat_wfmt_ext'; - readonly min_addr_len: number; - readonly max_addr_len: number; - readonly addr_len_step: number; - readonly workchain_type_id: number; - }; -export interface WorkchainDescr { - readonly kind: 'WorkchainDescr'; - readonly enabled_since: number; - readonly actual_min_split: number; - readonly min_split: number; - readonly max_split: number; - readonly basic: number; - readonly active: Bool; - readonly accept_msgs: Bool; - readonly flags: number; - readonly zerostate_root_hash: BitString; - readonly zerostate_file_hash: BitString; - readonly version: number; - readonly format: WorkchainFormat; - }; -export interface ComplaintPricing { - readonly kind: 'ComplaintPricing'; - readonly deposit: Grams; - readonly bit_price: Grams; - readonly _cell_price: Grams; - }; -export interface BlockCreateFees { - readonly kind: 'BlockCreateFees'; - readonly masterchain_block_fee: Grams; - readonly basechain_block_fee: Grams; - }; -export interface StoragePrices { - readonly kind: 'StoragePrices'; - readonly utime_since: number; - readonly bit_price_ps: number; - readonly _cell_price_ps: number; - readonly mc_bit_price_ps: number; - readonly mc_cell_price_ps: number; - }; -export type GasLimitsPrices = GasLimitsPrices_gas_prices | GasLimitsPrices_gas_prices_ext | GasLimitsPrices_gas_flat_pfx; -export interface GasLimitsPrices_gas_prices { - readonly kind: 'GasLimitsPrices_gas_prices'; - readonly gas_price: number; - readonly gas_limit: number; - readonly gas_credit: number; - readonly block_gas_limit: number; - readonly freeze_due_limit: number; - readonly delete_due_limit: number; - }; -export interface GasLimitsPrices_gas_prices_ext { - readonly kind: 'GasLimitsPrices_gas_prices_ext'; - readonly gas_price: number; - readonly gas_limit: number; - readonly special_gas_limit: number; - readonly gas_credit: number; - readonly block_gas_limit: number; - readonly freeze_due_limit: number; - readonly delete_due_limit: number; - }; -export interface GasLimitsPrices_gas_flat_pfx { - readonly kind: 'GasLimitsPrices_gas_flat_pfx'; - readonly flat_gas_limit: number; - readonly flat_gas_price: number; - readonly other: GasLimitsPrices; - }; -export interface ParamLimits { - readonly kind: 'ParamLimits'; - readonly underload: number; - readonly soft_limit: number; - readonly hard_limit: number; - }; -export interface BlockLimits { - readonly kind: 'BlockLimits'; - readonly bytes: ParamLimits; - readonly gas: ParamLimits; - readonly lt_delta: ParamLimits; - }; -export interface MsgForwardPrices { - readonly kind: 'MsgForwardPrices'; - readonly lump_price: number; - readonly bit_price: number; - readonly _cell_price: number; - readonly ihr_price_factor: number; - readonly first_frac: number; - readonly next_frac: number; - }; -export type CatchainConfig = CatchainConfig_catchain_config | CatchainConfig_catchain_config_new; -export interface CatchainConfig_catchain_config { - readonly kind: 'CatchainConfig_catchain_config'; - readonly mc_catchain_lifetime: number; - readonly shard_catchain_lifetime: number; - readonly shard_validators_lifetime: number; - readonly shard_validators_num: number; - }; -export interface CatchainConfig_catchain_config_new { - readonly kind: 'CatchainConfig_catchain_config_new'; - readonly flags: number; - readonly shuffle_mc_validators: Bool; - readonly mc_catchain_lifetime: number; - readonly shard_catchain_lifetime: number; - readonly shard_validators_lifetime: number; - readonly shard_validators_num: number; - }; -export type ConsensusConfig = ConsensusConfig_consensus_config | ConsensusConfig_consensus_config_new | ConsensusConfig_consensus_config_v3 | ConsensusConfig_consensus_config_v4; -export interface ConsensusConfig_consensus_config { - readonly kind: 'ConsensusConfig_consensus_config'; - readonly round_candidates: number; - readonly next_candidate_delay_ms: number; - readonly consensus_timeout_ms: number; - readonly fast_attempts: number; - readonly attempt_duration: number; - readonly catchain_max_deps: number; - readonly max_block_bytes: number; - readonly max_collated_bytes: number; - }; -export interface ConsensusConfig_consensus_config_new { - readonly kind: 'ConsensusConfig_consensus_config_new'; - readonly flags: number; - readonly new_catchain_ids: Bool; - readonly round_candidates: number; - readonly next_candidate_delay_ms: number; - readonly consensus_timeout_ms: number; - readonly fast_attempts: number; - readonly attempt_duration: number; - readonly catchain_max_deps: number; - readonly max_block_bytes: number; - readonly max_collated_bytes: number; - }; -export interface ConsensusConfig_consensus_config_v3 { - readonly kind: 'ConsensusConfig_consensus_config_v3'; - readonly flags: number; - readonly new_catchain_ids: Bool; - readonly round_candidates: number; - readonly next_candidate_delay_ms: number; - readonly consensus_timeout_ms: number; - readonly fast_attempts: number; - readonly attempt_duration: number; - readonly catchain_max_deps: number; - readonly max_block_bytes: number; - readonly max_collated_bytes: number; - readonly proto_version: number; - }; -export interface ConsensusConfig_consensus_config_v4 { - readonly kind: 'ConsensusConfig_consensus_config_v4'; - readonly flags: number; - readonly new_catchain_ids: Bool; - readonly round_candidates: number; - readonly next_candidate_delay_ms: number; - readonly consensus_timeout_ms: number; - readonly fast_attempts: number; - readonly attempt_duration: number; - readonly catchain_max_deps: number; - readonly max_block_bytes: number; - readonly max_collated_bytes: number; - readonly proto_version: number; - readonly catchain_max_blocks_coeff: number; - }; -export interface ValidatorTempKey { - readonly kind: 'ValidatorTempKey'; - readonly adnl_addr: BitString; - readonly temp_public_key: SigPubKey; - readonly seqno: number; - readonly valid_until: number; - }; -export interface ValidatorSignedTempKey { - readonly kind: 'ValidatorSignedTempKey'; - readonly key: ValidatorTempKey; - readonly signature: CryptoSignature; - }; -export interface MisbehaviourPunishmentConfig { - readonly kind: 'MisbehaviourPunishmentConfig'; - readonly default_flat_fine: Grams; - readonly default_proportional_fine: number; - readonly severity_flat_mult: number; - readonly severity_proportional_mult: number; - readonly unpunishable_interval: number; - readonly long_interval: number; - readonly long_flat_mult: number; - readonly long_proportional_mult: number; - readonly medium_interval: number; - readonly medium_flat_mult: number; - readonly medium_proportional_mult: number; - }; -export interface OracleBridgeParams { - readonly kind: 'OracleBridgeParams'; - readonly bridge_address: BitString; - readonly oracle_mutlisig_address: BitString; - readonly oracles: HashmapE; - readonly external_chain_address: BitString; - }; -export interface BlockSignaturesPure { - readonly kind: 'BlockSignaturesPure'; - readonly sig_count: number; - readonly sig_weight: number; - readonly signatures: HashmapE; - }; -export interface BlockSignatures { - readonly kind: 'BlockSignatures'; - readonly validator_info: ValidatorBaseInfo; - readonly pure_signatures: BlockSignaturesPure; - }; -export interface BlockProof { - readonly kind: 'BlockProof'; - readonly proof_for: BlockIdExt; - readonly root: Slice; - readonly signatures: Maybe; - }; -export type ProofChain = ProofChain_chain_empty | ProofChain_chain_link; -export interface ProofChain_chain_empty { - readonly kind: 'ProofChain_chain_empty'; - }; -export interface ProofChain_chain_link { - readonly kind: 'ProofChain_chain_link'; - readonly n: number; - readonly root: Slice; - readonly prev: ProofChain | undefined; - }; -export interface TopBlockDescr { - readonly kind: 'TopBlockDescr'; - readonly proof_for: BlockIdExt; - readonly signatures: Maybe; - readonly len: number; - readonly chain: ProofChain; - }; -export interface TopBlockDescrSet { - readonly kind: 'TopBlockDescrSet'; - readonly collection: HashmapE; - }; -export interface ProducerInfo { - readonly kind: 'ProducerInfo'; - readonly utime: number; - readonly mc_blk_ref: ExtBlkRef; - readonly state_proof: MERKLE_PROOF; - readonly prod_proof: MERKLE_PROOF; - }; -export type ComplaintDescr = ComplaintDescr_no_blk_gen | ComplaintDescr_no_blk_gen_diff; -export interface ComplaintDescr_no_blk_gen { - readonly kind: 'ComplaintDescr_no_blk_gen'; - readonly from_utime: number; - readonly prod_info: ProducerInfo; - }; -export interface ComplaintDescr_no_blk_gen_diff { - readonly kind: 'ComplaintDescr_no_blk_gen_diff'; - readonly prod_info_old: ProducerInfo; - readonly prod_info_new: ProducerInfo; - }; -export interface ValidatorComplaint { - readonly kind: 'ValidatorComplaint'; - readonly validator_pubkey: BitString; - readonly description: ComplaintDescr; - readonly created_at: number; - readonly severity: number; - readonly reward_addr: number; - readonly paid: Grams; - readonly suggested_fine: Grams; - readonly suggested_fine_part: number; - }; -export interface ValidatorComplaintStatus { - readonly kind: 'ValidatorComplaintStatus'; - readonly complaint: ValidatorComplaint; - readonly voters: HashmapE; - readonly vset_id: number; - readonly weight_remaining: number; - }; -export type VmStackValue = VmStackValue_vm_stk_null | VmStackValue_vm_stk_tinyint | VmStackValue_vm_stk_int | VmStackValue_vm_stk_nan | VmStackValue_vm_stk_cell | VmStackValue_vm_stk_slice | VmStackValue_vm_stk_builder | VmStackValue_vm_stk_cont | VmStackValue_vm_stk_tuple; -export interface VmStackValue_vm_stk_null { - readonly kind: 'VmStackValue_vm_stk_null'; - }; -export interface VmStackValue_vm_stk_tinyint { - readonly kind: 'VmStackValue_vm_stk_tinyint'; - readonly value: number; - }; -export interface VmStackValue_vm_stk_int { - readonly kind: 'VmStackValue_vm_stk_int'; - readonly value: number; - }; -export interface VmStackValue_vm_stk_nan { - readonly kind: 'VmStackValue_vm_stk_nan'; - }; -export interface VmStackValue_vm_stk_cell { - readonly kind: 'VmStackValue_vm_stk_cell'; - readonly _cell: Slice; - }; -export interface VmStackValue_vm_stk_slice { - readonly kind: 'VmStackValue_vm_stk_slice'; - readonly _: VmCellSlice; - }; -export interface VmStackValue_vm_stk_builder { - readonly kind: 'VmStackValue_vm_stk_builder'; - readonly _cell: Slice; - }; -export interface VmStackValue_vm_stk_cont { - readonly kind: 'VmStackValue_vm_stk_cont'; - readonly cont: VmCont; - }; -export interface VmStackValue_vm_stk_tuple { - readonly kind: 'VmStackValue_vm_stk_tuple'; - readonly len: number; - readonly data: VmTuple; - }; -export interface VmCellSlice { - readonly kind: 'VmCellSlice'; - readonly _cell: Slice; - readonly st_bits: number; - readonly end_bits: number; - readonly st_ref: number; - readonly end_ref: number; - }; -export type VmTupleRef = VmTupleRef_vm_tupref_nil | VmTupleRef_vm_tupref_single | VmTupleRef_vm_tupref_any; -export interface VmTupleRef_vm_tupref_nil { - readonly kind: 'VmTupleRef_vm_tupref_nil'; - }; -export interface VmTupleRef_vm_tupref_single { - readonly kind: 'VmTupleRef_vm_tupref_single'; - readonly entry: VmStackValue; - }; -export interface VmTupleRef_vm_tupref_any { - readonly kind: 'VmTupleRef_vm_tupref_any'; - readonly n: number; - readonly ref: VmTuple; - }; -export type VmTuple = VmTuple_vm_tuple_nil | VmTuple_vm_tuple_tcons; -export interface VmTuple_vm_tuple_nil { - readonly kind: 'VmTuple_vm_tuple_nil'; - }; -export interface VmTuple_vm_tuple_tcons { - readonly kind: 'VmTuple_vm_tuple_tcons'; - readonly n: number; - readonly head: VmTupleRef; - readonly tail: VmStackValue; - }; -export interface VmStack { - readonly kind: 'VmStack'; - readonly depth: number; - readonly stack: VmStackList; - }; -export type VmStackList = VmStackList_vm_stk_nil | VmStackList_vm_stk_cons; -export interface VmStackList_vm_stk_nil { - readonly kind: 'VmStackList_vm_stk_nil'; - }; -export interface VmStackList_vm_stk_cons { - readonly kind: 'VmStackList_vm_stk_cons'; - readonly n: number; - readonly rest: VmStackList; - readonly tos: VmStackValue; - }; -export interface VmSaveList { - readonly kind: 'VmSaveList'; - readonly cregs: HashmapE; - }; -export interface VmGasLimits { - readonly kind: 'VmGasLimits'; - readonly remaining: number; - readonly max_limit: number; - readonly cur_limit: number; - readonly credit: number; - }; -export interface VmLibraries { - readonly kind: 'VmLibraries'; - readonly libraries: HashmapE; - }; -export interface VmControlData { - readonly kind: 'VmControlData'; - readonly nargs: Maybe; - readonly stack: Maybe; - readonly save: VmSaveList; - readonly cp: Maybe; - }; -export type VmCont = VmCont_vmc_std | VmCont_vmc_envelope | VmCont_vmc_quit | VmCont_vmc_quit_exc | VmCont_vmc_repeat | VmCont_vmc_until | VmCont_vmc_again | VmCont_vmc_while_cond | VmCont_vmc_while_body | VmCont_vmc_pushint; -export interface VmCont_vmc_std { - readonly kind: 'VmCont_vmc_std'; - readonly cdata: VmControlData; - readonly code: VmCellSlice; - }; -export interface VmCont_vmc_envelope { - readonly kind: 'VmCont_vmc_envelope'; - readonly cdata: VmControlData; - readonly next: VmCont; - }; -export interface VmCont_vmc_quit { - readonly kind: 'VmCont_vmc_quit'; - readonly exit_code: number; - }; -export interface VmCont_vmc_quit_exc { - readonly kind: 'VmCont_vmc_quit_exc'; - }; -export interface VmCont_vmc_repeat { - readonly kind: 'VmCont_vmc_repeat'; - readonly count: number; - readonly body: VmCont; - readonly after: VmCont; - }; -export interface VmCont_vmc_until { - readonly kind: 'VmCont_vmc_until'; - readonly body: VmCont; - readonly after: VmCont; - }; -export interface VmCont_vmc_again { - readonly kind: 'VmCont_vmc_again'; - readonly body: VmCont; - }; -export interface VmCont_vmc_while_cond { - readonly kind: 'VmCont_vmc_while_cond'; - readonly cond: VmCont; - readonly body: VmCont; - readonly after: VmCont; - }; -export interface VmCont_vmc_while_body { - readonly kind: 'VmCont_vmc_while_body'; - readonly cond: VmCont; - readonly body: VmCont; - readonly after: VmCont; - }; -export interface VmCont_vmc_pushint { - readonly kind: 'VmCont_vmc_pushint'; - readonly value: number; - readonly next: VmCont; - }; -export interface DNS_RecordSet { - readonly kind: 'DNS_RecordSet'; - readonly anon0: HashmapE; - }; -export type TextChunkRef = TextChunkRef_chunk_ref_empty | TextChunkRef_chunk_ref; -export interface TextChunkRef_chunk_ref_empty { - readonly kind: 'TextChunkRef_chunk_ref_empty'; - }; -export interface TextChunkRef_chunk_ref { - readonly kind: 'TextChunkRef_chunk_ref'; - readonly n: number; - readonly ref: TextChunks; - }; -export type TextChunks = TextChunks_text_chunk_empty | TextChunks_text_chunk; -export interface TextChunks_text_chunk_empty { - readonly kind: 'TextChunks_text_chunk_empty'; - }; -export interface TextChunks_text_chunk { - readonly kind: 'TextChunks_text_chunk'; - readonly n: number; - readonly len: number; - readonly data: BitString; - readonly next: TextChunkRef; - }; -export interface Text { - readonly kind: 'Text'; - readonly chunks: number; - readonly rest: TextChunks; - }; -export type DNSRecord = DNSRecord_dns_text | DNSRecord_dns_next_resolver | DNSRecord_dns_adnl_address | DNSRecord_dns_smc_address; -export interface DNSRecord_dns_text { - readonly kind: 'DNSRecord_dns_text'; - readonly _: Text; - }; -export interface DNSRecord_dns_next_resolver { - readonly kind: 'DNSRecord_dns_next_resolver'; - readonly resolver: MsgAddressInt; - }; -export interface DNSRecord_dns_adnl_address { - readonly kind: 'DNSRecord_dns_adnl_address'; - readonly adnl_addr: BitString; - readonly flags: number; - readonly proto_list: ProtoList | undefined; - }; -export interface DNSRecord_dns_smc_address { - readonly kind: 'DNSRecord_dns_smc_address'; - readonly smc_addr: MsgAddressInt; - readonly flags: number; - readonly cap_list: SmcCapList | undefined; - }; -export type ProtoList = ProtoList_proto_list_nil | ProtoList_proto_list_next; -export interface ProtoList_proto_list_nil { - readonly kind: 'ProtoList_proto_list_nil'; - }; -export interface ProtoList_proto_list_next { - readonly kind: 'ProtoList_proto_list_next'; - readonly head: Protocol; - readonly tail: ProtoList; - }; -export interface Protocol { - readonly kind: 'Protocol'; - }; -export type SmcCapList = SmcCapList_cap_list_nil | SmcCapList_cap_list_next; -export interface SmcCapList_cap_list_nil { - readonly kind: 'SmcCapList_cap_list_nil'; - }; -export interface SmcCapList_cap_list_next { - readonly kind: 'SmcCapList_cap_list_next'; - readonly head: SmcCapability; - readonly tail: SmcCapList; - }; -export type SmcCapability = SmcCapability_cap_method_seqno | SmcCapability_cap_method_pubkey | SmcCapability_cap_is_wallet | SmcCapability_cap_name; -export interface SmcCapability_cap_method_seqno { - readonly kind: 'SmcCapability_cap_method_seqno'; - }; -export interface SmcCapability_cap_method_pubkey { - readonly kind: 'SmcCapability_cap_method_pubkey'; - }; -export interface SmcCapability_cap_is_wallet { - readonly kind: 'SmcCapability_cap_is_wallet'; - }; -export interface SmcCapability_cap_name { - readonly kind: 'SmcCapability_cap_name'; - readonly name: Text; - }; -export interface ChanConfig { - readonly kind: 'ChanConfig'; - readonly init_timeout: number; - readonly close_timeout: number; - readonly a_key: BitString; - readonly b_key: BitString; - readonly a_addr: MsgAddressInt; - readonly b_addr: MsgAddressInt; - readonly channel_id: number; - readonly min_A_extra: Grams; - }; -export type ChanState = ChanState_chan_state_init | ChanState_chan_state_close | ChanState_chan_state_payout; -export interface ChanState_chan_state_init { - readonly kind: 'ChanState_chan_state_init'; - readonly signed_A: Bool; - readonly signed_B: Bool; - readonly min_A: Grams; - readonly min_B: Grams; - readonly expire_at: number; - readonly A: Grams; - readonly B: Grams; - }; -export interface ChanState_chan_state_close { - readonly kind: 'ChanState_chan_state_close'; - readonly signed_A: Bool; - readonly signed_B: Bool; - readonly promise_A: Grams; - readonly promise_B: Grams; - readonly expire_at: number; - readonly A: Grams; - readonly B: Grams; - }; -export interface ChanState_chan_state_payout { - readonly kind: 'ChanState_chan_state_payout'; - readonly A: Grams; - readonly B: Grams; - }; -export interface ChanPromise { - readonly kind: 'ChanPromise'; - readonly channel_id: number; - readonly promise_A: Grams; - readonly promise_B: Grams; - }; -export interface ChanSignedPromise { - readonly kind: 'ChanSignedPromise'; - readonly sig: Maybe; - readonly promise: ChanPromise; - }; -export type ChanMsg = ChanMsg_chan_msg_init | ChanMsg_chan_msg_close | ChanMsg_chan_msg_timeout | ChanMsg_chan_msg_payout; -export interface ChanMsg_chan_msg_init { - readonly kind: 'ChanMsg_chan_msg_init'; - readonly inc_A: Grams; - readonly inc_B: Grams; - readonly min_A: Grams; - readonly min_B: Grams; - readonly channel_id: number; - }; -export interface ChanMsg_chan_msg_close { - readonly kind: 'ChanMsg_chan_msg_close'; - readonly extra_A: Grams; - readonly extra_B: Grams; - readonly promise: ChanSignedPromise; - }; -export interface ChanMsg_chan_msg_timeout { - readonly kind: 'ChanMsg_chan_msg_timeout'; - }; -export interface ChanMsg_chan_msg_payout { - readonly kind: 'ChanMsg_chan_msg_payout'; - }; -export interface ChanSignedMsg { - readonly kind: 'ChanSignedMsg'; - readonly sig_A: Maybe; - readonly sig_B: Maybe; - readonly msg: ChanMsg; - }; -export interface ChanOp { - readonly kind: 'ChanOp'; - readonly msg: ChanSignedMsg; - }; -export interface ChanData { - readonly kind: 'ChanData'; - readonly config: ChanConfig; - readonly state: ChanState; - }; -export function bitLen(n: number) { - return n.toString(2).length;; - } -export function loadUnit(slice: Slice): Unit { - return { - kind: 'Unit' - }; - } -export function storeUnit(unit: Unit): (builder: Builder) => void { - return ((builder: Builder) => { - - }); - } -export function loadTrue(slice: Slice): True { - return { - kind: 'True' - }; - } -export function storeTrue(true0: True): (builder: Builder) => void { - return ((builder: Builder) => { - - }); - } -export function loadBool(slice: Slice): Bool { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1); - return { - kind: 'Bool_bool_false' - }; - }; - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1); - return { - kind: 'Bool_bool_true' - }; - }; - throw new Error(''); - } -export function storeBool(bool: Bool): (builder: Builder) => void { - if ((bool.kind == 'Bool_bool_false')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1); - }); - }; - if ((bool.kind == 'Bool_bool_true')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1); - }); - }; - throw new Error(''); - } -export function loadBoolFalse(slice: Slice): BoolFalse { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1); - return { - kind: 'BoolFalse' - }; - }; - throw new Error(''); - } -export function storeBoolFalse(boolFalse: BoolFalse): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0b0, 1); - }); - } -export function loadBoolTrue(slice: Slice): BoolTrue { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1); - return { - kind: 'BoolTrue' - }; - }; - throw new Error(''); - } -export function storeBoolTrue(boolTrue: BoolTrue): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0b1, 1); - }); - } -export function loadMaybe(slice: Slice, loadX: (slice: Slice) => X): Maybe { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1); - return { - kind: 'Maybe_nothing' - }; - }; - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1); - let value: X = loadX(slice); - return { - kind: 'Maybe_just', - value: value - }; - }; - throw new Error(''); - } -export function storeMaybe(maybe: Maybe, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void { - if ((maybe.kind == 'Maybe_nothing')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1); - }); - }; - if ((maybe.kind == 'Maybe_just')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1); - storeX(maybe.value)(builder); - }); - }; - throw new Error(''); - } -export function loadEither(slice: Slice, loadX: (slice: Slice) => X, loadY: (slice: Slice) => Y): Either { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1); - let value: X = loadX(slice); - return { - kind: 'Either_left', - value: value - }; - }; - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1); - let value: Y = loadY(slice); - return { - kind: 'Either_right', - value: value - }; - }; - throw new Error(''); - } -export function storeEither(either: Either, storeX: (x: X) => (builder: Builder) => void, storeY: (y: Y) => (builder: Builder) => void): (builder: Builder) => void { - if ((either.kind == 'Either_left')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1); - storeX(either.value)(builder); - }); - }; - if ((either.kind == 'Either_right')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1); - storeY(either.value)(builder); - }); - }; - throw new Error(''); - } -export function loadBoth(slice: Slice, loadX: (slice: Slice) => X, loadY: (slice: Slice) => Y): Both { - let first: X = loadX(slice); - let second: Y = loadY(slice); - return { - kind: 'Both', - first: first, - second: second - }; - } -export function storeBoth(both: Both, storeX: (x: X) => (builder: Builder) => void, storeY: (y: Y) => (builder: Builder) => void): (builder: Builder) => void { - return ((builder: Builder) => { - storeX(both.first)(builder); - storeY(both.second)(builder); - }); - } -export function loadBit(slice: Slice): Bit { - let anon0: number = slice.loadUint(1); - return { - kind: 'Bit', - anon0: anon0 - }; - } -export function storeBit(bit: Bit): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(bit.anon0, 1); - }); - } -export function hashmap_get_l(label: HmLabel): number { - if ((label.kind == 'HmLabel_hml_short')) { - let n = label.n; - return n; - }; - if ((label.kind == 'HmLabel_hml_long')) { - let n = label.n; - return n; - }; - if ((label.kind == 'HmLabel_hml_same')) { - let n = label.n; - return n; - }; - throw new Error(''); - } -export function loadHashmap(slice: Slice, n: number, loadX: (slice: Slice) => X): Hashmap { - let label: HmLabel = loadHmLabel(slice, n); - let l = hashmap_get_l(label); - let node: HashmapNode = loadHashmapNode(slice, (n - l), loadX); - return { - kind: 'Hashmap', - m: (n - l), - n: n, - label: label, - l: l, - node: node - }; - } -export function storeHashmap(hashmap: Hashmap, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void { - return ((builder: Builder) => { - storeHmLabel(hashmap.label)(builder); - storeHashmapNode(hashmap.node, storeX)(builder); - }); - } -export function loadHashmapNode(slice: Slice, arg0: number, loadX: (slice: Slice) => X): HashmapNode { - if ((arg0 == 0)) { - let value: X = loadX(slice); - return { - kind: 'HashmapNode_hmn_leaf', - value: value - }; - }; - if (true) { - let slice1 = slice.loadRef().beginParse(); - let left: Hashmap = loadHashmap(slice1, (arg0 - 1), loadX); - let slice2 = slice.loadRef().beginParse(); - let right: Hashmap = loadHashmap(slice2, (arg0 - 1), loadX); - return { - kind: 'HashmapNode_hmn_fork', - n: (arg0 - 1), - left: left, - right: right - }; - }; - throw new Error(''); - } -export function storeHashmapNode(hashmapNode: HashmapNode, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void { - if ((hashmapNode.kind == 'HashmapNode_hmn_leaf')) { - return ((builder: Builder) => { - storeX(hashmapNode.value)(builder); - }); - }; - if ((hashmapNode.kind == 'HashmapNode_hmn_fork')) { - return ((builder: Builder) => { - let cell1 = beginCell(); - storeHashmap(hashmapNode.left, storeX)(cell1); - builder.storeRef(cell1); - let cell2 = beginCell(); - storeHashmap(hashmapNode.right, storeX)(cell2); - builder.storeRef(cell2); - }); - }; - throw new Error(''); - } -export function hmLabel_hml_short_get_n(len: Unary): number { - if ((len.kind == 'Unary_unary_zero')) { - return 0; - }; - if ((len.kind == 'Unary_unary_succ')) { - let n = len.n; - return (n + 1); - }; - throw new Error(''); - } -export function loadHmLabel(slice: Slice, m: number): HmLabel { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1); - let len: Unary = loadUnary(slice); - let n = hmLabel_hml_short_get_n(len); - let s: Array = Array.from(Array(n).keys()).map(((arg: number) => { - return slice.loadBits(1); - })); - if ((!(n <= m))) { - throw new Error(''); - }; - return { - kind: 'HmLabel_hml_short', - m: m, - len: len, - n: n, - s: s - }; - }; - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b10))) { - slice.loadUint(2); - let n: number = slice.loadUint(bitLen(m)); - let s: Array = Array.from(Array(n).keys()).map(((arg: number) => { - return slice.loadBits(1); - })); - return { - kind: 'HmLabel_hml_long', - m: m, - n: n, - s: s - }; - }; - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b11))) { - slice.loadUint(2); - let v: BitString = slice.loadBits(1); - let n: number = slice.loadUint(bitLen(m)); - return { - kind: 'HmLabel_hml_same', - m: m, - v: v, - n: n - }; - }; - throw new Error(''); - } -export function storeHmLabel(hmLabel: HmLabel): (builder: Builder) => void { - if ((hmLabel.kind == 'HmLabel_hml_short')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1); - storeUnary(hmLabel.len)(builder); - hmLabel.s.forEach(((arg: BitString) => { - builder.storeBits(arg); - })); - if ((!(hmLabel.n <= hmLabel.m))) { - throw new Error(''); - }; - }); - }; - if ((hmLabel.kind == 'HmLabel_hml_long')) { - return ((builder: Builder) => { - builder.storeUint(0b10, 2); - builder.storeUint(hmLabel.n, bitLen(hmLabel.m)); - hmLabel.s.forEach(((arg: BitString) => { - builder.storeBits(arg); - })); - }); - }; - if ((hmLabel.kind == 'HmLabel_hml_same')) { - return ((builder: Builder) => { - builder.storeUint(0b11, 2); - builder.storeBits(hmLabel.v); - builder.storeUint(hmLabel.n, bitLen(hmLabel.m)); - }); - }; - throw new Error(''); - } -export function unary_unary_succ_get_n(x: Unary): number { - if ((x.kind == 'Unary_unary_zero')) { - return 0; - }; - if ((x.kind == 'Unary_unary_succ')) { - let n = x.n; - return (n + 1); - }; - throw new Error(''); - } -export function loadUnary(slice: Slice): Unary { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1); - return { - kind: 'Unary_unary_zero' - }; - }; - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1); - let x: Unary = loadUnary(slice); - let n = unary_unary_succ_get_n(x); - return { - kind: 'Unary_unary_succ', - x: x, - n: n - }; - }; - throw new Error(''); - } -export function storeUnary(unary: Unary): (builder: Builder) => void { - if ((unary.kind == 'Unary_unary_zero')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1); - }); - }; - if ((unary.kind == 'Unary_unary_succ')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1); - storeUnary(unary.x)(builder); - }); - }; - throw new Error(''); - } -export function loadHashmapE(slice: Slice, n: number, loadX: (slice: Slice) => X): HashmapE { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1); - return { - kind: 'HashmapE_hme_empty', - n: n - }; - }; - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1); - let slice1 = slice.loadRef().beginParse(); - let root: Hashmap = loadHashmap(slice1, n, loadX); - return { - kind: 'HashmapE_hme_root', - n: n, - root: root - }; - }; - throw new Error(''); - } -export function storeHashmapE(hashmapE: HashmapE, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void { - if ((hashmapE.kind == 'HashmapE_hme_empty')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1); - }); - }; - if ((hashmapE.kind == 'HashmapE_hme_root')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1); - let cell1 = beginCell(); - storeHashmap(hashmapE.root, storeX)(cell1); - builder.storeRef(cell1); - }); - }; - throw new Error(''); - } -export function loadBitstringSet(slice: Slice, n: number): BitstringSet { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xda553663))) { - slice.loadUint(32); - let _: Hashmap = loadHashmap(slice, n, loadTrue); - return { - kind: 'BitstringSet', - n: n, - _: _ - }; - }; - throw new Error(''); - } -export function storeBitstringSet(bitstringSet: BitstringSet): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xda553663, 32); - storeHashmap(bitstringSet._, storeTrue)(builder); - }); - } -export function hashmapAug_get_l(label: HmLabel): number { - if ((label.kind == 'HmLabel_hml_short')) { - let n = label.n; - return n; - }; - if ((label.kind == 'HmLabel_hml_long')) { - let n = label.n; - return n; - }; - if ((label.kind == 'HmLabel_hml_same')) { - let n = label.n; - return n; - }; - throw new Error(''); - } -export function loadHashmapAug(slice: Slice, n: number, loadX: (slice: Slice) => X, loadY: (slice: Slice) => Y): HashmapAug { - let label: HmLabel = loadHmLabel(slice, n); - let l = hashmapAug_get_l(label); - let node: HashmapAugNode = loadHashmapAugNode(slice, (n - l), loadX, loadY); - return { - kind: 'HashmapAug', - m: (n - l), - n: n, - label: label, - l: l, - node: node - }; - } -export function storeHashmapAug(hashmapAug: HashmapAug, storeX: (x: X) => (builder: Builder) => void, storeY: (y: Y) => (builder: Builder) => void): (builder: Builder) => void { - return ((builder: Builder) => { - storeHmLabel(hashmapAug.label)(builder); - storeHashmapAugNode(hashmapAug.node, storeX, storeY)(builder); - }); - } -export function loadHashmapAugNode(slice: Slice, arg0: number, loadX: (slice: Slice) => X, loadY: (slice: Slice) => Y): HashmapAugNode { - if ((arg0 == 0)) { - let extra: Y = loadY(slice); - let value: X = loadX(slice); - return { - kind: 'HashmapAugNode_ahmn_leaf', - extra: extra, - value: value - }; - }; - if (true) { - let slice1 = slice.loadRef().beginParse(); - let left: HashmapAug = loadHashmapAug(slice1, (arg0 - 1), loadX, loadY); - let slice2 = slice.loadRef().beginParse(); - let right: HashmapAug = loadHashmapAug(slice2, (arg0 - 1), loadX, loadY); - let extra: Y = loadY(slice); - return { - kind: 'HashmapAugNode_ahmn_fork', - n: (arg0 - 1), - left: left, - right: right, - extra: extra - }; - }; - throw new Error(''); - } -export function storeHashmapAugNode(hashmapAugNode: HashmapAugNode, storeX: (x: X) => (builder: Builder) => void, storeY: (y: Y) => (builder: Builder) => void): (builder: Builder) => void { - if ((hashmapAugNode.kind == 'HashmapAugNode_ahmn_leaf')) { - return ((builder: Builder) => { - storeY(hashmapAugNode.extra)(builder); - storeX(hashmapAugNode.value)(builder); - }); - }; - if ((hashmapAugNode.kind == 'HashmapAugNode_ahmn_fork')) { - return ((builder: Builder) => { - let cell1 = beginCell(); - storeHashmapAug(hashmapAugNode.left, storeX, storeY)(cell1); - builder.storeRef(cell1); - let cell2 = beginCell(); - storeHashmapAug(hashmapAugNode.right, storeX, storeY)(cell2); - builder.storeRef(cell2); - storeY(hashmapAugNode.extra)(builder); - }); - }; - throw new Error(''); - } -export function loadHashmapAugE(slice: Slice, n: number, loadX: (slice: Slice) => X, loadY: (slice: Slice) => Y): HashmapAugE { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1); - let extra: Y = loadY(slice); - return { - kind: 'HashmapAugE_ahme_empty', - n: n, - extra: extra - }; - }; - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1); - let slice1 = slice.loadRef().beginParse(); - let root: HashmapAug = loadHashmapAug(slice1, n, loadX, loadY); - let extra: Y = loadY(slice); - return { - kind: 'HashmapAugE_ahme_root', - n: n, - root: root, - extra: extra - }; - }; - throw new Error(''); - } -export function storeHashmapAugE(hashmapAugE: HashmapAugE, storeX: (x: X) => (builder: Builder) => void, storeY: (y: Y) => (builder: Builder) => void): (builder: Builder) => void { - if ((hashmapAugE.kind == 'HashmapAugE_ahme_empty')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1); - storeY(hashmapAugE.extra)(builder); - }); - }; - if ((hashmapAugE.kind == 'HashmapAugE_ahme_root')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1); - let cell1 = beginCell(); - storeHashmapAug(hashmapAugE.root, storeX, storeY)(cell1); - builder.storeRef(cell1); - storeY(hashmapAugE.extra)(builder); - }); - }; - throw new Error(''); - } -export function varHashmap_get_l(label: HmLabel): number { - if ((label.kind == 'HmLabel_hml_short')) { - let n = label.n; - return n; - }; - if ((label.kind == 'HmLabel_hml_long')) { - let n = label.n; - return n; - }; - if ((label.kind == 'HmLabel_hml_same')) { - let n = label.n; - return n; - }; - throw new Error(''); - } -export function loadVarHashmap(slice: Slice, n: number, loadX: (slice: Slice) => X): VarHashmap { - let label: HmLabel = loadHmLabel(slice, n); - let l = varHashmap_get_l(label); - let node: VarHashmapNode = loadVarHashmapNode(slice, (n - l), loadX); - return { - kind: 'VarHashmap', - m: (n - l), - n: n, - label: label, - l: l, - node: node - }; - } -export function storeVarHashmap(varHashmap: VarHashmap, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void { - return ((builder: Builder) => { - storeHmLabel(varHashmap.label)(builder); - storeVarHashmapNode(varHashmap.node, storeX)(builder); - }); - } -export function loadVarHashmapNode(slice: Slice, arg0: number, loadX: (slice: Slice) => X): VarHashmapNode { - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { - slice.loadUint(2); - let value: X = loadX(slice); - return { - kind: 'VarHashmapNode_vhmn_leaf', - n: arg0, - value: value - }; - }; - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b01))) { - slice.loadUint(2); - let slice1 = slice.loadRef().beginParse(); - let left: VarHashmap = loadVarHashmap(slice1, (arg0 - 1), loadX); - let slice2 = slice.loadRef().beginParse(); - let right: VarHashmap = loadVarHashmap(slice2, (arg0 - 1), loadX); - let value: Maybe = loadMaybe(slice, loadX); - return { - kind: 'VarHashmapNode_vhmn_fork', - n: (arg0 - 1), - left: left, - right: right, - value: value - }; - }; - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1); - let branch: BitString = slice.loadBits(1); - let slice1 = slice.loadRef().beginParse(); - let child: VarHashmap = loadVarHashmap(slice1, (arg0 - 1), loadX); - let value: X = loadX(slice); - return { - kind: 'VarHashmapNode_vhmn_cont', - n: (arg0 - 1), - branch: branch, - child: child, - value: value - }; - }; - throw new Error(''); - } -export function storeVarHashmapNode(varHashmapNode: VarHashmapNode, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void { - if ((varHashmapNode.kind == 'VarHashmapNode_vhmn_leaf')) { - return ((builder: Builder) => { - builder.storeUint(0b00, 2); - storeX(varHashmapNode.value)(builder); - }); - }; - if ((varHashmapNode.kind == 'VarHashmapNode_vhmn_fork')) { - return ((builder: Builder) => { - builder.storeUint(0b01, 2); - let cell1 = beginCell(); - storeVarHashmap(varHashmapNode.left, storeX)(cell1); - builder.storeRef(cell1); - let cell2 = beginCell(); - storeVarHashmap(varHashmapNode.right, storeX)(cell2); - builder.storeRef(cell2); - storeMaybe(varHashmapNode.value, storeX)(builder); - }); - }; - if ((varHashmapNode.kind == 'VarHashmapNode_vhmn_cont')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1); - builder.storeBits(varHashmapNode.branch); - let cell1 = beginCell(); - storeVarHashmap(varHashmapNode.child, storeX)(cell1); - builder.storeRef(cell1); - storeX(varHashmapNode.value)(builder); - }); - }; - throw new Error(''); - } -export function loadVarHashmapE(slice: Slice, n: number, loadX: (slice: Slice) => X): VarHashmapE { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1); - return { - kind: 'VarHashmapE_vhme_empty', - n: n - }; - }; - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1); - let slice1 = slice.loadRef().beginParse(); - let root: VarHashmap = loadVarHashmap(slice1, n, loadX); - return { - kind: 'VarHashmapE_vhme_root', - n: n, - root: root - }; - }; - throw new Error(''); - } -export function storeVarHashmapE(varHashmapE: VarHashmapE, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void { - if ((varHashmapE.kind == 'VarHashmapE_vhme_empty')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1); - }); - }; - if ((varHashmapE.kind == 'VarHashmapE_vhme_root')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1); - let cell1 = beginCell(); - storeVarHashmap(varHashmapE.root, storeX)(cell1); - builder.storeRef(cell1); - }); - }; - throw new Error(''); - } -export function pfxHashmap_get_l(label: HmLabel): number { - if ((label.kind == 'HmLabel_hml_short')) { - let n = label.n; - return n; - }; - if ((label.kind == 'HmLabel_hml_long')) { - let n = label.n; - return n; - }; - if ((label.kind == 'HmLabel_hml_same')) { - let n = label.n; - return n; - }; - throw new Error(''); - } -export function loadPfxHashmap(slice: Slice, n: number, loadX: (slice: Slice) => X): PfxHashmap { - let label: HmLabel = loadHmLabel(slice, n); - let l = pfxHashmap_get_l(label); - let node: PfxHashmapNode = loadPfxHashmapNode(slice, (n - l), loadX); - return { - kind: 'PfxHashmap', - m: (n - l), - n: n, - label: label, - l: l, - node: node - }; - } -export function storePfxHashmap(pfxHashmap: PfxHashmap, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void { - return ((builder: Builder) => { - storeHmLabel(pfxHashmap.label)(builder); - storePfxHashmapNode(pfxHashmap.node, storeX)(builder); - }); - } -export function loadPfxHashmapNode(slice: Slice, arg0: number, loadX: (slice: Slice) => X): PfxHashmapNode { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1); - let value: X = loadX(slice); - return { - kind: 'PfxHashmapNode_phmn_leaf', - n: arg0, - value: value - }; - }; - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1); - let slice1 = slice.loadRef().beginParse(); - let left: PfxHashmap = loadPfxHashmap(slice1, (arg0 - 1), loadX); - let slice2 = slice.loadRef().beginParse(); - let right: PfxHashmap = loadPfxHashmap(slice2, (arg0 - 1), loadX); - return { - kind: 'PfxHashmapNode_phmn_fork', - n: (arg0 - 1), - left: left, - right: right - }; - }; - throw new Error(''); - } -export function storePfxHashmapNode(pfxHashmapNode: PfxHashmapNode, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void { - if ((pfxHashmapNode.kind == 'PfxHashmapNode_phmn_leaf')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1); - storeX(pfxHashmapNode.value)(builder); - }); - }; - if ((pfxHashmapNode.kind == 'PfxHashmapNode_phmn_fork')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1); - let cell1 = beginCell(); - storePfxHashmap(pfxHashmapNode.left, storeX)(cell1); - builder.storeRef(cell1); - let cell2 = beginCell(); - storePfxHashmap(pfxHashmapNode.right, storeX)(cell2); - builder.storeRef(cell2); - }); - }; - throw new Error(''); - } -export function loadPfxHashmapE(slice: Slice, n: number, loadX: (slice: Slice) => X): PfxHashmapE { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1); - return { - kind: 'PfxHashmapE_phme_empty', - n: n - }; - }; - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1); - let slice1 = slice.loadRef().beginParse(); - let root: PfxHashmap = loadPfxHashmap(slice1, n, loadX); - return { - kind: 'PfxHashmapE_phme_root', - n: n, - root: root - }; - }; - throw new Error(''); - } -export function storePfxHashmapE(pfxHashmapE: PfxHashmapE, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void { - if ((pfxHashmapE.kind == 'PfxHashmapE_phme_empty')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1); - }); - }; - if ((pfxHashmapE.kind == 'PfxHashmapE_phme_root')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1); - let cell1 = beginCell(); - storePfxHashmap(pfxHashmapE.root, storeX)(cell1); - builder.storeRef(cell1); - }); - }; - throw new Error(''); - } -export function loadMsgAddressExt(slice: Slice): MsgAddressExt { - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { - slice.loadUint(2); - return { - kind: 'MsgAddressExt_addr_none' - }; - }; - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b01))) { - slice.loadUint(2); - let len: number = slice.loadUint(9); - let external_address: BitString = slice.loadBits(len); - return { - kind: 'MsgAddressExt_addr_extern', - len: len, - external_address: external_address - }; - }; - throw new Error(''); - } -export function storeMsgAddressExt(msgAddressExt: MsgAddressExt): (builder: Builder) => void { - if ((msgAddressExt.kind == 'MsgAddressExt_addr_none')) { - return ((builder: Builder) => { - builder.storeUint(0b00, 2); - }); - }; - if ((msgAddressExt.kind == 'MsgAddressExt_addr_extern')) { - return ((builder: Builder) => { - builder.storeUint(0b01, 2); - builder.storeUint(msgAddressExt.len, 9); - builder.storeBits(msgAddressExt.external_address); - }); - }; - throw new Error(''); - } -export function loadAnycast(slice: Slice): Anycast { - let depth: number = slice.loadUint(bitLen(30)); - let rewrite_pfx: BitString = slice.loadBits(depth); - if ((!(depth >= 1))) { - throw new Error(''); - }; - return { - kind: 'Anycast', - depth: depth, - rewrite_pfx: rewrite_pfx - }; - } -export function storeAnycast(anycast: Anycast): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(anycast.depth, bitLen(30)); - builder.storeBits(anycast.rewrite_pfx); - if ((!(anycast.depth >= 1))) { - throw new Error(''); - }; - }); - } -export function loadMsgAddressInt(slice: Slice): MsgAddressInt { - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b10))) { - slice.loadUint(2); - let anycast: Maybe = loadMaybe(slice, loadAnycast); - let workchain_id: number = slice.loadInt(8); - let address: BitString = slice.loadBits(256); - return { - kind: 'MsgAddressInt_addr_std', - anycast: anycast, - workchain_id: workchain_id, - address: address - }; - }; - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b11))) { - slice.loadUint(2); - let anycast: Maybe = loadMaybe(slice, loadAnycast); - let addr_len: number = slice.loadUint(9); - let workchain_id: number = slice.loadInt(32); - let address: BitString = slice.loadBits(addr_len); - return { - kind: 'MsgAddressInt_addr_var', - anycast: anycast, - addr_len: addr_len, - workchain_id: workchain_id, - address: address - }; - }; - throw new Error(''); - } -export function storeMsgAddressInt(msgAddressInt: MsgAddressInt): (builder: Builder) => void { - if ((msgAddressInt.kind == 'MsgAddressInt_addr_std')) { - return ((builder: Builder) => { - builder.storeUint(0b10, 2); - storeMaybe(msgAddressInt.anycast, storeAnycast)(builder); - builder.storeInt(msgAddressInt.workchain_id, 8); - builder.storeBits(msgAddressInt.address); - }); - }; - if ((msgAddressInt.kind == 'MsgAddressInt_addr_var')) { - return ((builder: Builder) => { - builder.storeUint(0b11, 2); - storeMaybe(msgAddressInt.anycast, storeAnycast)(builder); - builder.storeUint(msgAddressInt.addr_len, 9); - builder.storeInt(msgAddressInt.workchain_id, 32); - builder.storeBits(msgAddressInt.address); - }); - }; - throw new Error(''); - } -export function loadMsgAddress(slice: Slice): MsgAddress { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xef3a10fa))) { - slice.loadUint(32); - let _: MsgAddressInt = loadMsgAddressInt(slice); - return { - kind: 'MsgAddress__', - _: _ - }; - }; - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xcf942fd1))) { - slice.loadUint(32); - let _: MsgAddressExt = loadMsgAddressExt(slice); - return { - kind: 'MsgAddress__1', - _: _ - }; - }; - throw new Error(''); - } -export function storeMsgAddress(msgAddress: MsgAddress): (builder: Builder) => void { - if ((msgAddress.kind == 'MsgAddress__')) { - return ((builder: Builder) => { - builder.storeUint(0xef3a10fa, 32); - storeMsgAddressInt(msgAddress._)(builder); - }); - }; - if ((msgAddress.kind == 'MsgAddress__1')) { - return ((builder: Builder) => { - builder.storeUint(0xcf942fd1, 32); - storeMsgAddressExt(msgAddress._)(builder); - }); - }; - throw new Error(''); - } -export function loadVarUInteger(slice: Slice, n: number): VarUInteger { - let len: number = slice.loadUint(bitLen((n - 1))); - let value: number = slice.loadUint((len * 8)); - return { - kind: 'VarUInteger', - n: n, - len: len, - value: value - }; - } -export function storeVarUInteger(varUInteger: VarUInteger): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(varUInteger.len, bitLen((varUInteger.n - 1))); - builder.storeUint(varUInteger.value, (varUInteger.len * 8)); - }); - } -export function loadVarInteger(slice: Slice, n: number): VarInteger { - let len: number = slice.loadUint(bitLen((n - 1))); - let value: number = slice.loadInt((len * 8)); - return { - kind: 'VarInteger', - n: n, - len: len, - value: value - }; - } -export function storeVarInteger(varInteger: VarInteger): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(varInteger.len, bitLen((varInteger.n - 1))); - builder.storeInt(varInteger.value, (varInteger.len * 8)); - }); - } -export function loadGrams(slice: Slice): Grams { - let amount: VarUInteger = loadVarUInteger(slice, 16); - return { - kind: 'Grams', - amount: amount - }; - } -export function storeGrams(grams: Grams): (builder: Builder) => void { - return ((builder: Builder) => { - storeVarUInteger(grams.amount)(builder); - }); - } -export function loadExtraCurrencyCollection(slice: Slice): ExtraCurrencyCollection { - let dict: HashmapE = loadHashmapE(slice, 32, ((slice: Slice) => { - return loadVarUInteger(slice, 32); - })); - return { - kind: 'ExtraCurrencyCollection', - dict: dict - }; - } -export function storeExtraCurrencyCollection(extraCurrencyCollection: ExtraCurrencyCollection): (builder: Builder) => void { - return ((builder: Builder) => { - storeHashmapE(extraCurrencyCollection.dict, ((arg: VarUInteger) => { - return ((builder: Builder) => { - storeVarUInteger(arg)(builder); - }); - }))(builder); - }); - } -export function loadCurrencyCollection(slice: Slice): CurrencyCollection { - let grams: Grams = loadGrams(slice); - let other: ExtraCurrencyCollection = loadExtraCurrencyCollection(slice); - return { - kind: 'CurrencyCollection', - grams: grams, - other: other - }; - } -export function storeCurrencyCollection(currencyCollection: CurrencyCollection): (builder: Builder) => void { - return ((builder: Builder) => { - storeGrams(currencyCollection.grams)(builder); - storeExtraCurrencyCollection(currencyCollection.other)(builder); - }); - } -export function loadCommonMsgInfo(slice: Slice): CommonMsgInfo { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1); - let ihr_disabled: Bool = loadBool(slice); - let bounce: Bool = loadBool(slice); - let bounced: Bool = loadBool(slice); - let src: MsgAddressInt = loadMsgAddressInt(slice); - let dest: MsgAddressInt = loadMsgAddressInt(slice); - let value: CurrencyCollection = loadCurrencyCollection(slice); - let ihr_fee: Grams = loadGrams(slice); - let fwd_fee: Grams = loadGrams(slice); - let created_lt: number = slice.loadUint(64); - let created_at: number = slice.loadUint(32); - return { - kind: 'CommonMsgInfo_int_msg_info', - ihr_disabled: ihr_disabled, - bounce: bounce, - bounced: bounced, - src: src, - dest: dest, - value: value, - ihr_fee: ihr_fee, - fwd_fee: fwd_fee, - created_lt: created_lt, - created_at: created_at - }; - }; - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b10))) { - slice.loadUint(2); - let src: MsgAddressExt = loadMsgAddressExt(slice); - let dest: MsgAddressInt = loadMsgAddressInt(slice); - let import_fee: Grams = loadGrams(slice); - return { - kind: 'CommonMsgInfo_ext_in_msg_info', - src: src, - dest: dest, - import_fee: import_fee - }; - }; - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b11))) { - slice.loadUint(2); - let src: MsgAddressInt = loadMsgAddressInt(slice); - let dest: MsgAddressExt = loadMsgAddressExt(slice); - let created_lt: number = slice.loadUint(64); - let created_at: number = slice.loadUint(32); - return { - kind: 'CommonMsgInfo_ext_out_msg_info', - src: src, - dest: dest, - created_lt: created_lt, - created_at: created_at - }; - }; - throw new Error(''); - } -export function storeCommonMsgInfo(commonMsgInfo: CommonMsgInfo): (builder: Builder) => void { - if ((commonMsgInfo.kind == 'CommonMsgInfo_int_msg_info')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1); - storeBool(commonMsgInfo.ihr_disabled)(builder); - storeBool(commonMsgInfo.bounce)(builder); - storeBool(commonMsgInfo.bounced)(builder); - storeMsgAddressInt(commonMsgInfo.src)(builder); - storeMsgAddressInt(commonMsgInfo.dest)(builder); - storeCurrencyCollection(commonMsgInfo.value)(builder); - storeGrams(commonMsgInfo.ihr_fee)(builder); - storeGrams(commonMsgInfo.fwd_fee)(builder); - builder.storeUint(commonMsgInfo.created_lt, 64); - builder.storeUint(commonMsgInfo.created_at, 32); - }); - }; - if ((commonMsgInfo.kind == 'CommonMsgInfo_ext_in_msg_info')) { - return ((builder: Builder) => { - builder.storeUint(0b10, 2); - storeMsgAddressExt(commonMsgInfo.src)(builder); - storeMsgAddressInt(commonMsgInfo.dest)(builder); - storeGrams(commonMsgInfo.import_fee)(builder); - }); - }; - if ((commonMsgInfo.kind == 'CommonMsgInfo_ext_out_msg_info')) { - return ((builder: Builder) => { - builder.storeUint(0b11, 2); - storeMsgAddressInt(commonMsgInfo.src)(builder); - storeMsgAddressExt(commonMsgInfo.dest)(builder); - builder.storeUint(commonMsgInfo.created_lt, 64); - builder.storeUint(commonMsgInfo.created_at, 32); - }); - }; - throw new Error(''); - } -export function loadCommonMsgInfoRelaxed(slice: Slice): CommonMsgInfoRelaxed { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1); - let ihr_disabled: Bool = loadBool(slice); - let bounce: Bool = loadBool(slice); - let bounced: Bool = loadBool(slice); - let src: MsgAddress = loadMsgAddress(slice); - let dest: MsgAddressInt = loadMsgAddressInt(slice); - let value: CurrencyCollection = loadCurrencyCollection(slice); - let ihr_fee: Grams = loadGrams(slice); - let fwd_fee: Grams = loadGrams(slice); - let created_lt: number = slice.loadUint(64); - let created_at: number = slice.loadUint(32); - return { - kind: 'CommonMsgInfoRelaxed_int_msg_info', - ihr_disabled: ihr_disabled, - bounce: bounce, - bounced: bounced, - src: src, - dest: dest, - value: value, - ihr_fee: ihr_fee, - fwd_fee: fwd_fee, - created_lt: created_lt, - created_at: created_at - }; - }; - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b11))) { - slice.loadUint(2); - let src: MsgAddress = loadMsgAddress(slice); - let dest: MsgAddressExt = loadMsgAddressExt(slice); - let created_lt: number = slice.loadUint(64); - let created_at: number = slice.loadUint(32); - return { - kind: 'CommonMsgInfoRelaxed_ext_out_msg_info', - src: src, - dest: dest, - created_lt: created_lt, - created_at: created_at - }; - }; - throw new Error(''); - } -export function storeCommonMsgInfoRelaxed(commonMsgInfoRelaxed: CommonMsgInfoRelaxed): (builder: Builder) => void { - if ((commonMsgInfoRelaxed.kind == 'CommonMsgInfoRelaxed_int_msg_info')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1); - storeBool(commonMsgInfoRelaxed.ihr_disabled)(builder); - storeBool(commonMsgInfoRelaxed.bounce)(builder); - storeBool(commonMsgInfoRelaxed.bounced)(builder); - storeMsgAddress(commonMsgInfoRelaxed.src)(builder); - storeMsgAddressInt(commonMsgInfoRelaxed.dest)(builder); - storeCurrencyCollection(commonMsgInfoRelaxed.value)(builder); - storeGrams(commonMsgInfoRelaxed.ihr_fee)(builder); - storeGrams(commonMsgInfoRelaxed.fwd_fee)(builder); - builder.storeUint(commonMsgInfoRelaxed.created_lt, 64); - builder.storeUint(commonMsgInfoRelaxed.created_at, 32); - }); - }; - if ((commonMsgInfoRelaxed.kind == 'CommonMsgInfoRelaxed_ext_out_msg_info')) { - return ((builder: Builder) => { - builder.storeUint(0b11, 2); - storeMsgAddress(commonMsgInfoRelaxed.src)(builder); - storeMsgAddressExt(commonMsgInfoRelaxed.dest)(builder); - builder.storeUint(commonMsgInfoRelaxed.created_lt, 64); - builder.storeUint(commonMsgInfoRelaxed.created_at, 32); - }); - }; - throw new Error(''); - } -export function loadTickTock(slice: Slice): TickTock { - let tick: Bool = loadBool(slice); - let tock: Bool = loadBool(slice); - return { - kind: 'TickTock', - tick: tick, - tock: tock - }; - } -export function storeTickTock(tickTock: TickTock): (builder: Builder) => void { - return ((builder: Builder) => { - storeBool(tickTock.tick)(builder); - storeBool(tickTock.tock)(builder); - }); - } -export function loadStateInit(slice: Slice): StateInit { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x91231967))) { - slice.loadUint(32); - let split_depth: Maybe = loadMaybe(slice, ((slice: Slice) => { - return slice.loadUint(5); - })); - let special: Maybe = loadMaybe(slice, loadTickTock); - let code: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return slice1; - })); - let data: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return slice1; - })); - let library: HashmapE = loadHashmapE(slice, 256, loadSimpleLib); - return { - kind: 'StateInit', - split_depth: split_depth, - special: special, - code: code, - data: data, - library: library - }; - }; - throw new Error(''); - } -export function storeStateInit(stateInit: StateInit): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x91231967, 32); - storeMaybe(stateInit.split_depth, ((arg: number) => { - return ((builder: Builder) => { - builder.storeUint(arg, 5); - }); - }))(builder); - storeMaybe(stateInit.special, storeTickTock)(builder); - storeMaybe(stateInit.code, ((arg: Slice) => { - return ((builder: Builder) => { - let cell1 = beginCell() - cell1.storeSlice(arg) - builder.storeRef(cell1); - }); - }))(builder); - storeMaybe(stateInit.data, ((arg: Slice) => { - return ((builder: Builder) => { - let cell1 = beginCell() - cell1.storeSlice(arg) - builder.storeRef(cell1); - }); - }))(builder); - storeHashmapE(stateInit.library, storeSimpleLib)(builder); - }); - } -export function loadSimpleLib(slice: Slice): SimpleLib { - let public0: Bool = loadBool(slice); - let slice1 = slice.loadRef().beginParse(); - let root: Slice = slice1; - return { - kind: 'SimpleLib', - public0: public0, - root: root - }; - } -export function storeSimpleLib(simpleLib: SimpleLib): (builder: Builder) => void { - return ((builder: Builder) => { - storeBool(simpleLib.public0)(builder); - let cell1 = beginCell(); - cell1.storeSlice(simpleLib.root); - builder.storeRef(cell1); - }); - } -export function loadMessage(slice: Slice, loadX: (slice: Slice) => X): Message { - let info: CommonMsgInfo = loadCommonMsgInfo(slice); - let init: Maybe> = loadMaybe>(slice, ((slice: Slice) => { - return loadEither(slice, loadStateInit, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadStateInit(slice1); - })); - })); - let body: Either = loadEither(slice, loadX, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadX(slice1); - })); - return { - kind: 'Message', - info: info, - init: init, - body: body - }; - } -export function storeMessage(message: Message, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void { - return ((builder: Builder) => { - storeCommonMsgInfo(message.info)(builder); - storeMaybe>(message.init, ((arg: Either) => { - return ((builder: Builder) => { - storeEither(arg, storeStateInit, ((arg: StateInit) => { - return ((builder: Builder) => { - let cell1 = beginCell() - storeStateInit(arg)(cell1) - builder.storeRef(cell1); - }); - }))(builder); - }); - }))(builder); - storeEither(message.body, storeX, ((arg: X) => { - return ((builder: Builder) => { - let cell1 = beginCell() - storeX(arg)(cell1) - builder.storeRef(cell1); - }); - }))(builder); - }); - } -export function loadMessageRelaxed(slice: Slice, loadX: (slice: Slice) => X): MessageRelaxed { - let info: CommonMsgInfoRelaxed = loadCommonMsgInfoRelaxed(slice); - let init: Maybe> = loadMaybe>(slice, ((slice: Slice) => { - return loadEither(slice, loadStateInit, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadStateInit(slice1); - })); - })); - let body: Either = loadEither(slice, loadX, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadX(slice1); - })); - return { - kind: 'MessageRelaxed', - info: info, - init: init, - body: body - }; - } -export function storeMessageRelaxed(messageRelaxed: MessageRelaxed, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void { - return ((builder: Builder) => { - storeCommonMsgInfoRelaxed(messageRelaxed.info)(builder); - storeMaybe>(messageRelaxed.init, ((arg: Either) => { - return ((builder: Builder) => { - storeEither(arg, storeStateInit, ((arg: StateInit) => { - return ((builder: Builder) => { - let cell1 = beginCell() - storeStateInit(arg)(cell1) - builder.storeRef(cell1); - }); - }))(builder); - }); - }))(builder); - storeEither(messageRelaxed.body, storeX, ((arg: X) => { - return ((builder: Builder) => { - let cell1 = beginCell() - storeX(arg)(cell1) - builder.storeRef(cell1); - }); - }))(builder); - }); - } -export function loadMessageAny(slice: Slice): MessageAny { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x9c54aa4b))) { - slice.loadUint(32); - let anon0: Message = loadMessage(slice, ((slice: Slice) => { - return slice; - })); - return { - kind: 'MessageAny', - anon0: anon0 - }; - }; - throw new Error(''); - } -export function storeMessageAny(messageAny: MessageAny): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x9c54aa4b, 32); - storeMessage(messageAny.anon0, ((arg: Slice) => { - return ((builder: Builder) => { - builder.storeSlice(arg); - }); - }))(builder); - }); - } -export function loadIntermediateAddress(slice: Slice): IntermediateAddress { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1); - let use_dest_bits: number = slice.loadUint(bitLen(96)); - return { - kind: 'IntermediateAddress_interm_addr_regular', - use_dest_bits: use_dest_bits - }; - }; - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b10))) { - slice.loadUint(2); - let workchain_id: number = slice.loadInt(8); - let addr_pfx: number = slice.loadUint(64); - return { - kind: 'IntermediateAddress_interm_addr_simple', - workchain_id: workchain_id, - addr_pfx: addr_pfx - }; - }; - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b11))) { - slice.loadUint(2); - let workchain_id: number = slice.loadInt(32); - let addr_pfx: number = slice.loadUint(64); - return { - kind: 'IntermediateAddress_interm_addr_ext', - workchain_id: workchain_id, - addr_pfx: addr_pfx - }; - }; - throw new Error(''); - } -export function storeIntermediateAddress(intermediateAddress: IntermediateAddress): (builder: Builder) => void { - if ((intermediateAddress.kind == 'IntermediateAddress_interm_addr_regular')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1); - builder.storeUint(intermediateAddress.use_dest_bits, bitLen(96)); - }); - }; - if ((intermediateAddress.kind == 'IntermediateAddress_interm_addr_simple')) { - return ((builder: Builder) => { - builder.storeUint(0b10, 2); - builder.storeInt(intermediateAddress.workchain_id, 8); - builder.storeUint(intermediateAddress.addr_pfx, 64); - }); - }; - if ((intermediateAddress.kind == 'IntermediateAddress_interm_addr_ext')) { - return ((builder: Builder) => { - builder.storeUint(0b11, 2); - builder.storeInt(intermediateAddress.workchain_id, 32); - builder.storeUint(intermediateAddress.addr_pfx, 64); - }); - }; - throw new Error(''); - } -export function loadMsgEnvelope(slice: Slice): MsgEnvelope { - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0x4))) { - slice.loadUint(4); - let cur_addr: IntermediateAddress = loadIntermediateAddress(slice); - let next_addr: IntermediateAddress = loadIntermediateAddress(slice); - let fwd_fee_remaining: Grams = loadGrams(slice); - let slice1 = slice.loadRef().beginParse(); - let msg: Message = loadMessage(slice1, ((slice: Slice) => { - return slice; - })); - return { - kind: 'MsgEnvelope', - cur_addr: cur_addr, - next_addr: next_addr, - fwd_fee_remaining: fwd_fee_remaining, - msg: msg - }; - }; - throw new Error(''); - } -export function storeMsgEnvelope(msgEnvelope: MsgEnvelope): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x4, 4); - storeIntermediateAddress(msgEnvelope.cur_addr)(builder); - storeIntermediateAddress(msgEnvelope.next_addr)(builder); - storeGrams(msgEnvelope.fwd_fee_remaining)(builder); - let cell1 = beginCell(); - storeMessage(msgEnvelope.msg, ((arg: Slice) => { - return ((builder: Builder) => { - cell1.storeSlice(arg); - }); - }))(cell1); - builder.storeRef(cell1); - }); - } -export function loadInMsg(slice: Slice): InMsg { - if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b000))) { - slice.loadUint(3); - let slice1 = slice.loadRef().beginParse(); - let msg: Message = loadMessage(slice1, ((slice: Slice) => { - return slice; - })); - let slice2 = slice.loadRef().beginParse(); - let transaction: Transaction = loadTransaction(slice2); - return { - kind: 'InMsg_msg_import_ext', - msg: msg, - transaction: transaction - }; - }; - if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b010))) { - slice.loadUint(3); - let slice1 = slice.loadRef().beginParse(); - let msg: Message = loadMessage(slice1, ((slice: Slice) => { - return slice; - })); - let slice2 = slice.loadRef().beginParse(); - let transaction: Transaction = loadTransaction(slice2); - let ihr_fee: Grams = loadGrams(slice); - let slice3 = slice.loadRef().beginParse(); - let proof_created: Slice = slice3; - return { - kind: 'InMsg_msg_import_ihr', - msg: msg, - transaction: transaction, - ihr_fee: ihr_fee, - proof_created: proof_created - }; - }; - if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b011))) { - slice.loadUint(3); - let slice1 = slice.loadRef().beginParse(); - let in_msg: MsgEnvelope = loadMsgEnvelope(slice1); - let slice2 = slice.loadRef().beginParse(); - let transaction: Transaction = loadTransaction(slice2); - let fwd_fee: Grams = loadGrams(slice); - return { - kind: 'InMsg_msg_import_imm', - in_msg: in_msg, - transaction: transaction, - fwd_fee: fwd_fee - }; - }; - if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b100))) { - slice.loadUint(3); - let slice1 = slice.loadRef().beginParse(); - let in_msg: MsgEnvelope = loadMsgEnvelope(slice1); - let slice2 = slice.loadRef().beginParse(); - let transaction: Transaction = loadTransaction(slice2); - let fwd_fee: Grams = loadGrams(slice); - return { - kind: 'InMsg_msg_import_fin', - in_msg: in_msg, - transaction: transaction, - fwd_fee: fwd_fee - }; - }; - if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b101))) { - slice.loadUint(3); - let slice1 = slice.loadRef().beginParse(); - let in_msg: MsgEnvelope = loadMsgEnvelope(slice1); - let slice2 = slice.loadRef().beginParse(); - let out_msg: MsgEnvelope = loadMsgEnvelope(slice2); - let transit_fee: Grams = loadGrams(slice); - return { - kind: 'InMsg_msg_import_tr', - in_msg: in_msg, - out_msg: out_msg, - transit_fee: transit_fee - }; - }; - if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b110))) { - slice.loadUint(3); - let slice1 = slice.loadRef().beginParse(); - let in_msg: MsgEnvelope = loadMsgEnvelope(slice1); - let transaction_id: number = slice.loadUint(64); - let fwd_fee: Grams = loadGrams(slice); - return { - kind: 'InMsg_msg_discard_fin', - in_msg: in_msg, - transaction_id: transaction_id, - fwd_fee: fwd_fee - }; - }; - if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b111))) { - slice.loadUint(3); - let slice1 = slice.loadRef().beginParse(); - let in_msg: MsgEnvelope = loadMsgEnvelope(slice1); - let transaction_id: number = slice.loadUint(64); - let fwd_fee: Grams = loadGrams(slice); - let slice2 = slice.loadRef().beginParse(); - let proof_delivered: Slice = slice2; - return { - kind: 'InMsg_msg_discard_tr', - in_msg: in_msg, - transaction_id: transaction_id, - fwd_fee: fwd_fee, - proof_delivered: proof_delivered - }; - }; - throw new Error(''); - } -export function storeInMsg(inMsg: InMsg): (builder: Builder) => void { - if ((inMsg.kind == 'InMsg_msg_import_ext')) { - return ((builder: Builder) => { - builder.storeUint(0b000, 3); - let cell1 = beginCell(); - storeMessage(inMsg.msg, ((arg: Slice) => { - return ((builder: Builder) => { - cell1.storeSlice(arg); - }); - }))(cell1); - builder.storeRef(cell1); - let cell2 = beginCell(); - storeTransaction(inMsg.transaction)(cell2); - builder.storeRef(cell2); - }); - }; - if ((inMsg.kind == 'InMsg_msg_import_ihr')) { - return ((builder: Builder) => { - builder.storeUint(0b010, 3); - let cell1 = beginCell(); - storeMessage(inMsg.msg, ((arg: Slice) => { - return ((builder: Builder) => { - cell1.storeSlice(arg); - }); - }))(cell1); - builder.storeRef(cell1); - let cell2 = beginCell(); - storeTransaction(inMsg.transaction)(cell2); - builder.storeRef(cell2); - storeGrams(inMsg.ihr_fee)(builder); - let cell3 = beginCell(); - cell3.storeSlice(inMsg.proof_created); - builder.storeRef(cell3); - }); - }; - if ((inMsg.kind == 'InMsg_msg_import_imm')) { - return ((builder: Builder) => { - builder.storeUint(0b011, 3); - let cell1 = beginCell(); - storeMsgEnvelope(inMsg.in_msg)(cell1); - builder.storeRef(cell1); - let cell2 = beginCell(); - storeTransaction(inMsg.transaction)(cell2); - builder.storeRef(cell2); - storeGrams(inMsg.fwd_fee)(builder); - }); - }; - if ((inMsg.kind == 'InMsg_msg_import_fin')) { - return ((builder: Builder) => { - builder.storeUint(0b100, 3); - let cell1 = beginCell(); - storeMsgEnvelope(inMsg.in_msg)(cell1); - builder.storeRef(cell1); - let cell2 = beginCell(); - storeTransaction(inMsg.transaction)(cell2); - builder.storeRef(cell2); - storeGrams(inMsg.fwd_fee)(builder); - }); - }; - if ((inMsg.kind == 'InMsg_msg_import_tr')) { - return ((builder: Builder) => { - builder.storeUint(0b101, 3); - let cell1 = beginCell(); - storeMsgEnvelope(inMsg.in_msg)(cell1); - builder.storeRef(cell1); - let cell2 = beginCell(); - storeMsgEnvelope(inMsg.out_msg)(cell2); - builder.storeRef(cell2); - storeGrams(inMsg.transit_fee)(builder); - }); - }; - if ((inMsg.kind == 'InMsg_msg_discard_fin')) { - return ((builder: Builder) => { - builder.storeUint(0b110, 3); - let cell1 = beginCell(); - storeMsgEnvelope(inMsg.in_msg)(cell1); - builder.storeRef(cell1); - builder.storeUint(inMsg.transaction_id, 64); - storeGrams(inMsg.fwd_fee)(builder); - }); - }; - if ((inMsg.kind == 'InMsg_msg_discard_tr')) { - return ((builder: Builder) => { - builder.storeUint(0b111, 3); - let cell1 = beginCell(); - storeMsgEnvelope(inMsg.in_msg)(cell1); - builder.storeRef(cell1); - builder.storeUint(inMsg.transaction_id, 64); - storeGrams(inMsg.fwd_fee)(builder); - let cell2 = beginCell(); - cell2.storeSlice(inMsg.proof_delivered); - builder.storeRef(cell2); - }); - }; - throw new Error(''); - } -export function loadImportFees(slice: Slice): ImportFees { - let fees_collected: Grams = loadGrams(slice); - let value_imported: CurrencyCollection = loadCurrencyCollection(slice); - return { - kind: 'ImportFees', - fees_collected: fees_collected, - value_imported: value_imported - }; - } -export function storeImportFees(importFees: ImportFees): (builder: Builder) => void { - return ((builder: Builder) => { - storeGrams(importFees.fees_collected)(builder); - storeCurrencyCollection(importFees.value_imported)(builder); - }); - } -export function loadInMsgDescr(slice: Slice): InMsgDescr { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x8615b8fd))) { - slice.loadUint(32); - let anon0: HashmapAugE = loadHashmapAugE(slice, 256, loadInMsg, loadImportFees); - return { - kind: 'InMsgDescr', - anon0: anon0 - }; - }; - throw new Error(''); - } -export function storeInMsgDescr(inMsgDescr: InMsgDescr): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x8615b8fd, 32); - storeHashmapAugE(inMsgDescr.anon0, storeInMsg, storeImportFees)(builder); - }); - } -export function loadOutMsg(slice: Slice): OutMsg { - if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b000))) { - slice.loadUint(3); - let slice1 = slice.loadRef().beginParse(); - let msg: Message = loadMessage(slice1, ((slice: Slice) => { - return slice; - })); - let slice2 = slice.loadRef().beginParse(); - let transaction: Transaction = loadTransaction(slice2); - return { - kind: 'OutMsg_msg_export_ext', - msg: msg, - transaction: transaction - }; - }; - if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b010))) { - slice.loadUint(3); - let slice1 = slice.loadRef().beginParse(); - let out_msg: MsgEnvelope = loadMsgEnvelope(slice1); - let slice2 = slice.loadRef().beginParse(); - let transaction: Transaction = loadTransaction(slice2); - let slice3 = slice.loadRef().beginParse(); - let reimport: InMsg = loadInMsg(slice3); - return { - kind: 'OutMsg_msg_export_imm', - out_msg: out_msg, - transaction: transaction, - reimport: reimport - }; - }; - if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b001))) { - slice.loadUint(3); - let slice1 = slice.loadRef().beginParse(); - let out_msg: MsgEnvelope = loadMsgEnvelope(slice1); - let slice2 = slice.loadRef().beginParse(); - let transaction: Transaction = loadTransaction(slice2); - return { - kind: 'OutMsg_msg_export_new', - out_msg: out_msg, - transaction: transaction - }; - }; - if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b011))) { - slice.loadUint(3); - let slice1 = slice.loadRef().beginParse(); - let out_msg: MsgEnvelope = loadMsgEnvelope(slice1); - let slice2 = slice.loadRef().beginParse(); - let imported: InMsg = loadInMsg(slice2); - return { - kind: 'OutMsg_msg_export_tr', - out_msg: out_msg, - imported: imported - }; - }; - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b1100))) { - slice.loadUint(4); - let slice1 = slice.loadRef().beginParse(); - let out_msg: MsgEnvelope = loadMsgEnvelope(slice1); - let import_block_lt: number = slice.loadUint(63); - return { - kind: 'OutMsg_msg_export_deq', - out_msg: out_msg, - import_block_lt: import_block_lt - }; - }; - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b1101))) { - slice.loadUint(4); - let msg_env_hash: BitString = slice.loadBits(256); - let next_workchain: number = slice.loadInt(32); - let next_addr_pfx: number = slice.loadUint(64); - let import_block_lt: number = slice.loadUint(64); - return { - kind: 'OutMsg_msg_export_deq_short', - msg_env_hash: msg_env_hash, - next_workchain: next_workchain, - next_addr_pfx: next_addr_pfx, - import_block_lt: import_block_lt - }; - }; - if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b111))) { - slice.loadUint(3); - let slice1 = slice.loadRef().beginParse(); - let out_msg: MsgEnvelope = loadMsgEnvelope(slice1); - let slice2 = slice.loadRef().beginParse(); - let imported: InMsg = loadInMsg(slice2); - return { - kind: 'OutMsg_msg_export_tr_req', - out_msg: out_msg, - imported: imported - }; - }; - if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b100))) { - slice.loadUint(3); - let slice1 = slice.loadRef().beginParse(); - let out_msg: MsgEnvelope = loadMsgEnvelope(slice1); - let slice2 = slice.loadRef().beginParse(); - let reimport: InMsg = loadInMsg(slice2); - return { - kind: 'OutMsg_msg_export_deq_imm', - out_msg: out_msg, - reimport: reimport - }; - }; - throw new Error(''); - } -export function storeOutMsg(outMsg: OutMsg): (builder: Builder) => void { - if ((outMsg.kind == 'OutMsg_msg_export_ext')) { - return ((builder: Builder) => { - builder.storeUint(0b000, 3); - let cell1 = beginCell(); - storeMessage(outMsg.msg, ((arg: Slice) => { - return ((builder: Builder) => { - cell1.storeSlice(arg); - }); - }))(cell1); - builder.storeRef(cell1); - let cell2 = beginCell(); - storeTransaction(outMsg.transaction)(cell2); - builder.storeRef(cell2); - }); - }; - if ((outMsg.kind == 'OutMsg_msg_export_imm')) { - return ((builder: Builder) => { - builder.storeUint(0b010, 3); - let cell1 = beginCell(); - storeMsgEnvelope(outMsg.out_msg)(cell1); - builder.storeRef(cell1); - let cell2 = beginCell(); - storeTransaction(outMsg.transaction)(cell2); - builder.storeRef(cell2); - let cell3 = beginCell(); - storeInMsg(outMsg.reimport)(cell3); - builder.storeRef(cell3); - }); - }; - if ((outMsg.kind == 'OutMsg_msg_export_new')) { - return ((builder: Builder) => { - builder.storeUint(0b001, 3); - let cell1 = beginCell(); - storeMsgEnvelope(outMsg.out_msg)(cell1); - builder.storeRef(cell1); - let cell2 = beginCell(); - storeTransaction(outMsg.transaction)(cell2); - builder.storeRef(cell2); - }); - }; - if ((outMsg.kind == 'OutMsg_msg_export_tr')) { - return ((builder: Builder) => { - builder.storeUint(0b011, 3); - let cell1 = beginCell(); - storeMsgEnvelope(outMsg.out_msg)(cell1); - builder.storeRef(cell1); - let cell2 = beginCell(); - storeInMsg(outMsg.imported)(cell2); - builder.storeRef(cell2); - }); - }; - if ((outMsg.kind == 'OutMsg_msg_export_deq')) { - return ((builder: Builder) => { - builder.storeUint(0b1100, 4); - let cell1 = beginCell(); - storeMsgEnvelope(outMsg.out_msg)(cell1); - builder.storeRef(cell1); - builder.storeUint(outMsg.import_block_lt, 63); - }); - }; - if ((outMsg.kind == 'OutMsg_msg_export_deq_short')) { - return ((builder: Builder) => { - builder.storeUint(0b1101, 4); - builder.storeBits(outMsg.msg_env_hash); - builder.storeInt(outMsg.next_workchain, 32); - builder.storeUint(outMsg.next_addr_pfx, 64); - builder.storeUint(outMsg.import_block_lt, 64); - }); - }; - if ((outMsg.kind == 'OutMsg_msg_export_tr_req')) { - return ((builder: Builder) => { - builder.storeUint(0b111, 3); - let cell1 = beginCell(); - storeMsgEnvelope(outMsg.out_msg)(cell1); - builder.storeRef(cell1); - let cell2 = beginCell(); - storeInMsg(outMsg.imported)(cell2); - builder.storeRef(cell2); - }); - }; - if ((outMsg.kind == 'OutMsg_msg_export_deq_imm')) { - return ((builder: Builder) => { - builder.storeUint(0b100, 3); - let cell1 = beginCell(); - storeMsgEnvelope(outMsg.out_msg)(cell1); - builder.storeRef(cell1); - let cell2 = beginCell(); - storeInMsg(outMsg.reimport)(cell2); - builder.storeRef(cell2); - }); - }; - throw new Error(''); - } -export function loadEnqueuedMsg(slice: Slice): EnqueuedMsg { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x98cd4c6e))) { - slice.loadUint(32); - let enqueued_lt: number = slice.loadUint(64); - let slice1 = slice.loadRef().beginParse(); - let out_msg: MsgEnvelope = loadMsgEnvelope(slice1); - return { - kind: 'EnqueuedMsg', - enqueued_lt: enqueued_lt, - out_msg: out_msg - }; - }; - throw new Error(''); - } -export function storeEnqueuedMsg(enqueuedMsg: EnqueuedMsg): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x98cd4c6e, 32); - builder.storeUint(enqueuedMsg.enqueued_lt, 64); - let cell1 = beginCell(); - storeMsgEnvelope(enqueuedMsg.out_msg)(cell1); - builder.storeRef(cell1); - }); - } -export function loadOutMsgDescr(slice: Slice): OutMsgDescr { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xbcd61b19))) { - slice.loadUint(32); - let anon0: HashmapAugE = loadHashmapAugE(slice, 256, loadOutMsg, loadCurrencyCollection); - return { - kind: 'OutMsgDescr', - anon0: anon0 - }; - }; - throw new Error(''); - } -export function storeOutMsgDescr(outMsgDescr: OutMsgDescr): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xbcd61b19, 32); - storeHashmapAugE(outMsgDescr.anon0, storeOutMsg, storeCurrencyCollection)(builder); - }); - } -export function loadOutMsgQueue(slice: Slice): OutMsgQueue { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xcf5f0da2))) { - slice.loadUint(32); - let anon0: HashmapAugE = loadHashmapAugE(slice, 352, loadEnqueuedMsg, ((slice: Slice) => { - return slice.loadUint(64); - })); - return { - kind: 'OutMsgQueue', - anon0: anon0 - }; - }; - throw new Error(''); - } -export function storeOutMsgQueue(outMsgQueue: OutMsgQueue): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xcf5f0da2, 32); - storeHashmapAugE(outMsgQueue.anon0, storeEnqueuedMsg, ((arg: number) => { - return ((builder: Builder) => { - builder.storeUint(arg, 64); - }); - }))(builder); - }); - } -export function loadProcessedUpto(slice: Slice): ProcessedUpto { - let last_msg_lt: number = slice.loadUint(64); - let last_msg_hash: BitString = slice.loadBits(256); - return { - kind: 'ProcessedUpto', - last_msg_lt: last_msg_lt, - last_msg_hash: last_msg_hash - }; - } -export function storeProcessedUpto(processedUpto: ProcessedUpto): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(processedUpto.last_msg_lt, 64); - builder.storeBits(processedUpto.last_msg_hash); - }); - } -export function loadProcessedInfo(slice: Slice): ProcessedInfo { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x982f4fa3))) { - slice.loadUint(32); - let anon0: HashmapE = loadHashmapE(slice, 96, loadProcessedUpto); - return { - kind: 'ProcessedInfo', - anon0: anon0 - }; - }; - throw new Error(''); - } -export function storeProcessedInfo(processedInfo: ProcessedInfo): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x982f4fa3, 32); - storeHashmapE(processedInfo.anon0, storeProcessedUpto)(builder); - }); - } -export function loadIhrPendingSince(slice: Slice): IhrPendingSince { - let import_lt: number = slice.loadUint(64); - return { - kind: 'IhrPendingSince', - import_lt: import_lt - }; - } -export function storeIhrPendingSince(ihrPendingSince: IhrPendingSince): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(ihrPendingSince.import_lt, 64); - }); - } -export function loadIhrPendingInfo(slice: Slice): IhrPendingInfo { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xc31463df))) { - slice.loadUint(32); - let anon0: HashmapE = loadHashmapE(slice, 320, loadIhrPendingSince); - return { - kind: 'IhrPendingInfo', - anon0: anon0 - }; - }; - throw new Error(''); - } -export function storeIhrPendingInfo(ihrPendingInfo: IhrPendingInfo): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xc31463df, 32); - storeHashmapE(ihrPendingInfo.anon0, storeIhrPendingSince)(builder); - }); - } -export function loadOutMsgQueueInfo(slice: Slice): OutMsgQueueInfo { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x98bb9b21))) { - slice.loadUint(32); - let out_queue: OutMsgQueue = loadOutMsgQueue(slice); - let proc_info: ProcessedInfo = loadProcessedInfo(slice); - let ihr_pending: IhrPendingInfo = loadIhrPendingInfo(slice); - return { - kind: 'OutMsgQueueInfo', - out_queue: out_queue, - proc_info: proc_info, - ihr_pending: ihr_pending - }; - }; - throw new Error(''); - } -export function storeOutMsgQueueInfo(outMsgQueueInfo: OutMsgQueueInfo): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x98bb9b21, 32); - storeOutMsgQueue(outMsgQueueInfo.out_queue)(builder); - storeProcessedInfo(outMsgQueueInfo.proc_info)(builder); - storeIhrPendingInfo(outMsgQueueInfo.ihr_pending)(builder); - }); - } -export function loadStorageUsed(slice: Slice): StorageUsed { - let _cells: VarUInteger = loadVarUInteger(slice, 7); - let bits: VarUInteger = loadVarUInteger(slice, 7); - let public_cells: VarUInteger = loadVarUInteger(slice, 7); - return { - kind: 'StorageUsed', - _cells: _cells, - bits: bits, - public_cells: public_cells - }; - } -export function storeStorageUsed(storageUsed: StorageUsed): (builder: Builder) => void { - return ((builder: Builder) => { - storeVarUInteger(storageUsed._cells)(builder); - storeVarUInteger(storageUsed.bits)(builder); - storeVarUInteger(storageUsed.public_cells)(builder); - }); - } -export function loadStorageUsedShort(slice: Slice): StorageUsedShort { - let _cells: VarUInteger = loadVarUInteger(slice, 7); - let bits: VarUInteger = loadVarUInteger(slice, 7); - return { - kind: 'StorageUsedShort', - _cells: _cells, - bits: bits - }; - } -export function storeStorageUsedShort(storageUsedShort: StorageUsedShort): (builder: Builder) => void { - return ((builder: Builder) => { - storeVarUInteger(storageUsedShort._cells)(builder); - storeVarUInteger(storageUsedShort.bits)(builder); - }); - } -export function loadStorageInfo(slice: Slice): StorageInfo { - let used: StorageUsed = loadStorageUsed(slice); - let last_paid: number = slice.loadUint(32); - let due_payment: Maybe = loadMaybe(slice, loadGrams); - return { - kind: 'StorageInfo', - used: used, - last_paid: last_paid, - due_payment: due_payment - }; - } -export function storeStorageInfo(storageInfo: StorageInfo): (builder: Builder) => void { - return ((builder: Builder) => { - storeStorageUsed(storageInfo.used)(builder); - builder.storeUint(storageInfo.last_paid, 32); - storeMaybe(storageInfo.due_payment, storeGrams)(builder); - }); - } -export function loadAccount(slice: Slice): Account { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1); - return { - kind: 'Account_account_none' - }; - }; - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1); - let addr: MsgAddressInt = loadMsgAddressInt(slice); - let storage_stat: StorageInfo = loadStorageInfo(slice); - let storage: AccountStorage = loadAccountStorage(slice); - return { - kind: 'Account_account', - addr: addr, - storage_stat: storage_stat, - storage: storage - }; - }; - throw new Error(''); - } -export function storeAccount(account: Account): (builder: Builder) => void { - if ((account.kind == 'Account_account_none')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1); - }); - }; - if ((account.kind == 'Account_account')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1); - storeMsgAddressInt(account.addr)(builder); - storeStorageInfo(account.storage_stat)(builder); - storeAccountStorage(account.storage)(builder); - }); - }; - throw new Error(''); - } -export function loadAccountStorage(slice: Slice): AccountStorage { - let last_trans_lt: number = slice.loadUint(64); - let balance: CurrencyCollection = loadCurrencyCollection(slice); - let state: AccountState = loadAccountState(slice); - return { - kind: 'AccountStorage', - last_trans_lt: last_trans_lt, - balance: balance, - state: state - }; - } -export function storeAccountStorage(accountStorage: AccountStorage): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(accountStorage.last_trans_lt, 64); - storeCurrencyCollection(accountStorage.balance)(builder); - storeAccountState(accountStorage.state)(builder); - }); - } -export function loadAccountState(slice: Slice): AccountState { - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { - slice.loadUint(2); - return { - kind: 'AccountState_account_uninit' - }; - }; - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1); - let _: StateInit = loadStateInit(slice); - return { - kind: 'AccountState_account_active', - _: _ - }; - }; - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b01))) { - slice.loadUint(2); - let state_hash: BitString = slice.loadBits(256); - return { - kind: 'AccountState_account_frozen', - state_hash: state_hash - }; - }; - throw new Error(''); - } -export function storeAccountState(accountState: AccountState): (builder: Builder) => void { - if ((accountState.kind == 'AccountState_account_uninit')) { - return ((builder: Builder) => { - builder.storeUint(0b00, 2); - }); - }; - if ((accountState.kind == 'AccountState_account_active')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1); - storeStateInit(accountState._)(builder); - }); - }; - if ((accountState.kind == 'AccountState_account_frozen')) { - return ((builder: Builder) => { - builder.storeUint(0b01, 2); - builder.storeBits(accountState.state_hash); - }); - }; - throw new Error(''); - } -export function loadAccountStatus(slice: Slice): AccountStatus { - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { - slice.loadUint(2); - return { - kind: 'AccountStatus_acc_state_uninit' - }; - }; - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b01))) { - slice.loadUint(2); - return { - kind: 'AccountStatus_acc_state_frozen' - }; - }; - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b10))) { - slice.loadUint(2); - return { - kind: 'AccountStatus_acc_state_active' - }; - }; - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b11))) { - slice.loadUint(2); - return { - kind: 'AccountStatus_acc_state_nonexist' - }; - }; - throw new Error(''); - } -export function storeAccountStatus(accountStatus: AccountStatus): (builder: Builder) => void { - if ((accountStatus.kind == 'AccountStatus_acc_state_uninit')) { - return ((builder: Builder) => { - builder.storeUint(0b00, 2); - }); - }; - if ((accountStatus.kind == 'AccountStatus_acc_state_frozen')) { - return ((builder: Builder) => { - builder.storeUint(0b01, 2); - }); - }; - if ((accountStatus.kind == 'AccountStatus_acc_state_active')) { - return ((builder: Builder) => { - builder.storeUint(0b10, 2); - }); - }; - if ((accountStatus.kind == 'AccountStatus_acc_state_nonexist')) { - return ((builder: Builder) => { - builder.storeUint(0b11, 2); - }); - }; - throw new Error(''); - } -export function loadShardAccount(slice: Slice): ShardAccount { - let slice1 = slice.loadRef().beginParse(); - let account: Account = loadAccount(slice1); - let last_trans_hash: BitString = slice.loadBits(256); - let last_trans_lt: number = slice.loadUint(64); - return { - kind: 'ShardAccount', - account: account, - last_trans_hash: last_trans_hash, - last_trans_lt: last_trans_lt - }; - } -export function storeShardAccount(shardAccount: ShardAccount): (builder: Builder) => void { - return ((builder: Builder) => { - let cell1 = beginCell(); - storeAccount(shardAccount.account)(cell1); - builder.storeRef(cell1); - builder.storeBits(shardAccount.last_trans_hash); - builder.storeUint(shardAccount.last_trans_lt, 64); - }); - } -export function loadDepthBalanceInfo(slice: Slice): DepthBalanceInfo { - let split_depth: number = slice.loadUint(bitLen(30)); - let balance: CurrencyCollection = loadCurrencyCollection(slice); - return { - kind: 'DepthBalanceInfo', - split_depth: split_depth, - balance: balance - }; - } -export function storeDepthBalanceInfo(depthBalanceInfo: DepthBalanceInfo): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(depthBalanceInfo.split_depth, bitLen(30)); - storeCurrencyCollection(depthBalanceInfo.balance)(builder); - }); - } -export function loadShardAccounts(slice: Slice): ShardAccounts { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xa59aef08))) { - slice.loadUint(32); - let anon0: HashmapAugE = loadHashmapAugE(slice, 256, loadShardAccount, loadDepthBalanceInfo); - return { - kind: 'ShardAccounts', - anon0: anon0 - }; - }; - throw new Error(''); - } -export function storeShardAccounts(shardAccounts: ShardAccounts): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xa59aef08, 32); - storeHashmapAugE(shardAccounts.anon0, storeShardAccount, storeDepthBalanceInfo)(builder); - }); - } -export function loadTransaction(slice: Slice): Transaction { - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b0111))) { - slice.loadUint(4); - let account_addr: BitString = slice.loadBits(256); - let lt: number = slice.loadUint(64); - let prev_trans_hash: BitString = slice.loadBits(256); - let prev_trans_lt: number = slice.loadUint(64); - let now: number = slice.loadUint(32); - let outmsg_cnt: number = slice.loadUint(15); - let orig_status: AccountStatus = loadAccountStatus(slice); - let end_status: AccountStatus = loadAccountStatus(slice); - let slice1 = slice.loadRef().beginParse(); - let in_msg: Maybe> = loadMaybe>(slice1, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadMessage(slice1, ((slice: Slice) => { - return slice; - })); - })); - let out_msgs: HashmapE> = loadHashmapE>(slice1, 15, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadMessage(slice1, ((slice: Slice) => { - return slice; - })); - })); - let total_fees: CurrencyCollection = loadCurrencyCollection(slice); - let slice2 = slice.loadRef().beginParse(); - let state_update: HASH_UPDATE = loadHASH_UPDATE(slice2, loadAccount); - let slice3 = slice.loadRef().beginParse(); - let description: TransactionDescr = loadTransactionDescr(slice3); - return { - kind: 'Transaction', - account_addr: account_addr, - lt: lt, - prev_trans_hash: prev_trans_hash, - prev_trans_lt: prev_trans_lt, - now: now, - outmsg_cnt: outmsg_cnt, - orig_status: orig_status, - end_status: end_status, - in_msg: in_msg, - out_msgs: out_msgs, - total_fees: total_fees, - state_update: state_update, - description: description - }; - }; - throw new Error(''); - } -export function storeTransaction(transaction: Transaction): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0b0111, 4); - builder.storeBits(transaction.account_addr); - builder.storeUint(transaction.lt, 64); - builder.storeBits(transaction.prev_trans_hash); - builder.storeUint(transaction.prev_trans_lt, 64); - builder.storeUint(transaction.now, 32); - builder.storeUint(transaction.outmsg_cnt, 15); - storeAccountStatus(transaction.orig_status)(builder); - storeAccountStatus(transaction.end_status)(builder); - let cell1 = beginCell(); - storeMaybe>(transaction.in_msg, ((arg: Message) => { - return ((builder: Builder) => { - let cell1 = beginCell() - storeMessage(arg, ((arg: Slice) => { - return ((builder: Builder) => { - cell1.storeSlice(arg); - }); - }))(cell1) - builder.storeRef(cell1); - }); - }))(cell1); - storeHashmapE>(transaction.out_msgs, ((arg: Message) => { - return ((builder: Builder) => { - let cell1 = beginCell() - storeMessage(arg, ((arg: Slice) => { - return ((builder: Builder) => { - cell1.storeSlice(arg); - }); - }))(cell1) - builder.storeRef(cell1); - }); - }))(cell1); - builder.storeRef(cell1); - storeCurrencyCollection(transaction.total_fees)(builder); - let cell2 = beginCell(); - storeHASH_UPDATE(transaction.state_update, storeAccount)(cell2); - builder.storeRef(cell2); - let cell3 = beginCell(); - storeTransactionDescr(transaction.description)(cell3); - builder.storeRef(cell3); - }); - } -export function loadMERKLE_UPDATE(slice: Slice, loadX: (slice: Slice) => X): MERKLE_UPDATE { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x02))) { - slice.loadUint(8); - let old_hash: BitString = slice.loadBits(256); - let new_hash: BitString = slice.loadBits(256); - let slice1 = slice.loadRef().beginParse(); - let old: X = loadX(slice1); - let slice2 = slice.loadRef().beginParse(); - let new0: X = loadX(slice2); - return { - kind: 'MERKLE_UPDATE', - old_hash: old_hash, - new_hash: new_hash, - old: old, - new0: new0 - }; - }; - throw new Error(''); - } -export function storeMERKLE_UPDATE(mERKLE_UPDATE: MERKLE_UPDATE, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x02, 8); - builder.storeBits(mERKLE_UPDATE.old_hash); - builder.storeBits(mERKLE_UPDATE.new_hash); - let cell1 = beginCell(); - storeX(mERKLE_UPDATE.old)(cell1); - builder.storeRef(cell1); - let cell2 = beginCell(); - storeX(mERKLE_UPDATE.new0)(cell2); - builder.storeRef(cell2); - }); - } -export function loadHASH_UPDATE(slice: Slice, loadX: (slice: Slice) => X): HASH_UPDATE { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x72))) { - slice.loadUint(8); - let old_hash: BitString = slice.loadBits(256); - let new_hash: BitString = slice.loadBits(256); - return { - kind: 'HASH_UPDATE', - old_hash: old_hash, - new_hash: new_hash - }; - }; - throw new Error(''); - } -export function storeHASH_UPDATE(hASH_UPDATE: HASH_UPDATE, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x72, 8); - builder.storeBits(hASH_UPDATE.old_hash); - builder.storeBits(hASH_UPDATE.new_hash); - }); - } -export function loadMERKLE_PROOF(slice: Slice, loadX: (slice: Slice) => X): MERKLE_PROOF { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x03))) { - slice.loadUint(8); - let virtual_hash: BitString = slice.loadBits(256); - let depth: number = slice.loadUint(16); - let slice1 = slice.loadRef().beginParse(); - let virtual_root: X = loadX(slice1); - return { - kind: 'MERKLE_PROOF', - virtual_hash: virtual_hash, - depth: depth, - virtual_root: virtual_root - }; - }; - throw new Error(''); - } -export function storeMERKLE_PROOF(mERKLE_PROOF: MERKLE_PROOF, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x03, 8); - builder.storeBits(mERKLE_PROOF.virtual_hash); - builder.storeUint(mERKLE_PROOF.depth, 16); - let cell1 = beginCell(); - storeX(mERKLE_PROOF.virtual_root)(cell1); - builder.storeRef(cell1); - }); - } -export function loadAccountBlock(slice: Slice): AccountBlock { - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0x5))) { - slice.loadUint(4); - let account_addr: BitString = slice.loadBits(256); - let transactions: HashmapAug = loadHashmapAug(slice, 64, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadTransaction(slice1); - }), loadCurrencyCollection); - let slice1 = slice.loadRef().beginParse(); - let state_update: HASH_UPDATE = loadHASH_UPDATE(slice1, loadAccount); - return { - kind: 'AccountBlock', - account_addr: account_addr, - transactions: transactions, - state_update: state_update - }; - }; - throw new Error(''); - } -export function storeAccountBlock(accountBlock: AccountBlock): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x5, 4); - builder.storeBits(accountBlock.account_addr); - storeHashmapAug(accountBlock.transactions, ((arg: Transaction) => { - return ((builder: Builder) => { - let cell1 = beginCell() - storeTransaction(arg)(cell1) - builder.storeRef(cell1); - }); - }), storeCurrencyCollection)(builder); - let cell1 = beginCell(); - storeHASH_UPDATE(accountBlock.state_update, storeAccount)(cell1); - builder.storeRef(cell1); - }); - } -export function loadShardAccountBlocks(slice: Slice): ShardAccountBlocks { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xdc67c889))) { - slice.loadUint(32); - let anon0: HashmapAugE = loadHashmapAugE(slice, 256, loadAccountBlock, loadCurrencyCollection); - return { - kind: 'ShardAccountBlocks', - anon0: anon0 - }; - }; - throw new Error(''); - } -export function storeShardAccountBlocks(shardAccountBlocks: ShardAccountBlocks): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xdc67c889, 32); - storeHashmapAugE(shardAccountBlocks.anon0, storeAccountBlock, storeCurrencyCollection)(builder); - }); - } -export function loadTrStoragePhase(slice: Slice): TrStoragePhase { - let storage_fees_collected: Grams = loadGrams(slice); - let storage_fees_due: Maybe = loadMaybe(slice, loadGrams); - let status_change: AccStatusChange = loadAccStatusChange(slice); - return { - kind: 'TrStoragePhase', - storage_fees_collected: storage_fees_collected, - storage_fees_due: storage_fees_due, - status_change: status_change - }; - } -export function storeTrStoragePhase(trStoragePhase: TrStoragePhase): (builder: Builder) => void { - return ((builder: Builder) => { - storeGrams(trStoragePhase.storage_fees_collected)(builder); - storeMaybe(trStoragePhase.storage_fees_due, storeGrams)(builder); - storeAccStatusChange(trStoragePhase.status_change)(builder); - }); - } -export function loadAccStatusChange(slice: Slice): AccStatusChange { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1); - return { - kind: 'AccStatusChange_acst_unchanged' - }; - }; - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b10))) { - slice.loadUint(2); - return { - kind: 'AccStatusChange_acst_frozen' - }; - }; - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b11))) { - slice.loadUint(2); - return { - kind: 'AccStatusChange_acst_deleted' - }; - }; - throw new Error(''); - } -export function storeAccStatusChange(accStatusChange: AccStatusChange): (builder: Builder) => void { - if ((accStatusChange.kind == 'AccStatusChange_acst_unchanged')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1); - }); - }; - if ((accStatusChange.kind == 'AccStatusChange_acst_frozen')) { - return ((builder: Builder) => { - builder.storeUint(0b10, 2); - }); - }; - if ((accStatusChange.kind == 'AccStatusChange_acst_deleted')) { - return ((builder: Builder) => { - builder.storeUint(0b11, 2); - }); - }; - throw new Error(''); - } -export function loadTrCreditPhase(slice: Slice): TrCreditPhase { - let due_fees_collected: Maybe = loadMaybe(slice, loadGrams); - let credit: CurrencyCollection = loadCurrencyCollection(slice); - return { - kind: 'TrCreditPhase', - due_fees_collected: due_fees_collected, - credit: credit - }; - } -export function storeTrCreditPhase(trCreditPhase: TrCreditPhase): (builder: Builder) => void { - return ((builder: Builder) => { - storeMaybe(trCreditPhase.due_fees_collected, storeGrams)(builder); - storeCurrencyCollection(trCreditPhase.credit)(builder); - }); - } -export function loadTrComputePhase(slice: Slice): TrComputePhase { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1); - let reason: ComputeSkipReason = loadComputeSkipReason(slice); - return { - kind: 'TrComputePhase_tr_phase_compute_skipped', - reason: reason - }; - }; - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1); - let success: Bool = loadBool(slice); - let msg_state_used: Bool = loadBool(slice); - let account_activated: Bool = loadBool(slice); - let gas_fees: Grams = loadGrams(slice); - let slice1 = slice.loadRef().beginParse(); - let gas_used: VarUInteger = loadVarUInteger(slice1, 7); - let gas_limit: VarUInteger = loadVarUInteger(slice1, 7); - let gas_credit: Maybe = loadMaybe(slice1, ((slice: Slice) => { - return loadVarUInteger(slice, 3); - })); - let mode: number = slice1.loadInt(8); - let exit_code: number = slice1.loadInt(32); - let exit_arg: Maybe = loadMaybe(slice1, ((slice: Slice) => { - return slice1.loadInt(32); - })); - let vm_steps: number = slice1.loadUint(32); - let vm_init_state_hash: BitString = slice1.loadBits(256); - let vm_final_state_hash: BitString = slice1.loadBits(256); - return { - kind: 'TrComputePhase_tr_phase_compute_vm', - success: success, - msg_state_used: msg_state_used, - account_activated: account_activated, - gas_fees: gas_fees, - gas_used: gas_used, - gas_limit: gas_limit, - gas_credit: gas_credit, - mode: mode, - exit_code: exit_code, - exit_arg: exit_arg, - vm_steps: vm_steps, - vm_init_state_hash: vm_init_state_hash, - vm_final_state_hash: vm_final_state_hash - }; - }; - throw new Error(''); - } -export function storeTrComputePhase(trComputePhase: TrComputePhase): (builder: Builder) => void { - if ((trComputePhase.kind == 'TrComputePhase_tr_phase_compute_skipped')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1); - storeComputeSkipReason(trComputePhase.reason)(builder); - }); - }; - if ((trComputePhase.kind == 'TrComputePhase_tr_phase_compute_vm')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1); - storeBool(trComputePhase.success)(builder); - storeBool(trComputePhase.msg_state_used)(builder); - storeBool(trComputePhase.account_activated)(builder); - storeGrams(trComputePhase.gas_fees)(builder); - let cell1 = beginCell(); - storeVarUInteger(trComputePhase.gas_used)(cell1); - storeVarUInteger(trComputePhase.gas_limit)(cell1); - storeMaybe(trComputePhase.gas_credit, ((arg: VarUInteger) => { - return ((builder: Builder) => { - storeVarUInteger(arg)(builder); - }); - }))(cell1); - cell1.storeInt(trComputePhase.mode, 8); - cell1.storeInt(trComputePhase.exit_code, 32); - storeMaybe(trComputePhase.exit_arg, ((arg: number) => { - return ((builder: Builder) => { - cell1.storeInt(arg, 32); - }); - }))(cell1); - cell1.storeUint(trComputePhase.vm_steps, 32); - cell1.storeBits(trComputePhase.vm_init_state_hash); - cell1.storeBits(trComputePhase.vm_final_state_hash); - builder.storeRef(cell1); - }); - }; - throw new Error(''); - } -export function loadComputeSkipReason(slice: Slice): ComputeSkipReason { - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { - slice.loadUint(2); - return { - kind: 'ComputeSkipReason_cskip_no_state' - }; - }; - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b01))) { - slice.loadUint(2); - return { - kind: 'ComputeSkipReason_cskip_bad_state' - }; - }; - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b10))) { - slice.loadUint(2); - return { - kind: 'ComputeSkipReason_cskip_no_gas' - }; - }; - throw new Error(''); - } -export function storeComputeSkipReason(computeSkipReason: ComputeSkipReason): (builder: Builder) => void { - if ((computeSkipReason.kind == 'ComputeSkipReason_cskip_no_state')) { - return ((builder: Builder) => { - builder.storeUint(0b00, 2); - }); - }; - if ((computeSkipReason.kind == 'ComputeSkipReason_cskip_bad_state')) { - return ((builder: Builder) => { - builder.storeUint(0b01, 2); - }); - }; - if ((computeSkipReason.kind == 'ComputeSkipReason_cskip_no_gas')) { - return ((builder: Builder) => { - builder.storeUint(0b10, 2); - }); - }; - throw new Error(''); - } -export function loadTrActionPhase(slice: Slice): TrActionPhase { - let success: Bool = loadBool(slice); - let valid: Bool = loadBool(slice); - let no_funds: Bool = loadBool(slice); - let status_change: AccStatusChange = loadAccStatusChange(slice); - let total_fwd_fees: Maybe = loadMaybe(slice, loadGrams); - let total_action_fees: Maybe = loadMaybe(slice, loadGrams); - let result_code: number = slice.loadInt(32); - let result_arg: Maybe = loadMaybe(slice, ((slice: Slice) => { - return slice.loadInt(32); - })); - let tot_actions: number = slice.loadUint(16); - let spec_actions: number = slice.loadUint(16); - let skipped_actions: number = slice.loadUint(16); - let msgs_created: number = slice.loadUint(16); - let action_list_hash: BitString = slice.loadBits(256); - let tot_msg_size: StorageUsedShort = loadStorageUsedShort(slice); - return { - kind: 'TrActionPhase', - success: success, - valid: valid, - no_funds: no_funds, - status_change: status_change, - total_fwd_fees: total_fwd_fees, - total_action_fees: total_action_fees, - result_code: result_code, - result_arg: result_arg, - tot_actions: tot_actions, - spec_actions: spec_actions, - skipped_actions: skipped_actions, - msgs_created: msgs_created, - action_list_hash: action_list_hash, - tot_msg_size: tot_msg_size - }; - } -export function storeTrActionPhase(trActionPhase: TrActionPhase): (builder: Builder) => void { - return ((builder: Builder) => { - storeBool(trActionPhase.success)(builder); - storeBool(trActionPhase.valid)(builder); - storeBool(trActionPhase.no_funds)(builder); - storeAccStatusChange(trActionPhase.status_change)(builder); - storeMaybe(trActionPhase.total_fwd_fees, storeGrams)(builder); - storeMaybe(trActionPhase.total_action_fees, storeGrams)(builder); - builder.storeInt(trActionPhase.result_code, 32); - storeMaybe(trActionPhase.result_arg, ((arg: number) => { - return ((builder: Builder) => { - builder.storeInt(arg, 32); - }); - }))(builder); - builder.storeUint(trActionPhase.tot_actions, 16); - builder.storeUint(trActionPhase.spec_actions, 16); - builder.storeUint(trActionPhase.skipped_actions, 16); - builder.storeUint(trActionPhase.msgs_created, 16); - builder.storeBits(trActionPhase.action_list_hash); - storeStorageUsedShort(trActionPhase.tot_msg_size)(builder); - }); - } -export function loadTrBouncePhase(slice: Slice): TrBouncePhase { - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { - slice.loadUint(2); - return { - kind: 'TrBouncePhase_tr_phase_bounce_negfunds' - }; - }; - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b01))) { - slice.loadUint(2); - let msg_size: StorageUsedShort = loadStorageUsedShort(slice); - let req_fwd_fees: Grams = loadGrams(slice); - return { - kind: 'TrBouncePhase_tr_phase_bounce_nofunds', - msg_size: msg_size, - req_fwd_fees: req_fwd_fees - }; - }; - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1); - let msg_size: StorageUsedShort = loadStorageUsedShort(slice); - let msg_fees: Grams = loadGrams(slice); - let fwd_fees: Grams = loadGrams(slice); - return { - kind: 'TrBouncePhase_tr_phase_bounce_ok', - msg_size: msg_size, - msg_fees: msg_fees, - fwd_fees: fwd_fees - }; - }; - throw new Error(''); - } -export function storeTrBouncePhase(trBouncePhase: TrBouncePhase): (builder: Builder) => void { - if ((trBouncePhase.kind == 'TrBouncePhase_tr_phase_bounce_negfunds')) { - return ((builder: Builder) => { - builder.storeUint(0b00, 2); - }); - }; - if ((trBouncePhase.kind == 'TrBouncePhase_tr_phase_bounce_nofunds')) { - return ((builder: Builder) => { - builder.storeUint(0b01, 2); - storeStorageUsedShort(trBouncePhase.msg_size)(builder); - storeGrams(trBouncePhase.req_fwd_fees)(builder); - }); - }; - if ((trBouncePhase.kind == 'TrBouncePhase_tr_phase_bounce_ok')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1); - storeStorageUsedShort(trBouncePhase.msg_size)(builder); - storeGrams(trBouncePhase.msg_fees)(builder); - storeGrams(trBouncePhase.fwd_fees)(builder); - }); - }; - throw new Error(''); - } -export function loadTransactionDescr(slice: Slice): TransactionDescr { - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b0000))) { - slice.loadUint(4); - let credit_first: Bool = loadBool(slice); - let storage_ph: Maybe = loadMaybe(slice, loadTrStoragePhase); - let credit_ph: Maybe = loadMaybe(slice, loadTrCreditPhase); - let compute_ph: TrComputePhase = loadTrComputePhase(slice); - let action: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadTrActionPhase(slice1); - })); - let aborted: Bool = loadBool(slice); - let bounce: Maybe = loadMaybe(slice, loadTrBouncePhase); - let destroyed: Bool = loadBool(slice); - return { - kind: 'TransactionDescr_trans_ord', - credit_first: credit_first, - storage_ph: storage_ph, - credit_ph: credit_ph, - compute_ph: compute_ph, - action: action, - aborted: aborted, - bounce: bounce, - destroyed: destroyed - }; - }; - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b0001))) { - slice.loadUint(4); - let storage_ph: TrStoragePhase = loadTrStoragePhase(slice); - return { - kind: 'TransactionDescr_trans_storage', - storage_ph: storage_ph - }; - }; - if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b001))) { - slice.loadUint(3); - let is_tock: Bool = loadBool(slice); - let storage_ph: TrStoragePhase = loadTrStoragePhase(slice); - let compute_ph: TrComputePhase = loadTrComputePhase(slice); - let action: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadTrActionPhase(slice1); - })); - let aborted: Bool = loadBool(slice); - let destroyed: Bool = loadBool(slice); - return { - kind: 'TransactionDescr_trans_tick_tock', - is_tock: is_tock, - storage_ph: storage_ph, - compute_ph: compute_ph, - action: action, - aborted: aborted, - destroyed: destroyed - }; - }; - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b0100))) { - slice.loadUint(4); - let split_info: SplitMergeInfo = loadSplitMergeInfo(slice); - let storage_ph: Maybe = loadMaybe(slice, loadTrStoragePhase); - let compute_ph: TrComputePhase = loadTrComputePhase(slice); - let action: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadTrActionPhase(slice1); - })); - let aborted: Bool = loadBool(slice); - let destroyed: Bool = loadBool(slice); - return { - kind: 'TransactionDescr_trans_split_prepare', - split_info: split_info, - storage_ph: storage_ph, - compute_ph: compute_ph, - action: action, - aborted: aborted, - destroyed: destroyed - }; - }; - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b0101))) { - slice.loadUint(4); - let split_info: SplitMergeInfo = loadSplitMergeInfo(slice); - let slice1 = slice.loadRef().beginParse(); - let prepare_transaction: Transaction = loadTransaction(slice1); - let installed: Bool = loadBool(slice); - return { - kind: 'TransactionDescr_trans_split_install', - split_info: split_info, - prepare_transaction: prepare_transaction, - installed: installed - }; - }; - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b0110))) { - slice.loadUint(4); - let split_info: SplitMergeInfo = loadSplitMergeInfo(slice); - let storage_ph: TrStoragePhase = loadTrStoragePhase(slice); - let aborted: Bool = loadBool(slice); - return { - kind: 'TransactionDescr_trans_merge_prepare', - split_info: split_info, - storage_ph: storage_ph, - aborted: aborted - }; - }; - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b0111))) { - slice.loadUint(4); - let split_info: SplitMergeInfo = loadSplitMergeInfo(slice); - let slice1 = slice.loadRef().beginParse(); - let prepare_transaction: Transaction = loadTransaction(slice1); - let storage_ph: Maybe = loadMaybe(slice, loadTrStoragePhase); - let credit_ph: Maybe = loadMaybe(slice, loadTrCreditPhase); - let compute_ph: TrComputePhase = loadTrComputePhase(slice); - let action: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadTrActionPhase(slice1); - })); - let aborted: Bool = loadBool(slice); - let destroyed: Bool = loadBool(slice); - return { - kind: 'TransactionDescr_trans_merge_install', - split_info: split_info, - prepare_transaction: prepare_transaction, - storage_ph: storage_ph, - credit_ph: credit_ph, - compute_ph: compute_ph, - action: action, - aborted: aborted, - destroyed: destroyed - }; - }; - throw new Error(''); - } -export function storeTransactionDescr(transactionDescr: TransactionDescr): (builder: Builder) => void { - if ((transactionDescr.kind == 'TransactionDescr_trans_ord')) { - return ((builder: Builder) => { - builder.storeUint(0b0000, 4); - storeBool(transactionDescr.credit_first)(builder); - storeMaybe(transactionDescr.storage_ph, storeTrStoragePhase)(builder); - storeMaybe(transactionDescr.credit_ph, storeTrCreditPhase)(builder); - storeTrComputePhase(transactionDescr.compute_ph)(builder); - storeMaybe(transactionDescr.action, ((arg: TrActionPhase) => { - return ((builder: Builder) => { - let cell1 = beginCell() - storeTrActionPhase(arg)(cell1) - builder.storeRef(cell1); - }); - }))(builder); - storeBool(transactionDescr.aborted)(builder); - storeMaybe(transactionDescr.bounce, storeTrBouncePhase)(builder); - storeBool(transactionDescr.destroyed)(builder); - }); - }; - if ((transactionDescr.kind == 'TransactionDescr_trans_storage')) { - return ((builder: Builder) => { - builder.storeUint(0b0001, 4); - storeTrStoragePhase(transactionDescr.storage_ph)(builder); - }); - }; - if ((transactionDescr.kind == 'TransactionDescr_trans_tick_tock')) { - return ((builder: Builder) => { - builder.storeUint(0b001, 3); - storeBool(transactionDescr.is_tock)(builder); - storeTrStoragePhase(transactionDescr.storage_ph)(builder); - storeTrComputePhase(transactionDescr.compute_ph)(builder); - storeMaybe(transactionDescr.action, ((arg: TrActionPhase) => { - return ((builder: Builder) => { - let cell1 = beginCell() - storeTrActionPhase(arg)(cell1) - builder.storeRef(cell1); - }); - }))(builder); - storeBool(transactionDescr.aborted)(builder); - storeBool(transactionDescr.destroyed)(builder); - }); - }; - if ((transactionDescr.kind == 'TransactionDescr_trans_split_prepare')) { - return ((builder: Builder) => { - builder.storeUint(0b0100, 4); - storeSplitMergeInfo(transactionDescr.split_info)(builder); - storeMaybe(transactionDescr.storage_ph, storeTrStoragePhase)(builder); - storeTrComputePhase(transactionDescr.compute_ph)(builder); - storeMaybe(transactionDescr.action, ((arg: TrActionPhase) => { - return ((builder: Builder) => { - let cell1 = beginCell() - storeTrActionPhase(arg)(cell1) - builder.storeRef(cell1); - }); - }))(builder); - storeBool(transactionDescr.aborted)(builder); - storeBool(transactionDescr.destroyed)(builder); - }); - }; - if ((transactionDescr.kind == 'TransactionDescr_trans_split_install')) { - return ((builder: Builder) => { - builder.storeUint(0b0101, 4); - storeSplitMergeInfo(transactionDescr.split_info)(builder); - let cell1 = beginCell(); - storeTransaction(transactionDescr.prepare_transaction)(cell1); - builder.storeRef(cell1); - storeBool(transactionDescr.installed)(builder); - }); - }; - if ((transactionDescr.kind == 'TransactionDescr_trans_merge_prepare')) { - return ((builder: Builder) => { - builder.storeUint(0b0110, 4); - storeSplitMergeInfo(transactionDescr.split_info)(builder); - storeTrStoragePhase(transactionDescr.storage_ph)(builder); - storeBool(transactionDescr.aborted)(builder); - }); - }; - if ((transactionDescr.kind == 'TransactionDescr_trans_merge_install')) { - return ((builder: Builder) => { - builder.storeUint(0b0111, 4); - storeSplitMergeInfo(transactionDescr.split_info)(builder); - let cell1 = beginCell(); - storeTransaction(transactionDescr.prepare_transaction)(cell1); - builder.storeRef(cell1); - storeMaybe(transactionDescr.storage_ph, storeTrStoragePhase)(builder); - storeMaybe(transactionDescr.credit_ph, storeTrCreditPhase)(builder); - storeTrComputePhase(transactionDescr.compute_ph)(builder); - storeMaybe(transactionDescr.action, ((arg: TrActionPhase) => { - return ((builder: Builder) => { - let cell1 = beginCell() - storeTrActionPhase(arg)(cell1) - builder.storeRef(cell1); - }); - }))(builder); - storeBool(transactionDescr.aborted)(builder); - storeBool(transactionDescr.destroyed)(builder); - }); - }; - throw new Error(''); - } -export function loadSplitMergeInfo(slice: Slice): SplitMergeInfo { - let cur_shard_pfx_len: number = slice.loadUint(6); - let acc_split_depth: number = slice.loadUint(6); - let this_addr: BitString = slice.loadBits(256); - let sibling_addr: BitString = slice.loadBits(256); - return { - kind: 'SplitMergeInfo', - cur_shard_pfx_len: cur_shard_pfx_len, - acc_split_depth: acc_split_depth, - this_addr: this_addr, - sibling_addr: sibling_addr - }; - } -export function storeSplitMergeInfo(splitMergeInfo: SplitMergeInfo): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(splitMergeInfo.cur_shard_pfx_len, 6); - builder.storeUint(splitMergeInfo.acc_split_depth, 6); - builder.storeBits(splitMergeInfo.this_addr); - builder.storeBits(splitMergeInfo.sibling_addr); - }); - } -export function loadSmartContractInfo(slice: Slice): SmartContractInfo { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x076ef1ea))) { - slice.loadUint(32); - let actions: number = slice.loadUint(16); - let msgs_sent: number = slice.loadUint(16); - let unixtime: number = slice.loadUint(32); - let block_lt: number = slice.loadUint(64); - let trans_lt: number = slice.loadUint(64); - let rand_seed: BitString = slice.loadBits(256); - let balance_remaining: CurrencyCollection = loadCurrencyCollection(slice); - let myself: MsgAddressInt = loadMsgAddressInt(slice); - return { - kind: 'SmartContractInfo', - actions: actions, - msgs_sent: msgs_sent, - unixtime: unixtime, - block_lt: block_lt, - trans_lt: trans_lt, - rand_seed: rand_seed, - balance_remaining: balance_remaining, - myself: myself - }; - }; - throw new Error(''); - } -export function storeSmartContractInfo(smartContractInfo: SmartContractInfo): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x076ef1ea, 32); - builder.storeUint(smartContractInfo.actions, 16); - builder.storeUint(smartContractInfo.msgs_sent, 16); - builder.storeUint(smartContractInfo.unixtime, 32); - builder.storeUint(smartContractInfo.block_lt, 64); - builder.storeUint(smartContractInfo.trans_lt, 64); - builder.storeBits(smartContractInfo.rand_seed); - storeCurrencyCollection(smartContractInfo.balance_remaining)(builder); - storeMsgAddressInt(smartContractInfo.myself)(builder); - }); - } -export function loadOutList(slice: Slice, arg0: number): OutList { - if ((arg0 == 0)) { - return { - kind: 'OutList_out_list_empty' - }; - }; - if (true) { - let slice1 = slice.loadRef().beginParse(); - let prev: OutList = loadOutList(slice1, (arg0 - 1)); - let action: OutAction = loadOutAction(slice); - return { - kind: 'OutList_out_list', - n: (arg0 - 1), - prev: prev, - action: action - }; - }; - throw new Error(''); - } -export function storeOutList(outList: OutList): (builder: Builder) => void { - if ((outList.kind == 'OutList_out_list_empty')) { - return ((builder: Builder) => { - - }); - }; - if ((outList.kind == 'OutList_out_list')) { - return ((builder: Builder) => { - let cell1 = beginCell(); - storeOutList(outList.prev)(cell1); - builder.storeRef(cell1); - storeOutAction(outList.action)(builder); - }); - }; - throw new Error(''); - } -export function loadOutAction(slice: Slice): OutAction { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x0ec3c86d))) { - slice.loadUint(32); - let mode: number = slice.loadUint(8); - let slice1 = slice.loadRef().beginParse(); - let out_msg: MessageRelaxed = loadMessageRelaxed(slice1, ((slice: Slice) => { - return slice; - })); - return { - kind: 'OutAction_action_send_msg', - mode: mode, - out_msg: out_msg - }; - }; - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xad4de08e))) { - slice.loadUint(32); - let slice1 = slice.loadRef().beginParse(); - let new_code: Slice = slice1; - return { - kind: 'OutAction_action_set_code', - new_code: new_code - }; - }; - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x36e6b809))) { - slice.loadUint(32); - let mode: number = slice.loadUint(8); - let currency: CurrencyCollection = loadCurrencyCollection(slice); - return { - kind: 'OutAction_action_reserve_currency', - mode: mode, - currency: currency - }; - }; - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x26fa1dd4))) { - slice.loadUint(32); - let mode: number = slice.loadUint(7); - let libref: LibRef = loadLibRef(slice); - if ((!(mode <= 2))) { - throw new Error(''); - }; - return { - kind: 'OutAction_action_change_library', - mode: mode, - libref: libref - }; - }; - throw new Error(''); - } -export function storeOutAction(outAction: OutAction): (builder: Builder) => void { - if ((outAction.kind == 'OutAction_action_send_msg')) { - return ((builder: Builder) => { - builder.storeUint(0x0ec3c86d, 32); - builder.storeUint(outAction.mode, 8); - let cell1 = beginCell(); - storeMessageRelaxed(outAction.out_msg, ((arg: Slice) => { - return ((builder: Builder) => { - cell1.storeSlice(arg); - }); - }))(cell1); - builder.storeRef(cell1); - }); - }; - if ((outAction.kind == 'OutAction_action_set_code')) { - return ((builder: Builder) => { - builder.storeUint(0xad4de08e, 32); - let cell1 = beginCell(); - cell1.storeSlice(outAction.new_code); - builder.storeRef(cell1); - }); - }; - if ((outAction.kind == 'OutAction_action_reserve_currency')) { - return ((builder: Builder) => { - builder.storeUint(0x36e6b809, 32); - builder.storeUint(outAction.mode, 8); - storeCurrencyCollection(outAction.currency)(builder); - }); - }; - if ((outAction.kind == 'OutAction_action_change_library')) { - return ((builder: Builder) => { - builder.storeUint(0x26fa1dd4, 32); - builder.storeUint(outAction.mode, 7); - storeLibRef(outAction.libref)(builder); - if ((!(outAction.mode <= 2))) { - throw new Error(''); - }; - }); - }; - throw new Error(''); - } -export function loadLibRef(slice: Slice): LibRef { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1); - let lib_hash: BitString = slice.loadBits(256); - return { - kind: 'LibRef_libref_hash', - lib_hash: lib_hash - }; - }; - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1); - let slice1 = slice.loadRef().beginParse(); - let library: Slice = slice1; - return { - kind: 'LibRef_libref_ref', - library: library - }; - }; - throw new Error(''); - } -export function storeLibRef(libRef: LibRef): (builder: Builder) => void { - if ((libRef.kind == 'LibRef_libref_hash')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1); - builder.storeBits(libRef.lib_hash); - }); - }; - if ((libRef.kind == 'LibRef_libref_ref')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1); - let cell1 = beginCell(); - cell1.storeSlice(libRef.library); - builder.storeRef(cell1); - }); - }; - throw new Error(''); - } -export function loadOutListNode(slice: Slice): OutListNode { - let slice1 = slice.loadRef().beginParse(); - let prev: Slice = slice1; - let action: OutAction = loadOutAction(slice); - return { - kind: 'OutListNode', - prev: prev, - action: action - }; - } -export function storeOutListNode(outListNode: OutListNode): (builder: Builder) => void { - return ((builder: Builder) => { - let cell1 = beginCell(); - cell1.storeSlice(outListNode.prev); - builder.storeRef(cell1); - storeOutAction(outListNode.action)(builder); - }); - } -export function loadShardIdent(slice: Slice): ShardIdent { - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { - slice.loadUint(2); - let shard_pfx_bits: number = slice.loadUint(bitLen(60)); - let workchain_id: number = slice.loadInt(32); - let shard_prefix: number = slice.loadUint(64); - return { - kind: 'ShardIdent', - shard_pfx_bits: shard_pfx_bits, - workchain_id: workchain_id, - shard_prefix: shard_prefix - }; - }; - throw new Error(''); - } -export function storeShardIdent(shardIdent: ShardIdent): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0b00, 2); - builder.storeUint(shardIdent.shard_pfx_bits, bitLen(60)); - builder.storeInt(shardIdent.workchain_id, 32); - builder.storeUint(shardIdent.shard_prefix, 64); - }); - } -export function loadExtBlkRef(slice: Slice): ExtBlkRef { - let end_lt: number = slice.loadUint(64); - let seq_no: number = slice.loadUint(32); - let root_hash: BitString = slice.loadBits(256); - let file_hash: BitString = slice.loadBits(256); - return { - kind: 'ExtBlkRef', - end_lt: end_lt, - seq_no: seq_no, - root_hash: root_hash, - file_hash: file_hash - }; - } -export function storeExtBlkRef(extBlkRef: ExtBlkRef): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(extBlkRef.end_lt, 64); - builder.storeUint(extBlkRef.seq_no, 32); - builder.storeBits(extBlkRef.root_hash); - builder.storeBits(extBlkRef.file_hash); - }); - } -export function loadBlockIdExt(slice: Slice): BlockIdExt { - let shard_id: ShardIdent = loadShardIdent(slice); - let seq_no: number = slice.loadUint(32); - let root_hash: BitString = slice.loadBits(256); - let file_hash: BitString = slice.loadBits(256); - return { - kind: 'BlockIdExt', - shard_id: shard_id, - seq_no: seq_no, - root_hash: root_hash, - file_hash: file_hash - }; - } -export function storeBlockIdExt(blockIdExt: BlockIdExt): (builder: Builder) => void { - return ((builder: Builder) => { - storeShardIdent(blockIdExt.shard_id)(builder); - builder.storeUint(blockIdExt.seq_no, 32); - builder.storeBits(blockIdExt.root_hash); - builder.storeBits(blockIdExt.file_hash); - }); - } -export function loadBlkMasterInfo(slice: Slice): BlkMasterInfo { - let master: ExtBlkRef = loadExtBlkRef(slice); - return { - kind: 'BlkMasterInfo', - master: master - }; - } -export function storeBlkMasterInfo(blkMasterInfo: BlkMasterInfo): (builder: Builder) => void { - return ((builder: Builder) => { - storeExtBlkRef(blkMasterInfo.master)(builder); - }); - } -export function loadShardStateUnsplit(slice: Slice): ShardStateUnsplit { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x9023afe2))) { - slice.loadUint(32); - let global_id: number = slice.loadInt(32); - let shard_id: ShardIdent = loadShardIdent(slice); - let seq_no: number = slice.loadUint(32); - let vert_seq_no: number = slice.loadUint(32); - let gen_utime: number = slice.loadUint(32); - let gen_lt: number = slice.loadUint(64); - let min_ref_mc_seqno: number = slice.loadUint(32); - let slice1 = slice.loadRef().beginParse(); - let out_msg_queue_info: OutMsgQueueInfo = loadOutMsgQueueInfo(slice1); - let before_split: number = slice.loadUint(1); - let slice2 = slice.loadRef().beginParse(); - let accounts: ShardAccounts = loadShardAccounts(slice2); - let slice3 = slice.loadRef().beginParse(); - let overload_history: number = slice3.loadUint(64); - let underload_history: number = slice3.loadUint(64); - let total_balance: CurrencyCollection = loadCurrencyCollection(slice3); - let total_validator_fees: CurrencyCollection = loadCurrencyCollection(slice3); - let libraries: HashmapE = loadHashmapE(slice3, 256, loadLibDescr); - let master_ref: Maybe = loadMaybe(slice3, loadBlkMasterInfo); - let custom: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadMcStateExtra(slice1); - })); - return { - kind: 'ShardStateUnsplit', - global_id: global_id, - shard_id: shard_id, - seq_no: seq_no, - vert_seq_no: vert_seq_no, - gen_utime: gen_utime, - gen_lt: gen_lt, - min_ref_mc_seqno: min_ref_mc_seqno, - out_msg_queue_info: out_msg_queue_info, - before_split: before_split, - accounts: accounts, - overload_history: overload_history, - underload_history: underload_history, - total_balance: total_balance, - total_validator_fees: total_validator_fees, - libraries: libraries, - master_ref: master_ref, - custom: custom - }; - }; - throw new Error(''); - } -export function storeShardStateUnsplit(shardStateUnsplit: ShardStateUnsplit): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x9023afe2, 32); - builder.storeInt(shardStateUnsplit.global_id, 32); - storeShardIdent(shardStateUnsplit.shard_id)(builder); - builder.storeUint(shardStateUnsplit.seq_no, 32); - builder.storeUint(shardStateUnsplit.vert_seq_no, 32); - builder.storeUint(shardStateUnsplit.gen_utime, 32); - builder.storeUint(shardStateUnsplit.gen_lt, 64); - builder.storeUint(shardStateUnsplit.min_ref_mc_seqno, 32); - let cell1 = beginCell(); - storeOutMsgQueueInfo(shardStateUnsplit.out_msg_queue_info)(cell1); - builder.storeRef(cell1); - builder.storeUint(shardStateUnsplit.before_split, 1); - let cell2 = beginCell(); - storeShardAccounts(shardStateUnsplit.accounts)(cell2); - builder.storeRef(cell2); - let cell3 = beginCell(); - cell3.storeUint(shardStateUnsplit.overload_history, 64); - cell3.storeUint(shardStateUnsplit.underload_history, 64); - storeCurrencyCollection(shardStateUnsplit.total_balance)(cell3); - storeCurrencyCollection(shardStateUnsplit.total_validator_fees)(cell3); - storeHashmapE(shardStateUnsplit.libraries, storeLibDescr)(cell3); - storeMaybe(shardStateUnsplit.master_ref, storeBlkMasterInfo)(cell3); - builder.storeRef(cell3); - storeMaybe(shardStateUnsplit.custom, ((arg: McStateExtra) => { - return ((builder: Builder) => { - let cell1 = beginCell() - storeMcStateExtra(arg)(cell1) - builder.storeRef(cell1); - }); - }))(builder); - }); - } -export function loadShardState(slice: Slice): ShardState { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x81e52440))) { - slice.loadUint(32); - let anon0: ShardStateUnsplit = loadShardStateUnsplit(slice); - return { - kind: 'ShardState__', - anon0: anon0 - }; - }; - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x5f327da5))) { - slice.loadUint(32); - let slice1 = slice.loadRef().beginParse(); - let left: ShardStateUnsplit = loadShardStateUnsplit(slice1); - let slice2 = slice.loadRef().beginParse(); - let right: ShardStateUnsplit = loadShardStateUnsplit(slice2); - return { - kind: 'ShardState_split_state', - left: left, - right: right - }; - }; - throw new Error(''); - } -export function storeShardState(shardState: ShardState): (builder: Builder) => void { - if ((shardState.kind == 'ShardState__')) { - return ((builder: Builder) => { - builder.storeUint(0x81e52440, 32); - storeShardStateUnsplit(shardState.anon0)(builder); - }); - }; - if ((shardState.kind == 'ShardState_split_state')) { - return ((builder: Builder) => { - builder.storeUint(0x5f327da5, 32); - let cell1 = beginCell(); - storeShardStateUnsplit(shardState.left)(cell1); - builder.storeRef(cell1); - let cell2 = beginCell(); - storeShardStateUnsplit(shardState.right)(cell2); - builder.storeRef(cell2); - }); - }; - throw new Error(''); - } -export function loadLibDescr(slice: Slice): LibDescr { - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { - slice.loadUint(2); - let slice1 = slice.loadRef().beginParse(); - let lib: Slice = slice1; - let publishers: Hashmap = loadHashmap(slice, 256, loadTrue); - return { - kind: 'LibDescr', - lib: lib, - publishers: publishers - }; - }; - throw new Error(''); - } -export function storeLibDescr(libDescr: LibDescr): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0b00, 2); - let cell1 = beginCell(); - cell1.storeSlice(libDescr.lib); - builder.storeRef(cell1); - storeHashmap(libDescr.publishers, storeTrue)(builder); - }); - } -export function loadBlockInfo(slice: Slice): BlockInfo { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x9bc7a987))) { - slice.loadUint(32); - let version: number = slice.loadUint(32); - let not_master: number = slice.loadUint(1); - let after_merge: number = slice.loadUint(1); - let before_split: number = slice.loadUint(1); - let after_split: number = slice.loadUint(1); - let want_split: Bool = loadBool(slice); - let want_merge: Bool = loadBool(slice); - let key_block: Bool = loadBool(slice); - let vert_seqno_incr: number = slice.loadUint(1); - let flags: number = slice.loadUint(8); - let seq_no: number = slice.loadUint(32); - let vert_seq_no: number = slice.loadUint(32); - let shard: ShardIdent = loadShardIdent(slice); - let gen_utime: number = slice.loadUint(32); - let start_lt: number = slice.loadUint(64); - let end_lt: number = slice.loadUint(64); - let gen_validator_list_hash_short: number = slice.loadUint(32); - let gen_catchain_seqno: number = slice.loadUint(32); - let min_ref_mc_seqno: number = slice.loadUint(32); - let prev_key_block_seqno: number = slice.loadUint(32); - let gen_software: GlobalVersion | undefined = ((flags & (1 << 0)) ? loadGlobalVersion(slice) : undefined); - let master_ref: BlkMasterInfo | undefined = (not_master ? ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadBlkMasterInfo(slice1); - })(slice) : undefined); - let slice1 = slice.loadRef().beginParse(); - let prev_ref: BlkPrevInfo = loadBlkPrevInfo(slice1, after_merge); - let prev_vert_ref: BlkPrevInfo | undefined = (vert_seqno_incr ? ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadBlkPrevInfo(slice1, 0); - })(slice) : undefined); - if ((!(flags <= 1))) { - throw new Error(''); - }; - if ((!(vert_seq_no >= vert_seqno_incr))) { - throw new Error(''); - }; - return { - kind: 'BlockInfo', - prev_seq_no: (seq_no - 1), - version: version, - not_master: not_master, - after_merge: after_merge, - before_split: before_split, - after_split: after_split, - want_split: want_split, - want_merge: want_merge, - key_block: key_block, - vert_seqno_incr: vert_seqno_incr, - flags: flags, - seq_no: seq_no, - vert_seq_no: vert_seq_no, - shard: shard, - gen_utime: gen_utime, - start_lt: start_lt, - end_lt: end_lt, - gen_validator_list_hash_short: gen_validator_list_hash_short, - gen_catchain_seqno: gen_catchain_seqno, - min_ref_mc_seqno: min_ref_mc_seqno, - prev_key_block_seqno: prev_key_block_seqno, - gen_software: gen_software, - master_ref: master_ref, - prev_ref: prev_ref, - prev_vert_ref: prev_vert_ref - }; - }; - throw new Error(''); - } -export function storeBlockInfo(blockInfo: BlockInfo): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x9bc7a987, 32); - builder.storeUint(blockInfo.version, 32); - builder.storeUint(blockInfo.not_master, 1); - builder.storeUint(blockInfo.after_merge, 1); - builder.storeUint(blockInfo.before_split, 1); - builder.storeUint(blockInfo.after_split, 1); - storeBool(blockInfo.want_split)(builder); - storeBool(blockInfo.want_merge)(builder); - storeBool(blockInfo.key_block)(builder); - builder.storeUint(blockInfo.vert_seqno_incr, 1); - builder.storeUint(blockInfo.flags, 8); - builder.storeUint(blockInfo.seq_no, 32); - builder.storeUint(blockInfo.vert_seq_no, 32); - storeShardIdent(blockInfo.shard)(builder); - builder.storeUint(blockInfo.gen_utime, 32); - builder.storeUint(blockInfo.start_lt, 64); - builder.storeUint(blockInfo.end_lt, 64); - builder.storeUint(blockInfo.gen_validator_list_hash_short, 32); - builder.storeUint(blockInfo.gen_catchain_seqno, 32); - builder.storeUint(blockInfo.min_ref_mc_seqno, 32); - builder.storeUint(blockInfo.prev_key_block_seqno, 32); - if ((blockInfo.gen_software != undefined)) { - storeGlobalVersion(blockInfo.gen_software)(builder); - }; - if ((blockInfo.master_ref != undefined)) { - let cell1 = beginCell() - storeBlkMasterInfo(blockInfo.master_ref)(cell1) - builder.storeRef(cell1); - }; - let cell1 = beginCell(); - storeBlkPrevInfo(blockInfo.prev_ref)(cell1); - builder.storeRef(cell1); - if ((blockInfo.prev_vert_ref != undefined)) { - let cell1 = beginCell() - storeBlkPrevInfo(blockInfo.prev_vert_ref)(cell1) - builder.storeRef(cell1); - }; - if ((!(blockInfo.flags <= 1))) { - throw new Error(''); - }; - if ((!(blockInfo.vert_seq_no >= blockInfo.vert_seqno_incr))) { - throw new Error(''); - }; - }); - } -export function loadBlkPrevInfo(slice: Slice, arg0: number): BlkPrevInfo { - if ((arg0 == 0)) { - let prev: ExtBlkRef = loadExtBlkRef(slice); - return { - kind: 'BlkPrevInfo_prev_blk_info', - prev: prev - }; - }; - if ((arg0 == 1)) { - let slice1 = slice.loadRef().beginParse(); - let prev1: ExtBlkRef = loadExtBlkRef(slice1); - let slice2 = slice.loadRef().beginParse(); - let prev2: ExtBlkRef = loadExtBlkRef(slice2); - return { - kind: 'BlkPrevInfo_prev_blks_info', - prev1: prev1, - prev2: prev2 - }; - }; - throw new Error(''); - } -export function storeBlkPrevInfo(blkPrevInfo: BlkPrevInfo): (builder: Builder) => void { - if ((blkPrevInfo.kind == 'BlkPrevInfo_prev_blk_info')) { - return ((builder: Builder) => { - storeExtBlkRef(blkPrevInfo.prev)(builder); - }); - }; - if ((blkPrevInfo.kind == 'BlkPrevInfo_prev_blks_info')) { - return ((builder: Builder) => { - let cell1 = beginCell(); - storeExtBlkRef(blkPrevInfo.prev1)(cell1); - builder.storeRef(cell1); - let cell2 = beginCell(); - storeExtBlkRef(blkPrevInfo.prev2)(cell2); - builder.storeRef(cell2); - }); - }; - throw new Error(''); - } -export function loadBlock(slice: Slice): Block { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x11ef55aa))) { - slice.loadUint(32); - let global_id: number = slice.loadInt(32); - let slice1 = slice.loadRef().beginParse(); - let info: BlockInfo = loadBlockInfo(slice1); - let slice2 = slice.loadRef().beginParse(); - let value_flow: ValueFlow = loadValueFlow(slice2); - let slice3 = slice.loadRef().beginParse(); - let state_update: MERKLE_UPDATE = loadMERKLE_UPDATE(slice3, loadShardState); - let slice4 = slice.loadRef().beginParse(); - let extra: BlockExtra = loadBlockExtra(slice4); - return { - kind: 'Block', - global_id: global_id, - info: info, - value_flow: value_flow, - state_update: state_update, - extra: extra - }; - }; - throw new Error(''); - } -export function storeBlock(block: Block): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x11ef55aa, 32); - builder.storeInt(block.global_id, 32); - let cell1 = beginCell(); - storeBlockInfo(block.info)(cell1); - builder.storeRef(cell1); - let cell2 = beginCell(); - storeValueFlow(block.value_flow)(cell2); - builder.storeRef(cell2); - let cell3 = beginCell(); - storeMERKLE_UPDATE(block.state_update, storeShardState)(cell3); - builder.storeRef(cell3); - let cell4 = beginCell(); - storeBlockExtra(block.extra)(cell4); - builder.storeRef(cell4); - }); - } -export function loadBlockExtra(slice: Slice): BlockExtra { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x8e7f7ff8))) { - slice.loadUint(32); - let slice1 = slice.loadRef().beginParse(); - let in_msg_descr: InMsgDescr = loadInMsgDescr(slice1); - let slice2 = slice.loadRef().beginParse(); - let out_msg_descr: OutMsgDescr = loadOutMsgDescr(slice2); - let slice3 = slice.loadRef().beginParse(); - let account_blocks: ShardAccountBlocks = loadShardAccountBlocks(slice3); - let rand_seed: BitString = slice.loadBits(256); - let created_by: BitString = slice.loadBits(256); - let custom: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadMcBlockExtra(slice1); - })); - return { - kind: 'BlockExtra', - in_msg_descr: in_msg_descr, - out_msg_descr: out_msg_descr, - account_blocks: account_blocks, - rand_seed: rand_seed, - created_by: created_by, - custom: custom - }; - }; - throw new Error(''); - } -export function storeBlockExtra(blockExtra: BlockExtra): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x8e7f7ff8, 32); - let cell1 = beginCell(); - storeInMsgDescr(blockExtra.in_msg_descr)(cell1); - builder.storeRef(cell1); - let cell2 = beginCell(); - storeOutMsgDescr(blockExtra.out_msg_descr)(cell2); - builder.storeRef(cell2); - let cell3 = beginCell(); - storeShardAccountBlocks(blockExtra.account_blocks)(cell3); - builder.storeRef(cell3); - builder.storeBits(blockExtra.rand_seed); - builder.storeBits(blockExtra.created_by); - storeMaybe(blockExtra.custom, ((arg: McBlockExtra) => { - return ((builder: Builder) => { - let cell1 = beginCell() - storeMcBlockExtra(arg)(cell1) - builder.storeRef(cell1); - }); - }))(builder); - }); - } -export function loadValueFlow(slice: Slice): ValueFlow { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x98055e37))) { - slice.loadUint(32); - let slice1 = slice.loadRef().beginParse(); - let from_prev_blk: CurrencyCollection = loadCurrencyCollection(slice1); - let to_next_blk: CurrencyCollection = loadCurrencyCollection(slice1); - let imported: CurrencyCollection = loadCurrencyCollection(slice1); - let exported: CurrencyCollection = loadCurrencyCollection(slice1); - let fees_collected: CurrencyCollection = loadCurrencyCollection(slice); - let slice2 = slice.loadRef().beginParse(); - let fees_imported: CurrencyCollection = loadCurrencyCollection(slice2); - let recovered: CurrencyCollection = loadCurrencyCollection(slice2); - let created: CurrencyCollection = loadCurrencyCollection(slice2); - let minted: CurrencyCollection = loadCurrencyCollection(slice2); - return { - kind: 'ValueFlow', - from_prev_blk: from_prev_blk, - to_next_blk: to_next_blk, - imported: imported, - exported: exported, - fees_collected: fees_collected, - fees_imported: fees_imported, - recovered: recovered, - created: created, - minted: minted - }; - }; - throw new Error(''); - } -export function storeValueFlow(valueFlow: ValueFlow): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x98055e37, 32); - let cell1 = beginCell(); - storeCurrencyCollection(valueFlow.from_prev_blk)(cell1); - storeCurrencyCollection(valueFlow.to_next_blk)(cell1); - storeCurrencyCollection(valueFlow.imported)(cell1); - storeCurrencyCollection(valueFlow.exported)(cell1); - builder.storeRef(cell1); - storeCurrencyCollection(valueFlow.fees_collected)(builder); - let cell2 = beginCell(); - storeCurrencyCollection(valueFlow.fees_imported)(cell2); - storeCurrencyCollection(valueFlow.recovered)(cell2); - storeCurrencyCollection(valueFlow.created)(cell2); - storeCurrencyCollection(valueFlow.minted)(cell2); - builder.storeRef(cell2); - }); - } -export function loadBinTree(slice: Slice, loadX: (slice: Slice) => X): BinTree { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1); - let leaf: X = loadX(slice); - return { - kind: 'BinTree_bt_leaf', - leaf: leaf - }; - }; - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1); - let slice1 = slice.loadRef().beginParse(); - let left: BinTree = loadBinTree(slice1, loadX); - let slice2 = slice.loadRef().beginParse(); - let right: BinTree = loadBinTree(slice2, loadX); - return { - kind: 'BinTree_bt_fork', - left: left, - right: right - }; - }; - throw new Error(''); - } -export function storeBinTree(binTree: BinTree, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void { - if ((binTree.kind == 'BinTree_bt_leaf')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1); - storeX(binTree.leaf)(builder); - }); - }; - if ((binTree.kind == 'BinTree_bt_fork')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1); - let cell1 = beginCell(); - storeBinTree(binTree.left, storeX)(cell1); - builder.storeRef(cell1); - let cell2 = beginCell(); - storeBinTree(binTree.right, storeX)(cell2); - builder.storeRef(cell2); - }); - }; - throw new Error(''); - } -export function loadFutureSplitMerge(slice: Slice): FutureSplitMerge { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1); - return { - kind: 'FutureSplitMerge_fsm_none' - }; - }; - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b10))) { - slice.loadUint(2); - let split_utime: number = slice.loadUint(32); - let interval: number = slice.loadUint(32); - return { - kind: 'FutureSplitMerge_fsm_split', - split_utime: split_utime, - interval: interval - }; - }; - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b11))) { - slice.loadUint(2); - let merge_utime: number = slice.loadUint(32); - let interval: number = slice.loadUint(32); - return { - kind: 'FutureSplitMerge_fsm_merge', - merge_utime: merge_utime, - interval: interval - }; - }; - throw new Error(''); - } -export function storeFutureSplitMerge(futureSplitMerge: FutureSplitMerge): (builder: Builder) => void { - if ((futureSplitMerge.kind == 'FutureSplitMerge_fsm_none')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1); - }); - }; - if ((futureSplitMerge.kind == 'FutureSplitMerge_fsm_split')) { - return ((builder: Builder) => { - builder.storeUint(0b10, 2); - builder.storeUint(futureSplitMerge.split_utime, 32); - builder.storeUint(futureSplitMerge.interval, 32); - }); - }; - if ((futureSplitMerge.kind == 'FutureSplitMerge_fsm_merge')) { - return ((builder: Builder) => { - builder.storeUint(0b11, 2); - builder.storeUint(futureSplitMerge.merge_utime, 32); - builder.storeUint(futureSplitMerge.interval, 32); - }); - }; - throw new Error(''); - } -export function loadShardDescr(slice: Slice): ShardDescr { - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0xb))) { - slice.loadUint(4); - let seq_no: number = slice.loadUint(32); - let reg_mc_seqno: number = slice.loadUint(32); - let start_lt: number = slice.loadUint(64); - let end_lt: number = slice.loadUint(64); - let root_hash: BitString = slice.loadBits(256); - let file_hash: BitString = slice.loadBits(256); - let before_split: Bool = loadBool(slice); - let before_merge: Bool = loadBool(slice); - let want_split: Bool = loadBool(slice); - let want_merge: Bool = loadBool(slice); - let nx_cc_updated: Bool = loadBool(slice); - let flags: number = slice.loadUint(3); - let next_catchain_seqno: number = slice.loadUint(32); - let next_validator_shard: number = slice.loadUint(64); - let min_ref_mc_seqno: number = slice.loadUint(32); - let gen_utime: number = slice.loadUint(32); - let split_merge_at: FutureSplitMerge = loadFutureSplitMerge(slice); - let fees_collected: CurrencyCollection = loadCurrencyCollection(slice); - let funds_created: CurrencyCollection = loadCurrencyCollection(slice); - if ((!(flags == 0))) { - throw new Error(''); - }; - return { - kind: 'ShardDescr_shard_descr', - seq_no: seq_no, - reg_mc_seqno: reg_mc_seqno, - start_lt: start_lt, - end_lt: end_lt, - root_hash: root_hash, - file_hash: file_hash, - before_split: before_split, - before_merge: before_merge, - want_split: want_split, - want_merge: want_merge, - nx_cc_updated: nx_cc_updated, - flags: flags, - next_catchain_seqno: next_catchain_seqno, - next_validator_shard: next_validator_shard, - min_ref_mc_seqno: min_ref_mc_seqno, - gen_utime: gen_utime, - split_merge_at: split_merge_at, - fees_collected: fees_collected, - funds_created: funds_created - }; - }; - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0xa))) { - slice.loadUint(4); - let seq_no: number = slice.loadUint(32); - let reg_mc_seqno: number = slice.loadUint(32); - let start_lt: number = slice.loadUint(64); - let end_lt: number = slice.loadUint(64); - let root_hash: BitString = slice.loadBits(256); - let file_hash: BitString = slice.loadBits(256); - let before_split: Bool = loadBool(slice); - let before_merge: Bool = loadBool(slice); - let want_split: Bool = loadBool(slice); - let want_merge: Bool = loadBool(slice); - let nx_cc_updated: Bool = loadBool(slice); - let flags: number = slice.loadUint(3); - let next_catchain_seqno: number = slice.loadUint(32); - let next_validator_shard: number = slice.loadUint(64); - let min_ref_mc_seqno: number = slice.loadUint(32); - let gen_utime: number = slice.loadUint(32); - let split_merge_at: FutureSplitMerge = loadFutureSplitMerge(slice); - let slice1 = slice.loadRef().beginParse(); - let fees_collected: CurrencyCollection = loadCurrencyCollection(slice1); - let funds_created: CurrencyCollection = loadCurrencyCollection(slice1); - if ((!(flags == 0))) { - throw new Error(''); - }; - return { - kind: 'ShardDescr_shard_descr_new', - seq_no: seq_no, - reg_mc_seqno: reg_mc_seqno, - start_lt: start_lt, - end_lt: end_lt, - root_hash: root_hash, - file_hash: file_hash, - before_split: before_split, - before_merge: before_merge, - want_split: want_split, - want_merge: want_merge, - nx_cc_updated: nx_cc_updated, - flags: flags, - next_catchain_seqno: next_catchain_seqno, - next_validator_shard: next_validator_shard, - min_ref_mc_seqno: min_ref_mc_seqno, - gen_utime: gen_utime, - split_merge_at: split_merge_at, - fees_collected: fees_collected, - funds_created: funds_created - }; - }; - throw new Error(''); - } -export function storeShardDescr(shardDescr: ShardDescr): (builder: Builder) => void { - if ((shardDescr.kind == 'ShardDescr_shard_descr')) { - return ((builder: Builder) => { - builder.storeUint(0xb, 4); - builder.storeUint(shardDescr.seq_no, 32); - builder.storeUint(shardDescr.reg_mc_seqno, 32); - builder.storeUint(shardDescr.start_lt, 64); - builder.storeUint(shardDescr.end_lt, 64); - builder.storeBits(shardDescr.root_hash); - builder.storeBits(shardDescr.file_hash); - storeBool(shardDescr.before_split)(builder); - storeBool(shardDescr.before_merge)(builder); - storeBool(shardDescr.want_split)(builder); - storeBool(shardDescr.want_merge)(builder); - storeBool(shardDescr.nx_cc_updated)(builder); - builder.storeUint(shardDescr.flags, 3); - builder.storeUint(shardDescr.next_catchain_seqno, 32); - builder.storeUint(shardDescr.next_validator_shard, 64); - builder.storeUint(shardDescr.min_ref_mc_seqno, 32); - builder.storeUint(shardDescr.gen_utime, 32); - storeFutureSplitMerge(shardDescr.split_merge_at)(builder); - storeCurrencyCollection(shardDescr.fees_collected)(builder); - storeCurrencyCollection(shardDescr.funds_created)(builder); - if ((!(shardDescr.flags == 0))) { - throw new Error(''); - }; - }); - }; - if ((shardDescr.kind == 'ShardDescr_shard_descr_new')) { - return ((builder: Builder) => { - builder.storeUint(0xa, 4); - builder.storeUint(shardDescr.seq_no, 32); - builder.storeUint(shardDescr.reg_mc_seqno, 32); - builder.storeUint(shardDescr.start_lt, 64); - builder.storeUint(shardDescr.end_lt, 64); - builder.storeBits(shardDescr.root_hash); - builder.storeBits(shardDescr.file_hash); - storeBool(shardDescr.before_split)(builder); - storeBool(shardDescr.before_merge)(builder); - storeBool(shardDescr.want_split)(builder); - storeBool(shardDescr.want_merge)(builder); - storeBool(shardDescr.nx_cc_updated)(builder); - builder.storeUint(shardDescr.flags, 3); - builder.storeUint(shardDescr.next_catchain_seqno, 32); - builder.storeUint(shardDescr.next_validator_shard, 64); - builder.storeUint(shardDescr.min_ref_mc_seqno, 32); - builder.storeUint(shardDescr.gen_utime, 32); - storeFutureSplitMerge(shardDescr.split_merge_at)(builder); - let cell1 = beginCell(); - storeCurrencyCollection(shardDescr.fees_collected)(cell1); - storeCurrencyCollection(shardDescr.funds_created)(cell1); - builder.storeRef(cell1); - if ((!(shardDescr.flags == 0))) { - throw new Error(''); - }; - }); - }; - throw new Error(''); - } -export function loadShardHashes(slice: Slice): ShardHashes { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xd7c80ab1))) { - slice.loadUint(32); - let anon0: HashmapE> = loadHashmapE>(slice, 32, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadBinTree(slice1, loadShardDescr); - })); - return { - kind: 'ShardHashes', - anon0: anon0 - }; - }; - throw new Error(''); - } -export function storeShardHashes(shardHashes: ShardHashes): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xd7c80ab1, 32); - storeHashmapE>(shardHashes.anon0, ((arg: BinTree) => { - return ((builder: Builder) => { - let cell1 = beginCell() - storeBinTree(arg, storeShardDescr)(cell1) - builder.storeRef(cell1); - }); - }))(builder); - }); - } -export function loadBinTreeAug(slice: Slice, loadX: (slice: Slice) => X, loadY: (slice: Slice) => Y): BinTreeAug { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1); - let extra: Y = loadY(slice); - let leaf: X = loadX(slice); - return { - kind: 'BinTreeAug_bta_leaf', - extra: extra, - leaf: leaf - }; - }; - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1); - let slice1 = slice.loadRef().beginParse(); - let left: BinTreeAug = loadBinTreeAug(slice1, loadX, loadY); - let slice2 = slice.loadRef().beginParse(); - let right: BinTreeAug = loadBinTreeAug(slice2, loadX, loadY); - let extra: Y = loadY(slice); - return { - kind: 'BinTreeAug_bta_fork', - left: left, - right: right, - extra: extra - }; - }; - throw new Error(''); - } -export function storeBinTreeAug(binTreeAug: BinTreeAug, storeX: (x: X) => (builder: Builder) => void, storeY: (y: Y) => (builder: Builder) => void): (builder: Builder) => void { - if ((binTreeAug.kind == 'BinTreeAug_bta_leaf')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1); - storeY(binTreeAug.extra)(builder); - storeX(binTreeAug.leaf)(builder); - }); - }; - if ((binTreeAug.kind == 'BinTreeAug_bta_fork')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1); - let cell1 = beginCell(); - storeBinTreeAug(binTreeAug.left, storeX, storeY)(cell1); - builder.storeRef(cell1); - let cell2 = beginCell(); - storeBinTreeAug(binTreeAug.right, storeX, storeY)(cell2); - builder.storeRef(cell2); - storeY(binTreeAug.extra)(builder); - }); - }; - throw new Error(''); - } -export function loadShardFeeCreated(slice: Slice): ShardFeeCreated { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xe537952e))) { - slice.loadUint(32); - let fees: CurrencyCollection = loadCurrencyCollection(slice); - let create: CurrencyCollection = loadCurrencyCollection(slice); - return { - kind: 'ShardFeeCreated', - fees: fees, - create: create - }; - }; - throw new Error(''); - } -export function storeShardFeeCreated(shardFeeCreated: ShardFeeCreated): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xe537952e, 32); - storeCurrencyCollection(shardFeeCreated.fees)(builder); - storeCurrencyCollection(shardFeeCreated.create)(builder); - }); - } -export function loadShardFees(slice: Slice): ShardFees { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xfea0d880))) { - slice.loadUint(32); - let anon0: HashmapAugE = loadHashmapAugE(slice, 96, loadShardFeeCreated, loadShardFeeCreated); - return { - kind: 'ShardFees', - anon0: anon0 - }; - }; - throw new Error(''); - } -export function storeShardFees(shardFees: ShardFees): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xfea0d880, 32); - storeHashmapAugE(shardFees.anon0, storeShardFeeCreated, storeShardFeeCreated)(builder); - }); - } -export function loadConfigParams(slice: Slice): ConfigParams { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x88116702))) { - slice.loadUint(32); - let config_addr: BitString = slice.loadBits(256); - let slice1 = slice.loadRef().beginParse(); - let config: Hashmap = loadHashmap(slice1, 32, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return slice1; - })); - return { - kind: 'ConfigParams', - config_addr: config_addr, - config: config - }; - }; - throw new Error(''); - } -export function storeConfigParams(configParams: ConfigParams): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x88116702, 32); - builder.storeBits(configParams.config_addr); - let cell1 = beginCell(); - storeHashmap(configParams.config, ((arg: Slice) => { - return ((builder: Builder) => { - let cell1 = beginCell() - cell1.storeSlice(arg) - builder.storeRef(cell1); - }); - }))(cell1); - builder.storeRef(cell1); - }); - } -export function loadValidatorInfo(slice: Slice): ValidatorInfo { - let validator_list_hash_short: number = slice.loadUint(32); - let catchain_seqno: number = slice.loadUint(32); - let nx_cc_updated: Bool = loadBool(slice); - return { - kind: 'ValidatorInfo', - validator_list_hash_short: validator_list_hash_short, - catchain_seqno: catchain_seqno, - nx_cc_updated: nx_cc_updated - }; - } -export function storeValidatorInfo(validatorInfo: ValidatorInfo): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(validatorInfo.validator_list_hash_short, 32); - builder.storeUint(validatorInfo.catchain_seqno, 32); - storeBool(validatorInfo.nx_cc_updated)(builder); - }); - } -export function loadValidatorBaseInfo(slice: Slice): ValidatorBaseInfo { - let validator_list_hash_short: number = slice.loadUint(32); - let catchain_seqno: number = slice.loadUint(32); - return { - kind: 'ValidatorBaseInfo', - validator_list_hash_short: validator_list_hash_short, - catchain_seqno: catchain_seqno - }; - } -export function storeValidatorBaseInfo(validatorBaseInfo: ValidatorBaseInfo): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(validatorBaseInfo.validator_list_hash_short, 32); - builder.storeUint(validatorBaseInfo.catchain_seqno, 32); - }); - } -export function loadKeyMaxLt(slice: Slice): KeyMaxLt { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x9a6d79a5))) { - slice.loadUint(32); - let key: Bool = loadBool(slice); - let max_end_lt: number = slice.loadUint(64); - return { - kind: 'KeyMaxLt', - key: key, - max_end_lt: max_end_lt - }; - }; - throw new Error(''); - } -export function storeKeyMaxLt(keyMaxLt: KeyMaxLt): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x9a6d79a5, 32); - storeBool(keyMaxLt.key)(builder); - builder.storeUint(keyMaxLt.max_end_lt, 64); - }); - } -export function loadKeyExtBlkRef(slice: Slice): KeyExtBlkRef { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xafeab488))) { - slice.loadUint(32); - let key: Bool = loadBool(slice); - let blk_ref: ExtBlkRef = loadExtBlkRef(slice); - return { - kind: 'KeyExtBlkRef', - key: key, - blk_ref: blk_ref - }; - }; - throw new Error(''); - } -export function storeKeyExtBlkRef(keyExtBlkRef: KeyExtBlkRef): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xafeab488, 32); - storeBool(keyExtBlkRef.key)(builder); - storeExtBlkRef(keyExtBlkRef.blk_ref)(builder); - }); - } -export function loadOldMcBlocksInfo(slice: Slice): OldMcBlocksInfo { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xf385c1e3))) { - slice.loadUint(32); - let anon0: HashmapAugE = loadHashmapAugE(slice, 32, loadKeyExtBlkRef, loadKeyMaxLt); - return { - kind: 'OldMcBlocksInfo', - anon0: anon0 - }; - }; - throw new Error(''); - } -export function storeOldMcBlocksInfo(oldMcBlocksInfo: OldMcBlocksInfo): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xf385c1e3, 32); - storeHashmapAugE(oldMcBlocksInfo.anon0, storeKeyExtBlkRef, storeKeyMaxLt)(builder); - }); - } -export function loadCounters(slice: Slice): Counters { - let last_updated: number = slice.loadUint(32); - let total: number = slice.loadUint(64); - let cnt2048: number = slice.loadUint(64); - let cnt65536: number = slice.loadUint(64); - return { - kind: 'Counters', - last_updated: last_updated, - total: total, - cnt2048: cnt2048, - cnt65536: cnt65536 - }; - } -export function storeCounters(counters: Counters): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(counters.last_updated, 32); - builder.storeUint(counters.total, 64); - builder.storeUint(counters.cnt2048, 64); - builder.storeUint(counters.cnt65536, 64); - }); - } -export function loadCreatorStats(slice: Slice): CreatorStats { - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0x4))) { - slice.loadUint(4); - let mc_blocks: Counters = loadCounters(slice); - let shard_blocks: Counters = loadCounters(slice); - return { - kind: 'CreatorStats', - mc_blocks: mc_blocks, - shard_blocks: shard_blocks - }; - }; - throw new Error(''); - } -export function storeCreatorStats(creatorStats: CreatorStats): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x4, 4); - storeCounters(creatorStats.mc_blocks)(builder); - storeCounters(creatorStats.shard_blocks)(builder); - }); - } -export function loadBlockCreateStats(slice: Slice): BlockCreateStats { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x17))) { - slice.loadUint(8); - let counters: HashmapE = loadHashmapE(slice, 256, loadCreatorStats); - return { - kind: 'BlockCreateStats_block_create_stats', - counters: counters - }; - }; - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x34))) { - slice.loadUint(8); - let counters: HashmapAugE = loadHashmapAugE(slice, 256, loadCreatorStats, ((slice: Slice) => { - return slice.loadUint(32); - })); - return { - kind: 'BlockCreateStats_block_create_stats_ext', - counters: counters - }; - }; - throw new Error(''); - } -export function storeBlockCreateStats(blockCreateStats: BlockCreateStats): (builder: Builder) => void { - if ((blockCreateStats.kind == 'BlockCreateStats_block_create_stats')) { - return ((builder: Builder) => { - builder.storeUint(0x17, 8); - storeHashmapE(blockCreateStats.counters, storeCreatorStats)(builder); - }); - }; - if ((blockCreateStats.kind == 'BlockCreateStats_block_create_stats_ext')) { - return ((builder: Builder) => { - builder.storeUint(0x34, 8); - storeHashmapAugE(blockCreateStats.counters, storeCreatorStats, ((arg: number) => { - return ((builder: Builder) => { - builder.storeUint(arg, 32); - }); - }))(builder); - }); - }; - throw new Error(''); - } -export function loadMcStateExtra(slice: Slice): McStateExtra { - if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0xcc26))) { - slice.loadUint(16); - let shard_hashes: ShardHashes = loadShardHashes(slice); - let config: ConfigParams = loadConfigParams(slice); - let slice1 = slice.loadRef().beginParse(); - let flags: number = slice1.loadUint(16); - let validator_info: ValidatorInfo = loadValidatorInfo(slice1); - let prev_blocks: OldMcBlocksInfo = loadOldMcBlocksInfo(slice1); - let after_key_block: Bool = loadBool(slice1); - let last_key_block: Maybe = loadMaybe(slice1, loadExtBlkRef); - let block_create_stats: BlockCreateStats | undefined = ((flags & (1 << 0)) ? loadBlockCreateStats(slice1) : undefined); - let global_balance: CurrencyCollection = loadCurrencyCollection(slice); - return { - kind: 'McStateExtra', - shard_hashes: shard_hashes, - config: config, - flags: flags, - validator_info: validator_info, - prev_blocks: prev_blocks, - after_key_block: after_key_block, - last_key_block: last_key_block, - block_create_stats: block_create_stats, - global_balance: global_balance - }; - }; - throw new Error(''); - } -export function storeMcStateExtra(mcStateExtra: McStateExtra): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xcc26, 16); - storeShardHashes(mcStateExtra.shard_hashes)(builder); - storeConfigParams(mcStateExtra.config)(builder); - let cell1 = beginCell(); - cell1.storeUint(mcStateExtra.flags, 16); - storeValidatorInfo(mcStateExtra.validator_info)(cell1); - storeOldMcBlocksInfo(mcStateExtra.prev_blocks)(cell1); - storeBool(mcStateExtra.after_key_block)(cell1); - storeMaybe(mcStateExtra.last_key_block, storeExtBlkRef)(cell1); - if ((mcStateExtra.block_create_stats != undefined)) { - storeBlockCreateStats(mcStateExtra.block_create_stats)(cell1); - }; - builder.storeRef(cell1); - storeCurrencyCollection(mcStateExtra.global_balance)(builder); - }); - } -export function loadSigPubKey(slice: Slice): SigPubKey { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x8e81278a))) { - slice.loadUint(32); - let pubkey: BitString = slice.loadBits(256); - return { - kind: 'SigPubKey', - pubkey: pubkey - }; - }; - throw new Error(''); - } -export function storeSigPubKey(sigPubKey: SigPubKey): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x8e81278a, 32); - builder.storeBits(sigPubKey.pubkey); - }); - } -export function loadCryptoSignatureSimple(slice: Slice): CryptoSignatureSimple { - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0x5))) { - slice.loadUint(4); - let R: BitString = slice.loadBits(256); - let s: BitString = slice.loadBits(256); - return { - kind: 'CryptoSignatureSimple', - R: R, - s: s - }; - }; - throw new Error(''); - } -export function storeCryptoSignatureSimple(cryptoSignatureSimple: CryptoSignatureSimple): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x5, 4); - builder.storeBits(cryptoSignatureSimple.R); - builder.storeBits(cryptoSignatureSimple.s); - }); - } -export function loadCryptoSignature(slice: Slice): CryptoSignature { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xdaa99887))) { - slice.loadUint(32); - let anon0: CryptoSignatureSimple = loadCryptoSignatureSimple(slice); - return { - kind: 'CryptoSignature__', - anon0: anon0 - }; - }; - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0xf))) { - slice.loadUint(4); - let slice1 = slice.loadRef().beginParse(); - let signed_cert: SignedCertificate = loadSignedCertificate(slice1); - let temp_key_signature: CryptoSignatureSimple = loadCryptoSignatureSimple(slice); - return { - kind: 'CryptoSignature_chained_signature', - signed_cert: signed_cert, - temp_key_signature: temp_key_signature - }; - }; - throw new Error(''); - } -export function storeCryptoSignature(cryptoSignature: CryptoSignature): (builder: Builder) => void { - if ((cryptoSignature.kind == 'CryptoSignature__')) { - return ((builder: Builder) => { - builder.storeUint(0xdaa99887, 32); - storeCryptoSignatureSimple(cryptoSignature.anon0)(builder); - }); - }; - if ((cryptoSignature.kind == 'CryptoSignature_chained_signature')) { - return ((builder: Builder) => { - builder.storeUint(0xf, 4); - let cell1 = beginCell(); - storeSignedCertificate(cryptoSignature.signed_cert)(cell1); - builder.storeRef(cell1); - storeCryptoSignatureSimple(cryptoSignature.temp_key_signature)(builder); - }); - }; - throw new Error(''); - } -export function loadCryptoSignaturePair(slice: Slice): CryptoSignaturePair { - let node_id_short: BitString = slice.loadBits(256); - let sign: CryptoSignature = loadCryptoSignature(slice); - return { - kind: 'CryptoSignaturePair', - node_id_short: node_id_short, - sign: sign - }; - } -export function storeCryptoSignaturePair(cryptoSignaturePair: CryptoSignaturePair): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeBits(cryptoSignaturePair.node_id_short); - storeCryptoSignature(cryptoSignaturePair.sign)(builder); - }); - } -export function loadCertificate(slice: Slice): Certificate { - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0x4))) { - slice.loadUint(4); - let temp_key: SigPubKey = loadSigPubKey(slice); - let valid_since: number = slice.loadUint(32); - let valid_until: number = slice.loadUint(32); - return { - kind: 'Certificate', - temp_key: temp_key, - valid_since: valid_since, - valid_until: valid_until - }; - }; - throw new Error(''); - } -export function storeCertificate(certificate: Certificate): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x4, 4); - storeSigPubKey(certificate.temp_key)(builder); - builder.storeUint(certificate.valid_since, 32); - builder.storeUint(certificate.valid_until, 32); - }); - } -export function loadCertificateEnv(slice: Slice): CertificateEnv { - if (((slice.remainingBits >= 28) && (slice.preloadUint(28) == 0xa419b7d))) { - slice.loadUint(28); - let certificate: Certificate = loadCertificate(slice); - return { - kind: 'CertificateEnv', - certificate: certificate - }; - }; - throw new Error(''); - } -export function storeCertificateEnv(certificateEnv: CertificateEnv): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xa419b7d, 28); - storeCertificate(certificateEnv.certificate)(builder); - }); - } -export function loadSignedCertificate(slice: Slice): SignedCertificate { - let certificate: Certificate = loadCertificate(slice); - let certificate_signature: CryptoSignature = loadCryptoSignature(slice); - return { - kind: 'SignedCertificate', - certificate: certificate, - certificate_signature: certificate_signature - }; - } -export function storeSignedCertificate(signedCertificate: SignedCertificate): (builder: Builder) => void { - return ((builder: Builder) => { - storeCertificate(signedCertificate.certificate)(builder); - storeCryptoSignature(signedCertificate.certificate_signature)(builder); - }); - } -export function loadMcBlockExtra(slice: Slice): McBlockExtra { - if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0xcca5))) { - slice.loadUint(16); - let key_block: number = slice.loadUint(1); - let shard_hashes: ShardHashes = loadShardHashes(slice); - let shard_fees: ShardFees = loadShardFees(slice); - let slice1 = slice.loadRef().beginParse(); - let prev_blk_signatures: HashmapE = loadHashmapE(slice1, 16, loadCryptoSignaturePair); - let recover_create_msg: Maybe = loadMaybe(slice1, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadInMsg(slice1); - })); - let mint_msg: Maybe = loadMaybe(slice1, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadInMsg(slice1); - })); - let config: ConfigParams | undefined = (key_block ? loadConfigParams(slice) : undefined); - return { - kind: 'McBlockExtra', - key_block: key_block, - shard_hashes: shard_hashes, - shard_fees: shard_fees, - prev_blk_signatures: prev_blk_signatures, - recover_create_msg: recover_create_msg, - mint_msg: mint_msg, - config: config - }; - }; - throw new Error(''); - } -export function storeMcBlockExtra(mcBlockExtra: McBlockExtra): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xcca5, 16); - builder.storeUint(mcBlockExtra.key_block, 1); - storeShardHashes(mcBlockExtra.shard_hashes)(builder); - storeShardFees(mcBlockExtra.shard_fees)(builder); - let cell1 = beginCell(); - storeHashmapE(mcBlockExtra.prev_blk_signatures, storeCryptoSignaturePair)(cell1); - storeMaybe(mcBlockExtra.recover_create_msg, ((arg: InMsg) => { - return ((builder: Builder) => { - let cell1 = beginCell() - storeInMsg(arg)(cell1) - builder.storeRef(cell1); - }); - }))(cell1); - storeMaybe(mcBlockExtra.mint_msg, ((arg: InMsg) => { - return ((builder: Builder) => { - let cell1 = beginCell() - storeInMsg(arg)(cell1) - builder.storeRef(cell1); - }); - }))(cell1); - builder.storeRef(cell1); - if ((mcBlockExtra.config != undefined)) { - storeConfigParams(mcBlockExtra.config)(builder); - }; - }); - } -export function loadValidatorDescr(slice: Slice): ValidatorDescr { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x53))) { - slice.loadUint(8); - let public_key: SigPubKey = loadSigPubKey(slice); - let weight: number = slice.loadUint(64); - return { - kind: 'ValidatorDescr_validator', - public_key: public_key, - weight: weight - }; - }; - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x73))) { - slice.loadUint(8); - let public_key: SigPubKey = loadSigPubKey(slice); - let weight: number = slice.loadUint(64); - let adnl_addr: BitString = slice.loadBits(256); - return { - kind: 'ValidatorDescr_validator_addr', - public_key: public_key, - weight: weight, - adnl_addr: adnl_addr - }; - }; - throw new Error(''); - } -export function storeValidatorDescr(validatorDescr: ValidatorDescr): (builder: Builder) => void { - if ((validatorDescr.kind == 'ValidatorDescr_validator')) { - return ((builder: Builder) => { - builder.storeUint(0x53, 8); - storeSigPubKey(validatorDescr.public_key)(builder); - builder.storeUint(validatorDescr.weight, 64); - }); - }; - if ((validatorDescr.kind == 'ValidatorDescr_validator_addr')) { - return ((builder: Builder) => { - builder.storeUint(0x73, 8); - storeSigPubKey(validatorDescr.public_key)(builder); - builder.storeUint(validatorDescr.weight, 64); - builder.storeBits(validatorDescr.adnl_addr); - }); - }; - throw new Error(''); - } -export function loadValidatorSet(slice: Slice): ValidatorSet { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x11))) { - slice.loadUint(8); - let utime_since: number = slice.loadUint(32); - let utime_until: number = slice.loadUint(32); - let total: number = slice.loadUint(16); - let main: number = slice.loadUint(16); - let list: Hashmap = loadHashmap(slice, 16, loadValidatorDescr); - if ((!(main <= total))) { - throw new Error(''); - }; - if ((!(main >= 1))) { - throw new Error(''); - }; - return { - kind: 'ValidatorSet_validators', - utime_since: utime_since, - utime_until: utime_until, - total: total, - main: main, - list: list - }; - }; - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x12))) { - slice.loadUint(8); - let utime_since: number = slice.loadUint(32); - let utime_until: number = slice.loadUint(32); - let total: number = slice.loadUint(16); - let main: number = slice.loadUint(16); - let total_weight: number = slice.loadUint(64); - let list: HashmapE = loadHashmapE(slice, 16, loadValidatorDescr); - if ((!(main <= total))) { - throw new Error(''); - }; - if ((!(main >= 1))) { - throw new Error(''); - }; - return { - kind: 'ValidatorSet_validators_ext', - utime_since: utime_since, - utime_until: utime_until, - total: total, - main: main, - total_weight: total_weight, - list: list - }; - }; - throw new Error(''); - } -export function storeValidatorSet(validatorSet: ValidatorSet): (builder: Builder) => void { - if ((validatorSet.kind == 'ValidatorSet_validators')) { - return ((builder: Builder) => { - builder.storeUint(0x11, 8); - builder.storeUint(validatorSet.utime_since, 32); - builder.storeUint(validatorSet.utime_until, 32); - builder.storeUint(validatorSet.total, 16); - builder.storeUint(validatorSet.main, 16); - storeHashmap(validatorSet.list, storeValidatorDescr)(builder); - if ((!(validatorSet.main <= validatorSet.total))) { - throw new Error(''); - }; - if ((!(validatorSet.main >= 1))) { - throw new Error(''); - }; - }); - }; - if ((validatorSet.kind == 'ValidatorSet_validators_ext')) { - return ((builder: Builder) => { - builder.storeUint(0x12, 8); - builder.storeUint(validatorSet.utime_since, 32); - builder.storeUint(validatorSet.utime_until, 32); - builder.storeUint(validatorSet.total, 16); - builder.storeUint(validatorSet.main, 16); - builder.storeUint(validatorSet.total_weight, 64); - storeHashmapE(validatorSet.list, storeValidatorDescr)(builder); - if ((!(validatorSet.main <= validatorSet.total))) { - throw new Error(''); - }; - if ((!(validatorSet.main >= 1))) { - throw new Error(''); - }; - }); - }; - throw new Error(''); - } -export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xbc7f2648) && (arg0 == 0)))) { - slice.loadUint(32); - let config_addr: BitString = slice.loadBits(256); - return { - kind: 'ConfigParam__', - config_addr: config_addr - }; - }; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x84659d0d) && (arg0 == 1)))) { - slice.loadUint(32); - let elector_addr: BitString = slice.loadBits(256); - return { - kind: 'ConfigParam__1', - elector_addr: elector_addr - }; - }; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x8648b2c4) && (arg0 == 2)))) { - slice.loadUint(32); - let minter_addr: BitString = slice.loadBits(256); - return { - kind: 'ConfigParam__2', - minter_addr: minter_addr - }; - }; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x8a752dc5) && (arg0 == 3)))) { - slice.loadUint(32); - let fee_collector_addr: BitString = slice.loadBits(256); - return { - kind: 'ConfigParam__3', - fee_collector_addr: fee_collector_addr - }; - }; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x8ceae93f) && (arg0 == 4)))) { - slice.loadUint(32); - let dns_root_addr: BitString = slice.loadBits(256); - return { - kind: 'ConfigParam__4', - dns_root_addr: dns_root_addr - }; - }; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xb2571db5) && (arg0 == 6)))) { - slice.loadUint(32); - let mint_new_price: Grams = loadGrams(slice); - let mint_add_price: Grams = loadGrams(slice); - return { - kind: 'ConfigParam__5', - mint_new_price: mint_new_price, - mint_add_price: mint_add_price - }; - }; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xd2115c6f) && (arg0 == 7)))) { - slice.loadUint(32); - let to_mint: ExtraCurrencyCollection = loadExtraCurrencyCollection(slice); - return { - kind: 'ConfigParam__6', - to_mint: to_mint - }; - }; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xb19d2da6) && (arg0 == 8)))) { - slice.loadUint(32); - let anon0: GlobalVersion = loadGlobalVersion(slice); - return { - kind: 'ConfigParam__7', - anon0: anon0 - }; - }; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x8f3b81de) && (arg0 == 9)))) { - slice.loadUint(32); - let mandatory_params: Hashmap = loadHashmap(slice, 32, loadTrue); - return { - kind: 'ConfigParam__8', - mandatory_params: mandatory_params - }; - }; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xfbcb8998) && (arg0 == 10)))) { - slice.loadUint(32); - let critical_params: Hashmap = loadHashmap(slice, 32, loadTrue); - return { - kind: 'ConfigParam__9', - critical_params: critical_params - }; - }; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x9358b12f) && (arg0 == 11)))) { - slice.loadUint(32); - let anon0: ConfigVotingSetup = loadConfigVotingSetup(slice); - return { - kind: 'ConfigParam__10', - anon0: anon0 - }; - }; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x9059857d) && (arg0 == 12)))) { - slice.loadUint(32); - let workchains: HashmapE = loadHashmapE(slice, 32, loadWorkchainDescr); - return { - kind: 'ConfigParam__11', - workchains: workchains - }; - }; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xe8ae7dd3) && (arg0 == 13)))) { - slice.loadUint(32); - let anon0: ComplaintPricing = loadComplaintPricing(slice); - return { - kind: 'ConfigParam__12', - anon0: anon0 - }; - }; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xf282db94) && (arg0 == 14)))) { - slice.loadUint(32); - let anon0: BlockCreateFees = loadBlockCreateFees(slice); - return { - kind: 'ConfigParam__13', - anon0: anon0 - }; - }; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xed67ebd2) && (arg0 == 15)))) { - slice.loadUint(32); - let validators_elected_for: number = slice.loadUint(32); - let elections_start_before: number = slice.loadUint(32); - let elections_end_before: number = slice.loadUint(32); - let stake_held_for: number = slice.loadUint(32); - return { - kind: 'ConfigParam__14', - validators_elected_for: validators_elected_for, - elections_start_before: elections_start_before, - elections_end_before: elections_end_before, - stake_held_for: stake_held_for - }; - }; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xe8298d51) && (arg0 == 16)))) { - slice.loadUint(32); - let max_validators: number = slice.loadUint(16); - let max_main_validators: number = slice.loadUint(16); - let min_validators: number = slice.loadUint(16); - if ((!(max_validators >= max_main_validators))) { - throw new Error(''); - }; - if ((!(max_main_validators >= min_validators))) { - throw new Error(''); - }; - if ((!(min_validators >= 1))) { - throw new Error(''); - }; - return { - kind: 'ConfigParam__15', - max_validators: max_validators, - max_main_validators: max_main_validators, - min_validators: min_validators - }; - }; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xa81c566c) && (arg0 == 17)))) { - slice.loadUint(32); - let min_stake: Grams = loadGrams(slice); - let max_stake: Grams = loadGrams(slice); - let min_total_stake: Grams = loadGrams(slice); - let max_stake_factor: number = slice.loadUint(32); - return { - kind: 'ConfigParam__16', - min_stake: min_stake, - max_stake: max_stake, - min_total_stake: min_total_stake, - max_stake_factor: max_stake_factor - }; - }; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xeab9843a) && (arg0 == 18)))) { - slice.loadUint(32); - let anon0: Hashmap = loadHashmap(slice, 32, loadStoragePrices); - return { - kind: 'ConfigParam__17', - anon0: anon0 - }; - }; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xf666426a) && (arg0 == 28)))) { - slice.loadUint(32); - let anon0: CatchainConfig = loadCatchainConfig(slice); - return { - kind: 'ConfigParam__24', - anon0: anon0 - }; - }; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xf5b85ad3) && (arg0 == 29)))) { - slice.loadUint(32); - let anon0: ConsensusConfig = loadConsensusConfig(slice); - return { - kind: 'ConfigParam__25', - anon0: anon0 - }; - }; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x849fe3cc) && (arg0 == 31)))) { - slice.loadUint(32); - let fundamental_smc_addr: HashmapE = loadHashmapE(slice, 256, loadTrue); - return { - kind: 'ConfigParam__26', - fundamental_smc_addr: fundamental_smc_addr - }; - }; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xcfc8ceeb) && (arg0 == 32)))) { - slice.loadUint(32); - let prev_validators: ValidatorSet = loadValidatorSet(slice); - return { - kind: 'ConfigParam__27', - prev_validators: prev_validators - }; - }; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xa1a5d63c) && (arg0 == 33)))) { - slice.loadUint(32); - let prev_temp_validators: ValidatorSet = loadValidatorSet(slice); - return { - kind: 'ConfigParam__28', - prev_temp_validators: prev_temp_validators - }; - }; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xfd569be3) && (arg0 == 34)))) { - slice.loadUint(32); - let cur_validators: ValidatorSet = loadValidatorSet(slice); - return { - kind: 'ConfigParam__29', - cur_validators: cur_validators - }; - }; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xc271315a) && (arg0 == 35)))) { - slice.loadUint(32); - let cur_temp_validators: ValidatorSet = loadValidatorSet(slice); - return { - kind: 'ConfigParam__30', - cur_temp_validators: cur_temp_validators - }; - }; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x85d02f6c) && (arg0 == 36)))) { - slice.loadUint(32); - let next_validators: ValidatorSet = loadValidatorSet(slice); - return { - kind: 'ConfigParam__31', - next_validators: next_validators - }; - }; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xffa3b0f8) && (arg0 == 37)))) { - slice.loadUint(32); - let next_temp_validators: ValidatorSet = loadValidatorSet(slice); - return { - kind: 'ConfigParam__32', - next_temp_validators: next_temp_validators - }; - }; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x86dfef76) && (arg0 == 39)))) { - slice.loadUint(32); - let anon0: HashmapE = loadHashmapE(slice, 256, loadValidatorSignedTempKey); - return { - kind: 'ConfigParam__33', - anon0: anon0 - }; - }; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x8517b916) && (arg0 == 40)))) { - slice.loadUint(32); - let anon0: MisbehaviourPunishmentConfig = loadMisbehaviourPunishmentConfig(slice); - return { - kind: 'ConfigParam__34', - anon0: anon0 - }; - }; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xbd424af1) && (arg0 == 71)))) { - slice.loadUint(32); - let anon0: OracleBridgeParams = loadOracleBridgeParams(slice); - return { - kind: 'ConfigParam__35', - anon0: anon0 - }; - }; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x966f1932) && (arg0 == 72)))) { - slice.loadUint(32); - let anon0: OracleBridgeParams = loadOracleBridgeParams(slice); - return { - kind: 'ConfigParam__36', - anon0: anon0 - }; - }; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x8f742873) && (arg0 == 73)))) { - slice.loadUint(32); - let anon0: OracleBridgeParams = loadOracleBridgeParams(slice); - return { - kind: 'ConfigParam__37', - anon0: anon0 - }; - }; - if ((arg0 == 20)) { - let anon0: GasLimitsPrices = loadGasLimitsPrices(slice); - return { - kind: 'ConfigParam_config_mc_gas_prices', - anon0: anon0 - }; - }; - if ((arg0 == 21)) { - let anon0: GasLimitsPrices = loadGasLimitsPrices(slice); - return { - kind: 'ConfigParam_config_gas_prices', - anon0: anon0 - }; - }; - if ((arg0 == 22)) { - let anon0: BlockLimits = loadBlockLimits(slice); - return { - kind: 'ConfigParam_config_mc_block_limits', - anon0: anon0 - }; - }; - if ((arg0 == 23)) { - let anon0: BlockLimits = loadBlockLimits(slice); - return { - kind: 'ConfigParam_config_block_limits', - anon0: anon0 - }; - }; - if ((arg0 == 24)) { - let anon0: MsgForwardPrices = loadMsgForwardPrices(slice); - return { - kind: 'ConfigParam_config_mc_fwd_prices', - anon0: anon0 - }; - }; - if ((arg0 == 25)) { - let anon0: MsgForwardPrices = loadMsgForwardPrices(slice); - return { - kind: 'ConfigParam_config_fwd_prices', - anon0: anon0 - }; - }; - throw new Error(''); - } -export function storeConfigParam(configParam: ConfigParam): (builder: Builder) => void { - if ((configParam.kind == 'ConfigParam__')) { - return ((builder: Builder) => { - builder.storeUint(0xbc7f2648, 32); - builder.storeBits(configParam.config_addr); - }); - }; - if ((configParam.kind == 'ConfigParam__1')) { - return ((builder: Builder) => { - builder.storeUint(0x84659d0d, 32); - builder.storeBits(configParam.elector_addr); - }); - }; - if ((configParam.kind == 'ConfigParam__2')) { - return ((builder: Builder) => { - builder.storeUint(0x8648b2c4, 32); - builder.storeBits(configParam.minter_addr); - }); - }; - if ((configParam.kind == 'ConfigParam__3')) { - return ((builder: Builder) => { - builder.storeUint(0x8a752dc5, 32); - builder.storeBits(configParam.fee_collector_addr); - }); - }; - if ((configParam.kind == 'ConfigParam__4')) { - return ((builder: Builder) => { - builder.storeUint(0x8ceae93f, 32); - builder.storeBits(configParam.dns_root_addr); - }); - }; - if ((configParam.kind == 'ConfigParam__5')) { - return ((builder: Builder) => { - builder.storeUint(0xb2571db5, 32); - storeGrams(configParam.mint_new_price)(builder); - storeGrams(configParam.mint_add_price)(builder); - }); - }; - if ((configParam.kind == 'ConfigParam__6')) { - return ((builder: Builder) => { - builder.storeUint(0xd2115c6f, 32); - storeExtraCurrencyCollection(configParam.to_mint)(builder); - }); - }; - if ((configParam.kind == 'ConfigParam__7')) { - return ((builder: Builder) => { - builder.storeUint(0xb19d2da6, 32); - storeGlobalVersion(configParam.anon0)(builder); - }); - }; - if ((configParam.kind == 'ConfigParam__8')) { - return ((builder: Builder) => { - builder.storeUint(0x8f3b81de, 32); - storeHashmap(configParam.mandatory_params, storeTrue)(builder); - }); - }; - if ((configParam.kind == 'ConfigParam__9')) { - return ((builder: Builder) => { - builder.storeUint(0xfbcb8998, 32); - storeHashmap(configParam.critical_params, storeTrue)(builder); - }); - }; - if ((configParam.kind == 'ConfigParam__10')) { - return ((builder: Builder) => { - builder.storeUint(0x9358b12f, 32); - storeConfigVotingSetup(configParam.anon0)(builder); - }); - }; - if ((configParam.kind == 'ConfigParam__11')) { - return ((builder: Builder) => { - builder.storeUint(0x9059857d, 32); - storeHashmapE(configParam.workchains, storeWorkchainDescr)(builder); - }); - }; - if ((configParam.kind == 'ConfigParam__12')) { - return ((builder: Builder) => { - builder.storeUint(0xe8ae7dd3, 32); - storeComplaintPricing(configParam.anon0)(builder); - }); - }; - if ((configParam.kind == 'ConfigParam__13')) { - return ((builder: Builder) => { - builder.storeUint(0xf282db94, 32); - storeBlockCreateFees(configParam.anon0)(builder); - }); - }; - if ((configParam.kind == 'ConfigParam__14')) { - return ((builder: Builder) => { - builder.storeUint(0xed67ebd2, 32); - builder.storeUint(configParam.validators_elected_for, 32); - builder.storeUint(configParam.elections_start_before, 32); - builder.storeUint(configParam.elections_end_before, 32); - builder.storeUint(configParam.stake_held_for, 32); - }); - }; - if ((configParam.kind == 'ConfigParam__15')) { - return ((builder: Builder) => { - builder.storeUint(0xe8298d51, 32); - builder.storeUint(configParam.max_validators, 16); - builder.storeUint(configParam.max_main_validators, 16); - builder.storeUint(configParam.min_validators, 16); - if ((!(configParam.max_validators >= configParam.max_main_validators))) { - throw new Error(''); - }; - if ((!(configParam.max_main_validators >= configParam.min_validators))) { - throw new Error(''); - }; - if ((!(configParam.min_validators >= 1))) { - throw new Error(''); - }; - }); - }; - if ((configParam.kind == 'ConfigParam__16')) { - return ((builder: Builder) => { - builder.storeUint(0xa81c566c, 32); - storeGrams(configParam.min_stake)(builder); - storeGrams(configParam.max_stake)(builder); - storeGrams(configParam.min_total_stake)(builder); - builder.storeUint(configParam.max_stake_factor, 32); - }); - }; - if ((configParam.kind == 'ConfigParam__17')) { - return ((builder: Builder) => { - builder.storeUint(0xeab9843a, 32); - storeHashmap(configParam.anon0, storeStoragePrices)(builder); - }); - }; - if ((configParam.kind == 'ConfigParam__24')) { - return ((builder: Builder) => { - builder.storeUint(0xf666426a, 32); - storeCatchainConfig(configParam.anon0)(builder); - }); - }; - if ((configParam.kind == 'ConfigParam__25')) { - return ((builder: Builder) => { - builder.storeUint(0xf5b85ad3, 32); - storeConsensusConfig(configParam.anon0)(builder); - }); - }; - if ((configParam.kind == 'ConfigParam__26')) { - return ((builder: Builder) => { - builder.storeUint(0x849fe3cc, 32); - storeHashmapE(configParam.fundamental_smc_addr, storeTrue)(builder); - }); - }; - if ((configParam.kind == 'ConfigParam__27')) { - return ((builder: Builder) => { - builder.storeUint(0xcfc8ceeb, 32); - storeValidatorSet(configParam.prev_validators)(builder); - }); - }; - if ((configParam.kind == 'ConfigParam__28')) { - return ((builder: Builder) => { - builder.storeUint(0xa1a5d63c, 32); - storeValidatorSet(configParam.prev_temp_validators)(builder); - }); - }; - if ((configParam.kind == 'ConfigParam__29')) { - return ((builder: Builder) => { - builder.storeUint(0xfd569be3, 32); - storeValidatorSet(configParam.cur_validators)(builder); - }); - }; - if ((configParam.kind == 'ConfigParam__30')) { - return ((builder: Builder) => { - builder.storeUint(0xc271315a, 32); - storeValidatorSet(configParam.cur_temp_validators)(builder); - }); - }; - if ((configParam.kind == 'ConfigParam__31')) { - return ((builder: Builder) => { - builder.storeUint(0x85d02f6c, 32); - storeValidatorSet(configParam.next_validators)(builder); - }); - }; - if ((configParam.kind == 'ConfigParam__32')) { - return ((builder: Builder) => { - builder.storeUint(0xffa3b0f8, 32); - storeValidatorSet(configParam.next_temp_validators)(builder); - }); - }; - if ((configParam.kind == 'ConfigParam__33')) { - return ((builder: Builder) => { - builder.storeUint(0x86dfef76, 32); - storeHashmapE(configParam.anon0, storeValidatorSignedTempKey)(builder); - }); - }; - if ((configParam.kind == 'ConfigParam__34')) { - return ((builder: Builder) => { - builder.storeUint(0x8517b916, 32); - storeMisbehaviourPunishmentConfig(configParam.anon0)(builder); - }); - }; - if ((configParam.kind == 'ConfigParam__35')) { - return ((builder: Builder) => { - builder.storeUint(0xbd424af1, 32); - storeOracleBridgeParams(configParam.anon0)(builder); - }); - }; - if ((configParam.kind == 'ConfigParam__36')) { - return ((builder: Builder) => { - builder.storeUint(0x966f1932, 32); - storeOracleBridgeParams(configParam.anon0)(builder); - }); - }; - if ((configParam.kind == 'ConfigParam__37')) { - return ((builder: Builder) => { - builder.storeUint(0x8f742873, 32); - storeOracleBridgeParams(configParam.anon0)(builder); - }); - }; - if ((configParam.kind == 'ConfigParam_config_mc_gas_prices')) { - return ((builder: Builder) => { - storeGasLimitsPrices(configParam.anon0)(builder); - }); - }; - if ((configParam.kind == 'ConfigParam_config_gas_prices')) { - return ((builder: Builder) => { - storeGasLimitsPrices(configParam.anon0)(builder); - }); - }; - if ((configParam.kind == 'ConfigParam_config_mc_block_limits')) { - return ((builder: Builder) => { - storeBlockLimits(configParam.anon0)(builder); - }); - }; - if ((configParam.kind == 'ConfigParam_config_block_limits')) { - return ((builder: Builder) => { - storeBlockLimits(configParam.anon0)(builder); - }); - }; - if ((configParam.kind == 'ConfigParam_config_mc_fwd_prices')) { - return ((builder: Builder) => { - storeMsgForwardPrices(configParam.anon0)(builder); - }); - }; - if ((configParam.kind == 'ConfigParam_config_fwd_prices')) { - return ((builder: Builder) => { - storeMsgForwardPrices(configParam.anon0)(builder); - }); - }; - throw new Error(''); - } -export function loadGlobalVersion(slice: Slice): GlobalVersion { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xc4))) { - slice.loadUint(8); - let version: number = slice.loadUint(32); - let capabilities: number = slice.loadUint(64); - return { - kind: 'GlobalVersion', - version: version, - capabilities: capabilities - }; - }; - throw new Error(''); - } -export function storeGlobalVersion(globalVersion: GlobalVersion): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xc4, 8); - builder.storeUint(globalVersion.version, 32); - builder.storeUint(globalVersion.capabilities, 64); - }); - } -export function loadConfigProposalSetup(slice: Slice): ConfigProposalSetup { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x36))) { - slice.loadUint(8); - let min_tot_rounds: number = slice.loadUint(8); - let max_tot_rounds: number = slice.loadUint(8); - let min_wins: number = slice.loadUint(8); - let max_losses: number = slice.loadUint(8); - let min_store_sec: number = slice.loadUint(32); - let max_store_sec: number = slice.loadUint(32); - let bit_price: number = slice.loadUint(32); - let _cell_price: number = slice.loadUint(32); - return { - kind: 'ConfigProposalSetup', - min_tot_rounds: min_tot_rounds, - max_tot_rounds: max_tot_rounds, - min_wins: min_wins, - max_losses: max_losses, - min_store_sec: min_store_sec, - max_store_sec: max_store_sec, - bit_price: bit_price, - _cell_price: _cell_price - }; - }; - throw new Error(''); - } -export function storeConfigProposalSetup(configProposalSetup: ConfigProposalSetup): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x36, 8); - builder.storeUint(configProposalSetup.min_tot_rounds, 8); - builder.storeUint(configProposalSetup.max_tot_rounds, 8); - builder.storeUint(configProposalSetup.min_wins, 8); - builder.storeUint(configProposalSetup.max_losses, 8); - builder.storeUint(configProposalSetup.min_store_sec, 32); - builder.storeUint(configProposalSetup.max_store_sec, 32); - builder.storeUint(configProposalSetup.bit_price, 32); - builder.storeUint(configProposalSetup._cell_price, 32); - }); - } -export function loadConfigVotingSetup(slice: Slice): ConfigVotingSetup { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x91))) { - slice.loadUint(8); - let slice1 = slice.loadRef().beginParse(); - let normal_params: ConfigProposalSetup = loadConfigProposalSetup(slice1); - let slice2 = slice.loadRef().beginParse(); - let critical_params: ConfigProposalSetup = loadConfigProposalSetup(slice2); - return { - kind: 'ConfigVotingSetup', - normal_params: normal_params, - critical_params: critical_params - }; - }; - throw new Error(''); - } -export function storeConfigVotingSetup(configVotingSetup: ConfigVotingSetup): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x91, 8); - let cell1 = beginCell(); - storeConfigProposalSetup(configVotingSetup.normal_params)(cell1); - builder.storeRef(cell1); - let cell2 = beginCell(); - storeConfigProposalSetup(configVotingSetup.critical_params)(cell2); - builder.storeRef(cell2); - }); - } -export function loadConfigProposal(slice: Slice): ConfigProposal { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xf3))) { - slice.loadUint(8); - let param_id: number = slice.loadInt(32); - let param_value: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return slice1; - })); - let if_hash_equal: Maybe = loadMaybe(slice, ((slice: Slice) => { - return slice.loadUint(256); - })); - return { - kind: 'ConfigProposal', - param_id: param_id, - param_value: param_value, - if_hash_equal: if_hash_equal - }; - }; - throw new Error(''); - } -export function storeConfigProposal(configProposal: ConfigProposal): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xf3, 8); - builder.storeInt(configProposal.param_id, 32); - storeMaybe(configProposal.param_value, ((arg: Slice) => { - return ((builder: Builder) => { - let cell1 = beginCell() - cell1.storeSlice(arg) - builder.storeRef(cell1); - }); - }))(builder); - storeMaybe(configProposal.if_hash_equal, ((arg: number) => { - return ((builder: Builder) => { - builder.storeUint(arg, 256); - }); - }))(builder); - }); - } -export function loadConfigProposalStatus(slice: Slice): ConfigProposalStatus { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xce))) { - slice.loadUint(8); - let expires: number = slice.loadUint(32); - let slice1 = slice.loadRef().beginParse(); - let proposal: ConfigProposal = loadConfigProposal(slice1); - let is_critical: Bool = loadBool(slice); - let voters: HashmapE = loadHashmapE(slice, 16, loadTrue); - let remaining_weight: number = slice.loadInt(64); - let validator_set_id: number = slice.loadUint(256); - let rounds_remaining: number = slice.loadUint(8); - let wins: number = slice.loadUint(8); - let losses: number = slice.loadUint(8); - return { - kind: 'ConfigProposalStatus', - expires: expires, - proposal: proposal, - is_critical: is_critical, - voters: voters, - remaining_weight: remaining_weight, - validator_set_id: validator_set_id, - rounds_remaining: rounds_remaining, - wins: wins, - losses: losses - }; - }; - throw new Error(''); - } -export function storeConfigProposalStatus(configProposalStatus: ConfigProposalStatus): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xce, 8); - builder.storeUint(configProposalStatus.expires, 32); - let cell1 = beginCell(); - storeConfigProposal(configProposalStatus.proposal)(cell1); - builder.storeRef(cell1); - storeBool(configProposalStatus.is_critical)(builder); - storeHashmapE(configProposalStatus.voters, storeTrue)(builder); - builder.storeInt(configProposalStatus.remaining_weight, 64); - builder.storeUint(configProposalStatus.validator_set_id, 256); - builder.storeUint(configProposalStatus.rounds_remaining, 8); - builder.storeUint(configProposalStatus.wins, 8); - builder.storeUint(configProposalStatus.losses, 8); - }); - } -export function loadWorkchainFormat(slice: Slice, arg0: number): WorkchainFormat { - if (((slice.remainingBits >= 4) && ((slice.preloadUint(4) == 0x1) && (arg0 == 1)))) { - slice.loadUint(4); - let vm_version: number = slice.loadInt(32); - let vm_mode: number = slice.loadUint(64); - return { - kind: 'WorkchainFormat_wfmt_basic', - vm_version: vm_version, - vm_mode: vm_mode - }; - }; - if (((slice.remainingBits >= 4) && ((slice.preloadUint(4) == 0x0) && (arg0 == 0)))) { - slice.loadUint(4); - let min_addr_len: number = slice.loadUint(12); - let max_addr_len: number = slice.loadUint(12); - let addr_len_step: number = slice.loadUint(12); - let workchain_type_id: number = slice.loadUint(32); - if ((!(min_addr_len >= 64))) { - throw new Error(''); - }; - if ((!(min_addr_len <= max_addr_len))) { - throw new Error(''); - }; - if ((!(max_addr_len <= 1023))) { - throw new Error(''); - }; - if ((!(addr_len_step <= 1023))) { - throw new Error(''); - }; - if ((!(workchain_type_id >= 1))) { - throw new Error(''); - }; - return { - kind: 'WorkchainFormat_wfmt_ext', - min_addr_len: min_addr_len, - max_addr_len: max_addr_len, - addr_len_step: addr_len_step, - workchain_type_id: workchain_type_id - }; - }; - throw new Error(''); - } -export function storeWorkchainFormat(workchainFormat: WorkchainFormat): (builder: Builder) => void { - if ((workchainFormat.kind == 'WorkchainFormat_wfmt_basic')) { - return ((builder: Builder) => { - builder.storeUint(0x1, 4); - builder.storeInt(workchainFormat.vm_version, 32); - builder.storeUint(workchainFormat.vm_mode, 64); - }); - }; - if ((workchainFormat.kind == 'WorkchainFormat_wfmt_ext')) { - return ((builder: Builder) => { - builder.storeUint(0x0, 4); - builder.storeUint(workchainFormat.min_addr_len, 12); - builder.storeUint(workchainFormat.max_addr_len, 12); - builder.storeUint(workchainFormat.addr_len_step, 12); - builder.storeUint(workchainFormat.workchain_type_id, 32); - if ((!(workchainFormat.min_addr_len >= 64))) { - throw new Error(''); - }; - if ((!(workchainFormat.min_addr_len <= workchainFormat.max_addr_len))) { - throw new Error(''); - }; - if ((!(workchainFormat.max_addr_len <= 1023))) { - throw new Error(''); - }; - if ((!(workchainFormat.addr_len_step <= 1023))) { - throw new Error(''); - }; - if ((!(workchainFormat.workchain_type_id >= 1))) { - throw new Error(''); - }; - }); - }; - throw new Error(''); - } -export function loadWorkchainDescr(slice: Slice): WorkchainDescr { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xa6))) { - slice.loadUint(8); - let enabled_since: number = slice.loadUint(32); - let actual_min_split: number = slice.loadUint(8); - let min_split: number = slice.loadUint(8); - let max_split: number = slice.loadUint(8); - let basic: number = slice.loadUint(1); - let active: Bool = loadBool(slice); - let accept_msgs: Bool = loadBool(slice); - let flags: number = slice.loadUint(13); - let zerostate_root_hash: BitString = slice.loadBits(256); - let zerostate_file_hash: BitString = slice.loadBits(256); - let version: number = slice.loadUint(32); - let format: WorkchainFormat = loadWorkchainFormat(slice, basic); - if ((!(actual_min_split <= min_split))) { - throw new Error(''); - }; - if ((!(flags == 0))) { - throw new Error(''); - }; - return { - kind: 'WorkchainDescr', - enabled_since: enabled_since, - actual_min_split: actual_min_split, - min_split: min_split, - max_split: max_split, - basic: basic, - active: active, - accept_msgs: accept_msgs, - flags: flags, - zerostate_root_hash: zerostate_root_hash, - zerostate_file_hash: zerostate_file_hash, - version: version, - format: format - }; - }; - throw new Error(''); - } -export function storeWorkchainDescr(workchainDescr: WorkchainDescr): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xa6, 8); - builder.storeUint(workchainDescr.enabled_since, 32); - builder.storeUint(workchainDescr.actual_min_split, 8); - builder.storeUint(workchainDescr.min_split, 8); - builder.storeUint(workchainDescr.max_split, 8); - builder.storeUint(workchainDescr.basic, 1); - storeBool(workchainDescr.active)(builder); - storeBool(workchainDescr.accept_msgs)(builder); - builder.storeUint(workchainDescr.flags, 13); - builder.storeBits(workchainDescr.zerostate_root_hash); - builder.storeBits(workchainDescr.zerostate_file_hash); - builder.storeUint(workchainDescr.version, 32); - storeWorkchainFormat(workchainDescr.format)(builder); - if ((!(workchainDescr.actual_min_split <= workchainDescr.min_split))) { - throw new Error(''); - }; - if ((!(workchainDescr.flags == 0))) { - throw new Error(''); - }; - }); - } -export function loadComplaintPricing(slice: Slice): ComplaintPricing { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x1a))) { - slice.loadUint(8); - let deposit: Grams = loadGrams(slice); - let bit_price: Grams = loadGrams(slice); - let _cell_price: Grams = loadGrams(slice); - return { - kind: 'ComplaintPricing', - deposit: deposit, - bit_price: bit_price, - _cell_price: _cell_price - }; - }; - throw new Error(''); - } -export function storeComplaintPricing(complaintPricing: ComplaintPricing): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x1a, 8); - storeGrams(complaintPricing.deposit)(builder); - storeGrams(complaintPricing.bit_price)(builder); - storeGrams(complaintPricing._cell_price)(builder); - }); - } -export function loadBlockCreateFees(slice: Slice): BlockCreateFees { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x6b))) { - slice.loadUint(8); - let masterchain_block_fee: Grams = loadGrams(slice); - let basechain_block_fee: Grams = loadGrams(slice); - return { - kind: 'BlockCreateFees', - masterchain_block_fee: masterchain_block_fee, - basechain_block_fee: basechain_block_fee - }; - }; - throw new Error(''); - } -export function storeBlockCreateFees(blockCreateFees: BlockCreateFees): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x6b, 8); - storeGrams(blockCreateFees.masterchain_block_fee)(builder); - storeGrams(blockCreateFees.basechain_block_fee)(builder); - }); - } -export function loadStoragePrices(slice: Slice): StoragePrices { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xcc))) { - slice.loadUint(8); - let utime_since: number = slice.loadUint(32); - let bit_price_ps: number = slice.loadUint(64); - let _cell_price_ps: number = slice.loadUint(64); - let mc_bit_price_ps: number = slice.loadUint(64); - let mc_cell_price_ps: number = slice.loadUint(64); - return { - kind: 'StoragePrices', - utime_since: utime_since, - bit_price_ps: bit_price_ps, - _cell_price_ps: _cell_price_ps, - mc_bit_price_ps: mc_bit_price_ps, - mc_cell_price_ps: mc_cell_price_ps - }; - }; - throw new Error(''); - } -export function storeStoragePrices(storagePrices: StoragePrices): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xcc, 8); - builder.storeUint(storagePrices.utime_since, 32); - builder.storeUint(storagePrices.bit_price_ps, 64); - builder.storeUint(storagePrices._cell_price_ps, 64); - builder.storeUint(storagePrices.mc_bit_price_ps, 64); - builder.storeUint(storagePrices.mc_cell_price_ps, 64); - }); - } -export function loadGasLimitsPrices(slice: Slice): GasLimitsPrices { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xdd))) { - slice.loadUint(8); - let gas_price: number = slice.loadUint(64); - let gas_limit: number = slice.loadUint(64); - let gas_credit: number = slice.loadUint(64); - let block_gas_limit: number = slice.loadUint(64); - let freeze_due_limit: number = slice.loadUint(64); - let delete_due_limit: number = slice.loadUint(64); - return { - kind: 'GasLimitsPrices_gas_prices', - gas_price: gas_price, - gas_limit: gas_limit, - gas_credit: gas_credit, - block_gas_limit: block_gas_limit, - freeze_due_limit: freeze_due_limit, - delete_due_limit: delete_due_limit - }; - }; - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xde))) { - slice.loadUint(8); - let gas_price: number = slice.loadUint(64); - let gas_limit: number = slice.loadUint(64); - let special_gas_limit: number = slice.loadUint(64); - let gas_credit: number = slice.loadUint(64); - let block_gas_limit: number = slice.loadUint(64); - let freeze_due_limit: number = slice.loadUint(64); - let delete_due_limit: number = slice.loadUint(64); - return { - kind: 'GasLimitsPrices_gas_prices_ext', - gas_price: gas_price, - gas_limit: gas_limit, - special_gas_limit: special_gas_limit, - gas_credit: gas_credit, - block_gas_limit: block_gas_limit, - freeze_due_limit: freeze_due_limit, - delete_due_limit: delete_due_limit - }; - }; - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xd1))) { - slice.loadUint(8); - let flat_gas_limit: number = slice.loadUint(64); - let flat_gas_price: number = slice.loadUint(64); - let other: GasLimitsPrices = loadGasLimitsPrices(slice); - return { - kind: 'GasLimitsPrices_gas_flat_pfx', - flat_gas_limit: flat_gas_limit, - flat_gas_price: flat_gas_price, - other: other - }; - }; - throw new Error(''); - } -export function storeGasLimitsPrices(gasLimitsPrices: GasLimitsPrices): (builder: Builder) => void { - if ((gasLimitsPrices.kind == 'GasLimitsPrices_gas_prices')) { - return ((builder: Builder) => { - builder.storeUint(0xdd, 8); - builder.storeUint(gasLimitsPrices.gas_price, 64); - builder.storeUint(gasLimitsPrices.gas_limit, 64); - builder.storeUint(gasLimitsPrices.gas_credit, 64); - builder.storeUint(gasLimitsPrices.block_gas_limit, 64); - builder.storeUint(gasLimitsPrices.freeze_due_limit, 64); - builder.storeUint(gasLimitsPrices.delete_due_limit, 64); - }); - }; - if ((gasLimitsPrices.kind == 'GasLimitsPrices_gas_prices_ext')) { - return ((builder: Builder) => { - builder.storeUint(0xde, 8); - builder.storeUint(gasLimitsPrices.gas_price, 64); - builder.storeUint(gasLimitsPrices.gas_limit, 64); - builder.storeUint(gasLimitsPrices.special_gas_limit, 64); - builder.storeUint(gasLimitsPrices.gas_credit, 64); - builder.storeUint(gasLimitsPrices.block_gas_limit, 64); - builder.storeUint(gasLimitsPrices.freeze_due_limit, 64); - builder.storeUint(gasLimitsPrices.delete_due_limit, 64); - }); - }; - if ((gasLimitsPrices.kind == 'GasLimitsPrices_gas_flat_pfx')) { - return ((builder: Builder) => { - builder.storeUint(0xd1, 8); - builder.storeUint(gasLimitsPrices.flat_gas_limit, 64); - builder.storeUint(gasLimitsPrices.flat_gas_price, 64); - storeGasLimitsPrices(gasLimitsPrices.other)(builder); - }); - }; - throw new Error(''); - } -export function loadParamLimits(slice: Slice): ParamLimits { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xc3))) { - slice.loadUint(8); - let underload: number = slice.loadUint(32); - let soft_limit: number = slice.loadUint(32); - let hard_limit: number = slice.loadUint(32); - if ((!(underload <= soft_limit))) { - throw new Error(''); - }; - if ((!(soft_limit <= hard_limit))) { - throw new Error(''); - }; - return { - kind: 'ParamLimits', - underload: underload, - soft_limit: soft_limit, - hard_limit: hard_limit - }; - }; - throw new Error(''); - } -export function storeParamLimits(paramLimits: ParamLimits): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xc3, 8); - builder.storeUint(paramLimits.underload, 32); - builder.storeUint(paramLimits.soft_limit, 32); - builder.storeUint(paramLimits.hard_limit, 32); - if ((!(paramLimits.underload <= paramLimits.soft_limit))) { - throw new Error(''); - }; - if ((!(paramLimits.soft_limit <= paramLimits.hard_limit))) { - throw new Error(''); - }; - }); - } -export function loadBlockLimits(slice: Slice): BlockLimits { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x5d))) { - slice.loadUint(8); - let bytes: ParamLimits = loadParamLimits(slice); - let gas: ParamLimits = loadParamLimits(slice); - let lt_delta: ParamLimits = loadParamLimits(slice); - return { - kind: 'BlockLimits', - bytes: bytes, - gas: gas, - lt_delta: lt_delta - }; - }; - throw new Error(''); - } -export function storeBlockLimits(blockLimits: BlockLimits): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x5d, 8); - storeParamLimits(blockLimits.bytes)(builder); - storeParamLimits(blockLimits.gas)(builder); - storeParamLimits(blockLimits.lt_delta)(builder); - }); - } -export function loadMsgForwardPrices(slice: Slice): MsgForwardPrices { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xea))) { - slice.loadUint(8); - let lump_price: number = slice.loadUint(64); - let bit_price: number = slice.loadUint(64); - let _cell_price: number = slice.loadUint(64); - let ihr_price_factor: number = slice.loadUint(32); - let first_frac: number = slice.loadUint(16); - let next_frac: number = slice.loadUint(16); - return { - kind: 'MsgForwardPrices', - lump_price: lump_price, - bit_price: bit_price, - _cell_price: _cell_price, - ihr_price_factor: ihr_price_factor, - first_frac: first_frac, - next_frac: next_frac - }; - }; - throw new Error(''); - } -export function storeMsgForwardPrices(msgForwardPrices: MsgForwardPrices): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xea, 8); - builder.storeUint(msgForwardPrices.lump_price, 64); - builder.storeUint(msgForwardPrices.bit_price, 64); - builder.storeUint(msgForwardPrices._cell_price, 64); - builder.storeUint(msgForwardPrices.ihr_price_factor, 32); - builder.storeUint(msgForwardPrices.first_frac, 16); - builder.storeUint(msgForwardPrices.next_frac, 16); - }); - } -export function loadCatchainConfig(slice: Slice): CatchainConfig { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xc1))) { - slice.loadUint(8); - let mc_catchain_lifetime: number = slice.loadUint(32); - let shard_catchain_lifetime: number = slice.loadUint(32); - let shard_validators_lifetime: number = slice.loadUint(32); - let shard_validators_num: number = slice.loadUint(32); - return { - kind: 'CatchainConfig_catchain_config', - mc_catchain_lifetime: mc_catchain_lifetime, - shard_catchain_lifetime: shard_catchain_lifetime, - shard_validators_lifetime: shard_validators_lifetime, - shard_validators_num: shard_validators_num - }; - }; - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xc2))) { - slice.loadUint(8); - let flags: number = slice.loadUint(7); - let shuffle_mc_validators: Bool = loadBool(slice); - let mc_catchain_lifetime: number = slice.loadUint(32); - let shard_catchain_lifetime: number = slice.loadUint(32); - let shard_validators_lifetime: number = slice.loadUint(32); - let shard_validators_num: number = slice.loadUint(32); - if ((!(flags == 0))) { - throw new Error(''); - }; - return { - kind: 'CatchainConfig_catchain_config_new', - flags: flags, - shuffle_mc_validators: shuffle_mc_validators, - mc_catchain_lifetime: mc_catchain_lifetime, - shard_catchain_lifetime: shard_catchain_lifetime, - shard_validators_lifetime: shard_validators_lifetime, - shard_validators_num: shard_validators_num - }; - }; - throw new Error(''); - } -export function storeCatchainConfig(catchainConfig: CatchainConfig): (builder: Builder) => void { - if ((catchainConfig.kind == 'CatchainConfig_catchain_config')) { - return ((builder: Builder) => { - builder.storeUint(0xc1, 8); - builder.storeUint(catchainConfig.mc_catchain_lifetime, 32); - builder.storeUint(catchainConfig.shard_catchain_lifetime, 32); - builder.storeUint(catchainConfig.shard_validators_lifetime, 32); - builder.storeUint(catchainConfig.shard_validators_num, 32); - }); - }; - if ((catchainConfig.kind == 'CatchainConfig_catchain_config_new')) { - return ((builder: Builder) => { - builder.storeUint(0xc2, 8); - builder.storeUint(catchainConfig.flags, 7); - storeBool(catchainConfig.shuffle_mc_validators)(builder); - builder.storeUint(catchainConfig.mc_catchain_lifetime, 32); - builder.storeUint(catchainConfig.shard_catchain_lifetime, 32); - builder.storeUint(catchainConfig.shard_validators_lifetime, 32); - builder.storeUint(catchainConfig.shard_validators_num, 32); - if ((!(catchainConfig.flags == 0))) { - throw new Error(''); - }; - }); - }; - throw new Error(''); - } -export function loadConsensusConfig(slice: Slice): ConsensusConfig { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xd6))) { - slice.loadUint(8); - let round_candidates: number = slice.loadUint(32); - let next_candidate_delay_ms: number = slice.loadUint(32); - let consensus_timeout_ms: number = slice.loadUint(32); - let fast_attempts: number = slice.loadUint(32); - let attempt_duration: number = slice.loadUint(32); - let catchain_max_deps: number = slice.loadUint(32); - let max_block_bytes: number = slice.loadUint(32); - let max_collated_bytes: number = slice.loadUint(32); - if ((!(round_candidates >= 1))) { - throw new Error(''); - }; - return { - kind: 'ConsensusConfig_consensus_config', - round_candidates: round_candidates, - next_candidate_delay_ms: next_candidate_delay_ms, - consensus_timeout_ms: consensus_timeout_ms, - fast_attempts: fast_attempts, - attempt_duration: attempt_duration, - catchain_max_deps: catchain_max_deps, - max_block_bytes: max_block_bytes, - max_collated_bytes: max_collated_bytes - }; - }; - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xd7))) { - slice.loadUint(8); - let flags: number = slice.loadUint(7); - let new_catchain_ids: Bool = loadBool(slice); - let round_candidates: number = slice.loadUint(8); - let next_candidate_delay_ms: number = slice.loadUint(32); - let consensus_timeout_ms: number = slice.loadUint(32); - let fast_attempts: number = slice.loadUint(32); - let attempt_duration: number = slice.loadUint(32); - let catchain_max_deps: number = slice.loadUint(32); - let max_block_bytes: number = slice.loadUint(32); - let max_collated_bytes: number = slice.loadUint(32); - if ((!(flags == 0))) { - throw new Error(''); - }; - if ((!(round_candidates >= 1))) { - throw new Error(''); - }; - return { - kind: 'ConsensusConfig_consensus_config_new', - flags: flags, - new_catchain_ids: new_catchain_ids, - round_candidates: round_candidates, - next_candidate_delay_ms: next_candidate_delay_ms, - consensus_timeout_ms: consensus_timeout_ms, - fast_attempts: fast_attempts, - attempt_duration: attempt_duration, - catchain_max_deps: catchain_max_deps, - max_block_bytes: max_block_bytes, - max_collated_bytes: max_collated_bytes - }; - }; - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xd8))) { - slice.loadUint(8); - let flags: number = slice.loadUint(7); - let new_catchain_ids: Bool = loadBool(slice); - let round_candidates: number = slice.loadUint(8); - let next_candidate_delay_ms: number = slice.loadUint(32); - let consensus_timeout_ms: number = slice.loadUint(32); - let fast_attempts: number = slice.loadUint(32); - let attempt_duration: number = slice.loadUint(32); - let catchain_max_deps: number = slice.loadUint(32); - let max_block_bytes: number = slice.loadUint(32); - let max_collated_bytes: number = slice.loadUint(32); - let proto_version: number = slice.loadUint(16); - if ((!(flags == 0))) { - throw new Error(''); - }; - if ((!(round_candidates >= 1))) { - throw new Error(''); - }; - return { - kind: 'ConsensusConfig_consensus_config_v3', - flags: flags, - new_catchain_ids: new_catchain_ids, - round_candidates: round_candidates, - next_candidate_delay_ms: next_candidate_delay_ms, - consensus_timeout_ms: consensus_timeout_ms, - fast_attempts: fast_attempts, - attempt_duration: attempt_duration, - catchain_max_deps: catchain_max_deps, - max_block_bytes: max_block_bytes, - max_collated_bytes: max_collated_bytes, - proto_version: proto_version - }; - }; - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xd9))) { - slice.loadUint(8); - let flags: number = slice.loadUint(7); - let new_catchain_ids: Bool = loadBool(slice); - let round_candidates: number = slice.loadUint(8); - let next_candidate_delay_ms: number = slice.loadUint(32); - let consensus_timeout_ms: number = slice.loadUint(32); - let fast_attempts: number = slice.loadUint(32); - let attempt_duration: number = slice.loadUint(32); - let catchain_max_deps: number = slice.loadUint(32); - let max_block_bytes: number = slice.loadUint(32); - let max_collated_bytes: number = slice.loadUint(32); - let proto_version: number = slice.loadUint(16); - let catchain_max_blocks_coeff: number = slice.loadUint(32); - if ((!(flags == 0))) { - throw new Error(''); - }; - if ((!(round_candidates >= 1))) { - throw new Error(''); - }; - return { - kind: 'ConsensusConfig_consensus_config_v4', - flags: flags, - new_catchain_ids: new_catchain_ids, - round_candidates: round_candidates, - next_candidate_delay_ms: next_candidate_delay_ms, - consensus_timeout_ms: consensus_timeout_ms, - fast_attempts: fast_attempts, - attempt_duration: attempt_duration, - catchain_max_deps: catchain_max_deps, - max_block_bytes: max_block_bytes, - max_collated_bytes: max_collated_bytes, - proto_version: proto_version, - catchain_max_blocks_coeff: catchain_max_blocks_coeff - }; - }; - throw new Error(''); - } -export function storeConsensusConfig(consensusConfig: ConsensusConfig): (builder: Builder) => void { - if ((consensusConfig.kind == 'ConsensusConfig_consensus_config')) { - return ((builder: Builder) => { - builder.storeUint(0xd6, 8); - builder.storeUint(consensusConfig.round_candidates, 32); - builder.storeUint(consensusConfig.next_candidate_delay_ms, 32); - builder.storeUint(consensusConfig.consensus_timeout_ms, 32); - builder.storeUint(consensusConfig.fast_attempts, 32); - builder.storeUint(consensusConfig.attempt_duration, 32); - builder.storeUint(consensusConfig.catchain_max_deps, 32); - builder.storeUint(consensusConfig.max_block_bytes, 32); - builder.storeUint(consensusConfig.max_collated_bytes, 32); - if ((!(consensusConfig.round_candidates >= 1))) { - throw new Error(''); - }; - }); - }; - if ((consensusConfig.kind == 'ConsensusConfig_consensus_config_new')) { - return ((builder: Builder) => { - builder.storeUint(0xd7, 8); - builder.storeUint(consensusConfig.flags, 7); - storeBool(consensusConfig.new_catchain_ids)(builder); - builder.storeUint(consensusConfig.round_candidates, 8); - builder.storeUint(consensusConfig.next_candidate_delay_ms, 32); - builder.storeUint(consensusConfig.consensus_timeout_ms, 32); - builder.storeUint(consensusConfig.fast_attempts, 32); - builder.storeUint(consensusConfig.attempt_duration, 32); - builder.storeUint(consensusConfig.catchain_max_deps, 32); - builder.storeUint(consensusConfig.max_block_bytes, 32); - builder.storeUint(consensusConfig.max_collated_bytes, 32); - if ((!(consensusConfig.flags == 0))) { - throw new Error(''); - }; - if ((!(consensusConfig.round_candidates >= 1))) { - throw new Error(''); - }; - }); - }; - if ((consensusConfig.kind == 'ConsensusConfig_consensus_config_v3')) { - return ((builder: Builder) => { - builder.storeUint(0xd8, 8); - builder.storeUint(consensusConfig.flags, 7); - storeBool(consensusConfig.new_catchain_ids)(builder); - builder.storeUint(consensusConfig.round_candidates, 8); - builder.storeUint(consensusConfig.next_candidate_delay_ms, 32); - builder.storeUint(consensusConfig.consensus_timeout_ms, 32); - builder.storeUint(consensusConfig.fast_attempts, 32); - builder.storeUint(consensusConfig.attempt_duration, 32); - builder.storeUint(consensusConfig.catchain_max_deps, 32); - builder.storeUint(consensusConfig.max_block_bytes, 32); - builder.storeUint(consensusConfig.max_collated_bytes, 32); - builder.storeUint(consensusConfig.proto_version, 16); - if ((!(consensusConfig.flags == 0))) { - throw new Error(''); - }; - if ((!(consensusConfig.round_candidates >= 1))) { - throw new Error(''); - }; - }); - }; - if ((consensusConfig.kind == 'ConsensusConfig_consensus_config_v4')) { - return ((builder: Builder) => { - builder.storeUint(0xd9, 8); - builder.storeUint(consensusConfig.flags, 7); - storeBool(consensusConfig.new_catchain_ids)(builder); - builder.storeUint(consensusConfig.round_candidates, 8); - builder.storeUint(consensusConfig.next_candidate_delay_ms, 32); - builder.storeUint(consensusConfig.consensus_timeout_ms, 32); - builder.storeUint(consensusConfig.fast_attempts, 32); - builder.storeUint(consensusConfig.attempt_duration, 32); - builder.storeUint(consensusConfig.catchain_max_deps, 32); - builder.storeUint(consensusConfig.max_block_bytes, 32); - builder.storeUint(consensusConfig.max_collated_bytes, 32); - builder.storeUint(consensusConfig.proto_version, 16); - builder.storeUint(consensusConfig.catchain_max_blocks_coeff, 32); - if ((!(consensusConfig.flags == 0))) { - throw new Error(''); - }; - if ((!(consensusConfig.round_candidates >= 1))) { - throw new Error(''); - }; - }); - }; - throw new Error(''); - } -export function loadValidatorTempKey(slice: Slice): ValidatorTempKey { - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0x3))) { - slice.loadUint(4); - let adnl_addr: BitString = slice.loadBits(256); - let temp_public_key: SigPubKey = loadSigPubKey(slice); - let seqno: number = slice.loadUint(32); - let valid_until: number = slice.loadUint(32); - return { - kind: 'ValidatorTempKey', - adnl_addr: adnl_addr, - temp_public_key: temp_public_key, - seqno: seqno, - valid_until: valid_until - }; - }; - throw new Error(''); - } -export function storeValidatorTempKey(validatorTempKey: ValidatorTempKey): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x3, 4); - builder.storeBits(validatorTempKey.adnl_addr); - storeSigPubKey(validatorTempKey.temp_public_key)(builder); - builder.storeUint(validatorTempKey.seqno, 32); - builder.storeUint(validatorTempKey.valid_until, 32); - }); - } -export function loadValidatorSignedTempKey(slice: Slice): ValidatorSignedTempKey { - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0x4))) { - slice.loadUint(4); - let slice1 = slice.loadRef().beginParse(); - let key: ValidatorTempKey = loadValidatorTempKey(slice1); - let signature: CryptoSignature = loadCryptoSignature(slice); - return { - kind: 'ValidatorSignedTempKey', - key: key, - signature: signature - }; - }; - throw new Error(''); - } -export function storeValidatorSignedTempKey(validatorSignedTempKey: ValidatorSignedTempKey): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x4, 4); - let cell1 = beginCell(); - storeValidatorTempKey(validatorSignedTempKey.key)(cell1); - builder.storeRef(cell1); - storeCryptoSignature(validatorSignedTempKey.signature)(builder); - }); - } -export function loadMisbehaviourPunishmentConfig(slice: Slice): MisbehaviourPunishmentConfig { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x01))) { - slice.loadUint(8); - let default_flat_fine: Grams = loadGrams(slice); - let default_proportional_fine: number = slice.loadUint(32); - let severity_flat_mult: number = slice.loadUint(16); - let severity_proportional_mult: number = slice.loadUint(16); - let unpunishable_interval: number = slice.loadUint(16); - let long_interval: number = slice.loadUint(16); - let long_flat_mult: number = slice.loadUint(16); - let long_proportional_mult: number = slice.loadUint(16); - let medium_interval: number = slice.loadUint(16); - let medium_flat_mult: number = slice.loadUint(16); - let medium_proportional_mult: number = slice.loadUint(16); - return { - kind: 'MisbehaviourPunishmentConfig', - default_flat_fine: default_flat_fine, - default_proportional_fine: default_proportional_fine, - severity_flat_mult: severity_flat_mult, - severity_proportional_mult: severity_proportional_mult, - unpunishable_interval: unpunishable_interval, - long_interval: long_interval, - long_flat_mult: long_flat_mult, - long_proportional_mult: long_proportional_mult, - medium_interval: medium_interval, - medium_flat_mult: medium_flat_mult, - medium_proportional_mult: medium_proportional_mult - }; - }; - throw new Error(''); - } -export function storeMisbehaviourPunishmentConfig(misbehaviourPunishmentConfig: MisbehaviourPunishmentConfig): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x01, 8); - storeGrams(misbehaviourPunishmentConfig.default_flat_fine)(builder); - builder.storeUint(misbehaviourPunishmentConfig.default_proportional_fine, 32); - builder.storeUint(misbehaviourPunishmentConfig.severity_flat_mult, 16); - builder.storeUint(misbehaviourPunishmentConfig.severity_proportional_mult, 16); - builder.storeUint(misbehaviourPunishmentConfig.unpunishable_interval, 16); - builder.storeUint(misbehaviourPunishmentConfig.long_interval, 16); - builder.storeUint(misbehaviourPunishmentConfig.long_flat_mult, 16); - builder.storeUint(misbehaviourPunishmentConfig.long_proportional_mult, 16); - builder.storeUint(misbehaviourPunishmentConfig.medium_interval, 16); - builder.storeUint(misbehaviourPunishmentConfig.medium_flat_mult, 16); - builder.storeUint(misbehaviourPunishmentConfig.medium_proportional_mult, 16); - }); - } -export function loadOracleBridgeParams(slice: Slice): OracleBridgeParams { - let bridge_address: BitString = slice.loadBits(256); - let oracle_mutlisig_address: BitString = slice.loadBits(256); - let oracles: HashmapE = loadHashmapE(slice, 256, ((slice: Slice) => { - return slice.loadUint(256); - })); - let external_chain_address: BitString = slice.loadBits(256); - return { - kind: 'OracleBridgeParams', - bridge_address: bridge_address, - oracle_mutlisig_address: oracle_mutlisig_address, - oracles: oracles, - external_chain_address: external_chain_address - }; - } -export function storeOracleBridgeParams(oracleBridgeParams: OracleBridgeParams): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeBits(oracleBridgeParams.bridge_address); - builder.storeBits(oracleBridgeParams.oracle_mutlisig_address); - storeHashmapE(oracleBridgeParams.oracles, ((arg: number) => { - return ((builder: Builder) => { - builder.storeUint(arg, 256); - }); - }))(builder); - builder.storeBits(oracleBridgeParams.external_chain_address); - }); - } -export function loadBlockSignaturesPure(slice: Slice): BlockSignaturesPure { - let sig_count: number = slice.loadUint(32); - let sig_weight: number = slice.loadUint(64); - let signatures: HashmapE = loadHashmapE(slice, 16, loadCryptoSignaturePair); - return { - kind: 'BlockSignaturesPure', - sig_count: sig_count, - sig_weight: sig_weight, - signatures: signatures - }; - } -export function storeBlockSignaturesPure(blockSignaturesPure: BlockSignaturesPure): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(blockSignaturesPure.sig_count, 32); - builder.storeUint(blockSignaturesPure.sig_weight, 64); - storeHashmapE(blockSignaturesPure.signatures, storeCryptoSignaturePair)(builder); - }); - } -export function loadBlockSignatures(slice: Slice): BlockSignatures { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x11))) { - slice.loadUint(8); - let validator_info: ValidatorBaseInfo = loadValidatorBaseInfo(slice); - let pure_signatures: BlockSignaturesPure = loadBlockSignaturesPure(slice); - return { - kind: 'BlockSignatures', - validator_info: validator_info, - pure_signatures: pure_signatures - }; - }; - throw new Error(''); - } -export function storeBlockSignatures(blockSignatures: BlockSignatures): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x11, 8); - storeValidatorBaseInfo(blockSignatures.validator_info)(builder); - storeBlockSignaturesPure(blockSignatures.pure_signatures)(builder); - }); - } -export function loadBlockProof(slice: Slice): BlockProof { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xc3))) { - slice.loadUint(8); - let proof_for: BlockIdExt = loadBlockIdExt(slice); - let slice1 = slice.loadRef().beginParse(); - let root: Slice = slice1; - let signatures: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadBlockSignatures(slice1); - })); - return { - kind: 'BlockProof', - proof_for: proof_for, - root: root, - signatures: signatures - }; - }; - throw new Error(''); - } -export function storeBlockProof(blockProof: BlockProof): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xc3, 8); - storeBlockIdExt(blockProof.proof_for)(builder); - let cell1 = beginCell(); - cell1.storeSlice(blockProof.root); - builder.storeRef(cell1); - storeMaybe(blockProof.signatures, ((arg: BlockSignatures) => { - return ((builder: Builder) => { - let cell1 = beginCell() - storeBlockSignatures(arg)(cell1) - builder.storeRef(cell1); - }); - }))(builder); - }); - } -export function loadProofChain(slice: Slice, arg0: number): ProofChain { - if ((arg0 == 0)) { - return { - kind: 'ProofChain_chain_empty' - }; - }; - if (true) { - let slice1 = slice.loadRef().beginParse(); - let root: Slice = slice1; - let prev: ProofChain | undefined = ((arg0 - 1) ? ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadProofChain(slice1, (arg0 - 1)); - })(slice) : undefined); - return { - kind: 'ProofChain_chain_link', - n: (arg0 - 1), - root: root, - prev: prev - }; - }; - throw new Error(''); - } -export function storeProofChain(proofChain: ProofChain): (builder: Builder) => void { - if ((proofChain.kind == 'ProofChain_chain_empty')) { - return ((builder: Builder) => { - - }); - }; - if ((proofChain.kind == 'ProofChain_chain_link')) { - return ((builder: Builder) => { - let cell1 = beginCell(); - cell1.storeSlice(proofChain.root); - builder.storeRef(cell1); - if ((proofChain.prev != undefined)) { - let cell1 = beginCell() - storeProofChain(proofChain.prev)(cell1) - builder.storeRef(cell1); - }; - }); - }; - throw new Error(''); - } -export function loadTopBlockDescr(slice: Slice): TopBlockDescr { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xd5))) { - slice.loadUint(8); - let proof_for: BlockIdExt = loadBlockIdExt(slice); - let signatures: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadBlockSignatures(slice1); - })); - let len: number = slice.loadUint(8); - let chain: ProofChain = loadProofChain(slice, len); - if ((!(len >= 1))) { - throw new Error(''); - }; - if ((!(len <= 8))) { - throw new Error(''); - }; - return { - kind: 'TopBlockDescr', - proof_for: proof_for, - signatures: signatures, - len: len, - chain: chain - }; - }; - throw new Error(''); - } -export function storeTopBlockDescr(topBlockDescr: TopBlockDescr): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xd5, 8); - storeBlockIdExt(topBlockDescr.proof_for)(builder); - storeMaybe(topBlockDescr.signatures, ((arg: BlockSignatures) => { - return ((builder: Builder) => { - let cell1 = beginCell() - storeBlockSignatures(arg)(cell1) - builder.storeRef(cell1); - }); - }))(builder); - builder.storeUint(topBlockDescr.len, 8); - storeProofChain(topBlockDescr.chain)(builder); - if ((!(topBlockDescr.len >= 1))) { - throw new Error(''); - }; - if ((!(topBlockDescr.len <= 8))) { - throw new Error(''); - }; - }); - } -export function loadTopBlockDescrSet(slice: Slice): TopBlockDescrSet { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x4ac789f3))) { - slice.loadUint(32); - let collection: HashmapE = loadHashmapE(slice, 96, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadTopBlockDescr(slice1); - })); - return { - kind: 'TopBlockDescrSet', - collection: collection - }; - }; - throw new Error(''); - } -export function storeTopBlockDescrSet(topBlockDescrSet: TopBlockDescrSet): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x4ac789f3, 32); - storeHashmapE(topBlockDescrSet.collection, ((arg: TopBlockDescr) => { - return ((builder: Builder) => { - let cell1 = beginCell() - storeTopBlockDescr(arg)(cell1) - builder.storeRef(cell1); - }); - }))(builder); - }); - } -export function loadProducerInfo(slice: Slice): ProducerInfo { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x34))) { - slice.loadUint(8); - let utime: number = slice.loadUint(32); - let mc_blk_ref: ExtBlkRef = loadExtBlkRef(slice); - let slice1 = slice.loadRef().beginParse(); - let state_proof: MERKLE_PROOF = loadMERKLE_PROOF(slice1, loadBlock); - let slice2 = slice.loadRef().beginParse(); - let prod_proof: MERKLE_PROOF = loadMERKLE_PROOF(slice2, loadShardState); - return { - kind: 'ProducerInfo', - utime: utime, - mc_blk_ref: mc_blk_ref, - state_proof: state_proof, - prod_proof: prod_proof - }; - }; - throw new Error(''); - } -export function storeProducerInfo(producerInfo: ProducerInfo): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x34, 8); - builder.storeUint(producerInfo.utime, 32); - storeExtBlkRef(producerInfo.mc_blk_ref)(builder); - let cell1 = beginCell(); - storeMERKLE_PROOF(producerInfo.state_proof, storeBlock)(cell1); - builder.storeRef(cell1); - let cell2 = beginCell(); - storeMERKLE_PROOF(producerInfo.prod_proof, storeShardState)(cell2); - builder.storeRef(cell2); - }); - } -export function loadComplaintDescr(slice: Slice): ComplaintDescr { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x9c436252))) { - slice.loadUint(32); - let from_utime: number = slice.loadUint(32); - let slice1 = slice.loadRef().beginParse(); - let prod_info: ProducerInfo = loadProducerInfo(slice1); - return { - kind: 'ComplaintDescr_no_blk_gen', - from_utime: from_utime, - prod_info: prod_info - }; - }; - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x987f1ab7))) { - slice.loadUint(32); - let slice1 = slice.loadRef().beginParse(); - let prod_info_old: ProducerInfo = loadProducerInfo(slice1); - let slice2 = slice.loadRef().beginParse(); - let prod_info_new: ProducerInfo = loadProducerInfo(slice2); - return { - kind: 'ComplaintDescr_no_blk_gen_diff', - prod_info_old: prod_info_old, - prod_info_new: prod_info_new - }; - }; - throw new Error(''); - } -export function storeComplaintDescr(complaintDescr: ComplaintDescr): (builder: Builder) => void { - if ((complaintDescr.kind == 'ComplaintDescr_no_blk_gen')) { - return ((builder: Builder) => { - builder.storeUint(0x9c436252, 32); - builder.storeUint(complaintDescr.from_utime, 32); - let cell1 = beginCell(); - storeProducerInfo(complaintDescr.prod_info)(cell1); - builder.storeRef(cell1); - }); - }; - if ((complaintDescr.kind == 'ComplaintDescr_no_blk_gen_diff')) { - return ((builder: Builder) => { - builder.storeUint(0x987f1ab7, 32); - let cell1 = beginCell(); - storeProducerInfo(complaintDescr.prod_info_old)(cell1); - builder.storeRef(cell1); - let cell2 = beginCell(); - storeProducerInfo(complaintDescr.prod_info_new)(cell2); - builder.storeRef(cell2); - }); - }; - throw new Error(''); - } -export function loadValidatorComplaint(slice: Slice): ValidatorComplaint { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xbc))) { - slice.loadUint(8); - let validator_pubkey: BitString = slice.loadBits(256); - let slice1 = slice.loadRef().beginParse(); - let description: ComplaintDescr = loadComplaintDescr(slice1); - let created_at: number = slice.loadUint(32); - let severity: number = slice.loadUint(8); - let reward_addr: number = slice.loadUint(256); - let paid: Grams = loadGrams(slice); - let suggested_fine: Grams = loadGrams(slice); - let suggested_fine_part: number = slice.loadUint(32); - return { - kind: 'ValidatorComplaint', - validator_pubkey: validator_pubkey, - description: description, - created_at: created_at, - severity: severity, - reward_addr: reward_addr, - paid: paid, - suggested_fine: suggested_fine, - suggested_fine_part: suggested_fine_part - }; - }; - throw new Error(''); - } -export function storeValidatorComplaint(validatorComplaint: ValidatorComplaint): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xbc, 8); - builder.storeBits(validatorComplaint.validator_pubkey); - let cell1 = beginCell(); - storeComplaintDescr(validatorComplaint.description)(cell1); - builder.storeRef(cell1); - builder.storeUint(validatorComplaint.created_at, 32); - builder.storeUint(validatorComplaint.severity, 8); - builder.storeUint(validatorComplaint.reward_addr, 256); - storeGrams(validatorComplaint.paid)(builder); - storeGrams(validatorComplaint.suggested_fine)(builder); - builder.storeUint(validatorComplaint.suggested_fine_part, 32); - }); - } -export function loadValidatorComplaintStatus(slice: Slice): ValidatorComplaintStatus { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x2d))) { - slice.loadUint(8); - let slice1 = slice.loadRef().beginParse(); - let complaint: ValidatorComplaint = loadValidatorComplaint(slice1); - let voters: HashmapE = loadHashmapE(slice, 16, loadTrue); - let vset_id: number = slice.loadUint(256); - let weight_remaining: number = slice.loadInt(64); - return { - kind: 'ValidatorComplaintStatus', - complaint: complaint, - voters: voters, - vset_id: vset_id, - weight_remaining: weight_remaining - }; - }; - throw new Error(''); - } -export function storeValidatorComplaintStatus(validatorComplaintStatus: ValidatorComplaintStatus): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x2d, 8); - let cell1 = beginCell(); - storeValidatorComplaint(validatorComplaintStatus.complaint)(cell1); - builder.storeRef(cell1); - storeHashmapE(validatorComplaintStatus.voters, storeTrue)(builder); - builder.storeUint(validatorComplaintStatus.vset_id, 256); - builder.storeInt(validatorComplaintStatus.weight_remaining, 64); - }); - } -export function loadVmStackValue(slice: Slice): VmStackValue { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x00))) { - slice.loadUint(8); - return { - kind: 'VmStackValue_vm_stk_null' - }; - }; - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x01))) { - slice.loadUint(8); - let value: number = slice.loadInt(64); - return { - kind: 'VmStackValue_vm_stk_tinyint', - value: value - }; - }; - if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x0201))) { - slice.loadUint(16); - let value: number = slice.loadInt(257); - return { - kind: 'VmStackValue_vm_stk_int', - value: value - }; - }; - if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x02ff))) { - slice.loadUint(16); - return { - kind: 'VmStackValue_vm_stk_nan' - }; - }; - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x03))) { - slice.loadUint(8); - let slice1 = slice.loadRef().beginParse(); - let _cell: Slice = slice1; - return { - kind: 'VmStackValue_vm_stk_cell', - _cell: _cell - }; - }; - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x04))) { - slice.loadUint(8); - let _: VmCellSlice = loadVmCellSlice(slice); - return { - kind: 'VmStackValue_vm_stk_slice', - _: _ - }; - }; - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x05))) { - slice.loadUint(8); - let slice1 = slice.loadRef().beginParse(); - let _cell: Slice = slice1; - return { - kind: 'VmStackValue_vm_stk_builder', - _cell: _cell - }; - }; - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x06))) { - slice.loadUint(8); - let cont: VmCont = loadVmCont(slice); - return { - kind: 'VmStackValue_vm_stk_cont', - cont: cont - }; - }; - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x07))) { - slice.loadUint(8); - let len: number = slice.loadUint(16); - let data: VmTuple = loadVmTuple(slice, len); - return { - kind: 'VmStackValue_vm_stk_tuple', - len: len, - data: data - }; - }; - throw new Error(''); - } -export function storeVmStackValue(vmStackValue: VmStackValue): (builder: Builder) => void { - if ((vmStackValue.kind == 'VmStackValue_vm_stk_null')) { - return ((builder: Builder) => { - builder.storeUint(0x00, 8); - }); - }; - if ((vmStackValue.kind == 'VmStackValue_vm_stk_tinyint')) { - return ((builder: Builder) => { - builder.storeUint(0x01, 8); - builder.storeInt(vmStackValue.value, 64); - }); - }; - if ((vmStackValue.kind == 'VmStackValue_vm_stk_int')) { - return ((builder: Builder) => { - builder.storeUint(0x0201, 16); - builder.storeInt(vmStackValue.value, 257); - }); - }; - if ((vmStackValue.kind == 'VmStackValue_vm_stk_nan')) { - return ((builder: Builder) => { - builder.storeUint(0x02ff, 16); - }); - }; - if ((vmStackValue.kind == 'VmStackValue_vm_stk_cell')) { - return ((builder: Builder) => { - builder.storeUint(0x03, 8); - let cell1 = beginCell(); - cell1.storeSlice(vmStackValue._cell); - builder.storeRef(cell1); - }); - }; - if ((vmStackValue.kind == 'VmStackValue_vm_stk_slice')) { - return ((builder: Builder) => { - builder.storeUint(0x04, 8); - storeVmCellSlice(vmStackValue._)(builder); - }); - }; - if ((vmStackValue.kind == 'VmStackValue_vm_stk_builder')) { - return ((builder: Builder) => { - builder.storeUint(0x05, 8); - let cell1 = beginCell(); - cell1.storeSlice(vmStackValue._cell); - builder.storeRef(cell1); - }); - }; - if ((vmStackValue.kind == 'VmStackValue_vm_stk_cont')) { - return ((builder: Builder) => { - builder.storeUint(0x06, 8); - storeVmCont(vmStackValue.cont)(builder); - }); - }; - if ((vmStackValue.kind == 'VmStackValue_vm_stk_tuple')) { - return ((builder: Builder) => { - builder.storeUint(0x07, 8); - builder.storeUint(vmStackValue.len, 16); - storeVmTuple(vmStackValue.data)(builder); - }); - }; - throw new Error(''); - } -export function loadVmCellSlice(slice: Slice): VmCellSlice { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xd6a63245))) { - slice.loadUint(32); - let slice1 = slice.loadRef().beginParse(); - let _cell: Slice = slice1; - let st_bits: number = slice.loadUint(10); - let end_bits: number = slice.loadUint(10); - let st_ref: number = slice.loadUint(bitLen(4)); - let end_ref: number = slice.loadUint(bitLen(4)); - if ((!(st_bits <= end_bits))) { - throw new Error(''); - }; - if ((!(st_ref <= end_ref))) { - throw new Error(''); - }; - return { - kind: 'VmCellSlice', - _cell: _cell, - st_bits: st_bits, - end_bits: end_bits, - st_ref: st_ref, - end_ref: end_ref - }; - }; - throw new Error(''); - } -export function storeVmCellSlice(vmCellSlice: VmCellSlice): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xd6a63245, 32); - let cell1 = beginCell(); - cell1.storeSlice(vmCellSlice._cell); - builder.storeRef(cell1); - builder.storeUint(vmCellSlice.st_bits, 10); - builder.storeUint(vmCellSlice.end_bits, 10); - builder.storeUint(vmCellSlice.st_ref, bitLen(4)); - builder.storeUint(vmCellSlice.end_ref, bitLen(4)); - if ((!(vmCellSlice.st_bits <= vmCellSlice.end_bits))) { - throw new Error(''); - }; - if ((!(vmCellSlice.st_ref <= vmCellSlice.end_ref))) { - throw new Error(''); - }; - }); - } -export function loadVmTupleRef(slice: Slice, arg0: number): VmTupleRef { - if ((arg0 == 0)) { - return { - kind: 'VmTupleRef_vm_tupref_nil' - }; - }; - if ((arg0 == 1)) { - let slice1 = slice.loadRef().beginParse(); - let entry: VmStackValue = loadVmStackValue(slice1); - return { - kind: 'VmTupleRef_vm_tupref_single', - entry: entry - }; - }; - if (true) { - let slice1 = slice.loadRef().beginParse(); - let ref: VmTuple = loadVmTuple(slice1, ((arg0 - 2) + 2)); - return { - kind: 'VmTupleRef_vm_tupref_any', - n: (arg0 - 2), - ref: ref - }; - }; - throw new Error(''); - } -export function storeVmTupleRef(vmTupleRef: VmTupleRef): (builder: Builder) => void { - if ((vmTupleRef.kind == 'VmTupleRef_vm_tupref_nil')) { - return ((builder: Builder) => { - - }); - }; - if ((vmTupleRef.kind == 'VmTupleRef_vm_tupref_single')) { - return ((builder: Builder) => { - let cell1 = beginCell(); - storeVmStackValue(vmTupleRef.entry)(cell1); - builder.storeRef(cell1); - }); - }; - if ((vmTupleRef.kind == 'VmTupleRef_vm_tupref_any')) { - return ((builder: Builder) => { - let cell1 = beginCell(); - storeVmTuple(vmTupleRef.ref)(cell1); - builder.storeRef(cell1); - }); - }; - throw new Error(''); - } -export function loadVmTuple(slice: Slice, arg0: number): VmTuple { - if ((arg0 == 0)) { - return { - kind: 'VmTuple_vm_tuple_nil' - }; - }; - if (true) { - let head: VmTupleRef = loadVmTupleRef(slice, (arg0 - 1)); - let slice1 = slice.loadRef().beginParse(); - let tail: VmStackValue = loadVmStackValue(slice1); - return { - kind: 'VmTuple_vm_tuple_tcons', - n: (arg0 - 1), - head: head, - tail: tail - }; - }; - throw new Error(''); - } -export function storeVmTuple(vmTuple: VmTuple): (builder: Builder) => void { - if ((vmTuple.kind == 'VmTuple_vm_tuple_nil')) { - return ((builder: Builder) => { - - }); - }; - if ((vmTuple.kind == 'VmTuple_vm_tuple_tcons')) { - return ((builder: Builder) => { - storeVmTupleRef(vmTuple.head)(builder); - let cell1 = beginCell(); - storeVmStackValue(vmTuple.tail)(cell1); - builder.storeRef(cell1); - }); - }; - throw new Error(''); - } -export function loadVmStack(slice: Slice): VmStack { - let depth: number = slice.loadUint(24); - let stack: VmStackList = loadVmStackList(slice, depth); - return { - kind: 'VmStack', - depth: depth, - stack: stack - }; - } -export function storeVmStack(vmStack: VmStack): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(vmStack.depth, 24); - storeVmStackList(vmStack.stack)(builder); - }); - } -export function loadVmStackList(slice: Slice, arg0: number): VmStackList { - if ((arg0 == 0)) { - return { - kind: 'VmStackList_vm_stk_nil' - }; - }; - if (true) { - let slice1 = slice.loadRef().beginParse(); - let rest: VmStackList = loadVmStackList(slice1, (arg0 - 1)); - let tos: VmStackValue = loadVmStackValue(slice); - return { - kind: 'VmStackList_vm_stk_cons', - n: (arg0 - 1), - rest: rest, - tos: tos - }; - }; - throw new Error(''); - } -export function storeVmStackList(vmStackList: VmStackList): (builder: Builder) => void { - if ((vmStackList.kind == 'VmStackList_vm_stk_nil')) { - return ((builder: Builder) => { - - }); - }; - if ((vmStackList.kind == 'VmStackList_vm_stk_cons')) { - return ((builder: Builder) => { - let cell1 = beginCell(); - storeVmStackList(vmStackList.rest)(cell1); - builder.storeRef(cell1); - storeVmStackValue(vmStackList.tos)(builder); - }); - }; - throw new Error(''); - } -export function loadVmSaveList(slice: Slice): VmSaveList { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xeed28f11))) { - slice.loadUint(32); - let cregs: HashmapE = loadHashmapE(slice, 4, loadVmStackValue); - return { - kind: 'VmSaveList', - cregs: cregs - }; - }; - throw new Error(''); - } -export function storeVmSaveList(vmSaveList: VmSaveList): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xeed28f11, 32); - storeHashmapE(vmSaveList.cregs, storeVmStackValue)(builder); - }); - } -export function loadVmGasLimits(slice: Slice): VmGasLimits { - let remaining: number = slice.loadInt(64); - let slice1 = slice.loadRef().beginParse(); - let max_limit: number = slice1.loadInt(64); - let cur_limit: number = slice1.loadInt(64); - let credit: number = slice1.loadInt(64); - return { - kind: 'VmGasLimits', - remaining: remaining, - max_limit: max_limit, - cur_limit: cur_limit, - credit: credit - }; - } -export function storeVmGasLimits(vmGasLimits: VmGasLimits): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeInt(vmGasLimits.remaining, 64); - let cell1 = beginCell(); - cell1.storeInt(vmGasLimits.max_limit, 64); - cell1.storeInt(vmGasLimits.cur_limit, 64); - cell1.storeInt(vmGasLimits.credit, 64); - builder.storeRef(cell1); - }); - } -export function loadVmLibraries(slice: Slice): VmLibraries { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xe9be85ef))) { - slice.loadUint(32); - let libraries: HashmapE = loadHashmapE(slice, 256, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return slice1; - })); - return { - kind: 'VmLibraries', - libraries: libraries - }; - }; - throw new Error(''); - } -export function storeVmLibraries(vmLibraries: VmLibraries): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xe9be85ef, 32); - storeHashmapE(vmLibraries.libraries, ((arg: Slice) => { - return ((builder: Builder) => { - let cell1 = beginCell() - cell1.storeSlice(arg) - builder.storeRef(cell1); - }); - }))(builder); - }); - } -export function loadVmControlData(slice: Slice): VmControlData { - let nargs: Maybe = loadMaybe(slice, ((slice: Slice) => { - return slice.loadUint(13); - })); - let stack: Maybe = loadMaybe(slice, loadVmStack); - let save: VmSaveList = loadVmSaveList(slice); - let cp: Maybe = loadMaybe(slice, ((slice: Slice) => { - return slice.loadInt(16); - })); - return { - kind: 'VmControlData', - nargs: nargs, - stack: stack, - save: save, - cp: cp - }; - } -export function storeVmControlData(vmControlData: VmControlData): (builder: Builder) => void { - return ((builder: Builder) => { - storeMaybe(vmControlData.nargs, ((arg: number) => { - return ((builder: Builder) => { - builder.storeUint(arg, 13); - }); - }))(builder); - storeMaybe(vmControlData.stack, storeVmStack)(builder); - storeVmSaveList(vmControlData.save)(builder); - storeMaybe(vmControlData.cp, ((arg: number) => { - return ((builder: Builder) => { - builder.storeInt(arg, 16); - }); - }))(builder); - }); - } -export function loadVmCont(slice: Slice): VmCont { - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { - slice.loadUint(2); - let cdata: VmControlData = loadVmControlData(slice); - let code: VmCellSlice = loadVmCellSlice(slice); - return { - kind: 'VmCont_vmc_std', - cdata: cdata, - code: code - }; - }; - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b01))) { - slice.loadUint(2); - let cdata: VmControlData = loadVmControlData(slice); - let slice1 = slice.loadRef().beginParse(); - let next: VmCont = loadVmCont(slice1); - return { - kind: 'VmCont_vmc_envelope', - cdata: cdata, - next: next - }; - }; - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b1000))) { - slice.loadUint(4); - let exit_code: number = slice.loadInt(32); - return { - kind: 'VmCont_vmc_quit', - exit_code: exit_code - }; - }; - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b1001))) { - slice.loadUint(4); - return { - kind: 'VmCont_vmc_quit_exc' - }; - }; - if (((slice.remainingBits >= 5) && (slice.preloadUint(5) == 0b10100))) { - slice.loadUint(5); - let count: number = slice.loadUint(63); - let slice1 = slice.loadRef().beginParse(); - let body: VmCont = loadVmCont(slice1); - let slice2 = slice.loadRef().beginParse(); - let after: VmCont = loadVmCont(slice2); - return { - kind: 'VmCont_vmc_repeat', - count: count, - body: body, - after: after - }; - }; - if (((slice.remainingBits >= 6) && (slice.preloadUint(6) == 0b110000))) { - slice.loadUint(6); - let slice1 = slice.loadRef().beginParse(); - let body: VmCont = loadVmCont(slice1); - let slice2 = slice.loadRef().beginParse(); - let after: VmCont = loadVmCont(slice2); - return { - kind: 'VmCont_vmc_until', - body: body, - after: after - }; - }; - if (((slice.remainingBits >= 6) && (slice.preloadUint(6) == 0b110001))) { - slice.loadUint(6); - let slice1 = slice.loadRef().beginParse(); - let body: VmCont = loadVmCont(slice1); - return { - kind: 'VmCont_vmc_again', - body: body - }; - }; - if (((slice.remainingBits >= 6) && (slice.preloadUint(6) == 0b110010))) { - slice.loadUint(6); - let slice1 = slice.loadRef().beginParse(); - let cond: VmCont = loadVmCont(slice1); - let slice2 = slice.loadRef().beginParse(); - let body: VmCont = loadVmCont(slice2); - let slice3 = slice.loadRef().beginParse(); - let after: VmCont = loadVmCont(slice3); - return { - kind: 'VmCont_vmc_while_cond', - cond: cond, - body: body, - after: after - }; - }; - if (((slice.remainingBits >= 6) && (slice.preloadUint(6) == 0b110011))) { - slice.loadUint(6); - let slice1 = slice.loadRef().beginParse(); - let cond: VmCont = loadVmCont(slice1); - let slice2 = slice.loadRef().beginParse(); - let body: VmCont = loadVmCont(slice2); - let slice3 = slice.loadRef().beginParse(); - let after: VmCont = loadVmCont(slice3); - return { - kind: 'VmCont_vmc_while_body', - cond: cond, - body: body, - after: after - }; - }; - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b1111))) { - slice.loadUint(4); - let value: number = slice.loadInt(32); - let slice1 = slice.loadRef().beginParse(); - let next: VmCont = loadVmCont(slice1); - return { - kind: 'VmCont_vmc_pushint', - value: value, - next: next - }; - }; - throw new Error(''); - } -export function storeVmCont(vmCont: VmCont): (builder: Builder) => void { - if ((vmCont.kind == 'VmCont_vmc_std')) { - return ((builder: Builder) => { - builder.storeUint(0b00, 2); - storeVmControlData(vmCont.cdata)(builder); - storeVmCellSlice(vmCont.code)(builder); - }); - }; - if ((vmCont.kind == 'VmCont_vmc_envelope')) { - return ((builder: Builder) => { - builder.storeUint(0b01, 2); - storeVmControlData(vmCont.cdata)(builder); - let cell1 = beginCell(); - storeVmCont(vmCont.next)(cell1); - builder.storeRef(cell1); - }); - }; - if ((vmCont.kind == 'VmCont_vmc_quit')) { - return ((builder: Builder) => { - builder.storeUint(0b1000, 4); - builder.storeInt(vmCont.exit_code, 32); - }); - }; - if ((vmCont.kind == 'VmCont_vmc_quit_exc')) { - return ((builder: Builder) => { - builder.storeUint(0b1001, 4); - }); - }; - if ((vmCont.kind == 'VmCont_vmc_repeat')) { - return ((builder: Builder) => { - builder.storeUint(0b10100, 5); - builder.storeUint(vmCont.count, 63); - let cell1 = beginCell(); - storeVmCont(vmCont.body)(cell1); - builder.storeRef(cell1); - let cell2 = beginCell(); - storeVmCont(vmCont.after)(cell2); - builder.storeRef(cell2); - }); - }; - if ((vmCont.kind == 'VmCont_vmc_until')) { - return ((builder: Builder) => { - builder.storeUint(0b110000, 6); - let cell1 = beginCell(); - storeVmCont(vmCont.body)(cell1); - builder.storeRef(cell1); - let cell2 = beginCell(); - storeVmCont(vmCont.after)(cell2); - builder.storeRef(cell2); - }); - }; - if ((vmCont.kind == 'VmCont_vmc_again')) { - return ((builder: Builder) => { - builder.storeUint(0b110001, 6); - let cell1 = beginCell(); - storeVmCont(vmCont.body)(cell1); - builder.storeRef(cell1); - }); - }; - if ((vmCont.kind == 'VmCont_vmc_while_cond')) { - return ((builder: Builder) => { - builder.storeUint(0b110010, 6); - let cell1 = beginCell(); - storeVmCont(vmCont.cond)(cell1); - builder.storeRef(cell1); - let cell2 = beginCell(); - storeVmCont(vmCont.body)(cell2); - builder.storeRef(cell2); - let cell3 = beginCell(); - storeVmCont(vmCont.after)(cell3); - builder.storeRef(cell3); - }); - }; - if ((vmCont.kind == 'VmCont_vmc_while_body')) { - return ((builder: Builder) => { - builder.storeUint(0b110011, 6); - let cell1 = beginCell(); - storeVmCont(vmCont.cond)(cell1); - builder.storeRef(cell1); - let cell2 = beginCell(); - storeVmCont(vmCont.body)(cell2); - builder.storeRef(cell2); - let cell3 = beginCell(); - storeVmCont(vmCont.after)(cell3); - builder.storeRef(cell3); - }); - }; - if ((vmCont.kind == 'VmCont_vmc_pushint')) { - return ((builder: Builder) => { - builder.storeUint(0b1111, 4); - builder.storeInt(vmCont.value, 32); - let cell1 = beginCell(); - storeVmCont(vmCont.next)(cell1); - builder.storeRef(cell1); - }); - }; - throw new Error(''); - } -export function loadDNS_RecordSet(slice: Slice): DNS_RecordSet { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xafbffed3))) { - slice.loadUint(32); - let anon0: HashmapE = loadHashmapE(slice, 256, loadDNSRecord); - return { - kind: 'DNS_RecordSet', - anon0: anon0 - }; - }; - throw new Error(''); - } -export function storeDNS_RecordSet(dNS_RecordSet: DNS_RecordSet): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xafbffed3, 32); - storeHashmapE(dNS_RecordSet.anon0, storeDNSRecord)(builder); - }); - } -export function loadTextChunkRef(slice: Slice, arg0: number): TextChunkRef { - if ((arg0 == 0)) { - return { - kind: 'TextChunkRef_chunk_ref_empty' - }; - }; - if (true) { - let slice1 = slice.loadRef().beginParse(); - let ref: TextChunks = loadTextChunks(slice1, ((arg0 - 1) + 1)); - return { - kind: 'TextChunkRef_chunk_ref', - n: (arg0 - 1), - ref: ref - }; - }; - throw new Error(''); - } -export function storeTextChunkRef(textChunkRef: TextChunkRef): (builder: Builder) => void { - if ((textChunkRef.kind == 'TextChunkRef_chunk_ref_empty')) { - return ((builder: Builder) => { - - }); - }; - if ((textChunkRef.kind == 'TextChunkRef_chunk_ref')) { - return ((builder: Builder) => { - let cell1 = beginCell(); - storeTextChunks(textChunkRef.ref)(cell1); - builder.storeRef(cell1); - }); - }; - throw new Error(''); - } -export function loadTextChunks(slice: Slice, arg0: number): TextChunks { - if ((arg0 == 0)) { - return { - kind: 'TextChunks_text_chunk_empty' - }; - }; - if (true) { - let len: number = slice.loadUint(8); - let data: BitString = slice.loadBits((len * 8)); - let next: TextChunkRef = loadTextChunkRef(slice, (arg0 - 1)); - return { - kind: 'TextChunks_text_chunk', - n: (arg0 - 1), - len: len, - data: data, - next: next - }; - }; - throw new Error(''); - } -export function storeTextChunks(textChunks: TextChunks): (builder: Builder) => void { - if ((textChunks.kind == 'TextChunks_text_chunk_empty')) { - return ((builder: Builder) => { - - }); - }; - if ((textChunks.kind == 'TextChunks_text_chunk')) { - return ((builder: Builder) => { - builder.storeUint(textChunks.len, 8); - builder.storeBits(textChunks.data); - storeTextChunkRef(textChunks.next)(builder); - }); - }; - throw new Error(''); - } -export function loadText(slice: Slice): Text { - let chunks: number = slice.loadUint(8); - let rest: TextChunks = loadTextChunks(slice, chunks); - return { - kind: 'Text', - chunks: chunks, - rest: rest - }; - } -export function storeText(text: Text): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(text.chunks, 8); - storeTextChunks(text.rest)(builder); - }); - } -export function loadDNSRecord(slice: Slice): DNSRecord { - if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x1eda))) { - slice.loadUint(16); - let _: Text = loadText(slice); - return { - kind: 'DNSRecord_dns_text', - _: _ - }; - }; - if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0xba93))) { - slice.loadUint(16); - let resolver: MsgAddressInt = loadMsgAddressInt(slice); - return { - kind: 'DNSRecord_dns_next_resolver', - resolver: resolver - }; - }; - if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0xad01))) { - slice.loadUint(16); - let adnl_addr: BitString = slice.loadBits(256); - let flags: number = slice.loadUint(8); - let proto_list: ProtoList | undefined = ((flags & (1 << 0)) ? loadProtoList(slice) : undefined); - if ((!(flags <= 1))) { - throw new Error(''); - }; - return { - kind: 'DNSRecord_dns_adnl_address', - adnl_addr: adnl_addr, - flags: flags, - proto_list: proto_list - }; - }; - if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x9fd3))) { - slice.loadUint(16); - let smc_addr: MsgAddressInt = loadMsgAddressInt(slice); - let flags: number = slice.loadUint(8); - let cap_list: SmcCapList | undefined = ((flags & (1 << 0)) ? loadSmcCapList(slice) : undefined); - if ((!(flags <= 1))) { - throw new Error(''); - }; - return { - kind: 'DNSRecord_dns_smc_address', - smc_addr: smc_addr, - flags: flags, - cap_list: cap_list - }; - }; - throw new Error(''); - } -export function storeDNSRecord(dNSRecord: DNSRecord): (builder: Builder) => void { - if ((dNSRecord.kind == 'DNSRecord_dns_text')) { - return ((builder: Builder) => { - builder.storeUint(0x1eda, 16); - storeText(dNSRecord._)(builder); - }); - }; - if ((dNSRecord.kind == 'DNSRecord_dns_next_resolver')) { - return ((builder: Builder) => { - builder.storeUint(0xba93, 16); - storeMsgAddressInt(dNSRecord.resolver)(builder); - }); - }; - if ((dNSRecord.kind == 'DNSRecord_dns_adnl_address')) { - return ((builder: Builder) => { - builder.storeUint(0xad01, 16); - builder.storeBits(dNSRecord.adnl_addr); - builder.storeUint(dNSRecord.flags, 8); - if ((dNSRecord.proto_list != undefined)) { - storeProtoList(dNSRecord.proto_list)(builder); - }; - if ((!(dNSRecord.flags <= 1))) { - throw new Error(''); - }; - }); - }; - if ((dNSRecord.kind == 'DNSRecord_dns_smc_address')) { - return ((builder: Builder) => { - builder.storeUint(0x9fd3, 16); - storeMsgAddressInt(dNSRecord.smc_addr)(builder); - builder.storeUint(dNSRecord.flags, 8); - if ((dNSRecord.cap_list != undefined)) { - storeSmcCapList(dNSRecord.cap_list)(builder); - }; - if ((!(dNSRecord.flags <= 1))) { - throw new Error(''); - }; - }); - }; - throw new Error(''); - } -export function loadProtoList(slice: Slice): ProtoList { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1); - return { - kind: 'ProtoList_proto_list_nil' - }; - }; - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1); - let head: Protocol = loadProtocol(slice); - let tail: ProtoList = loadProtoList(slice); - return { - kind: 'ProtoList_proto_list_next', - head: head, - tail: tail - }; - }; - throw new Error(''); - } -export function storeProtoList(protoList: ProtoList): (builder: Builder) => void { - if ((protoList.kind == 'ProtoList_proto_list_nil')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1); - }); - }; - if ((protoList.kind == 'ProtoList_proto_list_next')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1); - storeProtocol(protoList.head)(builder); - storeProtoList(protoList.tail)(builder); - }); - }; - throw new Error(''); - } -export function loadProtocol(slice: Slice): Protocol { - if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x4854))) { - slice.loadUint(16); - return { - kind: 'Protocol' - }; - }; - throw new Error(''); - } -export function storeProtocol(protocol: Protocol): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x4854, 16); - }); - } -export function loadSmcCapList(slice: Slice): SmcCapList { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1); - return { - kind: 'SmcCapList_cap_list_nil' - }; - }; - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1); - let head: SmcCapability = loadSmcCapability(slice); - let tail: SmcCapList = loadSmcCapList(slice); - return { - kind: 'SmcCapList_cap_list_next', - head: head, - tail: tail - }; - }; - throw new Error(''); - } -export function storeSmcCapList(smcCapList: SmcCapList): (builder: Builder) => void { - if ((smcCapList.kind == 'SmcCapList_cap_list_nil')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1); - }); - }; - if ((smcCapList.kind == 'SmcCapList_cap_list_next')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1); - storeSmcCapability(smcCapList.head)(builder); - storeSmcCapList(smcCapList.tail)(builder); - }); - }; - throw new Error(''); - } -export function loadSmcCapability(slice: Slice): SmcCapability { - if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x5371))) { - slice.loadUint(16); - return { - kind: 'SmcCapability_cap_method_seqno' - }; - }; - if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x71f4))) { - slice.loadUint(16); - return { - kind: 'SmcCapability_cap_method_pubkey' - }; - }; - if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x2177))) { - slice.loadUint(16); - return { - kind: 'SmcCapability_cap_is_wallet' - }; - }; - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xff))) { - slice.loadUint(8); - let name: Text = loadText(slice); - return { - kind: 'SmcCapability_cap_name', - name: name - }; - }; - throw new Error(''); - } -export function storeSmcCapability(smcCapability: SmcCapability): (builder: Builder) => void { - if ((smcCapability.kind == 'SmcCapability_cap_method_seqno')) { - return ((builder: Builder) => { - builder.storeUint(0x5371, 16); - }); - }; - if ((smcCapability.kind == 'SmcCapability_cap_method_pubkey')) { - return ((builder: Builder) => { - builder.storeUint(0x71f4, 16); - }); - }; - if ((smcCapability.kind == 'SmcCapability_cap_is_wallet')) { - return ((builder: Builder) => { - builder.storeUint(0x2177, 16); - }); - }; - if ((smcCapability.kind == 'SmcCapability_cap_name')) { - return ((builder: Builder) => { - builder.storeUint(0xff, 8); - storeText(smcCapability.name)(builder); - }); - }; - throw new Error(''); - } -export function loadChanConfig(slice: Slice): ChanConfig { - let init_timeout: number = slice.loadUint(32); - let close_timeout: number = slice.loadUint(32); - let a_key: BitString = slice.loadBits(256); - let b_key: BitString = slice.loadBits(256); - let slice1 = slice.loadRef().beginParse(); - let a_addr: MsgAddressInt = loadMsgAddressInt(slice1); - let slice2 = slice.loadRef().beginParse(); - let b_addr: MsgAddressInt = loadMsgAddressInt(slice2); - let channel_id: number = slice.loadUint(64); - let min_A_extra: Grams = loadGrams(slice); - return { - kind: 'ChanConfig', - init_timeout: init_timeout, - close_timeout: close_timeout, - a_key: a_key, - b_key: b_key, - a_addr: a_addr, - b_addr: b_addr, - channel_id: channel_id, - min_A_extra: min_A_extra - }; - } -export function storeChanConfig(chanConfig: ChanConfig): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(chanConfig.init_timeout, 32); - builder.storeUint(chanConfig.close_timeout, 32); - builder.storeBits(chanConfig.a_key); - builder.storeBits(chanConfig.b_key); - let cell1 = beginCell(); - storeMsgAddressInt(chanConfig.a_addr)(cell1); - builder.storeRef(cell1); - let cell2 = beginCell(); - storeMsgAddressInt(chanConfig.b_addr)(cell2); - builder.storeRef(cell2); - builder.storeUint(chanConfig.channel_id, 64); - storeGrams(chanConfig.min_A_extra)(builder); - }); - } -export function loadChanState(slice: Slice): ChanState { - if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b000))) { - slice.loadUint(3); - let signed_A: Bool = loadBool(slice); - let signed_B: Bool = loadBool(slice); - let min_A: Grams = loadGrams(slice); - let min_B: Grams = loadGrams(slice); - let expire_at: number = slice.loadUint(32); - let A: Grams = loadGrams(slice); - let B: Grams = loadGrams(slice); - return { - kind: 'ChanState_chan_state_init', - signed_A: signed_A, - signed_B: signed_B, - min_A: min_A, - min_B: min_B, - expire_at: expire_at, - A: A, - B: B - }; - }; - if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b001))) { - slice.loadUint(3); - let signed_A: Bool = loadBool(slice); - let signed_B: Bool = loadBool(slice); - let promise_A: Grams = loadGrams(slice); - let promise_B: Grams = loadGrams(slice); - let expire_at: number = slice.loadUint(32); - let A: Grams = loadGrams(slice); - let B: Grams = loadGrams(slice); - return { - kind: 'ChanState_chan_state_close', - signed_A: signed_A, - signed_B: signed_B, - promise_A: promise_A, - promise_B: promise_B, - expire_at: expire_at, - A: A, - B: B - }; - }; - if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b010))) { - slice.loadUint(3); - let A: Grams = loadGrams(slice); - let B: Grams = loadGrams(slice); - return { - kind: 'ChanState_chan_state_payout', - A: A, - B: B - }; - }; - throw new Error(''); - } -export function storeChanState(chanState: ChanState): (builder: Builder) => void { - if ((chanState.kind == 'ChanState_chan_state_init')) { - return ((builder: Builder) => { - builder.storeUint(0b000, 3); - storeBool(chanState.signed_A)(builder); - storeBool(chanState.signed_B)(builder); - storeGrams(chanState.min_A)(builder); - storeGrams(chanState.min_B)(builder); - builder.storeUint(chanState.expire_at, 32); - storeGrams(chanState.A)(builder); - storeGrams(chanState.B)(builder); - }); - }; - if ((chanState.kind == 'ChanState_chan_state_close')) { - return ((builder: Builder) => { - builder.storeUint(0b001, 3); - storeBool(chanState.signed_A)(builder); - storeBool(chanState.signed_B)(builder); - storeGrams(chanState.promise_A)(builder); - storeGrams(chanState.promise_B)(builder); - builder.storeUint(chanState.expire_at, 32); - storeGrams(chanState.A)(builder); - storeGrams(chanState.B)(builder); - }); - }; - if ((chanState.kind == 'ChanState_chan_state_payout')) { - return ((builder: Builder) => { - builder.storeUint(0b010, 3); - storeGrams(chanState.A)(builder); - storeGrams(chanState.B)(builder); - }); - }; - throw new Error(''); - } -export function loadChanPromise(slice: Slice): ChanPromise { - let channel_id: number = slice.loadUint(64); - let promise_A: Grams = loadGrams(slice); - let promise_B: Grams = loadGrams(slice); - return { - kind: 'ChanPromise', - channel_id: channel_id, - promise_A: promise_A, - promise_B: promise_B - }; - } -export function storeChanPromise(chanPromise: ChanPromise): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(chanPromise.channel_id, 64); - storeGrams(chanPromise.promise_A)(builder); - storeGrams(chanPromise.promise_B)(builder); - }); - } -export function loadChanSignedPromise(slice: Slice): ChanSignedPromise { - let sig: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return slice1.loadBits(512); - })); - let promise: ChanPromise = loadChanPromise(slice); - return { - kind: 'ChanSignedPromise', - sig: sig, - promise: promise - }; - } -export function storeChanSignedPromise(chanSignedPromise: ChanSignedPromise): (builder: Builder) => void { - return ((builder: Builder) => { - storeMaybe(chanSignedPromise.sig, ((arg: BitString) => { - return ((builder: Builder) => { - let cell1 = beginCell() - cell1.storeBits(arg) - builder.storeRef(cell1); - }); - }))(builder); - storeChanPromise(chanSignedPromise.promise)(builder); - }); - } -export function loadChanMsg(slice: Slice): ChanMsg { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x27317822))) { - slice.loadUint(32); - let inc_A: Grams = loadGrams(slice); - let inc_B: Grams = loadGrams(slice); - let min_A: Grams = loadGrams(slice); - let min_B: Grams = loadGrams(slice); - let channel_id: number = slice.loadUint(64); - return { - kind: 'ChanMsg_chan_msg_init', - inc_A: inc_A, - inc_B: inc_B, - min_A: min_A, - min_B: min_B, - channel_id: channel_id - }; - }; - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xf28ae183))) { - slice.loadUint(32); - let extra_A: Grams = loadGrams(slice); - let extra_B: Grams = loadGrams(slice); - let promise: ChanSignedPromise = loadChanSignedPromise(slice); - return { - kind: 'ChanMsg_chan_msg_close', - extra_A: extra_A, - extra_B: extra_B, - promise: promise - }; - }; - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x43278a28))) { - slice.loadUint(32); - return { - kind: 'ChanMsg_chan_msg_timeout' - }; - }; - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x37fe7810))) { - slice.loadUint(32); - return { - kind: 'ChanMsg_chan_msg_payout' - }; - }; - throw new Error(''); - } -export function storeChanMsg(chanMsg: ChanMsg): (builder: Builder) => void { - if ((chanMsg.kind == 'ChanMsg_chan_msg_init')) { - return ((builder: Builder) => { - builder.storeUint(0x27317822, 32); - storeGrams(chanMsg.inc_A)(builder); - storeGrams(chanMsg.inc_B)(builder); - storeGrams(chanMsg.min_A)(builder); - storeGrams(chanMsg.min_B)(builder); - builder.storeUint(chanMsg.channel_id, 64); - }); - }; - if ((chanMsg.kind == 'ChanMsg_chan_msg_close')) { - return ((builder: Builder) => { - builder.storeUint(0xf28ae183, 32); - storeGrams(chanMsg.extra_A)(builder); - storeGrams(chanMsg.extra_B)(builder); - storeChanSignedPromise(chanMsg.promise)(builder); - }); - }; - if ((chanMsg.kind == 'ChanMsg_chan_msg_timeout')) { - return ((builder: Builder) => { - builder.storeUint(0x43278a28, 32); - }); - }; - if ((chanMsg.kind == 'ChanMsg_chan_msg_payout')) { - return ((builder: Builder) => { - builder.storeUint(0x37fe7810, 32); - }); - }; - throw new Error(''); - } -export function loadChanSignedMsg(slice: Slice): ChanSignedMsg { - let sig_A: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return slice1.loadBits(512); - })); - let sig_B: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return slice1.loadBits(512); - })); - let msg: ChanMsg = loadChanMsg(slice); - return { - kind: 'ChanSignedMsg', - sig_A: sig_A, - sig_B: sig_B, - msg: msg - }; - } -export function storeChanSignedMsg(chanSignedMsg: ChanSignedMsg): (builder: Builder) => void { - return ((builder: Builder) => { - storeMaybe(chanSignedMsg.sig_A, ((arg: BitString) => { - return ((builder: Builder) => { - let cell1 = beginCell() - cell1.storeBits(arg) - builder.storeRef(cell1); - }); - }))(builder); - storeMaybe(chanSignedMsg.sig_B, ((arg: BitString) => { - return ((builder: Builder) => { - let cell1 = beginCell() - cell1.storeBits(arg) - builder.storeRef(cell1); - }); - }))(builder); - storeChanMsg(chanSignedMsg.msg)(builder); - }); - } -export function loadChanOp(slice: Slice): ChanOp { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x912838d1))) { - slice.loadUint(32); - let msg: ChanSignedMsg = loadChanSignedMsg(slice); - return { - kind: 'ChanOp', - msg: msg - }; - }; - throw new Error(''); - } -export function storeChanOp(chanOp: ChanOp): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x912838d1, 32); - storeChanSignedMsg(chanOp.msg)(builder); - }); - } -export function loadChanData(slice: Slice): ChanData { - let slice1 = slice.loadRef().beginParse(); - let config: ChanConfig = loadChanConfig(slice1); - let slice2 = slice.loadRef().beginParse(); - let state: ChanState = loadChanState(slice2); - return { - kind: 'ChanData', - config: config, - state: state - }; - } -export function storeChanData(chanData: ChanData): (builder: Builder) => void { - return ((builder: Builder) => { - let cell1 = beginCell(); - storeChanConfig(chanData.config)(cell1); - builder.storeRef(cell1); - let cell2 = beginCell(); - storeChanState(chanData.state)(cell2); - builder.storeRef(cell2); - }); - } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/generated_test.ts b/generated_test.ts index 3a6d1dc..d4ed8a3 100644 --- a/generated_test.ts +++ b/generated_test.ts @@ -2,1850 +2,214 @@ import { Builder } from 'ton' import { Slice } from 'ton' import { beginCell } from 'ton' import { BitString } from 'ton' -export interface Simple { - readonly kind: 'Simple'; - readonly a: number; - readonly b: number; - }; -export type TwoConstructors = TwoConstructors_bool_false | TwoConstructors_bool_true; -export interface TwoConstructors_bool_false { - readonly kind: 'TwoConstructors_bool_false'; - readonly a: number; - readonly b: number; - readonly c: number; - }; -export interface TwoConstructors_bool_true { - readonly kind: 'TwoConstructors_bool_true'; - readonly b: number; - }; -export interface FixedIntParam { - readonly kind: 'FixedIntParam'; - readonly y: number; - }; -export interface TypedField { - readonly kind: 'TypedField'; - readonly y: FixedIntParam; - readonly c: number; - }; -export interface SharpConstructor { - readonly kind: 'SharpConstructor'; - readonly y: FixedIntParam; - readonly c: number; - }; -export type Maybe = Maybe_nothing | Maybe_just; -export interface Maybe_nothing { - readonly kind: 'Maybe_nothing'; - }; -export interface Maybe_just { - readonly kind: 'Maybe_just'; - readonly value: TheType; - }; -export interface TypedParam { - readonly kind: 'TypedParam'; - readonly x: Maybe; - }; -export type Either = Either_left | Either_right; -export interface Either_left { - readonly kind: 'Either_left'; - readonly value: X; - }; -export interface Either_right { - readonly kind: 'Either_right'; - readonly value: Y; - }; -export interface BitLenArg { - readonly kind: 'BitLenArg'; - readonly x: number; - readonly value: number; - }; -export interface BitLenArgUser { - readonly kind: 'BitLenArgUser'; - readonly t: BitLenArg; - }; -export interface ExprArg { - readonly kind: 'ExprArg'; - readonly x: number; - readonly value: number; - }; -export interface ExprArgUser { - readonly kind: 'ExprArgUser'; - readonly t: ExprArg; - }; -export interface ComplexTypedField { - readonly kind: 'ComplexTypedField'; - readonly a: ExprArgUser; - }; -export interface CellTypedField { - readonly kind: 'CellTypedField'; - readonly a: ExprArgUser; - }; -export interface CellsSimple { - readonly kind: 'CellsSimple'; - readonly t: number; - readonly q: number; - readonly a: number; - readonly e: number; - readonly b: number; - readonly d: number; - readonly c: number; - }; -export interface IntBits { - readonly kind: 'IntBits'; - readonly d: number; - readonly g: BitString; - readonly arg: Arg; - readonly x: Slice; - }; -export interface IntBitsInside { - readonly kind: 'IntBitsInside'; - readonly x: number; - readonly a: IntBits; - }; -export interface IntBitsOutside { - readonly kind: 'IntBitsOutside'; - readonly x: IntBitsInside; - }; -export interface IntBitsParametrized { - readonly kind: 'IntBitsParametrized'; - readonly e: number; - readonly h: number; - readonly f: number; - readonly i: BitString; - readonly j: number; - readonly k: number; - readonly tc: Slice; - }; -export interface IntBitsParametrizedInside { - readonly kind: 'IntBitsParametrizedInside'; - readonly x: number; - readonly a: IntBitsParametrized; - }; -export interface IntBitsParametrizedOutside { - readonly kind: 'IntBitsParametrizedOutside'; - readonly x: IntBitsParametrizedInside; - }; -export interface LessThan { - readonly kind: 'LessThan'; - readonly x: number; - readonly y: number; - }; -export interface OneComb { - readonly kind: 'OneComb'; - readonly t: number; - readonly x: A; - }; -export interface ManyComb { - readonly kind: 'ManyComb'; - readonly y: OneComb>>; - }; -export type Unary = Unary_unary_zero | Unary_unary_succ; -export interface Unary_unary_zero { - readonly kind: 'Unary_unary_zero'; - }; -export interface Unary_unary_succ { - readonly kind: 'Unary_unary_succ'; - readonly n: number; - readonly x: Unary; - }; -export type ParamConst = ParamConst_b | ParamConst_c | ParamConst_a | ParamConst_d; -export interface ParamConst_b { - readonly kind: 'ParamConst_b'; - readonly m: number; - readonly k: number; - }; -export interface ParamConst_c { - readonly kind: 'ParamConst_c'; - readonly n: number; - readonly m: number; - readonly k: number; - }; -export interface ParamConst_a { - readonly kind: 'ParamConst_a'; - readonly n: number; - }; -export interface ParamConst_d { - readonly kind: 'ParamConst_d'; - readonly n: number; - readonly m: number; - readonly k: number; - readonly l: number; - }; -export type ParamDifNames = ParamDifNames_a | ParamDifNames_b | ParamDifNames_c | ParamDifNames_d; -export interface ParamDifNames_a { - readonly kind: 'ParamDifNames_a'; - }; -export interface ParamDifNames_b { - readonly kind: 'ParamDifNames_b'; - }; -export interface ParamDifNames_c { - readonly kind: 'ParamDifNames_c'; - readonly n: number; - readonly x: ParamDifNames; - }; -export interface ParamDifNames_d { - readonly kind: 'ParamDifNames_d'; - readonly m: number; - readonly x: ParamDifNames; - }; -export interface ParamDifNamesUser { - readonly kind: 'ParamDifNamesUser'; - readonly k: number; - readonly x: ParamDifNames; - }; -export interface NegationFromImplicit { - readonly kind: 'NegationFromImplicit'; - readonly y: number; - readonly t: number; - readonly z: number; - }; -export interface UnaryUserCheckOrder { - readonly kind: 'UnaryUserCheckOrder'; - readonly l: number; - readonly m: number; - readonly label: Unary; - }; -export interface CombArgCellRef { - readonly kind: 'CombArgCellRef'; - readonly info: number; - readonly init: Maybe>; - readonly other: Either>; - readonly body: Either; - }; -export interface CombArgCellRefUser { - readonly kind: 'CombArgCellRefUser'; - readonly x: CombArgCellRef; - }; -export interface MathExprAsCombArg { - readonly kind: 'MathExprAsCombArg'; - readonly n: number; - readonly ref: BitLenArg; - }; -export interface EmptyTag { - readonly kind: 'EmptyTag'; - readonly a: number; - }; -export interface SharpTag { - readonly kind: 'SharpTag'; - readonly x: number; - }; -export interface DollarTag { - readonly kind: 'DollarTag'; - readonly x: number; - }; -export interface TupleCheck { - readonly kind: 'TupleCheck'; - readonly s: Array; - }; -export interface Hashmap { - readonly kind: 'Hashmap'; - readonly n: number; - readonly l: number; - readonly m: number; - readonly label: HmLabel; - readonly node: HashmapNode; - }; -export type HashmapNode = HashmapNode_hmn_leaf | HashmapNode_hmn_fork; -export interface HashmapNode_hmn_leaf { - readonly kind: 'HashmapNode_hmn_leaf'; - readonly value: X; - }; -export interface HashmapNode_hmn_fork { - readonly kind: 'HashmapNode_hmn_fork'; - readonly n: number; - readonly left: Hashmap; - readonly right: Hashmap; - }; -export type HmLabel = HmLabel_hml_short | HmLabel_hml_long | HmLabel_hml_same; -export interface HmLabel_hml_short { - readonly kind: 'HmLabel_hml_short'; - readonly m: number; - readonly n: number; - readonly len: Unary; - readonly s: Array; - }; -export interface HmLabel_hml_long { - readonly kind: 'HmLabel_hml_long'; - readonly m: number; - readonly n: number; - readonly s: Array; - }; -export interface HmLabel_hml_same { - readonly kind: 'HmLabel_hml_same'; - readonly m: number; - readonly v: BitString; - readonly n: number; - }; -export type HashmapE = HashmapE_hme_empty | HashmapE_hme_root; -export interface HashmapE_hme_empty { - readonly kind: 'HashmapE_hme_empty'; - readonly n: number; - }; -export interface HashmapE_hme_root { - readonly kind: 'HashmapE_hme_root'; - readonly n: number; - readonly root: Hashmap; - }; -export interface HashmapEUser { - readonly kind: 'HashmapEUser'; - readonly x: HashmapE; - }; -export interface ConditionalField { - readonly kind: 'ConditionalField'; - readonly a: number; - readonly b: number | undefined; - }; -export interface BitSelection { - readonly kind: 'BitSelection'; - readonly a: number; - readonly b: number | undefined; - }; -export interface ImplicitCondition { - readonly kind: 'ImplicitCondition'; - readonly flags: number; - }; -export type MultipleEmptyConstructor = MultipleEmptyConstructor__ | MultipleEmptyConstructor__1 | MultipleEmptyConstructor_a; -export interface MultipleEmptyConstructor__ { - readonly kind: 'MultipleEmptyConstructor__'; - readonly a: number; - }; -export interface MultipleEmptyConstructor__1 { - readonly kind: 'MultipleEmptyConstructor__1'; - readonly b: number; - }; -export interface MultipleEmptyConstructor_a { - readonly kind: 'MultipleEmptyConstructor_a'; - readonly x: number; - }; -export interface True { - readonly kind: 'True'; - }; -export type ParamNamedArgInSecondConstr = ParamNamedArgInSecondConstr_a | ParamNamedArgInSecondConstr_b; -export interface ParamNamedArgInSecondConstr_a { - readonly kind: 'ParamNamedArgInSecondConstr_a'; - readonly n: number; - }; -export interface ParamNamedArgInSecondConstr_b { - readonly kind: 'ParamNamedArgInSecondConstr_b'; - readonly n: number; - }; -export interface RefCombinatorAny { - readonly kind: 'RefCombinatorAny'; - readonly msg: Maybe; - }; -export interface EqualityExpression { - readonly kind: 'EqualityExpression'; - readonly n: number; - }; -export interface ConditionalRef { - readonly kind: 'ConditionalRef'; - readonly x: number; - readonly y: Simple | undefined; - }; -export interface LoadFromNegationOutsideExpr { - readonly kind: 'LoadFromNegationOutsideExpr'; - readonly seq_no: number; - readonly prev_seq_no: number; - }; -export interface AnonymousData { - readonly kind: 'AnonymousData'; - readonly anon0: number; - }; -export interface FalseAnonField { - readonly kind: 'FalseAnonField'; - readonly value: number; - }; -export type ConstructorOrder = ConstructorOrder__ | ConstructorOrder_a; -export interface ConstructorOrder__ { - readonly kind: 'ConstructorOrder__'; - readonly anon0: Simple; - }; -export interface ConstructorOrder_a { - readonly kind: 'ConstructorOrder_a'; - readonly a: Simple; - }; -export type CheckCrc32 = CheckCrc32_a | CheckCrc32_b; -export interface CheckCrc32_a { - readonly kind: 'CheckCrc32_a'; - readonly a: number; - }; -export interface CheckCrc32_b { - readonly kind: 'CheckCrc32_b'; - readonly b: number; - readonly c: number; - }; -export interface CheckKeyword { - readonly kind: 'CheckKeyword'; - readonly const0: number; - }; -export function bitLen(n: number) { - return n.toString(2).length;; - } -export function loadSimple(slice: Slice): Simple { - let a: number = slice.loadUint(32); - let b: number = slice.loadUint(32); - return { - kind: 'Simple', - a: a, - b: b - }; - } -export function storeSimple(simple: Simple): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(simple.a, 32); - builder.storeUint(simple.b, 32); - }); - } -export function loadTwoConstructors(slice: Slice): TwoConstructors { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1); - let a: number = slice.loadUint(32); - let b: number = slice.loadUint(7); - let c: number = slice.loadUint(32); - return { - kind: 'TwoConstructors_bool_false', - a: a, - b: b, - c: c - }; - }; - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1); - let b: number = slice.loadUint(32); - return { - kind: 'TwoConstructors_bool_true', - b: b - }; - }; - throw new Error(''); - } -export function storeTwoConstructors(twoConstructors: TwoConstructors): (builder: Builder) => void { - if ((twoConstructors.kind == 'TwoConstructors_bool_false')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1); - builder.storeUint(twoConstructors.a, 32); - builder.storeUint(twoConstructors.b, 7); - builder.storeUint(twoConstructors.c, 32); - }); - }; - if ((twoConstructors.kind == 'TwoConstructors_bool_true')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1); - builder.storeUint(twoConstructors.b, 32); - }); - }; - throw new Error(''); - } -export function loadFixedIntParam(slice: Slice): FixedIntParam { - let y: number = slice.loadUint(5); - return { - kind: 'FixedIntParam', - y: y - }; - } -export function storeFixedIntParam(fixedIntParam: FixedIntParam): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(fixedIntParam.y, 5); - }); - } -export function loadTypedField(slice: Slice): TypedField { - let y: FixedIntParam = loadFixedIntParam(slice); - let c: number = slice.loadUint(32); - return { - kind: 'TypedField', - y: y, - c: c - }; - } -export function storeTypedField(typedField: TypedField): (builder: Builder) => void { - return ((builder: Builder) => { - storeFixedIntParam(typedField.y)(builder); - builder.storeUint(typedField.c, 32); - }); - } -export function loadSharpConstructor(slice: Slice): SharpConstructor { - let y: FixedIntParam = loadFixedIntParam(slice); - let c: number = slice.loadUint(32); - return { - kind: 'SharpConstructor', - y: y, - c: c - }; - } -export function storeSharpConstructor(sharpConstructor: SharpConstructor): (builder: Builder) => void { - return ((builder: Builder) => { - storeFixedIntParam(sharpConstructor.y)(builder); - builder.storeUint(sharpConstructor.c, 32); - }); - } -export function loadMaybe(slice: Slice, loadTheType: (slice: Slice) => TheType): Maybe { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1); - return { - kind: 'Maybe_nothing' - }; - }; - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1); - let value: TheType = loadTheType(slice); - return { - kind: 'Maybe_just', - value: value - }; - }; - throw new Error(''); - } -export function storeMaybe(maybe: Maybe, storeTheType: (theType: TheType) => (builder: Builder) => void): (builder: Builder) => void { - if ((maybe.kind == 'Maybe_nothing')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1); - }); - }; - if ((maybe.kind == 'Maybe_just')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1); - storeTheType(maybe.value)(builder); - }); - }; - throw new Error(''); - } -export function loadTypedParam(slice: Slice): TypedParam { - let x: Maybe = loadMaybe(slice, loadSharpConstructor); - return { - kind: 'TypedParam', - x: x - }; - } -export function storeTypedParam(typedParam: TypedParam): (builder: Builder) => void { - return ((builder: Builder) => { - storeMaybe(typedParam.x, storeSharpConstructor)(builder); - }); - } -export function loadEither(slice: Slice, loadX: (slice: Slice) => X, loadY: (slice: Slice) => Y): Either { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1); - let value: X = loadX(slice); - return { - kind: 'Either_left', - value: value - }; - }; - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1); - let value: Y = loadY(slice); - return { - kind: 'Either_right', - value: value - }; - }; - throw new Error(''); - } -export function storeEither(either: Either, storeX: (x: X) => (builder: Builder) => void, storeY: (y: Y) => (builder: Builder) => void): (builder: Builder) => void { - if ((either.kind == 'Either_left')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1); - storeX(either.value)(builder); - }); - }; - if ((either.kind == 'Either_right')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1); - storeY(either.value)(builder); - }); - }; - throw new Error(''); - } -export function loadBitLenArg(slice: Slice, x: number): BitLenArg { - let value: number = slice.loadUint(x); - return { - kind: 'BitLenArg', - x: x, - value: value - }; - } -export function storeBitLenArg(bitLenArg: BitLenArg): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(bitLenArg.value, bitLenArg.x); - }); - } -export function loadBitLenArgUser(slice: Slice): BitLenArgUser { - let t: BitLenArg = loadBitLenArg(slice, 4); - return { - kind: 'BitLenArgUser', - t: t - }; - } -export function storeBitLenArgUser(bitLenArgUser: BitLenArgUser): (builder: Builder) => void { - return ((builder: Builder) => { - storeBitLenArg(bitLenArgUser.t)(builder); - }); - } -export function loadExprArg(slice: Slice, arg0: number): ExprArg { - let value: number = slice.loadUint((arg0 - 2)); - return { - kind: 'ExprArg', - x: (arg0 - 2), - value: value - }; - } -export function storeExprArg(exprArg: ExprArg): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(exprArg.value, exprArg.x); - }); - } -export function loadExprArgUser(slice: Slice): ExprArgUser { - let t: ExprArg = loadExprArg(slice, 6); - return { - kind: 'ExprArgUser', - t: t - }; - } -export function storeExprArgUser(exprArgUser: ExprArgUser): (builder: Builder) => void { - return ((builder: Builder) => { - storeExprArg(exprArgUser.t)(builder); - }); - } -export function loadComplexTypedField(slice: Slice): ComplexTypedField { - let a: ExprArgUser = loadExprArgUser(slice); - return { - kind: 'ComplexTypedField', - a: a - }; - } -export function storeComplexTypedField(complexTypedField: ComplexTypedField): (builder: Builder) => void { - return ((builder: Builder) => { - storeExprArgUser(complexTypedField.a)(builder); - }); - } -export function loadCellTypedField(slice: Slice): CellTypedField { - let slice1 = slice.loadRef().beginParse(); - let a: ExprArgUser = loadExprArgUser(slice1); - return { - kind: 'CellTypedField', - a: a - }; - } -export function storeCellTypedField(_cellTypedField: CellTypedField): (builder: Builder) => void { - return ((builder: Builder) => { - let cell1 = beginCell(); - storeExprArgUser(_cellTypedField.a)(cell1); - builder.storeRef(cell1); - }); - } -export function loadCellsSimple(slice: Slice): CellsSimple { - let t: number = slice.loadUint(32); - let slice1 = slice.loadRef().beginParse(); - let q: number = slice1.loadUint(32); - let slice2 = slice.loadRef().beginParse(); - let a: number = slice2.loadUint(32); - let slice21 = slice2.loadRef().beginParse(); - let e: number = slice21.loadUint(32); - let slice22 = slice2.loadRef().beginParse(); - let b: number = slice22.loadUint(32); - let d: number = slice22.loadUint(32); - let slice221 = slice22.loadRef().beginParse(); - let c: number = slice221.loadUint(32); - return { - kind: 'CellsSimple', - t: t, - q: q, - a: a, - e: e, - b: b, - d: d, - c: c - }; - } -export function storeCellsSimple(_cellsSimple: CellsSimple): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(_cellsSimple.t, 32); - let cell1 = beginCell(); - cell1.storeUint(_cellsSimple.q, 32); - builder.storeRef(cell1); - let cell2 = beginCell(); - cell2.storeUint(_cellsSimple.a, 32); - let cell21 = beginCell(); - cell21.storeUint(_cellsSimple.e, 32); - cell2.storeRef(cell21); - let cell22 = beginCell(); - cell22.storeUint(_cellsSimple.b, 32); - cell22.storeUint(_cellsSimple.d, 32); - let cell221 = beginCell(); - cell221.storeUint(_cellsSimple.c, 32); - cell22.storeRef(cell221); - cell2.storeRef(cell22); - builder.storeRef(cell2); - }); - } -export function loadIntBits(slice: Slice, loadArg: (slice: Slice) => Arg): IntBits { - let d: number = slice.loadInt(11); - let g: BitString = slice.loadBits(2); - let arg: Arg = loadArg(slice); - let x: Slice = slice; - return { - kind: 'IntBits', - d: d, - g: g, - arg: arg, - x: x - }; - } -export function storeIntBits(intBits: IntBits, storeArg: (arg: Arg) => (builder: Builder) => void): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeInt(intBits.d, 11); - builder.storeBits(intBits.g); - storeArg(intBits.arg)(builder); - builder.storeSlice(intBits.x); - }); - } -export function loadIntBitsInside(slice: Slice, arg0: number): IntBitsInside { - let a: IntBits = loadIntBits(slice, ((slice: Slice) => { - return slice.loadInt((1 + (arg0 / 2))); - })); - return { - kind: 'IntBitsInside', - x: (arg0 / 2), - a: a - }; - } -export function storeIntBitsInside(intBitsInside: IntBitsInside): (builder: Builder) => void { - return ((builder: Builder) => { - storeIntBits(intBitsInside.a, ((arg: number) => { - return ((builder: Builder) => { - builder.storeInt(arg, (1 + intBitsInside.x)); - }); - }))(builder); - }); - } -export function loadIntBitsOutside(slice: Slice): IntBitsOutside { - let x: IntBitsInside = loadIntBitsInside(slice, 6); - return { - kind: 'IntBitsOutside', - x: x - }; - } -export function storeIntBitsOutside(intBitsOutside: IntBitsOutside): (builder: Builder) => void { - return ((builder: Builder) => { - storeIntBitsInside(intBitsOutside.x)(builder); - }); - } -export function loadIntBitsParametrized(slice: Slice, e: number): IntBitsParametrized { - let h: number = slice.loadInt((e * 8)); - let f: number = slice.loadUint((7 * e)); - let i: BitString = slice.loadBits((5 + e)); - let j: number = slice.loadInt(5); - let k: number = slice.loadUint(e); - let tc: Slice = slice; - return { - kind: 'IntBitsParametrized', - e: e, - h: h, - f: f, - i: i, - j: j, - k: k, - tc: tc - }; - } -export function storeIntBitsParametrized(intBitsParametrized: IntBitsParametrized): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeInt(intBitsParametrized.h, (intBitsParametrized.e * 8)); - builder.storeUint(intBitsParametrized.f, (7 * intBitsParametrized.e)); - builder.storeBits(intBitsParametrized.i); - builder.storeInt(intBitsParametrized.j, 5); - builder.storeUint(intBitsParametrized.k, intBitsParametrized.e); - builder.storeSlice(intBitsParametrized.tc); - }); - } -export function loadIntBitsParametrizedInside(slice: Slice, x: number): IntBitsParametrizedInside { - let a: IntBitsParametrized = loadIntBitsParametrized(slice, x); - return { - kind: 'IntBitsParametrizedInside', - x: x, - a: a - }; - } -export function storeIntBitsParametrizedInside(intBitsParametrizedInside: IntBitsParametrizedInside): (builder: Builder) => void { - return ((builder: Builder) => { - storeIntBitsParametrized(intBitsParametrizedInside.a)(builder); - }); - } -export function loadIntBitsParametrizedOutside(slice: Slice): IntBitsParametrizedOutside { - let x: IntBitsParametrizedInside = loadIntBitsParametrizedInside(slice, 5); - return { - kind: 'IntBitsParametrizedOutside', - x: x - }; - } -export function storeIntBitsParametrizedOutside(intBitsParametrizedOutside: IntBitsParametrizedOutside): (builder: Builder) => void { - return ((builder: Builder) => { - storeIntBitsParametrizedInside(intBitsParametrizedOutside.x)(builder); - }); - } -export function loadLessThan(slice: Slice): LessThan { - let x: number = slice.loadUint(bitLen((4 - 1))); - let y: number = slice.loadUint(bitLen(4)); - return { - kind: 'LessThan', - x: x, - y: y - }; - } -export function storeLessThan(lessThan: LessThan): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(lessThan.x, bitLen((4 - 1))); - builder.storeUint(lessThan.y, bitLen(4)); - }); - } -export function loadOneComb(slice: Slice, loadA: (slice: Slice) => A): OneComb { - let t: number = slice.loadUint(32); - let x: A = loadA(slice); - return { - kind: 'OneComb', - t: t, - x: x - }; - } -export function storeOneComb(oneComb: OneComb, storeA: (a: A) => (builder: Builder) => void): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(oneComb.t, 32); - storeA(oneComb.x)(builder); - }); - } -export function loadManyComb(slice: Slice): ManyComb { - let y: OneComb>> = loadOneComb>>(slice, ((slice: Slice) => { - return loadOneComb>(slice, ((slice: Slice) => { - return loadOneComb(slice, ((slice: Slice) => { - return slice.loadInt(3); - })); - })); - })); - return { - kind: 'ManyComb', - y: y - }; - } -export function storeManyComb(manyComb: ManyComb): (builder: Builder) => void { - return ((builder: Builder) => { - storeOneComb>>(manyComb.y, ((arg: OneComb>) => { - return ((builder: Builder) => { - storeOneComb>(arg, ((arg: OneComb) => { - return ((builder: Builder) => { - storeOneComb(arg, ((arg: number) => { - return ((builder: Builder) => { - builder.storeInt(arg, 3); - }); - }))(builder); - }); - }))(builder); - }); - }))(builder); - }); - } -export function unary_unary_succ_get_n(x: Unary): number { - if ((x.kind == 'Unary_unary_zero')) { - return 0; - }; - if ((x.kind == 'Unary_unary_succ')) { - let n = x.n; - return (n + 1); - }; - throw new Error(''); - } -export function loadUnary(slice: Slice): Unary { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1); - return { - kind: 'Unary_unary_zero' - }; - }; - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1); - let x: Unary = loadUnary(slice); - let n = unary_unary_succ_get_n(x); - return { - kind: 'Unary_unary_succ', - x: x, - n: n - }; - }; - throw new Error(''); - } -export function storeUnary(unary: Unary): (builder: Builder) => void { - if ((unary.kind == 'Unary_unary_zero')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1); - }); - }; - if ((unary.kind == 'Unary_unary_succ')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1); - storeUnary(unary.x)(builder); - }); - }; - throw new Error(''); - } -export function loadParamConst(slice: Slice, arg0: number, arg1: number): ParamConst { - if (((slice.remainingBits >= 2) && ((slice.preloadUint(2) == 0b01) && ((arg0 == 2) && (arg1 == 1))))) { - slice.loadUint(2); - let m: number = slice.loadUint(32); - let k: number = slice.loadUint(32); - return { - kind: 'ParamConst_b', - m: m, - k: k - }; - }; - if (((slice.remainingBits >= 2) && ((slice.preloadUint(2) == 0b01) && ((arg0 == 3) && (arg1 == 3))))) { - slice.loadUint(2); - let n: number = slice.loadUint(32); - let m: number = slice.loadUint(32); - let k: number = slice.loadUint(32); - return { - kind: 'ParamConst_c', - n: n, - m: m, - k: k - }; - }; - if (((arg0 == 1) && (arg1 == 1))) { - let n: number = slice.loadUint(32); - return { - kind: 'ParamConst_a', - n: n - }; - }; - if (((arg0 == 4) && (arg1 == 2))) { - let n: number = slice.loadUint(32); - let m: number = slice.loadUint(32); - let k: number = slice.loadUint(32); - let l: number = slice.loadUint(32); - return { - kind: 'ParamConst_d', - n: n, - m: m, - k: k, - l: l - }; - }; - throw new Error(''); - } -export function storeParamConst(paramConst: ParamConst): (builder: Builder) => void { - if ((paramConst.kind == 'ParamConst_b')) { - return ((builder: Builder) => { - builder.storeUint(0b01, 2); - builder.storeUint(paramConst.m, 32); - builder.storeUint(paramConst.k, 32); - }); - }; - if ((paramConst.kind == 'ParamConst_c')) { - return ((builder: Builder) => { - builder.storeUint(0b01, 2); - builder.storeUint(paramConst.n, 32); - builder.storeUint(paramConst.m, 32); - builder.storeUint(paramConst.k, 32); - }); - }; - if ((paramConst.kind == 'ParamConst_a')) { - return ((builder: Builder) => { - builder.storeUint(paramConst.n, 32); - }); - }; - if ((paramConst.kind == 'ParamConst_d')) { - return ((builder: Builder) => { - builder.storeUint(paramConst.n, 32); - builder.storeUint(paramConst.m, 32); - builder.storeUint(paramConst.k, 32); - builder.storeUint(paramConst.l, 32); - }); - }; - throw new Error(''); - } -export function paramDifNames_c_get_n(x: ParamDifNames): number { - if ((x.kind == 'ParamDifNames_a')) { - return 1; - }; - if ((x.kind == 'ParamDifNames_b')) { - return 1; - }; - if ((x.kind == 'ParamDifNames_c')) { - let n = x.n; - return (n + 1); - }; - if ((x.kind == 'ParamDifNames_d')) { - let m = x.m; - return (m * 2); - }; - throw new Error(''); - } -export function paramDifNames_d_get_m(x: ParamDifNames): number { - if ((x.kind == 'ParamDifNames_a')) { - return 1; - }; - if ((x.kind == 'ParamDifNames_b')) { - return 1; - }; - if ((x.kind == 'ParamDifNames_c')) { - let n = x.n; - return (n + 1); - }; - if ((x.kind == 'ParamDifNames_d')) { - let m = x.m; - return (m * 2); - }; - throw new Error(''); - } -export function loadParamDifNames(slice: Slice, arg0: number): ParamDifNames { - if (((slice.remainingBits >= 1) && ((slice.preloadUint(1) == 0b0) && (arg0 == 2)))) { - slice.loadUint(1); - return { - kind: 'ParamDifNames_a' - }; - }; - if (((slice.remainingBits >= 1) && ((slice.preloadUint(1) == 0b1) && (arg0 == 3)))) { - slice.loadUint(1); - return { - kind: 'ParamDifNames_b' - }; - }; - if (((slice.remainingBits >= 1) && ((slice.preloadUint(1) == 0b1) && (arg0 == 2)))) { - slice.loadUint(1); - let x: ParamDifNames = loadParamDifNames(slice, 2); - let n = paramDifNames_c_get_n(x); - return { - kind: 'ParamDifNames_c', - x: x, - n: n - }; - }; - if (((slice.remainingBits >= 1) && ((slice.preloadUint(1) == 0b0) && (arg0 == 3)))) { - slice.loadUint(1); - let x: ParamDifNames = loadParamDifNames(slice, 3); - let m = paramDifNames_d_get_m(x); - return { - kind: 'ParamDifNames_d', - x: x, - m: m - }; - }; - throw new Error(''); - } -export function storeParamDifNames(paramDifNames: ParamDifNames): (builder: Builder) => void { - if ((paramDifNames.kind == 'ParamDifNames_a')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1); - }); - }; - if ((paramDifNames.kind == 'ParamDifNames_b')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1); - }); - }; - if ((paramDifNames.kind == 'ParamDifNames_c')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1); - storeParamDifNames(paramDifNames.x)(builder); - }); - }; - if ((paramDifNames.kind == 'ParamDifNames_d')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1); - storeParamDifNames(paramDifNames.x)(builder); - }); - }; - throw new Error(''); - } -export function paramDifNamesUser_get_k(x: ParamDifNames): number { - if ((x.kind == 'ParamDifNames_a')) { - return 1; - }; - if ((x.kind == 'ParamDifNames_b')) { - return 1; - }; - if ((x.kind == 'ParamDifNames_c')) { - let n = x.n; - return (n + 1); - }; - if ((x.kind == 'ParamDifNames_d')) { - let m = x.m; - return (m * 2); - }; - throw new Error(''); - } -export function loadParamDifNamesUser(slice: Slice): ParamDifNamesUser { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1); - let x: ParamDifNames = loadParamDifNames(slice, 2); - let k = paramDifNamesUser_get_k(x); - return { - kind: 'ParamDifNamesUser', - x: x, - k: k - }; - }; - throw new Error(''); - } -export function storeParamDifNamesUser(paramDifNamesUser: ParamDifNamesUser): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0b0, 1); - storeParamDifNames(paramDifNamesUser.x)(builder); - }); - } -export function loadNegationFromImplicit(slice: Slice): NegationFromImplicit { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1); - let t: number = slice.loadUint(32); - let z: number = slice.loadUint(32); - return { - kind: 'NegationFromImplicit', - y: (t / 2), - t: t, - z: z - }; - }; - throw new Error(''); - } -export function storeNegationFromImplicit(negationFromImplicit: NegationFromImplicit): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0b1, 1); - builder.storeUint(negationFromImplicit.t, 32); - builder.storeUint(negationFromImplicit.z, 32); - }); - } -export function unaryUserCheckOrder_get_l(label: Unary): number { - if ((label.kind == 'Unary_unary_zero')) { - return 0; - }; - if ((label.kind == 'Unary_unary_succ')) { - let n = label.n; - return (n + 1); - }; - throw new Error(''); - } -export function loadUnaryUserCheckOrder(slice: Slice): UnaryUserCheckOrder { - let label: Unary = loadUnary(slice); - let l = unaryUserCheckOrder_get_l(label); - return { - kind: 'UnaryUserCheckOrder', - m: (7 - l), - label: label, - l: l - }; - } -export function storeUnaryUserCheckOrder(unaryUserCheckOrder: UnaryUserCheckOrder): (builder: Builder) => void { - return ((builder: Builder) => { - storeUnary(unaryUserCheckOrder.label)(builder); - }); - } -export function loadCombArgCellRef(slice: Slice, loadX: (slice: Slice) => X): CombArgCellRef { - let info: number = slice.loadInt(32); - let init: Maybe> = loadMaybe>(slice, ((slice: Slice) => { - return loadEither(slice, loadX, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return slice1.loadInt(22); - })); - })); - let other: Either> = loadEither>(slice, loadX, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadOneComb(slice1, loadX); - })); - let body: Either = loadEither(slice, loadX, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadX(slice1); - })); - return { - kind: 'CombArgCellRef', - info: info, - init: init, - other: other, - body: body - }; - } -export function storeCombArgCellRef(combArgCellRef: CombArgCellRef, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeInt(combArgCellRef.info, 32); - storeMaybe>(combArgCellRef.init, ((arg: Either) => { - return ((builder: Builder) => { - storeEither(arg, storeX, ((arg: number) => { - return ((builder: Builder) => { - let cell1 = beginCell() - cell1.storeInt(arg, 22) - builder.storeRef(cell1); - }); - }))(builder); - }); - }))(builder); - storeEither>(combArgCellRef.other, storeX, ((arg: OneComb) => { - return ((builder: Builder) => { - let cell1 = beginCell() - storeOneComb(arg, storeX)(cell1) - builder.storeRef(cell1); - }); - }))(builder); - storeEither(combArgCellRef.body, storeX, ((arg: X) => { - return ((builder: Builder) => { - let cell1 = beginCell() - storeX(arg)(cell1) - builder.storeRef(cell1); - }); - }))(builder); - }); - } -export function loadCombArgCellRefUser(slice: Slice): CombArgCellRefUser { - let x: CombArgCellRef = loadCombArgCellRef(slice, ((slice: Slice) => { - return slice.loadInt(12); - })); - return { - kind: 'CombArgCellRefUser', - x: x - }; - } -export function storeCombArgCellRefUser(combArgCellRefUser: CombArgCellRefUser): (builder: Builder) => void { - return ((builder: Builder) => { - storeCombArgCellRef(combArgCellRefUser.x, ((arg: number) => { - return ((builder: Builder) => { - builder.storeInt(arg, 12); - }); - }))(builder); - }); - } -export function loadMathExprAsCombArg(slice: Slice, arg0: number): MathExprAsCombArg { - let slice1 = slice.loadRef().beginParse(); - let ref: BitLenArg = loadBitLenArg(slice1, ((arg0 - 2) + 2)); - return { - kind: 'MathExprAsCombArg', - n: (arg0 - 2), - ref: ref - }; - } -export function storeMathExprAsCombArg(mathExprAsCombArg: MathExprAsCombArg): (builder: Builder) => void { - return ((builder: Builder) => { - let cell1 = beginCell(); - storeBitLenArg(mathExprAsCombArg.ref)(cell1); - builder.storeRef(cell1); - }); - } -export function loadEmptyTag(slice: Slice): EmptyTag { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xab787f76))) { - slice.loadUint(32); - let a: number = slice.loadUint(32); - return { - kind: 'EmptyTag', - a: a - }; - }; - throw new Error(''); - } -export function storeEmptyTag(emptyTag: EmptyTag): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xab787f76, 32); - builder.storeUint(emptyTag.a, 32); - }); - } -export function loadSharpTag(slice: Slice): SharpTag { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xf4))) { - slice.loadUint(8); - let x: number = slice.loadUint(32); - return { - kind: 'SharpTag', - x: x - }; - }; - throw new Error(''); - } -export function storeSharpTag(sharpTag: SharpTag): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xf4, 8); - builder.storeUint(sharpTag.x, 32); - }); - } -export function loadDollarTag(slice: Slice): DollarTag { - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b1011))) { - slice.loadUint(4); - let x: number = slice.loadUint(32); - return { - kind: 'DollarTag', - x: x - }; - }; - throw new Error(''); - } -export function storeDollarTag(dollarTag: DollarTag): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0b1011, 4); - builder.storeUint(dollarTag.x, 32); - }); - } -export function loadTupleCheck(slice: Slice): TupleCheck { - let s: Array = Array.from(Array(3).keys()).map(((arg: number) => { - return slice.loadInt(5); - })); - return { - kind: 'TupleCheck', - s: s - }; - } -export function storeTupleCheck(tupleCheck: TupleCheck): (builder: Builder) => void { - return ((builder: Builder) => { - tupleCheck.s.forEach(((arg: number) => { - builder.storeInt(arg, 5); - })); - }); - } -export function hashmap_get_l(label: HmLabel): number { - if ((label.kind == 'HmLabel_hml_short')) { - let n = label.n; - return n; - }; - if ((label.kind == 'HmLabel_hml_long')) { - let n = label.n; - return n; - }; - if ((label.kind == 'HmLabel_hml_same')) { - let n = label.n; - return n; - }; - throw new Error(''); - } -export function loadHashmap(slice: Slice, n: number, loadX: (slice: Slice) => X): Hashmap { - let label: HmLabel = loadHmLabel(slice, n); - let l = hashmap_get_l(label); - let node: HashmapNode = loadHashmapNode(slice, (n - l), loadX); - return { - kind: 'Hashmap', - m: (n - l), - n: n, - label: label, - l: l, - node: node - }; - } -export function storeHashmap(hashmap: Hashmap, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void { - return ((builder: Builder) => { - storeHmLabel(hashmap.label)(builder); - storeHashmapNode(hashmap.node, storeX)(builder); - }); - } -export function loadHashmapNode(slice: Slice, arg0: number, loadX: (slice: Slice) => X): HashmapNode { - if ((arg0 == 0)) { - let value: X = loadX(slice); - return { - kind: 'HashmapNode_hmn_leaf', - value: value - }; - }; - if (true) { - let slice1 = slice.loadRef().beginParse(); - let left: Hashmap = loadHashmap(slice1, (arg0 - 1), loadX); - let slice2 = slice.loadRef().beginParse(); - let right: Hashmap = loadHashmap(slice2, (arg0 - 1), loadX); - return { - kind: 'HashmapNode_hmn_fork', - n: (arg0 - 1), - left: left, - right: right - }; - }; - throw new Error(''); - } -export function storeHashmapNode(hashmapNode: HashmapNode, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void { - if ((hashmapNode.kind == 'HashmapNode_hmn_leaf')) { - return ((builder: Builder) => { - storeX(hashmapNode.value)(builder); - }); - }; - if ((hashmapNode.kind == 'HashmapNode_hmn_fork')) { - return ((builder: Builder) => { - let cell1 = beginCell(); - storeHashmap(hashmapNode.left, storeX)(cell1); - builder.storeRef(cell1); - let cell2 = beginCell(); - storeHashmap(hashmapNode.right, storeX)(cell2); - builder.storeRef(cell2); - }); - }; - throw new Error(''); - } -export function hmLabel_hml_short_get_n(len: Unary): number { - if ((len.kind == 'Unary_unary_zero')) { - return 0; - }; - if ((len.kind == 'Unary_unary_succ')) { - let n = len.n; - return (n + 1); - }; - throw new Error(''); - } -export function loadHmLabel(slice: Slice, m: number): HmLabel { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1); - let len: Unary = loadUnary(slice); - let n = hmLabel_hml_short_get_n(len); - let s: Array = Array.from(Array(n).keys()).map(((arg: number) => { - return slice.loadBits(1); - })); - if ((!(n <= m))) { - throw new Error(''); - }; - return { - kind: 'HmLabel_hml_short', - m: m, - len: len, - n: n, - s: s - }; - }; - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b10))) { - slice.loadUint(2); - let n: number = slice.loadUint(bitLen(m)); - let s: Array = Array.from(Array(n).keys()).map(((arg: number) => { - return slice.loadBits(1); - })); - return { - kind: 'HmLabel_hml_long', - m: m, - n: n, - s: s - }; - }; - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b11))) { - slice.loadUint(2); - let v: BitString = slice.loadBits(1); - let n: number = slice.loadUint(bitLen(m)); - return { - kind: 'HmLabel_hml_same', - m: m, - v: v, - n: n - }; - }; - throw new Error(''); - } -export function storeHmLabel(hmLabel: HmLabel): (builder: Builder) => void { - if ((hmLabel.kind == 'HmLabel_hml_short')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1); - storeUnary(hmLabel.len)(builder); - hmLabel.s.forEach(((arg: BitString) => { - builder.storeBits(arg); - })); - if ((!(hmLabel.n <= hmLabel.m))) { - throw new Error(''); - }; - }); - }; - if ((hmLabel.kind == 'HmLabel_hml_long')) { - return ((builder: Builder) => { - builder.storeUint(0b10, 2); - builder.storeUint(hmLabel.n, bitLen(hmLabel.m)); - hmLabel.s.forEach(((arg: BitString) => { - builder.storeBits(arg); - })); - }); - }; - if ((hmLabel.kind == 'HmLabel_hml_same')) { - return ((builder: Builder) => { - builder.storeUint(0b11, 2); - builder.storeBits(hmLabel.v); - builder.storeUint(hmLabel.n, bitLen(hmLabel.m)); - }); - }; - throw new Error(''); - } -export function loadHashmapE(slice: Slice, n: number, loadX: (slice: Slice) => X): HashmapE { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1); - return { - kind: 'HashmapE_hme_empty', - n: n - }; - }; - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1); - let slice1 = slice.loadRef().beginParse(); - let root: Hashmap = loadHashmap(slice1, n, loadX); - return { - kind: 'HashmapE_hme_root', - n: n, - root: root - }; - }; - throw new Error(''); - } -export function storeHashmapE(hashmapE: HashmapE, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void { - if ((hashmapE.kind == 'HashmapE_hme_empty')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1); - }); - }; - if ((hashmapE.kind == 'HashmapE_hme_root')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1); - let cell1 = beginCell(); - storeHashmap(hashmapE.root, storeX)(cell1); - builder.storeRef(cell1); - }); - }; - throw new Error(''); - } -export function loadHashmapEUser(slice: Slice): HashmapEUser { - let x: HashmapE = loadHashmapE(slice, 8, ((slice: Slice) => { - return slice.loadUint(16); - })); - return { - kind: 'HashmapEUser', - x: x - }; - } -export function storeHashmapEUser(hashmapEUser: HashmapEUser): (builder: Builder) => void { - return ((builder: Builder) => { - storeHashmapE(hashmapEUser.x, ((arg: number) => { - return ((builder: Builder) => { - builder.storeUint(arg, 16); - }); - }))(builder); - }); - } -export function loadConditionalField(slice: Slice): ConditionalField { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xdc165658))) { - slice.loadUint(32); - let a: number = slice.loadUint(1); - let b: number | undefined = (a ? slice.loadUint(32) : undefined); - return { - kind: 'ConditionalField', - a: a, - b: b - }; - }; - throw new Error(''); - } -export function storeConditionalField(conditionalField: ConditionalField): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xdc165658, 32); - builder.storeUint(conditionalField.a, 1); - if ((conditionalField.b != undefined)) { - builder.storeUint(conditionalField.b, 32); - }; - }); - } -export function loadBitSelection(slice: Slice): BitSelection { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xe1a2049e))) { - slice.loadUint(32); - let a: number = slice.loadUint(6); - let b: number | undefined = ((a & (1 << 2)) ? slice.loadUint(32) : undefined); - return { - kind: 'BitSelection', - a: a, - b: b - }; - }; - throw new Error(''); - } -export function storeBitSelection(bitSelection: BitSelection): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xe1a2049e, 32); - builder.storeUint(bitSelection.a, 6); - if ((bitSelection.b != undefined)) { - builder.storeUint(bitSelection.b, 32); - }; - }); - } -export function loadImplicitCondition(slice: Slice): ImplicitCondition { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xd86a5028))) { - slice.loadUint(32); - let flags: number = slice.loadUint(10); - if ((!(flags <= 100))) { - throw new Error(''); - }; - return { - kind: 'ImplicitCondition', - flags: flags - }; - }; - throw new Error(''); - } -export function storeImplicitCondition(implicitCondition: ImplicitCondition): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xd86a5028, 32); - builder.storeUint(implicitCondition.flags, 10); - if ((!(implicitCondition.flags <= 100))) { - throw new Error(''); - }; - }); - } -export function loadMultipleEmptyConstructor(slice: Slice, arg0: number): MultipleEmptyConstructor { - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x85e93c51) && (arg0 == 0)))) { - slice.loadUint(32); - let a: number = slice.loadUint(32); - return { - kind: 'MultipleEmptyConstructor__', - a: a - }; - }; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xc5d27bf1) && (arg0 == 1)))) { - slice.loadUint(32); - let b: number = slice.loadUint(5); - return { - kind: 'MultipleEmptyConstructor__1', - b: b - }; - }; - if ((arg0 == 2)) { - let x: number = slice.loadUint(6); - return { - kind: 'MultipleEmptyConstructor_a', - x: x - }; - }; - throw new Error(''); - } -export function storeMultipleEmptyConstructor(multipleEmptyConstructor: MultipleEmptyConstructor): (builder: Builder) => void { - if ((multipleEmptyConstructor.kind == 'MultipleEmptyConstructor__')) { - return ((builder: Builder) => { - builder.storeUint(0x85e93c51, 32); - builder.storeUint(multipleEmptyConstructor.a, 32); - }); - }; - if ((multipleEmptyConstructor.kind == 'MultipleEmptyConstructor__1')) { - return ((builder: Builder) => { - builder.storeUint(0xc5d27bf1, 32); - builder.storeUint(multipleEmptyConstructor.b, 5); - }); - }; - if ((multipleEmptyConstructor.kind == 'MultipleEmptyConstructor_a')) { - return ((builder: Builder) => { - builder.storeUint(multipleEmptyConstructor.x, 6); - }); - }; - throw new Error(''); - } -export function loadTrue(slice: Slice): True { - return { - kind: 'True' - }; - } -export function storeTrue(true0: True): (builder: Builder) => void { - return ((builder: Builder) => { - - }); - } -export function loadParamNamedArgInSecondConstr(slice: Slice, arg0: number): ParamNamedArgInSecondConstr { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1); - return { - kind: 'ParamNamedArgInSecondConstr_a', - n: arg0 - }; - }; - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1); - return { - kind: 'ParamNamedArgInSecondConstr_b', - n: (arg0 - 1) - }; - }; - throw new Error(''); - } -export function storeParamNamedArgInSecondConstr(paramNamedArgInSecondConstr: ParamNamedArgInSecondConstr): (builder: Builder) => void { - if ((paramNamedArgInSecondConstr.kind == 'ParamNamedArgInSecondConstr_a')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1); - }); - }; - if ((paramNamedArgInSecondConstr.kind == 'ParamNamedArgInSecondConstr_b')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1); - }); - }; - throw new Error(''); - } -export function loadRefCombinatorAny(slice: Slice): RefCombinatorAny { - let slice1 = slice.loadRef().beginParse(); - let msg: Maybe = loadMaybe(slice1, ((slice: Slice) => { - return slice; - })); - return { - kind: 'RefCombinatorAny', - msg: msg - }; - } -export function storeRefCombinatorAny(refCombinatorAny: RefCombinatorAny): (builder: Builder) => void { - return ((builder: Builder) => { - let cell1 = beginCell(); - storeMaybe(refCombinatorAny.msg, ((arg: Slice) => { - return ((builder: Builder) => { - cell1.storeSlice(arg); - }); - }))(cell1); - builder.storeRef(cell1); - }); - } -export function loadEqualityExpression(slice: Slice): EqualityExpression { - let n: number = slice.loadUint(32); - if ((!((5 + n) == 7))) { - throw new Error(''); - }; - return { - kind: 'EqualityExpression', - n: n - }; - } -export function storeEqualityExpression(equalityExpression: EqualityExpression): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(equalityExpression.n, 32); - if ((!((5 + equalityExpression.n) == 7))) { - throw new Error(''); - }; - }); - } -export function loadConditionalRef(slice: Slice): ConditionalRef { - let x: number = slice.loadUint(1); - let y: Simple | undefined = (x ? ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadSimple(slice1); - })(slice) : undefined); - return { - kind: 'ConditionalRef', - x: x, - y: y - }; - } -export function storeConditionalRef(conditionalRef: ConditionalRef): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(conditionalRef.x, 1); - if ((conditionalRef.y != undefined)) { - let cell1 = beginCell() - storeSimple(conditionalRef.y)(cell1) - builder.storeRef(cell1); - }; - }); - } -export function loadLoadFromNegationOutsideExpr(slice: Slice): LoadFromNegationOutsideExpr { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x9bc7a987))) { - slice.loadUint(32); - let seq_no: number = slice.loadUint(32); - return { - kind: 'LoadFromNegationOutsideExpr', - prev_seq_no: (seq_no - 1), - seq_no: seq_no - }; - }; - throw new Error(''); - } -export function storeLoadFromNegationOutsideExpr(loadFromNegationOutsideExpr: LoadFromNegationOutsideExpr): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x9bc7a987, 32); - builder.storeUint(loadFromNegationOutsideExpr.seq_no, 32); - }); - } -export function loadAnonymousData(slice: Slice): AnonymousData { - let anon0: number = slice.loadUint(1); - return { - kind: 'AnonymousData', - anon0: anon0 - }; - } -export function storeAnonymousData(anonymousData: AnonymousData): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(anonymousData.anon0, 1); - }); - } -export function loadFalseAnonField(slice: Slice): FalseAnonField { - if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x0201))) { - slice.loadUint(16); - let value: number = slice.loadInt(257); - return { - kind: 'FalseAnonField', - value: value - }; - }; - throw new Error(''); - } -export function storeFalseAnonField(falseAnonField: FalseAnonField): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x0201, 16); - builder.storeInt(falseAnonField.value, 257); - }); - } -export function loadConstructorOrder(slice: Slice): ConstructorOrder { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xc6cc03c3))) { - slice.loadUint(32); - let anon0: Simple = loadSimple(slice); - return { - kind: 'ConstructorOrder__', - anon0: anon0 - }; - }; - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1); - let a: Simple = loadSimple(slice); - return { - kind: 'ConstructorOrder_a', - a: a - }; - }; - throw new Error(''); - } -export function storeConstructorOrder(constructorOrder: ConstructorOrder): (builder: Builder) => void { - if ((constructorOrder.kind == 'ConstructorOrder__')) { - return ((builder: Builder) => { - builder.storeUint(0xc6cc03c3, 32); - storeSimple(constructorOrder.anon0)(builder); - }); - }; - if ((constructorOrder.kind == 'ConstructorOrder_a')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1); - storeSimple(constructorOrder.a)(builder); - }); - }; - throw new Error(''); - } -export function loadCheckCrc32(slice: Slice): CheckCrc32 { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xd6e7c617))) { - slice.loadUint(32); - let a: number = slice.loadUint(32); - return { - kind: 'CheckCrc32_a', - a: a - }; - }; - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xde1cb606))) { - slice.loadUint(32); - let b: number = slice.loadUint(32); - let c: number = slice.loadUint(32); - return { - kind: 'CheckCrc32_b', - b: b, - c: c - }; - }; - throw new Error(''); - } -export function storeCheckCrc32(checkCrc32: CheckCrc32): (builder: Builder) => void { - if ((checkCrc32.kind == 'CheckCrc32_a')) { - return ((builder: Builder) => { - builder.storeUint(0xd6e7c617, 32); - builder.storeUint(checkCrc32.a, 32); - }); - }; - if ((checkCrc32.kind == 'CheckCrc32_b')) { - return ((builder: Builder) => { - builder.storeUint(0xde1cb606, 32); - builder.storeUint(checkCrc32.b, 32); - builder.storeUint(checkCrc32.c, 32); - }); - }; - throw new Error(''); - } -export function loadCheckKeyword(slice: Slice): CheckKeyword { - let const0: number = slice.loadUint(32); - return { - kind: 'CheckKeyword', - const0: const0 - }; - } -export function storeCheckKeyword(checkKeyword: CheckKeyword): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(checkKeyword.const0, 32); - }); - } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/codegen/CodeBuilder.ts b/src/codegen/CodeBuilder.ts new file mode 100644 index 0000000..6431c84 --- /dev/null +++ b/src/codegen/CodeBuilder.ts @@ -0,0 +1,64 @@ +/** + * Copyright (c) Whales Corp. + * All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +export class CodeBuilder { + private tabLevel = 0 + private code = '' + + tab() { + this.tabLevel++ + } + + unTab() { + this.tabLevel-- + } + + inTab(callback: () => void) { + this.tab(); + callback() + this.unTab(); + } + + add(text?: string, moveLine = true) { + if (!text) { + this.code += '\n' + return + } + + let tab = ' '.repeat(this.tabLevel * 4) + this.code += tab + text + (moveLine ? '\n' : '') + } + + addMultiline(text: string, inline = false) { + let lines = text.split('\n') + let i = 0 + for (let line of lines) { + if (line === '\n' && lines.indexOf(line) === lines.length - 1) { + continue + } + if (inline && i === 0) { + this.code += line + '\n' + } else { + this.add(line) + } + i++ + } + } + + append(code: CodeBuilder) { + this.addMultiline(code.render()) + } + + appendInline(code: CodeBuilder) { + this.addMultiline(code.render(), true) + } + + render() { + return this.code + } +} \ No newline at end of file diff --git a/src/codegen/combinator.ts b/src/codegen/combinator.ts index 3adfb7c..7586760 100644 --- a/src/codegen/combinator.ts +++ b/src/codegen/combinator.ts @@ -1,5 +1,5 @@ import { BuiltinZeroArgs, FieldCurlyExprDef, FieldNamedDef, Program, Declaration, BuiltinOneArgExpr, NumberExpr, NameExpr, CombinatorExpr, FieldBuiltinDef, MathExpr, SimpleExpr, NegateExpr, CellRefExpr, FieldDefinition, FieldAnonymousDef, CondExpr, CompareExpr, Expression as ParserExpression, TypeExpr } from '../../src/ast/nodes' -import { tIdentifier, tArrowFunctionExpression, tArrowFunctionType, tBinaryExpression, tBinaryNumericLiteral, tDeclareVariable, tExpressionStatement, tFunctionCall, tFunctionDeclaration, tIfStatement, tImportDeclaration, tMemberExpression, tNumericLiteral, tObjectExpression, tObjectProperty, tReturnStatement, tStringLiteral, tStructDeclaration, tTypeParametersExpression, tTypeWithParameters, tTypedIdentifier, tUnionTypeDeclaration, toCode, toCodeArray, TypeWithParameters, ArrowFunctionExpression, tMultiStatement, tUnionTypeExpression, tTernaryExpression, FunctionDeclaration } from './tsgen' +import { tIdentifier, tArrowFunctionExpression, tArrowFunctionType, tBinaryExpression, tBinaryNumericLiteral, tDeclareVariable, tExpressionStatement, tFunctionCall, tFunctionDeclaration, tIfStatement, tImportDeclaration, tMemberExpression, tNumericLiteral, tObjectExpression, tObjectProperty, tReturnStatement, tStringLiteral, tStructDeclaration, tTypeParametersExpression, tTypeWithParameters, tTypedIdentifier, tUnionTypeDeclaration, toCode, TypeWithParameters, ArrowFunctionExpression, tMultiStatement, tUnionTypeExpression, tTernaryExpression, FunctionDeclaration } from './tsgen' import { TLBMathExpr, TLBVarExpr, TLBNumberExpr, TLBBinaryOp, TLBCode, TLBType, TLBConstructor, TLBParameter, TLBVariable } from './ast' import { Expression, Statement, Identifier, BinaryExpression, ASTNode, TypeExpression, TypeParametersExpression, ObjectProperty, TypedIdentifier } from './tsgen' import { fillConstructors, firstLower, getTypeParametersExpression, getCurrentSlice, bitLen, convertToAST, convertToMathExpr, getCondition, splitForTypeValue, deriveMathExpression } from './util' diff --git a/src/codegen/field.ts b/src/codegen/field.ts index dcb0ca8..a1f8ed8 100644 --- a/src/codegen/field.ts +++ b/src/codegen/field.ts @@ -1,5 +1,5 @@ import { BuiltinZeroArgs, FieldCurlyExprDef, FieldNamedDef, Program, Declaration, BuiltinOneArgExpr, NumberExpr, NameExpr, CombinatorExpr, FieldBuiltinDef, MathExpr, SimpleExpr, NegateExpr, CellRefExpr, FieldDefinition, FieldAnonymousDef, CondExpr, CompareExpr, Expression as ParserExpression, FieldExprDef } from '../../src/ast/nodes' -import { tIdentifier, tArrowFunctionExpression, tArrowFunctionType, tBinaryExpression, tBinaryNumericLiteral, tDeclareVariable, tExpressionStatement, tFunctionCall, tFunctionDeclaration, tIfStatement, tImportDeclaration, tMemberExpression, tNumericLiteral, tObjectExpression, tObjectProperty, tReturnStatement, tStringLiteral, tStructDeclaration, tTypeParametersExpression, tTypeWithParameters, tTypedIdentifier, GenDeclaration, tUnionTypeDeclaration, toCode, toCodeArray, TypeWithParameters, ArrowFunctionExpression, FunctionDeclaration } from './tsgen' +import { tIdentifier, tArrowFunctionExpression, tArrowFunctionType, tBinaryExpression, tBinaryNumericLiteral, tDeclareVariable, tExpressionStatement, tFunctionCall, tFunctionDeclaration, tIfStatement, tImportDeclaration, tMemberExpression, tNumericLiteral, tObjectExpression, tObjectProperty, tReturnStatement, tStringLiteral, tStructDeclaration, tTypeParametersExpression, tTypeWithParameters, tTypedIdentifier, GenDeclaration, tUnionTypeDeclaration, toCode, TypeWithParameters, ArrowFunctionExpression, FunctionDeclaration } from './tsgen' import { TLBMathExpr, TLBVarExpr, TLBNumberExpr, TLBBinaryOp, TLBCode, TLBType, TLBConstructor, TLBParameter, TLBVariable } from './ast' import { Expression, Statement, Identifier, BinaryExpression, ASTNode, TypeExpression, TypeParametersExpression, ObjectProperty, TypedIdentifier } from './tsgen' import { fillConstructors, firstLower, getTypeParametersExpression, getCurrentSlice, bitLen, convertToAST, convertToMathExpr, getCondition, splitForTypeValue, deriveMathExpression } from './util' diff --git a/src/codegen/helpers.ts b/src/codegen/helpers.ts index 023adbf..c43b59e 100644 --- a/src/codegen/helpers.ts +++ b/src/codegen/helpers.ts @@ -1,5 +1,5 @@ import { BuiltinZeroArgs, FieldCurlyExprDef, FieldNamedDef, Program, Declaration, BuiltinOneArgExpr, NumberExpr, NameExpr, CombinatorExpr, FieldBuiltinDef, MathExpr, SimpleExpr, NegateExpr, CellRefExpr, FieldDefinition, FieldAnonymousDef, CondExpr, CompareExpr, Expression as ParserExpression } from '../../src/ast/nodes' -import { tIdentifier, tArrowFunctionExpression, tArrowFunctionType, tBinaryExpression, tBinaryNumericLiteral, tDeclareVariable, tExpressionStatement, tFunctionCall, tFunctionDeclaration, tIfStatement, tImportDeclaration, tMemberExpression, tNumericLiteral, tObjectExpression, tObjectProperty, tReturnStatement, tStringLiteral, tStructDeclaration, tTypeParametersExpression, tTypeWithParameters, tTypedIdentifier, tUnionTypeDeclaration, toCode, toCodeArray, TypeWithParameters, ArrowFunctionExpression, tForCycle } from './tsgen' +import { tIdentifier, tArrowFunctionExpression, tArrowFunctionType, tBinaryExpression, tBinaryNumericLiteral, tDeclareVariable, tExpressionStatement, tFunctionCall, tFunctionDeclaration, tIfStatement, tImportDeclaration, tMemberExpression, tNumericLiteral, tObjectExpression, tObjectProperty, tReturnStatement, tStringLiteral, tStructDeclaration, tTypeParametersExpression, tTypeWithParameters, tTypedIdentifier, tUnionTypeDeclaration, toCode, TypeWithParameters, ArrowFunctionExpression, tForCycle } from './tsgen' import { TLBMathExpr, TLBVarExpr, TLBNumberExpr, TLBBinaryOp, TLBCode, TLBType, TLBConstructor, TLBParameter, TLBVariable } from './ast' import { Expression, Statement, Identifier, BinaryExpression, ASTNode, TypeExpression, TypeParametersExpression, ObjectProperty, TypedIdentifier } from './tsgen' import { fillConstructors, firstLower, getTypeParametersExpression, getCurrentSlice, bitLen, convertToAST, convertToMathExpr, getCondition, splitForTypeValue, deriveMathExpression, getStringDeclaration } from './util' diff --git a/src/codegen/main.ts b/src/codegen/main.ts index 19380dd..ae8e19e 100644 --- a/src/codegen/main.ts +++ b/src/codegen/main.ts @@ -1,5 +1,5 @@ import { BuiltinZeroArgs, FieldCurlyExprDef, FieldNamedDef, Program, Declaration, BuiltinOneArgExpr, NumberExpr, NameExpr, CombinatorExpr, FieldBuiltinDef, MathExpr, SimpleExpr, NegateExpr, CellRefExpr, FieldDefinition, FieldAnonymousDef, CondExpr, CompareExpr, Expression as ParserExpression } from '../../src/ast/nodes' -import { tIdentifier, tArrowFunctionExpression, tArrowFunctionType, tBinaryExpression, tBinaryNumericLiteral, tDeclareVariable, tExpressionStatement, tFunctionCall, tFunctionDeclaration, tIfStatement, tImportDeclaration, tMemberExpression, tNumericLiteral, tObjectExpression, tObjectProperty, tReturnStatement, tStringLiteral, tStructDeclaration, tTypeParametersExpression, tTypeWithParameters, tTypedIdentifier, tUnionTypeDeclaration, toCode, GenDeclaration, toCodeArray, TypeWithParameters, ArrowFunctionExpression, tUnionTypeExpression, tUnaryOpExpression, StructDeclaration, FunctionDeclaration } from './tsgen' +import { tIdentifier, tArrowFunctionExpression, tArrowFunctionType, tBinaryExpression, tBinaryNumericLiteral, tDeclareVariable, tExpressionStatement, tFunctionCall, tFunctionDeclaration, tIfStatement, tImportDeclaration, tMemberExpression, tNumericLiteral, tObjectExpression, tObjectProperty, tReturnStatement, tStringLiteral, tStructDeclaration, tTypeParametersExpression, tTypeWithParameters, tTypedIdentifier, tUnionTypeDeclaration, toCode, GenDeclaration, TypeWithParameters, ArrowFunctionExpression, tUnionTypeExpression, tUnaryOpExpression, StructDeclaration, FunctionDeclaration } from './tsgen' import { TLBMathExpr, TLBVarExpr, TLBNumberExpr, TLBBinaryOp, TLBCode, TLBType, TLBConstructor, TLBParameter, TLBVariable, TLBConstructorTag } from './ast' import { Expression, Statement, Identifier, BinaryExpression, ASTNode, TypeExpression, TypeParametersExpression, ObjectProperty, TypedIdentifier } from './tsgen' import { fillConstructors, firstLower, getTypeParametersExpression, getCurrentSlice, bitLen, convertToAST, convertToMathExpr, getCondition, splitForTypeValue, deriveMathExpression, getStringDeclaration } from './util' @@ -7,6 +7,7 @@ import { constructorNodes } from '../parsing' import { handleCombinator } from './combinator' import { handleField } from './field' import { getParamVarExpr, getSubStructName, goodVariableName } from './helpers' +import { CodeBuilder } from './CodeBuilder' export function generate(tree: Program, input: string) { let jsCodeDeclarations: GenDeclaration[] = [] @@ -177,7 +178,7 @@ export function generate(tree: Program, input: string) { }); jsCodeDeclarations.forEach(element => { - generatedCode += toCode(element, { tabs: 0 }) + '\n'; + generatedCode += toCode(element, new CodeBuilder()) + '\n'; }); return generatedCode; } \ No newline at end of file diff --git a/src/codegen/tsgen.ts b/src/codegen/tsgen.ts index fb36449..f336b68 100644 --- a/src/codegen/tsgen.ts +++ b/src/codegen/tsgen.ts @@ -1,3 +1,4 @@ +import { CodeBuilder } from "./CodeBuilder"; export interface ASTNode { type: TheNode["type"]; @@ -5,7 +6,7 @@ export interface ASTNode { export interface Identifier extends ASTNode { type: "Identifier", - name: String + name: string } export interface TypeWithParameters extends ASTNode { @@ -180,7 +181,7 @@ export type GenDeclaration = ImportDeclaration | StructDeclaration | UnionTypeDe export type TheNode = Identifier | GenDeclaration | TypedIdentifier | Expression | ObjectProperty | Statement; -export function tIdentifier(name: String): Identifier { +export function tIdentifier(name: string): Identifier { return { type: "Identifier", name: name }; } @@ -287,156 +288,145 @@ export function tMultiStatement(statements: Array): MultiStatement { -export function toCodeArray(nodeArray: Array, delimeter: string, prefix: string, printContext: PrintContext, suffix: string) { - let parameters: string = ''; +// export function toCodeArray(nodeArray: Array, delimeter: string, prefix: string, printContext: PrintContext, suffix: string) { +// let parameters: string = ''; - for (let i = 0; i < nodeArray.length; i++) { - let currentParam = nodeArray[i]; - if (currentParam != undefined) { - parameters += prefix + toCode(currentParam, printContext) + suffix; - } - if (i + 1 < nodeArray.length) { - parameters += delimeter; - } - } - - return parameters; -} - -type PrintContext = { - tabs: number; -} - -function addTab(printContext: PrintContext): PrintContext { - return { - ...printContext, - tabs: printContext.tabs + 1, - } -} +// for (let i = 0; i < nodeArray.length; i++) { +// let currentParam = nodeArray[i]; +// if (currentParam != undefined) { +// parameters += prefix + toCode(currentParam, printContext) + suffix; +// } +// if (i + 1 < nodeArray.length) { +// parameters += delimeter; +// } +// } -export function toCode(node: TheNode, printContext: PrintContext): string { - let result: string = ''; - let currentTabs = '\t'.repeat(printContext.tabs); +// return parameters; +// } +export function toCode(node: TheNode, code: CodeBuilder): string { if (node.type == "Identifier") { - result += node.name; + code.add(node.name, false); } if (node.type == "NumericLiteral") { - result += node.value.toString() + code.add(node.value.toString(), false) } if (node.type == "ImportDeclaration") { - result += currentTabs + `import { ${toCode(node.importValue, printContext)} } from ${toCode(node.from, printContext)}`; - } - - if (node.type == "FunctionDeclaration") { - result += currentTabs + `export function ${toCode(node.name, printContext)}${toCode(node.typeParameters, printContext)}(${toCodeArray(node.parameters, ', ', '', printContext, '')})${node.returnType ? ': ' + toCode(node.returnType, printContext) : ''} { - ${toCodeArray(node.body, '\n', '', addTab(printContext), ';')} - ${currentTabs}}` - } - - if (node.type == "ArrowFunctionExpression") { - result += `((${toCodeArray(node.parameters, ', ', '', printContext, '')}) => { - ${toCodeArray(node.body, '\n', '', addTab(printContext), ';')} - ${currentTabs}})` + code.add(`import { `, false); + toCode(node.importValue, code); + code.add(` } from `, false) + toCode(node.from, code) } - if (node.type == "ArrowFunctionType") { - result += `(${toCodeArray(node.parameters, ', ', '', printContext, '')}) => ${node.returnType ? toCode(node.returnType, printContext) : ''}` - } - - if (node.type == "TypeWithParameters") { - result += `${toCode(node.name, printContext)}${toCode(node.typeParameters, printContext)}` - } - - if (node.type == "TypedIdentifier") { - result += toCode(node.name, printContext) + ': ' + toCode(node.typeId, printContext); - } - - if (node.type == "ObjectProperty") { - result += currentTabs + toCode(node.key, printContext) + ': ' + toCode(node.value, printContext); - } - - if (node.type == "DeclareVariable") { - result += `let ${toCode(node.name, printContext)}${node.typeName ? ': ' + toCode(node.typeName, printContext) : ''}${node.init ? ' = ' + toCode(node.init, printContext) : ''}` - } - - if (node.type == "ObjectExpression") { - result += `{ - ${toCodeArray(node.objectValues, ',\n', '', addTab(printContext), '')} - ${currentTabs}}` - } - - if (node.type == "MultiStatement") { - result += toCodeArray(node.statements, '\n', '', printContext, ''); - } - - if (node.type == "ReturnStatement") { - result += currentTabs + `return ${toCode(node.returnValue, printContext)}` - } - - if (node.type == "ExpressionStatement") { - result += currentTabs + toCode(node.expression, printContext) - } - - if (node.type == "TypeParametersExpression") { - if (node.typeParameters.length > 0) { - result += '<'; - result += toCodeArray(node.typeParameters, ',', '', printContext, ''); - result += '>'; - } - } - - if (node.type == "StructDeclaration") { - result += currentTabs + `export interface ${toCode(node.name, printContext)}${toCode(node.typeParametersExpression, printContext)} { - ${toCodeArray(node.fields, '\n', '\treadonly ', printContext, ';')} - ${currentTabs}};` - } - - if (node.type == "UnionTypeDeclaration") { - result += currentTabs + `export type ${toCode(node.name, printContext)} = ${toCode(node.union, printContext)};` - } - - if (node.type == "UnionTypeExpression") { - return `${toCodeArray(node.unionMembers, ' | ', '', printContext, '')}` - } - - if (node.type == "FunctionCall") { - result += `${toCode(node.functionId, printContext)}${node.typeParameters ? toCode(node.typeParameters, printContext) : ''}(${toCodeArray(node.parameters, ', ', '', printContext, '')})` - } + // if (node.type == "FunctionDeclaration") { + // code.add(`export function ${toCode(node.name, printContext)}${toCode(node.typeParameters, printContext)}(${toCodeArray(node.parameters, ', ', '', printContext, '')})${node.returnType ? ': ' + toCode(node.returnType, printContext) : ''} { + // ${toCodeArray(node.body, '\n', '', addTab(printContext), ';')} + // ${currentTabs}}`) + // } + +// if (node.type == "ArrowFunctionExpression") { +// result += `((${toCodeArray(node.parameters, ', ', '', printContext, '')}) => { +// ${toCodeArray(node.body, '\n', '', addTab(printContext), ';')} +// ${currentTabs}})` +// } + +// if (node.type == "ArrowFunctionType") { +// result += `(${toCodeArray(node.parameters, ', ', '', printContext, '')}) => ${node.returnType ? toCode(node.returnType, printContext) : ''}` +// } + +// if (node.type == "TypeWithParameters") { +// result += `${toCode(node.name, printContext)}${toCode(node.typeParameters, printContext)}` +// } + +// if (node.type == "TypedIdentifier") { +// result += toCode(node.name, printContext) + ': ' + toCode(node.typeId, printContext); +// } + +// if (node.type == "ObjectProperty") { +// result += currentTabs + toCode(node.key, printContext) + ': ' + toCode(node.value, printContext); +// } + +// if (node.type == "DeclareVariable") { +// result += `let ${toCode(node.name, printContext)}${node.typeName ? ': ' + toCode(node.typeName, printContext) : ''}${node.init ? ' = ' + toCode(node.init, printContext) : ''}` +// } + +// if (node.type == "ObjectExpression") { +// result += `{ +// ${toCodeArray(node.objectValues, ',\n', '', addTab(printContext), '')} +// ${currentTabs}}` +// } + +// if (node.type == "MultiStatement") { +// result += toCodeArray(node.statements, '\n', '', printContext, ''); +// } + +// if (node.type == "ReturnStatement") { +// result += currentTabs + `return ${toCode(node.returnValue, printContext)}` +// } + +// if (node.type == "ExpressionStatement") { +// result += currentTabs + toCode(node.expression, printContext) +// } + +// if (node.type == "TypeParametersExpression") { +// if (node.typeParameters.length > 0) { +// result += '<'; +// result += toCodeArray(node.typeParameters, ',', '', printContext, ''); +// result += '>'; +// } +// } + +// if (node.type == "StructDeclaration") { +// result += currentTabs + `export interface ${toCode(node.name, printContext)}${toCode(node.typeParametersExpression, printContext)} { +// ${toCodeArray(node.fields, '\n', '\treadonly ', printContext, ';')} +// ${currentTabs}};` +// } + +// if (node.type == "UnionTypeDeclaration") { +// result += currentTabs + `export type ${toCode(node.name, printContext)} = ${toCode(node.union, printContext)};` +// } + +// if (node.type == "UnionTypeExpression") { +// return `${toCodeArray(node.unionMembers, ' | ', '', printContext, '')}` +// } + +// if (node.type == "FunctionCall") { +// result += `${toCode(node.functionId, printContext)}${node.typeParameters ? toCode(node.typeParameters, printContext) : ''}(${toCodeArray(node.parameters, ', ', '', printContext, '')})` +// } if (node.type == "StringLiteral") { - result += `'${node.value}'` + code.add(`'${node.value}'`, false) } - if (node.type == "MemberExpression") { - result += toCode(node.thisObject, printContext) + '.' + toCode(node.memberName, printContext); - } +// if (node.type == "MemberExpression") { +// result += toCode(node.thisObject, printContext) + '.' + toCode(node.memberName, printContext); +// } - if (node.type == "IfStatement") { - result += `${currentTabs}if (${toCode(node.condition, printContext)}) { - ${toCodeArray(node.body, '\n', '', addTab(printContext), ';')} - ${currentTabs}}` - } +// if (node.type == "IfStatement") { +// result += `${currentTabs}if (${toCode(node.condition, printContext)}) { +// ${toCodeArray(node.body, '\n', '', addTab(printContext), ';')} +// ${currentTabs}}` +// } - if (node.type == "ForCycle") { - result += `${currentTabs}for (${toCode(node.init, printContext)};${toCode(node.cond, printContext)};${toCode(node.inc, printContext)}) { - ${toCodeArray(node.body, '\n', '', addTab(printContext), ';')} - ${currentTabs}}` - } +// if (node.type == "ForCycle") { +// result += `${currentTabs}for (${toCode(node.init, printContext)};${toCode(node.cond, printContext)};${toCode(node.inc, printContext)}) { +// ${toCodeArray(node.body, '\n', '', addTab(printContext), ';')} +// ${currentTabs}}` +// } - if (node.type == "UnaryOpExpression") { - result += `(${node.unaryOperator}${toCode(node.expr, printContext)})` - } +// if (node.type == "UnaryOpExpression") { +// result += `(${node.unaryOperator}${toCode(node.expr, printContext)})` +// } - if (node.type == "BinaryExpression") { - result += `(${toCode(node.left, printContext)} ${node.binarySign} ${toCode(node.right, printContext)})` - } +// if (node.type == "BinaryExpression") { +// result += `(${toCode(node.left, printContext)} ${node.binarySign} ${toCode(node.right, printContext)})` +// } - if (node.type == "TernaryExpression") { - result += `(${toCode(node.condition, printContext)} ? ${toCode(node.body, printContext)} : ${toCode(node.elseBody, printContext)})` - } +// if (node.type == "TernaryExpression") { +// result += `(${toCode(node.condition, printContext)} ? ${toCode(node.body, printContext)} : ${toCode(node.elseBody, printContext)})` +// } - return result; + return code.render(); } diff --git a/src/codegen/util.ts b/src/codegen/util.ts index d052819..07fae15 100644 --- a/src/codegen/util.ts +++ b/src/codegen/util.ts @@ -2,7 +2,7 @@ import { SimpleExpr, NameExpr, NumberExpr, MathExpr, FieldBuiltinDef, NegateExpr import { TLBMathExpr, TLBVarExpr, TLBNumberExpr, TLBBinaryOp, TLBCode, TLBType, TLBConstructorTag, TLBConstructor, TLBParameter, TLBVariable } from "../codegen/ast" import { calculateOpcode, goodVariableName, isBadVarName } from "./helpers"; import { Identifier, Expression, BinaryExpression } from "./tsgen"; -import { tIdentifier, tArrowFunctionExpression, tArrowFunctionType, tBinaryExpression, tBinaryNumericLiteral, tDeclareVariable, tExpressionStatement, tFunctionCall, tFunctionDeclaration, tIfStatement, tImportDeclaration, tMemberExpression, tNumericLiteral, tObjectExpression, tObjectProperty, tReturnStatement, tStringLiteral, tStructDeclaration, tTypeParametersExpression, tTypeWithParameters, tTypedIdentifier, tUnionTypeDeclaration, toCode, toCodeArray } from './tsgen' +import { tIdentifier, tArrowFunctionExpression, tArrowFunctionType, tBinaryExpression, tBinaryNumericLiteral, tDeclareVariable, tExpressionStatement, tFunctionCall, tFunctionDeclaration, tIfStatement, tImportDeclaration, tMemberExpression, tNumericLiteral, tObjectExpression, tObjectProperty, tReturnStatement, tStringLiteral, tStructDeclaration, tTypeParametersExpression, tTypeWithParameters, tTypedIdentifier, tUnionTypeDeclaration, toCode } from './tsgen' import util from 'util' export function convertToMathExpr(mathExpr: SimpleExpr | NameExpr | NumberExpr | CompareExpr, negated: boolean = false): TLBMathExpr { From 4819a39f0601f981fec7097f83174fee1ff1e81e Mon Sep 17 00:00:00 2001 From: polyprogrammist Date: Mon, 11 Dec 2023 22:28:33 -0500 Subject: [PATCH 02/10] tmp --- src/codegen/main.ts | 2 +- src/codegen/tsgen.ts | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/codegen/main.ts b/src/codegen/main.ts index ae8e19e..a8c9555 100644 --- a/src/codegen/main.ts +++ b/src/codegen/main.ts @@ -178,7 +178,7 @@ export function generate(tree: Program, input: string) { }); jsCodeDeclarations.forEach(element => { - generatedCode += toCode(element, new CodeBuilder()) + '\n'; + generatedCode += toCode(element, new CodeBuilder()).render() + '\n'; }); return generatedCode; } \ No newline at end of file diff --git a/src/codegen/tsgen.ts b/src/codegen/tsgen.ts index f336b68..1172a95 100644 --- a/src/codegen/tsgen.ts +++ b/src/codegen/tsgen.ts @@ -304,7 +304,7 @@ export function tMultiStatement(statements: Array): MultiStatement { // return parameters; // } -export function toCode(node: TheNode, code: CodeBuilder): string { +export function toCode(node: TheNode, code: CodeBuilder): CodeBuilder { if (node.type == "Identifier") { code.add(node.name, false); } @@ -314,10 +314,7 @@ export function toCode(node: TheNode, code: CodeBuilder): string { } if (node.type == "ImportDeclaration") { - code.add(`import { `, false); - toCode(node.importValue, code); - code.add(` } from `, false) - toCode(node.from, code) + code.add(`import { ${toCode(node.importValue, new CodeBuilder()).render()} } from ${toCode(node.from, new CodeBuilder()).render()}`, false); } // if (node.type == "FunctionDeclaration") { @@ -428,5 +425,5 @@ export function toCode(node: TheNode, code: CodeBuilder): string { // result += `(${toCode(node.condition, printContext)} ? ${toCode(node.body, printContext)} : ${toCode(node.elseBody, printContext)})` // } - return code.render(); + return code; } From de0a05494f5af24a6900b196d1b8eac1471f9036 Mon Sep 17 00:00:00 2001 From: polyprogrammist Date: Mon, 11 Dec 2023 23:43:09 -0500 Subject: [PATCH 03/10] tmp --- generated_block.ts | 14708 +++++++++++++++++++++++++++++++++++++++++ generated_test.ts | 2733 ++++++++ src/codegen/tsgen.ts | 212 +- 3 files changed, 17569 insertions(+), 84 deletions(-) diff --git a/generated_block.ts b/generated_block.ts index a242c49..e9512ba 100644 --- a/generated_block.ts +++ b/generated_block.ts @@ -2,774 +2,15482 @@ import { Builder } from 'ton' import { Slice } from 'ton' import { beginCell } from 'ton' import { BitString } from 'ton' +export interface Unit { +readonly kind: 'Unit' +} + +export interface True { +readonly kind: 'True' +} + +export type Bool = Bool_bool_false | Bool_bool_true; + +export interface Bool_bool_false { +readonly kind: 'Bool_bool_false' +} + +export interface Bool_bool_true { +readonly kind: 'Bool_bool_true' +} + +export interface BoolFalse { +readonly kind: 'BoolFalse' +} + +export interface BoolTrue { +readonly kind: 'BoolTrue' +} + +export type Maybe = Maybe_nothing | Maybe_just; + +export interface Maybe_nothing { +readonly kind: 'Maybe_nothing' +} + +export interface Maybe_just { +readonly kind: 'Maybe_just' +readonly value: X +} + +export type Either = Either_left | Either_right; + +export interface Either_left { +readonly kind: 'Either_left' +readonly value: X +} + +export interface Either_right { +readonly kind: 'Either_right' +readonly value: Y +} + +export interface Both { +readonly kind: 'Both' +readonly first: X +readonly second: Y +} + +export interface Bit { +readonly kind: 'Bit' +readonly anon0: number +} + +export interface Hashmap { +readonly kind: 'Hashmap' +readonly n: number +readonly l: number +readonly m: number +readonly label: HmLabel +readonly node: HashmapNode +} + +export type HashmapNode = HashmapNode_hmn_leaf | HashmapNode_hmn_fork; + +export interface HashmapNode_hmn_leaf { +readonly kind: 'HashmapNode_hmn_leaf' +readonly value: X +} + +export interface HashmapNode_hmn_fork { +readonly kind: 'HashmapNode_hmn_fork' +readonly n: number +readonly left: Hashmap +readonly right: Hashmap +} + +export type HmLabel = HmLabel_hml_short | HmLabel_hml_long | HmLabel_hml_same; + +export interface HmLabel_hml_short { +readonly kind: 'HmLabel_hml_short' +readonly m: number +readonly n: number +readonly len: Unary +readonly s: Array +} + +export interface HmLabel_hml_long { +readonly kind: 'HmLabel_hml_long' +readonly m: number +readonly n: number +readonly s: Array +} + +export interface HmLabel_hml_same { +readonly kind: 'HmLabel_hml_same' +readonly m: number +readonly v: BitString +readonly n: number +} + +export type Unary = Unary_unary_zero | Unary_unary_succ; + +export interface Unary_unary_zero { +readonly kind: 'Unary_unary_zero' +} + +export interface Unary_unary_succ { +readonly kind: 'Unary_unary_succ' +readonly n: number +readonly x: Unary +} + +export type HashmapE = HashmapE_hme_empty | HashmapE_hme_root; + +export interface HashmapE_hme_empty { +readonly kind: 'HashmapE_hme_empty' +readonly n: number +} + +export interface HashmapE_hme_root { +readonly kind: 'HashmapE_hme_root' +readonly n: number +readonly root: Hashmap +} + +export interface BitstringSet { +readonly kind: 'BitstringSet' +readonly n: number +readonly _: Hashmap +} + +export interface HashmapAug { +readonly kind: 'HashmapAug' +readonly n: number +readonly l: number +readonly m: number +readonly label: HmLabel +readonly node: HashmapAugNode +} + +export type HashmapAugNode = HashmapAugNode_ahmn_leaf | HashmapAugNode_ahmn_fork; + +export interface HashmapAugNode_ahmn_leaf { +readonly kind: 'HashmapAugNode_ahmn_leaf' +readonly extra: Y +readonly value: X +} + +export interface HashmapAugNode_ahmn_fork { +readonly kind: 'HashmapAugNode_ahmn_fork' +readonly n: number +readonly left: HashmapAug +readonly right: HashmapAug +readonly extra: Y +} + +export type HashmapAugE = HashmapAugE_ahme_empty | HashmapAugE_ahme_root; + +export interface HashmapAugE_ahme_empty { +readonly kind: 'HashmapAugE_ahme_empty' +readonly n: number +readonly extra: Y +} + +export interface HashmapAugE_ahme_root { +readonly kind: 'HashmapAugE_ahme_root' +readonly n: number +readonly root: HashmapAug +readonly extra: Y +} + +export interface VarHashmap { +readonly kind: 'VarHashmap' +readonly n: number +readonly l: number +readonly m: number +readonly label: HmLabel +readonly node: VarHashmapNode +} + +export type VarHashmapNode = VarHashmapNode_vhmn_leaf | VarHashmapNode_vhmn_fork | VarHashmapNode_vhmn_cont; + +export interface VarHashmapNode_vhmn_leaf { +readonly kind: 'VarHashmapNode_vhmn_leaf' +readonly n: number +readonly value: X +} + +export interface VarHashmapNode_vhmn_fork { +readonly kind: 'VarHashmapNode_vhmn_fork' +readonly n: number +readonly left: VarHashmap +readonly right: VarHashmap +readonly value: Maybe +} + +export interface VarHashmapNode_vhmn_cont { +readonly kind: 'VarHashmapNode_vhmn_cont' +readonly n: number +readonly branch: BitString +readonly child: VarHashmap +readonly value: X +} + +export type VarHashmapE = VarHashmapE_vhme_empty | VarHashmapE_vhme_root; + +export interface VarHashmapE_vhme_empty { +readonly kind: 'VarHashmapE_vhme_empty' +readonly n: number +} + +export interface VarHashmapE_vhme_root { +readonly kind: 'VarHashmapE_vhme_root' +readonly n: number +readonly root: VarHashmap +} + +export interface PfxHashmap { +readonly kind: 'PfxHashmap' +readonly n: number +readonly l: number +readonly m: number +readonly label: HmLabel +readonly node: PfxHashmapNode +} + +export type PfxHashmapNode = PfxHashmapNode_phmn_leaf | PfxHashmapNode_phmn_fork; + +export interface PfxHashmapNode_phmn_leaf { +readonly kind: 'PfxHashmapNode_phmn_leaf' +readonly n: number +readonly value: X +} + +export interface PfxHashmapNode_phmn_fork { +readonly kind: 'PfxHashmapNode_phmn_fork' +readonly n: number +readonly left: PfxHashmap +readonly right: PfxHashmap +} + +export type PfxHashmapE = PfxHashmapE_phme_empty | PfxHashmapE_phme_root; + +export interface PfxHashmapE_phme_empty { +readonly kind: 'PfxHashmapE_phme_empty' +readonly n: number +} + +export interface PfxHashmapE_phme_root { +readonly kind: 'PfxHashmapE_phme_root' +readonly n: number +readonly root: PfxHashmap +} + +export type MsgAddressExt = MsgAddressExt_addr_none | MsgAddressExt_addr_extern; + +export interface MsgAddressExt_addr_none { +readonly kind: 'MsgAddressExt_addr_none' +} + +export interface MsgAddressExt_addr_extern { +readonly kind: 'MsgAddressExt_addr_extern' +readonly len: number +readonly external_address: BitString +} + +export interface Anycast { +readonly kind: 'Anycast' +readonly depth: number +readonly rewrite_pfx: BitString +} + +export type MsgAddressInt = MsgAddressInt_addr_std | MsgAddressInt_addr_var; + +export interface MsgAddressInt_addr_std { +readonly kind: 'MsgAddressInt_addr_std' +readonly anycast: Maybe +readonly workchain_id: number +readonly address: BitString +} + +export interface MsgAddressInt_addr_var { +readonly kind: 'MsgAddressInt_addr_var' +readonly anycast: Maybe +readonly addr_len: number +readonly workchain_id: number +readonly address: BitString +} + +export type MsgAddress = MsgAddress__ | MsgAddress__1; + +export interface MsgAddress__ { +readonly kind: 'MsgAddress__' +readonly _: MsgAddressInt +} + +export interface MsgAddress__1 { +readonly kind: 'MsgAddress__1' +readonly _: MsgAddressExt +} + +export interface VarUInteger { +readonly kind: 'VarUInteger' +readonly n: number +readonly len: number +readonly value: number +} + +export interface VarInteger { +readonly kind: 'VarInteger' +readonly n: number +readonly len: number +readonly value: number +} + +export interface Grams { +readonly kind: 'Grams' +readonly amount: VarUInteger +} + +export interface ExtraCurrencyCollection { +readonly kind: 'ExtraCurrencyCollection' +readonly dict: HashmapE +} + +export interface CurrencyCollection { +readonly kind: 'CurrencyCollection' +readonly grams: Grams +readonly other: ExtraCurrencyCollection +} + +export type CommonMsgInfo = CommonMsgInfo_int_msg_info | CommonMsgInfo_ext_in_msg_info | CommonMsgInfo_ext_out_msg_info; + +export interface CommonMsgInfo_int_msg_info { +readonly kind: 'CommonMsgInfo_int_msg_info' +readonly ihr_disabled: Bool +readonly bounce: Bool +readonly bounced: Bool +readonly src: MsgAddressInt +readonly dest: MsgAddressInt +readonly value: CurrencyCollection +readonly ihr_fee: Grams +readonly fwd_fee: Grams +readonly created_lt: number +readonly created_at: number +} + +export interface CommonMsgInfo_ext_in_msg_info { +readonly kind: 'CommonMsgInfo_ext_in_msg_info' +readonly src: MsgAddressExt +readonly dest: MsgAddressInt +readonly import_fee: Grams +} + +export interface CommonMsgInfo_ext_out_msg_info { +readonly kind: 'CommonMsgInfo_ext_out_msg_info' +readonly src: MsgAddressInt +readonly dest: MsgAddressExt +readonly created_lt: number +readonly created_at: number +} + +export type CommonMsgInfoRelaxed = CommonMsgInfoRelaxed_int_msg_info | CommonMsgInfoRelaxed_ext_out_msg_info; + +export interface CommonMsgInfoRelaxed_int_msg_info { +readonly kind: 'CommonMsgInfoRelaxed_int_msg_info' +readonly ihr_disabled: Bool +readonly bounce: Bool +readonly bounced: Bool +readonly src: MsgAddress +readonly dest: MsgAddressInt +readonly value: CurrencyCollection +readonly ihr_fee: Grams +readonly fwd_fee: Grams +readonly created_lt: number +readonly created_at: number +} + +export interface CommonMsgInfoRelaxed_ext_out_msg_info { +readonly kind: 'CommonMsgInfoRelaxed_ext_out_msg_info' +readonly src: MsgAddress +readonly dest: MsgAddressExt +readonly created_lt: number +readonly created_at: number +} + +export interface TickTock { +readonly kind: 'TickTock' +readonly tick: Bool +readonly tock: Bool +} + +export interface StateInit { +readonly kind: 'StateInit' +readonly split_depth: Maybe +readonly special: Maybe +readonly code: Maybe +readonly data: Maybe +readonly library: HashmapE +} + +export interface SimpleLib { +readonly kind: 'SimpleLib' +readonly public0: Bool +readonly root: Slice +} + +export interface Message { +readonly kind: 'Message' +readonly info: CommonMsgInfo +readonly init: Maybe> +readonly body: Either +} + +export interface MessageRelaxed { +readonly kind: 'MessageRelaxed' +readonly info: CommonMsgInfoRelaxed +readonly init: Maybe> +readonly body: Either +} + +export interface MessageAny { +readonly kind: 'MessageAny' +readonly anon0: Message +} + +export type IntermediateAddress = IntermediateAddress_interm_addr_regular | IntermediateAddress_interm_addr_simple | IntermediateAddress_interm_addr_ext; + +export interface IntermediateAddress_interm_addr_regular { +readonly kind: 'IntermediateAddress_interm_addr_regular' +readonly use_dest_bits: number +} + +export interface IntermediateAddress_interm_addr_simple { +readonly kind: 'IntermediateAddress_interm_addr_simple' +readonly workchain_id: number +readonly addr_pfx: number +} + +export interface IntermediateAddress_interm_addr_ext { +readonly kind: 'IntermediateAddress_interm_addr_ext' +readonly workchain_id: number +readonly addr_pfx: number +} + +export interface MsgEnvelope { +readonly kind: 'MsgEnvelope' +readonly cur_addr: IntermediateAddress +readonly next_addr: IntermediateAddress +readonly fwd_fee_remaining: Grams +readonly msg: Message +} + +export type InMsg = InMsg_msg_import_ext | InMsg_msg_import_ihr | InMsg_msg_import_imm | InMsg_msg_import_fin | InMsg_msg_import_tr | InMsg_msg_discard_fin | InMsg_msg_discard_tr; + +export interface InMsg_msg_import_ext { +readonly kind: 'InMsg_msg_import_ext' +readonly msg: Message +readonly transaction: Transaction +} + +export interface InMsg_msg_import_ihr { +readonly kind: 'InMsg_msg_import_ihr' +readonly msg: Message +readonly transaction: Transaction +readonly ihr_fee: Grams +readonly proof_created: Slice +} + +export interface InMsg_msg_import_imm { +readonly kind: 'InMsg_msg_import_imm' +readonly in_msg: MsgEnvelope +readonly transaction: Transaction +readonly fwd_fee: Grams +} + +export interface InMsg_msg_import_fin { +readonly kind: 'InMsg_msg_import_fin' +readonly in_msg: MsgEnvelope +readonly transaction: Transaction +readonly fwd_fee: Grams +} + +export interface InMsg_msg_import_tr { +readonly kind: 'InMsg_msg_import_tr' +readonly in_msg: MsgEnvelope +readonly out_msg: MsgEnvelope +readonly transit_fee: Grams +} + +export interface InMsg_msg_discard_fin { +readonly kind: 'InMsg_msg_discard_fin' +readonly in_msg: MsgEnvelope +readonly transaction_id: number +readonly fwd_fee: Grams +} + +export interface InMsg_msg_discard_tr { +readonly kind: 'InMsg_msg_discard_tr' +readonly in_msg: MsgEnvelope +readonly transaction_id: number +readonly fwd_fee: Grams +readonly proof_delivered: Slice +} + +export interface ImportFees { +readonly kind: 'ImportFees' +readonly fees_collected: Grams +readonly value_imported: CurrencyCollection +} + +export interface InMsgDescr { +readonly kind: 'InMsgDescr' +readonly anon0: HashmapAugE +} + +export type OutMsg = OutMsg_msg_export_ext | OutMsg_msg_export_imm | OutMsg_msg_export_new | OutMsg_msg_export_tr | OutMsg_msg_export_deq | OutMsg_msg_export_deq_short | OutMsg_msg_export_tr_req | OutMsg_msg_export_deq_imm; + +export interface OutMsg_msg_export_ext { +readonly kind: 'OutMsg_msg_export_ext' +readonly msg: Message +readonly transaction: Transaction +} + +export interface OutMsg_msg_export_imm { +readonly kind: 'OutMsg_msg_export_imm' +readonly out_msg: MsgEnvelope +readonly transaction: Transaction +readonly reimport: InMsg +} + +export interface OutMsg_msg_export_new { +readonly kind: 'OutMsg_msg_export_new' +readonly out_msg: MsgEnvelope +readonly transaction: Transaction +} + +export interface OutMsg_msg_export_tr { +readonly kind: 'OutMsg_msg_export_tr' +readonly out_msg: MsgEnvelope +readonly imported: InMsg +} + +export interface OutMsg_msg_export_deq { +readonly kind: 'OutMsg_msg_export_deq' +readonly out_msg: MsgEnvelope +readonly import_block_lt: number +} + +export interface OutMsg_msg_export_deq_short { +readonly kind: 'OutMsg_msg_export_deq_short' +readonly msg_env_hash: BitString +readonly next_workchain: number +readonly next_addr_pfx: number +readonly import_block_lt: number +} + +export interface OutMsg_msg_export_tr_req { +readonly kind: 'OutMsg_msg_export_tr_req' +readonly out_msg: MsgEnvelope +readonly imported: InMsg +} + +export interface OutMsg_msg_export_deq_imm { +readonly kind: 'OutMsg_msg_export_deq_imm' +readonly out_msg: MsgEnvelope +readonly reimport: InMsg +} + +export interface EnqueuedMsg { +readonly kind: 'EnqueuedMsg' +readonly enqueued_lt: number +readonly out_msg: MsgEnvelope +} + +export interface OutMsgDescr { +readonly kind: 'OutMsgDescr' +readonly anon0: HashmapAugE +} + +export interface OutMsgQueue { +readonly kind: 'OutMsgQueue' +readonly anon0: HashmapAugE +} + +export interface ProcessedUpto { +readonly kind: 'ProcessedUpto' +readonly last_msg_lt: number +readonly last_msg_hash: BitString +} + +export interface ProcessedInfo { +readonly kind: 'ProcessedInfo' +readonly anon0: HashmapE +} + +export interface IhrPendingSince { +readonly kind: 'IhrPendingSince' +readonly import_lt: number +} + +export interface IhrPendingInfo { +readonly kind: 'IhrPendingInfo' +readonly anon0: HashmapE +} + +export interface OutMsgQueueInfo { +readonly kind: 'OutMsgQueueInfo' +readonly out_queue: OutMsgQueue +readonly proc_info: ProcessedInfo +readonly ihr_pending: IhrPendingInfo +} + +export interface StorageUsed { +readonly kind: 'StorageUsed' +readonly _cells: VarUInteger +readonly bits: VarUInteger +readonly public_cells: VarUInteger +} + +export interface StorageUsedShort { +readonly kind: 'StorageUsedShort' +readonly _cells: VarUInteger +readonly bits: VarUInteger +} + +export interface StorageInfo { +readonly kind: 'StorageInfo' +readonly used: StorageUsed +readonly last_paid: number +readonly due_payment: Maybe +} + +export type Account = Account_account_none | Account_account; + +export interface Account_account_none { +readonly kind: 'Account_account_none' +} + +export interface Account_account { +readonly kind: 'Account_account' +readonly addr: MsgAddressInt +readonly storage_stat: StorageInfo +readonly storage: AccountStorage +} + +export interface AccountStorage { +readonly kind: 'AccountStorage' +readonly last_trans_lt: number +readonly balance: CurrencyCollection +readonly state: AccountState +} + +export type AccountState = AccountState_account_uninit | AccountState_account_active | AccountState_account_frozen; + +export interface AccountState_account_uninit { +readonly kind: 'AccountState_account_uninit' +} + +export interface AccountState_account_active { +readonly kind: 'AccountState_account_active' +readonly _: StateInit +} + +export interface AccountState_account_frozen { +readonly kind: 'AccountState_account_frozen' +readonly state_hash: BitString +} + +export type AccountStatus = AccountStatus_acc_state_uninit | AccountStatus_acc_state_frozen | AccountStatus_acc_state_active | AccountStatus_acc_state_nonexist; + +export interface AccountStatus_acc_state_uninit { +readonly kind: 'AccountStatus_acc_state_uninit' +} + +export interface AccountStatus_acc_state_frozen { +readonly kind: 'AccountStatus_acc_state_frozen' +} + +export interface AccountStatus_acc_state_active { +readonly kind: 'AccountStatus_acc_state_active' +} + +export interface AccountStatus_acc_state_nonexist { +readonly kind: 'AccountStatus_acc_state_nonexist' +} + +export interface ShardAccount { +readonly kind: 'ShardAccount' +readonly account: Account +readonly last_trans_hash: BitString +readonly last_trans_lt: number +} + +export interface DepthBalanceInfo { +readonly kind: 'DepthBalanceInfo' +readonly split_depth: number +readonly balance: CurrencyCollection +} + +export interface ShardAccounts { +readonly kind: 'ShardAccounts' +readonly anon0: HashmapAugE +} + +export interface Transaction { +readonly kind: 'Transaction' +readonly account_addr: BitString +readonly lt: number +readonly prev_trans_hash: BitString +readonly prev_trans_lt: number +readonly now: number +readonly outmsg_cnt: number +readonly orig_status: AccountStatus +readonly end_status: AccountStatus +readonly in_msg: Maybe> +readonly out_msgs: HashmapE> +readonly total_fees: CurrencyCollection +readonly state_update: HASH_UPDATE +readonly description: TransactionDescr +} + +export interface MERKLE_UPDATE { +readonly kind: 'MERKLE_UPDATE' +readonly old_hash: BitString +readonly new_hash: BitString +readonly old: X +readonly new0: X +} + +export interface HASH_UPDATE { +readonly kind: 'HASH_UPDATE' +readonly old_hash: BitString +readonly new_hash: BitString +} + +export interface MERKLE_PROOF { +readonly kind: 'MERKLE_PROOF' +readonly virtual_hash: BitString +readonly depth: number +readonly virtual_root: X +} + +export interface AccountBlock { +readonly kind: 'AccountBlock' +readonly account_addr: BitString +readonly transactions: HashmapAug +readonly state_update: HASH_UPDATE +} + +export interface ShardAccountBlocks { +readonly kind: 'ShardAccountBlocks' +readonly anon0: HashmapAugE +} + +export interface TrStoragePhase { +readonly kind: 'TrStoragePhase' +readonly storage_fees_collected: Grams +readonly storage_fees_due: Maybe +readonly status_change: AccStatusChange +} + +export type AccStatusChange = AccStatusChange_acst_unchanged | AccStatusChange_acst_frozen | AccStatusChange_acst_deleted; + +export interface AccStatusChange_acst_unchanged { +readonly kind: 'AccStatusChange_acst_unchanged' +} + +export interface AccStatusChange_acst_frozen { +readonly kind: 'AccStatusChange_acst_frozen' +} + +export interface AccStatusChange_acst_deleted { +readonly kind: 'AccStatusChange_acst_deleted' +} + +export interface TrCreditPhase { +readonly kind: 'TrCreditPhase' +readonly due_fees_collected: Maybe +readonly credit: CurrencyCollection +} + +export type TrComputePhase = TrComputePhase_tr_phase_compute_skipped | TrComputePhase_tr_phase_compute_vm; + +export interface TrComputePhase_tr_phase_compute_skipped { +readonly kind: 'TrComputePhase_tr_phase_compute_skipped' +readonly reason: ComputeSkipReason +} + +export interface TrComputePhase_tr_phase_compute_vm { +readonly kind: 'TrComputePhase_tr_phase_compute_vm' +readonly success: Bool +readonly msg_state_used: Bool +readonly account_activated: Bool +readonly gas_fees: Grams +readonly gas_used: VarUInteger +readonly gas_limit: VarUInteger +readonly gas_credit: Maybe +readonly mode: number +readonly exit_code: number +readonly exit_arg: Maybe +readonly vm_steps: number +readonly vm_init_state_hash: BitString +readonly vm_final_state_hash: BitString +} + +export type ComputeSkipReason = ComputeSkipReason_cskip_no_state | ComputeSkipReason_cskip_bad_state | ComputeSkipReason_cskip_no_gas; + +export interface ComputeSkipReason_cskip_no_state { +readonly kind: 'ComputeSkipReason_cskip_no_state' +} + +export interface ComputeSkipReason_cskip_bad_state { +readonly kind: 'ComputeSkipReason_cskip_bad_state' +} + +export interface ComputeSkipReason_cskip_no_gas { +readonly kind: 'ComputeSkipReason_cskip_no_gas' +} + +export interface TrActionPhase { +readonly kind: 'TrActionPhase' +readonly success: Bool +readonly valid: Bool +readonly no_funds: Bool +readonly status_change: AccStatusChange +readonly total_fwd_fees: Maybe +readonly total_action_fees: Maybe +readonly result_code: number +readonly result_arg: Maybe +readonly tot_actions: number +readonly spec_actions: number +readonly skipped_actions: number +readonly msgs_created: number +readonly action_list_hash: BitString +readonly tot_msg_size: StorageUsedShort +} + +export type TrBouncePhase = TrBouncePhase_tr_phase_bounce_negfunds | TrBouncePhase_tr_phase_bounce_nofunds | TrBouncePhase_tr_phase_bounce_ok; + +export interface TrBouncePhase_tr_phase_bounce_negfunds { +readonly kind: 'TrBouncePhase_tr_phase_bounce_negfunds' +} + +export interface TrBouncePhase_tr_phase_bounce_nofunds { +readonly kind: 'TrBouncePhase_tr_phase_bounce_nofunds' +readonly msg_size: StorageUsedShort +readonly req_fwd_fees: Grams +} + +export interface TrBouncePhase_tr_phase_bounce_ok { +readonly kind: 'TrBouncePhase_tr_phase_bounce_ok' +readonly msg_size: StorageUsedShort +readonly msg_fees: Grams +readonly fwd_fees: Grams +} + +export type TransactionDescr = TransactionDescr_trans_ord | TransactionDescr_trans_storage | TransactionDescr_trans_tick_tock | TransactionDescr_trans_split_prepare | TransactionDescr_trans_split_install | TransactionDescr_trans_merge_prepare | TransactionDescr_trans_merge_install; + +export interface TransactionDescr_trans_ord { +readonly kind: 'TransactionDescr_trans_ord' +readonly credit_first: Bool +readonly storage_ph: Maybe +readonly credit_ph: Maybe +readonly compute_ph: TrComputePhase +readonly action: Maybe +readonly aborted: Bool +readonly bounce: Maybe +readonly destroyed: Bool +} + +export interface TransactionDescr_trans_storage { +readonly kind: 'TransactionDescr_trans_storage' +readonly storage_ph: TrStoragePhase +} + +export interface TransactionDescr_trans_tick_tock { +readonly kind: 'TransactionDescr_trans_tick_tock' +readonly is_tock: Bool +readonly storage_ph: TrStoragePhase +readonly compute_ph: TrComputePhase +readonly action: Maybe +readonly aborted: Bool +readonly destroyed: Bool +} + +export interface TransactionDescr_trans_split_prepare { +readonly kind: 'TransactionDescr_trans_split_prepare' +readonly split_info: SplitMergeInfo +readonly storage_ph: Maybe +readonly compute_ph: TrComputePhase +readonly action: Maybe +readonly aborted: Bool +readonly destroyed: Bool +} + +export interface TransactionDescr_trans_split_install { +readonly kind: 'TransactionDescr_trans_split_install' +readonly split_info: SplitMergeInfo +readonly prepare_transaction: Transaction +readonly installed: Bool +} + +export interface TransactionDescr_trans_merge_prepare { +readonly kind: 'TransactionDescr_trans_merge_prepare' +readonly split_info: SplitMergeInfo +readonly storage_ph: TrStoragePhase +readonly aborted: Bool +} + +export interface TransactionDescr_trans_merge_install { +readonly kind: 'TransactionDescr_trans_merge_install' +readonly split_info: SplitMergeInfo +readonly prepare_transaction: Transaction +readonly storage_ph: Maybe +readonly credit_ph: Maybe +readonly compute_ph: TrComputePhase +readonly action: Maybe +readonly aborted: Bool +readonly destroyed: Bool +} + +export interface SplitMergeInfo { +readonly kind: 'SplitMergeInfo' +readonly cur_shard_pfx_len: number +readonly acc_split_depth: number +readonly this_addr: BitString +readonly sibling_addr: BitString +} + +export interface SmartContractInfo { +readonly kind: 'SmartContractInfo' +readonly actions: number +readonly msgs_sent: number +readonly unixtime: number +readonly block_lt: number +readonly trans_lt: number +readonly rand_seed: BitString +readonly balance_remaining: CurrencyCollection +readonly myself: MsgAddressInt +} + +export type OutList = OutList_out_list_empty | OutList_out_list; + +export interface OutList_out_list_empty { +readonly kind: 'OutList_out_list_empty' +} + +export interface OutList_out_list { +readonly kind: 'OutList_out_list' +readonly n: number +readonly prev: OutList +readonly action: OutAction +} + +export type OutAction = OutAction_action_send_msg | OutAction_action_set_code | OutAction_action_reserve_currency | OutAction_action_change_library; + +export interface OutAction_action_send_msg { +readonly kind: 'OutAction_action_send_msg' +readonly mode: number +readonly out_msg: MessageRelaxed +} + +export interface OutAction_action_set_code { +readonly kind: 'OutAction_action_set_code' +readonly new_code: Slice +} + +export interface OutAction_action_reserve_currency { +readonly kind: 'OutAction_action_reserve_currency' +readonly mode: number +readonly currency: CurrencyCollection +} + +export interface OutAction_action_change_library { +readonly kind: 'OutAction_action_change_library' +readonly mode: number +readonly libref: LibRef +} + +export type LibRef = LibRef_libref_hash | LibRef_libref_ref; + +export interface LibRef_libref_hash { +readonly kind: 'LibRef_libref_hash' +readonly lib_hash: BitString +} + +export interface LibRef_libref_ref { +readonly kind: 'LibRef_libref_ref' +readonly library: Slice +} + +export interface OutListNode { +readonly kind: 'OutListNode' +readonly prev: Slice +readonly action: OutAction +} + +export interface ShardIdent { +readonly kind: 'ShardIdent' +readonly shard_pfx_bits: number +readonly workchain_id: number +readonly shard_prefix: number +} + +export interface ExtBlkRef { +readonly kind: 'ExtBlkRef' +readonly end_lt: number +readonly seq_no: number +readonly root_hash: BitString +readonly file_hash: BitString +} + +export interface BlockIdExt { +readonly kind: 'BlockIdExt' +readonly shard_id: ShardIdent +readonly seq_no: number +readonly root_hash: BitString +readonly file_hash: BitString +} + +export interface BlkMasterInfo { +readonly kind: 'BlkMasterInfo' +readonly master: ExtBlkRef +} + +export interface ShardStateUnsplit { +readonly kind: 'ShardStateUnsplit' +readonly global_id: number +readonly shard_id: ShardIdent +readonly seq_no: number +readonly vert_seq_no: number +readonly gen_utime: number +readonly gen_lt: number +readonly min_ref_mc_seqno: number +readonly out_msg_queue_info: OutMsgQueueInfo +readonly before_split: number +readonly accounts: ShardAccounts +readonly overload_history: number +readonly underload_history: number +readonly total_balance: CurrencyCollection +readonly total_validator_fees: CurrencyCollection +readonly libraries: HashmapE +readonly master_ref: Maybe +readonly custom: Maybe +} + +export type ShardState = ShardState__ | ShardState_split_state; + +export interface ShardState__ { +readonly kind: 'ShardState__' +readonly anon0: ShardStateUnsplit +} + +export interface ShardState_split_state { +readonly kind: 'ShardState_split_state' +readonly left: ShardStateUnsplit +readonly right: ShardStateUnsplit +} + +export interface LibDescr { +readonly kind: 'LibDescr' +readonly lib: Slice +readonly publishers: Hashmap +} + +export interface BlockInfo { +readonly kind: 'BlockInfo' +readonly version: number +readonly not_master: number +readonly after_merge: number +readonly before_split: number +readonly after_split: number +readonly want_split: Bool +readonly want_merge: Bool +readonly key_block: Bool +readonly vert_seqno_incr: number +readonly flags: number +readonly seq_no: number +readonly vert_seq_no: number +readonly prev_seq_no: number +readonly shard: ShardIdent +readonly gen_utime: number +readonly start_lt: number +readonly end_lt: number +readonly gen_validator_list_hash_short: number +readonly gen_catchain_seqno: number +readonly min_ref_mc_seqno: number +readonly prev_key_block_seqno: number +readonly gen_software: GlobalVersion | undefined +readonly master_ref: BlkMasterInfo | undefined +readonly prev_ref: BlkPrevInfo +readonly prev_vert_ref: BlkPrevInfo | undefined +} + +export type BlkPrevInfo = BlkPrevInfo_prev_blk_info | BlkPrevInfo_prev_blks_info; + +export interface BlkPrevInfo_prev_blk_info { +readonly kind: 'BlkPrevInfo_prev_blk_info' +readonly prev: ExtBlkRef +} + +export interface BlkPrevInfo_prev_blks_info { +readonly kind: 'BlkPrevInfo_prev_blks_info' +readonly prev1: ExtBlkRef +readonly prev2: ExtBlkRef +} + +export interface Block { +readonly kind: 'Block' +readonly global_id: number +readonly info: BlockInfo +readonly value_flow: ValueFlow +readonly state_update: MERKLE_UPDATE +readonly extra: BlockExtra +} + +export interface BlockExtra { +readonly kind: 'BlockExtra' +readonly in_msg_descr: InMsgDescr +readonly out_msg_descr: OutMsgDescr +readonly account_blocks: ShardAccountBlocks +readonly rand_seed: BitString +readonly created_by: BitString +readonly custom: Maybe +} + +export interface ValueFlow { +readonly kind: 'ValueFlow' +readonly from_prev_blk: CurrencyCollection +readonly to_next_blk: CurrencyCollection +readonly imported: CurrencyCollection +readonly exported: CurrencyCollection +readonly fees_collected: CurrencyCollection +readonly fees_imported: CurrencyCollection +readonly recovered: CurrencyCollection +readonly created: CurrencyCollection +readonly minted: CurrencyCollection +} + +export type BinTree = BinTree_bt_leaf | BinTree_bt_fork; + +export interface BinTree_bt_leaf { +readonly kind: 'BinTree_bt_leaf' +readonly leaf: X +} + +export interface BinTree_bt_fork { +readonly kind: 'BinTree_bt_fork' +readonly left: BinTree +readonly right: BinTree +} + +export type FutureSplitMerge = FutureSplitMerge_fsm_none | FutureSplitMerge_fsm_split | FutureSplitMerge_fsm_merge; + +export interface FutureSplitMerge_fsm_none { +readonly kind: 'FutureSplitMerge_fsm_none' +} + +export interface FutureSplitMerge_fsm_split { +readonly kind: 'FutureSplitMerge_fsm_split' +readonly split_utime: number +readonly interval: number +} + +export interface FutureSplitMerge_fsm_merge { +readonly kind: 'FutureSplitMerge_fsm_merge' +readonly merge_utime: number +readonly interval: number +} + +export type ShardDescr = ShardDescr_shard_descr | ShardDescr_shard_descr_new; + +export interface ShardDescr_shard_descr { +readonly kind: 'ShardDescr_shard_descr' +readonly seq_no: number +readonly reg_mc_seqno: number +readonly start_lt: number +readonly end_lt: number +readonly root_hash: BitString +readonly file_hash: BitString +readonly before_split: Bool +readonly before_merge: Bool +readonly want_split: Bool +readonly want_merge: Bool +readonly nx_cc_updated: Bool +readonly flags: number +readonly next_catchain_seqno: number +readonly next_validator_shard: number +readonly min_ref_mc_seqno: number +readonly gen_utime: number +readonly split_merge_at: FutureSplitMerge +readonly fees_collected: CurrencyCollection +readonly funds_created: CurrencyCollection +} + +export interface ShardDescr_shard_descr_new { +readonly kind: 'ShardDescr_shard_descr_new' +readonly seq_no: number +readonly reg_mc_seqno: number +readonly start_lt: number +readonly end_lt: number +readonly root_hash: BitString +readonly file_hash: BitString +readonly before_split: Bool +readonly before_merge: Bool +readonly want_split: Bool +readonly want_merge: Bool +readonly nx_cc_updated: Bool +readonly flags: number +readonly next_catchain_seqno: number +readonly next_validator_shard: number +readonly min_ref_mc_seqno: number +readonly gen_utime: number +readonly split_merge_at: FutureSplitMerge +readonly fees_collected: CurrencyCollection +readonly funds_created: CurrencyCollection +} + +export interface ShardHashes { +readonly kind: 'ShardHashes' +readonly anon0: HashmapE> +} + +export type BinTreeAug = BinTreeAug_bta_leaf | BinTreeAug_bta_fork; + +export interface BinTreeAug_bta_leaf { +readonly kind: 'BinTreeAug_bta_leaf' +readonly extra: Y +readonly leaf: X +} + +export interface BinTreeAug_bta_fork { +readonly kind: 'BinTreeAug_bta_fork' +readonly left: BinTreeAug +readonly right: BinTreeAug +readonly extra: Y +} + +export interface ShardFeeCreated { +readonly kind: 'ShardFeeCreated' +readonly fees: CurrencyCollection +readonly create: CurrencyCollection +} + +export interface ShardFees { +readonly kind: 'ShardFees' +readonly anon0: HashmapAugE +} + +export interface ConfigParams { +readonly kind: 'ConfigParams' +readonly config_addr: BitString +readonly config: Hashmap +} + +export interface ValidatorInfo { +readonly kind: 'ValidatorInfo' +readonly validator_list_hash_short: number +readonly catchain_seqno: number +readonly nx_cc_updated: Bool +} + +export interface ValidatorBaseInfo { +readonly kind: 'ValidatorBaseInfo' +readonly validator_list_hash_short: number +readonly catchain_seqno: number +} + +export interface KeyMaxLt { +readonly kind: 'KeyMaxLt' +readonly key: Bool +readonly max_end_lt: number +} + +export interface KeyExtBlkRef { +readonly kind: 'KeyExtBlkRef' +readonly key: Bool +readonly blk_ref: ExtBlkRef +} + +export interface OldMcBlocksInfo { +readonly kind: 'OldMcBlocksInfo' +readonly anon0: HashmapAugE +} + +export interface Counters { +readonly kind: 'Counters' +readonly last_updated: number +readonly total: number +readonly cnt2048: number +readonly cnt65536: number +} + +export interface CreatorStats { +readonly kind: 'CreatorStats' +readonly mc_blocks: Counters +readonly shard_blocks: Counters +} + +export type BlockCreateStats = BlockCreateStats_block_create_stats | BlockCreateStats_block_create_stats_ext; + +export interface BlockCreateStats_block_create_stats { +readonly kind: 'BlockCreateStats_block_create_stats' +readonly counters: HashmapE +} + +export interface BlockCreateStats_block_create_stats_ext { +readonly kind: 'BlockCreateStats_block_create_stats_ext' +readonly counters: HashmapAugE +} + +export interface McStateExtra { +readonly kind: 'McStateExtra' +readonly shard_hashes: ShardHashes +readonly config: ConfigParams +readonly flags: number +readonly validator_info: ValidatorInfo +readonly prev_blocks: OldMcBlocksInfo +readonly after_key_block: Bool +readonly last_key_block: Maybe +readonly block_create_stats: BlockCreateStats | undefined +readonly global_balance: CurrencyCollection +} + +export interface SigPubKey { +readonly kind: 'SigPubKey' +readonly pubkey: BitString +} + +export interface CryptoSignatureSimple { +readonly kind: 'CryptoSignatureSimple' +readonly R: BitString +readonly s: BitString +} + +export type CryptoSignature = CryptoSignature__ | CryptoSignature_chained_signature; + +export interface CryptoSignature__ { +readonly kind: 'CryptoSignature__' +readonly anon0: CryptoSignatureSimple +} + +export interface CryptoSignature_chained_signature { +readonly kind: 'CryptoSignature_chained_signature' +readonly signed_cert: SignedCertificate +readonly temp_key_signature: CryptoSignatureSimple +} + +export interface CryptoSignaturePair { +readonly kind: 'CryptoSignaturePair' +readonly node_id_short: BitString +readonly sign: CryptoSignature +} + +export interface Certificate { +readonly kind: 'Certificate' +readonly temp_key: SigPubKey +readonly valid_since: number +readonly valid_until: number +} + +export interface CertificateEnv { +readonly kind: 'CertificateEnv' +readonly certificate: Certificate +} + +export interface SignedCertificate { +readonly kind: 'SignedCertificate' +readonly certificate: Certificate +readonly certificate_signature: CryptoSignature +} + +export interface McBlockExtra { +readonly kind: 'McBlockExtra' +readonly key_block: number +readonly shard_hashes: ShardHashes +readonly shard_fees: ShardFees +readonly prev_blk_signatures: HashmapE +readonly recover_create_msg: Maybe +readonly mint_msg: Maybe +readonly config: ConfigParams | undefined +} + +export type ValidatorDescr = ValidatorDescr_validator | ValidatorDescr_validator_addr; + +export interface ValidatorDescr_validator { +readonly kind: 'ValidatorDescr_validator' +readonly public_key: SigPubKey +readonly weight: number +} + +export interface ValidatorDescr_validator_addr { +readonly kind: 'ValidatorDescr_validator_addr' +readonly public_key: SigPubKey +readonly weight: number +readonly adnl_addr: BitString +} + +export type ValidatorSet = ValidatorSet_validators | ValidatorSet_validators_ext; + +export interface ValidatorSet_validators { +readonly kind: 'ValidatorSet_validators' +readonly utime_since: number +readonly utime_until: number +readonly total: number +readonly main: number +readonly list: Hashmap +} + +export interface ValidatorSet_validators_ext { +readonly kind: 'ValidatorSet_validators_ext' +readonly utime_since: number +readonly utime_until: number +readonly total: number +readonly main: number +readonly total_weight: number +readonly list: HashmapE +} + +export type ConfigParam = ConfigParam__ | ConfigParam__1 | ConfigParam__2 | ConfigParam__3 | ConfigParam__4 | ConfigParam__5 | ConfigParam__6 | ConfigParam__7 | ConfigParam__8 | ConfigParam__9 | ConfigParam__10 | ConfigParam__11 | ConfigParam__12 | ConfigParam__13 | ConfigParam__14 | ConfigParam__15 | ConfigParam__16 | ConfigParam__17 | ConfigParam__24 | ConfigParam__25 | ConfigParam__26 | ConfigParam__27 | ConfigParam__28 | ConfigParam__29 | ConfigParam__30 | ConfigParam__31 | ConfigParam__32 | ConfigParam__33 | ConfigParam__34 | ConfigParam__35 | ConfigParam__36 | ConfigParam__37 | ConfigParam_config_mc_gas_prices | ConfigParam_config_gas_prices | ConfigParam_config_mc_block_limits | ConfigParam_config_block_limits | ConfigParam_config_mc_fwd_prices | ConfigParam_config_fwd_prices; + +export interface ConfigParam__ { +readonly kind: 'ConfigParam__' +readonly config_addr: BitString +} + +export interface ConfigParam__1 { +readonly kind: 'ConfigParam__1' +readonly elector_addr: BitString +} + +export interface ConfigParam__2 { +readonly kind: 'ConfigParam__2' +readonly minter_addr: BitString +} + +export interface ConfigParam__3 { +readonly kind: 'ConfigParam__3' +readonly fee_collector_addr: BitString +} + +export interface ConfigParam__4 { +readonly kind: 'ConfigParam__4' +readonly dns_root_addr: BitString +} + +export interface ConfigParam__5 { +readonly kind: 'ConfigParam__5' +readonly mint_new_price: Grams +readonly mint_add_price: Grams +} + +export interface ConfigParam__6 { +readonly kind: 'ConfigParam__6' +readonly to_mint: ExtraCurrencyCollection +} + +export interface ConfigParam__7 { +readonly kind: 'ConfigParam__7' +readonly anon0: GlobalVersion +} + +export interface ConfigParam__8 { +readonly kind: 'ConfigParam__8' +readonly mandatory_params: Hashmap +} + +export interface ConfigParam__9 { +readonly kind: 'ConfigParam__9' +readonly critical_params: Hashmap +} + +export interface ConfigParam__10 { +readonly kind: 'ConfigParam__10' +readonly anon0: ConfigVotingSetup +} + +export interface ConfigParam__11 { +readonly kind: 'ConfigParam__11' +readonly workchains: HashmapE +} + +export interface ConfigParam__12 { +readonly kind: 'ConfigParam__12' +readonly anon0: ComplaintPricing +} + +export interface ConfigParam__13 { +readonly kind: 'ConfigParam__13' +readonly anon0: BlockCreateFees +} + +export interface ConfigParam__14 { +readonly kind: 'ConfigParam__14' +readonly validators_elected_for: number +readonly elections_start_before: number +readonly elections_end_before: number +readonly stake_held_for: number +} + +export interface ConfigParam__15 { +readonly kind: 'ConfigParam__15' +readonly max_validators: number +readonly max_main_validators: number +readonly min_validators: number +} + +export interface ConfigParam__16 { +readonly kind: 'ConfigParam__16' +readonly min_stake: Grams +readonly max_stake: Grams +readonly min_total_stake: Grams +readonly max_stake_factor: number +} + +export interface ConfigParam__17 { +readonly kind: 'ConfigParam__17' +readonly anon0: Hashmap +} + +export interface ConfigParam__24 { +readonly kind: 'ConfigParam__24' +readonly anon0: CatchainConfig +} + +export interface ConfigParam__25 { +readonly kind: 'ConfigParam__25' +readonly anon0: ConsensusConfig +} + +export interface ConfigParam__26 { +readonly kind: 'ConfigParam__26' +readonly fundamental_smc_addr: HashmapE +} + +export interface ConfigParam__27 { +readonly kind: 'ConfigParam__27' +readonly prev_validators: ValidatorSet +} + +export interface ConfigParam__28 { +readonly kind: 'ConfigParam__28' +readonly prev_temp_validators: ValidatorSet +} + +export interface ConfigParam__29 { +readonly kind: 'ConfigParam__29' +readonly cur_validators: ValidatorSet +} + +export interface ConfigParam__30 { +readonly kind: 'ConfigParam__30' +readonly cur_temp_validators: ValidatorSet +} + +export interface ConfigParam__31 { +readonly kind: 'ConfigParam__31' +readonly next_validators: ValidatorSet +} + +export interface ConfigParam__32 { +readonly kind: 'ConfigParam__32' +readonly next_temp_validators: ValidatorSet +} + +export interface ConfigParam__33 { +readonly kind: 'ConfigParam__33' +readonly anon0: HashmapE +} + +export interface ConfigParam__34 { +readonly kind: 'ConfigParam__34' +readonly anon0: MisbehaviourPunishmentConfig +} + +export interface ConfigParam__35 { +readonly kind: 'ConfigParam__35' +readonly anon0: OracleBridgeParams +} + +export interface ConfigParam__36 { +readonly kind: 'ConfigParam__36' +readonly anon0: OracleBridgeParams +} + +export interface ConfigParam__37 { +readonly kind: 'ConfigParam__37' +readonly anon0: OracleBridgeParams +} + +export interface ConfigParam_config_mc_gas_prices { +readonly kind: 'ConfigParam_config_mc_gas_prices' +readonly anon0: GasLimitsPrices +} + +export interface ConfigParam_config_gas_prices { +readonly kind: 'ConfigParam_config_gas_prices' +readonly anon0: GasLimitsPrices +} + +export interface ConfigParam_config_mc_block_limits { +readonly kind: 'ConfigParam_config_mc_block_limits' +readonly anon0: BlockLimits +} + +export interface ConfigParam_config_block_limits { +readonly kind: 'ConfigParam_config_block_limits' +readonly anon0: BlockLimits +} + +export interface ConfigParam_config_mc_fwd_prices { +readonly kind: 'ConfigParam_config_mc_fwd_prices' +readonly anon0: MsgForwardPrices +} + +export interface ConfigParam_config_fwd_prices { +readonly kind: 'ConfigParam_config_fwd_prices' +readonly anon0: MsgForwardPrices +} + +export interface GlobalVersion { +readonly kind: 'GlobalVersion' +readonly version: number +readonly capabilities: number +} + +export interface ConfigProposalSetup { +readonly kind: 'ConfigProposalSetup' +readonly min_tot_rounds: number +readonly max_tot_rounds: number +readonly min_wins: number +readonly max_losses: number +readonly min_store_sec: number +readonly max_store_sec: number +readonly bit_price: number +readonly _cell_price: number +} + +export interface ConfigVotingSetup { +readonly kind: 'ConfigVotingSetup' +readonly normal_params: ConfigProposalSetup +readonly critical_params: ConfigProposalSetup +} + +export interface ConfigProposal { +readonly kind: 'ConfigProposal' +readonly param_id: number +readonly param_value: Maybe +readonly if_hash_equal: Maybe +} + +export interface ConfigProposalStatus { +readonly kind: 'ConfigProposalStatus' +readonly expires: number +readonly proposal: ConfigProposal +readonly is_critical: Bool +readonly voters: HashmapE +readonly remaining_weight: number +readonly validator_set_id: number +readonly rounds_remaining: number +readonly wins: number +readonly losses: number +} + +export type WorkchainFormat = WorkchainFormat_wfmt_basic | WorkchainFormat_wfmt_ext; + +export interface WorkchainFormat_wfmt_basic { +readonly kind: 'WorkchainFormat_wfmt_basic' +readonly vm_version: number +readonly vm_mode: number +} + +export interface WorkchainFormat_wfmt_ext { +readonly kind: 'WorkchainFormat_wfmt_ext' +readonly min_addr_len: number +readonly max_addr_len: number +readonly addr_len_step: number +readonly workchain_type_id: number +} + +export interface WorkchainDescr { +readonly kind: 'WorkchainDescr' +readonly enabled_since: number +readonly actual_min_split: number +readonly min_split: number +readonly max_split: number +readonly basic: number +readonly active: Bool +readonly accept_msgs: Bool +readonly flags: number +readonly zerostate_root_hash: BitString +readonly zerostate_file_hash: BitString +readonly version: number +readonly format: WorkchainFormat +} + +export interface ComplaintPricing { +readonly kind: 'ComplaintPricing' +readonly deposit: Grams +readonly bit_price: Grams +readonly _cell_price: Grams +} + +export interface BlockCreateFees { +readonly kind: 'BlockCreateFees' +readonly masterchain_block_fee: Grams +readonly basechain_block_fee: Grams +} + +export interface StoragePrices { +readonly kind: 'StoragePrices' +readonly utime_since: number +readonly bit_price_ps: number +readonly _cell_price_ps: number +readonly mc_bit_price_ps: number +readonly mc_cell_price_ps: number +} + +export type GasLimitsPrices = GasLimitsPrices_gas_prices | GasLimitsPrices_gas_prices_ext | GasLimitsPrices_gas_flat_pfx; + +export interface GasLimitsPrices_gas_prices { +readonly kind: 'GasLimitsPrices_gas_prices' +readonly gas_price: number +readonly gas_limit: number +readonly gas_credit: number +readonly block_gas_limit: number +readonly freeze_due_limit: number +readonly delete_due_limit: number +} + +export interface GasLimitsPrices_gas_prices_ext { +readonly kind: 'GasLimitsPrices_gas_prices_ext' +readonly gas_price: number +readonly gas_limit: number +readonly special_gas_limit: number +readonly gas_credit: number +readonly block_gas_limit: number +readonly freeze_due_limit: number +readonly delete_due_limit: number +} + +export interface GasLimitsPrices_gas_flat_pfx { +readonly kind: 'GasLimitsPrices_gas_flat_pfx' +readonly flat_gas_limit: number +readonly flat_gas_price: number +readonly other: GasLimitsPrices +} + +export interface ParamLimits { +readonly kind: 'ParamLimits' +readonly underload: number +readonly soft_limit: number +readonly hard_limit: number +} + +export interface BlockLimits { +readonly kind: 'BlockLimits' +readonly bytes: ParamLimits +readonly gas: ParamLimits +readonly lt_delta: ParamLimits +} + +export interface MsgForwardPrices { +readonly kind: 'MsgForwardPrices' +readonly lump_price: number +readonly bit_price: number +readonly _cell_price: number +readonly ihr_price_factor: number +readonly first_frac: number +readonly next_frac: number +} + +export type CatchainConfig = CatchainConfig_catchain_config | CatchainConfig_catchain_config_new; + +export interface CatchainConfig_catchain_config { +readonly kind: 'CatchainConfig_catchain_config' +readonly mc_catchain_lifetime: number +readonly shard_catchain_lifetime: number +readonly shard_validators_lifetime: number +readonly shard_validators_num: number +} + +export interface CatchainConfig_catchain_config_new { +readonly kind: 'CatchainConfig_catchain_config_new' +readonly flags: number +readonly shuffle_mc_validators: Bool +readonly mc_catchain_lifetime: number +readonly shard_catchain_lifetime: number +readonly shard_validators_lifetime: number +readonly shard_validators_num: number +} + +export type ConsensusConfig = ConsensusConfig_consensus_config | ConsensusConfig_consensus_config_new | ConsensusConfig_consensus_config_v3 | ConsensusConfig_consensus_config_v4; + +export interface ConsensusConfig_consensus_config { +readonly kind: 'ConsensusConfig_consensus_config' +readonly round_candidates: number +readonly next_candidate_delay_ms: number +readonly consensus_timeout_ms: number +readonly fast_attempts: number +readonly attempt_duration: number +readonly catchain_max_deps: number +readonly max_block_bytes: number +readonly max_collated_bytes: number +} + +export interface ConsensusConfig_consensus_config_new { +readonly kind: 'ConsensusConfig_consensus_config_new' +readonly flags: number +readonly new_catchain_ids: Bool +readonly round_candidates: number +readonly next_candidate_delay_ms: number +readonly consensus_timeout_ms: number +readonly fast_attempts: number +readonly attempt_duration: number +readonly catchain_max_deps: number +readonly max_block_bytes: number +readonly max_collated_bytes: number +} + +export interface ConsensusConfig_consensus_config_v3 { +readonly kind: 'ConsensusConfig_consensus_config_v3' +readonly flags: number +readonly new_catchain_ids: Bool +readonly round_candidates: number +readonly next_candidate_delay_ms: number +readonly consensus_timeout_ms: number +readonly fast_attempts: number +readonly attempt_duration: number +readonly catchain_max_deps: number +readonly max_block_bytes: number +readonly max_collated_bytes: number +readonly proto_version: number +} + +export interface ConsensusConfig_consensus_config_v4 { +readonly kind: 'ConsensusConfig_consensus_config_v4' +readonly flags: number +readonly new_catchain_ids: Bool +readonly round_candidates: number +readonly next_candidate_delay_ms: number +readonly consensus_timeout_ms: number +readonly fast_attempts: number +readonly attempt_duration: number +readonly catchain_max_deps: number +readonly max_block_bytes: number +readonly max_collated_bytes: number +readonly proto_version: number +readonly catchain_max_blocks_coeff: number +} + +export interface ValidatorTempKey { +readonly kind: 'ValidatorTempKey' +readonly adnl_addr: BitString +readonly temp_public_key: SigPubKey +readonly seqno: number +readonly valid_until: number +} + +export interface ValidatorSignedTempKey { +readonly kind: 'ValidatorSignedTempKey' +readonly key: ValidatorTempKey +readonly signature: CryptoSignature +} + +export interface MisbehaviourPunishmentConfig { +readonly kind: 'MisbehaviourPunishmentConfig' +readonly default_flat_fine: Grams +readonly default_proportional_fine: number +readonly severity_flat_mult: number +readonly severity_proportional_mult: number +readonly unpunishable_interval: number +readonly long_interval: number +readonly long_flat_mult: number +readonly long_proportional_mult: number +readonly medium_interval: number +readonly medium_flat_mult: number +readonly medium_proportional_mult: number +} + +export interface OracleBridgeParams { +readonly kind: 'OracleBridgeParams' +readonly bridge_address: BitString +readonly oracle_mutlisig_address: BitString +readonly oracles: HashmapE +readonly external_chain_address: BitString +} + +export interface BlockSignaturesPure { +readonly kind: 'BlockSignaturesPure' +readonly sig_count: number +readonly sig_weight: number +readonly signatures: HashmapE +} + +export interface BlockSignatures { +readonly kind: 'BlockSignatures' +readonly validator_info: ValidatorBaseInfo +readonly pure_signatures: BlockSignaturesPure +} + +export interface BlockProof { +readonly kind: 'BlockProof' +readonly proof_for: BlockIdExt +readonly root: Slice +readonly signatures: Maybe +} + +export type ProofChain = ProofChain_chain_empty | ProofChain_chain_link; + +export interface ProofChain_chain_empty { +readonly kind: 'ProofChain_chain_empty' +} + +export interface ProofChain_chain_link { +readonly kind: 'ProofChain_chain_link' +readonly n: number +readonly root: Slice +readonly prev: ProofChain | undefined +} + +export interface TopBlockDescr { +readonly kind: 'TopBlockDescr' +readonly proof_for: BlockIdExt +readonly signatures: Maybe +readonly len: number +readonly chain: ProofChain +} + +export interface TopBlockDescrSet { +readonly kind: 'TopBlockDescrSet' +readonly collection: HashmapE +} + +export interface ProducerInfo { +readonly kind: 'ProducerInfo' +readonly utime: number +readonly mc_blk_ref: ExtBlkRef +readonly state_proof: MERKLE_PROOF +readonly prod_proof: MERKLE_PROOF +} + +export type ComplaintDescr = ComplaintDescr_no_blk_gen | ComplaintDescr_no_blk_gen_diff; + +export interface ComplaintDescr_no_blk_gen { +readonly kind: 'ComplaintDescr_no_blk_gen' +readonly from_utime: number +readonly prod_info: ProducerInfo +} + +export interface ComplaintDescr_no_blk_gen_diff { +readonly kind: 'ComplaintDescr_no_blk_gen_diff' +readonly prod_info_old: ProducerInfo +readonly prod_info_new: ProducerInfo +} + +export interface ValidatorComplaint { +readonly kind: 'ValidatorComplaint' +readonly validator_pubkey: BitString +readonly description: ComplaintDescr +readonly created_at: number +readonly severity: number +readonly reward_addr: number +readonly paid: Grams +readonly suggested_fine: Grams +readonly suggested_fine_part: number +} + +export interface ValidatorComplaintStatus { +readonly kind: 'ValidatorComplaintStatus' +readonly complaint: ValidatorComplaint +readonly voters: HashmapE +readonly vset_id: number +readonly weight_remaining: number +} + +export type VmStackValue = VmStackValue_vm_stk_null | VmStackValue_vm_stk_tinyint | VmStackValue_vm_stk_int | VmStackValue_vm_stk_nan | VmStackValue_vm_stk_cell | VmStackValue_vm_stk_slice | VmStackValue_vm_stk_builder | VmStackValue_vm_stk_cont | VmStackValue_vm_stk_tuple; + +export interface VmStackValue_vm_stk_null { +readonly kind: 'VmStackValue_vm_stk_null' +} + +export interface VmStackValue_vm_stk_tinyint { +readonly kind: 'VmStackValue_vm_stk_tinyint' +readonly value: number +} + +export interface VmStackValue_vm_stk_int { +readonly kind: 'VmStackValue_vm_stk_int' +readonly value: number +} + +export interface VmStackValue_vm_stk_nan { +readonly kind: 'VmStackValue_vm_stk_nan' +} + +export interface VmStackValue_vm_stk_cell { +readonly kind: 'VmStackValue_vm_stk_cell' +readonly _cell: Slice +} + +export interface VmStackValue_vm_stk_slice { +readonly kind: 'VmStackValue_vm_stk_slice' +readonly _: VmCellSlice +} + +export interface VmStackValue_vm_stk_builder { +readonly kind: 'VmStackValue_vm_stk_builder' +readonly _cell: Slice +} + +export interface VmStackValue_vm_stk_cont { +readonly kind: 'VmStackValue_vm_stk_cont' +readonly cont: VmCont +} + +export interface VmStackValue_vm_stk_tuple { +readonly kind: 'VmStackValue_vm_stk_tuple' +readonly len: number +readonly data: VmTuple +} + +export interface VmCellSlice { +readonly kind: 'VmCellSlice' +readonly _cell: Slice +readonly st_bits: number +readonly end_bits: number +readonly st_ref: number +readonly end_ref: number +} + +export type VmTupleRef = VmTupleRef_vm_tupref_nil | VmTupleRef_vm_tupref_single | VmTupleRef_vm_tupref_any; + +export interface VmTupleRef_vm_tupref_nil { +readonly kind: 'VmTupleRef_vm_tupref_nil' +} + +export interface VmTupleRef_vm_tupref_single { +readonly kind: 'VmTupleRef_vm_tupref_single' +readonly entry: VmStackValue +} + +export interface VmTupleRef_vm_tupref_any { +readonly kind: 'VmTupleRef_vm_tupref_any' +readonly n: number +readonly ref: VmTuple +} + +export type VmTuple = VmTuple_vm_tuple_nil | VmTuple_vm_tuple_tcons; + +export interface VmTuple_vm_tuple_nil { +readonly kind: 'VmTuple_vm_tuple_nil' +} + +export interface VmTuple_vm_tuple_tcons { +readonly kind: 'VmTuple_vm_tuple_tcons' +readonly n: number +readonly head: VmTupleRef +readonly tail: VmStackValue +} + +export interface VmStack { +readonly kind: 'VmStack' +readonly depth: number +readonly stack: VmStackList +} + +export type VmStackList = VmStackList_vm_stk_nil | VmStackList_vm_stk_cons; + +export interface VmStackList_vm_stk_nil { +readonly kind: 'VmStackList_vm_stk_nil' +} + +export interface VmStackList_vm_stk_cons { +readonly kind: 'VmStackList_vm_stk_cons' +readonly n: number +readonly rest: VmStackList +readonly tos: VmStackValue +} + +export interface VmSaveList { +readonly kind: 'VmSaveList' +readonly cregs: HashmapE +} + +export interface VmGasLimits { +readonly kind: 'VmGasLimits' +readonly remaining: number +readonly max_limit: number +readonly cur_limit: number +readonly credit: number +} + +export interface VmLibraries { +readonly kind: 'VmLibraries' +readonly libraries: HashmapE +} + +export interface VmControlData { +readonly kind: 'VmControlData' +readonly nargs: Maybe +readonly stack: Maybe +readonly save: VmSaveList +readonly cp: Maybe +} + +export type VmCont = VmCont_vmc_std | VmCont_vmc_envelope | VmCont_vmc_quit | VmCont_vmc_quit_exc | VmCont_vmc_repeat | VmCont_vmc_until | VmCont_vmc_again | VmCont_vmc_while_cond | VmCont_vmc_while_body | VmCont_vmc_pushint; + +export interface VmCont_vmc_std { +readonly kind: 'VmCont_vmc_std' +readonly cdata: VmControlData +readonly code: VmCellSlice +} + +export interface VmCont_vmc_envelope { +readonly kind: 'VmCont_vmc_envelope' +readonly cdata: VmControlData +readonly next: VmCont +} + +export interface VmCont_vmc_quit { +readonly kind: 'VmCont_vmc_quit' +readonly exit_code: number +} + +export interface VmCont_vmc_quit_exc { +readonly kind: 'VmCont_vmc_quit_exc' +} + +export interface VmCont_vmc_repeat { +readonly kind: 'VmCont_vmc_repeat' +readonly count: number +readonly body: VmCont +readonly after: VmCont +} + +export interface VmCont_vmc_until { +readonly kind: 'VmCont_vmc_until' +readonly body: VmCont +readonly after: VmCont +} + +export interface VmCont_vmc_again { +readonly kind: 'VmCont_vmc_again' +readonly body: VmCont +} + +export interface VmCont_vmc_while_cond { +readonly kind: 'VmCont_vmc_while_cond' +readonly cond: VmCont +readonly body: VmCont +readonly after: VmCont +} + +export interface VmCont_vmc_while_body { +readonly kind: 'VmCont_vmc_while_body' +readonly cond: VmCont +readonly body: VmCont +readonly after: VmCont +} + +export interface VmCont_vmc_pushint { +readonly kind: 'VmCont_vmc_pushint' +readonly value: number +readonly next: VmCont +} + +export interface DNS_RecordSet { +readonly kind: 'DNS_RecordSet' +readonly anon0: HashmapE +} + +export type TextChunkRef = TextChunkRef_chunk_ref_empty | TextChunkRef_chunk_ref; + +export interface TextChunkRef_chunk_ref_empty { +readonly kind: 'TextChunkRef_chunk_ref_empty' +} + +export interface TextChunkRef_chunk_ref { +readonly kind: 'TextChunkRef_chunk_ref' +readonly n: number +readonly ref: TextChunks +} + +export type TextChunks = TextChunks_text_chunk_empty | TextChunks_text_chunk; + +export interface TextChunks_text_chunk_empty { +readonly kind: 'TextChunks_text_chunk_empty' +} + +export interface TextChunks_text_chunk { +readonly kind: 'TextChunks_text_chunk' +readonly n: number +readonly len: number +readonly data: BitString +readonly next: TextChunkRef +} + +export interface Text { +readonly kind: 'Text' +readonly chunks: number +readonly rest: TextChunks +} + +export type DNSRecord = DNSRecord_dns_text | DNSRecord_dns_next_resolver | DNSRecord_dns_adnl_address | DNSRecord_dns_smc_address; + +export interface DNSRecord_dns_text { +readonly kind: 'DNSRecord_dns_text' +readonly _: Text +} + +export interface DNSRecord_dns_next_resolver { +readonly kind: 'DNSRecord_dns_next_resolver' +readonly resolver: MsgAddressInt +} + +export interface DNSRecord_dns_adnl_address { +readonly kind: 'DNSRecord_dns_adnl_address' +readonly adnl_addr: BitString +readonly flags: number +readonly proto_list: ProtoList | undefined +} + +export interface DNSRecord_dns_smc_address { +readonly kind: 'DNSRecord_dns_smc_address' +readonly smc_addr: MsgAddressInt +readonly flags: number +readonly cap_list: SmcCapList | undefined +} + +export type ProtoList = ProtoList_proto_list_nil | ProtoList_proto_list_next; + +export interface ProtoList_proto_list_nil { +readonly kind: 'ProtoList_proto_list_nil' +} + +export interface ProtoList_proto_list_next { +readonly kind: 'ProtoList_proto_list_next' +readonly head: Protocol +readonly tail: ProtoList +} + +export interface Protocol { +readonly kind: 'Protocol' +} + +export type SmcCapList = SmcCapList_cap_list_nil | SmcCapList_cap_list_next; + +export interface SmcCapList_cap_list_nil { +readonly kind: 'SmcCapList_cap_list_nil' +} + +export interface SmcCapList_cap_list_next { +readonly kind: 'SmcCapList_cap_list_next' +readonly head: SmcCapability +readonly tail: SmcCapList +} + +export type SmcCapability = SmcCapability_cap_method_seqno | SmcCapability_cap_method_pubkey | SmcCapability_cap_is_wallet | SmcCapability_cap_name; + +export interface SmcCapability_cap_method_seqno { +readonly kind: 'SmcCapability_cap_method_seqno' +} + +export interface SmcCapability_cap_method_pubkey { +readonly kind: 'SmcCapability_cap_method_pubkey' +} + +export interface SmcCapability_cap_is_wallet { +readonly kind: 'SmcCapability_cap_is_wallet' +} + +export interface SmcCapability_cap_name { +readonly kind: 'SmcCapability_cap_name' +readonly name: Text +} + +export interface ChanConfig { +readonly kind: 'ChanConfig' +readonly init_timeout: number +readonly close_timeout: number +readonly a_key: BitString +readonly b_key: BitString +readonly a_addr: MsgAddressInt +readonly b_addr: MsgAddressInt +readonly channel_id: number +readonly min_A_extra: Grams +} + +export type ChanState = ChanState_chan_state_init | ChanState_chan_state_close | ChanState_chan_state_payout; + +export interface ChanState_chan_state_init { +readonly kind: 'ChanState_chan_state_init' +readonly signed_A: Bool +readonly signed_B: Bool +readonly min_A: Grams +readonly min_B: Grams +readonly expire_at: number +readonly A: Grams +readonly B: Grams +} + +export interface ChanState_chan_state_close { +readonly kind: 'ChanState_chan_state_close' +readonly signed_A: Bool +readonly signed_B: Bool +readonly promise_A: Grams +readonly promise_B: Grams +readonly expire_at: number +readonly A: Grams +readonly B: Grams +} + +export interface ChanState_chan_state_payout { +readonly kind: 'ChanState_chan_state_payout' +readonly A: Grams +readonly B: Grams +} + +export interface ChanPromise { +readonly kind: 'ChanPromise' +readonly channel_id: number +readonly promise_A: Grams +readonly promise_B: Grams +} + +export interface ChanSignedPromise { +readonly kind: 'ChanSignedPromise' +readonly sig: Maybe +readonly promise: ChanPromise +} + +export type ChanMsg = ChanMsg_chan_msg_init | ChanMsg_chan_msg_close | ChanMsg_chan_msg_timeout | ChanMsg_chan_msg_payout; + +export interface ChanMsg_chan_msg_init { +readonly kind: 'ChanMsg_chan_msg_init' +readonly inc_A: Grams +readonly inc_B: Grams +readonly min_A: Grams +readonly min_B: Grams +readonly channel_id: number +} + +export interface ChanMsg_chan_msg_close { +readonly kind: 'ChanMsg_chan_msg_close' +readonly extra_A: Grams +readonly extra_B: Grams +readonly promise: ChanSignedPromise +} + +export interface ChanMsg_chan_msg_timeout { +readonly kind: 'ChanMsg_chan_msg_timeout' +} + +export interface ChanMsg_chan_msg_payout { +readonly kind: 'ChanMsg_chan_msg_payout' +} + +export interface ChanSignedMsg { +readonly kind: 'ChanSignedMsg' +readonly sig_A: Maybe +readonly sig_B: Maybe +readonly msg: ChanMsg +} + +export interface ChanOp { +readonly kind: 'ChanOp' +readonly msg: ChanSignedMsg +} + +export interface ChanData { +readonly kind: 'ChanData' +readonly config: ChanConfig +readonly state: ChanState +} + +export function bitLen(n: number) { + return n.toString(2).length; +; +} + +export function loadUnit(slice: Slice): Unit { + return { + kind: 'Unit', +} + +; +} + +export function storeUnit(unit: Unit): (builder: Builder) => void { + return ((builder: Builder) => { +}) + +; +} + +export function loadTrue(slice: Slice): True { + return { + kind: 'True', +} + +; +} + +export function storeTrue(true0: True): (builder: Builder) => void { + return ((builder: Builder) => { +}) + +; +} + +export function loadBool(slice: Slice): Bool { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { +slice.loadUint(1) + return { + kind: 'Bool_bool_false', +} + +} +; + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { +slice.loadUint(1) + return { + kind: 'Bool_bool_true', +} + +} +; + throw new Error('') +; +} + +export function storeBool(bool: Bool): (builder: Builder) => void { + if ((bool.kind == 'Bool_bool_false')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1) + +}) + +} +; + if ((bool.kind == 'Bool_bool_true')) { + return ((builder: Builder) => { + builder.storeUint(0b1, 1) + +}) + +} +; + throw new Error('') +; +} + +export function loadBoolFalse(slice: Slice): BoolFalse { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { +slice.loadUint(1) + return { + kind: 'BoolFalse', +} + +} +; + throw new Error('') +; +} + +export function storeBoolFalse(boolFalse: BoolFalse): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0b0, 1) + +}) + +; +} + +export function loadBoolTrue(slice: Slice): BoolTrue { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { +slice.loadUint(1) + return { + kind: 'BoolTrue', +} + +} +; + throw new Error('') +; +} + +export function storeBoolTrue(boolTrue: BoolTrue): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0b1, 1) + +}) + +; +} + +export function loadMaybe(slice: Slice, loadX: (slice: Slice) => X +): Maybe { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { +slice.loadUint(1) + return { + kind: 'Maybe_nothing', +} + +} +; + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { +slice.loadUint(1) +let value: X = loadX(slice) + + return { + kind: 'Maybe_just', + value: value, +} + +} +; + throw new Error('') +; +} + +export function storeMaybe(maybe: Maybe, storeX: (x: X) => (builder: Builder) => void + +): (builder: Builder) => void { + if ((maybe.kind == 'Maybe_nothing')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1) + +}) + +} +; + if ((maybe.kind == 'Maybe_just')) { + return ((builder: Builder) => { + builder.storeUint(0b1, 1) + + storeX(maybe.value)(builder) + +}) + +} +; + throw new Error('') +; +} + +export function loadEither(slice: Slice, loadX: (slice: Slice) => X +, loadY: (slice: Slice) => Y +): Either { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { +slice.loadUint(1) +let value: X = loadX(slice) + + return { + kind: 'Either_left', + value: value, +} +} +; + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { +slice.loadUint(1) +let value: Y = loadY(slice) + return { + kind: 'Either_right', + value: value, +} +} +; + throw new Error('') +; +} + +export function storeEither(either: Either, storeX: (x: X) => (builder: Builder) => void + +, storeY: (y: Y) => (builder: Builder) => void + +): (builder: Builder) => void { + if ((either.kind == 'Either_left')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1) + + storeX(either.value)(builder) +}) +} +; + if ((either.kind == 'Either_right')) { + return ((builder: Builder) => { + builder.storeUint(0b1, 1) + + storeY(either.value)(builder) + +}) + +} +; + throw new Error('') +; +} +export function loadBoth(slice: Slice, loadX: (slice: Slice) => X +, loadY: (slice: Slice) => Y +): Both { + let first: X = loadX(slice) +; + let second: Y = loadY(slice) +; + return { + kind: 'Both', + first: first, + second: second, +} +; +} +export function storeBoth(both: Both, storeX: (x: X) => (builder: Builder) => void +, storeY: (y: Y) => (builder: Builder) => void +): (builder: Builder) => void { + return ((builder: Builder) => { + storeX(both.first)(builder) + storeY(both.second)(builder) +}) +; +} +export function loadBit(slice: Slice): Bit { + let anon0: number = slice.loadUint(1) +; + return { + kind: 'Bit', + anon0: anon0, +} +; +} +export function storeBit(bit: Bit): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(bit.anon0, 1) +}) +; +} +export function hashmap_get_l(label: HmLabel): number { + if ((label.kind == 'HmLabel_hml_short')) { +let n = label.n + return n +} +; + if ((label.kind == 'HmLabel_hml_long')) { +let n = label.n + return n +} +; + if ((label.kind == 'HmLabel_hml_same')) { +let n = label.n + return n +} +; + throw new Error('') +; +} +export function loadHashmap(slice: Slice, n: number, loadX: (slice: Slice) => X +): Hashmap { + let label: HmLabel = loadHmLabel(slice, n) +; + let l = hashmap_get_l(label) +; + let node: HashmapNode = loadHashmapNode(slice, (n - l), loadX) +; + return { + kind: 'Hashmap', + m: (n - l), + n: n, + label: label, + l: l, + node: node, +} +; +} +export function storeHashmap(hashmap: Hashmap, storeX: (x: X) => (builder: Builder) => void +): (builder: Builder) => void { + return ((builder: Builder) => { + storeHmLabel(hashmap.label)(builder) + storeHashmapNode(hashmap.node, storeX)(builder) +}) +; +} +export function loadHashmapNode(slice: Slice, arg0: number, loadX: (slice: Slice) => X +): HashmapNode { + if ((arg0 == 0)) { +let value: X = loadX(slice) + return { + kind: 'HashmapNode_hmn_leaf', + value: value, +} +} +; + if (true) { +let slice1 = slice.loadRef().beginParse() +let left: Hashmap = loadHashmap(slice1, (arg0 - 1), loadX) +let slice2 = slice.loadRef().beginParse() +let right: Hashmap = loadHashmap(slice2, (arg0 - 1), loadX) + return { + kind: 'HashmapNode_hmn_fork', + n: (arg0 - 1), + left: left, + right: right, +} +} +; + throw new Error('') +; +} +export function storeHashmapNode(hashmapNode: HashmapNode, storeX: (x: X) => (builder: Builder) => void +): (builder: Builder) => void { + if ((hashmapNode.kind == 'HashmapNode_hmn_leaf')) { + return ((builder: Builder) => { + storeX(hashmapNode.value)(builder) + +}) + +} +; + if ((hashmapNode.kind == 'HashmapNode_hmn_fork')) { + return ((builder: Builder) => { + let cell1 = beginCell() + + + storeHashmap(hashmapNode.left, storeX)(cell1) + + builder.storeRef(cell1) + + let cell2 = beginCell() + storeHashmap(hashmapNode.right, storeX)(cell2) + builder.storeRef(cell2) +}) +} +; + throw new Error('') +; +} +export function hmLabel_hml_short_get_n(len: Unary): number { + if ((len.kind == 'Unary_unary_zero')) { + return 0 +} +; + if ((len.kind == 'Unary_unary_succ')) { +let n = len.n + return (n + 1) +} +; + throw new Error('') +; +} +export function loadHmLabel(slice: Slice, m: number): HmLabel { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { +slice.loadUint(1) +let len: Unary = loadUnary(slice) +let n = hmLabel_hml_short_get_n(len) +let s: Array = Array.from(Array(n).keys()).map(((arg: number) => { + return slice.loadBits(1) + }) + ) + if ((!(n <= m))) { +throw new Error('') + } + return { + kind: 'HmLabel_hml_short', + m: m, + len: len, + n: n, + s: s, +} +} +; + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b10))) { +slice.loadUint(2) +let n: number = slice.loadUint(bitLen(m)) +let s: Array = Array.from(Array(n).keys()).map(((arg: number) => { + return slice.loadBits(1) + }) + ) + + return { + kind: 'HmLabel_hml_long', + m: m, + n: n, + s: s, +} + +} +; + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b11))) { +slice.loadUint(2) +let v: BitString = slice.loadBits(1) +let n: number = slice.loadUint(bitLen(m)) + + return { + kind: 'HmLabel_hml_same', + m: m, + v: v, + n: n, +} + +} +; + throw new Error('') +; +} + +export function storeHmLabel(hmLabel: HmLabel): (builder: Builder) => void { + if ((hmLabel.kind == 'HmLabel_hml_short')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1) + + storeUnary(hmLabel.len)(builder) + + hmLabel.s.forEach(((arg: BitString) => { + builder.storeBits(arg) + + }) + ) + + if ((!(hmLabel.n <= hmLabel.m))) { + throw new Error('') + } + +}) + +} +; + if ((hmLabel.kind == 'HmLabel_hml_long')) { + return ((builder: Builder) => { + builder.storeUint(0b10, 2) + + builder.storeUint(hmLabel.n, bitLen(hmLabel.m)) + + hmLabel.s.forEach(((arg: BitString) => { + builder.storeBits(arg) + + }) + ) + +}) + +} +; + if ((hmLabel.kind == 'HmLabel_hml_same')) { + return ((builder: Builder) => { + builder.storeUint(0b11, 2) + + builder.storeBits(hmLabel.v) + + builder.storeUint(hmLabel.n, bitLen(hmLabel.m)) + +}) + +} +; + throw new Error('') +; +} + +export function unary_unary_succ_get_n(x: Unary): number { + if ((x.kind == 'Unary_unary_zero')) { + return 0 +} +; + if ((x.kind == 'Unary_unary_succ')) { +let n = x.n + + return (n + 1) +} +; + throw new Error('') +; +} + +export function loadUnary(slice: Slice): Unary { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { +slice.loadUint(1) + return { + kind: 'Unary_unary_zero', +} + +} +; + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { +slice.loadUint(1) +let x: Unary = loadUnary(slice) + +let n = unary_unary_succ_get_n(x) + + return { + kind: 'Unary_unary_succ', + x: x, + n: n, +} + +} +; + throw new Error('') +; +} + +export function storeUnary(unary: Unary): (builder: Builder) => void { + if ((unary.kind == 'Unary_unary_zero')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1) +}) +} +; + if ((unary.kind == 'Unary_unary_succ')) { + return ((builder: Builder) => { + builder.storeUint(0b1, 1) + + storeUnary(unary.x)(builder) +}) + +} +; + throw new Error('') +; +} + +export function loadHashmapE(slice: Slice, n: number, loadX: (slice: Slice) => X +): HashmapE { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { +slice.loadUint(1) + return { + kind: 'HashmapE_hme_empty', + n: n, +} + +} +; + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { +slice.loadUint(1) +let slice1 = slice.loadRef().beginParse() + +let root: Hashmap = loadHashmap(slice1, n, loadX) + + return { + kind: 'HashmapE_hme_root', + n: n, + root: root, +} + +} +; + throw new Error('') +; +} + +export function storeHashmapE(hashmapE: HashmapE, storeX: (x: X) => (builder: Builder) => void + +): (builder: Builder) => void { + if ((hashmapE.kind == 'HashmapE_hme_empty')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1) + +}) + +} +; + if ((hashmapE.kind == 'HashmapE_hme_root')) { + return ((builder: Builder) => { + builder.storeUint(0b1, 1) + + let cell1 = beginCell() + + + storeHashmap(hashmapE.root, storeX)(cell1) + + builder.storeRef(cell1) + +}) + +} +; + throw new Error('') +; +} + +export function loadBitstringSet(slice: Slice, n: number): BitstringSet { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xda553663))) { +slice.loadUint(32) +let _: Hashmap = loadHashmap(slice, n, loadTrue) + + return { + kind: 'BitstringSet', + n: n, + _: _, +} +} +; + throw new Error('') +; +} +export function storeBitstringSet(bitstringSet: BitstringSet): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xda553663, 32) + storeHashmap(bitstringSet._, storeTrue)(builder) +}) +; +} +export function hashmapAug_get_l(label: HmLabel): number { + if ((label.kind == 'HmLabel_hml_short')) { +let n = label.n + return n +} +; + if ((label.kind == 'HmLabel_hml_long')) { +let n = label.n + return n +} +; + if ((label.kind == 'HmLabel_hml_same')) { +let n = label.n + return n +} +; + throw new Error('') +; +} +export function loadHashmapAug(slice: Slice, n: number, loadX: (slice: Slice) => X +, loadY: (slice: Slice) => Y +): HashmapAug { + let label: HmLabel = loadHmLabel(slice, n) +; + let l = hashmapAug_get_l(label) +; + let node: HashmapAugNode = loadHashmapAugNode(slice, (n - l), loadX, loadY) +; + return { + kind: 'HashmapAug', + m: (n - l), + n: n, + label: label, + l: l, + node: node, +} +; +} +export function storeHashmapAug(hashmapAug: HashmapAug, storeX: (x: X) => (builder: Builder) => void +, storeY: (y: Y) => (builder: Builder) => void +): (builder: Builder) => void { + return ((builder: Builder) => { + storeHmLabel(hashmapAug.label)(builder) + storeHashmapAugNode(hashmapAug.node, storeX, storeY)(builder) +}) +; +} +export function loadHashmapAugNode(slice: Slice, arg0: number, loadX: (slice: Slice) => X +, loadY: (slice: Slice) => Y +): HashmapAugNode { + if ((arg0 == 0)) { +let extra: Y = loadY(slice) +let value: X = loadX(slice) + return { + kind: 'HashmapAugNode_ahmn_leaf', + extra: extra, + value: value, +} +} +; + if (true) { +let slice1 = slice.loadRef().beginParse() +let left: HashmapAug = loadHashmapAug(slice1, (arg0 - 1), loadX, loadY) +let slice2 = slice.loadRef().beginParse() +let right: HashmapAug = loadHashmapAug(slice2, (arg0 - 1), loadX, loadY) +let extra: Y = loadY(slice) + return { + kind: 'HashmapAugNode_ahmn_fork', + n: (arg0 - 1), + left: left, + right: right, + extra: extra, +} +} +; + throw new Error('') +; +} +export function storeHashmapAugNode(hashmapAugNode: HashmapAugNode, storeX: (x: X) => (builder: Builder) => void +, storeY: (y: Y) => (builder: Builder) => void +): (builder: Builder) => void { + if ((hashmapAugNode.kind == 'HashmapAugNode_ahmn_leaf')) { + return ((builder: Builder) => { + storeY(hashmapAugNode.extra)(builder) + storeX(hashmapAugNode.value)(builder) +}) +} +; + if ((hashmapAugNode.kind == 'HashmapAugNode_ahmn_fork')) { + return ((builder: Builder) => { + let cell1 = beginCell() + storeHashmapAug(hashmapAugNode.left, storeX, storeY)(cell1) + builder.storeRef(cell1) + let cell2 = beginCell() + storeHashmapAug(hashmapAugNode.right, storeX, storeY)(cell2) + builder.storeRef(cell2) + storeY(hashmapAugNode.extra)(builder) +}) +} +; + throw new Error('') +; +} +export function loadHashmapAugE(slice: Slice, n: number, loadX: (slice: Slice) => X +, loadY: (slice: Slice) => Y +): HashmapAugE { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { +slice.loadUint(1) +let extra: Y = loadY(slice) + return { + kind: 'HashmapAugE_ahme_empty', + n: n, + extra: extra, +} +} +; + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { +slice.loadUint(1) +let slice1 = slice.loadRef().beginParse() +let root: HashmapAug = loadHashmapAug(slice1, n, loadX, loadY) +let extra: Y = loadY(slice) + return { + kind: 'HashmapAugE_ahme_root', + n: n, + root: root, + extra: extra, +} +} +; + throw new Error('') +; +} +export function storeHashmapAugE(hashmapAugE: HashmapAugE, storeX: (x: X) => (builder: Builder) => void +, storeY: (y: Y) => (builder: Builder) => void +): (builder: Builder) => void { + if ((hashmapAugE.kind == 'HashmapAugE_ahme_empty')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1) + storeY(hashmapAugE.extra)(builder) +}) +} +; + if ((hashmapAugE.kind == 'HashmapAugE_ahme_root')) { + return ((builder: Builder) => { + builder.storeUint(0b1, 1) + let cell1 = beginCell() + storeHashmapAug(hashmapAugE.root, storeX, storeY)(cell1) + builder.storeRef(cell1) + storeY(hashmapAugE.extra)(builder) +}) +} +; + throw new Error('') +; +} +export function varHashmap_get_l(label: HmLabel): number { + if ((label.kind == 'HmLabel_hml_short')) { +let n = label.n + return n +} +; + if ((label.kind == 'HmLabel_hml_long')) { +let n = label.n + return n +} +; + if ((label.kind == 'HmLabel_hml_same')) { +let n = label.n + return n +} +; + throw new Error('') +; +} +export function loadVarHashmap(slice: Slice, n: number, loadX: (slice: Slice) => X +): VarHashmap { + let label: HmLabel = loadHmLabel(slice, n) +; + let l = varHashmap_get_l(label) +; + let node: VarHashmapNode = loadVarHashmapNode(slice, (n - l), loadX) +; + return { + kind: 'VarHashmap', + m: (n - l), + n: n, + label: label, + l: l, + node: node, +} +; +} +export function storeVarHashmap(varHashmap: VarHashmap, storeX: (x: X) => (builder: Builder) => void +): (builder: Builder) => void { + return ((builder: Builder) => { + storeHmLabel(varHashmap.label)(builder) + storeVarHashmapNode(varHashmap.node, storeX)(builder) +}) +; +} +export function loadVarHashmapNode(slice: Slice, arg0: number, loadX: (slice: Slice) => X +): VarHashmapNode { + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { +slice.loadUint(2) +let value: X = loadX(slice) + return { + kind: 'VarHashmapNode_vhmn_leaf', + n: arg0, + value: value, +} +} +; + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b01))) { +slice.loadUint(2) +let slice1 = slice.loadRef().beginParse() +let left: VarHashmap = loadVarHashmap(slice1, (arg0 - 1), loadX) +let slice2 = slice.loadRef().beginParse() +let right: VarHashmap = loadVarHashmap(slice2, (arg0 - 1), loadX) +let value: Maybe = loadMaybe(slice, loadX) + return { + kind: 'VarHashmapNode_vhmn_fork', + n: (arg0 - 1), + left: left, + right: right, + value: value, +} +} +; + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { +slice.loadUint(1) +let branch: BitString = slice.loadBits(1) +let slice1 = slice.loadRef().beginParse() +let child: VarHashmap = loadVarHashmap(slice1, (arg0 - 1), loadX) +let value: X = loadX(slice) + return { + kind: 'VarHashmapNode_vhmn_cont', + n: (arg0 - 1), + branch: branch, + child: child, + value: value, +} +} +; + throw new Error('') +; +} +export function storeVarHashmapNode(varHashmapNode: VarHashmapNode, storeX: (x: X) => (builder: Builder) => void +): (builder: Builder) => void { + if ((varHashmapNode.kind == 'VarHashmapNode_vhmn_leaf')) { + return ((builder: Builder) => { + builder.storeUint(0b00, 2) + storeX(varHashmapNode.value)(builder) +}) +} +; + if ((varHashmapNode.kind == 'VarHashmapNode_vhmn_fork')) { + return ((builder: Builder) => { + builder.storeUint(0b01, 2) + let cell1 = beginCell() + storeVarHashmap(varHashmapNode.left, storeX)(cell1) + builder.storeRef(cell1) + let cell2 = beginCell() + storeVarHashmap(varHashmapNode.right, storeX)(cell2) + builder.storeRef(cell2) + storeMaybe(varHashmapNode.value, storeX)(builder) +}) +} +; + if ((varHashmapNode.kind == 'VarHashmapNode_vhmn_cont')) { + return ((builder: Builder) => { + builder.storeUint(0b1, 1) + builder.storeBits(varHashmapNode.branch) + let cell1 = beginCell() + storeVarHashmap(varHashmapNode.child, storeX)(cell1) + builder.storeRef(cell1) + storeX(varHashmapNode.value)(builder) +}) +} +; + throw new Error('') +; +} +export function loadVarHashmapE(slice: Slice, n: number, loadX: (slice: Slice) => X +): VarHashmapE { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { +slice.loadUint(1) + return { + kind: 'VarHashmapE_vhme_empty', + n: n, +} +} +; + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { +slice.loadUint(1) +let slice1 = slice.loadRef().beginParse() +let root: VarHashmap = loadVarHashmap(slice1, n, loadX) + return { + kind: 'VarHashmapE_vhme_root', + n: n, + root: root, +} +} +; + throw new Error('') +; +} +export function storeVarHashmapE(varHashmapE: VarHashmapE, storeX: (x: X) => (builder: Builder) => void +): (builder: Builder) => void { + if ((varHashmapE.kind == 'VarHashmapE_vhme_empty')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1) +}) +} +; + if ((varHashmapE.kind == 'VarHashmapE_vhme_root')) { + return ((builder: Builder) => { + builder.storeUint(0b1, 1) + let cell1 = beginCell() + storeVarHashmap(varHashmapE.root, storeX)(cell1) + builder.storeRef(cell1) +}) +} +; + throw new Error('') +; +} +export function pfxHashmap_get_l(label: HmLabel): number { + if ((label.kind == 'HmLabel_hml_short')) { +let n = label.n + return n +} +; + if ((label.kind == 'HmLabel_hml_long')) { +let n = label.n + return n +} +; + if ((label.kind == 'HmLabel_hml_same')) { +let n = label.n + return n +} +; + throw new Error('') +; +} +export function loadPfxHashmap(slice: Slice, n: number, loadX: (slice: Slice) => X +): PfxHashmap { + let label: HmLabel = loadHmLabel(slice, n) +; + let l = pfxHashmap_get_l(label) +; + let node: PfxHashmapNode = loadPfxHashmapNode(slice, (n - l), loadX) +; + return { + kind: 'PfxHashmap', + m: (n - l), + n: n, + label: label, + l: l, + node: node, +} +; +} +export function storePfxHashmap(pfxHashmap: PfxHashmap, storeX: (x: X) => (builder: Builder) => void +): (builder: Builder) => void { + return ((builder: Builder) => { + storeHmLabel(pfxHashmap.label)(builder) + storePfxHashmapNode(pfxHashmap.node, storeX)(builder) +}) +; +} +export function loadPfxHashmapNode(slice: Slice, arg0: number, loadX: (slice: Slice) => X +): PfxHashmapNode { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { +slice.loadUint(1) +let value: X = loadX(slice) + return { + kind: 'PfxHashmapNode_phmn_leaf', + n: arg0, + value: value, +} +} +; + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { +slice.loadUint(1) +let slice1 = slice.loadRef().beginParse() +let left: PfxHashmap = loadPfxHashmap(slice1, (arg0 - 1), loadX) +let slice2 = slice.loadRef().beginParse() +let right: PfxHashmap = loadPfxHashmap(slice2, (arg0 - 1), loadX) + return { + kind: 'PfxHashmapNode_phmn_fork', + n: (arg0 - 1), + left: left, + right: right, +} +} +; + throw new Error('') +; +} +export function storePfxHashmapNode(pfxHashmapNode: PfxHashmapNode, storeX: (x: X) => (builder: Builder) => void +): (builder: Builder) => void { + if ((pfxHashmapNode.kind == 'PfxHashmapNode_phmn_leaf')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1) + storeX(pfxHashmapNode.value)(builder) +}) +} +; + if ((pfxHashmapNode.kind == 'PfxHashmapNode_phmn_fork')) { + return ((builder: Builder) => { + builder.storeUint(0b1, 1) + let cell1 = beginCell() + storePfxHashmap(pfxHashmapNode.left, storeX)(cell1) + builder.storeRef(cell1) + let cell2 = beginCell() + storePfxHashmap(pfxHashmapNode.right, storeX)(cell2) + builder.storeRef(cell2) +}) +} +; + throw new Error('') +; +} +export function loadPfxHashmapE(slice: Slice, n: number, loadX: (slice: Slice) => X +): PfxHashmapE { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { +slice.loadUint(1) + return { + kind: 'PfxHashmapE_phme_empty', + n: n, +} +} +; + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { +slice.loadUint(1) +let slice1 = slice.loadRef().beginParse() +let root: PfxHashmap = loadPfxHashmap(slice1, n, loadX) + return { + kind: 'PfxHashmapE_phme_root', + n: n, + root: root, +} +} +; + throw new Error('') +; +} +export function storePfxHashmapE(pfxHashmapE: PfxHashmapE, storeX: (x: X) => (builder: Builder) => void +): (builder: Builder) => void { + if ((pfxHashmapE.kind == 'PfxHashmapE_phme_empty')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1) +}) +} +; + if ((pfxHashmapE.kind == 'PfxHashmapE_phme_root')) { + return ((builder: Builder) => { + builder.storeUint(0b1, 1) + let cell1 = beginCell() + storePfxHashmap(pfxHashmapE.root, storeX)(cell1) + builder.storeRef(cell1) +}) +} +; + throw new Error('') +; +} +export function loadMsgAddressExt(slice: Slice): MsgAddressExt { + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { +slice.loadUint(2) + return { + kind: 'MsgAddressExt_addr_none', +} +} +; + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b01))) { +slice.loadUint(2) +let len: number = slice.loadUint(9) +let external_address: BitString = slice.loadBits(len) + return { + kind: 'MsgAddressExt_addr_extern', + len: len, + external_address: external_address, +} +} +; + throw new Error('') +; +} +export function storeMsgAddressExt(msgAddressExt: MsgAddressExt): (builder: Builder) => void { + if ((msgAddressExt.kind == 'MsgAddressExt_addr_none')) { + return ((builder: Builder) => { + builder.storeUint(0b00, 2) + +}) + +} +; + if ((msgAddressExt.kind == 'MsgAddressExt_addr_extern')) { + return ((builder: Builder) => { + builder.storeUint(0b01, 2) + builder.storeUint(msgAddressExt.len, 9) + builder.storeBits(msgAddressExt.external_address) +}) +} +; + throw new Error('') +; +} +export function loadAnycast(slice: Slice): Anycast { + let depth: number = slice.loadUint(bitLen(30)) +; + let rewrite_pfx: BitString = slice.loadBits(depth) +; + if ((!(depth >= 1))) { +throw new Error('') +} +; + return { + kind: 'Anycast', + depth: depth, + rewrite_pfx: rewrite_pfx, +} +; +} +export function storeAnycast(anycast: Anycast): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(anycast.depth, bitLen(30)) + builder.storeBits(anycast.rewrite_pfx) + if ((!(anycast.depth >= 1))) { + throw new Error('') + } +}) +; +} +export function loadMsgAddressInt(slice: Slice): MsgAddressInt { + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b10))) { +slice.loadUint(2) +let anycast: Maybe = loadMaybe(slice, loadAnycast) +let workchain_id: number = slice.loadInt(8) +let address: BitString = slice.loadBits(256) + return { + kind: 'MsgAddressInt_addr_std', + anycast: anycast, + workchain_id: workchain_id, + address: address, +} +} +; + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b11))) { +slice.loadUint(2) +let anycast: Maybe = loadMaybe(slice, loadAnycast) +let addr_len: number = slice.loadUint(9) +let workchain_id: number = slice.loadInt(32) +let address: BitString = slice.loadBits(addr_len) + return { + kind: 'MsgAddressInt_addr_var', + anycast: anycast, + addr_len: addr_len, + workchain_id: workchain_id, + address: address, +} +} +; + throw new Error('') +; +} +export function storeMsgAddressInt(msgAddressInt: MsgAddressInt): (builder: Builder) => void { + if ((msgAddressInt.kind == 'MsgAddressInt_addr_std')) { + return ((builder: Builder) => { + builder.storeUint(0b10, 2) + storeMaybe(msgAddressInt.anycast, storeAnycast)(builder) + builder.storeInt(msgAddressInt.workchain_id, 8) + builder.storeBits(msgAddressInt.address) +}) +} +; + if ((msgAddressInt.kind == 'MsgAddressInt_addr_var')) { + return ((builder: Builder) => { + builder.storeUint(0b11, 2) + storeMaybe(msgAddressInt.anycast, storeAnycast)(builder) + builder.storeUint(msgAddressInt.addr_len, 9) + builder.storeInt(msgAddressInt.workchain_id, 32) + builder.storeBits(msgAddressInt.address) +}) +} +; + throw new Error('') +; +} +export function loadMsgAddress(slice: Slice): MsgAddress { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xef3a10fa))) { +slice.loadUint(32) +let _: MsgAddressInt = loadMsgAddressInt(slice) + return { + kind: 'MsgAddress__', + _: _, +} +} +; + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xcf942fd1))) { +slice.loadUint(32) +let _: MsgAddressExt = loadMsgAddressExt(slice) + return { + kind: 'MsgAddress__1', + _: _, +} +} +; + throw new Error('') +; +} +export function storeMsgAddress(msgAddress: MsgAddress): (builder: Builder) => void { + if ((msgAddress.kind == 'MsgAddress__')) { + return ((builder: Builder) => { + builder.storeUint(0xef3a10fa, 32) + storeMsgAddressInt(msgAddress._)(builder) +}) +} +; + if ((msgAddress.kind == 'MsgAddress__1')) { + return ((builder: Builder) => { + builder.storeUint(0xcf942fd1, 32) + storeMsgAddressExt(msgAddress._)(builder) +}) +} +; + throw new Error('') +; +} +export function loadVarUInteger(slice: Slice, n: number): VarUInteger { + let len: number = slice.loadUint(bitLen((n - 1))) +; + let value: number = slice.loadUint((len * 8)) +; + return { + kind: 'VarUInteger', + n: n, + len: len, + value: value, +} +; +} +export function storeVarUInteger(varUInteger: VarUInteger): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(varUInteger.len, bitLen((varUInteger.n - 1))) + builder.storeUint(varUInteger.value, (varUInteger.len * 8)) +}) +; +} +export function loadVarInteger(slice: Slice, n: number): VarInteger { + let len: number = slice.loadUint(bitLen((n - 1))) +; + let value: number = slice.loadInt((len * 8)) +; + return { + kind: 'VarInteger', + n: n, + len: len, + value: value, +} +; +} +export function storeVarInteger(varInteger: VarInteger): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(varInteger.len, bitLen((varInteger.n - 1))) + builder.storeInt(varInteger.value, (varInteger.len * 8)) +}) +; +} +export function loadGrams(slice: Slice): Grams { + let amount: VarUInteger = loadVarUInteger(slice, 16) +; + return { + kind: 'Grams', + amount: amount, +} +; +} +export function storeGrams(grams: Grams): (builder: Builder) => void { + return ((builder: Builder) => { + storeVarUInteger(grams.amount)(builder) +}) +; +} +export function loadExtraCurrencyCollection(slice: Slice): ExtraCurrencyCollection { + let dict: HashmapE = loadHashmapE(slice, 32, ((slice: Slice) => { + return loadVarUInteger(slice, 32) +}) +) +; + return { + kind: 'ExtraCurrencyCollection', + dict: dict, +} +; +} +export function storeExtraCurrencyCollection(extraCurrencyCollection: ExtraCurrencyCollection): (builder: Builder) => void { + return ((builder: Builder) => { + storeHashmapE(extraCurrencyCollection.dict, ((arg: VarUInteger) => { + return ((builder: Builder) => { + storeVarUInteger(arg)(builder) + }) + }) + )(builder) +}) +; +} +export function loadCurrencyCollection(slice: Slice): CurrencyCollection { + let grams: Grams = loadGrams(slice) +; + let other: ExtraCurrencyCollection = loadExtraCurrencyCollection(slice) +; + return { + kind: 'CurrencyCollection', + grams: grams, + other: other, +} +; +} +export function storeCurrencyCollection(currencyCollection: CurrencyCollection): (builder: Builder) => void { + return ((builder: Builder) => { + storeGrams(currencyCollection.grams)(builder) + storeExtraCurrencyCollection(currencyCollection.other)(builder) +}) +; +} +export function loadCommonMsgInfo(slice: Slice): CommonMsgInfo { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { +slice.loadUint(1) +let ihr_disabled: Bool = loadBool(slice) +let bounce: Bool = loadBool(slice) +let bounced: Bool = loadBool(slice) +let src: MsgAddressInt = loadMsgAddressInt(slice) +let dest: MsgAddressInt = loadMsgAddressInt(slice) +let value: CurrencyCollection = loadCurrencyCollection(slice) +let ihr_fee: Grams = loadGrams(slice) +let fwd_fee: Grams = loadGrams(slice) +let created_lt: number = slice.loadUint(64) +let created_at: number = slice.loadUint(32) + return { + kind: 'CommonMsgInfo_int_msg_info', + ihr_disabled: ihr_disabled, + bounce: bounce, + bounced: bounced, + src: src, + dest: dest, + value: value, + ihr_fee: ihr_fee, + fwd_fee: fwd_fee, + created_lt: created_lt, + created_at: created_at, +} +} +; + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b10))) { +slice.loadUint(2) +let src: MsgAddressExt = loadMsgAddressExt(slice) +let dest: MsgAddressInt = loadMsgAddressInt(slice) +let import_fee: Grams = loadGrams(slice) + return { + kind: 'CommonMsgInfo_ext_in_msg_info', + src: src, + dest: dest, + import_fee: import_fee, +} +} +; + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b11))) { +slice.loadUint(2) +let src: MsgAddressInt = loadMsgAddressInt(slice) +let dest: MsgAddressExt = loadMsgAddressExt(slice) +let created_lt: number = slice.loadUint(64) +let created_at: number = slice.loadUint(32) + return { + kind: 'CommonMsgInfo_ext_out_msg_info', + src: src, + dest: dest, + created_lt: created_lt, + created_at: created_at, +} +} +; + throw new Error('') +; +} +export function storeCommonMsgInfo(commonMsgInfo: CommonMsgInfo): (builder: Builder) => void { + if ((commonMsgInfo.kind == 'CommonMsgInfo_int_msg_info')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1) + storeBool(commonMsgInfo.ihr_disabled)(builder) + storeBool(commonMsgInfo.bounce)(builder) + storeBool(commonMsgInfo.bounced)(builder) + storeMsgAddressInt(commonMsgInfo.src)(builder) + storeMsgAddressInt(commonMsgInfo.dest)(builder) + storeCurrencyCollection(commonMsgInfo.value)(builder) + storeGrams(commonMsgInfo.ihr_fee)(builder) + storeGrams(commonMsgInfo.fwd_fee)(builder) + builder.storeUint(commonMsgInfo.created_lt, 64) + builder.storeUint(commonMsgInfo.created_at, 32) +}) +} +; + if ((commonMsgInfo.kind == 'CommonMsgInfo_ext_in_msg_info')) { + return ((builder: Builder) => { + builder.storeUint(0b10, 2) + storeMsgAddressExt(commonMsgInfo.src)(builder) + storeMsgAddressInt(commonMsgInfo.dest)(builder) + storeGrams(commonMsgInfo.import_fee)(builder) +}) +} +; + if ((commonMsgInfo.kind == 'CommonMsgInfo_ext_out_msg_info')) { + return ((builder: Builder) => { + builder.storeUint(0b11, 2) + storeMsgAddressInt(commonMsgInfo.src)(builder) + storeMsgAddressExt(commonMsgInfo.dest)(builder) + builder.storeUint(commonMsgInfo.created_lt, 64) + builder.storeUint(commonMsgInfo.created_at, 32) +}) +} +; + throw new Error('') +; +} +export function loadCommonMsgInfoRelaxed(slice: Slice): CommonMsgInfoRelaxed { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { +slice.loadUint(1) +let ihr_disabled: Bool = loadBool(slice) +let bounce: Bool = loadBool(slice) +let bounced: Bool = loadBool(slice) +let src: MsgAddress = loadMsgAddress(slice) +let dest: MsgAddressInt = loadMsgAddressInt(slice) +let value: CurrencyCollection = loadCurrencyCollection(slice) +let ihr_fee: Grams = loadGrams(slice) +let fwd_fee: Grams = loadGrams(slice) +let created_lt: number = slice.loadUint(64) +let created_at: number = slice.loadUint(32) + return { + kind: 'CommonMsgInfoRelaxed_int_msg_info', + ihr_disabled: ihr_disabled, + bounce: bounce, + bounced: bounced, + src: src, + dest: dest, + value: value, + ihr_fee: ihr_fee, + fwd_fee: fwd_fee, + created_lt: created_lt, + created_at: created_at, +} +} +; + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b11))) { +slice.loadUint(2) +let src: MsgAddress = loadMsgAddress(slice) +let dest: MsgAddressExt = loadMsgAddressExt(slice) +let created_lt: number = slice.loadUint(64) +let created_at: number = slice.loadUint(32) + return { + kind: 'CommonMsgInfoRelaxed_ext_out_msg_info', + src: src, + dest: dest, + created_lt: created_lt, + created_at: created_at, +} +} +; + throw new Error('') +; +} +export function storeCommonMsgInfoRelaxed(commonMsgInfoRelaxed: CommonMsgInfoRelaxed): (builder: Builder) => void { + if ((commonMsgInfoRelaxed.kind == 'CommonMsgInfoRelaxed_int_msg_info')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1) + storeBool(commonMsgInfoRelaxed.ihr_disabled)(builder) + storeBool(commonMsgInfoRelaxed.bounce)(builder) + storeBool(commonMsgInfoRelaxed.bounced)(builder) + storeMsgAddress(commonMsgInfoRelaxed.src)(builder) + storeMsgAddressInt(commonMsgInfoRelaxed.dest)(builder) + storeCurrencyCollection(commonMsgInfoRelaxed.value)(builder) + storeGrams(commonMsgInfoRelaxed.ihr_fee)(builder) + storeGrams(commonMsgInfoRelaxed.fwd_fee)(builder) + builder.storeUint(commonMsgInfoRelaxed.created_lt, 64) + builder.storeUint(commonMsgInfoRelaxed.created_at, 32) +}) +} +; + if ((commonMsgInfoRelaxed.kind == 'CommonMsgInfoRelaxed_ext_out_msg_info')) { + return ((builder: Builder) => { + builder.storeUint(0b11, 2) + storeMsgAddress(commonMsgInfoRelaxed.src)(builder) + storeMsgAddressExt(commonMsgInfoRelaxed.dest)(builder) + builder.storeUint(commonMsgInfoRelaxed.created_lt, 64) + builder.storeUint(commonMsgInfoRelaxed.created_at, 32) +}) +} +; + throw new Error('') +; +} +export function loadTickTock(slice: Slice): TickTock { + let tick: Bool = loadBool(slice) +; + let tock: Bool = loadBool(slice) +; + return { + kind: 'TickTock', + tick: tick, + tock: tock, +} +; +} +export function storeTickTock(tickTock: TickTock): (builder: Builder) => void { + return ((builder: Builder) => { + storeBool(tickTock.tick)(builder) + storeBool(tickTock.tock)(builder) +}) +; +} +export function loadStateInit(slice: Slice): StateInit { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x91231967))) { +slice.loadUint(32) +let split_depth: Maybe = loadMaybe(slice, ((slice: Slice) => { + return slice.loadUint(5) + }) + ) +let special: Maybe = loadMaybe(slice, loadTickTock) +let code: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() + return slice1 + }) + ) +let data: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() + return slice1 + }) + ) +let library: HashmapE = loadHashmapE(slice, 256, loadSimpleLib) + return { + kind: 'StateInit', + split_depth: split_depth, + special: special, + code: code, + data: data, + library: library, +} +} +; + throw new Error('') +; +} +export function storeStateInit(stateInit: StateInit): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x91231967, 32) + storeMaybe(stateInit.split_depth, ((arg: number) => { + return ((builder: Builder) => { + builder.storeUint(arg, 5) + }) + }) + )(builder) + storeMaybe(stateInit.special, storeTickTock)(builder) + storeMaybe(stateInit.code, ((arg: Slice) => { + return ((builder: Builder) => { + let cell1 = beginCell() + cell1.storeSlice(arg) + builder.storeRef(cell1) + }) + }) + )(builder) + storeMaybe(stateInit.data, ((arg: Slice) => { + return ((builder: Builder) => { + let cell1 = beginCell() + cell1.storeSlice(arg) + builder.storeRef(cell1) + }) + }) + )(builder) + storeHashmapE(stateInit.library, storeSimpleLib)(builder) +}) +; +} +export function loadSimpleLib(slice: Slice): SimpleLib { + let public0: Bool = loadBool(slice) +; + let slice1 = slice.loadRef().beginParse() +; + let root: Slice = slice1 +; + return { + kind: 'SimpleLib', + public0: public0, + root: root, +} +; +} +export function storeSimpleLib(simpleLib: SimpleLib): (builder: Builder) => void { + return ((builder: Builder) => { + storeBool(simpleLib.public0)(builder) + let cell1 = beginCell() + cell1.storeSlice(simpleLib.root) + builder.storeRef(cell1) +}) +; +} +export function loadMessage(slice: Slice, loadX: (slice: Slice) => X +): Message { + let info: CommonMsgInfo = loadCommonMsgInfo(slice) +; + let init: Maybe> = loadMaybe>(slice, ((slice: Slice) => { + return loadEither(slice, loadStateInit, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() + return loadStateInit(slice1) + }) + ) +}) +) +; + let body: Either = loadEither(slice, loadX, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() + return loadX(slice1) +}) +) +; + return { + kind: 'Message', + info: info, + init: init, + body: body, +} +; +} +export function storeMessage(message: Message, storeX: (x: X) => (builder: Builder) => void +): (builder: Builder) => void { + return ((builder: Builder) => { + storeCommonMsgInfo(message.info)(builder) + storeMaybe>(message.init, ((arg: Either) => { + return ((builder: Builder) => { + storeEither(arg, storeStateInit, ((arg: StateInit) => { + return ((builder: Builder) => { + let cell1 = beginCell() + storeStateInit(arg)(cell1) + builder.storeRef(cell1) + }) + }) + )(builder) + }) + }) + )(builder) + storeEither(message.body, storeX, ((arg: X) => { + return ((builder: Builder) => { + let cell1 = beginCell() + storeX(arg)(cell1) + builder.storeRef(cell1) + }) + }) + )(builder) +}) +; +} +export function loadMessageRelaxed(slice: Slice, loadX: (slice: Slice) => X +): MessageRelaxed { + let info: CommonMsgInfoRelaxed = loadCommonMsgInfoRelaxed(slice) +; + let init: Maybe> = loadMaybe>(slice, ((slice: Slice) => { + return loadEither(slice, loadStateInit, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() + return loadStateInit(slice1) + }) + ) +}) +) +; + let body: Either = loadEither(slice, loadX, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() + return loadX(slice1) +}) +) +; + return { + kind: 'MessageRelaxed', + info: info, + init: init, + body: body, +} +; +} +export function storeMessageRelaxed(messageRelaxed: MessageRelaxed, storeX: (x: X) => (builder: Builder) => void +): (builder: Builder) => void { + return ((builder: Builder) => { + storeCommonMsgInfoRelaxed(messageRelaxed.info)(builder) + storeMaybe>(messageRelaxed.init, ((arg: Either) => { + return ((builder: Builder) => { + storeEither(arg, storeStateInit, ((arg: StateInit) => { + return ((builder: Builder) => { + let cell1 = beginCell() + storeStateInit(arg)(cell1) + builder.storeRef(cell1) + }) + }) + )(builder) + }) + }) + )(builder) + storeEither(messageRelaxed.body, storeX, ((arg: X) => { + return ((builder: Builder) => { + let cell1 = beginCell() + storeX(arg)(cell1) + builder.storeRef(cell1) + }) + }) + )(builder) +}) +; +} +export function loadMessageAny(slice: Slice): MessageAny { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x9c54aa4b))) { +slice.loadUint(32) +let anon0: Message = loadMessage(slice, ((slice: Slice) => { + return slice + }) + ) + return { + kind: 'MessageAny', + anon0: anon0, +} +} +; + throw new Error('') +; +} +export function storeMessageAny(messageAny: MessageAny): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x9c54aa4b, 32) + storeMessage(messageAny.anon0, ((arg: Slice) => { + return ((builder: Builder) => { + builder.storeSlice(arg) + }) + }) + )(builder) +}) +; +} +export function loadIntermediateAddress(slice: Slice): IntermediateAddress { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { +slice.loadUint(1) +let use_dest_bits: number = slice.loadUint(bitLen(96)) + return { + kind: 'IntermediateAddress_interm_addr_regular', + use_dest_bits: use_dest_bits, +} +} +; + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b10))) { +slice.loadUint(2) +let workchain_id: number = slice.loadInt(8) +let addr_pfx: number = slice.loadUint(64) + return { + kind: 'IntermediateAddress_interm_addr_simple', + workchain_id: workchain_id, + addr_pfx: addr_pfx, +} +} +; + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b11))) { +slice.loadUint(2) +let workchain_id: number = slice.loadInt(32) +let addr_pfx: number = slice.loadUint(64) + return { + kind: 'IntermediateAddress_interm_addr_ext', + workchain_id: workchain_id, + addr_pfx: addr_pfx, +} +} +; + throw new Error('') +; +} +export function storeIntermediateAddress(intermediateAddress: IntermediateAddress): (builder: Builder) => void { + if ((intermediateAddress.kind == 'IntermediateAddress_interm_addr_regular')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1) + builder.storeUint(intermediateAddress.use_dest_bits, bitLen(96)) +}) +} +; + if ((intermediateAddress.kind == 'IntermediateAddress_interm_addr_simple')) { + return ((builder: Builder) => { + builder.storeUint(0b10, 2) + builder.storeInt(intermediateAddress.workchain_id, 8) + builder.storeUint(intermediateAddress.addr_pfx, 64) +}) +} +; + if ((intermediateAddress.kind == 'IntermediateAddress_interm_addr_ext')) { + return ((builder: Builder) => { + builder.storeUint(0b11, 2) + builder.storeInt(intermediateAddress.workchain_id, 32) + builder.storeUint(intermediateAddress.addr_pfx, 64) +}) +} +; + throw new Error('') +; +} +export function loadMsgEnvelope(slice: Slice): MsgEnvelope { + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0x4))) { +slice.loadUint(4) +let cur_addr: IntermediateAddress = loadIntermediateAddress(slice) +let next_addr: IntermediateAddress = loadIntermediateAddress(slice) +let fwd_fee_remaining: Grams = loadGrams(slice) +let slice1 = slice.loadRef().beginParse() +let msg: Message = loadMessage(slice1, ((slice: Slice) => { + return slice + }) + ) + return { + kind: 'MsgEnvelope', + cur_addr: cur_addr, + next_addr: next_addr, + fwd_fee_remaining: fwd_fee_remaining, + msg: msg, +} +} +; + throw new Error('') +; +} +export function storeMsgEnvelope(msgEnvelope: MsgEnvelope): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x4, 4) + storeIntermediateAddress(msgEnvelope.cur_addr)(builder) + storeIntermediateAddress(msgEnvelope.next_addr)(builder) + storeGrams(msgEnvelope.fwd_fee_remaining)(builder) + let cell1 = beginCell() + storeMessage(msgEnvelope.msg, ((arg: Slice) => { + return ((builder: Builder) => { + cell1.storeSlice(arg) + }) + }) + )(cell1) + builder.storeRef(cell1) +}) +; +} +export function loadInMsg(slice: Slice): InMsg { + if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b000))) { +slice.loadUint(3) +let slice1 = slice.loadRef().beginParse() +let msg: Message = loadMessage(slice1, ((slice: Slice) => { + return slice + }) + ) +let slice2 = slice.loadRef().beginParse() +let transaction: Transaction = loadTransaction(slice2) + return { + kind: 'InMsg_msg_import_ext', + msg: msg, + transaction: transaction, +} +} +; + if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b010))) { +slice.loadUint(3) +let slice1 = slice.loadRef().beginParse() +let msg: Message = loadMessage(slice1, ((slice: Slice) => { + return slice + }) + ) +let slice2 = slice.loadRef().beginParse() +let transaction: Transaction = loadTransaction(slice2) +let ihr_fee: Grams = loadGrams(slice) +let slice3 = slice.loadRef().beginParse() +let proof_created: Slice = slice3 + return { + kind: 'InMsg_msg_import_ihr', + msg: msg, + transaction: transaction, + ihr_fee: ihr_fee, + proof_created: proof_created, +} +} +; + if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b011))) { +slice.loadUint(3) +let slice1 = slice.loadRef().beginParse() +let in_msg: MsgEnvelope = loadMsgEnvelope(slice1) +let slice2 = slice.loadRef().beginParse() +let transaction: Transaction = loadTransaction(slice2) +let fwd_fee: Grams = loadGrams(slice) + return { + kind: 'InMsg_msg_import_imm', + in_msg: in_msg, + transaction: transaction, + fwd_fee: fwd_fee, +} +} +; + if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b100))) { +slice.loadUint(3) +let slice1 = slice.loadRef().beginParse() +let in_msg: MsgEnvelope = loadMsgEnvelope(slice1) +let slice2 = slice.loadRef().beginParse() +let transaction: Transaction = loadTransaction(slice2) +let fwd_fee: Grams = loadGrams(slice) + return { + kind: 'InMsg_msg_import_fin', + in_msg: in_msg, + transaction: transaction, + fwd_fee: fwd_fee, +} +} +; + if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b101))) { +slice.loadUint(3) +let slice1 = slice.loadRef().beginParse() +let in_msg: MsgEnvelope = loadMsgEnvelope(slice1) +let slice2 = slice.loadRef().beginParse() +let out_msg: MsgEnvelope = loadMsgEnvelope(slice2) +let transit_fee: Grams = loadGrams(slice) + return { + kind: 'InMsg_msg_import_tr', + in_msg: in_msg, + out_msg: out_msg, + transit_fee: transit_fee, +} +} +; + if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b110))) { +slice.loadUint(3) +let slice1 = slice.loadRef().beginParse() +let in_msg: MsgEnvelope = loadMsgEnvelope(slice1) +let transaction_id: number = slice.loadUint(64) +let fwd_fee: Grams = loadGrams(slice) + return { + kind: 'InMsg_msg_discard_fin', + in_msg: in_msg, + transaction_id: transaction_id, + fwd_fee: fwd_fee, +} +} +; + if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b111))) { +slice.loadUint(3) +let slice1 = slice.loadRef().beginParse() +let in_msg: MsgEnvelope = loadMsgEnvelope(slice1) +let transaction_id: number = slice.loadUint(64) +let fwd_fee: Grams = loadGrams(slice) +let slice2 = slice.loadRef().beginParse() +let proof_delivered: Slice = slice2 + return { + kind: 'InMsg_msg_discard_tr', + in_msg: in_msg, + transaction_id: transaction_id, + fwd_fee: fwd_fee, + proof_delivered: proof_delivered, +} +} +; + throw new Error('') +; +} +export function storeInMsg(inMsg: InMsg): (builder: Builder) => void { + if ((inMsg.kind == 'InMsg_msg_import_ext')) { + return ((builder: Builder) => { + builder.storeUint(0b000, 3) + let cell1 = beginCell() + storeMessage(inMsg.msg, ((arg: Slice) => { + return ((builder: Builder) => { + cell1.storeSlice(arg) + }) + }) + )(cell1) + builder.storeRef(cell1) + let cell2 = beginCell() + storeTransaction(inMsg.transaction)(cell2) + builder.storeRef(cell2) +}) +} +; + if ((inMsg.kind == 'InMsg_msg_import_ihr')) { + return ((builder: Builder) => { + builder.storeUint(0b010, 3) + let cell1 = beginCell() + storeMessage(inMsg.msg, ((arg: Slice) => { + return ((builder: Builder) => { + cell1.storeSlice(arg) + }) + }) + )(cell1) + builder.storeRef(cell1) + let cell2 = beginCell() + storeTransaction(inMsg.transaction)(cell2) + builder.storeRef(cell2) + storeGrams(inMsg.ihr_fee)(builder) + let cell3 = beginCell() + cell3.storeSlice(inMsg.proof_created) + builder.storeRef(cell3) +}) +} +; + if ((inMsg.kind == 'InMsg_msg_import_imm')) { + return ((builder: Builder) => { + builder.storeUint(0b011, 3) + let cell1 = beginCell() + storeMsgEnvelope(inMsg.in_msg)(cell1) + builder.storeRef(cell1) + let cell2 = beginCell() + storeTransaction(inMsg.transaction)(cell2) + builder.storeRef(cell2) + storeGrams(inMsg.fwd_fee)(builder) +}) +} +; + if ((inMsg.kind == 'InMsg_msg_import_fin')) { + return ((builder: Builder) => { + builder.storeUint(0b100, 3) + let cell1 = beginCell() + storeMsgEnvelope(inMsg.in_msg)(cell1) + builder.storeRef(cell1) + let cell2 = beginCell() + storeTransaction(inMsg.transaction)(cell2) + builder.storeRef(cell2) + storeGrams(inMsg.fwd_fee)(builder) +}) +} +; + if ((inMsg.kind == 'InMsg_msg_import_tr')) { + return ((builder: Builder) => { + builder.storeUint(0b101, 3) + let cell1 = beginCell() + storeMsgEnvelope(inMsg.in_msg)(cell1) + builder.storeRef(cell1) + let cell2 = beginCell() + storeMsgEnvelope(inMsg.out_msg)(cell2) + builder.storeRef(cell2) + storeGrams(inMsg.transit_fee)(builder) +}) +} +; + if ((inMsg.kind == 'InMsg_msg_discard_fin')) { + return ((builder: Builder) => { + builder.storeUint(0b110, 3) + let cell1 = beginCell() + storeMsgEnvelope(inMsg.in_msg)(cell1) + builder.storeRef(cell1) + builder.storeUint(inMsg.transaction_id, 64) + storeGrams(inMsg.fwd_fee)(builder) +}) +} +; + if ((inMsg.kind == 'InMsg_msg_discard_tr')) { + return ((builder: Builder) => { + builder.storeUint(0b111, 3) + let cell1 = beginCell() + storeMsgEnvelope(inMsg.in_msg)(cell1) + builder.storeRef(cell1) + builder.storeUint(inMsg.transaction_id, 64) + storeGrams(inMsg.fwd_fee)(builder) + let cell2 = beginCell() + cell2.storeSlice(inMsg.proof_delivered) + builder.storeRef(cell2) +}) +} +; + throw new Error('') +; +} +export function loadImportFees(slice: Slice): ImportFees { + let fees_collected: Grams = loadGrams(slice) +; + let value_imported: CurrencyCollection = loadCurrencyCollection(slice) +; + return { + kind: 'ImportFees', + fees_collected: fees_collected, + value_imported: value_imported, +} +; +} +export function storeImportFees(importFees: ImportFees): (builder: Builder) => void { + return ((builder: Builder) => { + storeGrams(importFees.fees_collected)(builder) + storeCurrencyCollection(importFees.value_imported)(builder) +}) +; +} +export function loadInMsgDescr(slice: Slice): InMsgDescr { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x8615b8fd))) { +slice.loadUint(32) +let anon0: HashmapAugE = loadHashmapAugE(slice, 256, loadInMsg, loadImportFees) + return { + kind: 'InMsgDescr', + anon0: anon0, +} +} +; + throw new Error('') +; +} +export function storeInMsgDescr(inMsgDescr: InMsgDescr): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x8615b8fd, 32) + storeHashmapAugE(inMsgDescr.anon0, storeInMsg, storeImportFees)(builder) +}) +; +} +export function loadOutMsg(slice: Slice): OutMsg { + if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b000))) { +slice.loadUint(3) +let slice1 = slice.loadRef().beginParse() +let msg: Message = loadMessage(slice1, ((slice: Slice) => { + return slice + }) + ) +let slice2 = slice.loadRef().beginParse() +let transaction: Transaction = loadTransaction(slice2) + return { + kind: 'OutMsg_msg_export_ext', + msg: msg, + transaction: transaction, +} +} +; + if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b010))) { +slice.loadUint(3) +let slice1 = slice.loadRef().beginParse() +let out_msg: MsgEnvelope = loadMsgEnvelope(slice1) +let slice2 = slice.loadRef().beginParse() +let transaction: Transaction = loadTransaction(slice2) +let slice3 = slice.loadRef().beginParse() +let reimport: InMsg = loadInMsg(slice3) + return { + kind: 'OutMsg_msg_export_imm', + out_msg: out_msg, + transaction: transaction, + reimport: reimport, +} +} +; + if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b001))) { +slice.loadUint(3) +let slice1 = slice.loadRef().beginParse() +let out_msg: MsgEnvelope = loadMsgEnvelope(slice1) +let slice2 = slice.loadRef().beginParse() +let transaction: Transaction = loadTransaction(slice2) + return { + kind: 'OutMsg_msg_export_new', + out_msg: out_msg, + transaction: transaction, +} +} +; + if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b011))) { +slice.loadUint(3) +let slice1 = slice.loadRef().beginParse() + +let out_msg: MsgEnvelope = loadMsgEnvelope(slice1) + +let slice2 = slice.loadRef().beginParse() + +let imported: InMsg = loadInMsg(slice2) + + return { + kind: 'OutMsg_msg_export_tr', + out_msg: out_msg, + imported: imported, +} + +} +; + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b1100))) { +slice.loadUint(4) +let slice1 = slice.loadRef().beginParse() + +let out_msg: MsgEnvelope = loadMsgEnvelope(slice1) + +let import_block_lt: number = slice.loadUint(63) + + return { + kind: 'OutMsg_msg_export_deq', + out_msg: out_msg, + import_block_lt: import_block_lt, +} + +} +; + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b1101))) { +slice.loadUint(4) +let msg_env_hash: BitString = slice.loadBits(256) + +let next_workchain: number = slice.loadInt(32) + +let next_addr_pfx: number = slice.loadUint(64) + +let import_block_lt: number = slice.loadUint(64) + + return { + kind: 'OutMsg_msg_export_deq_short', + msg_env_hash: msg_env_hash, + next_workchain: next_workchain, + next_addr_pfx: next_addr_pfx, + import_block_lt: import_block_lt, +} + +} +; + if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b111))) { +slice.loadUint(3) +let slice1 = slice.loadRef().beginParse() + +let out_msg: MsgEnvelope = loadMsgEnvelope(slice1) + +let slice2 = slice.loadRef().beginParse() + +let imported: InMsg = loadInMsg(slice2) + + return { + kind: 'OutMsg_msg_export_tr_req', + out_msg: out_msg, + imported: imported, +} + +} +; + if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b100))) { +slice.loadUint(3) +let slice1 = slice.loadRef().beginParse() + +let out_msg: MsgEnvelope = loadMsgEnvelope(slice1) + +let slice2 = slice.loadRef().beginParse() + +let reimport: InMsg = loadInMsg(slice2) + + return { + kind: 'OutMsg_msg_export_deq_imm', + out_msg: out_msg, + reimport: reimport, +} + +} +; + throw new Error('') +; +} + +export function storeOutMsg(outMsg: OutMsg): (builder: Builder) => void { + if ((outMsg.kind == 'OutMsg_msg_export_ext')) { + return ((builder: Builder) => { + builder.storeUint(0b000, 3) + + let cell1 = beginCell() + + + storeMessage(outMsg.msg, ((arg: Slice) => { + return ((builder: Builder) => { + cell1.storeSlice(arg) + + }) + + + }) + )(cell1) + + builder.storeRef(cell1) + + let cell2 = beginCell() + + + storeTransaction(outMsg.transaction)(cell2) + + builder.storeRef(cell2) + +}) + +} +; + if ((outMsg.kind == 'OutMsg_msg_export_imm')) { + return ((builder: Builder) => { + builder.storeUint(0b010, 3) + + let cell1 = beginCell() + + + storeMsgEnvelope(outMsg.out_msg)(cell1) + + builder.storeRef(cell1) + + let cell2 = beginCell() + + + storeTransaction(outMsg.transaction)(cell2) + + builder.storeRef(cell2) + + let cell3 = beginCell() + + + storeInMsg(outMsg.reimport)(cell3) + + builder.storeRef(cell3) + +}) + +} +; + if ((outMsg.kind == 'OutMsg_msg_export_new')) { + return ((builder: Builder) => { + builder.storeUint(0b001, 3) + + let cell1 = beginCell() + + + storeMsgEnvelope(outMsg.out_msg)(cell1) + + builder.storeRef(cell1) + + let cell2 = beginCell() + + + storeTransaction(outMsg.transaction)(cell2) + + builder.storeRef(cell2) + +}) + +} +; + if ((outMsg.kind == 'OutMsg_msg_export_tr')) { + return ((builder: Builder) => { + builder.storeUint(0b011, 3) + + let cell1 = beginCell() + + + storeMsgEnvelope(outMsg.out_msg)(cell1) + + builder.storeRef(cell1) + + let cell2 = beginCell() + + + storeInMsg(outMsg.imported)(cell2) + + builder.storeRef(cell2) + +}) + +} +; + if ((outMsg.kind == 'OutMsg_msg_export_deq')) { + return ((builder: Builder) => { + builder.storeUint(0b1100, 4) + + let cell1 = beginCell() + + + storeMsgEnvelope(outMsg.out_msg)(cell1) + + builder.storeRef(cell1) + + builder.storeUint(outMsg.import_block_lt, 63) + +}) + +} +; + if ((outMsg.kind == 'OutMsg_msg_export_deq_short')) { + return ((builder: Builder) => { + builder.storeUint(0b1101, 4) + + builder.storeBits(outMsg.msg_env_hash) + + builder.storeInt(outMsg.next_workchain, 32) + + builder.storeUint(outMsg.next_addr_pfx, 64) + + builder.storeUint(outMsg.import_block_lt, 64) + +}) + +} +; + if ((outMsg.kind == 'OutMsg_msg_export_tr_req')) { + return ((builder: Builder) => { + builder.storeUint(0b111, 3) + + let cell1 = beginCell() + + + storeMsgEnvelope(outMsg.out_msg)(cell1) + + builder.storeRef(cell1) + + let cell2 = beginCell() + + + storeInMsg(outMsg.imported)(cell2) + + builder.storeRef(cell2) + +}) + +} +; + if ((outMsg.kind == 'OutMsg_msg_export_deq_imm')) { + return ((builder: Builder) => { + builder.storeUint(0b100, 3) + + let cell1 = beginCell() + + + storeMsgEnvelope(outMsg.out_msg)(cell1) + + builder.storeRef(cell1) + + let cell2 = beginCell() + + + storeInMsg(outMsg.reimport)(cell2) + + builder.storeRef(cell2) + +}) + +} +; + throw new Error('') +; +} + +export function loadEnqueuedMsg(slice: Slice): EnqueuedMsg { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x98cd4c6e))) { +slice.loadUint(32) +let enqueued_lt: number = slice.loadUint(64) + +let slice1 = slice.loadRef().beginParse() + +let out_msg: MsgEnvelope = loadMsgEnvelope(slice1) + + return { + kind: 'EnqueuedMsg', + enqueued_lt: enqueued_lt, + out_msg: out_msg, +} + +} +; + throw new Error('') +; +} + +export function storeEnqueuedMsg(enqueuedMsg: EnqueuedMsg): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x98cd4c6e, 32) + + builder.storeUint(enqueuedMsg.enqueued_lt, 64) + + let cell1 = beginCell() + + + storeMsgEnvelope(enqueuedMsg.out_msg)(cell1) + + builder.storeRef(cell1) + +}) + +; +} + +export function loadOutMsgDescr(slice: Slice): OutMsgDescr { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xbcd61b19))) { +slice.loadUint(32) +let anon0: HashmapAugE = loadHashmapAugE(slice, 256, loadOutMsg, loadCurrencyCollection) + + return { + kind: 'OutMsgDescr', + anon0: anon0, +} + +} +; + throw new Error('') +; +} + +export function storeOutMsgDescr(outMsgDescr: OutMsgDescr): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xbcd61b19, 32) + + storeHashmapAugE(outMsgDescr.anon0, storeOutMsg, storeCurrencyCollection)(builder) + +}) + +; +} + +export function loadOutMsgQueue(slice: Slice): OutMsgQueue { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xcf5f0da2))) { +slice.loadUint(32) +let anon0: HashmapAugE = loadHashmapAugE(slice, 352, loadEnqueuedMsg, ((slice: Slice) => { + return slice.loadUint(64) + + }) + ) + + return { + kind: 'OutMsgQueue', + anon0: anon0, +} + +} +; + throw new Error('') +; +} + +export function storeOutMsgQueue(outMsgQueue: OutMsgQueue): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xcf5f0da2, 32) + + storeHashmapAugE(outMsgQueue.anon0, storeEnqueuedMsg, ((arg: number) => { + return ((builder: Builder) => { + builder.storeUint(arg, 64) + + }) + + + }) + )(builder) + +}) + +; +} + +export function loadProcessedUpto(slice: Slice): ProcessedUpto { + let last_msg_lt: number = slice.loadUint(64) + +; + let last_msg_hash: BitString = slice.loadBits(256) + +; + return { + kind: 'ProcessedUpto', + last_msg_lt: last_msg_lt, + last_msg_hash: last_msg_hash, +} + +; +} + +export function storeProcessedUpto(processedUpto: ProcessedUpto): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(processedUpto.last_msg_lt, 64) + + builder.storeBits(processedUpto.last_msg_hash) + +}) + +; +} + +export function loadProcessedInfo(slice: Slice): ProcessedInfo { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x982f4fa3))) { +slice.loadUint(32) +let anon0: HashmapE = loadHashmapE(slice, 96, loadProcessedUpto) + + return { + kind: 'ProcessedInfo', + anon0: anon0, +} + +} +; + throw new Error('') +; +} + +export function storeProcessedInfo(processedInfo: ProcessedInfo): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x982f4fa3, 32) + + storeHashmapE(processedInfo.anon0, storeProcessedUpto)(builder) + +}) + +; +} + +export function loadIhrPendingSince(slice: Slice): IhrPendingSince { + let import_lt: number = slice.loadUint(64) + +; + return { + kind: 'IhrPendingSince', + import_lt: import_lt, +} + +; +} + +export function storeIhrPendingSince(ihrPendingSince: IhrPendingSince): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(ihrPendingSince.import_lt, 64) + +}) + +; +} + +export function loadIhrPendingInfo(slice: Slice): IhrPendingInfo { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xc31463df))) { +slice.loadUint(32) +let anon0: HashmapE = loadHashmapE(slice, 320, loadIhrPendingSince) + + return { + kind: 'IhrPendingInfo', + anon0: anon0, +} + +} +; + throw new Error('') +; +} + +export function storeIhrPendingInfo(ihrPendingInfo: IhrPendingInfo): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xc31463df, 32) + + storeHashmapE(ihrPendingInfo.anon0, storeIhrPendingSince)(builder) + +}) + +; +} + +export function loadOutMsgQueueInfo(slice: Slice): OutMsgQueueInfo { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x98bb9b21))) { +slice.loadUint(32) +let out_queue: OutMsgQueue = loadOutMsgQueue(slice) + +let proc_info: ProcessedInfo = loadProcessedInfo(slice) + +let ihr_pending: IhrPendingInfo = loadIhrPendingInfo(slice) + + return { + kind: 'OutMsgQueueInfo', + out_queue: out_queue, + proc_info: proc_info, + ihr_pending: ihr_pending, +} + +} +; + throw new Error('') +; +} + +export function storeOutMsgQueueInfo(outMsgQueueInfo: OutMsgQueueInfo): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x98bb9b21, 32) + + storeOutMsgQueue(outMsgQueueInfo.out_queue)(builder) + + storeProcessedInfo(outMsgQueueInfo.proc_info)(builder) + + storeIhrPendingInfo(outMsgQueueInfo.ihr_pending)(builder) + +}) + +; +} + +export function loadStorageUsed(slice: Slice): StorageUsed { + let _cells: VarUInteger = loadVarUInteger(slice, 7) + +; + let bits: VarUInteger = loadVarUInteger(slice, 7) + +; + let public_cells: VarUInteger = loadVarUInteger(slice, 7) + +; + return { + kind: 'StorageUsed', + _cells: _cells, + bits: bits, + public_cells: public_cells, +} + +; +} + +export function storeStorageUsed(storageUsed: StorageUsed): (builder: Builder) => void { + return ((builder: Builder) => { + storeVarUInteger(storageUsed._cells)(builder) + + storeVarUInteger(storageUsed.bits)(builder) + + storeVarUInteger(storageUsed.public_cells)(builder) + +}) + +; +} + +export function loadStorageUsedShort(slice: Slice): StorageUsedShort { + let _cells: VarUInteger = loadVarUInteger(slice, 7) + +; + let bits: VarUInteger = loadVarUInteger(slice, 7) + +; + return { + kind: 'StorageUsedShort', + _cells: _cells, + bits: bits, +} + +; +} + +export function storeStorageUsedShort(storageUsedShort: StorageUsedShort): (builder: Builder) => void { + return ((builder: Builder) => { + storeVarUInteger(storageUsedShort._cells)(builder) + + storeVarUInteger(storageUsedShort.bits)(builder) + +}) + +; +} + +export function loadStorageInfo(slice: Slice): StorageInfo { + let used: StorageUsed = loadStorageUsed(slice) + +; + let last_paid: number = slice.loadUint(32) + +; + let due_payment: Maybe = loadMaybe(slice, loadGrams) + +; + return { + kind: 'StorageInfo', + used: used, + last_paid: last_paid, + due_payment: due_payment, +} + +; +} + +export function storeStorageInfo(storageInfo: StorageInfo): (builder: Builder) => void { + return ((builder: Builder) => { + storeStorageUsed(storageInfo.used)(builder) + + builder.storeUint(storageInfo.last_paid, 32) + + storeMaybe(storageInfo.due_payment, storeGrams)(builder) + +}) + +; +} + +export function loadAccount(slice: Slice): Account { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { +slice.loadUint(1) + return { + kind: 'Account_account_none', +} + +} +; + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { +slice.loadUint(1) +let addr: MsgAddressInt = loadMsgAddressInt(slice) + +let storage_stat: StorageInfo = loadStorageInfo(slice) + +let storage: AccountStorage = loadAccountStorage(slice) + + return { + kind: 'Account_account', + addr: addr, + storage_stat: storage_stat, + storage: storage, +} + +} +; + throw new Error('') +; +} + +export function storeAccount(account: Account): (builder: Builder) => void { + if ((account.kind == 'Account_account_none')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1) + +}) + +} +; + if ((account.kind == 'Account_account')) { + return ((builder: Builder) => { + builder.storeUint(0b1, 1) + + storeMsgAddressInt(account.addr)(builder) + + storeStorageInfo(account.storage_stat)(builder) + + storeAccountStorage(account.storage)(builder) + +}) + +} +; + throw new Error('') +; +} + +export function loadAccountStorage(slice: Slice): AccountStorage { + let last_trans_lt: number = slice.loadUint(64) + +; + let balance: CurrencyCollection = loadCurrencyCollection(slice) + +; + let state: AccountState = loadAccountState(slice) + +; + return { + kind: 'AccountStorage', + last_trans_lt: last_trans_lt, + balance: balance, + state: state, +} + +; +} + +export function storeAccountStorage(accountStorage: AccountStorage): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(accountStorage.last_trans_lt, 64) + + storeCurrencyCollection(accountStorage.balance)(builder) + + storeAccountState(accountStorage.state)(builder) + +}) + +; +} + +export function loadAccountState(slice: Slice): AccountState { + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { +slice.loadUint(2) + return { + kind: 'AccountState_account_uninit', +} + +} +; + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { +slice.loadUint(1) +let _: StateInit = loadStateInit(slice) + + return { + kind: 'AccountState_account_active', + _: _, +} + +} +; + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b01))) { +slice.loadUint(2) +let state_hash: BitString = slice.loadBits(256) + + return { + kind: 'AccountState_account_frozen', + state_hash: state_hash, +} + +} +; + throw new Error('') +; +} + +export function storeAccountState(accountState: AccountState): (builder: Builder) => void { + if ((accountState.kind == 'AccountState_account_uninit')) { + return ((builder: Builder) => { + builder.storeUint(0b00, 2) + +}) + +} +; + if ((accountState.kind == 'AccountState_account_active')) { + return ((builder: Builder) => { + builder.storeUint(0b1, 1) + + storeStateInit(accountState._)(builder) + +}) + +} +; + if ((accountState.kind == 'AccountState_account_frozen')) { + return ((builder: Builder) => { + builder.storeUint(0b01, 2) + + builder.storeBits(accountState.state_hash) + +}) + +} +; + throw new Error('') +; +} + +export function loadAccountStatus(slice: Slice): AccountStatus { + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { +slice.loadUint(2) + return { + kind: 'AccountStatus_acc_state_uninit', +} + +} +; + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b01))) { +slice.loadUint(2) + return { + kind: 'AccountStatus_acc_state_frozen', +} + +} +; + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b10))) { +slice.loadUint(2) + return { + kind: 'AccountStatus_acc_state_active', +} + +} +; + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b11))) { +slice.loadUint(2) + return { + kind: 'AccountStatus_acc_state_nonexist', +} + +} +; + throw new Error('') +; +} + +export function storeAccountStatus(accountStatus: AccountStatus): (builder: Builder) => void { + if ((accountStatus.kind == 'AccountStatus_acc_state_uninit')) { + return ((builder: Builder) => { + builder.storeUint(0b00, 2) + +}) + +} +; + if ((accountStatus.kind == 'AccountStatus_acc_state_frozen')) { + return ((builder: Builder) => { + builder.storeUint(0b01, 2) + +}) + +} +; + if ((accountStatus.kind == 'AccountStatus_acc_state_active')) { + return ((builder: Builder) => { + builder.storeUint(0b10, 2) + +}) + +} +; + if ((accountStatus.kind == 'AccountStatus_acc_state_nonexist')) { + return ((builder: Builder) => { + builder.storeUint(0b11, 2) + +}) + +} +; + throw new Error('') +; +} + +export function loadShardAccount(slice: Slice): ShardAccount { + let slice1 = slice.loadRef().beginParse() + +; + let account: Account = loadAccount(slice1) + +; + let last_trans_hash: BitString = slice.loadBits(256) + +; + let last_trans_lt: number = slice.loadUint(64) + +; + return { + kind: 'ShardAccount', + account: account, + last_trans_hash: last_trans_hash, + last_trans_lt: last_trans_lt, +} + +; +} + +export function storeShardAccount(shardAccount: ShardAccount): (builder: Builder) => void { + return ((builder: Builder) => { + let cell1 = beginCell() + + + storeAccount(shardAccount.account)(cell1) + + builder.storeRef(cell1) + + builder.storeBits(shardAccount.last_trans_hash) + + builder.storeUint(shardAccount.last_trans_lt, 64) + +}) + +; +} + +export function loadDepthBalanceInfo(slice: Slice): DepthBalanceInfo { + let split_depth: number = slice.loadUint(bitLen(30)) + +; + let balance: CurrencyCollection = loadCurrencyCollection(slice) + +; + return { + kind: 'DepthBalanceInfo', + split_depth: split_depth, + balance: balance, +} + +; +} + +export function storeDepthBalanceInfo(depthBalanceInfo: DepthBalanceInfo): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(depthBalanceInfo.split_depth, bitLen(30)) + + storeCurrencyCollection(depthBalanceInfo.balance)(builder) + +}) + +; +} + +export function loadShardAccounts(slice: Slice): ShardAccounts { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xa59aef08))) { +slice.loadUint(32) +let anon0: HashmapAugE = loadHashmapAugE(slice, 256, loadShardAccount, loadDepthBalanceInfo) + + return { + kind: 'ShardAccounts', + anon0: anon0, +} + +} +; + throw new Error('') +; +} + +export function storeShardAccounts(shardAccounts: ShardAccounts): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xa59aef08, 32) + + storeHashmapAugE(shardAccounts.anon0, storeShardAccount, storeDepthBalanceInfo)(builder) + +}) + +; +} + +export function loadTransaction(slice: Slice): Transaction { + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b0111))) { +slice.loadUint(4) +let account_addr: BitString = slice.loadBits(256) + +let lt: number = slice.loadUint(64) + +let prev_trans_hash: BitString = slice.loadBits(256) + +let prev_trans_lt: number = slice.loadUint(64) + +let now: number = slice.loadUint(32) + +let outmsg_cnt: number = slice.loadUint(15) + +let orig_status: AccountStatus = loadAccountStatus(slice) + +let end_status: AccountStatus = loadAccountStatus(slice) + +let slice1 = slice.loadRef().beginParse() + +let in_msg: Maybe> = loadMaybe>(slice1, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() + + + return loadMessage(slice1, ((slice: Slice) => { + return slice + + }) + ) + + }) + ) + +let out_msgs: HashmapE> = loadHashmapE>(slice1, 15, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() + + + return loadMessage(slice1, ((slice: Slice) => { + return slice + + }) + ) + + }) + ) + +let total_fees: CurrencyCollection = loadCurrencyCollection(slice) + +let slice2 = slice.loadRef().beginParse() + +let state_update: HASH_UPDATE = loadHASH_UPDATE(slice2, loadAccount) + +let slice3 = slice.loadRef().beginParse() + +let description: TransactionDescr = loadTransactionDescr(slice3) + + return { + kind: 'Transaction', + account_addr: account_addr, + lt: lt, + prev_trans_hash: prev_trans_hash, + prev_trans_lt: prev_trans_lt, + now: now, + outmsg_cnt: outmsg_cnt, + orig_status: orig_status, + end_status: end_status, + in_msg: in_msg, + out_msgs: out_msgs, + total_fees: total_fees, + state_update: state_update, + description: description, +} + +} +; + throw new Error('') +; +} + +export function storeTransaction(transaction: Transaction): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0b0111, 4) + + builder.storeBits(transaction.account_addr) + + builder.storeUint(transaction.lt, 64) + + builder.storeBits(transaction.prev_trans_hash) + + builder.storeUint(transaction.prev_trans_lt, 64) + + builder.storeUint(transaction.now, 32) + + builder.storeUint(transaction.outmsg_cnt, 15) + + storeAccountStatus(transaction.orig_status)(builder) + + storeAccountStatus(transaction.end_status)(builder) + + let cell1 = beginCell() + + + storeMaybe>(transaction.in_msg, ((arg: Message) => { + return ((builder: Builder) => { + let cell1 = beginCell() + + + storeMessage(arg, ((arg: Slice) => { + return ((builder: Builder) => { + cell1.storeSlice(arg) + + }) + + + }) + )(cell1) + + builder.storeRef(cell1) + + + }) + + + }) + )(cell1) + + storeHashmapE>(transaction.out_msgs, ((arg: Message) => { + return ((builder: Builder) => { + let cell1 = beginCell() + + + storeMessage(arg, ((arg: Slice) => { + return ((builder: Builder) => { + cell1.storeSlice(arg) + + }) + + + }) + )(cell1) + + builder.storeRef(cell1) + + + }) + + + }) + )(cell1) + + builder.storeRef(cell1) + + storeCurrencyCollection(transaction.total_fees)(builder) + + let cell2 = beginCell() + + + storeHASH_UPDATE(transaction.state_update, storeAccount)(cell2) + + builder.storeRef(cell2) + + let cell3 = beginCell() + + + storeTransactionDescr(transaction.description)(cell3) + + builder.storeRef(cell3) + +}) + +; +} + +export function loadMERKLE_UPDATE(slice: Slice, loadX: (slice: Slice) => X +): MERKLE_UPDATE { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x02))) { +slice.loadUint(8) +let old_hash: BitString = slice.loadBits(256) + +let new_hash: BitString = slice.loadBits(256) + +let slice1 = slice.loadRef().beginParse() + +let old: X = loadX(slice1) + +let slice2 = slice.loadRef().beginParse() + +let new0: X = loadX(slice2) + + return { + kind: 'MERKLE_UPDATE', + old_hash: old_hash, + new_hash: new_hash, + old: old, + new0: new0, +} + +} +; + throw new Error('') +; +} + +export function storeMERKLE_UPDATE(mERKLE_UPDATE: MERKLE_UPDATE, storeX: (x: X) => (builder: Builder) => void + +): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x02, 8) + + builder.storeBits(mERKLE_UPDATE.old_hash) + + builder.storeBits(mERKLE_UPDATE.new_hash) + + let cell1 = beginCell() + + + storeX(mERKLE_UPDATE.old)(cell1) + + builder.storeRef(cell1) + + let cell2 = beginCell() + + + storeX(mERKLE_UPDATE.new0)(cell2) + + builder.storeRef(cell2) + +}) + +; +} + +export function loadHASH_UPDATE(slice: Slice, loadX: (slice: Slice) => X +): HASH_UPDATE { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x72))) { +slice.loadUint(8) +let old_hash: BitString = slice.loadBits(256) + +let new_hash: BitString = slice.loadBits(256) + + return { + kind: 'HASH_UPDATE', + old_hash: old_hash, + new_hash: new_hash, +} + +} +; + throw new Error('') +; +} + +export function storeHASH_UPDATE(hASH_UPDATE: HASH_UPDATE, storeX: (x: X) => (builder: Builder) => void + +): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x72, 8) + + builder.storeBits(hASH_UPDATE.old_hash) + + builder.storeBits(hASH_UPDATE.new_hash) + +}) + +; +} + +export function loadMERKLE_PROOF(slice: Slice, loadX: (slice: Slice) => X +): MERKLE_PROOF { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x03))) { +slice.loadUint(8) +let virtual_hash: BitString = slice.loadBits(256) + +let depth: number = slice.loadUint(16) + +let slice1 = slice.loadRef().beginParse() + +let virtual_root: X = loadX(slice1) + + return { + kind: 'MERKLE_PROOF', + virtual_hash: virtual_hash, + depth: depth, + virtual_root: virtual_root, +} + +} +; + throw new Error('') +; +} + +export function storeMERKLE_PROOF(mERKLE_PROOF: MERKLE_PROOF, storeX: (x: X) => (builder: Builder) => void + +): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x03, 8) + + builder.storeBits(mERKLE_PROOF.virtual_hash) + + builder.storeUint(mERKLE_PROOF.depth, 16) + + let cell1 = beginCell() + + + storeX(mERKLE_PROOF.virtual_root)(cell1) + + builder.storeRef(cell1) + +}) + +; +} + +export function loadAccountBlock(slice: Slice): AccountBlock { + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0x5))) { +slice.loadUint(4) +let account_addr: BitString = slice.loadBits(256) + +let transactions: HashmapAug = loadHashmapAug(slice, 64, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() + + + return loadTransaction(slice1) + + }) + , loadCurrencyCollection) + +let slice1 = slice.loadRef().beginParse() + +let state_update: HASH_UPDATE = loadHASH_UPDATE(slice1, loadAccount) + + return { + kind: 'AccountBlock', + account_addr: account_addr, + transactions: transactions, + state_update: state_update, +} + +} +; + throw new Error('') +; +} + +export function storeAccountBlock(accountBlock: AccountBlock): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x5, 4) + + builder.storeBits(accountBlock.account_addr) + + storeHashmapAug(accountBlock.transactions, ((arg: Transaction) => { + return ((builder: Builder) => { + let cell1 = beginCell() + + + storeTransaction(arg)(cell1) + + builder.storeRef(cell1) + + + }) + + + }) + , storeCurrencyCollection)(builder) + + let cell1 = beginCell() + + + storeHASH_UPDATE(accountBlock.state_update, storeAccount)(cell1) + + builder.storeRef(cell1) + +}) + +; +} + +export function loadShardAccountBlocks(slice: Slice): ShardAccountBlocks { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xdc67c889))) { +slice.loadUint(32) +let anon0: HashmapAugE = loadHashmapAugE(slice, 256, loadAccountBlock, loadCurrencyCollection) + + return { + kind: 'ShardAccountBlocks', + anon0: anon0, +} + +} +; + throw new Error('') +; +} + +export function storeShardAccountBlocks(shardAccountBlocks: ShardAccountBlocks): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xdc67c889, 32) + + storeHashmapAugE(shardAccountBlocks.anon0, storeAccountBlock, storeCurrencyCollection)(builder) + +}) + +; +} + +export function loadTrStoragePhase(slice: Slice): TrStoragePhase { + let storage_fees_collected: Grams = loadGrams(slice) + +; + let storage_fees_due: Maybe = loadMaybe(slice, loadGrams) + +; + let status_change: AccStatusChange = loadAccStatusChange(slice) + +; + return { + kind: 'TrStoragePhase', + storage_fees_collected: storage_fees_collected, + storage_fees_due: storage_fees_due, + status_change: status_change, +} + +; +} + +export function storeTrStoragePhase(trStoragePhase: TrStoragePhase): (builder: Builder) => void { + return ((builder: Builder) => { + storeGrams(trStoragePhase.storage_fees_collected)(builder) + + storeMaybe(trStoragePhase.storage_fees_due, storeGrams)(builder) + + storeAccStatusChange(trStoragePhase.status_change)(builder) + +}) + +; +} + +export function loadAccStatusChange(slice: Slice): AccStatusChange { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { +slice.loadUint(1) + return { + kind: 'AccStatusChange_acst_unchanged', +} + +} +; + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b10))) { +slice.loadUint(2) + return { + kind: 'AccStatusChange_acst_frozen', +} + +} +; + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b11))) { +slice.loadUint(2) + return { + kind: 'AccStatusChange_acst_deleted', +} + +} +; + throw new Error('') +; +} + +export function storeAccStatusChange(accStatusChange: AccStatusChange): (builder: Builder) => void { + if ((accStatusChange.kind == 'AccStatusChange_acst_unchanged')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1) + +}) + +} +; + if ((accStatusChange.kind == 'AccStatusChange_acst_frozen')) { + return ((builder: Builder) => { + builder.storeUint(0b10, 2) + +}) + +} +; + if ((accStatusChange.kind == 'AccStatusChange_acst_deleted')) { + return ((builder: Builder) => { + builder.storeUint(0b11, 2) + +}) + +} +; + throw new Error('') +; +} + +export function loadTrCreditPhase(slice: Slice): TrCreditPhase { + let due_fees_collected: Maybe = loadMaybe(slice, loadGrams) + +; + let credit: CurrencyCollection = loadCurrencyCollection(slice) + +; + return { + kind: 'TrCreditPhase', + due_fees_collected: due_fees_collected, + credit: credit, +} + +; +} + +export function storeTrCreditPhase(trCreditPhase: TrCreditPhase): (builder: Builder) => void { + return ((builder: Builder) => { + storeMaybe(trCreditPhase.due_fees_collected, storeGrams)(builder) + + storeCurrencyCollection(trCreditPhase.credit)(builder) + +}) + +; +} + +export function loadTrComputePhase(slice: Slice): TrComputePhase { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { +slice.loadUint(1) +let reason: ComputeSkipReason = loadComputeSkipReason(slice) + + return { + kind: 'TrComputePhase_tr_phase_compute_skipped', + reason: reason, +} + +} +; + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { +slice.loadUint(1) +let success: Bool = loadBool(slice) + +let msg_state_used: Bool = loadBool(slice) + +let account_activated: Bool = loadBool(slice) + +let gas_fees: Grams = loadGrams(slice) + +let slice1 = slice.loadRef().beginParse() + +let gas_used: VarUInteger = loadVarUInteger(slice1, 7) + +let gas_limit: VarUInteger = loadVarUInteger(slice1, 7) + +let gas_credit: Maybe = loadMaybe(slice1, ((slice: Slice) => { + return loadVarUInteger(slice, 3) + + }) + ) + +let mode: number = slice1.loadInt(8) + +let exit_code: number = slice1.loadInt(32) + +let exit_arg: Maybe = loadMaybe(slice1, ((slice: Slice) => { + return slice1.loadInt(32) + + }) + ) + +let vm_steps: number = slice1.loadUint(32) + +let vm_init_state_hash: BitString = slice1.loadBits(256) + +let vm_final_state_hash: BitString = slice1.loadBits(256) + + return { + kind: 'TrComputePhase_tr_phase_compute_vm', + success: success, + msg_state_used: msg_state_used, + account_activated: account_activated, + gas_fees: gas_fees, + gas_used: gas_used, + gas_limit: gas_limit, + gas_credit: gas_credit, + mode: mode, + exit_code: exit_code, + exit_arg: exit_arg, + vm_steps: vm_steps, + vm_init_state_hash: vm_init_state_hash, + vm_final_state_hash: vm_final_state_hash, +} + +} +; + throw new Error('') +; +} + +export function storeTrComputePhase(trComputePhase: TrComputePhase): (builder: Builder) => void { + if ((trComputePhase.kind == 'TrComputePhase_tr_phase_compute_skipped')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1) + + storeComputeSkipReason(trComputePhase.reason)(builder) + +}) + +} +; + if ((trComputePhase.kind == 'TrComputePhase_tr_phase_compute_vm')) { + return ((builder: Builder) => { + builder.storeUint(0b1, 1) + + storeBool(trComputePhase.success)(builder) + + storeBool(trComputePhase.msg_state_used)(builder) + + storeBool(trComputePhase.account_activated)(builder) + + storeGrams(trComputePhase.gas_fees)(builder) + + let cell1 = beginCell() + + + storeVarUInteger(trComputePhase.gas_used)(cell1) + + storeVarUInteger(trComputePhase.gas_limit)(cell1) + + storeMaybe(trComputePhase.gas_credit, ((arg: VarUInteger) => { + return ((builder: Builder) => { + storeVarUInteger(arg)(builder) + + }) + + + }) + )(cell1) + + cell1.storeInt(trComputePhase.mode, 8) + + cell1.storeInt(trComputePhase.exit_code, 32) + + storeMaybe(trComputePhase.exit_arg, ((arg: number) => { + return ((builder: Builder) => { + cell1.storeInt(arg, 32) + + }) + + + }) + )(cell1) + + cell1.storeUint(trComputePhase.vm_steps, 32) + + cell1.storeBits(trComputePhase.vm_init_state_hash) + + cell1.storeBits(trComputePhase.vm_final_state_hash) + + builder.storeRef(cell1) + +}) + +} +; + throw new Error('') +; +} + +export function loadComputeSkipReason(slice: Slice): ComputeSkipReason { + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { +slice.loadUint(2) + return { + kind: 'ComputeSkipReason_cskip_no_state', +} + +} +; + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b01))) { +slice.loadUint(2) + return { + kind: 'ComputeSkipReason_cskip_bad_state', +} + +} +; + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b10))) { +slice.loadUint(2) + return { + kind: 'ComputeSkipReason_cskip_no_gas', +} + +} +; + throw new Error('') +; +} + +export function storeComputeSkipReason(computeSkipReason: ComputeSkipReason): (builder: Builder) => void { + if ((computeSkipReason.kind == 'ComputeSkipReason_cskip_no_state')) { + return ((builder: Builder) => { + builder.storeUint(0b00, 2) + +}) + +} +; + if ((computeSkipReason.kind == 'ComputeSkipReason_cskip_bad_state')) { + return ((builder: Builder) => { + builder.storeUint(0b01, 2) + +}) + +} +; + if ((computeSkipReason.kind == 'ComputeSkipReason_cskip_no_gas')) { + return ((builder: Builder) => { + builder.storeUint(0b10, 2) + +}) + +} +; + throw new Error('') +; +} + +export function loadTrActionPhase(slice: Slice): TrActionPhase { + let success: Bool = loadBool(slice) + +; + let valid: Bool = loadBool(slice) + +; + let no_funds: Bool = loadBool(slice) + +; + let status_change: AccStatusChange = loadAccStatusChange(slice) + +; + let total_fwd_fees: Maybe = loadMaybe(slice, loadGrams) + +; + let total_action_fees: Maybe = loadMaybe(slice, loadGrams) + +; + let result_code: number = slice.loadInt(32) + +; + let result_arg: Maybe = loadMaybe(slice, ((slice: Slice) => { + return slice.loadInt(32) + +}) +) + +; + let tot_actions: number = slice.loadUint(16) + +; + let spec_actions: number = slice.loadUint(16) + +; + let skipped_actions: number = slice.loadUint(16) + +; + let msgs_created: number = slice.loadUint(16) + +; + let action_list_hash: BitString = slice.loadBits(256) + +; + let tot_msg_size: StorageUsedShort = loadStorageUsedShort(slice) + +; + return { + kind: 'TrActionPhase', + success: success, + valid: valid, + no_funds: no_funds, + status_change: status_change, + total_fwd_fees: total_fwd_fees, + total_action_fees: total_action_fees, + result_code: result_code, + result_arg: result_arg, + tot_actions: tot_actions, + spec_actions: spec_actions, + skipped_actions: skipped_actions, + msgs_created: msgs_created, + action_list_hash: action_list_hash, + tot_msg_size: tot_msg_size, +} + +; +} + +export function storeTrActionPhase(trActionPhase: TrActionPhase): (builder: Builder) => void { + return ((builder: Builder) => { + storeBool(trActionPhase.success)(builder) + + storeBool(trActionPhase.valid)(builder) + + storeBool(trActionPhase.no_funds)(builder) + + storeAccStatusChange(trActionPhase.status_change)(builder) + + storeMaybe(trActionPhase.total_fwd_fees, storeGrams)(builder) + + storeMaybe(trActionPhase.total_action_fees, storeGrams)(builder) + + builder.storeInt(trActionPhase.result_code, 32) + + storeMaybe(trActionPhase.result_arg, ((arg: number) => { + return ((builder: Builder) => { + builder.storeInt(arg, 32) + + }) + + + }) + )(builder) + + builder.storeUint(trActionPhase.tot_actions, 16) + + builder.storeUint(trActionPhase.spec_actions, 16) + + builder.storeUint(trActionPhase.skipped_actions, 16) + + builder.storeUint(trActionPhase.msgs_created, 16) + + builder.storeBits(trActionPhase.action_list_hash) + + storeStorageUsedShort(trActionPhase.tot_msg_size)(builder) + +}) + +; +} + +export function loadTrBouncePhase(slice: Slice): TrBouncePhase { + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { +slice.loadUint(2) + return { + kind: 'TrBouncePhase_tr_phase_bounce_negfunds', +} + +} +; + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b01))) { +slice.loadUint(2) +let msg_size: StorageUsedShort = loadStorageUsedShort(slice) + +let req_fwd_fees: Grams = loadGrams(slice) + + return { + kind: 'TrBouncePhase_tr_phase_bounce_nofunds', + msg_size: msg_size, + req_fwd_fees: req_fwd_fees, +} + +} +; + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { +slice.loadUint(1) +let msg_size: StorageUsedShort = loadStorageUsedShort(slice) + +let msg_fees: Grams = loadGrams(slice) + +let fwd_fees: Grams = loadGrams(slice) + + return { + kind: 'TrBouncePhase_tr_phase_bounce_ok', + msg_size: msg_size, + msg_fees: msg_fees, + fwd_fees: fwd_fees, +} + +} +; + throw new Error('') +; +} + +export function storeTrBouncePhase(trBouncePhase: TrBouncePhase): (builder: Builder) => void { + if ((trBouncePhase.kind == 'TrBouncePhase_tr_phase_bounce_negfunds')) { + return ((builder: Builder) => { + builder.storeUint(0b00, 2) + +}) + +} +; + if ((trBouncePhase.kind == 'TrBouncePhase_tr_phase_bounce_nofunds')) { + return ((builder: Builder) => { + builder.storeUint(0b01, 2) + + storeStorageUsedShort(trBouncePhase.msg_size)(builder) + + storeGrams(trBouncePhase.req_fwd_fees)(builder) + +}) + +} +; + if ((trBouncePhase.kind == 'TrBouncePhase_tr_phase_bounce_ok')) { + return ((builder: Builder) => { + builder.storeUint(0b1, 1) + + storeStorageUsedShort(trBouncePhase.msg_size)(builder) + + storeGrams(trBouncePhase.msg_fees)(builder) + + storeGrams(trBouncePhase.fwd_fees)(builder) + +}) + +} +; + throw new Error('') +; +} + +export function loadTransactionDescr(slice: Slice): TransactionDescr { + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b0000))) { +slice.loadUint(4) +let credit_first: Bool = loadBool(slice) + +let storage_ph: Maybe = loadMaybe(slice, loadTrStoragePhase) + +let credit_ph: Maybe = loadMaybe(slice, loadTrCreditPhase) + +let compute_ph: TrComputePhase = loadTrComputePhase(slice) + +let action: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() + + + return loadTrActionPhase(slice1) + + }) + ) + +let aborted: Bool = loadBool(slice) + +let bounce: Maybe = loadMaybe(slice, loadTrBouncePhase) + +let destroyed: Bool = loadBool(slice) + + return { + kind: 'TransactionDescr_trans_ord', + credit_first: credit_first, + storage_ph: storage_ph, + credit_ph: credit_ph, + compute_ph: compute_ph, + action: action, + aborted: aborted, + bounce: bounce, + destroyed: destroyed, +} + +} +; + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b0001))) { +slice.loadUint(4) +let storage_ph: TrStoragePhase = loadTrStoragePhase(slice) + + return { + kind: 'TransactionDescr_trans_storage', + storage_ph: storage_ph, +} + +} +; + if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b001))) { +slice.loadUint(3) +let is_tock: Bool = loadBool(slice) + +let storage_ph: TrStoragePhase = loadTrStoragePhase(slice) + +let compute_ph: TrComputePhase = loadTrComputePhase(slice) + +let action: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() + + + return loadTrActionPhase(slice1) + + }) + ) + +let aborted: Bool = loadBool(slice) + +let destroyed: Bool = loadBool(slice) + + return { + kind: 'TransactionDescr_trans_tick_tock', + is_tock: is_tock, + storage_ph: storage_ph, + compute_ph: compute_ph, + action: action, + aborted: aborted, + destroyed: destroyed, +} + +} +; + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b0100))) { +slice.loadUint(4) +let split_info: SplitMergeInfo = loadSplitMergeInfo(slice) + +let storage_ph: Maybe = loadMaybe(slice, loadTrStoragePhase) + +let compute_ph: TrComputePhase = loadTrComputePhase(slice) + +let action: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() + + + return loadTrActionPhase(slice1) + + }) + ) + +let aborted: Bool = loadBool(slice) + +let destroyed: Bool = loadBool(slice) + + return { + kind: 'TransactionDescr_trans_split_prepare', + split_info: split_info, + storage_ph: storage_ph, + compute_ph: compute_ph, + action: action, + aborted: aborted, + destroyed: destroyed, +} + +} +; + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b0101))) { +slice.loadUint(4) +let split_info: SplitMergeInfo = loadSplitMergeInfo(slice) + +let slice1 = slice.loadRef().beginParse() + +let prepare_transaction: Transaction = loadTransaction(slice1) + +let installed: Bool = loadBool(slice) + + return { + kind: 'TransactionDescr_trans_split_install', + split_info: split_info, + prepare_transaction: prepare_transaction, + installed: installed, +} + +} +; + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b0110))) { +slice.loadUint(4) +let split_info: SplitMergeInfo = loadSplitMergeInfo(slice) + +let storage_ph: TrStoragePhase = loadTrStoragePhase(slice) + +let aborted: Bool = loadBool(slice) + + return { + kind: 'TransactionDescr_trans_merge_prepare', + split_info: split_info, + storage_ph: storage_ph, + aborted: aborted, +} + +} +; + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b0111))) { +slice.loadUint(4) +let split_info: SplitMergeInfo = loadSplitMergeInfo(slice) + +let slice1 = slice.loadRef().beginParse() + +let prepare_transaction: Transaction = loadTransaction(slice1) + +let storage_ph: Maybe = loadMaybe(slice, loadTrStoragePhase) + +let credit_ph: Maybe = loadMaybe(slice, loadTrCreditPhase) + +let compute_ph: TrComputePhase = loadTrComputePhase(slice) + +let action: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() + + + return loadTrActionPhase(slice1) + + }) + ) + +let aborted: Bool = loadBool(slice) + +let destroyed: Bool = loadBool(slice) + + return { + kind: 'TransactionDescr_trans_merge_install', + split_info: split_info, + prepare_transaction: prepare_transaction, + storage_ph: storage_ph, + credit_ph: credit_ph, + compute_ph: compute_ph, + action: action, + aborted: aborted, + destroyed: destroyed, +} + +} +; + throw new Error('') +; +} + +export function storeTransactionDescr(transactionDescr: TransactionDescr): (builder: Builder) => void { + if ((transactionDescr.kind == 'TransactionDescr_trans_ord')) { + return ((builder: Builder) => { + builder.storeUint(0b0000, 4) + + storeBool(transactionDescr.credit_first)(builder) + + storeMaybe(transactionDescr.storage_ph, storeTrStoragePhase)(builder) + + storeMaybe(transactionDescr.credit_ph, storeTrCreditPhase)(builder) + + storeTrComputePhase(transactionDescr.compute_ph)(builder) + + storeMaybe(transactionDescr.action, ((arg: TrActionPhase) => { + return ((builder: Builder) => { + let cell1 = beginCell() + + + storeTrActionPhase(arg)(cell1) + + builder.storeRef(cell1) + + + }) + + + }) + )(builder) + + storeBool(transactionDescr.aborted)(builder) + + storeMaybe(transactionDescr.bounce, storeTrBouncePhase)(builder) + + storeBool(transactionDescr.destroyed)(builder) + +}) + +} +; + if ((transactionDescr.kind == 'TransactionDescr_trans_storage')) { + return ((builder: Builder) => { + builder.storeUint(0b0001, 4) + + storeTrStoragePhase(transactionDescr.storage_ph)(builder) + +}) + +} +; + if ((transactionDescr.kind == 'TransactionDescr_trans_tick_tock')) { + return ((builder: Builder) => { + builder.storeUint(0b001, 3) + + storeBool(transactionDescr.is_tock)(builder) + + storeTrStoragePhase(transactionDescr.storage_ph)(builder) + + storeTrComputePhase(transactionDescr.compute_ph)(builder) + + storeMaybe(transactionDescr.action, ((arg: TrActionPhase) => { + return ((builder: Builder) => { + let cell1 = beginCell() + + + storeTrActionPhase(arg)(cell1) + + builder.storeRef(cell1) + + + }) + + + }) + )(builder) + + storeBool(transactionDescr.aborted)(builder) + + storeBool(transactionDescr.destroyed)(builder) + +}) + +} +; + if ((transactionDescr.kind == 'TransactionDescr_trans_split_prepare')) { + return ((builder: Builder) => { + builder.storeUint(0b0100, 4) + + storeSplitMergeInfo(transactionDescr.split_info)(builder) + + storeMaybe(transactionDescr.storage_ph, storeTrStoragePhase)(builder) + + storeTrComputePhase(transactionDescr.compute_ph)(builder) + + storeMaybe(transactionDescr.action, ((arg: TrActionPhase) => { + return ((builder: Builder) => { + let cell1 = beginCell() + + + storeTrActionPhase(arg)(cell1) + + builder.storeRef(cell1) + + + }) + + + }) + )(builder) + + storeBool(transactionDescr.aborted)(builder) + + storeBool(transactionDescr.destroyed)(builder) + +}) + +} +; + if ((transactionDescr.kind == 'TransactionDescr_trans_split_install')) { + return ((builder: Builder) => { + builder.storeUint(0b0101, 4) + + storeSplitMergeInfo(transactionDescr.split_info)(builder) + + let cell1 = beginCell() + + + storeTransaction(transactionDescr.prepare_transaction)(cell1) + + builder.storeRef(cell1) + + storeBool(transactionDescr.installed)(builder) + +}) + +} +; + if ((transactionDescr.kind == 'TransactionDescr_trans_merge_prepare')) { + return ((builder: Builder) => { + builder.storeUint(0b0110, 4) + + storeSplitMergeInfo(transactionDescr.split_info)(builder) + + storeTrStoragePhase(transactionDescr.storage_ph)(builder) + + storeBool(transactionDescr.aborted)(builder) + +}) + +} +; + if ((transactionDescr.kind == 'TransactionDescr_trans_merge_install')) { + return ((builder: Builder) => { + builder.storeUint(0b0111, 4) + + storeSplitMergeInfo(transactionDescr.split_info)(builder) + + let cell1 = beginCell() + + + storeTransaction(transactionDescr.prepare_transaction)(cell1) + + builder.storeRef(cell1) + + storeMaybe(transactionDescr.storage_ph, storeTrStoragePhase)(builder) + + storeMaybe(transactionDescr.credit_ph, storeTrCreditPhase)(builder) + + storeTrComputePhase(transactionDescr.compute_ph)(builder) + + storeMaybe(transactionDescr.action, ((arg: TrActionPhase) => { + return ((builder: Builder) => { + let cell1 = beginCell() + + + storeTrActionPhase(arg)(cell1) + + builder.storeRef(cell1) + + + }) + + + }) + )(builder) + + storeBool(transactionDescr.aborted)(builder) + + storeBool(transactionDescr.destroyed)(builder) + +}) + +} +; + throw new Error('') +; +} + +export function loadSplitMergeInfo(slice: Slice): SplitMergeInfo { + let cur_shard_pfx_len: number = slice.loadUint(6) + +; + let acc_split_depth: number = slice.loadUint(6) + +; + let this_addr: BitString = slice.loadBits(256) + +; + let sibling_addr: BitString = slice.loadBits(256) + +; + return { + kind: 'SplitMergeInfo', + cur_shard_pfx_len: cur_shard_pfx_len, + acc_split_depth: acc_split_depth, + this_addr: this_addr, + sibling_addr: sibling_addr, +} + +; +} + +export function storeSplitMergeInfo(splitMergeInfo: SplitMergeInfo): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(splitMergeInfo.cur_shard_pfx_len, 6) + + builder.storeUint(splitMergeInfo.acc_split_depth, 6) + + builder.storeBits(splitMergeInfo.this_addr) + + builder.storeBits(splitMergeInfo.sibling_addr) + +}) + +; +} + +export function loadSmartContractInfo(slice: Slice): SmartContractInfo { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x076ef1ea))) { +slice.loadUint(32) +let actions: number = slice.loadUint(16) + +let msgs_sent: number = slice.loadUint(16) + +let unixtime: number = slice.loadUint(32) + +let block_lt: number = slice.loadUint(64) + +let trans_lt: number = slice.loadUint(64) + +let rand_seed: BitString = slice.loadBits(256) + +let balance_remaining: CurrencyCollection = loadCurrencyCollection(slice) + +let myself: MsgAddressInt = loadMsgAddressInt(slice) + + return { + kind: 'SmartContractInfo', + actions: actions, + msgs_sent: msgs_sent, + unixtime: unixtime, + block_lt: block_lt, + trans_lt: trans_lt, + rand_seed: rand_seed, + balance_remaining: balance_remaining, + myself: myself, +} + +} +; + throw new Error('') +; +} + +export function storeSmartContractInfo(smartContractInfo: SmartContractInfo): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x076ef1ea, 32) + + builder.storeUint(smartContractInfo.actions, 16) + + builder.storeUint(smartContractInfo.msgs_sent, 16) + + builder.storeUint(smartContractInfo.unixtime, 32) + + builder.storeUint(smartContractInfo.block_lt, 64) + + builder.storeUint(smartContractInfo.trans_lt, 64) + + builder.storeBits(smartContractInfo.rand_seed) + + storeCurrencyCollection(smartContractInfo.balance_remaining)(builder) + + storeMsgAddressInt(smartContractInfo.myself)(builder) + +}) + +; +} + +export function loadOutList(slice: Slice, arg0: number): OutList { + if ((arg0 == 0)) { + return { + kind: 'OutList_out_list_empty', +} + +} +; + if (true) { +let slice1 = slice.loadRef().beginParse() + +let prev: OutList = loadOutList(slice1, (arg0 - 1)) + +let action: OutAction = loadOutAction(slice) + + return { + kind: 'OutList_out_list', + n: (arg0 - 1), + prev: prev, + action: action, +} + +} +; + throw new Error('') +; +} + +export function storeOutList(outList: OutList): (builder: Builder) => void { + if ((outList.kind == 'OutList_out_list_empty')) { + return ((builder: Builder) => { +}) + +} +; + if ((outList.kind == 'OutList_out_list')) { + return ((builder: Builder) => { + let cell1 = beginCell() + + + storeOutList(outList.prev)(cell1) + + builder.storeRef(cell1) + + storeOutAction(outList.action)(builder) + +}) + +} +; + throw new Error('') +; +} + +export function loadOutAction(slice: Slice): OutAction { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x0ec3c86d))) { +slice.loadUint(32) +let mode: number = slice.loadUint(8) + +let slice1 = slice.loadRef().beginParse() + +let out_msg: MessageRelaxed = loadMessageRelaxed(slice1, ((slice: Slice) => { + return slice + + }) + ) + + return { + kind: 'OutAction_action_send_msg', + mode: mode, + out_msg: out_msg, +} + +} +; + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xad4de08e))) { +slice.loadUint(32) +let slice1 = slice.loadRef().beginParse() + +let new_code: Slice = slice1 + + return { + kind: 'OutAction_action_set_code', + new_code: new_code, +} + +} +; + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x36e6b809))) { +slice.loadUint(32) +let mode: number = slice.loadUint(8) + +let currency: CurrencyCollection = loadCurrencyCollection(slice) + + return { + kind: 'OutAction_action_reserve_currency', + mode: mode, + currency: currency, +} + +} +; + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x26fa1dd4))) { +slice.loadUint(32) +let mode: number = slice.loadUint(7) + +let libref: LibRef = loadLibRef(slice) + + if ((!(mode <= 2))) { +throw new Error('') + } + return { + kind: 'OutAction_action_change_library', + mode: mode, + libref: libref, +} + +} +; + throw new Error('') +; +} + +export function storeOutAction(outAction: OutAction): (builder: Builder) => void { + if ((outAction.kind == 'OutAction_action_send_msg')) { + return ((builder: Builder) => { + builder.storeUint(0x0ec3c86d, 32) + + builder.storeUint(outAction.mode, 8) + + let cell1 = beginCell() + + + storeMessageRelaxed(outAction.out_msg, ((arg: Slice) => { + return ((builder: Builder) => { + cell1.storeSlice(arg) + + }) + + + }) + )(cell1) + + builder.storeRef(cell1) + +}) + +} +; + if ((outAction.kind == 'OutAction_action_set_code')) { + return ((builder: Builder) => { + builder.storeUint(0xad4de08e, 32) + + let cell1 = beginCell() + + + cell1.storeSlice(outAction.new_code) + + builder.storeRef(cell1) + +}) + +} +; + if ((outAction.kind == 'OutAction_action_reserve_currency')) { + return ((builder: Builder) => { + builder.storeUint(0x36e6b809, 32) + + builder.storeUint(outAction.mode, 8) + + storeCurrencyCollection(outAction.currency)(builder) + +}) + +} +; + if ((outAction.kind == 'OutAction_action_change_library')) { + return ((builder: Builder) => { + builder.storeUint(0x26fa1dd4, 32) + + builder.storeUint(outAction.mode, 7) + + storeLibRef(outAction.libref)(builder) + + if ((!(outAction.mode <= 2))) { + throw new Error('') + } + +}) + +} +; + throw new Error('') +; +} + +export function loadLibRef(slice: Slice): LibRef { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { +slice.loadUint(1) +let lib_hash: BitString = slice.loadBits(256) + + return { + kind: 'LibRef_libref_hash', + lib_hash: lib_hash, +} + +} +; + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { +slice.loadUint(1) +let slice1 = slice.loadRef().beginParse() + +let library: Slice = slice1 + + return { + kind: 'LibRef_libref_ref', + library: library, +} + +} +; + throw new Error('') +; +} + +export function storeLibRef(libRef: LibRef): (builder: Builder) => void { + if ((libRef.kind == 'LibRef_libref_hash')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1) + + builder.storeBits(libRef.lib_hash) + +}) + +} +; + if ((libRef.kind == 'LibRef_libref_ref')) { + return ((builder: Builder) => { + builder.storeUint(0b1, 1) + + let cell1 = beginCell() + + + cell1.storeSlice(libRef.library) + + builder.storeRef(cell1) + +}) + +} +; + throw new Error('') +; +} + +export function loadOutListNode(slice: Slice): OutListNode { + let slice1 = slice.loadRef().beginParse() + +; + let prev: Slice = slice1 + +; + let action: OutAction = loadOutAction(slice) + +; + return { + kind: 'OutListNode', + prev: prev, + action: action, +} + +; +} + +export function storeOutListNode(outListNode: OutListNode): (builder: Builder) => void { + return ((builder: Builder) => { + let cell1 = beginCell() + + + cell1.storeSlice(outListNode.prev) + + builder.storeRef(cell1) + + storeOutAction(outListNode.action)(builder) + +}) + +; +} + +export function loadShardIdent(slice: Slice): ShardIdent { + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { +slice.loadUint(2) +let shard_pfx_bits: number = slice.loadUint(bitLen(60)) + +let workchain_id: number = slice.loadInt(32) + +let shard_prefix: number = slice.loadUint(64) + + return { + kind: 'ShardIdent', + shard_pfx_bits: shard_pfx_bits, + workchain_id: workchain_id, + shard_prefix: shard_prefix, +} + +} +; + throw new Error('') +; +} + +export function storeShardIdent(shardIdent: ShardIdent): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0b00, 2) + + builder.storeUint(shardIdent.shard_pfx_bits, bitLen(60)) + + builder.storeInt(shardIdent.workchain_id, 32) + + builder.storeUint(shardIdent.shard_prefix, 64) + +}) + +; +} + +export function loadExtBlkRef(slice: Slice): ExtBlkRef { + let end_lt: number = slice.loadUint(64) + +; + let seq_no: number = slice.loadUint(32) + +; + let root_hash: BitString = slice.loadBits(256) + +; + let file_hash: BitString = slice.loadBits(256) + +; + return { + kind: 'ExtBlkRef', + end_lt: end_lt, + seq_no: seq_no, + root_hash: root_hash, + file_hash: file_hash, +} + +; +} + +export function storeExtBlkRef(extBlkRef: ExtBlkRef): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(extBlkRef.end_lt, 64) + + builder.storeUint(extBlkRef.seq_no, 32) + + builder.storeBits(extBlkRef.root_hash) + + builder.storeBits(extBlkRef.file_hash) + +}) + +; +} + +export function loadBlockIdExt(slice: Slice): BlockIdExt { + let shard_id: ShardIdent = loadShardIdent(slice) + +; + let seq_no: number = slice.loadUint(32) + +; + let root_hash: BitString = slice.loadBits(256) + +; + let file_hash: BitString = slice.loadBits(256) + +; + return { + kind: 'BlockIdExt', + shard_id: shard_id, + seq_no: seq_no, + root_hash: root_hash, + file_hash: file_hash, +} + +; +} + +export function storeBlockIdExt(blockIdExt: BlockIdExt): (builder: Builder) => void { + return ((builder: Builder) => { + storeShardIdent(blockIdExt.shard_id)(builder) + + builder.storeUint(blockIdExt.seq_no, 32) + + builder.storeBits(blockIdExt.root_hash) + + builder.storeBits(blockIdExt.file_hash) + +}) + +; +} + +export function loadBlkMasterInfo(slice: Slice): BlkMasterInfo { + let master: ExtBlkRef = loadExtBlkRef(slice) + +; + return { + kind: 'BlkMasterInfo', + master: master, +} + +; +} + +export function storeBlkMasterInfo(blkMasterInfo: BlkMasterInfo): (builder: Builder) => void { + return ((builder: Builder) => { + storeExtBlkRef(blkMasterInfo.master)(builder) + +}) + +; +} + +export function loadShardStateUnsplit(slice: Slice): ShardStateUnsplit { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x9023afe2))) { +slice.loadUint(32) +let global_id: number = slice.loadInt(32) + +let shard_id: ShardIdent = loadShardIdent(slice) + +let seq_no: number = slice.loadUint(32) + +let vert_seq_no: number = slice.loadUint(32) + +let gen_utime: number = slice.loadUint(32) + +let gen_lt: number = slice.loadUint(64) + +let min_ref_mc_seqno: number = slice.loadUint(32) + +let slice1 = slice.loadRef().beginParse() + +let out_msg_queue_info: OutMsgQueueInfo = loadOutMsgQueueInfo(slice1) + +let before_split: number = slice.loadUint(1) + +let slice2 = slice.loadRef().beginParse() + +let accounts: ShardAccounts = loadShardAccounts(slice2) + +let slice3 = slice.loadRef().beginParse() + +let overload_history: number = slice3.loadUint(64) + +let underload_history: number = slice3.loadUint(64) + +let total_balance: CurrencyCollection = loadCurrencyCollection(slice3) + +let total_validator_fees: CurrencyCollection = loadCurrencyCollection(slice3) + +let libraries: HashmapE = loadHashmapE(slice3, 256, loadLibDescr) + +let master_ref: Maybe = loadMaybe(slice3, loadBlkMasterInfo) + +let custom: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() + + + return loadMcStateExtra(slice1) + + }) + ) + + return { + kind: 'ShardStateUnsplit', + global_id: global_id, + shard_id: shard_id, + seq_no: seq_no, + vert_seq_no: vert_seq_no, + gen_utime: gen_utime, + gen_lt: gen_lt, + min_ref_mc_seqno: min_ref_mc_seqno, + out_msg_queue_info: out_msg_queue_info, + before_split: before_split, + accounts: accounts, + overload_history: overload_history, + underload_history: underload_history, + total_balance: total_balance, + total_validator_fees: total_validator_fees, + libraries: libraries, + master_ref: master_ref, + custom: custom, +} + +} +; + throw new Error('') +; +} + +export function storeShardStateUnsplit(shardStateUnsplit: ShardStateUnsplit): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x9023afe2, 32) + + builder.storeInt(shardStateUnsplit.global_id, 32) + + storeShardIdent(shardStateUnsplit.shard_id)(builder) + + builder.storeUint(shardStateUnsplit.seq_no, 32) + + builder.storeUint(shardStateUnsplit.vert_seq_no, 32) + + builder.storeUint(shardStateUnsplit.gen_utime, 32) + + builder.storeUint(shardStateUnsplit.gen_lt, 64) + + builder.storeUint(shardStateUnsplit.min_ref_mc_seqno, 32) + + let cell1 = beginCell() + + + storeOutMsgQueueInfo(shardStateUnsplit.out_msg_queue_info)(cell1) + + builder.storeRef(cell1) + + builder.storeUint(shardStateUnsplit.before_split, 1) + + let cell2 = beginCell() + + + storeShardAccounts(shardStateUnsplit.accounts)(cell2) + + builder.storeRef(cell2) + + let cell3 = beginCell() + + + cell3.storeUint(shardStateUnsplit.overload_history, 64) + + cell3.storeUint(shardStateUnsplit.underload_history, 64) + + storeCurrencyCollection(shardStateUnsplit.total_balance)(cell3) + + storeCurrencyCollection(shardStateUnsplit.total_validator_fees)(cell3) + + storeHashmapE(shardStateUnsplit.libraries, storeLibDescr)(cell3) + + storeMaybe(shardStateUnsplit.master_ref, storeBlkMasterInfo)(cell3) + + builder.storeRef(cell3) + + storeMaybe(shardStateUnsplit.custom, ((arg: McStateExtra) => { + return ((builder: Builder) => { + let cell1 = beginCell() + + + storeMcStateExtra(arg)(cell1) + + builder.storeRef(cell1) + + + }) + + + }) + )(builder) + +}) + +; +} + +export function loadShardState(slice: Slice): ShardState { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x81e52440))) { +slice.loadUint(32) +let anon0: ShardStateUnsplit = loadShardStateUnsplit(slice) + + return { + kind: 'ShardState__', + anon0: anon0, +} + +} +; + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x5f327da5))) { +slice.loadUint(32) +let slice1 = slice.loadRef().beginParse() + +let left: ShardStateUnsplit = loadShardStateUnsplit(slice1) + +let slice2 = slice.loadRef().beginParse() + +let right: ShardStateUnsplit = loadShardStateUnsplit(slice2) + + return { + kind: 'ShardState_split_state', + left: left, + right: right, +} + +} +; + throw new Error('') +; +} + +export function storeShardState(shardState: ShardState): (builder: Builder) => void { + if ((shardState.kind == 'ShardState__')) { + return ((builder: Builder) => { + builder.storeUint(0x81e52440, 32) + + storeShardStateUnsplit(shardState.anon0)(builder) + +}) + +} +; + if ((shardState.kind == 'ShardState_split_state')) { + return ((builder: Builder) => { + builder.storeUint(0x5f327da5, 32) + + let cell1 = beginCell() + + + storeShardStateUnsplit(shardState.left)(cell1) + + builder.storeRef(cell1) + + let cell2 = beginCell() + + + storeShardStateUnsplit(shardState.right)(cell2) + + builder.storeRef(cell2) + +}) + +} +; + throw new Error('') +; +} + +export function loadLibDescr(slice: Slice): LibDescr { + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { +slice.loadUint(2) +let slice1 = slice.loadRef().beginParse() + +let lib: Slice = slice1 + +let publishers: Hashmap = loadHashmap(slice, 256, loadTrue) + + return { + kind: 'LibDescr', + lib: lib, + publishers: publishers, +} + +} +; + throw new Error('') +; +} + +export function storeLibDescr(libDescr: LibDescr): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0b00, 2) + + let cell1 = beginCell() + + + cell1.storeSlice(libDescr.lib) + + builder.storeRef(cell1) + + storeHashmap(libDescr.publishers, storeTrue)(builder) + +}) + +; +} + +export function loadBlockInfo(slice: Slice): BlockInfo { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x9bc7a987))) { +slice.loadUint(32) +let version: number = slice.loadUint(32) + +let not_master: number = slice.loadUint(1) + +let after_merge: number = slice.loadUint(1) + +let before_split: number = slice.loadUint(1) + +let after_split: number = slice.loadUint(1) + +let want_split: Bool = loadBool(slice) + +let want_merge: Bool = loadBool(slice) + +let key_block: Bool = loadBool(slice) + +let vert_seqno_incr: number = slice.loadUint(1) + +let flags: number = slice.loadUint(8) + +let seq_no: number = slice.loadUint(32) + +let vert_seq_no: number = slice.loadUint(32) + +let shard: ShardIdent = loadShardIdent(slice) + +let gen_utime: number = slice.loadUint(32) + +let start_lt: number = slice.loadUint(64) + +let end_lt: number = slice.loadUint(64) + +let gen_validator_list_hash_short: number = slice.loadUint(32) + +let gen_catchain_seqno: number = slice.loadUint(32) + +let min_ref_mc_seqno: number = slice.loadUint(32) + +let prev_key_block_seqno: number = slice.loadUint(32) + +let gen_software: GlobalVersion | undefined = ((flags & (1 << 0)) ? loadGlobalVersion(slice) : undefined) + +let master_ref: BlkMasterInfo | undefined = (not_master ? ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() + + + return loadBlkMasterInfo(slice1) + + }) + (slice) : undefined) + +let slice1 = slice.loadRef().beginParse() + +let prev_ref: BlkPrevInfo = loadBlkPrevInfo(slice1, after_merge) + +let prev_vert_ref: BlkPrevInfo | undefined = (vert_seqno_incr ? ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() + + + return loadBlkPrevInfo(slice1, 0) + + }) + (slice) : undefined) + + if ((!(flags <= 1))) { +throw new Error('') + } + if ((!(vert_seq_no >= vert_seqno_incr))) { +throw new Error('') + } + return { + kind: 'BlockInfo', + prev_seq_no: (seq_no - 1), + version: version, + not_master: not_master, + after_merge: after_merge, + before_split: before_split, + after_split: after_split, + want_split: want_split, + want_merge: want_merge, + key_block: key_block, + vert_seqno_incr: vert_seqno_incr, + flags: flags, + seq_no: seq_no, + vert_seq_no: vert_seq_no, + shard: shard, + gen_utime: gen_utime, + start_lt: start_lt, + end_lt: end_lt, + gen_validator_list_hash_short: gen_validator_list_hash_short, + gen_catchain_seqno: gen_catchain_seqno, + min_ref_mc_seqno: min_ref_mc_seqno, + prev_key_block_seqno: prev_key_block_seqno, + gen_software: gen_software, + master_ref: master_ref, + prev_ref: prev_ref, + prev_vert_ref: prev_vert_ref, +} + +} +; + throw new Error('') +; +} + +export function storeBlockInfo(blockInfo: BlockInfo): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x9bc7a987, 32) + + builder.storeUint(blockInfo.version, 32) + + builder.storeUint(blockInfo.not_master, 1) + + builder.storeUint(blockInfo.after_merge, 1) + + builder.storeUint(blockInfo.before_split, 1) + + builder.storeUint(blockInfo.after_split, 1) + + storeBool(blockInfo.want_split)(builder) + + storeBool(blockInfo.want_merge)(builder) + + storeBool(blockInfo.key_block)(builder) + + builder.storeUint(blockInfo.vert_seqno_incr, 1) + + builder.storeUint(blockInfo.flags, 8) + + builder.storeUint(blockInfo.seq_no, 32) + + builder.storeUint(blockInfo.vert_seq_no, 32) + + storeShardIdent(blockInfo.shard)(builder) + + builder.storeUint(blockInfo.gen_utime, 32) + + builder.storeUint(blockInfo.start_lt, 64) + + builder.storeUint(blockInfo.end_lt, 64) + + builder.storeUint(blockInfo.gen_validator_list_hash_short, 32) + + builder.storeUint(blockInfo.gen_catchain_seqno, 32) + + builder.storeUint(blockInfo.min_ref_mc_seqno, 32) + + builder.storeUint(blockInfo.prev_key_block_seqno, 32) + + if ((blockInfo.gen_software != undefined)) { + storeGlobalVersion(blockInfo.gen_software)(builder) + } + + if ((blockInfo.master_ref != undefined)) { + let cell1 = beginCell() + + + storeBlkMasterInfo(blockInfo.master_ref)(cell1) + + builder.storeRef(cell1) + + } + + let cell1 = beginCell() + + + storeBlkPrevInfo(blockInfo.prev_ref)(cell1) + + builder.storeRef(cell1) + + if ((blockInfo.prev_vert_ref != undefined)) { + let cell1 = beginCell() + + + storeBlkPrevInfo(blockInfo.prev_vert_ref)(cell1) + + builder.storeRef(cell1) + + } + + if ((!(blockInfo.flags <= 1))) { + throw new Error('') + } + + if ((!(blockInfo.vert_seq_no >= blockInfo.vert_seqno_incr))) { + throw new Error('') + } + +}) + +; +} + +export function loadBlkPrevInfo(slice: Slice, arg0: number): BlkPrevInfo { + if ((arg0 == 0)) { +let prev: ExtBlkRef = loadExtBlkRef(slice) + + return { + kind: 'BlkPrevInfo_prev_blk_info', + prev: prev, +} + +} +; + if ((arg0 == 1)) { +let slice1 = slice.loadRef().beginParse() + +let prev1: ExtBlkRef = loadExtBlkRef(slice1) + +let slice2 = slice.loadRef().beginParse() + +let prev2: ExtBlkRef = loadExtBlkRef(slice2) + + return { + kind: 'BlkPrevInfo_prev_blks_info', + prev1: prev1, + prev2: prev2, +} + +} +; + throw new Error('') +; +} + +export function storeBlkPrevInfo(blkPrevInfo: BlkPrevInfo): (builder: Builder) => void { + if ((blkPrevInfo.kind == 'BlkPrevInfo_prev_blk_info')) { + return ((builder: Builder) => { + storeExtBlkRef(blkPrevInfo.prev)(builder) + +}) + +} +; + if ((blkPrevInfo.kind == 'BlkPrevInfo_prev_blks_info')) { + return ((builder: Builder) => { + let cell1 = beginCell() + + + storeExtBlkRef(blkPrevInfo.prev1)(cell1) + + builder.storeRef(cell1) + + let cell2 = beginCell() + + + storeExtBlkRef(blkPrevInfo.prev2)(cell2) + + builder.storeRef(cell2) + +}) + +} +; + throw new Error('') +; +} + +export function loadBlock(slice: Slice): Block { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x11ef55aa))) { +slice.loadUint(32) +let global_id: number = slice.loadInt(32) + +let slice1 = slice.loadRef().beginParse() + +let info: BlockInfo = loadBlockInfo(slice1) + +let slice2 = slice.loadRef().beginParse() + +let value_flow: ValueFlow = loadValueFlow(slice2) + +let slice3 = slice.loadRef().beginParse() + +let state_update: MERKLE_UPDATE = loadMERKLE_UPDATE(slice3, loadShardState) + +let slice4 = slice.loadRef().beginParse() + +let extra: BlockExtra = loadBlockExtra(slice4) + + return { + kind: 'Block', + global_id: global_id, + info: info, + value_flow: value_flow, + state_update: state_update, + extra: extra, +} + +} +; + throw new Error('') +; +} + +export function storeBlock(block: Block): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x11ef55aa, 32) + + builder.storeInt(block.global_id, 32) + + let cell1 = beginCell() + + + storeBlockInfo(block.info)(cell1) + + builder.storeRef(cell1) + + let cell2 = beginCell() + + + storeValueFlow(block.value_flow)(cell2) + + builder.storeRef(cell2) + + let cell3 = beginCell() + + + storeMERKLE_UPDATE(block.state_update, storeShardState)(cell3) + + builder.storeRef(cell3) + + let cell4 = beginCell() + + + storeBlockExtra(block.extra)(cell4) + + builder.storeRef(cell4) + +}) + +; +} + +export function loadBlockExtra(slice: Slice): BlockExtra { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x8e7f7ff8))) { +slice.loadUint(32) +let slice1 = slice.loadRef().beginParse() + +let in_msg_descr: InMsgDescr = loadInMsgDescr(slice1) + +let slice2 = slice.loadRef().beginParse() + +let out_msg_descr: OutMsgDescr = loadOutMsgDescr(slice2) + +let slice3 = slice.loadRef().beginParse() + +let account_blocks: ShardAccountBlocks = loadShardAccountBlocks(slice3) + +let rand_seed: BitString = slice.loadBits(256) + +let created_by: BitString = slice.loadBits(256) + +let custom: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() + + + return loadMcBlockExtra(slice1) + + }) + ) + + return { + kind: 'BlockExtra', + in_msg_descr: in_msg_descr, + out_msg_descr: out_msg_descr, + account_blocks: account_blocks, + rand_seed: rand_seed, + created_by: created_by, + custom: custom, +} + +} +; + throw new Error('') +; +} + +export function storeBlockExtra(blockExtra: BlockExtra): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x8e7f7ff8, 32) + + let cell1 = beginCell() + + + storeInMsgDescr(blockExtra.in_msg_descr)(cell1) + + builder.storeRef(cell1) + + let cell2 = beginCell() + + + storeOutMsgDescr(blockExtra.out_msg_descr)(cell2) + + builder.storeRef(cell2) + + let cell3 = beginCell() + + + storeShardAccountBlocks(blockExtra.account_blocks)(cell3) + + builder.storeRef(cell3) + + builder.storeBits(blockExtra.rand_seed) + + builder.storeBits(blockExtra.created_by) + + storeMaybe(blockExtra.custom, ((arg: McBlockExtra) => { + return ((builder: Builder) => { + let cell1 = beginCell() + + + storeMcBlockExtra(arg)(cell1) + + builder.storeRef(cell1) + + + }) + + + }) + )(builder) + +}) + +; +} + +export function loadValueFlow(slice: Slice): ValueFlow { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x98055e37))) { +slice.loadUint(32) +let slice1 = slice.loadRef().beginParse() + +let from_prev_blk: CurrencyCollection = loadCurrencyCollection(slice1) + +let to_next_blk: CurrencyCollection = loadCurrencyCollection(slice1) + +let imported: CurrencyCollection = loadCurrencyCollection(slice1) + +let exported: CurrencyCollection = loadCurrencyCollection(slice1) + +let fees_collected: CurrencyCollection = loadCurrencyCollection(slice) + +let slice2 = slice.loadRef().beginParse() + +let fees_imported: CurrencyCollection = loadCurrencyCollection(slice2) + +let recovered: CurrencyCollection = loadCurrencyCollection(slice2) + +let created: CurrencyCollection = loadCurrencyCollection(slice2) + +let minted: CurrencyCollection = loadCurrencyCollection(slice2) + + return { + kind: 'ValueFlow', + from_prev_blk: from_prev_blk, + to_next_blk: to_next_blk, + imported: imported, + exported: exported, + fees_collected: fees_collected, + fees_imported: fees_imported, + recovered: recovered, + created: created, + minted: minted, +} + +} +; + throw new Error('') +; +} + +export function storeValueFlow(valueFlow: ValueFlow): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x98055e37, 32) + + let cell1 = beginCell() + + + storeCurrencyCollection(valueFlow.from_prev_blk)(cell1) + + storeCurrencyCollection(valueFlow.to_next_blk)(cell1) + + storeCurrencyCollection(valueFlow.imported)(cell1) + + storeCurrencyCollection(valueFlow.exported)(cell1) + + builder.storeRef(cell1) + + storeCurrencyCollection(valueFlow.fees_collected)(builder) + + let cell2 = beginCell() + + + storeCurrencyCollection(valueFlow.fees_imported)(cell2) + + storeCurrencyCollection(valueFlow.recovered)(cell2) + + storeCurrencyCollection(valueFlow.created)(cell2) + + storeCurrencyCollection(valueFlow.minted)(cell2) + + builder.storeRef(cell2) + +}) + +; +} + +export function loadBinTree(slice: Slice, loadX: (slice: Slice) => X +): BinTree { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { +slice.loadUint(1) +let leaf: X = loadX(slice) + + return { + kind: 'BinTree_bt_leaf', + leaf: leaf, +} + +} +; + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { +slice.loadUint(1) +let slice1 = slice.loadRef().beginParse() + +let left: BinTree = loadBinTree(slice1, loadX) + +let slice2 = slice.loadRef().beginParse() + +let right: BinTree = loadBinTree(slice2, loadX) + + return { + kind: 'BinTree_bt_fork', + left: left, + right: right, +} + +} +; + throw new Error('') +; +} + +export function storeBinTree(binTree: BinTree, storeX: (x: X) => (builder: Builder) => void + +): (builder: Builder) => void { + if ((binTree.kind == 'BinTree_bt_leaf')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1) + + storeX(binTree.leaf)(builder) + +}) + +} +; + if ((binTree.kind == 'BinTree_bt_fork')) { + return ((builder: Builder) => { + builder.storeUint(0b1, 1) + + let cell1 = beginCell() + + + storeBinTree(binTree.left, storeX)(cell1) + + builder.storeRef(cell1) + + let cell2 = beginCell() + + + storeBinTree(binTree.right, storeX)(cell2) + + builder.storeRef(cell2) + +}) + +} +; + throw new Error('') +; +} + +export function loadFutureSplitMerge(slice: Slice): FutureSplitMerge { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { +slice.loadUint(1) + return { + kind: 'FutureSplitMerge_fsm_none', +} + +} +; + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b10))) { +slice.loadUint(2) +let split_utime: number = slice.loadUint(32) + +let interval: number = slice.loadUint(32) + + return { + kind: 'FutureSplitMerge_fsm_split', + split_utime: split_utime, + interval: interval, +} + +} +; + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b11))) { +slice.loadUint(2) +let merge_utime: number = slice.loadUint(32) + +let interval: number = slice.loadUint(32) + + return { + kind: 'FutureSplitMerge_fsm_merge', + merge_utime: merge_utime, + interval: interval, +} + +} +; + throw new Error('') +; +} + +export function storeFutureSplitMerge(futureSplitMerge: FutureSplitMerge): (builder: Builder) => void { + if ((futureSplitMerge.kind == 'FutureSplitMerge_fsm_none')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1) + +}) + +} +; + if ((futureSplitMerge.kind == 'FutureSplitMerge_fsm_split')) { + return ((builder: Builder) => { + builder.storeUint(0b10, 2) + + builder.storeUint(futureSplitMerge.split_utime, 32) + + builder.storeUint(futureSplitMerge.interval, 32) + +}) + +} +; + if ((futureSplitMerge.kind == 'FutureSplitMerge_fsm_merge')) { + return ((builder: Builder) => { + builder.storeUint(0b11, 2) + + builder.storeUint(futureSplitMerge.merge_utime, 32) + + builder.storeUint(futureSplitMerge.interval, 32) + +}) + +} +; + throw new Error('') +; +} + +export function loadShardDescr(slice: Slice): ShardDescr { + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0xb))) { +slice.loadUint(4) +let seq_no: number = slice.loadUint(32) + +let reg_mc_seqno: number = slice.loadUint(32) + +let start_lt: number = slice.loadUint(64) + +let end_lt: number = slice.loadUint(64) + +let root_hash: BitString = slice.loadBits(256) + +let file_hash: BitString = slice.loadBits(256) + +let before_split: Bool = loadBool(slice) + +let before_merge: Bool = loadBool(slice) + +let want_split: Bool = loadBool(slice) + +let want_merge: Bool = loadBool(slice) + +let nx_cc_updated: Bool = loadBool(slice) + +let flags: number = slice.loadUint(3) + +let next_catchain_seqno: number = slice.loadUint(32) + +let next_validator_shard: number = slice.loadUint(64) + +let min_ref_mc_seqno: number = slice.loadUint(32) + +let gen_utime: number = slice.loadUint(32) + +let split_merge_at: FutureSplitMerge = loadFutureSplitMerge(slice) + +let fees_collected: CurrencyCollection = loadCurrencyCollection(slice) + +let funds_created: CurrencyCollection = loadCurrencyCollection(slice) + + if ((!(flags == 0))) { +throw new Error('') + } + return { + kind: 'ShardDescr_shard_descr', + seq_no: seq_no, + reg_mc_seqno: reg_mc_seqno, + start_lt: start_lt, + end_lt: end_lt, + root_hash: root_hash, + file_hash: file_hash, + before_split: before_split, + before_merge: before_merge, + want_split: want_split, + want_merge: want_merge, + nx_cc_updated: nx_cc_updated, + flags: flags, + next_catchain_seqno: next_catchain_seqno, + next_validator_shard: next_validator_shard, + min_ref_mc_seqno: min_ref_mc_seqno, + gen_utime: gen_utime, + split_merge_at: split_merge_at, + fees_collected: fees_collected, + funds_created: funds_created, +} + +} +; + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0xa))) { +slice.loadUint(4) +let seq_no: number = slice.loadUint(32) + +let reg_mc_seqno: number = slice.loadUint(32) + +let start_lt: number = slice.loadUint(64) + +let end_lt: number = slice.loadUint(64) + +let root_hash: BitString = slice.loadBits(256) + +let file_hash: BitString = slice.loadBits(256) + +let before_split: Bool = loadBool(slice) + +let before_merge: Bool = loadBool(slice) + +let want_split: Bool = loadBool(slice) + +let want_merge: Bool = loadBool(slice) + +let nx_cc_updated: Bool = loadBool(slice) + +let flags: number = slice.loadUint(3) + +let next_catchain_seqno: number = slice.loadUint(32) + +let next_validator_shard: number = slice.loadUint(64) + +let min_ref_mc_seqno: number = slice.loadUint(32) + +let gen_utime: number = slice.loadUint(32) + +let split_merge_at: FutureSplitMerge = loadFutureSplitMerge(slice) + +let slice1 = slice.loadRef().beginParse() + +let fees_collected: CurrencyCollection = loadCurrencyCollection(slice1) + +let funds_created: CurrencyCollection = loadCurrencyCollection(slice1) + + if ((!(flags == 0))) { +throw new Error('') + } + return { + kind: 'ShardDescr_shard_descr_new', + seq_no: seq_no, + reg_mc_seqno: reg_mc_seqno, + start_lt: start_lt, + end_lt: end_lt, + root_hash: root_hash, + file_hash: file_hash, + before_split: before_split, + before_merge: before_merge, + want_split: want_split, + want_merge: want_merge, + nx_cc_updated: nx_cc_updated, + flags: flags, + next_catchain_seqno: next_catchain_seqno, + next_validator_shard: next_validator_shard, + min_ref_mc_seqno: min_ref_mc_seqno, + gen_utime: gen_utime, + split_merge_at: split_merge_at, + fees_collected: fees_collected, + funds_created: funds_created, +} + +} +; + throw new Error('') +; +} + +export function storeShardDescr(shardDescr: ShardDescr): (builder: Builder) => void { + if ((shardDescr.kind == 'ShardDescr_shard_descr')) { + return ((builder: Builder) => { + builder.storeUint(0xb, 4) + + builder.storeUint(shardDescr.seq_no, 32) + + builder.storeUint(shardDescr.reg_mc_seqno, 32) + + builder.storeUint(shardDescr.start_lt, 64) + + builder.storeUint(shardDescr.end_lt, 64) + + builder.storeBits(shardDescr.root_hash) + + builder.storeBits(shardDescr.file_hash) + + storeBool(shardDescr.before_split)(builder) + + storeBool(shardDescr.before_merge)(builder) + + storeBool(shardDescr.want_split)(builder) + + storeBool(shardDescr.want_merge)(builder) + + storeBool(shardDescr.nx_cc_updated)(builder) + + builder.storeUint(shardDescr.flags, 3) + + builder.storeUint(shardDescr.next_catchain_seqno, 32) + + builder.storeUint(shardDescr.next_validator_shard, 64) + + builder.storeUint(shardDescr.min_ref_mc_seqno, 32) + + builder.storeUint(shardDescr.gen_utime, 32) + + storeFutureSplitMerge(shardDescr.split_merge_at)(builder) + + storeCurrencyCollection(shardDescr.fees_collected)(builder) + + storeCurrencyCollection(shardDescr.funds_created)(builder) + + if ((!(shardDescr.flags == 0))) { + throw new Error('') + } + +}) + +} +; + if ((shardDescr.kind == 'ShardDescr_shard_descr_new')) { + return ((builder: Builder) => { + builder.storeUint(0xa, 4) + + builder.storeUint(shardDescr.seq_no, 32) + + builder.storeUint(shardDescr.reg_mc_seqno, 32) + + builder.storeUint(shardDescr.start_lt, 64) + + builder.storeUint(shardDescr.end_lt, 64) + + builder.storeBits(shardDescr.root_hash) + + builder.storeBits(shardDescr.file_hash) + + storeBool(shardDescr.before_split)(builder) + + storeBool(shardDescr.before_merge)(builder) + + storeBool(shardDescr.want_split)(builder) + + storeBool(shardDescr.want_merge)(builder) + + storeBool(shardDescr.nx_cc_updated)(builder) + + builder.storeUint(shardDescr.flags, 3) + + builder.storeUint(shardDescr.next_catchain_seqno, 32) + + builder.storeUint(shardDescr.next_validator_shard, 64) + + builder.storeUint(shardDescr.min_ref_mc_seqno, 32) + + builder.storeUint(shardDescr.gen_utime, 32) + + storeFutureSplitMerge(shardDescr.split_merge_at)(builder) + + let cell1 = beginCell() + + + storeCurrencyCollection(shardDescr.fees_collected)(cell1) + + storeCurrencyCollection(shardDescr.funds_created)(cell1) + + builder.storeRef(cell1) + + if ((!(shardDescr.flags == 0))) { + throw new Error('') + } + +}) + +} +; + throw new Error('') +; +} + +export function loadShardHashes(slice: Slice): ShardHashes { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xd7c80ab1))) { +slice.loadUint(32) +let anon0: HashmapE> = loadHashmapE>(slice, 32, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() + + + return loadBinTree(slice1, loadShardDescr) + + }) + ) + + return { + kind: 'ShardHashes', + anon0: anon0, +} + +} +; + throw new Error('') +; +} + +export function storeShardHashes(shardHashes: ShardHashes): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xd7c80ab1, 32) + + storeHashmapE>(shardHashes.anon0, ((arg: BinTree) => { + return ((builder: Builder) => { + let cell1 = beginCell() + + + storeBinTree(arg, storeShardDescr)(cell1) + + builder.storeRef(cell1) + + + }) + + + }) + )(builder) + +}) + +; +} + +export function loadBinTreeAug(slice: Slice, loadX: (slice: Slice) => X +, loadY: (slice: Slice) => Y +): BinTreeAug { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { +slice.loadUint(1) +let extra: Y = loadY(slice) + +let leaf: X = loadX(slice) + + return { + kind: 'BinTreeAug_bta_leaf', + extra: extra, + leaf: leaf, +} + +} +; + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { +slice.loadUint(1) +let slice1 = slice.loadRef().beginParse() + +let left: BinTreeAug = loadBinTreeAug(slice1, loadX, loadY) + +let slice2 = slice.loadRef().beginParse() + +let right: BinTreeAug = loadBinTreeAug(slice2, loadX, loadY) + +let extra: Y = loadY(slice) + + return { + kind: 'BinTreeAug_bta_fork', + left: left, + right: right, + extra: extra, +} + +} +; + throw new Error('') +; +} + +export function storeBinTreeAug(binTreeAug: BinTreeAug, storeX: (x: X) => (builder: Builder) => void + +, storeY: (y: Y) => (builder: Builder) => void + +): (builder: Builder) => void { + if ((binTreeAug.kind == 'BinTreeAug_bta_leaf')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1) + + storeY(binTreeAug.extra)(builder) + + storeX(binTreeAug.leaf)(builder) + +}) + +} +; + if ((binTreeAug.kind == 'BinTreeAug_bta_fork')) { + return ((builder: Builder) => { + builder.storeUint(0b1, 1) + + let cell1 = beginCell() + + + storeBinTreeAug(binTreeAug.left, storeX, storeY)(cell1) + + builder.storeRef(cell1) + + let cell2 = beginCell() + + + storeBinTreeAug(binTreeAug.right, storeX, storeY)(cell2) + + builder.storeRef(cell2) + + storeY(binTreeAug.extra)(builder) + +}) + +} +; + throw new Error('') +; +} + +export function loadShardFeeCreated(slice: Slice): ShardFeeCreated { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xe537952e))) { +slice.loadUint(32) +let fees: CurrencyCollection = loadCurrencyCollection(slice) + +let create: CurrencyCollection = loadCurrencyCollection(slice) + + return { + kind: 'ShardFeeCreated', + fees: fees, + create: create, +} + +} +; + throw new Error('') +; +} + +export function storeShardFeeCreated(shardFeeCreated: ShardFeeCreated): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xe537952e, 32) + + storeCurrencyCollection(shardFeeCreated.fees)(builder) + + storeCurrencyCollection(shardFeeCreated.create)(builder) + +}) + +; +} + +export function loadShardFees(slice: Slice): ShardFees { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xfea0d880))) { +slice.loadUint(32) +let anon0: HashmapAugE = loadHashmapAugE(slice, 96, loadShardFeeCreated, loadShardFeeCreated) + + return { + kind: 'ShardFees', + anon0: anon0, +} + +} +; + throw new Error('') +; +} + +export function storeShardFees(shardFees: ShardFees): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xfea0d880, 32) + + storeHashmapAugE(shardFees.anon0, storeShardFeeCreated, storeShardFeeCreated)(builder) + +}) + +; +} + +export function loadConfigParams(slice: Slice): ConfigParams { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x88116702))) { +slice.loadUint(32) +let config_addr: BitString = slice.loadBits(256) + +let slice1 = slice.loadRef().beginParse() + +let config: Hashmap = loadHashmap(slice1, 32, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() + + + return slice1 + + }) + ) + + return { + kind: 'ConfigParams', + config_addr: config_addr, + config: config, +} + +} +; + throw new Error('') +; +} + +export function storeConfigParams(configParams: ConfigParams): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x88116702, 32) + + builder.storeBits(configParams.config_addr) + + let cell1 = beginCell() + + + storeHashmap(configParams.config, ((arg: Slice) => { + return ((builder: Builder) => { + let cell1 = beginCell() + + + cell1.storeSlice(arg) + + builder.storeRef(cell1) + + + }) + + + }) + )(cell1) + + builder.storeRef(cell1) + +}) + +; +} + +export function loadValidatorInfo(slice: Slice): ValidatorInfo { + let validator_list_hash_short: number = slice.loadUint(32) + +; + let catchain_seqno: number = slice.loadUint(32) + +; + let nx_cc_updated: Bool = loadBool(slice) + +; + return { + kind: 'ValidatorInfo', + validator_list_hash_short: validator_list_hash_short, + catchain_seqno: catchain_seqno, + nx_cc_updated: nx_cc_updated, +} + +; +} + +export function storeValidatorInfo(validatorInfo: ValidatorInfo): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(validatorInfo.validator_list_hash_short, 32) + + builder.storeUint(validatorInfo.catchain_seqno, 32) + + storeBool(validatorInfo.nx_cc_updated)(builder) + +}) + +; +} + +export function loadValidatorBaseInfo(slice: Slice): ValidatorBaseInfo { + let validator_list_hash_short: number = slice.loadUint(32) + +; + let catchain_seqno: number = slice.loadUint(32) + +; + return { + kind: 'ValidatorBaseInfo', + validator_list_hash_short: validator_list_hash_short, + catchain_seqno: catchain_seqno, +} + +; +} + +export function storeValidatorBaseInfo(validatorBaseInfo: ValidatorBaseInfo): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(validatorBaseInfo.validator_list_hash_short, 32) + + builder.storeUint(validatorBaseInfo.catchain_seqno, 32) + +}) + +; +} + +export function loadKeyMaxLt(slice: Slice): KeyMaxLt { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x9a6d79a5))) { +slice.loadUint(32) +let key: Bool = loadBool(slice) + +let max_end_lt: number = slice.loadUint(64) + + return { + kind: 'KeyMaxLt', + key: key, + max_end_lt: max_end_lt, +} + +} +; + throw new Error('') +; +} + +export function storeKeyMaxLt(keyMaxLt: KeyMaxLt): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x9a6d79a5, 32) + + storeBool(keyMaxLt.key)(builder) + + builder.storeUint(keyMaxLt.max_end_lt, 64) + +}) + +; +} + +export function loadKeyExtBlkRef(slice: Slice): KeyExtBlkRef { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xafeab488))) { +slice.loadUint(32) +let key: Bool = loadBool(slice) + +let blk_ref: ExtBlkRef = loadExtBlkRef(slice) + + return { + kind: 'KeyExtBlkRef', + key: key, + blk_ref: blk_ref, +} + +} +; + throw new Error('') +; +} + +export function storeKeyExtBlkRef(keyExtBlkRef: KeyExtBlkRef): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xafeab488, 32) + + storeBool(keyExtBlkRef.key)(builder) + + storeExtBlkRef(keyExtBlkRef.blk_ref)(builder) + +}) + +; +} + +export function loadOldMcBlocksInfo(slice: Slice): OldMcBlocksInfo { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xf385c1e3))) { +slice.loadUint(32) +let anon0: HashmapAugE = loadHashmapAugE(slice, 32, loadKeyExtBlkRef, loadKeyMaxLt) + + return { + kind: 'OldMcBlocksInfo', + anon0: anon0, +} + +} +; + throw new Error('') +; +} + +export function storeOldMcBlocksInfo(oldMcBlocksInfo: OldMcBlocksInfo): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xf385c1e3, 32) + + storeHashmapAugE(oldMcBlocksInfo.anon0, storeKeyExtBlkRef, storeKeyMaxLt)(builder) + +}) + +; +} + +export function loadCounters(slice: Slice): Counters { + let last_updated: number = slice.loadUint(32) + +; + let total: number = slice.loadUint(64) + +; + let cnt2048: number = slice.loadUint(64) + +; + let cnt65536: number = slice.loadUint(64) + +; + return { + kind: 'Counters', + last_updated: last_updated, + total: total, + cnt2048: cnt2048, + cnt65536: cnt65536, +} + +; +} + +export function storeCounters(counters: Counters): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(counters.last_updated, 32) + + builder.storeUint(counters.total, 64) + + builder.storeUint(counters.cnt2048, 64) + + builder.storeUint(counters.cnt65536, 64) + +}) + +; +} + +export function loadCreatorStats(slice: Slice): CreatorStats { + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0x4))) { +slice.loadUint(4) +let mc_blocks: Counters = loadCounters(slice) + +let shard_blocks: Counters = loadCounters(slice) + + return { + kind: 'CreatorStats', + mc_blocks: mc_blocks, + shard_blocks: shard_blocks, +} + +} +; + throw new Error('') +; +} + +export function storeCreatorStats(creatorStats: CreatorStats): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x4, 4) + + storeCounters(creatorStats.mc_blocks)(builder) + + storeCounters(creatorStats.shard_blocks)(builder) + +}) + +; +} + +export function loadBlockCreateStats(slice: Slice): BlockCreateStats { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x17))) { +slice.loadUint(8) +let counters: HashmapE = loadHashmapE(slice, 256, loadCreatorStats) + + return { + kind: 'BlockCreateStats_block_create_stats', + counters: counters, +} + +} +; + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x34))) { +slice.loadUint(8) +let counters: HashmapAugE = loadHashmapAugE(slice, 256, loadCreatorStats, ((slice: Slice) => { + return slice.loadUint(32) + + }) + ) + + return { + kind: 'BlockCreateStats_block_create_stats_ext', + counters: counters, +} + +} +; + throw new Error('') +; +} + +export function storeBlockCreateStats(blockCreateStats: BlockCreateStats): (builder: Builder) => void { + if ((blockCreateStats.kind == 'BlockCreateStats_block_create_stats')) { + return ((builder: Builder) => { + builder.storeUint(0x17, 8) + + storeHashmapE(blockCreateStats.counters, storeCreatorStats)(builder) + +}) + +} +; + if ((blockCreateStats.kind == 'BlockCreateStats_block_create_stats_ext')) { + return ((builder: Builder) => { + builder.storeUint(0x34, 8) + + storeHashmapAugE(blockCreateStats.counters, storeCreatorStats, ((arg: number) => { + return ((builder: Builder) => { + builder.storeUint(arg, 32) + + }) + + + }) + )(builder) + +}) + +} +; + throw new Error('') +; +} + +export function loadMcStateExtra(slice: Slice): McStateExtra { + if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0xcc26))) { +slice.loadUint(16) +let shard_hashes: ShardHashes = loadShardHashes(slice) + +let config: ConfigParams = loadConfigParams(slice) + +let slice1 = slice.loadRef().beginParse() + +let flags: number = slice1.loadUint(16) + +let validator_info: ValidatorInfo = loadValidatorInfo(slice1) + +let prev_blocks: OldMcBlocksInfo = loadOldMcBlocksInfo(slice1) + +let after_key_block: Bool = loadBool(slice1) + +let last_key_block: Maybe = loadMaybe(slice1, loadExtBlkRef) + +let block_create_stats: BlockCreateStats | undefined = ((flags & (1 << 0)) ? loadBlockCreateStats(slice1) : undefined) + +let global_balance: CurrencyCollection = loadCurrencyCollection(slice) + + return { + kind: 'McStateExtra', + shard_hashes: shard_hashes, + config: config, + flags: flags, + validator_info: validator_info, + prev_blocks: prev_blocks, + after_key_block: after_key_block, + last_key_block: last_key_block, + block_create_stats: block_create_stats, + global_balance: global_balance, +} + +} +; + throw new Error('') +; +} + +export function storeMcStateExtra(mcStateExtra: McStateExtra): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xcc26, 16) + + storeShardHashes(mcStateExtra.shard_hashes)(builder) + + storeConfigParams(mcStateExtra.config)(builder) + + let cell1 = beginCell() + + + cell1.storeUint(mcStateExtra.flags, 16) + + storeValidatorInfo(mcStateExtra.validator_info)(cell1) + + storeOldMcBlocksInfo(mcStateExtra.prev_blocks)(cell1) + + storeBool(mcStateExtra.after_key_block)(cell1) + + storeMaybe(mcStateExtra.last_key_block, storeExtBlkRef)(cell1) + + if ((mcStateExtra.block_create_stats != undefined)) { + storeBlockCreateStats(mcStateExtra.block_create_stats)(cell1) + } + + builder.storeRef(cell1) + + storeCurrencyCollection(mcStateExtra.global_balance)(builder) + +}) + +; +} + +export function loadSigPubKey(slice: Slice): SigPubKey { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x8e81278a))) { +slice.loadUint(32) +let pubkey: BitString = slice.loadBits(256) + + return { + kind: 'SigPubKey', + pubkey: pubkey, +} + +} +; + throw new Error('') +; +} + +export function storeSigPubKey(sigPubKey: SigPubKey): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x8e81278a, 32) + + builder.storeBits(sigPubKey.pubkey) + +}) + +; +} + +export function loadCryptoSignatureSimple(slice: Slice): CryptoSignatureSimple { + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0x5))) { +slice.loadUint(4) +let R: BitString = slice.loadBits(256) + +let s: BitString = slice.loadBits(256) + + return { + kind: 'CryptoSignatureSimple', + R: R, + s: s, +} + +} +; + throw new Error('') +; +} + +export function storeCryptoSignatureSimple(cryptoSignatureSimple: CryptoSignatureSimple): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x5, 4) + + builder.storeBits(cryptoSignatureSimple.R) + + builder.storeBits(cryptoSignatureSimple.s) + +}) + +; +} + +export function loadCryptoSignature(slice: Slice): CryptoSignature { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xdaa99887))) { +slice.loadUint(32) +let anon0: CryptoSignatureSimple = loadCryptoSignatureSimple(slice) + + return { + kind: 'CryptoSignature__', + anon0: anon0, +} + +} +; + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0xf))) { +slice.loadUint(4) +let slice1 = slice.loadRef().beginParse() + +let signed_cert: SignedCertificate = loadSignedCertificate(slice1) + +let temp_key_signature: CryptoSignatureSimple = loadCryptoSignatureSimple(slice) + + return { + kind: 'CryptoSignature_chained_signature', + signed_cert: signed_cert, + temp_key_signature: temp_key_signature, +} + +} +; + throw new Error('') +; +} + +export function storeCryptoSignature(cryptoSignature: CryptoSignature): (builder: Builder) => void { + if ((cryptoSignature.kind == 'CryptoSignature__')) { + return ((builder: Builder) => { + builder.storeUint(0xdaa99887, 32) + + storeCryptoSignatureSimple(cryptoSignature.anon0)(builder) + +}) + +} +; + if ((cryptoSignature.kind == 'CryptoSignature_chained_signature')) { + return ((builder: Builder) => { + builder.storeUint(0xf, 4) + + let cell1 = beginCell() + + + storeSignedCertificate(cryptoSignature.signed_cert)(cell1) + + builder.storeRef(cell1) + + storeCryptoSignatureSimple(cryptoSignature.temp_key_signature)(builder) + +}) + +} +; + throw new Error('') +; +} + +export function loadCryptoSignaturePair(slice: Slice): CryptoSignaturePair { + let node_id_short: BitString = slice.loadBits(256) + +; + let sign: CryptoSignature = loadCryptoSignature(slice) + +; + return { + kind: 'CryptoSignaturePair', + node_id_short: node_id_short, + sign: sign, +} + +; +} + +export function storeCryptoSignaturePair(cryptoSignaturePair: CryptoSignaturePair): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeBits(cryptoSignaturePair.node_id_short) + + storeCryptoSignature(cryptoSignaturePair.sign)(builder) + +}) + +; +} + +export function loadCertificate(slice: Slice): Certificate { + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0x4))) { +slice.loadUint(4) +let temp_key: SigPubKey = loadSigPubKey(slice) + +let valid_since: number = slice.loadUint(32) + +let valid_until: number = slice.loadUint(32) + + return { + kind: 'Certificate', + temp_key: temp_key, + valid_since: valid_since, + valid_until: valid_until, +} + +} +; + throw new Error('') +; +} + +export function storeCertificate(certificate: Certificate): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x4, 4) + + storeSigPubKey(certificate.temp_key)(builder) + + builder.storeUint(certificate.valid_since, 32) + + builder.storeUint(certificate.valid_until, 32) + +}) + +; +} + +export function loadCertificateEnv(slice: Slice): CertificateEnv { + if (((slice.remainingBits >= 28) && (slice.preloadUint(28) == 0xa419b7d))) { +slice.loadUint(28) +let certificate: Certificate = loadCertificate(slice) + + return { + kind: 'CertificateEnv', + certificate: certificate, +} + +} +; + throw new Error('') +; +} + +export function storeCertificateEnv(certificateEnv: CertificateEnv): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xa419b7d, 28) + + storeCertificate(certificateEnv.certificate)(builder) + +}) + +; +} + +export function loadSignedCertificate(slice: Slice): SignedCertificate { + let certificate: Certificate = loadCertificate(slice) + +; + let certificate_signature: CryptoSignature = loadCryptoSignature(slice) + +; + return { + kind: 'SignedCertificate', + certificate: certificate, + certificate_signature: certificate_signature, +} + +; +} + +export function storeSignedCertificate(signedCertificate: SignedCertificate): (builder: Builder) => void { + return ((builder: Builder) => { + storeCertificate(signedCertificate.certificate)(builder) + + storeCryptoSignature(signedCertificate.certificate_signature)(builder) + +}) + +; +} + +export function loadMcBlockExtra(slice: Slice): McBlockExtra { + if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0xcca5))) { +slice.loadUint(16) +let key_block: number = slice.loadUint(1) + +let shard_hashes: ShardHashes = loadShardHashes(slice) + +let shard_fees: ShardFees = loadShardFees(slice) + +let slice1 = slice.loadRef().beginParse() + +let prev_blk_signatures: HashmapE = loadHashmapE(slice1, 16, loadCryptoSignaturePair) + +let recover_create_msg: Maybe = loadMaybe(slice1, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() + + + return loadInMsg(slice1) + + }) + ) + +let mint_msg: Maybe = loadMaybe(slice1, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() + + + return loadInMsg(slice1) + + }) + ) + +let config: ConfigParams | undefined = (key_block ? loadConfigParams(slice) : undefined) + + return { + kind: 'McBlockExtra', + key_block: key_block, + shard_hashes: shard_hashes, + shard_fees: shard_fees, + prev_blk_signatures: prev_blk_signatures, + recover_create_msg: recover_create_msg, + mint_msg: mint_msg, + config: config, +} + +} +; + throw new Error('') +; +} + +export function storeMcBlockExtra(mcBlockExtra: McBlockExtra): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xcca5, 16) + + builder.storeUint(mcBlockExtra.key_block, 1) + + storeShardHashes(mcBlockExtra.shard_hashes)(builder) + + storeShardFees(mcBlockExtra.shard_fees)(builder) + + let cell1 = beginCell() + + + storeHashmapE(mcBlockExtra.prev_blk_signatures, storeCryptoSignaturePair)(cell1) + + storeMaybe(mcBlockExtra.recover_create_msg, ((arg: InMsg) => { + return ((builder: Builder) => { + let cell1 = beginCell() + + + storeInMsg(arg)(cell1) + + builder.storeRef(cell1) + + + }) + + + }) + )(cell1) + + storeMaybe(mcBlockExtra.mint_msg, ((arg: InMsg) => { + return ((builder: Builder) => { + let cell1 = beginCell() + + + storeInMsg(arg)(cell1) + + builder.storeRef(cell1) + + + }) + + + }) + )(cell1) + + builder.storeRef(cell1) + + if ((mcBlockExtra.config != undefined)) { + storeConfigParams(mcBlockExtra.config)(builder) + } + +}) + +; +} + +export function loadValidatorDescr(slice: Slice): ValidatorDescr { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x53))) { +slice.loadUint(8) +let public_key: SigPubKey = loadSigPubKey(slice) + +let weight: number = slice.loadUint(64) + + return { + kind: 'ValidatorDescr_validator', + public_key: public_key, + weight: weight, +} + +} +; + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x73))) { +slice.loadUint(8) +let public_key: SigPubKey = loadSigPubKey(slice) + +let weight: number = slice.loadUint(64) + +let adnl_addr: BitString = slice.loadBits(256) + + return { + kind: 'ValidatorDescr_validator_addr', + public_key: public_key, + weight: weight, + adnl_addr: adnl_addr, +} + +} +; + throw new Error('') +; +} + +export function storeValidatorDescr(validatorDescr: ValidatorDescr): (builder: Builder) => void { + if ((validatorDescr.kind == 'ValidatorDescr_validator')) { + return ((builder: Builder) => { + builder.storeUint(0x53, 8) + + storeSigPubKey(validatorDescr.public_key)(builder) + + builder.storeUint(validatorDescr.weight, 64) + +}) + +} +; + if ((validatorDescr.kind == 'ValidatorDescr_validator_addr')) { + return ((builder: Builder) => { + builder.storeUint(0x73, 8) + + storeSigPubKey(validatorDescr.public_key)(builder) + + builder.storeUint(validatorDescr.weight, 64) + + builder.storeBits(validatorDescr.adnl_addr) + +}) + +} +; + throw new Error('') +; +} + +export function loadValidatorSet(slice: Slice): ValidatorSet { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x11))) { +slice.loadUint(8) +let utime_since: number = slice.loadUint(32) + +let utime_until: number = slice.loadUint(32) + +let total: number = slice.loadUint(16) + +let main: number = slice.loadUint(16) + +let list: Hashmap = loadHashmap(slice, 16, loadValidatorDescr) + + if ((!(main <= total))) { +throw new Error('') + } + if ((!(main >= 1))) { +throw new Error('') + } + return { + kind: 'ValidatorSet_validators', + utime_since: utime_since, + utime_until: utime_until, + total: total, + main: main, + list: list, +} + +} +; + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x12))) { +slice.loadUint(8) +let utime_since: number = slice.loadUint(32) + +let utime_until: number = slice.loadUint(32) + +let total: number = slice.loadUint(16) + +let main: number = slice.loadUint(16) + +let total_weight: number = slice.loadUint(64) + +let list: HashmapE = loadHashmapE(slice, 16, loadValidatorDescr) + + if ((!(main <= total))) { +throw new Error('') + } + if ((!(main >= 1))) { +throw new Error('') + } + return { + kind: 'ValidatorSet_validators_ext', + utime_since: utime_since, + utime_until: utime_until, + total: total, + main: main, + total_weight: total_weight, + list: list, +} + +} +; + throw new Error('') +; +} + +export function storeValidatorSet(validatorSet: ValidatorSet): (builder: Builder) => void { + if ((validatorSet.kind == 'ValidatorSet_validators')) { + return ((builder: Builder) => { + builder.storeUint(0x11, 8) + + builder.storeUint(validatorSet.utime_since, 32) + + builder.storeUint(validatorSet.utime_until, 32) + + builder.storeUint(validatorSet.total, 16) + + builder.storeUint(validatorSet.main, 16) + + storeHashmap(validatorSet.list, storeValidatorDescr)(builder) + + if ((!(validatorSet.main <= validatorSet.total))) { + throw new Error('') + } + + if ((!(validatorSet.main >= 1))) { + throw new Error('') + } + +}) + +} +; + if ((validatorSet.kind == 'ValidatorSet_validators_ext')) { + return ((builder: Builder) => { + builder.storeUint(0x12, 8) + + builder.storeUint(validatorSet.utime_since, 32) + + builder.storeUint(validatorSet.utime_until, 32) + + builder.storeUint(validatorSet.total, 16) + + builder.storeUint(validatorSet.main, 16) + + builder.storeUint(validatorSet.total_weight, 64) + + storeHashmapE(validatorSet.list, storeValidatorDescr)(builder) + + if ((!(validatorSet.main <= validatorSet.total))) { + throw new Error('') + } + + if ((!(validatorSet.main >= 1))) { + throw new Error('') + } + +}) + +} +; + throw new Error('') +; +} + +export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xbc7f2648) && (arg0 == 0)))) { +slice.loadUint(32) +let config_addr: BitString = slice.loadBits(256) + + return { + kind: 'ConfigParam__', + config_addr: config_addr, +} + +} +; + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x84659d0d) && (arg0 == 1)))) { +slice.loadUint(32) +let elector_addr: BitString = slice.loadBits(256) + + return { + kind: 'ConfigParam__1', + elector_addr: elector_addr, +} + +} +; + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x8648b2c4) && (arg0 == 2)))) { +slice.loadUint(32) +let minter_addr: BitString = slice.loadBits(256) + + return { + kind: 'ConfigParam__2', + minter_addr: minter_addr, +} + +} +; + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x8a752dc5) && (arg0 == 3)))) { +slice.loadUint(32) +let fee_collector_addr: BitString = slice.loadBits(256) + + return { + kind: 'ConfigParam__3', + fee_collector_addr: fee_collector_addr, +} + +} +; + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x8ceae93f) && (arg0 == 4)))) { +slice.loadUint(32) +let dns_root_addr: BitString = slice.loadBits(256) + + return { + kind: 'ConfigParam__4', + dns_root_addr: dns_root_addr, +} + +} +; + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xb2571db5) && (arg0 == 6)))) { +slice.loadUint(32) +let mint_new_price: Grams = loadGrams(slice) + +let mint_add_price: Grams = loadGrams(slice) + + return { + kind: 'ConfigParam__5', + mint_new_price: mint_new_price, + mint_add_price: mint_add_price, +} + +} +; + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xd2115c6f) && (arg0 == 7)))) { +slice.loadUint(32) +let to_mint: ExtraCurrencyCollection = loadExtraCurrencyCollection(slice) + + return { + kind: 'ConfigParam__6', + to_mint: to_mint, +} + +} +; + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xb19d2da6) && (arg0 == 8)))) { +slice.loadUint(32) +let anon0: GlobalVersion = loadGlobalVersion(slice) + + return { + kind: 'ConfigParam__7', + anon0: anon0, +} + +} +; + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x8f3b81de) && (arg0 == 9)))) { +slice.loadUint(32) +let mandatory_params: Hashmap = loadHashmap(slice, 32, loadTrue) + + return { + kind: 'ConfigParam__8', + mandatory_params: mandatory_params, +} + +} +; + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xfbcb8998) && (arg0 == 10)))) { +slice.loadUint(32) +let critical_params: Hashmap = loadHashmap(slice, 32, loadTrue) + + return { + kind: 'ConfigParam__9', + critical_params: critical_params, +} + +} +; + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x9358b12f) && (arg0 == 11)))) { +slice.loadUint(32) +let anon0: ConfigVotingSetup = loadConfigVotingSetup(slice) + + return { + kind: 'ConfigParam__10', + anon0: anon0, +} + +} +; + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x9059857d) && (arg0 == 12)))) { +slice.loadUint(32) +let workchains: HashmapE = loadHashmapE(slice, 32, loadWorkchainDescr) + + return { + kind: 'ConfigParam__11', + workchains: workchains, +} + +} +; + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xe8ae7dd3) && (arg0 == 13)))) { +slice.loadUint(32) +let anon0: ComplaintPricing = loadComplaintPricing(slice) + + return { + kind: 'ConfigParam__12', + anon0: anon0, +} + +} +; + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xf282db94) && (arg0 == 14)))) { +slice.loadUint(32) +let anon0: BlockCreateFees = loadBlockCreateFees(slice) + + return { + kind: 'ConfigParam__13', + anon0: anon0, +} + +} +; + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xed67ebd2) && (arg0 == 15)))) { +slice.loadUint(32) +let validators_elected_for: number = slice.loadUint(32) + +let elections_start_before: number = slice.loadUint(32) + +let elections_end_before: number = slice.loadUint(32) + +let stake_held_for: number = slice.loadUint(32) + + return { + kind: 'ConfigParam__14', + validators_elected_for: validators_elected_for, + elections_start_before: elections_start_before, + elections_end_before: elections_end_before, + stake_held_for: stake_held_for, +} + +} +; + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xe8298d51) && (arg0 == 16)))) { +slice.loadUint(32) +let max_validators: number = slice.loadUint(16) + +let max_main_validators: number = slice.loadUint(16) + +let min_validators: number = slice.loadUint(16) + + if ((!(max_validators >= max_main_validators))) { +throw new Error('') + } + if ((!(max_main_validators >= min_validators))) { +throw new Error('') + } + if ((!(min_validators >= 1))) { +throw new Error('') + } + return { + kind: 'ConfigParam__15', + max_validators: max_validators, + max_main_validators: max_main_validators, + min_validators: min_validators, +} + +} +; + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xa81c566c) && (arg0 == 17)))) { +slice.loadUint(32) +let min_stake: Grams = loadGrams(slice) + +let max_stake: Grams = loadGrams(slice) + +let min_total_stake: Grams = loadGrams(slice) + +let max_stake_factor: number = slice.loadUint(32) + + return { + kind: 'ConfigParam__16', + min_stake: min_stake, + max_stake: max_stake, + min_total_stake: min_total_stake, + max_stake_factor: max_stake_factor, +} + +} +; + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xeab9843a) && (arg0 == 18)))) { +slice.loadUint(32) +let anon0: Hashmap = loadHashmap(slice, 32, loadStoragePrices) + + return { + kind: 'ConfigParam__17', + anon0: anon0, +} + +} +; + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xf666426a) && (arg0 == 28)))) { +slice.loadUint(32) +let anon0: CatchainConfig = loadCatchainConfig(slice) + + return { + kind: 'ConfigParam__24', + anon0: anon0, +} + +} +; + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xf5b85ad3) && (arg0 == 29)))) { +slice.loadUint(32) +let anon0: ConsensusConfig = loadConsensusConfig(slice) + + return { + kind: 'ConfigParam__25', + anon0: anon0, +} + +} +; + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x849fe3cc) && (arg0 == 31)))) { +slice.loadUint(32) +let fundamental_smc_addr: HashmapE = loadHashmapE(slice, 256, loadTrue) + + return { + kind: 'ConfigParam__26', + fundamental_smc_addr: fundamental_smc_addr, +} + +} +; + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xcfc8ceeb) && (arg0 == 32)))) { +slice.loadUint(32) +let prev_validators: ValidatorSet = loadValidatorSet(slice) + + return { + kind: 'ConfigParam__27', + prev_validators: prev_validators, +} + +} +; + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xa1a5d63c) && (arg0 == 33)))) { +slice.loadUint(32) +let prev_temp_validators: ValidatorSet = loadValidatorSet(slice) + + return { + kind: 'ConfigParam__28', + prev_temp_validators: prev_temp_validators, +} + +} +; + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xfd569be3) && (arg0 == 34)))) { +slice.loadUint(32) +let cur_validators: ValidatorSet = loadValidatorSet(slice) + + return { + kind: 'ConfigParam__29', + cur_validators: cur_validators, +} + +} +; + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xc271315a) && (arg0 == 35)))) { +slice.loadUint(32) +let cur_temp_validators: ValidatorSet = loadValidatorSet(slice) + + return { + kind: 'ConfigParam__30', + cur_temp_validators: cur_temp_validators, +} + +} +; + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x85d02f6c) && (arg0 == 36)))) { +slice.loadUint(32) +let next_validators: ValidatorSet = loadValidatorSet(slice) + + return { + kind: 'ConfigParam__31', + next_validators: next_validators, +} + +} +; + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xffa3b0f8) && (arg0 == 37)))) { +slice.loadUint(32) +let next_temp_validators: ValidatorSet = loadValidatorSet(slice) + + return { + kind: 'ConfigParam__32', + next_temp_validators: next_temp_validators, +} + +} +; + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x86dfef76) && (arg0 == 39)))) { +slice.loadUint(32) +let anon0: HashmapE = loadHashmapE(slice, 256, loadValidatorSignedTempKey) + + return { + kind: 'ConfigParam__33', + anon0: anon0, +} + +} +; + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x8517b916) && (arg0 == 40)))) { +slice.loadUint(32) +let anon0: MisbehaviourPunishmentConfig = loadMisbehaviourPunishmentConfig(slice) + + return { + kind: 'ConfigParam__34', + anon0: anon0, +} + +} +; + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xbd424af1) && (arg0 == 71)))) { +slice.loadUint(32) +let anon0: OracleBridgeParams = loadOracleBridgeParams(slice) + + return { + kind: 'ConfigParam__35', + anon0: anon0, +} + +} +; + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x966f1932) && (arg0 == 72)))) { +slice.loadUint(32) +let anon0: OracleBridgeParams = loadOracleBridgeParams(slice) + + return { + kind: 'ConfigParam__36', + anon0: anon0, +} + +} +; + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x8f742873) && (arg0 == 73)))) { +slice.loadUint(32) +let anon0: OracleBridgeParams = loadOracleBridgeParams(slice) + + return { + kind: 'ConfigParam__37', + anon0: anon0, +} + +} +; + if ((arg0 == 20)) { +let anon0: GasLimitsPrices = loadGasLimitsPrices(slice) + + return { + kind: 'ConfigParam_config_mc_gas_prices', + anon0: anon0, +} + +} +; + if ((arg0 == 21)) { +let anon0: GasLimitsPrices = loadGasLimitsPrices(slice) + + return { + kind: 'ConfigParam_config_gas_prices', + anon0: anon0, +} + +} +; + if ((arg0 == 22)) { +let anon0: BlockLimits = loadBlockLimits(slice) + + return { + kind: 'ConfigParam_config_mc_block_limits', + anon0: anon0, +} + +} +; + if ((arg0 == 23)) { +let anon0: BlockLimits = loadBlockLimits(slice) + + return { + kind: 'ConfigParam_config_block_limits', + anon0: anon0, +} + +} +; + if ((arg0 == 24)) { +let anon0: MsgForwardPrices = loadMsgForwardPrices(slice) + + return { + kind: 'ConfigParam_config_mc_fwd_prices', + anon0: anon0, +} + +} +; + if ((arg0 == 25)) { +let anon0: MsgForwardPrices = loadMsgForwardPrices(slice) + + return { + kind: 'ConfigParam_config_fwd_prices', + anon0: anon0, +} + +} +; + throw new Error('') +; +} + +export function storeConfigParam(configParam: ConfigParam): (builder: Builder) => void { + if ((configParam.kind == 'ConfigParam__')) { + return ((builder: Builder) => { + builder.storeUint(0xbc7f2648, 32) + + builder.storeBits(configParam.config_addr) + +}) + +} +; + if ((configParam.kind == 'ConfigParam__1')) { + return ((builder: Builder) => { + builder.storeUint(0x84659d0d, 32) + + builder.storeBits(configParam.elector_addr) + +}) + +} +; + if ((configParam.kind == 'ConfigParam__2')) { + return ((builder: Builder) => { + builder.storeUint(0x8648b2c4, 32) + + builder.storeBits(configParam.minter_addr) + +}) + +} +; + if ((configParam.kind == 'ConfigParam__3')) { + return ((builder: Builder) => { + builder.storeUint(0x8a752dc5, 32) + + builder.storeBits(configParam.fee_collector_addr) + +}) + +} +; + if ((configParam.kind == 'ConfigParam__4')) { + return ((builder: Builder) => { + builder.storeUint(0x8ceae93f, 32) + + builder.storeBits(configParam.dns_root_addr) + +}) + +} +; + if ((configParam.kind == 'ConfigParam__5')) { + return ((builder: Builder) => { + builder.storeUint(0xb2571db5, 32) + + storeGrams(configParam.mint_new_price)(builder) + + storeGrams(configParam.mint_add_price)(builder) + +}) + +} +; + if ((configParam.kind == 'ConfigParam__6')) { + return ((builder: Builder) => { + builder.storeUint(0xd2115c6f, 32) + + storeExtraCurrencyCollection(configParam.to_mint)(builder) + +}) + +} +; + if ((configParam.kind == 'ConfigParam__7')) { + return ((builder: Builder) => { + builder.storeUint(0xb19d2da6, 32) + + storeGlobalVersion(configParam.anon0)(builder) + +}) + +} +; + if ((configParam.kind == 'ConfigParam__8')) { + return ((builder: Builder) => { + builder.storeUint(0x8f3b81de, 32) + + storeHashmap(configParam.mandatory_params, storeTrue)(builder) + +}) + +} +; + if ((configParam.kind == 'ConfigParam__9')) { + return ((builder: Builder) => { + builder.storeUint(0xfbcb8998, 32) + + storeHashmap(configParam.critical_params, storeTrue)(builder) + +}) + +} +; + if ((configParam.kind == 'ConfigParam__10')) { + return ((builder: Builder) => { + builder.storeUint(0x9358b12f, 32) + + storeConfigVotingSetup(configParam.anon0)(builder) + +}) + +} +; + if ((configParam.kind == 'ConfigParam__11')) { + return ((builder: Builder) => { + builder.storeUint(0x9059857d, 32) + + storeHashmapE(configParam.workchains, storeWorkchainDescr)(builder) + +}) + +} +; + if ((configParam.kind == 'ConfigParam__12')) { + return ((builder: Builder) => { + builder.storeUint(0xe8ae7dd3, 32) + + storeComplaintPricing(configParam.anon0)(builder) + +}) + +} +; + if ((configParam.kind == 'ConfigParam__13')) { + return ((builder: Builder) => { + builder.storeUint(0xf282db94, 32) + + storeBlockCreateFees(configParam.anon0)(builder) + +}) + +} +; + if ((configParam.kind == 'ConfigParam__14')) { + return ((builder: Builder) => { + builder.storeUint(0xed67ebd2, 32) + + builder.storeUint(configParam.validators_elected_for, 32) + + builder.storeUint(configParam.elections_start_before, 32) + + builder.storeUint(configParam.elections_end_before, 32) + + builder.storeUint(configParam.stake_held_for, 32) + +}) + +} +; + if ((configParam.kind == 'ConfigParam__15')) { + return ((builder: Builder) => { + builder.storeUint(0xe8298d51, 32) + + builder.storeUint(configParam.max_validators, 16) + + builder.storeUint(configParam.max_main_validators, 16) + + builder.storeUint(configParam.min_validators, 16) + + if ((!(configParam.max_validators >= configParam.max_main_validators))) { + throw new Error('') + } + + if ((!(configParam.max_main_validators >= configParam.min_validators))) { + throw new Error('') + } + + if ((!(configParam.min_validators >= 1))) { + throw new Error('') + } + +}) + +} +; + if ((configParam.kind == 'ConfigParam__16')) { + return ((builder: Builder) => { + builder.storeUint(0xa81c566c, 32) + + storeGrams(configParam.min_stake)(builder) + + storeGrams(configParam.max_stake)(builder) + + storeGrams(configParam.min_total_stake)(builder) + + builder.storeUint(configParam.max_stake_factor, 32) + +}) + +} +; + if ((configParam.kind == 'ConfigParam__17')) { + return ((builder: Builder) => { + builder.storeUint(0xeab9843a, 32) + + storeHashmap(configParam.anon0, storeStoragePrices)(builder) + +}) + +} +; + if ((configParam.kind == 'ConfigParam__24')) { + return ((builder: Builder) => { + builder.storeUint(0xf666426a, 32) + + storeCatchainConfig(configParam.anon0)(builder) + +}) + +} +; + if ((configParam.kind == 'ConfigParam__25')) { + return ((builder: Builder) => { + builder.storeUint(0xf5b85ad3, 32) + + storeConsensusConfig(configParam.anon0)(builder) + +}) + +} +; + if ((configParam.kind == 'ConfigParam__26')) { + return ((builder: Builder) => { + builder.storeUint(0x849fe3cc, 32) + + storeHashmapE(configParam.fundamental_smc_addr, storeTrue)(builder) + +}) + +} +; + if ((configParam.kind == 'ConfigParam__27')) { + return ((builder: Builder) => { + builder.storeUint(0xcfc8ceeb, 32) + + storeValidatorSet(configParam.prev_validators)(builder) + +}) + +} +; + if ((configParam.kind == 'ConfigParam__28')) { + return ((builder: Builder) => { + builder.storeUint(0xa1a5d63c, 32) + + storeValidatorSet(configParam.prev_temp_validators)(builder) + +}) + +} +; + if ((configParam.kind == 'ConfigParam__29')) { + return ((builder: Builder) => { + builder.storeUint(0xfd569be3, 32) + + storeValidatorSet(configParam.cur_validators)(builder) + +}) + +} +; + if ((configParam.kind == 'ConfigParam__30')) { + return ((builder: Builder) => { + builder.storeUint(0xc271315a, 32) + + storeValidatorSet(configParam.cur_temp_validators)(builder) + +}) + +} +; + if ((configParam.kind == 'ConfigParam__31')) { + return ((builder: Builder) => { + builder.storeUint(0x85d02f6c, 32) + + storeValidatorSet(configParam.next_validators)(builder) + +}) + +} +; + if ((configParam.kind == 'ConfigParam__32')) { + return ((builder: Builder) => { + builder.storeUint(0xffa3b0f8, 32) + + storeValidatorSet(configParam.next_temp_validators)(builder) + +}) + +} +; + if ((configParam.kind == 'ConfigParam__33')) { + return ((builder: Builder) => { + builder.storeUint(0x86dfef76, 32) + + storeHashmapE(configParam.anon0, storeValidatorSignedTempKey)(builder) + +}) + +} +; + if ((configParam.kind == 'ConfigParam__34')) { + return ((builder: Builder) => { + builder.storeUint(0x8517b916, 32) + + storeMisbehaviourPunishmentConfig(configParam.anon0)(builder) + +}) + +} +; + if ((configParam.kind == 'ConfigParam__35')) { + return ((builder: Builder) => { + builder.storeUint(0xbd424af1, 32) + + storeOracleBridgeParams(configParam.anon0)(builder) + +}) + +} +; + if ((configParam.kind == 'ConfigParam__36')) { + return ((builder: Builder) => { + builder.storeUint(0x966f1932, 32) + + storeOracleBridgeParams(configParam.anon0)(builder) + +}) + +} +; + if ((configParam.kind == 'ConfigParam__37')) { + return ((builder: Builder) => { + builder.storeUint(0x8f742873, 32) + + storeOracleBridgeParams(configParam.anon0)(builder) + +}) + +} +; + if ((configParam.kind == 'ConfigParam_config_mc_gas_prices')) { + return ((builder: Builder) => { + storeGasLimitsPrices(configParam.anon0)(builder) + +}) + +} +; + if ((configParam.kind == 'ConfigParam_config_gas_prices')) { + return ((builder: Builder) => { + storeGasLimitsPrices(configParam.anon0)(builder) + +}) + +} +; + if ((configParam.kind == 'ConfigParam_config_mc_block_limits')) { + return ((builder: Builder) => { + storeBlockLimits(configParam.anon0)(builder) + +}) + +} +; + if ((configParam.kind == 'ConfigParam_config_block_limits')) { + return ((builder: Builder) => { + storeBlockLimits(configParam.anon0)(builder) + +}) + +} +; + if ((configParam.kind == 'ConfigParam_config_mc_fwd_prices')) { + return ((builder: Builder) => { + storeMsgForwardPrices(configParam.anon0)(builder) + +}) + +} +; + if ((configParam.kind == 'ConfigParam_config_fwd_prices')) { + return ((builder: Builder) => { + storeMsgForwardPrices(configParam.anon0)(builder) + +}) + +} +; + throw new Error('') +; +} + +export function loadGlobalVersion(slice: Slice): GlobalVersion { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xc4))) { +slice.loadUint(8) +let version: number = slice.loadUint(32) + +let capabilities: number = slice.loadUint(64) + + return { + kind: 'GlobalVersion', + version: version, + capabilities: capabilities, +} + +} +; + throw new Error('') +; +} + +export function storeGlobalVersion(globalVersion: GlobalVersion): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xc4, 8) + + builder.storeUint(globalVersion.version, 32) + + builder.storeUint(globalVersion.capabilities, 64) + +}) + +; +} + +export function loadConfigProposalSetup(slice: Slice): ConfigProposalSetup { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x36))) { +slice.loadUint(8) +let min_tot_rounds: number = slice.loadUint(8) + +let max_tot_rounds: number = slice.loadUint(8) + +let min_wins: number = slice.loadUint(8) + +let max_losses: number = slice.loadUint(8) + +let min_store_sec: number = slice.loadUint(32) + +let max_store_sec: number = slice.loadUint(32) + +let bit_price: number = slice.loadUint(32) + +let _cell_price: number = slice.loadUint(32) + + return { + kind: 'ConfigProposalSetup', + min_tot_rounds: min_tot_rounds, + max_tot_rounds: max_tot_rounds, + min_wins: min_wins, + max_losses: max_losses, + min_store_sec: min_store_sec, + max_store_sec: max_store_sec, + bit_price: bit_price, + _cell_price: _cell_price, +} + +} +; + throw new Error('') +; +} + +export function storeConfigProposalSetup(configProposalSetup: ConfigProposalSetup): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x36, 8) + + builder.storeUint(configProposalSetup.min_tot_rounds, 8) + + builder.storeUint(configProposalSetup.max_tot_rounds, 8) + + builder.storeUint(configProposalSetup.min_wins, 8) + + builder.storeUint(configProposalSetup.max_losses, 8) + + builder.storeUint(configProposalSetup.min_store_sec, 32) + + builder.storeUint(configProposalSetup.max_store_sec, 32) + + builder.storeUint(configProposalSetup.bit_price, 32) + + builder.storeUint(configProposalSetup._cell_price, 32) + +}) + +; +} + +export function loadConfigVotingSetup(slice: Slice): ConfigVotingSetup { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x91))) { +slice.loadUint(8) +let slice1 = slice.loadRef().beginParse() + +let normal_params: ConfigProposalSetup = loadConfigProposalSetup(slice1) + +let slice2 = slice.loadRef().beginParse() + +let critical_params: ConfigProposalSetup = loadConfigProposalSetup(slice2) + + return { + kind: 'ConfigVotingSetup', + normal_params: normal_params, + critical_params: critical_params, +} + +} +; + throw new Error('') +; +} + +export function storeConfigVotingSetup(configVotingSetup: ConfigVotingSetup): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x91, 8) + + let cell1 = beginCell() + + + storeConfigProposalSetup(configVotingSetup.normal_params)(cell1) + + builder.storeRef(cell1) + + let cell2 = beginCell() + + + storeConfigProposalSetup(configVotingSetup.critical_params)(cell2) + + builder.storeRef(cell2) + +}) + +; +} + +export function loadConfigProposal(slice: Slice): ConfigProposal { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xf3))) { +slice.loadUint(8) +let param_id: number = slice.loadInt(32) + +let param_value: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() + + + return slice1 + + }) + ) + +let if_hash_equal: Maybe = loadMaybe(slice, ((slice: Slice) => { + return slice.loadUint(256) + + }) + ) + + return { + kind: 'ConfigProposal', + param_id: param_id, + param_value: param_value, + if_hash_equal: if_hash_equal, +} + +} +; + throw new Error('') +; +} + +export function storeConfigProposal(configProposal: ConfigProposal): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xf3, 8) + + builder.storeInt(configProposal.param_id, 32) + + storeMaybe(configProposal.param_value, ((arg: Slice) => { + return ((builder: Builder) => { + let cell1 = beginCell() + + + cell1.storeSlice(arg) + + builder.storeRef(cell1) + + + }) + + + }) + )(builder) + + storeMaybe(configProposal.if_hash_equal, ((arg: number) => { + return ((builder: Builder) => { + builder.storeUint(arg, 256) + + }) + + + }) + )(builder) + +}) + +; +} + +export function loadConfigProposalStatus(slice: Slice): ConfigProposalStatus { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xce))) { +slice.loadUint(8) +let expires: number = slice.loadUint(32) + +let slice1 = slice.loadRef().beginParse() + +let proposal: ConfigProposal = loadConfigProposal(slice1) + +let is_critical: Bool = loadBool(slice) + +let voters: HashmapE = loadHashmapE(slice, 16, loadTrue) + +let remaining_weight: number = slice.loadInt(64) + +let validator_set_id: number = slice.loadUint(256) + +let rounds_remaining: number = slice.loadUint(8) + +let wins: number = slice.loadUint(8) + +let losses: number = slice.loadUint(8) + + return { + kind: 'ConfigProposalStatus', + expires: expires, + proposal: proposal, + is_critical: is_critical, + voters: voters, + remaining_weight: remaining_weight, + validator_set_id: validator_set_id, + rounds_remaining: rounds_remaining, + wins: wins, + losses: losses, +} + +} +; + throw new Error('') +; +} + +export function storeConfigProposalStatus(configProposalStatus: ConfigProposalStatus): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xce, 8) + + builder.storeUint(configProposalStatus.expires, 32) + + let cell1 = beginCell() + + + storeConfigProposal(configProposalStatus.proposal)(cell1) + + builder.storeRef(cell1) + + storeBool(configProposalStatus.is_critical)(builder) + + storeHashmapE(configProposalStatus.voters, storeTrue)(builder) + + builder.storeInt(configProposalStatus.remaining_weight, 64) + + builder.storeUint(configProposalStatus.validator_set_id, 256) + + builder.storeUint(configProposalStatus.rounds_remaining, 8) + + builder.storeUint(configProposalStatus.wins, 8) + + builder.storeUint(configProposalStatus.losses, 8) + +}) + +; +} + +export function loadWorkchainFormat(slice: Slice, arg0: number): WorkchainFormat { + if (((slice.remainingBits >= 4) && ((slice.preloadUint(4) == 0x1) && (arg0 == 1)))) { +slice.loadUint(4) +let vm_version: number = slice.loadInt(32) + +let vm_mode: number = slice.loadUint(64) + + return { + kind: 'WorkchainFormat_wfmt_basic', + vm_version: vm_version, + vm_mode: vm_mode, +} + +} +; + if (((slice.remainingBits >= 4) && ((slice.preloadUint(4) == 0x0) && (arg0 == 0)))) { +slice.loadUint(4) +let min_addr_len: number = slice.loadUint(12) + +let max_addr_len: number = slice.loadUint(12) + +let addr_len_step: number = slice.loadUint(12) + +let workchain_type_id: number = slice.loadUint(32) + + if ((!(min_addr_len >= 64))) { +throw new Error('') + } + if ((!(min_addr_len <= max_addr_len))) { +throw new Error('') + } + if ((!(max_addr_len <= 1023))) { +throw new Error('') + } + if ((!(addr_len_step <= 1023))) { +throw new Error('') + } + if ((!(workchain_type_id >= 1))) { +throw new Error('') + } + return { + kind: 'WorkchainFormat_wfmt_ext', + min_addr_len: min_addr_len, + max_addr_len: max_addr_len, + addr_len_step: addr_len_step, + workchain_type_id: workchain_type_id, +} + +} +; + throw new Error('') +; +} + +export function storeWorkchainFormat(workchainFormat: WorkchainFormat): (builder: Builder) => void { + if ((workchainFormat.kind == 'WorkchainFormat_wfmt_basic')) { + return ((builder: Builder) => { + builder.storeUint(0x1, 4) + + builder.storeInt(workchainFormat.vm_version, 32) + + builder.storeUint(workchainFormat.vm_mode, 64) + +}) + +} +; + if ((workchainFormat.kind == 'WorkchainFormat_wfmt_ext')) { + return ((builder: Builder) => { + builder.storeUint(0x0, 4) + + builder.storeUint(workchainFormat.min_addr_len, 12) + + builder.storeUint(workchainFormat.max_addr_len, 12) + + builder.storeUint(workchainFormat.addr_len_step, 12) + + builder.storeUint(workchainFormat.workchain_type_id, 32) + + if ((!(workchainFormat.min_addr_len >= 64))) { + throw new Error('') + } + + if ((!(workchainFormat.min_addr_len <= workchainFormat.max_addr_len))) { + throw new Error('') + } + + if ((!(workchainFormat.max_addr_len <= 1023))) { + throw new Error('') + } + + if ((!(workchainFormat.addr_len_step <= 1023))) { + throw new Error('') + } + + if ((!(workchainFormat.workchain_type_id >= 1))) { + throw new Error('') + } + +}) + +} +; + throw new Error('') +; +} + +export function loadWorkchainDescr(slice: Slice): WorkchainDescr { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xa6))) { +slice.loadUint(8) +let enabled_since: number = slice.loadUint(32) + +let actual_min_split: number = slice.loadUint(8) + +let min_split: number = slice.loadUint(8) + +let max_split: number = slice.loadUint(8) + +let basic: number = slice.loadUint(1) + +let active: Bool = loadBool(slice) + +let accept_msgs: Bool = loadBool(slice) + +let flags: number = slice.loadUint(13) + +let zerostate_root_hash: BitString = slice.loadBits(256) + +let zerostate_file_hash: BitString = slice.loadBits(256) + +let version: number = slice.loadUint(32) + +let format: WorkchainFormat = loadWorkchainFormat(slice, basic) + + if ((!(actual_min_split <= min_split))) { +throw new Error('') + } + if ((!(flags == 0))) { +throw new Error('') + } + return { + kind: 'WorkchainDescr', + enabled_since: enabled_since, + actual_min_split: actual_min_split, + min_split: min_split, + max_split: max_split, + basic: basic, + active: active, + accept_msgs: accept_msgs, + flags: flags, + zerostate_root_hash: zerostate_root_hash, + zerostate_file_hash: zerostate_file_hash, + version: version, + format: format, +} + +} +; + throw new Error('') +; +} + +export function storeWorkchainDescr(workchainDescr: WorkchainDescr): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xa6, 8) + + builder.storeUint(workchainDescr.enabled_since, 32) + + builder.storeUint(workchainDescr.actual_min_split, 8) + + builder.storeUint(workchainDescr.min_split, 8) + + builder.storeUint(workchainDescr.max_split, 8) + + builder.storeUint(workchainDescr.basic, 1) + + storeBool(workchainDescr.active)(builder) + + storeBool(workchainDescr.accept_msgs)(builder) + + builder.storeUint(workchainDescr.flags, 13) + + builder.storeBits(workchainDescr.zerostate_root_hash) + + builder.storeBits(workchainDescr.zerostate_file_hash) + + builder.storeUint(workchainDescr.version, 32) + + storeWorkchainFormat(workchainDescr.format)(builder) + + if ((!(workchainDescr.actual_min_split <= workchainDescr.min_split))) { + throw new Error('') + } + + if ((!(workchainDescr.flags == 0))) { + throw new Error('') + } + +}) + +; +} + +export function loadComplaintPricing(slice: Slice): ComplaintPricing { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x1a))) { +slice.loadUint(8) +let deposit: Grams = loadGrams(slice) + +let bit_price: Grams = loadGrams(slice) + +let _cell_price: Grams = loadGrams(slice) + + return { + kind: 'ComplaintPricing', + deposit: deposit, + bit_price: bit_price, + _cell_price: _cell_price, +} + +} +; + throw new Error('') +; +} + +export function storeComplaintPricing(complaintPricing: ComplaintPricing): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x1a, 8) + + storeGrams(complaintPricing.deposit)(builder) + + storeGrams(complaintPricing.bit_price)(builder) + + storeGrams(complaintPricing._cell_price)(builder) + +}) + +; +} + +export function loadBlockCreateFees(slice: Slice): BlockCreateFees { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x6b))) { +slice.loadUint(8) +let masterchain_block_fee: Grams = loadGrams(slice) + +let basechain_block_fee: Grams = loadGrams(slice) + + return { + kind: 'BlockCreateFees', + masterchain_block_fee: masterchain_block_fee, + basechain_block_fee: basechain_block_fee, +} + +} +; + throw new Error('') +; +} + +export function storeBlockCreateFees(blockCreateFees: BlockCreateFees): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x6b, 8) + + storeGrams(blockCreateFees.masterchain_block_fee)(builder) + + storeGrams(blockCreateFees.basechain_block_fee)(builder) + +}) + +; +} + +export function loadStoragePrices(slice: Slice): StoragePrices { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xcc))) { +slice.loadUint(8) +let utime_since: number = slice.loadUint(32) + +let bit_price_ps: number = slice.loadUint(64) + +let _cell_price_ps: number = slice.loadUint(64) + +let mc_bit_price_ps: number = slice.loadUint(64) + +let mc_cell_price_ps: number = slice.loadUint(64) + + return { + kind: 'StoragePrices', + utime_since: utime_since, + bit_price_ps: bit_price_ps, + _cell_price_ps: _cell_price_ps, + mc_bit_price_ps: mc_bit_price_ps, + mc_cell_price_ps: mc_cell_price_ps, +} + +} +; + throw new Error('') +; +} + +export function storeStoragePrices(storagePrices: StoragePrices): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xcc, 8) + + builder.storeUint(storagePrices.utime_since, 32) + + builder.storeUint(storagePrices.bit_price_ps, 64) + + builder.storeUint(storagePrices._cell_price_ps, 64) + + builder.storeUint(storagePrices.mc_bit_price_ps, 64) + + builder.storeUint(storagePrices.mc_cell_price_ps, 64) + +}) + +; +} + +export function loadGasLimitsPrices(slice: Slice): GasLimitsPrices { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xdd))) { +slice.loadUint(8) +let gas_price: number = slice.loadUint(64) + +let gas_limit: number = slice.loadUint(64) + +let gas_credit: number = slice.loadUint(64) + +let block_gas_limit: number = slice.loadUint(64) + +let freeze_due_limit: number = slice.loadUint(64) + +let delete_due_limit: number = slice.loadUint(64) + + return { + kind: 'GasLimitsPrices_gas_prices', + gas_price: gas_price, + gas_limit: gas_limit, + gas_credit: gas_credit, + block_gas_limit: block_gas_limit, + freeze_due_limit: freeze_due_limit, + delete_due_limit: delete_due_limit, +} + +} +; + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xde))) { +slice.loadUint(8) +let gas_price: number = slice.loadUint(64) + +let gas_limit: number = slice.loadUint(64) + +let special_gas_limit: number = slice.loadUint(64) + +let gas_credit: number = slice.loadUint(64) + +let block_gas_limit: number = slice.loadUint(64) + +let freeze_due_limit: number = slice.loadUint(64) + +let delete_due_limit: number = slice.loadUint(64) + + return { + kind: 'GasLimitsPrices_gas_prices_ext', + gas_price: gas_price, + gas_limit: gas_limit, + special_gas_limit: special_gas_limit, + gas_credit: gas_credit, + block_gas_limit: block_gas_limit, + freeze_due_limit: freeze_due_limit, + delete_due_limit: delete_due_limit, +} + +} +; + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xd1))) { +slice.loadUint(8) +let flat_gas_limit: number = slice.loadUint(64) + +let flat_gas_price: number = slice.loadUint(64) + +let other: GasLimitsPrices = loadGasLimitsPrices(slice) + + return { + kind: 'GasLimitsPrices_gas_flat_pfx', + flat_gas_limit: flat_gas_limit, + flat_gas_price: flat_gas_price, + other: other, +} + +} +; + throw new Error('') +; +} + +export function storeGasLimitsPrices(gasLimitsPrices: GasLimitsPrices): (builder: Builder) => void { + if ((gasLimitsPrices.kind == 'GasLimitsPrices_gas_prices')) { + return ((builder: Builder) => { + builder.storeUint(0xdd, 8) + + builder.storeUint(gasLimitsPrices.gas_price, 64) + + builder.storeUint(gasLimitsPrices.gas_limit, 64) + + builder.storeUint(gasLimitsPrices.gas_credit, 64) + + builder.storeUint(gasLimitsPrices.block_gas_limit, 64) + + builder.storeUint(gasLimitsPrices.freeze_due_limit, 64) + + builder.storeUint(gasLimitsPrices.delete_due_limit, 64) + +}) + +} +; + if ((gasLimitsPrices.kind == 'GasLimitsPrices_gas_prices_ext')) { + return ((builder: Builder) => { + builder.storeUint(0xde, 8) + + builder.storeUint(gasLimitsPrices.gas_price, 64) + + builder.storeUint(gasLimitsPrices.gas_limit, 64) + + builder.storeUint(gasLimitsPrices.special_gas_limit, 64) + + builder.storeUint(gasLimitsPrices.gas_credit, 64) + + builder.storeUint(gasLimitsPrices.block_gas_limit, 64) + + builder.storeUint(gasLimitsPrices.freeze_due_limit, 64) + + builder.storeUint(gasLimitsPrices.delete_due_limit, 64) + +}) + +} +; + if ((gasLimitsPrices.kind == 'GasLimitsPrices_gas_flat_pfx')) { + return ((builder: Builder) => { + builder.storeUint(0xd1, 8) + + builder.storeUint(gasLimitsPrices.flat_gas_limit, 64) + + builder.storeUint(gasLimitsPrices.flat_gas_price, 64) + + storeGasLimitsPrices(gasLimitsPrices.other)(builder) + +}) + +} +; + throw new Error('') +; +} + +export function loadParamLimits(slice: Slice): ParamLimits { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xc3))) { +slice.loadUint(8) +let underload: number = slice.loadUint(32) + +let soft_limit: number = slice.loadUint(32) + +let hard_limit: number = slice.loadUint(32) + + if ((!(underload <= soft_limit))) { +throw new Error('') + } + if ((!(soft_limit <= hard_limit))) { +throw new Error('') + } + return { + kind: 'ParamLimits', + underload: underload, + soft_limit: soft_limit, + hard_limit: hard_limit, +} + +} +; + throw new Error('') +; +} + +export function storeParamLimits(paramLimits: ParamLimits): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xc3, 8) + + builder.storeUint(paramLimits.underload, 32) + + builder.storeUint(paramLimits.soft_limit, 32) + + builder.storeUint(paramLimits.hard_limit, 32) + + if ((!(paramLimits.underload <= paramLimits.soft_limit))) { + throw new Error('') + } + + if ((!(paramLimits.soft_limit <= paramLimits.hard_limit))) { + throw new Error('') + } + +}) + +; +} + +export function loadBlockLimits(slice: Slice): BlockLimits { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x5d))) { +slice.loadUint(8) +let bytes: ParamLimits = loadParamLimits(slice) + +let gas: ParamLimits = loadParamLimits(slice) + +let lt_delta: ParamLimits = loadParamLimits(slice) + + return { + kind: 'BlockLimits', + bytes: bytes, + gas: gas, + lt_delta: lt_delta, +} + +} +; + throw new Error('') +; +} + +export function storeBlockLimits(blockLimits: BlockLimits): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x5d, 8) + + storeParamLimits(blockLimits.bytes)(builder) + + storeParamLimits(blockLimits.gas)(builder) + + storeParamLimits(blockLimits.lt_delta)(builder) + +}) + +; +} + +export function loadMsgForwardPrices(slice: Slice): MsgForwardPrices { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xea))) { +slice.loadUint(8) +let lump_price: number = slice.loadUint(64) + +let bit_price: number = slice.loadUint(64) + +let _cell_price: number = slice.loadUint(64) + +let ihr_price_factor: number = slice.loadUint(32) + +let first_frac: number = slice.loadUint(16) + +let next_frac: number = slice.loadUint(16) + + return { + kind: 'MsgForwardPrices', + lump_price: lump_price, + bit_price: bit_price, + _cell_price: _cell_price, + ihr_price_factor: ihr_price_factor, + first_frac: first_frac, + next_frac: next_frac, +} + +} +; + throw new Error('') +; +} + +export function storeMsgForwardPrices(msgForwardPrices: MsgForwardPrices): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xea, 8) + + builder.storeUint(msgForwardPrices.lump_price, 64) + + builder.storeUint(msgForwardPrices.bit_price, 64) + + builder.storeUint(msgForwardPrices._cell_price, 64) + + builder.storeUint(msgForwardPrices.ihr_price_factor, 32) + + builder.storeUint(msgForwardPrices.first_frac, 16) + + builder.storeUint(msgForwardPrices.next_frac, 16) + +}) + +; +} + +export function loadCatchainConfig(slice: Slice): CatchainConfig { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xc1))) { +slice.loadUint(8) +let mc_catchain_lifetime: number = slice.loadUint(32) + +let shard_catchain_lifetime: number = slice.loadUint(32) + +let shard_validators_lifetime: number = slice.loadUint(32) + +let shard_validators_num: number = slice.loadUint(32) + + return { + kind: 'CatchainConfig_catchain_config', + mc_catchain_lifetime: mc_catchain_lifetime, + shard_catchain_lifetime: shard_catchain_lifetime, + shard_validators_lifetime: shard_validators_lifetime, + shard_validators_num: shard_validators_num, +} + +} +; + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xc2))) { +slice.loadUint(8) +let flags: number = slice.loadUint(7) + +let shuffle_mc_validators: Bool = loadBool(slice) + +let mc_catchain_lifetime: number = slice.loadUint(32) + +let shard_catchain_lifetime: number = slice.loadUint(32) + +let shard_validators_lifetime: number = slice.loadUint(32) + +let shard_validators_num: number = slice.loadUint(32) + + if ((!(flags == 0))) { +throw new Error('') + } + return { + kind: 'CatchainConfig_catchain_config_new', + flags: flags, + shuffle_mc_validators: shuffle_mc_validators, + mc_catchain_lifetime: mc_catchain_lifetime, + shard_catchain_lifetime: shard_catchain_lifetime, + shard_validators_lifetime: shard_validators_lifetime, + shard_validators_num: shard_validators_num, +} + +} +; + throw new Error('') +; +} + +export function storeCatchainConfig(catchainConfig: CatchainConfig): (builder: Builder) => void { + if ((catchainConfig.kind == 'CatchainConfig_catchain_config')) { + return ((builder: Builder) => { + builder.storeUint(0xc1, 8) + + builder.storeUint(catchainConfig.mc_catchain_lifetime, 32) + + builder.storeUint(catchainConfig.shard_catchain_lifetime, 32) + + builder.storeUint(catchainConfig.shard_validators_lifetime, 32) + + builder.storeUint(catchainConfig.shard_validators_num, 32) + +}) + +} +; + if ((catchainConfig.kind == 'CatchainConfig_catchain_config_new')) { + return ((builder: Builder) => { + builder.storeUint(0xc2, 8) + + builder.storeUint(catchainConfig.flags, 7) + + storeBool(catchainConfig.shuffle_mc_validators)(builder) + + builder.storeUint(catchainConfig.mc_catchain_lifetime, 32) + + builder.storeUint(catchainConfig.shard_catchain_lifetime, 32) + + builder.storeUint(catchainConfig.shard_validators_lifetime, 32) + + builder.storeUint(catchainConfig.shard_validators_num, 32) + + if ((!(catchainConfig.flags == 0))) { + throw new Error('') + } + +}) + +} +; + throw new Error('') +; +} + +export function loadConsensusConfig(slice: Slice): ConsensusConfig { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xd6))) { +slice.loadUint(8) +let round_candidates: number = slice.loadUint(32) + +let next_candidate_delay_ms: number = slice.loadUint(32) + +let consensus_timeout_ms: number = slice.loadUint(32) + +let fast_attempts: number = slice.loadUint(32) + +let attempt_duration: number = slice.loadUint(32) + +let catchain_max_deps: number = slice.loadUint(32) + +let max_block_bytes: number = slice.loadUint(32) + +let max_collated_bytes: number = slice.loadUint(32) + + if ((!(round_candidates >= 1))) { +throw new Error('') + } + return { + kind: 'ConsensusConfig_consensus_config', + round_candidates: round_candidates, + next_candidate_delay_ms: next_candidate_delay_ms, + consensus_timeout_ms: consensus_timeout_ms, + fast_attempts: fast_attempts, + attempt_duration: attempt_duration, + catchain_max_deps: catchain_max_deps, + max_block_bytes: max_block_bytes, + max_collated_bytes: max_collated_bytes, +} + +} +; + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xd7))) { +slice.loadUint(8) +let flags: number = slice.loadUint(7) + +let new_catchain_ids: Bool = loadBool(slice) + +let round_candidates: number = slice.loadUint(8) + +let next_candidate_delay_ms: number = slice.loadUint(32) + +let consensus_timeout_ms: number = slice.loadUint(32) + +let fast_attempts: number = slice.loadUint(32) + +let attempt_duration: number = slice.loadUint(32) + +let catchain_max_deps: number = slice.loadUint(32) + +let max_block_bytes: number = slice.loadUint(32) + +let max_collated_bytes: number = slice.loadUint(32) + + if ((!(flags == 0))) { +throw new Error('') + } + if ((!(round_candidates >= 1))) { +throw new Error('') + } + return { + kind: 'ConsensusConfig_consensus_config_new', + flags: flags, + new_catchain_ids: new_catchain_ids, + round_candidates: round_candidates, + next_candidate_delay_ms: next_candidate_delay_ms, + consensus_timeout_ms: consensus_timeout_ms, + fast_attempts: fast_attempts, + attempt_duration: attempt_duration, + catchain_max_deps: catchain_max_deps, + max_block_bytes: max_block_bytes, + max_collated_bytes: max_collated_bytes, +} + +} +; + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xd8))) { +slice.loadUint(8) +let flags: number = slice.loadUint(7) + +let new_catchain_ids: Bool = loadBool(slice) + +let round_candidates: number = slice.loadUint(8) + +let next_candidate_delay_ms: number = slice.loadUint(32) + +let consensus_timeout_ms: number = slice.loadUint(32) + +let fast_attempts: number = slice.loadUint(32) + +let attempt_duration: number = slice.loadUint(32) + +let catchain_max_deps: number = slice.loadUint(32) + +let max_block_bytes: number = slice.loadUint(32) + +let max_collated_bytes: number = slice.loadUint(32) + +let proto_version: number = slice.loadUint(16) + + if ((!(flags == 0))) { +throw new Error('') + } + if ((!(round_candidates >= 1))) { +throw new Error('') + } + return { + kind: 'ConsensusConfig_consensus_config_v3', + flags: flags, + new_catchain_ids: new_catchain_ids, + round_candidates: round_candidates, + next_candidate_delay_ms: next_candidate_delay_ms, + consensus_timeout_ms: consensus_timeout_ms, + fast_attempts: fast_attempts, + attempt_duration: attempt_duration, + catchain_max_deps: catchain_max_deps, + max_block_bytes: max_block_bytes, + max_collated_bytes: max_collated_bytes, + proto_version: proto_version, +} + +} +; + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xd9))) { +slice.loadUint(8) +let flags: number = slice.loadUint(7) + +let new_catchain_ids: Bool = loadBool(slice) + +let round_candidates: number = slice.loadUint(8) + +let next_candidate_delay_ms: number = slice.loadUint(32) + +let consensus_timeout_ms: number = slice.loadUint(32) + +let fast_attempts: number = slice.loadUint(32) + +let attempt_duration: number = slice.loadUint(32) + +let catchain_max_deps: number = slice.loadUint(32) + +let max_block_bytes: number = slice.loadUint(32) + +let max_collated_bytes: number = slice.loadUint(32) + +let proto_version: number = slice.loadUint(16) + +let catchain_max_blocks_coeff: number = slice.loadUint(32) + + if ((!(flags == 0))) { +throw new Error('') + } + if ((!(round_candidates >= 1))) { +throw new Error('') + } + return { + kind: 'ConsensusConfig_consensus_config_v4', + flags: flags, + new_catchain_ids: new_catchain_ids, + round_candidates: round_candidates, + next_candidate_delay_ms: next_candidate_delay_ms, + consensus_timeout_ms: consensus_timeout_ms, + fast_attempts: fast_attempts, + attempt_duration: attempt_duration, + catchain_max_deps: catchain_max_deps, + max_block_bytes: max_block_bytes, + max_collated_bytes: max_collated_bytes, + proto_version: proto_version, + catchain_max_blocks_coeff: catchain_max_blocks_coeff, +} + +} +; + throw new Error('') +; +} + +export function storeConsensusConfig(consensusConfig: ConsensusConfig): (builder: Builder) => void { + if ((consensusConfig.kind == 'ConsensusConfig_consensus_config')) { + return ((builder: Builder) => { + builder.storeUint(0xd6, 8) + + builder.storeUint(consensusConfig.round_candidates, 32) + + builder.storeUint(consensusConfig.next_candidate_delay_ms, 32) + + builder.storeUint(consensusConfig.consensus_timeout_ms, 32) + + builder.storeUint(consensusConfig.fast_attempts, 32) + + builder.storeUint(consensusConfig.attempt_duration, 32) + + builder.storeUint(consensusConfig.catchain_max_deps, 32) + + builder.storeUint(consensusConfig.max_block_bytes, 32) + + builder.storeUint(consensusConfig.max_collated_bytes, 32) + + if ((!(consensusConfig.round_candidates >= 1))) { + throw new Error('') + } + +}) + +} +; + if ((consensusConfig.kind == 'ConsensusConfig_consensus_config_new')) { + return ((builder: Builder) => { + builder.storeUint(0xd7, 8) + + builder.storeUint(consensusConfig.flags, 7) + + storeBool(consensusConfig.new_catchain_ids)(builder) + + builder.storeUint(consensusConfig.round_candidates, 8) + + builder.storeUint(consensusConfig.next_candidate_delay_ms, 32) + + builder.storeUint(consensusConfig.consensus_timeout_ms, 32) + + builder.storeUint(consensusConfig.fast_attempts, 32) + + builder.storeUint(consensusConfig.attempt_duration, 32) + + builder.storeUint(consensusConfig.catchain_max_deps, 32) + + builder.storeUint(consensusConfig.max_block_bytes, 32) + + builder.storeUint(consensusConfig.max_collated_bytes, 32) + + if ((!(consensusConfig.flags == 0))) { + throw new Error('') + } + + if ((!(consensusConfig.round_candidates >= 1))) { + throw new Error('') + } + +}) + +} +; + if ((consensusConfig.kind == 'ConsensusConfig_consensus_config_v3')) { + return ((builder: Builder) => { + builder.storeUint(0xd8, 8) + + builder.storeUint(consensusConfig.flags, 7) + + storeBool(consensusConfig.new_catchain_ids)(builder) + + builder.storeUint(consensusConfig.round_candidates, 8) + + builder.storeUint(consensusConfig.next_candidate_delay_ms, 32) + + builder.storeUint(consensusConfig.consensus_timeout_ms, 32) + + builder.storeUint(consensusConfig.fast_attempts, 32) + + builder.storeUint(consensusConfig.attempt_duration, 32) + + builder.storeUint(consensusConfig.catchain_max_deps, 32) + + builder.storeUint(consensusConfig.max_block_bytes, 32) + + builder.storeUint(consensusConfig.max_collated_bytes, 32) + + builder.storeUint(consensusConfig.proto_version, 16) + + if ((!(consensusConfig.flags == 0))) { + throw new Error('') + } + + if ((!(consensusConfig.round_candidates >= 1))) { + throw new Error('') + } + +}) + +} +; + if ((consensusConfig.kind == 'ConsensusConfig_consensus_config_v4')) { + return ((builder: Builder) => { + builder.storeUint(0xd9, 8) + + builder.storeUint(consensusConfig.flags, 7) + + storeBool(consensusConfig.new_catchain_ids)(builder) + + builder.storeUint(consensusConfig.round_candidates, 8) + + builder.storeUint(consensusConfig.next_candidate_delay_ms, 32) + + builder.storeUint(consensusConfig.consensus_timeout_ms, 32) + + builder.storeUint(consensusConfig.fast_attempts, 32) + + builder.storeUint(consensusConfig.attempt_duration, 32) + + builder.storeUint(consensusConfig.catchain_max_deps, 32) + + builder.storeUint(consensusConfig.max_block_bytes, 32) + + builder.storeUint(consensusConfig.max_collated_bytes, 32) + + builder.storeUint(consensusConfig.proto_version, 16) + + builder.storeUint(consensusConfig.catchain_max_blocks_coeff, 32) + + if ((!(consensusConfig.flags == 0))) { + throw new Error('') + } + + if ((!(consensusConfig.round_candidates >= 1))) { + throw new Error('') + } + +}) + +} +; + throw new Error('') +; +} + +export function loadValidatorTempKey(slice: Slice): ValidatorTempKey { + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0x3))) { +slice.loadUint(4) +let adnl_addr: BitString = slice.loadBits(256) + +let temp_public_key: SigPubKey = loadSigPubKey(slice) + +let seqno: number = slice.loadUint(32) + +let valid_until: number = slice.loadUint(32) + + return { + kind: 'ValidatorTempKey', + adnl_addr: adnl_addr, + temp_public_key: temp_public_key, + seqno: seqno, + valid_until: valid_until, +} + +} +; + throw new Error('') +; +} + +export function storeValidatorTempKey(validatorTempKey: ValidatorTempKey): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x3, 4) + + builder.storeBits(validatorTempKey.adnl_addr) + + storeSigPubKey(validatorTempKey.temp_public_key)(builder) + + builder.storeUint(validatorTempKey.seqno, 32) + + builder.storeUint(validatorTempKey.valid_until, 32) + +}) + +; +} + +export function loadValidatorSignedTempKey(slice: Slice): ValidatorSignedTempKey { + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0x4))) { +slice.loadUint(4) +let slice1 = slice.loadRef().beginParse() + +let key: ValidatorTempKey = loadValidatorTempKey(slice1) + +let signature: CryptoSignature = loadCryptoSignature(slice) + + return { + kind: 'ValidatorSignedTempKey', + key: key, + signature: signature, +} + +} +; + throw new Error('') +; +} + +export function storeValidatorSignedTempKey(validatorSignedTempKey: ValidatorSignedTempKey): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x4, 4) + + let cell1 = beginCell() + + + storeValidatorTempKey(validatorSignedTempKey.key)(cell1) + + builder.storeRef(cell1) + + storeCryptoSignature(validatorSignedTempKey.signature)(builder) + +}) + +; +} + +export function loadMisbehaviourPunishmentConfig(slice: Slice): MisbehaviourPunishmentConfig { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x01))) { +slice.loadUint(8) +let default_flat_fine: Grams = loadGrams(slice) + +let default_proportional_fine: number = slice.loadUint(32) + +let severity_flat_mult: number = slice.loadUint(16) + +let severity_proportional_mult: number = slice.loadUint(16) + +let unpunishable_interval: number = slice.loadUint(16) + +let long_interval: number = slice.loadUint(16) + +let long_flat_mult: number = slice.loadUint(16) + +let long_proportional_mult: number = slice.loadUint(16) + +let medium_interval: number = slice.loadUint(16) + +let medium_flat_mult: number = slice.loadUint(16) + +let medium_proportional_mult: number = slice.loadUint(16) + + return { + kind: 'MisbehaviourPunishmentConfig', + default_flat_fine: default_flat_fine, + default_proportional_fine: default_proportional_fine, + severity_flat_mult: severity_flat_mult, + severity_proportional_mult: severity_proportional_mult, + unpunishable_interval: unpunishable_interval, + long_interval: long_interval, + long_flat_mult: long_flat_mult, + long_proportional_mult: long_proportional_mult, + medium_interval: medium_interval, + medium_flat_mult: medium_flat_mult, + medium_proportional_mult: medium_proportional_mult, +} + +} +; + throw new Error('') +; +} + +export function storeMisbehaviourPunishmentConfig(misbehaviourPunishmentConfig: MisbehaviourPunishmentConfig): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x01, 8) + + storeGrams(misbehaviourPunishmentConfig.default_flat_fine)(builder) + + builder.storeUint(misbehaviourPunishmentConfig.default_proportional_fine, 32) + + builder.storeUint(misbehaviourPunishmentConfig.severity_flat_mult, 16) + + builder.storeUint(misbehaviourPunishmentConfig.severity_proportional_mult, 16) + + builder.storeUint(misbehaviourPunishmentConfig.unpunishable_interval, 16) + + builder.storeUint(misbehaviourPunishmentConfig.long_interval, 16) + + builder.storeUint(misbehaviourPunishmentConfig.long_flat_mult, 16) + + builder.storeUint(misbehaviourPunishmentConfig.long_proportional_mult, 16) + + builder.storeUint(misbehaviourPunishmentConfig.medium_interval, 16) + + builder.storeUint(misbehaviourPunishmentConfig.medium_flat_mult, 16) + + builder.storeUint(misbehaviourPunishmentConfig.medium_proportional_mult, 16) + +}) + +; +} + +export function loadOracleBridgeParams(slice: Slice): OracleBridgeParams { + let bridge_address: BitString = slice.loadBits(256) + +; + let oracle_mutlisig_address: BitString = slice.loadBits(256) + +; + let oracles: HashmapE = loadHashmapE(slice, 256, ((slice: Slice) => { + return slice.loadUint(256) + +}) +) + +; + let external_chain_address: BitString = slice.loadBits(256) + +; + return { + kind: 'OracleBridgeParams', + bridge_address: bridge_address, + oracle_mutlisig_address: oracle_mutlisig_address, + oracles: oracles, + external_chain_address: external_chain_address, +} + +; +} + +export function storeOracleBridgeParams(oracleBridgeParams: OracleBridgeParams): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeBits(oracleBridgeParams.bridge_address) + + builder.storeBits(oracleBridgeParams.oracle_mutlisig_address) + + storeHashmapE(oracleBridgeParams.oracles, ((arg: number) => { + return ((builder: Builder) => { + builder.storeUint(arg, 256) + + }) + + + }) + )(builder) + + builder.storeBits(oracleBridgeParams.external_chain_address) + +}) + +; +} + +export function loadBlockSignaturesPure(slice: Slice): BlockSignaturesPure { + let sig_count: number = slice.loadUint(32) + +; + let sig_weight: number = slice.loadUint(64) + +; + let signatures: HashmapE = loadHashmapE(slice, 16, loadCryptoSignaturePair) + +; + return { + kind: 'BlockSignaturesPure', + sig_count: sig_count, + sig_weight: sig_weight, + signatures: signatures, +} + +; +} + +export function storeBlockSignaturesPure(blockSignaturesPure: BlockSignaturesPure): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(blockSignaturesPure.sig_count, 32) + + builder.storeUint(blockSignaturesPure.sig_weight, 64) + + storeHashmapE(blockSignaturesPure.signatures, storeCryptoSignaturePair)(builder) + +}) + +; +} + +export function loadBlockSignatures(slice: Slice): BlockSignatures { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x11))) { +slice.loadUint(8) +let validator_info: ValidatorBaseInfo = loadValidatorBaseInfo(slice) + +let pure_signatures: BlockSignaturesPure = loadBlockSignaturesPure(slice) + + return { + kind: 'BlockSignatures', + validator_info: validator_info, + pure_signatures: pure_signatures, +} + +} +; + throw new Error('') +; +} + +export function storeBlockSignatures(blockSignatures: BlockSignatures): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x11, 8) + + storeValidatorBaseInfo(blockSignatures.validator_info)(builder) + + storeBlockSignaturesPure(blockSignatures.pure_signatures)(builder) + +}) + +; +} + +export function loadBlockProof(slice: Slice): BlockProof { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xc3))) { +slice.loadUint(8) +let proof_for: BlockIdExt = loadBlockIdExt(slice) + +let slice1 = slice.loadRef().beginParse() + +let root: Slice = slice1 + +let signatures: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() + + + return loadBlockSignatures(slice1) + + }) + ) + + return { + kind: 'BlockProof', + proof_for: proof_for, + root: root, + signatures: signatures, +} + +} +; + throw new Error('') +; +} + +export function storeBlockProof(blockProof: BlockProof): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xc3, 8) + + storeBlockIdExt(blockProof.proof_for)(builder) + + let cell1 = beginCell() + + + cell1.storeSlice(blockProof.root) + + builder.storeRef(cell1) + + storeMaybe(blockProof.signatures, ((arg: BlockSignatures) => { + return ((builder: Builder) => { + let cell1 = beginCell() + + + storeBlockSignatures(arg)(cell1) + + builder.storeRef(cell1) + + + }) + + + }) + )(builder) + +}) + +; +} + +export function loadProofChain(slice: Slice, arg0: number): ProofChain { + if ((arg0 == 0)) { + return { + kind: 'ProofChain_chain_empty', +} + +} +; + if (true) { +let slice1 = slice.loadRef().beginParse() + +let root: Slice = slice1 + +let prev: ProofChain | undefined = ((arg0 - 1) ? ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() + + + return loadProofChain(slice1, (arg0 - 1)) + + }) + (slice) : undefined) + + return { + kind: 'ProofChain_chain_link', + n: (arg0 - 1), + root: root, + prev: prev, +} + +} +; + throw new Error('') +; +} + +export function storeProofChain(proofChain: ProofChain): (builder: Builder) => void { + if ((proofChain.kind == 'ProofChain_chain_empty')) { + return ((builder: Builder) => { +}) + +} +; + if ((proofChain.kind == 'ProofChain_chain_link')) { + return ((builder: Builder) => { + let cell1 = beginCell() + + + cell1.storeSlice(proofChain.root) + + builder.storeRef(cell1) + + if ((proofChain.prev != undefined)) { + let cell1 = beginCell() + + + storeProofChain(proofChain.prev)(cell1) + + builder.storeRef(cell1) + + } + +}) + +} +; + throw new Error('') +; +} + +export function loadTopBlockDescr(slice: Slice): TopBlockDescr { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xd5))) { +slice.loadUint(8) +let proof_for: BlockIdExt = loadBlockIdExt(slice) + +let signatures: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() + + + return loadBlockSignatures(slice1) + + }) + ) + +let len: number = slice.loadUint(8) + +let chain: ProofChain = loadProofChain(slice, len) + + if ((!(len >= 1))) { +throw new Error('') + } + if ((!(len <= 8))) { +throw new Error('') + } + return { + kind: 'TopBlockDescr', + proof_for: proof_for, + signatures: signatures, + len: len, + chain: chain, +} + +} +; + throw new Error('') +; +} + +export function storeTopBlockDescr(topBlockDescr: TopBlockDescr): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xd5, 8) + + storeBlockIdExt(topBlockDescr.proof_for)(builder) + + storeMaybe(topBlockDescr.signatures, ((arg: BlockSignatures) => { + return ((builder: Builder) => { + let cell1 = beginCell() + + + storeBlockSignatures(arg)(cell1) + + builder.storeRef(cell1) + + + }) + + + }) + )(builder) + + builder.storeUint(topBlockDescr.len, 8) + + storeProofChain(topBlockDescr.chain)(builder) + + if ((!(topBlockDescr.len >= 1))) { + throw new Error('') + } + + if ((!(topBlockDescr.len <= 8))) { + throw new Error('') + } + +}) + +; +} + +export function loadTopBlockDescrSet(slice: Slice): TopBlockDescrSet { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x4ac789f3))) { +slice.loadUint(32) +let collection: HashmapE = loadHashmapE(slice, 96, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() + + + return loadTopBlockDescr(slice1) + + }) + ) + + return { + kind: 'TopBlockDescrSet', + collection: collection, +} + +} +; + throw new Error('') +; +} + +export function storeTopBlockDescrSet(topBlockDescrSet: TopBlockDescrSet): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x4ac789f3, 32) + + storeHashmapE(topBlockDescrSet.collection, ((arg: TopBlockDescr) => { + return ((builder: Builder) => { + let cell1 = beginCell() + + + storeTopBlockDescr(arg)(cell1) + + builder.storeRef(cell1) + + + }) + + + }) + )(builder) + +}) + +; +} + +export function loadProducerInfo(slice: Slice): ProducerInfo { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x34))) { +slice.loadUint(8) +let utime: number = slice.loadUint(32) + +let mc_blk_ref: ExtBlkRef = loadExtBlkRef(slice) + +let slice1 = slice.loadRef().beginParse() + +let state_proof: MERKLE_PROOF = loadMERKLE_PROOF(slice1, loadBlock) + +let slice2 = slice.loadRef().beginParse() + +let prod_proof: MERKLE_PROOF = loadMERKLE_PROOF(slice2, loadShardState) + + return { + kind: 'ProducerInfo', + utime: utime, + mc_blk_ref: mc_blk_ref, + state_proof: state_proof, + prod_proof: prod_proof, +} + +} +; + throw new Error('') +; +} + +export function storeProducerInfo(producerInfo: ProducerInfo): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x34, 8) + + builder.storeUint(producerInfo.utime, 32) + + storeExtBlkRef(producerInfo.mc_blk_ref)(builder) + + let cell1 = beginCell() + + + storeMERKLE_PROOF(producerInfo.state_proof, storeBlock)(cell1) + + builder.storeRef(cell1) + + let cell2 = beginCell() + + + storeMERKLE_PROOF(producerInfo.prod_proof, storeShardState)(cell2) + + builder.storeRef(cell2) + +}) + +; +} + +export function loadComplaintDescr(slice: Slice): ComplaintDescr { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x9c436252))) { +slice.loadUint(32) +let from_utime: number = slice.loadUint(32) + +let slice1 = slice.loadRef().beginParse() + +let prod_info: ProducerInfo = loadProducerInfo(slice1) + + return { + kind: 'ComplaintDescr_no_blk_gen', + from_utime: from_utime, + prod_info: prod_info, +} + +} +; + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x987f1ab7))) { +slice.loadUint(32) +let slice1 = slice.loadRef().beginParse() + +let prod_info_old: ProducerInfo = loadProducerInfo(slice1) + +let slice2 = slice.loadRef().beginParse() + +let prod_info_new: ProducerInfo = loadProducerInfo(slice2) + + return { + kind: 'ComplaintDescr_no_blk_gen_diff', + prod_info_old: prod_info_old, + prod_info_new: prod_info_new, +} + +} +; + throw new Error('') +; +} + +export function storeComplaintDescr(complaintDescr: ComplaintDescr): (builder: Builder) => void { + if ((complaintDescr.kind == 'ComplaintDescr_no_blk_gen')) { + return ((builder: Builder) => { + builder.storeUint(0x9c436252, 32) + + builder.storeUint(complaintDescr.from_utime, 32) + + let cell1 = beginCell() + + + storeProducerInfo(complaintDescr.prod_info)(cell1) + + builder.storeRef(cell1) + +}) + +} +; + if ((complaintDescr.kind == 'ComplaintDescr_no_blk_gen_diff')) { + return ((builder: Builder) => { + builder.storeUint(0x987f1ab7, 32) + + let cell1 = beginCell() + + + storeProducerInfo(complaintDescr.prod_info_old)(cell1) + + builder.storeRef(cell1) + + let cell2 = beginCell() + + + storeProducerInfo(complaintDescr.prod_info_new)(cell2) + + builder.storeRef(cell2) + +}) + +} +; + throw new Error('') +; +} + +export function loadValidatorComplaint(slice: Slice): ValidatorComplaint { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xbc))) { +slice.loadUint(8) +let validator_pubkey: BitString = slice.loadBits(256) + +let slice1 = slice.loadRef().beginParse() + +let description: ComplaintDescr = loadComplaintDescr(slice1) + +let created_at: number = slice.loadUint(32) + +let severity: number = slice.loadUint(8) + +let reward_addr: number = slice.loadUint(256) + +let paid: Grams = loadGrams(slice) + +let suggested_fine: Grams = loadGrams(slice) + +let suggested_fine_part: number = slice.loadUint(32) + + return { + kind: 'ValidatorComplaint', + validator_pubkey: validator_pubkey, + description: description, + created_at: created_at, + severity: severity, + reward_addr: reward_addr, + paid: paid, + suggested_fine: suggested_fine, + suggested_fine_part: suggested_fine_part, +} + +} +; + throw new Error('') +; +} + +export function storeValidatorComplaint(validatorComplaint: ValidatorComplaint): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xbc, 8) + + builder.storeBits(validatorComplaint.validator_pubkey) + + let cell1 = beginCell() + + + storeComplaintDescr(validatorComplaint.description)(cell1) + + builder.storeRef(cell1) + + builder.storeUint(validatorComplaint.created_at, 32) + + builder.storeUint(validatorComplaint.severity, 8) + + builder.storeUint(validatorComplaint.reward_addr, 256) + + storeGrams(validatorComplaint.paid)(builder) + + storeGrams(validatorComplaint.suggested_fine)(builder) + + builder.storeUint(validatorComplaint.suggested_fine_part, 32) + +}) + +; +} + +export function loadValidatorComplaintStatus(slice: Slice): ValidatorComplaintStatus { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x2d))) { +slice.loadUint(8) +let slice1 = slice.loadRef().beginParse() + +let complaint: ValidatorComplaint = loadValidatorComplaint(slice1) + +let voters: HashmapE = loadHashmapE(slice, 16, loadTrue) + +let vset_id: number = slice.loadUint(256) + +let weight_remaining: number = slice.loadInt(64) + + return { + kind: 'ValidatorComplaintStatus', + complaint: complaint, + voters: voters, + vset_id: vset_id, + weight_remaining: weight_remaining, +} + +} +; + throw new Error('') +; +} + +export function storeValidatorComplaintStatus(validatorComplaintStatus: ValidatorComplaintStatus): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x2d, 8) + + let cell1 = beginCell() + + + storeValidatorComplaint(validatorComplaintStatus.complaint)(cell1) + + builder.storeRef(cell1) + + storeHashmapE(validatorComplaintStatus.voters, storeTrue)(builder) + + builder.storeUint(validatorComplaintStatus.vset_id, 256) + + builder.storeInt(validatorComplaintStatus.weight_remaining, 64) + +}) + +; +} + +export function loadVmStackValue(slice: Slice): VmStackValue { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x00))) { +slice.loadUint(8) + return { + kind: 'VmStackValue_vm_stk_null', +} + +} +; + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x01))) { +slice.loadUint(8) +let value: number = slice.loadInt(64) + + return { + kind: 'VmStackValue_vm_stk_tinyint', + value: value, +} + +} +; + if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x0201))) { +slice.loadUint(16) +let value: number = slice.loadInt(257) + + return { + kind: 'VmStackValue_vm_stk_int', + value: value, +} + +} +; + if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x02ff))) { +slice.loadUint(16) + return { + kind: 'VmStackValue_vm_stk_nan', +} + +} +; + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x03))) { +slice.loadUint(8) +let slice1 = slice.loadRef().beginParse() + +let _cell: Slice = slice1 + + return { + kind: 'VmStackValue_vm_stk_cell', + _cell: _cell, +} + +} +; + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x04))) { +slice.loadUint(8) +let _: VmCellSlice = loadVmCellSlice(slice) + + return { + kind: 'VmStackValue_vm_stk_slice', + _: _, +} + +} +; + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x05))) { +slice.loadUint(8) +let slice1 = slice.loadRef().beginParse() + +let _cell: Slice = slice1 + + return { + kind: 'VmStackValue_vm_stk_builder', + _cell: _cell, +} + +} +; + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x06))) { +slice.loadUint(8) +let cont: VmCont = loadVmCont(slice) + + return { + kind: 'VmStackValue_vm_stk_cont', + cont: cont, +} + +} +; + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x07))) { +slice.loadUint(8) +let len: number = slice.loadUint(16) + +let data: VmTuple = loadVmTuple(slice, len) + + return { + kind: 'VmStackValue_vm_stk_tuple', + len: len, + data: data, +} + +} +; + throw new Error('') +; +} + +export function storeVmStackValue(vmStackValue: VmStackValue): (builder: Builder) => void { + if ((vmStackValue.kind == 'VmStackValue_vm_stk_null')) { + return ((builder: Builder) => { + builder.storeUint(0x00, 8) + +}) + +} +; + if ((vmStackValue.kind == 'VmStackValue_vm_stk_tinyint')) { + return ((builder: Builder) => { + builder.storeUint(0x01, 8) + + builder.storeInt(vmStackValue.value, 64) + +}) + +} +; + if ((vmStackValue.kind == 'VmStackValue_vm_stk_int')) { + return ((builder: Builder) => { + builder.storeUint(0x0201, 16) + + builder.storeInt(vmStackValue.value, 257) + +}) + +} +; + if ((vmStackValue.kind == 'VmStackValue_vm_stk_nan')) { + return ((builder: Builder) => { + builder.storeUint(0x02ff, 16) + +}) + +} +; + if ((vmStackValue.kind == 'VmStackValue_vm_stk_cell')) { + return ((builder: Builder) => { + builder.storeUint(0x03, 8) + + let cell1 = beginCell() + + + cell1.storeSlice(vmStackValue._cell) + + builder.storeRef(cell1) + +}) + +} +; + if ((vmStackValue.kind == 'VmStackValue_vm_stk_slice')) { + return ((builder: Builder) => { + builder.storeUint(0x04, 8) + + storeVmCellSlice(vmStackValue._)(builder) + +}) + +} +; + if ((vmStackValue.kind == 'VmStackValue_vm_stk_builder')) { + return ((builder: Builder) => { + builder.storeUint(0x05, 8) + + let cell1 = beginCell() + + + cell1.storeSlice(vmStackValue._cell) + + builder.storeRef(cell1) + +}) + +} +; + if ((vmStackValue.kind == 'VmStackValue_vm_stk_cont')) { + return ((builder: Builder) => { + builder.storeUint(0x06, 8) + + storeVmCont(vmStackValue.cont)(builder) + +}) + +} +; + if ((vmStackValue.kind == 'VmStackValue_vm_stk_tuple')) { + return ((builder: Builder) => { + builder.storeUint(0x07, 8) + + builder.storeUint(vmStackValue.len, 16) + + storeVmTuple(vmStackValue.data)(builder) + +}) + +} +; + throw new Error('') +; +} + +export function loadVmCellSlice(slice: Slice): VmCellSlice { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xd6a63245))) { +slice.loadUint(32) +let slice1 = slice.loadRef().beginParse() + +let _cell: Slice = slice1 + +let st_bits: number = slice.loadUint(10) + +let end_bits: number = slice.loadUint(10) + +let st_ref: number = slice.loadUint(bitLen(4)) + +let end_ref: number = slice.loadUint(bitLen(4)) + + if ((!(st_bits <= end_bits))) { +throw new Error('') + } + if ((!(st_ref <= end_ref))) { +throw new Error('') + } + return { + kind: 'VmCellSlice', + _cell: _cell, + st_bits: st_bits, + end_bits: end_bits, + st_ref: st_ref, + end_ref: end_ref, +} + +} +; + throw new Error('') +; +} + +export function storeVmCellSlice(vmCellSlice: VmCellSlice): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xd6a63245, 32) + + let cell1 = beginCell() + + + cell1.storeSlice(vmCellSlice._cell) + + builder.storeRef(cell1) + + builder.storeUint(vmCellSlice.st_bits, 10) + + builder.storeUint(vmCellSlice.end_bits, 10) + + builder.storeUint(vmCellSlice.st_ref, bitLen(4)) + + builder.storeUint(vmCellSlice.end_ref, bitLen(4)) + + if ((!(vmCellSlice.st_bits <= vmCellSlice.end_bits))) { + throw new Error('') + } + + if ((!(vmCellSlice.st_ref <= vmCellSlice.end_ref))) { + throw new Error('') + } + +}) + +; +} + +export function loadVmTupleRef(slice: Slice, arg0: number): VmTupleRef { + if ((arg0 == 0)) { + return { + kind: 'VmTupleRef_vm_tupref_nil', +} + +} +; + if ((arg0 == 1)) { +let slice1 = slice.loadRef().beginParse() + +let entry: VmStackValue = loadVmStackValue(slice1) + + return { + kind: 'VmTupleRef_vm_tupref_single', + entry: entry, +} + +} +; + if (true) { +let slice1 = slice.loadRef().beginParse() + +let ref: VmTuple = loadVmTuple(slice1, ((arg0 - 2) + 2)) + + return { + kind: 'VmTupleRef_vm_tupref_any', + n: (arg0 - 2), + ref: ref, +} + +} +; + throw new Error('') +; +} + +export function storeVmTupleRef(vmTupleRef: VmTupleRef): (builder: Builder) => void { + if ((vmTupleRef.kind == 'VmTupleRef_vm_tupref_nil')) { + return ((builder: Builder) => { +}) + +} +; + if ((vmTupleRef.kind == 'VmTupleRef_vm_tupref_single')) { + return ((builder: Builder) => { + let cell1 = beginCell() + + + storeVmStackValue(vmTupleRef.entry)(cell1) + + builder.storeRef(cell1) + +}) + +} +; + if ((vmTupleRef.kind == 'VmTupleRef_vm_tupref_any')) { + return ((builder: Builder) => { + let cell1 = beginCell() + + + storeVmTuple(vmTupleRef.ref)(cell1) + + builder.storeRef(cell1) + +}) + +} +; + throw new Error('') +; +} + +export function loadVmTuple(slice: Slice, arg0: number): VmTuple { + if ((arg0 == 0)) { + return { + kind: 'VmTuple_vm_tuple_nil', +} + +} +; + if (true) { +let head: VmTupleRef = loadVmTupleRef(slice, (arg0 - 1)) + +let slice1 = slice.loadRef().beginParse() + +let tail: VmStackValue = loadVmStackValue(slice1) + + return { + kind: 'VmTuple_vm_tuple_tcons', + n: (arg0 - 1), + head: head, + tail: tail, +} + +} +; + throw new Error('') +; +} + +export function storeVmTuple(vmTuple: VmTuple): (builder: Builder) => void { + if ((vmTuple.kind == 'VmTuple_vm_tuple_nil')) { + return ((builder: Builder) => { +}) + +} +; + if ((vmTuple.kind == 'VmTuple_vm_tuple_tcons')) { + return ((builder: Builder) => { + storeVmTupleRef(vmTuple.head)(builder) + + let cell1 = beginCell() + + + storeVmStackValue(vmTuple.tail)(cell1) + + builder.storeRef(cell1) + +}) + +} +; + throw new Error('') +; +} + +export function loadVmStack(slice: Slice): VmStack { + let depth: number = slice.loadUint(24) + +; + let stack: VmStackList = loadVmStackList(slice, depth) + +; + return { + kind: 'VmStack', + depth: depth, + stack: stack, +} + +; +} + +export function storeVmStack(vmStack: VmStack): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(vmStack.depth, 24) + + storeVmStackList(vmStack.stack)(builder) + +}) + +; +} + +export function loadVmStackList(slice: Slice, arg0: number): VmStackList { + if ((arg0 == 0)) { + return { + kind: 'VmStackList_vm_stk_nil', +} + +} +; + if (true) { +let slice1 = slice.loadRef().beginParse() + +let rest: VmStackList = loadVmStackList(slice1, (arg0 - 1)) + +let tos: VmStackValue = loadVmStackValue(slice) + + return { + kind: 'VmStackList_vm_stk_cons', + n: (arg0 - 1), + rest: rest, + tos: tos, +} + +} +; + throw new Error('') +; +} + +export function storeVmStackList(vmStackList: VmStackList): (builder: Builder) => void { + if ((vmStackList.kind == 'VmStackList_vm_stk_nil')) { + return ((builder: Builder) => { +}) + +} +; + if ((vmStackList.kind == 'VmStackList_vm_stk_cons')) { + return ((builder: Builder) => { + let cell1 = beginCell() + + + storeVmStackList(vmStackList.rest)(cell1) + + builder.storeRef(cell1) + + storeVmStackValue(vmStackList.tos)(builder) + +}) + +} +; + throw new Error('') +; +} + +export function loadVmSaveList(slice: Slice): VmSaveList { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xeed28f11))) { +slice.loadUint(32) +let cregs: HashmapE = loadHashmapE(slice, 4, loadVmStackValue) + + return { + kind: 'VmSaveList', + cregs: cregs, +} + +} +; + throw new Error('') +; +} + +export function storeVmSaveList(vmSaveList: VmSaveList): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xeed28f11, 32) + + storeHashmapE(vmSaveList.cregs, storeVmStackValue)(builder) + +}) + +; +} + +export function loadVmGasLimits(slice: Slice): VmGasLimits { + let remaining: number = slice.loadInt(64) + +; + let slice1 = slice.loadRef().beginParse() + +; + let max_limit: number = slice1.loadInt(64) + +; + let cur_limit: number = slice1.loadInt(64) + +; + let credit: number = slice1.loadInt(64) + +; + return { + kind: 'VmGasLimits', + remaining: remaining, + max_limit: max_limit, + cur_limit: cur_limit, + credit: credit, +} + +; +} + +export function storeVmGasLimits(vmGasLimits: VmGasLimits): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeInt(vmGasLimits.remaining, 64) + + let cell1 = beginCell() + + + cell1.storeInt(vmGasLimits.max_limit, 64) + + cell1.storeInt(vmGasLimits.cur_limit, 64) + + cell1.storeInt(vmGasLimits.credit, 64) + + builder.storeRef(cell1) + +}) + +; +} + +export function loadVmLibraries(slice: Slice): VmLibraries { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xe9be85ef))) { +slice.loadUint(32) +let libraries: HashmapE = loadHashmapE(slice, 256, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() + + + return slice1 + + }) + ) + + return { + kind: 'VmLibraries', + libraries: libraries, +} + +} +; + throw new Error('') +; +} + +export function storeVmLibraries(vmLibraries: VmLibraries): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xe9be85ef, 32) + + storeHashmapE(vmLibraries.libraries, ((arg: Slice) => { + return ((builder: Builder) => { + let cell1 = beginCell() + + + cell1.storeSlice(arg) + + builder.storeRef(cell1) + + + }) + + + }) + )(builder) + +}) + +; +} + +export function loadVmControlData(slice: Slice): VmControlData { + let nargs: Maybe = loadMaybe(slice, ((slice: Slice) => { + return slice.loadUint(13) + +}) +) + +; + let stack: Maybe = loadMaybe(slice, loadVmStack) + +; + let save: VmSaveList = loadVmSaveList(slice) + +; + let cp: Maybe = loadMaybe(slice, ((slice: Slice) => { + return slice.loadInt(16) + +}) +) + +; + return { + kind: 'VmControlData', + nargs: nargs, + stack: stack, + save: save, + cp: cp, +} + +; +} + +export function storeVmControlData(vmControlData: VmControlData): (builder: Builder) => void { + return ((builder: Builder) => { + storeMaybe(vmControlData.nargs, ((arg: number) => { + return ((builder: Builder) => { + builder.storeUint(arg, 13) + + }) + + + }) + )(builder) + + storeMaybe(vmControlData.stack, storeVmStack)(builder) + + storeVmSaveList(vmControlData.save)(builder) + + storeMaybe(vmControlData.cp, ((arg: number) => { + return ((builder: Builder) => { + builder.storeInt(arg, 16) + + }) + + + }) + )(builder) + +}) + +; +} + +export function loadVmCont(slice: Slice): VmCont { + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { +slice.loadUint(2) +let cdata: VmControlData = loadVmControlData(slice) + +let code: VmCellSlice = loadVmCellSlice(slice) + + return { + kind: 'VmCont_vmc_std', + cdata: cdata, + code: code, +} + +} +; + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b01))) { +slice.loadUint(2) +let cdata: VmControlData = loadVmControlData(slice) + +let slice1 = slice.loadRef().beginParse() + +let next: VmCont = loadVmCont(slice1) + + return { + kind: 'VmCont_vmc_envelope', + cdata: cdata, + next: next, +} + +} +; + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b1000))) { +slice.loadUint(4) +let exit_code: number = slice.loadInt(32) + + return { + kind: 'VmCont_vmc_quit', + exit_code: exit_code, +} + +} +; + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b1001))) { +slice.loadUint(4) + return { + kind: 'VmCont_vmc_quit_exc', +} + +} +; + if (((slice.remainingBits >= 5) && (slice.preloadUint(5) == 0b10100))) { +slice.loadUint(5) +let count: number = slice.loadUint(63) + +let slice1 = slice.loadRef().beginParse() + +let body: VmCont = loadVmCont(slice1) + +let slice2 = slice.loadRef().beginParse() + +let after: VmCont = loadVmCont(slice2) + + return { + kind: 'VmCont_vmc_repeat', + count: count, + body: body, + after: after, +} + +} +; + if (((slice.remainingBits >= 6) && (slice.preloadUint(6) == 0b110000))) { +slice.loadUint(6) +let slice1 = slice.loadRef().beginParse() + +let body: VmCont = loadVmCont(slice1) + +let slice2 = slice.loadRef().beginParse() + +let after: VmCont = loadVmCont(slice2) + + return { + kind: 'VmCont_vmc_until', + body: body, + after: after, +} + +} +; + if (((slice.remainingBits >= 6) && (slice.preloadUint(6) == 0b110001))) { +slice.loadUint(6) +let slice1 = slice.loadRef().beginParse() + +let body: VmCont = loadVmCont(slice1) + + return { + kind: 'VmCont_vmc_again', + body: body, +} + +} +; + if (((slice.remainingBits >= 6) && (slice.preloadUint(6) == 0b110010))) { +slice.loadUint(6) +let slice1 = slice.loadRef().beginParse() + +let cond: VmCont = loadVmCont(slice1) + +let slice2 = slice.loadRef().beginParse() + +let body: VmCont = loadVmCont(slice2) + +let slice3 = slice.loadRef().beginParse() + +let after: VmCont = loadVmCont(slice3) + + return { + kind: 'VmCont_vmc_while_cond', + cond: cond, + body: body, + after: after, +} + +} +; + if (((slice.remainingBits >= 6) && (slice.preloadUint(6) == 0b110011))) { +slice.loadUint(6) +let slice1 = slice.loadRef().beginParse() + +let cond: VmCont = loadVmCont(slice1) + +let slice2 = slice.loadRef().beginParse() + +let body: VmCont = loadVmCont(slice2) + +let slice3 = slice.loadRef().beginParse() + +let after: VmCont = loadVmCont(slice3) + + return { + kind: 'VmCont_vmc_while_body', + cond: cond, + body: body, + after: after, +} + +} +; + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b1111))) { +slice.loadUint(4) +let value: number = slice.loadInt(32) + +let slice1 = slice.loadRef().beginParse() + +let next: VmCont = loadVmCont(slice1) + + return { + kind: 'VmCont_vmc_pushint', + value: value, + next: next, +} + +} +; + throw new Error('') +; +} + +export function storeVmCont(vmCont: VmCont): (builder: Builder) => void { + if ((vmCont.kind == 'VmCont_vmc_std')) { + return ((builder: Builder) => { + builder.storeUint(0b00, 2) + + storeVmControlData(vmCont.cdata)(builder) + + storeVmCellSlice(vmCont.code)(builder) + +}) + +} +; + if ((vmCont.kind == 'VmCont_vmc_envelope')) { + return ((builder: Builder) => { + builder.storeUint(0b01, 2) + + storeVmControlData(vmCont.cdata)(builder) + + let cell1 = beginCell() + + + storeVmCont(vmCont.next)(cell1) + + builder.storeRef(cell1) + +}) + +} +; + if ((vmCont.kind == 'VmCont_vmc_quit')) { + return ((builder: Builder) => { + builder.storeUint(0b1000, 4) + + builder.storeInt(vmCont.exit_code, 32) + +}) + +} +; + if ((vmCont.kind == 'VmCont_vmc_quit_exc')) { + return ((builder: Builder) => { + builder.storeUint(0b1001, 4) + +}) + +} +; + if ((vmCont.kind == 'VmCont_vmc_repeat')) { + return ((builder: Builder) => { + builder.storeUint(0b10100, 5) + + builder.storeUint(vmCont.count, 63) + + let cell1 = beginCell() + + + storeVmCont(vmCont.body)(cell1) + + builder.storeRef(cell1) + + let cell2 = beginCell() + + + storeVmCont(vmCont.after)(cell2) + + builder.storeRef(cell2) + +}) + +} +; + if ((vmCont.kind == 'VmCont_vmc_until')) { + return ((builder: Builder) => { + builder.storeUint(0b110000, 6) + + let cell1 = beginCell() + + + storeVmCont(vmCont.body)(cell1) + + builder.storeRef(cell1) + + let cell2 = beginCell() + + + storeVmCont(vmCont.after)(cell2) + + builder.storeRef(cell2) + +}) + +} +; + if ((vmCont.kind == 'VmCont_vmc_again')) { + return ((builder: Builder) => { + builder.storeUint(0b110001, 6) + + let cell1 = beginCell() + + + storeVmCont(vmCont.body)(cell1) + + builder.storeRef(cell1) + +}) + +} +; + if ((vmCont.kind == 'VmCont_vmc_while_cond')) { + return ((builder: Builder) => { + builder.storeUint(0b110010, 6) + + let cell1 = beginCell() + + + storeVmCont(vmCont.cond)(cell1) + + builder.storeRef(cell1) + + let cell2 = beginCell() + + + storeVmCont(vmCont.body)(cell2) + + builder.storeRef(cell2) + + let cell3 = beginCell() + + + storeVmCont(vmCont.after)(cell3) + + builder.storeRef(cell3) + +}) + +} +; + if ((vmCont.kind == 'VmCont_vmc_while_body')) { + return ((builder: Builder) => { + builder.storeUint(0b110011, 6) + + let cell1 = beginCell() + + + storeVmCont(vmCont.cond)(cell1) + + builder.storeRef(cell1) + + let cell2 = beginCell() + + + storeVmCont(vmCont.body)(cell2) + + builder.storeRef(cell2) + + let cell3 = beginCell() + + + storeVmCont(vmCont.after)(cell3) + + builder.storeRef(cell3) + +}) + +} +; + if ((vmCont.kind == 'VmCont_vmc_pushint')) { + return ((builder: Builder) => { + builder.storeUint(0b1111, 4) + + builder.storeInt(vmCont.value, 32) + + let cell1 = beginCell() + + + storeVmCont(vmCont.next)(cell1) + + builder.storeRef(cell1) + +}) + +} +; + throw new Error('') +; +} + +export function loadDNS_RecordSet(slice: Slice): DNS_RecordSet { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xafbffed3))) { +slice.loadUint(32) +let anon0: HashmapE = loadHashmapE(slice, 256, loadDNSRecord) + + return { + kind: 'DNS_RecordSet', + anon0: anon0, +} + +} +; + throw new Error('') +; +} + +export function storeDNS_RecordSet(dNS_RecordSet: DNS_RecordSet): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xafbffed3, 32) + + storeHashmapE(dNS_RecordSet.anon0, storeDNSRecord)(builder) + +}) + +; +} + +export function loadTextChunkRef(slice: Slice, arg0: number): TextChunkRef { + if ((arg0 == 0)) { + return { + kind: 'TextChunkRef_chunk_ref_empty', +} + +} +; + if (true) { +let slice1 = slice.loadRef().beginParse() + +let ref: TextChunks = loadTextChunks(slice1, ((arg0 - 1) + 1)) + + return { + kind: 'TextChunkRef_chunk_ref', + n: (arg0 - 1), + ref: ref, +} + +} +; + throw new Error('') +; +} + +export function storeTextChunkRef(textChunkRef: TextChunkRef): (builder: Builder) => void { + if ((textChunkRef.kind == 'TextChunkRef_chunk_ref_empty')) { + return ((builder: Builder) => { +}) + +} +; + if ((textChunkRef.kind == 'TextChunkRef_chunk_ref')) { + return ((builder: Builder) => { + let cell1 = beginCell() + + + storeTextChunks(textChunkRef.ref)(cell1) + + builder.storeRef(cell1) + +}) + +} +; + throw new Error('') +; +} + +export function loadTextChunks(slice: Slice, arg0: number): TextChunks { + if ((arg0 == 0)) { + return { + kind: 'TextChunks_text_chunk_empty', +} + +} +; + if (true) { +let len: number = slice.loadUint(8) + +let data: BitString = slice.loadBits((len * 8)) + +let next: TextChunkRef = loadTextChunkRef(slice, (arg0 - 1)) + + return { + kind: 'TextChunks_text_chunk', + n: (arg0 - 1), + len: len, + data: data, + next: next, +} + +} +; + throw new Error('') +; +} + +export function storeTextChunks(textChunks: TextChunks): (builder: Builder) => void { + if ((textChunks.kind == 'TextChunks_text_chunk_empty')) { + return ((builder: Builder) => { +}) + +} +; + if ((textChunks.kind == 'TextChunks_text_chunk')) { + return ((builder: Builder) => { + builder.storeUint(textChunks.len, 8) + + builder.storeBits(textChunks.data) + + storeTextChunkRef(textChunks.next)(builder) + +}) + +} +; + throw new Error('') +; +} + +export function loadText(slice: Slice): Text { + let chunks: number = slice.loadUint(8) + +; + let rest: TextChunks = loadTextChunks(slice, chunks) + +; + return { + kind: 'Text', + chunks: chunks, + rest: rest, +} + +; +} + +export function storeText(text: Text): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(text.chunks, 8) + + storeTextChunks(text.rest)(builder) + +}) + +; +} + +export function loadDNSRecord(slice: Slice): DNSRecord { + if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x1eda))) { +slice.loadUint(16) +let _: Text = loadText(slice) + + return { + kind: 'DNSRecord_dns_text', + _: _, +} + +} +; + if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0xba93))) { +slice.loadUint(16) +let resolver: MsgAddressInt = loadMsgAddressInt(slice) + + return { + kind: 'DNSRecord_dns_next_resolver', + resolver: resolver, +} + +} +; + if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0xad01))) { +slice.loadUint(16) +let adnl_addr: BitString = slice.loadBits(256) + +let flags: number = slice.loadUint(8) + +let proto_list: ProtoList | undefined = ((flags & (1 << 0)) ? loadProtoList(slice) : undefined) + + if ((!(flags <= 1))) { +throw new Error('') + } + return { + kind: 'DNSRecord_dns_adnl_address', + adnl_addr: adnl_addr, + flags: flags, + proto_list: proto_list, +} + +} +; + if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x9fd3))) { +slice.loadUint(16) +let smc_addr: MsgAddressInt = loadMsgAddressInt(slice) + +let flags: number = slice.loadUint(8) + +let cap_list: SmcCapList | undefined = ((flags & (1 << 0)) ? loadSmcCapList(slice) : undefined) + + if ((!(flags <= 1))) { +throw new Error('') + } + return { + kind: 'DNSRecord_dns_smc_address', + smc_addr: smc_addr, + flags: flags, + cap_list: cap_list, +} + +} +; + throw new Error('') +; +} + +export function storeDNSRecord(dNSRecord: DNSRecord): (builder: Builder) => void { + if ((dNSRecord.kind == 'DNSRecord_dns_text')) { + return ((builder: Builder) => { + builder.storeUint(0x1eda, 16) + + storeText(dNSRecord._)(builder) + +}) + +} +; + if ((dNSRecord.kind == 'DNSRecord_dns_next_resolver')) { + return ((builder: Builder) => { + builder.storeUint(0xba93, 16) + + storeMsgAddressInt(dNSRecord.resolver)(builder) + +}) + +} +; + if ((dNSRecord.kind == 'DNSRecord_dns_adnl_address')) { + return ((builder: Builder) => { + builder.storeUint(0xad01, 16) + + builder.storeBits(dNSRecord.adnl_addr) + + builder.storeUint(dNSRecord.flags, 8) + + if ((dNSRecord.proto_list != undefined)) { + storeProtoList(dNSRecord.proto_list)(builder) + } + + if ((!(dNSRecord.flags <= 1))) { + throw new Error('') + } + +}) + +} +; + if ((dNSRecord.kind == 'DNSRecord_dns_smc_address')) { + return ((builder: Builder) => { + builder.storeUint(0x9fd3, 16) + + storeMsgAddressInt(dNSRecord.smc_addr)(builder) + + builder.storeUint(dNSRecord.flags, 8) + + if ((dNSRecord.cap_list != undefined)) { + storeSmcCapList(dNSRecord.cap_list)(builder) + } + + if ((!(dNSRecord.flags <= 1))) { + throw new Error('') + } + +}) + +} +; + throw new Error('') +; +} + +export function loadProtoList(slice: Slice): ProtoList { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { +slice.loadUint(1) + return { + kind: 'ProtoList_proto_list_nil', +} + +} +; + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { +slice.loadUint(1) +let head: Protocol = loadProtocol(slice) + +let tail: ProtoList = loadProtoList(slice) + + return { + kind: 'ProtoList_proto_list_next', + head: head, + tail: tail, +} + +} +; + throw new Error('') +; +} + +export function storeProtoList(protoList: ProtoList): (builder: Builder) => void { + if ((protoList.kind == 'ProtoList_proto_list_nil')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1) + +}) + +} +; + if ((protoList.kind == 'ProtoList_proto_list_next')) { + return ((builder: Builder) => { + builder.storeUint(0b1, 1) + + storeProtocol(protoList.head)(builder) + + storeProtoList(protoList.tail)(builder) + +}) + +} +; + throw new Error('') +; +} + +export function loadProtocol(slice: Slice): Protocol { + if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x4854))) { +slice.loadUint(16) + return { + kind: 'Protocol', +} + +} +; + throw new Error('') +; +} + +export function storeProtocol(protocol: Protocol): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x4854, 16) + +}) + +; +} + +export function loadSmcCapList(slice: Slice): SmcCapList { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { +slice.loadUint(1) + return { + kind: 'SmcCapList_cap_list_nil', +} + +} +; + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { +slice.loadUint(1) +let head: SmcCapability = loadSmcCapability(slice) + +let tail: SmcCapList = loadSmcCapList(slice) + + return { + kind: 'SmcCapList_cap_list_next', + head: head, + tail: tail, +} + +} +; + throw new Error('') +; +} + +export function storeSmcCapList(smcCapList: SmcCapList): (builder: Builder) => void { + if ((smcCapList.kind == 'SmcCapList_cap_list_nil')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1) + +}) + +} +; + if ((smcCapList.kind == 'SmcCapList_cap_list_next')) { + return ((builder: Builder) => { + builder.storeUint(0b1, 1) + + storeSmcCapability(smcCapList.head)(builder) + + storeSmcCapList(smcCapList.tail)(builder) + +}) + +} +; + throw new Error('') +; +} + +export function loadSmcCapability(slice: Slice): SmcCapability { + if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x5371))) { +slice.loadUint(16) + return { + kind: 'SmcCapability_cap_method_seqno', +} + +} +; + if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x71f4))) { +slice.loadUint(16) + return { + kind: 'SmcCapability_cap_method_pubkey', +} + +} +; + if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x2177))) { +slice.loadUint(16) + return { + kind: 'SmcCapability_cap_is_wallet', +} + +} +; + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xff))) { +slice.loadUint(8) +let name: Text = loadText(slice) + + return { + kind: 'SmcCapability_cap_name', + name: name, +} + +} +; + throw new Error('') +; +} + +export function storeSmcCapability(smcCapability: SmcCapability): (builder: Builder) => void { + if ((smcCapability.kind == 'SmcCapability_cap_method_seqno')) { + return ((builder: Builder) => { + builder.storeUint(0x5371, 16) + +}) + +} +; + if ((smcCapability.kind == 'SmcCapability_cap_method_pubkey')) { + return ((builder: Builder) => { + builder.storeUint(0x71f4, 16) + +}) + +} +; + if ((smcCapability.kind == 'SmcCapability_cap_is_wallet')) { + return ((builder: Builder) => { + builder.storeUint(0x2177, 16) + +}) + +} +; + if ((smcCapability.kind == 'SmcCapability_cap_name')) { + return ((builder: Builder) => { + builder.storeUint(0xff, 8) + + storeText(smcCapability.name)(builder) + +}) + +} +; + throw new Error('') +; +} + +export function loadChanConfig(slice: Slice): ChanConfig { + let init_timeout: number = slice.loadUint(32) + +; + let close_timeout: number = slice.loadUint(32) + +; + let a_key: BitString = slice.loadBits(256) + +; + let b_key: BitString = slice.loadBits(256) + +; + let slice1 = slice.loadRef().beginParse() + +; + let a_addr: MsgAddressInt = loadMsgAddressInt(slice1) + +; + let slice2 = slice.loadRef().beginParse() + +; + let b_addr: MsgAddressInt = loadMsgAddressInt(slice2) + +; + let channel_id: number = slice.loadUint(64) + +; + let min_A_extra: Grams = loadGrams(slice) + +; + return { + kind: 'ChanConfig', + init_timeout: init_timeout, + close_timeout: close_timeout, + a_key: a_key, + b_key: b_key, + a_addr: a_addr, + b_addr: b_addr, + channel_id: channel_id, + min_A_extra: min_A_extra, +} + +; +} + +export function storeChanConfig(chanConfig: ChanConfig): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(chanConfig.init_timeout, 32) + + builder.storeUint(chanConfig.close_timeout, 32) + + builder.storeBits(chanConfig.a_key) + + builder.storeBits(chanConfig.b_key) + + let cell1 = beginCell() + + + storeMsgAddressInt(chanConfig.a_addr)(cell1) + + builder.storeRef(cell1) + + let cell2 = beginCell() + + + storeMsgAddressInt(chanConfig.b_addr)(cell2) + + builder.storeRef(cell2) + + builder.storeUint(chanConfig.channel_id, 64) + + storeGrams(chanConfig.min_A_extra)(builder) + +}) + +; +} + +export function loadChanState(slice: Slice): ChanState { + if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b000))) { +slice.loadUint(3) +let signed_A: Bool = loadBool(slice) + +let signed_B: Bool = loadBool(slice) + +let min_A: Grams = loadGrams(slice) + +let min_B: Grams = loadGrams(slice) + +let expire_at: number = slice.loadUint(32) + +let A: Grams = loadGrams(slice) + +let B: Grams = loadGrams(slice) + + return { + kind: 'ChanState_chan_state_init', + signed_A: signed_A, + signed_B: signed_B, + min_A: min_A, + min_B: min_B, + expire_at: expire_at, + A: A, + B: B, +} + +} +; + if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b001))) { +slice.loadUint(3) +let signed_A: Bool = loadBool(slice) + +let signed_B: Bool = loadBool(slice) + +let promise_A: Grams = loadGrams(slice) + +let promise_B: Grams = loadGrams(slice) + +let expire_at: number = slice.loadUint(32) + +let A: Grams = loadGrams(slice) + +let B: Grams = loadGrams(slice) + + return { + kind: 'ChanState_chan_state_close', + signed_A: signed_A, + signed_B: signed_B, + promise_A: promise_A, + promise_B: promise_B, + expire_at: expire_at, + A: A, + B: B, +} + +} +; + if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b010))) { +slice.loadUint(3) +let A: Grams = loadGrams(slice) + +let B: Grams = loadGrams(slice) + + return { + kind: 'ChanState_chan_state_payout', + A: A, + B: B, +} + +} +; + throw new Error('') +; +} + +export function storeChanState(chanState: ChanState): (builder: Builder) => void { + if ((chanState.kind == 'ChanState_chan_state_init')) { + return ((builder: Builder) => { + builder.storeUint(0b000, 3) + + storeBool(chanState.signed_A)(builder) + + storeBool(chanState.signed_B)(builder) + + storeGrams(chanState.min_A)(builder) + + storeGrams(chanState.min_B)(builder) + + builder.storeUint(chanState.expire_at, 32) + + storeGrams(chanState.A)(builder) + + storeGrams(chanState.B)(builder) + +}) + +} +; + if ((chanState.kind == 'ChanState_chan_state_close')) { + return ((builder: Builder) => { + builder.storeUint(0b001, 3) + + storeBool(chanState.signed_A)(builder) + + storeBool(chanState.signed_B)(builder) + + storeGrams(chanState.promise_A)(builder) + + storeGrams(chanState.promise_B)(builder) + + builder.storeUint(chanState.expire_at, 32) + + storeGrams(chanState.A)(builder) + + storeGrams(chanState.B)(builder) + +}) + +} +; + if ((chanState.kind == 'ChanState_chan_state_payout')) { + return ((builder: Builder) => { + builder.storeUint(0b010, 3) + + storeGrams(chanState.A)(builder) + + storeGrams(chanState.B)(builder) + +}) + +} +; + throw new Error('') +; +} + +export function loadChanPromise(slice: Slice): ChanPromise { + let channel_id: number = slice.loadUint(64) + +; + let promise_A: Grams = loadGrams(slice) + +; + let promise_B: Grams = loadGrams(slice) + +; + return { + kind: 'ChanPromise', + channel_id: channel_id, + promise_A: promise_A, + promise_B: promise_B, +} + +; +} + +export function storeChanPromise(chanPromise: ChanPromise): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(chanPromise.channel_id, 64) + + storeGrams(chanPromise.promise_A)(builder) + + storeGrams(chanPromise.promise_B)(builder) + +}) + +; +} + +export function loadChanSignedPromise(slice: Slice): ChanSignedPromise { + let sig: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() + + + return slice1.loadBits(512) + +}) +) + +; + let promise: ChanPromise = loadChanPromise(slice) + +; + return { + kind: 'ChanSignedPromise', + sig: sig, + promise: promise, +} + +; +} + +export function storeChanSignedPromise(chanSignedPromise: ChanSignedPromise): (builder: Builder) => void { + return ((builder: Builder) => { + storeMaybe(chanSignedPromise.sig, ((arg: BitString) => { + return ((builder: Builder) => { + let cell1 = beginCell() + + + cell1.storeBits(arg) + + builder.storeRef(cell1) + + + }) + + + }) + )(builder) + + storeChanPromise(chanSignedPromise.promise)(builder) + +}) + +; +} + +export function loadChanMsg(slice: Slice): ChanMsg { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x27317822))) { +slice.loadUint(32) +let inc_A: Grams = loadGrams(slice) + +let inc_B: Grams = loadGrams(slice) + +let min_A: Grams = loadGrams(slice) + +let min_B: Grams = loadGrams(slice) + +let channel_id: number = slice.loadUint(64) + + return { + kind: 'ChanMsg_chan_msg_init', + inc_A: inc_A, + inc_B: inc_B, + min_A: min_A, + min_B: min_B, + channel_id: channel_id, +} + +} +; + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xf28ae183))) { +slice.loadUint(32) +let extra_A: Grams = loadGrams(slice) + +let extra_B: Grams = loadGrams(slice) + +let promise: ChanSignedPromise = loadChanSignedPromise(slice) + + return { + kind: 'ChanMsg_chan_msg_close', + extra_A: extra_A, + extra_B: extra_B, + promise: promise, +} + +} +; + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x43278a28))) { +slice.loadUint(32) + return { + kind: 'ChanMsg_chan_msg_timeout', +} + +} +; + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x37fe7810))) { +slice.loadUint(32) + return { + kind: 'ChanMsg_chan_msg_payout', +} + +} +; + throw new Error('') +; +} + +export function storeChanMsg(chanMsg: ChanMsg): (builder: Builder) => void { + if ((chanMsg.kind == 'ChanMsg_chan_msg_init')) { + return ((builder: Builder) => { + builder.storeUint(0x27317822, 32) + + storeGrams(chanMsg.inc_A)(builder) + + storeGrams(chanMsg.inc_B)(builder) + + storeGrams(chanMsg.min_A)(builder) + + storeGrams(chanMsg.min_B)(builder) + + builder.storeUint(chanMsg.channel_id, 64) + +}) + +} +; + if ((chanMsg.kind == 'ChanMsg_chan_msg_close')) { + return ((builder: Builder) => { + builder.storeUint(0xf28ae183, 32) + + storeGrams(chanMsg.extra_A)(builder) + + storeGrams(chanMsg.extra_B)(builder) + + storeChanSignedPromise(chanMsg.promise)(builder) + +}) + +} +; + if ((chanMsg.kind == 'ChanMsg_chan_msg_timeout')) { + return ((builder: Builder) => { + builder.storeUint(0x43278a28, 32) + +}) + +} +; + if ((chanMsg.kind == 'ChanMsg_chan_msg_payout')) { + return ((builder: Builder) => { + builder.storeUint(0x37fe7810, 32) + +}) + +} +; + throw new Error('') +; +} + +export function loadChanSignedMsg(slice: Slice): ChanSignedMsg { + let sig_A: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() + + + return slice1.loadBits(512) + +}) +) + +; + let sig_B: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() + + + return slice1.loadBits(512) + +}) +) + +; + let msg: ChanMsg = loadChanMsg(slice) + +; + return { + kind: 'ChanSignedMsg', + sig_A: sig_A, + sig_B: sig_B, + msg: msg, +} + +; +} + +export function storeChanSignedMsg(chanSignedMsg: ChanSignedMsg): (builder: Builder) => void { + return ((builder: Builder) => { + storeMaybe(chanSignedMsg.sig_A, ((arg: BitString) => { + return ((builder: Builder) => { + let cell1 = beginCell() + + + cell1.storeBits(arg) + + builder.storeRef(cell1) + + + }) + + + }) + )(builder) + + storeMaybe(chanSignedMsg.sig_B, ((arg: BitString) => { + return ((builder: Builder) => { + let cell1 = beginCell() + + + cell1.storeBits(arg) + + builder.storeRef(cell1) + + + }) + + + }) + )(builder) + + storeChanMsg(chanSignedMsg.msg)(builder) + +}) + +; +} + +export function loadChanOp(slice: Slice): ChanOp { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x912838d1))) { +slice.loadUint(32) +let msg: ChanSignedMsg = loadChanSignedMsg(slice) + + return { + kind: 'ChanOp', + msg: msg, +} + +} +; + throw new Error('') +; +} + +export function storeChanOp(chanOp: ChanOp): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x912838d1, 32) + + storeChanSignedMsg(chanOp.msg)(builder) + +}) + +; +} + +export function loadChanData(slice: Slice): ChanData { + let slice1 = slice.loadRef().beginParse() + +; + let config: ChanConfig = loadChanConfig(slice1) + +; + let slice2 = slice.loadRef().beginParse() + +; + let state: ChanState = loadChanState(slice2) + +; + return { + kind: 'ChanData', + config: config, + state: state, +} + +; +} + +export function storeChanData(chanData: ChanData): (builder: Builder) => void { + return ((builder: Builder) => { + let cell1 = beginCell() + + + storeChanConfig(chanData.config)(cell1) + + builder.storeRef(cell1) + + let cell2 = beginCell() + + + storeChanState(chanData.state)(cell2) + + builder.storeRef(cell2) + +}) + +; +} diff --git a/generated_test.ts b/generated_test.ts index d4ed8a3..35ab436 100644 --- a/generated_test.ts +++ b/generated_test.ts @@ -2,214 +2,2947 @@ import { Builder } from 'ton' import { Slice } from 'ton' import { beginCell } from 'ton' import { BitString } from 'ton' +export interface Simple { +readonly kind: 'Simple' +readonly a: number +readonly b: number +} + +export type TwoConstructors = TwoConstructors_bool_false | TwoConstructors_bool_true; + +export interface TwoConstructors_bool_false { +readonly kind: 'TwoConstructors_bool_false' +readonly a: number +readonly b: number +readonly c: number +} + +export interface TwoConstructors_bool_true { +readonly kind: 'TwoConstructors_bool_true' +readonly b: number +} + +export interface FixedIntParam { +readonly kind: 'FixedIntParam' +readonly y: number +} + +export interface TypedField { +readonly kind: 'TypedField' +readonly y: FixedIntParam +readonly c: number +} + +export interface SharpConstructor { +readonly kind: 'SharpConstructor' +readonly y: FixedIntParam +readonly c: number +} + +export type Maybe = Maybe_nothing | Maybe_just; + +export interface Maybe_nothing { +readonly kind: 'Maybe_nothing' +} + +export interface Maybe_just { +readonly kind: 'Maybe_just' +readonly value: TheType +} + +export interface TypedParam { +readonly kind: 'TypedParam' +readonly x: Maybe +} + +export type Either = Either_left | Either_right; + +export interface Either_left { +readonly kind: 'Either_left' +readonly value: X +} + +export interface Either_right { +readonly kind: 'Either_right' +readonly value: Y +} + +export interface BitLenArg { +readonly kind: 'BitLenArg' +readonly x: number +readonly value: number +} + +export interface BitLenArgUser { +readonly kind: 'BitLenArgUser' +readonly t: BitLenArg +} + +export interface ExprArg { +readonly kind: 'ExprArg' +readonly x: number +readonly value: number +} + +export interface ExprArgUser { +readonly kind: 'ExprArgUser' +readonly t: ExprArg +} + +export interface ComplexTypedField { +readonly kind: 'ComplexTypedField' +readonly a: ExprArgUser +} + +export interface CellTypedField { +readonly kind: 'CellTypedField' +readonly a: ExprArgUser +} + +export interface CellsSimple { +readonly kind: 'CellsSimple' +readonly t: number +readonly q: number +readonly a: number +readonly e: number +readonly b: number +readonly d: number +readonly c: number +} + +export interface IntBits { +readonly kind: 'IntBits' +readonly d: number +readonly g: BitString +readonly arg: Arg +readonly x: Slice +} + +export interface IntBitsInside { +readonly kind: 'IntBitsInside' +readonly x: number +readonly a: IntBits +} + +export interface IntBitsOutside { +readonly kind: 'IntBitsOutside' +readonly x: IntBitsInside +} + +export interface IntBitsParametrized { +readonly kind: 'IntBitsParametrized' +readonly e: number +readonly h: number +readonly f: number +readonly i: BitString +readonly j: number +readonly k: number +readonly tc: Slice +} + +export interface IntBitsParametrizedInside { +readonly kind: 'IntBitsParametrizedInside' +readonly x: number +readonly a: IntBitsParametrized +} + +export interface IntBitsParametrizedOutside { +readonly kind: 'IntBitsParametrizedOutside' +readonly x: IntBitsParametrizedInside +} + +export interface LessThan { +readonly kind: 'LessThan' +readonly x: number +readonly y: number +} + +export interface OneComb { +readonly kind: 'OneComb' +readonly t: number +readonly x: A +} + +export interface ManyComb { +readonly kind: 'ManyComb' +readonly y: OneComb>> +} + +export type Unary = Unary_unary_zero | Unary_unary_succ; + +export interface Unary_unary_zero { +readonly kind: 'Unary_unary_zero' +} + +export interface Unary_unary_succ { +readonly kind: 'Unary_unary_succ' +readonly n: number +readonly x: Unary +} + +export type ParamConst = ParamConst_b | ParamConst_c | ParamConst_a | ParamConst_d; + +export interface ParamConst_b { +readonly kind: 'ParamConst_b' +readonly m: number +readonly k: number +} + +export interface ParamConst_c { +readonly kind: 'ParamConst_c' +readonly n: number +readonly m: number +readonly k: number +} + +export interface ParamConst_a { +readonly kind: 'ParamConst_a' +readonly n: number +} + +export interface ParamConst_d { +readonly kind: 'ParamConst_d' +readonly n: number +readonly m: number +readonly k: number +readonly l: number +} + +export type ParamDifNames = ParamDifNames_a | ParamDifNames_b | ParamDifNames_c | ParamDifNames_d; + +export interface ParamDifNames_a { +readonly kind: 'ParamDifNames_a' +} + +export interface ParamDifNames_b { +readonly kind: 'ParamDifNames_b' +} + +export interface ParamDifNames_c { +readonly kind: 'ParamDifNames_c' +readonly n: number +readonly x: ParamDifNames +} + +export interface ParamDifNames_d { +readonly kind: 'ParamDifNames_d' +readonly m: number +readonly x: ParamDifNames +} + +export interface ParamDifNamesUser { +readonly kind: 'ParamDifNamesUser' +readonly k: number +readonly x: ParamDifNames +} + +export interface NegationFromImplicit { +readonly kind: 'NegationFromImplicit' +readonly y: number +readonly t: number +readonly z: number +} + +export interface UnaryUserCheckOrder { +readonly kind: 'UnaryUserCheckOrder' +readonly l: number +readonly m: number +readonly label: Unary +} + +export interface CombArgCellRef { +readonly kind: 'CombArgCellRef' +readonly info: number +readonly init: Maybe> +readonly other: Either> +readonly body: Either +} + +export interface CombArgCellRefUser { +readonly kind: 'CombArgCellRefUser' +readonly x: CombArgCellRef +} + +export interface MathExprAsCombArg { +readonly kind: 'MathExprAsCombArg' +readonly n: number +readonly ref: BitLenArg +} + +export interface EmptyTag { +readonly kind: 'EmptyTag' +readonly a: number +} + +export interface SharpTag { +readonly kind: 'SharpTag' +readonly x: number +} + +export interface DollarTag { +readonly kind: 'DollarTag' +readonly x: number +} + +export interface TupleCheck { +readonly kind: 'TupleCheck' +readonly s: Array +} + +export interface Hashmap { +readonly kind: 'Hashmap' +readonly n: number +readonly l: number +readonly m: number +readonly label: HmLabel +readonly node: HashmapNode +} + +export type HashmapNode = HashmapNode_hmn_leaf | HashmapNode_hmn_fork; + +export interface HashmapNode_hmn_leaf { +readonly kind: 'HashmapNode_hmn_leaf' +readonly value: X +} + +export interface HashmapNode_hmn_fork { +readonly kind: 'HashmapNode_hmn_fork' +readonly n: number +readonly left: Hashmap +readonly right: Hashmap +} + +export type HmLabel = HmLabel_hml_short | HmLabel_hml_long | HmLabel_hml_same; + +export interface HmLabel_hml_short { +readonly kind: 'HmLabel_hml_short' +readonly m: number +readonly n: number +readonly len: Unary +readonly s: Array +} + +export interface HmLabel_hml_long { +readonly kind: 'HmLabel_hml_long' +readonly m: number +readonly n: number +readonly s: Array +} + +export interface HmLabel_hml_same { +readonly kind: 'HmLabel_hml_same' +readonly m: number +readonly v: BitString +readonly n: number +} + +export type HashmapE = HashmapE_hme_empty | HashmapE_hme_root; + +export interface HashmapE_hme_empty { +readonly kind: 'HashmapE_hme_empty' +readonly n: number +} + +export interface HashmapE_hme_root { +readonly kind: 'HashmapE_hme_root' +readonly n: number +readonly root: Hashmap +} + +export interface HashmapEUser { +readonly kind: 'HashmapEUser' +readonly x: HashmapE +} + +export interface ConditionalField { +readonly kind: 'ConditionalField' +readonly a: number +readonly b: number | undefined +} + +export interface BitSelection { +readonly kind: 'BitSelection' +readonly a: number +readonly b: number | undefined +} + +export interface ImplicitCondition { +readonly kind: 'ImplicitCondition' +readonly flags: number +} + +export type MultipleEmptyConstructor = MultipleEmptyConstructor__ | MultipleEmptyConstructor__1 | MultipleEmptyConstructor_a; + +export interface MultipleEmptyConstructor__ { +readonly kind: 'MultipleEmptyConstructor__' +readonly a: number +} + +export interface MultipleEmptyConstructor__1 { +readonly kind: 'MultipleEmptyConstructor__1' +readonly b: number +} + +export interface MultipleEmptyConstructor_a { +readonly kind: 'MultipleEmptyConstructor_a' +readonly x: number +} + +export interface True { +readonly kind: 'True' +} + +export type ParamNamedArgInSecondConstr = ParamNamedArgInSecondConstr_a | ParamNamedArgInSecondConstr_b; + +export interface ParamNamedArgInSecondConstr_a { +readonly kind: 'ParamNamedArgInSecondConstr_a' +readonly n: number +} + +export interface ParamNamedArgInSecondConstr_b { +readonly kind: 'ParamNamedArgInSecondConstr_b' +readonly n: number +} + +export interface RefCombinatorAny { +readonly kind: 'RefCombinatorAny' +readonly msg: Maybe +} + +export interface EqualityExpression { +readonly kind: 'EqualityExpression' +readonly n: number +} + +export interface ConditionalRef { +readonly kind: 'ConditionalRef' +readonly x: number +readonly y: Simple | undefined +} + +export interface LoadFromNegationOutsideExpr { +readonly kind: 'LoadFromNegationOutsideExpr' +readonly seq_no: number +readonly prev_seq_no: number +} + +export interface AnonymousData { +readonly kind: 'AnonymousData' +readonly anon0: number +} + +export interface FalseAnonField { +readonly kind: 'FalseAnonField' +readonly value: number +} + +export type ConstructorOrder = ConstructorOrder__ | ConstructorOrder_a; + +export interface ConstructorOrder__ { +readonly kind: 'ConstructorOrder__' +readonly anon0: Simple +} + +export interface ConstructorOrder_a { +readonly kind: 'ConstructorOrder_a' +readonly a: Simple +} + +export type CheckCrc32 = CheckCrc32_a | CheckCrc32_b; + +export interface CheckCrc32_a { +readonly kind: 'CheckCrc32_a' +readonly a: number +} + +export interface CheckCrc32_b { +readonly kind: 'CheckCrc32_b' +readonly b: number +readonly c: number +} + +export interface CheckKeyword { +readonly kind: 'CheckKeyword' +readonly const0: number +} + +export function bitLen(n: number) { + return n.toString(2).length; +; +} + +export function loadSimple(slice: Slice): Simple { + let a: number = slice.loadUint(32) + +; + let b: number = slice.loadUint(32) + +; + return { + kind: 'Simple', + a: a, + b: b, +} +; +} +export function storeSimple(simple: Simple): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(simple.a, 32) + builder.storeUint(simple.b, 32) + +}) + +; +} +export function loadTwoConstructors(slice: Slice): TwoConstructors { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { +slice.loadUint(1) +let a: number = slice.loadUint(32) +let b: number = slice.loadUint(7) +let c: number = slice.loadUint(32) + return { + kind: 'TwoConstructors_bool_false', + a: a, + b: b, + c: c, +} +} +; + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { +slice.loadUint(1) +let b: number = slice.loadUint(32) + return { + kind: 'TwoConstructors_bool_true', + b: b, +} +} +; + throw new Error('') +; +} +export function storeTwoConstructors(twoConstructors: TwoConstructors): (builder: Builder) => void { + if ((twoConstructors.kind == 'TwoConstructors_bool_false')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1) + builder.storeUint(twoConstructors.a, 32) + builder.storeUint(twoConstructors.b, 7) + builder.storeUint(twoConstructors.c, 32) +}) +} +; + if ((twoConstructors.kind == 'TwoConstructors_bool_true')) { + return ((builder: Builder) => { + builder.storeUint(0b1, 1) + builder.storeUint(twoConstructors.b, 32) +}) +} +; + throw new Error('') +; +} +export function loadFixedIntParam(slice: Slice): FixedIntParam { + let y: number = slice.loadUint(5) +; + return { + kind: 'FixedIntParam', + y: y, +} +; +} +export function storeFixedIntParam(fixedIntParam: FixedIntParam): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(fixedIntParam.y, 5) +}) +; +} +export function loadTypedField(slice: Slice): TypedField { + let y: FixedIntParam = loadFixedIntParam(slice) +; + let c: number = slice.loadUint(32) +; + return { + kind: 'TypedField', + y: y, + c: c, +} +; +} +export function storeTypedField(typedField: TypedField): (builder: Builder) => void { + return ((builder: Builder) => { + storeFixedIntParam(typedField.y)(builder) + builder.storeUint(typedField.c, 32) +}) +; +} +export function loadSharpConstructor(slice: Slice): SharpConstructor { + let y: FixedIntParam = loadFixedIntParam(slice) +; + let c: number = slice.loadUint(32) +; + return { + kind: 'SharpConstructor', + y: y, + c: c, +} +; +} +export function storeSharpConstructor(sharpConstructor: SharpConstructor): (builder: Builder) => void { + return ((builder: Builder) => { + storeFixedIntParam(sharpConstructor.y)(builder) + builder.storeUint(sharpConstructor.c, 32) +}) +; +} +export function loadMaybe(slice: Slice, loadTheType: (slice: Slice) => TheType +): Maybe { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { +slice.loadUint(1) + return { + kind: 'Maybe_nothing', +} +} +; + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { +slice.loadUint(1) +let value: TheType = loadTheType(slice) + return { + kind: 'Maybe_just', + value: value, +} +} +; + throw new Error('') +; +} +export function storeMaybe(maybe: Maybe, storeTheType: (theType: TheType) => (builder: Builder) => void +): (builder: Builder) => void { + if ((maybe.kind == 'Maybe_nothing')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1) +}) +} +; + if ((maybe.kind == 'Maybe_just')) { + return ((builder: Builder) => { + builder.storeUint(0b1, 1) + storeTheType(maybe.value)(builder) +}) +} +; + throw new Error('') +; +} +export function loadTypedParam(slice: Slice): TypedParam { + let x: Maybe = loadMaybe(slice, loadSharpConstructor) +; + return { + kind: 'TypedParam', + x: x, +} +; +} +export function storeTypedParam(typedParam: TypedParam): (builder: Builder) => void { + return ((builder: Builder) => { + storeMaybe(typedParam.x, storeSharpConstructor)(builder) +}) +; +} +export function loadEither(slice: Slice, loadX: (slice: Slice) => X +, loadY: (slice: Slice) => Y +): Either { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { +slice.loadUint(1) +let value: X = loadX(slice) + return { + kind: 'Either_left', + value: value, +} +} +; + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { +slice.loadUint(1) +let value: Y = loadY(slice) + return { + kind: 'Either_right', + value: value, +} +} +; + throw new Error('') +; +} +export function storeEither(either: Either, storeX: (x: X) => (builder: Builder) => void +, storeY: (y: Y) => (builder: Builder) => void +): (builder: Builder) => void { + if ((either.kind == 'Either_left')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1) + storeX(either.value)(builder) +}) +} +; + if ((either.kind == 'Either_right')) { + return ((builder: Builder) => { + builder.storeUint(0b1, 1) + storeY(either.value)(builder) +}) +} +; + throw new Error('') +; +} +export function loadBitLenArg(slice: Slice, x: number): BitLenArg { + let value: number = slice.loadUint(x) +; + return { + kind: 'BitLenArg', + x: x, + value: value, +} +; +} +export function storeBitLenArg(bitLenArg: BitLenArg): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(bitLenArg.value, bitLenArg.x) +}) +; +} +export function loadBitLenArgUser(slice: Slice): BitLenArgUser { + let t: BitLenArg = loadBitLenArg(slice, 4) +; + return { + kind: 'BitLenArgUser', + t: t, +} +; +} +export function storeBitLenArgUser(bitLenArgUser: BitLenArgUser): (builder: Builder) => void { + return ((builder: Builder) => { + storeBitLenArg(bitLenArgUser.t)(builder) +}) +; +} +export function loadExprArg(slice: Slice, arg0: number): ExprArg { + let value: number = slice.loadUint((arg0 - 2)) +; + return { + kind: 'ExprArg', + x: (arg0 - 2), + value: value, +} +; +} +export function storeExprArg(exprArg: ExprArg): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(exprArg.value, exprArg.x) +}) +; +} +export function loadExprArgUser(slice: Slice): ExprArgUser { + let t: ExprArg = loadExprArg(slice, 6) +; + return { + kind: 'ExprArgUser', + t: t, +} +; +} +export function storeExprArgUser(exprArgUser: ExprArgUser): (builder: Builder) => void { + return ((builder: Builder) => { + storeExprArg(exprArgUser.t)(builder) +}) +; +} +export function loadComplexTypedField(slice: Slice): ComplexTypedField { + let a: ExprArgUser = loadExprArgUser(slice) +; + return { + kind: 'ComplexTypedField', + a: a, +} +; +} +export function storeComplexTypedField(complexTypedField: ComplexTypedField): (builder: Builder) => void { + return ((builder: Builder) => { + storeExprArgUser(complexTypedField.a)(builder) +}) +; +} +export function loadCellTypedField(slice: Slice): CellTypedField { + let slice1 = slice.loadRef().beginParse() +; + let a: ExprArgUser = loadExprArgUser(slice1) +; + return { + kind: 'CellTypedField', + a: a, +} +; +} +export function storeCellTypedField(_cellTypedField: CellTypedField): (builder: Builder) => void { + return ((builder: Builder) => { + let cell1 = beginCell() + storeExprArgUser(_cellTypedField.a)(cell1) + builder.storeRef(cell1) +}) +; +} +export function loadCellsSimple(slice: Slice): CellsSimple { + let t: number = slice.loadUint(32) +; + let slice1 = slice.loadRef().beginParse() +; + let q: number = slice1.loadUint(32) +; + let slice2 = slice.loadRef().beginParse() +; + let a: number = slice2.loadUint(32) +; + let slice21 = slice2.loadRef().beginParse() +; + let e: number = slice21.loadUint(32) +; + let slice22 = slice2.loadRef().beginParse() +; + let b: number = slice22.loadUint(32) +; + let d: number = slice22.loadUint(32) +; + let slice221 = slice22.loadRef().beginParse() +; + let c: number = slice221.loadUint(32) +; + return { + kind: 'CellsSimple', + t: t, + q: q, + a: a, + e: e, + b: b, + d: d, + c: c, +} +; +} +export function storeCellsSimple(_cellsSimple: CellsSimple): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(_cellsSimple.t, 32) + let cell1 = beginCell() + cell1.storeUint(_cellsSimple.q, 32) + builder.storeRef(cell1) + let cell2 = beginCell() + cell2.storeUint(_cellsSimple.a, 32) + let cell21 = beginCell() + cell21.storeUint(_cellsSimple.e, 32) + cell2.storeRef(cell21) + let cell22 = beginCell() + cell22.storeUint(_cellsSimple.b, 32) + cell22.storeUint(_cellsSimple.d, 32) + let cell221 = beginCell() + cell221.storeUint(_cellsSimple.c, 32) + cell22.storeRef(cell221) + cell2.storeRef(cell22) + builder.storeRef(cell2) +}) +; +} +export function loadIntBits(slice: Slice, loadArg: (slice: Slice) => Arg +): IntBits { + let d: number = slice.loadInt(11) +; + let g: BitString = slice.loadBits(2) +; + let arg: Arg = loadArg(slice) +; + let x: Slice = slice +; + return { + kind: 'IntBits', + d: d, + g: g, + arg: arg, + x: x, +} +; +} +export function storeIntBits(intBits: IntBits, storeArg: (arg: Arg) => (builder: Builder) => void +): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeInt(intBits.d, 11) + builder.storeBits(intBits.g) + storeArg(intBits.arg)(builder) + builder.storeSlice(intBits.x) +}) +; +} +export function loadIntBitsInside(slice: Slice, arg0: number): IntBitsInside { + let a: IntBits = loadIntBits(slice, ((slice: Slice) => { + return slice.loadInt((1 + (arg0 / 2))) +}) +) +; + return { + kind: 'IntBitsInside', + x: (arg0 / 2), + a: a, +} +; +} +export function storeIntBitsInside(intBitsInside: IntBitsInside): (builder: Builder) => void { + return ((builder: Builder) => { + storeIntBits(intBitsInside.a, ((arg: number) => { + return ((builder: Builder) => { + builder.storeInt(arg, (1 + intBitsInside.x)) + }) + }) + )(builder) +}) +; +} +export function loadIntBitsOutside(slice: Slice): IntBitsOutside { + let x: IntBitsInside = loadIntBitsInside(slice, 6) +; + return { + kind: 'IntBitsOutside', + x: x, +} +; +} +export function storeIntBitsOutside(intBitsOutside: IntBitsOutside): (builder: Builder) => void { + return ((builder: Builder) => { + storeIntBitsInside(intBitsOutside.x)(builder) +}) +; +} +export function loadIntBitsParametrized(slice: Slice, e: number): IntBitsParametrized { + let h: number = slice.loadInt((e * 8)) +; + let f: number = slice.loadUint((7 * e)) +; + let i: BitString = slice.loadBits((5 + e)) +; + let j: number = slice.loadInt(5) +; + let k: number = slice.loadUint(e) +; + let tc: Slice = slice +; + return { + kind: 'IntBitsParametrized', + e: e, + h: h, + f: f, + i: i, + j: j, + k: k, + tc: tc, +} +; +} +export function storeIntBitsParametrized(intBitsParametrized: IntBitsParametrized): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeInt(intBitsParametrized.h, (intBitsParametrized.e * 8)) + builder.storeUint(intBitsParametrized.f, (7 * intBitsParametrized.e)) + builder.storeBits(intBitsParametrized.i) + builder.storeInt(intBitsParametrized.j, 5) + builder.storeUint(intBitsParametrized.k, intBitsParametrized.e) + builder.storeSlice(intBitsParametrized.tc) +}) +; +} +export function loadIntBitsParametrizedInside(slice: Slice, x: number): IntBitsParametrizedInside { + let a: IntBitsParametrized = loadIntBitsParametrized(slice, x) +; + return { + kind: 'IntBitsParametrizedInside', + x: x, + a: a, +} +; +} +export function storeIntBitsParametrizedInside(intBitsParametrizedInside: IntBitsParametrizedInside): (builder: Builder) => void { + return ((builder: Builder) => { + storeIntBitsParametrized(intBitsParametrizedInside.a)(builder) +}) +; +} +export function loadIntBitsParametrizedOutside(slice: Slice): IntBitsParametrizedOutside { + let x: IntBitsParametrizedInside = loadIntBitsParametrizedInside(slice, 5) +; + return { + kind: 'IntBitsParametrizedOutside', + x: x, +} +; +} +export function storeIntBitsParametrizedOutside(intBitsParametrizedOutside: IntBitsParametrizedOutside): (builder: Builder) => void { + return ((builder: Builder) => { + storeIntBitsParametrizedInside(intBitsParametrizedOutside.x)(builder) +}) +; +} +export function loadLessThan(slice: Slice): LessThan { + let x: number = slice.loadUint(bitLen((4 - 1))) +; + let y: number = slice.loadUint(bitLen(4)) +; + return { + kind: 'LessThan', + x: x, + y: y, +} + +; +} + +export function storeLessThan(lessThan: LessThan): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(lessThan.x, bitLen((4 - 1))) + + builder.storeUint(lessThan.y, bitLen(4)) + +}) + +; +} + +export function loadOneComb(slice: Slice, loadA: (slice: Slice) => A +): OneComb { + let t: number = slice.loadUint(32) + +; + let x: A = loadA(slice) + +; + return { + kind: 'OneComb', + t: t, + x: x, +} + +; +} + +export function storeOneComb(oneComb: OneComb, storeA: (a: A) => (builder: Builder) => void + +): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(oneComb.t, 32) + + storeA(oneComb.x)(builder) + +}) + +; +} + +export function loadManyComb(slice: Slice): ManyComb { + let y: OneComb>> = loadOneComb>>(slice, ((slice: Slice) => { + return loadOneComb>(slice, ((slice: Slice) => { + return loadOneComb(slice, ((slice: Slice) => { + return slice.loadInt(3) + + }) + ) + + }) + ) + +}) +) + +; + return { + kind: 'ManyComb', + y: y, +} + +; +} + +export function storeManyComb(manyComb: ManyComb): (builder: Builder) => void { + return ((builder: Builder) => { + storeOneComb>>(manyComb.y, ((arg: OneComb>) => { + return ((builder: Builder) => { + storeOneComb>(arg, ((arg: OneComb) => { + return ((builder: Builder) => { + storeOneComb(arg, ((arg: number) => { + return ((builder: Builder) => { + builder.storeInt(arg, 3) + + }) + + + }) + )(builder) + + }) + + + }) + )(builder) + + }) + + + }) + )(builder) + +}) + +; +} + +export function unary_unary_succ_get_n(x: Unary): number { + if ((x.kind == 'Unary_unary_zero')) { + return 0 +} +; + if ((x.kind == 'Unary_unary_succ')) { +let n = x.n + + return (n + 1) +} +; + throw new Error('') +; +} + +export function loadUnary(slice: Slice): Unary { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { +slice.loadUint(1) + return { + kind: 'Unary_unary_zero', +} + +} +; + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { +slice.loadUint(1) +let x: Unary = loadUnary(slice) + +let n = unary_unary_succ_get_n(x) + + return { + kind: 'Unary_unary_succ', + x: x, + n: n, +} + +} +; + throw new Error('') +; +} + +export function storeUnary(unary: Unary): (builder: Builder) => void { + if ((unary.kind == 'Unary_unary_zero')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1) + +}) + +} +; + if ((unary.kind == 'Unary_unary_succ')) { + return ((builder: Builder) => { + builder.storeUint(0b1, 1) + + storeUnary(unary.x)(builder) + +}) + +} +; + throw new Error('') +; +} + +export function loadParamConst(slice: Slice, arg0: number, arg1: number): ParamConst { + if (((slice.remainingBits >= 2) && ((slice.preloadUint(2) == 0b01) && ((arg0 == 2) && (arg1 == 1))))) { +slice.loadUint(2) +let m: number = slice.loadUint(32) + +let k: number = slice.loadUint(32) + + return { + kind: 'ParamConst_b', + m: m, + k: k, +} + +} +; + if (((slice.remainingBits >= 2) && ((slice.preloadUint(2) == 0b01) && ((arg0 == 3) && (arg1 == 3))))) { +slice.loadUint(2) +let n: number = slice.loadUint(32) + +let m: number = slice.loadUint(32) + +let k: number = slice.loadUint(32) + + return { + kind: 'ParamConst_c', + n: n, + m: m, + k: k, +} + +} +; + if (((arg0 == 1) && (arg1 == 1))) { +let n: number = slice.loadUint(32) + + return { + kind: 'ParamConst_a', + n: n, +} + +} +; + if (((arg0 == 4) && (arg1 == 2))) { +let n: number = slice.loadUint(32) + +let m: number = slice.loadUint(32) + +let k: number = slice.loadUint(32) + +let l: number = slice.loadUint(32) + + return { + kind: 'ParamConst_d', + n: n, + m: m, + k: k, + l: l, +} + +} +; + throw new Error('') +; +} + +export function storeParamConst(paramConst: ParamConst): (builder: Builder) => void { + if ((paramConst.kind == 'ParamConst_b')) { + return ((builder: Builder) => { + builder.storeUint(0b01, 2) + + builder.storeUint(paramConst.m, 32) + + builder.storeUint(paramConst.k, 32) + +}) + +} +; + if ((paramConst.kind == 'ParamConst_c')) { + return ((builder: Builder) => { + builder.storeUint(0b01, 2) + + builder.storeUint(paramConst.n, 32) + + builder.storeUint(paramConst.m, 32) + + builder.storeUint(paramConst.k, 32) + +}) + +} +; + if ((paramConst.kind == 'ParamConst_a')) { + return ((builder: Builder) => { + builder.storeUint(paramConst.n, 32) + +}) + +} +; + if ((paramConst.kind == 'ParamConst_d')) { + return ((builder: Builder) => { + builder.storeUint(paramConst.n, 32) + + builder.storeUint(paramConst.m, 32) + + builder.storeUint(paramConst.k, 32) + + builder.storeUint(paramConst.l, 32) + +}) + +} +; + throw new Error('') +; +} + +export function paramDifNames_c_get_n(x: ParamDifNames): number { + if ((x.kind == 'ParamDifNames_a')) { + return 1 +} +; + if ((x.kind == 'ParamDifNames_b')) { + return 1 +} +; + if ((x.kind == 'ParamDifNames_c')) { +let n = x.n + + return (n + 1) +} +; + if ((x.kind == 'ParamDifNames_d')) { +let m = x.m + + return (m * 2) +} +; + throw new Error('') +; +} + +export function paramDifNames_d_get_m(x: ParamDifNames): number { + if ((x.kind == 'ParamDifNames_a')) { + return 1 +} +; + if ((x.kind == 'ParamDifNames_b')) { + return 1 +} +; + if ((x.kind == 'ParamDifNames_c')) { +let n = x.n + + return (n + 1) +} +; + if ((x.kind == 'ParamDifNames_d')) { +let m = x.m + + return (m * 2) +} +; + throw new Error('') +; +} + +export function loadParamDifNames(slice: Slice, arg0: number): ParamDifNames { + if (((slice.remainingBits >= 1) && ((slice.preloadUint(1) == 0b0) && (arg0 == 2)))) { +slice.loadUint(1) + return { + kind: 'ParamDifNames_a', +} + +} +; + if (((slice.remainingBits >= 1) && ((slice.preloadUint(1) == 0b1) && (arg0 == 3)))) { +slice.loadUint(1) + return { + kind: 'ParamDifNames_b', +} + +} +; + if (((slice.remainingBits >= 1) && ((slice.preloadUint(1) == 0b1) && (arg0 == 2)))) { +slice.loadUint(1) +let x: ParamDifNames = loadParamDifNames(slice, 2) + +let n = paramDifNames_c_get_n(x) + + return { + kind: 'ParamDifNames_c', + x: x, + n: n, +} + +} +; + if (((slice.remainingBits >= 1) && ((slice.preloadUint(1) == 0b0) && (arg0 == 3)))) { +slice.loadUint(1) +let x: ParamDifNames = loadParamDifNames(slice, 3) + +let m = paramDifNames_d_get_m(x) + + return { + kind: 'ParamDifNames_d', + x: x, + m: m, +} + +} +; + throw new Error('') +; +} + +export function storeParamDifNames(paramDifNames: ParamDifNames): (builder: Builder) => void { + if ((paramDifNames.kind == 'ParamDifNames_a')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1) + +}) + +} +; + if ((paramDifNames.kind == 'ParamDifNames_b')) { + return ((builder: Builder) => { + builder.storeUint(0b1, 1) + +}) + +} +; + if ((paramDifNames.kind == 'ParamDifNames_c')) { + return ((builder: Builder) => { + builder.storeUint(0b1, 1) + + storeParamDifNames(paramDifNames.x)(builder) + +}) + +} +; + if ((paramDifNames.kind == 'ParamDifNames_d')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1) + + storeParamDifNames(paramDifNames.x)(builder) + +}) + +} +; + throw new Error('') +; +} + +export function paramDifNamesUser_get_k(x: ParamDifNames): number { + if ((x.kind == 'ParamDifNames_a')) { + return 1 +} +; + if ((x.kind == 'ParamDifNames_b')) { + return 1 +} +; + if ((x.kind == 'ParamDifNames_c')) { +let n = x.n + + return (n + 1) +} +; + if ((x.kind == 'ParamDifNames_d')) { +let m = x.m + + return (m * 2) +} +; + throw new Error('') +; +} + +export function loadParamDifNamesUser(slice: Slice): ParamDifNamesUser { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { +slice.loadUint(1) +let x: ParamDifNames = loadParamDifNames(slice, 2) + +let k = paramDifNamesUser_get_k(x) + + return { + kind: 'ParamDifNamesUser', + x: x, + k: k, +} + +} +; + throw new Error('') +; +} + +export function storeParamDifNamesUser(paramDifNamesUser: ParamDifNamesUser): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0b0, 1) + + storeParamDifNames(paramDifNamesUser.x)(builder) + +}) + +; +} + +export function loadNegationFromImplicit(slice: Slice): NegationFromImplicit { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { +slice.loadUint(1) +let t: number = slice.loadUint(32) + +let z: number = slice.loadUint(32) + + return { + kind: 'NegationFromImplicit', + y: (t / 2), + t: t, + z: z, +} + +} +; + throw new Error('') +; +} + +export function storeNegationFromImplicit(negationFromImplicit: NegationFromImplicit): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0b1, 1) + + builder.storeUint(negationFromImplicit.t, 32) + + builder.storeUint(negationFromImplicit.z, 32) + +}) + +; +} + +export function unaryUserCheckOrder_get_l(label: Unary): number { + if ((label.kind == 'Unary_unary_zero')) { + return 0 +} +; + if ((label.kind == 'Unary_unary_succ')) { +let n = label.n + + return (n + 1) +} +; + throw new Error('') +; +} + +export function loadUnaryUserCheckOrder(slice: Slice): UnaryUserCheckOrder { + let label: Unary = loadUnary(slice) + +; + let l = unaryUserCheckOrder_get_l(label) + +; + return { + kind: 'UnaryUserCheckOrder', + m: (7 - l), + label: label, + l: l, +} + +; +} + +export function storeUnaryUserCheckOrder(unaryUserCheckOrder: UnaryUserCheckOrder): (builder: Builder) => void { + return ((builder: Builder) => { + storeUnary(unaryUserCheckOrder.label)(builder) + +}) + +; +} + +export function loadCombArgCellRef(slice: Slice, loadX: (slice: Slice) => X +): CombArgCellRef { + let info: number = slice.loadInt(32) + +; + let init: Maybe> = loadMaybe>(slice, ((slice: Slice) => { + return loadEither(slice, loadX, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() + + + return slice1.loadInt(22) + + }) + ) + +}) +) + +; + let other: Either> = loadEither>(slice, loadX, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() + + + return loadOneComb(slice1, loadX) + +}) +) + +; + let body: Either = loadEither(slice, loadX, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() + + + return loadX(slice1) + +}) +) + +; + return { + kind: 'CombArgCellRef', + info: info, + init: init, + other: other, + body: body, +} + +; +} + +export function storeCombArgCellRef(combArgCellRef: CombArgCellRef, storeX: (x: X) => (builder: Builder) => void + +): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeInt(combArgCellRef.info, 32) + + storeMaybe>(combArgCellRef.init, ((arg: Either) => { + return ((builder: Builder) => { + storeEither(arg, storeX, ((arg: number) => { + return ((builder: Builder) => { + let cell1 = beginCell() + + + cell1.storeInt(arg, 22) + + builder.storeRef(cell1) + + + }) + + + }) + )(builder) + + }) + + + }) + )(builder) + + storeEither>(combArgCellRef.other, storeX, ((arg: OneComb) => { + return ((builder: Builder) => { + let cell1 = beginCell() + + + storeOneComb(arg, storeX)(cell1) + + builder.storeRef(cell1) + + + }) + + + }) + )(builder) + + storeEither(combArgCellRef.body, storeX, ((arg: X) => { + return ((builder: Builder) => { + let cell1 = beginCell() + + + storeX(arg)(cell1) + + builder.storeRef(cell1) + + + }) + + + }) + )(builder) + +}) + +; +} + +export function loadCombArgCellRefUser(slice: Slice): CombArgCellRefUser { + let x: CombArgCellRef = loadCombArgCellRef(slice, ((slice: Slice) => { + return slice.loadInt(12) + +}) +) + +; + return { + kind: 'CombArgCellRefUser', + x: x, +} + +; +} + +export function storeCombArgCellRefUser(combArgCellRefUser: CombArgCellRefUser): (builder: Builder) => void { + return ((builder: Builder) => { + storeCombArgCellRef(combArgCellRefUser.x, ((arg: number) => { + return ((builder: Builder) => { + builder.storeInt(arg, 12) + + }) + + + }) + )(builder) + +}) + +; +} + +export function loadMathExprAsCombArg(slice: Slice, arg0: number): MathExprAsCombArg { + let slice1 = slice.loadRef().beginParse() + +; + let ref: BitLenArg = loadBitLenArg(slice1, ((arg0 - 2) + 2)) + +; + return { + kind: 'MathExprAsCombArg', + n: (arg0 - 2), + ref: ref, +} + +; +} + +export function storeMathExprAsCombArg(mathExprAsCombArg: MathExprAsCombArg): (builder: Builder) => void { + return ((builder: Builder) => { + let cell1 = beginCell() + + + storeBitLenArg(mathExprAsCombArg.ref)(cell1) + + builder.storeRef(cell1) + +}) + +; +} + +export function loadEmptyTag(slice: Slice): EmptyTag { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xab787f76))) { +slice.loadUint(32) +let a: number = slice.loadUint(32) + + return { + kind: 'EmptyTag', + a: a, +} + +} +; + throw new Error('') +; +} + +export function storeEmptyTag(emptyTag: EmptyTag): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xab787f76, 32) + + builder.storeUint(emptyTag.a, 32) + +}) + +; +} + +export function loadSharpTag(slice: Slice): SharpTag { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xf4))) { +slice.loadUint(8) +let x: number = slice.loadUint(32) + + return { + kind: 'SharpTag', + x: x, +} + +} +; + throw new Error('') +; +} + +export function storeSharpTag(sharpTag: SharpTag): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xf4, 8) + + builder.storeUint(sharpTag.x, 32) + +}) + +; +} + +export function loadDollarTag(slice: Slice): DollarTag { + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b1011))) { +slice.loadUint(4) +let x: number = slice.loadUint(32) + + return { + kind: 'DollarTag', + x: x, +} + +} +; + throw new Error('') +; +} + +export function storeDollarTag(dollarTag: DollarTag): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0b1011, 4) + + builder.storeUint(dollarTag.x, 32) + +}) + +; +} + +export function loadTupleCheck(slice: Slice): TupleCheck { + let s: Array = Array.from(Array(3).keys()).map(((arg: number) => { + return slice.loadInt(5) + +}) +) + +; + return { + kind: 'TupleCheck', + s: s, +} + +; +} + +export function storeTupleCheck(tupleCheck: TupleCheck): (builder: Builder) => void { + return ((builder: Builder) => { + tupleCheck.s.forEach(((arg: number) => { + builder.storeInt(arg, 5) + + }) + ) + +}) + +; +} + +export function hashmap_get_l(label: HmLabel): number { + if ((label.kind == 'HmLabel_hml_short')) { +let n = label.n + + return n +} +; + if ((label.kind == 'HmLabel_hml_long')) { +let n = label.n + + return n +} +; + if ((label.kind == 'HmLabel_hml_same')) { +let n = label.n + + return n +} +; + throw new Error('') +; +} + +export function loadHashmap(slice: Slice, n: number, loadX: (slice: Slice) => X +): Hashmap { + let label: HmLabel = loadHmLabel(slice, n) + +; + let l = hashmap_get_l(label) + +; + let node: HashmapNode = loadHashmapNode(slice, (n - l), loadX) + +; + return { + kind: 'Hashmap', + m: (n - l), + n: n, + label: label, + l: l, + node: node, +} + +; +} + +export function storeHashmap(hashmap: Hashmap, storeX: (x: X) => (builder: Builder) => void + +): (builder: Builder) => void { + return ((builder: Builder) => { + storeHmLabel(hashmap.label)(builder) + + storeHashmapNode(hashmap.node, storeX)(builder) + +}) + +; +} + +export function loadHashmapNode(slice: Slice, arg0: number, loadX: (slice: Slice) => X +): HashmapNode { + if ((arg0 == 0)) { +let value: X = loadX(slice) + + return { + kind: 'HashmapNode_hmn_leaf', + value: value, +} + +} +; + if (true) { +let slice1 = slice.loadRef().beginParse() + +let left: Hashmap = loadHashmap(slice1, (arg0 - 1), loadX) + +let slice2 = slice.loadRef().beginParse() + +let right: Hashmap = loadHashmap(slice2, (arg0 - 1), loadX) + + return { + kind: 'HashmapNode_hmn_fork', + n: (arg0 - 1), + left: left, + right: right, +} + +} +; + throw new Error('') +; +} + +export function storeHashmapNode(hashmapNode: HashmapNode, storeX: (x: X) => (builder: Builder) => void + +): (builder: Builder) => void { + if ((hashmapNode.kind == 'HashmapNode_hmn_leaf')) { + return ((builder: Builder) => { + storeX(hashmapNode.value)(builder) + +}) + +} +; + if ((hashmapNode.kind == 'HashmapNode_hmn_fork')) { + return ((builder: Builder) => { + let cell1 = beginCell() + + + storeHashmap(hashmapNode.left, storeX)(cell1) + + builder.storeRef(cell1) + + let cell2 = beginCell() + + + storeHashmap(hashmapNode.right, storeX)(cell2) + + builder.storeRef(cell2) + +}) + +} +; + throw new Error('') +; +} + +export function hmLabel_hml_short_get_n(len: Unary): number { + if ((len.kind == 'Unary_unary_zero')) { + return 0 +} +; + if ((len.kind == 'Unary_unary_succ')) { +let n = len.n + + return (n + 1) +} +; + throw new Error('') +; +} + +export function loadHmLabel(slice: Slice, m: number): HmLabel { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { +slice.loadUint(1) +let len: Unary = loadUnary(slice) + +let n = hmLabel_hml_short_get_n(len) + +let s: Array = Array.from(Array(n).keys()).map(((arg: number) => { + return slice.loadBits(1) + + }) + ) + + if ((!(n <= m))) { +throw new Error('') + } + return { + kind: 'HmLabel_hml_short', + m: m, + len: len, + n: n, + s: s, +} + +} +; + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b10))) { +slice.loadUint(2) +let n: number = slice.loadUint(bitLen(m)) + +let s: Array = Array.from(Array(n).keys()).map(((arg: number) => { + return slice.loadBits(1) + + }) + ) + + return { + kind: 'HmLabel_hml_long', + m: m, + n: n, + s: s, +} + +} +; + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b11))) { +slice.loadUint(2) +let v: BitString = slice.loadBits(1) + +let n: number = slice.loadUint(bitLen(m)) + + return { + kind: 'HmLabel_hml_same', + m: m, + v: v, + n: n, +} + +} +; + throw new Error('') +; +} + +export function storeHmLabel(hmLabel: HmLabel): (builder: Builder) => void { + if ((hmLabel.kind == 'HmLabel_hml_short')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1) + + storeUnary(hmLabel.len)(builder) + + hmLabel.s.forEach(((arg: BitString) => { + builder.storeBits(arg) + + }) + ) + + if ((!(hmLabel.n <= hmLabel.m))) { + throw new Error('') + } + +}) + +} +; + if ((hmLabel.kind == 'HmLabel_hml_long')) { + return ((builder: Builder) => { + builder.storeUint(0b10, 2) + + builder.storeUint(hmLabel.n, bitLen(hmLabel.m)) + + hmLabel.s.forEach(((arg: BitString) => { + builder.storeBits(arg) + + }) + ) + +}) + +} +; + if ((hmLabel.kind == 'HmLabel_hml_same')) { + return ((builder: Builder) => { + builder.storeUint(0b11, 2) + + builder.storeBits(hmLabel.v) + + builder.storeUint(hmLabel.n, bitLen(hmLabel.m)) + +}) + +} +; + throw new Error('') +; +} + +export function loadHashmapE(slice: Slice, n: number, loadX: (slice: Slice) => X +): HashmapE { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { +slice.loadUint(1) + return { + kind: 'HashmapE_hme_empty', + n: n, +} + +} +; + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { +slice.loadUint(1) +let slice1 = slice.loadRef().beginParse() + +let root: Hashmap = loadHashmap(slice1, n, loadX) + + return { + kind: 'HashmapE_hme_root', + n: n, + root: root, +} + +} +; + throw new Error('') +; +} + +export function storeHashmapE(hashmapE: HashmapE, storeX: (x: X) => (builder: Builder) => void + +): (builder: Builder) => void { + if ((hashmapE.kind == 'HashmapE_hme_empty')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1) + +}) + +} +; + if ((hashmapE.kind == 'HashmapE_hme_root')) { + return ((builder: Builder) => { + builder.storeUint(0b1, 1) + + let cell1 = beginCell() + + + storeHashmap(hashmapE.root, storeX)(cell1) + + builder.storeRef(cell1) + +}) + +} +; + throw new Error('') +; +} + +export function loadHashmapEUser(slice: Slice): HashmapEUser { + let x: HashmapE = loadHashmapE(slice, 8, ((slice: Slice) => { + return slice.loadUint(16) + +}) +) + +; + return { + kind: 'HashmapEUser', + x: x, +} + +; +} + +export function storeHashmapEUser(hashmapEUser: HashmapEUser): (builder: Builder) => void { + return ((builder: Builder) => { + storeHashmapE(hashmapEUser.x, ((arg: number) => { + return ((builder: Builder) => { + builder.storeUint(arg, 16) + + }) + + + }) + )(builder) + +}) + +; +} + +export function loadConditionalField(slice: Slice): ConditionalField { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xdc165658))) { +slice.loadUint(32) +let a: number = slice.loadUint(1) + +let b: number | undefined = (a ? slice.loadUint(32) : undefined) + + return { + kind: 'ConditionalField', + a: a, + b: b, +} + +} +; + throw new Error('') +; +} + +export function storeConditionalField(conditionalField: ConditionalField): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xdc165658, 32) + + builder.storeUint(conditionalField.a, 1) + + if ((conditionalField.b != undefined)) { + builder.storeUint(conditionalField.b, 32) + } + +}) + +; +} + +export function loadBitSelection(slice: Slice): BitSelection { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xe1a2049e))) { +slice.loadUint(32) +let a: number = slice.loadUint(6) + +let b: number | undefined = ((a & (1 << 2)) ? slice.loadUint(32) : undefined) + + return { + kind: 'BitSelection', + a: a, + b: b, +} + +} +; + throw new Error('') +; +} + +export function storeBitSelection(bitSelection: BitSelection): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xe1a2049e, 32) + + builder.storeUint(bitSelection.a, 6) + + if ((bitSelection.b != undefined)) { + builder.storeUint(bitSelection.b, 32) + } + +}) + +; +} + +export function loadImplicitCondition(slice: Slice): ImplicitCondition { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xd86a5028))) { +slice.loadUint(32) +let flags: number = slice.loadUint(10) + + if ((!(flags <= 100))) { +throw new Error('') + } + return { + kind: 'ImplicitCondition', + flags: flags, +} + +} +; + throw new Error('') +; +} + +export function storeImplicitCondition(implicitCondition: ImplicitCondition): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xd86a5028, 32) + + builder.storeUint(implicitCondition.flags, 10) + + if ((!(implicitCondition.flags <= 100))) { + throw new Error('') + } + +}) + +; +} + +export function loadMultipleEmptyConstructor(slice: Slice, arg0: number): MultipleEmptyConstructor { + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x85e93c51) && (arg0 == 0)))) { +slice.loadUint(32) +let a: number = slice.loadUint(32) + + return { + kind: 'MultipleEmptyConstructor__', + a: a, +} + +} +; + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xc5d27bf1) && (arg0 == 1)))) { +slice.loadUint(32) +let b: number = slice.loadUint(5) + + return { + kind: 'MultipleEmptyConstructor__1', + b: b, +} + +} +; + if ((arg0 == 2)) { +let x: number = slice.loadUint(6) + + return { + kind: 'MultipleEmptyConstructor_a', + x: x, +} + +} +; + throw new Error('') +; +} + +export function storeMultipleEmptyConstructor(multipleEmptyConstructor: MultipleEmptyConstructor): (builder: Builder) => void { + if ((multipleEmptyConstructor.kind == 'MultipleEmptyConstructor__')) { + return ((builder: Builder) => { + builder.storeUint(0x85e93c51, 32) + + builder.storeUint(multipleEmptyConstructor.a, 32) + +}) + +} +; + if ((multipleEmptyConstructor.kind == 'MultipleEmptyConstructor__1')) { + return ((builder: Builder) => { + builder.storeUint(0xc5d27bf1, 32) + + builder.storeUint(multipleEmptyConstructor.b, 5) + +}) + +} +; + if ((multipleEmptyConstructor.kind == 'MultipleEmptyConstructor_a')) { + return ((builder: Builder) => { + builder.storeUint(multipleEmptyConstructor.x, 6) + +}) + +} +; + throw new Error('') +; +} + +export function loadTrue(slice: Slice): True { + return { + kind: 'True', +} + +; +} + +export function storeTrue(true0: True): (builder: Builder) => void { + return ((builder: Builder) => { +}) + +; +} + +export function loadParamNamedArgInSecondConstr(slice: Slice, arg0: number): ParamNamedArgInSecondConstr { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { +slice.loadUint(1) + return { + kind: 'ParamNamedArgInSecondConstr_a', + n: arg0, +} + +} +; + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { +slice.loadUint(1) + return { + kind: 'ParamNamedArgInSecondConstr_b', + n: (arg0 - 1), +} + +} +; + throw new Error('') +; +} + +export function storeParamNamedArgInSecondConstr(paramNamedArgInSecondConstr: ParamNamedArgInSecondConstr): (builder: Builder) => void { + if ((paramNamedArgInSecondConstr.kind == 'ParamNamedArgInSecondConstr_a')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1) + +}) + +} +; + if ((paramNamedArgInSecondConstr.kind == 'ParamNamedArgInSecondConstr_b')) { + return ((builder: Builder) => { + builder.storeUint(0b1, 1) + +}) + +} +; + throw new Error('') +; +} + +export function loadRefCombinatorAny(slice: Slice): RefCombinatorAny { + let slice1 = slice.loadRef().beginParse() + +; + let msg: Maybe = loadMaybe(slice1, ((slice: Slice) => { + return slice + +}) +) + +; + return { + kind: 'RefCombinatorAny', + msg: msg, +} + +; +} + +export function storeRefCombinatorAny(refCombinatorAny: RefCombinatorAny): (builder: Builder) => void { + return ((builder: Builder) => { + let cell1 = beginCell() + + + storeMaybe(refCombinatorAny.msg, ((arg: Slice) => { + return ((builder: Builder) => { + cell1.storeSlice(arg) + + }) + + + }) + )(cell1) + + builder.storeRef(cell1) + +}) + +; +} + +export function loadEqualityExpression(slice: Slice): EqualityExpression { + let n: number = slice.loadUint(32) + +; + if ((!((5 + n) == 7))) { +throw new Error('') +} +; + return { + kind: 'EqualityExpression', + n: n, +} + +; +} + +export function storeEqualityExpression(equalityExpression: EqualityExpression): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(equalityExpression.n, 32) + + if ((!((5 + equalityExpression.n) == 7))) { + throw new Error('') + } + +}) + +; +} + +export function loadConditionalRef(slice: Slice): ConditionalRef { + let x: number = slice.loadUint(1) + +; + let y: Simple | undefined = (x ? ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() + + + return loadSimple(slice1) + +}) +(slice) : undefined) + +; + return { + kind: 'ConditionalRef', + x: x, + y: y, +} + +; +} + +export function storeConditionalRef(conditionalRef: ConditionalRef): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(conditionalRef.x, 1) + + if ((conditionalRef.y != undefined)) { + let cell1 = beginCell() + + + storeSimple(conditionalRef.y)(cell1) + + builder.storeRef(cell1) + + } + +}) + +; +} + +export function loadLoadFromNegationOutsideExpr(slice: Slice): LoadFromNegationOutsideExpr { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x9bc7a987))) { +slice.loadUint(32) +let seq_no: number = slice.loadUint(32) + + return { + kind: 'LoadFromNegationOutsideExpr', + prev_seq_no: (seq_no - 1), + seq_no: seq_no, +} + +} +; + throw new Error('') +; +} + +export function storeLoadFromNegationOutsideExpr(loadFromNegationOutsideExpr: LoadFromNegationOutsideExpr): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x9bc7a987, 32) + + builder.storeUint(loadFromNegationOutsideExpr.seq_no, 32) + +}) + +; +} + +export function loadAnonymousData(slice: Slice): AnonymousData { + let anon0: number = slice.loadUint(1) + +; + return { + kind: 'AnonymousData', + anon0: anon0, +} + +; +} + +export function storeAnonymousData(anonymousData: AnonymousData): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(anonymousData.anon0, 1) + +}) + +; +} + +export function loadFalseAnonField(slice: Slice): FalseAnonField { + if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x0201))) { +slice.loadUint(16) +let value: number = slice.loadInt(257) + + return { + kind: 'FalseAnonField', + value: value, +} + +} +; + throw new Error('') +; +} + +export function storeFalseAnonField(falseAnonField: FalseAnonField): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x0201, 16) + + builder.storeInt(falseAnonField.value, 257) + +}) + +; +} + +export function loadConstructorOrder(slice: Slice): ConstructorOrder { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xc6cc03c3))) { +slice.loadUint(32) +let anon0: Simple = loadSimple(slice) + + return { + kind: 'ConstructorOrder__', + anon0: anon0, +} + +} +; + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { +slice.loadUint(1) +let a: Simple = loadSimple(slice) + + return { + kind: 'ConstructorOrder_a', + a: a, +} + +} +; + throw new Error('') +; +} + +export function storeConstructorOrder(constructorOrder: ConstructorOrder): (builder: Builder) => void { + if ((constructorOrder.kind == 'ConstructorOrder__')) { + return ((builder: Builder) => { + builder.storeUint(0xc6cc03c3, 32) + + storeSimple(constructorOrder.anon0)(builder) + +}) + +} +; + if ((constructorOrder.kind == 'ConstructorOrder_a')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1) + + storeSimple(constructorOrder.a)(builder) + +}) + +} +; + throw new Error('') +; +} + +export function loadCheckCrc32(slice: Slice): CheckCrc32 { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xd6e7c617))) { +slice.loadUint(32) +let a: number = slice.loadUint(32) + + return { + kind: 'CheckCrc32_a', + a: a, +} + +} +; + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xde1cb606))) { +slice.loadUint(32) +let b: number = slice.loadUint(32) + +let c: number = slice.loadUint(32) + + return { + kind: 'CheckCrc32_b', + b: b, + c: c, +} + +} +; + throw new Error('') +; +} + +export function storeCheckCrc32(checkCrc32: CheckCrc32): (builder: Builder) => void { + if ((checkCrc32.kind == 'CheckCrc32_a')) { + return ((builder: Builder) => { + builder.storeUint(0xd6e7c617, 32) + + builder.storeUint(checkCrc32.a, 32) + +}) + +} +; + if ((checkCrc32.kind == 'CheckCrc32_b')) { + return ((builder: Builder) => { + builder.storeUint(0xde1cb606, 32) + + builder.storeUint(checkCrc32.b, 32) + + builder.storeUint(checkCrc32.c, 32) + +}) + +} +; + throw new Error('') +; +} + +export function loadCheckKeyword(slice: Slice): CheckKeyword { + let const0: number = slice.loadUint(32) + +; + return { + kind: 'CheckKeyword', + const0: const0, +} + +; +} + +export function storeCheckKeyword(checkKeyword: CheckKeyword): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(checkKeyword.const0, 32) + +}) + +; +} diff --git a/src/codegen/tsgen.ts b/src/codegen/tsgen.ts index 1172a95..7b8cd21 100644 --- a/src/codegen/tsgen.ts +++ b/src/codegen/tsgen.ts @@ -304,7 +304,21 @@ export function tMultiStatement(statements: Array): MultiStatement { // return parameters; // } -export function toCode(node: TheNode, code: CodeBuilder): CodeBuilder { + +export function toCodeArray(nodeArray: Array, code: CodeBuilder, delimeter: string) { + for (let i = 0; i < nodeArray.length; i++) { + let currentParam = nodeArray[i]; + if (currentParam != undefined) { + code.add(toCode(currentParam).render(), false) + } + if (i + 1 < nodeArray.length) { + code.add(delimeter, false); + } + } + return code; +} + +export function toCode(node: TheNode, code: CodeBuilder = new CodeBuilder()): CodeBuilder { if (node.type == "Identifier") { code.add(node.name, false); } @@ -314,116 +328,146 @@ export function toCode(node: TheNode, code: CodeBuilder): CodeBuilder { } if (node.type == "ImportDeclaration") { - code.add(`import { ${toCode(node.importValue, new CodeBuilder()).render()} } from ${toCode(node.from, new CodeBuilder()).render()}`, false); + code.add(`import { ${toCode(node.importValue).render()} } from ${toCode(node.from).render()}`, false); } - // if (node.type == "FunctionDeclaration") { - // code.add(`export function ${toCode(node.name, printContext)}${toCode(node.typeParameters, printContext)}(${toCodeArray(node.parameters, ', ', '', printContext, '')})${node.returnType ? ': ' + toCode(node.returnType, printContext) : ''} { - // ${toCodeArray(node.body, '\n', '', addTab(printContext), ';')} - // ${currentTabs}}`) - // } + if (node.type == "FunctionDeclaration") { + code.add(`export function ${toCode(node.name).render()}${toCode(node.typeParameters).render()}(`, false) + toCodeArray(node.parameters, code, ', ') + code.add(`)${node.returnType ? ': ' + toCode(node.returnType).render() : ''} {`) + code.inTab(() => { + node.body.forEach((statement) => { + code.add(toCode(statement).render() + ';'); + }) + }); + code.add('}') + } -// if (node.type == "ArrowFunctionExpression") { -// result += `((${toCodeArray(node.parameters, ', ', '', printContext, '')}) => { -// ${toCodeArray(node.body, '\n', '', addTab(printContext), ';')} -// ${currentTabs}})` -// } + if (node.type == "ArrowFunctionExpression") { + code.add(`((`, false) + toCodeArray(node.parameters, code, ', ') + code.add(`) => {`) + code.inTab(() => { + node.body.forEach(statement => { + code.append(toCode(statement)); + }) + }) + code.add(`})`) + } -// if (node.type == "ArrowFunctionType") { -// result += `(${toCodeArray(node.parameters, ', ', '', printContext, '')}) => ${node.returnType ? toCode(node.returnType, printContext) : ''}` -// } + if (node.type == "ArrowFunctionType") { + code.add(`(${toCodeArray(node.parameters, new CodeBuilder(), ', ').render()}) => ${node.returnType ? toCode(node.returnType).render() : ''}`) + } -// if (node.type == "TypeWithParameters") { -// result += `${toCode(node.name, printContext)}${toCode(node.typeParameters, printContext)}` -// } + if (node.type == "TypeWithParameters") { + code.add(`${toCode(node.name).render()}${toCode(node.typeParameters).render()}`, false) + } -// if (node.type == "TypedIdentifier") { -// result += toCode(node.name, printContext) + ': ' + toCode(node.typeId, printContext); -// } + if (node.type == "TypedIdentifier") { + code.add(toCode(node.name).render() + ': ' + toCode(node.typeId).render(), false) + } -// if (node.type == "ObjectProperty") { -// result += currentTabs + toCode(node.key, printContext) + ': ' + toCode(node.value, printContext); -// } + if (node.type == "ObjectProperty") { + code.add(toCode(node.key).render() + ': ' + toCode(node.value).render(), false) + } -// if (node.type == "DeclareVariable") { -// result += `let ${toCode(node.name, printContext)}${node.typeName ? ': ' + toCode(node.typeName, printContext) : ''}${node.init ? ' = ' + toCode(node.init, printContext) : ''}` -// } + if (node.type == "DeclareVariable") { + code.add(`let ${toCode(node.name).render()}${node.typeName ? ': ' + toCode(node.typeName).render() : ''}${node.init ? ' = ' + toCode(node.init).render() : ''}`) + } -// if (node.type == "ObjectExpression") { -// result += `{ -// ${toCodeArray(node.objectValues, ',\n', '', addTab(printContext), '')} -// ${currentTabs}}` -// } + if (node.type == "ObjectExpression") { + code.add('{'); + code.inTab(() => { + node.objectValues.forEach(objectValue => { + code.add(toCode(objectValue).render() + ','); + }) + }); + code.add('}'); + } -// if (node.type == "MultiStatement") { -// result += toCodeArray(node.statements, '\n', '', printContext, ''); -// } + if (node.type == "MultiStatement") { + node.statements.forEach(statement => { + code.append(toCode(statement)); + }) + } -// if (node.type == "ReturnStatement") { -// result += currentTabs + `return ${toCode(node.returnValue, printContext)}` -// } + if (node.type == "ReturnStatement") { + code.add(`return ${toCode(node.returnValue).render()}`) + } -// if (node.type == "ExpressionStatement") { -// result += currentTabs + toCode(node.expression, printContext) -// } + if (node.type == "ExpressionStatement") { + code.appendInline(toCode(node.expression)) + } -// if (node.type == "TypeParametersExpression") { -// if (node.typeParameters.length > 0) { -// result += '<'; -// result += toCodeArray(node.typeParameters, ',', '', printContext, ''); -// result += '>'; -// } -// } + if (node.type == "TypeParametersExpression") { + if (node.typeParameters.length > 0) { + code.add('<', false); + toCodeArray(node.typeParameters, code, ', ') + code.add('>', false); + } + } -// if (node.type == "StructDeclaration") { -// result += currentTabs + `export interface ${toCode(node.name, printContext)}${toCode(node.typeParametersExpression, printContext)} { -// ${toCodeArray(node.fields, '\n', '\treadonly ', printContext, ';')} -// ${currentTabs}};` -// } + if (node.type == "StructDeclaration") { + code.add(`export interface ${toCode(node.name).render()}${toCode(node.typeParametersExpression).render()} {`) + node.fields.forEach(field => { + code.add(`readonly ${toCode(field).render()}`) + }) + code.add('}') + } -// if (node.type == "UnionTypeDeclaration") { -// result += currentTabs + `export type ${toCode(node.name, printContext)} = ${toCode(node.union, printContext)};` -// } + if (node.type == "UnionTypeDeclaration") { + code.add(`export type ${toCode(node.name).render()} = ${toCode(node.union).render()};`) + } -// if (node.type == "UnionTypeExpression") { -// return `${toCodeArray(node.unionMembers, ' | ', '', printContext, '')}` -// } + if (node.type == "UnionTypeExpression") { + toCodeArray(node.unionMembers, code, ' | '); + } -// if (node.type == "FunctionCall") { -// result += `${toCode(node.functionId, printContext)}${node.typeParameters ? toCode(node.typeParameters, printContext) : ''}(${toCodeArray(node.parameters, ', ', '', printContext, '')})` -// } + if (node.type == "FunctionCall") { + code.add(`${toCode(node.functionId).render()}${node.typeParameters ? toCode(node.typeParameters).render() : ''}(`, false) + toCodeArray(node.parameters, code, ', ') + code.add(`)`, false) + } if (node.type == "StringLiteral") { code.add(`'${node.value}'`, false) } -// if (node.type == "MemberExpression") { -// result += toCode(node.thisObject, printContext) + '.' + toCode(node.memberName, printContext); -// } + if (node.type == "MemberExpression") { + code.add(toCode(node.thisObject).render() + '.' + toCode(node.memberName).render(), false); + } -// if (node.type == "IfStatement") { -// result += `${currentTabs}if (${toCode(node.condition, printContext)}) { -// ${toCodeArray(node.body, '\n', '', addTab(printContext), ';')} -// ${currentTabs}}` -// } + if (node.type == "IfStatement") { + code.add(`if (${toCode(node.condition).render()}) {`) + code.inTab(() => { + node.body.forEach(statement => { + toCode(statement, code); + }) + }) + code.add('}') + } -// if (node.type == "ForCycle") { -// result += `${currentTabs}for (${toCode(node.init, printContext)};${toCode(node.cond, printContext)};${toCode(node.inc, printContext)}) { -// ${toCodeArray(node.body, '\n', '', addTab(printContext), ';')} -// ${currentTabs}}` -// } + if (node.type == "ForCycle") { + code.add(`for (${toCode(node.init).render()};${toCode(node.cond).render()};${toCode(node.inc).render()}) {`) + code.inTab(() => { + node.body.forEach(statement => { + toCode(statement, code); + }) + }) + code.add(`}`); + } -// if (node.type == "UnaryOpExpression") { -// result += `(${node.unaryOperator}${toCode(node.expr, printContext)})` -// } + if (node.type == "UnaryOpExpression") { + code.add(`(${node.unaryOperator}${toCode(node.expr).render()})`, false) + } -// if (node.type == "BinaryExpression") { -// result += `(${toCode(node.left, printContext)} ${node.binarySign} ${toCode(node.right, printContext)})` -// } + if (node.type == "BinaryExpression") { + code.add(`(${toCode(node.left).render()} ${node.binarySign} ${toCode(node.right).render()})`, false) + } -// if (node.type == "TernaryExpression") { -// result += `(${toCode(node.condition, printContext)} ? ${toCode(node.body, printContext)} : ${toCode(node.elseBody, printContext)})` -// } + if (node.type == "TernaryExpression") { + code.add(`(${toCode(node.condition).render()} ? ${toCode(node.body).render()} : ${toCode(node.elseBody).render()})`, false) + } return code; } From 0183d406019f75be444884dd258e6c5c0f2e4d68 Mon Sep 17 00:00:00 2001 From: polyprogrammist Date: Mon, 11 Dec 2023 23:45:24 -0500 Subject: [PATCH 04/10] tmp --- generated_block.ts | 2690 +++++++++++++++++++++--------------------- generated_test.ts | 244 ++-- src/codegen/tsgen.ts | 2 +- 3 files changed, 1468 insertions(+), 1468 deletions(-) diff --git a/generated_block.ts b/generated_block.ts index e9512ba..5b9bfa6 100644 --- a/generated_block.ts +++ b/generated_block.ts @@ -2423,7 +2423,7 @@ export function storeTrue(true0: True): (builder: Builder) => void { export function loadBool(slice: Slice): Bool { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { -slice.loadUint(1) + slice.loadUint(1) return { kind: 'Bool_bool_false', } @@ -2431,7 +2431,7 @@ slice.loadUint(1) } ; if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { -slice.loadUint(1) + slice.loadUint(1) return { kind: 'Bool_bool_true', } @@ -2465,7 +2465,7 @@ export function storeBool(bool: Bool): (builder: Builder) => void { export function loadBoolFalse(slice: Slice): BoolFalse { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { -slice.loadUint(1) + slice.loadUint(1) return { kind: 'BoolFalse', } @@ -2487,7 +2487,7 @@ export function storeBoolFalse(boolFalse: BoolFalse): (builder: Builder) => void export function loadBoolTrue(slice: Slice): BoolTrue { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { -slice.loadUint(1) + slice.loadUint(1) return { kind: 'BoolTrue', } @@ -2510,7 +2510,7 @@ export function storeBoolTrue(boolTrue: BoolTrue): (builder: Builder) => void { export function loadMaybe(slice: Slice, loadX: (slice: Slice) => X ): Maybe { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { -slice.loadUint(1) + slice.loadUint(1) return { kind: 'Maybe_nothing', } @@ -2518,8 +2518,8 @@ slice.loadUint(1) } ; if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { -slice.loadUint(1) -let value: X = loadX(slice) + slice.loadUint(1) + let value: X = loadX(slice) return { kind: 'Maybe_just', @@ -2561,8 +2561,8 @@ export function loadEither(slice: Slice, loadX: (slice: Slice) => X , loadY: (slice: Slice) => Y ): Either { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { -slice.loadUint(1) -let value: X = loadX(slice) + slice.loadUint(1) + let value: X = loadX(slice) return { kind: 'Either_left', @@ -2572,8 +2572,8 @@ let value: X = loadX(slice) } ; if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { -slice.loadUint(1) -let value: Y = loadY(slice) + slice.loadUint(1) + let value: Y = loadY(slice) return { kind: 'Either_right', @@ -2671,19 +2671,19 @@ export function storeBit(bit: Bit): (builder: Builder) => void { export function hashmap_get_l(label: HmLabel): number { if ((label.kind == 'HmLabel_hml_short')) { -let n = label.n + let n = label.n return n } ; if ((label.kind == 'HmLabel_hml_long')) { -let n = label.n + let n = label.n return n } ; if ((label.kind == 'HmLabel_hml_same')) { -let n = label.n + let n = label.n return n } @@ -2731,7 +2731,7 @@ export function storeHashmap(hashmap: Hashmap, storeX: (x: X) => (builder: export function loadHashmapNode(slice: Slice, arg0: number, loadX: (slice: Slice) => X ): HashmapNode { if ((arg0 == 0)) { -let value: X = loadX(slice) + let value: X = loadX(slice) return { kind: 'HashmapNode_hmn_leaf', @@ -2741,13 +2741,13 @@ let value: X = loadX(slice) } ; if (true) { -let slice1 = slice.loadRef().beginParse() + let slice1 = slice.loadRef().beginParse() -let left: Hashmap = loadHashmap(slice1, (arg0 - 1), loadX) + let left: Hashmap = loadHashmap(slice1, (arg0 - 1), loadX) -let slice2 = slice.loadRef().beginParse() + let slice2 = slice.loadRef().beginParse() -let right: Hashmap = loadHashmap(slice2, (arg0 - 1), loadX) + let right: Hashmap = loadHashmap(slice2, (arg0 - 1), loadX) return { kind: 'HashmapNode_hmn_fork', @@ -2803,7 +2803,7 @@ export function hmLabel_hml_short_get_n(len: Unary): number { } ; if ((len.kind == 'Unary_unary_succ')) { -let n = len.n + let n = len.n return (n + 1) } @@ -2814,19 +2814,19 @@ let n = len.n export function loadHmLabel(slice: Slice, m: number): HmLabel { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { -slice.loadUint(1) -let len: Unary = loadUnary(slice) + slice.loadUint(1) + let len: Unary = loadUnary(slice) -let n = hmLabel_hml_short_get_n(len) + let n = hmLabel_hml_short_get_n(len) -let s: Array = Array.from(Array(n).keys()).map(((arg: number) => { - return slice.loadBits(1) + let s: Array = Array.from(Array(n).keys()).map(((arg: number) => { + return slice.loadBits(1) - }) - ) +}) +) if ((!(n <= m))) { -throw new Error('') + throw new Error('') } return { kind: 'HmLabel_hml_short', @@ -2839,14 +2839,14 @@ throw new Error('') } ; if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b10))) { -slice.loadUint(2) -let n: number = slice.loadUint(bitLen(m)) + slice.loadUint(2) + let n: number = slice.loadUint(bitLen(m)) -let s: Array = Array.from(Array(n).keys()).map(((arg: number) => { - return slice.loadBits(1) + let s: Array = Array.from(Array(n).keys()).map(((arg: number) => { + return slice.loadBits(1) - }) - ) +}) +) return { kind: 'HmLabel_hml_long', @@ -2858,10 +2858,10 @@ let s: Array = Array.from(Array(n).keys()).map(((arg: number) => { } ; if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b11))) { -slice.loadUint(2) -let v: BitString = slice.loadBits(1) + slice.loadUint(2) + let v: BitString = slice.loadBits(1) -let n: number = slice.loadUint(bitLen(m)) + let n: number = slice.loadUint(bitLen(m)) return { kind: 'HmLabel_hml_same', @@ -2890,7 +2890,7 @@ export function storeHmLabel(hmLabel: HmLabel): (builder: Builder) => void { ) if ((!(hmLabel.n <= hmLabel.m))) { - throw new Error('') + throw new Error('') } }) @@ -2935,7 +2935,7 @@ export function unary_unary_succ_get_n(x: Unary): number { } ; if ((x.kind == 'Unary_unary_succ')) { -let n = x.n + let n = x.n return (n + 1) } @@ -2946,7 +2946,7 @@ let n = x.n export function loadUnary(slice: Slice): Unary { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { -slice.loadUint(1) + slice.loadUint(1) return { kind: 'Unary_unary_zero', } @@ -2954,10 +2954,10 @@ slice.loadUint(1) } ; if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { -slice.loadUint(1) -let x: Unary = loadUnary(slice) + slice.loadUint(1) + let x: Unary = loadUnary(slice) -let n = unary_unary_succ_get_n(x) + let n = unary_unary_succ_get_n(x) return { kind: 'Unary_unary_succ', @@ -2997,7 +2997,7 @@ export function storeUnary(unary: Unary): (builder: Builder) => void { export function loadHashmapE(slice: Slice, n: number, loadX: (slice: Slice) => X ): HashmapE { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { -slice.loadUint(1) + slice.loadUint(1) return { kind: 'HashmapE_hme_empty', n: n, @@ -3006,10 +3006,10 @@ slice.loadUint(1) } ; if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { -slice.loadUint(1) -let slice1 = slice.loadRef().beginParse() + slice.loadUint(1) + let slice1 = slice.loadRef().beginParse() -let root: Hashmap = loadHashmap(slice1, n, loadX) + let root: Hashmap = loadHashmap(slice1, n, loadX) return { kind: 'HashmapE_hme_root', @@ -3055,8 +3055,8 @@ export function storeHashmapE(hashmapE: HashmapE, storeX: (x: X) => (build export function loadBitstringSet(slice: Slice, n: number): BitstringSet { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xda553663))) { -slice.loadUint(32) -let _: Hashmap = loadHashmap(slice, n, loadTrue) + slice.loadUint(32) + let _: Hashmap = loadHashmap(slice, n, loadTrue) return { kind: 'BitstringSet', @@ -3083,19 +3083,19 @@ export function storeBitstringSet(bitstringSet: BitstringSet): (builder: Builder export function hashmapAug_get_l(label: HmLabel): number { if ((label.kind == 'HmLabel_hml_short')) { -let n = label.n + let n = label.n return n } ; if ((label.kind == 'HmLabel_hml_long')) { -let n = label.n + let n = label.n return n } ; if ((label.kind == 'HmLabel_hml_same')) { -let n = label.n + let n = label.n return n } @@ -3147,9 +3147,9 @@ export function loadHashmapAugNode(slice: Slice, arg0: number, loadX: (sli , loadY: (slice: Slice) => Y ): HashmapAugNode { if ((arg0 == 0)) { -let extra: Y = loadY(slice) + let extra: Y = loadY(slice) -let value: X = loadX(slice) + let value: X = loadX(slice) return { kind: 'HashmapAugNode_ahmn_leaf', @@ -3160,15 +3160,15 @@ let value: X = loadX(slice) } ; if (true) { -let slice1 = slice.loadRef().beginParse() + let slice1 = slice.loadRef().beginParse() -let left: HashmapAug = loadHashmapAug(slice1, (arg0 - 1), loadX, loadY) + let left: HashmapAug = loadHashmapAug(slice1, (arg0 - 1), loadX, loadY) -let slice2 = slice.loadRef().beginParse() + let slice2 = slice.loadRef().beginParse() -let right: HashmapAug = loadHashmapAug(slice2, (arg0 - 1), loadX, loadY) + let right: HashmapAug = loadHashmapAug(slice2, (arg0 - 1), loadX, loadY) -let extra: Y = loadY(slice) + let extra: Y = loadY(slice) return { kind: 'HashmapAugNode_ahmn_fork', @@ -3229,8 +3229,8 @@ export function loadHashmapAugE(slice: Slice, n: number, loadX: (slice: Sl , loadY: (slice: Slice) => Y ): HashmapAugE { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { -slice.loadUint(1) -let extra: Y = loadY(slice) + slice.loadUint(1) + let extra: Y = loadY(slice) return { kind: 'HashmapAugE_ahme_empty', @@ -3241,12 +3241,12 @@ let extra: Y = loadY(slice) } ; if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { -slice.loadUint(1) -let slice1 = slice.loadRef().beginParse() + slice.loadUint(1) + let slice1 = slice.loadRef().beginParse() -let root: HashmapAug = loadHashmapAug(slice1, n, loadX, loadY) + let root: HashmapAug = loadHashmapAug(slice1, n, loadX, loadY) -let extra: Y = loadY(slice) + let extra: Y = loadY(slice) return { kind: 'HashmapAugE_ahme_root', @@ -3299,19 +3299,19 @@ export function storeHashmapAugE(hashmapAugE: HashmapAugE, storeX: ( export function varHashmap_get_l(label: HmLabel): number { if ((label.kind == 'HmLabel_hml_short')) { -let n = label.n + let n = label.n return n } ; if ((label.kind == 'HmLabel_hml_long')) { -let n = label.n + let n = label.n return n } ; if ((label.kind == 'HmLabel_hml_same')) { -let n = label.n + let n = label.n return n } @@ -3359,8 +3359,8 @@ export function storeVarHashmap(varHashmap: VarHashmap, storeX: (x: X) => export function loadVarHashmapNode(slice: Slice, arg0: number, loadX: (slice: Slice) => X ): VarHashmapNode { if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { -slice.loadUint(2) -let value: X = loadX(slice) + slice.loadUint(2) + let value: X = loadX(slice) return { kind: 'VarHashmapNode_vhmn_leaf', @@ -3371,16 +3371,16 @@ let value: X = loadX(slice) } ; if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b01))) { -slice.loadUint(2) -let slice1 = slice.loadRef().beginParse() + slice.loadUint(2) + let slice1 = slice.loadRef().beginParse() -let left: VarHashmap = loadVarHashmap(slice1, (arg0 - 1), loadX) + let left: VarHashmap = loadVarHashmap(slice1, (arg0 - 1), loadX) -let slice2 = slice.loadRef().beginParse() + let slice2 = slice.loadRef().beginParse() -let right: VarHashmap = loadVarHashmap(slice2, (arg0 - 1), loadX) + let right: VarHashmap = loadVarHashmap(slice2, (arg0 - 1), loadX) -let value: Maybe = loadMaybe(slice, loadX) + let value: Maybe = loadMaybe(slice, loadX) return { kind: 'VarHashmapNode_vhmn_fork', @@ -3393,14 +3393,14 @@ let value: Maybe = loadMaybe(slice, loadX) } ; if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { -slice.loadUint(1) -let branch: BitString = slice.loadBits(1) + slice.loadUint(1) + let branch: BitString = slice.loadBits(1) -let slice1 = slice.loadRef().beginParse() + let slice1 = slice.loadRef().beginParse() -let child: VarHashmap = loadVarHashmap(slice1, (arg0 - 1), loadX) + let child: VarHashmap = loadVarHashmap(slice1, (arg0 - 1), loadX) -let value: X = loadX(slice) + let value: X = loadX(slice) return { kind: 'VarHashmapNode_vhmn_cont', @@ -3479,7 +3479,7 @@ export function storeVarHashmapNode(varHashmapNode: VarHashmapNode, storeX export function loadVarHashmapE(slice: Slice, n: number, loadX: (slice: Slice) => X ): VarHashmapE { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { -slice.loadUint(1) + slice.loadUint(1) return { kind: 'VarHashmapE_vhme_empty', n: n, @@ -3488,10 +3488,10 @@ slice.loadUint(1) } ; if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { -slice.loadUint(1) -let slice1 = slice.loadRef().beginParse() + slice.loadUint(1) + let slice1 = slice.loadRef().beginParse() -let root: VarHashmap = loadVarHashmap(slice1, n, loadX) + let root: VarHashmap = loadVarHashmap(slice1, n, loadX) return { kind: 'VarHashmapE_vhme_root', @@ -3537,19 +3537,19 @@ export function storeVarHashmapE(varHashmapE: VarHashmapE, storeX: (x: X) export function pfxHashmap_get_l(label: HmLabel): number { if ((label.kind == 'HmLabel_hml_short')) { -let n = label.n + let n = label.n return n } ; if ((label.kind == 'HmLabel_hml_long')) { -let n = label.n + let n = label.n return n } ; if ((label.kind == 'HmLabel_hml_same')) { -let n = label.n + let n = label.n return n } @@ -3597,8 +3597,8 @@ export function storePfxHashmap(pfxHashmap: PfxHashmap, storeX: (x: X) => export function loadPfxHashmapNode(slice: Slice, arg0: number, loadX: (slice: Slice) => X ): PfxHashmapNode { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { -slice.loadUint(1) -let value: X = loadX(slice) + slice.loadUint(1) + let value: X = loadX(slice) return { kind: 'PfxHashmapNode_phmn_leaf', @@ -3609,14 +3609,14 @@ let value: X = loadX(slice) } ; if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { -slice.loadUint(1) -let slice1 = slice.loadRef().beginParse() + slice.loadUint(1) + let slice1 = slice.loadRef().beginParse() -let left: PfxHashmap = loadPfxHashmap(slice1, (arg0 - 1), loadX) + let left: PfxHashmap = loadPfxHashmap(slice1, (arg0 - 1), loadX) -let slice2 = slice.loadRef().beginParse() + let slice2 = slice.loadRef().beginParse() -let right: PfxHashmap = loadPfxHashmap(slice2, (arg0 - 1), loadX) + let right: PfxHashmap = loadPfxHashmap(slice2, (arg0 - 1), loadX) return { kind: 'PfxHashmapNode_phmn_fork', @@ -3673,7 +3673,7 @@ export function storePfxHashmapNode(pfxHashmapNode: PfxHashmapNode, storeX export function loadPfxHashmapE(slice: Slice, n: number, loadX: (slice: Slice) => X ): PfxHashmapE { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { -slice.loadUint(1) + slice.loadUint(1) return { kind: 'PfxHashmapE_phme_empty', n: n, @@ -3682,10 +3682,10 @@ slice.loadUint(1) } ; if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { -slice.loadUint(1) -let slice1 = slice.loadRef().beginParse() + slice.loadUint(1) + let slice1 = slice.loadRef().beginParse() -let root: PfxHashmap = loadPfxHashmap(slice1, n, loadX) + let root: PfxHashmap = loadPfxHashmap(slice1, n, loadX) return { kind: 'PfxHashmapE_phme_root', @@ -3731,7 +3731,7 @@ export function storePfxHashmapE(pfxHashmapE: PfxHashmapE, storeX: (x: X) export function loadMsgAddressExt(slice: Slice): MsgAddressExt { if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { -slice.loadUint(2) + slice.loadUint(2) return { kind: 'MsgAddressExt_addr_none', } @@ -3739,10 +3739,10 @@ slice.loadUint(2) } ; if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b01))) { -slice.loadUint(2) -let len: number = slice.loadUint(9) + slice.loadUint(2) + let len: number = slice.loadUint(9) -let external_address: BitString = slice.loadBits(len) + let external_address: BitString = slice.loadBits(len) return { kind: 'MsgAddressExt_addr_extern', @@ -3789,7 +3789,7 @@ export function loadAnycast(slice: Slice): Anycast { ; if ((!(depth >= 1))) { -throw new Error('') + throw new Error('') } ; return { @@ -3808,7 +3808,7 @@ export function storeAnycast(anycast: Anycast): (builder: Builder) => void { builder.storeBits(anycast.rewrite_pfx) if ((!(anycast.depth >= 1))) { - throw new Error('') + throw new Error('') } }) @@ -3818,12 +3818,12 @@ export function storeAnycast(anycast: Anycast): (builder: Builder) => void { export function loadMsgAddressInt(slice: Slice): MsgAddressInt { if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b10))) { -slice.loadUint(2) -let anycast: Maybe = loadMaybe(slice, loadAnycast) + slice.loadUint(2) + let anycast: Maybe = loadMaybe(slice, loadAnycast) -let workchain_id: number = slice.loadInt(8) + let workchain_id: number = slice.loadInt(8) -let address: BitString = slice.loadBits(256) + let address: BitString = slice.loadBits(256) return { kind: 'MsgAddressInt_addr_std', @@ -3835,14 +3835,14 @@ let address: BitString = slice.loadBits(256) } ; if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b11))) { -slice.loadUint(2) -let anycast: Maybe = loadMaybe(slice, loadAnycast) + slice.loadUint(2) + let anycast: Maybe = loadMaybe(slice, loadAnycast) -let addr_len: number = slice.loadUint(9) + let addr_len: number = slice.loadUint(9) -let workchain_id: number = slice.loadInt(32) + let workchain_id: number = slice.loadInt(32) -let address: BitString = slice.loadBits(addr_len) + let address: BitString = slice.loadBits(addr_len) return { kind: 'MsgAddressInt_addr_var', @@ -3895,8 +3895,8 @@ export function storeMsgAddressInt(msgAddressInt: MsgAddressInt): (builder: Buil export function loadMsgAddress(slice: Slice): MsgAddress { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xef3a10fa))) { -slice.loadUint(32) -let _: MsgAddressInt = loadMsgAddressInt(slice) + slice.loadUint(32) + let _: MsgAddressInt = loadMsgAddressInt(slice) return { kind: 'MsgAddress__', @@ -3906,8 +3906,8 @@ let _: MsgAddressInt = loadMsgAddressInt(slice) } ; if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xcf942fd1))) { -slice.loadUint(32) -let _: MsgAddressExt = loadMsgAddressExt(slice) + slice.loadUint(32) + let _: MsgAddressExt = loadMsgAddressExt(slice) return { kind: 'MsgAddress__1', @@ -4084,26 +4084,26 @@ export function storeCurrencyCollection(currencyCollection: CurrencyCollection): export function loadCommonMsgInfo(slice: Slice): CommonMsgInfo { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { -slice.loadUint(1) -let ihr_disabled: Bool = loadBool(slice) + slice.loadUint(1) + let ihr_disabled: Bool = loadBool(slice) -let bounce: Bool = loadBool(slice) + let bounce: Bool = loadBool(slice) -let bounced: Bool = loadBool(slice) + let bounced: Bool = loadBool(slice) -let src: MsgAddressInt = loadMsgAddressInt(slice) + let src: MsgAddressInt = loadMsgAddressInt(slice) -let dest: MsgAddressInt = loadMsgAddressInt(slice) + let dest: MsgAddressInt = loadMsgAddressInt(slice) -let value: CurrencyCollection = loadCurrencyCollection(slice) + let value: CurrencyCollection = loadCurrencyCollection(slice) -let ihr_fee: Grams = loadGrams(slice) + let ihr_fee: Grams = loadGrams(slice) -let fwd_fee: Grams = loadGrams(slice) + let fwd_fee: Grams = loadGrams(slice) -let created_lt: number = slice.loadUint(64) + let created_lt: number = slice.loadUint(64) -let created_at: number = slice.loadUint(32) + let created_at: number = slice.loadUint(32) return { kind: 'CommonMsgInfo_int_msg_info', @@ -4122,12 +4122,12 @@ let created_at: number = slice.loadUint(32) } ; if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b10))) { -slice.loadUint(2) -let src: MsgAddressExt = loadMsgAddressExt(slice) + slice.loadUint(2) + let src: MsgAddressExt = loadMsgAddressExt(slice) -let dest: MsgAddressInt = loadMsgAddressInt(slice) + let dest: MsgAddressInt = loadMsgAddressInt(slice) -let import_fee: Grams = loadGrams(slice) + let import_fee: Grams = loadGrams(slice) return { kind: 'CommonMsgInfo_ext_in_msg_info', @@ -4139,14 +4139,14 @@ let import_fee: Grams = loadGrams(slice) } ; if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b11))) { -slice.loadUint(2) -let src: MsgAddressInt = loadMsgAddressInt(slice) + slice.loadUint(2) + let src: MsgAddressInt = loadMsgAddressInt(slice) -let dest: MsgAddressExt = loadMsgAddressExt(slice) + let dest: MsgAddressExt = loadMsgAddressExt(slice) -let created_lt: number = slice.loadUint(64) + let created_lt: number = slice.loadUint(64) -let created_at: number = slice.loadUint(32) + let created_at: number = slice.loadUint(32) return { kind: 'CommonMsgInfo_ext_out_msg_info', @@ -4227,26 +4227,26 @@ export function storeCommonMsgInfo(commonMsgInfo: CommonMsgInfo): (builder: Buil export function loadCommonMsgInfoRelaxed(slice: Slice): CommonMsgInfoRelaxed { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { -slice.loadUint(1) -let ihr_disabled: Bool = loadBool(slice) + slice.loadUint(1) + let ihr_disabled: Bool = loadBool(slice) -let bounce: Bool = loadBool(slice) + let bounce: Bool = loadBool(slice) -let bounced: Bool = loadBool(slice) + let bounced: Bool = loadBool(slice) -let src: MsgAddress = loadMsgAddress(slice) + let src: MsgAddress = loadMsgAddress(slice) -let dest: MsgAddressInt = loadMsgAddressInt(slice) + let dest: MsgAddressInt = loadMsgAddressInt(slice) -let value: CurrencyCollection = loadCurrencyCollection(slice) + let value: CurrencyCollection = loadCurrencyCollection(slice) -let ihr_fee: Grams = loadGrams(slice) + let ihr_fee: Grams = loadGrams(slice) -let fwd_fee: Grams = loadGrams(slice) + let fwd_fee: Grams = loadGrams(slice) -let created_lt: number = slice.loadUint(64) + let created_lt: number = slice.loadUint(64) -let created_at: number = slice.loadUint(32) + let created_at: number = slice.loadUint(32) return { kind: 'CommonMsgInfoRelaxed_int_msg_info', @@ -4265,14 +4265,14 @@ let created_at: number = slice.loadUint(32) } ; if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b11))) { -slice.loadUint(2) -let src: MsgAddress = loadMsgAddress(slice) + slice.loadUint(2) + let src: MsgAddress = loadMsgAddress(slice) -let dest: MsgAddressExt = loadMsgAddressExt(slice) + let dest: MsgAddressExt = loadMsgAddressExt(slice) -let created_lt: number = slice.loadUint(64) + let created_lt: number = slice.loadUint(64) -let created_at: number = slice.loadUint(32) + let created_at: number = slice.loadUint(32) return { kind: 'CommonMsgInfoRelaxed_ext_out_msg_info', @@ -4366,34 +4366,34 @@ export function storeTickTock(tickTock: TickTock): (builder: Builder) => void { export function loadStateInit(slice: Slice): StateInit { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x91231967))) { -slice.loadUint(32) -let split_depth: Maybe = loadMaybe(slice, ((slice: Slice) => { - return slice.loadUint(5) + slice.loadUint(32) + let split_depth: Maybe = loadMaybe(slice, ((slice: Slice) => { + return slice.loadUint(5) - }) - ) +}) +) -let special: Maybe = loadMaybe(slice, loadTickTock) + let special: Maybe = loadMaybe(slice, loadTickTock) -let code: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() + let code: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() - return slice1 + return slice1 - }) - ) +}) +) -let data: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() + let data: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() - return slice1 + return slice1 - }) - ) +}) +) -let library: HashmapE = loadHashmapE(slice, 256, loadSimpleLib) + let library: HashmapE = loadHashmapE(slice, 256, loadSimpleLib) return { kind: 'StateInit', @@ -4682,12 +4682,12 @@ export function storeMessageRelaxed(messageRelaxed: MessageRelaxed, storeX export function loadMessageAny(slice: Slice): MessageAny { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x9c54aa4b))) { -slice.loadUint(32) -let anon0: Message = loadMessage(slice, ((slice: Slice) => { - return slice + slice.loadUint(32) + let anon0: Message = loadMessage(slice, ((slice: Slice) => { + return slice - }) - ) +}) +) return { kind: 'MessageAny', @@ -4721,8 +4721,8 @@ export function storeMessageAny(messageAny: MessageAny): (builder: Builder) => v export function loadIntermediateAddress(slice: Slice): IntermediateAddress { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { -slice.loadUint(1) -let use_dest_bits: number = slice.loadUint(bitLen(96)) + slice.loadUint(1) + let use_dest_bits: number = slice.loadUint(bitLen(96)) return { kind: 'IntermediateAddress_interm_addr_regular', @@ -4732,10 +4732,10 @@ let use_dest_bits: number = slice.loadUint(bitLen(96)) } ; if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b10))) { -slice.loadUint(2) -let workchain_id: number = slice.loadInt(8) + slice.loadUint(2) + let workchain_id: number = slice.loadInt(8) -let addr_pfx: number = slice.loadUint(64) + let addr_pfx: number = slice.loadUint(64) return { kind: 'IntermediateAddress_interm_addr_simple', @@ -4746,10 +4746,10 @@ let addr_pfx: number = slice.loadUint(64) } ; if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b11))) { -slice.loadUint(2) -let workchain_id: number = slice.loadInt(32) + slice.loadUint(2) + let workchain_id: number = slice.loadInt(32) -let addr_pfx: number = slice.loadUint(64) + let addr_pfx: number = slice.loadUint(64) return { kind: 'IntermediateAddress_interm_addr_ext', @@ -4804,20 +4804,20 @@ export function storeIntermediateAddress(intermediateAddress: IntermediateAddres export function loadMsgEnvelope(slice: Slice): MsgEnvelope { if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0x4))) { -slice.loadUint(4) -let cur_addr: IntermediateAddress = loadIntermediateAddress(slice) + slice.loadUint(4) + let cur_addr: IntermediateAddress = loadIntermediateAddress(slice) -let next_addr: IntermediateAddress = loadIntermediateAddress(slice) + let next_addr: IntermediateAddress = loadIntermediateAddress(slice) -let fwd_fee_remaining: Grams = loadGrams(slice) + let fwd_fee_remaining: Grams = loadGrams(slice) -let slice1 = slice.loadRef().beginParse() + let slice1 = slice.loadRef().beginParse() -let msg: Message = loadMessage(slice1, ((slice: Slice) => { - return slice + let msg: Message = loadMessage(slice1, ((slice: Slice) => { + return slice - }) - ) +}) +) return { kind: 'MsgEnvelope', @@ -4865,18 +4865,18 @@ export function storeMsgEnvelope(msgEnvelope: MsgEnvelope): (builder: Builder) = export function loadInMsg(slice: Slice): InMsg { if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b000))) { -slice.loadUint(3) -let slice1 = slice.loadRef().beginParse() + slice.loadUint(3) + let slice1 = slice.loadRef().beginParse() -let msg: Message = loadMessage(slice1, ((slice: Slice) => { - return slice + let msg: Message = loadMessage(slice1, ((slice: Slice) => { + return slice - }) - ) +}) +) -let slice2 = slice.loadRef().beginParse() + let slice2 = slice.loadRef().beginParse() -let transaction: Transaction = loadTransaction(slice2) + let transaction: Transaction = loadTransaction(slice2) return { kind: 'InMsg_msg_import_ext', @@ -4887,24 +4887,24 @@ let transaction: Transaction = loadTransaction(slice2) } ; if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b010))) { -slice.loadUint(3) -let slice1 = slice.loadRef().beginParse() + slice.loadUint(3) + let slice1 = slice.loadRef().beginParse() -let msg: Message = loadMessage(slice1, ((slice: Slice) => { - return slice + let msg: Message = loadMessage(slice1, ((slice: Slice) => { + return slice - }) - ) +}) +) -let slice2 = slice.loadRef().beginParse() + let slice2 = slice.loadRef().beginParse() -let transaction: Transaction = loadTransaction(slice2) + let transaction: Transaction = loadTransaction(slice2) -let ihr_fee: Grams = loadGrams(slice) + let ihr_fee: Grams = loadGrams(slice) -let slice3 = slice.loadRef().beginParse() + let slice3 = slice.loadRef().beginParse() -let proof_created: Slice = slice3 + let proof_created: Slice = slice3 return { kind: 'InMsg_msg_import_ihr', @@ -4917,16 +4917,16 @@ let proof_created: Slice = slice3 } ; if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b011))) { -slice.loadUint(3) -let slice1 = slice.loadRef().beginParse() + slice.loadUint(3) + let slice1 = slice.loadRef().beginParse() -let in_msg: MsgEnvelope = loadMsgEnvelope(slice1) + let in_msg: MsgEnvelope = loadMsgEnvelope(slice1) -let slice2 = slice.loadRef().beginParse() + let slice2 = slice.loadRef().beginParse() -let transaction: Transaction = loadTransaction(slice2) + let transaction: Transaction = loadTransaction(slice2) -let fwd_fee: Grams = loadGrams(slice) + let fwd_fee: Grams = loadGrams(slice) return { kind: 'InMsg_msg_import_imm', @@ -4938,16 +4938,16 @@ let fwd_fee: Grams = loadGrams(slice) } ; if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b100))) { -slice.loadUint(3) -let slice1 = slice.loadRef().beginParse() + slice.loadUint(3) + let slice1 = slice.loadRef().beginParse() -let in_msg: MsgEnvelope = loadMsgEnvelope(slice1) + let in_msg: MsgEnvelope = loadMsgEnvelope(slice1) -let slice2 = slice.loadRef().beginParse() + let slice2 = slice.loadRef().beginParse() -let transaction: Transaction = loadTransaction(slice2) + let transaction: Transaction = loadTransaction(slice2) -let fwd_fee: Grams = loadGrams(slice) + let fwd_fee: Grams = loadGrams(slice) return { kind: 'InMsg_msg_import_fin', @@ -4959,16 +4959,16 @@ let fwd_fee: Grams = loadGrams(slice) } ; if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b101))) { -slice.loadUint(3) -let slice1 = slice.loadRef().beginParse() + slice.loadUint(3) + let slice1 = slice.loadRef().beginParse() -let in_msg: MsgEnvelope = loadMsgEnvelope(slice1) + let in_msg: MsgEnvelope = loadMsgEnvelope(slice1) -let slice2 = slice.loadRef().beginParse() + let slice2 = slice.loadRef().beginParse() -let out_msg: MsgEnvelope = loadMsgEnvelope(slice2) + let out_msg: MsgEnvelope = loadMsgEnvelope(slice2) -let transit_fee: Grams = loadGrams(slice) + let transit_fee: Grams = loadGrams(slice) return { kind: 'InMsg_msg_import_tr', @@ -4980,14 +4980,14 @@ let transit_fee: Grams = loadGrams(slice) } ; if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b110))) { -slice.loadUint(3) -let slice1 = slice.loadRef().beginParse() + slice.loadUint(3) + let slice1 = slice.loadRef().beginParse() -let in_msg: MsgEnvelope = loadMsgEnvelope(slice1) + let in_msg: MsgEnvelope = loadMsgEnvelope(slice1) -let transaction_id: number = slice.loadUint(64) + let transaction_id: number = slice.loadUint(64) -let fwd_fee: Grams = loadGrams(slice) + let fwd_fee: Grams = loadGrams(slice) return { kind: 'InMsg_msg_discard_fin', @@ -4999,18 +4999,18 @@ let fwd_fee: Grams = loadGrams(slice) } ; if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b111))) { -slice.loadUint(3) -let slice1 = slice.loadRef().beginParse() + slice.loadUint(3) + let slice1 = slice.loadRef().beginParse() -let in_msg: MsgEnvelope = loadMsgEnvelope(slice1) + let in_msg: MsgEnvelope = loadMsgEnvelope(slice1) -let transaction_id: number = slice.loadUint(64) + let transaction_id: number = slice.loadUint(64) -let fwd_fee: Grams = loadGrams(slice) + let fwd_fee: Grams = loadGrams(slice) -let slice2 = slice.loadRef().beginParse() + let slice2 = slice.loadRef().beginParse() -let proof_delivered: Slice = slice2 + let proof_delivered: Slice = slice2 return { kind: 'InMsg_msg_discard_tr', @@ -5246,8 +5246,8 @@ export function storeImportFees(importFees: ImportFees): (builder: Builder) => v export function loadInMsgDescr(slice: Slice): InMsgDescr { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x8615b8fd))) { -slice.loadUint(32) -let anon0: HashmapAugE = loadHashmapAugE(slice, 256, loadInMsg, loadImportFees) + slice.loadUint(32) + let anon0: HashmapAugE = loadHashmapAugE(slice, 256, loadInMsg, loadImportFees) return { kind: 'InMsgDescr', @@ -5273,18 +5273,18 @@ export function storeInMsgDescr(inMsgDescr: InMsgDescr): (builder: Builder) => v export function loadOutMsg(slice: Slice): OutMsg { if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b000))) { -slice.loadUint(3) -let slice1 = slice.loadRef().beginParse() + slice.loadUint(3) + let slice1 = slice.loadRef().beginParse() -let msg: Message = loadMessage(slice1, ((slice: Slice) => { - return slice + let msg: Message = loadMessage(slice1, ((slice: Slice) => { + return slice - }) - ) +}) +) -let slice2 = slice.loadRef().beginParse() + let slice2 = slice.loadRef().beginParse() -let transaction: Transaction = loadTransaction(slice2) + let transaction: Transaction = loadTransaction(slice2) return { kind: 'OutMsg_msg_export_ext', @@ -5295,18 +5295,18 @@ let transaction: Transaction = loadTransaction(slice2) } ; if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b010))) { -slice.loadUint(3) -let slice1 = slice.loadRef().beginParse() + slice.loadUint(3) + let slice1 = slice.loadRef().beginParse() -let out_msg: MsgEnvelope = loadMsgEnvelope(slice1) + let out_msg: MsgEnvelope = loadMsgEnvelope(slice1) -let slice2 = slice.loadRef().beginParse() + let slice2 = slice.loadRef().beginParse() -let transaction: Transaction = loadTransaction(slice2) + let transaction: Transaction = loadTransaction(slice2) -let slice3 = slice.loadRef().beginParse() + let slice3 = slice.loadRef().beginParse() -let reimport: InMsg = loadInMsg(slice3) + let reimport: InMsg = loadInMsg(slice3) return { kind: 'OutMsg_msg_export_imm', @@ -5318,14 +5318,14 @@ let reimport: InMsg = loadInMsg(slice3) } ; if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b001))) { -slice.loadUint(3) -let slice1 = slice.loadRef().beginParse() + slice.loadUint(3) + let slice1 = slice.loadRef().beginParse() -let out_msg: MsgEnvelope = loadMsgEnvelope(slice1) + let out_msg: MsgEnvelope = loadMsgEnvelope(slice1) -let slice2 = slice.loadRef().beginParse() + let slice2 = slice.loadRef().beginParse() -let transaction: Transaction = loadTransaction(slice2) + let transaction: Transaction = loadTransaction(slice2) return { kind: 'OutMsg_msg_export_new', @@ -5336,14 +5336,14 @@ let transaction: Transaction = loadTransaction(slice2) } ; if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b011))) { -slice.loadUint(3) -let slice1 = slice.loadRef().beginParse() + slice.loadUint(3) + let slice1 = slice.loadRef().beginParse() -let out_msg: MsgEnvelope = loadMsgEnvelope(slice1) + let out_msg: MsgEnvelope = loadMsgEnvelope(slice1) -let slice2 = slice.loadRef().beginParse() + let slice2 = slice.loadRef().beginParse() -let imported: InMsg = loadInMsg(slice2) + let imported: InMsg = loadInMsg(slice2) return { kind: 'OutMsg_msg_export_tr', @@ -5354,12 +5354,12 @@ let imported: InMsg = loadInMsg(slice2) } ; if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b1100))) { -slice.loadUint(4) -let slice1 = slice.loadRef().beginParse() + slice.loadUint(4) + let slice1 = slice.loadRef().beginParse() -let out_msg: MsgEnvelope = loadMsgEnvelope(slice1) + let out_msg: MsgEnvelope = loadMsgEnvelope(slice1) -let import_block_lt: number = slice.loadUint(63) + let import_block_lt: number = slice.loadUint(63) return { kind: 'OutMsg_msg_export_deq', @@ -5370,14 +5370,14 @@ let import_block_lt: number = slice.loadUint(63) } ; if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b1101))) { -slice.loadUint(4) -let msg_env_hash: BitString = slice.loadBits(256) + slice.loadUint(4) + let msg_env_hash: BitString = slice.loadBits(256) -let next_workchain: number = slice.loadInt(32) + let next_workchain: number = slice.loadInt(32) -let next_addr_pfx: number = slice.loadUint(64) + let next_addr_pfx: number = slice.loadUint(64) -let import_block_lt: number = slice.loadUint(64) + let import_block_lt: number = slice.loadUint(64) return { kind: 'OutMsg_msg_export_deq_short', @@ -5390,14 +5390,14 @@ let import_block_lt: number = slice.loadUint(64) } ; if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b111))) { -slice.loadUint(3) -let slice1 = slice.loadRef().beginParse() + slice.loadUint(3) + let slice1 = slice.loadRef().beginParse() -let out_msg: MsgEnvelope = loadMsgEnvelope(slice1) + let out_msg: MsgEnvelope = loadMsgEnvelope(slice1) -let slice2 = slice.loadRef().beginParse() + let slice2 = slice.loadRef().beginParse() -let imported: InMsg = loadInMsg(slice2) + let imported: InMsg = loadInMsg(slice2) return { kind: 'OutMsg_msg_export_tr_req', @@ -5408,14 +5408,14 @@ let imported: InMsg = loadInMsg(slice2) } ; if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b100))) { -slice.loadUint(3) -let slice1 = slice.loadRef().beginParse() + slice.loadUint(3) + let slice1 = slice.loadRef().beginParse() -let out_msg: MsgEnvelope = loadMsgEnvelope(slice1) + let out_msg: MsgEnvelope = loadMsgEnvelope(slice1) -let slice2 = slice.loadRef().beginParse() + let slice2 = slice.loadRef().beginParse() -let reimport: InMsg = loadInMsg(slice2) + let reimport: InMsg = loadInMsg(slice2) return { kind: 'OutMsg_msg_export_deq_imm', @@ -5616,12 +5616,12 @@ export function storeOutMsg(outMsg: OutMsg): (builder: Builder) => void { export function loadEnqueuedMsg(slice: Slice): EnqueuedMsg { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x98cd4c6e))) { -slice.loadUint(32) -let enqueued_lt: number = slice.loadUint(64) + slice.loadUint(32) + let enqueued_lt: number = slice.loadUint(64) -let slice1 = slice.loadRef().beginParse() + let slice1 = slice.loadRef().beginParse() -let out_msg: MsgEnvelope = loadMsgEnvelope(slice1) + let out_msg: MsgEnvelope = loadMsgEnvelope(slice1) return { kind: 'EnqueuedMsg', @@ -5655,8 +5655,8 @@ export function storeEnqueuedMsg(enqueuedMsg: EnqueuedMsg): (builder: Builder) = export function loadOutMsgDescr(slice: Slice): OutMsgDescr { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xbcd61b19))) { -slice.loadUint(32) -let anon0: HashmapAugE = loadHashmapAugE(slice, 256, loadOutMsg, loadCurrencyCollection) + slice.loadUint(32) + let anon0: HashmapAugE = loadHashmapAugE(slice, 256, loadOutMsg, loadCurrencyCollection) return { kind: 'OutMsgDescr', @@ -5682,12 +5682,12 @@ export function storeOutMsgDescr(outMsgDescr: OutMsgDescr): (builder: Builder) = export function loadOutMsgQueue(slice: Slice): OutMsgQueue { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xcf5f0da2))) { -slice.loadUint(32) -let anon0: HashmapAugE = loadHashmapAugE(slice, 352, loadEnqueuedMsg, ((slice: Slice) => { - return slice.loadUint(64) + slice.loadUint(32) + let anon0: HashmapAugE = loadHashmapAugE(slice, 352, loadEnqueuedMsg, ((slice: Slice) => { + return slice.loadUint(64) - }) - ) +}) +) return { kind: 'OutMsgQueue', @@ -5748,8 +5748,8 @@ export function storeProcessedUpto(processedUpto: ProcessedUpto): (builder: Buil export function loadProcessedInfo(slice: Slice): ProcessedInfo { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x982f4fa3))) { -slice.loadUint(32) -let anon0: HashmapE = loadHashmapE(slice, 96, loadProcessedUpto) + slice.loadUint(32) + let anon0: HashmapE = loadHashmapE(slice, 96, loadProcessedUpto) return { kind: 'ProcessedInfo', @@ -5796,8 +5796,8 @@ export function storeIhrPendingSince(ihrPendingSince: IhrPendingSince): (builder export function loadIhrPendingInfo(slice: Slice): IhrPendingInfo { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xc31463df))) { -slice.loadUint(32) -let anon0: HashmapE = loadHashmapE(slice, 320, loadIhrPendingSince) + slice.loadUint(32) + let anon0: HashmapE = loadHashmapE(slice, 320, loadIhrPendingSince) return { kind: 'IhrPendingInfo', @@ -5823,12 +5823,12 @@ export function storeIhrPendingInfo(ihrPendingInfo: IhrPendingInfo): (builder: B export function loadOutMsgQueueInfo(slice: Slice): OutMsgQueueInfo { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x98bb9b21))) { -slice.loadUint(32) -let out_queue: OutMsgQueue = loadOutMsgQueue(slice) + slice.loadUint(32) + let out_queue: OutMsgQueue = loadOutMsgQueue(slice) -let proc_info: ProcessedInfo = loadProcessedInfo(slice) + let proc_info: ProcessedInfo = loadProcessedInfo(slice) -let ihr_pending: IhrPendingInfo = loadIhrPendingInfo(slice) + let ihr_pending: IhrPendingInfo = loadIhrPendingInfo(slice) return { kind: 'OutMsgQueueInfo', @@ -5953,7 +5953,7 @@ export function storeStorageInfo(storageInfo: StorageInfo): (builder: Builder) = export function loadAccount(slice: Slice): Account { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { -slice.loadUint(1) + slice.loadUint(1) return { kind: 'Account_account_none', } @@ -5961,12 +5961,12 @@ slice.loadUint(1) } ; if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { -slice.loadUint(1) -let addr: MsgAddressInt = loadMsgAddressInt(slice) + slice.loadUint(1) + let addr: MsgAddressInt = loadMsgAddressInt(slice) -let storage_stat: StorageInfo = loadStorageInfo(slice) + let storage_stat: StorageInfo = loadStorageInfo(slice) -let storage: AccountStorage = loadAccountStorage(slice) + let storage: AccountStorage = loadAccountStorage(slice) return { kind: 'Account_account', @@ -6043,7 +6043,7 @@ export function storeAccountStorage(accountStorage: AccountStorage): (builder: B export function loadAccountState(slice: Slice): AccountState { if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { -slice.loadUint(2) + slice.loadUint(2) return { kind: 'AccountState_account_uninit', } @@ -6051,8 +6051,8 @@ slice.loadUint(2) } ; if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { -slice.loadUint(1) -let _: StateInit = loadStateInit(slice) + slice.loadUint(1) + let _: StateInit = loadStateInit(slice) return { kind: 'AccountState_account_active', @@ -6062,8 +6062,8 @@ let _: StateInit = loadStateInit(slice) } ; if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b01))) { -slice.loadUint(2) -let state_hash: BitString = slice.loadBits(256) + slice.loadUint(2) + let state_hash: BitString = slice.loadBits(256) return { kind: 'AccountState_account_frozen', @@ -6111,7 +6111,7 @@ export function storeAccountState(accountState: AccountState): (builder: Builder export function loadAccountStatus(slice: Slice): AccountStatus { if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { -slice.loadUint(2) + slice.loadUint(2) return { kind: 'AccountStatus_acc_state_uninit', } @@ -6119,7 +6119,7 @@ slice.loadUint(2) } ; if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b01))) { -slice.loadUint(2) + slice.loadUint(2) return { kind: 'AccountStatus_acc_state_frozen', } @@ -6127,7 +6127,7 @@ slice.loadUint(2) } ; if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b10))) { -slice.loadUint(2) + slice.loadUint(2) return { kind: 'AccountStatus_acc_state_active', } @@ -6135,7 +6135,7 @@ slice.loadUint(2) } ; if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b11))) { -slice.loadUint(2) + slice.loadUint(2) return { kind: 'AccountStatus_acc_state_nonexist', } @@ -6253,8 +6253,8 @@ export function storeDepthBalanceInfo(depthBalanceInfo: DepthBalanceInfo): (buil export function loadShardAccounts(slice: Slice): ShardAccounts { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xa59aef08))) { -slice.loadUint(32) -let anon0: HashmapAugE = loadHashmapAugE(slice, 256, loadShardAccount, loadDepthBalanceInfo) + slice.loadUint(32) + let anon0: HashmapAugE = loadHashmapAugE(slice, 256, loadShardAccount, loadDepthBalanceInfo) return { kind: 'ShardAccounts', @@ -6280,60 +6280,60 @@ export function storeShardAccounts(shardAccounts: ShardAccounts): (builder: Buil export function loadTransaction(slice: Slice): Transaction { if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b0111))) { -slice.loadUint(4) -let account_addr: BitString = slice.loadBits(256) + slice.loadUint(4) + let account_addr: BitString = slice.loadBits(256) -let lt: number = slice.loadUint(64) + let lt: number = slice.loadUint(64) -let prev_trans_hash: BitString = slice.loadBits(256) + let prev_trans_hash: BitString = slice.loadBits(256) -let prev_trans_lt: number = slice.loadUint(64) + let prev_trans_lt: number = slice.loadUint(64) -let now: number = slice.loadUint(32) + let now: number = slice.loadUint(32) -let outmsg_cnt: number = slice.loadUint(15) + let outmsg_cnt: number = slice.loadUint(15) -let orig_status: AccountStatus = loadAccountStatus(slice) + let orig_status: AccountStatus = loadAccountStatus(slice) -let end_status: AccountStatus = loadAccountStatus(slice) + let end_status: AccountStatus = loadAccountStatus(slice) -let slice1 = slice.loadRef().beginParse() - -let in_msg: Maybe> = loadMaybe>(slice1, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() + let slice1 = slice.loadRef().beginParse() + let in_msg: Maybe> = loadMaybe>(slice1, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() - return loadMessage(slice1, ((slice: Slice) => { - return slice - }) - ) + return loadMessage(slice1, ((slice: Slice) => { + return slice }) ) -let out_msgs: HashmapE> = loadHashmapE>(slice1, 15, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() +}) +) + let out_msgs: HashmapE> = loadHashmapE>(slice1, 15, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() - return loadMessage(slice1, ((slice: Slice) => { - return slice - }) - ) + return loadMessage(slice1, ((slice: Slice) => { + return slice }) ) -let total_fees: CurrencyCollection = loadCurrencyCollection(slice) +}) +) -let slice2 = slice.loadRef().beginParse() + let total_fees: CurrencyCollection = loadCurrencyCollection(slice) -let state_update: HASH_UPDATE = loadHASH_UPDATE(slice2, loadAccount) + let slice2 = slice.loadRef().beginParse() -let slice3 = slice.loadRef().beginParse() + let state_update: HASH_UPDATE = loadHASH_UPDATE(slice2, loadAccount) -let description: TransactionDescr = loadTransactionDescr(slice3) + let slice3 = slice.loadRef().beginParse() + + let description: TransactionDescr = loadTransactionDescr(slice3) return { kind: 'Transaction', @@ -6455,18 +6455,18 @@ export function storeTransaction(transaction: Transaction): (builder: Builder) = export function loadMERKLE_UPDATE(slice: Slice, loadX: (slice: Slice) => X ): MERKLE_UPDATE { if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x02))) { -slice.loadUint(8) -let old_hash: BitString = slice.loadBits(256) + slice.loadUint(8) + let old_hash: BitString = slice.loadBits(256) -let new_hash: BitString = slice.loadBits(256) + let new_hash: BitString = slice.loadBits(256) -let slice1 = slice.loadRef().beginParse() + let slice1 = slice.loadRef().beginParse() -let old: X = loadX(slice1) + let old: X = loadX(slice1) -let slice2 = slice.loadRef().beginParse() + let slice2 = slice.loadRef().beginParse() -let new0: X = loadX(slice2) + let new0: X = loadX(slice2) return { kind: 'MERKLE_UPDATE', @@ -6514,10 +6514,10 @@ export function storeMERKLE_UPDATE(mERKLE_UPDATE: MERKLE_UPDATE, storeX: ( export function loadHASH_UPDATE(slice: Slice, loadX: (slice: Slice) => X ): HASH_UPDATE { if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x72))) { -slice.loadUint(8) -let old_hash: BitString = slice.loadBits(256) + slice.loadUint(8) + let old_hash: BitString = slice.loadBits(256) -let new_hash: BitString = slice.loadBits(256) + let new_hash: BitString = slice.loadBits(256) return { kind: 'HASH_UPDATE', @@ -6549,14 +6549,14 @@ export function storeHASH_UPDATE(hASH_UPDATE: HASH_UPDATE, storeX: (x: X) export function loadMERKLE_PROOF(slice: Slice, loadX: (slice: Slice) => X ): MERKLE_PROOF { if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x03))) { -slice.loadUint(8) -let virtual_hash: BitString = slice.loadBits(256) + slice.loadUint(8) + let virtual_hash: BitString = slice.loadBits(256) -let depth: number = slice.loadUint(16) + let depth: number = slice.loadUint(16) -let slice1 = slice.loadRef().beginParse() + let slice1 = slice.loadRef().beginParse() -let virtual_root: X = loadX(slice1) + let virtual_root: X = loadX(slice1) return { kind: 'MERKLE_PROOF', @@ -6595,21 +6595,21 @@ export function storeMERKLE_PROOF(mERKLE_PROOF: MERKLE_PROOF, storeX: (x: export function loadAccountBlock(slice: Slice): AccountBlock { if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0x5))) { -slice.loadUint(4) -let account_addr: BitString = slice.loadBits(256) + slice.loadUint(4) + let account_addr: BitString = slice.loadBits(256) -let transactions: HashmapAug = loadHashmapAug(slice, 64, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() + let transactions: HashmapAug = loadHashmapAug(slice, 64, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() - return loadTransaction(slice1) + return loadTransaction(slice1) - }) - , loadCurrencyCollection) +}) +, loadCurrencyCollection) -let slice1 = slice.loadRef().beginParse() + let slice1 = slice.loadRef().beginParse() -let state_update: HASH_UPDATE = loadHASH_UPDATE(slice1, loadAccount) + let state_update: HASH_UPDATE = loadHASH_UPDATE(slice1, loadAccount) return { kind: 'AccountBlock', @@ -6660,8 +6660,8 @@ export function storeAccountBlock(accountBlock: AccountBlock): (builder: Builder export function loadShardAccountBlocks(slice: Slice): ShardAccountBlocks { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xdc67c889))) { -slice.loadUint(32) -let anon0: HashmapAugE = loadHashmapAugE(slice, 256, loadAccountBlock, loadCurrencyCollection) + slice.loadUint(32) + let anon0: HashmapAugE = loadHashmapAugE(slice, 256, loadAccountBlock, loadCurrencyCollection) return { kind: 'ShardAccountBlocks', @@ -6720,7 +6720,7 @@ export function storeTrStoragePhase(trStoragePhase: TrStoragePhase): (builder: B export function loadAccStatusChange(slice: Slice): AccStatusChange { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { -slice.loadUint(1) + slice.loadUint(1) return { kind: 'AccStatusChange_acst_unchanged', } @@ -6728,7 +6728,7 @@ slice.loadUint(1) } ; if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b10))) { -slice.loadUint(2) + slice.loadUint(2) return { kind: 'AccStatusChange_acst_frozen', } @@ -6736,7 +6736,7 @@ slice.loadUint(2) } ; if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b11))) { -slice.loadUint(2) + slice.loadUint(2) return { kind: 'AccStatusChange_acst_deleted', } @@ -6805,8 +6805,8 @@ export function storeTrCreditPhase(trCreditPhase: TrCreditPhase): (builder: Buil export function loadTrComputePhase(slice: Slice): TrComputePhase { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { -slice.loadUint(1) -let reason: ComputeSkipReason = loadComputeSkipReason(slice) + slice.loadUint(1) + let reason: ComputeSkipReason = loadComputeSkipReason(slice) return { kind: 'TrComputePhase_tr_phase_compute_skipped', @@ -6816,42 +6816,42 @@ let reason: ComputeSkipReason = loadComputeSkipReason(slice) } ; if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { -slice.loadUint(1) -let success: Bool = loadBool(slice) + slice.loadUint(1) + let success: Bool = loadBool(slice) -let msg_state_used: Bool = loadBool(slice) + let msg_state_used: Bool = loadBool(slice) -let account_activated: Bool = loadBool(slice) + let account_activated: Bool = loadBool(slice) -let gas_fees: Grams = loadGrams(slice) + let gas_fees: Grams = loadGrams(slice) -let slice1 = slice.loadRef().beginParse() + let slice1 = slice.loadRef().beginParse() -let gas_used: VarUInteger = loadVarUInteger(slice1, 7) + let gas_used: VarUInteger = loadVarUInteger(slice1, 7) -let gas_limit: VarUInteger = loadVarUInteger(slice1, 7) + let gas_limit: VarUInteger = loadVarUInteger(slice1, 7) -let gas_credit: Maybe = loadMaybe(slice1, ((slice: Slice) => { - return loadVarUInteger(slice, 3) + let gas_credit: Maybe = loadMaybe(slice1, ((slice: Slice) => { + return loadVarUInteger(slice, 3) - }) - ) +}) +) -let mode: number = slice1.loadInt(8) + let mode: number = slice1.loadInt(8) -let exit_code: number = slice1.loadInt(32) + let exit_code: number = slice1.loadInt(32) -let exit_arg: Maybe = loadMaybe(slice1, ((slice: Slice) => { - return slice1.loadInt(32) + let exit_arg: Maybe = loadMaybe(slice1, ((slice: Slice) => { + return slice1.loadInt(32) - }) - ) +}) +) -let vm_steps: number = slice1.loadUint(32) + let vm_steps: number = slice1.loadUint(32) -let vm_init_state_hash: BitString = slice1.loadBits(256) + let vm_init_state_hash: BitString = slice1.loadBits(256) -let vm_final_state_hash: BitString = slice1.loadBits(256) + let vm_final_state_hash: BitString = slice1.loadBits(256) return { kind: 'TrComputePhase_tr_phase_compute_vm', @@ -6948,7 +6948,7 @@ export function storeTrComputePhase(trComputePhase: TrComputePhase): (builder: B export function loadComputeSkipReason(slice: Slice): ComputeSkipReason { if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { -slice.loadUint(2) + slice.loadUint(2) return { kind: 'ComputeSkipReason_cskip_no_state', } @@ -6956,7 +6956,7 @@ slice.loadUint(2) } ; if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b01))) { -slice.loadUint(2) + slice.loadUint(2) return { kind: 'ComputeSkipReason_cskip_bad_state', } @@ -6964,7 +6964,7 @@ slice.loadUint(2) } ; if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b10))) { -slice.loadUint(2) + slice.loadUint(2) return { kind: 'ComputeSkipReason_cskip_no_gas', } @@ -7117,7 +7117,7 @@ export function storeTrActionPhase(trActionPhase: TrActionPhase): (builder: Buil export function loadTrBouncePhase(slice: Slice): TrBouncePhase { if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { -slice.loadUint(2) + slice.loadUint(2) return { kind: 'TrBouncePhase_tr_phase_bounce_negfunds', } @@ -7125,10 +7125,10 @@ slice.loadUint(2) } ; if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b01))) { -slice.loadUint(2) -let msg_size: StorageUsedShort = loadStorageUsedShort(slice) + slice.loadUint(2) + let msg_size: StorageUsedShort = loadStorageUsedShort(slice) -let req_fwd_fees: Grams = loadGrams(slice) + let req_fwd_fees: Grams = loadGrams(slice) return { kind: 'TrBouncePhase_tr_phase_bounce_nofunds', @@ -7139,12 +7139,12 @@ let req_fwd_fees: Grams = loadGrams(slice) } ; if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { -slice.loadUint(1) -let msg_size: StorageUsedShort = loadStorageUsedShort(slice) + slice.loadUint(1) + let msg_size: StorageUsedShort = loadStorageUsedShort(slice) -let msg_fees: Grams = loadGrams(slice) + let msg_fees: Grams = loadGrams(slice) -let fwd_fees: Grams = loadGrams(slice) + let fwd_fees: Grams = loadGrams(slice) return { kind: 'TrBouncePhase_tr_phase_bounce_ok', @@ -7200,29 +7200,29 @@ export function storeTrBouncePhase(trBouncePhase: TrBouncePhase): (builder: Buil export function loadTransactionDescr(slice: Slice): TransactionDescr { if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b0000))) { -slice.loadUint(4) -let credit_first: Bool = loadBool(slice) + slice.loadUint(4) + let credit_first: Bool = loadBool(slice) -let storage_ph: Maybe = loadMaybe(slice, loadTrStoragePhase) + let storage_ph: Maybe = loadMaybe(slice, loadTrStoragePhase) -let credit_ph: Maybe = loadMaybe(slice, loadTrCreditPhase) + let credit_ph: Maybe = loadMaybe(slice, loadTrCreditPhase) -let compute_ph: TrComputePhase = loadTrComputePhase(slice) + let compute_ph: TrComputePhase = loadTrComputePhase(slice) -let action: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() + let action: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() - return loadTrActionPhase(slice1) + return loadTrActionPhase(slice1) - }) - ) +}) +) -let aborted: Bool = loadBool(slice) + let aborted: Bool = loadBool(slice) -let bounce: Maybe = loadMaybe(slice, loadTrBouncePhase) + let bounce: Maybe = loadMaybe(slice, loadTrBouncePhase) -let destroyed: Bool = loadBool(slice) + let destroyed: Bool = loadBool(slice) return { kind: 'TransactionDescr_trans_ord', @@ -7239,8 +7239,8 @@ let destroyed: Bool = loadBool(slice) } ; if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b0001))) { -slice.loadUint(4) -let storage_ph: TrStoragePhase = loadTrStoragePhase(slice) + slice.loadUint(4) + let storage_ph: TrStoragePhase = loadTrStoragePhase(slice) return { kind: 'TransactionDescr_trans_storage', @@ -7250,25 +7250,25 @@ let storage_ph: TrStoragePhase = loadTrStoragePhase(slice) } ; if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b001))) { -slice.loadUint(3) -let is_tock: Bool = loadBool(slice) + slice.loadUint(3) + let is_tock: Bool = loadBool(slice) -let storage_ph: TrStoragePhase = loadTrStoragePhase(slice) + let storage_ph: TrStoragePhase = loadTrStoragePhase(slice) -let compute_ph: TrComputePhase = loadTrComputePhase(slice) + let compute_ph: TrComputePhase = loadTrComputePhase(slice) -let action: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() + let action: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() - return loadTrActionPhase(slice1) + return loadTrActionPhase(slice1) - }) - ) +}) +) -let aborted: Bool = loadBool(slice) + let aborted: Bool = loadBool(slice) -let destroyed: Bool = loadBool(slice) + let destroyed: Bool = loadBool(slice) return { kind: 'TransactionDescr_trans_tick_tock', @@ -7283,25 +7283,25 @@ let destroyed: Bool = loadBool(slice) } ; if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b0100))) { -slice.loadUint(4) -let split_info: SplitMergeInfo = loadSplitMergeInfo(slice) + slice.loadUint(4) + let split_info: SplitMergeInfo = loadSplitMergeInfo(slice) -let storage_ph: Maybe = loadMaybe(slice, loadTrStoragePhase) + let storage_ph: Maybe = loadMaybe(slice, loadTrStoragePhase) -let compute_ph: TrComputePhase = loadTrComputePhase(slice) + let compute_ph: TrComputePhase = loadTrComputePhase(slice) -let action: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() + let action: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() - return loadTrActionPhase(slice1) + return loadTrActionPhase(slice1) - }) - ) +}) +) -let aborted: Bool = loadBool(slice) + let aborted: Bool = loadBool(slice) -let destroyed: Bool = loadBool(slice) + let destroyed: Bool = loadBool(slice) return { kind: 'TransactionDescr_trans_split_prepare', @@ -7316,14 +7316,14 @@ let destroyed: Bool = loadBool(slice) } ; if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b0101))) { -slice.loadUint(4) -let split_info: SplitMergeInfo = loadSplitMergeInfo(slice) + slice.loadUint(4) + let split_info: SplitMergeInfo = loadSplitMergeInfo(slice) -let slice1 = slice.loadRef().beginParse() + let slice1 = slice.loadRef().beginParse() -let prepare_transaction: Transaction = loadTransaction(slice1) + let prepare_transaction: Transaction = loadTransaction(slice1) -let installed: Bool = loadBool(slice) + let installed: Bool = loadBool(slice) return { kind: 'TransactionDescr_trans_split_install', @@ -7335,12 +7335,12 @@ let installed: Bool = loadBool(slice) } ; if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b0110))) { -slice.loadUint(4) -let split_info: SplitMergeInfo = loadSplitMergeInfo(slice) + slice.loadUint(4) + let split_info: SplitMergeInfo = loadSplitMergeInfo(slice) -let storage_ph: TrStoragePhase = loadTrStoragePhase(slice) + let storage_ph: TrStoragePhase = loadTrStoragePhase(slice) -let aborted: Bool = loadBool(slice) + let aborted: Bool = loadBool(slice) return { kind: 'TransactionDescr_trans_merge_prepare', @@ -7352,31 +7352,31 @@ let aborted: Bool = loadBool(slice) } ; if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b0111))) { -slice.loadUint(4) -let split_info: SplitMergeInfo = loadSplitMergeInfo(slice) + slice.loadUint(4) + let split_info: SplitMergeInfo = loadSplitMergeInfo(slice) -let slice1 = slice.loadRef().beginParse() + let slice1 = slice.loadRef().beginParse() -let prepare_transaction: Transaction = loadTransaction(slice1) + let prepare_transaction: Transaction = loadTransaction(slice1) -let storage_ph: Maybe = loadMaybe(slice, loadTrStoragePhase) + let storage_ph: Maybe = loadMaybe(slice, loadTrStoragePhase) -let credit_ph: Maybe = loadMaybe(slice, loadTrCreditPhase) + let credit_ph: Maybe = loadMaybe(slice, loadTrCreditPhase) -let compute_ph: TrComputePhase = loadTrComputePhase(slice) + let compute_ph: TrComputePhase = loadTrComputePhase(slice) -let action: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() + let action: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() - return loadTrActionPhase(slice1) + return loadTrActionPhase(slice1) - }) - ) +}) +) -let aborted: Bool = loadBool(slice) + let aborted: Bool = loadBool(slice) -let destroyed: Bool = loadBool(slice) + let destroyed: Bool = loadBool(slice) return { kind: 'TransactionDescr_trans_merge_install', @@ -7634,22 +7634,22 @@ export function storeSplitMergeInfo(splitMergeInfo: SplitMergeInfo): (builder: B export function loadSmartContractInfo(slice: Slice): SmartContractInfo { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x076ef1ea))) { -slice.loadUint(32) -let actions: number = slice.loadUint(16) + slice.loadUint(32) + let actions: number = slice.loadUint(16) -let msgs_sent: number = slice.loadUint(16) + let msgs_sent: number = slice.loadUint(16) -let unixtime: number = slice.loadUint(32) + let unixtime: number = slice.loadUint(32) -let block_lt: number = slice.loadUint(64) + let block_lt: number = slice.loadUint(64) -let trans_lt: number = slice.loadUint(64) + let trans_lt: number = slice.loadUint(64) -let rand_seed: BitString = slice.loadBits(256) + let rand_seed: BitString = slice.loadBits(256) -let balance_remaining: CurrencyCollection = loadCurrencyCollection(slice) + let balance_remaining: CurrencyCollection = loadCurrencyCollection(slice) -let myself: MsgAddressInt = loadMsgAddressInt(slice) + let myself: MsgAddressInt = loadMsgAddressInt(slice) return { kind: 'SmartContractInfo', @@ -7703,11 +7703,11 @@ export function loadOutList(slice: Slice, arg0: number): OutList { } ; if (true) { -let slice1 = slice.loadRef().beginParse() + let slice1 = slice.loadRef().beginParse() -let prev: OutList = loadOutList(slice1, (arg0 - 1)) + let prev: OutList = loadOutList(slice1, (arg0 - 1)) -let action: OutAction = loadOutAction(slice) + let action: OutAction = loadOutAction(slice) return { kind: 'OutList_out_list', @@ -7750,16 +7750,16 @@ export function storeOutList(outList: OutList): (builder: Builder) => void { export function loadOutAction(slice: Slice): OutAction { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x0ec3c86d))) { -slice.loadUint(32) -let mode: number = slice.loadUint(8) + slice.loadUint(32) + let mode: number = slice.loadUint(8) -let slice1 = slice.loadRef().beginParse() + let slice1 = slice.loadRef().beginParse() -let out_msg: MessageRelaxed = loadMessageRelaxed(slice1, ((slice: Slice) => { - return slice + let out_msg: MessageRelaxed = loadMessageRelaxed(slice1, ((slice: Slice) => { + return slice - }) - ) +}) +) return { kind: 'OutAction_action_send_msg', @@ -7770,10 +7770,10 @@ let out_msg: MessageRelaxed = loadMessageRelaxed(slice1, ((slice: } ; if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xad4de08e))) { -slice.loadUint(32) -let slice1 = slice.loadRef().beginParse() + slice.loadUint(32) + let slice1 = slice.loadRef().beginParse() -let new_code: Slice = slice1 + let new_code: Slice = slice1 return { kind: 'OutAction_action_set_code', @@ -7783,10 +7783,10 @@ let new_code: Slice = slice1 } ; if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x36e6b809))) { -slice.loadUint(32) -let mode: number = slice.loadUint(8) + slice.loadUint(32) + let mode: number = slice.loadUint(8) -let currency: CurrencyCollection = loadCurrencyCollection(slice) + let currency: CurrencyCollection = loadCurrencyCollection(slice) return { kind: 'OutAction_action_reserve_currency', @@ -7797,13 +7797,13 @@ let currency: CurrencyCollection = loadCurrencyCollection(slice) } ; if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x26fa1dd4))) { -slice.loadUint(32) -let mode: number = slice.loadUint(7) + slice.loadUint(32) + let mode: number = slice.loadUint(7) -let libref: LibRef = loadLibRef(slice) + let libref: LibRef = loadLibRef(slice) if ((!(mode <= 2))) { -throw new Error('') + throw new Error('') } return { kind: 'OutAction_action_change_library', @@ -7879,7 +7879,7 @@ export function storeOutAction(outAction: OutAction): (builder: Builder) => void storeLibRef(outAction.libref)(builder) if ((!(outAction.mode <= 2))) { - throw new Error('') + throw new Error('') } }) @@ -7892,8 +7892,8 @@ export function storeOutAction(outAction: OutAction): (builder: Builder) => void export function loadLibRef(slice: Slice): LibRef { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { -slice.loadUint(1) -let lib_hash: BitString = slice.loadBits(256) + slice.loadUint(1) + let lib_hash: BitString = slice.loadBits(256) return { kind: 'LibRef_libref_hash', @@ -7903,10 +7903,10 @@ let lib_hash: BitString = slice.loadBits(256) } ; if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { -slice.loadUint(1) -let slice1 = slice.loadRef().beginParse() + slice.loadUint(1) + let slice1 = slice.loadRef().beginParse() -let library: Slice = slice1 + let library: Slice = slice1 return { kind: 'LibRef_libref_ref', @@ -7986,12 +7986,12 @@ export function storeOutListNode(outListNode: OutListNode): (builder: Builder) = export function loadShardIdent(slice: Slice): ShardIdent { if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { -slice.loadUint(2) -let shard_pfx_bits: number = slice.loadUint(bitLen(60)) + slice.loadUint(2) + let shard_pfx_bits: number = slice.loadUint(bitLen(60)) -let workchain_id: number = slice.loadInt(32) + let workchain_id: number = slice.loadInt(32) -let shard_prefix: number = slice.loadUint(64) + let shard_prefix: number = slice.loadUint(64) return { kind: 'ShardIdent', @@ -8122,53 +8122,53 @@ export function storeBlkMasterInfo(blkMasterInfo: BlkMasterInfo): (builder: Buil export function loadShardStateUnsplit(slice: Slice): ShardStateUnsplit { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x9023afe2))) { -slice.loadUint(32) -let global_id: number = slice.loadInt(32) + slice.loadUint(32) + let global_id: number = slice.loadInt(32) -let shard_id: ShardIdent = loadShardIdent(slice) + let shard_id: ShardIdent = loadShardIdent(slice) -let seq_no: number = slice.loadUint(32) + let seq_no: number = slice.loadUint(32) -let vert_seq_no: number = slice.loadUint(32) + let vert_seq_no: number = slice.loadUint(32) -let gen_utime: number = slice.loadUint(32) + let gen_utime: number = slice.loadUint(32) -let gen_lt: number = slice.loadUint(64) + let gen_lt: number = slice.loadUint(64) -let min_ref_mc_seqno: number = slice.loadUint(32) + let min_ref_mc_seqno: number = slice.loadUint(32) -let slice1 = slice.loadRef().beginParse() + let slice1 = slice.loadRef().beginParse() -let out_msg_queue_info: OutMsgQueueInfo = loadOutMsgQueueInfo(slice1) + let out_msg_queue_info: OutMsgQueueInfo = loadOutMsgQueueInfo(slice1) -let before_split: number = slice.loadUint(1) + let before_split: number = slice.loadUint(1) -let slice2 = slice.loadRef().beginParse() + let slice2 = slice.loadRef().beginParse() -let accounts: ShardAccounts = loadShardAccounts(slice2) + let accounts: ShardAccounts = loadShardAccounts(slice2) -let slice3 = slice.loadRef().beginParse() + let slice3 = slice.loadRef().beginParse() -let overload_history: number = slice3.loadUint(64) + let overload_history: number = slice3.loadUint(64) -let underload_history: number = slice3.loadUint(64) + let underload_history: number = slice3.loadUint(64) -let total_balance: CurrencyCollection = loadCurrencyCollection(slice3) + let total_balance: CurrencyCollection = loadCurrencyCollection(slice3) -let total_validator_fees: CurrencyCollection = loadCurrencyCollection(slice3) + let total_validator_fees: CurrencyCollection = loadCurrencyCollection(slice3) -let libraries: HashmapE = loadHashmapE(slice3, 256, loadLibDescr) + let libraries: HashmapE = loadHashmapE(slice3, 256, loadLibDescr) -let master_ref: Maybe = loadMaybe(slice3, loadBlkMasterInfo) + let master_ref: Maybe = loadMaybe(slice3, loadBlkMasterInfo) -let custom: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() + let custom: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() - return loadMcStateExtra(slice1) + return loadMcStateExtra(slice1) - }) - ) +}) +) return { kind: 'ShardStateUnsplit', @@ -8271,8 +8271,8 @@ export function storeShardStateUnsplit(shardStateUnsplit: ShardStateUnsplit): (b export function loadShardState(slice: Slice): ShardState { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x81e52440))) { -slice.loadUint(32) -let anon0: ShardStateUnsplit = loadShardStateUnsplit(slice) + slice.loadUint(32) + let anon0: ShardStateUnsplit = loadShardStateUnsplit(slice) return { kind: 'ShardState__', @@ -8282,14 +8282,14 @@ let anon0: ShardStateUnsplit = loadShardStateUnsplit(slice) } ; if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x5f327da5))) { -slice.loadUint(32) -let slice1 = slice.loadRef().beginParse() + slice.loadUint(32) + let slice1 = slice.loadRef().beginParse() -let left: ShardStateUnsplit = loadShardStateUnsplit(slice1) + let left: ShardStateUnsplit = loadShardStateUnsplit(slice1) -let slice2 = slice.loadRef().beginParse() + let slice2 = slice.loadRef().beginParse() -let right: ShardStateUnsplit = loadShardStateUnsplit(slice2) + let right: ShardStateUnsplit = loadShardStateUnsplit(slice2) return { kind: 'ShardState_split_state', @@ -8342,12 +8342,12 @@ export function storeShardState(shardState: ShardState): (builder: Builder) => v export function loadLibDescr(slice: Slice): LibDescr { if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { -slice.loadUint(2) -let slice1 = slice.loadRef().beginParse() + slice.loadUint(2) + let slice1 = slice.loadRef().beginParse() -let lib: Slice = slice1 + let lib: Slice = slice1 -let publishers: Hashmap = loadHashmap(slice, 256, loadTrue) + let publishers: Hashmap = loadHashmap(slice, 256, loadTrue) return { kind: 'LibDescr', @@ -8381,76 +8381,76 @@ export function storeLibDescr(libDescr: LibDescr): (builder: Builder) => void { export function loadBlockInfo(slice: Slice): BlockInfo { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x9bc7a987))) { -slice.loadUint(32) -let version: number = slice.loadUint(32) + slice.loadUint(32) + let version: number = slice.loadUint(32) -let not_master: number = slice.loadUint(1) + let not_master: number = slice.loadUint(1) -let after_merge: number = slice.loadUint(1) + let after_merge: number = slice.loadUint(1) -let before_split: number = slice.loadUint(1) + let before_split: number = slice.loadUint(1) -let after_split: number = slice.loadUint(1) + let after_split: number = slice.loadUint(1) -let want_split: Bool = loadBool(slice) + let want_split: Bool = loadBool(slice) -let want_merge: Bool = loadBool(slice) + let want_merge: Bool = loadBool(slice) -let key_block: Bool = loadBool(slice) + let key_block: Bool = loadBool(slice) -let vert_seqno_incr: number = slice.loadUint(1) + let vert_seqno_incr: number = slice.loadUint(1) -let flags: number = slice.loadUint(8) + let flags: number = slice.loadUint(8) -let seq_no: number = slice.loadUint(32) + let seq_no: number = slice.loadUint(32) -let vert_seq_no: number = slice.loadUint(32) + let vert_seq_no: number = slice.loadUint(32) -let shard: ShardIdent = loadShardIdent(slice) + let shard: ShardIdent = loadShardIdent(slice) -let gen_utime: number = slice.loadUint(32) + let gen_utime: number = slice.loadUint(32) -let start_lt: number = slice.loadUint(64) + let start_lt: number = slice.loadUint(64) -let end_lt: number = slice.loadUint(64) + let end_lt: number = slice.loadUint(64) -let gen_validator_list_hash_short: number = slice.loadUint(32) + let gen_validator_list_hash_short: number = slice.loadUint(32) -let gen_catchain_seqno: number = slice.loadUint(32) + let gen_catchain_seqno: number = slice.loadUint(32) -let min_ref_mc_seqno: number = slice.loadUint(32) + let min_ref_mc_seqno: number = slice.loadUint(32) -let prev_key_block_seqno: number = slice.loadUint(32) + let prev_key_block_seqno: number = slice.loadUint(32) -let gen_software: GlobalVersion | undefined = ((flags & (1 << 0)) ? loadGlobalVersion(slice) : undefined) + let gen_software: GlobalVersion | undefined = ((flags & (1 << 0)) ? loadGlobalVersion(slice) : undefined) -let master_ref: BlkMasterInfo | undefined = (not_master ? ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() + let master_ref: BlkMasterInfo | undefined = (not_master ? ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() - return loadBlkMasterInfo(slice1) + return loadBlkMasterInfo(slice1) - }) - (slice) : undefined) +}) +(slice) : undefined) -let slice1 = slice.loadRef().beginParse() + let slice1 = slice.loadRef().beginParse() -let prev_ref: BlkPrevInfo = loadBlkPrevInfo(slice1, after_merge) + let prev_ref: BlkPrevInfo = loadBlkPrevInfo(slice1, after_merge) -let prev_vert_ref: BlkPrevInfo | undefined = (vert_seqno_incr ? ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() + let prev_vert_ref: BlkPrevInfo | undefined = (vert_seqno_incr ? ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() - return loadBlkPrevInfo(slice1, 0) + return loadBlkPrevInfo(slice1, 0) - }) - (slice) : undefined) +}) +(slice) : undefined) if ((!(flags <= 1))) { -throw new Error('') + throw new Error('') } if ((!(vert_seq_no >= vert_seqno_incr))) { -throw new Error('') + throw new Error('') } return { kind: 'BlockInfo', @@ -8532,7 +8532,7 @@ export function storeBlockInfo(blockInfo: BlockInfo): (builder: Builder) => void builder.storeUint(blockInfo.prev_key_block_seqno, 32) if ((blockInfo.gen_software != undefined)) { - storeGlobalVersion(blockInfo.gen_software)(builder) + storeGlobalVersion(blockInfo.gen_software)(builder) } if ((blockInfo.master_ref != undefined)) { @@ -8563,11 +8563,11 @@ export function storeBlockInfo(blockInfo: BlockInfo): (builder: Builder) => void } if ((!(blockInfo.flags <= 1))) { - throw new Error('') + throw new Error('') } if ((!(blockInfo.vert_seq_no >= blockInfo.vert_seqno_incr))) { - throw new Error('') + throw new Error('') } }) @@ -8577,7 +8577,7 @@ export function storeBlockInfo(blockInfo: BlockInfo): (builder: Builder) => void export function loadBlkPrevInfo(slice: Slice, arg0: number): BlkPrevInfo { if ((arg0 == 0)) { -let prev: ExtBlkRef = loadExtBlkRef(slice) + let prev: ExtBlkRef = loadExtBlkRef(slice) return { kind: 'BlkPrevInfo_prev_blk_info', @@ -8587,13 +8587,13 @@ let prev: ExtBlkRef = loadExtBlkRef(slice) } ; if ((arg0 == 1)) { -let slice1 = slice.loadRef().beginParse() + let slice1 = slice.loadRef().beginParse() -let prev1: ExtBlkRef = loadExtBlkRef(slice1) + let prev1: ExtBlkRef = loadExtBlkRef(slice1) -let slice2 = slice.loadRef().beginParse() + let slice2 = slice.loadRef().beginParse() -let prev2: ExtBlkRef = loadExtBlkRef(slice2) + let prev2: ExtBlkRef = loadExtBlkRef(slice2) return { kind: 'BlkPrevInfo_prev_blks_info', @@ -8642,24 +8642,24 @@ export function storeBlkPrevInfo(blkPrevInfo: BlkPrevInfo): (builder: Builder) = export function loadBlock(slice: Slice): Block { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x11ef55aa))) { -slice.loadUint(32) -let global_id: number = slice.loadInt(32) + slice.loadUint(32) + let global_id: number = slice.loadInt(32) -let slice1 = slice.loadRef().beginParse() + let slice1 = slice.loadRef().beginParse() -let info: BlockInfo = loadBlockInfo(slice1) + let info: BlockInfo = loadBlockInfo(slice1) -let slice2 = slice.loadRef().beginParse() + let slice2 = slice.loadRef().beginParse() -let value_flow: ValueFlow = loadValueFlow(slice2) + let value_flow: ValueFlow = loadValueFlow(slice2) -let slice3 = slice.loadRef().beginParse() + let slice3 = slice.loadRef().beginParse() -let state_update: MERKLE_UPDATE = loadMERKLE_UPDATE(slice3, loadShardState) + let state_update: MERKLE_UPDATE = loadMERKLE_UPDATE(slice3, loadShardState) -let slice4 = slice.loadRef().beginParse() + let slice4 = slice.loadRef().beginParse() -let extra: BlockExtra = loadBlockExtra(slice4) + let extra: BlockExtra = loadBlockExtra(slice4) return { kind: 'Block', @@ -8717,31 +8717,31 @@ export function storeBlock(block: Block): (builder: Builder) => void { export function loadBlockExtra(slice: Slice): BlockExtra { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x8e7f7ff8))) { -slice.loadUint(32) -let slice1 = slice.loadRef().beginParse() + slice.loadUint(32) + let slice1 = slice.loadRef().beginParse() -let in_msg_descr: InMsgDescr = loadInMsgDescr(slice1) + let in_msg_descr: InMsgDescr = loadInMsgDescr(slice1) -let slice2 = slice.loadRef().beginParse() + let slice2 = slice.loadRef().beginParse() -let out_msg_descr: OutMsgDescr = loadOutMsgDescr(slice2) + let out_msg_descr: OutMsgDescr = loadOutMsgDescr(slice2) -let slice3 = slice.loadRef().beginParse() + let slice3 = slice.loadRef().beginParse() -let account_blocks: ShardAccountBlocks = loadShardAccountBlocks(slice3) + let account_blocks: ShardAccountBlocks = loadShardAccountBlocks(slice3) -let rand_seed: BitString = slice.loadBits(256) + let rand_seed: BitString = slice.loadBits(256) -let created_by: BitString = slice.loadBits(256) + let created_by: BitString = slice.loadBits(256) -let custom: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() + let custom: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() - return loadMcBlockExtra(slice1) + return loadMcBlockExtra(slice1) - }) - ) +}) +) return { kind: 'BlockExtra', @@ -8811,28 +8811,28 @@ export function storeBlockExtra(blockExtra: BlockExtra): (builder: Builder) => v export function loadValueFlow(slice: Slice): ValueFlow { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x98055e37))) { -slice.loadUint(32) -let slice1 = slice.loadRef().beginParse() + slice.loadUint(32) + let slice1 = slice.loadRef().beginParse() -let from_prev_blk: CurrencyCollection = loadCurrencyCollection(slice1) + let from_prev_blk: CurrencyCollection = loadCurrencyCollection(slice1) -let to_next_blk: CurrencyCollection = loadCurrencyCollection(slice1) + let to_next_blk: CurrencyCollection = loadCurrencyCollection(slice1) -let imported: CurrencyCollection = loadCurrencyCollection(slice1) + let imported: CurrencyCollection = loadCurrencyCollection(slice1) -let exported: CurrencyCollection = loadCurrencyCollection(slice1) + let exported: CurrencyCollection = loadCurrencyCollection(slice1) -let fees_collected: CurrencyCollection = loadCurrencyCollection(slice) + let fees_collected: CurrencyCollection = loadCurrencyCollection(slice) -let slice2 = slice.loadRef().beginParse() + let slice2 = slice.loadRef().beginParse() -let fees_imported: CurrencyCollection = loadCurrencyCollection(slice2) + let fees_imported: CurrencyCollection = loadCurrencyCollection(slice2) -let recovered: CurrencyCollection = loadCurrencyCollection(slice2) + let recovered: CurrencyCollection = loadCurrencyCollection(slice2) -let created: CurrencyCollection = loadCurrencyCollection(slice2) + let created: CurrencyCollection = loadCurrencyCollection(slice2) -let minted: CurrencyCollection = loadCurrencyCollection(slice2) + let minted: CurrencyCollection = loadCurrencyCollection(slice2) return { kind: 'ValueFlow', @@ -8893,8 +8893,8 @@ export function storeValueFlow(valueFlow: ValueFlow): (builder: Builder) => void export function loadBinTree(slice: Slice, loadX: (slice: Slice) => X ): BinTree { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { -slice.loadUint(1) -let leaf: X = loadX(slice) + slice.loadUint(1) + let leaf: X = loadX(slice) return { kind: 'BinTree_bt_leaf', @@ -8904,14 +8904,14 @@ let leaf: X = loadX(slice) } ; if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { -slice.loadUint(1) -let slice1 = slice.loadRef().beginParse() + slice.loadUint(1) + let slice1 = slice.loadRef().beginParse() -let left: BinTree = loadBinTree(slice1, loadX) + let left: BinTree = loadBinTree(slice1, loadX) -let slice2 = slice.loadRef().beginParse() + let slice2 = slice.loadRef().beginParse() -let right: BinTree = loadBinTree(slice2, loadX) + let right: BinTree = loadBinTree(slice2, loadX) return { kind: 'BinTree_bt_fork', @@ -8966,7 +8966,7 @@ export function storeBinTree(binTree: BinTree, storeX: (x: X) => (builder: export function loadFutureSplitMerge(slice: Slice): FutureSplitMerge { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { -slice.loadUint(1) + slice.loadUint(1) return { kind: 'FutureSplitMerge_fsm_none', } @@ -8974,10 +8974,10 @@ slice.loadUint(1) } ; if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b10))) { -slice.loadUint(2) -let split_utime: number = slice.loadUint(32) + slice.loadUint(2) + let split_utime: number = slice.loadUint(32) -let interval: number = slice.loadUint(32) + let interval: number = slice.loadUint(32) return { kind: 'FutureSplitMerge_fsm_split', @@ -8988,10 +8988,10 @@ let interval: number = slice.loadUint(32) } ; if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b11))) { -slice.loadUint(2) -let merge_utime: number = slice.loadUint(32) + slice.loadUint(2) + let merge_utime: number = slice.loadUint(32) -let interval: number = slice.loadUint(32) + let interval: number = slice.loadUint(32) return { kind: 'FutureSplitMerge_fsm_merge', @@ -9044,47 +9044,47 @@ export function storeFutureSplitMerge(futureSplitMerge: FutureSplitMerge): (buil export function loadShardDescr(slice: Slice): ShardDescr { if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0xb))) { -slice.loadUint(4) -let seq_no: number = slice.loadUint(32) + slice.loadUint(4) + let seq_no: number = slice.loadUint(32) -let reg_mc_seqno: number = slice.loadUint(32) + let reg_mc_seqno: number = slice.loadUint(32) -let start_lt: number = slice.loadUint(64) + let start_lt: number = slice.loadUint(64) -let end_lt: number = slice.loadUint(64) + let end_lt: number = slice.loadUint(64) -let root_hash: BitString = slice.loadBits(256) + let root_hash: BitString = slice.loadBits(256) -let file_hash: BitString = slice.loadBits(256) + let file_hash: BitString = slice.loadBits(256) -let before_split: Bool = loadBool(slice) + let before_split: Bool = loadBool(slice) -let before_merge: Bool = loadBool(slice) + let before_merge: Bool = loadBool(slice) -let want_split: Bool = loadBool(slice) + let want_split: Bool = loadBool(slice) -let want_merge: Bool = loadBool(slice) + let want_merge: Bool = loadBool(slice) -let nx_cc_updated: Bool = loadBool(slice) + let nx_cc_updated: Bool = loadBool(slice) -let flags: number = slice.loadUint(3) + let flags: number = slice.loadUint(3) -let next_catchain_seqno: number = slice.loadUint(32) + let next_catchain_seqno: number = slice.loadUint(32) -let next_validator_shard: number = slice.loadUint(64) + let next_validator_shard: number = slice.loadUint(64) -let min_ref_mc_seqno: number = slice.loadUint(32) + let min_ref_mc_seqno: number = slice.loadUint(32) -let gen_utime: number = slice.loadUint(32) + let gen_utime: number = slice.loadUint(32) -let split_merge_at: FutureSplitMerge = loadFutureSplitMerge(slice) + let split_merge_at: FutureSplitMerge = loadFutureSplitMerge(slice) -let fees_collected: CurrencyCollection = loadCurrencyCollection(slice) + let fees_collected: CurrencyCollection = loadCurrencyCollection(slice) -let funds_created: CurrencyCollection = loadCurrencyCollection(slice) + let funds_created: CurrencyCollection = loadCurrencyCollection(slice) if ((!(flags == 0))) { -throw new Error('') + throw new Error('') } return { kind: 'ShardDescr_shard_descr', @@ -9112,49 +9112,49 @@ throw new Error('') } ; if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0xa))) { -slice.loadUint(4) -let seq_no: number = slice.loadUint(32) + slice.loadUint(4) + let seq_no: number = slice.loadUint(32) -let reg_mc_seqno: number = slice.loadUint(32) + let reg_mc_seqno: number = slice.loadUint(32) -let start_lt: number = slice.loadUint(64) + let start_lt: number = slice.loadUint(64) -let end_lt: number = slice.loadUint(64) + let end_lt: number = slice.loadUint(64) -let root_hash: BitString = slice.loadBits(256) + let root_hash: BitString = slice.loadBits(256) -let file_hash: BitString = slice.loadBits(256) + let file_hash: BitString = slice.loadBits(256) -let before_split: Bool = loadBool(slice) + let before_split: Bool = loadBool(slice) -let before_merge: Bool = loadBool(slice) + let before_merge: Bool = loadBool(slice) -let want_split: Bool = loadBool(slice) + let want_split: Bool = loadBool(slice) -let want_merge: Bool = loadBool(slice) + let want_merge: Bool = loadBool(slice) -let nx_cc_updated: Bool = loadBool(slice) + let nx_cc_updated: Bool = loadBool(slice) -let flags: number = slice.loadUint(3) + let flags: number = slice.loadUint(3) -let next_catchain_seqno: number = slice.loadUint(32) + let next_catchain_seqno: number = slice.loadUint(32) -let next_validator_shard: number = slice.loadUint(64) + let next_validator_shard: number = slice.loadUint(64) -let min_ref_mc_seqno: number = slice.loadUint(32) + let min_ref_mc_seqno: number = slice.loadUint(32) -let gen_utime: number = slice.loadUint(32) + let gen_utime: number = slice.loadUint(32) -let split_merge_at: FutureSplitMerge = loadFutureSplitMerge(slice) + let split_merge_at: FutureSplitMerge = loadFutureSplitMerge(slice) -let slice1 = slice.loadRef().beginParse() + let slice1 = slice.loadRef().beginParse() -let fees_collected: CurrencyCollection = loadCurrencyCollection(slice1) + let fees_collected: CurrencyCollection = loadCurrencyCollection(slice1) -let funds_created: CurrencyCollection = loadCurrencyCollection(slice1) + let funds_created: CurrencyCollection = loadCurrencyCollection(slice1) if ((!(flags == 0))) { -throw new Error('') + throw new Error('') } return { kind: 'ShardDescr_shard_descr_new', @@ -9229,7 +9229,7 @@ export function storeShardDescr(shardDescr: ShardDescr): (builder: Builder) => v storeCurrencyCollection(shardDescr.funds_created)(builder) if ((!(shardDescr.flags == 0))) { - throw new Error('') + throw new Error('') } }) @@ -9284,7 +9284,7 @@ export function storeShardDescr(shardDescr: ShardDescr): (builder: Builder) => v builder.storeRef(cell1) if ((!(shardDescr.flags == 0))) { - throw new Error('') + throw new Error('') } }) @@ -9297,15 +9297,15 @@ export function storeShardDescr(shardDescr: ShardDescr): (builder: Builder) => v export function loadShardHashes(slice: Slice): ShardHashes { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xd7c80ab1))) { -slice.loadUint(32) -let anon0: HashmapE> = loadHashmapE>(slice, 32, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() + slice.loadUint(32) + let anon0: HashmapE> = loadHashmapE>(slice, 32, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() - return loadBinTree(slice1, loadShardDescr) + return loadBinTree(slice1, loadShardDescr) - }) - ) +}) +) return { kind: 'ShardHashes', @@ -9347,10 +9347,10 @@ export function loadBinTreeAug(slice: Slice, loadX: (slice: Slice) => X , loadY: (slice: Slice) => Y ): BinTreeAug { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { -slice.loadUint(1) -let extra: Y = loadY(slice) + slice.loadUint(1) + let extra: Y = loadY(slice) -let leaf: X = loadX(slice) + let leaf: X = loadX(slice) return { kind: 'BinTreeAug_bta_leaf', @@ -9361,16 +9361,16 @@ let leaf: X = loadX(slice) } ; if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { -slice.loadUint(1) -let slice1 = slice.loadRef().beginParse() + slice.loadUint(1) + let slice1 = slice.loadRef().beginParse() -let left: BinTreeAug = loadBinTreeAug(slice1, loadX, loadY) + let left: BinTreeAug = loadBinTreeAug(slice1, loadX, loadY) -let slice2 = slice.loadRef().beginParse() + let slice2 = slice.loadRef().beginParse() -let right: BinTreeAug = loadBinTreeAug(slice2, loadX, loadY) + let right: BinTreeAug = loadBinTreeAug(slice2, loadX, loadY) -let extra: Y = loadY(slice) + let extra: Y = loadY(slice) return { kind: 'BinTreeAug_bta_fork', @@ -9432,10 +9432,10 @@ export function storeBinTreeAug(binTreeAug: BinTreeAug, storeX: (x: export function loadShardFeeCreated(slice: Slice): ShardFeeCreated { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xe537952e))) { -slice.loadUint(32) -let fees: CurrencyCollection = loadCurrencyCollection(slice) + slice.loadUint(32) + let fees: CurrencyCollection = loadCurrencyCollection(slice) -let create: CurrencyCollection = loadCurrencyCollection(slice) + let create: CurrencyCollection = loadCurrencyCollection(slice) return { kind: 'ShardFeeCreated', @@ -9464,8 +9464,8 @@ export function storeShardFeeCreated(shardFeeCreated: ShardFeeCreated): (builder export function loadShardFees(slice: Slice): ShardFees { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xfea0d880))) { -slice.loadUint(32) -let anon0: HashmapAugE = loadHashmapAugE(slice, 96, loadShardFeeCreated, loadShardFeeCreated) + slice.loadUint(32) + let anon0: HashmapAugE = loadHashmapAugE(slice, 96, loadShardFeeCreated, loadShardFeeCreated) return { kind: 'ShardFees', @@ -9491,19 +9491,19 @@ export function storeShardFees(shardFees: ShardFees): (builder: Builder) => void export function loadConfigParams(slice: Slice): ConfigParams { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x88116702))) { -slice.loadUint(32) -let config_addr: BitString = slice.loadBits(256) + slice.loadUint(32) + let config_addr: BitString = slice.loadBits(256) -let slice1 = slice.loadRef().beginParse() + let slice1 = slice.loadRef().beginParse() -let config: Hashmap = loadHashmap(slice1, 32, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() + let config: Hashmap = loadHashmap(slice1, 32, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() - return slice1 + return slice1 - }) - ) +}) +) return { kind: 'ConfigParams', @@ -9611,10 +9611,10 @@ export function storeValidatorBaseInfo(validatorBaseInfo: ValidatorBaseInfo): (b export function loadKeyMaxLt(slice: Slice): KeyMaxLt { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x9a6d79a5))) { -slice.loadUint(32) -let key: Bool = loadBool(slice) + slice.loadUint(32) + let key: Bool = loadBool(slice) -let max_end_lt: number = slice.loadUint(64) + let max_end_lt: number = slice.loadUint(64) return { kind: 'KeyMaxLt', @@ -9643,10 +9643,10 @@ export function storeKeyMaxLt(keyMaxLt: KeyMaxLt): (builder: Builder) => void { export function loadKeyExtBlkRef(slice: Slice): KeyExtBlkRef { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xafeab488))) { -slice.loadUint(32) -let key: Bool = loadBool(slice) + slice.loadUint(32) + let key: Bool = loadBool(slice) -let blk_ref: ExtBlkRef = loadExtBlkRef(slice) + let blk_ref: ExtBlkRef = loadExtBlkRef(slice) return { kind: 'KeyExtBlkRef', @@ -9675,8 +9675,8 @@ export function storeKeyExtBlkRef(keyExtBlkRef: KeyExtBlkRef): (builder: Builder export function loadOldMcBlocksInfo(slice: Slice): OldMcBlocksInfo { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xf385c1e3))) { -slice.loadUint(32) -let anon0: HashmapAugE = loadHashmapAugE(slice, 32, loadKeyExtBlkRef, loadKeyMaxLt) + slice.loadUint(32) + let anon0: HashmapAugE = loadHashmapAugE(slice, 32, loadKeyExtBlkRef, loadKeyMaxLt) return { kind: 'OldMcBlocksInfo', @@ -9741,10 +9741,10 @@ export function storeCounters(counters: Counters): (builder: Builder) => void { export function loadCreatorStats(slice: Slice): CreatorStats { if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0x4))) { -slice.loadUint(4) -let mc_blocks: Counters = loadCounters(slice) + slice.loadUint(4) + let mc_blocks: Counters = loadCounters(slice) -let shard_blocks: Counters = loadCounters(slice) + let shard_blocks: Counters = loadCounters(slice) return { kind: 'CreatorStats', @@ -9773,8 +9773,8 @@ export function storeCreatorStats(creatorStats: CreatorStats): (builder: Builder export function loadBlockCreateStats(slice: Slice): BlockCreateStats { if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x17))) { -slice.loadUint(8) -let counters: HashmapE = loadHashmapE(slice, 256, loadCreatorStats) + slice.loadUint(8) + let counters: HashmapE = loadHashmapE(slice, 256, loadCreatorStats) return { kind: 'BlockCreateStats_block_create_stats', @@ -9784,12 +9784,12 @@ let counters: HashmapE = loadHashmapE(slice, 256, lo } ; if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x34))) { -slice.loadUint(8) -let counters: HashmapAugE = loadHashmapAugE(slice, 256, loadCreatorStats, ((slice: Slice) => { - return slice.loadUint(32) + slice.loadUint(8) + let counters: HashmapAugE = loadHashmapAugE(slice, 256, loadCreatorStats, ((slice: Slice) => { + return slice.loadUint(32) - }) - ) +}) +) return { kind: 'BlockCreateStats_block_create_stats_ext', @@ -9837,26 +9837,26 @@ export function storeBlockCreateStats(blockCreateStats: BlockCreateStats): (buil export function loadMcStateExtra(slice: Slice): McStateExtra { if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0xcc26))) { -slice.loadUint(16) -let shard_hashes: ShardHashes = loadShardHashes(slice) + slice.loadUint(16) + let shard_hashes: ShardHashes = loadShardHashes(slice) -let config: ConfigParams = loadConfigParams(slice) + let config: ConfigParams = loadConfigParams(slice) -let slice1 = slice.loadRef().beginParse() + let slice1 = slice.loadRef().beginParse() -let flags: number = slice1.loadUint(16) + let flags: number = slice1.loadUint(16) -let validator_info: ValidatorInfo = loadValidatorInfo(slice1) + let validator_info: ValidatorInfo = loadValidatorInfo(slice1) -let prev_blocks: OldMcBlocksInfo = loadOldMcBlocksInfo(slice1) + let prev_blocks: OldMcBlocksInfo = loadOldMcBlocksInfo(slice1) -let after_key_block: Bool = loadBool(slice1) + let after_key_block: Bool = loadBool(slice1) -let last_key_block: Maybe = loadMaybe(slice1, loadExtBlkRef) + let last_key_block: Maybe = loadMaybe(slice1, loadExtBlkRef) -let block_create_stats: BlockCreateStats | undefined = ((flags & (1 << 0)) ? loadBlockCreateStats(slice1) : undefined) + let block_create_stats: BlockCreateStats | undefined = ((flags & (1 << 0)) ? loadBlockCreateStats(slice1) : undefined) -let global_balance: CurrencyCollection = loadCurrencyCollection(slice) + let global_balance: CurrencyCollection = loadCurrencyCollection(slice) return { kind: 'McStateExtra', @@ -9899,7 +9899,7 @@ export function storeMcStateExtra(mcStateExtra: McStateExtra): (builder: Builder storeMaybe(mcStateExtra.last_key_block, storeExtBlkRef)(cell1) if ((mcStateExtra.block_create_stats != undefined)) { - storeBlockCreateStats(mcStateExtra.block_create_stats)(cell1) + storeBlockCreateStats(mcStateExtra.block_create_stats)(cell1) } builder.storeRef(cell1) @@ -9913,8 +9913,8 @@ export function storeMcStateExtra(mcStateExtra: McStateExtra): (builder: Builder export function loadSigPubKey(slice: Slice): SigPubKey { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x8e81278a))) { -slice.loadUint(32) -let pubkey: BitString = slice.loadBits(256) + slice.loadUint(32) + let pubkey: BitString = slice.loadBits(256) return { kind: 'SigPubKey', @@ -9940,10 +9940,10 @@ export function storeSigPubKey(sigPubKey: SigPubKey): (builder: Builder) => void export function loadCryptoSignatureSimple(slice: Slice): CryptoSignatureSimple { if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0x5))) { -slice.loadUint(4) -let R: BitString = slice.loadBits(256) + slice.loadUint(4) + let R: BitString = slice.loadBits(256) -let s: BitString = slice.loadBits(256) + let s: BitString = slice.loadBits(256) return { kind: 'CryptoSignatureSimple', @@ -9972,8 +9972,8 @@ export function storeCryptoSignatureSimple(cryptoSignatureSimple: CryptoSignatur export function loadCryptoSignature(slice: Slice): CryptoSignature { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xdaa99887))) { -slice.loadUint(32) -let anon0: CryptoSignatureSimple = loadCryptoSignatureSimple(slice) + slice.loadUint(32) + let anon0: CryptoSignatureSimple = loadCryptoSignatureSimple(slice) return { kind: 'CryptoSignature__', @@ -9983,12 +9983,12 @@ let anon0: CryptoSignatureSimple = loadCryptoSignatureSimple(slice) } ; if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0xf))) { -slice.loadUint(4) -let slice1 = slice.loadRef().beginParse() + slice.loadUint(4) + let slice1 = slice.loadRef().beginParse() -let signed_cert: SignedCertificate = loadSignedCertificate(slice1) + let signed_cert: SignedCertificate = loadSignedCertificate(slice1) -let temp_key_signature: CryptoSignatureSimple = loadCryptoSignatureSimple(slice) + let temp_key_signature: CryptoSignatureSimple = loadCryptoSignatureSimple(slice) return { kind: 'CryptoSignature_chained_signature', @@ -10063,12 +10063,12 @@ export function storeCryptoSignaturePair(cryptoSignaturePair: CryptoSignaturePai export function loadCertificate(slice: Slice): Certificate { if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0x4))) { -slice.loadUint(4) -let temp_key: SigPubKey = loadSigPubKey(slice) + slice.loadUint(4) + let temp_key: SigPubKey = loadSigPubKey(slice) -let valid_since: number = slice.loadUint(32) + let valid_since: number = slice.loadUint(32) -let valid_until: number = slice.loadUint(32) + let valid_until: number = slice.loadUint(32) return { kind: 'Certificate', @@ -10100,8 +10100,8 @@ export function storeCertificate(certificate: Certificate): (builder: Builder) = export function loadCertificateEnv(slice: Slice): CertificateEnv { if (((slice.remainingBits >= 28) && (slice.preloadUint(28) == 0xa419b7d))) { -slice.loadUint(28) -let certificate: Certificate = loadCertificate(slice) + slice.loadUint(28) + let certificate: Certificate = loadCertificate(slice) return { kind: 'CertificateEnv', @@ -10154,36 +10154,36 @@ export function storeSignedCertificate(signedCertificate: SignedCertificate): (b export function loadMcBlockExtra(slice: Slice): McBlockExtra { if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0xcca5))) { -slice.loadUint(16) -let key_block: number = slice.loadUint(1) + slice.loadUint(16) + let key_block: number = slice.loadUint(1) -let shard_hashes: ShardHashes = loadShardHashes(slice) + let shard_hashes: ShardHashes = loadShardHashes(slice) -let shard_fees: ShardFees = loadShardFees(slice) + let shard_fees: ShardFees = loadShardFees(slice) -let slice1 = slice.loadRef().beginParse() + let slice1 = slice.loadRef().beginParse() -let prev_blk_signatures: HashmapE = loadHashmapE(slice1, 16, loadCryptoSignaturePair) + let prev_blk_signatures: HashmapE = loadHashmapE(slice1, 16, loadCryptoSignaturePair) -let recover_create_msg: Maybe = loadMaybe(slice1, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() + let recover_create_msg: Maybe = loadMaybe(slice1, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() - return loadInMsg(slice1) + return loadInMsg(slice1) - }) - ) +}) +) -let mint_msg: Maybe = loadMaybe(slice1, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() + let mint_msg: Maybe = loadMaybe(slice1, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() - return loadInMsg(slice1) + return loadInMsg(slice1) - }) - ) +}) +) -let config: ConfigParams | undefined = (key_block ? loadConfigParams(slice) : undefined) + let config: ConfigParams | undefined = (key_block ? loadConfigParams(slice) : undefined) return { kind: 'McBlockExtra', @@ -10252,7 +10252,7 @@ export function storeMcBlockExtra(mcBlockExtra: McBlockExtra): (builder: Builder builder.storeRef(cell1) if ((mcBlockExtra.config != undefined)) { - storeConfigParams(mcBlockExtra.config)(builder) + storeConfigParams(mcBlockExtra.config)(builder) } }) @@ -10262,10 +10262,10 @@ export function storeMcBlockExtra(mcBlockExtra: McBlockExtra): (builder: Builder export function loadValidatorDescr(slice: Slice): ValidatorDescr { if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x53))) { -slice.loadUint(8) -let public_key: SigPubKey = loadSigPubKey(slice) + slice.loadUint(8) + let public_key: SigPubKey = loadSigPubKey(slice) -let weight: number = slice.loadUint(64) + let weight: number = slice.loadUint(64) return { kind: 'ValidatorDescr_validator', @@ -10276,12 +10276,12 @@ let weight: number = slice.loadUint(64) } ; if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x73))) { -slice.loadUint(8) -let public_key: SigPubKey = loadSigPubKey(slice) + slice.loadUint(8) + let public_key: SigPubKey = loadSigPubKey(slice) -let weight: number = slice.loadUint(64) + let weight: number = slice.loadUint(64) -let adnl_addr: BitString = slice.loadBits(256) + let adnl_addr: BitString = slice.loadBits(256) return { kind: 'ValidatorDescr_validator_addr', @@ -10329,22 +10329,22 @@ export function storeValidatorDescr(validatorDescr: ValidatorDescr): (builder: B export function loadValidatorSet(slice: Slice): ValidatorSet { if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x11))) { -slice.loadUint(8) -let utime_since: number = slice.loadUint(32) + slice.loadUint(8) + let utime_since: number = slice.loadUint(32) -let utime_until: number = slice.loadUint(32) + let utime_until: number = slice.loadUint(32) -let total: number = slice.loadUint(16) + let total: number = slice.loadUint(16) -let main: number = slice.loadUint(16) + let main: number = slice.loadUint(16) -let list: Hashmap = loadHashmap(slice, 16, loadValidatorDescr) + let list: Hashmap = loadHashmap(slice, 16, loadValidatorDescr) if ((!(main <= total))) { -throw new Error('') + throw new Error('') } if ((!(main >= 1))) { -throw new Error('') + throw new Error('') } return { kind: 'ValidatorSet_validators', @@ -10358,24 +10358,24 @@ throw new Error('') } ; if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x12))) { -slice.loadUint(8) -let utime_since: number = slice.loadUint(32) + slice.loadUint(8) + let utime_since: number = slice.loadUint(32) -let utime_until: number = slice.loadUint(32) + let utime_until: number = slice.loadUint(32) -let total: number = slice.loadUint(16) + let total: number = slice.loadUint(16) -let main: number = slice.loadUint(16) + let main: number = slice.loadUint(16) -let total_weight: number = slice.loadUint(64) + let total_weight: number = slice.loadUint(64) -let list: HashmapE = loadHashmapE(slice, 16, loadValidatorDescr) + let list: HashmapE = loadHashmapE(slice, 16, loadValidatorDescr) if ((!(main <= total))) { -throw new Error('') + throw new Error('') } if ((!(main >= 1))) { -throw new Error('') + throw new Error('') } return { kind: 'ValidatorSet_validators_ext', @@ -10409,11 +10409,11 @@ export function storeValidatorSet(validatorSet: ValidatorSet): (builder: Builder storeHashmap(validatorSet.list, storeValidatorDescr)(builder) if ((!(validatorSet.main <= validatorSet.total))) { - throw new Error('') + throw new Error('') } if ((!(validatorSet.main >= 1))) { - throw new Error('') + throw new Error('') } }) @@ -10437,11 +10437,11 @@ export function storeValidatorSet(validatorSet: ValidatorSet): (builder: Builder storeHashmapE(validatorSet.list, storeValidatorDescr)(builder) if ((!(validatorSet.main <= validatorSet.total))) { - throw new Error('') + throw new Error('') } if ((!(validatorSet.main >= 1))) { - throw new Error('') + throw new Error('') } }) @@ -10454,8 +10454,8 @@ export function storeValidatorSet(validatorSet: ValidatorSet): (builder: Builder export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xbc7f2648) && (arg0 == 0)))) { -slice.loadUint(32) -let config_addr: BitString = slice.loadBits(256) + slice.loadUint(32) + let config_addr: BitString = slice.loadBits(256) return { kind: 'ConfigParam__', @@ -10465,8 +10465,8 @@ let config_addr: BitString = slice.loadBits(256) } ; if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x84659d0d) && (arg0 == 1)))) { -slice.loadUint(32) -let elector_addr: BitString = slice.loadBits(256) + slice.loadUint(32) + let elector_addr: BitString = slice.loadBits(256) return { kind: 'ConfigParam__1', @@ -10476,8 +10476,8 @@ let elector_addr: BitString = slice.loadBits(256) } ; if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x8648b2c4) && (arg0 == 2)))) { -slice.loadUint(32) -let minter_addr: BitString = slice.loadBits(256) + slice.loadUint(32) + let minter_addr: BitString = slice.loadBits(256) return { kind: 'ConfigParam__2', @@ -10487,8 +10487,8 @@ let minter_addr: BitString = slice.loadBits(256) } ; if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x8a752dc5) && (arg0 == 3)))) { -slice.loadUint(32) -let fee_collector_addr: BitString = slice.loadBits(256) + slice.loadUint(32) + let fee_collector_addr: BitString = slice.loadBits(256) return { kind: 'ConfigParam__3', @@ -10498,8 +10498,8 @@ let fee_collector_addr: BitString = slice.loadBits(256) } ; if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x8ceae93f) && (arg0 == 4)))) { -slice.loadUint(32) -let dns_root_addr: BitString = slice.loadBits(256) + slice.loadUint(32) + let dns_root_addr: BitString = slice.loadBits(256) return { kind: 'ConfigParam__4', @@ -10509,10 +10509,10 @@ let dns_root_addr: BitString = slice.loadBits(256) } ; if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xb2571db5) && (arg0 == 6)))) { -slice.loadUint(32) -let mint_new_price: Grams = loadGrams(slice) + slice.loadUint(32) + let mint_new_price: Grams = loadGrams(slice) -let mint_add_price: Grams = loadGrams(slice) + let mint_add_price: Grams = loadGrams(slice) return { kind: 'ConfigParam__5', @@ -10523,8 +10523,8 @@ let mint_add_price: Grams = loadGrams(slice) } ; if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xd2115c6f) && (arg0 == 7)))) { -slice.loadUint(32) -let to_mint: ExtraCurrencyCollection = loadExtraCurrencyCollection(slice) + slice.loadUint(32) + let to_mint: ExtraCurrencyCollection = loadExtraCurrencyCollection(slice) return { kind: 'ConfigParam__6', @@ -10534,8 +10534,8 @@ let to_mint: ExtraCurrencyCollection = loadExtraCurrencyCollection(slice) } ; if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xb19d2da6) && (arg0 == 8)))) { -slice.loadUint(32) -let anon0: GlobalVersion = loadGlobalVersion(slice) + slice.loadUint(32) + let anon0: GlobalVersion = loadGlobalVersion(slice) return { kind: 'ConfigParam__7', @@ -10545,8 +10545,8 @@ let anon0: GlobalVersion = loadGlobalVersion(slice) } ; if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x8f3b81de) && (arg0 == 9)))) { -slice.loadUint(32) -let mandatory_params: Hashmap = loadHashmap(slice, 32, loadTrue) + slice.loadUint(32) + let mandatory_params: Hashmap = loadHashmap(slice, 32, loadTrue) return { kind: 'ConfigParam__8', @@ -10556,8 +10556,8 @@ let mandatory_params: Hashmap = loadHashmap(slice, 32, loadTrue) } ; if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xfbcb8998) && (arg0 == 10)))) { -slice.loadUint(32) -let critical_params: Hashmap = loadHashmap(slice, 32, loadTrue) + slice.loadUint(32) + let critical_params: Hashmap = loadHashmap(slice, 32, loadTrue) return { kind: 'ConfigParam__9', @@ -10567,8 +10567,8 @@ let critical_params: Hashmap = loadHashmap(slice, 32, loadTrue) } ; if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x9358b12f) && (arg0 == 11)))) { -slice.loadUint(32) -let anon0: ConfigVotingSetup = loadConfigVotingSetup(slice) + slice.loadUint(32) + let anon0: ConfigVotingSetup = loadConfigVotingSetup(slice) return { kind: 'ConfigParam__10', @@ -10578,8 +10578,8 @@ let anon0: ConfigVotingSetup = loadConfigVotingSetup(slice) } ; if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x9059857d) && (arg0 == 12)))) { -slice.loadUint(32) -let workchains: HashmapE = loadHashmapE(slice, 32, loadWorkchainDescr) + slice.loadUint(32) + let workchains: HashmapE = loadHashmapE(slice, 32, loadWorkchainDescr) return { kind: 'ConfigParam__11', @@ -10589,8 +10589,8 @@ let workchains: HashmapE = loadHashmapE(slice, 3 } ; if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xe8ae7dd3) && (arg0 == 13)))) { -slice.loadUint(32) -let anon0: ComplaintPricing = loadComplaintPricing(slice) + slice.loadUint(32) + let anon0: ComplaintPricing = loadComplaintPricing(slice) return { kind: 'ConfigParam__12', @@ -10600,8 +10600,8 @@ let anon0: ComplaintPricing = loadComplaintPricing(slice) } ; if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xf282db94) && (arg0 == 14)))) { -slice.loadUint(32) -let anon0: BlockCreateFees = loadBlockCreateFees(slice) + slice.loadUint(32) + let anon0: BlockCreateFees = loadBlockCreateFees(slice) return { kind: 'ConfigParam__13', @@ -10611,14 +10611,14 @@ let anon0: BlockCreateFees = loadBlockCreateFees(slice) } ; if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xed67ebd2) && (arg0 == 15)))) { -slice.loadUint(32) -let validators_elected_for: number = slice.loadUint(32) + slice.loadUint(32) + let validators_elected_for: number = slice.loadUint(32) -let elections_start_before: number = slice.loadUint(32) + let elections_start_before: number = slice.loadUint(32) -let elections_end_before: number = slice.loadUint(32) + let elections_end_before: number = slice.loadUint(32) -let stake_held_for: number = slice.loadUint(32) + let stake_held_for: number = slice.loadUint(32) return { kind: 'ConfigParam__14', @@ -10631,21 +10631,21 @@ let stake_held_for: number = slice.loadUint(32) } ; if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xe8298d51) && (arg0 == 16)))) { -slice.loadUint(32) -let max_validators: number = slice.loadUint(16) + slice.loadUint(32) + let max_validators: number = slice.loadUint(16) -let max_main_validators: number = slice.loadUint(16) + let max_main_validators: number = slice.loadUint(16) -let min_validators: number = slice.loadUint(16) + let min_validators: number = slice.loadUint(16) if ((!(max_validators >= max_main_validators))) { -throw new Error('') + throw new Error('') } if ((!(max_main_validators >= min_validators))) { -throw new Error('') + throw new Error('') } if ((!(min_validators >= 1))) { -throw new Error('') + throw new Error('') } return { kind: 'ConfigParam__15', @@ -10657,14 +10657,14 @@ throw new Error('') } ; if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xa81c566c) && (arg0 == 17)))) { -slice.loadUint(32) -let min_stake: Grams = loadGrams(slice) + slice.loadUint(32) + let min_stake: Grams = loadGrams(slice) -let max_stake: Grams = loadGrams(slice) + let max_stake: Grams = loadGrams(slice) -let min_total_stake: Grams = loadGrams(slice) + let min_total_stake: Grams = loadGrams(slice) -let max_stake_factor: number = slice.loadUint(32) + let max_stake_factor: number = slice.loadUint(32) return { kind: 'ConfigParam__16', @@ -10677,8 +10677,8 @@ let max_stake_factor: number = slice.loadUint(32) } ; if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xeab9843a) && (arg0 == 18)))) { -slice.loadUint(32) -let anon0: Hashmap = loadHashmap(slice, 32, loadStoragePrices) + slice.loadUint(32) + let anon0: Hashmap = loadHashmap(slice, 32, loadStoragePrices) return { kind: 'ConfigParam__17', @@ -10688,8 +10688,8 @@ let anon0: Hashmap = loadHashmap(slice, 32, loadSt } ; if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xf666426a) && (arg0 == 28)))) { -slice.loadUint(32) -let anon0: CatchainConfig = loadCatchainConfig(slice) + slice.loadUint(32) + let anon0: CatchainConfig = loadCatchainConfig(slice) return { kind: 'ConfigParam__24', @@ -10699,8 +10699,8 @@ let anon0: CatchainConfig = loadCatchainConfig(slice) } ; if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xf5b85ad3) && (arg0 == 29)))) { -slice.loadUint(32) -let anon0: ConsensusConfig = loadConsensusConfig(slice) + slice.loadUint(32) + let anon0: ConsensusConfig = loadConsensusConfig(slice) return { kind: 'ConfigParam__25', @@ -10710,8 +10710,8 @@ let anon0: ConsensusConfig = loadConsensusConfig(slice) } ; if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x849fe3cc) && (arg0 == 31)))) { -slice.loadUint(32) -let fundamental_smc_addr: HashmapE = loadHashmapE(slice, 256, loadTrue) + slice.loadUint(32) + let fundamental_smc_addr: HashmapE = loadHashmapE(slice, 256, loadTrue) return { kind: 'ConfigParam__26', @@ -10721,8 +10721,8 @@ let fundamental_smc_addr: HashmapE = loadHashmapE(slice, 256, loadTr } ; if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xcfc8ceeb) && (arg0 == 32)))) { -slice.loadUint(32) -let prev_validators: ValidatorSet = loadValidatorSet(slice) + slice.loadUint(32) + let prev_validators: ValidatorSet = loadValidatorSet(slice) return { kind: 'ConfigParam__27', @@ -10732,8 +10732,8 @@ let prev_validators: ValidatorSet = loadValidatorSet(slice) } ; if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xa1a5d63c) && (arg0 == 33)))) { -slice.loadUint(32) -let prev_temp_validators: ValidatorSet = loadValidatorSet(slice) + slice.loadUint(32) + let prev_temp_validators: ValidatorSet = loadValidatorSet(slice) return { kind: 'ConfigParam__28', @@ -10743,8 +10743,8 @@ let prev_temp_validators: ValidatorSet = loadValidatorSet(slice) } ; if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xfd569be3) && (arg0 == 34)))) { -slice.loadUint(32) -let cur_validators: ValidatorSet = loadValidatorSet(slice) + slice.loadUint(32) + let cur_validators: ValidatorSet = loadValidatorSet(slice) return { kind: 'ConfigParam__29', @@ -10754,8 +10754,8 @@ let cur_validators: ValidatorSet = loadValidatorSet(slice) } ; if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xc271315a) && (arg0 == 35)))) { -slice.loadUint(32) -let cur_temp_validators: ValidatorSet = loadValidatorSet(slice) + slice.loadUint(32) + let cur_temp_validators: ValidatorSet = loadValidatorSet(slice) return { kind: 'ConfigParam__30', @@ -10765,8 +10765,8 @@ let cur_temp_validators: ValidatorSet = loadValidatorSet(slice) } ; if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x85d02f6c) && (arg0 == 36)))) { -slice.loadUint(32) -let next_validators: ValidatorSet = loadValidatorSet(slice) + slice.loadUint(32) + let next_validators: ValidatorSet = loadValidatorSet(slice) return { kind: 'ConfigParam__31', @@ -10776,8 +10776,8 @@ let next_validators: ValidatorSet = loadValidatorSet(slice) } ; if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xffa3b0f8) && (arg0 == 37)))) { -slice.loadUint(32) -let next_temp_validators: ValidatorSet = loadValidatorSet(slice) + slice.loadUint(32) + let next_temp_validators: ValidatorSet = loadValidatorSet(slice) return { kind: 'ConfigParam__32', @@ -10787,8 +10787,8 @@ let next_temp_validators: ValidatorSet = loadValidatorSet(slice) } ; if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x86dfef76) && (arg0 == 39)))) { -slice.loadUint(32) -let anon0: HashmapE = loadHashmapE(slice, 256, loadValidatorSignedTempKey) + slice.loadUint(32) + let anon0: HashmapE = loadHashmapE(slice, 256, loadValidatorSignedTempKey) return { kind: 'ConfigParam__33', @@ -10798,8 +10798,8 @@ let anon0: HashmapE = loadHashmapE= 32) && ((slice.preloadUint(32) == 0x8517b916) && (arg0 == 40)))) { -slice.loadUint(32) -let anon0: MisbehaviourPunishmentConfig = loadMisbehaviourPunishmentConfig(slice) + slice.loadUint(32) + let anon0: MisbehaviourPunishmentConfig = loadMisbehaviourPunishmentConfig(slice) return { kind: 'ConfigParam__34', @@ -10809,8 +10809,8 @@ let anon0: MisbehaviourPunishmentConfig = loadMisbehaviourPunishmentConfig(slice } ; if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xbd424af1) && (arg0 == 71)))) { -slice.loadUint(32) -let anon0: OracleBridgeParams = loadOracleBridgeParams(slice) + slice.loadUint(32) + let anon0: OracleBridgeParams = loadOracleBridgeParams(slice) return { kind: 'ConfigParam__35', @@ -10820,8 +10820,8 @@ let anon0: OracleBridgeParams = loadOracleBridgeParams(slice) } ; if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x966f1932) && (arg0 == 72)))) { -slice.loadUint(32) -let anon0: OracleBridgeParams = loadOracleBridgeParams(slice) + slice.loadUint(32) + let anon0: OracleBridgeParams = loadOracleBridgeParams(slice) return { kind: 'ConfigParam__36', @@ -10831,8 +10831,8 @@ let anon0: OracleBridgeParams = loadOracleBridgeParams(slice) } ; if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x8f742873) && (arg0 == 73)))) { -slice.loadUint(32) -let anon0: OracleBridgeParams = loadOracleBridgeParams(slice) + slice.loadUint(32) + let anon0: OracleBridgeParams = loadOracleBridgeParams(slice) return { kind: 'ConfigParam__37', @@ -10842,7 +10842,7 @@ let anon0: OracleBridgeParams = loadOracleBridgeParams(slice) } ; if ((arg0 == 20)) { -let anon0: GasLimitsPrices = loadGasLimitsPrices(slice) + let anon0: GasLimitsPrices = loadGasLimitsPrices(slice) return { kind: 'ConfigParam_config_mc_gas_prices', @@ -10852,7 +10852,7 @@ let anon0: GasLimitsPrices = loadGasLimitsPrices(slice) } ; if ((arg0 == 21)) { -let anon0: GasLimitsPrices = loadGasLimitsPrices(slice) + let anon0: GasLimitsPrices = loadGasLimitsPrices(slice) return { kind: 'ConfigParam_config_gas_prices', @@ -10862,7 +10862,7 @@ let anon0: GasLimitsPrices = loadGasLimitsPrices(slice) } ; if ((arg0 == 22)) { -let anon0: BlockLimits = loadBlockLimits(slice) + let anon0: BlockLimits = loadBlockLimits(slice) return { kind: 'ConfigParam_config_mc_block_limits', @@ -10872,7 +10872,7 @@ let anon0: BlockLimits = loadBlockLimits(slice) } ; if ((arg0 == 23)) { -let anon0: BlockLimits = loadBlockLimits(slice) + let anon0: BlockLimits = loadBlockLimits(slice) return { kind: 'ConfigParam_config_block_limits', @@ -10882,7 +10882,7 @@ let anon0: BlockLimits = loadBlockLimits(slice) } ; if ((arg0 == 24)) { -let anon0: MsgForwardPrices = loadMsgForwardPrices(slice) + let anon0: MsgForwardPrices = loadMsgForwardPrices(slice) return { kind: 'ConfigParam_config_mc_fwd_prices', @@ -10892,7 +10892,7 @@ let anon0: MsgForwardPrices = loadMsgForwardPrices(slice) } ; if ((arg0 == 25)) { -let anon0: MsgForwardPrices = loadMsgForwardPrices(slice) + let anon0: MsgForwardPrices = loadMsgForwardPrices(slice) return { kind: 'ConfigParam_config_fwd_prices', @@ -11075,15 +11075,15 @@ export function storeConfigParam(configParam: ConfigParam): (builder: Builder) = builder.storeUint(configParam.min_validators, 16) if ((!(configParam.max_validators >= configParam.max_main_validators))) { - throw new Error('') + throw new Error('') } if ((!(configParam.max_main_validators >= configParam.min_validators))) { - throw new Error('') + throw new Error('') } if ((!(configParam.min_validators >= 1))) { - throw new Error('') + throw new Error('') } }) @@ -11310,10 +11310,10 @@ export function storeConfigParam(configParam: ConfigParam): (builder: Builder) = export function loadGlobalVersion(slice: Slice): GlobalVersion { if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xc4))) { -slice.loadUint(8) -let version: number = slice.loadUint(32) + slice.loadUint(8) + let version: number = slice.loadUint(32) -let capabilities: number = slice.loadUint(64) + let capabilities: number = slice.loadUint(64) return { kind: 'GlobalVersion', @@ -11342,22 +11342,22 @@ export function storeGlobalVersion(globalVersion: GlobalVersion): (builder: Buil export function loadConfigProposalSetup(slice: Slice): ConfigProposalSetup { if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x36))) { -slice.loadUint(8) -let min_tot_rounds: number = slice.loadUint(8) + slice.loadUint(8) + let min_tot_rounds: number = slice.loadUint(8) -let max_tot_rounds: number = slice.loadUint(8) + let max_tot_rounds: number = slice.loadUint(8) -let min_wins: number = slice.loadUint(8) + let min_wins: number = slice.loadUint(8) -let max_losses: number = slice.loadUint(8) + let max_losses: number = slice.loadUint(8) -let min_store_sec: number = slice.loadUint(32) + let min_store_sec: number = slice.loadUint(32) -let max_store_sec: number = slice.loadUint(32) + let max_store_sec: number = slice.loadUint(32) -let bit_price: number = slice.loadUint(32) + let bit_price: number = slice.loadUint(32) -let _cell_price: number = slice.loadUint(32) + let _cell_price: number = slice.loadUint(32) return { kind: 'ConfigProposalSetup', @@ -11404,14 +11404,14 @@ export function storeConfigProposalSetup(configProposalSetup: ConfigProposalSetu export function loadConfigVotingSetup(slice: Slice): ConfigVotingSetup { if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x91))) { -slice.loadUint(8) -let slice1 = slice.loadRef().beginParse() + slice.loadUint(8) + let slice1 = slice.loadRef().beginParse() -let normal_params: ConfigProposalSetup = loadConfigProposalSetup(slice1) + let normal_params: ConfigProposalSetup = loadConfigProposalSetup(slice1) -let slice2 = slice.loadRef().beginParse() + let slice2 = slice.loadRef().beginParse() -let critical_params: ConfigProposalSetup = loadConfigProposalSetup(slice2) + let critical_params: ConfigProposalSetup = loadConfigProposalSetup(slice2) return { kind: 'ConfigVotingSetup', @@ -11450,23 +11450,23 @@ export function storeConfigVotingSetup(configVotingSetup: ConfigVotingSetup): (b export function loadConfigProposal(slice: Slice): ConfigProposal { if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xf3))) { -slice.loadUint(8) -let param_id: number = slice.loadInt(32) + slice.loadUint(8) + let param_id: number = slice.loadInt(32) -let param_value: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() + let param_value: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() - return slice1 + return slice1 - }) - ) +}) +) -let if_hash_equal: Maybe = loadMaybe(slice, ((slice: Slice) => { - return slice.loadUint(256) + let if_hash_equal: Maybe = loadMaybe(slice, ((slice: Slice) => { + return slice.loadUint(256) - }) - ) +}) +) return { kind: 'ConfigProposal', @@ -11520,26 +11520,26 @@ export function storeConfigProposal(configProposal: ConfigProposal): (builder: B export function loadConfigProposalStatus(slice: Slice): ConfigProposalStatus { if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xce))) { -slice.loadUint(8) -let expires: number = slice.loadUint(32) + slice.loadUint(8) + let expires: number = slice.loadUint(32) -let slice1 = slice.loadRef().beginParse() + let slice1 = slice.loadRef().beginParse() -let proposal: ConfigProposal = loadConfigProposal(slice1) + let proposal: ConfigProposal = loadConfigProposal(slice1) -let is_critical: Bool = loadBool(slice) + let is_critical: Bool = loadBool(slice) -let voters: HashmapE = loadHashmapE(slice, 16, loadTrue) + let voters: HashmapE = loadHashmapE(slice, 16, loadTrue) -let remaining_weight: number = slice.loadInt(64) + let remaining_weight: number = slice.loadInt(64) -let validator_set_id: number = slice.loadUint(256) + let validator_set_id: number = slice.loadUint(256) -let rounds_remaining: number = slice.loadUint(8) + let rounds_remaining: number = slice.loadUint(8) -let wins: number = slice.loadUint(8) + let wins: number = slice.loadUint(8) -let losses: number = slice.loadUint(8) + let losses: number = slice.loadUint(8) return { kind: 'ConfigProposalStatus', @@ -11594,10 +11594,10 @@ export function storeConfigProposalStatus(configProposalStatus: ConfigProposalSt export function loadWorkchainFormat(slice: Slice, arg0: number): WorkchainFormat { if (((slice.remainingBits >= 4) && ((slice.preloadUint(4) == 0x1) && (arg0 == 1)))) { -slice.loadUint(4) -let vm_version: number = slice.loadInt(32) + slice.loadUint(4) + let vm_version: number = slice.loadInt(32) -let vm_mode: number = slice.loadUint(64) + let vm_mode: number = slice.loadUint(64) return { kind: 'WorkchainFormat_wfmt_basic', @@ -11608,29 +11608,29 @@ let vm_mode: number = slice.loadUint(64) } ; if (((slice.remainingBits >= 4) && ((slice.preloadUint(4) == 0x0) && (arg0 == 0)))) { -slice.loadUint(4) -let min_addr_len: number = slice.loadUint(12) + slice.loadUint(4) + let min_addr_len: number = slice.loadUint(12) -let max_addr_len: number = slice.loadUint(12) + let max_addr_len: number = slice.loadUint(12) -let addr_len_step: number = slice.loadUint(12) + let addr_len_step: number = slice.loadUint(12) -let workchain_type_id: number = slice.loadUint(32) + let workchain_type_id: number = slice.loadUint(32) if ((!(min_addr_len >= 64))) { -throw new Error('') + throw new Error('') } if ((!(min_addr_len <= max_addr_len))) { -throw new Error('') + throw new Error('') } if ((!(max_addr_len <= 1023))) { -throw new Error('') + throw new Error('') } if ((!(addr_len_step <= 1023))) { -throw new Error('') + throw new Error('') } if ((!(workchain_type_id >= 1))) { -throw new Error('') + throw new Error('') } return { kind: 'WorkchainFormat_wfmt_ext', @@ -11672,23 +11672,23 @@ export function storeWorkchainFormat(workchainFormat: WorkchainFormat): (builder builder.storeUint(workchainFormat.workchain_type_id, 32) if ((!(workchainFormat.min_addr_len >= 64))) { - throw new Error('') + throw new Error('') } if ((!(workchainFormat.min_addr_len <= workchainFormat.max_addr_len))) { - throw new Error('') + throw new Error('') } if ((!(workchainFormat.max_addr_len <= 1023))) { - throw new Error('') + throw new Error('') } if ((!(workchainFormat.addr_len_step <= 1023))) { - throw new Error('') + throw new Error('') } if ((!(workchainFormat.workchain_type_id >= 1))) { - throw new Error('') + throw new Error('') } }) @@ -11701,36 +11701,36 @@ export function storeWorkchainFormat(workchainFormat: WorkchainFormat): (builder export function loadWorkchainDescr(slice: Slice): WorkchainDescr { if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xa6))) { -slice.loadUint(8) -let enabled_since: number = slice.loadUint(32) + slice.loadUint(8) + let enabled_since: number = slice.loadUint(32) -let actual_min_split: number = slice.loadUint(8) + let actual_min_split: number = slice.loadUint(8) -let min_split: number = slice.loadUint(8) + let min_split: number = slice.loadUint(8) -let max_split: number = slice.loadUint(8) + let max_split: number = slice.loadUint(8) -let basic: number = slice.loadUint(1) + let basic: number = slice.loadUint(1) -let active: Bool = loadBool(slice) + let active: Bool = loadBool(slice) -let accept_msgs: Bool = loadBool(slice) + let accept_msgs: Bool = loadBool(slice) -let flags: number = slice.loadUint(13) + let flags: number = slice.loadUint(13) -let zerostate_root_hash: BitString = slice.loadBits(256) + let zerostate_root_hash: BitString = slice.loadBits(256) -let zerostate_file_hash: BitString = slice.loadBits(256) + let zerostate_file_hash: BitString = slice.loadBits(256) -let version: number = slice.loadUint(32) + let version: number = slice.loadUint(32) -let format: WorkchainFormat = loadWorkchainFormat(slice, basic) + let format: WorkchainFormat = loadWorkchainFormat(slice, basic) if ((!(actual_min_split <= min_split))) { -throw new Error('') + throw new Error('') } if ((!(flags == 0))) { -throw new Error('') + throw new Error('') } return { kind: 'WorkchainDescr', @@ -11783,11 +11783,11 @@ export function storeWorkchainDescr(workchainDescr: WorkchainDescr): (builder: B storeWorkchainFormat(workchainDescr.format)(builder) if ((!(workchainDescr.actual_min_split <= workchainDescr.min_split))) { - throw new Error('') + throw new Error('') } if ((!(workchainDescr.flags == 0))) { - throw new Error('') + throw new Error('') } }) @@ -11797,12 +11797,12 @@ export function storeWorkchainDescr(workchainDescr: WorkchainDescr): (builder: B export function loadComplaintPricing(slice: Slice): ComplaintPricing { if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x1a))) { -slice.loadUint(8) -let deposit: Grams = loadGrams(slice) + slice.loadUint(8) + let deposit: Grams = loadGrams(slice) -let bit_price: Grams = loadGrams(slice) + let bit_price: Grams = loadGrams(slice) -let _cell_price: Grams = loadGrams(slice) + let _cell_price: Grams = loadGrams(slice) return { kind: 'ComplaintPricing', @@ -11834,10 +11834,10 @@ export function storeComplaintPricing(complaintPricing: ComplaintPricing): (buil export function loadBlockCreateFees(slice: Slice): BlockCreateFees { if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x6b))) { -slice.loadUint(8) -let masterchain_block_fee: Grams = loadGrams(slice) + slice.loadUint(8) + let masterchain_block_fee: Grams = loadGrams(slice) -let basechain_block_fee: Grams = loadGrams(slice) + let basechain_block_fee: Grams = loadGrams(slice) return { kind: 'BlockCreateFees', @@ -11866,16 +11866,16 @@ export function storeBlockCreateFees(blockCreateFees: BlockCreateFees): (builder export function loadStoragePrices(slice: Slice): StoragePrices { if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xcc))) { -slice.loadUint(8) -let utime_since: number = slice.loadUint(32) + slice.loadUint(8) + let utime_since: number = slice.loadUint(32) -let bit_price_ps: number = slice.loadUint(64) + let bit_price_ps: number = slice.loadUint(64) -let _cell_price_ps: number = slice.loadUint(64) + let _cell_price_ps: number = slice.loadUint(64) -let mc_bit_price_ps: number = slice.loadUint(64) + let mc_bit_price_ps: number = slice.loadUint(64) -let mc_cell_price_ps: number = slice.loadUint(64) + let mc_cell_price_ps: number = slice.loadUint(64) return { kind: 'StoragePrices', @@ -11913,18 +11913,18 @@ export function storeStoragePrices(storagePrices: StoragePrices): (builder: Buil export function loadGasLimitsPrices(slice: Slice): GasLimitsPrices { if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xdd))) { -slice.loadUint(8) -let gas_price: number = slice.loadUint(64) + slice.loadUint(8) + let gas_price: number = slice.loadUint(64) -let gas_limit: number = slice.loadUint(64) + let gas_limit: number = slice.loadUint(64) -let gas_credit: number = slice.loadUint(64) + let gas_credit: number = slice.loadUint(64) -let block_gas_limit: number = slice.loadUint(64) + let block_gas_limit: number = slice.loadUint(64) -let freeze_due_limit: number = slice.loadUint(64) + let freeze_due_limit: number = slice.loadUint(64) -let delete_due_limit: number = slice.loadUint(64) + let delete_due_limit: number = slice.loadUint(64) return { kind: 'GasLimitsPrices_gas_prices', @@ -11939,20 +11939,20 @@ let delete_due_limit: number = slice.loadUint(64) } ; if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xde))) { -slice.loadUint(8) -let gas_price: number = slice.loadUint(64) + slice.loadUint(8) + let gas_price: number = slice.loadUint(64) -let gas_limit: number = slice.loadUint(64) + let gas_limit: number = slice.loadUint(64) -let special_gas_limit: number = slice.loadUint(64) + let special_gas_limit: number = slice.loadUint(64) -let gas_credit: number = slice.loadUint(64) + let gas_credit: number = slice.loadUint(64) -let block_gas_limit: number = slice.loadUint(64) + let block_gas_limit: number = slice.loadUint(64) -let freeze_due_limit: number = slice.loadUint(64) + let freeze_due_limit: number = slice.loadUint(64) -let delete_due_limit: number = slice.loadUint(64) + let delete_due_limit: number = slice.loadUint(64) return { kind: 'GasLimitsPrices_gas_prices_ext', @@ -11968,12 +11968,12 @@ let delete_due_limit: number = slice.loadUint(64) } ; if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xd1))) { -slice.loadUint(8) -let flat_gas_limit: number = slice.loadUint(64) + slice.loadUint(8) + let flat_gas_limit: number = slice.loadUint(64) -let flat_gas_price: number = slice.loadUint(64) + let flat_gas_price: number = slice.loadUint(64) -let other: GasLimitsPrices = loadGasLimitsPrices(slice) + let other: GasLimitsPrices = loadGasLimitsPrices(slice) return { kind: 'GasLimitsPrices_gas_flat_pfx', @@ -12051,18 +12051,18 @@ export function storeGasLimitsPrices(gasLimitsPrices: GasLimitsPrices): (builder export function loadParamLimits(slice: Slice): ParamLimits { if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xc3))) { -slice.loadUint(8) -let underload: number = slice.loadUint(32) + slice.loadUint(8) + let underload: number = slice.loadUint(32) -let soft_limit: number = slice.loadUint(32) + let soft_limit: number = slice.loadUint(32) -let hard_limit: number = slice.loadUint(32) + let hard_limit: number = slice.loadUint(32) if ((!(underload <= soft_limit))) { -throw new Error('') + throw new Error('') } if ((!(soft_limit <= hard_limit))) { -throw new Error('') + throw new Error('') } return { kind: 'ParamLimits', @@ -12088,11 +12088,11 @@ export function storeParamLimits(paramLimits: ParamLimits): (builder: Builder) = builder.storeUint(paramLimits.hard_limit, 32) if ((!(paramLimits.underload <= paramLimits.soft_limit))) { - throw new Error('') + throw new Error('') } if ((!(paramLimits.soft_limit <= paramLimits.hard_limit))) { - throw new Error('') + throw new Error('') } }) @@ -12102,12 +12102,12 @@ export function storeParamLimits(paramLimits: ParamLimits): (builder: Builder) = export function loadBlockLimits(slice: Slice): BlockLimits { if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x5d))) { -slice.loadUint(8) -let bytes: ParamLimits = loadParamLimits(slice) + slice.loadUint(8) + let bytes: ParamLimits = loadParamLimits(slice) -let gas: ParamLimits = loadParamLimits(slice) + let gas: ParamLimits = loadParamLimits(slice) -let lt_delta: ParamLimits = loadParamLimits(slice) + let lt_delta: ParamLimits = loadParamLimits(slice) return { kind: 'BlockLimits', @@ -12139,18 +12139,18 @@ export function storeBlockLimits(blockLimits: BlockLimits): (builder: Builder) = export function loadMsgForwardPrices(slice: Slice): MsgForwardPrices { if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xea))) { -slice.loadUint(8) -let lump_price: number = slice.loadUint(64) + slice.loadUint(8) + let lump_price: number = slice.loadUint(64) -let bit_price: number = slice.loadUint(64) + let bit_price: number = slice.loadUint(64) -let _cell_price: number = slice.loadUint(64) + let _cell_price: number = slice.loadUint(64) -let ihr_price_factor: number = slice.loadUint(32) + let ihr_price_factor: number = slice.loadUint(32) -let first_frac: number = slice.loadUint(16) + let first_frac: number = slice.loadUint(16) -let next_frac: number = slice.loadUint(16) + let next_frac: number = slice.loadUint(16) return { kind: 'MsgForwardPrices', @@ -12191,14 +12191,14 @@ export function storeMsgForwardPrices(msgForwardPrices: MsgForwardPrices): (buil export function loadCatchainConfig(slice: Slice): CatchainConfig { if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xc1))) { -slice.loadUint(8) -let mc_catchain_lifetime: number = slice.loadUint(32) + slice.loadUint(8) + let mc_catchain_lifetime: number = slice.loadUint(32) -let shard_catchain_lifetime: number = slice.loadUint(32) + let shard_catchain_lifetime: number = slice.loadUint(32) -let shard_validators_lifetime: number = slice.loadUint(32) + let shard_validators_lifetime: number = slice.loadUint(32) -let shard_validators_num: number = slice.loadUint(32) + let shard_validators_num: number = slice.loadUint(32) return { kind: 'CatchainConfig_catchain_config', @@ -12211,21 +12211,21 @@ let shard_validators_num: number = slice.loadUint(32) } ; if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xc2))) { -slice.loadUint(8) -let flags: number = slice.loadUint(7) + slice.loadUint(8) + let flags: number = slice.loadUint(7) -let shuffle_mc_validators: Bool = loadBool(slice) + let shuffle_mc_validators: Bool = loadBool(slice) -let mc_catchain_lifetime: number = slice.loadUint(32) + let mc_catchain_lifetime: number = slice.loadUint(32) -let shard_catchain_lifetime: number = slice.loadUint(32) + let shard_catchain_lifetime: number = slice.loadUint(32) -let shard_validators_lifetime: number = slice.loadUint(32) + let shard_validators_lifetime: number = slice.loadUint(32) -let shard_validators_num: number = slice.loadUint(32) + let shard_validators_num: number = slice.loadUint(32) if ((!(flags == 0))) { -throw new Error('') + throw new Error('') } return { kind: 'CatchainConfig_catchain_config_new', @@ -12277,7 +12277,7 @@ export function storeCatchainConfig(catchainConfig: CatchainConfig): (builder: B builder.storeUint(catchainConfig.shard_validators_num, 32) if ((!(catchainConfig.flags == 0))) { - throw new Error('') + throw new Error('') } }) @@ -12290,25 +12290,25 @@ export function storeCatchainConfig(catchainConfig: CatchainConfig): (builder: B export function loadConsensusConfig(slice: Slice): ConsensusConfig { if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xd6))) { -slice.loadUint(8) -let round_candidates: number = slice.loadUint(32) + slice.loadUint(8) + let round_candidates: number = slice.loadUint(32) -let next_candidate_delay_ms: number = slice.loadUint(32) + let next_candidate_delay_ms: number = slice.loadUint(32) -let consensus_timeout_ms: number = slice.loadUint(32) + let consensus_timeout_ms: number = slice.loadUint(32) -let fast_attempts: number = slice.loadUint(32) + let fast_attempts: number = slice.loadUint(32) -let attempt_duration: number = slice.loadUint(32) + let attempt_duration: number = slice.loadUint(32) -let catchain_max_deps: number = slice.loadUint(32) + let catchain_max_deps: number = slice.loadUint(32) -let max_block_bytes: number = slice.loadUint(32) + let max_block_bytes: number = slice.loadUint(32) -let max_collated_bytes: number = slice.loadUint(32) + let max_collated_bytes: number = slice.loadUint(32) if ((!(round_candidates >= 1))) { -throw new Error('') + throw new Error('') } return { kind: 'ConsensusConfig_consensus_config', @@ -12325,32 +12325,32 @@ throw new Error('') } ; if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xd7))) { -slice.loadUint(8) -let flags: number = slice.loadUint(7) + slice.loadUint(8) + let flags: number = slice.loadUint(7) -let new_catchain_ids: Bool = loadBool(slice) + let new_catchain_ids: Bool = loadBool(slice) -let round_candidates: number = slice.loadUint(8) + let round_candidates: number = slice.loadUint(8) -let next_candidate_delay_ms: number = slice.loadUint(32) + let next_candidate_delay_ms: number = slice.loadUint(32) -let consensus_timeout_ms: number = slice.loadUint(32) + let consensus_timeout_ms: number = slice.loadUint(32) -let fast_attempts: number = slice.loadUint(32) + let fast_attempts: number = slice.loadUint(32) -let attempt_duration: number = slice.loadUint(32) + let attempt_duration: number = slice.loadUint(32) -let catchain_max_deps: number = slice.loadUint(32) + let catchain_max_deps: number = slice.loadUint(32) -let max_block_bytes: number = slice.loadUint(32) + let max_block_bytes: number = slice.loadUint(32) -let max_collated_bytes: number = slice.loadUint(32) + let max_collated_bytes: number = slice.loadUint(32) if ((!(flags == 0))) { -throw new Error('') + throw new Error('') } if ((!(round_candidates >= 1))) { -throw new Error('') + throw new Error('') } return { kind: 'ConsensusConfig_consensus_config_new', @@ -12369,34 +12369,34 @@ throw new Error('') } ; if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xd8))) { -slice.loadUint(8) -let flags: number = slice.loadUint(7) + slice.loadUint(8) + let flags: number = slice.loadUint(7) -let new_catchain_ids: Bool = loadBool(slice) + let new_catchain_ids: Bool = loadBool(slice) -let round_candidates: number = slice.loadUint(8) + let round_candidates: number = slice.loadUint(8) -let next_candidate_delay_ms: number = slice.loadUint(32) + let next_candidate_delay_ms: number = slice.loadUint(32) -let consensus_timeout_ms: number = slice.loadUint(32) + let consensus_timeout_ms: number = slice.loadUint(32) -let fast_attempts: number = slice.loadUint(32) + let fast_attempts: number = slice.loadUint(32) -let attempt_duration: number = slice.loadUint(32) + let attempt_duration: number = slice.loadUint(32) -let catchain_max_deps: number = slice.loadUint(32) + let catchain_max_deps: number = slice.loadUint(32) -let max_block_bytes: number = slice.loadUint(32) + let max_block_bytes: number = slice.loadUint(32) -let max_collated_bytes: number = slice.loadUint(32) + let max_collated_bytes: number = slice.loadUint(32) -let proto_version: number = slice.loadUint(16) + let proto_version: number = slice.loadUint(16) if ((!(flags == 0))) { -throw new Error('') + throw new Error('') } if ((!(round_candidates >= 1))) { -throw new Error('') + throw new Error('') } return { kind: 'ConsensusConfig_consensus_config_v3', @@ -12416,36 +12416,36 @@ throw new Error('') } ; if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xd9))) { -slice.loadUint(8) -let flags: number = slice.loadUint(7) + slice.loadUint(8) + let flags: number = slice.loadUint(7) -let new_catchain_ids: Bool = loadBool(slice) + let new_catchain_ids: Bool = loadBool(slice) -let round_candidates: number = slice.loadUint(8) + let round_candidates: number = slice.loadUint(8) -let next_candidate_delay_ms: number = slice.loadUint(32) + let next_candidate_delay_ms: number = slice.loadUint(32) -let consensus_timeout_ms: number = slice.loadUint(32) + let consensus_timeout_ms: number = slice.loadUint(32) -let fast_attempts: number = slice.loadUint(32) + let fast_attempts: number = slice.loadUint(32) -let attempt_duration: number = slice.loadUint(32) + let attempt_duration: number = slice.loadUint(32) -let catchain_max_deps: number = slice.loadUint(32) + let catchain_max_deps: number = slice.loadUint(32) -let max_block_bytes: number = slice.loadUint(32) + let max_block_bytes: number = slice.loadUint(32) -let max_collated_bytes: number = slice.loadUint(32) + let max_collated_bytes: number = slice.loadUint(32) -let proto_version: number = slice.loadUint(16) + let proto_version: number = slice.loadUint(16) -let catchain_max_blocks_coeff: number = slice.loadUint(32) + let catchain_max_blocks_coeff: number = slice.loadUint(32) if ((!(flags == 0))) { -throw new Error('') + throw new Error('') } if ((!(round_candidates >= 1))) { -throw new Error('') + throw new Error('') } return { kind: 'ConsensusConfig_consensus_config_v4', @@ -12491,7 +12491,7 @@ export function storeConsensusConfig(consensusConfig: ConsensusConfig): (builder builder.storeUint(consensusConfig.max_collated_bytes, 32) if ((!(consensusConfig.round_candidates >= 1))) { - throw new Error('') + throw new Error('') } }) @@ -12523,11 +12523,11 @@ export function storeConsensusConfig(consensusConfig: ConsensusConfig): (builder builder.storeUint(consensusConfig.max_collated_bytes, 32) if ((!(consensusConfig.flags == 0))) { - throw new Error('') + throw new Error('') } if ((!(consensusConfig.round_candidates >= 1))) { - throw new Error('') + throw new Error('') } }) @@ -12561,11 +12561,11 @@ export function storeConsensusConfig(consensusConfig: ConsensusConfig): (builder builder.storeUint(consensusConfig.proto_version, 16) if ((!(consensusConfig.flags == 0))) { - throw new Error('') + throw new Error('') } if ((!(consensusConfig.round_candidates >= 1))) { - throw new Error('') + throw new Error('') } }) @@ -12601,11 +12601,11 @@ export function storeConsensusConfig(consensusConfig: ConsensusConfig): (builder builder.storeUint(consensusConfig.catchain_max_blocks_coeff, 32) if ((!(consensusConfig.flags == 0))) { - throw new Error('') + throw new Error('') } if ((!(consensusConfig.round_candidates >= 1))) { - throw new Error('') + throw new Error('') } }) @@ -12618,14 +12618,14 @@ export function storeConsensusConfig(consensusConfig: ConsensusConfig): (builder export function loadValidatorTempKey(slice: Slice): ValidatorTempKey { if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0x3))) { -slice.loadUint(4) -let adnl_addr: BitString = slice.loadBits(256) + slice.loadUint(4) + let adnl_addr: BitString = slice.loadBits(256) -let temp_public_key: SigPubKey = loadSigPubKey(slice) + let temp_public_key: SigPubKey = loadSigPubKey(slice) -let seqno: number = slice.loadUint(32) + let seqno: number = slice.loadUint(32) -let valid_until: number = slice.loadUint(32) + let valid_until: number = slice.loadUint(32) return { kind: 'ValidatorTempKey', @@ -12660,12 +12660,12 @@ export function storeValidatorTempKey(validatorTempKey: ValidatorTempKey): (buil export function loadValidatorSignedTempKey(slice: Slice): ValidatorSignedTempKey { if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0x4))) { -slice.loadUint(4) -let slice1 = slice.loadRef().beginParse() + slice.loadUint(4) + let slice1 = slice.loadRef().beginParse() -let key: ValidatorTempKey = loadValidatorTempKey(slice1) + let key: ValidatorTempKey = loadValidatorTempKey(slice1) -let signature: CryptoSignature = loadCryptoSignature(slice) + let signature: CryptoSignature = loadCryptoSignature(slice) return { kind: 'ValidatorSignedTempKey', @@ -12699,28 +12699,28 @@ export function storeValidatorSignedTempKey(validatorSignedTempKey: ValidatorSig export function loadMisbehaviourPunishmentConfig(slice: Slice): MisbehaviourPunishmentConfig { if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x01))) { -slice.loadUint(8) -let default_flat_fine: Grams = loadGrams(slice) + slice.loadUint(8) + let default_flat_fine: Grams = loadGrams(slice) -let default_proportional_fine: number = slice.loadUint(32) + let default_proportional_fine: number = slice.loadUint(32) -let severity_flat_mult: number = slice.loadUint(16) + let severity_flat_mult: number = slice.loadUint(16) -let severity_proportional_mult: number = slice.loadUint(16) + let severity_proportional_mult: number = slice.loadUint(16) -let unpunishable_interval: number = slice.loadUint(16) + let unpunishable_interval: number = slice.loadUint(16) -let long_interval: number = slice.loadUint(16) + let long_interval: number = slice.loadUint(16) -let long_flat_mult: number = slice.loadUint(16) + let long_flat_mult: number = slice.loadUint(16) -let long_proportional_mult: number = slice.loadUint(16) + let long_proportional_mult: number = slice.loadUint(16) -let medium_interval: number = slice.loadUint(16) + let medium_interval: number = slice.loadUint(16) -let medium_flat_mult: number = slice.loadUint(16) + let medium_flat_mult: number = slice.loadUint(16) -let medium_proportional_mult: number = slice.loadUint(16) + let medium_proportional_mult: number = slice.loadUint(16) return { kind: 'MisbehaviourPunishmentConfig', @@ -12860,10 +12860,10 @@ export function storeBlockSignaturesPure(blockSignaturesPure: BlockSignaturesPur export function loadBlockSignatures(slice: Slice): BlockSignatures { if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x11))) { -slice.loadUint(8) -let validator_info: ValidatorBaseInfo = loadValidatorBaseInfo(slice) + slice.loadUint(8) + let validator_info: ValidatorBaseInfo = loadValidatorBaseInfo(slice) -let pure_signatures: BlockSignaturesPure = loadBlockSignaturesPure(slice) + let pure_signatures: BlockSignaturesPure = loadBlockSignaturesPure(slice) return { kind: 'BlockSignatures', @@ -12892,21 +12892,21 @@ export function storeBlockSignatures(blockSignatures: BlockSignatures): (builder export function loadBlockProof(slice: Slice): BlockProof { if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xc3))) { -slice.loadUint(8) -let proof_for: BlockIdExt = loadBlockIdExt(slice) + slice.loadUint(8) + let proof_for: BlockIdExt = loadBlockIdExt(slice) -let slice1 = slice.loadRef().beginParse() + let slice1 = slice.loadRef().beginParse() -let root: Slice = slice1 + let root: Slice = slice1 -let signatures: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() + let signatures: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() - return loadBlockSignatures(slice1) + return loadBlockSignatures(slice1) - }) - ) +}) +) return { kind: 'BlockProof', @@ -12964,18 +12964,18 @@ export function loadProofChain(slice: Slice, arg0: number): ProofChain { } ; if (true) { -let slice1 = slice.loadRef().beginParse() + let slice1 = slice.loadRef().beginParse() -let root: Slice = slice1 + let root: Slice = slice1 -let prev: ProofChain | undefined = ((arg0 - 1) ? ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() + let prev: ProofChain | undefined = ((arg0 - 1) ? ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() - return loadProofChain(slice1, (arg0 - 1)) + return loadProofChain(slice1, (arg0 - 1)) - }) - (slice) : undefined) +}) +(slice) : undefined) return { kind: 'ProofChain_chain_link', @@ -13026,27 +13026,27 @@ export function storeProofChain(proofChain: ProofChain): (builder: Builder) => v export function loadTopBlockDescr(slice: Slice): TopBlockDescr { if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xd5))) { -slice.loadUint(8) -let proof_for: BlockIdExt = loadBlockIdExt(slice) + slice.loadUint(8) + let proof_for: BlockIdExt = loadBlockIdExt(slice) -let signatures: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() + let signatures: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() - return loadBlockSignatures(slice1) + return loadBlockSignatures(slice1) - }) - ) +}) +) -let len: number = slice.loadUint(8) + let len: number = slice.loadUint(8) -let chain: ProofChain = loadProofChain(slice, len) + let chain: ProofChain = loadProofChain(slice, len) if ((!(len >= 1))) { -throw new Error('') + throw new Error('') } if ((!(len <= 8))) { -throw new Error('') + throw new Error('') } return { kind: 'TopBlockDescr', @@ -13089,11 +13089,11 @@ export function storeTopBlockDescr(topBlockDescr: TopBlockDescr): (builder: Buil storeProofChain(topBlockDescr.chain)(builder) if ((!(topBlockDescr.len >= 1))) { - throw new Error('') + throw new Error('') } if ((!(topBlockDescr.len <= 8))) { - throw new Error('') + throw new Error('') } }) @@ -13103,15 +13103,15 @@ export function storeTopBlockDescr(topBlockDescr: TopBlockDescr): (builder: Buil export function loadTopBlockDescrSet(slice: Slice): TopBlockDescrSet { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x4ac789f3))) { -slice.loadUint(32) -let collection: HashmapE = loadHashmapE(slice, 96, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() + slice.loadUint(32) + let collection: HashmapE = loadHashmapE(slice, 96, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() - return loadTopBlockDescr(slice1) + return loadTopBlockDescr(slice1) - }) - ) +}) +) return { kind: 'TopBlockDescrSet', @@ -13151,18 +13151,18 @@ export function storeTopBlockDescrSet(topBlockDescrSet: TopBlockDescrSet): (buil export function loadProducerInfo(slice: Slice): ProducerInfo { if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x34))) { -slice.loadUint(8) -let utime: number = slice.loadUint(32) + slice.loadUint(8) + let utime: number = slice.loadUint(32) -let mc_blk_ref: ExtBlkRef = loadExtBlkRef(slice) + let mc_blk_ref: ExtBlkRef = loadExtBlkRef(slice) -let slice1 = slice.loadRef().beginParse() + let slice1 = slice.loadRef().beginParse() -let state_proof: MERKLE_PROOF = loadMERKLE_PROOF(slice1, loadBlock) + let state_proof: MERKLE_PROOF = loadMERKLE_PROOF(slice1, loadBlock) -let slice2 = slice.loadRef().beginParse() + let slice2 = slice.loadRef().beginParse() -let prod_proof: MERKLE_PROOF = loadMERKLE_PROOF(slice2, loadShardState) + let prod_proof: MERKLE_PROOF = loadMERKLE_PROOF(slice2, loadShardState) return { kind: 'ProducerInfo', @@ -13207,12 +13207,12 @@ export function storeProducerInfo(producerInfo: ProducerInfo): (builder: Builder export function loadComplaintDescr(slice: Slice): ComplaintDescr { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x9c436252))) { -slice.loadUint(32) -let from_utime: number = slice.loadUint(32) + slice.loadUint(32) + let from_utime: number = slice.loadUint(32) -let slice1 = slice.loadRef().beginParse() + let slice1 = slice.loadRef().beginParse() -let prod_info: ProducerInfo = loadProducerInfo(slice1) + let prod_info: ProducerInfo = loadProducerInfo(slice1) return { kind: 'ComplaintDescr_no_blk_gen', @@ -13223,14 +13223,14 @@ let prod_info: ProducerInfo = loadProducerInfo(slice1) } ; if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x987f1ab7))) { -slice.loadUint(32) -let slice1 = slice.loadRef().beginParse() + slice.loadUint(32) + let slice1 = slice.loadRef().beginParse() -let prod_info_old: ProducerInfo = loadProducerInfo(slice1) + let prod_info_old: ProducerInfo = loadProducerInfo(slice1) -let slice2 = slice.loadRef().beginParse() + let slice2 = slice.loadRef().beginParse() -let prod_info_new: ProducerInfo = loadProducerInfo(slice2) + let prod_info_new: ProducerInfo = loadProducerInfo(slice2) return { kind: 'ComplaintDescr_no_blk_gen_diff', @@ -13290,24 +13290,24 @@ export function storeComplaintDescr(complaintDescr: ComplaintDescr): (builder: B export function loadValidatorComplaint(slice: Slice): ValidatorComplaint { if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xbc))) { -slice.loadUint(8) -let validator_pubkey: BitString = slice.loadBits(256) + slice.loadUint(8) + let validator_pubkey: BitString = slice.loadBits(256) -let slice1 = slice.loadRef().beginParse() + let slice1 = slice.loadRef().beginParse() -let description: ComplaintDescr = loadComplaintDescr(slice1) + let description: ComplaintDescr = loadComplaintDescr(slice1) -let created_at: number = slice.loadUint(32) + let created_at: number = slice.loadUint(32) -let severity: number = slice.loadUint(8) + let severity: number = slice.loadUint(8) -let reward_addr: number = slice.loadUint(256) + let reward_addr: number = slice.loadUint(256) -let paid: Grams = loadGrams(slice) + let paid: Grams = loadGrams(slice) -let suggested_fine: Grams = loadGrams(slice) + let suggested_fine: Grams = loadGrams(slice) -let suggested_fine_part: number = slice.loadUint(32) + let suggested_fine_part: number = slice.loadUint(32) return { kind: 'ValidatorComplaint', @@ -13359,16 +13359,16 @@ export function storeValidatorComplaint(validatorComplaint: ValidatorComplaint): export function loadValidatorComplaintStatus(slice: Slice): ValidatorComplaintStatus { if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x2d))) { -slice.loadUint(8) -let slice1 = slice.loadRef().beginParse() + slice.loadUint(8) + let slice1 = slice.loadRef().beginParse() -let complaint: ValidatorComplaint = loadValidatorComplaint(slice1) + let complaint: ValidatorComplaint = loadValidatorComplaint(slice1) -let voters: HashmapE = loadHashmapE(slice, 16, loadTrue) + let voters: HashmapE = loadHashmapE(slice, 16, loadTrue) -let vset_id: number = slice.loadUint(256) + let vset_id: number = slice.loadUint(256) -let weight_remaining: number = slice.loadInt(64) + let weight_remaining: number = slice.loadInt(64) return { kind: 'ValidatorComplaintStatus', @@ -13408,7 +13408,7 @@ export function storeValidatorComplaintStatus(validatorComplaintStatus: Validato export function loadVmStackValue(slice: Slice): VmStackValue { if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x00))) { -slice.loadUint(8) + slice.loadUint(8) return { kind: 'VmStackValue_vm_stk_null', } @@ -13416,8 +13416,8 @@ slice.loadUint(8) } ; if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x01))) { -slice.loadUint(8) -let value: number = slice.loadInt(64) + slice.loadUint(8) + let value: number = slice.loadInt(64) return { kind: 'VmStackValue_vm_stk_tinyint', @@ -13427,8 +13427,8 @@ let value: number = slice.loadInt(64) } ; if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x0201))) { -slice.loadUint(16) -let value: number = slice.loadInt(257) + slice.loadUint(16) + let value: number = slice.loadInt(257) return { kind: 'VmStackValue_vm_stk_int', @@ -13438,7 +13438,7 @@ let value: number = slice.loadInt(257) } ; if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x02ff))) { -slice.loadUint(16) + slice.loadUint(16) return { kind: 'VmStackValue_vm_stk_nan', } @@ -13446,10 +13446,10 @@ slice.loadUint(16) } ; if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x03))) { -slice.loadUint(8) -let slice1 = slice.loadRef().beginParse() + slice.loadUint(8) + let slice1 = slice.loadRef().beginParse() -let _cell: Slice = slice1 + let _cell: Slice = slice1 return { kind: 'VmStackValue_vm_stk_cell', @@ -13459,8 +13459,8 @@ let _cell: Slice = slice1 } ; if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x04))) { -slice.loadUint(8) -let _: VmCellSlice = loadVmCellSlice(slice) + slice.loadUint(8) + let _: VmCellSlice = loadVmCellSlice(slice) return { kind: 'VmStackValue_vm_stk_slice', @@ -13470,10 +13470,10 @@ let _: VmCellSlice = loadVmCellSlice(slice) } ; if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x05))) { -slice.loadUint(8) -let slice1 = slice.loadRef().beginParse() + slice.loadUint(8) + let slice1 = slice.loadRef().beginParse() -let _cell: Slice = slice1 + let _cell: Slice = slice1 return { kind: 'VmStackValue_vm_stk_builder', @@ -13483,8 +13483,8 @@ let _cell: Slice = slice1 } ; if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x06))) { -slice.loadUint(8) -let cont: VmCont = loadVmCont(slice) + slice.loadUint(8) + let cont: VmCont = loadVmCont(slice) return { kind: 'VmStackValue_vm_stk_cont', @@ -13494,10 +13494,10 @@ let cont: VmCont = loadVmCont(slice) } ; if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x07))) { -slice.loadUint(8) -let len: number = slice.loadUint(16) + slice.loadUint(8) + let len: number = slice.loadUint(16) -let data: VmTuple = loadVmTuple(slice, len) + let data: VmTuple = loadVmTuple(slice, len) return { kind: 'VmStackValue_vm_stk_tuple', @@ -13616,24 +13616,24 @@ export function storeVmStackValue(vmStackValue: VmStackValue): (builder: Builder export function loadVmCellSlice(slice: Slice): VmCellSlice { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xd6a63245))) { -slice.loadUint(32) -let slice1 = slice.loadRef().beginParse() + slice.loadUint(32) + let slice1 = slice.loadRef().beginParse() -let _cell: Slice = slice1 + let _cell: Slice = slice1 -let st_bits: number = slice.loadUint(10) + let st_bits: number = slice.loadUint(10) -let end_bits: number = slice.loadUint(10) + let end_bits: number = slice.loadUint(10) -let st_ref: number = slice.loadUint(bitLen(4)) + let st_ref: number = slice.loadUint(bitLen(4)) -let end_ref: number = slice.loadUint(bitLen(4)) + let end_ref: number = slice.loadUint(bitLen(4)) if ((!(st_bits <= end_bits))) { -throw new Error('') + throw new Error('') } if ((!(st_ref <= end_ref))) { -throw new Error('') + throw new Error('') } return { kind: 'VmCellSlice', @@ -13670,11 +13670,11 @@ export function storeVmCellSlice(vmCellSlice: VmCellSlice): (builder: Builder) = builder.storeUint(vmCellSlice.end_ref, bitLen(4)) if ((!(vmCellSlice.st_bits <= vmCellSlice.end_bits))) { - throw new Error('') + throw new Error('') } if ((!(vmCellSlice.st_ref <= vmCellSlice.end_ref))) { - throw new Error('') + throw new Error('') } }) @@ -13691,9 +13691,9 @@ export function loadVmTupleRef(slice: Slice, arg0: number): VmTupleRef { } ; if ((arg0 == 1)) { -let slice1 = slice.loadRef().beginParse() + let slice1 = slice.loadRef().beginParse() -let entry: VmStackValue = loadVmStackValue(slice1) + let entry: VmStackValue = loadVmStackValue(slice1) return { kind: 'VmTupleRef_vm_tupref_single', @@ -13703,9 +13703,9 @@ let entry: VmStackValue = loadVmStackValue(slice1) } ; if (true) { -let slice1 = slice.loadRef().beginParse() + let slice1 = slice.loadRef().beginParse() -let ref: VmTuple = loadVmTuple(slice1, ((arg0 - 2) + 2)) + let ref: VmTuple = loadVmTuple(slice1, ((arg0 - 2) + 2)) return { kind: 'VmTupleRef_vm_tupref_any', @@ -13765,11 +13765,11 @@ export function loadVmTuple(slice: Slice, arg0: number): VmTuple { } ; if (true) { -let head: VmTupleRef = loadVmTupleRef(slice, (arg0 - 1)) + let head: VmTupleRef = loadVmTupleRef(slice, (arg0 - 1)) -let slice1 = slice.loadRef().beginParse() + let slice1 = slice.loadRef().beginParse() -let tail: VmStackValue = loadVmStackValue(slice1) + let tail: VmStackValue = loadVmStackValue(slice1) return { kind: 'VmTuple_vm_tuple_tcons', @@ -13846,11 +13846,11 @@ export function loadVmStackList(slice: Slice, arg0: number): VmStackList { } ; if (true) { -let slice1 = slice.loadRef().beginParse() + let slice1 = slice.loadRef().beginParse() -let rest: VmStackList = loadVmStackList(slice1, (arg0 - 1)) + let rest: VmStackList = loadVmStackList(slice1, (arg0 - 1)) -let tos: VmStackValue = loadVmStackValue(slice) + let tos: VmStackValue = loadVmStackValue(slice) return { kind: 'VmStackList_vm_stk_cons', @@ -13893,8 +13893,8 @@ export function storeVmStackList(vmStackList: VmStackList): (builder: Builder) = export function loadVmSaveList(slice: Slice): VmSaveList { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xeed28f11))) { -slice.loadUint(32) -let cregs: HashmapE = loadHashmapE(slice, 4, loadVmStackValue) + slice.loadUint(32) + let cregs: HashmapE = loadHashmapE(slice, 4, loadVmStackValue) return { kind: 'VmSaveList', @@ -13967,15 +13967,15 @@ export function storeVmGasLimits(vmGasLimits: VmGasLimits): (builder: Builder) = export function loadVmLibraries(slice: Slice): VmLibraries { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xe9be85ef))) { -slice.loadUint(32) -let libraries: HashmapE = loadHashmapE(slice, 256, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() + slice.loadUint(32) + let libraries: HashmapE = loadHashmapE(slice, 256, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse() - return slice1 + return slice1 - }) - ) +}) +) return { kind: 'VmLibraries', @@ -14078,10 +14078,10 @@ export function storeVmControlData(vmControlData: VmControlData): (builder: Buil export function loadVmCont(slice: Slice): VmCont { if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { -slice.loadUint(2) -let cdata: VmControlData = loadVmControlData(slice) + slice.loadUint(2) + let cdata: VmControlData = loadVmControlData(slice) -let code: VmCellSlice = loadVmCellSlice(slice) + let code: VmCellSlice = loadVmCellSlice(slice) return { kind: 'VmCont_vmc_std', @@ -14092,12 +14092,12 @@ let code: VmCellSlice = loadVmCellSlice(slice) } ; if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b01))) { -slice.loadUint(2) -let cdata: VmControlData = loadVmControlData(slice) + slice.loadUint(2) + let cdata: VmControlData = loadVmControlData(slice) -let slice1 = slice.loadRef().beginParse() + let slice1 = slice.loadRef().beginParse() -let next: VmCont = loadVmCont(slice1) + let next: VmCont = loadVmCont(slice1) return { kind: 'VmCont_vmc_envelope', @@ -14108,8 +14108,8 @@ let next: VmCont = loadVmCont(slice1) } ; if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b1000))) { -slice.loadUint(4) -let exit_code: number = slice.loadInt(32) + slice.loadUint(4) + let exit_code: number = slice.loadInt(32) return { kind: 'VmCont_vmc_quit', @@ -14119,7 +14119,7 @@ let exit_code: number = slice.loadInt(32) } ; if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b1001))) { -slice.loadUint(4) + slice.loadUint(4) return { kind: 'VmCont_vmc_quit_exc', } @@ -14127,16 +14127,16 @@ slice.loadUint(4) } ; if (((slice.remainingBits >= 5) && (slice.preloadUint(5) == 0b10100))) { -slice.loadUint(5) -let count: number = slice.loadUint(63) + slice.loadUint(5) + let count: number = slice.loadUint(63) -let slice1 = slice.loadRef().beginParse() + let slice1 = slice.loadRef().beginParse() -let body: VmCont = loadVmCont(slice1) + let body: VmCont = loadVmCont(slice1) -let slice2 = slice.loadRef().beginParse() + let slice2 = slice.loadRef().beginParse() -let after: VmCont = loadVmCont(slice2) + let after: VmCont = loadVmCont(slice2) return { kind: 'VmCont_vmc_repeat', @@ -14148,14 +14148,14 @@ let after: VmCont = loadVmCont(slice2) } ; if (((slice.remainingBits >= 6) && (slice.preloadUint(6) == 0b110000))) { -slice.loadUint(6) -let slice1 = slice.loadRef().beginParse() + slice.loadUint(6) + let slice1 = slice.loadRef().beginParse() -let body: VmCont = loadVmCont(slice1) + let body: VmCont = loadVmCont(slice1) -let slice2 = slice.loadRef().beginParse() + let slice2 = slice.loadRef().beginParse() -let after: VmCont = loadVmCont(slice2) + let after: VmCont = loadVmCont(slice2) return { kind: 'VmCont_vmc_until', @@ -14166,10 +14166,10 @@ let after: VmCont = loadVmCont(slice2) } ; if (((slice.remainingBits >= 6) && (slice.preloadUint(6) == 0b110001))) { -slice.loadUint(6) -let slice1 = slice.loadRef().beginParse() + slice.loadUint(6) + let slice1 = slice.loadRef().beginParse() -let body: VmCont = loadVmCont(slice1) + let body: VmCont = loadVmCont(slice1) return { kind: 'VmCont_vmc_again', @@ -14179,18 +14179,18 @@ let body: VmCont = loadVmCont(slice1) } ; if (((slice.remainingBits >= 6) && (slice.preloadUint(6) == 0b110010))) { -slice.loadUint(6) -let slice1 = slice.loadRef().beginParse() + slice.loadUint(6) + let slice1 = slice.loadRef().beginParse() -let cond: VmCont = loadVmCont(slice1) + let cond: VmCont = loadVmCont(slice1) -let slice2 = slice.loadRef().beginParse() + let slice2 = slice.loadRef().beginParse() -let body: VmCont = loadVmCont(slice2) + let body: VmCont = loadVmCont(slice2) -let slice3 = slice.loadRef().beginParse() + let slice3 = slice.loadRef().beginParse() -let after: VmCont = loadVmCont(slice3) + let after: VmCont = loadVmCont(slice3) return { kind: 'VmCont_vmc_while_cond', @@ -14202,18 +14202,18 @@ let after: VmCont = loadVmCont(slice3) } ; if (((slice.remainingBits >= 6) && (slice.preloadUint(6) == 0b110011))) { -slice.loadUint(6) -let slice1 = slice.loadRef().beginParse() + slice.loadUint(6) + let slice1 = slice.loadRef().beginParse() -let cond: VmCont = loadVmCont(slice1) + let cond: VmCont = loadVmCont(slice1) -let slice2 = slice.loadRef().beginParse() + let slice2 = slice.loadRef().beginParse() -let body: VmCont = loadVmCont(slice2) + let body: VmCont = loadVmCont(slice2) -let slice3 = slice.loadRef().beginParse() + let slice3 = slice.loadRef().beginParse() -let after: VmCont = loadVmCont(slice3) + let after: VmCont = loadVmCont(slice3) return { kind: 'VmCont_vmc_while_body', @@ -14225,12 +14225,12 @@ let after: VmCont = loadVmCont(slice3) } ; if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b1111))) { -slice.loadUint(4) -let value: number = slice.loadInt(32) + slice.loadUint(4) + let value: number = slice.loadInt(32) -let slice1 = slice.loadRef().beginParse() + let slice1 = slice.loadRef().beginParse() -let next: VmCont = loadVmCont(slice1) + let next: VmCont = loadVmCont(slice1) return { kind: 'VmCont_vmc_pushint', @@ -14434,8 +14434,8 @@ export function storeVmCont(vmCont: VmCont): (builder: Builder) => void { export function loadDNS_RecordSet(slice: Slice): DNS_RecordSet { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xafbffed3))) { -slice.loadUint(32) -let anon0: HashmapE = loadHashmapE(slice, 256, loadDNSRecord) + slice.loadUint(32) + let anon0: HashmapE = loadHashmapE(slice, 256, loadDNSRecord) return { kind: 'DNS_RecordSet', @@ -14468,9 +14468,9 @@ export function loadTextChunkRef(slice: Slice, arg0: number): TextChunkRef { } ; if (true) { -let slice1 = slice.loadRef().beginParse() + let slice1 = slice.loadRef().beginParse() -let ref: TextChunks = loadTextChunks(slice1, ((arg0 - 1) + 1)) + let ref: TextChunks = loadTextChunks(slice1, ((arg0 - 1) + 1)) return { kind: 'TextChunkRef_chunk_ref', @@ -14517,11 +14517,11 @@ export function loadTextChunks(slice: Slice, arg0: number): TextChunks { } ; if (true) { -let len: number = slice.loadUint(8) + let len: number = slice.loadUint(8) -let data: BitString = slice.loadBits((len * 8)) + let data: BitString = slice.loadBits((len * 8)) -let next: TextChunkRef = loadTextChunkRef(slice, (arg0 - 1)) + let next: TextChunkRef = loadTextChunkRef(slice, (arg0 - 1)) return { kind: 'TextChunks_text_chunk', @@ -14589,8 +14589,8 @@ export function storeText(text: Text): (builder: Builder) => void { export function loadDNSRecord(slice: Slice): DNSRecord { if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x1eda))) { -slice.loadUint(16) -let _: Text = loadText(slice) + slice.loadUint(16) + let _: Text = loadText(slice) return { kind: 'DNSRecord_dns_text', @@ -14600,8 +14600,8 @@ let _: Text = loadText(slice) } ; if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0xba93))) { -slice.loadUint(16) -let resolver: MsgAddressInt = loadMsgAddressInt(slice) + slice.loadUint(16) + let resolver: MsgAddressInt = loadMsgAddressInt(slice) return { kind: 'DNSRecord_dns_next_resolver', @@ -14611,15 +14611,15 @@ let resolver: MsgAddressInt = loadMsgAddressInt(slice) } ; if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0xad01))) { -slice.loadUint(16) -let adnl_addr: BitString = slice.loadBits(256) + slice.loadUint(16) + let adnl_addr: BitString = slice.loadBits(256) -let flags: number = slice.loadUint(8) + let flags: number = slice.loadUint(8) -let proto_list: ProtoList | undefined = ((flags & (1 << 0)) ? loadProtoList(slice) : undefined) + let proto_list: ProtoList | undefined = ((flags & (1 << 0)) ? loadProtoList(slice) : undefined) if ((!(flags <= 1))) { -throw new Error('') + throw new Error('') } return { kind: 'DNSRecord_dns_adnl_address', @@ -14631,15 +14631,15 @@ throw new Error('') } ; if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x9fd3))) { -slice.loadUint(16) -let smc_addr: MsgAddressInt = loadMsgAddressInt(slice) + slice.loadUint(16) + let smc_addr: MsgAddressInt = loadMsgAddressInt(slice) -let flags: number = slice.loadUint(8) + let flags: number = slice.loadUint(8) -let cap_list: SmcCapList | undefined = ((flags & (1 << 0)) ? loadSmcCapList(slice) : undefined) + let cap_list: SmcCapList | undefined = ((flags & (1 << 0)) ? loadSmcCapList(slice) : undefined) if ((!(flags <= 1))) { -throw new Error('') + throw new Error('') } return { kind: 'DNSRecord_dns_smc_address', @@ -14684,11 +14684,11 @@ export function storeDNSRecord(dNSRecord: DNSRecord): (builder: Builder) => void builder.storeUint(dNSRecord.flags, 8) if ((dNSRecord.proto_list != undefined)) { - storeProtoList(dNSRecord.proto_list)(builder) + storeProtoList(dNSRecord.proto_list)(builder) } if ((!(dNSRecord.flags <= 1))) { - throw new Error('') + throw new Error('') } }) @@ -14704,11 +14704,11 @@ export function storeDNSRecord(dNSRecord: DNSRecord): (builder: Builder) => void builder.storeUint(dNSRecord.flags, 8) if ((dNSRecord.cap_list != undefined)) { - storeSmcCapList(dNSRecord.cap_list)(builder) + storeSmcCapList(dNSRecord.cap_list)(builder) } if ((!(dNSRecord.flags <= 1))) { - throw new Error('') + throw new Error('') } }) @@ -14721,7 +14721,7 @@ export function storeDNSRecord(dNSRecord: DNSRecord): (builder: Builder) => void export function loadProtoList(slice: Slice): ProtoList { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { -slice.loadUint(1) + slice.loadUint(1) return { kind: 'ProtoList_proto_list_nil', } @@ -14729,10 +14729,10 @@ slice.loadUint(1) } ; if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { -slice.loadUint(1) -let head: Protocol = loadProtocol(slice) + slice.loadUint(1) + let head: Protocol = loadProtocol(slice) -let tail: ProtoList = loadProtoList(slice) + let tail: ProtoList = loadProtoList(slice) return { kind: 'ProtoList_proto_list_next', @@ -14773,7 +14773,7 @@ export function storeProtoList(protoList: ProtoList): (builder: Builder) => void export function loadProtocol(slice: Slice): Protocol { if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x4854))) { -slice.loadUint(16) + slice.loadUint(16) return { kind: 'Protocol', } @@ -14795,7 +14795,7 @@ export function storeProtocol(protocol: Protocol): (builder: Builder) => void { export function loadSmcCapList(slice: Slice): SmcCapList { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { -slice.loadUint(1) + slice.loadUint(1) return { kind: 'SmcCapList_cap_list_nil', } @@ -14803,10 +14803,10 @@ slice.loadUint(1) } ; if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { -slice.loadUint(1) -let head: SmcCapability = loadSmcCapability(slice) + slice.loadUint(1) + let head: SmcCapability = loadSmcCapability(slice) -let tail: SmcCapList = loadSmcCapList(slice) + let tail: SmcCapList = loadSmcCapList(slice) return { kind: 'SmcCapList_cap_list_next', @@ -14847,7 +14847,7 @@ export function storeSmcCapList(smcCapList: SmcCapList): (builder: Builder) => v export function loadSmcCapability(slice: Slice): SmcCapability { if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x5371))) { -slice.loadUint(16) + slice.loadUint(16) return { kind: 'SmcCapability_cap_method_seqno', } @@ -14855,7 +14855,7 @@ slice.loadUint(16) } ; if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x71f4))) { -slice.loadUint(16) + slice.loadUint(16) return { kind: 'SmcCapability_cap_method_pubkey', } @@ -14863,7 +14863,7 @@ slice.loadUint(16) } ; if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x2177))) { -slice.loadUint(16) + slice.loadUint(16) return { kind: 'SmcCapability_cap_is_wallet', } @@ -14871,8 +14871,8 @@ slice.loadUint(16) } ; if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xff))) { -slice.loadUint(8) -let name: Text = loadText(slice) + slice.loadUint(8) + let name: Text = loadText(slice) return { kind: 'SmcCapability_cap_name', @@ -15005,20 +15005,20 @@ export function storeChanConfig(chanConfig: ChanConfig): (builder: Builder) => v export function loadChanState(slice: Slice): ChanState { if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b000))) { -slice.loadUint(3) -let signed_A: Bool = loadBool(slice) + slice.loadUint(3) + let signed_A: Bool = loadBool(slice) -let signed_B: Bool = loadBool(slice) + let signed_B: Bool = loadBool(slice) -let min_A: Grams = loadGrams(slice) + let min_A: Grams = loadGrams(slice) -let min_B: Grams = loadGrams(slice) + let min_B: Grams = loadGrams(slice) -let expire_at: number = slice.loadUint(32) + let expire_at: number = slice.loadUint(32) -let A: Grams = loadGrams(slice) + let A: Grams = loadGrams(slice) -let B: Grams = loadGrams(slice) + let B: Grams = loadGrams(slice) return { kind: 'ChanState_chan_state_init', @@ -15034,20 +15034,20 @@ let B: Grams = loadGrams(slice) } ; if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b001))) { -slice.loadUint(3) -let signed_A: Bool = loadBool(slice) + slice.loadUint(3) + let signed_A: Bool = loadBool(slice) -let signed_B: Bool = loadBool(slice) + let signed_B: Bool = loadBool(slice) -let promise_A: Grams = loadGrams(slice) + let promise_A: Grams = loadGrams(slice) -let promise_B: Grams = loadGrams(slice) + let promise_B: Grams = loadGrams(slice) -let expire_at: number = slice.loadUint(32) + let expire_at: number = slice.loadUint(32) -let A: Grams = loadGrams(slice) + let A: Grams = loadGrams(slice) -let B: Grams = loadGrams(slice) + let B: Grams = loadGrams(slice) return { kind: 'ChanState_chan_state_close', @@ -15063,10 +15063,10 @@ let B: Grams = loadGrams(slice) } ; if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b010))) { -slice.loadUint(3) -let A: Grams = loadGrams(slice) + slice.loadUint(3) + let A: Grams = loadGrams(slice) -let B: Grams = loadGrams(slice) + let B: Grams = loadGrams(slice) return { kind: 'ChanState_chan_state_payout', @@ -15224,16 +15224,16 @@ export function storeChanSignedPromise(chanSignedPromise: ChanSignedPromise): (b export function loadChanMsg(slice: Slice): ChanMsg { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x27317822))) { -slice.loadUint(32) -let inc_A: Grams = loadGrams(slice) + slice.loadUint(32) + let inc_A: Grams = loadGrams(slice) -let inc_B: Grams = loadGrams(slice) + let inc_B: Grams = loadGrams(slice) -let min_A: Grams = loadGrams(slice) + let min_A: Grams = loadGrams(slice) -let min_B: Grams = loadGrams(slice) + let min_B: Grams = loadGrams(slice) -let channel_id: number = slice.loadUint(64) + let channel_id: number = slice.loadUint(64) return { kind: 'ChanMsg_chan_msg_init', @@ -15247,12 +15247,12 @@ let channel_id: number = slice.loadUint(64) } ; if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xf28ae183))) { -slice.loadUint(32) -let extra_A: Grams = loadGrams(slice) + slice.loadUint(32) + let extra_A: Grams = loadGrams(slice) -let extra_B: Grams = loadGrams(slice) + let extra_B: Grams = loadGrams(slice) -let promise: ChanSignedPromise = loadChanSignedPromise(slice) + let promise: ChanSignedPromise = loadChanSignedPromise(slice) return { kind: 'ChanMsg_chan_msg_close', @@ -15264,7 +15264,7 @@ let promise: ChanSignedPromise = loadChanSignedPromise(slice) } ; if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x43278a28))) { -slice.loadUint(32) + slice.loadUint(32) return { kind: 'ChanMsg_chan_msg_timeout', } @@ -15272,7 +15272,7 @@ slice.loadUint(32) } ; if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x37fe7810))) { -slice.loadUint(32) + slice.loadUint(32) return { kind: 'ChanMsg_chan_msg_payout', } @@ -15413,8 +15413,8 @@ export function storeChanSignedMsg(chanSignedMsg: ChanSignedMsg): (builder: Buil export function loadChanOp(slice: Slice): ChanOp { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x912838d1))) { -slice.loadUint(32) -let msg: ChanSignedMsg = loadChanSignedMsg(slice) + slice.loadUint(32) + let msg: ChanSignedMsg = loadChanSignedMsg(slice) return { kind: 'ChanOp', diff --git a/generated_test.ts b/generated_test.ts index 35ab436..e583023 100644 --- a/generated_test.ts +++ b/generated_test.ts @@ -500,12 +500,12 @@ export function storeSimple(simple: Simple): (builder: Builder) => void { export function loadTwoConstructors(slice: Slice): TwoConstructors { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { -slice.loadUint(1) -let a: number = slice.loadUint(32) + slice.loadUint(1) + let a: number = slice.loadUint(32) -let b: number = slice.loadUint(7) + let b: number = slice.loadUint(7) -let c: number = slice.loadUint(32) + let c: number = slice.loadUint(32) return { kind: 'TwoConstructors_bool_false', @@ -517,8 +517,8 @@ let c: number = slice.loadUint(32) } ; if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { -slice.loadUint(1) -let b: number = slice.loadUint(32) + slice.loadUint(1) + let b: number = slice.loadUint(32) return { kind: 'TwoConstructors_bool_true', @@ -638,7 +638,7 @@ export function storeSharpConstructor(sharpConstructor: SharpConstructor): (buil export function loadMaybe(slice: Slice, loadTheType: (slice: Slice) => TheType ): Maybe { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { -slice.loadUint(1) + slice.loadUint(1) return { kind: 'Maybe_nothing', } @@ -646,8 +646,8 @@ slice.loadUint(1) } ; if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { -slice.loadUint(1) -let value: TheType = loadTheType(slice) + slice.loadUint(1) + let value: TheType = loadTheType(slice) return { kind: 'Maybe_just', @@ -710,8 +710,8 @@ export function loadEither(slice: Slice, loadX: (slice: Slice) => X , loadY: (slice: Slice) => Y ): Either { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { -slice.loadUint(1) -let value: X = loadX(slice) + slice.loadUint(1) + let value: X = loadX(slice) return { kind: 'Either_left', @@ -721,8 +721,8 @@ let value: X = loadX(slice) } ; if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { -slice.loadUint(1) -let value: Y = loadY(slice) + slice.loadUint(1) + let value: Y = loadY(slice) return { kind: 'Either_right', @@ -1309,7 +1309,7 @@ export function unary_unary_succ_get_n(x: Unary): number { } ; if ((x.kind == 'Unary_unary_succ')) { -let n = x.n + let n = x.n return (n + 1) } @@ -1320,7 +1320,7 @@ let n = x.n export function loadUnary(slice: Slice): Unary { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { -slice.loadUint(1) + slice.loadUint(1) return { kind: 'Unary_unary_zero', } @@ -1328,10 +1328,10 @@ slice.loadUint(1) } ; if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { -slice.loadUint(1) -let x: Unary = loadUnary(slice) + slice.loadUint(1) + let x: Unary = loadUnary(slice) -let n = unary_unary_succ_get_n(x) + let n = unary_unary_succ_get_n(x) return { kind: 'Unary_unary_succ', @@ -1370,10 +1370,10 @@ export function storeUnary(unary: Unary): (builder: Builder) => void { export function loadParamConst(slice: Slice, arg0: number, arg1: number): ParamConst { if (((slice.remainingBits >= 2) && ((slice.preloadUint(2) == 0b01) && ((arg0 == 2) && (arg1 == 1))))) { -slice.loadUint(2) -let m: number = slice.loadUint(32) + slice.loadUint(2) + let m: number = slice.loadUint(32) -let k: number = slice.loadUint(32) + let k: number = slice.loadUint(32) return { kind: 'ParamConst_b', @@ -1384,12 +1384,12 @@ let k: number = slice.loadUint(32) } ; if (((slice.remainingBits >= 2) && ((slice.preloadUint(2) == 0b01) && ((arg0 == 3) && (arg1 == 3))))) { -slice.loadUint(2) -let n: number = slice.loadUint(32) + slice.loadUint(2) + let n: number = slice.loadUint(32) -let m: number = slice.loadUint(32) + let m: number = slice.loadUint(32) -let k: number = slice.loadUint(32) + let k: number = slice.loadUint(32) return { kind: 'ParamConst_c', @@ -1401,7 +1401,7 @@ let k: number = slice.loadUint(32) } ; if (((arg0 == 1) && (arg1 == 1))) { -let n: number = slice.loadUint(32) + let n: number = slice.loadUint(32) return { kind: 'ParamConst_a', @@ -1411,13 +1411,13 @@ let n: number = slice.loadUint(32) } ; if (((arg0 == 4) && (arg1 == 2))) { -let n: number = slice.loadUint(32) + let n: number = slice.loadUint(32) -let m: number = slice.loadUint(32) + let m: number = slice.loadUint(32) -let k: number = slice.loadUint(32) + let k: number = slice.loadUint(32) -let l: number = slice.loadUint(32) + let l: number = slice.loadUint(32) return { kind: 'ParamConst_d', @@ -1496,13 +1496,13 @@ export function paramDifNames_c_get_n(x: ParamDifNames): number { } ; if ((x.kind == 'ParamDifNames_c')) { -let n = x.n + let n = x.n return (n + 1) } ; if ((x.kind == 'ParamDifNames_d')) { -let m = x.m + let m = x.m return (m * 2) } @@ -1521,13 +1521,13 @@ export function paramDifNames_d_get_m(x: ParamDifNames): number { } ; if ((x.kind == 'ParamDifNames_c')) { -let n = x.n + let n = x.n return (n + 1) } ; if ((x.kind == 'ParamDifNames_d')) { -let m = x.m + let m = x.m return (m * 2) } @@ -1538,7 +1538,7 @@ let m = x.m export function loadParamDifNames(slice: Slice, arg0: number): ParamDifNames { if (((slice.remainingBits >= 1) && ((slice.preloadUint(1) == 0b0) && (arg0 == 2)))) { -slice.loadUint(1) + slice.loadUint(1) return { kind: 'ParamDifNames_a', } @@ -1546,7 +1546,7 @@ slice.loadUint(1) } ; if (((slice.remainingBits >= 1) && ((slice.preloadUint(1) == 0b1) && (arg0 == 3)))) { -slice.loadUint(1) + slice.loadUint(1) return { kind: 'ParamDifNames_b', } @@ -1554,10 +1554,10 @@ slice.loadUint(1) } ; if (((slice.remainingBits >= 1) && ((slice.preloadUint(1) == 0b1) && (arg0 == 2)))) { -slice.loadUint(1) -let x: ParamDifNames = loadParamDifNames(slice, 2) + slice.loadUint(1) + let x: ParamDifNames = loadParamDifNames(slice, 2) -let n = paramDifNames_c_get_n(x) + let n = paramDifNames_c_get_n(x) return { kind: 'ParamDifNames_c', @@ -1568,10 +1568,10 @@ let n = paramDifNames_c_get_n(x) } ; if (((slice.remainingBits >= 1) && ((slice.preloadUint(1) == 0b0) && (arg0 == 3)))) { -slice.loadUint(1) -let x: ParamDifNames = loadParamDifNames(slice, 3) + slice.loadUint(1) + let x: ParamDifNames = loadParamDifNames(slice, 3) -let m = paramDifNames_d_get_m(x) + let m = paramDifNames_d_get_m(x) return { kind: 'ParamDifNames_d', @@ -1636,13 +1636,13 @@ export function paramDifNamesUser_get_k(x: ParamDifNames): number { } ; if ((x.kind == 'ParamDifNames_c')) { -let n = x.n + let n = x.n return (n + 1) } ; if ((x.kind == 'ParamDifNames_d')) { -let m = x.m + let m = x.m return (m * 2) } @@ -1653,10 +1653,10 @@ let m = x.m export function loadParamDifNamesUser(slice: Slice): ParamDifNamesUser { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { -slice.loadUint(1) -let x: ParamDifNames = loadParamDifNames(slice, 2) + slice.loadUint(1) + let x: ParamDifNames = loadParamDifNames(slice, 2) -let k = paramDifNamesUser_get_k(x) + let k = paramDifNamesUser_get_k(x) return { kind: 'ParamDifNamesUser', @@ -1683,10 +1683,10 @@ export function storeParamDifNamesUser(paramDifNamesUser: ParamDifNamesUser): (b export function loadNegationFromImplicit(slice: Slice): NegationFromImplicit { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { -slice.loadUint(1) -let t: number = slice.loadUint(32) + slice.loadUint(1) + let t: number = slice.loadUint(32) -let z: number = slice.loadUint(32) + let z: number = slice.loadUint(32) return { kind: 'NegationFromImplicit', @@ -1720,7 +1720,7 @@ export function unaryUserCheckOrder_get_l(label: Unary): number { } ; if ((label.kind == 'Unary_unary_succ')) { -let n = label.n + let n = label.n return (n + 1) } @@ -1937,8 +1937,8 @@ export function storeMathExprAsCombArg(mathExprAsCombArg: MathExprAsCombArg): (b export function loadEmptyTag(slice: Slice): EmptyTag { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xab787f76))) { -slice.loadUint(32) -let a: number = slice.loadUint(32) + slice.loadUint(32) + let a: number = slice.loadUint(32) return { kind: 'EmptyTag', @@ -1964,8 +1964,8 @@ export function storeEmptyTag(emptyTag: EmptyTag): (builder: Builder) => void { export function loadSharpTag(slice: Slice): SharpTag { if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xf4))) { -slice.loadUint(8) -let x: number = slice.loadUint(32) + slice.loadUint(8) + let x: number = slice.loadUint(32) return { kind: 'SharpTag', @@ -1991,8 +1991,8 @@ export function storeSharpTag(sharpTag: SharpTag): (builder: Builder) => void { export function loadDollarTag(slice: Slice): DollarTag { if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b1011))) { -slice.loadUint(4) -let x: number = slice.loadUint(32) + slice.loadUint(4) + let x: number = slice.loadUint(32) return { kind: 'DollarTag', @@ -2047,19 +2047,19 @@ export function storeTupleCheck(tupleCheck: TupleCheck): (builder: Builder) => v export function hashmap_get_l(label: HmLabel): number { if ((label.kind == 'HmLabel_hml_short')) { -let n = label.n + let n = label.n return n } ; if ((label.kind == 'HmLabel_hml_long')) { -let n = label.n + let n = label.n return n } ; if ((label.kind == 'HmLabel_hml_same')) { -let n = label.n + let n = label.n return n } @@ -2107,7 +2107,7 @@ export function storeHashmap(hashmap: Hashmap, storeX: (x: X) => (builder: export function loadHashmapNode(slice: Slice, arg0: number, loadX: (slice: Slice) => X ): HashmapNode { if ((arg0 == 0)) { -let value: X = loadX(slice) + let value: X = loadX(slice) return { kind: 'HashmapNode_hmn_leaf', @@ -2117,13 +2117,13 @@ let value: X = loadX(slice) } ; if (true) { -let slice1 = slice.loadRef().beginParse() + let slice1 = slice.loadRef().beginParse() -let left: Hashmap = loadHashmap(slice1, (arg0 - 1), loadX) + let left: Hashmap = loadHashmap(slice1, (arg0 - 1), loadX) -let slice2 = slice.loadRef().beginParse() + let slice2 = slice.loadRef().beginParse() -let right: Hashmap = loadHashmap(slice2, (arg0 - 1), loadX) + let right: Hashmap = loadHashmap(slice2, (arg0 - 1), loadX) return { kind: 'HashmapNode_hmn_fork', @@ -2179,7 +2179,7 @@ export function hmLabel_hml_short_get_n(len: Unary): number { } ; if ((len.kind == 'Unary_unary_succ')) { -let n = len.n + let n = len.n return (n + 1) } @@ -2190,19 +2190,19 @@ let n = len.n export function loadHmLabel(slice: Slice, m: number): HmLabel { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { -slice.loadUint(1) -let len: Unary = loadUnary(slice) + slice.loadUint(1) + let len: Unary = loadUnary(slice) -let n = hmLabel_hml_short_get_n(len) + let n = hmLabel_hml_short_get_n(len) -let s: Array = Array.from(Array(n).keys()).map(((arg: number) => { - return slice.loadBits(1) + let s: Array = Array.from(Array(n).keys()).map(((arg: number) => { + return slice.loadBits(1) - }) - ) +}) +) if ((!(n <= m))) { -throw new Error('') + throw new Error('') } return { kind: 'HmLabel_hml_short', @@ -2215,14 +2215,14 @@ throw new Error('') } ; if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b10))) { -slice.loadUint(2) -let n: number = slice.loadUint(bitLen(m)) + slice.loadUint(2) + let n: number = slice.loadUint(bitLen(m)) -let s: Array = Array.from(Array(n).keys()).map(((arg: number) => { - return slice.loadBits(1) + let s: Array = Array.from(Array(n).keys()).map(((arg: number) => { + return slice.loadBits(1) - }) - ) +}) +) return { kind: 'HmLabel_hml_long', @@ -2234,10 +2234,10 @@ let s: Array = Array.from(Array(n).keys()).map(((arg: number) => { } ; if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b11))) { -slice.loadUint(2) -let v: BitString = slice.loadBits(1) + slice.loadUint(2) + let v: BitString = slice.loadBits(1) -let n: number = slice.loadUint(bitLen(m)) + let n: number = slice.loadUint(bitLen(m)) return { kind: 'HmLabel_hml_same', @@ -2266,7 +2266,7 @@ export function storeHmLabel(hmLabel: HmLabel): (builder: Builder) => void { ) if ((!(hmLabel.n <= hmLabel.m))) { - throw new Error('') + throw new Error('') } }) @@ -2308,7 +2308,7 @@ export function storeHmLabel(hmLabel: HmLabel): (builder: Builder) => void { export function loadHashmapE(slice: Slice, n: number, loadX: (slice: Slice) => X ): HashmapE { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { -slice.loadUint(1) + slice.loadUint(1) return { kind: 'HashmapE_hme_empty', n: n, @@ -2317,10 +2317,10 @@ slice.loadUint(1) } ; if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { -slice.loadUint(1) -let slice1 = slice.loadRef().beginParse() + slice.loadUint(1) + let slice1 = slice.loadRef().beginParse() -let root: Hashmap = loadHashmap(slice1, n, loadX) + let root: Hashmap = loadHashmap(slice1, n, loadX) return { kind: 'HashmapE_hme_root', @@ -2399,10 +2399,10 @@ export function storeHashmapEUser(hashmapEUser: HashmapEUser): (builder: Builder export function loadConditionalField(slice: Slice): ConditionalField { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xdc165658))) { -slice.loadUint(32) -let a: number = slice.loadUint(1) + slice.loadUint(32) + let a: number = slice.loadUint(1) -let b: number | undefined = (a ? slice.loadUint(32) : undefined) + let b: number | undefined = (a ? slice.loadUint(32) : undefined) return { kind: 'ConditionalField', @@ -2423,7 +2423,7 @@ export function storeConditionalField(conditionalField: ConditionalField): (buil builder.storeUint(conditionalField.a, 1) if ((conditionalField.b != undefined)) { - builder.storeUint(conditionalField.b, 32) + builder.storeUint(conditionalField.b, 32) } }) @@ -2433,10 +2433,10 @@ export function storeConditionalField(conditionalField: ConditionalField): (buil export function loadBitSelection(slice: Slice): BitSelection { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xe1a2049e))) { -slice.loadUint(32) -let a: number = slice.loadUint(6) + slice.loadUint(32) + let a: number = slice.loadUint(6) -let b: number | undefined = ((a & (1 << 2)) ? slice.loadUint(32) : undefined) + let b: number | undefined = ((a & (1 << 2)) ? slice.loadUint(32) : undefined) return { kind: 'BitSelection', @@ -2457,7 +2457,7 @@ export function storeBitSelection(bitSelection: BitSelection): (builder: Builder builder.storeUint(bitSelection.a, 6) if ((bitSelection.b != undefined)) { - builder.storeUint(bitSelection.b, 32) + builder.storeUint(bitSelection.b, 32) } }) @@ -2467,11 +2467,11 @@ export function storeBitSelection(bitSelection: BitSelection): (builder: Builder export function loadImplicitCondition(slice: Slice): ImplicitCondition { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xd86a5028))) { -slice.loadUint(32) -let flags: number = slice.loadUint(10) + slice.loadUint(32) + let flags: number = slice.loadUint(10) if ((!(flags <= 100))) { -throw new Error('') + throw new Error('') } return { kind: 'ImplicitCondition', @@ -2491,7 +2491,7 @@ export function storeImplicitCondition(implicitCondition: ImplicitCondition): (b builder.storeUint(implicitCondition.flags, 10) if ((!(implicitCondition.flags <= 100))) { - throw new Error('') + throw new Error('') } }) @@ -2501,8 +2501,8 @@ export function storeImplicitCondition(implicitCondition: ImplicitCondition): (b export function loadMultipleEmptyConstructor(slice: Slice, arg0: number): MultipleEmptyConstructor { if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x85e93c51) && (arg0 == 0)))) { -slice.loadUint(32) -let a: number = slice.loadUint(32) + slice.loadUint(32) + let a: number = slice.loadUint(32) return { kind: 'MultipleEmptyConstructor__', @@ -2512,8 +2512,8 @@ let a: number = slice.loadUint(32) } ; if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xc5d27bf1) && (arg0 == 1)))) { -slice.loadUint(32) -let b: number = slice.loadUint(5) + slice.loadUint(32) + let b: number = slice.loadUint(5) return { kind: 'MultipleEmptyConstructor__1', @@ -2523,7 +2523,7 @@ let b: number = slice.loadUint(5) } ; if ((arg0 == 2)) { -let x: number = slice.loadUint(6) + let x: number = slice.loadUint(6) return { kind: 'MultipleEmptyConstructor_a', @@ -2586,7 +2586,7 @@ export function storeTrue(true0: True): (builder: Builder) => void { export function loadParamNamedArgInSecondConstr(slice: Slice, arg0: number): ParamNamedArgInSecondConstr { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { -slice.loadUint(1) + slice.loadUint(1) return { kind: 'ParamNamedArgInSecondConstr_a', n: arg0, @@ -2595,7 +2595,7 @@ slice.loadUint(1) } ; if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { -slice.loadUint(1) + slice.loadUint(1) return { kind: 'ParamNamedArgInSecondConstr_b', n: (arg0 - 1), @@ -2674,7 +2674,7 @@ export function loadEqualityExpression(slice: Slice): EqualityExpression { ; if ((!((5 + n) == 7))) { -throw new Error('') + throw new Error('') } ; return { @@ -2690,7 +2690,7 @@ export function storeEqualityExpression(equalityExpression: EqualityExpression): builder.storeUint(equalityExpression.n, 32) if ((!((5 + equalityExpression.n) == 7))) { - throw new Error('') + throw new Error('') } }) @@ -2742,8 +2742,8 @@ export function storeConditionalRef(conditionalRef: ConditionalRef): (builder: B export function loadLoadFromNegationOutsideExpr(slice: Slice): LoadFromNegationOutsideExpr { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x9bc7a987))) { -slice.loadUint(32) -let seq_no: number = slice.loadUint(32) + slice.loadUint(32) + let seq_no: number = slice.loadUint(32) return { kind: 'LoadFromNegationOutsideExpr', @@ -2791,8 +2791,8 @@ export function storeAnonymousData(anonymousData: AnonymousData): (builder: Buil export function loadFalseAnonField(slice: Slice): FalseAnonField { if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x0201))) { -slice.loadUint(16) -let value: number = slice.loadInt(257) + slice.loadUint(16) + let value: number = slice.loadInt(257) return { kind: 'FalseAnonField', @@ -2818,8 +2818,8 @@ export function storeFalseAnonField(falseAnonField: FalseAnonField): (builder: B export function loadConstructorOrder(slice: Slice): ConstructorOrder { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xc6cc03c3))) { -slice.loadUint(32) -let anon0: Simple = loadSimple(slice) + slice.loadUint(32) + let anon0: Simple = loadSimple(slice) return { kind: 'ConstructorOrder__', @@ -2829,8 +2829,8 @@ let anon0: Simple = loadSimple(slice) } ; if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { -slice.loadUint(1) -let a: Simple = loadSimple(slice) + slice.loadUint(1) + let a: Simple = loadSimple(slice) return { kind: 'ConstructorOrder_a', @@ -2870,8 +2870,8 @@ export function storeConstructorOrder(constructorOrder: ConstructorOrder): (buil export function loadCheckCrc32(slice: Slice): CheckCrc32 { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xd6e7c617))) { -slice.loadUint(32) -let a: number = slice.loadUint(32) + slice.loadUint(32) + let a: number = slice.loadUint(32) return { kind: 'CheckCrc32_a', @@ -2881,10 +2881,10 @@ let a: number = slice.loadUint(32) } ; if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xde1cb606))) { -slice.loadUint(32) -let b: number = slice.loadUint(32) + slice.loadUint(32) + let b: number = slice.loadUint(32) -let c: number = slice.loadUint(32) + let c: number = slice.loadUint(32) return { kind: 'CheckCrc32_b', diff --git a/src/codegen/tsgen.ts b/src/codegen/tsgen.ts index 7b8cd21..d67df77 100644 --- a/src/codegen/tsgen.ts +++ b/src/codegen/tsgen.ts @@ -396,7 +396,7 @@ export function toCode(node: TheNode, code: CodeBuilder = new CodeBuilder()): Co } if (node.type == "ExpressionStatement") { - code.appendInline(toCode(node.expression)) + code.add(toCode(node.expression).render()) } if (node.type == "TypeParametersExpression") { From 8f5b17af925ccba360daf0c83cdaab2751e36a66 Mon Sep 17 00:00:00 2001 From: polyprogrammist Date: Mon, 11 Dec 2023 23:47:38 -0500 Subject: [PATCH 05/10] tmp --- generated_block.ts | 2504 +++++++++++++++++++++--------------------- generated_test.ts | 420 +++---- src/codegen/tsgen.ts | 6 +- 3 files changed, 1466 insertions(+), 1464 deletions(-) diff --git a/generated_block.ts b/generated_block.ts index 5b9bfa6..eda748e 100644 --- a/generated_block.ts +++ b/generated_block.ts @@ -3,2387 +3,2387 @@ import { Slice } from 'ton' import { beginCell } from 'ton' import { BitString } from 'ton' export interface Unit { -readonly kind: 'Unit' + readonly kind: 'Unit'; } export interface True { -readonly kind: 'True' + readonly kind: 'True'; } export type Bool = Bool_bool_false | Bool_bool_true; export interface Bool_bool_false { -readonly kind: 'Bool_bool_false' + readonly kind: 'Bool_bool_false'; } export interface Bool_bool_true { -readonly kind: 'Bool_bool_true' + readonly kind: 'Bool_bool_true'; } export interface BoolFalse { -readonly kind: 'BoolFalse' + readonly kind: 'BoolFalse'; } export interface BoolTrue { -readonly kind: 'BoolTrue' + readonly kind: 'BoolTrue'; } export type Maybe = Maybe_nothing | Maybe_just; export interface Maybe_nothing { -readonly kind: 'Maybe_nothing' + readonly kind: 'Maybe_nothing'; } export interface Maybe_just { -readonly kind: 'Maybe_just' -readonly value: X + readonly kind: 'Maybe_just'; + readonly value: X; } export type Either = Either_left | Either_right; export interface Either_left { -readonly kind: 'Either_left' -readonly value: X + readonly kind: 'Either_left'; + readonly value: X; } export interface Either_right { -readonly kind: 'Either_right' -readonly value: Y + readonly kind: 'Either_right'; + readonly value: Y; } export interface Both { -readonly kind: 'Both' -readonly first: X -readonly second: Y + readonly kind: 'Both'; + readonly first: X; + readonly second: Y; } export interface Bit { -readonly kind: 'Bit' -readonly anon0: number + readonly kind: 'Bit'; + readonly anon0: number; } export interface Hashmap { -readonly kind: 'Hashmap' -readonly n: number -readonly l: number -readonly m: number -readonly label: HmLabel -readonly node: HashmapNode + readonly kind: 'Hashmap'; + readonly n: number; + readonly l: number; + readonly m: number; + readonly label: HmLabel; + readonly node: HashmapNode; } export type HashmapNode = HashmapNode_hmn_leaf | HashmapNode_hmn_fork; export interface HashmapNode_hmn_leaf { -readonly kind: 'HashmapNode_hmn_leaf' -readonly value: X + readonly kind: 'HashmapNode_hmn_leaf'; + readonly value: X; } export interface HashmapNode_hmn_fork { -readonly kind: 'HashmapNode_hmn_fork' -readonly n: number -readonly left: Hashmap -readonly right: Hashmap + readonly kind: 'HashmapNode_hmn_fork'; + readonly n: number; + readonly left: Hashmap; + readonly right: Hashmap; } export type HmLabel = HmLabel_hml_short | HmLabel_hml_long | HmLabel_hml_same; export interface HmLabel_hml_short { -readonly kind: 'HmLabel_hml_short' -readonly m: number -readonly n: number -readonly len: Unary -readonly s: Array + readonly kind: 'HmLabel_hml_short'; + readonly m: number; + readonly n: number; + readonly len: Unary; + readonly s: Array; } export interface HmLabel_hml_long { -readonly kind: 'HmLabel_hml_long' -readonly m: number -readonly n: number -readonly s: Array + readonly kind: 'HmLabel_hml_long'; + readonly m: number; + readonly n: number; + readonly s: Array; } export interface HmLabel_hml_same { -readonly kind: 'HmLabel_hml_same' -readonly m: number -readonly v: BitString -readonly n: number + readonly kind: 'HmLabel_hml_same'; + readonly m: number; + readonly v: BitString; + readonly n: number; } export type Unary = Unary_unary_zero | Unary_unary_succ; export interface Unary_unary_zero { -readonly kind: 'Unary_unary_zero' + readonly kind: 'Unary_unary_zero'; } export interface Unary_unary_succ { -readonly kind: 'Unary_unary_succ' -readonly n: number -readonly x: Unary + readonly kind: 'Unary_unary_succ'; + readonly n: number; + readonly x: Unary; } export type HashmapE = HashmapE_hme_empty | HashmapE_hme_root; export interface HashmapE_hme_empty { -readonly kind: 'HashmapE_hme_empty' -readonly n: number + readonly kind: 'HashmapE_hme_empty'; + readonly n: number; } export interface HashmapE_hme_root { -readonly kind: 'HashmapE_hme_root' -readonly n: number -readonly root: Hashmap + readonly kind: 'HashmapE_hme_root'; + readonly n: number; + readonly root: Hashmap; } export interface BitstringSet { -readonly kind: 'BitstringSet' -readonly n: number -readonly _: Hashmap + readonly kind: 'BitstringSet'; + readonly n: number; + readonly _: Hashmap; } export interface HashmapAug { -readonly kind: 'HashmapAug' -readonly n: number -readonly l: number -readonly m: number -readonly label: HmLabel -readonly node: HashmapAugNode + readonly kind: 'HashmapAug'; + readonly n: number; + readonly l: number; + readonly m: number; + readonly label: HmLabel; + readonly node: HashmapAugNode; } export type HashmapAugNode = HashmapAugNode_ahmn_leaf | HashmapAugNode_ahmn_fork; export interface HashmapAugNode_ahmn_leaf { -readonly kind: 'HashmapAugNode_ahmn_leaf' -readonly extra: Y -readonly value: X + readonly kind: 'HashmapAugNode_ahmn_leaf'; + readonly extra: Y; + readonly value: X; } export interface HashmapAugNode_ahmn_fork { -readonly kind: 'HashmapAugNode_ahmn_fork' -readonly n: number -readonly left: HashmapAug -readonly right: HashmapAug -readonly extra: Y + readonly kind: 'HashmapAugNode_ahmn_fork'; + readonly n: number; + readonly left: HashmapAug; + readonly right: HashmapAug; + readonly extra: Y; } export type HashmapAugE = HashmapAugE_ahme_empty | HashmapAugE_ahme_root; export interface HashmapAugE_ahme_empty { -readonly kind: 'HashmapAugE_ahme_empty' -readonly n: number -readonly extra: Y + readonly kind: 'HashmapAugE_ahme_empty'; + readonly n: number; + readonly extra: Y; } export interface HashmapAugE_ahme_root { -readonly kind: 'HashmapAugE_ahme_root' -readonly n: number -readonly root: HashmapAug -readonly extra: Y + readonly kind: 'HashmapAugE_ahme_root'; + readonly n: number; + readonly root: HashmapAug; + readonly extra: Y; } export interface VarHashmap { -readonly kind: 'VarHashmap' -readonly n: number -readonly l: number -readonly m: number -readonly label: HmLabel -readonly node: VarHashmapNode + readonly kind: 'VarHashmap'; + readonly n: number; + readonly l: number; + readonly m: number; + readonly label: HmLabel; + readonly node: VarHashmapNode; } export type VarHashmapNode = VarHashmapNode_vhmn_leaf | VarHashmapNode_vhmn_fork | VarHashmapNode_vhmn_cont; export interface VarHashmapNode_vhmn_leaf { -readonly kind: 'VarHashmapNode_vhmn_leaf' -readonly n: number -readonly value: X + readonly kind: 'VarHashmapNode_vhmn_leaf'; + readonly n: number; + readonly value: X; } export interface VarHashmapNode_vhmn_fork { -readonly kind: 'VarHashmapNode_vhmn_fork' -readonly n: number -readonly left: VarHashmap -readonly right: VarHashmap -readonly value: Maybe + readonly kind: 'VarHashmapNode_vhmn_fork'; + readonly n: number; + readonly left: VarHashmap; + readonly right: VarHashmap; + readonly value: Maybe; } export interface VarHashmapNode_vhmn_cont { -readonly kind: 'VarHashmapNode_vhmn_cont' -readonly n: number -readonly branch: BitString -readonly child: VarHashmap -readonly value: X + readonly kind: 'VarHashmapNode_vhmn_cont'; + readonly n: number; + readonly branch: BitString; + readonly child: VarHashmap; + readonly value: X; } export type VarHashmapE = VarHashmapE_vhme_empty | VarHashmapE_vhme_root; export interface VarHashmapE_vhme_empty { -readonly kind: 'VarHashmapE_vhme_empty' -readonly n: number + readonly kind: 'VarHashmapE_vhme_empty'; + readonly n: number; } export interface VarHashmapE_vhme_root { -readonly kind: 'VarHashmapE_vhme_root' -readonly n: number -readonly root: VarHashmap + readonly kind: 'VarHashmapE_vhme_root'; + readonly n: number; + readonly root: VarHashmap; } export interface PfxHashmap { -readonly kind: 'PfxHashmap' -readonly n: number -readonly l: number -readonly m: number -readonly label: HmLabel -readonly node: PfxHashmapNode + readonly kind: 'PfxHashmap'; + readonly n: number; + readonly l: number; + readonly m: number; + readonly label: HmLabel; + readonly node: PfxHashmapNode; } export type PfxHashmapNode = PfxHashmapNode_phmn_leaf | PfxHashmapNode_phmn_fork; export interface PfxHashmapNode_phmn_leaf { -readonly kind: 'PfxHashmapNode_phmn_leaf' -readonly n: number -readonly value: X + readonly kind: 'PfxHashmapNode_phmn_leaf'; + readonly n: number; + readonly value: X; } export interface PfxHashmapNode_phmn_fork { -readonly kind: 'PfxHashmapNode_phmn_fork' -readonly n: number -readonly left: PfxHashmap -readonly right: PfxHashmap + readonly kind: 'PfxHashmapNode_phmn_fork'; + readonly n: number; + readonly left: PfxHashmap; + readonly right: PfxHashmap; } export type PfxHashmapE = PfxHashmapE_phme_empty | PfxHashmapE_phme_root; export interface PfxHashmapE_phme_empty { -readonly kind: 'PfxHashmapE_phme_empty' -readonly n: number + readonly kind: 'PfxHashmapE_phme_empty'; + readonly n: number; } export interface PfxHashmapE_phme_root { -readonly kind: 'PfxHashmapE_phme_root' -readonly n: number -readonly root: PfxHashmap + readonly kind: 'PfxHashmapE_phme_root'; + readonly n: number; + readonly root: PfxHashmap; } export type MsgAddressExt = MsgAddressExt_addr_none | MsgAddressExt_addr_extern; export interface MsgAddressExt_addr_none { -readonly kind: 'MsgAddressExt_addr_none' + readonly kind: 'MsgAddressExt_addr_none'; } export interface MsgAddressExt_addr_extern { -readonly kind: 'MsgAddressExt_addr_extern' -readonly len: number -readonly external_address: BitString + readonly kind: 'MsgAddressExt_addr_extern'; + readonly len: number; + readonly external_address: BitString; } export interface Anycast { -readonly kind: 'Anycast' -readonly depth: number -readonly rewrite_pfx: BitString + readonly kind: 'Anycast'; + readonly depth: number; + readonly rewrite_pfx: BitString; } export type MsgAddressInt = MsgAddressInt_addr_std | MsgAddressInt_addr_var; export interface MsgAddressInt_addr_std { -readonly kind: 'MsgAddressInt_addr_std' -readonly anycast: Maybe -readonly workchain_id: number -readonly address: BitString + readonly kind: 'MsgAddressInt_addr_std'; + readonly anycast: Maybe; + readonly workchain_id: number; + readonly address: BitString; } export interface MsgAddressInt_addr_var { -readonly kind: 'MsgAddressInt_addr_var' -readonly anycast: Maybe -readonly addr_len: number -readonly workchain_id: number -readonly address: BitString + readonly kind: 'MsgAddressInt_addr_var'; + readonly anycast: Maybe; + readonly addr_len: number; + readonly workchain_id: number; + readonly address: BitString; } export type MsgAddress = MsgAddress__ | MsgAddress__1; export interface MsgAddress__ { -readonly kind: 'MsgAddress__' -readonly _: MsgAddressInt + readonly kind: 'MsgAddress__'; + readonly _: MsgAddressInt; } export interface MsgAddress__1 { -readonly kind: 'MsgAddress__1' -readonly _: MsgAddressExt + readonly kind: 'MsgAddress__1'; + readonly _: MsgAddressExt; } export interface VarUInteger { -readonly kind: 'VarUInteger' -readonly n: number -readonly len: number -readonly value: number + readonly kind: 'VarUInteger'; + readonly n: number; + readonly len: number; + readonly value: number; } export interface VarInteger { -readonly kind: 'VarInteger' -readonly n: number -readonly len: number -readonly value: number + readonly kind: 'VarInteger'; + readonly n: number; + readonly len: number; + readonly value: number; } export interface Grams { -readonly kind: 'Grams' -readonly amount: VarUInteger + readonly kind: 'Grams'; + readonly amount: VarUInteger; } export interface ExtraCurrencyCollection { -readonly kind: 'ExtraCurrencyCollection' -readonly dict: HashmapE + readonly kind: 'ExtraCurrencyCollection'; + readonly dict: HashmapE; } export interface CurrencyCollection { -readonly kind: 'CurrencyCollection' -readonly grams: Grams -readonly other: ExtraCurrencyCollection + readonly kind: 'CurrencyCollection'; + readonly grams: Grams; + readonly other: ExtraCurrencyCollection; } export type CommonMsgInfo = CommonMsgInfo_int_msg_info | CommonMsgInfo_ext_in_msg_info | CommonMsgInfo_ext_out_msg_info; export interface CommonMsgInfo_int_msg_info { -readonly kind: 'CommonMsgInfo_int_msg_info' -readonly ihr_disabled: Bool -readonly bounce: Bool -readonly bounced: Bool -readonly src: MsgAddressInt -readonly dest: MsgAddressInt -readonly value: CurrencyCollection -readonly ihr_fee: Grams -readonly fwd_fee: Grams -readonly created_lt: number -readonly created_at: number + readonly kind: 'CommonMsgInfo_int_msg_info'; + readonly ihr_disabled: Bool; + readonly bounce: Bool; + readonly bounced: Bool; + readonly src: MsgAddressInt; + readonly dest: MsgAddressInt; + readonly value: CurrencyCollection; + readonly ihr_fee: Grams; + readonly fwd_fee: Grams; + readonly created_lt: number; + readonly created_at: number; } export interface CommonMsgInfo_ext_in_msg_info { -readonly kind: 'CommonMsgInfo_ext_in_msg_info' -readonly src: MsgAddressExt -readonly dest: MsgAddressInt -readonly import_fee: Grams + readonly kind: 'CommonMsgInfo_ext_in_msg_info'; + readonly src: MsgAddressExt; + readonly dest: MsgAddressInt; + readonly import_fee: Grams; } export interface CommonMsgInfo_ext_out_msg_info { -readonly kind: 'CommonMsgInfo_ext_out_msg_info' -readonly src: MsgAddressInt -readonly dest: MsgAddressExt -readonly created_lt: number -readonly created_at: number + readonly kind: 'CommonMsgInfo_ext_out_msg_info'; + readonly src: MsgAddressInt; + readonly dest: MsgAddressExt; + readonly created_lt: number; + readonly created_at: number; } export type CommonMsgInfoRelaxed = CommonMsgInfoRelaxed_int_msg_info | CommonMsgInfoRelaxed_ext_out_msg_info; export interface CommonMsgInfoRelaxed_int_msg_info { -readonly kind: 'CommonMsgInfoRelaxed_int_msg_info' -readonly ihr_disabled: Bool -readonly bounce: Bool -readonly bounced: Bool -readonly src: MsgAddress -readonly dest: MsgAddressInt -readonly value: CurrencyCollection -readonly ihr_fee: Grams -readonly fwd_fee: Grams -readonly created_lt: number -readonly created_at: number + readonly kind: 'CommonMsgInfoRelaxed_int_msg_info'; + readonly ihr_disabled: Bool; + readonly bounce: Bool; + readonly bounced: Bool; + readonly src: MsgAddress; + readonly dest: MsgAddressInt; + readonly value: CurrencyCollection; + readonly ihr_fee: Grams; + readonly fwd_fee: Grams; + readonly created_lt: number; + readonly created_at: number; } export interface CommonMsgInfoRelaxed_ext_out_msg_info { -readonly kind: 'CommonMsgInfoRelaxed_ext_out_msg_info' -readonly src: MsgAddress -readonly dest: MsgAddressExt -readonly created_lt: number -readonly created_at: number + readonly kind: 'CommonMsgInfoRelaxed_ext_out_msg_info'; + readonly src: MsgAddress; + readonly dest: MsgAddressExt; + readonly created_lt: number; + readonly created_at: number; } export interface TickTock { -readonly kind: 'TickTock' -readonly tick: Bool -readonly tock: Bool + readonly kind: 'TickTock'; + readonly tick: Bool; + readonly tock: Bool; } export interface StateInit { -readonly kind: 'StateInit' -readonly split_depth: Maybe -readonly special: Maybe -readonly code: Maybe -readonly data: Maybe -readonly library: HashmapE + readonly kind: 'StateInit'; + readonly split_depth: Maybe; + readonly special: Maybe; + readonly code: Maybe; + readonly data: Maybe; + readonly library: HashmapE; } export interface SimpleLib { -readonly kind: 'SimpleLib' -readonly public0: Bool -readonly root: Slice + readonly kind: 'SimpleLib'; + readonly public0: Bool; + readonly root: Slice; } export interface Message { -readonly kind: 'Message' -readonly info: CommonMsgInfo -readonly init: Maybe> -readonly body: Either + readonly kind: 'Message'; + readonly info: CommonMsgInfo; + readonly init: Maybe>; + readonly body: Either; } export interface MessageRelaxed { -readonly kind: 'MessageRelaxed' -readonly info: CommonMsgInfoRelaxed -readonly init: Maybe> -readonly body: Either + readonly kind: 'MessageRelaxed'; + readonly info: CommonMsgInfoRelaxed; + readonly init: Maybe>; + readonly body: Either; } export interface MessageAny { -readonly kind: 'MessageAny' -readonly anon0: Message + readonly kind: 'MessageAny'; + readonly anon0: Message; } export type IntermediateAddress = IntermediateAddress_interm_addr_regular | IntermediateAddress_interm_addr_simple | IntermediateAddress_interm_addr_ext; export interface IntermediateAddress_interm_addr_regular { -readonly kind: 'IntermediateAddress_interm_addr_regular' -readonly use_dest_bits: number + readonly kind: 'IntermediateAddress_interm_addr_regular'; + readonly use_dest_bits: number; } export interface IntermediateAddress_interm_addr_simple { -readonly kind: 'IntermediateAddress_interm_addr_simple' -readonly workchain_id: number -readonly addr_pfx: number + readonly kind: 'IntermediateAddress_interm_addr_simple'; + readonly workchain_id: number; + readonly addr_pfx: number; } export interface IntermediateAddress_interm_addr_ext { -readonly kind: 'IntermediateAddress_interm_addr_ext' -readonly workchain_id: number -readonly addr_pfx: number + readonly kind: 'IntermediateAddress_interm_addr_ext'; + readonly workchain_id: number; + readonly addr_pfx: number; } export interface MsgEnvelope { -readonly kind: 'MsgEnvelope' -readonly cur_addr: IntermediateAddress -readonly next_addr: IntermediateAddress -readonly fwd_fee_remaining: Grams -readonly msg: Message + readonly kind: 'MsgEnvelope'; + readonly cur_addr: IntermediateAddress; + readonly next_addr: IntermediateAddress; + readonly fwd_fee_remaining: Grams; + readonly msg: Message; } export type InMsg = InMsg_msg_import_ext | InMsg_msg_import_ihr | InMsg_msg_import_imm | InMsg_msg_import_fin | InMsg_msg_import_tr | InMsg_msg_discard_fin | InMsg_msg_discard_tr; export interface InMsg_msg_import_ext { -readonly kind: 'InMsg_msg_import_ext' -readonly msg: Message -readonly transaction: Transaction + readonly kind: 'InMsg_msg_import_ext'; + readonly msg: Message; + readonly transaction: Transaction; } export interface InMsg_msg_import_ihr { -readonly kind: 'InMsg_msg_import_ihr' -readonly msg: Message -readonly transaction: Transaction -readonly ihr_fee: Grams -readonly proof_created: Slice + readonly kind: 'InMsg_msg_import_ihr'; + readonly msg: Message; + readonly transaction: Transaction; + readonly ihr_fee: Grams; + readonly proof_created: Slice; } export interface InMsg_msg_import_imm { -readonly kind: 'InMsg_msg_import_imm' -readonly in_msg: MsgEnvelope -readonly transaction: Transaction -readonly fwd_fee: Grams + readonly kind: 'InMsg_msg_import_imm'; + readonly in_msg: MsgEnvelope; + readonly transaction: Transaction; + readonly fwd_fee: Grams; } export interface InMsg_msg_import_fin { -readonly kind: 'InMsg_msg_import_fin' -readonly in_msg: MsgEnvelope -readonly transaction: Transaction -readonly fwd_fee: Grams + readonly kind: 'InMsg_msg_import_fin'; + readonly in_msg: MsgEnvelope; + readonly transaction: Transaction; + readonly fwd_fee: Grams; } export interface InMsg_msg_import_tr { -readonly kind: 'InMsg_msg_import_tr' -readonly in_msg: MsgEnvelope -readonly out_msg: MsgEnvelope -readonly transit_fee: Grams + readonly kind: 'InMsg_msg_import_tr'; + readonly in_msg: MsgEnvelope; + readonly out_msg: MsgEnvelope; + readonly transit_fee: Grams; } export interface InMsg_msg_discard_fin { -readonly kind: 'InMsg_msg_discard_fin' -readonly in_msg: MsgEnvelope -readonly transaction_id: number -readonly fwd_fee: Grams + readonly kind: 'InMsg_msg_discard_fin'; + readonly in_msg: MsgEnvelope; + readonly transaction_id: number; + readonly fwd_fee: Grams; } export interface InMsg_msg_discard_tr { -readonly kind: 'InMsg_msg_discard_tr' -readonly in_msg: MsgEnvelope -readonly transaction_id: number -readonly fwd_fee: Grams -readonly proof_delivered: Slice + readonly kind: 'InMsg_msg_discard_tr'; + readonly in_msg: MsgEnvelope; + readonly transaction_id: number; + readonly fwd_fee: Grams; + readonly proof_delivered: Slice; } export interface ImportFees { -readonly kind: 'ImportFees' -readonly fees_collected: Grams -readonly value_imported: CurrencyCollection + readonly kind: 'ImportFees'; + readonly fees_collected: Grams; + readonly value_imported: CurrencyCollection; } export interface InMsgDescr { -readonly kind: 'InMsgDescr' -readonly anon0: HashmapAugE + readonly kind: 'InMsgDescr'; + readonly anon0: HashmapAugE; } export type OutMsg = OutMsg_msg_export_ext | OutMsg_msg_export_imm | OutMsg_msg_export_new | OutMsg_msg_export_tr | OutMsg_msg_export_deq | OutMsg_msg_export_deq_short | OutMsg_msg_export_tr_req | OutMsg_msg_export_deq_imm; export interface OutMsg_msg_export_ext { -readonly kind: 'OutMsg_msg_export_ext' -readonly msg: Message -readonly transaction: Transaction + readonly kind: 'OutMsg_msg_export_ext'; + readonly msg: Message; + readonly transaction: Transaction; } export interface OutMsg_msg_export_imm { -readonly kind: 'OutMsg_msg_export_imm' -readonly out_msg: MsgEnvelope -readonly transaction: Transaction -readonly reimport: InMsg + readonly kind: 'OutMsg_msg_export_imm'; + readonly out_msg: MsgEnvelope; + readonly transaction: Transaction; + readonly reimport: InMsg; } export interface OutMsg_msg_export_new { -readonly kind: 'OutMsg_msg_export_new' -readonly out_msg: MsgEnvelope -readonly transaction: Transaction + readonly kind: 'OutMsg_msg_export_new'; + readonly out_msg: MsgEnvelope; + readonly transaction: Transaction; } export interface OutMsg_msg_export_tr { -readonly kind: 'OutMsg_msg_export_tr' -readonly out_msg: MsgEnvelope -readonly imported: InMsg + readonly kind: 'OutMsg_msg_export_tr'; + readonly out_msg: MsgEnvelope; + readonly imported: InMsg; } export interface OutMsg_msg_export_deq { -readonly kind: 'OutMsg_msg_export_deq' -readonly out_msg: MsgEnvelope -readonly import_block_lt: number + readonly kind: 'OutMsg_msg_export_deq'; + readonly out_msg: MsgEnvelope; + readonly import_block_lt: number; } export interface OutMsg_msg_export_deq_short { -readonly kind: 'OutMsg_msg_export_deq_short' -readonly msg_env_hash: BitString -readonly next_workchain: number -readonly next_addr_pfx: number -readonly import_block_lt: number + readonly kind: 'OutMsg_msg_export_deq_short'; + readonly msg_env_hash: BitString; + readonly next_workchain: number; + readonly next_addr_pfx: number; + readonly import_block_lt: number; } export interface OutMsg_msg_export_tr_req { -readonly kind: 'OutMsg_msg_export_tr_req' -readonly out_msg: MsgEnvelope -readonly imported: InMsg + readonly kind: 'OutMsg_msg_export_tr_req'; + readonly out_msg: MsgEnvelope; + readonly imported: InMsg; } export interface OutMsg_msg_export_deq_imm { -readonly kind: 'OutMsg_msg_export_deq_imm' -readonly out_msg: MsgEnvelope -readonly reimport: InMsg + readonly kind: 'OutMsg_msg_export_deq_imm'; + readonly out_msg: MsgEnvelope; + readonly reimport: InMsg; } export interface EnqueuedMsg { -readonly kind: 'EnqueuedMsg' -readonly enqueued_lt: number -readonly out_msg: MsgEnvelope + readonly kind: 'EnqueuedMsg'; + readonly enqueued_lt: number; + readonly out_msg: MsgEnvelope; } export interface OutMsgDescr { -readonly kind: 'OutMsgDescr' -readonly anon0: HashmapAugE + readonly kind: 'OutMsgDescr'; + readonly anon0: HashmapAugE; } export interface OutMsgQueue { -readonly kind: 'OutMsgQueue' -readonly anon0: HashmapAugE + readonly kind: 'OutMsgQueue'; + readonly anon0: HashmapAugE; } export interface ProcessedUpto { -readonly kind: 'ProcessedUpto' -readonly last_msg_lt: number -readonly last_msg_hash: BitString + readonly kind: 'ProcessedUpto'; + readonly last_msg_lt: number; + readonly last_msg_hash: BitString; } export interface ProcessedInfo { -readonly kind: 'ProcessedInfo' -readonly anon0: HashmapE + readonly kind: 'ProcessedInfo'; + readonly anon0: HashmapE; } export interface IhrPendingSince { -readonly kind: 'IhrPendingSince' -readonly import_lt: number + readonly kind: 'IhrPendingSince'; + readonly import_lt: number; } export interface IhrPendingInfo { -readonly kind: 'IhrPendingInfo' -readonly anon0: HashmapE + readonly kind: 'IhrPendingInfo'; + readonly anon0: HashmapE; } export interface OutMsgQueueInfo { -readonly kind: 'OutMsgQueueInfo' -readonly out_queue: OutMsgQueue -readonly proc_info: ProcessedInfo -readonly ihr_pending: IhrPendingInfo + readonly kind: 'OutMsgQueueInfo'; + readonly out_queue: OutMsgQueue; + readonly proc_info: ProcessedInfo; + readonly ihr_pending: IhrPendingInfo; } export interface StorageUsed { -readonly kind: 'StorageUsed' -readonly _cells: VarUInteger -readonly bits: VarUInteger -readonly public_cells: VarUInteger + readonly kind: 'StorageUsed'; + readonly _cells: VarUInteger; + readonly bits: VarUInteger; + readonly public_cells: VarUInteger; } export interface StorageUsedShort { -readonly kind: 'StorageUsedShort' -readonly _cells: VarUInteger -readonly bits: VarUInteger + readonly kind: 'StorageUsedShort'; + readonly _cells: VarUInteger; + readonly bits: VarUInteger; } export interface StorageInfo { -readonly kind: 'StorageInfo' -readonly used: StorageUsed -readonly last_paid: number -readonly due_payment: Maybe + readonly kind: 'StorageInfo'; + readonly used: StorageUsed; + readonly last_paid: number; + readonly due_payment: Maybe; } export type Account = Account_account_none | Account_account; export interface Account_account_none { -readonly kind: 'Account_account_none' + readonly kind: 'Account_account_none'; } export interface Account_account { -readonly kind: 'Account_account' -readonly addr: MsgAddressInt -readonly storage_stat: StorageInfo -readonly storage: AccountStorage + readonly kind: 'Account_account'; + readonly addr: MsgAddressInt; + readonly storage_stat: StorageInfo; + readonly storage: AccountStorage; } export interface AccountStorage { -readonly kind: 'AccountStorage' -readonly last_trans_lt: number -readonly balance: CurrencyCollection -readonly state: AccountState + readonly kind: 'AccountStorage'; + readonly last_trans_lt: number; + readonly balance: CurrencyCollection; + readonly state: AccountState; } export type AccountState = AccountState_account_uninit | AccountState_account_active | AccountState_account_frozen; export interface AccountState_account_uninit { -readonly kind: 'AccountState_account_uninit' + readonly kind: 'AccountState_account_uninit'; } export interface AccountState_account_active { -readonly kind: 'AccountState_account_active' -readonly _: StateInit + readonly kind: 'AccountState_account_active'; + readonly _: StateInit; } export interface AccountState_account_frozen { -readonly kind: 'AccountState_account_frozen' -readonly state_hash: BitString + readonly kind: 'AccountState_account_frozen'; + readonly state_hash: BitString; } export type AccountStatus = AccountStatus_acc_state_uninit | AccountStatus_acc_state_frozen | AccountStatus_acc_state_active | AccountStatus_acc_state_nonexist; export interface AccountStatus_acc_state_uninit { -readonly kind: 'AccountStatus_acc_state_uninit' + readonly kind: 'AccountStatus_acc_state_uninit'; } export interface AccountStatus_acc_state_frozen { -readonly kind: 'AccountStatus_acc_state_frozen' + readonly kind: 'AccountStatus_acc_state_frozen'; } export interface AccountStatus_acc_state_active { -readonly kind: 'AccountStatus_acc_state_active' + readonly kind: 'AccountStatus_acc_state_active'; } export interface AccountStatus_acc_state_nonexist { -readonly kind: 'AccountStatus_acc_state_nonexist' + readonly kind: 'AccountStatus_acc_state_nonexist'; } export interface ShardAccount { -readonly kind: 'ShardAccount' -readonly account: Account -readonly last_trans_hash: BitString -readonly last_trans_lt: number + readonly kind: 'ShardAccount'; + readonly account: Account; + readonly last_trans_hash: BitString; + readonly last_trans_lt: number; } export interface DepthBalanceInfo { -readonly kind: 'DepthBalanceInfo' -readonly split_depth: number -readonly balance: CurrencyCollection + readonly kind: 'DepthBalanceInfo'; + readonly split_depth: number; + readonly balance: CurrencyCollection; } export interface ShardAccounts { -readonly kind: 'ShardAccounts' -readonly anon0: HashmapAugE + readonly kind: 'ShardAccounts'; + readonly anon0: HashmapAugE; } export interface Transaction { -readonly kind: 'Transaction' -readonly account_addr: BitString -readonly lt: number -readonly prev_trans_hash: BitString -readonly prev_trans_lt: number -readonly now: number -readonly outmsg_cnt: number -readonly orig_status: AccountStatus -readonly end_status: AccountStatus -readonly in_msg: Maybe> -readonly out_msgs: HashmapE> -readonly total_fees: CurrencyCollection -readonly state_update: HASH_UPDATE -readonly description: TransactionDescr + readonly kind: 'Transaction'; + readonly account_addr: BitString; + readonly lt: number; + readonly prev_trans_hash: BitString; + readonly prev_trans_lt: number; + readonly now: number; + readonly outmsg_cnt: number; + readonly orig_status: AccountStatus; + readonly end_status: AccountStatus; + readonly in_msg: Maybe>; + readonly out_msgs: HashmapE>; + readonly total_fees: CurrencyCollection; + readonly state_update: HASH_UPDATE; + readonly description: TransactionDescr; } export interface MERKLE_UPDATE { -readonly kind: 'MERKLE_UPDATE' -readonly old_hash: BitString -readonly new_hash: BitString -readonly old: X -readonly new0: X + readonly kind: 'MERKLE_UPDATE'; + readonly old_hash: BitString; + readonly new_hash: BitString; + readonly old: X; + readonly new0: X; } export interface HASH_UPDATE { -readonly kind: 'HASH_UPDATE' -readonly old_hash: BitString -readonly new_hash: BitString + readonly kind: 'HASH_UPDATE'; + readonly old_hash: BitString; + readonly new_hash: BitString; } export interface MERKLE_PROOF { -readonly kind: 'MERKLE_PROOF' -readonly virtual_hash: BitString -readonly depth: number -readonly virtual_root: X + readonly kind: 'MERKLE_PROOF'; + readonly virtual_hash: BitString; + readonly depth: number; + readonly virtual_root: X; } export interface AccountBlock { -readonly kind: 'AccountBlock' -readonly account_addr: BitString -readonly transactions: HashmapAug -readonly state_update: HASH_UPDATE + readonly kind: 'AccountBlock'; + readonly account_addr: BitString; + readonly transactions: HashmapAug; + readonly state_update: HASH_UPDATE; } export interface ShardAccountBlocks { -readonly kind: 'ShardAccountBlocks' -readonly anon0: HashmapAugE + readonly kind: 'ShardAccountBlocks'; + readonly anon0: HashmapAugE; } export interface TrStoragePhase { -readonly kind: 'TrStoragePhase' -readonly storage_fees_collected: Grams -readonly storage_fees_due: Maybe -readonly status_change: AccStatusChange + readonly kind: 'TrStoragePhase'; + readonly storage_fees_collected: Grams; + readonly storage_fees_due: Maybe; + readonly status_change: AccStatusChange; } export type AccStatusChange = AccStatusChange_acst_unchanged | AccStatusChange_acst_frozen | AccStatusChange_acst_deleted; export interface AccStatusChange_acst_unchanged { -readonly kind: 'AccStatusChange_acst_unchanged' + readonly kind: 'AccStatusChange_acst_unchanged'; } export interface AccStatusChange_acst_frozen { -readonly kind: 'AccStatusChange_acst_frozen' + readonly kind: 'AccStatusChange_acst_frozen'; } export interface AccStatusChange_acst_deleted { -readonly kind: 'AccStatusChange_acst_deleted' + readonly kind: 'AccStatusChange_acst_deleted'; } export interface TrCreditPhase { -readonly kind: 'TrCreditPhase' -readonly due_fees_collected: Maybe -readonly credit: CurrencyCollection + readonly kind: 'TrCreditPhase'; + readonly due_fees_collected: Maybe; + readonly credit: CurrencyCollection; } export type TrComputePhase = TrComputePhase_tr_phase_compute_skipped | TrComputePhase_tr_phase_compute_vm; export interface TrComputePhase_tr_phase_compute_skipped { -readonly kind: 'TrComputePhase_tr_phase_compute_skipped' -readonly reason: ComputeSkipReason + readonly kind: 'TrComputePhase_tr_phase_compute_skipped'; + readonly reason: ComputeSkipReason; } export interface TrComputePhase_tr_phase_compute_vm { -readonly kind: 'TrComputePhase_tr_phase_compute_vm' -readonly success: Bool -readonly msg_state_used: Bool -readonly account_activated: Bool -readonly gas_fees: Grams -readonly gas_used: VarUInteger -readonly gas_limit: VarUInteger -readonly gas_credit: Maybe -readonly mode: number -readonly exit_code: number -readonly exit_arg: Maybe -readonly vm_steps: number -readonly vm_init_state_hash: BitString -readonly vm_final_state_hash: BitString + readonly kind: 'TrComputePhase_tr_phase_compute_vm'; + readonly success: Bool; + readonly msg_state_used: Bool; + readonly account_activated: Bool; + readonly gas_fees: Grams; + readonly gas_used: VarUInteger; + readonly gas_limit: VarUInteger; + readonly gas_credit: Maybe; + readonly mode: number; + readonly exit_code: number; + readonly exit_arg: Maybe; + readonly vm_steps: number; + readonly vm_init_state_hash: BitString; + readonly vm_final_state_hash: BitString; } export type ComputeSkipReason = ComputeSkipReason_cskip_no_state | ComputeSkipReason_cskip_bad_state | ComputeSkipReason_cskip_no_gas; export interface ComputeSkipReason_cskip_no_state { -readonly kind: 'ComputeSkipReason_cskip_no_state' + readonly kind: 'ComputeSkipReason_cskip_no_state'; } export interface ComputeSkipReason_cskip_bad_state { -readonly kind: 'ComputeSkipReason_cskip_bad_state' + readonly kind: 'ComputeSkipReason_cskip_bad_state'; } export interface ComputeSkipReason_cskip_no_gas { -readonly kind: 'ComputeSkipReason_cskip_no_gas' + readonly kind: 'ComputeSkipReason_cskip_no_gas'; } export interface TrActionPhase { -readonly kind: 'TrActionPhase' -readonly success: Bool -readonly valid: Bool -readonly no_funds: Bool -readonly status_change: AccStatusChange -readonly total_fwd_fees: Maybe -readonly total_action_fees: Maybe -readonly result_code: number -readonly result_arg: Maybe -readonly tot_actions: number -readonly spec_actions: number -readonly skipped_actions: number -readonly msgs_created: number -readonly action_list_hash: BitString -readonly tot_msg_size: StorageUsedShort + readonly kind: 'TrActionPhase'; + readonly success: Bool; + readonly valid: Bool; + readonly no_funds: Bool; + readonly status_change: AccStatusChange; + readonly total_fwd_fees: Maybe; + readonly total_action_fees: Maybe; + readonly result_code: number; + readonly result_arg: Maybe; + readonly tot_actions: number; + readonly spec_actions: number; + readonly skipped_actions: number; + readonly msgs_created: number; + readonly action_list_hash: BitString; + readonly tot_msg_size: StorageUsedShort; } export type TrBouncePhase = TrBouncePhase_tr_phase_bounce_negfunds | TrBouncePhase_tr_phase_bounce_nofunds | TrBouncePhase_tr_phase_bounce_ok; export interface TrBouncePhase_tr_phase_bounce_negfunds { -readonly kind: 'TrBouncePhase_tr_phase_bounce_negfunds' + readonly kind: 'TrBouncePhase_tr_phase_bounce_negfunds'; } export interface TrBouncePhase_tr_phase_bounce_nofunds { -readonly kind: 'TrBouncePhase_tr_phase_bounce_nofunds' -readonly msg_size: StorageUsedShort -readonly req_fwd_fees: Grams + readonly kind: 'TrBouncePhase_tr_phase_bounce_nofunds'; + readonly msg_size: StorageUsedShort; + readonly req_fwd_fees: Grams; } export interface TrBouncePhase_tr_phase_bounce_ok { -readonly kind: 'TrBouncePhase_tr_phase_bounce_ok' -readonly msg_size: StorageUsedShort -readonly msg_fees: Grams -readonly fwd_fees: Grams + readonly kind: 'TrBouncePhase_tr_phase_bounce_ok'; + readonly msg_size: StorageUsedShort; + readonly msg_fees: Grams; + readonly fwd_fees: Grams; } export type TransactionDescr = TransactionDescr_trans_ord | TransactionDescr_trans_storage | TransactionDescr_trans_tick_tock | TransactionDescr_trans_split_prepare | TransactionDescr_trans_split_install | TransactionDescr_trans_merge_prepare | TransactionDescr_trans_merge_install; export interface TransactionDescr_trans_ord { -readonly kind: 'TransactionDescr_trans_ord' -readonly credit_first: Bool -readonly storage_ph: Maybe -readonly credit_ph: Maybe -readonly compute_ph: TrComputePhase -readonly action: Maybe -readonly aborted: Bool -readonly bounce: Maybe -readonly destroyed: Bool + readonly kind: 'TransactionDescr_trans_ord'; + readonly credit_first: Bool; + readonly storage_ph: Maybe; + readonly credit_ph: Maybe; + readonly compute_ph: TrComputePhase; + readonly action: Maybe; + readonly aborted: Bool; + readonly bounce: Maybe; + readonly destroyed: Bool; } export interface TransactionDescr_trans_storage { -readonly kind: 'TransactionDescr_trans_storage' -readonly storage_ph: TrStoragePhase + readonly kind: 'TransactionDescr_trans_storage'; + readonly storage_ph: TrStoragePhase; } export interface TransactionDescr_trans_tick_tock { -readonly kind: 'TransactionDescr_trans_tick_tock' -readonly is_tock: Bool -readonly storage_ph: TrStoragePhase -readonly compute_ph: TrComputePhase -readonly action: Maybe -readonly aborted: Bool -readonly destroyed: Bool + readonly kind: 'TransactionDescr_trans_tick_tock'; + readonly is_tock: Bool; + readonly storage_ph: TrStoragePhase; + readonly compute_ph: TrComputePhase; + readonly action: Maybe; + readonly aborted: Bool; + readonly destroyed: Bool; } export interface TransactionDescr_trans_split_prepare { -readonly kind: 'TransactionDescr_trans_split_prepare' -readonly split_info: SplitMergeInfo -readonly storage_ph: Maybe -readonly compute_ph: TrComputePhase -readonly action: Maybe -readonly aborted: Bool -readonly destroyed: Bool + readonly kind: 'TransactionDescr_trans_split_prepare'; + readonly split_info: SplitMergeInfo; + readonly storage_ph: Maybe; + readonly compute_ph: TrComputePhase; + readonly action: Maybe; + readonly aborted: Bool; + readonly destroyed: Bool; } export interface TransactionDescr_trans_split_install { -readonly kind: 'TransactionDescr_trans_split_install' -readonly split_info: SplitMergeInfo -readonly prepare_transaction: Transaction -readonly installed: Bool + readonly kind: 'TransactionDescr_trans_split_install'; + readonly split_info: SplitMergeInfo; + readonly prepare_transaction: Transaction; + readonly installed: Bool; } export interface TransactionDescr_trans_merge_prepare { -readonly kind: 'TransactionDescr_trans_merge_prepare' -readonly split_info: SplitMergeInfo -readonly storage_ph: TrStoragePhase -readonly aborted: Bool + readonly kind: 'TransactionDescr_trans_merge_prepare'; + readonly split_info: SplitMergeInfo; + readonly storage_ph: TrStoragePhase; + readonly aborted: Bool; } export interface TransactionDescr_trans_merge_install { -readonly kind: 'TransactionDescr_trans_merge_install' -readonly split_info: SplitMergeInfo -readonly prepare_transaction: Transaction -readonly storage_ph: Maybe -readonly credit_ph: Maybe -readonly compute_ph: TrComputePhase -readonly action: Maybe -readonly aborted: Bool -readonly destroyed: Bool + readonly kind: 'TransactionDescr_trans_merge_install'; + readonly split_info: SplitMergeInfo; + readonly prepare_transaction: Transaction; + readonly storage_ph: Maybe; + readonly credit_ph: Maybe; + readonly compute_ph: TrComputePhase; + readonly action: Maybe; + readonly aborted: Bool; + readonly destroyed: Bool; } export interface SplitMergeInfo { -readonly kind: 'SplitMergeInfo' -readonly cur_shard_pfx_len: number -readonly acc_split_depth: number -readonly this_addr: BitString -readonly sibling_addr: BitString + readonly kind: 'SplitMergeInfo'; + readonly cur_shard_pfx_len: number; + readonly acc_split_depth: number; + readonly this_addr: BitString; + readonly sibling_addr: BitString; } export interface SmartContractInfo { -readonly kind: 'SmartContractInfo' -readonly actions: number -readonly msgs_sent: number -readonly unixtime: number -readonly block_lt: number -readonly trans_lt: number -readonly rand_seed: BitString -readonly balance_remaining: CurrencyCollection -readonly myself: MsgAddressInt + readonly kind: 'SmartContractInfo'; + readonly actions: number; + readonly msgs_sent: number; + readonly unixtime: number; + readonly block_lt: number; + readonly trans_lt: number; + readonly rand_seed: BitString; + readonly balance_remaining: CurrencyCollection; + readonly myself: MsgAddressInt; } export type OutList = OutList_out_list_empty | OutList_out_list; export interface OutList_out_list_empty { -readonly kind: 'OutList_out_list_empty' + readonly kind: 'OutList_out_list_empty'; } export interface OutList_out_list { -readonly kind: 'OutList_out_list' -readonly n: number -readonly prev: OutList -readonly action: OutAction + readonly kind: 'OutList_out_list'; + readonly n: number; + readonly prev: OutList; + readonly action: OutAction; } export type OutAction = OutAction_action_send_msg | OutAction_action_set_code | OutAction_action_reserve_currency | OutAction_action_change_library; export interface OutAction_action_send_msg { -readonly kind: 'OutAction_action_send_msg' -readonly mode: number -readonly out_msg: MessageRelaxed + readonly kind: 'OutAction_action_send_msg'; + readonly mode: number; + readonly out_msg: MessageRelaxed; } export interface OutAction_action_set_code { -readonly kind: 'OutAction_action_set_code' -readonly new_code: Slice + readonly kind: 'OutAction_action_set_code'; + readonly new_code: Slice; } export interface OutAction_action_reserve_currency { -readonly kind: 'OutAction_action_reserve_currency' -readonly mode: number -readonly currency: CurrencyCollection + readonly kind: 'OutAction_action_reserve_currency'; + readonly mode: number; + readonly currency: CurrencyCollection; } export interface OutAction_action_change_library { -readonly kind: 'OutAction_action_change_library' -readonly mode: number -readonly libref: LibRef + readonly kind: 'OutAction_action_change_library'; + readonly mode: number; + readonly libref: LibRef; } export type LibRef = LibRef_libref_hash | LibRef_libref_ref; export interface LibRef_libref_hash { -readonly kind: 'LibRef_libref_hash' -readonly lib_hash: BitString + readonly kind: 'LibRef_libref_hash'; + readonly lib_hash: BitString; } export interface LibRef_libref_ref { -readonly kind: 'LibRef_libref_ref' -readonly library: Slice + readonly kind: 'LibRef_libref_ref'; + readonly library: Slice; } export interface OutListNode { -readonly kind: 'OutListNode' -readonly prev: Slice -readonly action: OutAction + readonly kind: 'OutListNode'; + readonly prev: Slice; + readonly action: OutAction; } export interface ShardIdent { -readonly kind: 'ShardIdent' -readonly shard_pfx_bits: number -readonly workchain_id: number -readonly shard_prefix: number + readonly kind: 'ShardIdent'; + readonly shard_pfx_bits: number; + readonly workchain_id: number; + readonly shard_prefix: number; } export interface ExtBlkRef { -readonly kind: 'ExtBlkRef' -readonly end_lt: number -readonly seq_no: number -readonly root_hash: BitString -readonly file_hash: BitString + readonly kind: 'ExtBlkRef'; + readonly end_lt: number; + readonly seq_no: number; + readonly root_hash: BitString; + readonly file_hash: BitString; } export interface BlockIdExt { -readonly kind: 'BlockIdExt' -readonly shard_id: ShardIdent -readonly seq_no: number -readonly root_hash: BitString -readonly file_hash: BitString + readonly kind: 'BlockIdExt'; + readonly shard_id: ShardIdent; + readonly seq_no: number; + readonly root_hash: BitString; + readonly file_hash: BitString; } export interface BlkMasterInfo { -readonly kind: 'BlkMasterInfo' -readonly master: ExtBlkRef + readonly kind: 'BlkMasterInfo'; + readonly master: ExtBlkRef; } export interface ShardStateUnsplit { -readonly kind: 'ShardStateUnsplit' -readonly global_id: number -readonly shard_id: ShardIdent -readonly seq_no: number -readonly vert_seq_no: number -readonly gen_utime: number -readonly gen_lt: number -readonly min_ref_mc_seqno: number -readonly out_msg_queue_info: OutMsgQueueInfo -readonly before_split: number -readonly accounts: ShardAccounts -readonly overload_history: number -readonly underload_history: number -readonly total_balance: CurrencyCollection -readonly total_validator_fees: CurrencyCollection -readonly libraries: HashmapE -readonly master_ref: Maybe -readonly custom: Maybe + readonly kind: 'ShardStateUnsplit'; + readonly global_id: number; + readonly shard_id: ShardIdent; + readonly seq_no: number; + readonly vert_seq_no: number; + readonly gen_utime: number; + readonly gen_lt: number; + readonly min_ref_mc_seqno: number; + readonly out_msg_queue_info: OutMsgQueueInfo; + readonly before_split: number; + readonly accounts: ShardAccounts; + readonly overload_history: number; + readonly underload_history: number; + readonly total_balance: CurrencyCollection; + readonly total_validator_fees: CurrencyCollection; + readonly libraries: HashmapE; + readonly master_ref: Maybe; + readonly custom: Maybe; } export type ShardState = ShardState__ | ShardState_split_state; export interface ShardState__ { -readonly kind: 'ShardState__' -readonly anon0: ShardStateUnsplit + readonly kind: 'ShardState__'; + readonly anon0: ShardStateUnsplit; } export interface ShardState_split_state { -readonly kind: 'ShardState_split_state' -readonly left: ShardStateUnsplit -readonly right: ShardStateUnsplit + readonly kind: 'ShardState_split_state'; + readonly left: ShardStateUnsplit; + readonly right: ShardStateUnsplit; } export interface LibDescr { -readonly kind: 'LibDescr' -readonly lib: Slice -readonly publishers: Hashmap + readonly kind: 'LibDescr'; + readonly lib: Slice; + readonly publishers: Hashmap; } export interface BlockInfo { -readonly kind: 'BlockInfo' -readonly version: number -readonly not_master: number -readonly after_merge: number -readonly before_split: number -readonly after_split: number -readonly want_split: Bool -readonly want_merge: Bool -readonly key_block: Bool -readonly vert_seqno_incr: number -readonly flags: number -readonly seq_no: number -readonly vert_seq_no: number -readonly prev_seq_no: number -readonly shard: ShardIdent -readonly gen_utime: number -readonly start_lt: number -readonly end_lt: number -readonly gen_validator_list_hash_short: number -readonly gen_catchain_seqno: number -readonly min_ref_mc_seqno: number -readonly prev_key_block_seqno: number -readonly gen_software: GlobalVersion | undefined -readonly master_ref: BlkMasterInfo | undefined -readonly prev_ref: BlkPrevInfo -readonly prev_vert_ref: BlkPrevInfo | undefined + readonly kind: 'BlockInfo'; + readonly version: number; + readonly not_master: number; + readonly after_merge: number; + readonly before_split: number; + readonly after_split: number; + readonly want_split: Bool; + readonly want_merge: Bool; + readonly key_block: Bool; + readonly vert_seqno_incr: number; + readonly flags: number; + readonly seq_no: number; + readonly vert_seq_no: number; + readonly prev_seq_no: number; + readonly shard: ShardIdent; + readonly gen_utime: number; + readonly start_lt: number; + readonly end_lt: number; + readonly gen_validator_list_hash_short: number; + readonly gen_catchain_seqno: number; + readonly min_ref_mc_seqno: number; + readonly prev_key_block_seqno: number; + readonly gen_software: GlobalVersion | undefined; + readonly master_ref: BlkMasterInfo | undefined; + readonly prev_ref: BlkPrevInfo; + readonly prev_vert_ref: BlkPrevInfo | undefined; } export type BlkPrevInfo = BlkPrevInfo_prev_blk_info | BlkPrevInfo_prev_blks_info; export interface BlkPrevInfo_prev_blk_info { -readonly kind: 'BlkPrevInfo_prev_blk_info' -readonly prev: ExtBlkRef + readonly kind: 'BlkPrevInfo_prev_blk_info'; + readonly prev: ExtBlkRef; } export interface BlkPrevInfo_prev_blks_info { -readonly kind: 'BlkPrevInfo_prev_blks_info' -readonly prev1: ExtBlkRef -readonly prev2: ExtBlkRef + readonly kind: 'BlkPrevInfo_prev_blks_info'; + readonly prev1: ExtBlkRef; + readonly prev2: ExtBlkRef; } export interface Block { -readonly kind: 'Block' -readonly global_id: number -readonly info: BlockInfo -readonly value_flow: ValueFlow -readonly state_update: MERKLE_UPDATE -readonly extra: BlockExtra + readonly kind: 'Block'; + readonly global_id: number; + readonly info: BlockInfo; + readonly value_flow: ValueFlow; + readonly state_update: MERKLE_UPDATE; + readonly extra: BlockExtra; } export interface BlockExtra { -readonly kind: 'BlockExtra' -readonly in_msg_descr: InMsgDescr -readonly out_msg_descr: OutMsgDescr -readonly account_blocks: ShardAccountBlocks -readonly rand_seed: BitString -readonly created_by: BitString -readonly custom: Maybe + readonly kind: 'BlockExtra'; + readonly in_msg_descr: InMsgDescr; + readonly out_msg_descr: OutMsgDescr; + readonly account_blocks: ShardAccountBlocks; + readonly rand_seed: BitString; + readonly created_by: BitString; + readonly custom: Maybe; } export interface ValueFlow { -readonly kind: 'ValueFlow' -readonly from_prev_blk: CurrencyCollection -readonly to_next_blk: CurrencyCollection -readonly imported: CurrencyCollection -readonly exported: CurrencyCollection -readonly fees_collected: CurrencyCollection -readonly fees_imported: CurrencyCollection -readonly recovered: CurrencyCollection -readonly created: CurrencyCollection -readonly minted: CurrencyCollection + readonly kind: 'ValueFlow'; + readonly from_prev_blk: CurrencyCollection; + readonly to_next_blk: CurrencyCollection; + readonly imported: CurrencyCollection; + readonly exported: CurrencyCollection; + readonly fees_collected: CurrencyCollection; + readonly fees_imported: CurrencyCollection; + readonly recovered: CurrencyCollection; + readonly created: CurrencyCollection; + readonly minted: CurrencyCollection; } export type BinTree = BinTree_bt_leaf | BinTree_bt_fork; export interface BinTree_bt_leaf { -readonly kind: 'BinTree_bt_leaf' -readonly leaf: X + readonly kind: 'BinTree_bt_leaf'; + readonly leaf: X; } export interface BinTree_bt_fork { -readonly kind: 'BinTree_bt_fork' -readonly left: BinTree -readonly right: BinTree + readonly kind: 'BinTree_bt_fork'; + readonly left: BinTree; + readonly right: BinTree; } export type FutureSplitMerge = FutureSplitMerge_fsm_none | FutureSplitMerge_fsm_split | FutureSplitMerge_fsm_merge; export interface FutureSplitMerge_fsm_none { -readonly kind: 'FutureSplitMerge_fsm_none' + readonly kind: 'FutureSplitMerge_fsm_none'; } export interface FutureSplitMerge_fsm_split { -readonly kind: 'FutureSplitMerge_fsm_split' -readonly split_utime: number -readonly interval: number + readonly kind: 'FutureSplitMerge_fsm_split'; + readonly split_utime: number; + readonly interval: number; } export interface FutureSplitMerge_fsm_merge { -readonly kind: 'FutureSplitMerge_fsm_merge' -readonly merge_utime: number -readonly interval: number + readonly kind: 'FutureSplitMerge_fsm_merge'; + readonly merge_utime: number; + readonly interval: number; } export type ShardDescr = ShardDescr_shard_descr | ShardDescr_shard_descr_new; export interface ShardDescr_shard_descr { -readonly kind: 'ShardDescr_shard_descr' -readonly seq_no: number -readonly reg_mc_seqno: number -readonly start_lt: number -readonly end_lt: number -readonly root_hash: BitString -readonly file_hash: BitString -readonly before_split: Bool -readonly before_merge: Bool -readonly want_split: Bool -readonly want_merge: Bool -readonly nx_cc_updated: Bool -readonly flags: number -readonly next_catchain_seqno: number -readonly next_validator_shard: number -readonly min_ref_mc_seqno: number -readonly gen_utime: number -readonly split_merge_at: FutureSplitMerge -readonly fees_collected: CurrencyCollection -readonly funds_created: CurrencyCollection + readonly kind: 'ShardDescr_shard_descr'; + readonly seq_no: number; + readonly reg_mc_seqno: number; + readonly start_lt: number; + readonly end_lt: number; + readonly root_hash: BitString; + readonly file_hash: BitString; + readonly before_split: Bool; + readonly before_merge: Bool; + readonly want_split: Bool; + readonly want_merge: Bool; + readonly nx_cc_updated: Bool; + readonly flags: number; + readonly next_catchain_seqno: number; + readonly next_validator_shard: number; + readonly min_ref_mc_seqno: number; + readonly gen_utime: number; + readonly split_merge_at: FutureSplitMerge; + readonly fees_collected: CurrencyCollection; + readonly funds_created: CurrencyCollection; } export interface ShardDescr_shard_descr_new { -readonly kind: 'ShardDescr_shard_descr_new' -readonly seq_no: number -readonly reg_mc_seqno: number -readonly start_lt: number -readonly end_lt: number -readonly root_hash: BitString -readonly file_hash: BitString -readonly before_split: Bool -readonly before_merge: Bool -readonly want_split: Bool -readonly want_merge: Bool -readonly nx_cc_updated: Bool -readonly flags: number -readonly next_catchain_seqno: number -readonly next_validator_shard: number -readonly min_ref_mc_seqno: number -readonly gen_utime: number -readonly split_merge_at: FutureSplitMerge -readonly fees_collected: CurrencyCollection -readonly funds_created: CurrencyCollection + readonly kind: 'ShardDescr_shard_descr_new'; + readonly seq_no: number; + readonly reg_mc_seqno: number; + readonly start_lt: number; + readonly end_lt: number; + readonly root_hash: BitString; + readonly file_hash: BitString; + readonly before_split: Bool; + readonly before_merge: Bool; + readonly want_split: Bool; + readonly want_merge: Bool; + readonly nx_cc_updated: Bool; + readonly flags: number; + readonly next_catchain_seqno: number; + readonly next_validator_shard: number; + readonly min_ref_mc_seqno: number; + readonly gen_utime: number; + readonly split_merge_at: FutureSplitMerge; + readonly fees_collected: CurrencyCollection; + readonly funds_created: CurrencyCollection; } export interface ShardHashes { -readonly kind: 'ShardHashes' -readonly anon0: HashmapE> + readonly kind: 'ShardHashes'; + readonly anon0: HashmapE>; } export type BinTreeAug = BinTreeAug_bta_leaf | BinTreeAug_bta_fork; export interface BinTreeAug_bta_leaf { -readonly kind: 'BinTreeAug_bta_leaf' -readonly extra: Y -readonly leaf: X + readonly kind: 'BinTreeAug_bta_leaf'; + readonly extra: Y; + readonly leaf: X; } export interface BinTreeAug_bta_fork { -readonly kind: 'BinTreeAug_bta_fork' -readonly left: BinTreeAug -readonly right: BinTreeAug -readonly extra: Y + readonly kind: 'BinTreeAug_bta_fork'; + readonly left: BinTreeAug; + readonly right: BinTreeAug; + readonly extra: Y; } export interface ShardFeeCreated { -readonly kind: 'ShardFeeCreated' -readonly fees: CurrencyCollection -readonly create: CurrencyCollection + readonly kind: 'ShardFeeCreated'; + readonly fees: CurrencyCollection; + readonly create: CurrencyCollection; } export interface ShardFees { -readonly kind: 'ShardFees' -readonly anon0: HashmapAugE + readonly kind: 'ShardFees'; + readonly anon0: HashmapAugE; } export interface ConfigParams { -readonly kind: 'ConfigParams' -readonly config_addr: BitString -readonly config: Hashmap + readonly kind: 'ConfigParams'; + readonly config_addr: BitString; + readonly config: Hashmap; } export interface ValidatorInfo { -readonly kind: 'ValidatorInfo' -readonly validator_list_hash_short: number -readonly catchain_seqno: number -readonly nx_cc_updated: Bool + readonly kind: 'ValidatorInfo'; + readonly validator_list_hash_short: number; + readonly catchain_seqno: number; + readonly nx_cc_updated: Bool; } export interface ValidatorBaseInfo { -readonly kind: 'ValidatorBaseInfo' -readonly validator_list_hash_short: number -readonly catchain_seqno: number + readonly kind: 'ValidatorBaseInfo'; + readonly validator_list_hash_short: number; + readonly catchain_seqno: number; } export interface KeyMaxLt { -readonly kind: 'KeyMaxLt' -readonly key: Bool -readonly max_end_lt: number + readonly kind: 'KeyMaxLt'; + readonly key: Bool; + readonly max_end_lt: number; } export interface KeyExtBlkRef { -readonly kind: 'KeyExtBlkRef' -readonly key: Bool -readonly blk_ref: ExtBlkRef + readonly kind: 'KeyExtBlkRef'; + readonly key: Bool; + readonly blk_ref: ExtBlkRef; } export interface OldMcBlocksInfo { -readonly kind: 'OldMcBlocksInfo' -readonly anon0: HashmapAugE + readonly kind: 'OldMcBlocksInfo'; + readonly anon0: HashmapAugE; } export interface Counters { -readonly kind: 'Counters' -readonly last_updated: number -readonly total: number -readonly cnt2048: number -readonly cnt65536: number + readonly kind: 'Counters'; + readonly last_updated: number; + readonly total: number; + readonly cnt2048: number; + readonly cnt65536: number; } export interface CreatorStats { -readonly kind: 'CreatorStats' -readonly mc_blocks: Counters -readonly shard_blocks: Counters + readonly kind: 'CreatorStats'; + readonly mc_blocks: Counters; + readonly shard_blocks: Counters; } export type BlockCreateStats = BlockCreateStats_block_create_stats | BlockCreateStats_block_create_stats_ext; export interface BlockCreateStats_block_create_stats { -readonly kind: 'BlockCreateStats_block_create_stats' -readonly counters: HashmapE + readonly kind: 'BlockCreateStats_block_create_stats'; + readonly counters: HashmapE; } export interface BlockCreateStats_block_create_stats_ext { -readonly kind: 'BlockCreateStats_block_create_stats_ext' -readonly counters: HashmapAugE + readonly kind: 'BlockCreateStats_block_create_stats_ext'; + readonly counters: HashmapAugE; } export interface McStateExtra { -readonly kind: 'McStateExtra' -readonly shard_hashes: ShardHashes -readonly config: ConfigParams -readonly flags: number -readonly validator_info: ValidatorInfo -readonly prev_blocks: OldMcBlocksInfo -readonly after_key_block: Bool -readonly last_key_block: Maybe -readonly block_create_stats: BlockCreateStats | undefined -readonly global_balance: CurrencyCollection + readonly kind: 'McStateExtra'; + readonly shard_hashes: ShardHashes; + readonly config: ConfigParams; + readonly flags: number; + readonly validator_info: ValidatorInfo; + readonly prev_blocks: OldMcBlocksInfo; + readonly after_key_block: Bool; + readonly last_key_block: Maybe; + readonly block_create_stats: BlockCreateStats | undefined; + readonly global_balance: CurrencyCollection; } export interface SigPubKey { -readonly kind: 'SigPubKey' -readonly pubkey: BitString + readonly kind: 'SigPubKey'; + readonly pubkey: BitString; } export interface CryptoSignatureSimple { -readonly kind: 'CryptoSignatureSimple' -readonly R: BitString -readonly s: BitString + readonly kind: 'CryptoSignatureSimple'; + readonly R: BitString; + readonly s: BitString; } export type CryptoSignature = CryptoSignature__ | CryptoSignature_chained_signature; export interface CryptoSignature__ { -readonly kind: 'CryptoSignature__' -readonly anon0: CryptoSignatureSimple + readonly kind: 'CryptoSignature__'; + readonly anon0: CryptoSignatureSimple; } export interface CryptoSignature_chained_signature { -readonly kind: 'CryptoSignature_chained_signature' -readonly signed_cert: SignedCertificate -readonly temp_key_signature: CryptoSignatureSimple + readonly kind: 'CryptoSignature_chained_signature'; + readonly signed_cert: SignedCertificate; + readonly temp_key_signature: CryptoSignatureSimple; } export interface CryptoSignaturePair { -readonly kind: 'CryptoSignaturePair' -readonly node_id_short: BitString -readonly sign: CryptoSignature + readonly kind: 'CryptoSignaturePair'; + readonly node_id_short: BitString; + readonly sign: CryptoSignature; } export interface Certificate { -readonly kind: 'Certificate' -readonly temp_key: SigPubKey -readonly valid_since: number -readonly valid_until: number + readonly kind: 'Certificate'; + readonly temp_key: SigPubKey; + readonly valid_since: number; + readonly valid_until: number; } export interface CertificateEnv { -readonly kind: 'CertificateEnv' -readonly certificate: Certificate + readonly kind: 'CertificateEnv'; + readonly certificate: Certificate; } export interface SignedCertificate { -readonly kind: 'SignedCertificate' -readonly certificate: Certificate -readonly certificate_signature: CryptoSignature + readonly kind: 'SignedCertificate'; + readonly certificate: Certificate; + readonly certificate_signature: CryptoSignature; } export interface McBlockExtra { -readonly kind: 'McBlockExtra' -readonly key_block: number -readonly shard_hashes: ShardHashes -readonly shard_fees: ShardFees -readonly prev_blk_signatures: HashmapE -readonly recover_create_msg: Maybe -readonly mint_msg: Maybe -readonly config: ConfigParams | undefined + readonly kind: 'McBlockExtra'; + readonly key_block: number; + readonly shard_hashes: ShardHashes; + readonly shard_fees: ShardFees; + readonly prev_blk_signatures: HashmapE; + readonly recover_create_msg: Maybe; + readonly mint_msg: Maybe; + readonly config: ConfigParams | undefined; } export type ValidatorDescr = ValidatorDescr_validator | ValidatorDescr_validator_addr; export interface ValidatorDescr_validator { -readonly kind: 'ValidatorDescr_validator' -readonly public_key: SigPubKey -readonly weight: number + readonly kind: 'ValidatorDescr_validator'; + readonly public_key: SigPubKey; + readonly weight: number; } export interface ValidatorDescr_validator_addr { -readonly kind: 'ValidatorDescr_validator_addr' -readonly public_key: SigPubKey -readonly weight: number -readonly adnl_addr: BitString + readonly kind: 'ValidatorDescr_validator_addr'; + readonly public_key: SigPubKey; + readonly weight: number; + readonly adnl_addr: BitString; } export type ValidatorSet = ValidatorSet_validators | ValidatorSet_validators_ext; export interface ValidatorSet_validators { -readonly kind: 'ValidatorSet_validators' -readonly utime_since: number -readonly utime_until: number -readonly total: number -readonly main: number -readonly list: Hashmap + readonly kind: 'ValidatorSet_validators'; + readonly utime_since: number; + readonly utime_until: number; + readonly total: number; + readonly main: number; + readonly list: Hashmap; } export interface ValidatorSet_validators_ext { -readonly kind: 'ValidatorSet_validators_ext' -readonly utime_since: number -readonly utime_until: number -readonly total: number -readonly main: number -readonly total_weight: number -readonly list: HashmapE + readonly kind: 'ValidatorSet_validators_ext'; + readonly utime_since: number; + readonly utime_until: number; + readonly total: number; + readonly main: number; + readonly total_weight: number; + readonly list: HashmapE; } export type ConfigParam = ConfigParam__ | ConfigParam__1 | ConfigParam__2 | ConfigParam__3 | ConfigParam__4 | ConfigParam__5 | ConfigParam__6 | ConfigParam__7 | ConfigParam__8 | ConfigParam__9 | ConfigParam__10 | ConfigParam__11 | ConfigParam__12 | ConfigParam__13 | ConfigParam__14 | ConfigParam__15 | ConfigParam__16 | ConfigParam__17 | ConfigParam__24 | ConfigParam__25 | ConfigParam__26 | ConfigParam__27 | ConfigParam__28 | ConfigParam__29 | ConfigParam__30 | ConfigParam__31 | ConfigParam__32 | ConfigParam__33 | ConfigParam__34 | ConfigParam__35 | ConfigParam__36 | ConfigParam__37 | ConfigParam_config_mc_gas_prices | ConfigParam_config_gas_prices | ConfigParam_config_mc_block_limits | ConfigParam_config_block_limits | ConfigParam_config_mc_fwd_prices | ConfigParam_config_fwd_prices; export interface ConfigParam__ { -readonly kind: 'ConfigParam__' -readonly config_addr: BitString + readonly kind: 'ConfigParam__'; + readonly config_addr: BitString; } export interface ConfigParam__1 { -readonly kind: 'ConfigParam__1' -readonly elector_addr: BitString + readonly kind: 'ConfigParam__1'; + readonly elector_addr: BitString; } export interface ConfigParam__2 { -readonly kind: 'ConfigParam__2' -readonly minter_addr: BitString + readonly kind: 'ConfigParam__2'; + readonly minter_addr: BitString; } export interface ConfigParam__3 { -readonly kind: 'ConfigParam__3' -readonly fee_collector_addr: BitString + readonly kind: 'ConfigParam__3'; + readonly fee_collector_addr: BitString; } export interface ConfigParam__4 { -readonly kind: 'ConfigParam__4' -readonly dns_root_addr: BitString + readonly kind: 'ConfigParam__4'; + readonly dns_root_addr: BitString; } export interface ConfigParam__5 { -readonly kind: 'ConfigParam__5' -readonly mint_new_price: Grams -readonly mint_add_price: Grams + readonly kind: 'ConfigParam__5'; + readonly mint_new_price: Grams; + readonly mint_add_price: Grams; } export interface ConfigParam__6 { -readonly kind: 'ConfigParam__6' -readonly to_mint: ExtraCurrencyCollection + readonly kind: 'ConfigParam__6'; + readonly to_mint: ExtraCurrencyCollection; } export interface ConfigParam__7 { -readonly kind: 'ConfigParam__7' -readonly anon0: GlobalVersion + readonly kind: 'ConfigParam__7'; + readonly anon0: GlobalVersion; } export interface ConfigParam__8 { -readonly kind: 'ConfigParam__8' -readonly mandatory_params: Hashmap + readonly kind: 'ConfigParam__8'; + readonly mandatory_params: Hashmap; } export interface ConfigParam__9 { -readonly kind: 'ConfigParam__9' -readonly critical_params: Hashmap + readonly kind: 'ConfigParam__9'; + readonly critical_params: Hashmap; } export interface ConfigParam__10 { -readonly kind: 'ConfigParam__10' -readonly anon0: ConfigVotingSetup + readonly kind: 'ConfigParam__10'; + readonly anon0: ConfigVotingSetup; } export interface ConfigParam__11 { -readonly kind: 'ConfigParam__11' -readonly workchains: HashmapE + readonly kind: 'ConfigParam__11'; + readonly workchains: HashmapE; } export interface ConfigParam__12 { -readonly kind: 'ConfigParam__12' -readonly anon0: ComplaintPricing + readonly kind: 'ConfigParam__12'; + readonly anon0: ComplaintPricing; } export interface ConfigParam__13 { -readonly kind: 'ConfigParam__13' -readonly anon0: BlockCreateFees + readonly kind: 'ConfigParam__13'; + readonly anon0: BlockCreateFees; } export interface ConfigParam__14 { -readonly kind: 'ConfigParam__14' -readonly validators_elected_for: number -readonly elections_start_before: number -readonly elections_end_before: number -readonly stake_held_for: number + readonly kind: 'ConfigParam__14'; + readonly validators_elected_for: number; + readonly elections_start_before: number; + readonly elections_end_before: number; + readonly stake_held_for: number; } export interface ConfigParam__15 { -readonly kind: 'ConfigParam__15' -readonly max_validators: number -readonly max_main_validators: number -readonly min_validators: number + readonly kind: 'ConfigParam__15'; + readonly max_validators: number; + readonly max_main_validators: number; + readonly min_validators: number; } export interface ConfigParam__16 { -readonly kind: 'ConfigParam__16' -readonly min_stake: Grams -readonly max_stake: Grams -readonly min_total_stake: Grams -readonly max_stake_factor: number + readonly kind: 'ConfigParam__16'; + readonly min_stake: Grams; + readonly max_stake: Grams; + readonly min_total_stake: Grams; + readonly max_stake_factor: number; } export interface ConfigParam__17 { -readonly kind: 'ConfigParam__17' -readonly anon0: Hashmap + readonly kind: 'ConfigParam__17'; + readonly anon0: Hashmap; } export interface ConfigParam__24 { -readonly kind: 'ConfigParam__24' -readonly anon0: CatchainConfig + readonly kind: 'ConfigParam__24'; + readonly anon0: CatchainConfig; } export interface ConfigParam__25 { -readonly kind: 'ConfigParam__25' -readonly anon0: ConsensusConfig + readonly kind: 'ConfigParam__25'; + readonly anon0: ConsensusConfig; } export interface ConfigParam__26 { -readonly kind: 'ConfigParam__26' -readonly fundamental_smc_addr: HashmapE + readonly kind: 'ConfigParam__26'; + readonly fundamental_smc_addr: HashmapE; } export interface ConfigParam__27 { -readonly kind: 'ConfigParam__27' -readonly prev_validators: ValidatorSet + readonly kind: 'ConfigParam__27'; + readonly prev_validators: ValidatorSet; } export interface ConfigParam__28 { -readonly kind: 'ConfigParam__28' -readonly prev_temp_validators: ValidatorSet + readonly kind: 'ConfigParam__28'; + readonly prev_temp_validators: ValidatorSet; } export interface ConfigParam__29 { -readonly kind: 'ConfigParam__29' -readonly cur_validators: ValidatorSet + readonly kind: 'ConfigParam__29'; + readonly cur_validators: ValidatorSet; } export interface ConfigParam__30 { -readonly kind: 'ConfigParam__30' -readonly cur_temp_validators: ValidatorSet + readonly kind: 'ConfigParam__30'; + readonly cur_temp_validators: ValidatorSet; } export interface ConfigParam__31 { -readonly kind: 'ConfigParam__31' -readonly next_validators: ValidatorSet + readonly kind: 'ConfigParam__31'; + readonly next_validators: ValidatorSet; } export interface ConfigParam__32 { -readonly kind: 'ConfigParam__32' -readonly next_temp_validators: ValidatorSet + readonly kind: 'ConfigParam__32'; + readonly next_temp_validators: ValidatorSet; } export interface ConfigParam__33 { -readonly kind: 'ConfigParam__33' -readonly anon0: HashmapE + readonly kind: 'ConfigParam__33'; + readonly anon0: HashmapE; } export interface ConfigParam__34 { -readonly kind: 'ConfigParam__34' -readonly anon0: MisbehaviourPunishmentConfig + readonly kind: 'ConfigParam__34'; + readonly anon0: MisbehaviourPunishmentConfig; } export interface ConfigParam__35 { -readonly kind: 'ConfigParam__35' -readonly anon0: OracleBridgeParams + readonly kind: 'ConfigParam__35'; + readonly anon0: OracleBridgeParams; } export interface ConfigParam__36 { -readonly kind: 'ConfigParam__36' -readonly anon0: OracleBridgeParams + readonly kind: 'ConfigParam__36'; + readonly anon0: OracleBridgeParams; } export interface ConfigParam__37 { -readonly kind: 'ConfigParam__37' -readonly anon0: OracleBridgeParams + readonly kind: 'ConfigParam__37'; + readonly anon0: OracleBridgeParams; } export interface ConfigParam_config_mc_gas_prices { -readonly kind: 'ConfigParam_config_mc_gas_prices' -readonly anon0: GasLimitsPrices + readonly kind: 'ConfigParam_config_mc_gas_prices'; + readonly anon0: GasLimitsPrices; } export interface ConfigParam_config_gas_prices { -readonly kind: 'ConfigParam_config_gas_prices' -readonly anon0: GasLimitsPrices + readonly kind: 'ConfigParam_config_gas_prices'; + readonly anon0: GasLimitsPrices; } export interface ConfigParam_config_mc_block_limits { -readonly kind: 'ConfigParam_config_mc_block_limits' -readonly anon0: BlockLimits + readonly kind: 'ConfigParam_config_mc_block_limits'; + readonly anon0: BlockLimits; } export interface ConfigParam_config_block_limits { -readonly kind: 'ConfigParam_config_block_limits' -readonly anon0: BlockLimits + readonly kind: 'ConfigParam_config_block_limits'; + readonly anon0: BlockLimits; } export interface ConfigParam_config_mc_fwd_prices { -readonly kind: 'ConfigParam_config_mc_fwd_prices' -readonly anon0: MsgForwardPrices + readonly kind: 'ConfigParam_config_mc_fwd_prices'; + readonly anon0: MsgForwardPrices; } export interface ConfigParam_config_fwd_prices { -readonly kind: 'ConfigParam_config_fwd_prices' -readonly anon0: MsgForwardPrices + readonly kind: 'ConfigParam_config_fwd_prices'; + readonly anon0: MsgForwardPrices; } export interface GlobalVersion { -readonly kind: 'GlobalVersion' -readonly version: number -readonly capabilities: number + readonly kind: 'GlobalVersion'; + readonly version: number; + readonly capabilities: number; } export interface ConfigProposalSetup { -readonly kind: 'ConfigProposalSetup' -readonly min_tot_rounds: number -readonly max_tot_rounds: number -readonly min_wins: number -readonly max_losses: number -readonly min_store_sec: number -readonly max_store_sec: number -readonly bit_price: number -readonly _cell_price: number + readonly kind: 'ConfigProposalSetup'; + readonly min_tot_rounds: number; + readonly max_tot_rounds: number; + readonly min_wins: number; + readonly max_losses: number; + readonly min_store_sec: number; + readonly max_store_sec: number; + readonly bit_price: number; + readonly _cell_price: number; } export interface ConfigVotingSetup { -readonly kind: 'ConfigVotingSetup' -readonly normal_params: ConfigProposalSetup -readonly critical_params: ConfigProposalSetup + readonly kind: 'ConfigVotingSetup'; + readonly normal_params: ConfigProposalSetup; + readonly critical_params: ConfigProposalSetup; } export interface ConfigProposal { -readonly kind: 'ConfigProposal' -readonly param_id: number -readonly param_value: Maybe -readonly if_hash_equal: Maybe + readonly kind: 'ConfigProposal'; + readonly param_id: number; + readonly param_value: Maybe; + readonly if_hash_equal: Maybe; } export interface ConfigProposalStatus { -readonly kind: 'ConfigProposalStatus' -readonly expires: number -readonly proposal: ConfigProposal -readonly is_critical: Bool -readonly voters: HashmapE -readonly remaining_weight: number -readonly validator_set_id: number -readonly rounds_remaining: number -readonly wins: number -readonly losses: number + readonly kind: 'ConfigProposalStatus'; + readonly expires: number; + readonly proposal: ConfigProposal; + readonly is_critical: Bool; + readonly voters: HashmapE; + readonly remaining_weight: number; + readonly validator_set_id: number; + readonly rounds_remaining: number; + readonly wins: number; + readonly losses: number; } export type WorkchainFormat = WorkchainFormat_wfmt_basic | WorkchainFormat_wfmt_ext; export interface WorkchainFormat_wfmt_basic { -readonly kind: 'WorkchainFormat_wfmt_basic' -readonly vm_version: number -readonly vm_mode: number + readonly kind: 'WorkchainFormat_wfmt_basic'; + readonly vm_version: number; + readonly vm_mode: number; } export interface WorkchainFormat_wfmt_ext { -readonly kind: 'WorkchainFormat_wfmt_ext' -readonly min_addr_len: number -readonly max_addr_len: number -readonly addr_len_step: number -readonly workchain_type_id: number + readonly kind: 'WorkchainFormat_wfmt_ext'; + readonly min_addr_len: number; + readonly max_addr_len: number; + readonly addr_len_step: number; + readonly workchain_type_id: number; } export interface WorkchainDescr { -readonly kind: 'WorkchainDescr' -readonly enabled_since: number -readonly actual_min_split: number -readonly min_split: number -readonly max_split: number -readonly basic: number -readonly active: Bool -readonly accept_msgs: Bool -readonly flags: number -readonly zerostate_root_hash: BitString -readonly zerostate_file_hash: BitString -readonly version: number -readonly format: WorkchainFormat + readonly kind: 'WorkchainDescr'; + readonly enabled_since: number; + readonly actual_min_split: number; + readonly min_split: number; + readonly max_split: number; + readonly basic: number; + readonly active: Bool; + readonly accept_msgs: Bool; + readonly flags: number; + readonly zerostate_root_hash: BitString; + readonly zerostate_file_hash: BitString; + readonly version: number; + readonly format: WorkchainFormat; } export interface ComplaintPricing { -readonly kind: 'ComplaintPricing' -readonly deposit: Grams -readonly bit_price: Grams -readonly _cell_price: Grams + readonly kind: 'ComplaintPricing'; + readonly deposit: Grams; + readonly bit_price: Grams; + readonly _cell_price: Grams; } export interface BlockCreateFees { -readonly kind: 'BlockCreateFees' -readonly masterchain_block_fee: Grams -readonly basechain_block_fee: Grams + readonly kind: 'BlockCreateFees'; + readonly masterchain_block_fee: Grams; + readonly basechain_block_fee: Grams; } export interface StoragePrices { -readonly kind: 'StoragePrices' -readonly utime_since: number -readonly bit_price_ps: number -readonly _cell_price_ps: number -readonly mc_bit_price_ps: number -readonly mc_cell_price_ps: number + readonly kind: 'StoragePrices'; + readonly utime_since: number; + readonly bit_price_ps: number; + readonly _cell_price_ps: number; + readonly mc_bit_price_ps: number; + readonly mc_cell_price_ps: number; } export type GasLimitsPrices = GasLimitsPrices_gas_prices | GasLimitsPrices_gas_prices_ext | GasLimitsPrices_gas_flat_pfx; export interface GasLimitsPrices_gas_prices { -readonly kind: 'GasLimitsPrices_gas_prices' -readonly gas_price: number -readonly gas_limit: number -readonly gas_credit: number -readonly block_gas_limit: number -readonly freeze_due_limit: number -readonly delete_due_limit: number + readonly kind: 'GasLimitsPrices_gas_prices'; + readonly gas_price: number; + readonly gas_limit: number; + readonly gas_credit: number; + readonly block_gas_limit: number; + readonly freeze_due_limit: number; + readonly delete_due_limit: number; } export interface GasLimitsPrices_gas_prices_ext { -readonly kind: 'GasLimitsPrices_gas_prices_ext' -readonly gas_price: number -readonly gas_limit: number -readonly special_gas_limit: number -readonly gas_credit: number -readonly block_gas_limit: number -readonly freeze_due_limit: number -readonly delete_due_limit: number + readonly kind: 'GasLimitsPrices_gas_prices_ext'; + readonly gas_price: number; + readonly gas_limit: number; + readonly special_gas_limit: number; + readonly gas_credit: number; + readonly block_gas_limit: number; + readonly freeze_due_limit: number; + readonly delete_due_limit: number; } export interface GasLimitsPrices_gas_flat_pfx { -readonly kind: 'GasLimitsPrices_gas_flat_pfx' -readonly flat_gas_limit: number -readonly flat_gas_price: number -readonly other: GasLimitsPrices + readonly kind: 'GasLimitsPrices_gas_flat_pfx'; + readonly flat_gas_limit: number; + readonly flat_gas_price: number; + readonly other: GasLimitsPrices; } export interface ParamLimits { -readonly kind: 'ParamLimits' -readonly underload: number -readonly soft_limit: number -readonly hard_limit: number + readonly kind: 'ParamLimits'; + readonly underload: number; + readonly soft_limit: number; + readonly hard_limit: number; } export interface BlockLimits { -readonly kind: 'BlockLimits' -readonly bytes: ParamLimits -readonly gas: ParamLimits -readonly lt_delta: ParamLimits + readonly kind: 'BlockLimits'; + readonly bytes: ParamLimits; + readonly gas: ParamLimits; + readonly lt_delta: ParamLimits; } export interface MsgForwardPrices { -readonly kind: 'MsgForwardPrices' -readonly lump_price: number -readonly bit_price: number -readonly _cell_price: number -readonly ihr_price_factor: number -readonly first_frac: number -readonly next_frac: number + readonly kind: 'MsgForwardPrices'; + readonly lump_price: number; + readonly bit_price: number; + readonly _cell_price: number; + readonly ihr_price_factor: number; + readonly first_frac: number; + readonly next_frac: number; } export type CatchainConfig = CatchainConfig_catchain_config | CatchainConfig_catchain_config_new; export interface CatchainConfig_catchain_config { -readonly kind: 'CatchainConfig_catchain_config' -readonly mc_catchain_lifetime: number -readonly shard_catchain_lifetime: number -readonly shard_validators_lifetime: number -readonly shard_validators_num: number + readonly kind: 'CatchainConfig_catchain_config'; + readonly mc_catchain_lifetime: number; + readonly shard_catchain_lifetime: number; + readonly shard_validators_lifetime: number; + readonly shard_validators_num: number; } export interface CatchainConfig_catchain_config_new { -readonly kind: 'CatchainConfig_catchain_config_new' -readonly flags: number -readonly shuffle_mc_validators: Bool -readonly mc_catchain_lifetime: number -readonly shard_catchain_lifetime: number -readonly shard_validators_lifetime: number -readonly shard_validators_num: number + readonly kind: 'CatchainConfig_catchain_config_new'; + readonly flags: number; + readonly shuffle_mc_validators: Bool; + readonly mc_catchain_lifetime: number; + readonly shard_catchain_lifetime: number; + readonly shard_validators_lifetime: number; + readonly shard_validators_num: number; } export type ConsensusConfig = ConsensusConfig_consensus_config | ConsensusConfig_consensus_config_new | ConsensusConfig_consensus_config_v3 | ConsensusConfig_consensus_config_v4; export interface ConsensusConfig_consensus_config { -readonly kind: 'ConsensusConfig_consensus_config' -readonly round_candidates: number -readonly next_candidate_delay_ms: number -readonly consensus_timeout_ms: number -readonly fast_attempts: number -readonly attempt_duration: number -readonly catchain_max_deps: number -readonly max_block_bytes: number -readonly max_collated_bytes: number + readonly kind: 'ConsensusConfig_consensus_config'; + readonly round_candidates: number; + readonly next_candidate_delay_ms: number; + readonly consensus_timeout_ms: number; + readonly fast_attempts: number; + readonly attempt_duration: number; + readonly catchain_max_deps: number; + readonly max_block_bytes: number; + readonly max_collated_bytes: number; } export interface ConsensusConfig_consensus_config_new { -readonly kind: 'ConsensusConfig_consensus_config_new' -readonly flags: number -readonly new_catchain_ids: Bool -readonly round_candidates: number -readonly next_candidate_delay_ms: number -readonly consensus_timeout_ms: number -readonly fast_attempts: number -readonly attempt_duration: number -readonly catchain_max_deps: number -readonly max_block_bytes: number -readonly max_collated_bytes: number + readonly kind: 'ConsensusConfig_consensus_config_new'; + readonly flags: number; + readonly new_catchain_ids: Bool; + readonly round_candidates: number; + readonly next_candidate_delay_ms: number; + readonly consensus_timeout_ms: number; + readonly fast_attempts: number; + readonly attempt_duration: number; + readonly catchain_max_deps: number; + readonly max_block_bytes: number; + readonly max_collated_bytes: number; } export interface ConsensusConfig_consensus_config_v3 { -readonly kind: 'ConsensusConfig_consensus_config_v3' -readonly flags: number -readonly new_catchain_ids: Bool -readonly round_candidates: number -readonly next_candidate_delay_ms: number -readonly consensus_timeout_ms: number -readonly fast_attempts: number -readonly attempt_duration: number -readonly catchain_max_deps: number -readonly max_block_bytes: number -readonly max_collated_bytes: number -readonly proto_version: number + readonly kind: 'ConsensusConfig_consensus_config_v3'; + readonly flags: number; + readonly new_catchain_ids: Bool; + readonly round_candidates: number; + readonly next_candidate_delay_ms: number; + readonly consensus_timeout_ms: number; + readonly fast_attempts: number; + readonly attempt_duration: number; + readonly catchain_max_deps: number; + readonly max_block_bytes: number; + readonly max_collated_bytes: number; + readonly proto_version: number; } export interface ConsensusConfig_consensus_config_v4 { -readonly kind: 'ConsensusConfig_consensus_config_v4' -readonly flags: number -readonly new_catchain_ids: Bool -readonly round_candidates: number -readonly next_candidate_delay_ms: number -readonly consensus_timeout_ms: number -readonly fast_attempts: number -readonly attempt_duration: number -readonly catchain_max_deps: number -readonly max_block_bytes: number -readonly max_collated_bytes: number -readonly proto_version: number -readonly catchain_max_blocks_coeff: number + readonly kind: 'ConsensusConfig_consensus_config_v4'; + readonly flags: number; + readonly new_catchain_ids: Bool; + readonly round_candidates: number; + readonly next_candidate_delay_ms: number; + readonly consensus_timeout_ms: number; + readonly fast_attempts: number; + readonly attempt_duration: number; + readonly catchain_max_deps: number; + readonly max_block_bytes: number; + readonly max_collated_bytes: number; + readonly proto_version: number; + readonly catchain_max_blocks_coeff: number; } export interface ValidatorTempKey { -readonly kind: 'ValidatorTempKey' -readonly adnl_addr: BitString -readonly temp_public_key: SigPubKey -readonly seqno: number -readonly valid_until: number + readonly kind: 'ValidatorTempKey'; + readonly adnl_addr: BitString; + readonly temp_public_key: SigPubKey; + readonly seqno: number; + readonly valid_until: number; } export interface ValidatorSignedTempKey { -readonly kind: 'ValidatorSignedTempKey' -readonly key: ValidatorTempKey -readonly signature: CryptoSignature + readonly kind: 'ValidatorSignedTempKey'; + readonly key: ValidatorTempKey; + readonly signature: CryptoSignature; } export interface MisbehaviourPunishmentConfig { -readonly kind: 'MisbehaviourPunishmentConfig' -readonly default_flat_fine: Grams -readonly default_proportional_fine: number -readonly severity_flat_mult: number -readonly severity_proportional_mult: number -readonly unpunishable_interval: number -readonly long_interval: number -readonly long_flat_mult: number -readonly long_proportional_mult: number -readonly medium_interval: number -readonly medium_flat_mult: number -readonly medium_proportional_mult: number + readonly kind: 'MisbehaviourPunishmentConfig'; + readonly default_flat_fine: Grams; + readonly default_proportional_fine: number; + readonly severity_flat_mult: number; + readonly severity_proportional_mult: number; + readonly unpunishable_interval: number; + readonly long_interval: number; + readonly long_flat_mult: number; + readonly long_proportional_mult: number; + readonly medium_interval: number; + readonly medium_flat_mult: number; + readonly medium_proportional_mult: number; } export interface OracleBridgeParams { -readonly kind: 'OracleBridgeParams' -readonly bridge_address: BitString -readonly oracle_mutlisig_address: BitString -readonly oracles: HashmapE -readonly external_chain_address: BitString + readonly kind: 'OracleBridgeParams'; + readonly bridge_address: BitString; + readonly oracle_mutlisig_address: BitString; + readonly oracles: HashmapE; + readonly external_chain_address: BitString; } export interface BlockSignaturesPure { -readonly kind: 'BlockSignaturesPure' -readonly sig_count: number -readonly sig_weight: number -readonly signatures: HashmapE + readonly kind: 'BlockSignaturesPure'; + readonly sig_count: number; + readonly sig_weight: number; + readonly signatures: HashmapE; } export interface BlockSignatures { -readonly kind: 'BlockSignatures' -readonly validator_info: ValidatorBaseInfo -readonly pure_signatures: BlockSignaturesPure + readonly kind: 'BlockSignatures'; + readonly validator_info: ValidatorBaseInfo; + readonly pure_signatures: BlockSignaturesPure; } export interface BlockProof { -readonly kind: 'BlockProof' -readonly proof_for: BlockIdExt -readonly root: Slice -readonly signatures: Maybe + readonly kind: 'BlockProof'; + readonly proof_for: BlockIdExt; + readonly root: Slice; + readonly signatures: Maybe; } export type ProofChain = ProofChain_chain_empty | ProofChain_chain_link; export interface ProofChain_chain_empty { -readonly kind: 'ProofChain_chain_empty' + readonly kind: 'ProofChain_chain_empty'; } export interface ProofChain_chain_link { -readonly kind: 'ProofChain_chain_link' -readonly n: number -readonly root: Slice -readonly prev: ProofChain | undefined + readonly kind: 'ProofChain_chain_link'; + readonly n: number; + readonly root: Slice; + readonly prev: ProofChain | undefined; } export interface TopBlockDescr { -readonly kind: 'TopBlockDescr' -readonly proof_for: BlockIdExt -readonly signatures: Maybe -readonly len: number -readonly chain: ProofChain + readonly kind: 'TopBlockDescr'; + readonly proof_for: BlockIdExt; + readonly signatures: Maybe; + readonly len: number; + readonly chain: ProofChain; } export interface TopBlockDescrSet { -readonly kind: 'TopBlockDescrSet' -readonly collection: HashmapE + readonly kind: 'TopBlockDescrSet'; + readonly collection: HashmapE; } export interface ProducerInfo { -readonly kind: 'ProducerInfo' -readonly utime: number -readonly mc_blk_ref: ExtBlkRef -readonly state_proof: MERKLE_PROOF -readonly prod_proof: MERKLE_PROOF + readonly kind: 'ProducerInfo'; + readonly utime: number; + readonly mc_blk_ref: ExtBlkRef; + readonly state_proof: MERKLE_PROOF; + readonly prod_proof: MERKLE_PROOF; } export type ComplaintDescr = ComplaintDescr_no_blk_gen | ComplaintDescr_no_blk_gen_diff; export interface ComplaintDescr_no_blk_gen { -readonly kind: 'ComplaintDescr_no_blk_gen' -readonly from_utime: number -readonly prod_info: ProducerInfo + readonly kind: 'ComplaintDescr_no_blk_gen'; + readonly from_utime: number; + readonly prod_info: ProducerInfo; } export interface ComplaintDescr_no_blk_gen_diff { -readonly kind: 'ComplaintDescr_no_blk_gen_diff' -readonly prod_info_old: ProducerInfo -readonly prod_info_new: ProducerInfo + readonly kind: 'ComplaintDescr_no_blk_gen_diff'; + readonly prod_info_old: ProducerInfo; + readonly prod_info_new: ProducerInfo; } export interface ValidatorComplaint { -readonly kind: 'ValidatorComplaint' -readonly validator_pubkey: BitString -readonly description: ComplaintDescr -readonly created_at: number -readonly severity: number -readonly reward_addr: number -readonly paid: Grams -readonly suggested_fine: Grams -readonly suggested_fine_part: number + readonly kind: 'ValidatorComplaint'; + readonly validator_pubkey: BitString; + readonly description: ComplaintDescr; + readonly created_at: number; + readonly severity: number; + readonly reward_addr: number; + readonly paid: Grams; + readonly suggested_fine: Grams; + readonly suggested_fine_part: number; } export interface ValidatorComplaintStatus { -readonly kind: 'ValidatorComplaintStatus' -readonly complaint: ValidatorComplaint -readonly voters: HashmapE -readonly vset_id: number -readonly weight_remaining: number + readonly kind: 'ValidatorComplaintStatus'; + readonly complaint: ValidatorComplaint; + readonly voters: HashmapE; + readonly vset_id: number; + readonly weight_remaining: number; } export type VmStackValue = VmStackValue_vm_stk_null | VmStackValue_vm_stk_tinyint | VmStackValue_vm_stk_int | VmStackValue_vm_stk_nan | VmStackValue_vm_stk_cell | VmStackValue_vm_stk_slice | VmStackValue_vm_stk_builder | VmStackValue_vm_stk_cont | VmStackValue_vm_stk_tuple; export interface VmStackValue_vm_stk_null { -readonly kind: 'VmStackValue_vm_stk_null' + readonly kind: 'VmStackValue_vm_stk_null'; } export interface VmStackValue_vm_stk_tinyint { -readonly kind: 'VmStackValue_vm_stk_tinyint' -readonly value: number + readonly kind: 'VmStackValue_vm_stk_tinyint'; + readonly value: number; } export interface VmStackValue_vm_stk_int { -readonly kind: 'VmStackValue_vm_stk_int' -readonly value: number + readonly kind: 'VmStackValue_vm_stk_int'; + readonly value: number; } export interface VmStackValue_vm_stk_nan { -readonly kind: 'VmStackValue_vm_stk_nan' + readonly kind: 'VmStackValue_vm_stk_nan'; } export interface VmStackValue_vm_stk_cell { -readonly kind: 'VmStackValue_vm_stk_cell' -readonly _cell: Slice + readonly kind: 'VmStackValue_vm_stk_cell'; + readonly _cell: Slice; } export interface VmStackValue_vm_stk_slice { -readonly kind: 'VmStackValue_vm_stk_slice' -readonly _: VmCellSlice + readonly kind: 'VmStackValue_vm_stk_slice'; + readonly _: VmCellSlice; } export interface VmStackValue_vm_stk_builder { -readonly kind: 'VmStackValue_vm_stk_builder' -readonly _cell: Slice + readonly kind: 'VmStackValue_vm_stk_builder'; + readonly _cell: Slice; } export interface VmStackValue_vm_stk_cont { -readonly kind: 'VmStackValue_vm_stk_cont' -readonly cont: VmCont + readonly kind: 'VmStackValue_vm_stk_cont'; + readonly cont: VmCont; } export interface VmStackValue_vm_stk_tuple { -readonly kind: 'VmStackValue_vm_stk_tuple' -readonly len: number -readonly data: VmTuple + readonly kind: 'VmStackValue_vm_stk_tuple'; + readonly len: number; + readonly data: VmTuple; } export interface VmCellSlice { -readonly kind: 'VmCellSlice' -readonly _cell: Slice -readonly st_bits: number -readonly end_bits: number -readonly st_ref: number -readonly end_ref: number + readonly kind: 'VmCellSlice'; + readonly _cell: Slice; + readonly st_bits: number; + readonly end_bits: number; + readonly st_ref: number; + readonly end_ref: number; } export type VmTupleRef = VmTupleRef_vm_tupref_nil | VmTupleRef_vm_tupref_single | VmTupleRef_vm_tupref_any; export interface VmTupleRef_vm_tupref_nil { -readonly kind: 'VmTupleRef_vm_tupref_nil' + readonly kind: 'VmTupleRef_vm_tupref_nil'; } export interface VmTupleRef_vm_tupref_single { -readonly kind: 'VmTupleRef_vm_tupref_single' -readonly entry: VmStackValue + readonly kind: 'VmTupleRef_vm_tupref_single'; + readonly entry: VmStackValue; } export interface VmTupleRef_vm_tupref_any { -readonly kind: 'VmTupleRef_vm_tupref_any' -readonly n: number -readonly ref: VmTuple + readonly kind: 'VmTupleRef_vm_tupref_any'; + readonly n: number; + readonly ref: VmTuple; } export type VmTuple = VmTuple_vm_tuple_nil | VmTuple_vm_tuple_tcons; export interface VmTuple_vm_tuple_nil { -readonly kind: 'VmTuple_vm_tuple_nil' + readonly kind: 'VmTuple_vm_tuple_nil'; } export interface VmTuple_vm_tuple_tcons { -readonly kind: 'VmTuple_vm_tuple_tcons' -readonly n: number -readonly head: VmTupleRef -readonly tail: VmStackValue + readonly kind: 'VmTuple_vm_tuple_tcons'; + readonly n: number; + readonly head: VmTupleRef; + readonly tail: VmStackValue; } export interface VmStack { -readonly kind: 'VmStack' -readonly depth: number -readonly stack: VmStackList + readonly kind: 'VmStack'; + readonly depth: number; + readonly stack: VmStackList; } export type VmStackList = VmStackList_vm_stk_nil | VmStackList_vm_stk_cons; export interface VmStackList_vm_stk_nil { -readonly kind: 'VmStackList_vm_stk_nil' + readonly kind: 'VmStackList_vm_stk_nil'; } export interface VmStackList_vm_stk_cons { -readonly kind: 'VmStackList_vm_stk_cons' -readonly n: number -readonly rest: VmStackList -readonly tos: VmStackValue + readonly kind: 'VmStackList_vm_stk_cons'; + readonly n: number; + readonly rest: VmStackList; + readonly tos: VmStackValue; } export interface VmSaveList { -readonly kind: 'VmSaveList' -readonly cregs: HashmapE + readonly kind: 'VmSaveList'; + readonly cregs: HashmapE; } export interface VmGasLimits { -readonly kind: 'VmGasLimits' -readonly remaining: number -readonly max_limit: number -readonly cur_limit: number -readonly credit: number + readonly kind: 'VmGasLimits'; + readonly remaining: number; + readonly max_limit: number; + readonly cur_limit: number; + readonly credit: number; } export interface VmLibraries { -readonly kind: 'VmLibraries' -readonly libraries: HashmapE + readonly kind: 'VmLibraries'; + readonly libraries: HashmapE; } export interface VmControlData { -readonly kind: 'VmControlData' -readonly nargs: Maybe -readonly stack: Maybe -readonly save: VmSaveList -readonly cp: Maybe + readonly kind: 'VmControlData'; + readonly nargs: Maybe; + readonly stack: Maybe; + readonly save: VmSaveList; + readonly cp: Maybe; } export type VmCont = VmCont_vmc_std | VmCont_vmc_envelope | VmCont_vmc_quit | VmCont_vmc_quit_exc | VmCont_vmc_repeat | VmCont_vmc_until | VmCont_vmc_again | VmCont_vmc_while_cond | VmCont_vmc_while_body | VmCont_vmc_pushint; export interface VmCont_vmc_std { -readonly kind: 'VmCont_vmc_std' -readonly cdata: VmControlData -readonly code: VmCellSlice + readonly kind: 'VmCont_vmc_std'; + readonly cdata: VmControlData; + readonly code: VmCellSlice; } export interface VmCont_vmc_envelope { -readonly kind: 'VmCont_vmc_envelope' -readonly cdata: VmControlData -readonly next: VmCont + readonly kind: 'VmCont_vmc_envelope'; + readonly cdata: VmControlData; + readonly next: VmCont; } export interface VmCont_vmc_quit { -readonly kind: 'VmCont_vmc_quit' -readonly exit_code: number + readonly kind: 'VmCont_vmc_quit'; + readonly exit_code: number; } export interface VmCont_vmc_quit_exc { -readonly kind: 'VmCont_vmc_quit_exc' + readonly kind: 'VmCont_vmc_quit_exc'; } export interface VmCont_vmc_repeat { -readonly kind: 'VmCont_vmc_repeat' -readonly count: number -readonly body: VmCont -readonly after: VmCont + readonly kind: 'VmCont_vmc_repeat'; + readonly count: number; + readonly body: VmCont; + readonly after: VmCont; } export interface VmCont_vmc_until { -readonly kind: 'VmCont_vmc_until' -readonly body: VmCont -readonly after: VmCont + readonly kind: 'VmCont_vmc_until'; + readonly body: VmCont; + readonly after: VmCont; } export interface VmCont_vmc_again { -readonly kind: 'VmCont_vmc_again' -readonly body: VmCont + readonly kind: 'VmCont_vmc_again'; + readonly body: VmCont; } export interface VmCont_vmc_while_cond { -readonly kind: 'VmCont_vmc_while_cond' -readonly cond: VmCont -readonly body: VmCont -readonly after: VmCont + readonly kind: 'VmCont_vmc_while_cond'; + readonly cond: VmCont; + readonly body: VmCont; + readonly after: VmCont; } export interface VmCont_vmc_while_body { -readonly kind: 'VmCont_vmc_while_body' -readonly cond: VmCont -readonly body: VmCont -readonly after: VmCont + readonly kind: 'VmCont_vmc_while_body'; + readonly cond: VmCont; + readonly body: VmCont; + readonly after: VmCont; } export interface VmCont_vmc_pushint { -readonly kind: 'VmCont_vmc_pushint' -readonly value: number -readonly next: VmCont + readonly kind: 'VmCont_vmc_pushint'; + readonly value: number; + readonly next: VmCont; } export interface DNS_RecordSet { -readonly kind: 'DNS_RecordSet' -readonly anon0: HashmapE + readonly kind: 'DNS_RecordSet'; + readonly anon0: HashmapE; } export type TextChunkRef = TextChunkRef_chunk_ref_empty | TextChunkRef_chunk_ref; export interface TextChunkRef_chunk_ref_empty { -readonly kind: 'TextChunkRef_chunk_ref_empty' + readonly kind: 'TextChunkRef_chunk_ref_empty'; } export interface TextChunkRef_chunk_ref { -readonly kind: 'TextChunkRef_chunk_ref' -readonly n: number -readonly ref: TextChunks + readonly kind: 'TextChunkRef_chunk_ref'; + readonly n: number; + readonly ref: TextChunks; } export type TextChunks = TextChunks_text_chunk_empty | TextChunks_text_chunk; export interface TextChunks_text_chunk_empty { -readonly kind: 'TextChunks_text_chunk_empty' + readonly kind: 'TextChunks_text_chunk_empty'; } export interface TextChunks_text_chunk { -readonly kind: 'TextChunks_text_chunk' -readonly n: number -readonly len: number -readonly data: BitString -readonly next: TextChunkRef + readonly kind: 'TextChunks_text_chunk'; + readonly n: number; + readonly len: number; + readonly data: BitString; + readonly next: TextChunkRef; } export interface Text { -readonly kind: 'Text' -readonly chunks: number -readonly rest: TextChunks + readonly kind: 'Text'; + readonly chunks: number; + readonly rest: TextChunks; } export type DNSRecord = DNSRecord_dns_text | DNSRecord_dns_next_resolver | DNSRecord_dns_adnl_address | DNSRecord_dns_smc_address; export interface DNSRecord_dns_text { -readonly kind: 'DNSRecord_dns_text' -readonly _: Text + readonly kind: 'DNSRecord_dns_text'; + readonly _: Text; } export interface DNSRecord_dns_next_resolver { -readonly kind: 'DNSRecord_dns_next_resolver' -readonly resolver: MsgAddressInt + readonly kind: 'DNSRecord_dns_next_resolver'; + readonly resolver: MsgAddressInt; } export interface DNSRecord_dns_adnl_address { -readonly kind: 'DNSRecord_dns_adnl_address' -readonly adnl_addr: BitString -readonly flags: number -readonly proto_list: ProtoList | undefined + readonly kind: 'DNSRecord_dns_adnl_address'; + readonly adnl_addr: BitString; + readonly flags: number; + readonly proto_list: ProtoList | undefined; } export interface DNSRecord_dns_smc_address { -readonly kind: 'DNSRecord_dns_smc_address' -readonly smc_addr: MsgAddressInt -readonly flags: number -readonly cap_list: SmcCapList | undefined + readonly kind: 'DNSRecord_dns_smc_address'; + readonly smc_addr: MsgAddressInt; + readonly flags: number; + readonly cap_list: SmcCapList | undefined; } export type ProtoList = ProtoList_proto_list_nil | ProtoList_proto_list_next; export interface ProtoList_proto_list_nil { -readonly kind: 'ProtoList_proto_list_nil' + readonly kind: 'ProtoList_proto_list_nil'; } export interface ProtoList_proto_list_next { -readonly kind: 'ProtoList_proto_list_next' -readonly head: Protocol -readonly tail: ProtoList + readonly kind: 'ProtoList_proto_list_next'; + readonly head: Protocol; + readonly tail: ProtoList; } export interface Protocol { -readonly kind: 'Protocol' + readonly kind: 'Protocol'; } export type SmcCapList = SmcCapList_cap_list_nil | SmcCapList_cap_list_next; export interface SmcCapList_cap_list_nil { -readonly kind: 'SmcCapList_cap_list_nil' + readonly kind: 'SmcCapList_cap_list_nil'; } export interface SmcCapList_cap_list_next { -readonly kind: 'SmcCapList_cap_list_next' -readonly head: SmcCapability -readonly tail: SmcCapList + readonly kind: 'SmcCapList_cap_list_next'; + readonly head: SmcCapability; + readonly tail: SmcCapList; } export type SmcCapability = SmcCapability_cap_method_seqno | SmcCapability_cap_method_pubkey | SmcCapability_cap_is_wallet | SmcCapability_cap_name; export interface SmcCapability_cap_method_seqno { -readonly kind: 'SmcCapability_cap_method_seqno' + readonly kind: 'SmcCapability_cap_method_seqno'; } export interface SmcCapability_cap_method_pubkey { -readonly kind: 'SmcCapability_cap_method_pubkey' + readonly kind: 'SmcCapability_cap_method_pubkey'; } export interface SmcCapability_cap_is_wallet { -readonly kind: 'SmcCapability_cap_is_wallet' + readonly kind: 'SmcCapability_cap_is_wallet'; } export interface SmcCapability_cap_name { -readonly kind: 'SmcCapability_cap_name' -readonly name: Text + readonly kind: 'SmcCapability_cap_name'; + readonly name: Text; } export interface ChanConfig { -readonly kind: 'ChanConfig' -readonly init_timeout: number -readonly close_timeout: number -readonly a_key: BitString -readonly b_key: BitString -readonly a_addr: MsgAddressInt -readonly b_addr: MsgAddressInt -readonly channel_id: number -readonly min_A_extra: Grams + readonly kind: 'ChanConfig'; + readonly init_timeout: number; + readonly close_timeout: number; + readonly a_key: BitString; + readonly b_key: BitString; + readonly a_addr: MsgAddressInt; + readonly b_addr: MsgAddressInt; + readonly channel_id: number; + readonly min_A_extra: Grams; } export type ChanState = ChanState_chan_state_init | ChanState_chan_state_close | ChanState_chan_state_payout; export interface ChanState_chan_state_init { -readonly kind: 'ChanState_chan_state_init' -readonly signed_A: Bool -readonly signed_B: Bool -readonly min_A: Grams -readonly min_B: Grams -readonly expire_at: number -readonly A: Grams -readonly B: Grams + readonly kind: 'ChanState_chan_state_init'; + readonly signed_A: Bool; + readonly signed_B: Bool; + readonly min_A: Grams; + readonly min_B: Grams; + readonly expire_at: number; + readonly A: Grams; + readonly B: Grams; } export interface ChanState_chan_state_close { -readonly kind: 'ChanState_chan_state_close' -readonly signed_A: Bool -readonly signed_B: Bool -readonly promise_A: Grams -readonly promise_B: Grams -readonly expire_at: number -readonly A: Grams -readonly B: Grams + readonly kind: 'ChanState_chan_state_close'; + readonly signed_A: Bool; + readonly signed_B: Bool; + readonly promise_A: Grams; + readonly promise_B: Grams; + readonly expire_at: number; + readonly A: Grams; + readonly B: Grams; } export interface ChanState_chan_state_payout { -readonly kind: 'ChanState_chan_state_payout' -readonly A: Grams -readonly B: Grams + readonly kind: 'ChanState_chan_state_payout'; + readonly A: Grams; + readonly B: Grams; } export interface ChanPromise { -readonly kind: 'ChanPromise' -readonly channel_id: number -readonly promise_A: Grams -readonly promise_B: Grams + readonly kind: 'ChanPromise'; + readonly channel_id: number; + readonly promise_A: Grams; + readonly promise_B: Grams; } export interface ChanSignedPromise { -readonly kind: 'ChanSignedPromise' -readonly sig: Maybe -readonly promise: ChanPromise + readonly kind: 'ChanSignedPromise'; + readonly sig: Maybe; + readonly promise: ChanPromise; } export type ChanMsg = ChanMsg_chan_msg_init | ChanMsg_chan_msg_close | ChanMsg_chan_msg_timeout | ChanMsg_chan_msg_payout; export interface ChanMsg_chan_msg_init { -readonly kind: 'ChanMsg_chan_msg_init' -readonly inc_A: Grams -readonly inc_B: Grams -readonly min_A: Grams -readonly min_B: Grams -readonly channel_id: number + readonly kind: 'ChanMsg_chan_msg_init'; + readonly inc_A: Grams; + readonly inc_B: Grams; + readonly min_A: Grams; + readonly min_B: Grams; + readonly channel_id: number; } export interface ChanMsg_chan_msg_close { -readonly kind: 'ChanMsg_chan_msg_close' -readonly extra_A: Grams -readonly extra_B: Grams -readonly promise: ChanSignedPromise + readonly kind: 'ChanMsg_chan_msg_close'; + readonly extra_A: Grams; + readonly extra_B: Grams; + readonly promise: ChanSignedPromise; } export interface ChanMsg_chan_msg_timeout { -readonly kind: 'ChanMsg_chan_msg_timeout' + readonly kind: 'ChanMsg_chan_msg_timeout'; } export interface ChanMsg_chan_msg_payout { -readonly kind: 'ChanMsg_chan_msg_payout' + readonly kind: 'ChanMsg_chan_msg_payout'; } export interface ChanSignedMsg { -readonly kind: 'ChanSignedMsg' -readonly sig_A: Maybe -readonly sig_B: Maybe -readonly msg: ChanMsg + readonly kind: 'ChanSignedMsg'; + readonly sig_A: Maybe; + readonly sig_B: Maybe; + readonly msg: ChanMsg; } export interface ChanOp { -readonly kind: 'ChanOp' -readonly msg: ChanSignedMsg + readonly kind: 'ChanOp'; + readonly msg: ChanSignedMsg; } export interface ChanData { -readonly kind: 'ChanData' -readonly config: ChanConfig -readonly state: ChanState + readonly kind: 'ChanData'; + readonly config: ChanConfig; + readonly state: ChanState; } export function bitLen(n: number) { diff --git a/generated_test.ts b/generated_test.ts index e583023..0b79b83 100644 --- a/generated_test.ts +++ b/generated_test.ts @@ -3,467 +3,467 @@ import { Slice } from 'ton' import { beginCell } from 'ton' import { BitString } from 'ton' export interface Simple { -readonly kind: 'Simple' -readonly a: number -readonly b: number + readonly kind: 'Simple'; + readonly a: number; + readonly b: number; } export type TwoConstructors = TwoConstructors_bool_false | TwoConstructors_bool_true; export interface TwoConstructors_bool_false { -readonly kind: 'TwoConstructors_bool_false' -readonly a: number -readonly b: number -readonly c: number + readonly kind: 'TwoConstructors_bool_false'; + readonly a: number; + readonly b: number; + readonly c: number; } export interface TwoConstructors_bool_true { -readonly kind: 'TwoConstructors_bool_true' -readonly b: number + readonly kind: 'TwoConstructors_bool_true'; + readonly b: number; } export interface FixedIntParam { -readonly kind: 'FixedIntParam' -readonly y: number + readonly kind: 'FixedIntParam'; + readonly y: number; } export interface TypedField { -readonly kind: 'TypedField' -readonly y: FixedIntParam -readonly c: number + readonly kind: 'TypedField'; + readonly y: FixedIntParam; + readonly c: number; } export interface SharpConstructor { -readonly kind: 'SharpConstructor' -readonly y: FixedIntParam -readonly c: number + readonly kind: 'SharpConstructor'; + readonly y: FixedIntParam; + readonly c: number; } export type Maybe = Maybe_nothing | Maybe_just; export interface Maybe_nothing { -readonly kind: 'Maybe_nothing' + readonly kind: 'Maybe_nothing'; } export interface Maybe_just { -readonly kind: 'Maybe_just' -readonly value: TheType + readonly kind: 'Maybe_just'; + readonly value: TheType; } export interface TypedParam { -readonly kind: 'TypedParam' -readonly x: Maybe + readonly kind: 'TypedParam'; + readonly x: Maybe; } export type Either = Either_left | Either_right; export interface Either_left { -readonly kind: 'Either_left' -readonly value: X + readonly kind: 'Either_left'; + readonly value: X; } export interface Either_right { -readonly kind: 'Either_right' -readonly value: Y + readonly kind: 'Either_right'; + readonly value: Y; } export interface BitLenArg { -readonly kind: 'BitLenArg' -readonly x: number -readonly value: number + readonly kind: 'BitLenArg'; + readonly x: number; + readonly value: number; } export interface BitLenArgUser { -readonly kind: 'BitLenArgUser' -readonly t: BitLenArg + readonly kind: 'BitLenArgUser'; + readonly t: BitLenArg; } export interface ExprArg { -readonly kind: 'ExprArg' -readonly x: number -readonly value: number + readonly kind: 'ExprArg'; + readonly x: number; + readonly value: number; } export interface ExprArgUser { -readonly kind: 'ExprArgUser' -readonly t: ExprArg + readonly kind: 'ExprArgUser'; + readonly t: ExprArg; } export interface ComplexTypedField { -readonly kind: 'ComplexTypedField' -readonly a: ExprArgUser + readonly kind: 'ComplexTypedField'; + readonly a: ExprArgUser; } export interface CellTypedField { -readonly kind: 'CellTypedField' -readonly a: ExprArgUser + readonly kind: 'CellTypedField'; + readonly a: ExprArgUser; } export interface CellsSimple { -readonly kind: 'CellsSimple' -readonly t: number -readonly q: number -readonly a: number -readonly e: number -readonly b: number -readonly d: number -readonly c: number + readonly kind: 'CellsSimple'; + readonly t: number; + readonly q: number; + readonly a: number; + readonly e: number; + readonly b: number; + readonly d: number; + readonly c: number; } export interface IntBits { -readonly kind: 'IntBits' -readonly d: number -readonly g: BitString -readonly arg: Arg -readonly x: Slice + readonly kind: 'IntBits'; + readonly d: number; + readonly g: BitString; + readonly arg: Arg; + readonly x: Slice; } export interface IntBitsInside { -readonly kind: 'IntBitsInside' -readonly x: number -readonly a: IntBits + readonly kind: 'IntBitsInside'; + readonly x: number; + readonly a: IntBits; } export interface IntBitsOutside { -readonly kind: 'IntBitsOutside' -readonly x: IntBitsInside + readonly kind: 'IntBitsOutside'; + readonly x: IntBitsInside; } export interface IntBitsParametrized { -readonly kind: 'IntBitsParametrized' -readonly e: number -readonly h: number -readonly f: number -readonly i: BitString -readonly j: number -readonly k: number -readonly tc: Slice + readonly kind: 'IntBitsParametrized'; + readonly e: number; + readonly h: number; + readonly f: number; + readonly i: BitString; + readonly j: number; + readonly k: number; + readonly tc: Slice; } export interface IntBitsParametrizedInside { -readonly kind: 'IntBitsParametrizedInside' -readonly x: number -readonly a: IntBitsParametrized + readonly kind: 'IntBitsParametrizedInside'; + readonly x: number; + readonly a: IntBitsParametrized; } export interface IntBitsParametrizedOutside { -readonly kind: 'IntBitsParametrizedOutside' -readonly x: IntBitsParametrizedInside + readonly kind: 'IntBitsParametrizedOutside'; + readonly x: IntBitsParametrizedInside; } export interface LessThan { -readonly kind: 'LessThan' -readonly x: number -readonly y: number + readonly kind: 'LessThan'; + readonly x: number; + readonly y: number; } export interface OneComb { -readonly kind: 'OneComb' -readonly t: number -readonly x: A + readonly kind: 'OneComb'; + readonly t: number; + readonly x: A; } export interface ManyComb { -readonly kind: 'ManyComb' -readonly y: OneComb>> + readonly kind: 'ManyComb'; + readonly y: OneComb>>; } export type Unary = Unary_unary_zero | Unary_unary_succ; export interface Unary_unary_zero { -readonly kind: 'Unary_unary_zero' + readonly kind: 'Unary_unary_zero'; } export interface Unary_unary_succ { -readonly kind: 'Unary_unary_succ' -readonly n: number -readonly x: Unary + readonly kind: 'Unary_unary_succ'; + readonly n: number; + readonly x: Unary; } export type ParamConst = ParamConst_b | ParamConst_c | ParamConst_a | ParamConst_d; export interface ParamConst_b { -readonly kind: 'ParamConst_b' -readonly m: number -readonly k: number + readonly kind: 'ParamConst_b'; + readonly m: number; + readonly k: number; } export interface ParamConst_c { -readonly kind: 'ParamConst_c' -readonly n: number -readonly m: number -readonly k: number + readonly kind: 'ParamConst_c'; + readonly n: number; + readonly m: number; + readonly k: number; } export interface ParamConst_a { -readonly kind: 'ParamConst_a' -readonly n: number + readonly kind: 'ParamConst_a'; + readonly n: number; } export interface ParamConst_d { -readonly kind: 'ParamConst_d' -readonly n: number -readonly m: number -readonly k: number -readonly l: number + readonly kind: 'ParamConst_d'; + readonly n: number; + readonly m: number; + readonly k: number; + readonly l: number; } export type ParamDifNames = ParamDifNames_a | ParamDifNames_b | ParamDifNames_c | ParamDifNames_d; export interface ParamDifNames_a { -readonly kind: 'ParamDifNames_a' + readonly kind: 'ParamDifNames_a'; } export interface ParamDifNames_b { -readonly kind: 'ParamDifNames_b' + readonly kind: 'ParamDifNames_b'; } export interface ParamDifNames_c { -readonly kind: 'ParamDifNames_c' -readonly n: number -readonly x: ParamDifNames + readonly kind: 'ParamDifNames_c'; + readonly n: number; + readonly x: ParamDifNames; } export interface ParamDifNames_d { -readonly kind: 'ParamDifNames_d' -readonly m: number -readonly x: ParamDifNames + readonly kind: 'ParamDifNames_d'; + readonly m: number; + readonly x: ParamDifNames; } export interface ParamDifNamesUser { -readonly kind: 'ParamDifNamesUser' -readonly k: number -readonly x: ParamDifNames + readonly kind: 'ParamDifNamesUser'; + readonly k: number; + readonly x: ParamDifNames; } export interface NegationFromImplicit { -readonly kind: 'NegationFromImplicit' -readonly y: number -readonly t: number -readonly z: number + readonly kind: 'NegationFromImplicit'; + readonly y: number; + readonly t: number; + readonly z: number; } export interface UnaryUserCheckOrder { -readonly kind: 'UnaryUserCheckOrder' -readonly l: number -readonly m: number -readonly label: Unary + readonly kind: 'UnaryUserCheckOrder'; + readonly l: number; + readonly m: number; + readonly label: Unary; } export interface CombArgCellRef { -readonly kind: 'CombArgCellRef' -readonly info: number -readonly init: Maybe> -readonly other: Either> -readonly body: Either + readonly kind: 'CombArgCellRef'; + readonly info: number; + readonly init: Maybe>; + readonly other: Either>; + readonly body: Either; } export interface CombArgCellRefUser { -readonly kind: 'CombArgCellRefUser' -readonly x: CombArgCellRef + readonly kind: 'CombArgCellRefUser'; + readonly x: CombArgCellRef; } export interface MathExprAsCombArg { -readonly kind: 'MathExprAsCombArg' -readonly n: number -readonly ref: BitLenArg + readonly kind: 'MathExprAsCombArg'; + readonly n: number; + readonly ref: BitLenArg; } export interface EmptyTag { -readonly kind: 'EmptyTag' -readonly a: number + readonly kind: 'EmptyTag'; + readonly a: number; } export interface SharpTag { -readonly kind: 'SharpTag' -readonly x: number + readonly kind: 'SharpTag'; + readonly x: number; } export interface DollarTag { -readonly kind: 'DollarTag' -readonly x: number + readonly kind: 'DollarTag'; + readonly x: number; } export interface TupleCheck { -readonly kind: 'TupleCheck' -readonly s: Array + readonly kind: 'TupleCheck'; + readonly s: Array; } export interface Hashmap { -readonly kind: 'Hashmap' -readonly n: number -readonly l: number -readonly m: number -readonly label: HmLabel -readonly node: HashmapNode + readonly kind: 'Hashmap'; + readonly n: number; + readonly l: number; + readonly m: number; + readonly label: HmLabel; + readonly node: HashmapNode; } export type HashmapNode = HashmapNode_hmn_leaf | HashmapNode_hmn_fork; export interface HashmapNode_hmn_leaf { -readonly kind: 'HashmapNode_hmn_leaf' -readonly value: X + readonly kind: 'HashmapNode_hmn_leaf'; + readonly value: X; } export interface HashmapNode_hmn_fork { -readonly kind: 'HashmapNode_hmn_fork' -readonly n: number -readonly left: Hashmap -readonly right: Hashmap + readonly kind: 'HashmapNode_hmn_fork'; + readonly n: number; + readonly left: Hashmap; + readonly right: Hashmap; } export type HmLabel = HmLabel_hml_short | HmLabel_hml_long | HmLabel_hml_same; export interface HmLabel_hml_short { -readonly kind: 'HmLabel_hml_short' -readonly m: number -readonly n: number -readonly len: Unary -readonly s: Array + readonly kind: 'HmLabel_hml_short'; + readonly m: number; + readonly n: number; + readonly len: Unary; + readonly s: Array; } export interface HmLabel_hml_long { -readonly kind: 'HmLabel_hml_long' -readonly m: number -readonly n: number -readonly s: Array + readonly kind: 'HmLabel_hml_long'; + readonly m: number; + readonly n: number; + readonly s: Array; } export interface HmLabel_hml_same { -readonly kind: 'HmLabel_hml_same' -readonly m: number -readonly v: BitString -readonly n: number + readonly kind: 'HmLabel_hml_same'; + readonly m: number; + readonly v: BitString; + readonly n: number; } export type HashmapE = HashmapE_hme_empty | HashmapE_hme_root; export interface HashmapE_hme_empty { -readonly kind: 'HashmapE_hme_empty' -readonly n: number + readonly kind: 'HashmapE_hme_empty'; + readonly n: number; } export interface HashmapE_hme_root { -readonly kind: 'HashmapE_hme_root' -readonly n: number -readonly root: Hashmap + readonly kind: 'HashmapE_hme_root'; + readonly n: number; + readonly root: Hashmap; } export interface HashmapEUser { -readonly kind: 'HashmapEUser' -readonly x: HashmapE + readonly kind: 'HashmapEUser'; + readonly x: HashmapE; } export interface ConditionalField { -readonly kind: 'ConditionalField' -readonly a: number -readonly b: number | undefined + readonly kind: 'ConditionalField'; + readonly a: number; + readonly b: number | undefined; } export interface BitSelection { -readonly kind: 'BitSelection' -readonly a: number -readonly b: number | undefined + readonly kind: 'BitSelection'; + readonly a: number; + readonly b: number | undefined; } export interface ImplicitCondition { -readonly kind: 'ImplicitCondition' -readonly flags: number + readonly kind: 'ImplicitCondition'; + readonly flags: number; } export type MultipleEmptyConstructor = MultipleEmptyConstructor__ | MultipleEmptyConstructor__1 | MultipleEmptyConstructor_a; export interface MultipleEmptyConstructor__ { -readonly kind: 'MultipleEmptyConstructor__' -readonly a: number + readonly kind: 'MultipleEmptyConstructor__'; + readonly a: number; } export interface MultipleEmptyConstructor__1 { -readonly kind: 'MultipleEmptyConstructor__1' -readonly b: number + readonly kind: 'MultipleEmptyConstructor__1'; + readonly b: number; } export interface MultipleEmptyConstructor_a { -readonly kind: 'MultipleEmptyConstructor_a' -readonly x: number + readonly kind: 'MultipleEmptyConstructor_a'; + readonly x: number; } export interface True { -readonly kind: 'True' + readonly kind: 'True'; } export type ParamNamedArgInSecondConstr = ParamNamedArgInSecondConstr_a | ParamNamedArgInSecondConstr_b; export interface ParamNamedArgInSecondConstr_a { -readonly kind: 'ParamNamedArgInSecondConstr_a' -readonly n: number + readonly kind: 'ParamNamedArgInSecondConstr_a'; + readonly n: number; } export interface ParamNamedArgInSecondConstr_b { -readonly kind: 'ParamNamedArgInSecondConstr_b' -readonly n: number + readonly kind: 'ParamNamedArgInSecondConstr_b'; + readonly n: number; } export interface RefCombinatorAny { -readonly kind: 'RefCombinatorAny' -readonly msg: Maybe + readonly kind: 'RefCombinatorAny'; + readonly msg: Maybe; } export interface EqualityExpression { -readonly kind: 'EqualityExpression' -readonly n: number + readonly kind: 'EqualityExpression'; + readonly n: number; } export interface ConditionalRef { -readonly kind: 'ConditionalRef' -readonly x: number -readonly y: Simple | undefined + readonly kind: 'ConditionalRef'; + readonly x: number; + readonly y: Simple | undefined; } export interface LoadFromNegationOutsideExpr { -readonly kind: 'LoadFromNegationOutsideExpr' -readonly seq_no: number -readonly prev_seq_no: number + readonly kind: 'LoadFromNegationOutsideExpr'; + readonly seq_no: number; + readonly prev_seq_no: number; } export interface AnonymousData { -readonly kind: 'AnonymousData' -readonly anon0: number + readonly kind: 'AnonymousData'; + readonly anon0: number; } export interface FalseAnonField { -readonly kind: 'FalseAnonField' -readonly value: number + readonly kind: 'FalseAnonField'; + readonly value: number; } export type ConstructorOrder = ConstructorOrder__ | ConstructorOrder_a; export interface ConstructorOrder__ { -readonly kind: 'ConstructorOrder__' -readonly anon0: Simple + readonly kind: 'ConstructorOrder__'; + readonly anon0: Simple; } export interface ConstructorOrder_a { -readonly kind: 'ConstructorOrder_a' -readonly a: Simple + readonly kind: 'ConstructorOrder_a'; + readonly a: Simple; } export type CheckCrc32 = CheckCrc32_a | CheckCrc32_b; export interface CheckCrc32_a { -readonly kind: 'CheckCrc32_a' -readonly a: number + readonly kind: 'CheckCrc32_a'; + readonly a: number; } export interface CheckCrc32_b { -readonly kind: 'CheckCrc32_b' -readonly b: number -readonly c: number + readonly kind: 'CheckCrc32_b'; + readonly b: number; + readonly c: number; } export interface CheckKeyword { -readonly kind: 'CheckKeyword' -readonly const0: number + readonly kind: 'CheckKeyword'; + readonly const0: number; } export function bitLen(n: number) { diff --git a/src/codegen/tsgen.ts b/src/codegen/tsgen.ts index d67df77..d3ac987 100644 --- a/src/codegen/tsgen.ts +++ b/src/codegen/tsgen.ts @@ -409,8 +409,10 @@ export function toCode(node: TheNode, code: CodeBuilder = new CodeBuilder()): Co if (node.type == "StructDeclaration") { code.add(`export interface ${toCode(node.name).render()}${toCode(node.typeParametersExpression).render()} {`) - node.fields.forEach(field => { - code.add(`readonly ${toCode(field).render()}`) + code.inTab(() => { + node.fields.forEach(field => { + code.add(`readonly ${toCode(field).render()};`) + }) }) code.add('}') } From 123aaf592a4ef1bd200c03da2c36189b698864e7 Mon Sep 17 00:00:00 2001 From: polyprogrammist Date: Tue, 12 Dec 2023 00:15:54 -0500 Subject: [PATCH 06/10] tmp --- generated_block.ts | 18626 ++++++++++++++++------------------------- generated_test.ts | 2674 +++--- src/codegen/tsgen.ts | 11 +- 3 files changed, 8406 insertions(+), 12905 deletions(-) diff --git a/generated_block.ts b/generated_block.ts index eda748e..d22db74 100644 --- a/generated_block.ts +++ b/generated_block.ts @@ -2387,203 +2387,167 @@ export interface ChanData { } export function bitLen(n: number) { - return n.toString(2).length; -; + return n.toString(2).length;; } export function loadUnit(slice: Slice): Unit { return { - kind: 'Unit', -} + kind: 'Unit', + } -; } export function storeUnit(unit: Unit): (builder: Builder) => void { return ((builder: Builder) => { -}) + }) -; } export function loadTrue(slice: Slice): True { return { - kind: 'True', -} + kind: 'True', + } -; } export function storeTrue(true0: True): (builder: Builder) => void { return ((builder: Builder) => { -}) + }) -; } export function loadBool(slice: Slice): Bool { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1) - return { - kind: 'Bool_bool_false', -} + slice.loadUint(1); + return { + kind: 'Bool_bool_false', + } -} -; + } if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1) - return { - kind: 'Bool_bool_true', -} + slice.loadUint(1); + return { + kind: 'Bool_bool_true', + } -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeBool(bool: Bool): (builder: Builder) => void { if ((bool.kind == 'Bool_bool_false')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1) - -}) + return ((builder: Builder) => { + builder.storeUint(0b0, 1); + }) -} -; + } if ((bool.kind == 'Bool_bool_true')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1) - -}) + return ((builder: Builder) => { + builder.storeUint(0b1, 1); + }) -} -; - throw new Error('') -; + } + throw new Error(''); } export function loadBoolFalse(slice: Slice): BoolFalse { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1) - return { - kind: 'BoolFalse', -} + slice.loadUint(1); + return { + kind: 'BoolFalse', + } -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeBoolFalse(boolFalse: BoolFalse): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0b0, 1) - -}) + builder.storeUint(0b0, 1); + }) -; } export function loadBoolTrue(slice: Slice): BoolTrue { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1) - return { - kind: 'BoolTrue', -} + slice.loadUint(1); + return { + kind: 'BoolTrue', + } -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeBoolTrue(boolTrue: BoolTrue): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0b1, 1) - -}) + builder.storeUint(0b1, 1); + }) -; } export function loadMaybe(slice: Slice, loadX: (slice: Slice) => X ): Maybe { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1) - return { - kind: 'Maybe_nothing', -} + slice.loadUint(1); + return { + kind: 'Maybe_nothing', + } -} -; + } if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1) - let value: X = loadX(slice) + slice.loadUint(1); + let value: X = loadX(slice); + return { + kind: 'Maybe_just', + value: value, + } - return { - kind: 'Maybe_just', - value: value, -} - -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeMaybe(maybe: Maybe, storeX: (x: X) => (builder: Builder) => void ): (builder: Builder) => void { if ((maybe.kind == 'Maybe_nothing')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1) - -}) + return ((builder: Builder) => { + builder.storeUint(0b0, 1); + }) -} -; + } if ((maybe.kind == 'Maybe_just')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1) - - storeX(maybe.value)(builder) - -}) + return ((builder: Builder) => { + builder.storeUint(0b1, 1); + storeX(maybe.value)(builder); + }) -} -; - throw new Error('') -; + } + throw new Error(''); } export function loadEither(slice: Slice, loadX: (slice: Slice) => X , loadY: (slice: Slice) => Y ): Either { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1) - let value: X = loadX(slice) + slice.loadUint(1); + let value: X = loadX(slice); + return { + kind: 'Either_left', + value: value, + } - return { - kind: 'Either_left', - value: value, -} - -} -; + } if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1) - let value: Y = loadY(slice) - - return { - kind: 'Either_right', - value: value, -} + slice.loadUint(1); + let value: Y = loadY(slice); + return { + kind: 'Either_right', + value: value, + } -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeEither(either: Either, storeX: (x: X) => (builder: Builder) => void @@ -2592,45 +2556,33 @@ export function storeEither(either: Either, storeX: (x: X) => (build ): (builder: Builder) => void { if ((either.kind == 'Either_left')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1) - - storeX(either.value)(builder) - -}) + return ((builder: Builder) => { + builder.storeUint(0b0, 1); + storeX(either.value)(builder); + }) -} -; + } if ((either.kind == 'Either_right')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1) - - storeY(either.value)(builder) - -}) + return ((builder: Builder) => { + builder.storeUint(0b1, 1); + storeY(either.value)(builder); + }) -} -; - throw new Error('') -; + } + throw new Error(''); } export function loadBoth(slice: Slice, loadX: (slice: Slice) => X , loadY: (slice: Slice) => Y ): Both { - let first: X = loadX(slice) - -; - let second: Y = loadY(slice) - -; + let first: X = loadX(slice); + let second: Y = loadY(slice); return { - kind: 'Both', - first: first, - second: second, -} + kind: 'Both', + first: first, + second: second, + } -; } export function storeBoth(both: Both, storeX: (x: X) => (builder: Builder) => void @@ -2639,493 +2591,366 @@ export function storeBoth(both: Both, storeX: (x: X) => (builder: Bu ): (builder: Builder) => void { return ((builder: Builder) => { - storeX(both.first)(builder) - - storeY(both.second)(builder) - -}) + storeX(both.first)(builder); + storeY(both.second)(builder); + }) -; } export function loadBit(slice: Slice): Bit { - let anon0: number = slice.loadUint(1) - -; + let anon0: number = slice.loadUint(1); return { - kind: 'Bit', - anon0: anon0, -} + kind: 'Bit', + anon0: anon0, + } -; } export function storeBit(bit: Bit): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(bit.anon0, 1) - -}) + builder.storeUint(bit.anon0, 1); + }) -; } export function hashmap_get_l(label: HmLabel): number { if ((label.kind == 'HmLabel_hml_short')) { - let n = label.n - - return n -} -; + let n = label.n; + return n + } if ((label.kind == 'HmLabel_hml_long')) { - let n = label.n - - return n -} -; + let n = label.n; + return n + } if ((label.kind == 'HmLabel_hml_same')) { - let n = label.n - - return n -} -; - throw new Error('') -; + let n = label.n; + return n + } + throw new Error(''); } export function loadHashmap(slice: Slice, n: number, loadX: (slice: Slice) => X ): Hashmap { - let label: HmLabel = loadHmLabel(slice, n) - -; - let l = hashmap_get_l(label) - -; - let node: HashmapNode = loadHashmapNode(slice, (n - l), loadX) - -; - return { - kind: 'Hashmap', - m: (n - l), - n: n, - label: label, - l: l, - node: node, -} + let label: HmLabel = loadHmLabel(slice, n); + let l = hashmap_get_l(label); + let node: HashmapNode = loadHashmapNode(slice, (n - l), loadX); + return { + kind: 'Hashmap', + m: (n - l), + n: n, + label: label, + l: l, + node: node, + } -; } export function storeHashmap(hashmap: Hashmap, storeX: (x: X) => (builder: Builder) => void ): (builder: Builder) => void { return ((builder: Builder) => { - storeHmLabel(hashmap.label)(builder) - - storeHashmapNode(hashmap.node, storeX)(builder) - -}) + storeHmLabel(hashmap.label)(builder); + storeHashmapNode(hashmap.node, storeX)(builder); + }) -; } export function loadHashmapNode(slice: Slice, arg0: number, loadX: (slice: Slice) => X ): HashmapNode { if ((arg0 == 0)) { - let value: X = loadX(slice) - - return { - kind: 'HashmapNode_hmn_leaf', - value: value, -} + let value: X = loadX(slice); + return { + kind: 'HashmapNode_hmn_leaf', + value: value, + } -} -; + } if (true) { - let slice1 = slice.loadRef().beginParse() - - let left: Hashmap = loadHashmap(slice1, (arg0 - 1), loadX) - - let slice2 = slice.loadRef().beginParse() - - let right: Hashmap = loadHashmap(slice2, (arg0 - 1), loadX) - - return { - kind: 'HashmapNode_hmn_fork', - n: (arg0 - 1), - left: left, - right: right, -} + let slice1 = slice.loadRef().beginParse(); + let left: Hashmap = loadHashmap(slice1, (arg0 - 1), loadX); + let slice2 = slice.loadRef().beginParse(); + let right: Hashmap = loadHashmap(slice2, (arg0 - 1), loadX); + return { + kind: 'HashmapNode_hmn_fork', + n: (arg0 - 1), + left: left, + right: right, + } -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeHashmapNode(hashmapNode: HashmapNode, storeX: (x: X) => (builder: Builder) => void ): (builder: Builder) => void { if ((hashmapNode.kind == 'HashmapNode_hmn_leaf')) { - return ((builder: Builder) => { - storeX(hashmapNode.value)(builder) - -}) + return ((builder: Builder) => { + storeX(hashmapNode.value)(builder); + }) -} -; + } if ((hashmapNode.kind == 'HashmapNode_hmn_fork')) { - return ((builder: Builder) => { - let cell1 = beginCell() - - - storeHashmap(hashmapNode.left, storeX)(cell1) - - builder.storeRef(cell1) - - let cell2 = beginCell() - - - storeHashmap(hashmapNode.right, storeX)(cell2) - - builder.storeRef(cell2) - -}) + return ((builder: Builder) => { + let cell1 = beginCell(); + storeHashmap(hashmapNode.left, storeX)(cell1); + builder.storeRef(cell1); + let cell2 = beginCell(); + storeHashmap(hashmapNode.right, storeX)(cell2); + builder.storeRef(cell2); + }) -} -; - throw new Error('') -; + } + throw new Error(''); } export function hmLabel_hml_short_get_n(len: Unary): number { if ((len.kind == 'Unary_unary_zero')) { - return 0 -} -; + return 0 + } if ((len.kind == 'Unary_unary_succ')) { - let n = len.n - - return (n + 1) -} -; - throw new Error('') -; + let n = len.n; + return (n + 1) + } + throw new Error(''); } export function loadHmLabel(slice: Slice, m: number): HmLabel { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1) - let len: Unary = loadUnary(slice) - - let n = hmLabel_hml_short_get_n(len) - - let s: Array = Array.from(Array(n).keys()).map(((arg: number) => { + slice.loadUint(1); + let len: Unary = loadUnary(slice); + let n = hmLabel_hml_short_get_n(len); + let s: Array = Array.from(Array(n).keys()).map(((arg: number) => { return slice.loadBits(1) - }) -) +); + if ((!(n <= m))) { + throw new Error(''); + } + return { + kind: 'HmLabel_hml_short', + m: m, + len: len, + n: n, + s: s, + } - if ((!(n <= m))) { - throw new Error('') } - return { - kind: 'HmLabel_hml_short', - m: m, - len: len, - n: n, - s: s, -} - -} -; if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b10))) { - slice.loadUint(2) - let n: number = slice.loadUint(bitLen(m)) - - let s: Array = Array.from(Array(n).keys()).map(((arg: number) => { + slice.loadUint(2); + let n: number = slice.loadUint(bitLen(m)); + let s: Array = Array.from(Array(n).keys()).map(((arg: number) => { return slice.loadBits(1) - }) -) - - return { - kind: 'HmLabel_hml_long', - m: m, - n: n, - s: s, -} +); + return { + kind: 'HmLabel_hml_long', + m: m, + n: n, + s: s, + } -} -; + } if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b11))) { - slice.loadUint(2) - let v: BitString = slice.loadBits(1) - - let n: number = slice.loadUint(bitLen(m)) - - return { - kind: 'HmLabel_hml_same', - m: m, - v: v, - n: n, -} + slice.loadUint(2); + let v: BitString = slice.loadBits(1); + let n: number = slice.loadUint(bitLen(m)); + return { + kind: 'HmLabel_hml_same', + m: m, + v: v, + n: n, + } -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeHmLabel(hmLabel: HmLabel): (builder: Builder) => void { if ((hmLabel.kind == 'HmLabel_hml_short')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1) - - storeUnary(hmLabel.len)(builder) - - hmLabel.s.forEach(((arg: BitString) => { - builder.storeBits(arg) - - }) - ) + return ((builder: Builder) => { + builder.storeUint(0b0, 1); + storeUnary(hmLabel.len)(builder); + hmLabel.s.forEach(((arg: BitString) => { + builder.storeBits(arg); + }) + ); + if ((!(hmLabel.n <= hmLabel.m))) { + throw new Error(''); + } + }) - if ((!(hmLabel.n <= hmLabel.m))) { - throw new Error('') } - -}) - -} -; if ((hmLabel.kind == 'HmLabel_hml_long')) { - return ((builder: Builder) => { - builder.storeUint(0b10, 2) - - builder.storeUint(hmLabel.n, bitLen(hmLabel.m)) - - hmLabel.s.forEach(((arg: BitString) => { - builder.storeBits(arg) - - }) - ) - -}) + return ((builder: Builder) => { + builder.storeUint(0b10, 2); + builder.storeUint(hmLabel.n, bitLen(hmLabel.m)); + hmLabel.s.forEach(((arg: BitString) => { + builder.storeBits(arg); + }) + ); + }) -} -; + } if ((hmLabel.kind == 'HmLabel_hml_same')) { - return ((builder: Builder) => { - builder.storeUint(0b11, 2) - - builder.storeBits(hmLabel.v) - - builder.storeUint(hmLabel.n, bitLen(hmLabel.m)) - -}) + return ((builder: Builder) => { + builder.storeUint(0b11, 2); + builder.storeBits(hmLabel.v); + builder.storeUint(hmLabel.n, bitLen(hmLabel.m)); + }) -} -; - throw new Error('') -; + } + throw new Error(''); } export function unary_unary_succ_get_n(x: Unary): number { if ((x.kind == 'Unary_unary_zero')) { - return 0 -} -; + return 0 + } if ((x.kind == 'Unary_unary_succ')) { - let n = x.n - - return (n + 1) -} -; - throw new Error('') -; + let n = x.n; + return (n + 1) + } + throw new Error(''); } export function loadUnary(slice: Slice): Unary { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1) - return { - kind: 'Unary_unary_zero', -} + slice.loadUint(1); + return { + kind: 'Unary_unary_zero', + } -} -; + } if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1) - let x: Unary = loadUnary(slice) - - let n = unary_unary_succ_get_n(x) - - return { - kind: 'Unary_unary_succ', - x: x, - n: n, -} + slice.loadUint(1); + let x: Unary = loadUnary(slice); + let n = unary_unary_succ_get_n(x); + return { + kind: 'Unary_unary_succ', + x: x, + n: n, + } -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeUnary(unary: Unary): (builder: Builder) => void { if ((unary.kind == 'Unary_unary_zero')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1) - -}) + return ((builder: Builder) => { + builder.storeUint(0b0, 1); + }) -} -; + } if ((unary.kind == 'Unary_unary_succ')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1) - - storeUnary(unary.x)(builder) - -}) + return ((builder: Builder) => { + builder.storeUint(0b1, 1); + storeUnary(unary.x)(builder); + }) -} -; - throw new Error('') -; + } + throw new Error(''); } export function loadHashmapE(slice: Slice, n: number, loadX: (slice: Slice) => X ): HashmapE { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1) - return { - kind: 'HashmapE_hme_empty', - n: n, -} + slice.loadUint(1); + return { + kind: 'HashmapE_hme_empty', + n: n, + } -} -; + } if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1) - let slice1 = slice.loadRef().beginParse() - - let root: Hashmap = loadHashmap(slice1, n, loadX) + slice.loadUint(1); + let slice1 = slice.loadRef().beginParse(); + let root: Hashmap = loadHashmap(slice1, n, loadX); + return { + kind: 'HashmapE_hme_root', + n: n, + root: root, + } - return { - kind: 'HashmapE_hme_root', - n: n, - root: root, -} - -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeHashmapE(hashmapE: HashmapE, storeX: (x: X) => (builder: Builder) => void ): (builder: Builder) => void { if ((hashmapE.kind == 'HashmapE_hme_empty')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1) - -}) + return ((builder: Builder) => { + builder.storeUint(0b0, 1); + }) -} -; + } if ((hashmapE.kind == 'HashmapE_hme_root')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1) - - let cell1 = beginCell() - - - storeHashmap(hashmapE.root, storeX)(cell1) - - builder.storeRef(cell1) - -}) + return ((builder: Builder) => { + builder.storeUint(0b1, 1); + let cell1 = beginCell(); + storeHashmap(hashmapE.root, storeX)(cell1); + builder.storeRef(cell1); + }) -} -; - throw new Error('') -; + } + throw new Error(''); } export function loadBitstringSet(slice: Slice, n: number): BitstringSet { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xda553663))) { - slice.loadUint(32) - let _: Hashmap = loadHashmap(slice, n, loadTrue) - - return { - kind: 'BitstringSet', - n: n, - _: _, -} + slice.loadUint(32); + let _: Hashmap = loadHashmap(slice, n, loadTrue); + return { + kind: 'BitstringSet', + n: n, + _: _, + } -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeBitstringSet(bitstringSet: BitstringSet): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xda553663, 32) - - storeHashmap(bitstringSet._, storeTrue)(builder) - -}) + builder.storeUint(0xda553663, 32); + storeHashmap(bitstringSet._, storeTrue)(builder); + }) -; } export function hashmapAug_get_l(label: HmLabel): number { if ((label.kind == 'HmLabel_hml_short')) { - let n = label.n - - return n -} -; + let n = label.n; + return n + } if ((label.kind == 'HmLabel_hml_long')) { - let n = label.n - - return n -} -; + let n = label.n; + return n + } if ((label.kind == 'HmLabel_hml_same')) { - let n = label.n - - return n -} -; - throw new Error('') -; + let n = label.n; + return n + } + throw new Error(''); } export function loadHashmapAug(slice: Slice, n: number, loadX: (slice: Slice) => X , loadY: (slice: Slice) => Y ): HashmapAug { - let label: HmLabel = loadHmLabel(slice, n) - -; - let l = hashmapAug_get_l(label) - -; - let node: HashmapAugNode = loadHashmapAugNode(slice, (n - l), loadX, loadY) - -; - return { - kind: 'HashmapAug', - m: (n - l), - n: n, - label: label, - l: l, - node: node, -} + let label: HmLabel = loadHmLabel(slice, n); + let l = hashmapAug_get_l(label); + let node: HashmapAugNode = loadHashmapAugNode(slice, (n - l), loadX, loadY); + return { + kind: 'HashmapAug', + m: (n - l), + n: n, + label: label, + l: l, + node: node, + } -; } export function storeHashmapAug(hashmapAug: HashmapAug, storeX: (x: X) => (builder: Builder) => void @@ -3134,54 +2959,41 @@ export function storeHashmapAug(hashmapAug: HashmapAug, storeX: (x: ): (builder: Builder) => void { return ((builder: Builder) => { - storeHmLabel(hashmapAug.label)(builder) - - storeHashmapAugNode(hashmapAug.node, storeX, storeY)(builder) - -}) + storeHmLabel(hashmapAug.label)(builder); + storeHashmapAugNode(hashmapAug.node, storeX, storeY)(builder); + }) -; } export function loadHashmapAugNode(slice: Slice, arg0: number, loadX: (slice: Slice) => X , loadY: (slice: Slice) => Y ): HashmapAugNode { if ((arg0 == 0)) { - let extra: Y = loadY(slice) - - let value: X = loadX(slice) + let extra: Y = loadY(slice); + let value: X = loadX(slice); + return { + kind: 'HashmapAugNode_ahmn_leaf', + extra: extra, + value: value, + } - return { - kind: 'HashmapAugNode_ahmn_leaf', - extra: extra, - value: value, -} - -} -; + } if (true) { - let slice1 = slice.loadRef().beginParse() - - let left: HashmapAug = loadHashmapAug(slice1, (arg0 - 1), loadX, loadY) - - let slice2 = slice.loadRef().beginParse() - - let right: HashmapAug = loadHashmapAug(slice2, (arg0 - 1), loadX, loadY) - - let extra: Y = loadY(slice) - - return { - kind: 'HashmapAugNode_ahmn_fork', - n: (arg0 - 1), - left: left, - right: right, - extra: extra, -} + let slice1 = slice.loadRef().beginParse(); + let left: HashmapAug = loadHashmapAug(slice1, (arg0 - 1), loadX, loadY); + let slice2 = slice.loadRef().beginParse(); + let right: HashmapAug = loadHashmapAug(slice2, (arg0 - 1), loadX, loadY); + let extra: Y = loadY(slice); + return { + kind: 'HashmapAugNode_ahmn_fork', + n: (arg0 - 1), + left: left, + right: right, + extra: extra, + } -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeHashmapAugNode(hashmapAugNode: HashmapAugNode, storeX: (x: X) => (builder: Builder) => void @@ -3190,75 +3002,54 @@ export function storeHashmapAugNode(hashmapAugNode: HashmapAugNode, ): (builder: Builder) => void { if ((hashmapAugNode.kind == 'HashmapAugNode_ahmn_leaf')) { - return ((builder: Builder) => { - storeY(hashmapAugNode.extra)(builder) - - storeX(hashmapAugNode.value)(builder) - -}) + return ((builder: Builder) => { + storeY(hashmapAugNode.extra)(builder); + storeX(hashmapAugNode.value)(builder); + }) -} -; + } if ((hashmapAugNode.kind == 'HashmapAugNode_ahmn_fork')) { - return ((builder: Builder) => { - let cell1 = beginCell() - - - storeHashmapAug(hashmapAugNode.left, storeX, storeY)(cell1) - - builder.storeRef(cell1) - - let cell2 = beginCell() - - - storeHashmapAug(hashmapAugNode.right, storeX, storeY)(cell2) - - builder.storeRef(cell2) - - storeY(hashmapAugNode.extra)(builder) - -}) + return ((builder: Builder) => { + let cell1 = beginCell(); + storeHashmapAug(hashmapAugNode.left, storeX, storeY)(cell1); + builder.storeRef(cell1); + let cell2 = beginCell(); + storeHashmapAug(hashmapAugNode.right, storeX, storeY)(cell2); + builder.storeRef(cell2); + storeY(hashmapAugNode.extra)(builder); + }) -} -; - throw new Error('') -; + } + throw new Error(''); } export function loadHashmapAugE(slice: Slice, n: number, loadX: (slice: Slice) => X , loadY: (slice: Slice) => Y ): HashmapAugE { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1) - let extra: Y = loadY(slice) - - return { - kind: 'HashmapAugE_ahme_empty', - n: n, - extra: extra, -} + slice.loadUint(1); + let extra: Y = loadY(slice); + return { + kind: 'HashmapAugE_ahme_empty', + n: n, + extra: extra, + } -} -; + } if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1) - let slice1 = slice.loadRef().beginParse() - - let root: HashmapAug = loadHashmapAug(slice1, n, loadX, loadY) - - let extra: Y = loadY(slice) + slice.loadUint(1); + let slice1 = slice.loadRef().beginParse(); + let root: HashmapAug = loadHashmapAug(slice1, n, loadX, loadY); + let extra: Y = loadY(slice); + return { + kind: 'HashmapAugE_ahme_root', + n: n, + root: root, + extra: extra, + } - return { - kind: 'HashmapAugE_ahme_root', - n: n, - root: root, - extra: extra, -} - -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeHashmapAugE(hashmapAugE: HashmapAugE, storeX: (x: X) => (builder: Builder) => void @@ -3267,12217 +3058,8582 @@ export function storeHashmapAugE(hashmapAugE: HashmapAugE, storeX: ( ): (builder: Builder) => void { if ((hashmapAugE.kind == 'HashmapAugE_ahme_empty')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1) - - storeY(hashmapAugE.extra)(builder) - -}) + return ((builder: Builder) => { + builder.storeUint(0b0, 1); + storeY(hashmapAugE.extra)(builder); + }) -} -; + } if ((hashmapAugE.kind == 'HashmapAugE_ahme_root')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1) - - let cell1 = beginCell() - - - storeHashmapAug(hashmapAugE.root, storeX, storeY)(cell1) - - builder.storeRef(cell1) - - storeY(hashmapAugE.extra)(builder) - -}) + return ((builder: Builder) => { + builder.storeUint(0b1, 1); + let cell1 = beginCell(); + storeHashmapAug(hashmapAugE.root, storeX, storeY)(cell1); + builder.storeRef(cell1); + storeY(hashmapAugE.extra)(builder); + }) -} -; - throw new Error('') -; + } + throw new Error(''); } export function varHashmap_get_l(label: HmLabel): number { if ((label.kind == 'HmLabel_hml_short')) { - let n = label.n - - return n -} -; + let n = label.n; + return n + } if ((label.kind == 'HmLabel_hml_long')) { - let n = label.n - - return n -} -; + let n = label.n; + return n + } if ((label.kind == 'HmLabel_hml_same')) { - let n = label.n - - return n -} -; - throw new Error('') -; + let n = label.n; + return n + } + throw new Error(''); } export function loadVarHashmap(slice: Slice, n: number, loadX: (slice: Slice) => X ): VarHashmap { - let label: HmLabel = loadHmLabel(slice, n) - -; - let l = varHashmap_get_l(label) - -; - let node: VarHashmapNode = loadVarHashmapNode(slice, (n - l), loadX) - -; - return { - kind: 'VarHashmap', - m: (n - l), - n: n, - label: label, - l: l, - node: node, -} + let label: HmLabel = loadHmLabel(slice, n); + let l = varHashmap_get_l(label); + let node: VarHashmapNode = loadVarHashmapNode(slice, (n - l), loadX); + return { + kind: 'VarHashmap', + m: (n - l), + n: n, + label: label, + l: l, + node: node, + } -; } export function storeVarHashmap(varHashmap: VarHashmap, storeX: (x: X) => (builder: Builder) => void ): (builder: Builder) => void { return ((builder: Builder) => { - storeHmLabel(varHashmap.label)(builder) - - storeVarHashmapNode(varHashmap.node, storeX)(builder) - -}) + storeHmLabel(varHashmap.label)(builder); + storeVarHashmapNode(varHashmap.node, storeX)(builder); + }) -; } export function loadVarHashmapNode(slice: Slice, arg0: number, loadX: (slice: Slice) => X ): VarHashmapNode { if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { - slice.loadUint(2) - let value: X = loadX(slice) + slice.loadUint(2); + let value: X = loadX(slice); + return { + kind: 'VarHashmapNode_vhmn_leaf', + n: arg0, + value: value, + } - return { - kind: 'VarHashmapNode_vhmn_leaf', - n: arg0, - value: value, -} - -} -; + } if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b01))) { - slice.loadUint(2) - let slice1 = slice.loadRef().beginParse() - - let left: VarHashmap = loadVarHashmap(slice1, (arg0 - 1), loadX) - - let slice2 = slice.loadRef().beginParse() - - let right: VarHashmap = loadVarHashmap(slice2, (arg0 - 1), loadX) - - let value: Maybe = loadMaybe(slice, loadX) - - return { - kind: 'VarHashmapNode_vhmn_fork', - n: (arg0 - 1), - left: left, - right: right, - value: value, -} + slice.loadUint(2); + let slice1 = slice.loadRef().beginParse(); + let left: VarHashmap = loadVarHashmap(slice1, (arg0 - 1), loadX); + let slice2 = slice.loadRef().beginParse(); + let right: VarHashmap = loadVarHashmap(slice2, (arg0 - 1), loadX); + let value: Maybe = loadMaybe(slice, loadX); + return { + kind: 'VarHashmapNode_vhmn_fork', + n: (arg0 - 1), + left: left, + right: right, + value: value, + } -} -; + } if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1) - let branch: BitString = slice.loadBits(1) - - let slice1 = slice.loadRef().beginParse() - - let child: VarHashmap = loadVarHashmap(slice1, (arg0 - 1), loadX) - - let value: X = loadX(slice) - - return { - kind: 'VarHashmapNode_vhmn_cont', - n: (arg0 - 1), - branch: branch, - child: child, - value: value, -} + slice.loadUint(1); + let branch: BitString = slice.loadBits(1); + let slice1 = slice.loadRef().beginParse(); + let child: VarHashmap = loadVarHashmap(slice1, (arg0 - 1), loadX); + let value: X = loadX(slice); + return { + kind: 'VarHashmapNode_vhmn_cont', + n: (arg0 - 1), + branch: branch, + child: child, + value: value, + } -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeVarHashmapNode(varHashmapNode: VarHashmapNode, storeX: (x: X) => (builder: Builder) => void ): (builder: Builder) => void { if ((varHashmapNode.kind == 'VarHashmapNode_vhmn_leaf')) { - return ((builder: Builder) => { - builder.storeUint(0b00, 2) - - storeX(varHashmapNode.value)(builder) - -}) + return ((builder: Builder) => { + builder.storeUint(0b00, 2); + storeX(varHashmapNode.value)(builder); + }) -} -; + } if ((varHashmapNode.kind == 'VarHashmapNode_vhmn_fork')) { - return ((builder: Builder) => { - builder.storeUint(0b01, 2) - - let cell1 = beginCell() - - - storeVarHashmap(varHashmapNode.left, storeX)(cell1) - - builder.storeRef(cell1) - - let cell2 = beginCell() - - - storeVarHashmap(varHashmapNode.right, storeX)(cell2) - - builder.storeRef(cell2) - - storeMaybe(varHashmapNode.value, storeX)(builder) - -}) + return ((builder: Builder) => { + builder.storeUint(0b01, 2); + let cell1 = beginCell(); + storeVarHashmap(varHashmapNode.left, storeX)(cell1); + builder.storeRef(cell1); + let cell2 = beginCell(); + storeVarHashmap(varHashmapNode.right, storeX)(cell2); + builder.storeRef(cell2); + storeMaybe(varHashmapNode.value, storeX)(builder); + }) -} -; + } if ((varHashmapNode.kind == 'VarHashmapNode_vhmn_cont')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1) - - builder.storeBits(varHashmapNode.branch) - - let cell1 = beginCell() - - - storeVarHashmap(varHashmapNode.child, storeX)(cell1) - - builder.storeRef(cell1) - - storeX(varHashmapNode.value)(builder) - -}) + return ((builder: Builder) => { + builder.storeUint(0b1, 1); + builder.storeBits(varHashmapNode.branch); + let cell1 = beginCell(); + storeVarHashmap(varHashmapNode.child, storeX)(cell1); + builder.storeRef(cell1); + storeX(varHashmapNode.value)(builder); + }) -} -; - throw new Error('') -; + } + throw new Error(''); } export function loadVarHashmapE(slice: Slice, n: number, loadX: (slice: Slice) => X ): VarHashmapE { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1) - return { - kind: 'VarHashmapE_vhme_empty', - n: n, -} + slice.loadUint(1); + return { + kind: 'VarHashmapE_vhme_empty', + n: n, + } -} -; + } if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1) - let slice1 = slice.loadRef().beginParse() - - let root: VarHashmap = loadVarHashmap(slice1, n, loadX) + slice.loadUint(1); + let slice1 = slice.loadRef().beginParse(); + let root: VarHashmap = loadVarHashmap(slice1, n, loadX); + return { + kind: 'VarHashmapE_vhme_root', + n: n, + root: root, + } - return { - kind: 'VarHashmapE_vhme_root', - n: n, - root: root, -} - -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeVarHashmapE(varHashmapE: VarHashmapE, storeX: (x: X) => (builder: Builder) => void ): (builder: Builder) => void { if ((varHashmapE.kind == 'VarHashmapE_vhme_empty')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1) - -}) + return ((builder: Builder) => { + builder.storeUint(0b0, 1); + }) -} -; + } if ((varHashmapE.kind == 'VarHashmapE_vhme_root')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1) - - let cell1 = beginCell() - - - storeVarHashmap(varHashmapE.root, storeX)(cell1) - - builder.storeRef(cell1) - -}) + return ((builder: Builder) => { + builder.storeUint(0b1, 1); + let cell1 = beginCell(); + storeVarHashmap(varHashmapE.root, storeX)(cell1); + builder.storeRef(cell1); + }) -} -; - throw new Error('') -; + } + throw new Error(''); } export function pfxHashmap_get_l(label: HmLabel): number { if ((label.kind == 'HmLabel_hml_short')) { - let n = label.n - - return n -} -; + let n = label.n; + return n + } if ((label.kind == 'HmLabel_hml_long')) { - let n = label.n - - return n -} -; + let n = label.n; + return n + } if ((label.kind == 'HmLabel_hml_same')) { - let n = label.n - - return n -} -; - throw new Error('') -; + let n = label.n; + return n + } + throw new Error(''); } export function loadPfxHashmap(slice: Slice, n: number, loadX: (slice: Slice) => X ): PfxHashmap { - let label: HmLabel = loadHmLabel(slice, n) - -; - let l = pfxHashmap_get_l(label) - -; - let node: PfxHashmapNode = loadPfxHashmapNode(slice, (n - l), loadX) - -; - return { - kind: 'PfxHashmap', - m: (n - l), - n: n, - label: label, - l: l, - node: node, -} + let label: HmLabel = loadHmLabel(slice, n); + let l = pfxHashmap_get_l(label); + let node: PfxHashmapNode = loadPfxHashmapNode(slice, (n - l), loadX); + return { + kind: 'PfxHashmap', + m: (n - l), + n: n, + label: label, + l: l, + node: node, + } -; } export function storePfxHashmap(pfxHashmap: PfxHashmap, storeX: (x: X) => (builder: Builder) => void ): (builder: Builder) => void { return ((builder: Builder) => { - storeHmLabel(pfxHashmap.label)(builder) - - storePfxHashmapNode(pfxHashmap.node, storeX)(builder) - -}) + storeHmLabel(pfxHashmap.label)(builder); + storePfxHashmapNode(pfxHashmap.node, storeX)(builder); + }) -; } export function loadPfxHashmapNode(slice: Slice, arg0: number, loadX: (slice: Slice) => X ): PfxHashmapNode { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1) - let value: X = loadX(slice) - - return { - kind: 'PfxHashmapNode_phmn_leaf', - n: arg0, - value: value, -} + slice.loadUint(1); + let value: X = loadX(slice); + return { + kind: 'PfxHashmapNode_phmn_leaf', + n: arg0, + value: value, + } -} -; + } if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1) - let slice1 = slice.loadRef().beginParse() - - let left: PfxHashmap = loadPfxHashmap(slice1, (arg0 - 1), loadX) + slice.loadUint(1); + let slice1 = slice.loadRef().beginParse(); + let left: PfxHashmap = loadPfxHashmap(slice1, (arg0 - 1), loadX); + let slice2 = slice.loadRef().beginParse(); + let right: PfxHashmap = loadPfxHashmap(slice2, (arg0 - 1), loadX); + return { + kind: 'PfxHashmapNode_phmn_fork', + n: (arg0 - 1), + left: left, + right: right, + } - let slice2 = slice.loadRef().beginParse() - - let right: PfxHashmap = loadPfxHashmap(slice2, (arg0 - 1), loadX) - - return { - kind: 'PfxHashmapNode_phmn_fork', - n: (arg0 - 1), - left: left, - right: right, -} - -} -; - throw new Error('') -; + } + throw new Error(''); } export function storePfxHashmapNode(pfxHashmapNode: PfxHashmapNode, storeX: (x: X) => (builder: Builder) => void ): (builder: Builder) => void { if ((pfxHashmapNode.kind == 'PfxHashmapNode_phmn_leaf')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1) - - storeX(pfxHashmapNode.value)(builder) - -}) + return ((builder: Builder) => { + builder.storeUint(0b0, 1); + storeX(pfxHashmapNode.value)(builder); + }) -} -; + } if ((pfxHashmapNode.kind == 'PfxHashmapNode_phmn_fork')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1) - - let cell1 = beginCell() - - - storePfxHashmap(pfxHashmapNode.left, storeX)(cell1) - - builder.storeRef(cell1) - - let cell2 = beginCell() - - - storePfxHashmap(pfxHashmapNode.right, storeX)(cell2) - - builder.storeRef(cell2) - -}) + return ((builder: Builder) => { + builder.storeUint(0b1, 1); + let cell1 = beginCell(); + storePfxHashmap(pfxHashmapNode.left, storeX)(cell1); + builder.storeRef(cell1); + let cell2 = beginCell(); + storePfxHashmap(pfxHashmapNode.right, storeX)(cell2); + builder.storeRef(cell2); + }) -} -; - throw new Error('') -; + } + throw new Error(''); } export function loadPfxHashmapE(slice: Slice, n: number, loadX: (slice: Slice) => X ): PfxHashmapE { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1) - return { - kind: 'PfxHashmapE_phme_empty', - n: n, -} + slice.loadUint(1); + return { + kind: 'PfxHashmapE_phme_empty', + n: n, + } -} -; + } if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1) - let slice1 = slice.loadRef().beginParse() - - let root: PfxHashmap = loadPfxHashmap(slice1, n, loadX) - - return { - kind: 'PfxHashmapE_phme_root', - n: n, - root: root, -} + slice.loadUint(1); + let slice1 = slice.loadRef().beginParse(); + let root: PfxHashmap = loadPfxHashmap(slice1, n, loadX); + return { + kind: 'PfxHashmapE_phme_root', + n: n, + root: root, + } -} -; - throw new Error('') -; + } + throw new Error(''); } export function storePfxHashmapE(pfxHashmapE: PfxHashmapE, storeX: (x: X) => (builder: Builder) => void ): (builder: Builder) => void { if ((pfxHashmapE.kind == 'PfxHashmapE_phme_empty')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1) - -}) + return ((builder: Builder) => { + builder.storeUint(0b0, 1); + }) -} -; + } if ((pfxHashmapE.kind == 'PfxHashmapE_phme_root')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1) - - let cell1 = beginCell() - - - storePfxHashmap(pfxHashmapE.root, storeX)(cell1) - - builder.storeRef(cell1) - -}) + return ((builder: Builder) => { + builder.storeUint(0b1, 1); + let cell1 = beginCell(); + storePfxHashmap(pfxHashmapE.root, storeX)(cell1); + builder.storeRef(cell1); + }) -} -; - throw new Error('') -; + } + throw new Error(''); } export function loadMsgAddressExt(slice: Slice): MsgAddressExt { if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { - slice.loadUint(2) - return { - kind: 'MsgAddressExt_addr_none', -} + slice.loadUint(2); + return { + kind: 'MsgAddressExt_addr_none', + } -} -; + } if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b01))) { - slice.loadUint(2) - let len: number = slice.loadUint(9) - - let external_address: BitString = slice.loadBits(len) - - return { - kind: 'MsgAddressExt_addr_extern', - len: len, - external_address: external_address, -} + slice.loadUint(2); + let len: number = slice.loadUint(9); + let external_address: BitString = slice.loadBits(len); + return { + kind: 'MsgAddressExt_addr_extern', + len: len, + external_address: external_address, + } -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeMsgAddressExt(msgAddressExt: MsgAddressExt): (builder: Builder) => void { if ((msgAddressExt.kind == 'MsgAddressExt_addr_none')) { - return ((builder: Builder) => { - builder.storeUint(0b00, 2) - -}) + return ((builder: Builder) => { + builder.storeUint(0b00, 2); + }) -} -; + } if ((msgAddressExt.kind == 'MsgAddressExt_addr_extern')) { - return ((builder: Builder) => { - builder.storeUint(0b01, 2) - - builder.storeUint(msgAddressExt.len, 9) - - builder.storeBits(msgAddressExt.external_address) - -}) + return ((builder: Builder) => { + builder.storeUint(0b01, 2); + builder.storeUint(msgAddressExt.len, 9); + builder.storeBits(msgAddressExt.external_address); + }) -} -; - throw new Error('') -; + } + throw new Error(''); } export function loadAnycast(slice: Slice): Anycast { - let depth: number = slice.loadUint(bitLen(30)) - -; - let rewrite_pfx: BitString = slice.loadBits(depth) - -; + let depth: number = slice.loadUint(bitLen(30)); + let rewrite_pfx: BitString = slice.loadBits(depth); if ((!(depth >= 1))) { - throw new Error('') -} -; + throw new Error(''); + } return { - kind: 'Anycast', - depth: depth, - rewrite_pfx: rewrite_pfx, -} + kind: 'Anycast', + depth: depth, + rewrite_pfx: rewrite_pfx, + } -; } export function storeAnycast(anycast: Anycast): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(anycast.depth, bitLen(30)) - - builder.storeBits(anycast.rewrite_pfx) - - if ((!(anycast.depth >= 1))) { - throw new Error('') - } - -}) + builder.storeUint(anycast.depth, bitLen(30)); + builder.storeBits(anycast.rewrite_pfx); + if ((!(anycast.depth >= 1))) { + throw new Error(''); + } + }) -; } export function loadMsgAddressInt(slice: Slice): MsgAddressInt { if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b10))) { - slice.loadUint(2) - let anycast: Maybe = loadMaybe(slice, loadAnycast) - - let workchain_id: number = slice.loadInt(8) - - let address: BitString = slice.loadBits(256) - - return { - kind: 'MsgAddressInt_addr_std', - anycast: anycast, - workchain_id: workchain_id, - address: address, -} + slice.loadUint(2); + let anycast: Maybe = loadMaybe(slice, loadAnycast); + let workchain_id: number = slice.loadInt(8); + let address: BitString = slice.loadBits(256); + return { + kind: 'MsgAddressInt_addr_std', + anycast: anycast, + workchain_id: workchain_id, + address: address, + } -} -; + } if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b11))) { - slice.loadUint(2) - let anycast: Maybe = loadMaybe(slice, loadAnycast) - - let addr_len: number = slice.loadUint(9) - - let workchain_id: number = slice.loadInt(32) - - let address: BitString = slice.loadBits(addr_len) - - return { - kind: 'MsgAddressInt_addr_var', - anycast: anycast, - addr_len: addr_len, - workchain_id: workchain_id, - address: address, -} + slice.loadUint(2); + let anycast: Maybe = loadMaybe(slice, loadAnycast); + let addr_len: number = slice.loadUint(9); + let workchain_id: number = slice.loadInt(32); + let address: BitString = slice.loadBits(addr_len); + return { + kind: 'MsgAddressInt_addr_var', + anycast: anycast, + addr_len: addr_len, + workchain_id: workchain_id, + address: address, + } -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeMsgAddressInt(msgAddressInt: MsgAddressInt): (builder: Builder) => void { if ((msgAddressInt.kind == 'MsgAddressInt_addr_std')) { - return ((builder: Builder) => { - builder.storeUint(0b10, 2) - - storeMaybe(msgAddressInt.anycast, storeAnycast)(builder) - - builder.storeInt(msgAddressInt.workchain_id, 8) - - builder.storeBits(msgAddressInt.address) - -}) + return ((builder: Builder) => { + builder.storeUint(0b10, 2); + storeMaybe(msgAddressInt.anycast, storeAnycast)(builder); + builder.storeInt(msgAddressInt.workchain_id, 8); + builder.storeBits(msgAddressInt.address); + }) -} -; + } if ((msgAddressInt.kind == 'MsgAddressInt_addr_var')) { - return ((builder: Builder) => { - builder.storeUint(0b11, 2) - - storeMaybe(msgAddressInt.anycast, storeAnycast)(builder) - - builder.storeUint(msgAddressInt.addr_len, 9) - - builder.storeInt(msgAddressInt.workchain_id, 32) - - builder.storeBits(msgAddressInt.address) - -}) + return ((builder: Builder) => { + builder.storeUint(0b11, 2); + storeMaybe(msgAddressInt.anycast, storeAnycast)(builder); + builder.storeUint(msgAddressInt.addr_len, 9); + builder.storeInt(msgAddressInt.workchain_id, 32); + builder.storeBits(msgAddressInt.address); + }) -} -; - throw new Error('') -; + } + throw new Error(''); } export function loadMsgAddress(slice: Slice): MsgAddress { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xef3a10fa))) { - slice.loadUint(32) - let _: MsgAddressInt = loadMsgAddressInt(slice) + slice.loadUint(32); + let _: MsgAddressInt = loadMsgAddressInt(slice); + return { + kind: 'MsgAddress__', + _: _, + } - return { - kind: 'MsgAddress__', - _: _, -} - -} -; + } if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xcf942fd1))) { - slice.loadUint(32) - let _: MsgAddressExt = loadMsgAddressExt(slice) - - return { - kind: 'MsgAddress__1', - _: _, -} + slice.loadUint(32); + let _: MsgAddressExt = loadMsgAddressExt(slice); + return { + kind: 'MsgAddress__1', + _: _, + } -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeMsgAddress(msgAddress: MsgAddress): (builder: Builder) => void { if ((msgAddress.kind == 'MsgAddress__')) { - return ((builder: Builder) => { - builder.storeUint(0xef3a10fa, 32) - - storeMsgAddressInt(msgAddress._)(builder) - -}) + return ((builder: Builder) => { + builder.storeUint(0xef3a10fa, 32); + storeMsgAddressInt(msgAddress._)(builder); + }) -} -; + } if ((msgAddress.kind == 'MsgAddress__1')) { - return ((builder: Builder) => { - builder.storeUint(0xcf942fd1, 32) - - storeMsgAddressExt(msgAddress._)(builder) - -}) + return ((builder: Builder) => { + builder.storeUint(0xcf942fd1, 32); + storeMsgAddressExt(msgAddress._)(builder); + }) -} -; - throw new Error('') -; + } + throw new Error(''); } export function loadVarUInteger(slice: Slice, n: number): VarUInteger { - let len: number = slice.loadUint(bitLen((n - 1))) - -; - let value: number = slice.loadUint((len * 8)) - -; + let len: number = slice.loadUint(bitLen((n - 1))); + let value: number = slice.loadUint((len * 8)); return { - kind: 'VarUInteger', - n: n, - len: len, - value: value, -} + kind: 'VarUInteger', + n: n, + len: len, + value: value, + } -; } export function storeVarUInteger(varUInteger: VarUInteger): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(varUInteger.len, bitLen((varUInteger.n - 1))) - - builder.storeUint(varUInteger.value, (varUInteger.len * 8)) - -}) + builder.storeUint(varUInteger.len, bitLen((varUInteger.n - 1))); + builder.storeUint(varUInteger.value, (varUInteger.len * 8)); + }) -; } export function loadVarInteger(slice: Slice, n: number): VarInteger { - let len: number = slice.loadUint(bitLen((n - 1))) - -; - let value: number = slice.loadInt((len * 8)) - -; + let len: number = slice.loadUint(bitLen((n - 1))); + let value: number = slice.loadInt((len * 8)); return { - kind: 'VarInteger', - n: n, - len: len, - value: value, -} + kind: 'VarInteger', + n: n, + len: len, + value: value, + } -; } export function storeVarInteger(varInteger: VarInteger): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(varInteger.len, bitLen((varInteger.n - 1))) - - builder.storeInt(varInteger.value, (varInteger.len * 8)) - -}) + builder.storeUint(varInteger.len, bitLen((varInteger.n - 1))); + builder.storeInt(varInteger.value, (varInteger.len * 8)); + }) -; } export function loadGrams(slice: Slice): Grams { - let amount: VarUInteger = loadVarUInteger(slice, 16) - -; + let amount: VarUInteger = loadVarUInteger(slice, 16); return { - kind: 'Grams', - amount: amount, -} + kind: 'Grams', + amount: amount, + } -; } export function storeGrams(grams: Grams): (builder: Builder) => void { return ((builder: Builder) => { - storeVarUInteger(grams.amount)(builder) - -}) + storeVarUInteger(grams.amount)(builder); + }) -; } export function loadExtraCurrencyCollection(slice: Slice): ExtraCurrencyCollection { let dict: HashmapE = loadHashmapE(slice, 32, ((slice: Slice) => { return loadVarUInteger(slice, 32) - }) -) - -; +); return { - kind: 'ExtraCurrencyCollection', - dict: dict, -} + kind: 'ExtraCurrencyCollection', + dict: dict, + } -; } export function storeExtraCurrencyCollection(extraCurrencyCollection: ExtraCurrencyCollection): (builder: Builder) => void { return ((builder: Builder) => { - storeHashmapE(extraCurrencyCollection.dict, ((arg: VarUInteger) => { + storeHashmapE(extraCurrencyCollection.dict, ((arg: VarUInteger) => { return ((builder: Builder) => { - storeVarUInteger(arg)(builder) - + storeVarUInteger(arg)(builder); }) - }) - )(builder) - -}) + )(builder); + }) -; } export function loadCurrencyCollection(slice: Slice): CurrencyCollection { - let grams: Grams = loadGrams(slice) - -; - let other: ExtraCurrencyCollection = loadExtraCurrencyCollection(slice) - -; + let grams: Grams = loadGrams(slice); + let other: ExtraCurrencyCollection = loadExtraCurrencyCollection(slice); return { - kind: 'CurrencyCollection', - grams: grams, - other: other, -} + kind: 'CurrencyCollection', + grams: grams, + other: other, + } -; } export function storeCurrencyCollection(currencyCollection: CurrencyCollection): (builder: Builder) => void { return ((builder: Builder) => { - storeGrams(currencyCollection.grams)(builder) - - storeExtraCurrencyCollection(currencyCollection.other)(builder) - -}) + storeGrams(currencyCollection.grams)(builder); + storeExtraCurrencyCollection(currencyCollection.other)(builder); + }) -; } export function loadCommonMsgInfo(slice: Slice): CommonMsgInfo { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1) - let ihr_disabled: Bool = loadBool(slice) + slice.loadUint(1); + let ihr_disabled: Bool = loadBool(slice); + let bounce: Bool = loadBool(slice); + let bounced: Bool = loadBool(slice); + let src: MsgAddressInt = loadMsgAddressInt(slice); + let dest: MsgAddressInt = loadMsgAddressInt(slice); + let value: CurrencyCollection = loadCurrencyCollection(slice); + let ihr_fee: Grams = loadGrams(slice); + let fwd_fee: Grams = loadGrams(slice); + let created_lt: number = slice.loadUint(64); + let created_at: number = slice.loadUint(32); + return { + kind: 'CommonMsgInfo_int_msg_info', + ihr_disabled: ihr_disabled, + bounce: bounce, + bounced: bounced, + src: src, + dest: dest, + value: value, + ihr_fee: ihr_fee, + fwd_fee: fwd_fee, + created_lt: created_lt, + created_at: created_at, + } - let bounce: Bool = loadBool(slice) + } + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b10))) { + slice.loadUint(2); + let src: MsgAddressExt = loadMsgAddressExt(slice); + let dest: MsgAddressInt = loadMsgAddressInt(slice); + let import_fee: Grams = loadGrams(slice); + return { + kind: 'CommonMsgInfo_ext_in_msg_info', + src: src, + dest: dest, + import_fee: import_fee, + } - let bounced: Bool = loadBool(slice) + } + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b11))) { + slice.loadUint(2); + let src: MsgAddressInt = loadMsgAddressInt(slice); + let dest: MsgAddressExt = loadMsgAddressExt(slice); + let created_lt: number = slice.loadUint(64); + let created_at: number = slice.loadUint(32); + return { + kind: 'CommonMsgInfo_ext_out_msg_info', + src: src, + dest: dest, + created_lt: created_lt, + created_at: created_at, + } - let src: MsgAddressInt = loadMsgAddressInt(slice) + } + throw new Error(''); +} - let dest: MsgAddressInt = loadMsgAddressInt(slice) +export function storeCommonMsgInfo(commonMsgInfo: CommonMsgInfo): (builder: Builder) => void { + if ((commonMsgInfo.kind == 'CommonMsgInfo_int_msg_info')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1); + storeBool(commonMsgInfo.ihr_disabled)(builder); + storeBool(commonMsgInfo.bounce)(builder); + storeBool(commonMsgInfo.bounced)(builder); + storeMsgAddressInt(commonMsgInfo.src)(builder); + storeMsgAddressInt(commonMsgInfo.dest)(builder); + storeCurrencyCollection(commonMsgInfo.value)(builder); + storeGrams(commonMsgInfo.ihr_fee)(builder); + storeGrams(commonMsgInfo.fwd_fee)(builder); + builder.storeUint(commonMsgInfo.created_lt, 64); + builder.storeUint(commonMsgInfo.created_at, 32); + }) - let value: CurrencyCollection = loadCurrencyCollection(slice) + } + if ((commonMsgInfo.kind == 'CommonMsgInfo_ext_in_msg_info')) { + return ((builder: Builder) => { + builder.storeUint(0b10, 2); + storeMsgAddressExt(commonMsgInfo.src)(builder); + storeMsgAddressInt(commonMsgInfo.dest)(builder); + storeGrams(commonMsgInfo.import_fee)(builder); + }) - let ihr_fee: Grams = loadGrams(slice) + } + if ((commonMsgInfo.kind == 'CommonMsgInfo_ext_out_msg_info')) { + return ((builder: Builder) => { + builder.storeUint(0b11, 2); + storeMsgAddressInt(commonMsgInfo.src)(builder); + storeMsgAddressExt(commonMsgInfo.dest)(builder); + builder.storeUint(commonMsgInfo.created_lt, 64); + builder.storeUint(commonMsgInfo.created_at, 32); + }) - let fwd_fee: Grams = loadGrams(slice) + } + throw new Error(''); +} - let created_lt: number = slice.loadUint(64) +export function loadCommonMsgInfoRelaxed(slice: Slice): CommonMsgInfoRelaxed { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { + slice.loadUint(1); + let ihr_disabled: Bool = loadBool(slice); + let bounce: Bool = loadBool(slice); + let bounced: Bool = loadBool(slice); + let src: MsgAddress = loadMsgAddress(slice); + let dest: MsgAddressInt = loadMsgAddressInt(slice); + let value: CurrencyCollection = loadCurrencyCollection(slice); + let ihr_fee: Grams = loadGrams(slice); + let fwd_fee: Grams = loadGrams(slice); + let created_lt: number = slice.loadUint(64); + let created_at: number = slice.loadUint(32); + return { + kind: 'CommonMsgInfoRelaxed_int_msg_info', + ihr_disabled: ihr_disabled, + bounce: bounce, + bounced: bounced, + src: src, + dest: dest, + value: value, + ihr_fee: ihr_fee, + fwd_fee: fwd_fee, + created_lt: created_lt, + created_at: created_at, + } - let created_at: number = slice.loadUint(32) + } + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b11))) { + slice.loadUint(2); + let src: MsgAddress = loadMsgAddress(slice); + let dest: MsgAddressExt = loadMsgAddressExt(slice); + let created_lt: number = slice.loadUint(64); + let created_at: number = slice.loadUint(32); + return { + kind: 'CommonMsgInfoRelaxed_ext_out_msg_info', + src: src, + dest: dest, + created_lt: created_lt, + created_at: created_at, + } - return { - kind: 'CommonMsgInfo_int_msg_info', - ihr_disabled: ihr_disabled, - bounce: bounce, - bounced: bounced, - src: src, - dest: dest, - value: value, - ihr_fee: ihr_fee, - fwd_fee: fwd_fee, - created_lt: created_lt, - created_at: created_at, + } + throw new Error(''); } -} -; - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b10))) { - slice.loadUint(2) - let src: MsgAddressExt = loadMsgAddressExt(slice) +export function storeCommonMsgInfoRelaxed(commonMsgInfoRelaxed: CommonMsgInfoRelaxed): (builder: Builder) => void { + if ((commonMsgInfoRelaxed.kind == 'CommonMsgInfoRelaxed_int_msg_info')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1); + storeBool(commonMsgInfoRelaxed.ihr_disabled)(builder); + storeBool(commonMsgInfoRelaxed.bounce)(builder); + storeBool(commonMsgInfoRelaxed.bounced)(builder); + storeMsgAddress(commonMsgInfoRelaxed.src)(builder); + storeMsgAddressInt(commonMsgInfoRelaxed.dest)(builder); + storeCurrencyCollection(commonMsgInfoRelaxed.value)(builder); + storeGrams(commonMsgInfoRelaxed.ihr_fee)(builder); + storeGrams(commonMsgInfoRelaxed.fwd_fee)(builder); + builder.storeUint(commonMsgInfoRelaxed.created_lt, 64); + builder.storeUint(commonMsgInfoRelaxed.created_at, 32); + }) - let dest: MsgAddressInt = loadMsgAddressInt(slice) + } + if ((commonMsgInfoRelaxed.kind == 'CommonMsgInfoRelaxed_ext_out_msg_info')) { + return ((builder: Builder) => { + builder.storeUint(0b11, 2); + storeMsgAddress(commonMsgInfoRelaxed.src)(builder); + storeMsgAddressExt(commonMsgInfoRelaxed.dest)(builder); + builder.storeUint(commonMsgInfoRelaxed.created_lt, 64); + builder.storeUint(commonMsgInfoRelaxed.created_at, 32); + }) - let import_fee: Grams = loadGrams(slice) + } + throw new Error(''); +} +export function loadTickTock(slice: Slice): TickTock { + let tick: Bool = loadBool(slice); + let tock: Bool = loadBool(slice); return { - kind: 'CommonMsgInfo_ext_in_msg_info', - src: src, - dest: dest, - import_fee: import_fee, -} + kind: 'TickTock', + tick: tick, + tock: tock, + } } -; - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b11))) { - slice.loadUint(2) - let src: MsgAddressInt = loadMsgAddressInt(slice) - - let dest: MsgAddressExt = loadMsgAddressExt(slice) - let created_lt: number = slice.loadUint(64) - - let created_at: number = slice.loadUint(32) +export function storeTickTock(tickTock: TickTock): (builder: Builder) => void { + return ((builder: Builder) => { + storeBool(tickTock.tick)(builder); + storeBool(tickTock.tock)(builder); + }) - return { - kind: 'CommonMsgInfo_ext_out_msg_info', - src: src, - dest: dest, - created_lt: created_lt, - created_at: created_at, } -} -; - throw new Error('') -; +export function loadStateInit(slice: Slice): StateInit { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x91231967))) { + slice.loadUint(32); + let split_depth: Maybe = loadMaybe(slice, ((slice: Slice) => { + return slice.loadUint(5) +}) +); + let special: Maybe = loadMaybe(slice, loadTickTock); + let code: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse(); + return slice1 +}) +); + let data: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse(); + return slice1 +}) +); + let library: HashmapE = loadHashmapE(slice, 256, loadSimpleLib); + return { + kind: 'StateInit', + split_depth: split_depth, + special: special, + code: code, + data: data, + library: library, + } + + } + throw new Error(''); } -export function storeCommonMsgInfo(commonMsgInfo: CommonMsgInfo): (builder: Builder) => void { - if ((commonMsgInfo.kind == 'CommonMsgInfo_int_msg_info')) { +export function storeStateInit(stateInit: StateInit): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0b0, 1) - - storeBool(commonMsgInfo.ihr_disabled)(builder) - - storeBool(commonMsgInfo.bounce)(builder) - - storeBool(commonMsgInfo.bounced)(builder) - - storeMsgAddressInt(commonMsgInfo.src)(builder) - - storeMsgAddressInt(commonMsgInfo.dest)(builder) - - storeCurrencyCollection(commonMsgInfo.value)(builder) - - storeGrams(commonMsgInfo.ihr_fee)(builder) - - storeGrams(commonMsgInfo.fwd_fee)(builder) - - builder.storeUint(commonMsgInfo.created_lt, 64) - - builder.storeUint(commonMsgInfo.created_at, 32) - -}) - -} -; - if ((commonMsgInfo.kind == 'CommonMsgInfo_ext_in_msg_info')) { - return ((builder: Builder) => { - builder.storeUint(0b10, 2) - - storeMsgAddressExt(commonMsgInfo.src)(builder) - - storeMsgAddressInt(commonMsgInfo.dest)(builder) - - storeGrams(commonMsgInfo.import_fee)(builder) - -}) - -} -; - if ((commonMsgInfo.kind == 'CommonMsgInfo_ext_out_msg_info')) { - return ((builder: Builder) => { - builder.storeUint(0b11, 2) - - storeMsgAddressInt(commonMsgInfo.src)(builder) - - storeMsgAddressExt(commonMsgInfo.dest)(builder) - - builder.storeUint(commonMsgInfo.created_lt, 64) - - builder.storeUint(commonMsgInfo.created_at, 32) - -}) - -} -; - throw new Error('') -; -} - -export function loadCommonMsgInfoRelaxed(slice: Slice): CommonMsgInfoRelaxed { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1) - let ihr_disabled: Bool = loadBool(slice) - - let bounce: Bool = loadBool(slice) - - let bounced: Bool = loadBool(slice) - - let src: MsgAddress = loadMsgAddress(slice) - - let dest: MsgAddressInt = loadMsgAddressInt(slice) - - let value: CurrencyCollection = loadCurrencyCollection(slice) - - let ihr_fee: Grams = loadGrams(slice) - - let fwd_fee: Grams = loadGrams(slice) - - let created_lt: number = slice.loadUint(64) - - let created_at: number = slice.loadUint(32) - - return { - kind: 'CommonMsgInfoRelaxed_int_msg_info', - ihr_disabled: ihr_disabled, - bounce: bounce, - bounced: bounced, - src: src, - dest: dest, - value: value, - ihr_fee: ihr_fee, - fwd_fee: fwd_fee, - created_lt: created_lt, - created_at: created_at, -} - -} -; - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b11))) { - slice.loadUint(2) - let src: MsgAddress = loadMsgAddress(slice) - - let dest: MsgAddressExt = loadMsgAddressExt(slice) - - let created_lt: number = slice.loadUint(64) - - let created_at: number = slice.loadUint(32) - - return { - kind: 'CommonMsgInfoRelaxed_ext_out_msg_info', - src: src, - dest: dest, - created_lt: created_lt, - created_at: created_at, -} - -} -; - throw new Error('') -; -} - -export function storeCommonMsgInfoRelaxed(commonMsgInfoRelaxed: CommonMsgInfoRelaxed): (builder: Builder) => void { - if ((commonMsgInfoRelaxed.kind == 'CommonMsgInfoRelaxed_int_msg_info')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1) - - storeBool(commonMsgInfoRelaxed.ihr_disabled)(builder) - - storeBool(commonMsgInfoRelaxed.bounce)(builder) - - storeBool(commonMsgInfoRelaxed.bounced)(builder) - - storeMsgAddress(commonMsgInfoRelaxed.src)(builder) - - storeMsgAddressInt(commonMsgInfoRelaxed.dest)(builder) - - storeCurrencyCollection(commonMsgInfoRelaxed.value)(builder) - - storeGrams(commonMsgInfoRelaxed.ihr_fee)(builder) - - storeGrams(commonMsgInfoRelaxed.fwd_fee)(builder) - - builder.storeUint(commonMsgInfoRelaxed.created_lt, 64) - - builder.storeUint(commonMsgInfoRelaxed.created_at, 32) - -}) - -} -; - if ((commonMsgInfoRelaxed.kind == 'CommonMsgInfoRelaxed_ext_out_msg_info')) { - return ((builder: Builder) => { - builder.storeUint(0b11, 2) - - storeMsgAddress(commonMsgInfoRelaxed.src)(builder) - - storeMsgAddressExt(commonMsgInfoRelaxed.dest)(builder) - - builder.storeUint(commonMsgInfoRelaxed.created_lt, 64) - - builder.storeUint(commonMsgInfoRelaxed.created_at, 32) - -}) - -} -; - throw new Error('') -; -} - -export function loadTickTock(slice: Slice): TickTock { - let tick: Bool = loadBool(slice) - -; - let tock: Bool = loadBool(slice) - -; - return { - kind: 'TickTock', - tick: tick, - tock: tock, -} - -; -} - -export function storeTickTock(tickTock: TickTock): (builder: Builder) => void { - return ((builder: Builder) => { - storeBool(tickTock.tick)(builder) - - storeBool(tickTock.tock)(builder) - -}) - -; -} - -export function loadStateInit(slice: Slice): StateInit { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x91231967))) { - slice.loadUint(32) - let split_depth: Maybe = loadMaybe(slice, ((slice: Slice) => { - return slice.loadUint(5) - -}) -) - - let special: Maybe = loadMaybe(slice, loadTickTock) - - let code: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() - - - return slice1 - -}) -) - - let data: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() - - - return slice1 - -}) -) - - let library: HashmapE = loadHashmapE(slice, 256, loadSimpleLib) - - return { - kind: 'StateInit', - split_depth: split_depth, - special: special, - code: code, - data: data, - library: library, -} - -} -; - throw new Error('') -; -} - -export function storeStateInit(stateInit: StateInit): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x91231967, 32) - - storeMaybe(stateInit.split_depth, ((arg: number) => { + builder.storeUint(0x91231967, 32); + storeMaybe(stateInit.split_depth, ((arg: number) => { return ((builder: Builder) => { - builder.storeUint(arg, 5) - + builder.storeUint(arg, 5); }) - }) - )(builder) - - storeMaybe(stateInit.special, storeTickTock)(builder) - - storeMaybe(stateInit.code, ((arg: Slice) => { + )(builder); + storeMaybe(stateInit.special, storeTickTock)(builder); + storeMaybe(stateInit.code, ((arg: Slice) => { return ((builder: Builder) => { - let cell1 = beginCell() - + let cell1 = beginCell(); - cell1.storeSlice(arg) - - builder.storeRef(cell1) + cell1.storeSlice(arg); + builder.storeRef(cell1); }) - }) - )(builder) - - storeMaybe(stateInit.data, ((arg: Slice) => { + )(builder); + storeMaybe(stateInit.data, ((arg: Slice) => { return ((builder: Builder) => { - let cell1 = beginCell() - + let cell1 = beginCell(); - cell1.storeSlice(arg) - - builder.storeRef(cell1) + cell1.storeSlice(arg); + builder.storeRef(cell1); }) - }) - )(builder) - - storeHashmapE(stateInit.library, storeSimpleLib)(builder) - -}) + )(builder); + storeHashmapE(stateInit.library, storeSimpleLib)(builder); + }) -; } export function loadSimpleLib(slice: Slice): SimpleLib { - let public0: Bool = loadBool(slice) - -; - let slice1 = slice.loadRef().beginParse() - -; - let root: Slice = slice1 - -; + let public0: Bool = loadBool(slice); + let slice1 = slice.loadRef().beginParse(); + let root: Slice = slice1; return { - kind: 'SimpleLib', - public0: public0, - root: root, -} + kind: 'SimpleLib', + public0: public0, + root: root, + } -; } export function storeSimpleLib(simpleLib: SimpleLib): (builder: Builder) => void { return ((builder: Builder) => { - storeBool(simpleLib.public0)(builder) - - let cell1 = beginCell() - - - cell1.storeSlice(simpleLib.root) - - builder.storeRef(cell1) - -}) + storeBool(simpleLib.public0)(builder); + let cell1 = beginCell(); + cell1.storeSlice(simpleLib.root); + builder.storeRef(cell1); + }) -; } export function loadMessage(slice: Slice, loadX: (slice: Slice) => X ): Message { - let info: CommonMsgInfo = loadCommonMsgInfo(slice) - -; + let info: CommonMsgInfo = loadCommonMsgInfo(slice); let init: Maybe> = loadMaybe>(slice, ((slice: Slice) => { return loadEither(slice, loadStateInit, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() - - + let slice1 = slice.loadRef().beginParse(); return loadStateInit(slice1) - }) ) - }) -) - -; +); let body: Either = loadEither(slice, loadX, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() - - + let slice1 = slice.loadRef().beginParse(); return loadX(slice1) - }) -) - -; +); return { - kind: 'Message', - info: info, - init: init, - body: body, -} + kind: 'Message', + info: info, + init: init, + body: body, + } -; } export function storeMessage(message: Message, storeX: (x: X) => (builder: Builder) => void ): (builder: Builder) => void { return ((builder: Builder) => { - storeCommonMsgInfo(message.info)(builder) - - storeMaybe>(message.init, ((arg: Either) => { + storeCommonMsgInfo(message.info)(builder); + storeMaybe>(message.init, ((arg: Either) => { return ((builder: Builder) => { storeEither(arg, storeStateInit, ((arg: StateInit) => { - return ((builder: Builder) => { - let cell1 = beginCell() + return ((builder: Builder) => { + let cell1 = beginCell(); + storeStateInit(arg)(cell1); - storeStateInit(arg)(cell1) - - builder.storeRef(cell1) - - - }) - + builder.storeRef(cell1); }) - )(builder) }) - + )(builder); + }) }) - )(builder) - - storeEither(message.body, storeX, ((arg: X) => { + )(builder); + storeEither(message.body, storeX, ((arg: X) => { return ((builder: Builder) => { - let cell1 = beginCell() + let cell1 = beginCell(); + storeX(arg)(cell1); - storeX(arg)(cell1) - - builder.storeRef(cell1) - + builder.storeRef(cell1); }) - }) - )(builder) - -}) + )(builder); + }) -; } export function loadMessageRelaxed(slice: Slice, loadX: (slice: Slice) => X ): MessageRelaxed { - let info: CommonMsgInfoRelaxed = loadCommonMsgInfoRelaxed(slice) - -; + let info: CommonMsgInfoRelaxed = loadCommonMsgInfoRelaxed(slice); let init: Maybe> = loadMaybe>(slice, ((slice: Slice) => { return loadEither(slice, loadStateInit, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() - - + let slice1 = slice.loadRef().beginParse(); return loadStateInit(slice1) - }) ) - }) -) - -; +); let body: Either = loadEither(slice, loadX, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() - - + let slice1 = slice.loadRef().beginParse(); return loadX(slice1) - }) -) - -; +); return { - kind: 'MessageRelaxed', - info: info, - init: init, - body: body, -} + kind: 'MessageRelaxed', + info: info, + init: init, + body: body, + } -; } export function storeMessageRelaxed(messageRelaxed: MessageRelaxed, storeX: (x: X) => (builder: Builder) => void ): (builder: Builder) => void { return ((builder: Builder) => { - storeCommonMsgInfoRelaxed(messageRelaxed.info)(builder) - - storeMaybe>(messageRelaxed.init, ((arg: Either) => { + storeCommonMsgInfoRelaxed(messageRelaxed.info)(builder); + storeMaybe>(messageRelaxed.init, ((arg: Either) => { return ((builder: Builder) => { storeEither(arg, storeStateInit, ((arg: StateInit) => { - return ((builder: Builder) => { - let cell1 = beginCell() - - - storeStateInit(arg)(cell1) - - builder.storeRef(cell1) - + return ((builder: Builder) => { + let cell1 = beginCell(); - }) + storeStateInit(arg)(cell1); + builder.storeRef(cell1); }) - )(builder) }) - + )(builder); + }) }) - )(builder) - - storeEither(messageRelaxed.body, storeX, ((arg: X) => { + )(builder); + storeEither(messageRelaxed.body, storeX, ((arg: X) => { return ((builder: Builder) => { - let cell1 = beginCell() + let cell1 = beginCell(); + storeX(arg)(cell1); - storeX(arg)(cell1) - - builder.storeRef(cell1) - + builder.storeRef(cell1); }) - }) - )(builder) - -}) + )(builder); + }) -; } export function loadMessageAny(slice: Slice): MessageAny { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x9c54aa4b))) { - slice.loadUint(32) - let anon0: Message = loadMessage(slice, ((slice: Slice) => { + slice.loadUint(32); + let anon0: Message = loadMessage(slice, ((slice: Slice) => { return slice - }) -) - - return { - kind: 'MessageAny', - anon0: anon0, -} +); + return { + kind: 'MessageAny', + anon0: anon0, + } -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeMessageAny(messageAny: MessageAny): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0x9c54aa4b, 32) - - storeMessage(messageAny.anon0, ((arg: Slice) => { + builder.storeUint(0x9c54aa4b, 32); + storeMessage(messageAny.anon0, ((arg: Slice) => { return ((builder: Builder) => { - builder.storeSlice(arg) - + builder.storeSlice(arg); }) - }) - )(builder) - -}) + )(builder); + }) -; } export function loadIntermediateAddress(slice: Slice): IntermediateAddress { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1) - let use_dest_bits: number = slice.loadUint(bitLen(96)) - - return { - kind: 'IntermediateAddress_interm_addr_regular', - use_dest_bits: use_dest_bits, -} + slice.loadUint(1); + let use_dest_bits: number = slice.loadUint(bitLen(96)); + return { + kind: 'IntermediateAddress_interm_addr_regular', + use_dest_bits: use_dest_bits, + } -} -; + } if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b10))) { - slice.loadUint(2) - let workchain_id: number = slice.loadInt(8) - - let addr_pfx: number = slice.loadUint(64) + slice.loadUint(2); + let workchain_id: number = slice.loadInt(8); + let addr_pfx: number = slice.loadUint(64); + return { + kind: 'IntermediateAddress_interm_addr_simple', + workchain_id: workchain_id, + addr_pfx: addr_pfx, + } - return { - kind: 'IntermediateAddress_interm_addr_simple', - workchain_id: workchain_id, - addr_pfx: addr_pfx, -} - -} -; + } if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b11))) { - slice.loadUint(2) - let workchain_id: number = slice.loadInt(32) - - let addr_pfx: number = slice.loadUint(64) - - return { - kind: 'IntermediateAddress_interm_addr_ext', - workchain_id: workchain_id, - addr_pfx: addr_pfx, -} + slice.loadUint(2); + let workchain_id: number = slice.loadInt(32); + let addr_pfx: number = slice.loadUint(64); + return { + kind: 'IntermediateAddress_interm_addr_ext', + workchain_id: workchain_id, + addr_pfx: addr_pfx, + } -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeIntermediateAddress(intermediateAddress: IntermediateAddress): (builder: Builder) => void { if ((intermediateAddress.kind == 'IntermediateAddress_interm_addr_regular')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1) - - builder.storeUint(intermediateAddress.use_dest_bits, bitLen(96)) - -}) + return ((builder: Builder) => { + builder.storeUint(0b0, 1); + builder.storeUint(intermediateAddress.use_dest_bits, bitLen(96)); + }) -} -; + } if ((intermediateAddress.kind == 'IntermediateAddress_interm_addr_simple')) { - return ((builder: Builder) => { - builder.storeUint(0b10, 2) - - builder.storeInt(intermediateAddress.workchain_id, 8) - - builder.storeUint(intermediateAddress.addr_pfx, 64) - -}) + return ((builder: Builder) => { + builder.storeUint(0b10, 2); + builder.storeInt(intermediateAddress.workchain_id, 8); + builder.storeUint(intermediateAddress.addr_pfx, 64); + }) -} -; + } if ((intermediateAddress.kind == 'IntermediateAddress_interm_addr_ext')) { - return ((builder: Builder) => { - builder.storeUint(0b11, 2) - - builder.storeInt(intermediateAddress.workchain_id, 32) - - builder.storeUint(intermediateAddress.addr_pfx, 64) - -}) + return ((builder: Builder) => { + builder.storeUint(0b11, 2); + builder.storeInt(intermediateAddress.workchain_id, 32); + builder.storeUint(intermediateAddress.addr_pfx, 64); + }) -} -; - throw new Error('') -; + } + throw new Error(''); } export function loadMsgEnvelope(slice: Slice): MsgEnvelope { if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0x4))) { - slice.loadUint(4) - let cur_addr: IntermediateAddress = loadIntermediateAddress(slice) - - let next_addr: IntermediateAddress = loadIntermediateAddress(slice) - - let fwd_fee_remaining: Grams = loadGrams(slice) - - let slice1 = slice.loadRef().beginParse() - - let msg: Message = loadMessage(slice1, ((slice: Slice) => { + slice.loadUint(4); + let cur_addr: IntermediateAddress = loadIntermediateAddress(slice); + let next_addr: IntermediateAddress = loadIntermediateAddress(slice); + let fwd_fee_remaining: Grams = loadGrams(slice); + let slice1 = slice.loadRef().beginParse(); + let msg: Message = loadMessage(slice1, ((slice: Slice) => { return slice - }) -) - - return { - kind: 'MsgEnvelope', - cur_addr: cur_addr, - next_addr: next_addr, - fwd_fee_remaining: fwd_fee_remaining, - msg: msg, -} +); + return { + kind: 'MsgEnvelope', + cur_addr: cur_addr, + next_addr: next_addr, + fwd_fee_remaining: fwd_fee_remaining, + msg: msg, + } -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeMsgEnvelope(msgEnvelope: MsgEnvelope): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0x4, 4) - - storeIntermediateAddress(msgEnvelope.cur_addr)(builder) - - storeIntermediateAddress(msgEnvelope.next_addr)(builder) - - storeGrams(msgEnvelope.fwd_fee_remaining)(builder) - - let cell1 = beginCell() - - - storeMessage(msgEnvelope.msg, ((arg: Slice) => { + builder.storeUint(0x4, 4); + storeIntermediateAddress(msgEnvelope.cur_addr)(builder); + storeIntermediateAddress(msgEnvelope.next_addr)(builder); + storeGrams(msgEnvelope.fwd_fee_remaining)(builder); + let cell1 = beginCell(); + storeMessage(msgEnvelope.msg, ((arg: Slice) => { return ((builder: Builder) => { - cell1.storeSlice(arg) - + cell1.storeSlice(arg); }) - }) - )(cell1) - - builder.storeRef(cell1) - -}) + )(cell1); + builder.storeRef(cell1); + }) -; } export function loadInMsg(slice: Slice): InMsg { if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b000))) { - slice.loadUint(3) - let slice1 = slice.loadRef().beginParse() - - let msg: Message = loadMessage(slice1, ((slice: Slice) => { + slice.loadUint(3); + let slice1 = slice.loadRef().beginParse(); + let msg: Message = loadMessage(slice1, ((slice: Slice) => { return slice - }) -) - - let slice2 = slice.loadRef().beginParse() - - let transaction: Transaction = loadTransaction(slice2) - - return { - kind: 'InMsg_msg_import_ext', - msg: msg, - transaction: transaction, -} +); + let slice2 = slice.loadRef().beginParse(); + let transaction: Transaction = loadTransaction(slice2); + return { + kind: 'InMsg_msg_import_ext', + msg: msg, + transaction: transaction, + } -} -; + } if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b010))) { - slice.loadUint(3) - let slice1 = slice.loadRef().beginParse() - - let msg: Message = loadMessage(slice1, ((slice: Slice) => { + slice.loadUint(3); + let slice1 = slice.loadRef().beginParse(); + let msg: Message = loadMessage(slice1, ((slice: Slice) => { return slice - }) -) +); + let slice2 = slice.loadRef().beginParse(); + let transaction: Transaction = loadTransaction(slice2); + let ihr_fee: Grams = loadGrams(slice); + let slice3 = slice.loadRef().beginParse(); + let proof_created: Slice = slice3; + return { + kind: 'InMsg_msg_import_ihr', + msg: msg, + transaction: transaction, + ihr_fee: ihr_fee, + proof_created: proof_created, + } - let slice2 = slice.loadRef().beginParse() - - let transaction: Transaction = loadTransaction(slice2) + } + if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b011))) { + slice.loadUint(3); + let slice1 = slice.loadRef().beginParse(); + let in_msg: MsgEnvelope = loadMsgEnvelope(slice1); + let slice2 = slice.loadRef().beginParse(); + let transaction: Transaction = loadTransaction(slice2); + let fwd_fee: Grams = loadGrams(slice); + return { + kind: 'InMsg_msg_import_imm', + in_msg: in_msg, + transaction: transaction, + fwd_fee: fwd_fee, + } - let ihr_fee: Grams = loadGrams(slice) + } + if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b100))) { + slice.loadUint(3); + let slice1 = slice.loadRef().beginParse(); + let in_msg: MsgEnvelope = loadMsgEnvelope(slice1); + let slice2 = slice.loadRef().beginParse(); + let transaction: Transaction = loadTransaction(slice2); + let fwd_fee: Grams = loadGrams(slice); + return { + kind: 'InMsg_msg_import_fin', + in_msg: in_msg, + transaction: transaction, + fwd_fee: fwd_fee, + } - let slice3 = slice.loadRef().beginParse() + } + if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b101))) { + slice.loadUint(3); + let slice1 = slice.loadRef().beginParse(); + let in_msg: MsgEnvelope = loadMsgEnvelope(slice1); + let slice2 = slice.loadRef().beginParse(); + let out_msg: MsgEnvelope = loadMsgEnvelope(slice2); + let transit_fee: Grams = loadGrams(slice); + return { + kind: 'InMsg_msg_import_tr', + in_msg: in_msg, + out_msg: out_msg, + transit_fee: transit_fee, + } - let proof_created: Slice = slice3 + } + if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b110))) { + slice.loadUint(3); + let slice1 = slice.loadRef().beginParse(); + let in_msg: MsgEnvelope = loadMsgEnvelope(slice1); + let transaction_id: number = slice.loadUint(64); + let fwd_fee: Grams = loadGrams(slice); + return { + kind: 'InMsg_msg_discard_fin', + in_msg: in_msg, + transaction_id: transaction_id, + fwd_fee: fwd_fee, + } - return { - kind: 'InMsg_msg_import_ihr', - msg: msg, - transaction: transaction, - ihr_fee: ihr_fee, - proof_created: proof_created, -} + } + if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b111))) { + slice.loadUint(3); + let slice1 = slice.loadRef().beginParse(); + let in_msg: MsgEnvelope = loadMsgEnvelope(slice1); + let transaction_id: number = slice.loadUint(64); + let fwd_fee: Grams = loadGrams(slice); + let slice2 = slice.loadRef().beginParse(); + let proof_delivered: Slice = slice2; + return { + kind: 'InMsg_msg_discard_tr', + in_msg: in_msg, + transaction_id: transaction_id, + fwd_fee: fwd_fee, + proof_delivered: proof_delivered, + } + } + throw new Error(''); } -; - if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b011))) { - slice.loadUint(3) - let slice1 = slice.loadRef().beginParse() - let in_msg: MsgEnvelope = loadMsgEnvelope(slice1) +export function storeInMsg(inMsg: InMsg): (builder: Builder) => void { + if ((inMsg.kind == 'InMsg_msg_import_ext')) { + return ((builder: Builder) => { + builder.storeUint(0b000, 3); + let cell1 = beginCell(); + storeMessage(inMsg.msg, ((arg: Slice) => { + return ((builder: Builder) => { + cell1.storeSlice(arg); + }) - let slice2 = slice.loadRef().beginParse() + }) + )(cell1); + builder.storeRef(cell1); + let cell2 = beginCell(); + storeTransaction(inMsg.transaction)(cell2); + builder.storeRef(cell2); + }) - let transaction: Transaction = loadTransaction(slice2) + } + if ((inMsg.kind == 'InMsg_msg_import_ihr')) { + return ((builder: Builder) => { + builder.storeUint(0b010, 3); + let cell1 = beginCell(); + storeMessage(inMsg.msg, ((arg: Slice) => { + return ((builder: Builder) => { + cell1.storeSlice(arg); + }) - let fwd_fee: Grams = loadGrams(slice) + }) + )(cell1); + builder.storeRef(cell1); + let cell2 = beginCell(); + storeTransaction(inMsg.transaction)(cell2); + builder.storeRef(cell2); + storeGrams(inMsg.ihr_fee)(builder); + let cell3 = beginCell(); + cell3.storeSlice(inMsg.proof_created); + builder.storeRef(cell3); + }) - return { - kind: 'InMsg_msg_import_imm', - in_msg: in_msg, - transaction: transaction, - fwd_fee: fwd_fee, -} + } + if ((inMsg.kind == 'InMsg_msg_import_imm')) { + return ((builder: Builder) => { + builder.storeUint(0b011, 3); + let cell1 = beginCell(); + storeMsgEnvelope(inMsg.in_msg)(cell1); + builder.storeRef(cell1); + let cell2 = beginCell(); + storeTransaction(inMsg.transaction)(cell2); + builder.storeRef(cell2); + storeGrams(inMsg.fwd_fee)(builder); + }) -} -; - if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b100))) { - slice.loadUint(3) - let slice1 = slice.loadRef().beginParse() + } + if ((inMsg.kind == 'InMsg_msg_import_fin')) { + return ((builder: Builder) => { + builder.storeUint(0b100, 3); + let cell1 = beginCell(); + storeMsgEnvelope(inMsg.in_msg)(cell1); + builder.storeRef(cell1); + let cell2 = beginCell(); + storeTransaction(inMsg.transaction)(cell2); + builder.storeRef(cell2); + storeGrams(inMsg.fwd_fee)(builder); + }) - let in_msg: MsgEnvelope = loadMsgEnvelope(slice1) + } + if ((inMsg.kind == 'InMsg_msg_import_tr')) { + return ((builder: Builder) => { + builder.storeUint(0b101, 3); + let cell1 = beginCell(); + storeMsgEnvelope(inMsg.in_msg)(cell1); + builder.storeRef(cell1); + let cell2 = beginCell(); + storeMsgEnvelope(inMsg.out_msg)(cell2); + builder.storeRef(cell2); + storeGrams(inMsg.transit_fee)(builder); + }) - let slice2 = slice.loadRef().beginParse() + } + if ((inMsg.kind == 'InMsg_msg_discard_fin')) { + return ((builder: Builder) => { + builder.storeUint(0b110, 3); + let cell1 = beginCell(); + storeMsgEnvelope(inMsg.in_msg)(cell1); + builder.storeRef(cell1); + builder.storeUint(inMsg.transaction_id, 64); + storeGrams(inMsg.fwd_fee)(builder); + }) - let transaction: Transaction = loadTransaction(slice2) + } + if ((inMsg.kind == 'InMsg_msg_discard_tr')) { + return ((builder: Builder) => { + builder.storeUint(0b111, 3); + let cell1 = beginCell(); + storeMsgEnvelope(inMsg.in_msg)(cell1); + builder.storeRef(cell1); + builder.storeUint(inMsg.transaction_id, 64); + storeGrams(inMsg.fwd_fee)(builder); + let cell2 = beginCell(); + cell2.storeSlice(inMsg.proof_delivered); + builder.storeRef(cell2); + }) - let fwd_fee: Grams = loadGrams(slice) + } + throw new Error(''); +} +export function loadImportFees(slice: Slice): ImportFees { + let fees_collected: Grams = loadGrams(slice); + let value_imported: CurrencyCollection = loadCurrencyCollection(slice); return { - kind: 'InMsg_msg_import_fin', - in_msg: in_msg, - transaction: transaction, - fwd_fee: fwd_fee, -} + kind: 'ImportFees', + fees_collected: fees_collected, + value_imported: value_imported, + } } -; - if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b101))) { - slice.loadUint(3) - let slice1 = slice.loadRef().beginParse() - - let in_msg: MsgEnvelope = loadMsgEnvelope(slice1) - let slice2 = slice.loadRef().beginParse() - - let out_msg: MsgEnvelope = loadMsgEnvelope(slice2) - - let transit_fee: Grams = loadGrams(slice) +export function storeImportFees(importFees: ImportFees): (builder: Builder) => void { + return ((builder: Builder) => { + storeGrams(importFees.fees_collected)(builder); + storeCurrencyCollection(importFees.value_imported)(builder); + }) - return { - kind: 'InMsg_msg_import_tr', - in_msg: in_msg, - out_msg: out_msg, - transit_fee: transit_fee, } +export function loadInMsgDescr(slice: Slice): InMsgDescr { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x8615b8fd))) { + slice.loadUint(32); + let anon0: HashmapAugE = loadHashmapAugE(slice, 256, loadInMsg, loadImportFees); + return { + kind: 'InMsgDescr', + anon0: anon0, + } + + } + throw new Error(''); } -; - if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b110))) { - slice.loadUint(3) - let slice1 = slice.loadRef().beginParse() - let in_msg: MsgEnvelope = loadMsgEnvelope(slice1) +export function storeInMsgDescr(inMsgDescr: InMsgDescr): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x8615b8fd, 32); + storeHashmapAugE(inMsgDescr.anon0, storeInMsg, storeImportFees)(builder); + }) - let transaction_id: number = slice.loadUint(64) +} - let fwd_fee: Grams = loadGrams(slice) +export function loadOutMsg(slice: Slice): OutMsg { + if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b000))) { + slice.loadUint(3); + let slice1 = slice.loadRef().beginParse(); + let msg: Message = loadMessage(slice1, ((slice: Slice) => { + return slice +}) +); + let slice2 = slice.loadRef().beginParse(); + let transaction: Transaction = loadTransaction(slice2); + return { + kind: 'OutMsg_msg_export_ext', + msg: msg, + transaction: transaction, + } - return { - kind: 'InMsg_msg_discard_fin', - in_msg: in_msg, - transaction_id: transaction_id, - fwd_fee: fwd_fee, -} + } + if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b010))) { + slice.loadUint(3); + let slice1 = slice.loadRef().beginParse(); + let out_msg: MsgEnvelope = loadMsgEnvelope(slice1); + let slice2 = slice.loadRef().beginParse(); + let transaction: Transaction = loadTransaction(slice2); + let slice3 = slice.loadRef().beginParse(); + let reimport: InMsg = loadInMsg(slice3); + return { + kind: 'OutMsg_msg_export_imm', + out_msg: out_msg, + transaction: transaction, + reimport: reimport, + } -} -; - if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b111))) { - slice.loadUint(3) - let slice1 = slice.loadRef().beginParse() + } + if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b001))) { + slice.loadUint(3); + let slice1 = slice.loadRef().beginParse(); + let out_msg: MsgEnvelope = loadMsgEnvelope(slice1); + let slice2 = slice.loadRef().beginParse(); + let transaction: Transaction = loadTransaction(slice2); + return { + kind: 'OutMsg_msg_export_new', + out_msg: out_msg, + transaction: transaction, + } - let in_msg: MsgEnvelope = loadMsgEnvelope(slice1) + } + if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b011))) { + slice.loadUint(3); + let slice1 = slice.loadRef().beginParse(); + let out_msg: MsgEnvelope = loadMsgEnvelope(slice1); + let slice2 = slice.loadRef().beginParse(); + let imported: InMsg = loadInMsg(slice2); + return { + kind: 'OutMsg_msg_export_tr', + out_msg: out_msg, + imported: imported, + } - let transaction_id: number = slice.loadUint(64) + } + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b1100))) { + slice.loadUint(4); + let slice1 = slice.loadRef().beginParse(); + let out_msg: MsgEnvelope = loadMsgEnvelope(slice1); + let import_block_lt: number = slice.loadUint(63); + return { + kind: 'OutMsg_msg_export_deq', + out_msg: out_msg, + import_block_lt: import_block_lt, + } - let fwd_fee: Grams = loadGrams(slice) + } + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b1101))) { + slice.loadUint(4); + let msg_env_hash: BitString = slice.loadBits(256); + let next_workchain: number = slice.loadInt(32); + let next_addr_pfx: number = slice.loadUint(64); + let import_block_lt: number = slice.loadUint(64); + return { + kind: 'OutMsg_msg_export_deq_short', + msg_env_hash: msg_env_hash, + next_workchain: next_workchain, + next_addr_pfx: next_addr_pfx, + import_block_lt: import_block_lt, + } - let slice2 = slice.loadRef().beginParse() + } + if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b111))) { + slice.loadUint(3); + let slice1 = slice.loadRef().beginParse(); + let out_msg: MsgEnvelope = loadMsgEnvelope(slice1); + let slice2 = slice.loadRef().beginParse(); + let imported: InMsg = loadInMsg(slice2); + return { + kind: 'OutMsg_msg_export_tr_req', + out_msg: out_msg, + imported: imported, + } - let proof_delivered: Slice = slice2 + } + if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b100))) { + slice.loadUint(3); + let slice1 = slice.loadRef().beginParse(); + let out_msg: MsgEnvelope = loadMsgEnvelope(slice1); + let slice2 = slice.loadRef().beginParse(); + let reimport: InMsg = loadInMsg(slice2); + return { + kind: 'OutMsg_msg_export_deq_imm', + out_msg: out_msg, + reimport: reimport, + } - return { - kind: 'InMsg_msg_discard_tr', - in_msg: in_msg, - transaction_id: transaction_id, - fwd_fee: fwd_fee, - proof_delivered: proof_delivered, + } + throw new Error(''); } -} -; - throw new Error('') -; -} +export function storeOutMsg(outMsg: OutMsg): (builder: Builder) => void { + if ((outMsg.kind == 'OutMsg_msg_export_ext')) { + return ((builder: Builder) => { + builder.storeUint(0b000, 3); + let cell1 = beginCell(); + storeMessage(outMsg.msg, ((arg: Slice) => { + return ((builder: Builder) => { + cell1.storeSlice(arg); + }) -export function storeInMsg(inMsg: InMsg): (builder: Builder) => void { - if ((inMsg.kind == 'InMsg_msg_import_ext')) { - return ((builder: Builder) => { - builder.storeUint(0b000, 3) + }) + )(cell1); + builder.storeRef(cell1); + let cell2 = beginCell(); + storeTransaction(outMsg.transaction)(cell2); + builder.storeRef(cell2); + }) + + } + if ((outMsg.kind == 'OutMsg_msg_export_imm')) { + return ((builder: Builder) => { + builder.storeUint(0b010, 3); + let cell1 = beginCell(); + storeMsgEnvelope(outMsg.out_msg)(cell1); + builder.storeRef(cell1); + let cell2 = beginCell(); + storeTransaction(outMsg.transaction)(cell2); + builder.storeRef(cell2); + let cell3 = beginCell(); + storeInMsg(outMsg.reimport)(cell3); + builder.storeRef(cell3); + }) - let cell1 = beginCell() + } + if ((outMsg.kind == 'OutMsg_msg_export_new')) { + return ((builder: Builder) => { + builder.storeUint(0b001, 3); + let cell1 = beginCell(); + storeMsgEnvelope(outMsg.out_msg)(cell1); + builder.storeRef(cell1); + let cell2 = beginCell(); + storeTransaction(outMsg.transaction)(cell2); + builder.storeRef(cell2); + }) + } + if ((outMsg.kind == 'OutMsg_msg_export_tr')) { + return ((builder: Builder) => { + builder.storeUint(0b011, 3); + let cell1 = beginCell(); + storeMsgEnvelope(outMsg.out_msg)(cell1); + builder.storeRef(cell1); + let cell2 = beginCell(); + storeInMsg(outMsg.imported)(cell2); + builder.storeRef(cell2); + }) - storeMessage(inMsg.msg, ((arg: Slice) => { + } + if ((outMsg.kind == 'OutMsg_msg_export_deq')) { return ((builder: Builder) => { - cell1.storeSlice(arg) + builder.storeUint(0b1100, 4); + let cell1 = beginCell(); + storeMsgEnvelope(outMsg.out_msg)(cell1); + builder.storeRef(cell1); + builder.storeUint(outMsg.import_block_lt, 63); + }) + } + if ((outMsg.kind == 'OutMsg_msg_export_deq_short')) { + return ((builder: Builder) => { + builder.storeUint(0b1101, 4); + builder.storeBits(outMsg.msg_env_hash); + builder.storeInt(outMsg.next_workchain, 32); + builder.storeUint(outMsg.next_addr_pfx, 64); + builder.storeUint(outMsg.import_block_lt, 64); }) + } + if ((outMsg.kind == 'OutMsg_msg_export_tr_req')) { + return ((builder: Builder) => { + builder.storeUint(0b111, 3); + let cell1 = beginCell(); + storeMsgEnvelope(outMsg.out_msg)(cell1); + builder.storeRef(cell1); + let cell2 = beginCell(); + storeInMsg(outMsg.imported)(cell2); + builder.storeRef(cell2); + }) - }) - )(cell1) + } + if ((outMsg.kind == 'OutMsg_msg_export_deq_imm')) { + return ((builder: Builder) => { + builder.storeUint(0b100, 3); + let cell1 = beginCell(); + storeMsgEnvelope(outMsg.out_msg)(cell1); + builder.storeRef(cell1); + let cell2 = beginCell(); + storeInMsg(outMsg.reimport)(cell2); + builder.storeRef(cell2); + }) - builder.storeRef(cell1) + } + throw new Error(''); +} - let cell2 = beginCell() +export function loadEnqueuedMsg(slice: Slice): EnqueuedMsg { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x98cd4c6e))) { + slice.loadUint(32); + let enqueued_lt: number = slice.loadUint(64); + let slice1 = slice.loadRef().beginParse(); + let out_msg: MsgEnvelope = loadMsgEnvelope(slice1); + return { + kind: 'EnqueuedMsg', + enqueued_lt: enqueued_lt, + out_msg: out_msg, + } + } + throw new Error(''); +} - storeTransaction(inMsg.transaction)(cell2) +export function storeEnqueuedMsg(enqueuedMsg: EnqueuedMsg): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x98cd4c6e, 32); + builder.storeUint(enqueuedMsg.enqueued_lt, 64); + let cell1 = beginCell(); + storeMsgEnvelope(enqueuedMsg.out_msg)(cell1); + builder.storeRef(cell1); + }) - builder.storeRef(cell2) +} -}) +export function loadOutMsgDescr(slice: Slice): OutMsgDescr { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xbcd61b19))) { + slice.loadUint(32); + let anon0: HashmapAugE = loadHashmapAugE(slice, 256, loadOutMsg, loadCurrencyCollection); + return { + kind: 'OutMsgDescr', + anon0: anon0, + } + } + throw new Error(''); } -; - if ((inMsg.kind == 'InMsg_msg_import_ihr')) { + +export function storeOutMsgDescr(outMsgDescr: OutMsgDescr): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0b010, 3) + builder.storeUint(0xbcd61b19, 32); + storeHashmapAugE(outMsgDescr.anon0, storeOutMsg, storeCurrencyCollection)(builder); + }) - let cell1 = beginCell() +} + +export function loadOutMsgQueue(slice: Slice): OutMsgQueue { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xcf5f0da2))) { + slice.loadUint(32); + let anon0: HashmapAugE = loadHashmapAugE(slice, 352, loadEnqueuedMsg, ((slice: Slice) => { + return slice.loadUint(64) +}) +); + return { + kind: 'OutMsgQueue', + anon0: anon0, + } + } + throw new Error(''); +} - storeMessage(inMsg.msg, ((arg: Slice) => { +export function storeOutMsgQueue(outMsgQueue: OutMsgQueue): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xcf5f0da2, 32); + storeHashmapAugE(outMsgQueue.anon0, storeEnqueuedMsg, ((arg: number) => { return ((builder: Builder) => { - cell1.storeSlice(arg) - + builder.storeUint(arg, 64); }) - }) - )(cell1) - - builder.storeRef(cell1) + )(builder); + }) - let cell2 = beginCell() +} +export function loadProcessedUpto(slice: Slice): ProcessedUpto { + let last_msg_lt: number = slice.loadUint(64); + let last_msg_hash: BitString = slice.loadBits(256); + return { + kind: 'ProcessedUpto', + last_msg_lt: last_msg_lt, + last_msg_hash: last_msg_hash, + } - storeTransaction(inMsg.transaction)(cell2) +} - builder.storeRef(cell2) +export function storeProcessedUpto(processedUpto: ProcessedUpto): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(processedUpto.last_msg_lt, 64); + builder.storeBits(processedUpto.last_msg_hash); + }) - storeGrams(inMsg.ihr_fee)(builder) +} - let cell3 = beginCell() +export function loadProcessedInfo(slice: Slice): ProcessedInfo { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x982f4fa3))) { + slice.loadUint(32); + let anon0: HashmapE = loadHashmapE(slice, 96, loadProcessedUpto); + return { + kind: 'ProcessedInfo', + anon0: anon0, + } + } + throw new Error(''); +} - cell3.storeSlice(inMsg.proof_created) +export function storeProcessedInfo(processedInfo: ProcessedInfo): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x982f4fa3, 32); + storeHashmapE(processedInfo.anon0, storeProcessedUpto)(builder); + }) - builder.storeRef(cell3) +} -}) +export function loadIhrPendingSince(slice: Slice): IhrPendingSince { + let import_lt: number = slice.loadUint(64); + return { + kind: 'IhrPendingSince', + import_lt: import_lt, + } } -; - if ((inMsg.kind == 'InMsg_msg_import_imm')) { + +export function storeIhrPendingSince(ihrPendingSince: IhrPendingSince): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0b011, 3) + builder.storeUint(ihrPendingSince.import_lt, 64); + }) - let cell1 = beginCell() +} +export function loadIhrPendingInfo(slice: Slice): IhrPendingInfo { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xc31463df))) { + slice.loadUint(32); + let anon0: HashmapE = loadHashmapE(slice, 320, loadIhrPendingSince); + return { + kind: 'IhrPendingInfo', + anon0: anon0, + } - storeMsgEnvelope(inMsg.in_msg)(cell1) + } + throw new Error(''); +} - builder.storeRef(cell1) +export function storeIhrPendingInfo(ihrPendingInfo: IhrPendingInfo): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xc31463df, 32); + storeHashmapE(ihrPendingInfo.anon0, storeIhrPendingSince)(builder); + }) - let cell2 = beginCell() +} +export function loadOutMsgQueueInfo(slice: Slice): OutMsgQueueInfo { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x98bb9b21))) { + slice.loadUint(32); + let out_queue: OutMsgQueue = loadOutMsgQueue(slice); + let proc_info: ProcessedInfo = loadProcessedInfo(slice); + let ihr_pending: IhrPendingInfo = loadIhrPendingInfo(slice); + return { + kind: 'OutMsgQueueInfo', + out_queue: out_queue, + proc_info: proc_info, + ihr_pending: ihr_pending, + } - storeTransaction(inMsg.transaction)(cell2) + } + throw new Error(''); +} - builder.storeRef(cell2) - - storeGrams(inMsg.fwd_fee)(builder) - -}) - -} -; - if ((inMsg.kind == 'InMsg_msg_import_fin')) { +export function storeOutMsgQueueInfo(outMsgQueueInfo: OutMsgQueueInfo): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0b100, 3) + builder.storeUint(0x98bb9b21, 32); + storeOutMsgQueue(outMsgQueueInfo.out_queue)(builder); + storeProcessedInfo(outMsgQueueInfo.proc_info)(builder); + storeIhrPendingInfo(outMsgQueueInfo.ihr_pending)(builder); + }) - let cell1 = beginCell() +} +export function loadStorageUsed(slice: Slice): StorageUsed { + let _cells: VarUInteger = loadVarUInteger(slice, 7); + let bits: VarUInteger = loadVarUInteger(slice, 7); + let public_cells: VarUInteger = loadVarUInteger(slice, 7); + return { + kind: 'StorageUsed', + _cells: _cells, + bits: bits, + public_cells: public_cells, + } - storeMsgEnvelope(inMsg.in_msg)(cell1) +} - builder.storeRef(cell1) +export function storeStorageUsed(storageUsed: StorageUsed): (builder: Builder) => void { + return ((builder: Builder) => { + storeVarUInteger(storageUsed._cells)(builder); + storeVarUInteger(storageUsed.bits)(builder); + storeVarUInteger(storageUsed.public_cells)(builder); + }) - let cell2 = beginCell() +} +export function loadStorageUsedShort(slice: Slice): StorageUsedShort { + let _cells: VarUInteger = loadVarUInteger(slice, 7); + let bits: VarUInteger = loadVarUInteger(slice, 7); + return { + kind: 'StorageUsedShort', + _cells: _cells, + bits: bits, + } - storeTransaction(inMsg.transaction)(cell2) +} - builder.storeRef(cell2) +export function storeStorageUsedShort(storageUsedShort: StorageUsedShort): (builder: Builder) => void { + return ((builder: Builder) => { + storeVarUInteger(storageUsedShort._cells)(builder); + storeVarUInteger(storageUsedShort.bits)(builder); + }) - storeGrams(inMsg.fwd_fee)(builder) +} -}) +export function loadStorageInfo(slice: Slice): StorageInfo { + let used: StorageUsed = loadStorageUsed(slice); + let last_paid: number = slice.loadUint(32); + let due_payment: Maybe = loadMaybe(slice, loadGrams); + return { + kind: 'StorageInfo', + used: used, + last_paid: last_paid, + due_payment: due_payment, + } } -; - if ((inMsg.kind == 'InMsg_msg_import_tr')) { + +export function storeStorageInfo(storageInfo: StorageInfo): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0b101, 3) + storeStorageUsed(storageInfo.used)(builder); + builder.storeUint(storageInfo.last_paid, 32); + storeMaybe(storageInfo.due_payment, storeGrams)(builder); + }) - let cell1 = beginCell() +} +export function loadAccount(slice: Slice): Account { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { + slice.loadUint(1); + return { + kind: 'Account_account_none', + } - storeMsgEnvelope(inMsg.in_msg)(cell1) + } + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { + slice.loadUint(1); + let addr: MsgAddressInt = loadMsgAddressInt(slice); + let storage_stat: StorageInfo = loadStorageInfo(slice); + let storage: AccountStorage = loadAccountStorage(slice); + return { + kind: 'Account_account', + addr: addr, + storage_stat: storage_stat, + storage: storage, + } - builder.storeRef(cell1) + } + throw new Error(''); +} - let cell2 = beginCell() +export function storeAccount(account: Account): (builder: Builder) => void { + if ((account.kind == 'Account_account_none')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1); + }) + } + if ((account.kind == 'Account_account')) { + return ((builder: Builder) => { + builder.storeUint(0b1, 1); + storeMsgAddressInt(account.addr)(builder); + storeStorageInfo(account.storage_stat)(builder); + storeAccountStorage(account.storage)(builder); + }) - storeMsgEnvelope(inMsg.out_msg)(cell2) + } + throw new Error(''); +} - builder.storeRef(cell2) +export function loadAccountStorage(slice: Slice): AccountStorage { + let last_trans_lt: number = slice.loadUint(64); + let balance: CurrencyCollection = loadCurrencyCollection(slice); + let state: AccountState = loadAccountState(slice); + return { + kind: 'AccountStorage', + last_trans_lt: last_trans_lt, + balance: balance, + state: state, + } - storeGrams(inMsg.transit_fee)(builder) +} -}) +export function storeAccountStorage(accountStorage: AccountStorage): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(accountStorage.last_trans_lt, 64); + storeCurrencyCollection(accountStorage.balance)(builder); + storeAccountState(accountStorage.state)(builder); + }) } -; - if ((inMsg.kind == 'InMsg_msg_discard_fin')) { - return ((builder: Builder) => { - builder.storeUint(0b110, 3) - let cell1 = beginCell() +export function loadAccountState(slice: Slice): AccountState { + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { + slice.loadUint(2); + return { + kind: 'AccountState_account_uninit', + } + } + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { + slice.loadUint(1); + let _: StateInit = loadStateInit(slice); + return { + kind: 'AccountState_account_active', + _: _, + } - storeMsgEnvelope(inMsg.in_msg)(cell1) + } + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b01))) { + slice.loadUint(2); + let state_hash: BitString = slice.loadBits(256); + return { + kind: 'AccountState_account_frozen', + state_hash: state_hash, + } - builder.storeRef(cell1) + } + throw new Error(''); +} - builder.storeUint(inMsg.transaction_id, 64) +export function storeAccountState(accountState: AccountState): (builder: Builder) => void { + if ((accountState.kind == 'AccountState_account_uninit')) { + return ((builder: Builder) => { + builder.storeUint(0b00, 2); + }) - storeGrams(inMsg.fwd_fee)(builder) + } + if ((accountState.kind == 'AccountState_account_active')) { + return ((builder: Builder) => { + builder.storeUint(0b1, 1); + storeStateInit(accountState._)(builder); + }) -}) + } + if ((accountState.kind == 'AccountState_account_frozen')) { + return ((builder: Builder) => { + builder.storeUint(0b01, 2); + builder.storeBits(accountState.state_hash); + }) + } + throw new Error(''); } -; - if ((inMsg.kind == 'InMsg_msg_discard_tr')) { - return ((builder: Builder) => { - builder.storeUint(0b111, 3) - let cell1 = beginCell() +export function loadAccountStatus(slice: Slice): AccountStatus { + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { + slice.loadUint(2); + return { + kind: 'AccountStatus_acc_state_uninit', + } + } + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b01))) { + slice.loadUint(2); + return { + kind: 'AccountStatus_acc_state_frozen', + } - storeMsgEnvelope(inMsg.in_msg)(cell1) + } + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b10))) { + slice.loadUint(2); + return { + kind: 'AccountStatus_acc_state_active', + } - builder.storeRef(cell1) + } + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b11))) { + slice.loadUint(2); + return { + kind: 'AccountStatus_acc_state_nonexist', + } - builder.storeUint(inMsg.transaction_id, 64) + } + throw new Error(''); +} - storeGrams(inMsg.fwd_fee)(builder) +export function storeAccountStatus(accountStatus: AccountStatus): (builder: Builder) => void { + if ((accountStatus.kind == 'AccountStatus_acc_state_uninit')) { + return ((builder: Builder) => { + builder.storeUint(0b00, 2); + }) - let cell2 = beginCell() + } + if ((accountStatus.kind == 'AccountStatus_acc_state_frozen')) { + return ((builder: Builder) => { + builder.storeUint(0b01, 2); + }) + } + if ((accountStatus.kind == 'AccountStatus_acc_state_active')) { + return ((builder: Builder) => { + builder.storeUint(0b10, 2); + }) - cell2.storeSlice(inMsg.proof_delivered) + } + if ((accountStatus.kind == 'AccountStatus_acc_state_nonexist')) { + return ((builder: Builder) => { + builder.storeUint(0b11, 2); + }) - builder.storeRef(cell2) + } + throw new Error(''); +} -}) +export function loadShardAccount(slice: Slice): ShardAccount { + let slice1 = slice.loadRef().beginParse(); + let account: Account = loadAccount(slice1); + let last_trans_hash: BitString = slice.loadBits(256); + let last_trans_lt: number = slice.loadUint(64); + return { + kind: 'ShardAccount', + account: account, + last_trans_hash: last_trans_hash, + last_trans_lt: last_trans_lt, + } -} -; - throw new Error('') -; } -export function loadImportFees(slice: Slice): ImportFees { - let fees_collected: Grams = loadGrams(slice) +export function storeShardAccount(shardAccount: ShardAccount): (builder: Builder) => void { + return ((builder: Builder) => { + let cell1 = beginCell(); + storeAccount(shardAccount.account)(cell1); + builder.storeRef(cell1); + builder.storeBits(shardAccount.last_trans_hash); + builder.storeUint(shardAccount.last_trans_lt, 64); + }) -; - let value_imported: CurrencyCollection = loadCurrencyCollection(slice) +} -; +export function loadDepthBalanceInfo(slice: Slice): DepthBalanceInfo { + let split_depth: number = slice.loadUint(bitLen(30)); + let balance: CurrencyCollection = loadCurrencyCollection(slice); return { - kind: 'ImportFees', - fees_collected: fees_collected, - value_imported: value_imported, -} + kind: 'DepthBalanceInfo', + split_depth: split_depth, + balance: balance, + } -; } -export function storeImportFees(importFees: ImportFees): (builder: Builder) => void { +export function storeDepthBalanceInfo(depthBalanceInfo: DepthBalanceInfo): (builder: Builder) => void { return ((builder: Builder) => { - storeGrams(importFees.fees_collected)(builder) - - storeCurrencyCollection(importFees.value_imported)(builder) - -}) + builder.storeUint(depthBalanceInfo.split_depth, bitLen(30)); + storeCurrencyCollection(depthBalanceInfo.balance)(builder); + }) -; } -export function loadInMsgDescr(slice: Slice): InMsgDescr { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x8615b8fd))) { - slice.loadUint(32) - let anon0: HashmapAugE = loadHashmapAugE(slice, 256, loadInMsg, loadImportFees) - - return { - kind: 'InMsgDescr', - anon0: anon0, -} +export function loadShardAccounts(slice: Slice): ShardAccounts { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xa59aef08))) { + slice.loadUint(32); + let anon0: HashmapAugE = loadHashmapAugE(slice, 256, loadShardAccount, loadDepthBalanceInfo); + return { + kind: 'ShardAccounts', + anon0: anon0, + } -} -; - throw new Error('') -; + } + throw new Error(''); } -export function storeInMsgDescr(inMsgDescr: InMsgDescr): (builder: Builder) => void { +export function storeShardAccounts(shardAccounts: ShardAccounts): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0x8615b8fd, 32) + builder.storeUint(0xa59aef08, 32); + storeHashmapAugE(shardAccounts.anon0, storeShardAccount, storeDepthBalanceInfo)(builder); + }) - storeHashmapAugE(inMsgDescr.anon0, storeInMsg, storeImportFees)(builder) +} +export function loadTransaction(slice: Slice): Transaction { + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b0111))) { + slice.loadUint(4); + let account_addr: BitString = slice.loadBits(256); + let lt: number = slice.loadUint(64); + let prev_trans_hash: BitString = slice.loadBits(256); + let prev_trans_lt: number = slice.loadUint(64); + let now: number = slice.loadUint(32); + let outmsg_cnt: number = slice.loadUint(15); + let orig_status: AccountStatus = loadAccountStatus(slice); + let end_status: AccountStatus = loadAccountStatus(slice); + let slice1 = slice.loadRef().beginParse(); + let in_msg: Maybe> = loadMaybe>(slice1, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse(); + return loadMessage(slice1, ((slice: Slice) => { + return slice + }) + ) +}) +); + let out_msgs: HashmapE> = loadHashmapE>(slice1, 15, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse(); + return loadMessage(slice1, ((slice: Slice) => { + return slice + }) + ) }) +); + let total_fees: CurrencyCollection = loadCurrencyCollection(slice); + let slice2 = slice.loadRef().beginParse(); + let state_update: HASH_UPDATE = loadHASH_UPDATE(slice2, loadAccount); + let slice3 = slice.loadRef().beginParse(); + let description: TransactionDescr = loadTransactionDescr(slice3); + return { + kind: 'Transaction', + account_addr: account_addr, + lt: lt, + prev_trans_hash: prev_trans_hash, + prev_trans_lt: prev_trans_lt, + now: now, + outmsg_cnt: outmsg_cnt, + orig_status: orig_status, + end_status: end_status, + in_msg: in_msg, + out_msgs: out_msgs, + total_fees: total_fees, + state_update: state_update, + description: description, + } -; + } + throw new Error(''); } -export function loadOutMsg(slice: Slice): OutMsg { - if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b000))) { - slice.loadUint(3) - let slice1 = slice.loadRef().beginParse() - - let msg: Message = loadMessage(slice1, ((slice: Slice) => { - return slice - -}) -) +export function storeTransaction(transaction: Transaction): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0b0111, 4); + builder.storeBits(transaction.account_addr); + builder.storeUint(transaction.lt, 64); + builder.storeBits(transaction.prev_trans_hash); + builder.storeUint(transaction.prev_trans_lt, 64); + builder.storeUint(transaction.now, 32); + builder.storeUint(transaction.outmsg_cnt, 15); + storeAccountStatus(transaction.orig_status)(builder); + storeAccountStatus(transaction.end_status)(builder); + let cell1 = beginCell(); + storeMaybe>(transaction.in_msg, ((arg: Message) => { + return ((builder: Builder) => { + let cell1 = beginCell(); - let slice2 = slice.loadRef().beginParse() + storeMessage(arg, ((arg: Slice) => { + return ((builder: Builder) => { + cell1.storeSlice(arg); + }) - let transaction: Transaction = loadTransaction(slice2) + }) + )(cell1); - return { - kind: 'OutMsg_msg_export_ext', - msg: msg, - transaction: transaction, -} + builder.storeRef(cell1); -} -; - if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b010))) { - slice.loadUint(3) - let slice1 = slice.loadRef().beginParse() + }) - let out_msg: MsgEnvelope = loadMsgEnvelope(slice1) + }) + )(cell1); + storeHashmapE>(transaction.out_msgs, ((arg: Message) => { + return ((builder: Builder) => { + let cell1 = beginCell(); - let slice2 = slice.loadRef().beginParse() + storeMessage(arg, ((arg: Slice) => { + return ((builder: Builder) => { + cell1.storeSlice(arg); + }) - let transaction: Transaction = loadTransaction(slice2) + }) + )(cell1); - let slice3 = slice.loadRef().beginParse() + builder.storeRef(cell1); - let reimport: InMsg = loadInMsg(slice3) + }) - return { - kind: 'OutMsg_msg_export_imm', - out_msg: out_msg, - transaction: transaction, - reimport: reimport, -} + }) + )(cell1); + builder.storeRef(cell1); + storeCurrencyCollection(transaction.total_fees)(builder); + let cell2 = beginCell(); + storeHASH_UPDATE(transaction.state_update, storeAccount)(cell2); + builder.storeRef(cell2); + let cell3 = beginCell(); + storeTransactionDescr(transaction.description)(cell3); + builder.storeRef(cell3); + }) } -; - if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b001))) { - slice.loadUint(3) - let slice1 = slice.loadRef().beginParse() - let out_msg: MsgEnvelope = loadMsgEnvelope(slice1) +export function loadMERKLE_UPDATE(slice: Slice, loadX: (slice: Slice) => X +): MERKLE_UPDATE { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x02))) { + slice.loadUint(8); + let old_hash: BitString = slice.loadBits(256); + let new_hash: BitString = slice.loadBits(256); + let slice1 = slice.loadRef().beginParse(); + let old: X = loadX(slice1); + let slice2 = slice.loadRef().beginParse(); + let new0: X = loadX(slice2); + return { + kind: 'MERKLE_UPDATE', + old_hash: old_hash, + new_hash: new_hash, + old: old, + new0: new0, + } - let slice2 = slice.loadRef().beginParse() + } + throw new Error(''); +} - let transaction: Transaction = loadTransaction(slice2) +export function storeMERKLE_UPDATE(mERKLE_UPDATE: MERKLE_UPDATE, storeX: (x: X) => (builder: Builder) => void - return { - kind: 'OutMsg_msg_export_new', - out_msg: out_msg, - transaction: transaction, -} +): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x02, 8); + builder.storeBits(mERKLE_UPDATE.old_hash); + builder.storeBits(mERKLE_UPDATE.new_hash); + let cell1 = beginCell(); + storeX(mERKLE_UPDATE.old)(cell1); + builder.storeRef(cell1); + let cell2 = beginCell(); + storeX(mERKLE_UPDATE.new0)(cell2); + builder.storeRef(cell2); + }) } -; - if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b011))) { - slice.loadUint(3) - let slice1 = slice.loadRef().beginParse() - let out_msg: MsgEnvelope = loadMsgEnvelope(slice1) +export function loadHASH_UPDATE(slice: Slice, loadX: (slice: Slice) => X +): HASH_UPDATE { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x72))) { + slice.loadUint(8); + let old_hash: BitString = slice.loadBits(256); + let new_hash: BitString = slice.loadBits(256); + return { + kind: 'HASH_UPDATE', + old_hash: old_hash, + new_hash: new_hash, + } - let slice2 = slice.loadRef().beginParse() + } + throw new Error(''); +} - let imported: InMsg = loadInMsg(slice2) +export function storeHASH_UPDATE(hASH_UPDATE: HASH_UPDATE, storeX: (x: X) => (builder: Builder) => void - return { - kind: 'OutMsg_msg_export_tr', - out_msg: out_msg, - imported: imported, -} +): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x72, 8); + builder.storeBits(hASH_UPDATE.old_hash); + builder.storeBits(hASH_UPDATE.new_hash); + }) } -; - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b1100))) { - slice.loadUint(4) - let slice1 = slice.loadRef().beginParse() - let out_msg: MsgEnvelope = loadMsgEnvelope(slice1) - - let import_block_lt: number = slice.loadUint(63) +export function loadMERKLE_PROOF(slice: Slice, loadX: (slice: Slice) => X +): MERKLE_PROOF { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x03))) { + slice.loadUint(8); + let virtual_hash: BitString = slice.loadBits(256); + let depth: number = slice.loadUint(16); + let slice1 = slice.loadRef().beginParse(); + let virtual_root: X = loadX(slice1); + return { + kind: 'MERKLE_PROOF', + virtual_hash: virtual_hash, + depth: depth, + virtual_root: virtual_root, + } - return { - kind: 'OutMsg_msg_export_deq', - out_msg: out_msg, - import_block_lt: import_block_lt, + } + throw new Error(''); } -} -; - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b1101))) { - slice.loadUint(4) - let msg_env_hash: BitString = slice.loadBits(256) +export function storeMERKLE_PROOF(mERKLE_PROOF: MERKLE_PROOF, storeX: (x: X) => (builder: Builder) => void - let next_workchain: number = slice.loadInt(32) +): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x03, 8); + builder.storeBits(mERKLE_PROOF.virtual_hash); + builder.storeUint(mERKLE_PROOF.depth, 16); + let cell1 = beginCell(); + storeX(mERKLE_PROOF.virtual_root)(cell1); + builder.storeRef(cell1); + }) - let next_addr_pfx: number = slice.loadUint(64) +} - let import_block_lt: number = slice.loadUint(64) +export function loadAccountBlock(slice: Slice): AccountBlock { + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0x5))) { + slice.loadUint(4); + let account_addr: BitString = slice.loadBits(256); + let transactions: HashmapAug = loadHashmapAug(slice, 64, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse(); + return loadTransaction(slice1) +}) +, loadCurrencyCollection); + let slice1 = slice.loadRef().beginParse(); + let state_update: HASH_UPDATE = loadHASH_UPDATE(slice1, loadAccount); + return { + kind: 'AccountBlock', + account_addr: account_addr, + transactions: transactions, + state_update: state_update, + } - return { - kind: 'OutMsg_msg_export_deq_short', - msg_env_hash: msg_env_hash, - next_workchain: next_workchain, - next_addr_pfx: next_addr_pfx, - import_block_lt: import_block_lt, + } + throw new Error(''); } -} -; - if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b111))) { - slice.loadUint(3) - let slice1 = slice.loadRef().beginParse() +export function storeAccountBlock(accountBlock: AccountBlock): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x5, 4); + builder.storeBits(accountBlock.account_addr); + storeHashmapAug(accountBlock.transactions, ((arg: Transaction) => { + return ((builder: Builder) => { + let cell1 = beginCell(); - let out_msg: MsgEnvelope = loadMsgEnvelope(slice1) + storeTransaction(arg)(cell1); - let slice2 = slice.loadRef().beginParse() + builder.storeRef(cell1); - let imported: InMsg = loadInMsg(slice2) + }) - return { - kind: 'OutMsg_msg_export_tr_req', - out_msg: out_msg, - imported: imported, -} + }) + , storeCurrencyCollection)(builder); + let cell1 = beginCell(); + storeHASH_UPDATE(accountBlock.state_update, storeAccount)(cell1); + builder.storeRef(cell1); + }) } -; - if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b100))) { - slice.loadUint(3) - let slice1 = slice.loadRef().beginParse() - let out_msg: MsgEnvelope = loadMsgEnvelope(slice1) +export function loadShardAccountBlocks(slice: Slice): ShardAccountBlocks { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xdc67c889))) { + slice.loadUint(32); + let anon0: HashmapAugE = loadHashmapAugE(slice, 256, loadAccountBlock, loadCurrencyCollection); + return { + kind: 'ShardAccountBlocks', + anon0: anon0, + } - let slice2 = slice.loadRef().beginParse() + } + throw new Error(''); +} - let reimport: InMsg = loadInMsg(slice2) +export function storeShardAccountBlocks(shardAccountBlocks: ShardAccountBlocks): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xdc67c889, 32); + storeHashmapAugE(shardAccountBlocks.anon0, storeAccountBlock, storeCurrencyCollection)(builder); + }) - return { - kind: 'OutMsg_msg_export_deq_imm', - out_msg: out_msg, - reimport: reimport, } -} -; - throw new Error('') -; +export function loadTrStoragePhase(slice: Slice): TrStoragePhase { + let storage_fees_collected: Grams = loadGrams(slice); + let storage_fees_due: Maybe = loadMaybe(slice, loadGrams); + let status_change: AccStatusChange = loadAccStatusChange(slice); + return { + kind: 'TrStoragePhase', + storage_fees_collected: storage_fees_collected, + storage_fees_due: storage_fees_due, + status_change: status_change, + } + } -export function storeOutMsg(outMsg: OutMsg): (builder: Builder) => void { - if ((outMsg.kind == 'OutMsg_msg_export_ext')) { +export function storeTrStoragePhase(trStoragePhase: TrStoragePhase): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0b000, 3) + storeGrams(trStoragePhase.storage_fees_collected)(builder); + storeMaybe(trStoragePhase.storage_fees_due, storeGrams)(builder); + storeAccStatusChange(trStoragePhase.status_change)(builder); + }) - let cell1 = beginCell() +} +export function loadAccStatusChange(slice: Slice): AccStatusChange { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { + slice.loadUint(1); + return { + kind: 'AccStatusChange_acst_unchanged', + } - storeMessage(outMsg.msg, ((arg: Slice) => { - return ((builder: Builder) => { - cell1.storeSlice(arg) - - }) - - - }) - )(cell1) - - builder.storeRef(cell1) + } + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b10))) { + slice.loadUint(2); + return { + kind: 'AccStatusChange_acst_frozen', + } - let cell2 = beginCell() + } + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b11))) { + slice.loadUint(2); + return { + kind: 'AccStatusChange_acst_deleted', + } + } + throw new Error(''); +} - storeTransaction(outMsg.transaction)(cell2) +export function storeAccStatusChange(accStatusChange: AccStatusChange): (builder: Builder) => void { + if ((accStatusChange.kind == 'AccStatusChange_acst_unchanged')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1); + }) - builder.storeRef(cell2) + } + if ((accStatusChange.kind == 'AccStatusChange_acst_frozen')) { + return ((builder: Builder) => { + builder.storeUint(0b10, 2); + }) -}) + } + if ((accStatusChange.kind == 'AccStatusChange_acst_deleted')) { + return ((builder: Builder) => { + builder.storeUint(0b11, 2); + }) + } + throw new Error(''); } -; - if ((outMsg.kind == 'OutMsg_msg_export_imm')) { - return ((builder: Builder) => { - builder.storeUint(0b010, 3) - let cell1 = beginCell() - - - storeMsgEnvelope(outMsg.out_msg)(cell1) +export function loadTrCreditPhase(slice: Slice): TrCreditPhase { + let due_fees_collected: Maybe = loadMaybe(slice, loadGrams); + let credit: CurrencyCollection = loadCurrencyCollection(slice); + return { + kind: 'TrCreditPhase', + due_fees_collected: due_fees_collected, + credit: credit, + } - builder.storeRef(cell1) +} - let cell2 = beginCell() +export function storeTrCreditPhase(trCreditPhase: TrCreditPhase): (builder: Builder) => void { + return ((builder: Builder) => { + storeMaybe(trCreditPhase.due_fees_collected, storeGrams)(builder); + storeCurrencyCollection(trCreditPhase.credit)(builder); + }) +} - storeTransaction(outMsg.transaction)(cell2) +export function loadTrComputePhase(slice: Slice): TrComputePhase { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { + slice.loadUint(1); + let reason: ComputeSkipReason = loadComputeSkipReason(slice); + return { + kind: 'TrComputePhase_tr_phase_compute_skipped', + reason: reason, + } - builder.storeRef(cell2) + } + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { + slice.loadUint(1); + let success: Bool = loadBool(slice); + let msg_state_used: Bool = loadBool(slice); + let account_activated: Bool = loadBool(slice); + let gas_fees: Grams = loadGrams(slice); + let slice1 = slice.loadRef().beginParse(); + let gas_used: VarUInteger = loadVarUInteger(slice1, 7); + let gas_limit: VarUInteger = loadVarUInteger(slice1, 7); + let gas_credit: Maybe = loadMaybe(slice1, ((slice: Slice) => { + return loadVarUInteger(slice, 3) +}) +); + let mode: number = slice1.loadInt(8); + let exit_code: number = slice1.loadInt(32); + let exit_arg: Maybe = loadMaybe(slice1, ((slice: Slice) => { + return slice1.loadInt(32) +}) +); + let vm_steps: number = slice1.loadUint(32); + let vm_init_state_hash: BitString = slice1.loadBits(256); + let vm_final_state_hash: BitString = slice1.loadBits(256); + return { + kind: 'TrComputePhase_tr_phase_compute_vm', + success: success, + msg_state_used: msg_state_used, + account_activated: account_activated, + gas_fees: gas_fees, + gas_used: gas_used, + gas_limit: gas_limit, + gas_credit: gas_credit, + mode: mode, + exit_code: exit_code, + exit_arg: exit_arg, + vm_steps: vm_steps, + vm_init_state_hash: vm_init_state_hash, + vm_final_state_hash: vm_final_state_hash, + } - let cell3 = beginCell() + } + throw new Error(''); +} +export function storeTrComputePhase(trComputePhase: TrComputePhase): (builder: Builder) => void { + if ((trComputePhase.kind == 'TrComputePhase_tr_phase_compute_skipped')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1); + storeComputeSkipReason(trComputePhase.reason)(builder); + }) - storeInMsg(outMsg.reimport)(cell3) + } + if ((trComputePhase.kind == 'TrComputePhase_tr_phase_compute_vm')) { + return ((builder: Builder) => { + builder.storeUint(0b1, 1); + storeBool(trComputePhase.success)(builder); + storeBool(trComputePhase.msg_state_used)(builder); + storeBool(trComputePhase.account_activated)(builder); + storeGrams(trComputePhase.gas_fees)(builder); + let cell1 = beginCell(); + storeVarUInteger(trComputePhase.gas_used)(cell1); + storeVarUInteger(trComputePhase.gas_limit)(cell1); + storeMaybe(trComputePhase.gas_credit, ((arg: VarUInteger) => { + return ((builder: Builder) => { + storeVarUInteger(arg)(builder); + }) - builder.storeRef(cell3) + }) + )(cell1); + cell1.storeInt(trComputePhase.mode, 8); + cell1.storeInt(trComputePhase.exit_code, 32); + storeMaybe(trComputePhase.exit_arg, ((arg: number) => { + return ((builder: Builder) => { + cell1.storeInt(arg, 32); + }) -}) + }) + )(cell1); + cell1.storeUint(trComputePhase.vm_steps, 32); + cell1.storeBits(trComputePhase.vm_init_state_hash); + cell1.storeBits(trComputePhase.vm_final_state_hash); + builder.storeRef(cell1); + }) + } + throw new Error(''); } -; - if ((outMsg.kind == 'OutMsg_msg_export_new')) { - return ((builder: Builder) => { - builder.storeUint(0b001, 3) - let cell1 = beginCell() +export function loadComputeSkipReason(slice: Slice): ComputeSkipReason { + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { + slice.loadUint(2); + return { + kind: 'ComputeSkipReason_cskip_no_state', + } + } + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b01))) { + slice.loadUint(2); + return { + kind: 'ComputeSkipReason_cskip_bad_state', + } - storeMsgEnvelope(outMsg.out_msg)(cell1) + } + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b10))) { + slice.loadUint(2); + return { + kind: 'ComputeSkipReason_cskip_no_gas', + } - builder.storeRef(cell1) + } + throw new Error(''); +} - let cell2 = beginCell() +export function storeComputeSkipReason(computeSkipReason: ComputeSkipReason): (builder: Builder) => void { + if ((computeSkipReason.kind == 'ComputeSkipReason_cskip_no_state')) { + return ((builder: Builder) => { + builder.storeUint(0b00, 2); + }) + } + if ((computeSkipReason.kind == 'ComputeSkipReason_cskip_bad_state')) { + return ((builder: Builder) => { + builder.storeUint(0b01, 2); + }) - storeTransaction(outMsg.transaction)(cell2) + } + if ((computeSkipReason.kind == 'ComputeSkipReason_cskip_no_gas')) { + return ((builder: Builder) => { + builder.storeUint(0b10, 2); + }) - builder.storeRef(cell2) + } + throw new Error(''); +} +export function loadTrActionPhase(slice: Slice): TrActionPhase { + let success: Bool = loadBool(slice); + let valid: Bool = loadBool(slice); + let no_funds: Bool = loadBool(slice); + let status_change: AccStatusChange = loadAccStatusChange(slice); + let total_fwd_fees: Maybe = loadMaybe(slice, loadGrams); + let total_action_fees: Maybe = loadMaybe(slice, loadGrams); + let result_code: number = slice.loadInt(32); + let result_arg: Maybe = loadMaybe(slice, ((slice: Slice) => { + return slice.loadInt(32) }) +); + let tot_actions: number = slice.loadUint(16); + let spec_actions: number = slice.loadUint(16); + let skipped_actions: number = slice.loadUint(16); + let msgs_created: number = slice.loadUint(16); + let action_list_hash: BitString = slice.loadBits(256); + let tot_msg_size: StorageUsedShort = loadStorageUsedShort(slice); + return { + kind: 'TrActionPhase', + success: success, + valid: valid, + no_funds: no_funds, + status_change: status_change, + total_fwd_fees: total_fwd_fees, + total_action_fees: total_action_fees, + result_code: result_code, + result_arg: result_arg, + tot_actions: tot_actions, + spec_actions: spec_actions, + skipped_actions: skipped_actions, + msgs_created: msgs_created, + action_list_hash: action_list_hash, + tot_msg_size: tot_msg_size, + } } -; - if ((outMsg.kind == 'OutMsg_msg_export_tr')) { - return ((builder: Builder) => { - builder.storeUint(0b011, 3) - let cell1 = beginCell() - - - storeMsgEnvelope(outMsg.out_msg)(cell1) - - builder.storeRef(cell1) +export function storeTrActionPhase(trActionPhase: TrActionPhase): (builder: Builder) => void { + return ((builder: Builder) => { + storeBool(trActionPhase.success)(builder); + storeBool(trActionPhase.valid)(builder); + storeBool(trActionPhase.no_funds)(builder); + storeAccStatusChange(trActionPhase.status_change)(builder); + storeMaybe(trActionPhase.total_fwd_fees, storeGrams)(builder); + storeMaybe(trActionPhase.total_action_fees, storeGrams)(builder); + builder.storeInt(trActionPhase.result_code, 32); + storeMaybe(trActionPhase.result_arg, ((arg: number) => { + return ((builder: Builder) => { + builder.storeInt(arg, 32); + }) - let cell2 = beginCell() + }) + )(builder); + builder.storeUint(trActionPhase.tot_actions, 16); + builder.storeUint(trActionPhase.spec_actions, 16); + builder.storeUint(trActionPhase.skipped_actions, 16); + builder.storeUint(trActionPhase.msgs_created, 16); + builder.storeBits(trActionPhase.action_list_hash); + storeStorageUsedShort(trActionPhase.tot_msg_size)(builder); + }) +} - storeInMsg(outMsg.imported)(cell2) +export function loadTrBouncePhase(slice: Slice): TrBouncePhase { + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { + slice.loadUint(2); + return { + kind: 'TrBouncePhase_tr_phase_bounce_negfunds', + } - builder.storeRef(cell2) + } + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b01))) { + slice.loadUint(2); + let msg_size: StorageUsedShort = loadStorageUsedShort(slice); + let req_fwd_fees: Grams = loadGrams(slice); + return { + kind: 'TrBouncePhase_tr_phase_bounce_nofunds', + msg_size: msg_size, + req_fwd_fees: req_fwd_fees, + } -}) + } + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { + slice.loadUint(1); + let msg_size: StorageUsedShort = loadStorageUsedShort(slice); + let msg_fees: Grams = loadGrams(slice); + let fwd_fees: Grams = loadGrams(slice); + return { + kind: 'TrBouncePhase_tr_phase_bounce_ok', + msg_size: msg_size, + msg_fees: msg_fees, + fwd_fees: fwd_fees, + } + } + throw new Error(''); } -; - if ((outMsg.kind == 'OutMsg_msg_export_deq')) { - return ((builder: Builder) => { - builder.storeUint(0b1100, 4) - - let cell1 = beginCell() +export function storeTrBouncePhase(trBouncePhase: TrBouncePhase): (builder: Builder) => void { + if ((trBouncePhase.kind == 'TrBouncePhase_tr_phase_bounce_negfunds')) { + return ((builder: Builder) => { + builder.storeUint(0b00, 2); + }) - storeMsgEnvelope(outMsg.out_msg)(cell1) + } + if ((trBouncePhase.kind == 'TrBouncePhase_tr_phase_bounce_nofunds')) { + return ((builder: Builder) => { + builder.storeUint(0b01, 2); + storeStorageUsedShort(trBouncePhase.msg_size)(builder); + storeGrams(trBouncePhase.req_fwd_fees)(builder); + }) - builder.storeRef(cell1) + } + if ((trBouncePhase.kind == 'TrBouncePhase_tr_phase_bounce_ok')) { + return ((builder: Builder) => { + builder.storeUint(0b1, 1); + storeStorageUsedShort(trBouncePhase.msg_size)(builder); + storeGrams(trBouncePhase.msg_fees)(builder); + storeGrams(trBouncePhase.fwd_fees)(builder); + }) - builder.storeUint(outMsg.import_block_lt, 63) + } + throw new Error(''); +} +export function loadTransactionDescr(slice: Slice): TransactionDescr { + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b0000))) { + slice.loadUint(4); + let credit_first: Bool = loadBool(slice); + let storage_ph: Maybe = loadMaybe(slice, loadTrStoragePhase); + let credit_ph: Maybe = loadMaybe(slice, loadTrCreditPhase); + let compute_ph: TrComputePhase = loadTrComputePhase(slice); + let action: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse(); + return loadTrActionPhase(slice1) }) +); + let aborted: Bool = loadBool(slice); + let bounce: Maybe = loadMaybe(slice, loadTrBouncePhase); + let destroyed: Bool = loadBool(slice); + return { + kind: 'TransactionDescr_trans_ord', + credit_first: credit_first, + storage_ph: storage_ph, + credit_ph: credit_ph, + compute_ph: compute_ph, + action: action, + aborted: aborted, + bounce: bounce, + destroyed: destroyed, + } -} -; - if ((outMsg.kind == 'OutMsg_msg_export_deq_short')) { - return ((builder: Builder) => { - builder.storeUint(0b1101, 4) + } + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b0001))) { + slice.loadUint(4); + let storage_ph: TrStoragePhase = loadTrStoragePhase(slice); + return { + kind: 'TransactionDescr_trans_storage', + storage_ph: storage_ph, + } - builder.storeBits(outMsg.msg_env_hash) + } + if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b001))) { + slice.loadUint(3); + let is_tock: Bool = loadBool(slice); + let storage_ph: TrStoragePhase = loadTrStoragePhase(slice); + let compute_ph: TrComputePhase = loadTrComputePhase(slice); + let action: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse(); + return loadTrActionPhase(slice1) +}) +); + let aborted: Bool = loadBool(slice); + let destroyed: Bool = loadBool(slice); + return { + kind: 'TransactionDescr_trans_tick_tock', + is_tock: is_tock, + storage_ph: storage_ph, + compute_ph: compute_ph, + action: action, + aborted: aborted, + destroyed: destroyed, + } - builder.storeInt(outMsg.next_workchain, 32) + } + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b0100))) { + slice.loadUint(4); + let split_info: SplitMergeInfo = loadSplitMergeInfo(slice); + let storage_ph: Maybe = loadMaybe(slice, loadTrStoragePhase); + let compute_ph: TrComputePhase = loadTrComputePhase(slice); + let action: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse(); + return loadTrActionPhase(slice1) +}) +); + let aborted: Bool = loadBool(slice); + let destroyed: Bool = loadBool(slice); + return { + kind: 'TransactionDescr_trans_split_prepare', + split_info: split_info, + storage_ph: storage_ph, + compute_ph: compute_ph, + action: action, + aborted: aborted, + destroyed: destroyed, + } - builder.storeUint(outMsg.next_addr_pfx, 64) + } + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b0101))) { + slice.loadUint(4); + let split_info: SplitMergeInfo = loadSplitMergeInfo(slice); + let slice1 = slice.loadRef().beginParse(); + let prepare_transaction: Transaction = loadTransaction(slice1); + let installed: Bool = loadBool(slice); + return { + kind: 'TransactionDescr_trans_split_install', + split_info: split_info, + prepare_transaction: prepare_transaction, + installed: installed, + } - builder.storeUint(outMsg.import_block_lt, 64) + } + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b0110))) { + slice.loadUint(4); + let split_info: SplitMergeInfo = loadSplitMergeInfo(slice); + let storage_ph: TrStoragePhase = loadTrStoragePhase(slice); + let aborted: Bool = loadBool(slice); + return { + kind: 'TransactionDescr_trans_merge_prepare', + split_info: split_info, + storage_ph: storage_ph, + aborted: aborted, + } + } + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b0111))) { + slice.loadUint(4); + let split_info: SplitMergeInfo = loadSplitMergeInfo(slice); + let slice1 = slice.loadRef().beginParse(); + let prepare_transaction: Transaction = loadTransaction(slice1); + let storage_ph: Maybe = loadMaybe(slice, loadTrStoragePhase); + let credit_ph: Maybe = loadMaybe(slice, loadTrCreditPhase); + let compute_ph: TrComputePhase = loadTrComputePhase(slice); + let action: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse(); + return loadTrActionPhase(slice1) }) +); + let aborted: Bool = loadBool(slice); + let destroyed: Bool = loadBool(slice); + return { + kind: 'TransactionDescr_trans_merge_install', + split_info: split_info, + prepare_transaction: prepare_transaction, + storage_ph: storage_ph, + credit_ph: credit_ph, + compute_ph: compute_ph, + action: action, + aborted: aborted, + destroyed: destroyed, + } + } + throw new Error(''); } -; - if ((outMsg.kind == 'OutMsg_msg_export_tr_req')) { - return ((builder: Builder) => { - builder.storeUint(0b111, 3) - - let cell1 = beginCell() +export function storeTransactionDescr(transactionDescr: TransactionDescr): (builder: Builder) => void { + if ((transactionDescr.kind == 'TransactionDescr_trans_ord')) { + return ((builder: Builder) => { + builder.storeUint(0b0000, 4); + storeBool(transactionDescr.credit_first)(builder); + storeMaybe(transactionDescr.storage_ph, storeTrStoragePhase)(builder); + storeMaybe(transactionDescr.credit_ph, storeTrCreditPhase)(builder); + storeTrComputePhase(transactionDescr.compute_ph)(builder); + storeMaybe(transactionDescr.action, ((arg: TrActionPhase) => { + return ((builder: Builder) => { + let cell1 = beginCell(); - storeMsgEnvelope(outMsg.out_msg)(cell1) - - builder.storeRef(cell1) + storeTrActionPhase(arg)(cell1); - let cell2 = beginCell() + builder.storeRef(cell1); + }) - storeInMsg(outMsg.imported)(cell2) + }) + )(builder); + storeBool(transactionDescr.aborted)(builder); + storeMaybe(transactionDescr.bounce, storeTrBouncePhase)(builder); + storeBool(transactionDescr.destroyed)(builder); + }) - builder.storeRef(cell2) + } + if ((transactionDescr.kind == 'TransactionDescr_trans_storage')) { + return ((builder: Builder) => { + builder.storeUint(0b0001, 4); + storeTrStoragePhase(transactionDescr.storage_ph)(builder); + }) -}) + } + if ((transactionDescr.kind == 'TransactionDescr_trans_tick_tock')) { + return ((builder: Builder) => { + builder.storeUint(0b001, 3); + storeBool(transactionDescr.is_tock)(builder); + storeTrStoragePhase(transactionDescr.storage_ph)(builder); + storeTrComputePhase(transactionDescr.compute_ph)(builder); + storeMaybe(transactionDescr.action, ((arg: TrActionPhase) => { + return ((builder: Builder) => { + let cell1 = beginCell(); -} -; - if ((outMsg.kind == 'OutMsg_msg_export_deq_imm')) { - return ((builder: Builder) => { - builder.storeUint(0b100, 3) + storeTrActionPhase(arg)(cell1); - let cell1 = beginCell() + builder.storeRef(cell1); + }) - storeMsgEnvelope(outMsg.out_msg)(cell1) + }) + )(builder); + storeBool(transactionDescr.aborted)(builder); + storeBool(transactionDescr.destroyed)(builder); + }) - builder.storeRef(cell1) + } + if ((transactionDescr.kind == 'TransactionDescr_trans_split_prepare')) { + return ((builder: Builder) => { + builder.storeUint(0b0100, 4); + storeSplitMergeInfo(transactionDescr.split_info)(builder); + storeMaybe(transactionDescr.storage_ph, storeTrStoragePhase)(builder); + storeTrComputePhase(transactionDescr.compute_ph)(builder); + storeMaybe(transactionDescr.action, ((arg: TrActionPhase) => { + return ((builder: Builder) => { + let cell1 = beginCell(); - let cell2 = beginCell() + storeTrActionPhase(arg)(cell1); + builder.storeRef(cell1); - storeInMsg(outMsg.reimport)(cell2) + }) - builder.storeRef(cell2) + }) + )(builder); + storeBool(transactionDescr.aborted)(builder); + storeBool(transactionDescr.destroyed)(builder); + }) -}) + } + if ((transactionDescr.kind == 'TransactionDescr_trans_split_install')) { + return ((builder: Builder) => { + builder.storeUint(0b0101, 4); + storeSplitMergeInfo(transactionDescr.split_info)(builder); + let cell1 = beginCell(); + storeTransaction(transactionDescr.prepare_transaction)(cell1); + builder.storeRef(cell1); + storeBool(transactionDescr.installed)(builder); + }) -} -; - throw new Error('') -; -} + } + if ((transactionDescr.kind == 'TransactionDescr_trans_merge_prepare')) { + return ((builder: Builder) => { + builder.storeUint(0b0110, 4); + storeSplitMergeInfo(transactionDescr.split_info)(builder); + storeTrStoragePhase(transactionDescr.storage_ph)(builder); + storeBool(transactionDescr.aborted)(builder); + }) -export function loadEnqueuedMsg(slice: Slice): EnqueuedMsg { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x98cd4c6e))) { - slice.loadUint(32) - let enqueued_lt: number = slice.loadUint(64) + } + if ((transactionDescr.kind == 'TransactionDescr_trans_merge_install')) { + return ((builder: Builder) => { + builder.storeUint(0b0111, 4); + storeSplitMergeInfo(transactionDescr.split_info)(builder); + let cell1 = beginCell(); + storeTransaction(transactionDescr.prepare_transaction)(cell1); + builder.storeRef(cell1); + storeMaybe(transactionDescr.storage_ph, storeTrStoragePhase)(builder); + storeMaybe(transactionDescr.credit_ph, storeTrCreditPhase)(builder); + storeTrComputePhase(transactionDescr.compute_ph)(builder); + storeMaybe(transactionDescr.action, ((arg: TrActionPhase) => { + return ((builder: Builder) => { + let cell1 = beginCell(); + + storeTrActionPhase(arg)(cell1); + + builder.storeRef(cell1); - let slice1 = slice.loadRef().beginParse() + }) - let out_msg: MsgEnvelope = loadMsgEnvelope(slice1) + }) + )(builder); + storeBool(transactionDescr.aborted)(builder); + storeBool(transactionDescr.destroyed)(builder); + }) - return { - kind: 'EnqueuedMsg', - enqueued_lt: enqueued_lt, - out_msg: out_msg, + } + throw new Error(''); } -} -; - throw new Error('') -; +export function loadSplitMergeInfo(slice: Slice): SplitMergeInfo { + let cur_shard_pfx_len: number = slice.loadUint(6); + let acc_split_depth: number = slice.loadUint(6); + let this_addr: BitString = slice.loadBits(256); + let sibling_addr: BitString = slice.loadBits(256); + return { + kind: 'SplitMergeInfo', + cur_shard_pfx_len: cur_shard_pfx_len, + acc_split_depth: acc_split_depth, + this_addr: this_addr, + sibling_addr: sibling_addr, + } + } -export function storeEnqueuedMsg(enqueuedMsg: EnqueuedMsg): (builder: Builder) => void { +export function storeSplitMergeInfo(splitMergeInfo: SplitMergeInfo): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0x98cd4c6e, 32) - - builder.storeUint(enqueuedMsg.enqueued_lt, 64) - - let cell1 = beginCell() - - - storeMsgEnvelope(enqueuedMsg.out_msg)(cell1) - - builder.storeRef(cell1) - -}) + builder.storeUint(splitMergeInfo.cur_shard_pfx_len, 6); + builder.storeUint(splitMergeInfo.acc_split_depth, 6); + builder.storeBits(splitMergeInfo.this_addr); + builder.storeBits(splitMergeInfo.sibling_addr); + }) -; } -export function loadOutMsgDescr(slice: Slice): OutMsgDescr { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xbcd61b19))) { - slice.loadUint(32) - let anon0: HashmapAugE = loadHashmapAugE(slice, 256, loadOutMsg, loadCurrencyCollection) - - return { - kind: 'OutMsgDescr', - anon0: anon0, -} +export function loadSmartContractInfo(slice: Slice): SmartContractInfo { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x076ef1ea))) { + slice.loadUint(32); + let actions: number = slice.loadUint(16); + let msgs_sent: number = slice.loadUint(16); + let unixtime: number = slice.loadUint(32); + let block_lt: number = slice.loadUint(64); + let trans_lt: number = slice.loadUint(64); + let rand_seed: BitString = slice.loadBits(256); + let balance_remaining: CurrencyCollection = loadCurrencyCollection(slice); + let myself: MsgAddressInt = loadMsgAddressInt(slice); + return { + kind: 'SmartContractInfo', + actions: actions, + msgs_sent: msgs_sent, + unixtime: unixtime, + block_lt: block_lt, + trans_lt: trans_lt, + rand_seed: rand_seed, + balance_remaining: balance_remaining, + myself: myself, + } -} -; - throw new Error('') -; + } + throw new Error(''); } -export function storeOutMsgDescr(outMsgDescr: OutMsgDescr): (builder: Builder) => void { +export function storeSmartContractInfo(smartContractInfo: SmartContractInfo): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xbcd61b19, 32) - - storeHashmapAugE(outMsgDescr.anon0, storeOutMsg, storeCurrencyCollection)(builder) - -}) + builder.storeUint(0x076ef1ea, 32); + builder.storeUint(smartContractInfo.actions, 16); + builder.storeUint(smartContractInfo.msgs_sent, 16); + builder.storeUint(smartContractInfo.unixtime, 32); + builder.storeUint(smartContractInfo.block_lt, 64); + builder.storeUint(smartContractInfo.trans_lt, 64); + builder.storeBits(smartContractInfo.rand_seed); + storeCurrencyCollection(smartContractInfo.balance_remaining)(builder); + storeMsgAddressInt(smartContractInfo.myself)(builder); + }) -; } -export function loadOutMsgQueue(slice: Slice): OutMsgQueue { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xcf5f0da2))) { - slice.loadUint(32) - let anon0: HashmapAugE = loadHashmapAugE(slice, 352, loadEnqueuedMsg, ((slice: Slice) => { - return slice.loadUint(64) - -}) -) +export function loadOutList(slice: Slice, arg0: number): OutList { + if ((arg0 == 0)) { + return { + kind: 'OutList_out_list_empty', + } - return { - kind: 'OutMsgQueue', - anon0: anon0, -} + } + if (true) { + let slice1 = slice.loadRef().beginParse(); + let prev: OutList = loadOutList(slice1, (arg0 - 1)); + let action: OutAction = loadOutAction(slice); + return { + kind: 'OutList_out_list', + n: (arg0 - 1), + prev: prev, + action: action, + } -} -; - throw new Error('') -; + } + throw new Error(''); } -export function storeOutMsgQueue(outMsgQueue: OutMsgQueue): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xcf5f0da2, 32) - - storeHashmapAugE(outMsgQueue.anon0, storeEnqueuedMsg, ((arg: number) => { +export function storeOutList(outList: OutList): (builder: Builder) => void { + if ((outList.kind == 'OutList_out_list_empty')) { return ((builder: Builder) => { - builder.storeUint(arg, 64) + }) + } + if ((outList.kind == 'OutList_out_list')) { + return ((builder: Builder) => { + let cell1 = beginCell(); + storeOutList(outList.prev)(cell1); + builder.storeRef(cell1); + storeOutAction(outList.action)(builder); }) + } + throw new Error(''); +} - }) - )(builder) - +export function loadOutAction(slice: Slice): OutAction { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x0ec3c86d))) { + slice.loadUint(32); + let mode: number = slice.loadUint(8); + let slice1 = slice.loadRef().beginParse(); + let out_msg: MessageRelaxed = loadMessageRelaxed(slice1, ((slice: Slice) => { + return slice }) +); + return { + kind: 'OutAction_action_send_msg', + mode: mode, + out_msg: out_msg, + } -; -} + } + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xad4de08e))) { + slice.loadUint(32); + let slice1 = slice.loadRef().beginParse(); + let new_code: Slice = slice1; + return { + kind: 'OutAction_action_set_code', + new_code: new_code, + } -export function loadProcessedUpto(slice: Slice): ProcessedUpto { - let last_msg_lt: number = slice.loadUint(64) + } + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x36e6b809))) { + slice.loadUint(32); + let mode: number = slice.loadUint(8); + let currency: CurrencyCollection = loadCurrencyCollection(slice); + return { + kind: 'OutAction_action_reserve_currency', + mode: mode, + currency: currency, + } -; - let last_msg_hash: BitString = slice.loadBits(256) + } + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x26fa1dd4))) { + slice.loadUint(32); + let mode: number = slice.loadUint(7); + let libref: LibRef = loadLibRef(slice); + if ((!(mode <= 2))) { + throw new Error(''); + } + return { + kind: 'OutAction_action_change_library', + mode: mode, + libref: libref, + } -; - return { - kind: 'ProcessedUpto', - last_msg_lt: last_msg_lt, - last_msg_hash: last_msg_hash, + } + throw new Error(''); } -; -} +export function storeOutAction(outAction: OutAction): (builder: Builder) => void { + if ((outAction.kind == 'OutAction_action_send_msg')) { + return ((builder: Builder) => { + builder.storeUint(0x0ec3c86d, 32); + builder.storeUint(outAction.mode, 8); + let cell1 = beginCell(); + storeMessageRelaxed(outAction.out_msg, ((arg: Slice) => { + return ((builder: Builder) => { + cell1.storeSlice(arg); + }) -export function storeProcessedUpto(processedUpto: ProcessedUpto): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(processedUpto.last_msg_lt, 64) + }) + )(cell1); + builder.storeRef(cell1); + }) - builder.storeBits(processedUpto.last_msg_hash) + } + if ((outAction.kind == 'OutAction_action_set_code')) { + return ((builder: Builder) => { + builder.storeUint(0xad4de08e, 32); + let cell1 = beginCell(); + cell1.storeSlice(outAction.new_code); + builder.storeRef(cell1); + }) -}) + } + if ((outAction.kind == 'OutAction_action_reserve_currency')) { + return ((builder: Builder) => { + builder.storeUint(0x36e6b809, 32); + builder.storeUint(outAction.mode, 8); + storeCurrencyCollection(outAction.currency)(builder); + }) -; + } + if ((outAction.kind == 'OutAction_action_change_library')) { + return ((builder: Builder) => { + builder.storeUint(0x26fa1dd4, 32); + builder.storeUint(outAction.mode, 7); + storeLibRef(outAction.libref)(builder); + if ((!(outAction.mode <= 2))) { + throw new Error(''); + } + }) + + } + throw new Error(''); } -export function loadProcessedInfo(slice: Slice): ProcessedInfo { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x982f4fa3))) { - slice.loadUint(32) - let anon0: HashmapE = loadHashmapE(slice, 96, loadProcessedUpto) +export function loadLibRef(slice: Slice): LibRef { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { + slice.loadUint(1); + let lib_hash: BitString = slice.loadBits(256); + return { + kind: 'LibRef_libref_hash', + lib_hash: lib_hash, + } - return { - kind: 'ProcessedInfo', - anon0: anon0, -} + } + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { + slice.loadUint(1); + let slice1 = slice.loadRef().beginParse(); + let library: Slice = slice1; + return { + kind: 'LibRef_libref_ref', + library: library, + } -} -; - throw new Error('') -; + } + throw new Error(''); } -export function storeProcessedInfo(processedInfo: ProcessedInfo): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x982f4fa3, 32) - - storeHashmapE(processedInfo.anon0, storeProcessedUpto)(builder) +export function storeLibRef(libRef: LibRef): (builder: Builder) => void { + if ((libRef.kind == 'LibRef_libref_hash')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1); + builder.storeBits(libRef.lib_hash); + }) -}) + } + if ((libRef.kind == 'LibRef_libref_ref')) { + return ((builder: Builder) => { + builder.storeUint(0b1, 1); + let cell1 = beginCell(); + cell1.storeSlice(libRef.library); + builder.storeRef(cell1); + }) -; + } + throw new Error(''); } -export function loadIhrPendingSince(slice: Slice): IhrPendingSince { - let import_lt: number = slice.loadUint(64) - -; +export function loadOutListNode(slice: Slice): OutListNode { + let slice1 = slice.loadRef().beginParse(); + let prev: Slice = slice1; + let action: OutAction = loadOutAction(slice); return { - kind: 'IhrPendingSince', - import_lt: import_lt, -} + kind: 'OutListNode', + prev: prev, + action: action, + } -; } -export function storeIhrPendingSince(ihrPendingSince: IhrPendingSince): (builder: Builder) => void { +export function storeOutListNode(outListNode: OutListNode): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(ihrPendingSince.import_lt, 64) - -}) + let cell1 = beginCell(); + cell1.storeSlice(outListNode.prev); + builder.storeRef(cell1); + storeOutAction(outListNode.action)(builder); + }) -; } -export function loadIhrPendingInfo(slice: Slice): IhrPendingInfo { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xc31463df))) { - slice.loadUint(32) - let anon0: HashmapE = loadHashmapE(slice, 320, loadIhrPendingSince) +export function loadShardIdent(slice: Slice): ShardIdent { + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { + slice.loadUint(2); + let shard_pfx_bits: number = slice.loadUint(bitLen(60)); + let workchain_id: number = slice.loadInt(32); + let shard_prefix: number = slice.loadUint(64); + return { + kind: 'ShardIdent', + shard_pfx_bits: shard_pfx_bits, + workchain_id: workchain_id, + shard_prefix: shard_prefix, + } - return { - kind: 'IhrPendingInfo', - anon0: anon0, + } + throw new Error(''); } +export function storeShardIdent(shardIdent: ShardIdent): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0b00, 2); + builder.storeUint(shardIdent.shard_pfx_bits, bitLen(60)); + builder.storeInt(shardIdent.workchain_id, 32); + builder.storeUint(shardIdent.shard_prefix, 64); + }) + } -; - throw new Error('') -; + +export function loadExtBlkRef(slice: Slice): ExtBlkRef { + let end_lt: number = slice.loadUint(64); + let seq_no: number = slice.loadUint(32); + let root_hash: BitString = slice.loadBits(256); + let file_hash: BitString = slice.loadBits(256); + return { + kind: 'ExtBlkRef', + end_lt: end_lt, + seq_no: seq_no, + root_hash: root_hash, + file_hash: file_hash, + } + } -export function storeIhrPendingInfo(ihrPendingInfo: IhrPendingInfo): (builder: Builder) => void { +export function storeExtBlkRef(extBlkRef: ExtBlkRef): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xc31463df, 32) + builder.storeUint(extBlkRef.end_lt, 64); + builder.storeUint(extBlkRef.seq_no, 32); + builder.storeBits(extBlkRef.root_hash); + builder.storeBits(extBlkRef.file_hash); + }) - storeHashmapE(ihrPendingInfo.anon0, storeIhrPendingSince)(builder) +} -}) +export function loadBlockIdExt(slice: Slice): BlockIdExt { + let shard_id: ShardIdent = loadShardIdent(slice); + let seq_no: number = slice.loadUint(32); + let root_hash: BitString = slice.loadBits(256); + let file_hash: BitString = slice.loadBits(256); + return { + kind: 'BlockIdExt', + shard_id: shard_id, + seq_no: seq_no, + root_hash: root_hash, + file_hash: file_hash, + } -; } -export function loadOutMsgQueueInfo(slice: Slice): OutMsgQueueInfo { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x98bb9b21))) { - slice.loadUint(32) - let out_queue: OutMsgQueue = loadOutMsgQueue(slice) - - let proc_info: ProcessedInfo = loadProcessedInfo(slice) +export function storeBlockIdExt(blockIdExt: BlockIdExt): (builder: Builder) => void { + return ((builder: Builder) => { + storeShardIdent(blockIdExt.shard_id)(builder); + builder.storeUint(blockIdExt.seq_no, 32); + builder.storeBits(blockIdExt.root_hash); + builder.storeBits(blockIdExt.file_hash); + }) - let ihr_pending: IhrPendingInfo = loadIhrPendingInfo(slice) +} +export function loadBlkMasterInfo(slice: Slice): BlkMasterInfo { + let master: ExtBlkRef = loadExtBlkRef(slice); return { - kind: 'OutMsgQueueInfo', - out_queue: out_queue, - proc_info: proc_info, - ihr_pending: ihr_pending, -} + kind: 'BlkMasterInfo', + master: master, + } -} -; - throw new Error('') -; } -export function storeOutMsgQueueInfo(outMsgQueueInfo: OutMsgQueueInfo): (builder: Builder) => void { +export function storeBlkMasterInfo(blkMasterInfo: BlkMasterInfo): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0x98bb9b21, 32) - - storeOutMsgQueue(outMsgQueueInfo.out_queue)(builder) - - storeProcessedInfo(outMsgQueueInfo.proc_info)(builder) + storeExtBlkRef(blkMasterInfo.master)(builder); + }) - storeIhrPendingInfo(outMsgQueueInfo.ihr_pending)(builder) +} +export function loadShardStateUnsplit(slice: Slice): ShardStateUnsplit { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x9023afe2))) { + slice.loadUint(32); + let global_id: number = slice.loadInt(32); + let shard_id: ShardIdent = loadShardIdent(slice); + let seq_no: number = slice.loadUint(32); + let vert_seq_no: number = slice.loadUint(32); + let gen_utime: number = slice.loadUint(32); + let gen_lt: number = slice.loadUint(64); + let min_ref_mc_seqno: number = slice.loadUint(32); + let slice1 = slice.loadRef().beginParse(); + let out_msg_queue_info: OutMsgQueueInfo = loadOutMsgQueueInfo(slice1); + let before_split: number = slice.loadUint(1); + let slice2 = slice.loadRef().beginParse(); + let accounts: ShardAccounts = loadShardAccounts(slice2); + let slice3 = slice.loadRef().beginParse(); + let overload_history: number = slice3.loadUint(64); + let underload_history: number = slice3.loadUint(64); + let total_balance: CurrencyCollection = loadCurrencyCollection(slice3); + let total_validator_fees: CurrencyCollection = loadCurrencyCollection(slice3); + let libraries: HashmapE = loadHashmapE(slice3, 256, loadLibDescr); + let master_ref: Maybe = loadMaybe(slice3, loadBlkMasterInfo); + let custom: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse(); + return loadMcStateExtra(slice1) }) +); + return { + kind: 'ShardStateUnsplit', + global_id: global_id, + shard_id: shard_id, + seq_no: seq_no, + vert_seq_no: vert_seq_no, + gen_utime: gen_utime, + gen_lt: gen_lt, + min_ref_mc_seqno: min_ref_mc_seqno, + out_msg_queue_info: out_msg_queue_info, + before_split: before_split, + accounts: accounts, + overload_history: overload_history, + underload_history: underload_history, + total_balance: total_balance, + total_validator_fees: total_validator_fees, + libraries: libraries, + master_ref: master_ref, + custom: custom, + } -; + } + throw new Error(''); } -export function loadStorageUsed(slice: Slice): StorageUsed { - let _cells: VarUInteger = loadVarUInteger(slice, 7) - -; - let bits: VarUInteger = loadVarUInteger(slice, 7) +export function storeShardStateUnsplit(shardStateUnsplit: ShardStateUnsplit): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x9023afe2, 32); + builder.storeInt(shardStateUnsplit.global_id, 32); + storeShardIdent(shardStateUnsplit.shard_id)(builder); + builder.storeUint(shardStateUnsplit.seq_no, 32); + builder.storeUint(shardStateUnsplit.vert_seq_no, 32); + builder.storeUint(shardStateUnsplit.gen_utime, 32); + builder.storeUint(shardStateUnsplit.gen_lt, 64); + builder.storeUint(shardStateUnsplit.min_ref_mc_seqno, 32); + let cell1 = beginCell(); + storeOutMsgQueueInfo(shardStateUnsplit.out_msg_queue_info)(cell1); + builder.storeRef(cell1); + builder.storeUint(shardStateUnsplit.before_split, 1); + let cell2 = beginCell(); + storeShardAccounts(shardStateUnsplit.accounts)(cell2); + builder.storeRef(cell2); + let cell3 = beginCell(); + cell3.storeUint(shardStateUnsplit.overload_history, 64); + cell3.storeUint(shardStateUnsplit.underload_history, 64); + storeCurrencyCollection(shardStateUnsplit.total_balance)(cell3); + storeCurrencyCollection(shardStateUnsplit.total_validator_fees)(cell3); + storeHashmapE(shardStateUnsplit.libraries, storeLibDescr)(cell3); + storeMaybe(shardStateUnsplit.master_ref, storeBlkMasterInfo)(cell3); + builder.storeRef(cell3); + storeMaybe(shardStateUnsplit.custom, ((arg: McStateExtra) => { + return ((builder: Builder) => { + let cell1 = beginCell(); -; - let public_cells: VarUInteger = loadVarUInteger(slice, 7) + storeMcStateExtra(arg)(cell1); -; - return { - kind: 'StorageUsed', - _cells: _cells, - bits: bits, - public_cells: public_cells, -} + builder.storeRef(cell1); -; -} + }) -export function storeStorageUsed(storageUsed: StorageUsed): (builder: Builder) => void { - return ((builder: Builder) => { - storeVarUInteger(storageUsed._cells)(builder) + }) + )(builder); + }) - storeVarUInteger(storageUsed.bits)(builder) +} - storeVarUInteger(storageUsed.public_cells)(builder) +export function loadShardState(slice: Slice): ShardState { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x81e52440))) { + slice.loadUint(32); + let anon0: ShardStateUnsplit = loadShardStateUnsplit(slice); + return { + kind: 'ShardState__', + anon0: anon0, + } -}) + } + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x5f327da5))) { + slice.loadUint(32); + let slice1 = slice.loadRef().beginParse(); + let left: ShardStateUnsplit = loadShardStateUnsplit(slice1); + let slice2 = slice.loadRef().beginParse(); + let right: ShardStateUnsplit = loadShardStateUnsplit(slice2); + return { + kind: 'ShardState_split_state', + left: left, + right: right, + } -; + } + throw new Error(''); } -export function loadStorageUsedShort(slice: Slice): StorageUsedShort { - let _cells: VarUInteger = loadVarUInteger(slice, 7) +export function storeShardState(shardState: ShardState): (builder: Builder) => void { + if ((shardState.kind == 'ShardState__')) { + return ((builder: Builder) => { + builder.storeUint(0x81e52440, 32); + storeShardStateUnsplit(shardState.anon0)(builder); + }) -; - let bits: VarUInteger = loadVarUInteger(slice, 7) + } + if ((shardState.kind == 'ShardState_split_state')) { + return ((builder: Builder) => { + builder.storeUint(0x5f327da5, 32); + let cell1 = beginCell(); + storeShardStateUnsplit(shardState.left)(cell1); + builder.storeRef(cell1); + let cell2 = beginCell(); + storeShardStateUnsplit(shardState.right)(cell2); + builder.storeRef(cell2); + }) -; - return { - kind: 'StorageUsedShort', - _cells: _cells, - bits: bits, + } + throw new Error(''); } -; +export function loadLibDescr(slice: Slice): LibDescr { + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { + slice.loadUint(2); + let slice1 = slice.loadRef().beginParse(); + let lib: Slice = slice1; + let publishers: Hashmap = loadHashmap(slice, 256, loadTrue); + return { + kind: 'LibDescr', + lib: lib, + publishers: publishers, + } + + } + throw new Error(''); } -export function storeStorageUsedShort(storageUsedShort: StorageUsedShort): (builder: Builder) => void { +export function storeLibDescr(libDescr: LibDescr): (builder: Builder) => void { return ((builder: Builder) => { - storeVarUInteger(storageUsedShort._cells)(builder) + builder.storeUint(0b00, 2); + let cell1 = beginCell(); + cell1.storeSlice(libDescr.lib); + builder.storeRef(cell1); + storeHashmap(libDescr.publishers, storeTrue)(builder); + }) - storeVarUInteger(storageUsedShort.bits)(builder) +} +export function loadBlockInfo(slice: Slice): BlockInfo { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x9bc7a987))) { + slice.loadUint(32); + let version: number = slice.loadUint(32); + let not_master: number = slice.loadUint(1); + let after_merge: number = slice.loadUint(1); + let before_split: number = slice.loadUint(1); + let after_split: number = slice.loadUint(1); + let want_split: Bool = loadBool(slice); + let want_merge: Bool = loadBool(slice); + let key_block: Bool = loadBool(slice); + let vert_seqno_incr: number = slice.loadUint(1); + let flags: number = slice.loadUint(8); + let seq_no: number = slice.loadUint(32); + let vert_seq_no: number = slice.loadUint(32); + let shard: ShardIdent = loadShardIdent(slice); + let gen_utime: number = slice.loadUint(32); + let start_lt: number = slice.loadUint(64); + let end_lt: number = slice.loadUint(64); + let gen_validator_list_hash_short: number = slice.loadUint(32); + let gen_catchain_seqno: number = slice.loadUint(32); + let min_ref_mc_seqno: number = slice.loadUint(32); + let prev_key_block_seqno: number = slice.loadUint(32); + let gen_software: GlobalVersion | undefined = ((flags & (1 << 0)) ? loadGlobalVersion(slice) : undefined); + let master_ref: BlkMasterInfo | undefined = (not_master ? ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse(); + return loadBlkMasterInfo(slice1) +}) +(slice) : undefined); + let slice1 = slice.loadRef().beginParse(); + let prev_ref: BlkPrevInfo = loadBlkPrevInfo(slice1, after_merge); + let prev_vert_ref: BlkPrevInfo | undefined = (vert_seqno_incr ? ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse(); + return loadBlkPrevInfo(slice1, 0) }) +(slice) : undefined); + if ((!(flags <= 1))) { + throw new Error(''); + } + if ((!(vert_seq_no >= vert_seqno_incr))) { + throw new Error(''); + } + return { + kind: 'BlockInfo', + prev_seq_no: (seq_no - 1), + version: version, + not_master: not_master, + after_merge: after_merge, + before_split: before_split, + after_split: after_split, + want_split: want_split, + want_merge: want_merge, + key_block: key_block, + vert_seqno_incr: vert_seqno_incr, + flags: flags, + seq_no: seq_no, + vert_seq_no: vert_seq_no, + shard: shard, + gen_utime: gen_utime, + start_lt: start_lt, + end_lt: end_lt, + gen_validator_list_hash_short: gen_validator_list_hash_short, + gen_catchain_seqno: gen_catchain_seqno, + min_ref_mc_seqno: min_ref_mc_seqno, + prev_key_block_seqno: prev_key_block_seqno, + gen_software: gen_software, + master_ref: master_ref, + prev_ref: prev_ref, + prev_vert_ref: prev_vert_ref, + } -; + } + throw new Error(''); } -export function loadStorageInfo(slice: Slice): StorageInfo { - let used: StorageUsed = loadStorageUsed(slice) - -; - let last_paid: number = slice.loadUint(32) - -; - let due_payment: Maybe = loadMaybe(slice, loadGrams) +export function storeBlockInfo(blockInfo: BlockInfo): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x9bc7a987, 32); + builder.storeUint(blockInfo.version, 32); + builder.storeUint(blockInfo.not_master, 1); + builder.storeUint(blockInfo.after_merge, 1); + builder.storeUint(blockInfo.before_split, 1); + builder.storeUint(blockInfo.after_split, 1); + storeBool(blockInfo.want_split)(builder); + storeBool(blockInfo.want_merge)(builder); + storeBool(blockInfo.key_block)(builder); + builder.storeUint(blockInfo.vert_seqno_incr, 1); + builder.storeUint(blockInfo.flags, 8); + builder.storeUint(blockInfo.seq_no, 32); + builder.storeUint(blockInfo.vert_seq_no, 32); + storeShardIdent(blockInfo.shard)(builder); + builder.storeUint(blockInfo.gen_utime, 32); + builder.storeUint(blockInfo.start_lt, 64); + builder.storeUint(blockInfo.end_lt, 64); + builder.storeUint(blockInfo.gen_validator_list_hash_short, 32); + builder.storeUint(blockInfo.gen_catchain_seqno, 32); + builder.storeUint(blockInfo.min_ref_mc_seqno, 32); + builder.storeUint(blockInfo.prev_key_block_seqno, 32); + if ((blockInfo.gen_software != undefined)) { + storeGlobalVersion(blockInfo.gen_software)(builder); + } + if ((blockInfo.master_ref != undefined)) { + let cell1 = beginCell(); + + storeBlkMasterInfo(blockInfo.master_ref)(cell1); + + builder.storeRef(cell1); + + } + let cell1 = beginCell(); + storeBlkPrevInfo(blockInfo.prev_ref)(cell1); + builder.storeRef(cell1); + if ((blockInfo.prev_vert_ref != undefined)) { + let cell1 = beginCell(); + + storeBlkPrevInfo(blockInfo.prev_vert_ref)(cell1); + + builder.storeRef(cell1); + + } + if ((!(blockInfo.flags <= 1))) { + throw new Error(''); + } + if ((!(blockInfo.vert_seq_no >= blockInfo.vert_seqno_incr))) { + throw new Error(''); + } + }) -; - return { - kind: 'StorageInfo', - used: used, - last_paid: last_paid, - due_payment: due_payment, } -; -} +export function loadBlkPrevInfo(slice: Slice, arg0: number): BlkPrevInfo { + if ((arg0 == 0)) { + let prev: ExtBlkRef = loadExtBlkRef(slice); + return { + kind: 'BlkPrevInfo_prev_blk_info', + prev: prev, + } -export function storeStorageInfo(storageInfo: StorageInfo): (builder: Builder) => void { - return ((builder: Builder) => { - storeStorageUsed(storageInfo.used)(builder) + } + if ((arg0 == 1)) { + let slice1 = slice.loadRef().beginParse(); + let prev1: ExtBlkRef = loadExtBlkRef(slice1); + let slice2 = slice.loadRef().beginParse(); + let prev2: ExtBlkRef = loadExtBlkRef(slice2); + return { + kind: 'BlkPrevInfo_prev_blks_info', + prev1: prev1, + prev2: prev2, + } - builder.storeUint(storageInfo.last_paid, 32) + } + throw new Error(''); +} - storeMaybe(storageInfo.due_payment, storeGrams)(builder) +export function storeBlkPrevInfo(blkPrevInfo: BlkPrevInfo): (builder: Builder) => void { + if ((blkPrevInfo.kind == 'BlkPrevInfo_prev_blk_info')) { + return ((builder: Builder) => { + storeExtBlkRef(blkPrevInfo.prev)(builder); + }) -}) + } + if ((blkPrevInfo.kind == 'BlkPrevInfo_prev_blks_info')) { + return ((builder: Builder) => { + let cell1 = beginCell(); + storeExtBlkRef(blkPrevInfo.prev1)(cell1); + builder.storeRef(cell1); + let cell2 = beginCell(); + storeExtBlkRef(blkPrevInfo.prev2)(cell2); + builder.storeRef(cell2); + }) -; + } + throw new Error(''); } -export function loadAccount(slice: Slice): Account { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1) - return { - kind: 'Account_account_none', -} +export function loadBlock(slice: Slice): Block { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x11ef55aa))) { + slice.loadUint(32); + let global_id: number = slice.loadInt(32); + let slice1 = slice.loadRef().beginParse(); + let info: BlockInfo = loadBlockInfo(slice1); + let slice2 = slice.loadRef().beginParse(); + let value_flow: ValueFlow = loadValueFlow(slice2); + let slice3 = slice.loadRef().beginParse(); + let state_update: MERKLE_UPDATE = loadMERKLE_UPDATE(slice3, loadShardState); + let slice4 = slice.loadRef().beginParse(); + let extra: BlockExtra = loadBlockExtra(slice4); + return { + kind: 'Block', + global_id: global_id, + info: info, + value_flow: value_flow, + state_update: state_update, + extra: extra, + } + } + throw new Error(''); } -; - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1) - let addr: MsgAddressInt = loadMsgAddressInt(slice) - let storage_stat: StorageInfo = loadStorageInfo(slice) - - let storage: AccountStorage = loadAccountStorage(slice) - - return { - kind: 'Account_account', - addr: addr, - storage_stat: storage_stat, - storage: storage, -} +export function storeBlock(block: Block): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x11ef55aa, 32); + builder.storeInt(block.global_id, 32); + let cell1 = beginCell(); + storeBlockInfo(block.info)(cell1); + builder.storeRef(cell1); + let cell2 = beginCell(); + storeValueFlow(block.value_flow)(cell2); + builder.storeRef(cell2); + let cell3 = beginCell(); + storeMERKLE_UPDATE(block.state_update, storeShardState)(cell3); + builder.storeRef(cell3); + let cell4 = beginCell(); + storeBlockExtra(block.extra)(cell4); + builder.storeRef(cell4); + }) -} -; - throw new Error('') -; } -export function storeAccount(account: Account): (builder: Builder) => void { - if ((account.kind == 'Account_account_none')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1) - +export function loadBlockExtra(slice: Slice): BlockExtra { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x8e7f7ff8))) { + slice.loadUint(32); + let slice1 = slice.loadRef().beginParse(); + let in_msg_descr: InMsgDescr = loadInMsgDescr(slice1); + let slice2 = slice.loadRef().beginParse(); + let out_msg_descr: OutMsgDescr = loadOutMsgDescr(slice2); + let slice3 = slice.loadRef().beginParse(); + let account_blocks: ShardAccountBlocks = loadShardAccountBlocks(slice3); + let rand_seed: BitString = slice.loadBits(256); + let created_by: BitString = slice.loadBits(256); + let custom: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse(); + return loadMcBlockExtra(slice1) }) +); + return { + kind: 'BlockExtra', + in_msg_descr: in_msg_descr, + out_msg_descr: out_msg_descr, + account_blocks: account_blocks, + rand_seed: rand_seed, + created_by: created_by, + custom: custom, + } + } + throw new Error(''); } -; - if ((account.kind == 'Account_account')) { + +export function storeBlockExtra(blockExtra: BlockExtra): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0b1, 1) + builder.storeUint(0x8e7f7ff8, 32); + let cell1 = beginCell(); + storeInMsgDescr(blockExtra.in_msg_descr)(cell1); + builder.storeRef(cell1); + let cell2 = beginCell(); + storeOutMsgDescr(blockExtra.out_msg_descr)(cell2); + builder.storeRef(cell2); + let cell3 = beginCell(); + storeShardAccountBlocks(blockExtra.account_blocks)(cell3); + builder.storeRef(cell3); + builder.storeBits(blockExtra.rand_seed); + builder.storeBits(blockExtra.created_by); + storeMaybe(blockExtra.custom, ((arg: McBlockExtra) => { + return ((builder: Builder) => { + let cell1 = beginCell(); - storeMsgAddressInt(account.addr)(builder) + storeMcBlockExtra(arg)(cell1); - storeStorageInfo(account.storage_stat)(builder) + builder.storeRef(cell1); - storeAccountStorage(account.storage)(builder) + }) -}) + }) + )(builder); + }) } -; - throw new Error('') -; -} - -export function loadAccountStorage(slice: Slice): AccountStorage { - let last_trans_lt: number = slice.loadUint(64) - -; - let balance: CurrencyCollection = loadCurrencyCollection(slice) -; - let state: AccountState = loadAccountState(slice) - -; - return { - kind: 'AccountStorage', - last_trans_lt: last_trans_lt, - balance: balance, - state: state, -} +export function loadValueFlow(slice: Slice): ValueFlow { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x98055e37))) { + slice.loadUint(32); + let slice1 = slice.loadRef().beginParse(); + let from_prev_blk: CurrencyCollection = loadCurrencyCollection(slice1); + let to_next_blk: CurrencyCollection = loadCurrencyCollection(slice1); + let imported: CurrencyCollection = loadCurrencyCollection(slice1); + let exported: CurrencyCollection = loadCurrencyCollection(slice1); + let fees_collected: CurrencyCollection = loadCurrencyCollection(slice); + let slice2 = slice.loadRef().beginParse(); + let fees_imported: CurrencyCollection = loadCurrencyCollection(slice2); + let recovered: CurrencyCollection = loadCurrencyCollection(slice2); + let created: CurrencyCollection = loadCurrencyCollection(slice2); + let minted: CurrencyCollection = loadCurrencyCollection(slice2); + return { + kind: 'ValueFlow', + from_prev_blk: from_prev_blk, + to_next_blk: to_next_blk, + imported: imported, + exported: exported, + fees_collected: fees_collected, + fees_imported: fees_imported, + recovered: recovered, + created: created, + minted: minted, + } -; + } + throw new Error(''); } -export function storeAccountStorage(accountStorage: AccountStorage): (builder: Builder) => void { +export function storeValueFlow(valueFlow: ValueFlow): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(accountStorage.last_trans_lt, 64) + builder.storeUint(0x98055e37, 32); + let cell1 = beginCell(); + storeCurrencyCollection(valueFlow.from_prev_blk)(cell1); + storeCurrencyCollection(valueFlow.to_next_blk)(cell1); + storeCurrencyCollection(valueFlow.imported)(cell1); + storeCurrencyCollection(valueFlow.exported)(cell1); + builder.storeRef(cell1); + storeCurrencyCollection(valueFlow.fees_collected)(builder); + let cell2 = beginCell(); + storeCurrencyCollection(valueFlow.fees_imported)(cell2); + storeCurrencyCollection(valueFlow.recovered)(cell2); + storeCurrencyCollection(valueFlow.created)(cell2); + storeCurrencyCollection(valueFlow.minted)(cell2); + builder.storeRef(cell2); + }) - storeCurrencyCollection(accountStorage.balance)(builder) +} - storeAccountState(accountStorage.state)(builder) +export function loadBinTree(slice: Slice, loadX: (slice: Slice) => X +): BinTree { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { + slice.loadUint(1); + let leaf: X = loadX(slice); + return { + kind: 'BinTree_bt_leaf', + leaf: leaf, + } -}) + } + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { + slice.loadUint(1); + let slice1 = slice.loadRef().beginParse(); + let left: BinTree = loadBinTree(slice1, loadX); + let slice2 = slice.loadRef().beginParse(); + let right: BinTree = loadBinTree(slice2, loadX); + return { + kind: 'BinTree_bt_fork', + left: left, + right: right, + } -; + } + throw new Error(''); } -export function loadAccountState(slice: Slice): AccountState { - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { - slice.loadUint(2) - return { - kind: 'AccountState_account_uninit', -} +export function storeBinTree(binTree: BinTree, storeX: (x: X) => (builder: Builder) => void -} -; - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1) - let _: StateInit = loadStateInit(slice) +): (builder: Builder) => void { + if ((binTree.kind == 'BinTree_bt_leaf')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1); + storeX(binTree.leaf)(builder); + }) - return { - kind: 'AccountState_account_active', - _: _, -} + } + if ((binTree.kind == 'BinTree_bt_fork')) { + return ((builder: Builder) => { + builder.storeUint(0b1, 1); + let cell1 = beginCell(); + storeBinTree(binTree.left, storeX)(cell1); + builder.storeRef(cell1); + let cell2 = beginCell(); + storeBinTree(binTree.right, storeX)(cell2); + builder.storeRef(cell2); + }) + } + throw new Error(''); } -; - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b01))) { - slice.loadUint(2) - let state_hash: BitString = slice.loadBits(256) - return { - kind: 'AccountState_account_frozen', - state_hash: state_hash, -} - -} -; - throw new Error('') -; -} +export function loadFutureSplitMerge(slice: Slice): FutureSplitMerge { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { + slice.loadUint(1); + return { + kind: 'FutureSplitMerge_fsm_none', + } -export function storeAccountState(accountState: AccountState): (builder: Builder) => void { - if ((accountState.kind == 'AccountState_account_uninit')) { - return ((builder: Builder) => { - builder.storeUint(0b00, 2) + } + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b10))) { + slice.loadUint(2); + let split_utime: number = slice.loadUint(32); + let interval: number = slice.loadUint(32); + return { + kind: 'FutureSplitMerge_fsm_split', + split_utime: split_utime, + interval: interval, + } -}) + } + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b11))) { + slice.loadUint(2); + let merge_utime: number = slice.loadUint(32); + let interval: number = slice.loadUint(32); + return { + kind: 'FutureSplitMerge_fsm_merge', + merge_utime: merge_utime, + interval: interval, + } + } + throw new Error(''); } -; - if ((accountState.kind == 'AccountState_account_active')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1) - storeStateInit(accountState._)(builder) +export function storeFutureSplitMerge(futureSplitMerge: FutureSplitMerge): (builder: Builder) => void { + if ((futureSplitMerge.kind == 'FutureSplitMerge_fsm_none')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1); + }) -}) + } + if ((futureSplitMerge.kind == 'FutureSplitMerge_fsm_split')) { + return ((builder: Builder) => { + builder.storeUint(0b10, 2); + builder.storeUint(futureSplitMerge.split_utime, 32); + builder.storeUint(futureSplitMerge.interval, 32); + }) + + } + if ((futureSplitMerge.kind == 'FutureSplitMerge_fsm_merge')) { + return ((builder: Builder) => { + builder.storeUint(0b11, 2); + builder.storeUint(futureSplitMerge.merge_utime, 32); + builder.storeUint(futureSplitMerge.interval, 32); + }) + } + throw new Error(''); } -; - if ((accountState.kind == 'AccountState_account_frozen')) { - return ((builder: Builder) => { - builder.storeUint(0b01, 2) - builder.storeBits(accountState.state_hash) +export function loadShardDescr(slice: Slice): ShardDescr { + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0xb))) { + slice.loadUint(4); + let seq_no: number = slice.loadUint(32); + let reg_mc_seqno: number = slice.loadUint(32); + let start_lt: number = slice.loadUint(64); + let end_lt: number = slice.loadUint(64); + let root_hash: BitString = slice.loadBits(256); + let file_hash: BitString = slice.loadBits(256); + let before_split: Bool = loadBool(slice); + let before_merge: Bool = loadBool(slice); + let want_split: Bool = loadBool(slice); + let want_merge: Bool = loadBool(slice); + let nx_cc_updated: Bool = loadBool(slice); + let flags: number = slice.loadUint(3); + let next_catchain_seqno: number = slice.loadUint(32); + let next_validator_shard: number = slice.loadUint(64); + let min_ref_mc_seqno: number = slice.loadUint(32); + let gen_utime: number = slice.loadUint(32); + let split_merge_at: FutureSplitMerge = loadFutureSplitMerge(slice); + let fees_collected: CurrencyCollection = loadCurrencyCollection(slice); + let funds_created: CurrencyCollection = loadCurrencyCollection(slice); + if ((!(flags == 0))) { + throw new Error(''); + } + return { + kind: 'ShardDescr_shard_descr', + seq_no: seq_no, + reg_mc_seqno: reg_mc_seqno, + start_lt: start_lt, + end_lt: end_lt, + root_hash: root_hash, + file_hash: file_hash, + before_split: before_split, + before_merge: before_merge, + want_split: want_split, + want_merge: want_merge, + nx_cc_updated: nx_cc_updated, + flags: flags, + next_catchain_seqno: next_catchain_seqno, + next_validator_shard: next_validator_shard, + min_ref_mc_seqno: min_ref_mc_seqno, + gen_utime: gen_utime, + split_merge_at: split_merge_at, + fees_collected: fees_collected, + funds_created: funds_created, + } -}) + } + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0xa))) { + slice.loadUint(4); + let seq_no: number = slice.loadUint(32); + let reg_mc_seqno: number = slice.loadUint(32); + let start_lt: number = slice.loadUint(64); + let end_lt: number = slice.loadUint(64); + let root_hash: BitString = slice.loadBits(256); + let file_hash: BitString = slice.loadBits(256); + let before_split: Bool = loadBool(slice); + let before_merge: Bool = loadBool(slice); + let want_split: Bool = loadBool(slice); + let want_merge: Bool = loadBool(slice); + let nx_cc_updated: Bool = loadBool(slice); + let flags: number = slice.loadUint(3); + let next_catchain_seqno: number = slice.loadUint(32); + let next_validator_shard: number = slice.loadUint(64); + let min_ref_mc_seqno: number = slice.loadUint(32); + let gen_utime: number = slice.loadUint(32); + let split_merge_at: FutureSplitMerge = loadFutureSplitMerge(slice); + let slice1 = slice.loadRef().beginParse(); + let fees_collected: CurrencyCollection = loadCurrencyCollection(slice1); + let funds_created: CurrencyCollection = loadCurrencyCollection(slice1); + if ((!(flags == 0))) { + throw new Error(''); + } + return { + kind: 'ShardDescr_shard_descr_new', + seq_no: seq_no, + reg_mc_seqno: reg_mc_seqno, + start_lt: start_lt, + end_lt: end_lt, + root_hash: root_hash, + file_hash: file_hash, + before_split: before_split, + before_merge: before_merge, + want_split: want_split, + want_merge: want_merge, + nx_cc_updated: nx_cc_updated, + flags: flags, + next_catchain_seqno: next_catchain_seqno, + next_validator_shard: next_validator_shard, + min_ref_mc_seqno: min_ref_mc_seqno, + gen_utime: gen_utime, + split_merge_at: split_merge_at, + fees_collected: fees_collected, + funds_created: funds_created, + } -} -; - throw new Error('') -; + } + throw new Error(''); } -export function loadAccountStatus(slice: Slice): AccountStatus { - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { - slice.loadUint(2) - return { - kind: 'AccountStatus_acc_state_uninit', -} +export function storeShardDescr(shardDescr: ShardDescr): (builder: Builder) => void { + if ((shardDescr.kind == 'ShardDescr_shard_descr')) { + return ((builder: Builder) => { + builder.storeUint(0xb, 4); + builder.storeUint(shardDescr.seq_no, 32); + builder.storeUint(shardDescr.reg_mc_seqno, 32); + builder.storeUint(shardDescr.start_lt, 64); + builder.storeUint(shardDescr.end_lt, 64); + builder.storeBits(shardDescr.root_hash); + builder.storeBits(shardDescr.file_hash); + storeBool(shardDescr.before_split)(builder); + storeBool(shardDescr.before_merge)(builder); + storeBool(shardDescr.want_split)(builder); + storeBool(shardDescr.want_merge)(builder); + storeBool(shardDescr.nx_cc_updated)(builder); + builder.storeUint(shardDescr.flags, 3); + builder.storeUint(shardDescr.next_catchain_seqno, 32); + builder.storeUint(shardDescr.next_validator_shard, 64); + builder.storeUint(shardDescr.min_ref_mc_seqno, 32); + builder.storeUint(shardDescr.gen_utime, 32); + storeFutureSplitMerge(shardDescr.split_merge_at)(builder); + storeCurrencyCollection(shardDescr.fees_collected)(builder); + storeCurrencyCollection(shardDescr.funds_created)(builder); + if ((!(shardDescr.flags == 0))) { + throw new Error(''); + } + }) -} -; - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b01))) { - slice.loadUint(2) - return { - kind: 'AccountStatus_acc_state_frozen', -} + } + if ((shardDescr.kind == 'ShardDescr_shard_descr_new')) { + return ((builder: Builder) => { + builder.storeUint(0xa, 4); + builder.storeUint(shardDescr.seq_no, 32); + builder.storeUint(shardDescr.reg_mc_seqno, 32); + builder.storeUint(shardDescr.start_lt, 64); + builder.storeUint(shardDescr.end_lt, 64); + builder.storeBits(shardDescr.root_hash); + builder.storeBits(shardDescr.file_hash); + storeBool(shardDescr.before_split)(builder); + storeBool(shardDescr.before_merge)(builder); + storeBool(shardDescr.want_split)(builder); + storeBool(shardDescr.want_merge)(builder); + storeBool(shardDescr.nx_cc_updated)(builder); + builder.storeUint(shardDescr.flags, 3); + builder.storeUint(shardDescr.next_catchain_seqno, 32); + builder.storeUint(shardDescr.next_validator_shard, 64); + builder.storeUint(shardDescr.min_ref_mc_seqno, 32); + builder.storeUint(shardDescr.gen_utime, 32); + storeFutureSplitMerge(shardDescr.split_merge_at)(builder); + let cell1 = beginCell(); + storeCurrencyCollection(shardDescr.fees_collected)(cell1); + storeCurrencyCollection(shardDescr.funds_created)(cell1); + builder.storeRef(cell1); + if ((!(shardDescr.flags == 0))) { + throw new Error(''); + } + }) -} -; - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b10))) { - slice.loadUint(2) - return { - kind: 'AccountStatus_acc_state_active', + } + throw new Error(''); } -} -; - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b11))) { - slice.loadUint(2) - return { - kind: 'AccountStatus_acc_state_nonexist', -} +export function loadShardHashes(slice: Slice): ShardHashes { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xd7c80ab1))) { + slice.loadUint(32); + let anon0: HashmapE> = loadHashmapE>(slice, 32, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse(); + return loadBinTree(slice1, loadShardDescr) +}) +); + return { + kind: 'ShardHashes', + anon0: anon0, + } -} -; - throw new Error('') -; + } + throw new Error(''); } -export function storeAccountStatus(accountStatus: AccountStatus): (builder: Builder) => void { - if ((accountStatus.kind == 'AccountStatus_acc_state_uninit')) { +export function storeShardHashes(shardHashes: ShardHashes): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0b00, 2) - -}) + builder.storeUint(0xd7c80ab1, 32); + storeHashmapE>(shardHashes.anon0, ((arg: BinTree) => { + return ((builder: Builder) => { + let cell1 = beginCell(); -} -; - if ((accountStatus.kind == 'AccountStatus_acc_state_frozen')) { - return ((builder: Builder) => { - builder.storeUint(0b01, 2) + storeBinTree(arg, storeShardDescr)(cell1); -}) + builder.storeRef(cell1); -} -; - if ((accountStatus.kind == 'AccountStatus_acc_state_active')) { - return ((builder: Builder) => { - builder.storeUint(0b10, 2) + }) -}) + }) + )(builder); + }) } -; - if ((accountStatus.kind == 'AccountStatus_acc_state_nonexist')) { - return ((builder: Builder) => { - builder.storeUint(0b11, 2) -}) +export function loadBinTreeAug(slice: Slice, loadX: (slice: Slice) => X +, loadY: (slice: Slice) => Y +): BinTreeAug { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { + slice.loadUint(1); + let extra: Y = loadY(slice); + let leaf: X = loadX(slice); + return { + kind: 'BinTreeAug_bta_leaf', + extra: extra, + leaf: leaf, + } -} -; - throw new Error('') -; + } + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { + slice.loadUint(1); + let slice1 = slice.loadRef().beginParse(); + let left: BinTreeAug = loadBinTreeAug(slice1, loadX, loadY); + let slice2 = slice.loadRef().beginParse(); + let right: BinTreeAug = loadBinTreeAug(slice2, loadX, loadY); + let extra: Y = loadY(slice); + return { + kind: 'BinTreeAug_bta_fork', + left: left, + right: right, + extra: extra, + } + + } + throw new Error(''); } -export function loadShardAccount(slice: Slice): ShardAccount { - let slice1 = slice.loadRef().beginParse() +export function storeBinTreeAug(binTreeAug: BinTreeAug, storeX: (x: X) => (builder: Builder) => void -; - let account: Account = loadAccount(slice1) +, storeY: (y: Y) => (builder: Builder) => void -; - let last_trans_hash: BitString = slice.loadBits(256) +): (builder: Builder) => void { + if ((binTreeAug.kind == 'BinTreeAug_bta_leaf')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1); + storeY(binTreeAug.extra)(builder); + storeX(binTreeAug.leaf)(builder); + }) -; - let last_trans_lt: number = slice.loadUint(64) + } + if ((binTreeAug.kind == 'BinTreeAug_bta_fork')) { + return ((builder: Builder) => { + builder.storeUint(0b1, 1); + let cell1 = beginCell(); + storeBinTreeAug(binTreeAug.left, storeX, storeY)(cell1); + builder.storeRef(cell1); + let cell2 = beginCell(); + storeBinTreeAug(binTreeAug.right, storeX, storeY)(cell2); + builder.storeRef(cell2); + storeY(binTreeAug.extra)(builder); + }) -; - return { - kind: 'ShardAccount', - account: account, - last_trans_hash: last_trans_hash, - last_trans_lt: last_trans_lt, + } + throw new Error(''); } -; +export function loadShardFeeCreated(slice: Slice): ShardFeeCreated { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xe537952e))) { + slice.loadUint(32); + let fees: CurrencyCollection = loadCurrencyCollection(slice); + let create: CurrencyCollection = loadCurrencyCollection(slice); + return { + kind: 'ShardFeeCreated', + fees: fees, + create: create, + } + + } + throw new Error(''); } -export function storeShardAccount(shardAccount: ShardAccount): (builder: Builder) => void { +export function storeShardFeeCreated(shardFeeCreated: ShardFeeCreated): (builder: Builder) => void { return ((builder: Builder) => { - let cell1 = beginCell() + builder.storeUint(0xe537952e, 32); + storeCurrencyCollection(shardFeeCreated.fees)(builder); + storeCurrencyCollection(shardFeeCreated.create)(builder); + }) +} - storeAccount(shardAccount.account)(cell1) +export function loadShardFees(slice: Slice): ShardFees { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xfea0d880))) { + slice.loadUint(32); + let anon0: HashmapAugE = loadHashmapAugE(slice, 96, loadShardFeeCreated, loadShardFeeCreated); + return { + kind: 'ShardFees', + anon0: anon0, + } - builder.storeRef(cell1) + } + throw new Error(''); +} - builder.storeBits(shardAccount.last_trans_hash) +export function storeShardFees(shardFees: ShardFees): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xfea0d880, 32); + storeHashmapAugE(shardFees.anon0, storeShardFeeCreated, storeShardFeeCreated)(builder); + }) - builder.storeUint(shardAccount.last_trans_lt, 64) +} +export function loadConfigParams(slice: Slice): ConfigParams { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x88116702))) { + slice.loadUint(32); + let config_addr: BitString = slice.loadBits(256); + let slice1 = slice.loadRef().beginParse(); + let config: Hashmap = loadHashmap(slice1, 32, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse(); + return slice1 }) +); + return { + kind: 'ConfigParams', + config_addr: config_addr, + config: config, + } -; + } + throw new Error(''); } -export function loadDepthBalanceInfo(slice: Slice): DepthBalanceInfo { - let split_depth: number = slice.loadUint(bitLen(30)) +export function storeConfigParams(configParams: ConfigParams): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x88116702, 32); + builder.storeBits(configParams.config_addr); + let cell1 = beginCell(); + storeHashmap(configParams.config, ((arg: Slice) => { + return ((builder: Builder) => { + let cell1 = beginCell(); -; - let balance: CurrencyCollection = loadCurrencyCollection(slice) + cell1.storeSlice(arg); -; - return { - kind: 'DepthBalanceInfo', - split_depth: split_depth, - balance: balance, -} + builder.storeRef(cell1); -; -} + }) -export function storeDepthBalanceInfo(depthBalanceInfo: DepthBalanceInfo): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(depthBalanceInfo.split_depth, bitLen(30)) + }) + )(cell1); + builder.storeRef(cell1); + }) - storeCurrencyCollection(depthBalanceInfo.balance)(builder) +} -}) +export function loadValidatorInfo(slice: Slice): ValidatorInfo { + let validator_list_hash_short: number = slice.loadUint(32); + let catchain_seqno: number = slice.loadUint(32); + let nx_cc_updated: Bool = loadBool(slice); + return { + kind: 'ValidatorInfo', + validator_list_hash_short: validator_list_hash_short, + catchain_seqno: catchain_seqno, + nx_cc_updated: nx_cc_updated, + } -; } -export function loadShardAccounts(slice: Slice): ShardAccounts { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xa59aef08))) { - slice.loadUint(32) - let anon0: HashmapAugE = loadHashmapAugE(slice, 256, loadShardAccount, loadDepthBalanceInfo) +export function storeValidatorInfo(validatorInfo: ValidatorInfo): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(validatorInfo.validator_list_hash_short, 32); + builder.storeUint(validatorInfo.catchain_seqno, 32); + storeBool(validatorInfo.nx_cc_updated)(builder); + }) - return { - kind: 'ShardAccounts', - anon0: anon0, } -} -; - throw new Error('') -; +export function loadValidatorBaseInfo(slice: Slice): ValidatorBaseInfo { + let validator_list_hash_short: number = slice.loadUint(32); + let catchain_seqno: number = slice.loadUint(32); + return { + kind: 'ValidatorBaseInfo', + validator_list_hash_short: validator_list_hash_short, + catchain_seqno: catchain_seqno, + } + } -export function storeShardAccounts(shardAccounts: ShardAccounts): (builder: Builder) => void { +export function storeValidatorBaseInfo(validatorBaseInfo: ValidatorBaseInfo): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xa59aef08, 32) + builder.storeUint(validatorBaseInfo.validator_list_hash_short, 32); + builder.storeUint(validatorBaseInfo.catchain_seqno, 32); + }) - storeHashmapAugE(shardAccounts.anon0, storeShardAccount, storeDepthBalanceInfo)(builder) +} -}) +export function loadKeyMaxLt(slice: Slice): KeyMaxLt { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x9a6d79a5))) { + slice.loadUint(32); + let key: Bool = loadBool(slice); + let max_end_lt: number = slice.loadUint(64); + return { + kind: 'KeyMaxLt', + key: key, + max_end_lt: max_end_lt, + } -; + } + throw new Error(''); } -export function loadTransaction(slice: Slice): Transaction { - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b0111))) { - slice.loadUint(4) - let account_addr: BitString = slice.loadBits(256) +export function storeKeyMaxLt(keyMaxLt: KeyMaxLt): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x9a6d79a5, 32); + storeBool(keyMaxLt.key)(builder); + builder.storeUint(keyMaxLt.max_end_lt, 64); + }) - let lt: number = slice.loadUint(64) +} - let prev_trans_hash: BitString = slice.loadBits(256) +export function loadKeyExtBlkRef(slice: Slice): KeyExtBlkRef { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xafeab488))) { + slice.loadUint(32); + let key: Bool = loadBool(slice); + let blk_ref: ExtBlkRef = loadExtBlkRef(slice); + return { + kind: 'KeyExtBlkRef', + key: key, + blk_ref: blk_ref, + } - let prev_trans_lt: number = slice.loadUint(64) + } + throw new Error(''); +} - let now: number = slice.loadUint(32) +export function storeKeyExtBlkRef(keyExtBlkRef: KeyExtBlkRef): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xafeab488, 32); + storeBool(keyExtBlkRef.key)(builder); + storeExtBlkRef(keyExtBlkRef.blk_ref)(builder); + }) - let outmsg_cnt: number = slice.loadUint(15) +} - let orig_status: AccountStatus = loadAccountStatus(slice) +export function loadOldMcBlocksInfo(slice: Slice): OldMcBlocksInfo { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xf385c1e3))) { + slice.loadUint(32); + let anon0: HashmapAugE = loadHashmapAugE(slice, 32, loadKeyExtBlkRef, loadKeyMaxLt); + return { + kind: 'OldMcBlocksInfo', + anon0: anon0, + } - let end_status: AccountStatus = loadAccountStatus(slice) + } + throw new Error(''); +} - let slice1 = slice.loadRef().beginParse() +export function storeOldMcBlocksInfo(oldMcBlocksInfo: OldMcBlocksInfo): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xf385c1e3, 32); + storeHashmapAugE(oldMcBlocksInfo.anon0, storeKeyExtBlkRef, storeKeyMaxLt)(builder); + }) - let in_msg: Maybe> = loadMaybe>(slice1, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() +} +export function loadCounters(slice: Slice): Counters { + let last_updated: number = slice.loadUint(32); + let total: number = slice.loadUint(64); + let cnt2048: number = slice.loadUint(64); + let cnt65536: number = slice.loadUint(64); + return { + kind: 'Counters', + last_updated: last_updated, + total: total, + cnt2048: cnt2048, + cnt65536: cnt65536, + } - return loadMessage(slice1, ((slice: Slice) => { - return slice +} +export function storeCounters(counters: Counters): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(counters.last_updated, 32); + builder.storeUint(counters.total, 64); + builder.storeUint(counters.cnt2048, 64); + builder.storeUint(counters.cnt65536, 64); }) - ) - -}) -) - let out_msgs: HashmapE> = loadHashmapE>(slice1, 15, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() +} +export function loadCreatorStats(slice: Slice): CreatorStats { + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0x4))) { + slice.loadUint(4); + let mc_blocks: Counters = loadCounters(slice); + let shard_blocks: Counters = loadCounters(slice); + return { + kind: 'CreatorStats', + mc_blocks: mc_blocks, + shard_blocks: shard_blocks, + } - return loadMessage(slice1, ((slice: Slice) => { - return slice + } + throw new Error(''); +} +export function storeCreatorStats(creatorStats: CreatorStats): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x4, 4); + storeCounters(creatorStats.mc_blocks)(builder); + storeCounters(creatorStats.shard_blocks)(builder); }) - ) -}) -) +} + +export function loadBlockCreateStats(slice: Slice): BlockCreateStats { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x17))) { + slice.loadUint(8); + let counters: HashmapE = loadHashmapE(slice, 256, loadCreatorStats); + return { + kind: 'BlockCreateStats_block_create_stats', + counters: counters, + } - let total_fees: CurrencyCollection = loadCurrencyCollection(slice) + } + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x34))) { + slice.loadUint(8); + let counters: HashmapAugE = loadHashmapAugE(slice, 256, loadCreatorStats, ((slice: Slice) => { + return slice.loadUint(32) +}) +); + return { + kind: 'BlockCreateStats_block_create_stats_ext', + counters: counters, + } - let slice2 = slice.loadRef().beginParse() + } + throw new Error(''); +} - let state_update: HASH_UPDATE = loadHASH_UPDATE(slice2, loadAccount) +export function storeBlockCreateStats(blockCreateStats: BlockCreateStats): (builder: Builder) => void { + if ((blockCreateStats.kind == 'BlockCreateStats_block_create_stats')) { + return ((builder: Builder) => { + builder.storeUint(0x17, 8); + storeHashmapE(blockCreateStats.counters, storeCreatorStats)(builder); + }) - let slice3 = slice.loadRef().beginParse() + } + if ((blockCreateStats.kind == 'BlockCreateStats_block_create_stats_ext')) { + return ((builder: Builder) => { + builder.storeUint(0x34, 8); + storeHashmapAugE(blockCreateStats.counters, storeCreatorStats, ((arg: number) => { + return ((builder: Builder) => { + builder.storeUint(arg, 32); + }) - let description: TransactionDescr = loadTransactionDescr(slice3) + }) + )(builder); + }) - return { - kind: 'Transaction', - account_addr: account_addr, - lt: lt, - prev_trans_hash: prev_trans_hash, - prev_trans_lt: prev_trans_lt, - now: now, - outmsg_cnt: outmsg_cnt, - orig_status: orig_status, - end_status: end_status, - in_msg: in_msg, - out_msgs: out_msgs, - total_fees: total_fees, - state_update: state_update, - description: description, + } + throw new Error(''); } -} -; - throw new Error('') -; +export function loadMcStateExtra(slice: Slice): McStateExtra { + if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0xcc26))) { + slice.loadUint(16); + let shard_hashes: ShardHashes = loadShardHashes(slice); + let config: ConfigParams = loadConfigParams(slice); + let slice1 = slice.loadRef().beginParse(); + let flags: number = slice1.loadUint(16); + let validator_info: ValidatorInfo = loadValidatorInfo(slice1); + let prev_blocks: OldMcBlocksInfo = loadOldMcBlocksInfo(slice1); + let after_key_block: Bool = loadBool(slice1); + let last_key_block: Maybe = loadMaybe(slice1, loadExtBlkRef); + let block_create_stats: BlockCreateStats | undefined = ((flags & (1 << 0)) ? loadBlockCreateStats(slice1) : undefined); + let global_balance: CurrencyCollection = loadCurrencyCollection(slice); + return { + kind: 'McStateExtra', + shard_hashes: shard_hashes, + config: config, + flags: flags, + validator_info: validator_info, + prev_blocks: prev_blocks, + after_key_block: after_key_block, + last_key_block: last_key_block, + block_create_stats: block_create_stats, + global_balance: global_balance, + } + + } + throw new Error(''); } -export function storeTransaction(transaction: Transaction): (builder: Builder) => void { +export function storeMcStateExtra(mcStateExtra: McStateExtra): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0b0111, 4) - - builder.storeBits(transaction.account_addr) + builder.storeUint(0xcc26, 16); + storeShardHashes(mcStateExtra.shard_hashes)(builder); + storeConfigParams(mcStateExtra.config)(builder); + let cell1 = beginCell(); + cell1.storeUint(mcStateExtra.flags, 16); + storeValidatorInfo(mcStateExtra.validator_info)(cell1); + storeOldMcBlocksInfo(mcStateExtra.prev_blocks)(cell1); + storeBool(mcStateExtra.after_key_block)(cell1); + storeMaybe(mcStateExtra.last_key_block, storeExtBlkRef)(cell1); + if ((mcStateExtra.block_create_stats != undefined)) { + storeBlockCreateStats(mcStateExtra.block_create_stats)(cell1); + } + builder.storeRef(cell1); + storeCurrencyCollection(mcStateExtra.global_balance)(builder); + }) - builder.storeUint(transaction.lt, 64) +} - builder.storeBits(transaction.prev_trans_hash) +export function loadSigPubKey(slice: Slice): SigPubKey { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x8e81278a))) { + slice.loadUint(32); + let pubkey: BitString = slice.loadBits(256); + return { + kind: 'SigPubKey', + pubkey: pubkey, + } - builder.storeUint(transaction.prev_trans_lt, 64) + } + throw new Error(''); +} - builder.storeUint(transaction.now, 32) +export function storeSigPubKey(sigPubKey: SigPubKey): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x8e81278a, 32); + builder.storeBits(sigPubKey.pubkey); + }) - builder.storeUint(transaction.outmsg_cnt, 15) +} - storeAccountStatus(transaction.orig_status)(builder) +export function loadCryptoSignatureSimple(slice: Slice): CryptoSignatureSimple { + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0x5))) { + slice.loadUint(4); + let R: BitString = slice.loadBits(256); + let s: BitString = slice.loadBits(256); + return { + kind: 'CryptoSignatureSimple', + R: R, + s: s, + } - storeAccountStatus(transaction.end_status)(builder) + } + throw new Error(''); +} - let cell1 = beginCell() - - - storeMaybe>(transaction.in_msg, ((arg: Message) => { - return ((builder: Builder) => { - let cell1 = beginCell() - - - storeMessage(arg, ((arg: Slice) => { - return ((builder: Builder) => { - cell1.storeSlice(arg) - - }) +export function storeCryptoSignatureSimple(cryptoSignatureSimple: CryptoSignatureSimple): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x5, 4); + builder.storeBits(cryptoSignatureSimple.R); + builder.storeBits(cryptoSignatureSimple.s); + }) +} - }) - )(cell1) +export function loadCryptoSignature(slice: Slice): CryptoSignature { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xdaa99887))) { + slice.loadUint(32); + let anon0: CryptoSignatureSimple = loadCryptoSignatureSimple(slice); + return { + kind: 'CryptoSignature__', + anon0: anon0, + } - builder.storeRef(cell1) + } + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0xf))) { + slice.loadUint(4); + let slice1 = slice.loadRef().beginParse(); + let signed_cert: SignedCertificate = loadSignedCertificate(slice1); + let temp_key_signature: CryptoSignatureSimple = loadCryptoSignatureSimple(slice); + return { + kind: 'CryptoSignature_chained_signature', + signed_cert: signed_cert, + temp_key_signature: temp_key_signature, + } + } + throw new Error(''); +} +export function storeCryptoSignature(cryptoSignature: CryptoSignature): (builder: Builder) => void { + if ((cryptoSignature.kind == 'CryptoSignature__')) { + return ((builder: Builder) => { + builder.storeUint(0xdaa99887, 32); + storeCryptoSignatureSimple(cryptoSignature.anon0)(builder); }) - - }) - )(cell1) - - storeHashmapE>(transaction.out_msgs, ((arg: Message) => { + } + if ((cryptoSignature.kind == 'CryptoSignature_chained_signature')) { return ((builder: Builder) => { - let cell1 = beginCell() - - - storeMessage(arg, ((arg: Slice) => { - return ((builder: Builder) => { - cell1.storeSlice(arg) - - }) - - - }) - )(cell1) - - builder.storeRef(cell1) - - + builder.storeUint(0xf, 4); + let cell1 = beginCell(); + storeSignedCertificate(cryptoSignature.signed_cert)(cell1); + builder.storeRef(cell1); + storeCryptoSignatureSimple(cryptoSignature.temp_key_signature)(builder); }) + } + throw new Error(''); +} - }) - )(cell1) - - builder.storeRef(cell1) - - storeCurrencyCollection(transaction.total_fees)(builder) - - let cell2 = beginCell() - - - storeHASH_UPDATE(transaction.state_update, storeAccount)(cell2) - - builder.storeRef(cell2) - - let cell3 = beginCell() +export function loadCryptoSignaturePair(slice: Slice): CryptoSignaturePair { + let node_id_short: BitString = slice.loadBits(256); + let sign: CryptoSignature = loadCryptoSignature(slice); + return { + kind: 'CryptoSignaturePair', + node_id_short: node_id_short, + sign: sign, + } +} - storeTransactionDescr(transaction.description)(cell3) +export function storeCryptoSignaturePair(cryptoSignaturePair: CryptoSignaturePair): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeBits(cryptoSignaturePair.node_id_short); + storeCryptoSignature(cryptoSignaturePair.sign)(builder); + }) - builder.storeRef(cell3) +} -}) +export function loadCertificate(slice: Slice): Certificate { + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0x4))) { + slice.loadUint(4); + let temp_key: SigPubKey = loadSigPubKey(slice); + let valid_since: number = slice.loadUint(32); + let valid_until: number = slice.loadUint(32); + return { + kind: 'Certificate', + temp_key: temp_key, + valid_since: valid_since, + valid_until: valid_until, + } -; + } + throw new Error(''); } -export function loadMERKLE_UPDATE(slice: Slice, loadX: (slice: Slice) => X -): MERKLE_UPDATE { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x02))) { - slice.loadUint(8) - let old_hash: BitString = slice.loadBits(256) +export function storeCertificate(certificate: Certificate): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x4, 4); + storeSigPubKey(certificate.temp_key)(builder); + builder.storeUint(certificate.valid_since, 32); + builder.storeUint(certificate.valid_until, 32); + }) - let new_hash: BitString = slice.loadBits(256) +} - let slice1 = slice.loadRef().beginParse() +export function loadCertificateEnv(slice: Slice): CertificateEnv { + if (((slice.remainingBits >= 28) && (slice.preloadUint(28) == 0xa419b7d))) { + slice.loadUint(28); + let certificate: Certificate = loadCertificate(slice); + return { + kind: 'CertificateEnv', + certificate: certificate, + } - let old: X = loadX(slice1) + } + throw new Error(''); +} - let slice2 = slice.loadRef().beginParse() +export function storeCertificateEnv(certificateEnv: CertificateEnv): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xa419b7d, 28); + storeCertificate(certificateEnv.certificate)(builder); + }) - let new0: X = loadX(slice2) +} +export function loadSignedCertificate(slice: Slice): SignedCertificate { + let certificate: Certificate = loadCertificate(slice); + let certificate_signature: CryptoSignature = loadCryptoSignature(slice); return { - kind: 'MERKLE_UPDATE', - old_hash: old_hash, - new_hash: new_hash, - old: old, - new0: new0, -} + kind: 'SignedCertificate', + certificate: certificate, + certificate_signature: certificate_signature, + } } -; - throw new Error('') -; -} - -export function storeMERKLE_UPDATE(mERKLE_UPDATE: MERKLE_UPDATE, storeX: (x: X) => (builder: Builder) => void -): (builder: Builder) => void { +export function storeSignedCertificate(signedCertificate: SignedCertificate): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0x02, 8) + storeCertificate(signedCertificate.certificate)(builder); + storeCryptoSignature(signedCertificate.certificate_signature)(builder); + }) + +} - builder.storeBits(mERKLE_UPDATE.old_hash) +export function loadMcBlockExtra(slice: Slice): McBlockExtra { + if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0xcca5))) { + slice.loadUint(16); + let key_block: number = slice.loadUint(1); + let shard_hashes: ShardHashes = loadShardHashes(slice); + let shard_fees: ShardFees = loadShardFees(slice); + let slice1 = slice.loadRef().beginParse(); + let prev_blk_signatures: HashmapE = loadHashmapE(slice1, 16, loadCryptoSignaturePair); + let recover_create_msg: Maybe = loadMaybe(slice1, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse(); + return loadInMsg(slice1) +}) +); + let mint_msg: Maybe = loadMaybe(slice1, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse(); + return loadInMsg(slice1) +}) +); + let config: ConfigParams | undefined = (key_block ? loadConfigParams(slice) : undefined); + return { + kind: 'McBlockExtra', + key_block: key_block, + shard_hashes: shard_hashes, + shard_fees: shard_fees, + prev_blk_signatures: prev_blk_signatures, + recover_create_msg: recover_create_msg, + mint_msg: mint_msg, + config: config, + } - builder.storeBits(mERKLE_UPDATE.new_hash) + } + throw new Error(''); +} - let cell1 = beginCell() +export function storeMcBlockExtra(mcBlockExtra: McBlockExtra): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xcca5, 16); + builder.storeUint(mcBlockExtra.key_block, 1); + storeShardHashes(mcBlockExtra.shard_hashes)(builder); + storeShardFees(mcBlockExtra.shard_fees)(builder); + let cell1 = beginCell(); + storeHashmapE(mcBlockExtra.prev_blk_signatures, storeCryptoSignaturePair)(cell1); + storeMaybe(mcBlockExtra.recover_create_msg, ((arg: InMsg) => { + return ((builder: Builder) => { + let cell1 = beginCell(); + storeInMsg(arg)(cell1); - storeX(mERKLE_UPDATE.old)(cell1) + builder.storeRef(cell1); - builder.storeRef(cell1) + }) - let cell2 = beginCell() + }) + )(cell1); + storeMaybe(mcBlockExtra.mint_msg, ((arg: InMsg) => { + return ((builder: Builder) => { + let cell1 = beginCell(); + storeInMsg(arg)(cell1); - storeX(mERKLE_UPDATE.new0)(cell2) + builder.storeRef(cell1); - builder.storeRef(cell2) + }) -}) + }) + )(cell1); + builder.storeRef(cell1); + if ((mcBlockExtra.config != undefined)) { + storeConfigParams(mcBlockExtra.config)(builder); + } + }) -; } -export function loadHASH_UPDATE(slice: Slice, loadX: (slice: Slice) => X -): HASH_UPDATE { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x72))) { - slice.loadUint(8) - let old_hash: BitString = slice.loadBits(256) - - let new_hash: BitString = slice.loadBits(256) +export function loadValidatorDescr(slice: Slice): ValidatorDescr { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x53))) { + slice.loadUint(8); + let public_key: SigPubKey = loadSigPubKey(slice); + let weight: number = slice.loadUint(64); + return { + kind: 'ValidatorDescr_validator', + public_key: public_key, + weight: weight, + } - return { - kind: 'HASH_UPDATE', - old_hash: old_hash, - new_hash: new_hash, -} + } + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x73))) { + slice.loadUint(8); + let public_key: SigPubKey = loadSigPubKey(slice); + let weight: number = slice.loadUint(64); + let adnl_addr: BitString = slice.loadBits(256); + return { + kind: 'ValidatorDescr_validator_addr', + public_key: public_key, + weight: weight, + adnl_addr: adnl_addr, + } -} -; - throw new Error('') -; + } + throw new Error(''); } -export function storeHASH_UPDATE(hASH_UPDATE: HASH_UPDATE, storeX: (x: X) => (builder: Builder) => void +export function storeValidatorDescr(validatorDescr: ValidatorDescr): (builder: Builder) => void { + if ((validatorDescr.kind == 'ValidatorDescr_validator')) { + return ((builder: Builder) => { + builder.storeUint(0x53, 8); + storeSigPubKey(validatorDescr.public_key)(builder); + builder.storeUint(validatorDescr.weight, 64); + }) -): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x72, 8) + } + if ((validatorDescr.kind == 'ValidatorDescr_validator_addr')) { + return ((builder: Builder) => { + builder.storeUint(0x73, 8); + storeSigPubKey(validatorDescr.public_key)(builder); + builder.storeUint(validatorDescr.weight, 64); + builder.storeBits(validatorDescr.adnl_addr); + }) - builder.storeBits(hASH_UPDATE.old_hash) + } + throw new Error(''); +} - builder.storeBits(hASH_UPDATE.new_hash) +export function loadValidatorSet(slice: Slice): ValidatorSet { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x11))) { + slice.loadUint(8); + let utime_since: number = slice.loadUint(32); + let utime_until: number = slice.loadUint(32); + let total: number = slice.loadUint(16); + let main: number = slice.loadUint(16); + let list: Hashmap = loadHashmap(slice, 16, loadValidatorDescr); + if ((!(main <= total))) { + throw new Error(''); + } + if ((!(main >= 1))) { + throw new Error(''); + } + return { + kind: 'ValidatorSet_validators', + utime_since: utime_since, + utime_until: utime_until, + total: total, + main: main, + list: list, + } -}) + } + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x12))) { + slice.loadUint(8); + let utime_since: number = slice.loadUint(32); + let utime_until: number = slice.loadUint(32); + let total: number = slice.loadUint(16); + let main: number = slice.loadUint(16); + let total_weight: number = slice.loadUint(64); + let list: HashmapE = loadHashmapE(slice, 16, loadValidatorDescr); + if ((!(main <= total))) { + throw new Error(''); + } + if ((!(main >= 1))) { + throw new Error(''); + } + return { + kind: 'ValidatorSet_validators_ext', + utime_since: utime_since, + utime_until: utime_until, + total: total, + main: main, + total_weight: total_weight, + list: list, + } -; + } + throw new Error(''); } -export function loadMERKLE_PROOF(slice: Slice, loadX: (slice: Slice) => X -): MERKLE_PROOF { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x03))) { - slice.loadUint(8) - let virtual_hash: BitString = slice.loadBits(256) - - let depth: number = slice.loadUint(16) - - let slice1 = slice.loadRef().beginParse() +export function storeValidatorSet(validatorSet: ValidatorSet): (builder: Builder) => void { + if ((validatorSet.kind == 'ValidatorSet_validators')) { + return ((builder: Builder) => { + builder.storeUint(0x11, 8); + builder.storeUint(validatorSet.utime_since, 32); + builder.storeUint(validatorSet.utime_until, 32); + builder.storeUint(validatorSet.total, 16); + builder.storeUint(validatorSet.main, 16); + storeHashmap(validatorSet.list, storeValidatorDescr)(builder); + if ((!(validatorSet.main <= validatorSet.total))) { + throw new Error(''); + } + if ((!(validatorSet.main >= 1))) { + throw new Error(''); + } + }) - let virtual_root: X = loadX(slice1) + } + if ((validatorSet.kind == 'ValidatorSet_validators_ext')) { + return ((builder: Builder) => { + builder.storeUint(0x12, 8); + builder.storeUint(validatorSet.utime_since, 32); + builder.storeUint(validatorSet.utime_until, 32); + builder.storeUint(validatorSet.total, 16); + builder.storeUint(validatorSet.main, 16); + builder.storeUint(validatorSet.total_weight, 64); + storeHashmapE(validatorSet.list, storeValidatorDescr)(builder); + if ((!(validatorSet.main <= validatorSet.total))) { + throw new Error(''); + } + if ((!(validatorSet.main >= 1))) { + throw new Error(''); + } + }) - return { - kind: 'MERKLE_PROOF', - virtual_hash: virtual_hash, - depth: depth, - virtual_root: virtual_root, + } + throw new Error(''); } -} -; - throw new Error('') -; -} +export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xbc7f2648) && (arg0 == 0)))) { + slice.loadUint(32); + let config_addr: BitString = slice.loadBits(256); + return { + kind: 'ConfigParam__', + config_addr: config_addr, + } -export function storeMERKLE_PROOF(mERKLE_PROOF: MERKLE_PROOF, storeX: (x: X) => (builder: Builder) => void + } + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x84659d0d) && (arg0 == 1)))) { + slice.loadUint(32); + let elector_addr: BitString = slice.loadBits(256); + return { + kind: 'ConfigParam__1', + elector_addr: elector_addr, + } -): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x03, 8) + } + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x8648b2c4) && (arg0 == 2)))) { + slice.loadUint(32); + let minter_addr: BitString = slice.loadBits(256); + return { + kind: 'ConfigParam__2', + minter_addr: minter_addr, + } - builder.storeBits(mERKLE_PROOF.virtual_hash) + } + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x8a752dc5) && (arg0 == 3)))) { + slice.loadUint(32); + let fee_collector_addr: BitString = slice.loadBits(256); + return { + kind: 'ConfigParam__3', + fee_collector_addr: fee_collector_addr, + } - builder.storeUint(mERKLE_PROOF.depth, 16) + } + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x8ceae93f) && (arg0 == 4)))) { + slice.loadUint(32); + let dns_root_addr: BitString = slice.loadBits(256); + return { + kind: 'ConfigParam__4', + dns_root_addr: dns_root_addr, + } - let cell1 = beginCell() + } + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xb2571db5) && (arg0 == 6)))) { + slice.loadUint(32); + let mint_new_price: Grams = loadGrams(slice); + let mint_add_price: Grams = loadGrams(slice); + return { + kind: 'ConfigParam__5', + mint_new_price: mint_new_price, + mint_add_price: mint_add_price, + } + } + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xd2115c6f) && (arg0 == 7)))) { + slice.loadUint(32); + let to_mint: ExtraCurrencyCollection = loadExtraCurrencyCollection(slice); + return { + kind: 'ConfigParam__6', + to_mint: to_mint, + } - storeX(mERKLE_PROOF.virtual_root)(cell1) + } + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xb19d2da6) && (arg0 == 8)))) { + slice.loadUint(32); + let anon0: GlobalVersion = loadGlobalVersion(slice); + return { + kind: 'ConfigParam__7', + anon0: anon0, + } - builder.storeRef(cell1) + } + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x8f3b81de) && (arg0 == 9)))) { + slice.loadUint(32); + let mandatory_params: Hashmap = loadHashmap(slice, 32, loadTrue); + return { + kind: 'ConfigParam__8', + mandatory_params: mandatory_params, + } -}) + } + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xfbcb8998) && (arg0 == 10)))) { + slice.loadUint(32); + let critical_params: Hashmap = loadHashmap(slice, 32, loadTrue); + return { + kind: 'ConfigParam__9', + critical_params: critical_params, + } -; -} + } + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x9358b12f) && (arg0 == 11)))) { + slice.loadUint(32); + let anon0: ConfigVotingSetup = loadConfigVotingSetup(slice); + return { + kind: 'ConfigParam__10', + anon0: anon0, + } -export function loadAccountBlock(slice: Slice): AccountBlock { - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0x5))) { - slice.loadUint(4) - let account_addr: BitString = slice.loadBits(256) + } + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x9059857d) && (arg0 == 12)))) { + slice.loadUint(32); + let workchains: HashmapE = loadHashmapE(slice, 32, loadWorkchainDescr); + return { + kind: 'ConfigParam__11', + workchains: workchains, + } - let transactions: HashmapAug = loadHashmapAug(slice, 64, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() + } + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xe8ae7dd3) && (arg0 == 13)))) { + slice.loadUint(32); + let anon0: ComplaintPricing = loadComplaintPricing(slice); + return { + kind: 'ConfigParam__12', + anon0: anon0, + } + } + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xf282db94) && (arg0 == 14)))) { + slice.loadUint(32); + let anon0: BlockCreateFees = loadBlockCreateFees(slice); + return { + kind: 'ConfigParam__13', + anon0: anon0, + } - return loadTransaction(slice1) + } + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xed67ebd2) && (arg0 == 15)))) { + slice.loadUint(32); + let validators_elected_for: number = slice.loadUint(32); + let elections_start_before: number = slice.loadUint(32); + let elections_end_before: number = slice.loadUint(32); + let stake_held_for: number = slice.loadUint(32); + return { + kind: 'ConfigParam__14', + validators_elected_for: validators_elected_for, + elections_start_before: elections_start_before, + elections_end_before: elections_end_before, + stake_held_for: stake_held_for, + } -}) -, loadCurrencyCollection) + } + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xe8298d51) && (arg0 == 16)))) { + slice.loadUint(32); + let max_validators: number = slice.loadUint(16); + let max_main_validators: number = slice.loadUint(16); + let min_validators: number = slice.loadUint(16); + if ((!(max_validators >= max_main_validators))) { + throw new Error(''); + } + if ((!(max_main_validators >= min_validators))) { + throw new Error(''); + } + if ((!(min_validators >= 1))) { + throw new Error(''); + } + return { + kind: 'ConfigParam__15', + max_validators: max_validators, + max_main_validators: max_main_validators, + min_validators: min_validators, + } - let slice1 = slice.loadRef().beginParse() + } + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xa81c566c) && (arg0 == 17)))) { + slice.loadUint(32); + let min_stake: Grams = loadGrams(slice); + let max_stake: Grams = loadGrams(slice); + let min_total_stake: Grams = loadGrams(slice); + let max_stake_factor: number = slice.loadUint(32); + return { + kind: 'ConfigParam__16', + min_stake: min_stake, + max_stake: max_stake, + min_total_stake: min_total_stake, + max_stake_factor: max_stake_factor, + } - let state_update: HASH_UPDATE = loadHASH_UPDATE(slice1, loadAccount) + } + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xeab9843a) && (arg0 == 18)))) { + slice.loadUint(32); + let anon0: Hashmap = loadHashmap(slice, 32, loadStoragePrices); + return { + kind: 'ConfigParam__17', + anon0: anon0, + } - return { - kind: 'AccountBlock', - account_addr: account_addr, - transactions: transactions, - state_update: state_update, -} + } + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xf666426a) && (arg0 == 28)))) { + slice.loadUint(32); + let anon0: CatchainConfig = loadCatchainConfig(slice); + return { + kind: 'ConfigParam__24', + anon0: anon0, + } -} -; - throw new Error('') -; -} + } + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xf5b85ad3) && (arg0 == 29)))) { + slice.loadUint(32); + let anon0: ConsensusConfig = loadConsensusConfig(slice); + return { + kind: 'ConfigParam__25', + anon0: anon0, + } -export function storeAccountBlock(accountBlock: AccountBlock): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x5, 4) + } + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x849fe3cc) && (arg0 == 31)))) { + slice.loadUint(32); + let fundamental_smc_addr: HashmapE = loadHashmapE(slice, 256, loadTrue); + return { + kind: 'ConfigParam__26', + fundamental_smc_addr: fundamental_smc_addr, + } - builder.storeBits(accountBlock.account_addr) + } + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xcfc8ceeb) && (arg0 == 32)))) { + slice.loadUint(32); + let prev_validators: ValidatorSet = loadValidatorSet(slice); + return { + kind: 'ConfigParam__27', + prev_validators: prev_validators, + } - storeHashmapAug(accountBlock.transactions, ((arg: Transaction) => { - return ((builder: Builder) => { - let cell1 = beginCell() + } + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xa1a5d63c) && (arg0 == 33)))) { + slice.loadUint(32); + let prev_temp_validators: ValidatorSet = loadValidatorSet(slice); + return { + kind: 'ConfigParam__28', + prev_temp_validators: prev_temp_validators, + } + } + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xfd569be3) && (arg0 == 34)))) { + slice.loadUint(32); + let cur_validators: ValidatorSet = loadValidatorSet(slice); + return { + kind: 'ConfigParam__29', + cur_validators: cur_validators, + } - storeTransaction(arg)(cell1) + } + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xc271315a) && (arg0 == 35)))) { + slice.loadUint(32); + let cur_temp_validators: ValidatorSet = loadValidatorSet(slice); + return { + kind: 'ConfigParam__30', + cur_temp_validators: cur_temp_validators, + } - builder.storeRef(cell1) + } + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x85d02f6c) && (arg0 == 36)))) { + slice.loadUint(32); + let next_validators: ValidatorSet = loadValidatorSet(slice); + return { + kind: 'ConfigParam__31', + next_validators: next_validators, + } + } + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xffa3b0f8) && (arg0 == 37)))) { + slice.loadUint(32); + let next_temp_validators: ValidatorSet = loadValidatorSet(slice); + return { + kind: 'ConfigParam__32', + next_temp_validators: next_temp_validators, + } - }) + } + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x86dfef76) && (arg0 == 39)))) { + slice.loadUint(32); + let anon0: HashmapE = loadHashmapE(slice, 256, loadValidatorSignedTempKey); + return { + kind: 'ConfigParam__33', + anon0: anon0, + } + } + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x8517b916) && (arg0 == 40)))) { + slice.loadUint(32); + let anon0: MisbehaviourPunishmentConfig = loadMisbehaviourPunishmentConfig(slice); + return { + kind: 'ConfigParam__34', + anon0: anon0, + } - }) - , storeCurrencyCollection)(builder) + } + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xbd424af1) && (arg0 == 71)))) { + slice.loadUint(32); + let anon0: OracleBridgeParams = loadOracleBridgeParams(slice); + return { + kind: 'ConfigParam__35', + anon0: anon0, + } - let cell1 = beginCell() + } + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x966f1932) && (arg0 == 72)))) { + slice.loadUint(32); + let anon0: OracleBridgeParams = loadOracleBridgeParams(slice); + return { + kind: 'ConfigParam__36', + anon0: anon0, + } + } + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x8f742873) && (arg0 == 73)))) { + slice.loadUint(32); + let anon0: OracleBridgeParams = loadOracleBridgeParams(slice); + return { + kind: 'ConfigParam__37', + anon0: anon0, + } - storeHASH_UPDATE(accountBlock.state_update, storeAccount)(cell1) + } + if ((arg0 == 20)) { + let anon0: GasLimitsPrices = loadGasLimitsPrices(slice); + return { + kind: 'ConfigParam_config_mc_gas_prices', + anon0: anon0, + } - builder.storeRef(cell1) + } + if ((arg0 == 21)) { + let anon0: GasLimitsPrices = loadGasLimitsPrices(slice); + return { + kind: 'ConfigParam_config_gas_prices', + anon0: anon0, + } -}) + } + if ((arg0 == 22)) { + let anon0: BlockLimits = loadBlockLimits(slice); + return { + kind: 'ConfigParam_config_mc_block_limits', + anon0: anon0, + } -; -} + } + if ((arg0 == 23)) { + let anon0: BlockLimits = loadBlockLimits(slice); + return { + kind: 'ConfigParam_config_block_limits', + anon0: anon0, + } -export function loadShardAccountBlocks(slice: Slice): ShardAccountBlocks { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xdc67c889))) { - slice.loadUint(32) - let anon0: HashmapAugE = loadHashmapAugE(slice, 256, loadAccountBlock, loadCurrencyCollection) + } + if ((arg0 == 24)) { + let anon0: MsgForwardPrices = loadMsgForwardPrices(slice); + return { + kind: 'ConfigParam_config_mc_fwd_prices', + anon0: anon0, + } - return { - kind: 'ShardAccountBlocks', - anon0: anon0, -} + } + if ((arg0 == 25)) { + let anon0: MsgForwardPrices = loadMsgForwardPrices(slice); + return { + kind: 'ConfigParam_config_fwd_prices', + anon0: anon0, + } -} -; - throw new Error('') -; + } + throw new Error(''); } -export function storeShardAccountBlocks(shardAccountBlocks: ShardAccountBlocks): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xdc67c889, 32) - - storeHashmapAugE(shardAccountBlocks.anon0, storeAccountBlock, storeCurrencyCollection)(builder) - -}) - -; -} - -export function loadTrStoragePhase(slice: Slice): TrStoragePhase { - let storage_fees_collected: Grams = loadGrams(slice) - -; - let storage_fees_due: Maybe = loadMaybe(slice, loadGrams) - -; - let status_change: AccStatusChange = loadAccStatusChange(slice) - -; - return { - kind: 'TrStoragePhase', - storage_fees_collected: storage_fees_collected, - storage_fees_due: storage_fees_due, - status_change: status_change, -} - -; -} - -export function storeTrStoragePhase(trStoragePhase: TrStoragePhase): (builder: Builder) => void { - return ((builder: Builder) => { - storeGrams(trStoragePhase.storage_fees_collected)(builder) - - storeMaybe(trStoragePhase.storage_fees_due, storeGrams)(builder) - - storeAccStatusChange(trStoragePhase.status_change)(builder) - -}) - -; -} - -export function loadAccStatusChange(slice: Slice): AccStatusChange { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1) - return { - kind: 'AccStatusChange_acst_unchanged', -} - -} -; - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b10))) { - slice.loadUint(2) - return { - kind: 'AccStatusChange_acst_frozen', -} - -} -; - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b11))) { - slice.loadUint(2) - return { - kind: 'AccStatusChange_acst_deleted', -} - -} -; - throw new Error('') -; -} - -export function storeAccStatusChange(accStatusChange: AccStatusChange): (builder: Builder) => void { - if ((accStatusChange.kind == 'AccStatusChange_acst_unchanged')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1) - -}) - -} -; - if ((accStatusChange.kind == 'AccStatusChange_acst_frozen')) { - return ((builder: Builder) => { - builder.storeUint(0b10, 2) - -}) - -} -; - if ((accStatusChange.kind == 'AccStatusChange_acst_deleted')) { - return ((builder: Builder) => { - builder.storeUint(0b11, 2) - -}) - -} -; - throw new Error('') -; -} - -export function loadTrCreditPhase(slice: Slice): TrCreditPhase { - let due_fees_collected: Maybe = loadMaybe(slice, loadGrams) - -; - let credit: CurrencyCollection = loadCurrencyCollection(slice) - -; - return { - kind: 'TrCreditPhase', - due_fees_collected: due_fees_collected, - credit: credit, -} - -; -} - -export function storeTrCreditPhase(trCreditPhase: TrCreditPhase): (builder: Builder) => void { - return ((builder: Builder) => { - storeMaybe(trCreditPhase.due_fees_collected, storeGrams)(builder) - - storeCurrencyCollection(trCreditPhase.credit)(builder) - -}) - -; -} - -export function loadTrComputePhase(slice: Slice): TrComputePhase { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1) - let reason: ComputeSkipReason = loadComputeSkipReason(slice) - - return { - kind: 'TrComputePhase_tr_phase_compute_skipped', - reason: reason, -} - -} -; - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1) - let success: Bool = loadBool(slice) - - let msg_state_used: Bool = loadBool(slice) - - let account_activated: Bool = loadBool(slice) - - let gas_fees: Grams = loadGrams(slice) - - let slice1 = slice.loadRef().beginParse() - - let gas_used: VarUInteger = loadVarUInteger(slice1, 7) - - let gas_limit: VarUInteger = loadVarUInteger(slice1, 7) - - let gas_credit: Maybe = loadMaybe(slice1, ((slice: Slice) => { - return loadVarUInteger(slice, 3) - -}) -) - - let mode: number = slice1.loadInt(8) - - let exit_code: number = slice1.loadInt(32) - - let exit_arg: Maybe = loadMaybe(slice1, ((slice: Slice) => { - return slice1.loadInt(32) - -}) -) - - let vm_steps: number = slice1.loadUint(32) - - let vm_init_state_hash: BitString = slice1.loadBits(256) - - let vm_final_state_hash: BitString = slice1.loadBits(256) - - return { - kind: 'TrComputePhase_tr_phase_compute_vm', - success: success, - msg_state_used: msg_state_used, - account_activated: account_activated, - gas_fees: gas_fees, - gas_used: gas_used, - gas_limit: gas_limit, - gas_credit: gas_credit, - mode: mode, - exit_code: exit_code, - exit_arg: exit_arg, - vm_steps: vm_steps, - vm_init_state_hash: vm_init_state_hash, - vm_final_state_hash: vm_final_state_hash, -} - -} -; - throw new Error('') -; -} - -export function storeTrComputePhase(trComputePhase: TrComputePhase): (builder: Builder) => void { - if ((trComputePhase.kind == 'TrComputePhase_tr_phase_compute_skipped')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1) - - storeComputeSkipReason(trComputePhase.reason)(builder) - -}) - -} -; - if ((trComputePhase.kind == 'TrComputePhase_tr_phase_compute_vm')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1) - - storeBool(trComputePhase.success)(builder) - - storeBool(trComputePhase.msg_state_used)(builder) - - storeBool(trComputePhase.account_activated)(builder) - - storeGrams(trComputePhase.gas_fees)(builder) - - let cell1 = beginCell() - - - storeVarUInteger(trComputePhase.gas_used)(cell1) - - storeVarUInteger(trComputePhase.gas_limit)(cell1) - - storeMaybe(trComputePhase.gas_credit, ((arg: VarUInteger) => { - return ((builder: Builder) => { - storeVarUInteger(arg)(builder) - - }) - - - }) - )(cell1) - - cell1.storeInt(trComputePhase.mode, 8) - - cell1.storeInt(trComputePhase.exit_code, 32) - - storeMaybe(trComputePhase.exit_arg, ((arg: number) => { - return ((builder: Builder) => { - cell1.storeInt(arg, 32) - - }) - - - }) - )(cell1) - - cell1.storeUint(trComputePhase.vm_steps, 32) - - cell1.storeBits(trComputePhase.vm_init_state_hash) - - cell1.storeBits(trComputePhase.vm_final_state_hash) - - builder.storeRef(cell1) - -}) - -} -; - throw new Error('') -; -} - -export function loadComputeSkipReason(slice: Slice): ComputeSkipReason { - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { - slice.loadUint(2) - return { - kind: 'ComputeSkipReason_cskip_no_state', -} - -} -; - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b01))) { - slice.loadUint(2) - return { - kind: 'ComputeSkipReason_cskip_bad_state', -} - -} -; - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b10))) { - slice.loadUint(2) - return { - kind: 'ComputeSkipReason_cskip_no_gas', -} - -} -; - throw new Error('') -; -} - -export function storeComputeSkipReason(computeSkipReason: ComputeSkipReason): (builder: Builder) => void { - if ((computeSkipReason.kind == 'ComputeSkipReason_cskip_no_state')) { - return ((builder: Builder) => { - builder.storeUint(0b00, 2) - -}) - -} -; - if ((computeSkipReason.kind == 'ComputeSkipReason_cskip_bad_state')) { - return ((builder: Builder) => { - builder.storeUint(0b01, 2) - -}) - -} -; - if ((computeSkipReason.kind == 'ComputeSkipReason_cskip_no_gas')) { - return ((builder: Builder) => { - builder.storeUint(0b10, 2) - -}) - -} -; - throw new Error('') -; -} - -export function loadTrActionPhase(slice: Slice): TrActionPhase { - let success: Bool = loadBool(slice) - -; - let valid: Bool = loadBool(slice) - -; - let no_funds: Bool = loadBool(slice) - -; - let status_change: AccStatusChange = loadAccStatusChange(slice) - -; - let total_fwd_fees: Maybe = loadMaybe(slice, loadGrams) - -; - let total_action_fees: Maybe = loadMaybe(slice, loadGrams) - -; - let result_code: number = slice.loadInt(32) - -; - let result_arg: Maybe = loadMaybe(slice, ((slice: Slice) => { - return slice.loadInt(32) - -}) -) - -; - let tot_actions: number = slice.loadUint(16) - -; - let spec_actions: number = slice.loadUint(16) - -; - let skipped_actions: number = slice.loadUint(16) - -; - let msgs_created: number = slice.loadUint(16) - -; - let action_list_hash: BitString = slice.loadBits(256) - -; - let tot_msg_size: StorageUsedShort = loadStorageUsedShort(slice) - -; - return { - kind: 'TrActionPhase', - success: success, - valid: valid, - no_funds: no_funds, - status_change: status_change, - total_fwd_fees: total_fwd_fees, - total_action_fees: total_action_fees, - result_code: result_code, - result_arg: result_arg, - tot_actions: tot_actions, - spec_actions: spec_actions, - skipped_actions: skipped_actions, - msgs_created: msgs_created, - action_list_hash: action_list_hash, - tot_msg_size: tot_msg_size, -} - -; -} - -export function storeTrActionPhase(trActionPhase: TrActionPhase): (builder: Builder) => void { - return ((builder: Builder) => { - storeBool(trActionPhase.success)(builder) - - storeBool(trActionPhase.valid)(builder) - - storeBool(trActionPhase.no_funds)(builder) - - storeAccStatusChange(trActionPhase.status_change)(builder) - - storeMaybe(trActionPhase.total_fwd_fees, storeGrams)(builder) - - storeMaybe(trActionPhase.total_action_fees, storeGrams)(builder) - - builder.storeInt(trActionPhase.result_code, 32) - - storeMaybe(trActionPhase.result_arg, ((arg: number) => { - return ((builder: Builder) => { - builder.storeInt(arg, 32) - - }) - - - }) - )(builder) - - builder.storeUint(trActionPhase.tot_actions, 16) - - builder.storeUint(trActionPhase.spec_actions, 16) - - builder.storeUint(trActionPhase.skipped_actions, 16) - - builder.storeUint(trActionPhase.msgs_created, 16) - - builder.storeBits(trActionPhase.action_list_hash) - - storeStorageUsedShort(trActionPhase.tot_msg_size)(builder) - -}) - -; -} - -export function loadTrBouncePhase(slice: Slice): TrBouncePhase { - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { - slice.loadUint(2) - return { - kind: 'TrBouncePhase_tr_phase_bounce_negfunds', -} - -} -; - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b01))) { - slice.loadUint(2) - let msg_size: StorageUsedShort = loadStorageUsedShort(slice) - - let req_fwd_fees: Grams = loadGrams(slice) - - return { - kind: 'TrBouncePhase_tr_phase_bounce_nofunds', - msg_size: msg_size, - req_fwd_fees: req_fwd_fees, -} - -} -; - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1) - let msg_size: StorageUsedShort = loadStorageUsedShort(slice) - - let msg_fees: Grams = loadGrams(slice) - - let fwd_fees: Grams = loadGrams(slice) - - return { - kind: 'TrBouncePhase_tr_phase_bounce_ok', - msg_size: msg_size, - msg_fees: msg_fees, - fwd_fees: fwd_fees, -} - -} -; - throw new Error('') -; -} - -export function storeTrBouncePhase(trBouncePhase: TrBouncePhase): (builder: Builder) => void { - if ((trBouncePhase.kind == 'TrBouncePhase_tr_phase_bounce_negfunds')) { - return ((builder: Builder) => { - builder.storeUint(0b00, 2) - -}) - -} -; - if ((trBouncePhase.kind == 'TrBouncePhase_tr_phase_bounce_nofunds')) { - return ((builder: Builder) => { - builder.storeUint(0b01, 2) - - storeStorageUsedShort(trBouncePhase.msg_size)(builder) - - storeGrams(trBouncePhase.req_fwd_fees)(builder) - -}) - -} -; - if ((trBouncePhase.kind == 'TrBouncePhase_tr_phase_bounce_ok')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1) - - storeStorageUsedShort(trBouncePhase.msg_size)(builder) - - storeGrams(trBouncePhase.msg_fees)(builder) - - storeGrams(trBouncePhase.fwd_fees)(builder) - -}) - -} -; - throw new Error('') -; -} - -export function loadTransactionDescr(slice: Slice): TransactionDescr { - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b0000))) { - slice.loadUint(4) - let credit_first: Bool = loadBool(slice) - - let storage_ph: Maybe = loadMaybe(slice, loadTrStoragePhase) - - let credit_ph: Maybe = loadMaybe(slice, loadTrCreditPhase) - - let compute_ph: TrComputePhase = loadTrComputePhase(slice) - - let action: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() - - - return loadTrActionPhase(slice1) - -}) -) - - let aborted: Bool = loadBool(slice) - - let bounce: Maybe = loadMaybe(slice, loadTrBouncePhase) - - let destroyed: Bool = loadBool(slice) - - return { - kind: 'TransactionDescr_trans_ord', - credit_first: credit_first, - storage_ph: storage_ph, - credit_ph: credit_ph, - compute_ph: compute_ph, - action: action, - aborted: aborted, - bounce: bounce, - destroyed: destroyed, -} - -} -; - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b0001))) { - slice.loadUint(4) - let storage_ph: TrStoragePhase = loadTrStoragePhase(slice) - - return { - kind: 'TransactionDescr_trans_storage', - storage_ph: storage_ph, -} - -} -; - if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b001))) { - slice.loadUint(3) - let is_tock: Bool = loadBool(slice) - - let storage_ph: TrStoragePhase = loadTrStoragePhase(slice) - - let compute_ph: TrComputePhase = loadTrComputePhase(slice) - - let action: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() - - - return loadTrActionPhase(slice1) - -}) -) - - let aborted: Bool = loadBool(slice) - - let destroyed: Bool = loadBool(slice) - - return { - kind: 'TransactionDescr_trans_tick_tock', - is_tock: is_tock, - storage_ph: storage_ph, - compute_ph: compute_ph, - action: action, - aborted: aborted, - destroyed: destroyed, -} - -} -; - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b0100))) { - slice.loadUint(4) - let split_info: SplitMergeInfo = loadSplitMergeInfo(slice) - - let storage_ph: Maybe = loadMaybe(slice, loadTrStoragePhase) - - let compute_ph: TrComputePhase = loadTrComputePhase(slice) - - let action: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() - - - return loadTrActionPhase(slice1) - -}) -) - - let aborted: Bool = loadBool(slice) - - let destroyed: Bool = loadBool(slice) - - return { - kind: 'TransactionDescr_trans_split_prepare', - split_info: split_info, - storage_ph: storage_ph, - compute_ph: compute_ph, - action: action, - aborted: aborted, - destroyed: destroyed, -} - -} -; - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b0101))) { - slice.loadUint(4) - let split_info: SplitMergeInfo = loadSplitMergeInfo(slice) - - let slice1 = slice.loadRef().beginParse() - - let prepare_transaction: Transaction = loadTransaction(slice1) - - let installed: Bool = loadBool(slice) - - return { - kind: 'TransactionDescr_trans_split_install', - split_info: split_info, - prepare_transaction: prepare_transaction, - installed: installed, -} - -} -; - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b0110))) { - slice.loadUint(4) - let split_info: SplitMergeInfo = loadSplitMergeInfo(slice) - - let storage_ph: TrStoragePhase = loadTrStoragePhase(slice) - - let aborted: Bool = loadBool(slice) - - return { - kind: 'TransactionDescr_trans_merge_prepare', - split_info: split_info, - storage_ph: storage_ph, - aborted: aborted, -} - -} -; - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b0111))) { - slice.loadUint(4) - let split_info: SplitMergeInfo = loadSplitMergeInfo(slice) - - let slice1 = slice.loadRef().beginParse() - - let prepare_transaction: Transaction = loadTransaction(slice1) - - let storage_ph: Maybe = loadMaybe(slice, loadTrStoragePhase) - - let credit_ph: Maybe = loadMaybe(slice, loadTrCreditPhase) - - let compute_ph: TrComputePhase = loadTrComputePhase(slice) - - let action: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() - - - return loadTrActionPhase(slice1) - -}) -) - - let aborted: Bool = loadBool(slice) - - let destroyed: Bool = loadBool(slice) - - return { - kind: 'TransactionDescr_trans_merge_install', - split_info: split_info, - prepare_transaction: prepare_transaction, - storage_ph: storage_ph, - credit_ph: credit_ph, - compute_ph: compute_ph, - action: action, - aborted: aborted, - destroyed: destroyed, -} - -} -; - throw new Error('') -; -} - -export function storeTransactionDescr(transactionDescr: TransactionDescr): (builder: Builder) => void { - if ((transactionDescr.kind == 'TransactionDescr_trans_ord')) { - return ((builder: Builder) => { - builder.storeUint(0b0000, 4) - - storeBool(transactionDescr.credit_first)(builder) - - storeMaybe(transactionDescr.storage_ph, storeTrStoragePhase)(builder) - - storeMaybe(transactionDescr.credit_ph, storeTrCreditPhase)(builder) - - storeTrComputePhase(transactionDescr.compute_ph)(builder) - - storeMaybe(transactionDescr.action, ((arg: TrActionPhase) => { - return ((builder: Builder) => { - let cell1 = beginCell() - - - storeTrActionPhase(arg)(cell1) - - builder.storeRef(cell1) - - - }) - - - }) - )(builder) - - storeBool(transactionDescr.aborted)(builder) - - storeMaybe(transactionDescr.bounce, storeTrBouncePhase)(builder) - - storeBool(transactionDescr.destroyed)(builder) - -}) - -} -; - if ((transactionDescr.kind == 'TransactionDescr_trans_storage')) { - return ((builder: Builder) => { - builder.storeUint(0b0001, 4) - - storeTrStoragePhase(transactionDescr.storage_ph)(builder) - -}) - -} -; - if ((transactionDescr.kind == 'TransactionDescr_trans_tick_tock')) { - return ((builder: Builder) => { - builder.storeUint(0b001, 3) - - storeBool(transactionDescr.is_tock)(builder) - - storeTrStoragePhase(transactionDescr.storage_ph)(builder) - - storeTrComputePhase(transactionDescr.compute_ph)(builder) - - storeMaybe(transactionDescr.action, ((arg: TrActionPhase) => { - return ((builder: Builder) => { - let cell1 = beginCell() - - - storeTrActionPhase(arg)(cell1) - - builder.storeRef(cell1) - - - }) - - - }) - )(builder) - - storeBool(transactionDescr.aborted)(builder) - - storeBool(transactionDescr.destroyed)(builder) - -}) - -} -; - if ((transactionDescr.kind == 'TransactionDescr_trans_split_prepare')) { - return ((builder: Builder) => { - builder.storeUint(0b0100, 4) - - storeSplitMergeInfo(transactionDescr.split_info)(builder) - - storeMaybe(transactionDescr.storage_ph, storeTrStoragePhase)(builder) - - storeTrComputePhase(transactionDescr.compute_ph)(builder) - - storeMaybe(transactionDescr.action, ((arg: TrActionPhase) => { - return ((builder: Builder) => { - let cell1 = beginCell() - - - storeTrActionPhase(arg)(cell1) - - builder.storeRef(cell1) - - - }) - - - }) - )(builder) - - storeBool(transactionDescr.aborted)(builder) - - storeBool(transactionDescr.destroyed)(builder) - -}) - -} -; - if ((transactionDescr.kind == 'TransactionDescr_trans_split_install')) { - return ((builder: Builder) => { - builder.storeUint(0b0101, 4) - - storeSplitMergeInfo(transactionDescr.split_info)(builder) - - let cell1 = beginCell() - - - storeTransaction(transactionDescr.prepare_transaction)(cell1) - - builder.storeRef(cell1) - - storeBool(transactionDescr.installed)(builder) - -}) - -} -; - if ((transactionDescr.kind == 'TransactionDescr_trans_merge_prepare')) { - return ((builder: Builder) => { - builder.storeUint(0b0110, 4) - - storeSplitMergeInfo(transactionDescr.split_info)(builder) - - storeTrStoragePhase(transactionDescr.storage_ph)(builder) - - storeBool(transactionDescr.aborted)(builder) - -}) - -} -; - if ((transactionDescr.kind == 'TransactionDescr_trans_merge_install')) { - return ((builder: Builder) => { - builder.storeUint(0b0111, 4) - - storeSplitMergeInfo(transactionDescr.split_info)(builder) - - let cell1 = beginCell() - - - storeTransaction(transactionDescr.prepare_transaction)(cell1) - - builder.storeRef(cell1) - - storeMaybe(transactionDescr.storage_ph, storeTrStoragePhase)(builder) - - storeMaybe(transactionDescr.credit_ph, storeTrCreditPhase)(builder) - - storeTrComputePhase(transactionDescr.compute_ph)(builder) - - storeMaybe(transactionDescr.action, ((arg: TrActionPhase) => { - return ((builder: Builder) => { - let cell1 = beginCell() - - - storeTrActionPhase(arg)(cell1) - - builder.storeRef(cell1) - - - }) - - - }) - )(builder) - - storeBool(transactionDescr.aborted)(builder) - - storeBool(transactionDescr.destroyed)(builder) - -}) - -} -; - throw new Error('') -; -} - -export function loadSplitMergeInfo(slice: Slice): SplitMergeInfo { - let cur_shard_pfx_len: number = slice.loadUint(6) - -; - let acc_split_depth: number = slice.loadUint(6) - -; - let this_addr: BitString = slice.loadBits(256) - -; - let sibling_addr: BitString = slice.loadBits(256) - -; - return { - kind: 'SplitMergeInfo', - cur_shard_pfx_len: cur_shard_pfx_len, - acc_split_depth: acc_split_depth, - this_addr: this_addr, - sibling_addr: sibling_addr, -} - -; -} - -export function storeSplitMergeInfo(splitMergeInfo: SplitMergeInfo): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(splitMergeInfo.cur_shard_pfx_len, 6) - - builder.storeUint(splitMergeInfo.acc_split_depth, 6) - - builder.storeBits(splitMergeInfo.this_addr) - - builder.storeBits(splitMergeInfo.sibling_addr) - -}) - -; -} - -export function loadSmartContractInfo(slice: Slice): SmartContractInfo { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x076ef1ea))) { - slice.loadUint(32) - let actions: number = slice.loadUint(16) - - let msgs_sent: number = slice.loadUint(16) - - let unixtime: number = slice.loadUint(32) - - let block_lt: number = slice.loadUint(64) - - let trans_lt: number = slice.loadUint(64) - - let rand_seed: BitString = slice.loadBits(256) - - let balance_remaining: CurrencyCollection = loadCurrencyCollection(slice) - - let myself: MsgAddressInt = loadMsgAddressInt(slice) - - return { - kind: 'SmartContractInfo', - actions: actions, - msgs_sent: msgs_sent, - unixtime: unixtime, - block_lt: block_lt, - trans_lt: trans_lt, - rand_seed: rand_seed, - balance_remaining: balance_remaining, - myself: myself, -} - -} -; - throw new Error('') -; -} - -export function storeSmartContractInfo(smartContractInfo: SmartContractInfo): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x076ef1ea, 32) - - builder.storeUint(smartContractInfo.actions, 16) - - builder.storeUint(smartContractInfo.msgs_sent, 16) - - builder.storeUint(smartContractInfo.unixtime, 32) - - builder.storeUint(smartContractInfo.block_lt, 64) - - builder.storeUint(smartContractInfo.trans_lt, 64) - - builder.storeBits(smartContractInfo.rand_seed) - - storeCurrencyCollection(smartContractInfo.balance_remaining)(builder) - - storeMsgAddressInt(smartContractInfo.myself)(builder) - -}) - -; -} - -export function loadOutList(slice: Slice, arg0: number): OutList { - if ((arg0 == 0)) { - return { - kind: 'OutList_out_list_empty', -} - -} -; - if (true) { - let slice1 = slice.loadRef().beginParse() - - let prev: OutList = loadOutList(slice1, (arg0 - 1)) - - let action: OutAction = loadOutAction(slice) - - return { - kind: 'OutList_out_list', - n: (arg0 - 1), - prev: prev, - action: action, -} - -} -; - throw new Error('') -; -} - -export function storeOutList(outList: OutList): (builder: Builder) => void { - if ((outList.kind == 'OutList_out_list_empty')) { - return ((builder: Builder) => { -}) - -} -; - if ((outList.kind == 'OutList_out_list')) { - return ((builder: Builder) => { - let cell1 = beginCell() - - - storeOutList(outList.prev)(cell1) - - builder.storeRef(cell1) - - storeOutAction(outList.action)(builder) - -}) - -} -; - throw new Error('') -; -} - -export function loadOutAction(slice: Slice): OutAction { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x0ec3c86d))) { - slice.loadUint(32) - let mode: number = slice.loadUint(8) - - let slice1 = slice.loadRef().beginParse() - - let out_msg: MessageRelaxed = loadMessageRelaxed(slice1, ((slice: Slice) => { - return slice - -}) -) - - return { - kind: 'OutAction_action_send_msg', - mode: mode, - out_msg: out_msg, -} - -} -; - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xad4de08e))) { - slice.loadUint(32) - let slice1 = slice.loadRef().beginParse() - - let new_code: Slice = slice1 - - return { - kind: 'OutAction_action_set_code', - new_code: new_code, -} - -} -; - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x36e6b809))) { - slice.loadUint(32) - let mode: number = slice.loadUint(8) - - let currency: CurrencyCollection = loadCurrencyCollection(slice) - - return { - kind: 'OutAction_action_reserve_currency', - mode: mode, - currency: currency, -} - -} -; - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x26fa1dd4))) { - slice.loadUint(32) - let mode: number = slice.loadUint(7) - - let libref: LibRef = loadLibRef(slice) - - if ((!(mode <= 2))) { - throw new Error('') - } - return { - kind: 'OutAction_action_change_library', - mode: mode, - libref: libref, -} - -} -; - throw new Error('') -; -} - -export function storeOutAction(outAction: OutAction): (builder: Builder) => void { - if ((outAction.kind == 'OutAction_action_send_msg')) { - return ((builder: Builder) => { - builder.storeUint(0x0ec3c86d, 32) - - builder.storeUint(outAction.mode, 8) - - let cell1 = beginCell() - - - storeMessageRelaxed(outAction.out_msg, ((arg: Slice) => { - return ((builder: Builder) => { - cell1.storeSlice(arg) - - }) - - - }) - )(cell1) - - builder.storeRef(cell1) - -}) - -} -; - if ((outAction.kind == 'OutAction_action_set_code')) { - return ((builder: Builder) => { - builder.storeUint(0xad4de08e, 32) - - let cell1 = beginCell() - - - cell1.storeSlice(outAction.new_code) - - builder.storeRef(cell1) - -}) - -} -; - if ((outAction.kind == 'OutAction_action_reserve_currency')) { - return ((builder: Builder) => { - builder.storeUint(0x36e6b809, 32) - - builder.storeUint(outAction.mode, 8) - - storeCurrencyCollection(outAction.currency)(builder) - -}) - -} -; - if ((outAction.kind == 'OutAction_action_change_library')) { - return ((builder: Builder) => { - builder.storeUint(0x26fa1dd4, 32) - - builder.storeUint(outAction.mode, 7) - - storeLibRef(outAction.libref)(builder) - - if ((!(outAction.mode <= 2))) { - throw new Error('') - } - -}) - -} -; - throw new Error('') -; -} - -export function loadLibRef(slice: Slice): LibRef { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1) - let lib_hash: BitString = slice.loadBits(256) - - return { - kind: 'LibRef_libref_hash', - lib_hash: lib_hash, -} - -} -; - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1) - let slice1 = slice.loadRef().beginParse() - - let library: Slice = slice1 - - return { - kind: 'LibRef_libref_ref', - library: library, -} - -} -; - throw new Error('') -; -} - -export function storeLibRef(libRef: LibRef): (builder: Builder) => void { - if ((libRef.kind == 'LibRef_libref_hash')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1) - - builder.storeBits(libRef.lib_hash) - -}) - -} -; - if ((libRef.kind == 'LibRef_libref_ref')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1) - - let cell1 = beginCell() - - - cell1.storeSlice(libRef.library) - - builder.storeRef(cell1) - -}) - -} -; - throw new Error('') -; -} - -export function loadOutListNode(slice: Slice): OutListNode { - let slice1 = slice.loadRef().beginParse() - -; - let prev: Slice = slice1 - -; - let action: OutAction = loadOutAction(slice) - -; - return { - kind: 'OutListNode', - prev: prev, - action: action, -} - -; -} - -export function storeOutListNode(outListNode: OutListNode): (builder: Builder) => void { - return ((builder: Builder) => { - let cell1 = beginCell() - - - cell1.storeSlice(outListNode.prev) - - builder.storeRef(cell1) - - storeOutAction(outListNode.action)(builder) - -}) - -; -} - -export function loadShardIdent(slice: Slice): ShardIdent { - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { - slice.loadUint(2) - let shard_pfx_bits: number = slice.loadUint(bitLen(60)) - - let workchain_id: number = slice.loadInt(32) - - let shard_prefix: number = slice.loadUint(64) - - return { - kind: 'ShardIdent', - shard_pfx_bits: shard_pfx_bits, - workchain_id: workchain_id, - shard_prefix: shard_prefix, -} - -} -; - throw new Error('') -; -} - -export function storeShardIdent(shardIdent: ShardIdent): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0b00, 2) - - builder.storeUint(shardIdent.shard_pfx_bits, bitLen(60)) - - builder.storeInt(shardIdent.workchain_id, 32) - - builder.storeUint(shardIdent.shard_prefix, 64) - -}) - -; -} - -export function loadExtBlkRef(slice: Slice): ExtBlkRef { - let end_lt: number = slice.loadUint(64) - -; - let seq_no: number = slice.loadUint(32) - -; - let root_hash: BitString = slice.loadBits(256) - -; - let file_hash: BitString = slice.loadBits(256) - -; - return { - kind: 'ExtBlkRef', - end_lt: end_lt, - seq_no: seq_no, - root_hash: root_hash, - file_hash: file_hash, -} - -; -} - -export function storeExtBlkRef(extBlkRef: ExtBlkRef): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(extBlkRef.end_lt, 64) - - builder.storeUint(extBlkRef.seq_no, 32) - - builder.storeBits(extBlkRef.root_hash) - - builder.storeBits(extBlkRef.file_hash) - -}) - -; -} - -export function loadBlockIdExt(slice: Slice): BlockIdExt { - let shard_id: ShardIdent = loadShardIdent(slice) - -; - let seq_no: number = slice.loadUint(32) - -; - let root_hash: BitString = slice.loadBits(256) - -; - let file_hash: BitString = slice.loadBits(256) - -; - return { - kind: 'BlockIdExt', - shard_id: shard_id, - seq_no: seq_no, - root_hash: root_hash, - file_hash: file_hash, -} - -; -} - -export function storeBlockIdExt(blockIdExt: BlockIdExt): (builder: Builder) => void { - return ((builder: Builder) => { - storeShardIdent(blockIdExt.shard_id)(builder) - - builder.storeUint(blockIdExt.seq_no, 32) - - builder.storeBits(blockIdExt.root_hash) - - builder.storeBits(blockIdExt.file_hash) - -}) - -; -} - -export function loadBlkMasterInfo(slice: Slice): BlkMasterInfo { - let master: ExtBlkRef = loadExtBlkRef(slice) - -; - return { - kind: 'BlkMasterInfo', - master: master, -} - -; -} - -export function storeBlkMasterInfo(blkMasterInfo: BlkMasterInfo): (builder: Builder) => void { - return ((builder: Builder) => { - storeExtBlkRef(blkMasterInfo.master)(builder) - -}) - -; -} - -export function loadShardStateUnsplit(slice: Slice): ShardStateUnsplit { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x9023afe2))) { - slice.loadUint(32) - let global_id: number = slice.loadInt(32) - - let shard_id: ShardIdent = loadShardIdent(slice) - - let seq_no: number = slice.loadUint(32) - - let vert_seq_no: number = slice.loadUint(32) - - let gen_utime: number = slice.loadUint(32) - - let gen_lt: number = slice.loadUint(64) - - let min_ref_mc_seqno: number = slice.loadUint(32) - - let slice1 = slice.loadRef().beginParse() - - let out_msg_queue_info: OutMsgQueueInfo = loadOutMsgQueueInfo(slice1) - - let before_split: number = slice.loadUint(1) - - let slice2 = slice.loadRef().beginParse() - - let accounts: ShardAccounts = loadShardAccounts(slice2) - - let slice3 = slice.loadRef().beginParse() - - let overload_history: number = slice3.loadUint(64) - - let underload_history: number = slice3.loadUint(64) - - let total_balance: CurrencyCollection = loadCurrencyCollection(slice3) - - let total_validator_fees: CurrencyCollection = loadCurrencyCollection(slice3) - - let libraries: HashmapE = loadHashmapE(slice3, 256, loadLibDescr) - - let master_ref: Maybe = loadMaybe(slice3, loadBlkMasterInfo) - - let custom: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() - - - return loadMcStateExtra(slice1) - -}) -) - - return { - kind: 'ShardStateUnsplit', - global_id: global_id, - shard_id: shard_id, - seq_no: seq_no, - vert_seq_no: vert_seq_no, - gen_utime: gen_utime, - gen_lt: gen_lt, - min_ref_mc_seqno: min_ref_mc_seqno, - out_msg_queue_info: out_msg_queue_info, - before_split: before_split, - accounts: accounts, - overload_history: overload_history, - underload_history: underload_history, - total_balance: total_balance, - total_validator_fees: total_validator_fees, - libraries: libraries, - master_ref: master_ref, - custom: custom, -} - -} -; - throw new Error('') -; -} - -export function storeShardStateUnsplit(shardStateUnsplit: ShardStateUnsplit): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x9023afe2, 32) - - builder.storeInt(shardStateUnsplit.global_id, 32) - - storeShardIdent(shardStateUnsplit.shard_id)(builder) - - builder.storeUint(shardStateUnsplit.seq_no, 32) - - builder.storeUint(shardStateUnsplit.vert_seq_no, 32) - - builder.storeUint(shardStateUnsplit.gen_utime, 32) - - builder.storeUint(shardStateUnsplit.gen_lt, 64) - - builder.storeUint(shardStateUnsplit.min_ref_mc_seqno, 32) - - let cell1 = beginCell() - - - storeOutMsgQueueInfo(shardStateUnsplit.out_msg_queue_info)(cell1) - - builder.storeRef(cell1) - - builder.storeUint(shardStateUnsplit.before_split, 1) - - let cell2 = beginCell() - - - storeShardAccounts(shardStateUnsplit.accounts)(cell2) - - builder.storeRef(cell2) - - let cell3 = beginCell() - - - cell3.storeUint(shardStateUnsplit.overload_history, 64) - - cell3.storeUint(shardStateUnsplit.underload_history, 64) - - storeCurrencyCollection(shardStateUnsplit.total_balance)(cell3) - - storeCurrencyCollection(shardStateUnsplit.total_validator_fees)(cell3) - - storeHashmapE(shardStateUnsplit.libraries, storeLibDescr)(cell3) - - storeMaybe(shardStateUnsplit.master_ref, storeBlkMasterInfo)(cell3) - - builder.storeRef(cell3) - - storeMaybe(shardStateUnsplit.custom, ((arg: McStateExtra) => { - return ((builder: Builder) => { - let cell1 = beginCell() - - - storeMcStateExtra(arg)(cell1) - - builder.storeRef(cell1) - - - }) - - - }) - )(builder) - -}) - -; -} - -export function loadShardState(slice: Slice): ShardState { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x81e52440))) { - slice.loadUint(32) - let anon0: ShardStateUnsplit = loadShardStateUnsplit(slice) - - return { - kind: 'ShardState__', - anon0: anon0, -} - -} -; - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x5f327da5))) { - slice.loadUint(32) - let slice1 = slice.loadRef().beginParse() - - let left: ShardStateUnsplit = loadShardStateUnsplit(slice1) - - let slice2 = slice.loadRef().beginParse() - - let right: ShardStateUnsplit = loadShardStateUnsplit(slice2) - - return { - kind: 'ShardState_split_state', - left: left, - right: right, -} - -} -; - throw new Error('') -; -} - -export function storeShardState(shardState: ShardState): (builder: Builder) => void { - if ((shardState.kind == 'ShardState__')) { - return ((builder: Builder) => { - builder.storeUint(0x81e52440, 32) - - storeShardStateUnsplit(shardState.anon0)(builder) - -}) - -} -; - if ((shardState.kind == 'ShardState_split_state')) { - return ((builder: Builder) => { - builder.storeUint(0x5f327da5, 32) - - let cell1 = beginCell() - - - storeShardStateUnsplit(shardState.left)(cell1) - - builder.storeRef(cell1) - - let cell2 = beginCell() - - - storeShardStateUnsplit(shardState.right)(cell2) - - builder.storeRef(cell2) - -}) - -} -; - throw new Error('') -; -} - -export function loadLibDescr(slice: Slice): LibDescr { - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { - slice.loadUint(2) - let slice1 = slice.loadRef().beginParse() - - let lib: Slice = slice1 - - let publishers: Hashmap = loadHashmap(slice, 256, loadTrue) - - return { - kind: 'LibDescr', - lib: lib, - publishers: publishers, -} - -} -; - throw new Error('') -; -} - -export function storeLibDescr(libDescr: LibDescr): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0b00, 2) - - let cell1 = beginCell() - - - cell1.storeSlice(libDescr.lib) - - builder.storeRef(cell1) - - storeHashmap(libDescr.publishers, storeTrue)(builder) - -}) - -; -} - -export function loadBlockInfo(slice: Slice): BlockInfo { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x9bc7a987))) { - slice.loadUint(32) - let version: number = slice.loadUint(32) - - let not_master: number = slice.loadUint(1) - - let after_merge: number = slice.loadUint(1) - - let before_split: number = slice.loadUint(1) - - let after_split: number = slice.loadUint(1) - - let want_split: Bool = loadBool(slice) - - let want_merge: Bool = loadBool(slice) - - let key_block: Bool = loadBool(slice) - - let vert_seqno_incr: number = slice.loadUint(1) - - let flags: number = slice.loadUint(8) - - let seq_no: number = slice.loadUint(32) - - let vert_seq_no: number = slice.loadUint(32) - - let shard: ShardIdent = loadShardIdent(slice) - - let gen_utime: number = slice.loadUint(32) - - let start_lt: number = slice.loadUint(64) - - let end_lt: number = slice.loadUint(64) - - let gen_validator_list_hash_short: number = slice.loadUint(32) - - let gen_catchain_seqno: number = slice.loadUint(32) - - let min_ref_mc_seqno: number = slice.loadUint(32) - - let prev_key_block_seqno: number = slice.loadUint(32) - - let gen_software: GlobalVersion | undefined = ((flags & (1 << 0)) ? loadGlobalVersion(slice) : undefined) - - let master_ref: BlkMasterInfo | undefined = (not_master ? ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() - - - return loadBlkMasterInfo(slice1) - -}) -(slice) : undefined) - - let slice1 = slice.loadRef().beginParse() - - let prev_ref: BlkPrevInfo = loadBlkPrevInfo(slice1, after_merge) - - let prev_vert_ref: BlkPrevInfo | undefined = (vert_seqno_incr ? ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() - - - return loadBlkPrevInfo(slice1, 0) - -}) -(slice) : undefined) - - if ((!(flags <= 1))) { - throw new Error('') - } - if ((!(vert_seq_no >= vert_seqno_incr))) { - throw new Error('') - } - return { - kind: 'BlockInfo', - prev_seq_no: (seq_no - 1), - version: version, - not_master: not_master, - after_merge: after_merge, - before_split: before_split, - after_split: after_split, - want_split: want_split, - want_merge: want_merge, - key_block: key_block, - vert_seqno_incr: vert_seqno_incr, - flags: flags, - seq_no: seq_no, - vert_seq_no: vert_seq_no, - shard: shard, - gen_utime: gen_utime, - start_lt: start_lt, - end_lt: end_lt, - gen_validator_list_hash_short: gen_validator_list_hash_short, - gen_catchain_seqno: gen_catchain_seqno, - min_ref_mc_seqno: min_ref_mc_seqno, - prev_key_block_seqno: prev_key_block_seqno, - gen_software: gen_software, - master_ref: master_ref, - prev_ref: prev_ref, - prev_vert_ref: prev_vert_ref, -} - -} -; - throw new Error('') -; -} - -export function storeBlockInfo(blockInfo: BlockInfo): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x9bc7a987, 32) - - builder.storeUint(blockInfo.version, 32) - - builder.storeUint(blockInfo.not_master, 1) - - builder.storeUint(blockInfo.after_merge, 1) - - builder.storeUint(blockInfo.before_split, 1) - - builder.storeUint(blockInfo.after_split, 1) - - storeBool(blockInfo.want_split)(builder) - - storeBool(blockInfo.want_merge)(builder) - - storeBool(blockInfo.key_block)(builder) - - builder.storeUint(blockInfo.vert_seqno_incr, 1) - - builder.storeUint(blockInfo.flags, 8) - - builder.storeUint(blockInfo.seq_no, 32) - - builder.storeUint(blockInfo.vert_seq_no, 32) - - storeShardIdent(blockInfo.shard)(builder) - - builder.storeUint(blockInfo.gen_utime, 32) - - builder.storeUint(blockInfo.start_lt, 64) - - builder.storeUint(blockInfo.end_lt, 64) - - builder.storeUint(blockInfo.gen_validator_list_hash_short, 32) - - builder.storeUint(blockInfo.gen_catchain_seqno, 32) - - builder.storeUint(blockInfo.min_ref_mc_seqno, 32) - - builder.storeUint(blockInfo.prev_key_block_seqno, 32) - - if ((blockInfo.gen_software != undefined)) { - storeGlobalVersion(blockInfo.gen_software)(builder) - } - - if ((blockInfo.master_ref != undefined)) { - let cell1 = beginCell() - - - storeBlkMasterInfo(blockInfo.master_ref)(cell1) - - builder.storeRef(cell1) - - } - - let cell1 = beginCell() - - - storeBlkPrevInfo(blockInfo.prev_ref)(cell1) - - builder.storeRef(cell1) - - if ((blockInfo.prev_vert_ref != undefined)) { - let cell1 = beginCell() - - - storeBlkPrevInfo(blockInfo.prev_vert_ref)(cell1) - - builder.storeRef(cell1) - - } - - if ((!(blockInfo.flags <= 1))) { - throw new Error('') - } - - if ((!(blockInfo.vert_seq_no >= blockInfo.vert_seqno_incr))) { - throw new Error('') - } - -}) - -; -} - -export function loadBlkPrevInfo(slice: Slice, arg0: number): BlkPrevInfo { - if ((arg0 == 0)) { - let prev: ExtBlkRef = loadExtBlkRef(slice) - - return { - kind: 'BlkPrevInfo_prev_blk_info', - prev: prev, -} - -} -; - if ((arg0 == 1)) { - let slice1 = slice.loadRef().beginParse() - - let prev1: ExtBlkRef = loadExtBlkRef(slice1) - - let slice2 = slice.loadRef().beginParse() - - let prev2: ExtBlkRef = loadExtBlkRef(slice2) - - return { - kind: 'BlkPrevInfo_prev_blks_info', - prev1: prev1, - prev2: prev2, -} - -} -; - throw new Error('') -; -} - -export function storeBlkPrevInfo(blkPrevInfo: BlkPrevInfo): (builder: Builder) => void { - if ((blkPrevInfo.kind == 'BlkPrevInfo_prev_blk_info')) { - return ((builder: Builder) => { - storeExtBlkRef(blkPrevInfo.prev)(builder) - -}) - -} -; - if ((blkPrevInfo.kind == 'BlkPrevInfo_prev_blks_info')) { - return ((builder: Builder) => { - let cell1 = beginCell() - - - storeExtBlkRef(blkPrevInfo.prev1)(cell1) - - builder.storeRef(cell1) - - let cell2 = beginCell() - - - storeExtBlkRef(blkPrevInfo.prev2)(cell2) - - builder.storeRef(cell2) - -}) - -} -; - throw new Error('') -; -} - -export function loadBlock(slice: Slice): Block { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x11ef55aa))) { - slice.loadUint(32) - let global_id: number = slice.loadInt(32) - - let slice1 = slice.loadRef().beginParse() - - let info: BlockInfo = loadBlockInfo(slice1) - - let slice2 = slice.loadRef().beginParse() - - let value_flow: ValueFlow = loadValueFlow(slice2) - - let slice3 = slice.loadRef().beginParse() - - let state_update: MERKLE_UPDATE = loadMERKLE_UPDATE(slice3, loadShardState) - - let slice4 = slice.loadRef().beginParse() - - let extra: BlockExtra = loadBlockExtra(slice4) - - return { - kind: 'Block', - global_id: global_id, - info: info, - value_flow: value_flow, - state_update: state_update, - extra: extra, -} - -} -; - throw new Error('') -; -} - -export function storeBlock(block: Block): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x11ef55aa, 32) - - builder.storeInt(block.global_id, 32) - - let cell1 = beginCell() - - - storeBlockInfo(block.info)(cell1) - - builder.storeRef(cell1) - - let cell2 = beginCell() - - - storeValueFlow(block.value_flow)(cell2) - - builder.storeRef(cell2) - - let cell3 = beginCell() - - - storeMERKLE_UPDATE(block.state_update, storeShardState)(cell3) - - builder.storeRef(cell3) - - let cell4 = beginCell() - - - storeBlockExtra(block.extra)(cell4) - - builder.storeRef(cell4) - -}) - -; -} - -export function loadBlockExtra(slice: Slice): BlockExtra { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x8e7f7ff8))) { - slice.loadUint(32) - let slice1 = slice.loadRef().beginParse() - - let in_msg_descr: InMsgDescr = loadInMsgDescr(slice1) - - let slice2 = slice.loadRef().beginParse() - - let out_msg_descr: OutMsgDescr = loadOutMsgDescr(slice2) - - let slice3 = slice.loadRef().beginParse() - - let account_blocks: ShardAccountBlocks = loadShardAccountBlocks(slice3) - - let rand_seed: BitString = slice.loadBits(256) - - let created_by: BitString = slice.loadBits(256) - - let custom: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() - - - return loadMcBlockExtra(slice1) - -}) -) - - return { - kind: 'BlockExtra', - in_msg_descr: in_msg_descr, - out_msg_descr: out_msg_descr, - account_blocks: account_blocks, - rand_seed: rand_seed, - created_by: created_by, - custom: custom, -} - -} -; - throw new Error('') -; -} - -export function storeBlockExtra(blockExtra: BlockExtra): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x8e7f7ff8, 32) - - let cell1 = beginCell() - - - storeInMsgDescr(blockExtra.in_msg_descr)(cell1) - - builder.storeRef(cell1) - - let cell2 = beginCell() - - - storeOutMsgDescr(blockExtra.out_msg_descr)(cell2) - - builder.storeRef(cell2) - - let cell3 = beginCell() - - - storeShardAccountBlocks(blockExtra.account_blocks)(cell3) - - builder.storeRef(cell3) - - builder.storeBits(blockExtra.rand_seed) - - builder.storeBits(blockExtra.created_by) - - storeMaybe(blockExtra.custom, ((arg: McBlockExtra) => { - return ((builder: Builder) => { - let cell1 = beginCell() - - - storeMcBlockExtra(arg)(cell1) - - builder.storeRef(cell1) - - - }) - - - }) - )(builder) - -}) - -; -} - -export function loadValueFlow(slice: Slice): ValueFlow { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x98055e37))) { - slice.loadUint(32) - let slice1 = slice.loadRef().beginParse() - - let from_prev_blk: CurrencyCollection = loadCurrencyCollection(slice1) - - let to_next_blk: CurrencyCollection = loadCurrencyCollection(slice1) - - let imported: CurrencyCollection = loadCurrencyCollection(slice1) - - let exported: CurrencyCollection = loadCurrencyCollection(slice1) - - let fees_collected: CurrencyCollection = loadCurrencyCollection(slice) - - let slice2 = slice.loadRef().beginParse() - - let fees_imported: CurrencyCollection = loadCurrencyCollection(slice2) - - let recovered: CurrencyCollection = loadCurrencyCollection(slice2) - - let created: CurrencyCollection = loadCurrencyCollection(slice2) - - let minted: CurrencyCollection = loadCurrencyCollection(slice2) - - return { - kind: 'ValueFlow', - from_prev_blk: from_prev_blk, - to_next_blk: to_next_blk, - imported: imported, - exported: exported, - fees_collected: fees_collected, - fees_imported: fees_imported, - recovered: recovered, - created: created, - minted: minted, -} - -} -; - throw new Error('') -; -} - -export function storeValueFlow(valueFlow: ValueFlow): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x98055e37, 32) - - let cell1 = beginCell() - - - storeCurrencyCollection(valueFlow.from_prev_blk)(cell1) - - storeCurrencyCollection(valueFlow.to_next_blk)(cell1) - - storeCurrencyCollection(valueFlow.imported)(cell1) - - storeCurrencyCollection(valueFlow.exported)(cell1) - - builder.storeRef(cell1) - - storeCurrencyCollection(valueFlow.fees_collected)(builder) - - let cell2 = beginCell() - - - storeCurrencyCollection(valueFlow.fees_imported)(cell2) - - storeCurrencyCollection(valueFlow.recovered)(cell2) - - storeCurrencyCollection(valueFlow.created)(cell2) - - storeCurrencyCollection(valueFlow.minted)(cell2) - - builder.storeRef(cell2) - -}) - -; -} - -export function loadBinTree(slice: Slice, loadX: (slice: Slice) => X -): BinTree { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1) - let leaf: X = loadX(slice) - - return { - kind: 'BinTree_bt_leaf', - leaf: leaf, -} - -} -; - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1) - let slice1 = slice.loadRef().beginParse() - - let left: BinTree = loadBinTree(slice1, loadX) - - let slice2 = slice.loadRef().beginParse() - - let right: BinTree = loadBinTree(slice2, loadX) - - return { - kind: 'BinTree_bt_fork', - left: left, - right: right, -} - -} -; - throw new Error('') -; -} - -export function storeBinTree(binTree: BinTree, storeX: (x: X) => (builder: Builder) => void - -): (builder: Builder) => void { - if ((binTree.kind == 'BinTree_bt_leaf')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1) - - storeX(binTree.leaf)(builder) - -}) - -} -; - if ((binTree.kind == 'BinTree_bt_fork')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1) - - let cell1 = beginCell() - - - storeBinTree(binTree.left, storeX)(cell1) - - builder.storeRef(cell1) - - let cell2 = beginCell() - - - storeBinTree(binTree.right, storeX)(cell2) - - builder.storeRef(cell2) - -}) - -} -; - throw new Error('') -; -} - -export function loadFutureSplitMerge(slice: Slice): FutureSplitMerge { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1) - return { - kind: 'FutureSplitMerge_fsm_none', -} - -} -; - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b10))) { - slice.loadUint(2) - let split_utime: number = slice.loadUint(32) - - let interval: number = slice.loadUint(32) - - return { - kind: 'FutureSplitMerge_fsm_split', - split_utime: split_utime, - interval: interval, -} - -} -; - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b11))) { - slice.loadUint(2) - let merge_utime: number = slice.loadUint(32) - - let interval: number = slice.loadUint(32) - - return { - kind: 'FutureSplitMerge_fsm_merge', - merge_utime: merge_utime, - interval: interval, -} - -} -; - throw new Error('') -; -} - -export function storeFutureSplitMerge(futureSplitMerge: FutureSplitMerge): (builder: Builder) => void { - if ((futureSplitMerge.kind == 'FutureSplitMerge_fsm_none')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1) - -}) - -} -; - if ((futureSplitMerge.kind == 'FutureSplitMerge_fsm_split')) { - return ((builder: Builder) => { - builder.storeUint(0b10, 2) - - builder.storeUint(futureSplitMerge.split_utime, 32) - - builder.storeUint(futureSplitMerge.interval, 32) - -}) - -} -; - if ((futureSplitMerge.kind == 'FutureSplitMerge_fsm_merge')) { - return ((builder: Builder) => { - builder.storeUint(0b11, 2) - - builder.storeUint(futureSplitMerge.merge_utime, 32) - - builder.storeUint(futureSplitMerge.interval, 32) - -}) - -} -; - throw new Error('') -; -} - -export function loadShardDescr(slice: Slice): ShardDescr { - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0xb))) { - slice.loadUint(4) - let seq_no: number = slice.loadUint(32) - - let reg_mc_seqno: number = slice.loadUint(32) - - let start_lt: number = slice.loadUint(64) - - let end_lt: number = slice.loadUint(64) - - let root_hash: BitString = slice.loadBits(256) - - let file_hash: BitString = slice.loadBits(256) - - let before_split: Bool = loadBool(slice) - - let before_merge: Bool = loadBool(slice) - - let want_split: Bool = loadBool(slice) - - let want_merge: Bool = loadBool(slice) - - let nx_cc_updated: Bool = loadBool(slice) - - let flags: number = slice.loadUint(3) - - let next_catchain_seqno: number = slice.loadUint(32) - - let next_validator_shard: number = slice.loadUint(64) - - let min_ref_mc_seqno: number = slice.loadUint(32) - - let gen_utime: number = slice.loadUint(32) - - let split_merge_at: FutureSplitMerge = loadFutureSplitMerge(slice) - - let fees_collected: CurrencyCollection = loadCurrencyCollection(slice) - - let funds_created: CurrencyCollection = loadCurrencyCollection(slice) - - if ((!(flags == 0))) { - throw new Error('') - } - return { - kind: 'ShardDescr_shard_descr', - seq_no: seq_no, - reg_mc_seqno: reg_mc_seqno, - start_lt: start_lt, - end_lt: end_lt, - root_hash: root_hash, - file_hash: file_hash, - before_split: before_split, - before_merge: before_merge, - want_split: want_split, - want_merge: want_merge, - nx_cc_updated: nx_cc_updated, - flags: flags, - next_catchain_seqno: next_catchain_seqno, - next_validator_shard: next_validator_shard, - min_ref_mc_seqno: min_ref_mc_seqno, - gen_utime: gen_utime, - split_merge_at: split_merge_at, - fees_collected: fees_collected, - funds_created: funds_created, -} - -} -; - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0xa))) { - slice.loadUint(4) - let seq_no: number = slice.loadUint(32) - - let reg_mc_seqno: number = slice.loadUint(32) - - let start_lt: number = slice.loadUint(64) - - let end_lt: number = slice.loadUint(64) - - let root_hash: BitString = slice.loadBits(256) - - let file_hash: BitString = slice.loadBits(256) - - let before_split: Bool = loadBool(slice) - - let before_merge: Bool = loadBool(slice) - - let want_split: Bool = loadBool(slice) - - let want_merge: Bool = loadBool(slice) - - let nx_cc_updated: Bool = loadBool(slice) - - let flags: number = slice.loadUint(3) - - let next_catchain_seqno: number = slice.loadUint(32) - - let next_validator_shard: number = slice.loadUint(64) - - let min_ref_mc_seqno: number = slice.loadUint(32) - - let gen_utime: number = slice.loadUint(32) - - let split_merge_at: FutureSplitMerge = loadFutureSplitMerge(slice) - - let slice1 = slice.loadRef().beginParse() - - let fees_collected: CurrencyCollection = loadCurrencyCollection(slice1) - - let funds_created: CurrencyCollection = loadCurrencyCollection(slice1) - - if ((!(flags == 0))) { - throw new Error('') - } - return { - kind: 'ShardDescr_shard_descr_new', - seq_no: seq_no, - reg_mc_seqno: reg_mc_seqno, - start_lt: start_lt, - end_lt: end_lt, - root_hash: root_hash, - file_hash: file_hash, - before_split: before_split, - before_merge: before_merge, - want_split: want_split, - want_merge: want_merge, - nx_cc_updated: nx_cc_updated, - flags: flags, - next_catchain_seqno: next_catchain_seqno, - next_validator_shard: next_validator_shard, - min_ref_mc_seqno: min_ref_mc_seqno, - gen_utime: gen_utime, - split_merge_at: split_merge_at, - fees_collected: fees_collected, - funds_created: funds_created, -} - -} -; - throw new Error('') -; -} - -export function storeShardDescr(shardDescr: ShardDescr): (builder: Builder) => void { - if ((shardDescr.kind == 'ShardDescr_shard_descr')) { - return ((builder: Builder) => { - builder.storeUint(0xb, 4) - - builder.storeUint(shardDescr.seq_no, 32) - - builder.storeUint(shardDescr.reg_mc_seqno, 32) - - builder.storeUint(shardDescr.start_lt, 64) - - builder.storeUint(shardDescr.end_lt, 64) - - builder.storeBits(shardDescr.root_hash) - - builder.storeBits(shardDescr.file_hash) - - storeBool(shardDescr.before_split)(builder) - - storeBool(shardDescr.before_merge)(builder) - - storeBool(shardDescr.want_split)(builder) - - storeBool(shardDescr.want_merge)(builder) - - storeBool(shardDescr.nx_cc_updated)(builder) - - builder.storeUint(shardDescr.flags, 3) - - builder.storeUint(shardDescr.next_catchain_seqno, 32) - - builder.storeUint(shardDescr.next_validator_shard, 64) - - builder.storeUint(shardDescr.min_ref_mc_seqno, 32) - - builder.storeUint(shardDescr.gen_utime, 32) - - storeFutureSplitMerge(shardDescr.split_merge_at)(builder) - - storeCurrencyCollection(shardDescr.fees_collected)(builder) - - storeCurrencyCollection(shardDescr.funds_created)(builder) - - if ((!(shardDescr.flags == 0))) { - throw new Error('') - } - -}) - -} -; - if ((shardDescr.kind == 'ShardDescr_shard_descr_new')) { - return ((builder: Builder) => { - builder.storeUint(0xa, 4) - - builder.storeUint(shardDescr.seq_no, 32) - - builder.storeUint(shardDescr.reg_mc_seqno, 32) - - builder.storeUint(shardDescr.start_lt, 64) - - builder.storeUint(shardDescr.end_lt, 64) - - builder.storeBits(shardDescr.root_hash) - - builder.storeBits(shardDescr.file_hash) - - storeBool(shardDescr.before_split)(builder) - - storeBool(shardDescr.before_merge)(builder) - - storeBool(shardDescr.want_split)(builder) - - storeBool(shardDescr.want_merge)(builder) - - storeBool(shardDescr.nx_cc_updated)(builder) - - builder.storeUint(shardDescr.flags, 3) - - builder.storeUint(shardDescr.next_catchain_seqno, 32) - - builder.storeUint(shardDescr.next_validator_shard, 64) - - builder.storeUint(shardDescr.min_ref_mc_seqno, 32) - - builder.storeUint(shardDescr.gen_utime, 32) - - storeFutureSplitMerge(shardDescr.split_merge_at)(builder) - - let cell1 = beginCell() - - - storeCurrencyCollection(shardDescr.fees_collected)(cell1) - - storeCurrencyCollection(shardDescr.funds_created)(cell1) - - builder.storeRef(cell1) - - if ((!(shardDescr.flags == 0))) { - throw new Error('') - } - -}) - -} -; - throw new Error('') -; -} - -export function loadShardHashes(slice: Slice): ShardHashes { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xd7c80ab1))) { - slice.loadUint(32) - let anon0: HashmapE> = loadHashmapE>(slice, 32, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() - - - return loadBinTree(slice1, loadShardDescr) - -}) -) - - return { - kind: 'ShardHashes', - anon0: anon0, -} - -} -; - throw new Error('') -; -} - -export function storeShardHashes(shardHashes: ShardHashes): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xd7c80ab1, 32) - - storeHashmapE>(shardHashes.anon0, ((arg: BinTree) => { - return ((builder: Builder) => { - let cell1 = beginCell() - - - storeBinTree(arg, storeShardDescr)(cell1) - - builder.storeRef(cell1) - - - }) - - - }) - )(builder) - -}) - -; -} - -export function loadBinTreeAug(slice: Slice, loadX: (slice: Slice) => X -, loadY: (slice: Slice) => Y -): BinTreeAug { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1) - let extra: Y = loadY(slice) - - let leaf: X = loadX(slice) - - return { - kind: 'BinTreeAug_bta_leaf', - extra: extra, - leaf: leaf, -} - -} -; - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1) - let slice1 = slice.loadRef().beginParse() - - let left: BinTreeAug = loadBinTreeAug(slice1, loadX, loadY) - - let slice2 = slice.loadRef().beginParse() - - let right: BinTreeAug = loadBinTreeAug(slice2, loadX, loadY) - - let extra: Y = loadY(slice) - - return { - kind: 'BinTreeAug_bta_fork', - left: left, - right: right, - extra: extra, -} - -} -; - throw new Error('') -; -} - -export function storeBinTreeAug(binTreeAug: BinTreeAug, storeX: (x: X) => (builder: Builder) => void - -, storeY: (y: Y) => (builder: Builder) => void - -): (builder: Builder) => void { - if ((binTreeAug.kind == 'BinTreeAug_bta_leaf')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1) - - storeY(binTreeAug.extra)(builder) - - storeX(binTreeAug.leaf)(builder) - -}) - -} -; - if ((binTreeAug.kind == 'BinTreeAug_bta_fork')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1) - - let cell1 = beginCell() - - - storeBinTreeAug(binTreeAug.left, storeX, storeY)(cell1) - - builder.storeRef(cell1) - - let cell2 = beginCell() - - - storeBinTreeAug(binTreeAug.right, storeX, storeY)(cell2) - - builder.storeRef(cell2) - - storeY(binTreeAug.extra)(builder) - -}) - -} -; - throw new Error('') -; -} - -export function loadShardFeeCreated(slice: Slice): ShardFeeCreated { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xe537952e))) { - slice.loadUint(32) - let fees: CurrencyCollection = loadCurrencyCollection(slice) - - let create: CurrencyCollection = loadCurrencyCollection(slice) - - return { - kind: 'ShardFeeCreated', - fees: fees, - create: create, -} - -} -; - throw new Error('') -; -} - -export function storeShardFeeCreated(shardFeeCreated: ShardFeeCreated): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xe537952e, 32) - - storeCurrencyCollection(shardFeeCreated.fees)(builder) - - storeCurrencyCollection(shardFeeCreated.create)(builder) - -}) - -; -} - -export function loadShardFees(slice: Slice): ShardFees { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xfea0d880))) { - slice.loadUint(32) - let anon0: HashmapAugE = loadHashmapAugE(slice, 96, loadShardFeeCreated, loadShardFeeCreated) - - return { - kind: 'ShardFees', - anon0: anon0, -} - -} -; - throw new Error('') -; -} - -export function storeShardFees(shardFees: ShardFees): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xfea0d880, 32) - - storeHashmapAugE(shardFees.anon0, storeShardFeeCreated, storeShardFeeCreated)(builder) - -}) - -; -} - -export function loadConfigParams(slice: Slice): ConfigParams { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x88116702))) { - slice.loadUint(32) - let config_addr: BitString = slice.loadBits(256) - - let slice1 = slice.loadRef().beginParse() - - let config: Hashmap = loadHashmap(slice1, 32, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() - - - return slice1 - -}) -) - - return { - kind: 'ConfigParams', - config_addr: config_addr, - config: config, -} - -} -; - throw new Error('') -; -} - -export function storeConfigParams(configParams: ConfigParams): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x88116702, 32) - - builder.storeBits(configParams.config_addr) - - let cell1 = beginCell() - - - storeHashmap(configParams.config, ((arg: Slice) => { - return ((builder: Builder) => { - let cell1 = beginCell() - - - cell1.storeSlice(arg) - - builder.storeRef(cell1) - - - }) - - - }) - )(cell1) - - builder.storeRef(cell1) - -}) - -; -} - -export function loadValidatorInfo(slice: Slice): ValidatorInfo { - let validator_list_hash_short: number = slice.loadUint(32) - -; - let catchain_seqno: number = slice.loadUint(32) - -; - let nx_cc_updated: Bool = loadBool(slice) - -; - return { - kind: 'ValidatorInfo', - validator_list_hash_short: validator_list_hash_short, - catchain_seqno: catchain_seqno, - nx_cc_updated: nx_cc_updated, -} - -; -} - -export function storeValidatorInfo(validatorInfo: ValidatorInfo): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(validatorInfo.validator_list_hash_short, 32) - - builder.storeUint(validatorInfo.catchain_seqno, 32) - - storeBool(validatorInfo.nx_cc_updated)(builder) - -}) - -; -} - -export function loadValidatorBaseInfo(slice: Slice): ValidatorBaseInfo { - let validator_list_hash_short: number = slice.loadUint(32) - -; - let catchain_seqno: number = slice.loadUint(32) - -; - return { - kind: 'ValidatorBaseInfo', - validator_list_hash_short: validator_list_hash_short, - catchain_seqno: catchain_seqno, -} - -; -} - -export function storeValidatorBaseInfo(validatorBaseInfo: ValidatorBaseInfo): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(validatorBaseInfo.validator_list_hash_short, 32) - - builder.storeUint(validatorBaseInfo.catchain_seqno, 32) - -}) - -; -} - -export function loadKeyMaxLt(slice: Slice): KeyMaxLt { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x9a6d79a5))) { - slice.loadUint(32) - let key: Bool = loadBool(slice) - - let max_end_lt: number = slice.loadUint(64) - - return { - kind: 'KeyMaxLt', - key: key, - max_end_lt: max_end_lt, -} - -} -; - throw new Error('') -; -} - -export function storeKeyMaxLt(keyMaxLt: KeyMaxLt): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x9a6d79a5, 32) - - storeBool(keyMaxLt.key)(builder) - - builder.storeUint(keyMaxLt.max_end_lt, 64) - -}) - -; -} - -export function loadKeyExtBlkRef(slice: Slice): KeyExtBlkRef { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xafeab488))) { - slice.loadUint(32) - let key: Bool = loadBool(slice) - - let blk_ref: ExtBlkRef = loadExtBlkRef(slice) - - return { - kind: 'KeyExtBlkRef', - key: key, - blk_ref: blk_ref, -} - -} -; - throw new Error('') -; -} - -export function storeKeyExtBlkRef(keyExtBlkRef: KeyExtBlkRef): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xafeab488, 32) - - storeBool(keyExtBlkRef.key)(builder) - - storeExtBlkRef(keyExtBlkRef.blk_ref)(builder) - -}) - -; -} - -export function loadOldMcBlocksInfo(slice: Slice): OldMcBlocksInfo { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xf385c1e3))) { - slice.loadUint(32) - let anon0: HashmapAugE = loadHashmapAugE(slice, 32, loadKeyExtBlkRef, loadKeyMaxLt) - - return { - kind: 'OldMcBlocksInfo', - anon0: anon0, -} - -} -; - throw new Error('') -; -} - -export function storeOldMcBlocksInfo(oldMcBlocksInfo: OldMcBlocksInfo): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xf385c1e3, 32) - - storeHashmapAugE(oldMcBlocksInfo.anon0, storeKeyExtBlkRef, storeKeyMaxLt)(builder) - -}) - -; -} - -export function loadCounters(slice: Slice): Counters { - let last_updated: number = slice.loadUint(32) - -; - let total: number = slice.loadUint(64) - -; - let cnt2048: number = slice.loadUint(64) - -; - let cnt65536: number = slice.loadUint(64) - -; - return { - kind: 'Counters', - last_updated: last_updated, - total: total, - cnt2048: cnt2048, - cnt65536: cnt65536, -} - -; -} - -export function storeCounters(counters: Counters): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(counters.last_updated, 32) - - builder.storeUint(counters.total, 64) - - builder.storeUint(counters.cnt2048, 64) - - builder.storeUint(counters.cnt65536, 64) - -}) - -; -} - -export function loadCreatorStats(slice: Slice): CreatorStats { - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0x4))) { - slice.loadUint(4) - let mc_blocks: Counters = loadCounters(slice) - - let shard_blocks: Counters = loadCounters(slice) - - return { - kind: 'CreatorStats', - mc_blocks: mc_blocks, - shard_blocks: shard_blocks, -} - -} -; - throw new Error('') -; -} - -export function storeCreatorStats(creatorStats: CreatorStats): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x4, 4) - - storeCounters(creatorStats.mc_blocks)(builder) - - storeCounters(creatorStats.shard_blocks)(builder) - -}) - -; -} - -export function loadBlockCreateStats(slice: Slice): BlockCreateStats { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x17))) { - slice.loadUint(8) - let counters: HashmapE = loadHashmapE(slice, 256, loadCreatorStats) - - return { - kind: 'BlockCreateStats_block_create_stats', - counters: counters, -} - -} -; - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x34))) { - slice.loadUint(8) - let counters: HashmapAugE = loadHashmapAugE(slice, 256, loadCreatorStats, ((slice: Slice) => { - return slice.loadUint(32) - -}) -) - - return { - kind: 'BlockCreateStats_block_create_stats_ext', - counters: counters, -} - -} -; - throw new Error('') -; -} - -export function storeBlockCreateStats(blockCreateStats: BlockCreateStats): (builder: Builder) => void { - if ((blockCreateStats.kind == 'BlockCreateStats_block_create_stats')) { - return ((builder: Builder) => { - builder.storeUint(0x17, 8) - - storeHashmapE(blockCreateStats.counters, storeCreatorStats)(builder) - -}) - -} -; - if ((blockCreateStats.kind == 'BlockCreateStats_block_create_stats_ext')) { - return ((builder: Builder) => { - builder.storeUint(0x34, 8) - - storeHashmapAugE(blockCreateStats.counters, storeCreatorStats, ((arg: number) => { - return ((builder: Builder) => { - builder.storeUint(arg, 32) - - }) - - - }) - )(builder) - -}) - -} -; - throw new Error('') -; -} - -export function loadMcStateExtra(slice: Slice): McStateExtra { - if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0xcc26))) { - slice.loadUint(16) - let shard_hashes: ShardHashes = loadShardHashes(slice) - - let config: ConfigParams = loadConfigParams(slice) - - let slice1 = slice.loadRef().beginParse() - - let flags: number = slice1.loadUint(16) - - let validator_info: ValidatorInfo = loadValidatorInfo(slice1) - - let prev_blocks: OldMcBlocksInfo = loadOldMcBlocksInfo(slice1) - - let after_key_block: Bool = loadBool(slice1) - - let last_key_block: Maybe = loadMaybe(slice1, loadExtBlkRef) - - let block_create_stats: BlockCreateStats | undefined = ((flags & (1 << 0)) ? loadBlockCreateStats(slice1) : undefined) - - let global_balance: CurrencyCollection = loadCurrencyCollection(slice) - - return { - kind: 'McStateExtra', - shard_hashes: shard_hashes, - config: config, - flags: flags, - validator_info: validator_info, - prev_blocks: prev_blocks, - after_key_block: after_key_block, - last_key_block: last_key_block, - block_create_stats: block_create_stats, - global_balance: global_balance, -} - -} -; - throw new Error('') -; -} - -export function storeMcStateExtra(mcStateExtra: McStateExtra): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xcc26, 16) - - storeShardHashes(mcStateExtra.shard_hashes)(builder) - - storeConfigParams(mcStateExtra.config)(builder) - - let cell1 = beginCell() - - - cell1.storeUint(mcStateExtra.flags, 16) - - storeValidatorInfo(mcStateExtra.validator_info)(cell1) - - storeOldMcBlocksInfo(mcStateExtra.prev_blocks)(cell1) - - storeBool(mcStateExtra.after_key_block)(cell1) - - storeMaybe(mcStateExtra.last_key_block, storeExtBlkRef)(cell1) - - if ((mcStateExtra.block_create_stats != undefined)) { - storeBlockCreateStats(mcStateExtra.block_create_stats)(cell1) - } - - builder.storeRef(cell1) - - storeCurrencyCollection(mcStateExtra.global_balance)(builder) - -}) - -; -} - -export function loadSigPubKey(slice: Slice): SigPubKey { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x8e81278a))) { - slice.loadUint(32) - let pubkey: BitString = slice.loadBits(256) - - return { - kind: 'SigPubKey', - pubkey: pubkey, -} - -} -; - throw new Error('') -; -} - -export function storeSigPubKey(sigPubKey: SigPubKey): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x8e81278a, 32) - - builder.storeBits(sigPubKey.pubkey) - -}) - -; -} - -export function loadCryptoSignatureSimple(slice: Slice): CryptoSignatureSimple { - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0x5))) { - slice.loadUint(4) - let R: BitString = slice.loadBits(256) - - let s: BitString = slice.loadBits(256) - - return { - kind: 'CryptoSignatureSimple', - R: R, - s: s, -} - -} -; - throw new Error('') -; -} - -export function storeCryptoSignatureSimple(cryptoSignatureSimple: CryptoSignatureSimple): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x5, 4) - - builder.storeBits(cryptoSignatureSimple.R) - - builder.storeBits(cryptoSignatureSimple.s) - -}) - -; -} - -export function loadCryptoSignature(slice: Slice): CryptoSignature { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xdaa99887))) { - slice.loadUint(32) - let anon0: CryptoSignatureSimple = loadCryptoSignatureSimple(slice) - - return { - kind: 'CryptoSignature__', - anon0: anon0, -} - -} -; - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0xf))) { - slice.loadUint(4) - let slice1 = slice.loadRef().beginParse() - - let signed_cert: SignedCertificate = loadSignedCertificate(slice1) - - let temp_key_signature: CryptoSignatureSimple = loadCryptoSignatureSimple(slice) - - return { - kind: 'CryptoSignature_chained_signature', - signed_cert: signed_cert, - temp_key_signature: temp_key_signature, -} - -} -; - throw new Error('') -; -} - -export function storeCryptoSignature(cryptoSignature: CryptoSignature): (builder: Builder) => void { - if ((cryptoSignature.kind == 'CryptoSignature__')) { - return ((builder: Builder) => { - builder.storeUint(0xdaa99887, 32) - - storeCryptoSignatureSimple(cryptoSignature.anon0)(builder) - -}) - -} -; - if ((cryptoSignature.kind == 'CryptoSignature_chained_signature')) { - return ((builder: Builder) => { - builder.storeUint(0xf, 4) - - let cell1 = beginCell() - - - storeSignedCertificate(cryptoSignature.signed_cert)(cell1) - - builder.storeRef(cell1) - - storeCryptoSignatureSimple(cryptoSignature.temp_key_signature)(builder) - -}) - -} -; - throw new Error('') -; -} - -export function loadCryptoSignaturePair(slice: Slice): CryptoSignaturePair { - let node_id_short: BitString = slice.loadBits(256) - -; - let sign: CryptoSignature = loadCryptoSignature(slice) - -; - return { - kind: 'CryptoSignaturePair', - node_id_short: node_id_short, - sign: sign, -} - -; -} - -export function storeCryptoSignaturePair(cryptoSignaturePair: CryptoSignaturePair): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeBits(cryptoSignaturePair.node_id_short) - - storeCryptoSignature(cryptoSignaturePair.sign)(builder) - -}) - -; -} - -export function loadCertificate(slice: Slice): Certificate { - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0x4))) { - slice.loadUint(4) - let temp_key: SigPubKey = loadSigPubKey(slice) - - let valid_since: number = slice.loadUint(32) - - let valid_until: number = slice.loadUint(32) - - return { - kind: 'Certificate', - temp_key: temp_key, - valid_since: valid_since, - valid_until: valid_until, -} - -} -; - throw new Error('') -; -} - -export function storeCertificate(certificate: Certificate): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x4, 4) - - storeSigPubKey(certificate.temp_key)(builder) - - builder.storeUint(certificate.valid_since, 32) - - builder.storeUint(certificate.valid_until, 32) - -}) - -; -} - -export function loadCertificateEnv(slice: Slice): CertificateEnv { - if (((slice.remainingBits >= 28) && (slice.preloadUint(28) == 0xa419b7d))) { - slice.loadUint(28) - let certificate: Certificate = loadCertificate(slice) - - return { - kind: 'CertificateEnv', - certificate: certificate, -} - -} -; - throw new Error('') -; -} - -export function storeCertificateEnv(certificateEnv: CertificateEnv): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xa419b7d, 28) - - storeCertificate(certificateEnv.certificate)(builder) - -}) - -; -} - -export function loadSignedCertificate(slice: Slice): SignedCertificate { - let certificate: Certificate = loadCertificate(slice) - -; - let certificate_signature: CryptoSignature = loadCryptoSignature(slice) - -; - return { - kind: 'SignedCertificate', - certificate: certificate, - certificate_signature: certificate_signature, -} - -; -} - -export function storeSignedCertificate(signedCertificate: SignedCertificate): (builder: Builder) => void { - return ((builder: Builder) => { - storeCertificate(signedCertificate.certificate)(builder) - - storeCryptoSignature(signedCertificate.certificate_signature)(builder) - -}) - -; -} - -export function loadMcBlockExtra(slice: Slice): McBlockExtra { - if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0xcca5))) { - slice.loadUint(16) - let key_block: number = slice.loadUint(1) - - let shard_hashes: ShardHashes = loadShardHashes(slice) - - let shard_fees: ShardFees = loadShardFees(slice) - - let slice1 = slice.loadRef().beginParse() - - let prev_blk_signatures: HashmapE = loadHashmapE(slice1, 16, loadCryptoSignaturePair) - - let recover_create_msg: Maybe = loadMaybe(slice1, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() - - - return loadInMsg(slice1) - -}) -) - - let mint_msg: Maybe = loadMaybe(slice1, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() - - - return loadInMsg(slice1) - -}) -) - - let config: ConfigParams | undefined = (key_block ? loadConfigParams(slice) : undefined) - - return { - kind: 'McBlockExtra', - key_block: key_block, - shard_hashes: shard_hashes, - shard_fees: shard_fees, - prev_blk_signatures: prev_blk_signatures, - recover_create_msg: recover_create_msg, - mint_msg: mint_msg, - config: config, -} - -} -; - throw new Error('') -; -} - -export function storeMcBlockExtra(mcBlockExtra: McBlockExtra): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xcca5, 16) - - builder.storeUint(mcBlockExtra.key_block, 1) - - storeShardHashes(mcBlockExtra.shard_hashes)(builder) - - storeShardFees(mcBlockExtra.shard_fees)(builder) - - let cell1 = beginCell() - - - storeHashmapE(mcBlockExtra.prev_blk_signatures, storeCryptoSignaturePair)(cell1) - - storeMaybe(mcBlockExtra.recover_create_msg, ((arg: InMsg) => { - return ((builder: Builder) => { - let cell1 = beginCell() - - - storeInMsg(arg)(cell1) - - builder.storeRef(cell1) - - - }) - - - }) - )(cell1) - - storeMaybe(mcBlockExtra.mint_msg, ((arg: InMsg) => { - return ((builder: Builder) => { - let cell1 = beginCell() - - - storeInMsg(arg)(cell1) - - builder.storeRef(cell1) - - - }) - - - }) - )(cell1) - - builder.storeRef(cell1) - - if ((mcBlockExtra.config != undefined)) { - storeConfigParams(mcBlockExtra.config)(builder) - } - -}) - -; -} - -export function loadValidatorDescr(slice: Slice): ValidatorDescr { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x53))) { - slice.loadUint(8) - let public_key: SigPubKey = loadSigPubKey(slice) - - let weight: number = slice.loadUint(64) - - return { - kind: 'ValidatorDescr_validator', - public_key: public_key, - weight: weight, -} - -} -; - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x73))) { - slice.loadUint(8) - let public_key: SigPubKey = loadSigPubKey(slice) - - let weight: number = slice.loadUint(64) - - let adnl_addr: BitString = slice.loadBits(256) - - return { - kind: 'ValidatorDescr_validator_addr', - public_key: public_key, - weight: weight, - adnl_addr: adnl_addr, -} - -} -; - throw new Error('') -; -} - -export function storeValidatorDescr(validatorDescr: ValidatorDescr): (builder: Builder) => void { - if ((validatorDescr.kind == 'ValidatorDescr_validator')) { - return ((builder: Builder) => { - builder.storeUint(0x53, 8) - - storeSigPubKey(validatorDescr.public_key)(builder) - - builder.storeUint(validatorDescr.weight, 64) - -}) - -} -; - if ((validatorDescr.kind == 'ValidatorDescr_validator_addr')) { - return ((builder: Builder) => { - builder.storeUint(0x73, 8) - - storeSigPubKey(validatorDescr.public_key)(builder) - - builder.storeUint(validatorDescr.weight, 64) - - builder.storeBits(validatorDescr.adnl_addr) - -}) - -} -; - throw new Error('') -; -} - -export function loadValidatorSet(slice: Slice): ValidatorSet { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x11))) { - slice.loadUint(8) - let utime_since: number = slice.loadUint(32) - - let utime_until: number = slice.loadUint(32) - - let total: number = slice.loadUint(16) - - let main: number = slice.loadUint(16) - - let list: Hashmap = loadHashmap(slice, 16, loadValidatorDescr) - - if ((!(main <= total))) { - throw new Error('') - } - if ((!(main >= 1))) { - throw new Error('') - } - return { - kind: 'ValidatorSet_validators', - utime_since: utime_since, - utime_until: utime_until, - total: total, - main: main, - list: list, -} - -} -; - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x12))) { - slice.loadUint(8) - let utime_since: number = slice.loadUint(32) - - let utime_until: number = slice.loadUint(32) - - let total: number = slice.loadUint(16) - - let main: number = slice.loadUint(16) - - let total_weight: number = slice.loadUint(64) - - let list: HashmapE = loadHashmapE(slice, 16, loadValidatorDescr) - - if ((!(main <= total))) { - throw new Error('') - } - if ((!(main >= 1))) { - throw new Error('') - } - return { - kind: 'ValidatorSet_validators_ext', - utime_since: utime_since, - utime_until: utime_until, - total: total, - main: main, - total_weight: total_weight, - list: list, -} - -} -; - throw new Error('') -; -} - -export function storeValidatorSet(validatorSet: ValidatorSet): (builder: Builder) => void { - if ((validatorSet.kind == 'ValidatorSet_validators')) { - return ((builder: Builder) => { - builder.storeUint(0x11, 8) - - builder.storeUint(validatorSet.utime_since, 32) - - builder.storeUint(validatorSet.utime_until, 32) - - builder.storeUint(validatorSet.total, 16) - - builder.storeUint(validatorSet.main, 16) - - storeHashmap(validatorSet.list, storeValidatorDescr)(builder) - - if ((!(validatorSet.main <= validatorSet.total))) { - throw new Error('') - } - - if ((!(validatorSet.main >= 1))) { - throw new Error('') - } - -}) - -} -; - if ((validatorSet.kind == 'ValidatorSet_validators_ext')) { - return ((builder: Builder) => { - builder.storeUint(0x12, 8) - - builder.storeUint(validatorSet.utime_since, 32) - - builder.storeUint(validatorSet.utime_until, 32) - - builder.storeUint(validatorSet.total, 16) - - builder.storeUint(validatorSet.main, 16) - - builder.storeUint(validatorSet.total_weight, 64) - - storeHashmapE(validatorSet.list, storeValidatorDescr)(builder) - - if ((!(validatorSet.main <= validatorSet.total))) { - throw new Error('') - } - - if ((!(validatorSet.main >= 1))) { - throw new Error('') - } - -}) - -} -; - throw new Error('') -; -} - -export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xbc7f2648) && (arg0 == 0)))) { - slice.loadUint(32) - let config_addr: BitString = slice.loadBits(256) - - return { - kind: 'ConfigParam__', - config_addr: config_addr, -} - -} -; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x84659d0d) && (arg0 == 1)))) { - slice.loadUint(32) - let elector_addr: BitString = slice.loadBits(256) - - return { - kind: 'ConfigParam__1', - elector_addr: elector_addr, -} - -} -; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x8648b2c4) && (arg0 == 2)))) { - slice.loadUint(32) - let minter_addr: BitString = slice.loadBits(256) - - return { - kind: 'ConfigParam__2', - minter_addr: minter_addr, -} - -} -; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x8a752dc5) && (arg0 == 3)))) { - slice.loadUint(32) - let fee_collector_addr: BitString = slice.loadBits(256) - - return { - kind: 'ConfigParam__3', - fee_collector_addr: fee_collector_addr, -} - -} -; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x8ceae93f) && (arg0 == 4)))) { - slice.loadUint(32) - let dns_root_addr: BitString = slice.loadBits(256) - - return { - kind: 'ConfigParam__4', - dns_root_addr: dns_root_addr, -} - -} -; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xb2571db5) && (arg0 == 6)))) { - slice.loadUint(32) - let mint_new_price: Grams = loadGrams(slice) - - let mint_add_price: Grams = loadGrams(slice) - - return { - kind: 'ConfigParam__5', - mint_new_price: mint_new_price, - mint_add_price: mint_add_price, -} - -} -; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xd2115c6f) && (arg0 == 7)))) { - slice.loadUint(32) - let to_mint: ExtraCurrencyCollection = loadExtraCurrencyCollection(slice) - - return { - kind: 'ConfigParam__6', - to_mint: to_mint, -} - -} -; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xb19d2da6) && (arg0 == 8)))) { - slice.loadUint(32) - let anon0: GlobalVersion = loadGlobalVersion(slice) - - return { - kind: 'ConfigParam__7', - anon0: anon0, -} - -} -; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x8f3b81de) && (arg0 == 9)))) { - slice.loadUint(32) - let mandatory_params: Hashmap = loadHashmap(slice, 32, loadTrue) - - return { - kind: 'ConfigParam__8', - mandatory_params: mandatory_params, -} - -} -; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xfbcb8998) && (arg0 == 10)))) { - slice.loadUint(32) - let critical_params: Hashmap = loadHashmap(slice, 32, loadTrue) - - return { - kind: 'ConfigParam__9', - critical_params: critical_params, -} - -} -; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x9358b12f) && (arg0 == 11)))) { - slice.loadUint(32) - let anon0: ConfigVotingSetup = loadConfigVotingSetup(slice) - - return { - kind: 'ConfigParam__10', - anon0: anon0, -} - -} -; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x9059857d) && (arg0 == 12)))) { - slice.loadUint(32) - let workchains: HashmapE = loadHashmapE(slice, 32, loadWorkchainDescr) - - return { - kind: 'ConfigParam__11', - workchains: workchains, -} - -} -; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xe8ae7dd3) && (arg0 == 13)))) { - slice.loadUint(32) - let anon0: ComplaintPricing = loadComplaintPricing(slice) - - return { - kind: 'ConfigParam__12', - anon0: anon0, -} - -} -; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xf282db94) && (arg0 == 14)))) { - slice.loadUint(32) - let anon0: BlockCreateFees = loadBlockCreateFees(slice) - - return { - kind: 'ConfigParam__13', - anon0: anon0, -} - -} -; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xed67ebd2) && (arg0 == 15)))) { - slice.loadUint(32) - let validators_elected_for: number = slice.loadUint(32) - - let elections_start_before: number = slice.loadUint(32) - - let elections_end_before: number = slice.loadUint(32) - - let stake_held_for: number = slice.loadUint(32) - - return { - kind: 'ConfigParam__14', - validators_elected_for: validators_elected_for, - elections_start_before: elections_start_before, - elections_end_before: elections_end_before, - stake_held_for: stake_held_for, -} - -} -; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xe8298d51) && (arg0 == 16)))) { - slice.loadUint(32) - let max_validators: number = slice.loadUint(16) - - let max_main_validators: number = slice.loadUint(16) - - let min_validators: number = slice.loadUint(16) - - if ((!(max_validators >= max_main_validators))) { - throw new Error('') - } - if ((!(max_main_validators >= min_validators))) { - throw new Error('') - } - if ((!(min_validators >= 1))) { - throw new Error('') - } - return { - kind: 'ConfigParam__15', - max_validators: max_validators, - max_main_validators: max_main_validators, - min_validators: min_validators, -} - -} -; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xa81c566c) && (arg0 == 17)))) { - slice.loadUint(32) - let min_stake: Grams = loadGrams(slice) - - let max_stake: Grams = loadGrams(slice) - - let min_total_stake: Grams = loadGrams(slice) - - let max_stake_factor: number = slice.loadUint(32) - - return { - kind: 'ConfigParam__16', - min_stake: min_stake, - max_stake: max_stake, - min_total_stake: min_total_stake, - max_stake_factor: max_stake_factor, -} - -} -; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xeab9843a) && (arg0 == 18)))) { - slice.loadUint(32) - let anon0: Hashmap = loadHashmap(slice, 32, loadStoragePrices) - - return { - kind: 'ConfigParam__17', - anon0: anon0, -} - -} -; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xf666426a) && (arg0 == 28)))) { - slice.loadUint(32) - let anon0: CatchainConfig = loadCatchainConfig(slice) - - return { - kind: 'ConfigParam__24', - anon0: anon0, -} - -} -; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xf5b85ad3) && (arg0 == 29)))) { - slice.loadUint(32) - let anon0: ConsensusConfig = loadConsensusConfig(slice) - - return { - kind: 'ConfigParam__25', - anon0: anon0, -} - -} -; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x849fe3cc) && (arg0 == 31)))) { - slice.loadUint(32) - let fundamental_smc_addr: HashmapE = loadHashmapE(slice, 256, loadTrue) - - return { - kind: 'ConfigParam__26', - fundamental_smc_addr: fundamental_smc_addr, -} - -} -; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xcfc8ceeb) && (arg0 == 32)))) { - slice.loadUint(32) - let prev_validators: ValidatorSet = loadValidatorSet(slice) - - return { - kind: 'ConfigParam__27', - prev_validators: prev_validators, -} - -} -; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xa1a5d63c) && (arg0 == 33)))) { - slice.loadUint(32) - let prev_temp_validators: ValidatorSet = loadValidatorSet(slice) - - return { - kind: 'ConfigParam__28', - prev_temp_validators: prev_temp_validators, -} - -} -; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xfd569be3) && (arg0 == 34)))) { - slice.loadUint(32) - let cur_validators: ValidatorSet = loadValidatorSet(slice) - - return { - kind: 'ConfigParam__29', - cur_validators: cur_validators, -} - -} -; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xc271315a) && (arg0 == 35)))) { - slice.loadUint(32) - let cur_temp_validators: ValidatorSet = loadValidatorSet(slice) - - return { - kind: 'ConfigParam__30', - cur_temp_validators: cur_temp_validators, -} - -} -; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x85d02f6c) && (arg0 == 36)))) { - slice.loadUint(32) - let next_validators: ValidatorSet = loadValidatorSet(slice) - - return { - kind: 'ConfigParam__31', - next_validators: next_validators, -} - -} -; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xffa3b0f8) && (arg0 == 37)))) { - slice.loadUint(32) - let next_temp_validators: ValidatorSet = loadValidatorSet(slice) - - return { - kind: 'ConfigParam__32', - next_temp_validators: next_temp_validators, -} - -} -; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x86dfef76) && (arg0 == 39)))) { - slice.loadUint(32) - let anon0: HashmapE = loadHashmapE(slice, 256, loadValidatorSignedTempKey) - - return { - kind: 'ConfigParam__33', - anon0: anon0, -} - -} -; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x8517b916) && (arg0 == 40)))) { - slice.loadUint(32) - let anon0: MisbehaviourPunishmentConfig = loadMisbehaviourPunishmentConfig(slice) - - return { - kind: 'ConfigParam__34', - anon0: anon0, -} - -} -; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xbd424af1) && (arg0 == 71)))) { - slice.loadUint(32) - let anon0: OracleBridgeParams = loadOracleBridgeParams(slice) - - return { - kind: 'ConfigParam__35', - anon0: anon0, -} - -} -; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x966f1932) && (arg0 == 72)))) { - slice.loadUint(32) - let anon0: OracleBridgeParams = loadOracleBridgeParams(slice) - - return { - kind: 'ConfigParam__36', - anon0: anon0, -} - -} -; - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x8f742873) && (arg0 == 73)))) { - slice.loadUint(32) - let anon0: OracleBridgeParams = loadOracleBridgeParams(slice) - - return { - kind: 'ConfigParam__37', - anon0: anon0, -} - -} -; - if ((arg0 == 20)) { - let anon0: GasLimitsPrices = loadGasLimitsPrices(slice) - - return { - kind: 'ConfigParam_config_mc_gas_prices', - anon0: anon0, -} - -} -; - if ((arg0 == 21)) { - let anon0: GasLimitsPrices = loadGasLimitsPrices(slice) - - return { - kind: 'ConfigParam_config_gas_prices', - anon0: anon0, -} - -} -; - if ((arg0 == 22)) { - let anon0: BlockLimits = loadBlockLimits(slice) - - return { - kind: 'ConfigParam_config_mc_block_limits', - anon0: anon0, -} - -} -; - if ((arg0 == 23)) { - let anon0: BlockLimits = loadBlockLimits(slice) - - return { - kind: 'ConfigParam_config_block_limits', - anon0: anon0, -} - -} -; - if ((arg0 == 24)) { - let anon0: MsgForwardPrices = loadMsgForwardPrices(slice) - - return { - kind: 'ConfigParam_config_mc_fwd_prices', - anon0: anon0, -} - -} -; - if ((arg0 == 25)) { - let anon0: MsgForwardPrices = loadMsgForwardPrices(slice) - - return { - kind: 'ConfigParam_config_fwd_prices', - anon0: anon0, -} - -} -; - throw new Error('') -; -} - -export function storeConfigParam(configParam: ConfigParam): (builder: Builder) => void { - if ((configParam.kind == 'ConfigParam__')) { - return ((builder: Builder) => { - builder.storeUint(0xbc7f2648, 32) - - builder.storeBits(configParam.config_addr) - -}) - -} -; - if ((configParam.kind == 'ConfigParam__1')) { - return ((builder: Builder) => { - builder.storeUint(0x84659d0d, 32) - - builder.storeBits(configParam.elector_addr) - -}) - -} -; - if ((configParam.kind == 'ConfigParam__2')) { - return ((builder: Builder) => { - builder.storeUint(0x8648b2c4, 32) - - builder.storeBits(configParam.minter_addr) - -}) - -} -; - if ((configParam.kind == 'ConfigParam__3')) { - return ((builder: Builder) => { - builder.storeUint(0x8a752dc5, 32) - - builder.storeBits(configParam.fee_collector_addr) - -}) - -} -; - if ((configParam.kind == 'ConfigParam__4')) { - return ((builder: Builder) => { - builder.storeUint(0x8ceae93f, 32) - - builder.storeBits(configParam.dns_root_addr) - -}) - -} -; - if ((configParam.kind == 'ConfigParam__5')) { - return ((builder: Builder) => { - builder.storeUint(0xb2571db5, 32) - - storeGrams(configParam.mint_new_price)(builder) - - storeGrams(configParam.mint_add_price)(builder) - -}) - -} -; - if ((configParam.kind == 'ConfigParam__6')) { - return ((builder: Builder) => { - builder.storeUint(0xd2115c6f, 32) - - storeExtraCurrencyCollection(configParam.to_mint)(builder) - -}) - -} -; - if ((configParam.kind == 'ConfigParam__7')) { - return ((builder: Builder) => { - builder.storeUint(0xb19d2da6, 32) - - storeGlobalVersion(configParam.anon0)(builder) - -}) - -} -; - if ((configParam.kind == 'ConfigParam__8')) { - return ((builder: Builder) => { - builder.storeUint(0x8f3b81de, 32) - - storeHashmap(configParam.mandatory_params, storeTrue)(builder) - -}) - -} -; - if ((configParam.kind == 'ConfigParam__9')) { - return ((builder: Builder) => { - builder.storeUint(0xfbcb8998, 32) - - storeHashmap(configParam.critical_params, storeTrue)(builder) - -}) - -} -; - if ((configParam.kind == 'ConfigParam__10')) { - return ((builder: Builder) => { - builder.storeUint(0x9358b12f, 32) - - storeConfigVotingSetup(configParam.anon0)(builder) - -}) - -} -; - if ((configParam.kind == 'ConfigParam__11')) { - return ((builder: Builder) => { - builder.storeUint(0x9059857d, 32) - - storeHashmapE(configParam.workchains, storeWorkchainDescr)(builder) - -}) - -} -; - if ((configParam.kind == 'ConfigParam__12')) { - return ((builder: Builder) => { - builder.storeUint(0xe8ae7dd3, 32) - - storeComplaintPricing(configParam.anon0)(builder) - -}) - -} -; - if ((configParam.kind == 'ConfigParam__13')) { - return ((builder: Builder) => { - builder.storeUint(0xf282db94, 32) - - storeBlockCreateFees(configParam.anon0)(builder) - -}) - -} -; - if ((configParam.kind == 'ConfigParam__14')) { - return ((builder: Builder) => { - builder.storeUint(0xed67ebd2, 32) - - builder.storeUint(configParam.validators_elected_for, 32) - - builder.storeUint(configParam.elections_start_before, 32) - - builder.storeUint(configParam.elections_end_before, 32) - - builder.storeUint(configParam.stake_held_for, 32) - -}) - -} -; - if ((configParam.kind == 'ConfigParam__15')) { - return ((builder: Builder) => { - builder.storeUint(0xe8298d51, 32) - - builder.storeUint(configParam.max_validators, 16) - - builder.storeUint(configParam.max_main_validators, 16) - - builder.storeUint(configParam.min_validators, 16) - - if ((!(configParam.max_validators >= configParam.max_main_validators))) { - throw new Error('') - } - - if ((!(configParam.max_main_validators >= configParam.min_validators))) { - throw new Error('') - } - - if ((!(configParam.min_validators >= 1))) { - throw new Error('') - } - -}) - -} -; - if ((configParam.kind == 'ConfigParam__16')) { - return ((builder: Builder) => { - builder.storeUint(0xa81c566c, 32) - - storeGrams(configParam.min_stake)(builder) - - storeGrams(configParam.max_stake)(builder) - - storeGrams(configParam.min_total_stake)(builder) - - builder.storeUint(configParam.max_stake_factor, 32) - -}) - -} -; - if ((configParam.kind == 'ConfigParam__17')) { - return ((builder: Builder) => { - builder.storeUint(0xeab9843a, 32) - - storeHashmap(configParam.anon0, storeStoragePrices)(builder) - -}) - -} -; - if ((configParam.kind == 'ConfigParam__24')) { - return ((builder: Builder) => { - builder.storeUint(0xf666426a, 32) - - storeCatchainConfig(configParam.anon0)(builder) - -}) - -} -; - if ((configParam.kind == 'ConfigParam__25')) { - return ((builder: Builder) => { - builder.storeUint(0xf5b85ad3, 32) - - storeConsensusConfig(configParam.anon0)(builder) - -}) - -} -; - if ((configParam.kind == 'ConfigParam__26')) { - return ((builder: Builder) => { - builder.storeUint(0x849fe3cc, 32) - - storeHashmapE(configParam.fundamental_smc_addr, storeTrue)(builder) - -}) - -} -; - if ((configParam.kind == 'ConfigParam__27')) { - return ((builder: Builder) => { - builder.storeUint(0xcfc8ceeb, 32) - - storeValidatorSet(configParam.prev_validators)(builder) - -}) - -} -; - if ((configParam.kind == 'ConfigParam__28')) { - return ((builder: Builder) => { - builder.storeUint(0xa1a5d63c, 32) - - storeValidatorSet(configParam.prev_temp_validators)(builder) - -}) - -} -; - if ((configParam.kind == 'ConfigParam__29')) { - return ((builder: Builder) => { - builder.storeUint(0xfd569be3, 32) - - storeValidatorSet(configParam.cur_validators)(builder) - -}) - -} -; - if ((configParam.kind == 'ConfigParam__30')) { - return ((builder: Builder) => { - builder.storeUint(0xc271315a, 32) - - storeValidatorSet(configParam.cur_temp_validators)(builder) - -}) - -} -; - if ((configParam.kind == 'ConfigParam__31')) { - return ((builder: Builder) => { - builder.storeUint(0x85d02f6c, 32) - - storeValidatorSet(configParam.next_validators)(builder) - -}) - -} -; - if ((configParam.kind == 'ConfigParam__32')) { - return ((builder: Builder) => { - builder.storeUint(0xffa3b0f8, 32) - - storeValidatorSet(configParam.next_temp_validators)(builder) - -}) - -} -; - if ((configParam.kind == 'ConfigParam__33')) { - return ((builder: Builder) => { - builder.storeUint(0x86dfef76, 32) - - storeHashmapE(configParam.anon0, storeValidatorSignedTempKey)(builder) - -}) - -} -; - if ((configParam.kind == 'ConfigParam__34')) { - return ((builder: Builder) => { - builder.storeUint(0x8517b916, 32) - - storeMisbehaviourPunishmentConfig(configParam.anon0)(builder) - -}) - -} -; - if ((configParam.kind == 'ConfigParam__35')) { - return ((builder: Builder) => { - builder.storeUint(0xbd424af1, 32) - - storeOracleBridgeParams(configParam.anon0)(builder) - -}) - -} -; - if ((configParam.kind == 'ConfigParam__36')) { - return ((builder: Builder) => { - builder.storeUint(0x966f1932, 32) - - storeOracleBridgeParams(configParam.anon0)(builder) - -}) - -} -; - if ((configParam.kind == 'ConfigParam__37')) { - return ((builder: Builder) => { - builder.storeUint(0x8f742873, 32) - - storeOracleBridgeParams(configParam.anon0)(builder) - -}) - -} -; - if ((configParam.kind == 'ConfigParam_config_mc_gas_prices')) { - return ((builder: Builder) => { - storeGasLimitsPrices(configParam.anon0)(builder) - -}) - -} -; - if ((configParam.kind == 'ConfigParam_config_gas_prices')) { - return ((builder: Builder) => { - storeGasLimitsPrices(configParam.anon0)(builder) - -}) - -} -; - if ((configParam.kind == 'ConfigParam_config_mc_block_limits')) { - return ((builder: Builder) => { - storeBlockLimits(configParam.anon0)(builder) - -}) - -} -; - if ((configParam.kind == 'ConfigParam_config_block_limits')) { - return ((builder: Builder) => { - storeBlockLimits(configParam.anon0)(builder) - -}) - -} -; - if ((configParam.kind == 'ConfigParam_config_mc_fwd_prices')) { - return ((builder: Builder) => { - storeMsgForwardPrices(configParam.anon0)(builder) - -}) - -} -; - if ((configParam.kind == 'ConfigParam_config_fwd_prices')) { - return ((builder: Builder) => { - storeMsgForwardPrices(configParam.anon0)(builder) - -}) - -} -; - throw new Error('') -; -} - -export function loadGlobalVersion(slice: Slice): GlobalVersion { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xc4))) { - slice.loadUint(8) - let version: number = slice.loadUint(32) - - let capabilities: number = slice.loadUint(64) - - return { - kind: 'GlobalVersion', - version: version, - capabilities: capabilities, -} - -} -; - throw new Error('') -; -} - -export function storeGlobalVersion(globalVersion: GlobalVersion): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xc4, 8) - - builder.storeUint(globalVersion.version, 32) - - builder.storeUint(globalVersion.capabilities, 64) - -}) - -; -} - -export function loadConfigProposalSetup(slice: Slice): ConfigProposalSetup { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x36))) { - slice.loadUint(8) - let min_tot_rounds: number = slice.loadUint(8) - - let max_tot_rounds: number = slice.loadUint(8) - - let min_wins: number = slice.loadUint(8) - - let max_losses: number = slice.loadUint(8) - - let min_store_sec: number = slice.loadUint(32) - - let max_store_sec: number = slice.loadUint(32) - - let bit_price: number = slice.loadUint(32) - - let _cell_price: number = slice.loadUint(32) - - return { - kind: 'ConfigProposalSetup', - min_tot_rounds: min_tot_rounds, - max_tot_rounds: max_tot_rounds, - min_wins: min_wins, - max_losses: max_losses, - min_store_sec: min_store_sec, - max_store_sec: max_store_sec, - bit_price: bit_price, - _cell_price: _cell_price, -} - -} -; - throw new Error('') -; -} - -export function storeConfigProposalSetup(configProposalSetup: ConfigProposalSetup): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x36, 8) - - builder.storeUint(configProposalSetup.min_tot_rounds, 8) - - builder.storeUint(configProposalSetup.max_tot_rounds, 8) - - builder.storeUint(configProposalSetup.min_wins, 8) - - builder.storeUint(configProposalSetup.max_losses, 8) - - builder.storeUint(configProposalSetup.min_store_sec, 32) - - builder.storeUint(configProposalSetup.max_store_sec, 32) - - builder.storeUint(configProposalSetup.bit_price, 32) - - builder.storeUint(configProposalSetup._cell_price, 32) - -}) - -; -} - -export function loadConfigVotingSetup(slice: Slice): ConfigVotingSetup { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x91))) { - slice.loadUint(8) - let slice1 = slice.loadRef().beginParse() - - let normal_params: ConfigProposalSetup = loadConfigProposalSetup(slice1) - - let slice2 = slice.loadRef().beginParse() - - let critical_params: ConfigProposalSetup = loadConfigProposalSetup(slice2) - - return { - kind: 'ConfigVotingSetup', - normal_params: normal_params, - critical_params: critical_params, -} - -} -; - throw new Error('') -; -} - -export function storeConfigVotingSetup(configVotingSetup: ConfigVotingSetup): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x91, 8) - - let cell1 = beginCell() - - - storeConfigProposalSetup(configVotingSetup.normal_params)(cell1) - - builder.storeRef(cell1) - - let cell2 = beginCell() - - - storeConfigProposalSetup(configVotingSetup.critical_params)(cell2) - - builder.storeRef(cell2) - -}) - -; -} - -export function loadConfigProposal(slice: Slice): ConfigProposal { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xf3))) { - slice.loadUint(8) - let param_id: number = slice.loadInt(32) - - let param_value: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() - - - return slice1 - -}) -) - - let if_hash_equal: Maybe = loadMaybe(slice, ((slice: Slice) => { - return slice.loadUint(256) - -}) -) - - return { - kind: 'ConfigProposal', - param_id: param_id, - param_value: param_value, - if_hash_equal: if_hash_equal, -} - -} -; - throw new Error('') -; -} - -export function storeConfigProposal(configProposal: ConfigProposal): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xf3, 8) - - builder.storeInt(configProposal.param_id, 32) - - storeMaybe(configProposal.param_value, ((arg: Slice) => { - return ((builder: Builder) => { - let cell1 = beginCell() - - - cell1.storeSlice(arg) - - builder.storeRef(cell1) - - - }) - - - }) - )(builder) - - storeMaybe(configProposal.if_hash_equal, ((arg: number) => { - return ((builder: Builder) => { - builder.storeUint(arg, 256) - - }) - - - }) - )(builder) - -}) - -; -} - -export function loadConfigProposalStatus(slice: Slice): ConfigProposalStatus { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xce))) { - slice.loadUint(8) - let expires: number = slice.loadUint(32) - - let slice1 = slice.loadRef().beginParse() - - let proposal: ConfigProposal = loadConfigProposal(slice1) - - let is_critical: Bool = loadBool(slice) - - let voters: HashmapE = loadHashmapE(slice, 16, loadTrue) - - let remaining_weight: number = slice.loadInt(64) - - let validator_set_id: number = slice.loadUint(256) - - let rounds_remaining: number = slice.loadUint(8) - - let wins: number = slice.loadUint(8) - - let losses: number = slice.loadUint(8) - - return { - kind: 'ConfigProposalStatus', - expires: expires, - proposal: proposal, - is_critical: is_critical, - voters: voters, - remaining_weight: remaining_weight, - validator_set_id: validator_set_id, - rounds_remaining: rounds_remaining, - wins: wins, - losses: losses, -} - -} -; - throw new Error('') -; -} - -export function storeConfigProposalStatus(configProposalStatus: ConfigProposalStatus): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xce, 8) - - builder.storeUint(configProposalStatus.expires, 32) - - let cell1 = beginCell() - - - storeConfigProposal(configProposalStatus.proposal)(cell1) - - builder.storeRef(cell1) - - storeBool(configProposalStatus.is_critical)(builder) - - storeHashmapE(configProposalStatus.voters, storeTrue)(builder) - - builder.storeInt(configProposalStatus.remaining_weight, 64) - - builder.storeUint(configProposalStatus.validator_set_id, 256) - - builder.storeUint(configProposalStatus.rounds_remaining, 8) - - builder.storeUint(configProposalStatus.wins, 8) - - builder.storeUint(configProposalStatus.losses, 8) - -}) - -; -} - -export function loadWorkchainFormat(slice: Slice, arg0: number): WorkchainFormat { - if (((slice.remainingBits >= 4) && ((slice.preloadUint(4) == 0x1) && (arg0 == 1)))) { - slice.loadUint(4) - let vm_version: number = slice.loadInt(32) - - let vm_mode: number = slice.loadUint(64) - - return { - kind: 'WorkchainFormat_wfmt_basic', - vm_version: vm_version, - vm_mode: vm_mode, -} - -} -; - if (((slice.remainingBits >= 4) && ((slice.preloadUint(4) == 0x0) && (arg0 == 0)))) { - slice.loadUint(4) - let min_addr_len: number = slice.loadUint(12) - - let max_addr_len: number = slice.loadUint(12) - - let addr_len_step: number = slice.loadUint(12) - - let workchain_type_id: number = slice.loadUint(32) - - if ((!(min_addr_len >= 64))) { - throw new Error('') - } - if ((!(min_addr_len <= max_addr_len))) { - throw new Error('') - } - if ((!(max_addr_len <= 1023))) { - throw new Error('') - } - if ((!(addr_len_step <= 1023))) { - throw new Error('') - } - if ((!(workchain_type_id >= 1))) { - throw new Error('') - } - return { - kind: 'WorkchainFormat_wfmt_ext', - min_addr_len: min_addr_len, - max_addr_len: max_addr_len, - addr_len_step: addr_len_step, - workchain_type_id: workchain_type_id, -} - -} -; - throw new Error('') -; -} - -export function storeWorkchainFormat(workchainFormat: WorkchainFormat): (builder: Builder) => void { - if ((workchainFormat.kind == 'WorkchainFormat_wfmt_basic')) { - return ((builder: Builder) => { - builder.storeUint(0x1, 4) - - builder.storeInt(workchainFormat.vm_version, 32) - - builder.storeUint(workchainFormat.vm_mode, 64) - -}) - -} -; - if ((workchainFormat.kind == 'WorkchainFormat_wfmt_ext')) { - return ((builder: Builder) => { - builder.storeUint(0x0, 4) - - builder.storeUint(workchainFormat.min_addr_len, 12) - - builder.storeUint(workchainFormat.max_addr_len, 12) - - builder.storeUint(workchainFormat.addr_len_step, 12) - - builder.storeUint(workchainFormat.workchain_type_id, 32) - - if ((!(workchainFormat.min_addr_len >= 64))) { - throw new Error('') - } - - if ((!(workchainFormat.min_addr_len <= workchainFormat.max_addr_len))) { - throw new Error('') - } - - if ((!(workchainFormat.max_addr_len <= 1023))) { - throw new Error('') - } - - if ((!(workchainFormat.addr_len_step <= 1023))) { - throw new Error('') - } - - if ((!(workchainFormat.workchain_type_id >= 1))) { - throw new Error('') - } - -}) - -} -; - throw new Error('') -; -} - -export function loadWorkchainDescr(slice: Slice): WorkchainDescr { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xa6))) { - slice.loadUint(8) - let enabled_since: number = slice.loadUint(32) - - let actual_min_split: number = slice.loadUint(8) - - let min_split: number = slice.loadUint(8) - - let max_split: number = slice.loadUint(8) - - let basic: number = slice.loadUint(1) - - let active: Bool = loadBool(slice) - - let accept_msgs: Bool = loadBool(slice) - - let flags: number = slice.loadUint(13) - - let zerostate_root_hash: BitString = slice.loadBits(256) - - let zerostate_file_hash: BitString = slice.loadBits(256) - - let version: number = slice.loadUint(32) - - let format: WorkchainFormat = loadWorkchainFormat(slice, basic) - - if ((!(actual_min_split <= min_split))) { - throw new Error('') - } - if ((!(flags == 0))) { - throw new Error('') - } - return { - kind: 'WorkchainDescr', - enabled_since: enabled_since, - actual_min_split: actual_min_split, - min_split: min_split, - max_split: max_split, - basic: basic, - active: active, - accept_msgs: accept_msgs, - flags: flags, - zerostate_root_hash: zerostate_root_hash, - zerostate_file_hash: zerostate_file_hash, - version: version, - format: format, -} - -} -; - throw new Error('') -; -} - -export function storeWorkchainDescr(workchainDescr: WorkchainDescr): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xa6, 8) - - builder.storeUint(workchainDescr.enabled_since, 32) - - builder.storeUint(workchainDescr.actual_min_split, 8) - - builder.storeUint(workchainDescr.min_split, 8) - - builder.storeUint(workchainDescr.max_split, 8) - - builder.storeUint(workchainDescr.basic, 1) - - storeBool(workchainDescr.active)(builder) - - storeBool(workchainDescr.accept_msgs)(builder) - - builder.storeUint(workchainDescr.flags, 13) - - builder.storeBits(workchainDescr.zerostate_root_hash) - - builder.storeBits(workchainDescr.zerostate_file_hash) - - builder.storeUint(workchainDescr.version, 32) - - storeWorkchainFormat(workchainDescr.format)(builder) - - if ((!(workchainDescr.actual_min_split <= workchainDescr.min_split))) { - throw new Error('') - } - - if ((!(workchainDescr.flags == 0))) { - throw new Error('') - } - -}) - -; -} - -export function loadComplaintPricing(slice: Slice): ComplaintPricing { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x1a))) { - slice.loadUint(8) - let deposit: Grams = loadGrams(slice) - - let bit_price: Grams = loadGrams(slice) - - let _cell_price: Grams = loadGrams(slice) - - return { - kind: 'ComplaintPricing', - deposit: deposit, - bit_price: bit_price, - _cell_price: _cell_price, -} - -} -; - throw new Error('') -; -} - -export function storeComplaintPricing(complaintPricing: ComplaintPricing): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x1a, 8) - - storeGrams(complaintPricing.deposit)(builder) - - storeGrams(complaintPricing.bit_price)(builder) - - storeGrams(complaintPricing._cell_price)(builder) - -}) - -; -} - -export function loadBlockCreateFees(slice: Slice): BlockCreateFees { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x6b))) { - slice.loadUint(8) - let masterchain_block_fee: Grams = loadGrams(slice) - - let basechain_block_fee: Grams = loadGrams(slice) - - return { - kind: 'BlockCreateFees', - masterchain_block_fee: masterchain_block_fee, - basechain_block_fee: basechain_block_fee, -} - -} -; - throw new Error('') -; -} - -export function storeBlockCreateFees(blockCreateFees: BlockCreateFees): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x6b, 8) - - storeGrams(blockCreateFees.masterchain_block_fee)(builder) - - storeGrams(blockCreateFees.basechain_block_fee)(builder) - -}) - -; -} - -export function loadStoragePrices(slice: Slice): StoragePrices { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xcc))) { - slice.loadUint(8) - let utime_since: number = slice.loadUint(32) - - let bit_price_ps: number = slice.loadUint(64) - - let _cell_price_ps: number = slice.loadUint(64) - - let mc_bit_price_ps: number = slice.loadUint(64) - - let mc_cell_price_ps: number = slice.loadUint(64) - - return { - kind: 'StoragePrices', - utime_since: utime_since, - bit_price_ps: bit_price_ps, - _cell_price_ps: _cell_price_ps, - mc_bit_price_ps: mc_bit_price_ps, - mc_cell_price_ps: mc_cell_price_ps, -} - -} -; - throw new Error('') -; -} - -export function storeStoragePrices(storagePrices: StoragePrices): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xcc, 8) - - builder.storeUint(storagePrices.utime_since, 32) - - builder.storeUint(storagePrices.bit_price_ps, 64) - - builder.storeUint(storagePrices._cell_price_ps, 64) - - builder.storeUint(storagePrices.mc_bit_price_ps, 64) - - builder.storeUint(storagePrices.mc_cell_price_ps, 64) - -}) - -; -} - -export function loadGasLimitsPrices(slice: Slice): GasLimitsPrices { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xdd))) { - slice.loadUint(8) - let gas_price: number = slice.loadUint(64) - - let gas_limit: number = slice.loadUint(64) - - let gas_credit: number = slice.loadUint(64) - - let block_gas_limit: number = slice.loadUint(64) - - let freeze_due_limit: number = slice.loadUint(64) - - let delete_due_limit: number = slice.loadUint(64) - - return { - kind: 'GasLimitsPrices_gas_prices', - gas_price: gas_price, - gas_limit: gas_limit, - gas_credit: gas_credit, - block_gas_limit: block_gas_limit, - freeze_due_limit: freeze_due_limit, - delete_due_limit: delete_due_limit, -} - -} -; - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xde))) { - slice.loadUint(8) - let gas_price: number = slice.loadUint(64) - - let gas_limit: number = slice.loadUint(64) - - let special_gas_limit: number = slice.loadUint(64) - - let gas_credit: number = slice.loadUint(64) - - let block_gas_limit: number = slice.loadUint(64) - - let freeze_due_limit: number = slice.loadUint(64) - - let delete_due_limit: number = slice.loadUint(64) - - return { - kind: 'GasLimitsPrices_gas_prices_ext', - gas_price: gas_price, - gas_limit: gas_limit, - special_gas_limit: special_gas_limit, - gas_credit: gas_credit, - block_gas_limit: block_gas_limit, - freeze_due_limit: freeze_due_limit, - delete_due_limit: delete_due_limit, -} - -} -; - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xd1))) { - slice.loadUint(8) - let flat_gas_limit: number = slice.loadUint(64) - - let flat_gas_price: number = slice.loadUint(64) - - let other: GasLimitsPrices = loadGasLimitsPrices(slice) - - return { - kind: 'GasLimitsPrices_gas_flat_pfx', - flat_gas_limit: flat_gas_limit, - flat_gas_price: flat_gas_price, - other: other, -} - -} -; - throw new Error('') -; -} - -export function storeGasLimitsPrices(gasLimitsPrices: GasLimitsPrices): (builder: Builder) => void { - if ((gasLimitsPrices.kind == 'GasLimitsPrices_gas_prices')) { - return ((builder: Builder) => { - builder.storeUint(0xdd, 8) - - builder.storeUint(gasLimitsPrices.gas_price, 64) - - builder.storeUint(gasLimitsPrices.gas_limit, 64) - - builder.storeUint(gasLimitsPrices.gas_credit, 64) - - builder.storeUint(gasLimitsPrices.block_gas_limit, 64) - - builder.storeUint(gasLimitsPrices.freeze_due_limit, 64) - - builder.storeUint(gasLimitsPrices.delete_due_limit, 64) - -}) - -} -; - if ((gasLimitsPrices.kind == 'GasLimitsPrices_gas_prices_ext')) { - return ((builder: Builder) => { - builder.storeUint(0xde, 8) - - builder.storeUint(gasLimitsPrices.gas_price, 64) - - builder.storeUint(gasLimitsPrices.gas_limit, 64) - - builder.storeUint(gasLimitsPrices.special_gas_limit, 64) - - builder.storeUint(gasLimitsPrices.gas_credit, 64) - - builder.storeUint(gasLimitsPrices.block_gas_limit, 64) - - builder.storeUint(gasLimitsPrices.freeze_due_limit, 64) - - builder.storeUint(gasLimitsPrices.delete_due_limit, 64) - -}) - -} -; - if ((gasLimitsPrices.kind == 'GasLimitsPrices_gas_flat_pfx')) { - return ((builder: Builder) => { - builder.storeUint(0xd1, 8) - - builder.storeUint(gasLimitsPrices.flat_gas_limit, 64) - - builder.storeUint(gasLimitsPrices.flat_gas_price, 64) - - storeGasLimitsPrices(gasLimitsPrices.other)(builder) - -}) - -} -; - throw new Error('') -; -} - -export function loadParamLimits(slice: Slice): ParamLimits { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xc3))) { - slice.loadUint(8) - let underload: number = slice.loadUint(32) - - let soft_limit: number = slice.loadUint(32) - - let hard_limit: number = slice.loadUint(32) - - if ((!(underload <= soft_limit))) { - throw new Error('') - } - if ((!(soft_limit <= hard_limit))) { - throw new Error('') - } - return { - kind: 'ParamLimits', - underload: underload, - soft_limit: soft_limit, - hard_limit: hard_limit, -} - -} -; - throw new Error('') -; -} - -export function storeParamLimits(paramLimits: ParamLimits): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xc3, 8) - - builder.storeUint(paramLimits.underload, 32) - - builder.storeUint(paramLimits.soft_limit, 32) - - builder.storeUint(paramLimits.hard_limit, 32) - - if ((!(paramLimits.underload <= paramLimits.soft_limit))) { - throw new Error('') - } - - if ((!(paramLimits.soft_limit <= paramLimits.hard_limit))) { - throw new Error('') - } - -}) - -; -} - -export function loadBlockLimits(slice: Slice): BlockLimits { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x5d))) { - slice.loadUint(8) - let bytes: ParamLimits = loadParamLimits(slice) - - let gas: ParamLimits = loadParamLimits(slice) - - let lt_delta: ParamLimits = loadParamLimits(slice) - - return { - kind: 'BlockLimits', - bytes: bytes, - gas: gas, - lt_delta: lt_delta, -} - -} -; - throw new Error('') -; -} - -export function storeBlockLimits(blockLimits: BlockLimits): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x5d, 8) - - storeParamLimits(blockLimits.bytes)(builder) - - storeParamLimits(blockLimits.gas)(builder) - - storeParamLimits(blockLimits.lt_delta)(builder) - -}) - -; -} - -export function loadMsgForwardPrices(slice: Slice): MsgForwardPrices { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xea))) { - slice.loadUint(8) - let lump_price: number = slice.loadUint(64) - - let bit_price: number = slice.loadUint(64) - - let _cell_price: number = slice.loadUint(64) - - let ihr_price_factor: number = slice.loadUint(32) - - let first_frac: number = slice.loadUint(16) - - let next_frac: number = slice.loadUint(16) - - return { - kind: 'MsgForwardPrices', - lump_price: lump_price, - bit_price: bit_price, - _cell_price: _cell_price, - ihr_price_factor: ihr_price_factor, - first_frac: first_frac, - next_frac: next_frac, -} - -} -; - throw new Error('') -; -} - -export function storeMsgForwardPrices(msgForwardPrices: MsgForwardPrices): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xea, 8) - - builder.storeUint(msgForwardPrices.lump_price, 64) - - builder.storeUint(msgForwardPrices.bit_price, 64) - - builder.storeUint(msgForwardPrices._cell_price, 64) - - builder.storeUint(msgForwardPrices.ihr_price_factor, 32) - - builder.storeUint(msgForwardPrices.first_frac, 16) - - builder.storeUint(msgForwardPrices.next_frac, 16) - -}) - -; -} - -export function loadCatchainConfig(slice: Slice): CatchainConfig { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xc1))) { - slice.loadUint(8) - let mc_catchain_lifetime: number = slice.loadUint(32) - - let shard_catchain_lifetime: number = slice.loadUint(32) - - let shard_validators_lifetime: number = slice.loadUint(32) - - let shard_validators_num: number = slice.loadUint(32) - - return { - kind: 'CatchainConfig_catchain_config', - mc_catchain_lifetime: mc_catchain_lifetime, - shard_catchain_lifetime: shard_catchain_lifetime, - shard_validators_lifetime: shard_validators_lifetime, - shard_validators_num: shard_validators_num, -} - -} -; - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xc2))) { - slice.loadUint(8) - let flags: number = slice.loadUint(7) - - let shuffle_mc_validators: Bool = loadBool(slice) - - let mc_catchain_lifetime: number = slice.loadUint(32) - - let shard_catchain_lifetime: number = slice.loadUint(32) - - let shard_validators_lifetime: number = slice.loadUint(32) - - let shard_validators_num: number = slice.loadUint(32) - - if ((!(flags == 0))) { - throw new Error('') - } - return { - kind: 'CatchainConfig_catchain_config_new', - flags: flags, - shuffle_mc_validators: shuffle_mc_validators, - mc_catchain_lifetime: mc_catchain_lifetime, - shard_catchain_lifetime: shard_catchain_lifetime, - shard_validators_lifetime: shard_validators_lifetime, - shard_validators_num: shard_validators_num, -} - -} -; - throw new Error('') -; -} - -export function storeCatchainConfig(catchainConfig: CatchainConfig): (builder: Builder) => void { - if ((catchainConfig.kind == 'CatchainConfig_catchain_config')) { - return ((builder: Builder) => { - builder.storeUint(0xc1, 8) - - builder.storeUint(catchainConfig.mc_catchain_lifetime, 32) - - builder.storeUint(catchainConfig.shard_catchain_lifetime, 32) - - builder.storeUint(catchainConfig.shard_validators_lifetime, 32) - - builder.storeUint(catchainConfig.shard_validators_num, 32) - -}) - -} -; - if ((catchainConfig.kind == 'CatchainConfig_catchain_config_new')) { - return ((builder: Builder) => { - builder.storeUint(0xc2, 8) - - builder.storeUint(catchainConfig.flags, 7) - - storeBool(catchainConfig.shuffle_mc_validators)(builder) - - builder.storeUint(catchainConfig.mc_catchain_lifetime, 32) - - builder.storeUint(catchainConfig.shard_catchain_lifetime, 32) - - builder.storeUint(catchainConfig.shard_validators_lifetime, 32) - - builder.storeUint(catchainConfig.shard_validators_num, 32) - - if ((!(catchainConfig.flags == 0))) { - throw new Error('') - } - -}) - -} -; - throw new Error('') -; -} - -export function loadConsensusConfig(slice: Slice): ConsensusConfig { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xd6))) { - slice.loadUint(8) - let round_candidates: number = slice.loadUint(32) - - let next_candidate_delay_ms: number = slice.loadUint(32) - - let consensus_timeout_ms: number = slice.loadUint(32) - - let fast_attempts: number = slice.loadUint(32) - - let attempt_duration: number = slice.loadUint(32) - - let catchain_max_deps: number = slice.loadUint(32) - - let max_block_bytes: number = slice.loadUint(32) - - let max_collated_bytes: number = slice.loadUint(32) - - if ((!(round_candidates >= 1))) { - throw new Error('') - } - return { - kind: 'ConsensusConfig_consensus_config', - round_candidates: round_candidates, - next_candidate_delay_ms: next_candidate_delay_ms, - consensus_timeout_ms: consensus_timeout_ms, - fast_attempts: fast_attempts, - attempt_duration: attempt_duration, - catchain_max_deps: catchain_max_deps, - max_block_bytes: max_block_bytes, - max_collated_bytes: max_collated_bytes, -} - -} -; - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xd7))) { - slice.loadUint(8) - let flags: number = slice.loadUint(7) - - let new_catchain_ids: Bool = loadBool(slice) - - let round_candidates: number = slice.loadUint(8) - - let next_candidate_delay_ms: number = slice.loadUint(32) - - let consensus_timeout_ms: number = slice.loadUint(32) - - let fast_attempts: number = slice.loadUint(32) - - let attempt_duration: number = slice.loadUint(32) - - let catchain_max_deps: number = slice.loadUint(32) - - let max_block_bytes: number = slice.loadUint(32) - - let max_collated_bytes: number = slice.loadUint(32) - - if ((!(flags == 0))) { - throw new Error('') - } - if ((!(round_candidates >= 1))) { - throw new Error('') - } - return { - kind: 'ConsensusConfig_consensus_config_new', - flags: flags, - new_catchain_ids: new_catchain_ids, - round_candidates: round_candidates, - next_candidate_delay_ms: next_candidate_delay_ms, - consensus_timeout_ms: consensus_timeout_ms, - fast_attempts: fast_attempts, - attempt_duration: attempt_duration, - catchain_max_deps: catchain_max_deps, - max_block_bytes: max_block_bytes, - max_collated_bytes: max_collated_bytes, -} - -} -; - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xd8))) { - slice.loadUint(8) - let flags: number = slice.loadUint(7) - - let new_catchain_ids: Bool = loadBool(slice) - - let round_candidates: number = slice.loadUint(8) - - let next_candidate_delay_ms: number = slice.loadUint(32) - - let consensus_timeout_ms: number = slice.loadUint(32) - - let fast_attempts: number = slice.loadUint(32) - - let attempt_duration: number = slice.loadUint(32) - - let catchain_max_deps: number = slice.loadUint(32) - - let max_block_bytes: number = slice.loadUint(32) - - let max_collated_bytes: number = slice.loadUint(32) - - let proto_version: number = slice.loadUint(16) - - if ((!(flags == 0))) { - throw new Error('') - } - if ((!(round_candidates >= 1))) { - throw new Error('') - } - return { - kind: 'ConsensusConfig_consensus_config_v3', - flags: flags, - new_catchain_ids: new_catchain_ids, - round_candidates: round_candidates, - next_candidate_delay_ms: next_candidate_delay_ms, - consensus_timeout_ms: consensus_timeout_ms, - fast_attempts: fast_attempts, - attempt_duration: attempt_duration, - catchain_max_deps: catchain_max_deps, - max_block_bytes: max_block_bytes, - max_collated_bytes: max_collated_bytes, - proto_version: proto_version, -} - -} -; - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xd9))) { - slice.loadUint(8) - let flags: number = slice.loadUint(7) - - let new_catchain_ids: Bool = loadBool(slice) - - let round_candidates: number = slice.loadUint(8) - - let next_candidate_delay_ms: number = slice.loadUint(32) - - let consensus_timeout_ms: number = slice.loadUint(32) - - let fast_attempts: number = slice.loadUint(32) - - let attempt_duration: number = slice.loadUint(32) - - let catchain_max_deps: number = slice.loadUint(32) - - let max_block_bytes: number = slice.loadUint(32) - - let max_collated_bytes: number = slice.loadUint(32) - - let proto_version: number = slice.loadUint(16) - - let catchain_max_blocks_coeff: number = slice.loadUint(32) - - if ((!(flags == 0))) { - throw new Error('') - } - if ((!(round_candidates >= 1))) { - throw new Error('') - } - return { - kind: 'ConsensusConfig_consensus_config_v4', - flags: flags, - new_catchain_ids: new_catchain_ids, - round_candidates: round_candidates, - next_candidate_delay_ms: next_candidate_delay_ms, - consensus_timeout_ms: consensus_timeout_ms, - fast_attempts: fast_attempts, - attempt_duration: attempt_duration, - catchain_max_deps: catchain_max_deps, - max_block_bytes: max_block_bytes, - max_collated_bytes: max_collated_bytes, - proto_version: proto_version, - catchain_max_blocks_coeff: catchain_max_blocks_coeff, -} - -} -; - throw new Error('') -; -} - -export function storeConsensusConfig(consensusConfig: ConsensusConfig): (builder: Builder) => void { - if ((consensusConfig.kind == 'ConsensusConfig_consensus_config')) { - return ((builder: Builder) => { - builder.storeUint(0xd6, 8) - - builder.storeUint(consensusConfig.round_candidates, 32) - - builder.storeUint(consensusConfig.next_candidate_delay_ms, 32) - - builder.storeUint(consensusConfig.consensus_timeout_ms, 32) - - builder.storeUint(consensusConfig.fast_attempts, 32) - - builder.storeUint(consensusConfig.attempt_duration, 32) - - builder.storeUint(consensusConfig.catchain_max_deps, 32) - - builder.storeUint(consensusConfig.max_block_bytes, 32) - - builder.storeUint(consensusConfig.max_collated_bytes, 32) - - if ((!(consensusConfig.round_candidates >= 1))) { - throw new Error('') - } - -}) - -} -; - if ((consensusConfig.kind == 'ConsensusConfig_consensus_config_new')) { - return ((builder: Builder) => { - builder.storeUint(0xd7, 8) - - builder.storeUint(consensusConfig.flags, 7) - - storeBool(consensusConfig.new_catchain_ids)(builder) - - builder.storeUint(consensusConfig.round_candidates, 8) - - builder.storeUint(consensusConfig.next_candidate_delay_ms, 32) - - builder.storeUint(consensusConfig.consensus_timeout_ms, 32) - - builder.storeUint(consensusConfig.fast_attempts, 32) - - builder.storeUint(consensusConfig.attempt_duration, 32) - - builder.storeUint(consensusConfig.catchain_max_deps, 32) - - builder.storeUint(consensusConfig.max_block_bytes, 32) - - builder.storeUint(consensusConfig.max_collated_bytes, 32) - - if ((!(consensusConfig.flags == 0))) { - throw new Error('') - } - - if ((!(consensusConfig.round_candidates >= 1))) { - throw new Error('') - } - -}) - -} -; - if ((consensusConfig.kind == 'ConsensusConfig_consensus_config_v3')) { - return ((builder: Builder) => { - builder.storeUint(0xd8, 8) - - builder.storeUint(consensusConfig.flags, 7) - - storeBool(consensusConfig.new_catchain_ids)(builder) - - builder.storeUint(consensusConfig.round_candidates, 8) - - builder.storeUint(consensusConfig.next_candidate_delay_ms, 32) - - builder.storeUint(consensusConfig.consensus_timeout_ms, 32) - - builder.storeUint(consensusConfig.fast_attempts, 32) - - builder.storeUint(consensusConfig.attempt_duration, 32) - - builder.storeUint(consensusConfig.catchain_max_deps, 32) - - builder.storeUint(consensusConfig.max_block_bytes, 32) - - builder.storeUint(consensusConfig.max_collated_bytes, 32) - - builder.storeUint(consensusConfig.proto_version, 16) - - if ((!(consensusConfig.flags == 0))) { - throw new Error('') - } - - if ((!(consensusConfig.round_candidates >= 1))) { - throw new Error('') - } - -}) - -} -; - if ((consensusConfig.kind == 'ConsensusConfig_consensus_config_v4')) { - return ((builder: Builder) => { - builder.storeUint(0xd9, 8) - - builder.storeUint(consensusConfig.flags, 7) - - storeBool(consensusConfig.new_catchain_ids)(builder) - - builder.storeUint(consensusConfig.round_candidates, 8) - - builder.storeUint(consensusConfig.next_candidate_delay_ms, 32) - - builder.storeUint(consensusConfig.consensus_timeout_ms, 32) - - builder.storeUint(consensusConfig.fast_attempts, 32) - - builder.storeUint(consensusConfig.attempt_duration, 32) - - builder.storeUint(consensusConfig.catchain_max_deps, 32) - - builder.storeUint(consensusConfig.max_block_bytes, 32) - - builder.storeUint(consensusConfig.max_collated_bytes, 32) - - builder.storeUint(consensusConfig.proto_version, 16) - - builder.storeUint(consensusConfig.catchain_max_blocks_coeff, 32) - - if ((!(consensusConfig.flags == 0))) { - throw new Error('') - } - - if ((!(consensusConfig.round_candidates >= 1))) { - throw new Error('') - } - -}) - -} -; - throw new Error('') -; -} - -export function loadValidatorTempKey(slice: Slice): ValidatorTempKey { - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0x3))) { - slice.loadUint(4) - let adnl_addr: BitString = slice.loadBits(256) - - let temp_public_key: SigPubKey = loadSigPubKey(slice) - - let seqno: number = slice.loadUint(32) - - let valid_until: number = slice.loadUint(32) - - return { - kind: 'ValidatorTempKey', - adnl_addr: adnl_addr, - temp_public_key: temp_public_key, - seqno: seqno, - valid_until: valid_until, -} - -} -; - throw new Error('') -; -} - -export function storeValidatorTempKey(validatorTempKey: ValidatorTempKey): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x3, 4) - - builder.storeBits(validatorTempKey.adnl_addr) - - storeSigPubKey(validatorTempKey.temp_public_key)(builder) - - builder.storeUint(validatorTempKey.seqno, 32) - - builder.storeUint(validatorTempKey.valid_until, 32) - -}) - -; -} - -export function loadValidatorSignedTempKey(slice: Slice): ValidatorSignedTempKey { - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0x4))) { - slice.loadUint(4) - let slice1 = slice.loadRef().beginParse() - - let key: ValidatorTempKey = loadValidatorTempKey(slice1) - - let signature: CryptoSignature = loadCryptoSignature(slice) - - return { - kind: 'ValidatorSignedTempKey', - key: key, - signature: signature, -} - -} -; - throw new Error('') -; -} - -export function storeValidatorSignedTempKey(validatorSignedTempKey: ValidatorSignedTempKey): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x4, 4) - - let cell1 = beginCell() - - - storeValidatorTempKey(validatorSignedTempKey.key)(cell1) - - builder.storeRef(cell1) - - storeCryptoSignature(validatorSignedTempKey.signature)(builder) - -}) - -; -} - -export function loadMisbehaviourPunishmentConfig(slice: Slice): MisbehaviourPunishmentConfig { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x01))) { - slice.loadUint(8) - let default_flat_fine: Grams = loadGrams(slice) - - let default_proportional_fine: number = slice.loadUint(32) - - let severity_flat_mult: number = slice.loadUint(16) - - let severity_proportional_mult: number = slice.loadUint(16) - - let unpunishable_interval: number = slice.loadUint(16) - - let long_interval: number = slice.loadUint(16) - - let long_flat_mult: number = slice.loadUint(16) - - let long_proportional_mult: number = slice.loadUint(16) - - let medium_interval: number = slice.loadUint(16) - - let medium_flat_mult: number = slice.loadUint(16) - - let medium_proportional_mult: number = slice.loadUint(16) - - return { - kind: 'MisbehaviourPunishmentConfig', - default_flat_fine: default_flat_fine, - default_proportional_fine: default_proportional_fine, - severity_flat_mult: severity_flat_mult, - severity_proportional_mult: severity_proportional_mult, - unpunishable_interval: unpunishable_interval, - long_interval: long_interval, - long_flat_mult: long_flat_mult, - long_proportional_mult: long_proportional_mult, - medium_interval: medium_interval, - medium_flat_mult: medium_flat_mult, - medium_proportional_mult: medium_proportional_mult, -} - -} -; - throw new Error('') -; -} - -export function storeMisbehaviourPunishmentConfig(misbehaviourPunishmentConfig: MisbehaviourPunishmentConfig): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x01, 8) - - storeGrams(misbehaviourPunishmentConfig.default_flat_fine)(builder) - - builder.storeUint(misbehaviourPunishmentConfig.default_proportional_fine, 32) - - builder.storeUint(misbehaviourPunishmentConfig.severity_flat_mult, 16) - - builder.storeUint(misbehaviourPunishmentConfig.severity_proportional_mult, 16) - - builder.storeUint(misbehaviourPunishmentConfig.unpunishable_interval, 16) - - builder.storeUint(misbehaviourPunishmentConfig.long_interval, 16) - - builder.storeUint(misbehaviourPunishmentConfig.long_flat_mult, 16) - - builder.storeUint(misbehaviourPunishmentConfig.long_proportional_mult, 16) - - builder.storeUint(misbehaviourPunishmentConfig.medium_interval, 16) - - builder.storeUint(misbehaviourPunishmentConfig.medium_flat_mult, 16) - - builder.storeUint(misbehaviourPunishmentConfig.medium_proportional_mult, 16) - -}) - -; -} - -export function loadOracleBridgeParams(slice: Slice): OracleBridgeParams { - let bridge_address: BitString = slice.loadBits(256) - -; - let oracle_mutlisig_address: BitString = slice.loadBits(256) - -; - let oracles: HashmapE = loadHashmapE(slice, 256, ((slice: Slice) => { - return slice.loadUint(256) - -}) -) - -; - let external_chain_address: BitString = slice.loadBits(256) - -; - return { - kind: 'OracleBridgeParams', - bridge_address: bridge_address, - oracle_mutlisig_address: oracle_mutlisig_address, - oracles: oracles, - external_chain_address: external_chain_address, -} - -; -} - -export function storeOracleBridgeParams(oracleBridgeParams: OracleBridgeParams): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeBits(oracleBridgeParams.bridge_address) - - builder.storeBits(oracleBridgeParams.oracle_mutlisig_address) - - storeHashmapE(oracleBridgeParams.oracles, ((arg: number) => { - return ((builder: Builder) => { - builder.storeUint(arg, 256) - - }) - - - }) - )(builder) - - builder.storeBits(oracleBridgeParams.external_chain_address) - -}) - -; -} - -export function loadBlockSignaturesPure(slice: Slice): BlockSignaturesPure { - let sig_count: number = slice.loadUint(32) - -; - let sig_weight: number = slice.loadUint(64) - -; - let signatures: HashmapE = loadHashmapE(slice, 16, loadCryptoSignaturePair) - -; - return { - kind: 'BlockSignaturesPure', - sig_count: sig_count, - sig_weight: sig_weight, - signatures: signatures, -} - -; -} - -export function storeBlockSignaturesPure(blockSignaturesPure: BlockSignaturesPure): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(blockSignaturesPure.sig_count, 32) - - builder.storeUint(blockSignaturesPure.sig_weight, 64) - - storeHashmapE(blockSignaturesPure.signatures, storeCryptoSignaturePair)(builder) - -}) - -; -} - -export function loadBlockSignatures(slice: Slice): BlockSignatures { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x11))) { - slice.loadUint(8) - let validator_info: ValidatorBaseInfo = loadValidatorBaseInfo(slice) - - let pure_signatures: BlockSignaturesPure = loadBlockSignaturesPure(slice) - - return { - kind: 'BlockSignatures', - validator_info: validator_info, - pure_signatures: pure_signatures, -} - -} -; - throw new Error('') -; -} - -export function storeBlockSignatures(blockSignatures: BlockSignatures): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x11, 8) - - storeValidatorBaseInfo(blockSignatures.validator_info)(builder) - - storeBlockSignaturesPure(blockSignatures.pure_signatures)(builder) - -}) - -; -} - -export function loadBlockProof(slice: Slice): BlockProof { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xc3))) { - slice.loadUint(8) - let proof_for: BlockIdExt = loadBlockIdExt(slice) - - let slice1 = slice.loadRef().beginParse() - - let root: Slice = slice1 - - let signatures: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() - - - return loadBlockSignatures(slice1) - -}) -) - - return { - kind: 'BlockProof', - proof_for: proof_for, - root: root, - signatures: signatures, -} - -} -; - throw new Error('') -; -} - -export function storeBlockProof(blockProof: BlockProof): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xc3, 8) - - storeBlockIdExt(blockProof.proof_for)(builder) - - let cell1 = beginCell() - - - cell1.storeSlice(blockProof.root) - - builder.storeRef(cell1) - - storeMaybe(blockProof.signatures, ((arg: BlockSignatures) => { - return ((builder: Builder) => { - let cell1 = beginCell() - - - storeBlockSignatures(arg)(cell1) - - builder.storeRef(cell1) - - - }) - - - }) - )(builder) - -}) - -; -} - -export function loadProofChain(slice: Slice, arg0: number): ProofChain { - if ((arg0 == 0)) { - return { - kind: 'ProofChain_chain_empty', -} - -} -; - if (true) { - let slice1 = slice.loadRef().beginParse() - - let root: Slice = slice1 - - let prev: ProofChain | undefined = ((arg0 - 1) ? ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() - - - return loadProofChain(slice1, (arg0 - 1)) - -}) -(slice) : undefined) - - return { - kind: 'ProofChain_chain_link', - n: (arg0 - 1), - root: root, - prev: prev, -} - -} -; - throw new Error('') -; -} - -export function storeProofChain(proofChain: ProofChain): (builder: Builder) => void { - if ((proofChain.kind == 'ProofChain_chain_empty')) { - return ((builder: Builder) => { -}) - -} -; - if ((proofChain.kind == 'ProofChain_chain_link')) { - return ((builder: Builder) => { - let cell1 = beginCell() - - - cell1.storeSlice(proofChain.root) - - builder.storeRef(cell1) - - if ((proofChain.prev != undefined)) { - let cell1 = beginCell() - - - storeProofChain(proofChain.prev)(cell1) - - builder.storeRef(cell1) - - } - -}) - -} -; - throw new Error('') -; -} - -export function loadTopBlockDescr(slice: Slice): TopBlockDescr { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xd5))) { - slice.loadUint(8) - let proof_for: BlockIdExt = loadBlockIdExt(slice) - - let signatures: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() - - - return loadBlockSignatures(slice1) - -}) -) - - let len: number = slice.loadUint(8) - - let chain: ProofChain = loadProofChain(slice, len) - - if ((!(len >= 1))) { - throw new Error('') - } - if ((!(len <= 8))) { - throw new Error('') - } - return { - kind: 'TopBlockDescr', - proof_for: proof_for, - signatures: signatures, - len: len, - chain: chain, -} - -} -; - throw new Error('') -; -} - -export function storeTopBlockDescr(topBlockDescr: TopBlockDescr): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xd5, 8) - - storeBlockIdExt(topBlockDescr.proof_for)(builder) - - storeMaybe(topBlockDescr.signatures, ((arg: BlockSignatures) => { - return ((builder: Builder) => { - let cell1 = beginCell() - - - storeBlockSignatures(arg)(cell1) - - builder.storeRef(cell1) - - - }) - - - }) - )(builder) - - builder.storeUint(topBlockDescr.len, 8) - - storeProofChain(topBlockDescr.chain)(builder) - - if ((!(topBlockDescr.len >= 1))) { - throw new Error('') - } - - if ((!(topBlockDescr.len <= 8))) { - throw new Error('') - } - -}) - -; -} - -export function loadTopBlockDescrSet(slice: Slice): TopBlockDescrSet { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x4ac789f3))) { - slice.loadUint(32) - let collection: HashmapE = loadHashmapE(slice, 96, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() - - - return loadTopBlockDescr(slice1) - -}) -) - - return { - kind: 'TopBlockDescrSet', - collection: collection, -} - -} -; - throw new Error('') -; -} - -export function storeTopBlockDescrSet(topBlockDescrSet: TopBlockDescrSet): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x4ac789f3, 32) - - storeHashmapE(topBlockDescrSet.collection, ((arg: TopBlockDescr) => { - return ((builder: Builder) => { - let cell1 = beginCell() - - - storeTopBlockDescr(arg)(cell1) - - builder.storeRef(cell1) - - - }) - - - }) - )(builder) - -}) - -; -} - -export function loadProducerInfo(slice: Slice): ProducerInfo { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x34))) { - slice.loadUint(8) - let utime: number = slice.loadUint(32) - - let mc_blk_ref: ExtBlkRef = loadExtBlkRef(slice) - - let slice1 = slice.loadRef().beginParse() - - let state_proof: MERKLE_PROOF = loadMERKLE_PROOF(slice1, loadBlock) - - let slice2 = slice.loadRef().beginParse() - - let prod_proof: MERKLE_PROOF = loadMERKLE_PROOF(slice2, loadShardState) - - return { - kind: 'ProducerInfo', - utime: utime, - mc_blk_ref: mc_blk_ref, - state_proof: state_proof, - prod_proof: prod_proof, -} - -} -; - throw new Error('') -; -} - -export function storeProducerInfo(producerInfo: ProducerInfo): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x34, 8) - - builder.storeUint(producerInfo.utime, 32) - - storeExtBlkRef(producerInfo.mc_blk_ref)(builder) - - let cell1 = beginCell() - - - storeMERKLE_PROOF(producerInfo.state_proof, storeBlock)(cell1) - - builder.storeRef(cell1) - - let cell2 = beginCell() - - - storeMERKLE_PROOF(producerInfo.prod_proof, storeShardState)(cell2) - - builder.storeRef(cell2) - -}) - -; -} - -export function loadComplaintDescr(slice: Slice): ComplaintDescr { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x9c436252))) { - slice.loadUint(32) - let from_utime: number = slice.loadUint(32) - - let slice1 = slice.loadRef().beginParse() - - let prod_info: ProducerInfo = loadProducerInfo(slice1) - - return { - kind: 'ComplaintDescr_no_blk_gen', - from_utime: from_utime, - prod_info: prod_info, -} - -} -; - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x987f1ab7))) { - slice.loadUint(32) - let slice1 = slice.loadRef().beginParse() - - let prod_info_old: ProducerInfo = loadProducerInfo(slice1) - - let slice2 = slice.loadRef().beginParse() - - let prod_info_new: ProducerInfo = loadProducerInfo(slice2) - - return { - kind: 'ComplaintDescr_no_blk_gen_diff', - prod_info_old: prod_info_old, - prod_info_new: prod_info_new, -} - -} -; - throw new Error('') -; -} - -export function storeComplaintDescr(complaintDescr: ComplaintDescr): (builder: Builder) => void { - if ((complaintDescr.kind == 'ComplaintDescr_no_blk_gen')) { - return ((builder: Builder) => { - builder.storeUint(0x9c436252, 32) - - builder.storeUint(complaintDescr.from_utime, 32) - - let cell1 = beginCell() - - - storeProducerInfo(complaintDescr.prod_info)(cell1) - - builder.storeRef(cell1) - -}) - -} -; - if ((complaintDescr.kind == 'ComplaintDescr_no_blk_gen_diff')) { - return ((builder: Builder) => { - builder.storeUint(0x987f1ab7, 32) - - let cell1 = beginCell() - - - storeProducerInfo(complaintDescr.prod_info_old)(cell1) - - builder.storeRef(cell1) - - let cell2 = beginCell() - - - storeProducerInfo(complaintDescr.prod_info_new)(cell2) - - builder.storeRef(cell2) - -}) - -} -; - throw new Error('') -; -} - -export function loadValidatorComplaint(slice: Slice): ValidatorComplaint { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xbc))) { - slice.loadUint(8) - let validator_pubkey: BitString = slice.loadBits(256) - - let slice1 = slice.loadRef().beginParse() - - let description: ComplaintDescr = loadComplaintDescr(slice1) - - let created_at: number = slice.loadUint(32) - - let severity: number = slice.loadUint(8) - - let reward_addr: number = slice.loadUint(256) - - let paid: Grams = loadGrams(slice) - - let suggested_fine: Grams = loadGrams(slice) - - let suggested_fine_part: number = slice.loadUint(32) - - return { - kind: 'ValidatorComplaint', - validator_pubkey: validator_pubkey, - description: description, - created_at: created_at, - severity: severity, - reward_addr: reward_addr, - paid: paid, - suggested_fine: suggested_fine, - suggested_fine_part: suggested_fine_part, -} - -} -; - throw new Error('') -; -} - -export function storeValidatorComplaint(validatorComplaint: ValidatorComplaint): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xbc, 8) - - builder.storeBits(validatorComplaint.validator_pubkey) - - let cell1 = beginCell() - - - storeComplaintDescr(validatorComplaint.description)(cell1) - - builder.storeRef(cell1) - - builder.storeUint(validatorComplaint.created_at, 32) - - builder.storeUint(validatorComplaint.severity, 8) - - builder.storeUint(validatorComplaint.reward_addr, 256) - - storeGrams(validatorComplaint.paid)(builder) - - storeGrams(validatorComplaint.suggested_fine)(builder) - - builder.storeUint(validatorComplaint.suggested_fine_part, 32) - -}) - -; -} - -export function loadValidatorComplaintStatus(slice: Slice): ValidatorComplaintStatus { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x2d))) { - slice.loadUint(8) - let slice1 = slice.loadRef().beginParse() - - let complaint: ValidatorComplaint = loadValidatorComplaint(slice1) - - let voters: HashmapE = loadHashmapE(slice, 16, loadTrue) - - let vset_id: number = slice.loadUint(256) - - let weight_remaining: number = slice.loadInt(64) - - return { - kind: 'ValidatorComplaintStatus', - complaint: complaint, - voters: voters, - vset_id: vset_id, - weight_remaining: weight_remaining, -} - -} -; - throw new Error('') -; -} - -export function storeValidatorComplaintStatus(validatorComplaintStatus: ValidatorComplaintStatus): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x2d, 8) - - let cell1 = beginCell() - - - storeValidatorComplaint(validatorComplaintStatus.complaint)(cell1) - - builder.storeRef(cell1) - - storeHashmapE(validatorComplaintStatus.voters, storeTrue)(builder) - - builder.storeUint(validatorComplaintStatus.vset_id, 256) - - builder.storeInt(validatorComplaintStatus.weight_remaining, 64) - -}) - -; -} - -export function loadVmStackValue(slice: Slice): VmStackValue { - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x00))) { - slice.loadUint(8) - return { - kind: 'VmStackValue_vm_stk_null', -} - -} -; - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x01))) { - slice.loadUint(8) - let value: number = slice.loadInt(64) - - return { - kind: 'VmStackValue_vm_stk_tinyint', - value: value, -} - -} -; - if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x0201))) { - slice.loadUint(16) - let value: number = slice.loadInt(257) - - return { - kind: 'VmStackValue_vm_stk_int', - value: value, -} - -} -; - if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x02ff))) { - slice.loadUint(16) - return { - kind: 'VmStackValue_vm_stk_nan', -} - -} -; - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x03))) { - slice.loadUint(8) - let slice1 = slice.loadRef().beginParse() - - let _cell: Slice = slice1 - - return { - kind: 'VmStackValue_vm_stk_cell', - _cell: _cell, -} - -} -; - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x04))) { - slice.loadUint(8) - let _: VmCellSlice = loadVmCellSlice(slice) - - return { - kind: 'VmStackValue_vm_stk_slice', - _: _, -} - -} -; - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x05))) { - slice.loadUint(8) - let slice1 = slice.loadRef().beginParse() - - let _cell: Slice = slice1 - - return { - kind: 'VmStackValue_vm_stk_builder', - _cell: _cell, -} - -} -; - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x06))) { - slice.loadUint(8) - let cont: VmCont = loadVmCont(slice) - - return { - kind: 'VmStackValue_vm_stk_cont', - cont: cont, -} - -} -; - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x07))) { - slice.loadUint(8) - let len: number = slice.loadUint(16) - - let data: VmTuple = loadVmTuple(slice, len) - - return { - kind: 'VmStackValue_vm_stk_tuple', - len: len, - data: data, -} - -} -; - throw new Error('') -; -} - -export function storeVmStackValue(vmStackValue: VmStackValue): (builder: Builder) => void { - if ((vmStackValue.kind == 'VmStackValue_vm_stk_null')) { - return ((builder: Builder) => { - builder.storeUint(0x00, 8) - -}) - -} -; - if ((vmStackValue.kind == 'VmStackValue_vm_stk_tinyint')) { - return ((builder: Builder) => { - builder.storeUint(0x01, 8) - - builder.storeInt(vmStackValue.value, 64) - -}) - -} -; - if ((vmStackValue.kind == 'VmStackValue_vm_stk_int')) { - return ((builder: Builder) => { - builder.storeUint(0x0201, 16) - - builder.storeInt(vmStackValue.value, 257) - -}) - -} -; - if ((vmStackValue.kind == 'VmStackValue_vm_stk_nan')) { - return ((builder: Builder) => { - builder.storeUint(0x02ff, 16) - -}) - -} -; - if ((vmStackValue.kind == 'VmStackValue_vm_stk_cell')) { - return ((builder: Builder) => { - builder.storeUint(0x03, 8) - - let cell1 = beginCell() - - - cell1.storeSlice(vmStackValue._cell) - - builder.storeRef(cell1) - -}) - -} -; - if ((vmStackValue.kind == 'VmStackValue_vm_stk_slice')) { - return ((builder: Builder) => { - builder.storeUint(0x04, 8) - - storeVmCellSlice(vmStackValue._)(builder) - -}) - -} -; - if ((vmStackValue.kind == 'VmStackValue_vm_stk_builder')) { - return ((builder: Builder) => { - builder.storeUint(0x05, 8) - - let cell1 = beginCell() - - - cell1.storeSlice(vmStackValue._cell) - - builder.storeRef(cell1) - -}) - -} -; - if ((vmStackValue.kind == 'VmStackValue_vm_stk_cont')) { - return ((builder: Builder) => { - builder.storeUint(0x06, 8) - - storeVmCont(vmStackValue.cont)(builder) - -}) - -} -; - if ((vmStackValue.kind == 'VmStackValue_vm_stk_tuple')) { - return ((builder: Builder) => { - builder.storeUint(0x07, 8) - - builder.storeUint(vmStackValue.len, 16) - - storeVmTuple(vmStackValue.data)(builder) - -}) - -} -; - throw new Error('') -; -} - -export function loadVmCellSlice(slice: Slice): VmCellSlice { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xd6a63245))) { - slice.loadUint(32) - let slice1 = slice.loadRef().beginParse() - - let _cell: Slice = slice1 - - let st_bits: number = slice.loadUint(10) - - let end_bits: number = slice.loadUint(10) - - let st_ref: number = slice.loadUint(bitLen(4)) - - let end_ref: number = slice.loadUint(bitLen(4)) - - if ((!(st_bits <= end_bits))) { - throw new Error('') - } - if ((!(st_ref <= end_ref))) { - throw new Error('') - } - return { - kind: 'VmCellSlice', - _cell: _cell, - st_bits: st_bits, - end_bits: end_bits, - st_ref: st_ref, - end_ref: end_ref, -} - -} -; - throw new Error('') -; -} - -export function storeVmCellSlice(vmCellSlice: VmCellSlice): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xd6a63245, 32) - - let cell1 = beginCell() - - - cell1.storeSlice(vmCellSlice._cell) - - builder.storeRef(cell1) - - builder.storeUint(vmCellSlice.st_bits, 10) - - builder.storeUint(vmCellSlice.end_bits, 10) - - builder.storeUint(vmCellSlice.st_ref, bitLen(4)) - - builder.storeUint(vmCellSlice.end_ref, bitLen(4)) - - if ((!(vmCellSlice.st_bits <= vmCellSlice.end_bits))) { - throw new Error('') - } - - if ((!(vmCellSlice.st_ref <= vmCellSlice.end_ref))) { - throw new Error('') - } - -}) - -; -} - -export function loadVmTupleRef(slice: Slice, arg0: number): VmTupleRef { - if ((arg0 == 0)) { - return { - kind: 'VmTupleRef_vm_tupref_nil', -} - -} -; - if ((arg0 == 1)) { - let slice1 = slice.loadRef().beginParse() - - let entry: VmStackValue = loadVmStackValue(slice1) - - return { - kind: 'VmTupleRef_vm_tupref_single', - entry: entry, -} - -} -; - if (true) { - let slice1 = slice.loadRef().beginParse() - - let ref: VmTuple = loadVmTuple(slice1, ((arg0 - 2) + 2)) - - return { - kind: 'VmTupleRef_vm_tupref_any', - n: (arg0 - 2), - ref: ref, -} - -} -; - throw new Error('') -; -} - -export function storeVmTupleRef(vmTupleRef: VmTupleRef): (builder: Builder) => void { - if ((vmTupleRef.kind == 'VmTupleRef_vm_tupref_nil')) { - return ((builder: Builder) => { -}) - -} -; - if ((vmTupleRef.kind == 'VmTupleRef_vm_tupref_single')) { - return ((builder: Builder) => { - let cell1 = beginCell() - - - storeVmStackValue(vmTupleRef.entry)(cell1) - - builder.storeRef(cell1) - -}) - -} -; - if ((vmTupleRef.kind == 'VmTupleRef_vm_tupref_any')) { - return ((builder: Builder) => { - let cell1 = beginCell() - - - storeVmTuple(vmTupleRef.ref)(cell1) - - builder.storeRef(cell1) - -}) - -} -; - throw new Error('') -; -} - -export function loadVmTuple(slice: Slice, arg0: number): VmTuple { - if ((arg0 == 0)) { - return { - kind: 'VmTuple_vm_tuple_nil', -} - -} -; - if (true) { - let head: VmTupleRef = loadVmTupleRef(slice, (arg0 - 1)) - - let slice1 = slice.loadRef().beginParse() - - let tail: VmStackValue = loadVmStackValue(slice1) - - return { - kind: 'VmTuple_vm_tuple_tcons', - n: (arg0 - 1), - head: head, - tail: tail, -} - -} -; - throw new Error('') -; -} - -export function storeVmTuple(vmTuple: VmTuple): (builder: Builder) => void { - if ((vmTuple.kind == 'VmTuple_vm_tuple_nil')) { - return ((builder: Builder) => { -}) - -} -; - if ((vmTuple.kind == 'VmTuple_vm_tuple_tcons')) { - return ((builder: Builder) => { - storeVmTupleRef(vmTuple.head)(builder) - - let cell1 = beginCell() - - - storeVmStackValue(vmTuple.tail)(cell1) - - builder.storeRef(cell1) - -}) - -} -; - throw new Error('') -; -} - -export function loadVmStack(slice: Slice): VmStack { - let depth: number = slice.loadUint(24) - -; - let stack: VmStackList = loadVmStackList(slice, depth) - -; - return { - kind: 'VmStack', - depth: depth, - stack: stack, -} - -; -} - -export function storeVmStack(vmStack: VmStack): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(vmStack.depth, 24) - - storeVmStackList(vmStack.stack)(builder) - -}) - -; -} - -export function loadVmStackList(slice: Slice, arg0: number): VmStackList { - if ((arg0 == 0)) { - return { - kind: 'VmStackList_vm_stk_nil', -} - -} -; - if (true) { - let slice1 = slice.loadRef().beginParse() - - let rest: VmStackList = loadVmStackList(slice1, (arg0 - 1)) - - let tos: VmStackValue = loadVmStackValue(slice) - - return { - kind: 'VmStackList_vm_stk_cons', - n: (arg0 - 1), - rest: rest, - tos: tos, -} - -} -; - throw new Error('') -; -} - -export function storeVmStackList(vmStackList: VmStackList): (builder: Builder) => void { - if ((vmStackList.kind == 'VmStackList_vm_stk_nil')) { - return ((builder: Builder) => { -}) - -} -; - if ((vmStackList.kind == 'VmStackList_vm_stk_cons')) { - return ((builder: Builder) => { - let cell1 = beginCell() - - - storeVmStackList(vmStackList.rest)(cell1) - - builder.storeRef(cell1) - - storeVmStackValue(vmStackList.tos)(builder) - -}) - -} -; - throw new Error('') -; -} - -export function loadVmSaveList(slice: Slice): VmSaveList { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xeed28f11))) { - slice.loadUint(32) - let cregs: HashmapE = loadHashmapE(slice, 4, loadVmStackValue) - - return { - kind: 'VmSaveList', - cregs: cregs, -} +export function storeConfigParam(configParam: ConfigParam): (builder: Builder) => void { + if ((configParam.kind == 'ConfigParam__')) { + return ((builder: Builder) => { + builder.storeUint(0xbc7f2648, 32); + builder.storeBits(configParam.config_addr); + }) -} -; - throw new Error('') -; -} + } + if ((configParam.kind == 'ConfigParam__1')) { + return ((builder: Builder) => { + builder.storeUint(0x84659d0d, 32); + builder.storeBits(configParam.elector_addr); + }) -export function storeVmSaveList(vmSaveList: VmSaveList): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xeed28f11, 32) + } + if ((configParam.kind == 'ConfigParam__2')) { + return ((builder: Builder) => { + builder.storeUint(0x8648b2c4, 32); + builder.storeBits(configParam.minter_addr); + }) - storeHashmapE(vmSaveList.cregs, storeVmStackValue)(builder) + } + if ((configParam.kind == 'ConfigParam__3')) { + return ((builder: Builder) => { + builder.storeUint(0x8a752dc5, 32); + builder.storeBits(configParam.fee_collector_addr); + }) -}) + } + if ((configParam.kind == 'ConfigParam__4')) { + return ((builder: Builder) => { + builder.storeUint(0x8ceae93f, 32); + builder.storeBits(configParam.dns_root_addr); + }) -; -} + } + if ((configParam.kind == 'ConfigParam__5')) { + return ((builder: Builder) => { + builder.storeUint(0xb2571db5, 32); + storeGrams(configParam.mint_new_price)(builder); + storeGrams(configParam.mint_add_price)(builder); + }) -export function loadVmGasLimits(slice: Slice): VmGasLimits { - let remaining: number = slice.loadInt(64) + } + if ((configParam.kind == 'ConfigParam__6')) { + return ((builder: Builder) => { + builder.storeUint(0xd2115c6f, 32); + storeExtraCurrencyCollection(configParam.to_mint)(builder); + }) -; - let slice1 = slice.loadRef().beginParse() + } + if ((configParam.kind == 'ConfigParam__7')) { + return ((builder: Builder) => { + builder.storeUint(0xb19d2da6, 32); + storeGlobalVersion(configParam.anon0)(builder); + }) -; - let max_limit: number = slice1.loadInt(64) + } + if ((configParam.kind == 'ConfigParam__8')) { + return ((builder: Builder) => { + builder.storeUint(0x8f3b81de, 32); + storeHashmap(configParam.mandatory_params, storeTrue)(builder); + }) -; - let cur_limit: number = slice1.loadInt(64) + } + if ((configParam.kind == 'ConfigParam__9')) { + return ((builder: Builder) => { + builder.storeUint(0xfbcb8998, 32); + storeHashmap(configParam.critical_params, storeTrue)(builder); + }) -; - let credit: number = slice1.loadInt(64) + } + if ((configParam.kind == 'ConfigParam__10')) { + return ((builder: Builder) => { + builder.storeUint(0x9358b12f, 32); + storeConfigVotingSetup(configParam.anon0)(builder); + }) -; - return { - kind: 'VmGasLimits', - remaining: remaining, - max_limit: max_limit, - cur_limit: cur_limit, - credit: credit, -} + } + if ((configParam.kind == 'ConfigParam__11')) { + return ((builder: Builder) => { + builder.storeUint(0x9059857d, 32); + storeHashmapE(configParam.workchains, storeWorkchainDescr)(builder); + }) -; -} + } + if ((configParam.kind == 'ConfigParam__12')) { + return ((builder: Builder) => { + builder.storeUint(0xe8ae7dd3, 32); + storeComplaintPricing(configParam.anon0)(builder); + }) -export function storeVmGasLimits(vmGasLimits: VmGasLimits): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeInt(vmGasLimits.remaining, 64) + } + if ((configParam.kind == 'ConfigParam__13')) { + return ((builder: Builder) => { + builder.storeUint(0xf282db94, 32); + storeBlockCreateFees(configParam.anon0)(builder); + }) - let cell1 = beginCell() + } + if ((configParam.kind == 'ConfigParam__14')) { + return ((builder: Builder) => { + builder.storeUint(0xed67ebd2, 32); + builder.storeUint(configParam.validators_elected_for, 32); + builder.storeUint(configParam.elections_start_before, 32); + builder.storeUint(configParam.elections_end_before, 32); + builder.storeUint(configParam.stake_held_for, 32); + }) + } + if ((configParam.kind == 'ConfigParam__15')) { + return ((builder: Builder) => { + builder.storeUint(0xe8298d51, 32); + builder.storeUint(configParam.max_validators, 16); + builder.storeUint(configParam.max_main_validators, 16); + builder.storeUint(configParam.min_validators, 16); + if ((!(configParam.max_validators >= configParam.max_main_validators))) { + throw new Error(''); + } + if ((!(configParam.max_main_validators >= configParam.min_validators))) { + throw new Error(''); + } + if ((!(configParam.min_validators >= 1))) { + throw new Error(''); + } + }) - cell1.storeInt(vmGasLimits.max_limit, 64) + } + if ((configParam.kind == 'ConfigParam__16')) { + return ((builder: Builder) => { + builder.storeUint(0xa81c566c, 32); + storeGrams(configParam.min_stake)(builder); + storeGrams(configParam.max_stake)(builder); + storeGrams(configParam.min_total_stake)(builder); + builder.storeUint(configParam.max_stake_factor, 32); + }) - cell1.storeInt(vmGasLimits.cur_limit, 64) + } + if ((configParam.kind == 'ConfigParam__17')) { + return ((builder: Builder) => { + builder.storeUint(0xeab9843a, 32); + storeHashmap(configParam.anon0, storeStoragePrices)(builder); + }) - cell1.storeInt(vmGasLimits.credit, 64) + } + if ((configParam.kind == 'ConfigParam__24')) { + return ((builder: Builder) => { + builder.storeUint(0xf666426a, 32); + storeCatchainConfig(configParam.anon0)(builder); + }) - builder.storeRef(cell1) + } + if ((configParam.kind == 'ConfigParam__25')) { + return ((builder: Builder) => { + builder.storeUint(0xf5b85ad3, 32); + storeConsensusConfig(configParam.anon0)(builder); + }) -}) + } + if ((configParam.kind == 'ConfigParam__26')) { + return ((builder: Builder) => { + builder.storeUint(0x849fe3cc, 32); + storeHashmapE(configParam.fundamental_smc_addr, storeTrue)(builder); + }) -; -} + } + if ((configParam.kind == 'ConfigParam__27')) { + return ((builder: Builder) => { + builder.storeUint(0xcfc8ceeb, 32); + storeValidatorSet(configParam.prev_validators)(builder); + }) -export function loadVmLibraries(slice: Slice): VmLibraries { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xe9be85ef))) { - slice.loadUint(32) - let libraries: HashmapE = loadHashmapE(slice, 256, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() + } + if ((configParam.kind == 'ConfigParam__28')) { + return ((builder: Builder) => { + builder.storeUint(0xa1a5d63c, 32); + storeValidatorSet(configParam.prev_temp_validators)(builder); + }) + } + if ((configParam.kind == 'ConfigParam__29')) { + return ((builder: Builder) => { + builder.storeUint(0xfd569be3, 32); + storeValidatorSet(configParam.cur_validators)(builder); + }) - return slice1 + } + if ((configParam.kind == 'ConfigParam__30')) { + return ((builder: Builder) => { + builder.storeUint(0xc271315a, 32); + storeValidatorSet(configParam.cur_temp_validators)(builder); + }) -}) -) + } + if ((configParam.kind == 'ConfigParam__31')) { + return ((builder: Builder) => { + builder.storeUint(0x85d02f6c, 32); + storeValidatorSet(configParam.next_validators)(builder); + }) - return { - kind: 'VmLibraries', - libraries: libraries, -} + } + if ((configParam.kind == 'ConfigParam__32')) { + return ((builder: Builder) => { + builder.storeUint(0xffa3b0f8, 32); + storeValidatorSet(configParam.next_temp_validators)(builder); + }) -} -; - throw new Error('') -; -} + } + if ((configParam.kind == 'ConfigParam__33')) { + return ((builder: Builder) => { + builder.storeUint(0x86dfef76, 32); + storeHashmapE(configParam.anon0, storeValidatorSignedTempKey)(builder); + }) -export function storeVmLibraries(vmLibraries: VmLibraries): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xe9be85ef, 32) + } + if ((configParam.kind == 'ConfigParam__34')) { + return ((builder: Builder) => { + builder.storeUint(0x8517b916, 32); + storeMisbehaviourPunishmentConfig(configParam.anon0)(builder); + }) - storeHashmapE(vmLibraries.libraries, ((arg: Slice) => { + } + if ((configParam.kind == 'ConfigParam__35')) { return ((builder: Builder) => { - let cell1 = beginCell() + builder.storeUint(0xbd424af1, 32); + storeOracleBridgeParams(configParam.anon0)(builder); + }) + } + if ((configParam.kind == 'ConfigParam__36')) { + return ((builder: Builder) => { + builder.storeUint(0x966f1932, 32); + storeOracleBridgeParams(configParam.anon0)(builder); + }) - cell1.storeSlice(arg) + } + if ((configParam.kind == 'ConfigParam__37')) { + return ((builder: Builder) => { + builder.storeUint(0x8f742873, 32); + storeOracleBridgeParams(configParam.anon0)(builder); + }) - builder.storeRef(cell1) + } + if ((configParam.kind == 'ConfigParam_config_mc_gas_prices')) { + return ((builder: Builder) => { + storeGasLimitsPrices(configParam.anon0)(builder); + }) + } + if ((configParam.kind == 'ConfigParam_config_gas_prices')) { + return ((builder: Builder) => { + storeGasLimitsPrices(configParam.anon0)(builder); + }) + } + if ((configParam.kind == 'ConfigParam_config_mc_block_limits')) { + return ((builder: Builder) => { + storeBlockLimits(configParam.anon0)(builder); }) + } + if ((configParam.kind == 'ConfigParam_config_block_limits')) { + return ((builder: Builder) => { + storeBlockLimits(configParam.anon0)(builder); + }) - }) - )(builder) + } + if ((configParam.kind == 'ConfigParam_config_mc_fwd_prices')) { + return ((builder: Builder) => { + storeMsgForwardPrices(configParam.anon0)(builder); + }) -}) + } + if ((configParam.kind == 'ConfigParam_config_fwd_prices')) { + return ((builder: Builder) => { + storeMsgForwardPrices(configParam.anon0)(builder); + }) -; + } + throw new Error(''); } -export function loadVmControlData(slice: Slice): VmControlData { - let nargs: Maybe = loadMaybe(slice, ((slice: Slice) => { - return slice.loadUint(13) - -}) -) - -; - let stack: Maybe = loadMaybe(slice, loadVmStack) - -; - let save: VmSaveList = loadVmSaveList(slice) - -; - let cp: Maybe = loadMaybe(slice, ((slice: Slice) => { - return slice.loadInt(16) - -}) -) - -; - return { - kind: 'VmControlData', - nargs: nargs, - stack: stack, - save: save, - cp: cp, -} +export function loadGlobalVersion(slice: Slice): GlobalVersion { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xc4))) { + slice.loadUint(8); + let version: number = slice.loadUint(32); + let capabilities: number = slice.loadUint(64); + return { + kind: 'GlobalVersion', + version: version, + capabilities: capabilities, + } -; + } + throw new Error(''); } -export function storeVmControlData(vmControlData: VmControlData): (builder: Builder) => void { +export function storeGlobalVersion(globalVersion: GlobalVersion): (builder: Builder) => void { return ((builder: Builder) => { - storeMaybe(vmControlData.nargs, ((arg: number) => { - return ((builder: Builder) => { - builder.storeUint(arg, 13) - - }) - - + builder.storeUint(0xc4, 8); + builder.storeUint(globalVersion.version, 32); + builder.storeUint(globalVersion.capabilities, 64); }) - )(builder) - - storeMaybe(vmControlData.stack, storeVmStack)(builder) - storeVmSaveList(vmControlData.save)(builder) - - storeMaybe(vmControlData.cp, ((arg: number) => { - return ((builder: Builder) => { - builder.storeInt(arg, 16) +} - }) +export function loadConfigProposalSetup(slice: Slice): ConfigProposalSetup { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x36))) { + slice.loadUint(8); + let min_tot_rounds: number = slice.loadUint(8); + let max_tot_rounds: number = slice.loadUint(8); + let min_wins: number = slice.loadUint(8); + let max_losses: number = slice.loadUint(8); + let min_store_sec: number = slice.loadUint(32); + let max_store_sec: number = slice.loadUint(32); + let bit_price: number = slice.loadUint(32); + let _cell_price: number = slice.loadUint(32); + return { + kind: 'ConfigProposalSetup', + min_tot_rounds: min_tot_rounds, + max_tot_rounds: max_tot_rounds, + min_wins: min_wins, + max_losses: max_losses, + min_store_sec: min_store_sec, + max_store_sec: max_store_sec, + bit_price: bit_price, + _cell_price: _cell_price, + } + } + throw new Error(''); +} +export function storeConfigProposalSetup(configProposalSetup: ConfigProposalSetup): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x36, 8); + builder.storeUint(configProposalSetup.min_tot_rounds, 8); + builder.storeUint(configProposalSetup.max_tot_rounds, 8); + builder.storeUint(configProposalSetup.min_wins, 8); + builder.storeUint(configProposalSetup.max_losses, 8); + builder.storeUint(configProposalSetup.min_store_sec, 32); + builder.storeUint(configProposalSetup.max_store_sec, 32); + builder.storeUint(configProposalSetup.bit_price, 32); + builder.storeUint(configProposalSetup._cell_price, 32); }) - )(builder) -}) - -; } -export function loadVmCont(slice: Slice): VmCont { - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { - slice.loadUint(2) - let cdata: VmControlData = loadVmControlData(slice) - - let code: VmCellSlice = loadVmCellSlice(slice) - - return { - kind: 'VmCont_vmc_std', - cdata: cdata, - code: code, -} +export function loadConfigVotingSetup(slice: Slice): ConfigVotingSetup { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x91))) { + slice.loadUint(8); + let slice1 = slice.loadRef().beginParse(); + let normal_params: ConfigProposalSetup = loadConfigProposalSetup(slice1); + let slice2 = slice.loadRef().beginParse(); + let critical_params: ConfigProposalSetup = loadConfigProposalSetup(slice2); + return { + kind: 'ConfigVotingSetup', + normal_params: normal_params, + critical_params: critical_params, + } + } + throw new Error(''); } -; - if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b01))) { - slice.loadUint(2) - let cdata: VmControlData = loadVmControlData(slice) - let slice1 = slice.loadRef().beginParse() - - let next: VmCont = loadVmCont(slice1) +export function storeConfigVotingSetup(configVotingSetup: ConfigVotingSetup): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x91, 8); + let cell1 = beginCell(); + storeConfigProposalSetup(configVotingSetup.normal_params)(cell1); + builder.storeRef(cell1); + let cell2 = beginCell(); + storeConfigProposalSetup(configVotingSetup.critical_params)(cell2); + builder.storeRef(cell2); + }) - return { - kind: 'VmCont_vmc_envelope', - cdata: cdata, - next: next, } -} -; - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b1000))) { - slice.loadUint(4) - let exit_code: number = slice.loadInt(32) +export function loadConfigProposal(slice: Slice): ConfigProposal { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xf3))) { + slice.loadUint(8); + let param_id: number = slice.loadInt(32); + let param_value: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse(); + return slice1 +}) +); + let if_hash_equal: Maybe = loadMaybe(slice, ((slice: Slice) => { + return slice.loadUint(256) +}) +); + return { + kind: 'ConfigProposal', + param_id: param_id, + param_value: param_value, + if_hash_equal: if_hash_equal, + } - return { - kind: 'VmCont_vmc_quit', - exit_code: exit_code, + } + throw new Error(''); } -} -; - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b1001))) { - slice.loadUint(4) - return { - kind: 'VmCont_vmc_quit_exc', -} +export function storeConfigProposal(configProposal: ConfigProposal): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xf3, 8); + builder.storeInt(configProposal.param_id, 32); + storeMaybe(configProposal.param_value, ((arg: Slice) => { + return ((builder: Builder) => { + let cell1 = beginCell(); -} -; - if (((slice.remainingBits >= 5) && (slice.preloadUint(5) == 0b10100))) { - slice.loadUint(5) - let count: number = slice.loadUint(63) + cell1.storeSlice(arg); - let slice1 = slice.loadRef().beginParse() + builder.storeRef(cell1); - let body: VmCont = loadVmCont(slice1) + }) - let slice2 = slice.loadRef().beginParse() + }) + )(builder); + storeMaybe(configProposal.if_hash_equal, ((arg: number) => { + return ((builder: Builder) => { + builder.storeUint(arg, 256); + }) - let after: VmCont = loadVmCont(slice2) + }) + )(builder); + }) - return { - kind: 'VmCont_vmc_repeat', - count: count, - body: body, - after: after, } +export function loadConfigProposalStatus(slice: Slice): ConfigProposalStatus { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xce))) { + slice.loadUint(8); + let expires: number = slice.loadUint(32); + let slice1 = slice.loadRef().beginParse(); + let proposal: ConfigProposal = loadConfigProposal(slice1); + let is_critical: Bool = loadBool(slice); + let voters: HashmapE = loadHashmapE(slice, 16, loadTrue); + let remaining_weight: number = slice.loadInt(64); + let validator_set_id: number = slice.loadUint(256); + let rounds_remaining: number = slice.loadUint(8); + let wins: number = slice.loadUint(8); + let losses: number = slice.loadUint(8); + return { + kind: 'ConfigProposalStatus', + expires: expires, + proposal: proposal, + is_critical: is_critical, + voters: voters, + remaining_weight: remaining_weight, + validator_set_id: validator_set_id, + rounds_remaining: rounds_remaining, + wins: wins, + losses: losses, + } + + } + throw new Error(''); } -; - if (((slice.remainingBits >= 6) && (slice.preloadUint(6) == 0b110000))) { - slice.loadUint(6) - let slice1 = slice.loadRef().beginParse() - let body: VmCont = loadVmCont(slice1) +export function storeConfigProposalStatus(configProposalStatus: ConfigProposalStatus): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xce, 8); + builder.storeUint(configProposalStatus.expires, 32); + let cell1 = beginCell(); + storeConfigProposal(configProposalStatus.proposal)(cell1); + builder.storeRef(cell1); + storeBool(configProposalStatus.is_critical)(builder); + storeHashmapE(configProposalStatus.voters, storeTrue)(builder); + builder.storeInt(configProposalStatus.remaining_weight, 64); + builder.storeUint(configProposalStatus.validator_set_id, 256); + builder.storeUint(configProposalStatus.rounds_remaining, 8); + builder.storeUint(configProposalStatus.wins, 8); + builder.storeUint(configProposalStatus.losses, 8); + }) - let slice2 = slice.loadRef().beginParse() +} - let after: VmCont = loadVmCont(slice2) +export function loadWorkchainFormat(slice: Slice, arg0: number): WorkchainFormat { + if (((slice.remainingBits >= 4) && ((slice.preloadUint(4) == 0x1) && (arg0 == 1)))) { + slice.loadUint(4); + let vm_version: number = slice.loadInt(32); + let vm_mode: number = slice.loadUint(64); + return { + kind: 'WorkchainFormat_wfmt_basic', + vm_version: vm_version, + vm_mode: vm_mode, + } - return { - kind: 'VmCont_vmc_until', - body: body, - after: after, -} + } + if (((slice.remainingBits >= 4) && ((slice.preloadUint(4) == 0x0) && (arg0 == 0)))) { + slice.loadUint(4); + let min_addr_len: number = slice.loadUint(12); + let max_addr_len: number = slice.loadUint(12); + let addr_len_step: number = slice.loadUint(12); + let workchain_type_id: number = slice.loadUint(32); + if ((!(min_addr_len >= 64))) { + throw new Error(''); + } + if ((!(min_addr_len <= max_addr_len))) { + throw new Error(''); + } + if ((!(max_addr_len <= 1023))) { + throw new Error(''); + } + if ((!(addr_len_step <= 1023))) { + throw new Error(''); + } + if ((!(workchain_type_id >= 1))) { + throw new Error(''); + } + return { + kind: 'WorkchainFormat_wfmt_ext', + min_addr_len: min_addr_len, + max_addr_len: max_addr_len, + addr_len_step: addr_len_step, + workchain_type_id: workchain_type_id, + } + } + throw new Error(''); } -; - if (((slice.remainingBits >= 6) && (slice.preloadUint(6) == 0b110001))) { - slice.loadUint(6) - let slice1 = slice.loadRef().beginParse() - let body: VmCont = loadVmCont(slice1) +export function storeWorkchainFormat(workchainFormat: WorkchainFormat): (builder: Builder) => void { + if ((workchainFormat.kind == 'WorkchainFormat_wfmt_basic')) { + return ((builder: Builder) => { + builder.storeUint(0x1, 4); + builder.storeInt(workchainFormat.vm_version, 32); + builder.storeUint(workchainFormat.vm_mode, 64); + }) - return { - kind: 'VmCont_vmc_again', - body: body, -} + } + if ((workchainFormat.kind == 'WorkchainFormat_wfmt_ext')) { + return ((builder: Builder) => { + builder.storeUint(0x0, 4); + builder.storeUint(workchainFormat.min_addr_len, 12); + builder.storeUint(workchainFormat.max_addr_len, 12); + builder.storeUint(workchainFormat.addr_len_step, 12); + builder.storeUint(workchainFormat.workchain_type_id, 32); + if ((!(workchainFormat.min_addr_len >= 64))) { + throw new Error(''); + } + if ((!(workchainFormat.min_addr_len <= workchainFormat.max_addr_len))) { + throw new Error(''); + } + if ((!(workchainFormat.max_addr_len <= 1023))) { + throw new Error(''); + } + if ((!(workchainFormat.addr_len_step <= 1023))) { + throw new Error(''); + } + if ((!(workchainFormat.workchain_type_id >= 1))) { + throw new Error(''); + } + }) + } + throw new Error(''); } -; - if (((slice.remainingBits >= 6) && (slice.preloadUint(6) == 0b110010))) { - slice.loadUint(6) - let slice1 = slice.loadRef().beginParse() - let cond: VmCont = loadVmCont(slice1) +export function loadWorkchainDescr(slice: Slice): WorkchainDescr { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xa6))) { + slice.loadUint(8); + let enabled_since: number = slice.loadUint(32); + let actual_min_split: number = slice.loadUint(8); + let min_split: number = slice.loadUint(8); + let max_split: number = slice.loadUint(8); + let basic: number = slice.loadUint(1); + let active: Bool = loadBool(slice); + let accept_msgs: Bool = loadBool(slice); + let flags: number = slice.loadUint(13); + let zerostate_root_hash: BitString = slice.loadBits(256); + let zerostate_file_hash: BitString = slice.loadBits(256); + let version: number = slice.loadUint(32); + let format: WorkchainFormat = loadWorkchainFormat(slice, basic); + if ((!(actual_min_split <= min_split))) { + throw new Error(''); + } + if ((!(flags == 0))) { + throw new Error(''); + } + return { + kind: 'WorkchainDescr', + enabled_since: enabled_since, + actual_min_split: actual_min_split, + min_split: min_split, + max_split: max_split, + basic: basic, + active: active, + accept_msgs: accept_msgs, + flags: flags, + zerostate_root_hash: zerostate_root_hash, + zerostate_file_hash: zerostate_file_hash, + version: version, + format: format, + } - let slice2 = slice.loadRef().beginParse() + } + throw new Error(''); +} - let body: VmCont = loadVmCont(slice2) +export function storeWorkchainDescr(workchainDescr: WorkchainDescr): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xa6, 8); + builder.storeUint(workchainDescr.enabled_since, 32); + builder.storeUint(workchainDescr.actual_min_split, 8); + builder.storeUint(workchainDescr.min_split, 8); + builder.storeUint(workchainDescr.max_split, 8); + builder.storeUint(workchainDescr.basic, 1); + storeBool(workchainDescr.active)(builder); + storeBool(workchainDescr.accept_msgs)(builder); + builder.storeUint(workchainDescr.flags, 13); + builder.storeBits(workchainDescr.zerostate_root_hash); + builder.storeBits(workchainDescr.zerostate_file_hash); + builder.storeUint(workchainDescr.version, 32); + storeWorkchainFormat(workchainDescr.format)(builder); + if ((!(workchainDescr.actual_min_split <= workchainDescr.min_split))) { + throw new Error(''); + } + if ((!(workchainDescr.flags == 0))) { + throw new Error(''); + } + }) - let slice3 = slice.loadRef().beginParse() +} - let after: VmCont = loadVmCont(slice3) +export function loadComplaintPricing(slice: Slice): ComplaintPricing { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x1a))) { + slice.loadUint(8); + let deposit: Grams = loadGrams(slice); + let bit_price: Grams = loadGrams(slice); + let _cell_price: Grams = loadGrams(slice); + return { + kind: 'ComplaintPricing', + deposit: deposit, + bit_price: bit_price, + _cell_price: _cell_price, + } - return { - kind: 'VmCont_vmc_while_cond', - cond: cond, - body: body, - after: after, + } + throw new Error(''); } +export function storeComplaintPricing(complaintPricing: ComplaintPricing): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x1a, 8); + storeGrams(complaintPricing.deposit)(builder); + storeGrams(complaintPricing.bit_price)(builder); + storeGrams(complaintPricing._cell_price)(builder); + }) + } -; - if (((slice.remainingBits >= 6) && (slice.preloadUint(6) == 0b110011))) { - slice.loadUint(6) - let slice1 = slice.loadRef().beginParse() - let cond: VmCont = loadVmCont(slice1) +export function loadBlockCreateFees(slice: Slice): BlockCreateFees { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x6b))) { + slice.loadUint(8); + let masterchain_block_fee: Grams = loadGrams(slice); + let basechain_block_fee: Grams = loadGrams(slice); + return { + kind: 'BlockCreateFees', + masterchain_block_fee: masterchain_block_fee, + basechain_block_fee: basechain_block_fee, + } - let slice2 = slice.loadRef().beginParse() + } + throw new Error(''); +} - let body: VmCont = loadVmCont(slice2) +export function storeBlockCreateFees(blockCreateFees: BlockCreateFees): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x6b, 8); + storeGrams(blockCreateFees.masterchain_block_fee)(builder); + storeGrams(blockCreateFees.basechain_block_fee)(builder); + }) - let slice3 = slice.loadRef().beginParse() +} - let after: VmCont = loadVmCont(slice3) +export function loadStoragePrices(slice: Slice): StoragePrices { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xcc))) { + slice.loadUint(8); + let utime_since: number = slice.loadUint(32); + let bit_price_ps: number = slice.loadUint(64); + let _cell_price_ps: number = slice.loadUint(64); + let mc_bit_price_ps: number = slice.loadUint(64); + let mc_cell_price_ps: number = slice.loadUint(64); + return { + kind: 'StoragePrices', + utime_since: utime_since, + bit_price_ps: bit_price_ps, + _cell_price_ps: _cell_price_ps, + mc_bit_price_ps: mc_bit_price_ps, + mc_cell_price_ps: mc_cell_price_ps, + } - return { - kind: 'VmCont_vmc_while_body', - cond: cond, - body: body, - after: after, + } + throw new Error(''); } +export function storeStoragePrices(storagePrices: StoragePrices): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xcc, 8); + builder.storeUint(storagePrices.utime_since, 32); + builder.storeUint(storagePrices.bit_price_ps, 64); + builder.storeUint(storagePrices._cell_price_ps, 64); + builder.storeUint(storagePrices.mc_bit_price_ps, 64); + builder.storeUint(storagePrices.mc_cell_price_ps, 64); + }) + } -; - if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b1111))) { - slice.loadUint(4) - let value: number = slice.loadInt(32) - let slice1 = slice.loadRef().beginParse() +export function loadGasLimitsPrices(slice: Slice): GasLimitsPrices { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xdd))) { + slice.loadUint(8); + let gas_price: number = slice.loadUint(64); + let gas_limit: number = slice.loadUint(64); + let gas_credit: number = slice.loadUint(64); + let block_gas_limit: number = slice.loadUint(64); + let freeze_due_limit: number = slice.loadUint(64); + let delete_due_limit: number = slice.loadUint(64); + return { + kind: 'GasLimitsPrices_gas_prices', + gas_price: gas_price, + gas_limit: gas_limit, + gas_credit: gas_credit, + block_gas_limit: block_gas_limit, + freeze_due_limit: freeze_due_limit, + delete_due_limit: delete_due_limit, + } - let next: VmCont = loadVmCont(slice1) + } + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xde))) { + slice.loadUint(8); + let gas_price: number = slice.loadUint(64); + let gas_limit: number = slice.loadUint(64); + let special_gas_limit: number = slice.loadUint(64); + let gas_credit: number = slice.loadUint(64); + let block_gas_limit: number = slice.loadUint(64); + let freeze_due_limit: number = slice.loadUint(64); + let delete_due_limit: number = slice.loadUint(64); + return { + kind: 'GasLimitsPrices_gas_prices_ext', + gas_price: gas_price, + gas_limit: gas_limit, + special_gas_limit: special_gas_limit, + gas_credit: gas_credit, + block_gas_limit: block_gas_limit, + freeze_due_limit: freeze_due_limit, + delete_due_limit: delete_due_limit, + } - return { - kind: 'VmCont_vmc_pushint', - value: value, - next: next, -} + } + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xd1))) { + slice.loadUint(8); + let flat_gas_limit: number = slice.loadUint(64); + let flat_gas_price: number = slice.loadUint(64); + let other: GasLimitsPrices = loadGasLimitsPrices(slice); + return { + kind: 'GasLimitsPrices_gas_flat_pfx', + flat_gas_limit: flat_gas_limit, + flat_gas_price: flat_gas_price, + other: other, + } + } + throw new Error(''); } -; - throw new Error('') -; -} - -export function storeVmCont(vmCont: VmCont): (builder: Builder) => void { - if ((vmCont.kind == 'VmCont_vmc_std')) { - return ((builder: Builder) => { - builder.storeUint(0b00, 2) - storeVmControlData(vmCont.cdata)(builder) +export function storeGasLimitsPrices(gasLimitsPrices: GasLimitsPrices): (builder: Builder) => void { + if ((gasLimitsPrices.kind == 'GasLimitsPrices_gas_prices')) { + return ((builder: Builder) => { + builder.storeUint(0xdd, 8); + builder.storeUint(gasLimitsPrices.gas_price, 64); + builder.storeUint(gasLimitsPrices.gas_limit, 64); + builder.storeUint(gasLimitsPrices.gas_credit, 64); + builder.storeUint(gasLimitsPrices.block_gas_limit, 64); + builder.storeUint(gasLimitsPrices.freeze_due_limit, 64); + builder.storeUint(gasLimitsPrices.delete_due_limit, 64); + }) - storeVmCellSlice(vmCont.code)(builder) + } + if ((gasLimitsPrices.kind == 'GasLimitsPrices_gas_prices_ext')) { + return ((builder: Builder) => { + builder.storeUint(0xde, 8); + builder.storeUint(gasLimitsPrices.gas_price, 64); + builder.storeUint(gasLimitsPrices.gas_limit, 64); + builder.storeUint(gasLimitsPrices.special_gas_limit, 64); + builder.storeUint(gasLimitsPrices.gas_credit, 64); + builder.storeUint(gasLimitsPrices.block_gas_limit, 64); + builder.storeUint(gasLimitsPrices.freeze_due_limit, 64); + builder.storeUint(gasLimitsPrices.delete_due_limit, 64); + }) -}) + } + if ((gasLimitsPrices.kind == 'GasLimitsPrices_gas_flat_pfx')) { + return ((builder: Builder) => { + builder.storeUint(0xd1, 8); + builder.storeUint(gasLimitsPrices.flat_gas_limit, 64); + builder.storeUint(gasLimitsPrices.flat_gas_price, 64); + storeGasLimitsPrices(gasLimitsPrices.other)(builder); + }) + } + throw new Error(''); } -; - if ((vmCont.kind == 'VmCont_vmc_envelope')) { - return ((builder: Builder) => { - builder.storeUint(0b01, 2) - storeVmControlData(vmCont.cdata)(builder) - - let cell1 = beginCell() +export function loadParamLimits(slice: Slice): ParamLimits { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xc3))) { + slice.loadUint(8); + let underload: number = slice.loadUint(32); + let soft_limit: number = slice.loadUint(32); + let hard_limit: number = slice.loadUint(32); + if ((!(underload <= soft_limit))) { + throw new Error(''); + } + if ((!(soft_limit <= hard_limit))) { + throw new Error(''); + } + return { + kind: 'ParamLimits', + underload: underload, + soft_limit: soft_limit, + hard_limit: hard_limit, + } + } + throw new Error(''); +} - storeVmCont(vmCont.next)(cell1) +export function storeParamLimits(paramLimits: ParamLimits): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xc3, 8); + builder.storeUint(paramLimits.underload, 32); + builder.storeUint(paramLimits.soft_limit, 32); + builder.storeUint(paramLimits.hard_limit, 32); + if ((!(paramLimits.underload <= paramLimits.soft_limit))) { + throw new Error(''); + } + if ((!(paramLimits.soft_limit <= paramLimits.hard_limit))) { + throw new Error(''); + } + }) - builder.storeRef(cell1) +} -}) +export function loadBlockLimits(slice: Slice): BlockLimits { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x5d))) { + slice.loadUint(8); + let bytes: ParamLimits = loadParamLimits(slice); + let gas: ParamLimits = loadParamLimits(slice); + let lt_delta: ParamLimits = loadParamLimits(slice); + return { + kind: 'BlockLimits', + bytes: bytes, + gas: gas, + lt_delta: lt_delta, + } + } + throw new Error(''); } -; - if ((vmCont.kind == 'VmCont_vmc_quit')) { + +export function storeBlockLimits(blockLimits: BlockLimits): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0b1000, 4) + builder.storeUint(0x5d, 8); + storeParamLimits(blockLimits.bytes)(builder); + storeParamLimits(blockLimits.gas)(builder); + storeParamLimits(blockLimits.lt_delta)(builder); + }) - builder.storeInt(vmCont.exit_code, 32) +} -}) +export function loadMsgForwardPrices(slice: Slice): MsgForwardPrices { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xea))) { + slice.loadUint(8); + let lump_price: number = slice.loadUint(64); + let bit_price: number = slice.loadUint(64); + let _cell_price: number = slice.loadUint(64); + let ihr_price_factor: number = slice.loadUint(32); + let first_frac: number = slice.loadUint(16); + let next_frac: number = slice.loadUint(16); + return { + kind: 'MsgForwardPrices', + lump_price: lump_price, + bit_price: bit_price, + _cell_price: _cell_price, + ihr_price_factor: ihr_price_factor, + first_frac: first_frac, + next_frac: next_frac, + } + } + throw new Error(''); } -; - if ((vmCont.kind == 'VmCont_vmc_quit_exc')) { - return ((builder: Builder) => { - builder.storeUint(0b1001, 4) -}) +export function storeMsgForwardPrices(msgForwardPrices: MsgForwardPrices): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xea, 8); + builder.storeUint(msgForwardPrices.lump_price, 64); + builder.storeUint(msgForwardPrices.bit_price, 64); + builder.storeUint(msgForwardPrices._cell_price, 64); + builder.storeUint(msgForwardPrices.ihr_price_factor, 32); + builder.storeUint(msgForwardPrices.first_frac, 16); + builder.storeUint(msgForwardPrices.next_frac, 16); + }) } -; - if ((vmCont.kind == 'VmCont_vmc_repeat')) { - return ((builder: Builder) => { - builder.storeUint(0b10100, 5) - builder.storeUint(vmCont.count, 63) +export function loadCatchainConfig(slice: Slice): CatchainConfig { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xc1))) { + slice.loadUint(8); + let mc_catchain_lifetime: number = slice.loadUint(32); + let shard_catchain_lifetime: number = slice.loadUint(32); + let shard_validators_lifetime: number = slice.loadUint(32); + let shard_validators_num: number = slice.loadUint(32); + return { + kind: 'CatchainConfig_catchain_config', + mc_catchain_lifetime: mc_catchain_lifetime, + shard_catchain_lifetime: shard_catchain_lifetime, + shard_validators_lifetime: shard_validators_lifetime, + shard_validators_num: shard_validators_num, + } - let cell1 = beginCell() + } + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xc2))) { + slice.loadUint(8); + let flags: number = slice.loadUint(7); + let shuffle_mc_validators: Bool = loadBool(slice); + let mc_catchain_lifetime: number = slice.loadUint(32); + let shard_catchain_lifetime: number = slice.loadUint(32); + let shard_validators_lifetime: number = slice.loadUint(32); + let shard_validators_num: number = slice.loadUint(32); + if ((!(flags == 0))) { + throw new Error(''); + } + return { + kind: 'CatchainConfig_catchain_config_new', + flags: flags, + shuffle_mc_validators: shuffle_mc_validators, + mc_catchain_lifetime: mc_catchain_lifetime, + shard_catchain_lifetime: shard_catchain_lifetime, + shard_validators_lifetime: shard_validators_lifetime, + shard_validators_num: shard_validators_num, + } + } + throw new Error(''); +} - storeVmCont(vmCont.body)(cell1) +export function storeCatchainConfig(catchainConfig: CatchainConfig): (builder: Builder) => void { + if ((catchainConfig.kind == 'CatchainConfig_catchain_config')) { + return ((builder: Builder) => { + builder.storeUint(0xc1, 8); + builder.storeUint(catchainConfig.mc_catchain_lifetime, 32); + builder.storeUint(catchainConfig.shard_catchain_lifetime, 32); + builder.storeUint(catchainConfig.shard_validators_lifetime, 32); + builder.storeUint(catchainConfig.shard_validators_num, 32); + }) - builder.storeRef(cell1) + } + if ((catchainConfig.kind == 'CatchainConfig_catchain_config_new')) { + return ((builder: Builder) => { + builder.storeUint(0xc2, 8); + builder.storeUint(catchainConfig.flags, 7); + storeBool(catchainConfig.shuffle_mc_validators)(builder); + builder.storeUint(catchainConfig.mc_catchain_lifetime, 32); + builder.storeUint(catchainConfig.shard_catchain_lifetime, 32); + builder.storeUint(catchainConfig.shard_validators_lifetime, 32); + builder.storeUint(catchainConfig.shard_validators_num, 32); + if ((!(catchainConfig.flags == 0))) { + throw new Error(''); + } + }) - let cell2 = beginCell() + } + throw new Error(''); +} +export function loadConsensusConfig(slice: Slice): ConsensusConfig { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xd6))) { + slice.loadUint(8); + let round_candidates: number = slice.loadUint(32); + let next_candidate_delay_ms: number = slice.loadUint(32); + let consensus_timeout_ms: number = slice.loadUint(32); + let fast_attempts: number = slice.loadUint(32); + let attempt_duration: number = slice.loadUint(32); + let catchain_max_deps: number = slice.loadUint(32); + let max_block_bytes: number = slice.loadUint(32); + let max_collated_bytes: number = slice.loadUint(32); + if ((!(round_candidates >= 1))) { + throw new Error(''); + } + return { + kind: 'ConsensusConfig_consensus_config', + round_candidates: round_candidates, + next_candidate_delay_ms: next_candidate_delay_ms, + consensus_timeout_ms: consensus_timeout_ms, + fast_attempts: fast_attempts, + attempt_duration: attempt_duration, + catchain_max_deps: catchain_max_deps, + max_block_bytes: max_block_bytes, + max_collated_bytes: max_collated_bytes, + } - storeVmCont(vmCont.after)(cell2) + } + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xd7))) { + slice.loadUint(8); + let flags: number = slice.loadUint(7); + let new_catchain_ids: Bool = loadBool(slice); + let round_candidates: number = slice.loadUint(8); + let next_candidate_delay_ms: number = slice.loadUint(32); + let consensus_timeout_ms: number = slice.loadUint(32); + let fast_attempts: number = slice.loadUint(32); + let attempt_duration: number = slice.loadUint(32); + let catchain_max_deps: number = slice.loadUint(32); + let max_block_bytes: number = slice.loadUint(32); + let max_collated_bytes: number = slice.loadUint(32); + if ((!(flags == 0))) { + throw new Error(''); + } + if ((!(round_candidates >= 1))) { + throw new Error(''); + } + return { + kind: 'ConsensusConfig_consensus_config_new', + flags: flags, + new_catchain_ids: new_catchain_ids, + round_candidates: round_candidates, + next_candidate_delay_ms: next_candidate_delay_ms, + consensus_timeout_ms: consensus_timeout_ms, + fast_attempts: fast_attempts, + attempt_duration: attempt_duration, + catchain_max_deps: catchain_max_deps, + max_block_bytes: max_block_bytes, + max_collated_bytes: max_collated_bytes, + } - builder.storeRef(cell2) + } + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xd8))) { + slice.loadUint(8); + let flags: number = slice.loadUint(7); + let new_catchain_ids: Bool = loadBool(slice); + let round_candidates: number = slice.loadUint(8); + let next_candidate_delay_ms: number = slice.loadUint(32); + let consensus_timeout_ms: number = slice.loadUint(32); + let fast_attempts: number = slice.loadUint(32); + let attempt_duration: number = slice.loadUint(32); + let catchain_max_deps: number = slice.loadUint(32); + let max_block_bytes: number = slice.loadUint(32); + let max_collated_bytes: number = slice.loadUint(32); + let proto_version: number = slice.loadUint(16); + if ((!(flags == 0))) { + throw new Error(''); + } + if ((!(round_candidates >= 1))) { + throw new Error(''); + } + return { + kind: 'ConsensusConfig_consensus_config_v3', + flags: flags, + new_catchain_ids: new_catchain_ids, + round_candidates: round_candidates, + next_candidate_delay_ms: next_candidate_delay_ms, + consensus_timeout_ms: consensus_timeout_ms, + fast_attempts: fast_attempts, + attempt_duration: attempt_duration, + catchain_max_deps: catchain_max_deps, + max_block_bytes: max_block_bytes, + max_collated_bytes: max_collated_bytes, + proto_version: proto_version, + } -}) + } + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xd9))) { + slice.loadUint(8); + let flags: number = slice.loadUint(7); + let new_catchain_ids: Bool = loadBool(slice); + let round_candidates: number = slice.loadUint(8); + let next_candidate_delay_ms: number = slice.loadUint(32); + let consensus_timeout_ms: number = slice.loadUint(32); + let fast_attempts: number = slice.loadUint(32); + let attempt_duration: number = slice.loadUint(32); + let catchain_max_deps: number = slice.loadUint(32); + let max_block_bytes: number = slice.loadUint(32); + let max_collated_bytes: number = slice.loadUint(32); + let proto_version: number = slice.loadUint(16); + let catchain_max_blocks_coeff: number = slice.loadUint(32); + if ((!(flags == 0))) { + throw new Error(''); + } + if ((!(round_candidates >= 1))) { + throw new Error(''); + } + return { + kind: 'ConsensusConfig_consensus_config_v4', + flags: flags, + new_catchain_ids: new_catchain_ids, + round_candidates: round_candidates, + next_candidate_delay_ms: next_candidate_delay_ms, + consensus_timeout_ms: consensus_timeout_ms, + fast_attempts: fast_attempts, + attempt_duration: attempt_duration, + catchain_max_deps: catchain_max_deps, + max_block_bytes: max_block_bytes, + max_collated_bytes: max_collated_bytes, + proto_version: proto_version, + catchain_max_blocks_coeff: catchain_max_blocks_coeff, + } + } + throw new Error(''); } -; - if ((vmCont.kind == 'VmCont_vmc_until')) { - return ((builder: Builder) => { - builder.storeUint(0b110000, 6) - let cell1 = beginCell() +export function storeConsensusConfig(consensusConfig: ConsensusConfig): (builder: Builder) => void { + if ((consensusConfig.kind == 'ConsensusConfig_consensus_config')) { + return ((builder: Builder) => { + builder.storeUint(0xd6, 8); + builder.storeUint(consensusConfig.round_candidates, 32); + builder.storeUint(consensusConfig.next_candidate_delay_ms, 32); + builder.storeUint(consensusConfig.consensus_timeout_ms, 32); + builder.storeUint(consensusConfig.fast_attempts, 32); + builder.storeUint(consensusConfig.attempt_duration, 32); + builder.storeUint(consensusConfig.catchain_max_deps, 32); + builder.storeUint(consensusConfig.max_block_bytes, 32); + builder.storeUint(consensusConfig.max_collated_bytes, 32); + if ((!(consensusConfig.round_candidates >= 1))) { + throw new Error(''); + } + }) + + } + if ((consensusConfig.kind == 'ConsensusConfig_consensus_config_new')) { + return ((builder: Builder) => { + builder.storeUint(0xd7, 8); + builder.storeUint(consensusConfig.flags, 7); + storeBool(consensusConfig.new_catchain_ids)(builder); + builder.storeUint(consensusConfig.round_candidates, 8); + builder.storeUint(consensusConfig.next_candidate_delay_ms, 32); + builder.storeUint(consensusConfig.consensus_timeout_ms, 32); + builder.storeUint(consensusConfig.fast_attempts, 32); + builder.storeUint(consensusConfig.attempt_duration, 32); + builder.storeUint(consensusConfig.catchain_max_deps, 32); + builder.storeUint(consensusConfig.max_block_bytes, 32); + builder.storeUint(consensusConfig.max_collated_bytes, 32); + if ((!(consensusConfig.flags == 0))) { + throw new Error(''); + } + if ((!(consensusConfig.round_candidates >= 1))) { + throw new Error(''); + } + }) + } + if ((consensusConfig.kind == 'ConsensusConfig_consensus_config_v3')) { + return ((builder: Builder) => { + builder.storeUint(0xd8, 8); + builder.storeUint(consensusConfig.flags, 7); + storeBool(consensusConfig.new_catchain_ids)(builder); + builder.storeUint(consensusConfig.round_candidates, 8); + builder.storeUint(consensusConfig.next_candidate_delay_ms, 32); + builder.storeUint(consensusConfig.consensus_timeout_ms, 32); + builder.storeUint(consensusConfig.fast_attempts, 32); + builder.storeUint(consensusConfig.attempt_duration, 32); + builder.storeUint(consensusConfig.catchain_max_deps, 32); + builder.storeUint(consensusConfig.max_block_bytes, 32); + builder.storeUint(consensusConfig.max_collated_bytes, 32); + builder.storeUint(consensusConfig.proto_version, 16); + if ((!(consensusConfig.flags == 0))) { + throw new Error(''); + } + if ((!(consensusConfig.round_candidates >= 1))) { + throw new Error(''); + } + }) - storeVmCont(vmCont.body)(cell1) + } + if ((consensusConfig.kind == 'ConsensusConfig_consensus_config_v4')) { + return ((builder: Builder) => { + builder.storeUint(0xd9, 8); + builder.storeUint(consensusConfig.flags, 7); + storeBool(consensusConfig.new_catchain_ids)(builder); + builder.storeUint(consensusConfig.round_candidates, 8); + builder.storeUint(consensusConfig.next_candidate_delay_ms, 32); + builder.storeUint(consensusConfig.consensus_timeout_ms, 32); + builder.storeUint(consensusConfig.fast_attempts, 32); + builder.storeUint(consensusConfig.attempt_duration, 32); + builder.storeUint(consensusConfig.catchain_max_deps, 32); + builder.storeUint(consensusConfig.max_block_bytes, 32); + builder.storeUint(consensusConfig.max_collated_bytes, 32); + builder.storeUint(consensusConfig.proto_version, 16); + builder.storeUint(consensusConfig.catchain_max_blocks_coeff, 32); + if ((!(consensusConfig.flags == 0))) { + throw new Error(''); + } + if ((!(consensusConfig.round_candidates >= 1))) { + throw new Error(''); + } + }) - builder.storeRef(cell1) + } + throw new Error(''); +} - let cell2 = beginCell() +export function loadValidatorTempKey(slice: Slice): ValidatorTempKey { + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0x3))) { + slice.loadUint(4); + let adnl_addr: BitString = slice.loadBits(256); + let temp_public_key: SigPubKey = loadSigPubKey(slice); + let seqno: number = slice.loadUint(32); + let valid_until: number = slice.loadUint(32); + return { + kind: 'ValidatorTempKey', + adnl_addr: adnl_addr, + temp_public_key: temp_public_key, + seqno: seqno, + valid_until: valid_until, + } + } + throw new Error(''); +} - storeVmCont(vmCont.after)(cell2) +export function storeValidatorTempKey(validatorTempKey: ValidatorTempKey): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x3, 4); + builder.storeBits(validatorTempKey.adnl_addr); + storeSigPubKey(validatorTempKey.temp_public_key)(builder); + builder.storeUint(validatorTempKey.seqno, 32); + builder.storeUint(validatorTempKey.valid_until, 32); + }) - builder.storeRef(cell2) +} -}) +export function loadValidatorSignedTempKey(slice: Slice): ValidatorSignedTempKey { + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0x4))) { + slice.loadUint(4); + let slice1 = slice.loadRef().beginParse(); + let key: ValidatorTempKey = loadValidatorTempKey(slice1); + let signature: CryptoSignature = loadCryptoSignature(slice); + return { + kind: 'ValidatorSignedTempKey', + key: key, + signature: signature, + } + } + throw new Error(''); } -; - if ((vmCont.kind == 'VmCont_vmc_again')) { + +export function storeValidatorSignedTempKey(validatorSignedTempKey: ValidatorSignedTempKey): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0b110001, 6) + builder.storeUint(0x4, 4); + let cell1 = beginCell(); + storeValidatorTempKey(validatorSignedTempKey.key)(cell1); + builder.storeRef(cell1); + storeCryptoSignature(validatorSignedTempKey.signature)(builder); + }) + +} - let cell1 = beginCell() +export function loadMisbehaviourPunishmentConfig(slice: Slice): MisbehaviourPunishmentConfig { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x01))) { + slice.loadUint(8); + let default_flat_fine: Grams = loadGrams(slice); + let default_proportional_fine: number = slice.loadUint(32); + let severity_flat_mult: number = slice.loadUint(16); + let severity_proportional_mult: number = slice.loadUint(16); + let unpunishable_interval: number = slice.loadUint(16); + let long_interval: number = slice.loadUint(16); + let long_flat_mult: number = slice.loadUint(16); + let long_proportional_mult: number = slice.loadUint(16); + let medium_interval: number = slice.loadUint(16); + let medium_flat_mult: number = slice.loadUint(16); + let medium_proportional_mult: number = slice.loadUint(16); + return { + kind: 'MisbehaviourPunishmentConfig', + default_flat_fine: default_flat_fine, + default_proportional_fine: default_proportional_fine, + severity_flat_mult: severity_flat_mult, + severity_proportional_mult: severity_proportional_mult, + unpunishable_interval: unpunishable_interval, + long_interval: long_interval, + long_flat_mult: long_flat_mult, + long_proportional_mult: long_proportional_mult, + medium_interval: medium_interval, + medium_flat_mult: medium_flat_mult, + medium_proportional_mult: medium_proportional_mult, + } + } + throw new Error(''); +} - storeVmCont(vmCont.body)(cell1) +export function storeMisbehaviourPunishmentConfig(misbehaviourPunishmentConfig: MisbehaviourPunishmentConfig): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x01, 8); + storeGrams(misbehaviourPunishmentConfig.default_flat_fine)(builder); + builder.storeUint(misbehaviourPunishmentConfig.default_proportional_fine, 32); + builder.storeUint(misbehaviourPunishmentConfig.severity_flat_mult, 16); + builder.storeUint(misbehaviourPunishmentConfig.severity_proportional_mult, 16); + builder.storeUint(misbehaviourPunishmentConfig.unpunishable_interval, 16); + builder.storeUint(misbehaviourPunishmentConfig.long_interval, 16); + builder.storeUint(misbehaviourPunishmentConfig.long_flat_mult, 16); + builder.storeUint(misbehaviourPunishmentConfig.long_proportional_mult, 16); + builder.storeUint(misbehaviourPunishmentConfig.medium_interval, 16); + builder.storeUint(misbehaviourPunishmentConfig.medium_flat_mult, 16); + builder.storeUint(misbehaviourPunishmentConfig.medium_proportional_mult, 16); + }) - builder.storeRef(cell1) +} +export function loadOracleBridgeParams(slice: Slice): OracleBridgeParams { + let bridge_address: BitString = slice.loadBits(256); + let oracle_mutlisig_address: BitString = slice.loadBits(256); + let oracles: HashmapE = loadHashmapE(slice, 256, ((slice: Slice) => { + return slice.loadUint(256) }) +); + let external_chain_address: BitString = slice.loadBits(256); + return { + kind: 'OracleBridgeParams', + bridge_address: bridge_address, + oracle_mutlisig_address: oracle_mutlisig_address, + oracles: oracles, + external_chain_address: external_chain_address, + } } -; - if ((vmCont.kind == 'VmCont_vmc_while_cond')) { - return ((builder: Builder) => { - builder.storeUint(0b110010, 6) - - let cell1 = beginCell() +export function storeOracleBridgeParams(oracleBridgeParams: OracleBridgeParams): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeBits(oracleBridgeParams.bridge_address); + builder.storeBits(oracleBridgeParams.oracle_mutlisig_address); + storeHashmapE(oracleBridgeParams.oracles, ((arg: number) => { + return ((builder: Builder) => { + builder.storeUint(arg, 256); + }) - storeVmCont(vmCont.cond)(cell1) + }) + )(builder); + builder.storeBits(oracleBridgeParams.external_chain_address); + }) - builder.storeRef(cell1) +} - let cell2 = beginCell() +export function loadBlockSignaturesPure(slice: Slice): BlockSignaturesPure { + let sig_count: number = slice.loadUint(32); + let sig_weight: number = slice.loadUint(64); + let signatures: HashmapE = loadHashmapE(slice, 16, loadCryptoSignaturePair); + return { + kind: 'BlockSignaturesPure', + sig_count: sig_count, + sig_weight: sig_weight, + signatures: signatures, + } +} - storeVmCont(vmCont.body)(cell2) +export function storeBlockSignaturesPure(blockSignaturesPure: BlockSignaturesPure): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(blockSignaturesPure.sig_count, 32); + builder.storeUint(blockSignaturesPure.sig_weight, 64); + storeHashmapE(blockSignaturesPure.signatures, storeCryptoSignaturePair)(builder); + }) - builder.storeRef(cell2) +} - let cell3 = beginCell() +export function loadBlockSignatures(slice: Slice): BlockSignatures { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x11))) { + slice.loadUint(8); + let validator_info: ValidatorBaseInfo = loadValidatorBaseInfo(slice); + let pure_signatures: BlockSignaturesPure = loadBlockSignaturesPure(slice); + return { + kind: 'BlockSignatures', + validator_info: validator_info, + pure_signatures: pure_signatures, + } + } + throw new Error(''); +} - storeVmCont(vmCont.after)(cell3) +export function storeBlockSignatures(blockSignatures: BlockSignatures): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x11, 8); + storeValidatorBaseInfo(blockSignatures.validator_info)(builder); + storeBlockSignaturesPure(blockSignatures.pure_signatures)(builder); + }) - builder.storeRef(cell3) +} +export function loadBlockProof(slice: Slice): BlockProof { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xc3))) { + slice.loadUint(8); + let proof_for: BlockIdExt = loadBlockIdExt(slice); + let slice1 = slice.loadRef().beginParse(); + let root: Slice = slice1; + let signatures: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse(); + return loadBlockSignatures(slice1) }) +); + return { + kind: 'BlockProof', + proof_for: proof_for, + root: root, + signatures: signatures, + } + } + throw new Error(''); } -; - if ((vmCont.kind == 'VmCont_vmc_while_body')) { + +export function storeBlockProof(blockProof: BlockProof): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0b110011, 6) + builder.storeUint(0xc3, 8); + storeBlockIdExt(blockProof.proof_for)(builder); + let cell1 = beginCell(); + cell1.storeSlice(blockProof.root); + builder.storeRef(cell1); + storeMaybe(blockProof.signatures, ((arg: BlockSignatures) => { + return ((builder: Builder) => { + let cell1 = beginCell(); + + storeBlockSignatures(arg)(cell1); - let cell1 = beginCell() + builder.storeRef(cell1); + + }) + }) + )(builder); + }) - storeVmCont(vmCont.cond)(cell1) +} - builder.storeRef(cell1) +export function loadProofChain(slice: Slice, arg0: number): ProofChain { + if ((arg0 == 0)) { + return { + kind: 'ProofChain_chain_empty', + } - let cell2 = beginCell() + } + if (true) { + let slice1 = slice.loadRef().beginParse(); + let root: Slice = slice1; + let prev: ProofChain | undefined = ((arg0 - 1) ? ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse(); + return loadProofChain(slice1, (arg0 - 1)) +}) +(slice) : undefined); + return { + kind: 'ProofChain_chain_link', + n: (arg0 - 1), + root: root, + prev: prev, + } + } + throw new Error(''); +} - storeVmCont(vmCont.body)(cell2) +export function storeProofChain(proofChain: ProofChain): (builder: Builder) => void { + if ((proofChain.kind == 'ProofChain_chain_empty')) { + return ((builder: Builder) => { + }) - builder.storeRef(cell2) + } + if ((proofChain.kind == 'ProofChain_chain_link')) { + return ((builder: Builder) => { + let cell1 = beginCell(); + cell1.storeSlice(proofChain.root); + builder.storeRef(cell1); + if ((proofChain.prev != undefined)) { + let cell1 = beginCell(); - let cell3 = beginCell() + storeProofChain(proofChain.prev)(cell1); + builder.storeRef(cell1); - storeVmCont(vmCont.after)(cell3) + } + }) - builder.storeRef(cell3) + } + throw new Error(''); +} +export function loadTopBlockDescr(slice: Slice): TopBlockDescr { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xd5))) { + slice.loadUint(8); + let proof_for: BlockIdExt = loadBlockIdExt(slice); + let signatures: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse(); + return loadBlockSignatures(slice1) }) +); + let len: number = slice.loadUint(8); + let chain: ProofChain = loadProofChain(slice, len); + if ((!(len >= 1))) { + throw new Error(''); + } + if ((!(len <= 8))) { + throw new Error(''); + } + return { + kind: 'TopBlockDescr', + proof_for: proof_for, + signatures: signatures, + len: len, + chain: chain, + } + } + throw new Error(''); } -; - if ((vmCont.kind == 'VmCont_vmc_pushint')) { - return ((builder: Builder) => { - builder.storeUint(0b1111, 4) - - builder.storeInt(vmCont.value, 32) - let cell1 = beginCell() +export function storeTopBlockDescr(topBlockDescr: TopBlockDescr): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xd5, 8); + storeBlockIdExt(topBlockDescr.proof_for)(builder); + storeMaybe(topBlockDescr.signatures, ((arg: BlockSignatures) => { + return ((builder: Builder) => { + let cell1 = beginCell(); + storeBlockSignatures(arg)(cell1); - storeVmCont(vmCont.next)(cell1) + builder.storeRef(cell1); - builder.storeRef(cell1) + }) -}) + }) + )(builder); + builder.storeUint(topBlockDescr.len, 8); + storeProofChain(topBlockDescr.chain)(builder); + if ((!(topBlockDescr.len >= 1))) { + throw new Error(''); + } + if ((!(topBlockDescr.len <= 8))) { + throw new Error(''); + } + }) -} -; - throw new Error('') -; } -export function loadDNS_RecordSet(slice: Slice): DNS_RecordSet { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xafbffed3))) { - slice.loadUint(32) - let anon0: HashmapE = loadHashmapE(slice, 256, loadDNSRecord) - - return { - kind: 'DNS_RecordSet', - anon0: anon0, -} +export function loadTopBlockDescrSet(slice: Slice): TopBlockDescrSet { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x4ac789f3))) { + slice.loadUint(32); + let collection: HashmapE = loadHashmapE(slice, 96, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse(); + return loadTopBlockDescr(slice1) +}) +); + return { + kind: 'TopBlockDescrSet', + collection: collection, + } -} -; - throw new Error('') -; + } + throw new Error(''); } -export function storeDNS_RecordSet(dNS_RecordSet: DNS_RecordSet): (builder: Builder) => void { +export function storeTopBlockDescrSet(topBlockDescrSet: TopBlockDescrSet): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xafbffed3, 32) + builder.storeUint(0x4ac789f3, 32); + storeHashmapE(topBlockDescrSet.collection, ((arg: TopBlockDescr) => { + return ((builder: Builder) => { + let cell1 = beginCell(); - storeHashmapE(dNS_RecordSet.anon0, storeDNSRecord)(builder) + storeTopBlockDescr(arg)(cell1); -}) + builder.storeRef(cell1); -; -} + }) -export function loadTextChunkRef(slice: Slice, arg0: number): TextChunkRef { - if ((arg0 == 0)) { - return { - kind: 'TextChunkRef_chunk_ref_empty', -} + }) + )(builder); + }) } -; - if (true) { - let slice1 = slice.loadRef().beginParse() - let ref: TextChunks = loadTextChunks(slice1, ((arg0 - 1) + 1)) - - return { - kind: 'TextChunkRef_chunk_ref', - n: (arg0 - 1), - ref: ref, -} +export function loadProducerInfo(slice: Slice): ProducerInfo { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x34))) { + slice.loadUint(8); + let utime: number = slice.loadUint(32); + let mc_blk_ref: ExtBlkRef = loadExtBlkRef(slice); + let slice1 = slice.loadRef().beginParse(); + let state_proof: MERKLE_PROOF = loadMERKLE_PROOF(slice1, loadBlock); + let slice2 = slice.loadRef().beginParse(); + let prod_proof: MERKLE_PROOF = loadMERKLE_PROOF(slice2, loadShardState); + return { + kind: 'ProducerInfo', + utime: utime, + mc_blk_ref: mc_blk_ref, + state_proof: state_proof, + prod_proof: prod_proof, + } -} -; - throw new Error('') -; + } + throw new Error(''); } -export function storeTextChunkRef(textChunkRef: TextChunkRef): (builder: Builder) => void { - if ((textChunkRef.kind == 'TextChunkRef_chunk_ref_empty')) { +export function storeProducerInfo(producerInfo: ProducerInfo): (builder: Builder) => void { return ((builder: Builder) => { -}) + builder.storeUint(0x34, 8); + builder.storeUint(producerInfo.utime, 32); + storeExtBlkRef(producerInfo.mc_blk_ref)(builder); + let cell1 = beginCell(); + storeMERKLE_PROOF(producerInfo.state_proof, storeBlock)(cell1); + builder.storeRef(cell1); + let cell2 = beginCell(); + storeMERKLE_PROOF(producerInfo.prod_proof, storeShardState)(cell2); + builder.storeRef(cell2); + }) } -; - if ((textChunkRef.kind == 'TextChunkRef_chunk_ref')) { - return ((builder: Builder) => { - let cell1 = beginCell() - - - storeTextChunks(textChunkRef.ref)(cell1) - builder.storeRef(cell1) - -}) - -} -; - throw new Error('') -; -} +export function loadComplaintDescr(slice: Slice): ComplaintDescr { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x9c436252))) { + slice.loadUint(32); + let from_utime: number = slice.loadUint(32); + let slice1 = slice.loadRef().beginParse(); + let prod_info: ProducerInfo = loadProducerInfo(slice1); + return { + kind: 'ComplaintDescr_no_blk_gen', + from_utime: from_utime, + prod_info: prod_info, + } -export function loadTextChunks(slice: Slice, arg0: number): TextChunks { - if ((arg0 == 0)) { - return { - kind: 'TextChunks_text_chunk_empty', -} + } + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x987f1ab7))) { + slice.loadUint(32); + let slice1 = slice.loadRef().beginParse(); + let prod_info_old: ProducerInfo = loadProducerInfo(slice1); + let slice2 = slice.loadRef().beginParse(); + let prod_info_new: ProducerInfo = loadProducerInfo(slice2); + return { + kind: 'ComplaintDescr_no_blk_gen_diff', + prod_info_old: prod_info_old, + prod_info_new: prod_info_new, + } + } + throw new Error(''); } -; - if (true) { - let len: number = slice.loadUint(8) - let data: BitString = slice.loadBits((len * 8)) +export function storeComplaintDescr(complaintDescr: ComplaintDescr): (builder: Builder) => void { + if ((complaintDescr.kind == 'ComplaintDescr_no_blk_gen')) { + return ((builder: Builder) => { + builder.storeUint(0x9c436252, 32); + builder.storeUint(complaintDescr.from_utime, 32); + let cell1 = beginCell(); + storeProducerInfo(complaintDescr.prod_info)(cell1); + builder.storeRef(cell1); + }) - let next: TextChunkRef = loadTextChunkRef(slice, (arg0 - 1)) + } + if ((complaintDescr.kind == 'ComplaintDescr_no_blk_gen_diff')) { + return ((builder: Builder) => { + builder.storeUint(0x987f1ab7, 32); + let cell1 = beginCell(); + storeProducerInfo(complaintDescr.prod_info_old)(cell1); + builder.storeRef(cell1); + let cell2 = beginCell(); + storeProducerInfo(complaintDescr.prod_info_new)(cell2); + builder.storeRef(cell2); + }) - return { - kind: 'TextChunks_text_chunk', - n: (arg0 - 1), - len: len, - data: data, - next: next, + } + throw new Error(''); } -} -; - throw new Error('') -; +export function loadValidatorComplaint(slice: Slice): ValidatorComplaint { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xbc))) { + slice.loadUint(8); + let validator_pubkey: BitString = slice.loadBits(256); + let slice1 = slice.loadRef().beginParse(); + let description: ComplaintDescr = loadComplaintDescr(slice1); + let created_at: number = slice.loadUint(32); + let severity: number = slice.loadUint(8); + let reward_addr: number = slice.loadUint(256); + let paid: Grams = loadGrams(slice); + let suggested_fine: Grams = loadGrams(slice); + let suggested_fine_part: number = slice.loadUint(32); + return { + kind: 'ValidatorComplaint', + validator_pubkey: validator_pubkey, + description: description, + created_at: created_at, + severity: severity, + reward_addr: reward_addr, + paid: paid, + suggested_fine: suggested_fine, + suggested_fine_part: suggested_fine_part, + } + + } + throw new Error(''); } -export function storeTextChunks(textChunks: TextChunks): (builder: Builder) => void { - if ((textChunks.kind == 'TextChunks_text_chunk_empty')) { +export function storeValidatorComplaint(validatorComplaint: ValidatorComplaint): (builder: Builder) => void { return ((builder: Builder) => { -}) + builder.storeUint(0xbc, 8); + builder.storeBits(validatorComplaint.validator_pubkey); + let cell1 = beginCell(); + storeComplaintDescr(validatorComplaint.description)(cell1); + builder.storeRef(cell1); + builder.storeUint(validatorComplaint.created_at, 32); + builder.storeUint(validatorComplaint.severity, 8); + builder.storeUint(validatorComplaint.reward_addr, 256); + storeGrams(validatorComplaint.paid)(builder); + storeGrams(validatorComplaint.suggested_fine)(builder); + builder.storeUint(validatorComplaint.suggested_fine_part, 32); + }) } -; - if ((textChunks.kind == 'TextChunks_text_chunk')) { - return ((builder: Builder) => { - builder.storeUint(textChunks.len, 8) - builder.storeBits(textChunks.data) +export function loadValidatorComplaintStatus(slice: Slice): ValidatorComplaintStatus { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x2d))) { + slice.loadUint(8); + let slice1 = slice.loadRef().beginParse(); + let complaint: ValidatorComplaint = loadValidatorComplaint(slice1); + let voters: HashmapE = loadHashmapE(slice, 16, loadTrue); + let vset_id: number = slice.loadUint(256); + let weight_remaining: number = slice.loadInt(64); + return { + kind: 'ValidatorComplaintStatus', + complaint: complaint, + voters: voters, + vset_id: vset_id, + weight_remaining: weight_remaining, + } - storeTextChunkRef(textChunks.next)(builder) + } + throw new Error(''); +} -}) +export function storeValidatorComplaintStatus(validatorComplaintStatus: ValidatorComplaintStatus): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x2d, 8); + let cell1 = beginCell(); + storeValidatorComplaint(validatorComplaintStatus.complaint)(cell1); + builder.storeRef(cell1); + storeHashmapE(validatorComplaintStatus.voters, storeTrue)(builder); + builder.storeUint(validatorComplaintStatus.vset_id, 256); + builder.storeInt(validatorComplaintStatus.weight_remaining, 64); + }) -} -; - throw new Error('') -; } -export function loadText(slice: Slice): Text { - let chunks: number = slice.loadUint(8) +export function loadVmStackValue(slice: Slice): VmStackValue { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x00))) { + slice.loadUint(8); + return { + kind: 'VmStackValue_vm_stk_null', + } -; - let rest: TextChunks = loadTextChunks(slice, chunks) + } + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x01))) { + slice.loadUint(8); + let value: number = slice.loadInt(64); + return { + kind: 'VmStackValue_vm_stk_tinyint', + value: value, + } -; - return { - kind: 'Text', - chunks: chunks, - rest: rest, -} + } + if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x0201))) { + slice.loadUint(16); + let value: number = slice.loadInt(257); + return { + kind: 'VmStackValue_vm_stk_int', + value: value, + } -; -} + } + if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x02ff))) { + slice.loadUint(16); + return { + kind: 'VmStackValue_vm_stk_nan', + } -export function storeText(text: Text): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(text.chunks, 8) + } + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x03))) { + slice.loadUint(8); + let slice1 = slice.loadRef().beginParse(); + let _cell: Slice = slice1; + return { + kind: 'VmStackValue_vm_stk_cell', + _cell: _cell, + } - storeTextChunks(text.rest)(builder) + } + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x04))) { + slice.loadUint(8); + let _: VmCellSlice = loadVmCellSlice(slice); + return { + kind: 'VmStackValue_vm_stk_slice', + _: _, + } -}) + } + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x05))) { + slice.loadUint(8); + let slice1 = slice.loadRef().beginParse(); + let _cell: Slice = slice1; + return { + kind: 'VmStackValue_vm_stk_builder', + _cell: _cell, + } -; -} + } + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x06))) { + slice.loadUint(8); + let cont: VmCont = loadVmCont(slice); + return { + kind: 'VmStackValue_vm_stk_cont', + cont: cont, + } -export function loadDNSRecord(slice: Slice): DNSRecord { - if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x1eda))) { - slice.loadUint(16) - let _: Text = loadText(slice) + } + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x07))) { + slice.loadUint(8); + let len: number = slice.loadUint(16); + let data: VmTuple = loadVmTuple(slice, len); + return { + kind: 'VmStackValue_vm_stk_tuple', + len: len, + data: data, + } - return { - kind: 'DNSRecord_dns_text', - _: _, + } + throw new Error(''); } -} -; - if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0xba93))) { - slice.loadUint(16) - let resolver: MsgAddressInt = loadMsgAddressInt(slice) +export function storeVmStackValue(vmStackValue: VmStackValue): (builder: Builder) => void { + if ((vmStackValue.kind == 'VmStackValue_vm_stk_null')) { + return ((builder: Builder) => { + builder.storeUint(0x00, 8); + }) - return { - kind: 'DNSRecord_dns_next_resolver', - resolver: resolver, -} + } + if ((vmStackValue.kind == 'VmStackValue_vm_stk_tinyint')) { + return ((builder: Builder) => { + builder.storeUint(0x01, 8); + builder.storeInt(vmStackValue.value, 64); + }) -} -; - if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0xad01))) { - slice.loadUint(16) - let adnl_addr: BitString = slice.loadBits(256) + } + if ((vmStackValue.kind == 'VmStackValue_vm_stk_int')) { + return ((builder: Builder) => { + builder.storeUint(0x0201, 16); + builder.storeInt(vmStackValue.value, 257); + }) - let flags: number = slice.loadUint(8) + } + if ((vmStackValue.kind == 'VmStackValue_vm_stk_nan')) { + return ((builder: Builder) => { + builder.storeUint(0x02ff, 16); + }) - let proto_list: ProtoList | undefined = ((flags & (1 << 0)) ? loadProtoList(slice) : undefined) + } + if ((vmStackValue.kind == 'VmStackValue_vm_stk_cell')) { + return ((builder: Builder) => { + builder.storeUint(0x03, 8); + let cell1 = beginCell(); + cell1.storeSlice(vmStackValue._cell); + builder.storeRef(cell1); + }) - if ((!(flags <= 1))) { - throw new Error('') } - return { - kind: 'DNSRecord_dns_adnl_address', - adnl_addr: adnl_addr, - flags: flags, - proto_list: proto_list, -} + if ((vmStackValue.kind == 'VmStackValue_vm_stk_slice')) { + return ((builder: Builder) => { + builder.storeUint(0x04, 8); + storeVmCellSlice(vmStackValue._)(builder); + }) -} -; - if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x9fd3))) { - slice.loadUint(16) - let smc_addr: MsgAddressInt = loadMsgAddressInt(slice) + } + if ((vmStackValue.kind == 'VmStackValue_vm_stk_builder')) { + return ((builder: Builder) => { + builder.storeUint(0x05, 8); + let cell1 = beginCell(); + cell1.storeSlice(vmStackValue._cell); + builder.storeRef(cell1); + }) - let flags: number = slice.loadUint(8) + } + if ((vmStackValue.kind == 'VmStackValue_vm_stk_cont')) { + return ((builder: Builder) => { + builder.storeUint(0x06, 8); + storeVmCont(vmStackValue.cont)(builder); + }) - let cap_list: SmcCapList | undefined = ((flags & (1 << 0)) ? loadSmcCapList(slice) : undefined) + } + if ((vmStackValue.kind == 'VmStackValue_vm_stk_tuple')) { + return ((builder: Builder) => { + builder.storeUint(0x07, 8); + builder.storeUint(vmStackValue.len, 16); + storeVmTuple(vmStackValue.data)(builder); + }) - if ((!(flags <= 1))) { - throw new Error('') } - return { - kind: 'DNSRecord_dns_smc_address', - smc_addr: smc_addr, - flags: flags, - cap_list: cap_list, + throw new Error(''); } -} -; - throw new Error('') -; +export function loadVmCellSlice(slice: Slice): VmCellSlice { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xd6a63245))) { + slice.loadUint(32); + let slice1 = slice.loadRef().beginParse(); + let _cell: Slice = slice1; + let st_bits: number = slice.loadUint(10); + let end_bits: number = slice.loadUint(10); + let st_ref: number = slice.loadUint(bitLen(4)); + let end_ref: number = slice.loadUint(bitLen(4)); + if ((!(st_bits <= end_bits))) { + throw new Error(''); + } + if ((!(st_ref <= end_ref))) { + throw new Error(''); + } + return { + kind: 'VmCellSlice', + _cell: _cell, + st_bits: st_bits, + end_bits: end_bits, + st_ref: st_ref, + end_ref: end_ref, + } + + } + throw new Error(''); } -export function storeDNSRecord(dNSRecord: DNSRecord): (builder: Builder) => void { - if ((dNSRecord.kind == 'DNSRecord_dns_text')) { +export function storeVmCellSlice(vmCellSlice: VmCellSlice): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0x1eda, 16) - - storeText(dNSRecord._)(builder) - -}) + builder.storeUint(0xd6a63245, 32); + let cell1 = beginCell(); + cell1.storeSlice(vmCellSlice._cell); + builder.storeRef(cell1); + builder.storeUint(vmCellSlice.st_bits, 10); + builder.storeUint(vmCellSlice.end_bits, 10); + builder.storeUint(vmCellSlice.st_ref, bitLen(4)); + builder.storeUint(vmCellSlice.end_ref, bitLen(4)); + if ((!(vmCellSlice.st_bits <= vmCellSlice.end_bits))) { + throw new Error(''); + } + if ((!(vmCellSlice.st_ref <= vmCellSlice.end_ref))) { + throw new Error(''); + } + }) } -; - if ((dNSRecord.kind == 'DNSRecord_dns_next_resolver')) { - return ((builder: Builder) => { - builder.storeUint(0xba93, 16) - storeMsgAddressInt(dNSRecord.resolver)(builder) +export function loadVmTupleRef(slice: Slice, arg0: number): VmTupleRef { + if ((arg0 == 0)) { + return { + kind: 'VmTupleRef_vm_tupref_nil', + } -}) + } + if ((arg0 == 1)) { + let slice1 = slice.loadRef().beginParse(); + let entry: VmStackValue = loadVmStackValue(slice1); + return { + kind: 'VmTupleRef_vm_tupref_single', + entry: entry, + } -} -; - if ((dNSRecord.kind == 'DNSRecord_dns_adnl_address')) { - return ((builder: Builder) => { - builder.storeUint(0xad01, 16) + } + if (true) { + let slice1 = slice.loadRef().beginParse(); + let ref: VmTuple = loadVmTuple(slice1, ((arg0 - 2) + 2)); + return { + kind: 'VmTupleRef_vm_tupref_any', + n: (arg0 - 2), + ref: ref, + } - builder.storeBits(dNSRecord.adnl_addr) + } + throw new Error(''); +} - builder.storeUint(dNSRecord.flags, 8) +export function storeVmTupleRef(vmTupleRef: VmTupleRef): (builder: Builder) => void { + if ((vmTupleRef.kind == 'VmTupleRef_vm_tupref_nil')) { + return ((builder: Builder) => { + }) - if ((dNSRecord.proto_list != undefined)) { - storeProtoList(dNSRecord.proto_list)(builder) } + if ((vmTupleRef.kind == 'VmTupleRef_vm_tupref_single')) { + return ((builder: Builder) => { + let cell1 = beginCell(); + storeVmStackValue(vmTupleRef.entry)(cell1); + builder.storeRef(cell1); + }) - if ((!(dNSRecord.flags <= 1))) { - throw new Error('') } + if ((vmTupleRef.kind == 'VmTupleRef_vm_tupref_any')) { + return ((builder: Builder) => { + let cell1 = beginCell(); + storeVmTuple(vmTupleRef.ref)(cell1); + builder.storeRef(cell1); + }) -}) - + } + throw new Error(''); } -; - if ((dNSRecord.kind == 'DNSRecord_dns_smc_address')) { - return ((builder: Builder) => { - builder.storeUint(0x9fd3, 16) - - storeMsgAddressInt(dNSRecord.smc_addr)(builder) - builder.storeUint(dNSRecord.flags, 8) +export function loadVmTuple(slice: Slice, arg0: number): VmTuple { + if ((arg0 == 0)) { + return { + kind: 'VmTuple_vm_tuple_nil', + } - if ((dNSRecord.cap_list != undefined)) { - storeSmcCapList(dNSRecord.cap_list)(builder) } + if (true) { + let head: VmTupleRef = loadVmTupleRef(slice, (arg0 - 1)); + let slice1 = slice.loadRef().beginParse(); + let tail: VmStackValue = loadVmStackValue(slice1); + return { + kind: 'VmTuple_vm_tuple_tcons', + n: (arg0 - 1), + head: head, + tail: tail, + } - if ((!(dNSRecord.flags <= 1))) { - throw new Error('') } - -}) - -} -; - throw new Error('') -; + throw new Error(''); } -export function loadProtoList(slice: Slice): ProtoList { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1) - return { - kind: 'ProtoList_proto_list_nil', -} +export function storeVmTuple(vmTuple: VmTuple): (builder: Builder) => void { + if ((vmTuple.kind == 'VmTuple_vm_tuple_nil')) { + return ((builder: Builder) => { + }) -} -; - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1) - let head: Protocol = loadProtocol(slice) + } + if ((vmTuple.kind == 'VmTuple_vm_tuple_tcons')) { + return ((builder: Builder) => { + storeVmTupleRef(vmTuple.head)(builder); + let cell1 = beginCell(); + storeVmStackValue(vmTuple.tail)(cell1); + builder.storeRef(cell1); + }) - let tail: ProtoList = loadProtoList(slice) + } + throw new Error(''); +} +export function loadVmStack(slice: Slice): VmStack { + let depth: number = slice.loadUint(24); + let stack: VmStackList = loadVmStackList(slice, depth); return { - kind: 'ProtoList_proto_list_next', - head: head, - tail: tail, -} + kind: 'VmStack', + depth: depth, + stack: stack, + } -} -; - throw new Error('') -; } -export function storeProtoList(protoList: ProtoList): (builder: Builder) => void { - if ((protoList.kind == 'ProtoList_proto_list_nil')) { +export function storeVmStack(vmStack: VmStack): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0b0, 1) - -}) + builder.storeUint(vmStack.depth, 24); + storeVmStackList(vmStack.stack)(builder); + }) } -; - if ((protoList.kind == 'ProtoList_proto_list_next')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1) - - storeProtocol(protoList.head)(builder) - storeProtoList(protoList.tail)(builder) - -}) - -} -; - throw new Error('') -; -} +export function loadVmStackList(slice: Slice, arg0: number): VmStackList { + if ((arg0 == 0)) { + return { + kind: 'VmStackList_vm_stk_nil', + } -export function loadProtocol(slice: Slice): Protocol { - if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x4854))) { - slice.loadUint(16) - return { - kind: 'Protocol', -} + } + if (true) { + let slice1 = slice.loadRef().beginParse(); + let rest: VmStackList = loadVmStackList(slice1, (arg0 - 1)); + let tos: VmStackValue = loadVmStackValue(slice); + return { + kind: 'VmStackList_vm_stk_cons', + n: (arg0 - 1), + rest: rest, + tos: tos, + } -} -; - throw new Error('') -; + } + throw new Error(''); } -export function storeProtocol(protocol: Protocol): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x4854, 16) +export function storeVmStackList(vmStackList: VmStackList): (builder: Builder) => void { + if ((vmStackList.kind == 'VmStackList_vm_stk_nil')) { + return ((builder: Builder) => { + }) -}) + } + if ((vmStackList.kind == 'VmStackList_vm_stk_cons')) { + return ((builder: Builder) => { + let cell1 = beginCell(); + storeVmStackList(vmStackList.rest)(cell1); + builder.storeRef(cell1); + storeVmStackValue(vmStackList.tos)(builder); + }) -; + } + throw new Error(''); } -export function loadSmcCapList(slice: Slice): SmcCapList { - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1) - return { - kind: 'SmcCapList_cap_list_nil', -} +export function loadVmSaveList(slice: Slice): VmSaveList { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xeed28f11))) { + slice.loadUint(32); + let cregs: HashmapE = loadHashmapE(slice, 4, loadVmStackValue); + return { + kind: 'VmSaveList', + cregs: cregs, + } + } + throw new Error(''); } -; - if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1) - let head: SmcCapability = loadSmcCapability(slice) - let tail: SmcCapList = loadSmcCapList(slice) +export function storeVmSaveList(vmSaveList: VmSaveList): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0xeed28f11, 32); + storeHashmapE(vmSaveList.cregs, storeVmStackValue)(builder); + }) - return { - kind: 'SmcCapList_cap_list_next', - head: head, - tail: tail, } -} -; - throw new Error('') -; +export function loadVmGasLimits(slice: Slice): VmGasLimits { + let remaining: number = slice.loadInt(64); + let slice1 = slice.loadRef().beginParse(); + let max_limit: number = slice1.loadInt(64); + let cur_limit: number = slice1.loadInt(64); + let credit: number = slice1.loadInt(64); + return { + kind: 'VmGasLimits', + remaining: remaining, + max_limit: max_limit, + cur_limit: cur_limit, + credit: credit, + } + } -export function storeSmcCapList(smcCapList: SmcCapList): (builder: Builder) => void { - if ((smcCapList.kind == 'SmcCapList_cap_list_nil')) { +export function storeVmGasLimits(vmGasLimits: VmGasLimits): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0b0, 1) + builder.storeInt(vmGasLimits.remaining, 64); + let cell1 = beginCell(); + cell1.storeInt(vmGasLimits.max_limit, 64); + cell1.storeInt(vmGasLimits.cur_limit, 64); + cell1.storeInt(vmGasLimits.credit, 64); + builder.storeRef(cell1); + }) + +} +export function loadVmLibraries(slice: Slice): VmLibraries { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xe9be85ef))) { + slice.loadUint(32); + let libraries: HashmapE = loadHashmapE(slice, 256, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse(); + return slice1 }) +); + return { + kind: 'VmLibraries', + libraries: libraries, + } + } + throw new Error(''); } -; - if ((smcCapList.kind == 'SmcCapList_cap_list_next')) { + +export function storeVmLibraries(vmLibraries: VmLibraries): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0b1, 1) + builder.storeUint(0xe9be85ef, 32); + storeHashmapE(vmLibraries.libraries, ((arg: Slice) => { + return ((builder: Builder) => { + let cell1 = beginCell(); - storeSmcCapability(smcCapList.head)(builder) + cell1.storeSlice(arg); - storeSmcCapList(smcCapList.tail)(builder) + builder.storeRef(cell1); -}) + }) -} -; - throw new Error('') -; -} + }) + )(builder); + }) -export function loadSmcCapability(slice: Slice): SmcCapability { - if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x5371))) { - slice.loadUint(16) - return { - kind: 'SmcCapability_cap_method_seqno', } -} -; - if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x71f4))) { - slice.loadUint(16) +export function loadVmControlData(slice: Slice): VmControlData { + let nargs: Maybe = loadMaybe(slice, ((slice: Slice) => { + return slice.loadUint(13) +}) +); + let stack: Maybe = loadMaybe(slice, loadVmStack); + let save: VmSaveList = loadVmSaveList(slice); + let cp: Maybe = loadMaybe(slice, ((slice: Slice) => { + return slice.loadInt(16) +}) +); return { - kind: 'SmcCapability_cap_method_pubkey', -} + kind: 'VmControlData', + nargs: nargs, + stack: stack, + save: save, + cp: cp, + } } -; - if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x2177))) { - slice.loadUint(16) - return { - kind: 'SmcCapability_cap_is_wallet', -} -} -; - if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xff))) { - slice.loadUint(8) - let name: Text = loadText(slice) +export function storeVmControlData(vmControlData: VmControlData): (builder: Builder) => void { + return ((builder: Builder) => { + storeMaybe(vmControlData.nargs, ((arg: number) => { + return ((builder: Builder) => { + builder.storeUint(arg, 13); + }) - return { - kind: 'SmcCapability_cap_name', - name: name, -} + }) + )(builder); + storeMaybe(vmControlData.stack, storeVmStack)(builder); + storeVmSaveList(vmControlData.save)(builder); + storeMaybe(vmControlData.cp, ((arg: number) => { + return ((builder: Builder) => { + builder.storeInt(arg, 16); + }) + + }) + )(builder); + }) -} -; - throw new Error('') -; } -export function storeSmcCapability(smcCapability: SmcCapability): (builder: Builder) => void { - if ((smcCapability.kind == 'SmcCapability_cap_method_seqno')) { - return ((builder: Builder) => { - builder.storeUint(0x5371, 16) +export function loadVmCont(slice: Slice): VmCont { + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { + slice.loadUint(2); + let cdata: VmControlData = loadVmControlData(slice); + let code: VmCellSlice = loadVmCellSlice(slice); + return { + kind: 'VmCont_vmc_std', + cdata: cdata, + code: code, + } -}) + } + if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b01))) { + slice.loadUint(2); + let cdata: VmControlData = loadVmControlData(slice); + let slice1 = slice.loadRef().beginParse(); + let next: VmCont = loadVmCont(slice1); + return { + kind: 'VmCont_vmc_envelope', + cdata: cdata, + next: next, + } -} -; - if ((smcCapability.kind == 'SmcCapability_cap_method_pubkey')) { - return ((builder: Builder) => { - builder.storeUint(0x71f4, 16) + } + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b1000))) { + slice.loadUint(4); + let exit_code: number = slice.loadInt(32); + return { + kind: 'VmCont_vmc_quit', + exit_code: exit_code, + } -}) + } + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b1001))) { + slice.loadUint(4); + return { + kind: 'VmCont_vmc_quit_exc', + } -} -; - if ((smcCapability.kind == 'SmcCapability_cap_is_wallet')) { - return ((builder: Builder) => { - builder.storeUint(0x2177, 16) + } + if (((slice.remainingBits >= 5) && (slice.preloadUint(5) == 0b10100))) { + slice.loadUint(5); + let count: number = slice.loadUint(63); + let slice1 = slice.loadRef().beginParse(); + let body: VmCont = loadVmCont(slice1); + let slice2 = slice.loadRef().beginParse(); + let after: VmCont = loadVmCont(slice2); + return { + kind: 'VmCont_vmc_repeat', + count: count, + body: body, + after: after, + } -}) + } + if (((slice.remainingBits >= 6) && (slice.preloadUint(6) == 0b110000))) { + slice.loadUint(6); + let slice1 = slice.loadRef().beginParse(); + let body: VmCont = loadVmCont(slice1); + let slice2 = slice.loadRef().beginParse(); + let after: VmCont = loadVmCont(slice2); + return { + kind: 'VmCont_vmc_until', + body: body, + after: after, + } -} -; - if ((smcCapability.kind == 'SmcCapability_cap_name')) { - return ((builder: Builder) => { - builder.storeUint(0xff, 8) + } + if (((slice.remainingBits >= 6) && (slice.preloadUint(6) == 0b110001))) { + slice.loadUint(6); + let slice1 = slice.loadRef().beginParse(); + let body: VmCont = loadVmCont(slice1); + return { + kind: 'VmCont_vmc_again', + body: body, + } - storeText(smcCapability.name)(builder) + } + if (((slice.remainingBits >= 6) && (slice.preloadUint(6) == 0b110010))) { + slice.loadUint(6); + let slice1 = slice.loadRef().beginParse(); + let cond: VmCont = loadVmCont(slice1); + let slice2 = slice.loadRef().beginParse(); + let body: VmCont = loadVmCont(slice2); + let slice3 = slice.loadRef().beginParse(); + let after: VmCont = loadVmCont(slice3); + return { + kind: 'VmCont_vmc_while_cond', + cond: cond, + body: body, + after: after, + } -}) + } + if (((slice.remainingBits >= 6) && (slice.preloadUint(6) == 0b110011))) { + slice.loadUint(6); + let slice1 = slice.loadRef().beginParse(); + let cond: VmCont = loadVmCont(slice1); + let slice2 = slice.loadRef().beginParse(); + let body: VmCont = loadVmCont(slice2); + let slice3 = slice.loadRef().beginParse(); + let after: VmCont = loadVmCont(slice3); + return { + kind: 'VmCont_vmc_while_body', + cond: cond, + body: body, + after: after, + } -} -; - throw new Error('') -; + } + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b1111))) { + slice.loadUint(4); + let value: number = slice.loadInt(32); + let slice1 = slice.loadRef().beginParse(); + let next: VmCont = loadVmCont(slice1); + return { + kind: 'VmCont_vmc_pushint', + value: value, + next: next, + } + + } + throw new Error(''); } -export function loadChanConfig(slice: Slice): ChanConfig { - let init_timeout: number = slice.loadUint(32) +export function storeVmCont(vmCont: VmCont): (builder: Builder) => void { + if ((vmCont.kind == 'VmCont_vmc_std')) { + return ((builder: Builder) => { + builder.storeUint(0b00, 2); + storeVmControlData(vmCont.cdata)(builder); + storeVmCellSlice(vmCont.code)(builder); + }) -; - let close_timeout: number = slice.loadUint(32) + } + if ((vmCont.kind == 'VmCont_vmc_envelope')) { + return ((builder: Builder) => { + builder.storeUint(0b01, 2); + storeVmControlData(vmCont.cdata)(builder); + let cell1 = beginCell(); + storeVmCont(vmCont.next)(cell1); + builder.storeRef(cell1); + }) -; - let a_key: BitString = slice.loadBits(256) + } + if ((vmCont.kind == 'VmCont_vmc_quit')) { + return ((builder: Builder) => { + builder.storeUint(0b1000, 4); + builder.storeInt(vmCont.exit_code, 32); + }) -; - let b_key: BitString = slice.loadBits(256) + } + if ((vmCont.kind == 'VmCont_vmc_quit_exc')) { + return ((builder: Builder) => { + builder.storeUint(0b1001, 4); + }) -; - let slice1 = slice.loadRef().beginParse() + } + if ((vmCont.kind == 'VmCont_vmc_repeat')) { + return ((builder: Builder) => { + builder.storeUint(0b10100, 5); + builder.storeUint(vmCont.count, 63); + let cell1 = beginCell(); + storeVmCont(vmCont.body)(cell1); + builder.storeRef(cell1); + let cell2 = beginCell(); + storeVmCont(vmCont.after)(cell2); + builder.storeRef(cell2); + }) -; - let a_addr: MsgAddressInt = loadMsgAddressInt(slice1) + } + if ((vmCont.kind == 'VmCont_vmc_until')) { + return ((builder: Builder) => { + builder.storeUint(0b110000, 6); + let cell1 = beginCell(); + storeVmCont(vmCont.body)(cell1); + builder.storeRef(cell1); + let cell2 = beginCell(); + storeVmCont(vmCont.after)(cell2); + builder.storeRef(cell2); + }) -; - let slice2 = slice.loadRef().beginParse() + } + if ((vmCont.kind == 'VmCont_vmc_again')) { + return ((builder: Builder) => { + builder.storeUint(0b110001, 6); + let cell1 = beginCell(); + storeVmCont(vmCont.body)(cell1); + builder.storeRef(cell1); + }) -; - let b_addr: MsgAddressInt = loadMsgAddressInt(slice2) + } + if ((vmCont.kind == 'VmCont_vmc_while_cond')) { + return ((builder: Builder) => { + builder.storeUint(0b110010, 6); + let cell1 = beginCell(); + storeVmCont(vmCont.cond)(cell1); + builder.storeRef(cell1); + let cell2 = beginCell(); + storeVmCont(vmCont.body)(cell2); + builder.storeRef(cell2); + let cell3 = beginCell(); + storeVmCont(vmCont.after)(cell3); + builder.storeRef(cell3); + }) -; - let channel_id: number = slice.loadUint(64) + } + if ((vmCont.kind == 'VmCont_vmc_while_body')) { + return ((builder: Builder) => { + builder.storeUint(0b110011, 6); + let cell1 = beginCell(); + storeVmCont(vmCont.cond)(cell1); + builder.storeRef(cell1); + let cell2 = beginCell(); + storeVmCont(vmCont.body)(cell2); + builder.storeRef(cell2); + let cell3 = beginCell(); + storeVmCont(vmCont.after)(cell3); + builder.storeRef(cell3); + }) -; - let min_A_extra: Grams = loadGrams(slice) + } + if ((vmCont.kind == 'VmCont_vmc_pushint')) { + return ((builder: Builder) => { + builder.storeUint(0b1111, 4); + builder.storeInt(vmCont.value, 32); + let cell1 = beginCell(); + storeVmCont(vmCont.next)(cell1); + builder.storeRef(cell1); + }) -; - return { - kind: 'ChanConfig', - init_timeout: init_timeout, - close_timeout: close_timeout, - a_key: a_key, - b_key: b_key, - a_addr: a_addr, - b_addr: b_addr, - channel_id: channel_id, - min_A_extra: min_A_extra, + } + throw new Error(''); } -; +export function loadDNS_RecordSet(slice: Slice): DNS_RecordSet { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xafbffed3))) { + slice.loadUint(32); + let anon0: HashmapE = loadHashmapE(slice, 256, loadDNSRecord); + return { + kind: 'DNS_RecordSet', + anon0: anon0, + } + + } + throw new Error(''); } -export function storeChanConfig(chanConfig: ChanConfig): (builder: Builder) => void { +export function storeDNS_RecordSet(dNS_RecordSet: DNS_RecordSet): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(chanConfig.init_timeout, 32) + builder.storeUint(0xafbffed3, 32); + storeHashmapE(dNS_RecordSet.anon0, storeDNSRecord)(builder); + }) + +} + +export function loadTextChunkRef(slice: Slice, arg0: number): TextChunkRef { + if ((arg0 == 0)) { + return { + kind: 'TextChunkRef_chunk_ref_empty', + } - builder.storeUint(chanConfig.close_timeout, 32) + } + if (true) { + let slice1 = slice.loadRef().beginParse(); + let ref: TextChunks = loadTextChunks(slice1, ((arg0 - 1) + 1)); + return { + kind: 'TextChunkRef_chunk_ref', + n: (arg0 - 1), + ref: ref, + } - builder.storeBits(chanConfig.a_key) + } + throw new Error(''); +} - builder.storeBits(chanConfig.b_key) +export function storeTextChunkRef(textChunkRef: TextChunkRef): (builder: Builder) => void { + if ((textChunkRef.kind == 'TextChunkRef_chunk_ref_empty')) { + return ((builder: Builder) => { + }) - let cell1 = beginCell() + } + if ((textChunkRef.kind == 'TextChunkRef_chunk_ref')) { + return ((builder: Builder) => { + let cell1 = beginCell(); + storeTextChunks(textChunkRef.ref)(cell1); + builder.storeRef(cell1); + }) + } + throw new Error(''); +} - storeMsgAddressInt(chanConfig.a_addr)(cell1) +export function loadTextChunks(slice: Slice, arg0: number): TextChunks { + if ((arg0 == 0)) { + return { + kind: 'TextChunks_text_chunk_empty', + } - builder.storeRef(cell1) + } + if (true) { + let len: number = slice.loadUint(8); + let data: BitString = slice.loadBits((len * 8)); + let next: TextChunkRef = loadTextChunkRef(slice, (arg0 - 1)); + return { + kind: 'TextChunks_text_chunk', + n: (arg0 - 1), + len: len, + data: data, + next: next, + } - let cell2 = beginCell() + } + throw new Error(''); +} +export function storeTextChunks(textChunks: TextChunks): (builder: Builder) => void { + if ((textChunks.kind == 'TextChunks_text_chunk_empty')) { + return ((builder: Builder) => { + }) - storeMsgAddressInt(chanConfig.b_addr)(cell2) + } + if ((textChunks.kind == 'TextChunks_text_chunk')) { + return ((builder: Builder) => { + builder.storeUint(textChunks.len, 8); + builder.storeBits(textChunks.data); + storeTextChunkRef(textChunks.next)(builder); + }) - builder.storeRef(cell2) + } + throw new Error(''); +} - builder.storeUint(chanConfig.channel_id, 64) +export function loadText(slice: Slice): Text { + let chunks: number = slice.loadUint(8); + let rest: TextChunks = loadTextChunks(slice, chunks); + return { + kind: 'Text', + chunks: chunks, + rest: rest, + } - storeGrams(chanConfig.min_A_extra)(builder) +} -}) +export function storeText(text: Text): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(text.chunks, 8); + storeTextChunks(text.rest)(builder); + }) -; } -export function loadChanState(slice: Slice): ChanState { - if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b000))) { - slice.loadUint(3) - let signed_A: Bool = loadBool(slice) +export function loadDNSRecord(slice: Slice): DNSRecord { + if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x1eda))) { + slice.loadUint(16); + let _: Text = loadText(slice); + return { + kind: 'DNSRecord_dns_text', + _: _, + } + + } + if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0xba93))) { + slice.loadUint(16); + let resolver: MsgAddressInt = loadMsgAddressInt(slice); + return { + kind: 'DNSRecord_dns_next_resolver', + resolver: resolver, + } - let signed_B: Bool = loadBool(slice) + } + if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0xad01))) { + slice.loadUint(16); + let adnl_addr: BitString = slice.loadBits(256); + let flags: number = slice.loadUint(8); + let proto_list: ProtoList | undefined = ((flags & (1 << 0)) ? loadProtoList(slice) : undefined); + if ((!(flags <= 1))) { + throw new Error(''); + } + return { + kind: 'DNSRecord_dns_adnl_address', + adnl_addr: adnl_addr, + flags: flags, + proto_list: proto_list, + } - let min_A: Grams = loadGrams(slice) + } + if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x9fd3))) { + slice.loadUint(16); + let smc_addr: MsgAddressInt = loadMsgAddressInt(slice); + let flags: number = slice.loadUint(8); + let cap_list: SmcCapList | undefined = ((flags & (1 << 0)) ? loadSmcCapList(slice) : undefined); + if ((!(flags <= 1))) { + throw new Error(''); + } + return { + kind: 'DNSRecord_dns_smc_address', + smc_addr: smc_addr, + flags: flags, + cap_list: cap_list, + } - let min_B: Grams = loadGrams(slice) + } + throw new Error(''); +} - let expire_at: number = slice.loadUint(32) +export function storeDNSRecord(dNSRecord: DNSRecord): (builder: Builder) => void { + if ((dNSRecord.kind == 'DNSRecord_dns_text')) { + return ((builder: Builder) => { + builder.storeUint(0x1eda, 16); + storeText(dNSRecord._)(builder); + }) - let A: Grams = loadGrams(slice) + } + if ((dNSRecord.kind == 'DNSRecord_dns_next_resolver')) { + return ((builder: Builder) => { + builder.storeUint(0xba93, 16); + storeMsgAddressInt(dNSRecord.resolver)(builder); + }) - let B: Grams = loadGrams(slice) + } + if ((dNSRecord.kind == 'DNSRecord_dns_adnl_address')) { + return ((builder: Builder) => { + builder.storeUint(0xad01, 16); + builder.storeBits(dNSRecord.adnl_addr); + builder.storeUint(dNSRecord.flags, 8); + if ((dNSRecord.proto_list != undefined)) { + storeProtoList(dNSRecord.proto_list)(builder); + } + if ((!(dNSRecord.flags <= 1))) { + throw new Error(''); + } + }) - return { - kind: 'ChanState_chan_state_init', - signed_A: signed_A, - signed_B: signed_B, - min_A: min_A, - min_B: min_B, - expire_at: expire_at, - A: A, - B: B, -} + } + if ((dNSRecord.kind == 'DNSRecord_dns_smc_address')) { + return ((builder: Builder) => { + builder.storeUint(0x9fd3, 16); + storeMsgAddressInt(dNSRecord.smc_addr)(builder); + builder.storeUint(dNSRecord.flags, 8); + if ((dNSRecord.cap_list != undefined)) { + storeSmcCapList(dNSRecord.cap_list)(builder); + } + if ((!(dNSRecord.flags <= 1))) { + throw new Error(''); + } + }) + } + throw new Error(''); } -; - if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b001))) { - slice.loadUint(3) - let signed_A: Bool = loadBool(slice) - let signed_B: Bool = loadBool(slice) - - let promise_A: Grams = loadGrams(slice) +export function loadProtoList(slice: Slice): ProtoList { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { + slice.loadUint(1); + return { + kind: 'ProtoList_proto_list_nil', + } - let promise_B: Grams = loadGrams(slice) + } + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { + slice.loadUint(1); + let head: Protocol = loadProtocol(slice); + let tail: ProtoList = loadProtoList(slice); + return { + kind: 'ProtoList_proto_list_next', + head: head, + tail: tail, + } - let expire_at: number = slice.loadUint(32) + } + throw new Error(''); +} - let A: Grams = loadGrams(slice) +export function storeProtoList(protoList: ProtoList): (builder: Builder) => void { + if ((protoList.kind == 'ProtoList_proto_list_nil')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1); + }) - let B: Grams = loadGrams(slice) + } + if ((protoList.kind == 'ProtoList_proto_list_next')) { + return ((builder: Builder) => { + builder.storeUint(0b1, 1); + storeProtocol(protoList.head)(builder); + storeProtoList(protoList.tail)(builder); + }) - return { - kind: 'ChanState_chan_state_close', - signed_A: signed_A, - signed_B: signed_B, - promise_A: promise_A, - promise_B: promise_B, - expire_at: expire_at, - A: A, - B: B, + } + throw new Error(''); } +export function loadProtocol(slice: Slice): Protocol { + if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x4854))) { + slice.loadUint(16); + return { + kind: 'Protocol', + } + + } + throw new Error(''); } -; - if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b010))) { - slice.loadUint(3) - let A: Grams = loadGrams(slice) - let B: Grams = loadGrams(slice) +export function storeProtocol(protocol: Protocol): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x4854, 16); + }) - return { - kind: 'ChanState_chan_state_payout', - A: A, - B: B, } -} -; - throw new Error('') -; -} +export function loadSmcCapList(slice: Slice): SmcCapList { + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { + slice.loadUint(1); + return { + kind: 'SmcCapList_cap_list_nil', + } -export function storeChanState(chanState: ChanState): (builder: Builder) => void { - if ((chanState.kind == 'ChanState_chan_state_init')) { - return ((builder: Builder) => { - builder.storeUint(0b000, 3) + } + if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { + slice.loadUint(1); + let head: SmcCapability = loadSmcCapability(slice); + let tail: SmcCapList = loadSmcCapList(slice); + return { + kind: 'SmcCapList_cap_list_next', + head: head, + tail: tail, + } - storeBool(chanState.signed_A)(builder) + } + throw new Error(''); +} - storeBool(chanState.signed_B)(builder) +export function storeSmcCapList(smcCapList: SmcCapList): (builder: Builder) => void { + if ((smcCapList.kind == 'SmcCapList_cap_list_nil')) { + return ((builder: Builder) => { + builder.storeUint(0b0, 1); + }) - storeGrams(chanState.min_A)(builder) + } + if ((smcCapList.kind == 'SmcCapList_cap_list_next')) { + return ((builder: Builder) => { + builder.storeUint(0b1, 1); + storeSmcCapability(smcCapList.head)(builder); + storeSmcCapList(smcCapList.tail)(builder); + }) - storeGrams(chanState.min_B)(builder) + } + throw new Error(''); +} - builder.storeUint(chanState.expire_at, 32) +export function loadSmcCapability(slice: Slice): SmcCapability { + if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x5371))) { + slice.loadUint(16); + return { + kind: 'SmcCapability_cap_method_seqno', + } - storeGrams(chanState.A)(builder) + } + if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x71f4))) { + slice.loadUint(16); + return { + kind: 'SmcCapability_cap_method_pubkey', + } - storeGrams(chanState.B)(builder) + } + if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x2177))) { + slice.loadUint(16); + return { + kind: 'SmcCapability_cap_is_wallet', + } -}) + } + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xff))) { + slice.loadUint(8); + let name: Text = loadText(slice); + return { + kind: 'SmcCapability_cap_name', + name: name, + } + } + throw new Error(''); } -; - if ((chanState.kind == 'ChanState_chan_state_close')) { - return ((builder: Builder) => { - builder.storeUint(0b001, 3) - storeBool(chanState.signed_A)(builder) +export function storeSmcCapability(smcCapability: SmcCapability): (builder: Builder) => void { + if ((smcCapability.kind == 'SmcCapability_cap_method_seqno')) { + return ((builder: Builder) => { + builder.storeUint(0x5371, 16); + }) - storeBool(chanState.signed_B)(builder) + } + if ((smcCapability.kind == 'SmcCapability_cap_method_pubkey')) { + return ((builder: Builder) => { + builder.storeUint(0x71f4, 16); + }) - storeGrams(chanState.promise_A)(builder) + } + if ((smcCapability.kind == 'SmcCapability_cap_is_wallet')) { + return ((builder: Builder) => { + builder.storeUint(0x2177, 16); + }) - storeGrams(chanState.promise_B)(builder) + } + if ((smcCapability.kind == 'SmcCapability_cap_name')) { + return ((builder: Builder) => { + builder.storeUint(0xff, 8); + storeText(smcCapability.name)(builder); + }) - builder.storeUint(chanState.expire_at, 32) + } + throw new Error(''); +} - storeGrams(chanState.A)(builder) +export function loadChanConfig(slice: Slice): ChanConfig { + let init_timeout: number = slice.loadUint(32); + let close_timeout: number = slice.loadUint(32); + let a_key: BitString = slice.loadBits(256); + let b_key: BitString = slice.loadBits(256); + let slice1 = slice.loadRef().beginParse(); + let a_addr: MsgAddressInt = loadMsgAddressInt(slice1); + let slice2 = slice.loadRef().beginParse(); + let b_addr: MsgAddressInt = loadMsgAddressInt(slice2); + let channel_id: number = slice.loadUint(64); + let min_A_extra: Grams = loadGrams(slice); + return { + kind: 'ChanConfig', + init_timeout: init_timeout, + close_timeout: close_timeout, + a_key: a_key, + b_key: b_key, + a_addr: a_addr, + b_addr: b_addr, + channel_id: channel_id, + min_A_extra: min_A_extra, + } - storeGrams(chanState.B)(builder) +} -}) +export function storeChanConfig(chanConfig: ChanConfig): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(chanConfig.init_timeout, 32); + builder.storeUint(chanConfig.close_timeout, 32); + builder.storeBits(chanConfig.a_key); + builder.storeBits(chanConfig.b_key); + let cell1 = beginCell(); + storeMsgAddressInt(chanConfig.a_addr)(cell1); + builder.storeRef(cell1); + let cell2 = beginCell(); + storeMsgAddressInt(chanConfig.b_addr)(cell2); + builder.storeRef(cell2); + builder.storeUint(chanConfig.channel_id, 64); + storeGrams(chanConfig.min_A_extra)(builder); + }) } -; - if ((chanState.kind == 'ChanState_chan_state_payout')) { - return ((builder: Builder) => { - builder.storeUint(0b010, 3) - storeGrams(chanState.A)(builder) +export function loadChanState(slice: Slice): ChanState { + if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b000))) { + slice.loadUint(3); + let signed_A: Bool = loadBool(slice); + let signed_B: Bool = loadBool(slice); + let min_A: Grams = loadGrams(slice); + let min_B: Grams = loadGrams(slice); + let expire_at: number = slice.loadUint(32); + let A: Grams = loadGrams(slice); + let B: Grams = loadGrams(slice); + return { + kind: 'ChanState_chan_state_init', + signed_A: signed_A, + signed_B: signed_B, + min_A: min_A, + min_B: min_B, + expire_at: expire_at, + A: A, + B: B, + } - storeGrams(chanState.B)(builder) + } + if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b001))) { + slice.loadUint(3); + let signed_A: Bool = loadBool(slice); + let signed_B: Bool = loadBool(slice); + let promise_A: Grams = loadGrams(slice); + let promise_B: Grams = loadGrams(slice); + let expire_at: number = slice.loadUint(32); + let A: Grams = loadGrams(slice); + let B: Grams = loadGrams(slice); + return { + kind: 'ChanState_chan_state_close', + signed_A: signed_A, + signed_B: signed_B, + promise_A: promise_A, + promise_B: promise_B, + expire_at: expire_at, + A: A, + B: B, + } -}) + } + if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b010))) { + slice.loadUint(3); + let A: Grams = loadGrams(slice); + let B: Grams = loadGrams(slice); + return { + kind: 'ChanState_chan_state_payout', + A: A, + B: B, + } -} -; - throw new Error('') -; + } + throw new Error(''); } -export function loadChanPromise(slice: Slice): ChanPromise { - let channel_id: number = slice.loadUint(64) +export function storeChanState(chanState: ChanState): (builder: Builder) => void { + if ((chanState.kind == 'ChanState_chan_state_init')) { + return ((builder: Builder) => { + builder.storeUint(0b000, 3); + storeBool(chanState.signed_A)(builder); + storeBool(chanState.signed_B)(builder); + storeGrams(chanState.min_A)(builder); + storeGrams(chanState.min_B)(builder); + builder.storeUint(chanState.expire_at, 32); + storeGrams(chanState.A)(builder); + storeGrams(chanState.B)(builder); + }) -; - let promise_A: Grams = loadGrams(slice) + } + if ((chanState.kind == 'ChanState_chan_state_close')) { + return ((builder: Builder) => { + builder.storeUint(0b001, 3); + storeBool(chanState.signed_A)(builder); + storeBool(chanState.signed_B)(builder); + storeGrams(chanState.promise_A)(builder); + storeGrams(chanState.promise_B)(builder); + builder.storeUint(chanState.expire_at, 32); + storeGrams(chanState.A)(builder); + storeGrams(chanState.B)(builder); + }) -; - let promise_B: Grams = loadGrams(slice) + } + if ((chanState.kind == 'ChanState_chan_state_payout')) { + return ((builder: Builder) => { + builder.storeUint(0b010, 3); + storeGrams(chanState.A)(builder); + storeGrams(chanState.B)(builder); + }) -; - return { - kind: 'ChanPromise', - channel_id: channel_id, - promise_A: promise_A, - promise_B: promise_B, + } + throw new Error(''); } -; +export function loadChanPromise(slice: Slice): ChanPromise { + let channel_id: number = slice.loadUint(64); + let promise_A: Grams = loadGrams(slice); + let promise_B: Grams = loadGrams(slice); + return { + kind: 'ChanPromise', + channel_id: channel_id, + promise_A: promise_A, + promise_B: promise_B, + } + } export function storeChanPromise(chanPromise: ChanPromise): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(chanPromise.channel_id, 64) - - storeGrams(chanPromise.promise_A)(builder) - - storeGrams(chanPromise.promise_B)(builder) - -}) + builder.storeUint(chanPromise.channel_id, 64); + storeGrams(chanPromise.promise_A)(builder); + storeGrams(chanPromise.promise_B)(builder); + }) -; } export function loadChanSignedPromise(slice: Slice): ChanSignedPromise { let sig: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() - - + let slice1 = slice.loadRef().beginParse(); return slice1.loadBits(512) - }) -) - -; - let promise: ChanPromise = loadChanPromise(slice) - -; +); + let promise: ChanPromise = loadChanPromise(slice); return { - kind: 'ChanSignedPromise', - sig: sig, - promise: promise, -} + kind: 'ChanSignedPromise', + sig: sig, + promise: promise, + } -; } export function storeChanSignedPromise(chanSignedPromise: ChanSignedPromise): (builder: Builder) => void { return ((builder: Builder) => { - storeMaybe(chanSignedPromise.sig, ((arg: BitString) => { + storeMaybe(chanSignedPromise.sig, ((arg: BitString) => { return ((builder: Builder) => { - let cell1 = beginCell() - + let cell1 = beginCell(); - cell1.storeBits(arg) - - builder.storeRef(cell1) + cell1.storeBits(arg); + builder.storeRef(cell1); }) - }) - )(builder) - - storeChanPromise(chanSignedPromise.promise)(builder) - -}) + )(builder); + storeChanPromise(chanSignedPromise.promise)(builder); + }) -; } export function loadChanMsg(slice: Slice): ChanMsg { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x27317822))) { - slice.loadUint(32) - let inc_A: Grams = loadGrams(slice) - - let inc_B: Grams = loadGrams(slice) - - let min_A: Grams = loadGrams(slice) - - let min_B: Grams = loadGrams(slice) - - let channel_id: number = slice.loadUint(64) + slice.loadUint(32); + let inc_A: Grams = loadGrams(slice); + let inc_B: Grams = loadGrams(slice); + let min_A: Grams = loadGrams(slice); + let min_B: Grams = loadGrams(slice); + let channel_id: number = slice.loadUint(64); + return { + kind: 'ChanMsg_chan_msg_init', + inc_A: inc_A, + inc_B: inc_B, + min_A: min_A, + min_B: min_B, + channel_id: channel_id, + } - return { - kind: 'ChanMsg_chan_msg_init', - inc_A: inc_A, - inc_B: inc_B, - min_A: min_A, - min_B: min_B, - channel_id: channel_id, -} - -} -; + } if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xf28ae183))) { - slice.loadUint(32) - let extra_A: Grams = loadGrams(slice) - - let extra_B: Grams = loadGrams(slice) - - let promise: ChanSignedPromise = loadChanSignedPromise(slice) - - return { - kind: 'ChanMsg_chan_msg_close', - extra_A: extra_A, - extra_B: extra_B, - promise: promise, -} + slice.loadUint(32); + let extra_A: Grams = loadGrams(slice); + let extra_B: Grams = loadGrams(slice); + let promise: ChanSignedPromise = loadChanSignedPromise(slice); + return { + kind: 'ChanMsg_chan_msg_close', + extra_A: extra_A, + extra_B: extra_B, + promise: promise, + } -} -; + } if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x43278a28))) { - slice.loadUint(32) - return { - kind: 'ChanMsg_chan_msg_timeout', -} + slice.loadUint(32); + return { + kind: 'ChanMsg_chan_msg_timeout', + } -} -; + } if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x37fe7810))) { - slice.loadUint(32) - return { - kind: 'ChanMsg_chan_msg_payout', -} + slice.loadUint(32); + return { + kind: 'ChanMsg_chan_msg_payout', + } -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeChanMsg(chanMsg: ChanMsg): (builder: Builder) => void { if ((chanMsg.kind == 'ChanMsg_chan_msg_init')) { - return ((builder: Builder) => { - builder.storeUint(0x27317822, 32) - - storeGrams(chanMsg.inc_A)(builder) - - storeGrams(chanMsg.inc_B)(builder) - - storeGrams(chanMsg.min_A)(builder) - - storeGrams(chanMsg.min_B)(builder) - - builder.storeUint(chanMsg.channel_id, 64) - -}) + return ((builder: Builder) => { + builder.storeUint(0x27317822, 32); + storeGrams(chanMsg.inc_A)(builder); + storeGrams(chanMsg.inc_B)(builder); + storeGrams(chanMsg.min_A)(builder); + storeGrams(chanMsg.min_B)(builder); + builder.storeUint(chanMsg.channel_id, 64); + }) -} -; + } if ((chanMsg.kind == 'ChanMsg_chan_msg_close')) { - return ((builder: Builder) => { - builder.storeUint(0xf28ae183, 32) - - storeGrams(chanMsg.extra_A)(builder) - - storeGrams(chanMsg.extra_B)(builder) - - storeChanSignedPromise(chanMsg.promise)(builder) - -}) + return ((builder: Builder) => { + builder.storeUint(0xf28ae183, 32); + storeGrams(chanMsg.extra_A)(builder); + storeGrams(chanMsg.extra_B)(builder); + storeChanSignedPromise(chanMsg.promise)(builder); + }) -} -; + } if ((chanMsg.kind == 'ChanMsg_chan_msg_timeout')) { - return ((builder: Builder) => { - builder.storeUint(0x43278a28, 32) - -}) + return ((builder: Builder) => { + builder.storeUint(0x43278a28, 32); + }) -} -; + } if ((chanMsg.kind == 'ChanMsg_chan_msg_payout')) { - return ((builder: Builder) => { - builder.storeUint(0x37fe7810, 32) - -}) + return ((builder: Builder) => { + builder.storeUint(0x37fe7810, 32); + }) -} -; - throw new Error('') -; + } + throw new Error(''); } export function loadChanSignedMsg(slice: Slice): ChanSignedMsg { let sig_A: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() - - + let slice1 = slice.loadRef().beginParse(); return slice1.loadBits(512) - }) -) - -; +); let sig_B: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() - - + let slice1 = slice.loadRef().beginParse(); return slice1.loadBits(512) - }) -) - -; - let msg: ChanMsg = loadChanMsg(slice) - -; +); + let msg: ChanMsg = loadChanMsg(slice); return { - kind: 'ChanSignedMsg', - sig_A: sig_A, - sig_B: sig_B, - msg: msg, -} + kind: 'ChanSignedMsg', + sig_A: sig_A, + sig_B: sig_B, + msg: msg, + } -; } export function storeChanSignedMsg(chanSignedMsg: ChanSignedMsg): (builder: Builder) => void { return ((builder: Builder) => { - storeMaybe(chanSignedMsg.sig_A, ((arg: BitString) => { + storeMaybe(chanSignedMsg.sig_A, ((arg: BitString) => { return ((builder: Builder) => { - let cell1 = beginCell() - + let cell1 = beginCell(); - cell1.storeBits(arg) - - builder.storeRef(cell1) + cell1.storeBits(arg); + builder.storeRef(cell1); }) - }) - )(builder) - - storeMaybe(chanSignedMsg.sig_B, ((arg: BitString) => { + )(builder); + storeMaybe(chanSignedMsg.sig_B, ((arg: BitString) => { return ((builder: Builder) => { - let cell1 = beginCell() - + let cell1 = beginCell(); - cell1.storeBits(arg) - - builder.storeRef(cell1) + cell1.storeBits(arg); + builder.storeRef(cell1); }) - }) - )(builder) - - storeChanMsg(chanSignedMsg.msg)(builder) - -}) + )(builder); + storeChanMsg(chanSignedMsg.msg)(builder); + }) -; } export function loadChanOp(slice: Slice): ChanOp { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x912838d1))) { - slice.loadUint(32) - let msg: ChanSignedMsg = loadChanSignedMsg(slice) - - return { - kind: 'ChanOp', - msg: msg, -} + slice.loadUint(32); + let msg: ChanSignedMsg = loadChanSignedMsg(slice); + return { + kind: 'ChanOp', + msg: msg, + } -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeChanOp(chanOp: ChanOp): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0x912838d1, 32) - - storeChanSignedMsg(chanOp.msg)(builder) - -}) + builder.storeUint(0x912838d1, 32); + storeChanSignedMsg(chanOp.msg)(builder); + }) -; } export function loadChanData(slice: Slice): ChanData { - let slice1 = slice.loadRef().beginParse() - -; - let config: ChanConfig = loadChanConfig(slice1) - -; - let slice2 = slice.loadRef().beginParse() - -; - let state: ChanState = loadChanState(slice2) - -; - return { - kind: 'ChanData', - config: config, - state: state, -} + let slice1 = slice.loadRef().beginParse(); + let config: ChanConfig = loadChanConfig(slice1); + let slice2 = slice.loadRef().beginParse(); + let state: ChanState = loadChanState(slice2); + return { + kind: 'ChanData', + config: config, + state: state, + } -; } export function storeChanData(chanData: ChanData): (builder: Builder) => void { return ((builder: Builder) => { - let cell1 = beginCell() - - - storeChanConfig(chanData.config)(cell1) - - builder.storeRef(cell1) - - let cell2 = beginCell() - - - storeChanState(chanData.state)(cell2) - - builder.storeRef(cell2) - -}) + let cell1 = beginCell(); + storeChanConfig(chanData.config)(cell1); + builder.storeRef(cell1); + let cell2 = beginCell(); + storeChanState(chanData.state)(cell2); + builder.storeRef(cell2); + }) -; } diff --git a/generated_test.ts b/generated_test.ts index 0b79b83..75eb7ad 100644 --- a/generated_test.ts +++ b/generated_test.ts @@ -467,272 +467,206 @@ export interface CheckKeyword { } export function bitLen(n: number) { - return n.toString(2).length; -; + return n.toString(2).length;; } export function loadSimple(slice: Slice): Simple { - let a: number = slice.loadUint(32) - -; - let b: number = slice.loadUint(32) - -; + let a: number = slice.loadUint(32); + let b: number = slice.loadUint(32); return { - kind: 'Simple', - a: a, - b: b, -} + kind: 'Simple', + a: a, + b: b, + } -; } export function storeSimple(simple: Simple): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(simple.a, 32) - - builder.storeUint(simple.b, 32) - -}) + builder.storeUint(simple.a, 32); + builder.storeUint(simple.b, 32); + }) -; } export function loadTwoConstructors(slice: Slice): TwoConstructors { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1) - let a: number = slice.loadUint(32) + slice.loadUint(1); + let a: number = slice.loadUint(32); + let b: number = slice.loadUint(7); + let c: number = slice.loadUint(32); + return { + kind: 'TwoConstructors_bool_false', + a: a, + b: b, + c: c, + } - let b: number = slice.loadUint(7) - - let c: number = slice.loadUint(32) - - return { - kind: 'TwoConstructors_bool_false', - a: a, - b: b, - c: c, -} - -} -; + } if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1) - let b: number = slice.loadUint(32) - - return { - kind: 'TwoConstructors_bool_true', - b: b, -} + slice.loadUint(1); + let b: number = slice.loadUint(32); + return { + kind: 'TwoConstructors_bool_true', + b: b, + } -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeTwoConstructors(twoConstructors: TwoConstructors): (builder: Builder) => void { if ((twoConstructors.kind == 'TwoConstructors_bool_false')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1) - - builder.storeUint(twoConstructors.a, 32) - - builder.storeUint(twoConstructors.b, 7) - - builder.storeUint(twoConstructors.c, 32) - -}) + return ((builder: Builder) => { + builder.storeUint(0b0, 1); + builder.storeUint(twoConstructors.a, 32); + builder.storeUint(twoConstructors.b, 7); + builder.storeUint(twoConstructors.c, 32); + }) -} -; + } if ((twoConstructors.kind == 'TwoConstructors_bool_true')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1) - - builder.storeUint(twoConstructors.b, 32) - -}) + return ((builder: Builder) => { + builder.storeUint(0b1, 1); + builder.storeUint(twoConstructors.b, 32); + }) -} -; - throw new Error('') -; + } + throw new Error(''); } export function loadFixedIntParam(slice: Slice): FixedIntParam { - let y: number = slice.loadUint(5) - -; + let y: number = slice.loadUint(5); return { - kind: 'FixedIntParam', - y: y, -} + kind: 'FixedIntParam', + y: y, + } -; } export function storeFixedIntParam(fixedIntParam: FixedIntParam): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(fixedIntParam.y, 5) - -}) + builder.storeUint(fixedIntParam.y, 5); + }) -; } export function loadTypedField(slice: Slice): TypedField { - let y: FixedIntParam = loadFixedIntParam(slice) - -; - let c: number = slice.loadUint(32) - -; + let y: FixedIntParam = loadFixedIntParam(slice); + let c: number = slice.loadUint(32); return { - kind: 'TypedField', - y: y, - c: c, -} + kind: 'TypedField', + y: y, + c: c, + } -; } export function storeTypedField(typedField: TypedField): (builder: Builder) => void { return ((builder: Builder) => { - storeFixedIntParam(typedField.y)(builder) - - builder.storeUint(typedField.c, 32) - -}) + storeFixedIntParam(typedField.y)(builder); + builder.storeUint(typedField.c, 32); + }) -; } export function loadSharpConstructor(slice: Slice): SharpConstructor { - let y: FixedIntParam = loadFixedIntParam(slice) - -; - let c: number = slice.loadUint(32) - -; + let y: FixedIntParam = loadFixedIntParam(slice); + let c: number = slice.loadUint(32); return { - kind: 'SharpConstructor', - y: y, - c: c, -} + kind: 'SharpConstructor', + y: y, + c: c, + } -; } export function storeSharpConstructor(sharpConstructor: SharpConstructor): (builder: Builder) => void { return ((builder: Builder) => { - storeFixedIntParam(sharpConstructor.y)(builder) - - builder.storeUint(sharpConstructor.c, 32) - -}) + storeFixedIntParam(sharpConstructor.y)(builder); + builder.storeUint(sharpConstructor.c, 32); + }) -; } export function loadMaybe(slice: Slice, loadTheType: (slice: Slice) => TheType ): Maybe { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1) - return { - kind: 'Maybe_nothing', -} + slice.loadUint(1); + return { + kind: 'Maybe_nothing', + } -} -; + } if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1) - let value: TheType = loadTheType(slice) + slice.loadUint(1); + let value: TheType = loadTheType(slice); + return { + kind: 'Maybe_just', + value: value, + } - return { - kind: 'Maybe_just', - value: value, -} - -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeMaybe(maybe: Maybe, storeTheType: (theType: TheType) => (builder: Builder) => void ): (builder: Builder) => void { if ((maybe.kind == 'Maybe_nothing')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1) - -}) + return ((builder: Builder) => { + builder.storeUint(0b0, 1); + }) -} -; + } if ((maybe.kind == 'Maybe_just')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1) - - storeTheType(maybe.value)(builder) - -}) + return ((builder: Builder) => { + builder.storeUint(0b1, 1); + storeTheType(maybe.value)(builder); + }) -} -; - throw new Error('') -; + } + throw new Error(''); } export function loadTypedParam(slice: Slice): TypedParam { - let x: Maybe = loadMaybe(slice, loadSharpConstructor) - -; + let x: Maybe = loadMaybe(slice, loadSharpConstructor); return { - kind: 'TypedParam', - x: x, -} + kind: 'TypedParam', + x: x, + } -; } export function storeTypedParam(typedParam: TypedParam): (builder: Builder) => void { return ((builder: Builder) => { - storeMaybe(typedParam.x, storeSharpConstructor)(builder) - -}) + storeMaybe(typedParam.x, storeSharpConstructor)(builder); + }) -; } export function loadEither(slice: Slice, loadX: (slice: Slice) => X , loadY: (slice: Slice) => Y ): Either { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1) - let value: X = loadX(slice) - - return { - kind: 'Either_left', - value: value, -} + slice.loadUint(1); + let value: X = loadX(slice); + return { + kind: 'Either_left', + value: value, + } -} -; + } if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1) - let value: Y = loadY(slice) - - return { - kind: 'Either_right', - value: value, -} + slice.loadUint(1); + let value: Y = loadY(slice); + return { + kind: 'Either_right', + value: value, + } -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeEither(either: Either, storeX: (x: X) => (builder: Builder) => void @@ -741,509 +675,346 @@ export function storeEither(either: Either, storeX: (x: X) => (build ): (builder: Builder) => void { if ((either.kind == 'Either_left')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1) - - storeX(either.value)(builder) - -}) + return ((builder: Builder) => { + builder.storeUint(0b0, 1); + storeX(either.value)(builder); + }) -} -; + } if ((either.kind == 'Either_right')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1) - - storeY(either.value)(builder) - -}) + return ((builder: Builder) => { + builder.storeUint(0b1, 1); + storeY(either.value)(builder); + }) -} -; - throw new Error('') -; + } + throw new Error(''); } export function loadBitLenArg(slice: Slice, x: number): BitLenArg { - let value: number = slice.loadUint(x) - -; + let value: number = slice.loadUint(x); return { - kind: 'BitLenArg', - x: x, - value: value, -} + kind: 'BitLenArg', + x: x, + value: value, + } -; } export function storeBitLenArg(bitLenArg: BitLenArg): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(bitLenArg.value, bitLenArg.x) - -}) + builder.storeUint(bitLenArg.value, bitLenArg.x); + }) -; } export function loadBitLenArgUser(slice: Slice): BitLenArgUser { - let t: BitLenArg = loadBitLenArg(slice, 4) - -; + let t: BitLenArg = loadBitLenArg(slice, 4); return { - kind: 'BitLenArgUser', - t: t, -} + kind: 'BitLenArgUser', + t: t, + } -; } export function storeBitLenArgUser(bitLenArgUser: BitLenArgUser): (builder: Builder) => void { return ((builder: Builder) => { - storeBitLenArg(bitLenArgUser.t)(builder) - -}) + storeBitLenArg(bitLenArgUser.t)(builder); + }) -; } export function loadExprArg(slice: Slice, arg0: number): ExprArg { - let value: number = slice.loadUint((arg0 - 2)) - -; + let value: number = slice.loadUint((arg0 - 2)); return { - kind: 'ExprArg', - x: (arg0 - 2), - value: value, -} + kind: 'ExprArg', + x: (arg0 - 2), + value: value, + } -; } export function storeExprArg(exprArg: ExprArg): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(exprArg.value, exprArg.x) - -}) + builder.storeUint(exprArg.value, exprArg.x); + }) -; } export function loadExprArgUser(slice: Slice): ExprArgUser { - let t: ExprArg = loadExprArg(slice, 6) - -; + let t: ExprArg = loadExprArg(slice, 6); return { - kind: 'ExprArgUser', - t: t, -} + kind: 'ExprArgUser', + t: t, + } -; } export function storeExprArgUser(exprArgUser: ExprArgUser): (builder: Builder) => void { return ((builder: Builder) => { - storeExprArg(exprArgUser.t)(builder) - -}) + storeExprArg(exprArgUser.t)(builder); + }) -; } export function loadComplexTypedField(slice: Slice): ComplexTypedField { - let a: ExprArgUser = loadExprArgUser(slice) - -; + let a: ExprArgUser = loadExprArgUser(slice); return { - kind: 'ComplexTypedField', - a: a, -} + kind: 'ComplexTypedField', + a: a, + } -; } export function storeComplexTypedField(complexTypedField: ComplexTypedField): (builder: Builder) => void { return ((builder: Builder) => { - storeExprArgUser(complexTypedField.a)(builder) - -}) + storeExprArgUser(complexTypedField.a)(builder); + }) -; } export function loadCellTypedField(slice: Slice): CellTypedField { - let slice1 = slice.loadRef().beginParse() - -; - let a: ExprArgUser = loadExprArgUser(slice1) - -; + let slice1 = slice.loadRef().beginParse(); + let a: ExprArgUser = loadExprArgUser(slice1); return { - kind: 'CellTypedField', - a: a, -} + kind: 'CellTypedField', + a: a, + } -; } export function storeCellTypedField(_cellTypedField: CellTypedField): (builder: Builder) => void { return ((builder: Builder) => { - let cell1 = beginCell() - - - storeExprArgUser(_cellTypedField.a)(cell1) - - builder.storeRef(cell1) - -}) + let cell1 = beginCell(); + storeExprArgUser(_cellTypedField.a)(cell1); + builder.storeRef(cell1); + }) -; } export function loadCellsSimple(slice: Slice): CellsSimple { - let t: number = slice.loadUint(32) - -; - let slice1 = slice.loadRef().beginParse() - -; - let q: number = slice1.loadUint(32) - -; - let slice2 = slice.loadRef().beginParse() - -; - let a: number = slice2.loadUint(32) - -; - let slice21 = slice2.loadRef().beginParse() - -; - let e: number = slice21.loadUint(32) - -; - let slice22 = slice2.loadRef().beginParse() - -; - let b: number = slice22.loadUint(32) - -; - let d: number = slice22.loadUint(32) - -; - let slice221 = slice22.loadRef().beginParse() - -; - let c: number = slice221.loadUint(32) - -; - return { - kind: 'CellsSimple', - t: t, - q: q, - a: a, - e: e, - b: b, - d: d, - c: c, -} + let t: number = slice.loadUint(32); + let slice1 = slice.loadRef().beginParse(); + let q: number = slice1.loadUint(32); + let slice2 = slice.loadRef().beginParse(); + let a: number = slice2.loadUint(32); + let slice21 = slice2.loadRef().beginParse(); + let e: number = slice21.loadUint(32); + let slice22 = slice2.loadRef().beginParse(); + let b: number = slice22.loadUint(32); + let d: number = slice22.loadUint(32); + let slice221 = slice22.loadRef().beginParse(); + let c: number = slice221.loadUint(32); + return { + kind: 'CellsSimple', + t: t, + q: q, + a: a, + e: e, + b: b, + d: d, + c: c, + } -; } export function storeCellsSimple(_cellsSimple: CellsSimple): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(_cellsSimple.t, 32) - - let cell1 = beginCell() - - - cell1.storeUint(_cellsSimple.q, 32) - - builder.storeRef(cell1) - - let cell2 = beginCell() - - - cell2.storeUint(_cellsSimple.a, 32) - - let cell21 = beginCell() - - - cell21.storeUint(_cellsSimple.e, 32) - - cell2.storeRef(cell21) - - let cell22 = beginCell() - - - cell22.storeUint(_cellsSimple.b, 32) - - cell22.storeUint(_cellsSimple.d, 32) - - let cell221 = beginCell() - - - cell221.storeUint(_cellsSimple.c, 32) - - cell22.storeRef(cell221) - - cell2.storeRef(cell22) - - builder.storeRef(cell2) - -}) + builder.storeUint(_cellsSimple.t, 32); + let cell1 = beginCell(); + cell1.storeUint(_cellsSimple.q, 32); + builder.storeRef(cell1); + let cell2 = beginCell(); + cell2.storeUint(_cellsSimple.a, 32); + let cell21 = beginCell(); + cell21.storeUint(_cellsSimple.e, 32); + cell2.storeRef(cell21); + let cell22 = beginCell(); + cell22.storeUint(_cellsSimple.b, 32); + cell22.storeUint(_cellsSimple.d, 32); + let cell221 = beginCell(); + cell221.storeUint(_cellsSimple.c, 32); + cell22.storeRef(cell221); + cell2.storeRef(cell22); + builder.storeRef(cell2); + }) -; } export function loadIntBits(slice: Slice, loadArg: (slice: Slice) => Arg ): IntBits { - let d: number = slice.loadInt(11) - -; - let g: BitString = slice.loadBits(2) - -; - let arg: Arg = loadArg(slice) - -; - let x: Slice = slice - -; - return { - kind: 'IntBits', - d: d, - g: g, - arg: arg, - x: x, -} + let d: number = slice.loadInt(11); + let g: BitString = slice.loadBits(2); + let arg: Arg = loadArg(slice); + let x: Slice = slice; + return { + kind: 'IntBits', + d: d, + g: g, + arg: arg, + x: x, + } -; } export function storeIntBits(intBits: IntBits, storeArg: (arg: Arg) => (builder: Builder) => void ): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeInt(intBits.d, 11) - - builder.storeBits(intBits.g) - - storeArg(intBits.arg)(builder) - - builder.storeSlice(intBits.x) - -}) + builder.storeInt(intBits.d, 11); + builder.storeBits(intBits.g); + storeArg(intBits.arg)(builder); + builder.storeSlice(intBits.x); + }) -; } export function loadIntBitsInside(slice: Slice, arg0: number): IntBitsInside { let a: IntBits = loadIntBits(slice, ((slice: Slice) => { return slice.loadInt((1 + (arg0 / 2))) - }) -) - -; +); return { - kind: 'IntBitsInside', - x: (arg0 / 2), - a: a, -} + kind: 'IntBitsInside', + x: (arg0 / 2), + a: a, + } -; } export function storeIntBitsInside(intBitsInside: IntBitsInside): (builder: Builder) => void { return ((builder: Builder) => { - storeIntBits(intBitsInside.a, ((arg: number) => { + storeIntBits(intBitsInside.a, ((arg: number) => { return ((builder: Builder) => { - builder.storeInt(arg, (1 + intBitsInside.x)) - + builder.storeInt(arg, (1 + intBitsInside.x)); }) - }) - )(builder) - -}) + )(builder); + }) -; } export function loadIntBitsOutside(slice: Slice): IntBitsOutside { - let x: IntBitsInside = loadIntBitsInside(slice, 6) - -; + let x: IntBitsInside = loadIntBitsInside(slice, 6); return { - kind: 'IntBitsOutside', - x: x, -} + kind: 'IntBitsOutside', + x: x, + } -; } export function storeIntBitsOutside(intBitsOutside: IntBitsOutside): (builder: Builder) => void { return ((builder: Builder) => { - storeIntBitsInside(intBitsOutside.x)(builder) - -}) + storeIntBitsInside(intBitsOutside.x)(builder); + }) -; } export function loadIntBitsParametrized(slice: Slice, e: number): IntBitsParametrized { - let h: number = slice.loadInt((e * 8)) - -; - let f: number = slice.loadUint((7 * e)) - -; - let i: BitString = slice.loadBits((5 + e)) - -; - let j: number = slice.loadInt(5) - -; - let k: number = slice.loadUint(e) - -; - let tc: Slice = slice - -; - return { - kind: 'IntBitsParametrized', - e: e, - h: h, - f: f, - i: i, - j: j, - k: k, - tc: tc, -} + let h: number = slice.loadInt((e * 8)); + let f: number = slice.loadUint((7 * e)); + let i: BitString = slice.loadBits((5 + e)); + let j: number = slice.loadInt(5); + let k: number = slice.loadUint(e); + let tc: Slice = slice; + return { + kind: 'IntBitsParametrized', + e: e, + h: h, + f: f, + i: i, + j: j, + k: k, + tc: tc, + } -; } export function storeIntBitsParametrized(intBitsParametrized: IntBitsParametrized): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeInt(intBitsParametrized.h, (intBitsParametrized.e * 8)) - - builder.storeUint(intBitsParametrized.f, (7 * intBitsParametrized.e)) - - builder.storeBits(intBitsParametrized.i) - - builder.storeInt(intBitsParametrized.j, 5) - - builder.storeUint(intBitsParametrized.k, intBitsParametrized.e) - - builder.storeSlice(intBitsParametrized.tc) - -}) + builder.storeInt(intBitsParametrized.h, (intBitsParametrized.e * 8)); + builder.storeUint(intBitsParametrized.f, (7 * intBitsParametrized.e)); + builder.storeBits(intBitsParametrized.i); + builder.storeInt(intBitsParametrized.j, 5); + builder.storeUint(intBitsParametrized.k, intBitsParametrized.e); + builder.storeSlice(intBitsParametrized.tc); + }) -; } export function loadIntBitsParametrizedInside(slice: Slice, x: number): IntBitsParametrizedInside { - let a: IntBitsParametrized = loadIntBitsParametrized(slice, x) - -; + let a: IntBitsParametrized = loadIntBitsParametrized(slice, x); return { - kind: 'IntBitsParametrizedInside', - x: x, - a: a, -} + kind: 'IntBitsParametrizedInside', + x: x, + a: a, + } -; } export function storeIntBitsParametrizedInside(intBitsParametrizedInside: IntBitsParametrizedInside): (builder: Builder) => void { return ((builder: Builder) => { - storeIntBitsParametrized(intBitsParametrizedInside.a)(builder) - -}) + storeIntBitsParametrized(intBitsParametrizedInside.a)(builder); + }) -; } export function loadIntBitsParametrizedOutside(slice: Slice): IntBitsParametrizedOutside { - let x: IntBitsParametrizedInside = loadIntBitsParametrizedInside(slice, 5) - -; + let x: IntBitsParametrizedInside = loadIntBitsParametrizedInside(slice, 5); return { - kind: 'IntBitsParametrizedOutside', - x: x, -} + kind: 'IntBitsParametrizedOutside', + x: x, + } -; } export function storeIntBitsParametrizedOutside(intBitsParametrizedOutside: IntBitsParametrizedOutside): (builder: Builder) => void { return ((builder: Builder) => { - storeIntBitsParametrizedInside(intBitsParametrizedOutside.x)(builder) - -}) + storeIntBitsParametrizedInside(intBitsParametrizedOutside.x)(builder); + }) -; } export function loadLessThan(slice: Slice): LessThan { - let x: number = slice.loadUint(bitLen((4 - 1))) - -; - let y: number = slice.loadUint(bitLen(4)) - -; + let x: number = slice.loadUint(bitLen((4 - 1))); + let y: number = slice.loadUint(bitLen(4)); return { - kind: 'LessThan', - x: x, - y: y, -} + kind: 'LessThan', + x: x, + y: y, + } -; } export function storeLessThan(lessThan: LessThan): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(lessThan.x, bitLen((4 - 1))) - - builder.storeUint(lessThan.y, bitLen(4)) - -}) + builder.storeUint(lessThan.x, bitLen((4 - 1))); + builder.storeUint(lessThan.y, bitLen(4)); + }) -; } export function loadOneComb(slice: Slice, loadA: (slice: Slice) => A ): OneComb { - let t: number = slice.loadUint(32) - -; - let x: A = loadA(slice) - -; + let t: number = slice.loadUint(32); + let x: A = loadA(slice); return { - kind: 'OneComb', - t: t, - x: x, -} + kind: 'OneComb', + t: t, + x: x, + } -; } export function storeOneComb(oneComb: OneComb, storeA: (a: A) => (builder: Builder) => void ): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(oneComb.t, 32) - - storeA(oneComb.x)(builder) - -}) + builder.storeUint(oneComb.t, 32); + storeA(oneComb.x)(builder); + }) -; } export function loadManyComb(slice: Slice): ManyComb { @@ -1251,1698 +1022,1271 @@ export function loadManyComb(slice: Slice): ManyComb { return loadOneComb>(slice, ((slice: Slice) => { return loadOneComb(slice, ((slice: Slice) => { return slice.loadInt(3) - }) ) - }) ) - }) -) - -; +); return { - kind: 'ManyComb', - y: y, -} + kind: 'ManyComb', + y: y, + } -; } export function storeManyComb(manyComb: ManyComb): (builder: Builder) => void { return ((builder: Builder) => { - storeOneComb>>(manyComb.y, ((arg: OneComb>) => { + storeOneComb>>(manyComb.y, ((arg: OneComb>) => { return ((builder: Builder) => { storeOneComb>(arg, ((arg: OneComb) => { + return ((builder: Builder) => { + storeOneComb(arg, ((arg: number) => { return ((builder: Builder) => { - storeOneComb(arg, ((arg: number) => { - return ((builder: Builder) => { - builder.storeInt(arg, 3) - - }) - - - }) - )(builder) - + builder.storeInt(arg, 3); }) - }) - )(builder) + )(builder); + }) }) - + )(builder); + }) }) - )(builder) - -}) + )(builder); + }) -; } export function unary_unary_succ_get_n(x: Unary): number { if ((x.kind == 'Unary_unary_zero')) { - return 0 -} -; + return 0 + } if ((x.kind == 'Unary_unary_succ')) { - let n = x.n - - return (n + 1) -} -; - throw new Error('') -; + let n = x.n; + return (n + 1) + } + throw new Error(''); } export function loadUnary(slice: Slice): Unary { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1) - return { - kind: 'Unary_unary_zero', -} + slice.loadUint(1); + return { + kind: 'Unary_unary_zero', + } -} -; + } if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1) - let x: Unary = loadUnary(slice) - - let n = unary_unary_succ_get_n(x) - - return { - kind: 'Unary_unary_succ', - x: x, - n: n, -} + slice.loadUint(1); + let x: Unary = loadUnary(slice); + let n = unary_unary_succ_get_n(x); + return { + kind: 'Unary_unary_succ', + x: x, + n: n, + } -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeUnary(unary: Unary): (builder: Builder) => void { if ((unary.kind == 'Unary_unary_zero')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1) - -}) + return ((builder: Builder) => { + builder.storeUint(0b0, 1); + }) -} -; + } if ((unary.kind == 'Unary_unary_succ')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1) - - storeUnary(unary.x)(builder) - -}) + return ((builder: Builder) => { + builder.storeUint(0b1, 1); + storeUnary(unary.x)(builder); + }) -} -; - throw new Error('') -; + } + throw new Error(''); } export function loadParamConst(slice: Slice, arg0: number, arg1: number): ParamConst { if (((slice.remainingBits >= 2) && ((slice.preloadUint(2) == 0b01) && ((arg0 == 2) && (arg1 == 1))))) { - slice.loadUint(2) - let m: number = slice.loadUint(32) - - let k: number = slice.loadUint(32) - - return { - kind: 'ParamConst_b', - m: m, - k: k, -} + slice.loadUint(2); + let m: number = slice.loadUint(32); + let k: number = slice.loadUint(32); + return { + kind: 'ParamConst_b', + m: m, + k: k, + } -} -; + } if (((slice.remainingBits >= 2) && ((slice.preloadUint(2) == 0b01) && ((arg0 == 3) && (arg1 == 3))))) { - slice.loadUint(2) - let n: number = slice.loadUint(32) - - let m: number = slice.loadUint(32) - - let k: number = slice.loadUint(32) - - return { - kind: 'ParamConst_c', - n: n, - m: m, - k: k, -} + slice.loadUint(2); + let n: number = slice.loadUint(32); + let m: number = slice.loadUint(32); + let k: number = slice.loadUint(32); + return { + kind: 'ParamConst_c', + n: n, + m: m, + k: k, + } -} -; + } if (((arg0 == 1) && (arg1 == 1))) { - let n: number = slice.loadUint(32) + let n: number = slice.loadUint(32); + return { + kind: 'ParamConst_a', + n: n, + } - return { - kind: 'ParamConst_a', - n: n, -} - -} -; + } if (((arg0 == 4) && (arg1 == 2))) { - let n: number = slice.loadUint(32) - - let m: number = slice.loadUint(32) - - let k: number = slice.loadUint(32) - - let l: number = slice.loadUint(32) - - return { - kind: 'ParamConst_d', - n: n, - m: m, - k: k, - l: l, -} + let n: number = slice.loadUint(32); + let m: number = slice.loadUint(32); + let k: number = slice.loadUint(32); + let l: number = slice.loadUint(32); + return { + kind: 'ParamConst_d', + n: n, + m: m, + k: k, + l: l, + } -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeParamConst(paramConst: ParamConst): (builder: Builder) => void { if ((paramConst.kind == 'ParamConst_b')) { - return ((builder: Builder) => { - builder.storeUint(0b01, 2) - - builder.storeUint(paramConst.m, 32) - - builder.storeUint(paramConst.k, 32) - -}) + return ((builder: Builder) => { + builder.storeUint(0b01, 2); + builder.storeUint(paramConst.m, 32); + builder.storeUint(paramConst.k, 32); + }) -} -; + } if ((paramConst.kind == 'ParamConst_c')) { - return ((builder: Builder) => { - builder.storeUint(0b01, 2) - - builder.storeUint(paramConst.n, 32) - - builder.storeUint(paramConst.m, 32) - - builder.storeUint(paramConst.k, 32) - -}) + return ((builder: Builder) => { + builder.storeUint(0b01, 2); + builder.storeUint(paramConst.n, 32); + builder.storeUint(paramConst.m, 32); + builder.storeUint(paramConst.k, 32); + }) -} -; + } if ((paramConst.kind == 'ParamConst_a')) { - return ((builder: Builder) => { - builder.storeUint(paramConst.n, 32) - -}) + return ((builder: Builder) => { + builder.storeUint(paramConst.n, 32); + }) -} -; + } if ((paramConst.kind == 'ParamConst_d')) { - return ((builder: Builder) => { - builder.storeUint(paramConst.n, 32) - - builder.storeUint(paramConst.m, 32) - - builder.storeUint(paramConst.k, 32) - - builder.storeUint(paramConst.l, 32) - -}) + return ((builder: Builder) => { + builder.storeUint(paramConst.n, 32); + builder.storeUint(paramConst.m, 32); + builder.storeUint(paramConst.k, 32); + builder.storeUint(paramConst.l, 32); + }) -} -; - throw new Error('') -; + } + throw new Error(''); } export function paramDifNames_c_get_n(x: ParamDifNames): number { if ((x.kind == 'ParamDifNames_a')) { - return 1 -} -; + return 1 + } if ((x.kind == 'ParamDifNames_b')) { - return 1 -} -; + return 1 + } if ((x.kind == 'ParamDifNames_c')) { - let n = x.n - - return (n + 1) -} -; + let n = x.n; + return (n + 1) + } if ((x.kind == 'ParamDifNames_d')) { - let m = x.m - - return (m * 2) -} -; - throw new Error('') -; + let m = x.m; + return (m * 2) + } + throw new Error(''); } export function paramDifNames_d_get_m(x: ParamDifNames): number { if ((x.kind == 'ParamDifNames_a')) { - return 1 -} -; + return 1 + } if ((x.kind == 'ParamDifNames_b')) { - return 1 -} -; + return 1 + } if ((x.kind == 'ParamDifNames_c')) { - let n = x.n - - return (n + 1) -} -; + let n = x.n; + return (n + 1) + } if ((x.kind == 'ParamDifNames_d')) { - let m = x.m - - return (m * 2) -} -; - throw new Error('') -; + let m = x.m; + return (m * 2) + } + throw new Error(''); } export function loadParamDifNames(slice: Slice, arg0: number): ParamDifNames { if (((slice.remainingBits >= 1) && ((slice.preloadUint(1) == 0b0) && (arg0 == 2)))) { - slice.loadUint(1) - return { - kind: 'ParamDifNames_a', -} + slice.loadUint(1); + return { + kind: 'ParamDifNames_a', + } -} -; + } if (((slice.remainingBits >= 1) && ((slice.preloadUint(1) == 0b1) && (arg0 == 3)))) { - slice.loadUint(1) - return { - kind: 'ParamDifNames_b', -} + slice.loadUint(1); + return { + kind: 'ParamDifNames_b', + } -} -; + } if (((slice.remainingBits >= 1) && ((slice.preloadUint(1) == 0b1) && (arg0 == 2)))) { - slice.loadUint(1) - let x: ParamDifNames = loadParamDifNames(slice, 2) + slice.loadUint(1); + let x: ParamDifNames = loadParamDifNames(slice, 2); + let n = paramDifNames_c_get_n(x); + return { + kind: 'ParamDifNames_c', + x: x, + n: n, + } - let n = paramDifNames_c_get_n(x) - - return { - kind: 'ParamDifNames_c', - x: x, - n: n, -} - -} -; + } if (((slice.remainingBits >= 1) && ((slice.preloadUint(1) == 0b0) && (arg0 == 3)))) { - slice.loadUint(1) - let x: ParamDifNames = loadParamDifNames(slice, 3) - - let m = paramDifNames_d_get_m(x) - - return { - kind: 'ParamDifNames_d', - x: x, - m: m, -} + slice.loadUint(1); + let x: ParamDifNames = loadParamDifNames(slice, 3); + let m = paramDifNames_d_get_m(x); + return { + kind: 'ParamDifNames_d', + x: x, + m: m, + } -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeParamDifNames(paramDifNames: ParamDifNames): (builder: Builder) => void { if ((paramDifNames.kind == 'ParamDifNames_a')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1) - -}) + return ((builder: Builder) => { + builder.storeUint(0b0, 1); + }) -} -; + } if ((paramDifNames.kind == 'ParamDifNames_b')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1) - -}) + return ((builder: Builder) => { + builder.storeUint(0b1, 1); + }) -} -; + } if ((paramDifNames.kind == 'ParamDifNames_c')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1) - - storeParamDifNames(paramDifNames.x)(builder) - -}) + return ((builder: Builder) => { + builder.storeUint(0b1, 1); + storeParamDifNames(paramDifNames.x)(builder); + }) -} -; + } if ((paramDifNames.kind == 'ParamDifNames_d')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1) - - storeParamDifNames(paramDifNames.x)(builder) - -}) + return ((builder: Builder) => { + builder.storeUint(0b0, 1); + storeParamDifNames(paramDifNames.x)(builder); + }) -} -; - throw new Error('') -; + } + throw new Error(''); } export function paramDifNamesUser_get_k(x: ParamDifNames): number { if ((x.kind == 'ParamDifNames_a')) { - return 1 -} -; + return 1 + } if ((x.kind == 'ParamDifNames_b')) { - return 1 -} -; + return 1 + } if ((x.kind == 'ParamDifNames_c')) { - let n = x.n - - return (n + 1) -} -; + let n = x.n; + return (n + 1) + } if ((x.kind == 'ParamDifNames_d')) { - let m = x.m - - return (m * 2) -} -; - throw new Error('') -; + let m = x.m; + return (m * 2) + } + throw new Error(''); } export function loadParamDifNamesUser(slice: Slice): ParamDifNamesUser { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1) - let x: ParamDifNames = loadParamDifNames(slice, 2) + slice.loadUint(1); + let x: ParamDifNames = loadParamDifNames(slice, 2); + let k = paramDifNamesUser_get_k(x); + return { + kind: 'ParamDifNamesUser', + x: x, + k: k, + } - let k = paramDifNamesUser_get_k(x) - - return { - kind: 'ParamDifNamesUser', - x: x, - k: k, -} - -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeParamDifNamesUser(paramDifNamesUser: ParamDifNamesUser): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0b0, 1) - - storeParamDifNames(paramDifNamesUser.x)(builder) - -}) + builder.storeUint(0b0, 1); + storeParamDifNames(paramDifNamesUser.x)(builder); + }) -; } export function loadNegationFromImplicit(slice: Slice): NegationFromImplicit { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1) - let t: number = slice.loadUint(32) - - let z: number = slice.loadUint(32) + slice.loadUint(1); + let t: number = slice.loadUint(32); + let z: number = slice.loadUint(32); + return { + kind: 'NegationFromImplicit', + y: (t / 2), + t: t, + z: z, + } - return { - kind: 'NegationFromImplicit', - y: (t / 2), - t: t, - z: z, -} - -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeNegationFromImplicit(negationFromImplicit: NegationFromImplicit): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0b1, 1) - - builder.storeUint(negationFromImplicit.t, 32) - - builder.storeUint(negationFromImplicit.z, 32) - -}) + builder.storeUint(0b1, 1); + builder.storeUint(negationFromImplicit.t, 32); + builder.storeUint(negationFromImplicit.z, 32); + }) -; } export function unaryUserCheckOrder_get_l(label: Unary): number { if ((label.kind == 'Unary_unary_zero')) { - return 0 -} -; + return 0 + } if ((label.kind == 'Unary_unary_succ')) { - let n = label.n - - return (n + 1) -} -; - throw new Error('') -; + let n = label.n; + return (n + 1) + } + throw new Error(''); } export function loadUnaryUserCheckOrder(slice: Slice): UnaryUserCheckOrder { - let label: Unary = loadUnary(slice) - -; - let l = unaryUserCheckOrder_get_l(label) - -; + let label: Unary = loadUnary(slice); + let l = unaryUserCheckOrder_get_l(label); return { - kind: 'UnaryUserCheckOrder', - m: (7 - l), - label: label, - l: l, -} + kind: 'UnaryUserCheckOrder', + m: (7 - l), + label: label, + l: l, + } -; } export function storeUnaryUserCheckOrder(unaryUserCheckOrder: UnaryUserCheckOrder): (builder: Builder) => void { return ((builder: Builder) => { - storeUnary(unaryUserCheckOrder.label)(builder) - -}) + storeUnary(unaryUserCheckOrder.label)(builder); + }) -; } export function loadCombArgCellRef(slice: Slice, loadX: (slice: Slice) => X ): CombArgCellRef { - let info: number = slice.loadInt(32) - -; + let info: number = slice.loadInt(32); let init: Maybe> = loadMaybe>(slice, ((slice: Slice) => { return loadEither(slice, loadX, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() - - + let slice1 = slice.loadRef().beginParse(); return slice1.loadInt(22) - }) ) - }) -) - -; +); let other: Either> = loadEither>(slice, loadX, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() - - + let slice1 = slice.loadRef().beginParse(); return loadOneComb(slice1, loadX) - }) -) - -; +); let body: Either = loadEither(slice, loadX, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() - - + let slice1 = slice.loadRef().beginParse(); return loadX(slice1) - }) -) - -; +); return { - kind: 'CombArgCellRef', - info: info, - init: init, - other: other, - body: body, -} + kind: 'CombArgCellRef', + info: info, + init: init, + other: other, + body: body, + } -; } export function storeCombArgCellRef(combArgCellRef: CombArgCellRef, storeX: (x: X) => (builder: Builder) => void ): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeInt(combArgCellRef.info, 32) - - storeMaybe>(combArgCellRef.init, ((arg: Either) => { + builder.storeInt(combArgCellRef.info, 32); + storeMaybe>(combArgCellRef.init, ((arg: Either) => { return ((builder: Builder) => { storeEither(arg, storeX, ((arg: number) => { - return ((builder: Builder) => { - let cell1 = beginCell() - - - cell1.storeInt(arg, 22) + return ((builder: Builder) => { + let cell1 = beginCell(); - builder.storeRef(cell1) - - - }) + cell1.storeInt(arg, 22); + builder.storeRef(cell1); }) - )(builder) }) - + )(builder); + }) }) - )(builder) - - storeEither>(combArgCellRef.other, storeX, ((arg: OneComb) => { + )(builder); + storeEither>(combArgCellRef.other, storeX, ((arg: OneComb) => { return ((builder: Builder) => { - let cell1 = beginCell() - + let cell1 = beginCell(); - storeOneComb(arg, storeX)(cell1) - - builder.storeRef(cell1) + storeOneComb(arg, storeX)(cell1); + builder.storeRef(cell1); }) - }) - )(builder) - - storeEither(combArgCellRef.body, storeX, ((arg: X) => { + )(builder); + storeEither(combArgCellRef.body, storeX, ((arg: X) => { return ((builder: Builder) => { - let cell1 = beginCell() - + let cell1 = beginCell(); - storeX(arg)(cell1) - - builder.storeRef(cell1) + storeX(arg)(cell1); + builder.storeRef(cell1); }) - }) - )(builder) - -}) + )(builder); + }) -; } export function loadCombArgCellRefUser(slice: Slice): CombArgCellRefUser { let x: CombArgCellRef = loadCombArgCellRef(slice, ((slice: Slice) => { return slice.loadInt(12) - }) -) - -; +); return { - kind: 'CombArgCellRefUser', - x: x, -} + kind: 'CombArgCellRefUser', + x: x, + } -; } export function storeCombArgCellRefUser(combArgCellRefUser: CombArgCellRefUser): (builder: Builder) => void { return ((builder: Builder) => { - storeCombArgCellRef(combArgCellRefUser.x, ((arg: number) => { + storeCombArgCellRef(combArgCellRefUser.x, ((arg: number) => { return ((builder: Builder) => { - builder.storeInt(arg, 12) - + builder.storeInt(arg, 12); }) - }) - )(builder) - -}) + )(builder); + }) -; } export function loadMathExprAsCombArg(slice: Slice, arg0: number): MathExprAsCombArg { - let slice1 = slice.loadRef().beginParse() - -; - let ref: BitLenArg = loadBitLenArg(slice1, ((arg0 - 2) + 2)) - -; + let slice1 = slice.loadRef().beginParse(); + let ref: BitLenArg = loadBitLenArg(slice1, ((arg0 - 2) + 2)); return { - kind: 'MathExprAsCombArg', - n: (arg0 - 2), - ref: ref, -} + kind: 'MathExprAsCombArg', + n: (arg0 - 2), + ref: ref, + } -; } export function storeMathExprAsCombArg(mathExprAsCombArg: MathExprAsCombArg): (builder: Builder) => void { return ((builder: Builder) => { - let cell1 = beginCell() - - - storeBitLenArg(mathExprAsCombArg.ref)(cell1) - - builder.storeRef(cell1) - -}) + let cell1 = beginCell(); + storeBitLenArg(mathExprAsCombArg.ref)(cell1); + builder.storeRef(cell1); + }) -; } export function loadEmptyTag(slice: Slice): EmptyTag { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xab787f76))) { - slice.loadUint(32) - let a: number = slice.loadUint(32) - - return { - kind: 'EmptyTag', - a: a, -} + slice.loadUint(32); + let a: number = slice.loadUint(32); + return { + kind: 'EmptyTag', + a: a, + } -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeEmptyTag(emptyTag: EmptyTag): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xab787f76, 32) - - builder.storeUint(emptyTag.a, 32) - -}) + builder.storeUint(0xab787f76, 32); + builder.storeUint(emptyTag.a, 32); + }) -; } export function loadSharpTag(slice: Slice): SharpTag { if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xf4))) { - slice.loadUint(8) - let x: number = slice.loadUint(32) - - return { - kind: 'SharpTag', - x: x, -} + slice.loadUint(8); + let x: number = slice.loadUint(32); + return { + kind: 'SharpTag', + x: x, + } -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeSharpTag(sharpTag: SharpTag): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xf4, 8) - - builder.storeUint(sharpTag.x, 32) - -}) + builder.storeUint(0xf4, 8); + builder.storeUint(sharpTag.x, 32); + }) -; } export function loadDollarTag(slice: Slice): DollarTag { if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0b1011))) { - slice.loadUint(4) - let x: number = slice.loadUint(32) - - return { - kind: 'DollarTag', - x: x, -} + slice.loadUint(4); + let x: number = slice.loadUint(32); + return { + kind: 'DollarTag', + x: x, + } -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeDollarTag(dollarTag: DollarTag): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0b1011, 4) - - builder.storeUint(dollarTag.x, 32) - -}) + builder.storeUint(0b1011, 4); + builder.storeUint(dollarTag.x, 32); + }) -; } export function loadTupleCheck(slice: Slice): TupleCheck { let s: Array = Array.from(Array(3).keys()).map(((arg: number) => { return slice.loadInt(5) - }) -) - -; +); return { - kind: 'TupleCheck', - s: s, -} + kind: 'TupleCheck', + s: s, + } -; } export function storeTupleCheck(tupleCheck: TupleCheck): (builder: Builder) => void { return ((builder: Builder) => { - tupleCheck.s.forEach(((arg: number) => { - builder.storeInt(arg, 5) - + tupleCheck.s.forEach(((arg: number) => { + builder.storeInt(arg, 5); + }) + ); }) - ) - -}) -; } export function hashmap_get_l(label: HmLabel): number { if ((label.kind == 'HmLabel_hml_short')) { - let n = label.n - - return n -} -; + let n = label.n; + return n + } if ((label.kind == 'HmLabel_hml_long')) { - let n = label.n - - return n -} -; + let n = label.n; + return n + } if ((label.kind == 'HmLabel_hml_same')) { - let n = label.n - - return n -} -; - throw new Error('') -; + let n = label.n; + return n + } + throw new Error(''); } export function loadHashmap(slice: Slice, n: number, loadX: (slice: Slice) => X ): Hashmap { - let label: HmLabel = loadHmLabel(slice, n) - -; - let l = hashmap_get_l(label) - -; - let node: HashmapNode = loadHashmapNode(slice, (n - l), loadX) - -; - return { - kind: 'Hashmap', - m: (n - l), - n: n, - label: label, - l: l, - node: node, -} + let label: HmLabel = loadHmLabel(slice, n); + let l = hashmap_get_l(label); + let node: HashmapNode = loadHashmapNode(slice, (n - l), loadX); + return { + kind: 'Hashmap', + m: (n - l), + n: n, + label: label, + l: l, + node: node, + } -; } export function storeHashmap(hashmap: Hashmap, storeX: (x: X) => (builder: Builder) => void ): (builder: Builder) => void { return ((builder: Builder) => { - storeHmLabel(hashmap.label)(builder) - - storeHashmapNode(hashmap.node, storeX)(builder) - -}) + storeHmLabel(hashmap.label)(builder); + storeHashmapNode(hashmap.node, storeX)(builder); + }) -; } export function loadHashmapNode(slice: Slice, arg0: number, loadX: (slice: Slice) => X ): HashmapNode { if ((arg0 == 0)) { - let value: X = loadX(slice) + let value: X = loadX(slice); + return { + kind: 'HashmapNode_hmn_leaf', + value: value, + } - return { - kind: 'HashmapNode_hmn_leaf', - value: value, -} - -} -; + } if (true) { - let slice1 = slice.loadRef().beginParse() + let slice1 = slice.loadRef().beginParse(); + let left: Hashmap = loadHashmap(slice1, (arg0 - 1), loadX); + let slice2 = slice.loadRef().beginParse(); + let right: Hashmap = loadHashmap(slice2, (arg0 - 1), loadX); + return { + kind: 'HashmapNode_hmn_fork', + n: (arg0 - 1), + left: left, + right: right, + } - let left: Hashmap = loadHashmap(slice1, (arg0 - 1), loadX) - - let slice2 = slice.loadRef().beginParse() - - let right: Hashmap = loadHashmap(slice2, (arg0 - 1), loadX) - - return { - kind: 'HashmapNode_hmn_fork', - n: (arg0 - 1), - left: left, - right: right, -} - -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeHashmapNode(hashmapNode: HashmapNode, storeX: (x: X) => (builder: Builder) => void ): (builder: Builder) => void { if ((hashmapNode.kind == 'HashmapNode_hmn_leaf')) { - return ((builder: Builder) => { - storeX(hashmapNode.value)(builder) - -}) + return ((builder: Builder) => { + storeX(hashmapNode.value)(builder); + }) -} -; + } if ((hashmapNode.kind == 'HashmapNode_hmn_fork')) { - return ((builder: Builder) => { - let cell1 = beginCell() - - - storeHashmap(hashmapNode.left, storeX)(cell1) - - builder.storeRef(cell1) - - let cell2 = beginCell() - - - storeHashmap(hashmapNode.right, storeX)(cell2) - - builder.storeRef(cell2) - -}) + return ((builder: Builder) => { + let cell1 = beginCell(); + storeHashmap(hashmapNode.left, storeX)(cell1); + builder.storeRef(cell1); + let cell2 = beginCell(); + storeHashmap(hashmapNode.right, storeX)(cell2); + builder.storeRef(cell2); + }) -} -; - throw new Error('') -; + } + throw new Error(''); } export function hmLabel_hml_short_get_n(len: Unary): number { if ((len.kind == 'Unary_unary_zero')) { - return 0 -} -; + return 0 + } if ((len.kind == 'Unary_unary_succ')) { - let n = len.n - - return (n + 1) -} -; - throw new Error('') -; + let n = len.n; + return (n + 1) + } + throw new Error(''); } export function loadHmLabel(slice: Slice, m: number): HmLabel { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1) - let len: Unary = loadUnary(slice) - - let n = hmLabel_hml_short_get_n(len) - - let s: Array = Array.from(Array(n).keys()).map(((arg: number) => { + slice.loadUint(1); + let len: Unary = loadUnary(slice); + let n = hmLabel_hml_short_get_n(len); + let s: Array = Array.from(Array(n).keys()).map(((arg: number) => { return slice.loadBits(1) - }) -) +); + if ((!(n <= m))) { + throw new Error(''); + } + return { + kind: 'HmLabel_hml_short', + m: m, + len: len, + n: n, + s: s, + } - if ((!(n <= m))) { - throw new Error('') } - return { - kind: 'HmLabel_hml_short', - m: m, - len: len, - n: n, - s: s, -} - -} -; if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b10))) { - slice.loadUint(2) - let n: number = slice.loadUint(bitLen(m)) - - let s: Array = Array.from(Array(n).keys()).map(((arg: number) => { + slice.loadUint(2); + let n: number = slice.loadUint(bitLen(m)); + let s: Array = Array.from(Array(n).keys()).map(((arg: number) => { return slice.loadBits(1) - }) -) +); + return { + kind: 'HmLabel_hml_long', + m: m, + n: n, + s: s, + } - return { - kind: 'HmLabel_hml_long', - m: m, - n: n, - s: s, -} - -} -; + } if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b11))) { - slice.loadUint(2) - let v: BitString = slice.loadBits(1) + slice.loadUint(2); + let v: BitString = slice.loadBits(1); + let n: number = slice.loadUint(bitLen(m)); + return { + kind: 'HmLabel_hml_same', + m: m, + v: v, + n: n, + } - let n: number = slice.loadUint(bitLen(m)) - - return { - kind: 'HmLabel_hml_same', - m: m, - v: v, - n: n, -} - -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeHmLabel(hmLabel: HmLabel): (builder: Builder) => void { if ((hmLabel.kind == 'HmLabel_hml_short')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1) - - storeUnary(hmLabel.len)(builder) - - hmLabel.s.forEach(((arg: BitString) => { - builder.storeBits(arg) - - }) - ) + return ((builder: Builder) => { + builder.storeUint(0b0, 1); + storeUnary(hmLabel.len)(builder); + hmLabel.s.forEach(((arg: BitString) => { + builder.storeBits(arg); + }) + ); + if ((!(hmLabel.n <= hmLabel.m))) { + throw new Error(''); + } + }) - if ((!(hmLabel.n <= hmLabel.m))) { - throw new Error('') } - -}) - -} -; if ((hmLabel.kind == 'HmLabel_hml_long')) { - return ((builder: Builder) => { - builder.storeUint(0b10, 2) - - builder.storeUint(hmLabel.n, bitLen(hmLabel.m)) - - hmLabel.s.forEach(((arg: BitString) => { - builder.storeBits(arg) - - }) - ) - -}) + return ((builder: Builder) => { + builder.storeUint(0b10, 2); + builder.storeUint(hmLabel.n, bitLen(hmLabel.m)); + hmLabel.s.forEach(((arg: BitString) => { + builder.storeBits(arg); + }) + ); + }) -} -; + } if ((hmLabel.kind == 'HmLabel_hml_same')) { - return ((builder: Builder) => { - builder.storeUint(0b11, 2) - - builder.storeBits(hmLabel.v) - - builder.storeUint(hmLabel.n, bitLen(hmLabel.m)) - -}) + return ((builder: Builder) => { + builder.storeUint(0b11, 2); + builder.storeBits(hmLabel.v); + builder.storeUint(hmLabel.n, bitLen(hmLabel.m)); + }) -} -; - throw new Error('') -; + } + throw new Error(''); } export function loadHashmapE(slice: Slice, n: number, loadX: (slice: Slice) => X ): HashmapE { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1) - return { - kind: 'HashmapE_hme_empty', - n: n, -} + slice.loadUint(1); + return { + kind: 'HashmapE_hme_empty', + n: n, + } -} -; + } if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1) - let slice1 = slice.loadRef().beginParse() - - let root: Hashmap = loadHashmap(slice1, n, loadX) - - return { - kind: 'HashmapE_hme_root', - n: n, - root: root, -} + slice.loadUint(1); + let slice1 = slice.loadRef().beginParse(); + let root: Hashmap = loadHashmap(slice1, n, loadX); + return { + kind: 'HashmapE_hme_root', + n: n, + root: root, + } -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeHashmapE(hashmapE: HashmapE, storeX: (x: X) => (builder: Builder) => void ): (builder: Builder) => void { if ((hashmapE.kind == 'HashmapE_hme_empty')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1) - -}) + return ((builder: Builder) => { + builder.storeUint(0b0, 1); + }) -} -; + } if ((hashmapE.kind == 'HashmapE_hme_root')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1) - - let cell1 = beginCell() - - - storeHashmap(hashmapE.root, storeX)(cell1) - - builder.storeRef(cell1) - -}) + return ((builder: Builder) => { + builder.storeUint(0b1, 1); + let cell1 = beginCell(); + storeHashmap(hashmapE.root, storeX)(cell1); + builder.storeRef(cell1); + }) -} -; - throw new Error('') -; + } + throw new Error(''); } export function loadHashmapEUser(slice: Slice): HashmapEUser { let x: HashmapE = loadHashmapE(slice, 8, ((slice: Slice) => { return slice.loadUint(16) - }) -) - -; +); return { - kind: 'HashmapEUser', - x: x, -} + kind: 'HashmapEUser', + x: x, + } -; } export function storeHashmapEUser(hashmapEUser: HashmapEUser): (builder: Builder) => void { return ((builder: Builder) => { - storeHashmapE(hashmapEUser.x, ((arg: number) => { + storeHashmapE(hashmapEUser.x, ((arg: number) => { return ((builder: Builder) => { - builder.storeUint(arg, 16) - + builder.storeUint(arg, 16); }) - }) - )(builder) - -}) + )(builder); + }) -; } export function loadConditionalField(slice: Slice): ConditionalField { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xdc165658))) { - slice.loadUint(32) - let a: number = slice.loadUint(1) - - let b: number | undefined = (a ? slice.loadUint(32) : undefined) - - return { - kind: 'ConditionalField', - a: a, - b: b, -} + slice.loadUint(32); + let a: number = slice.loadUint(1); + let b: number | undefined = (a ? slice.loadUint(32) : undefined); + return { + kind: 'ConditionalField', + a: a, + b: b, + } -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeConditionalField(conditionalField: ConditionalField): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xdc165658, 32) - - builder.storeUint(conditionalField.a, 1) - - if ((conditionalField.b != undefined)) { - builder.storeUint(conditionalField.b, 32) - } - -}) + builder.storeUint(0xdc165658, 32); + builder.storeUint(conditionalField.a, 1); + if ((conditionalField.b != undefined)) { + builder.storeUint(conditionalField.b, 32); + } + }) -; } export function loadBitSelection(slice: Slice): BitSelection { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xe1a2049e))) { - slice.loadUint(32) - let a: number = slice.loadUint(6) - - let b: number | undefined = ((a & (1 << 2)) ? slice.loadUint(32) : undefined) - - return { - kind: 'BitSelection', - a: a, - b: b, -} + slice.loadUint(32); + let a: number = slice.loadUint(6); + let b: number | undefined = ((a & (1 << 2)) ? slice.loadUint(32) : undefined); + return { + kind: 'BitSelection', + a: a, + b: b, + } -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeBitSelection(bitSelection: BitSelection): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xe1a2049e, 32) - - builder.storeUint(bitSelection.a, 6) - - if ((bitSelection.b != undefined)) { - builder.storeUint(bitSelection.b, 32) - } - -}) + builder.storeUint(0xe1a2049e, 32); + builder.storeUint(bitSelection.a, 6); + if ((bitSelection.b != undefined)) { + builder.storeUint(bitSelection.b, 32); + } + }) -; } export function loadImplicitCondition(slice: Slice): ImplicitCondition { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xd86a5028))) { - slice.loadUint(32) - let flags: number = slice.loadUint(10) + slice.loadUint(32); + let flags: number = slice.loadUint(10); + if ((!(flags <= 100))) { + throw new Error(''); + } + return { + kind: 'ImplicitCondition', + flags: flags, + } - if ((!(flags <= 100))) { - throw new Error('') } - return { - kind: 'ImplicitCondition', - flags: flags, -} - -} -; - throw new Error('') -; + throw new Error(''); } export function storeImplicitCondition(implicitCondition: ImplicitCondition): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xd86a5028, 32) - - builder.storeUint(implicitCondition.flags, 10) - - if ((!(implicitCondition.flags <= 100))) { - throw new Error('') - } - -}) + builder.storeUint(0xd86a5028, 32); + builder.storeUint(implicitCondition.flags, 10); + if ((!(implicitCondition.flags <= 100))) { + throw new Error(''); + } + }) -; } export function loadMultipleEmptyConstructor(slice: Slice, arg0: number): MultipleEmptyConstructor { if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x85e93c51) && (arg0 == 0)))) { - slice.loadUint(32) - let a: number = slice.loadUint(32) + slice.loadUint(32); + let a: number = slice.loadUint(32); + return { + kind: 'MultipleEmptyConstructor__', + a: a, + } - return { - kind: 'MultipleEmptyConstructor__', - a: a, -} - -} -; + } if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xc5d27bf1) && (arg0 == 1)))) { - slice.loadUint(32) - let b: number = slice.loadUint(5) - - return { - kind: 'MultipleEmptyConstructor__1', - b: b, -} + slice.loadUint(32); + let b: number = slice.loadUint(5); + return { + kind: 'MultipleEmptyConstructor__1', + b: b, + } -} -; + } if ((arg0 == 2)) { - let x: number = slice.loadUint(6) - - return { - kind: 'MultipleEmptyConstructor_a', - x: x, -} + let x: number = slice.loadUint(6); + return { + kind: 'MultipleEmptyConstructor_a', + x: x, + } -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeMultipleEmptyConstructor(multipleEmptyConstructor: MultipleEmptyConstructor): (builder: Builder) => void { if ((multipleEmptyConstructor.kind == 'MultipleEmptyConstructor__')) { - return ((builder: Builder) => { - builder.storeUint(0x85e93c51, 32) - - builder.storeUint(multipleEmptyConstructor.a, 32) - -}) + return ((builder: Builder) => { + builder.storeUint(0x85e93c51, 32); + builder.storeUint(multipleEmptyConstructor.a, 32); + }) -} -; + } if ((multipleEmptyConstructor.kind == 'MultipleEmptyConstructor__1')) { - return ((builder: Builder) => { - builder.storeUint(0xc5d27bf1, 32) - - builder.storeUint(multipleEmptyConstructor.b, 5) - -}) + return ((builder: Builder) => { + builder.storeUint(0xc5d27bf1, 32); + builder.storeUint(multipleEmptyConstructor.b, 5); + }) -} -; + } if ((multipleEmptyConstructor.kind == 'MultipleEmptyConstructor_a')) { - return ((builder: Builder) => { - builder.storeUint(multipleEmptyConstructor.x, 6) - -}) + return ((builder: Builder) => { + builder.storeUint(multipleEmptyConstructor.x, 6); + }) -} -; - throw new Error('') -; + } + throw new Error(''); } export function loadTrue(slice: Slice): True { return { - kind: 'True', -} + kind: 'True', + } -; } export function storeTrue(true0: True): (builder: Builder) => void { return ((builder: Builder) => { -}) + }) -; } export function loadParamNamedArgInSecondConstr(slice: Slice, arg0: number): ParamNamedArgInSecondConstr { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1) - return { - kind: 'ParamNamedArgInSecondConstr_a', - n: arg0, -} + slice.loadUint(1); + return { + kind: 'ParamNamedArgInSecondConstr_a', + n: arg0, + } -} -; + } if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) { - slice.loadUint(1) - return { - kind: 'ParamNamedArgInSecondConstr_b', - n: (arg0 - 1), -} + slice.loadUint(1); + return { + kind: 'ParamNamedArgInSecondConstr_b', + n: (arg0 - 1), + } -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeParamNamedArgInSecondConstr(paramNamedArgInSecondConstr: ParamNamedArgInSecondConstr): (builder: Builder) => void { if ((paramNamedArgInSecondConstr.kind == 'ParamNamedArgInSecondConstr_a')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1) - -}) + return ((builder: Builder) => { + builder.storeUint(0b0, 1); + }) -} -; + } if ((paramNamedArgInSecondConstr.kind == 'ParamNamedArgInSecondConstr_b')) { - return ((builder: Builder) => { - builder.storeUint(0b1, 1) - -}) + return ((builder: Builder) => { + builder.storeUint(0b1, 1); + }) -} -; - throw new Error('') -; + } + throw new Error(''); } export function loadRefCombinatorAny(slice: Slice): RefCombinatorAny { - let slice1 = slice.loadRef().beginParse() - -; + let slice1 = slice.loadRef().beginParse(); let msg: Maybe = loadMaybe(slice1, ((slice: Slice) => { return slice - }) -) - -; +); return { - kind: 'RefCombinatorAny', - msg: msg, -} + kind: 'RefCombinatorAny', + msg: msg, + } -; } export function storeRefCombinatorAny(refCombinatorAny: RefCombinatorAny): (builder: Builder) => void { return ((builder: Builder) => { - let cell1 = beginCell() - - - storeMaybe(refCombinatorAny.msg, ((arg: Slice) => { + let cell1 = beginCell(); + storeMaybe(refCombinatorAny.msg, ((arg: Slice) => { return ((builder: Builder) => { - cell1.storeSlice(arg) - + cell1.storeSlice(arg); }) - }) - )(cell1) - - builder.storeRef(cell1) - -}) + )(cell1); + builder.storeRef(cell1); + }) -; } export function loadEqualityExpression(slice: Slice): EqualityExpression { - let n: number = slice.loadUint(32) - -; + let n: number = slice.loadUint(32); if ((!((5 + n) == 7))) { - throw new Error('') -} -; + throw new Error(''); + } return { - kind: 'EqualityExpression', - n: n, -} + kind: 'EqualityExpression', + n: n, + } -; } export function storeEqualityExpression(equalityExpression: EqualityExpression): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(equalityExpression.n, 32) - - if ((!((5 + equalityExpression.n) == 7))) { - throw new Error('') - } - -}) + builder.storeUint(equalityExpression.n, 32); + if ((!((5 + equalityExpression.n) == 7))) { + throw new Error(''); + } + }) -; } export function loadConditionalRef(slice: Slice): ConditionalRef { - let x: number = slice.loadUint(1) - -; + let x: number = slice.loadUint(1); let y: Simple | undefined = (x ? ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse() - - + let slice1 = slice.loadRef().beginParse(); return loadSimple(slice1) - }) -(slice) : undefined) - -; +(slice) : undefined); return { - kind: 'ConditionalRef', - x: x, - y: y, -} + kind: 'ConditionalRef', + x: x, + y: y, + } -; } export function storeConditionalRef(conditionalRef: ConditionalRef): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(conditionalRef.x, 1) - - if ((conditionalRef.y != undefined)) { - let cell1 = beginCell() - + builder.storeUint(conditionalRef.x, 1); + if ((conditionalRef.y != undefined)) { + let cell1 = beginCell(); - storeSimple(conditionalRef.y)(cell1) + storeSimple(conditionalRef.y)(cell1); - builder.storeRef(cell1) + builder.storeRef(cell1); - } - -}) + } + }) -; } export function loadLoadFromNegationOutsideExpr(slice: Slice): LoadFromNegationOutsideExpr { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x9bc7a987))) { - slice.loadUint(32) - let seq_no: number = slice.loadUint(32) + slice.loadUint(32); + let seq_no: number = slice.loadUint(32); + return { + kind: 'LoadFromNegationOutsideExpr', + prev_seq_no: (seq_no - 1), + seq_no: seq_no, + } - return { - kind: 'LoadFromNegationOutsideExpr', - prev_seq_no: (seq_no - 1), - seq_no: seq_no, -} - -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeLoadFromNegationOutsideExpr(loadFromNegationOutsideExpr: LoadFromNegationOutsideExpr): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0x9bc7a987, 32) - - builder.storeUint(loadFromNegationOutsideExpr.seq_no, 32) - -}) + builder.storeUint(0x9bc7a987, 32); + builder.storeUint(loadFromNegationOutsideExpr.seq_no, 32); + }) -; } export function loadAnonymousData(slice: Slice): AnonymousData { - let anon0: number = slice.loadUint(1) - -; + let anon0: number = slice.loadUint(1); return { - kind: 'AnonymousData', - anon0: anon0, -} + kind: 'AnonymousData', + anon0: anon0, + } -; } export function storeAnonymousData(anonymousData: AnonymousData): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(anonymousData.anon0, 1) - -}) + builder.storeUint(anonymousData.anon0, 1); + }) -; } export function loadFalseAnonField(slice: Slice): FalseAnonField { if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x0201))) { - slice.loadUint(16) - let value: number = slice.loadInt(257) - - return { - kind: 'FalseAnonField', - value: value, -} + slice.loadUint(16); + let value: number = slice.loadInt(257); + return { + kind: 'FalseAnonField', + value: value, + } -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeFalseAnonField(falseAnonField: FalseAnonField): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0x0201, 16) - - builder.storeInt(falseAnonField.value, 257) - -}) + builder.storeUint(0x0201, 16); + builder.storeInt(falseAnonField.value, 257); + }) -; } export function loadConstructorOrder(slice: Slice): ConstructorOrder { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xc6cc03c3))) { - slice.loadUint(32) - let anon0: Simple = loadSimple(slice) + slice.loadUint(32); + let anon0: Simple = loadSimple(slice); + return { + kind: 'ConstructorOrder__', + anon0: anon0, + } - return { - kind: 'ConstructorOrder__', - anon0: anon0, -} - -} -; + } if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { - slice.loadUint(1) - let a: Simple = loadSimple(slice) - - return { - kind: 'ConstructorOrder_a', - a: a, -} + slice.loadUint(1); + let a: Simple = loadSimple(slice); + return { + kind: 'ConstructorOrder_a', + a: a, + } -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeConstructorOrder(constructorOrder: ConstructorOrder): (builder: Builder) => void { if ((constructorOrder.kind == 'ConstructorOrder__')) { - return ((builder: Builder) => { - builder.storeUint(0xc6cc03c3, 32) - - storeSimple(constructorOrder.anon0)(builder) - -}) + return ((builder: Builder) => { + builder.storeUint(0xc6cc03c3, 32); + storeSimple(constructorOrder.anon0)(builder); + }) -} -; + } if ((constructorOrder.kind == 'ConstructorOrder_a')) { - return ((builder: Builder) => { - builder.storeUint(0b0, 1) - - storeSimple(constructorOrder.a)(builder) - -}) + return ((builder: Builder) => { + builder.storeUint(0b0, 1); + storeSimple(constructorOrder.a)(builder); + }) -} -; - throw new Error('') -; + } + throw new Error(''); } export function loadCheckCrc32(slice: Slice): CheckCrc32 { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xd6e7c617))) { - slice.loadUint(32) - let a: number = slice.loadUint(32) - - return { - kind: 'CheckCrc32_a', - a: a, -} + slice.loadUint(32); + let a: number = slice.loadUint(32); + return { + kind: 'CheckCrc32_a', + a: a, + } -} -; + } if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xde1cb606))) { - slice.loadUint(32) - let b: number = slice.loadUint(32) - - let c: number = slice.loadUint(32) + slice.loadUint(32); + let b: number = slice.loadUint(32); + let c: number = slice.loadUint(32); + return { + kind: 'CheckCrc32_b', + b: b, + c: c, + } - return { - kind: 'CheckCrc32_b', - b: b, - c: c, -} - -} -; - throw new Error('') -; + } + throw new Error(''); } export function storeCheckCrc32(checkCrc32: CheckCrc32): (builder: Builder) => void { if ((checkCrc32.kind == 'CheckCrc32_a')) { - return ((builder: Builder) => { - builder.storeUint(0xd6e7c617, 32) - - builder.storeUint(checkCrc32.a, 32) - -}) + return ((builder: Builder) => { + builder.storeUint(0xd6e7c617, 32); + builder.storeUint(checkCrc32.a, 32); + }) -} -; + } if ((checkCrc32.kind == 'CheckCrc32_b')) { - return ((builder: Builder) => { - builder.storeUint(0xde1cb606, 32) - - builder.storeUint(checkCrc32.b, 32) - - builder.storeUint(checkCrc32.c, 32) - -}) + return ((builder: Builder) => { + builder.storeUint(0xde1cb606, 32); + builder.storeUint(checkCrc32.b, 32); + builder.storeUint(checkCrc32.c, 32); + }) -} -; - throw new Error('') -; + } + throw new Error(''); } export function loadCheckKeyword(slice: Slice): CheckKeyword { - let const0: number = slice.loadUint(32) - -; + let const0: number = slice.loadUint(32); return { - kind: 'CheckKeyword', - const0: const0, -} + kind: 'CheckKeyword', + const0: const0, + } -; } export function storeCheckKeyword(checkKeyword: CheckKeyword): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(checkKeyword.const0, 32) - -}) + builder.storeUint(checkKeyword.const0, 32); + }) -; } diff --git a/src/codegen/tsgen.ts b/src/codegen/tsgen.ts index d3ac987..16dd1d0 100644 --- a/src/codegen/tsgen.ts +++ b/src/codegen/tsgen.ts @@ -337,7 +337,7 @@ export function toCode(node: TheNode, code: CodeBuilder = new CodeBuilder()): Co code.add(`)${node.returnType ? ': ' + toCode(node.returnType).render() : ''} {`) code.inTab(() => { node.body.forEach((statement) => { - code.add(toCode(statement).render() + ';'); + toCode(statement, code); }) }); code.add('}') @@ -349,7 +349,7 @@ export function toCode(node: TheNode, code: CodeBuilder = new CodeBuilder()): Co code.add(`) => {`) code.inTab(() => { node.body.forEach(statement => { - code.append(toCode(statement)); + toCode(statement, code); }) }) code.add(`})`) @@ -372,7 +372,7 @@ export function toCode(node: TheNode, code: CodeBuilder = new CodeBuilder()): Co } if (node.type == "DeclareVariable") { - code.add(`let ${toCode(node.name).render()}${node.typeName ? ': ' + toCode(node.typeName).render() : ''}${node.init ? ' = ' + toCode(node.init).render() : ''}`) + code.add(`let ${toCode(node.name).render()}${node.typeName ? ': ' + toCode(node.typeName).render() : ''}${node.init ? ' = ' + toCode(node.init).render() : ''}`, false) } if (node.type == "ObjectExpression") { @@ -392,11 +392,12 @@ export function toCode(node: TheNode, code: CodeBuilder = new CodeBuilder()): Co } if (node.type == "ReturnStatement") { - code.add(`return ${toCode(node.returnValue).render()}`) + code.add(`return `, false) + code.appendInline(toCode(node.returnValue)) } if (node.type == "ExpressionStatement") { - code.add(toCode(node.expression).render()) + code.add(toCode(node.expression).render() + ';') } if (node.type == "TypeParametersExpression") { From 9784fc9f68a319ce601905e25e76eff7571adf4b Mon Sep 17 00:00:00 2001 From: polyprogrammist Date: Tue, 12 Dec 2023 00:21:52 -0500 Subject: [PATCH 07/10] tmp --- generated_block.ts | 172 +++++++++++-------------------------------- generated_test.ts | 59 ++++----------- src/codegen/tsgen.ts | 2 +- 3 files changed, 61 insertions(+), 172 deletions(-) diff --git a/generated_block.ts b/generated_block.ts index d22db74..992dc88 100644 --- a/generated_block.ts +++ b/generated_block.ts @@ -2486,8 +2486,7 @@ export function storeBoolTrue(boolTrue: BoolTrue): (builder: Builder) => void { } -export function loadMaybe(slice: Slice, loadX: (slice: Slice) => X -): Maybe { +export function loadMaybe(slice: Slice, loadX: (slice: Slice) => X): Maybe { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { slice.loadUint(1); return { @@ -2507,9 +2506,7 @@ export function loadMaybe(slice: Slice, loadX: (slice: Slice) => X throw new Error(''); } -export function storeMaybe(maybe: Maybe, storeX: (x: X) => (builder: Builder) => void - -): (builder: Builder) => void { +export function storeMaybe(maybe: Maybe, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void { if ((maybe.kind == 'Maybe_nothing')) { return ((builder: Builder) => { builder.storeUint(0b0, 1); @@ -2526,9 +2523,7 @@ export function storeMaybe(maybe: Maybe, storeX: (x: X) => (builder: Build throw new Error(''); } -export function loadEither(slice: Slice, loadX: (slice: Slice) => X -, loadY: (slice: Slice) => Y -): Either { +export function loadEither(slice: Slice, loadX: (slice: Slice) => X, loadY: (slice: Slice) => Y): Either { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { slice.loadUint(1); let value: X = loadX(slice); @@ -2550,11 +2545,7 @@ export function loadEither(slice: Slice, loadX: (slice: Slice) => X throw new Error(''); } -export function storeEither(either: Either, storeX: (x: X) => (builder: Builder) => void - -, storeY: (y: Y) => (builder: Builder) => void - -): (builder: Builder) => void { +export function storeEither(either: Either, storeX: (x: X) => (builder: Builder) => void, storeY: (y: Y) => (builder: Builder) => void): (builder: Builder) => void { if ((either.kind == 'Either_left')) { return ((builder: Builder) => { builder.storeUint(0b0, 1); @@ -2572,9 +2563,7 @@ export function storeEither(either: Either, storeX: (x: X) => (build throw new Error(''); } -export function loadBoth(slice: Slice, loadX: (slice: Slice) => X -, loadY: (slice: Slice) => Y -): Both { +export function loadBoth(slice: Slice, loadX: (slice: Slice) => X, loadY: (slice: Slice) => Y): Both { let first: X = loadX(slice); let second: Y = loadY(slice); return { @@ -2585,11 +2574,7 @@ export function loadBoth(slice: Slice, loadX: (slice: Slice) => X } -export function storeBoth(both: Both, storeX: (x: X) => (builder: Builder) => void - -, storeY: (y: Y) => (builder: Builder) => void - -): (builder: Builder) => void { +export function storeBoth(both: Both, storeX: (x: X) => (builder: Builder) => void, storeY: (y: Y) => (builder: Builder) => void): (builder: Builder) => void { return ((builder: Builder) => { storeX(both.first)(builder); storeY(both.second)(builder); @@ -2629,8 +2614,7 @@ export function hashmap_get_l(label: HmLabel): number { throw new Error(''); } -export function loadHashmap(slice: Slice, n: number, loadX: (slice: Slice) => X -): Hashmap { +export function loadHashmap(slice: Slice, n: number, loadX: (slice: Slice) => X): Hashmap { let label: HmLabel = loadHmLabel(slice, n); let l = hashmap_get_l(label); let node: HashmapNode = loadHashmapNode(slice, (n - l), loadX); @@ -2645,9 +2629,7 @@ export function loadHashmap(slice: Slice, n: number, loadX: (slice: Slice) => } -export function storeHashmap(hashmap: Hashmap, storeX: (x: X) => (builder: Builder) => void - -): (builder: Builder) => void { +export function storeHashmap(hashmap: Hashmap, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void { return ((builder: Builder) => { storeHmLabel(hashmap.label)(builder); storeHashmapNode(hashmap.node, storeX)(builder); @@ -2655,8 +2637,7 @@ export function storeHashmap(hashmap: Hashmap, storeX: (x: X) => (builder: } -export function loadHashmapNode(slice: Slice, arg0: number, loadX: (slice: Slice) => X -): HashmapNode { +export function loadHashmapNode(slice: Slice, arg0: number, loadX: (slice: Slice) => X): HashmapNode { if ((arg0 == 0)) { let value: X = loadX(slice); return { @@ -2681,9 +2662,7 @@ export function loadHashmapNode(slice: Slice, arg0: number, loadX: (slice: Sl throw new Error(''); } -export function storeHashmapNode(hashmapNode: HashmapNode, storeX: (x: X) => (builder: Builder) => void - -): (builder: Builder) => void { +export function storeHashmapNode(hashmapNode: HashmapNode, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void { if ((hashmapNode.kind == 'HashmapNode_hmn_leaf')) { return ((builder: Builder) => { storeX(hashmapNode.value)(builder); @@ -2853,8 +2832,7 @@ export function storeUnary(unary: Unary): (builder: Builder) => void { throw new Error(''); } -export function loadHashmapE(slice: Slice, n: number, loadX: (slice: Slice) => X -): HashmapE { +export function loadHashmapE(slice: Slice, n: number, loadX: (slice: Slice) => X): HashmapE { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { slice.loadUint(1); return { @@ -2877,9 +2855,7 @@ export function loadHashmapE(slice: Slice, n: number, loadX: (slice: Slice) = throw new Error(''); } -export function storeHashmapE(hashmapE: HashmapE, storeX: (x: X) => (builder: Builder) => void - -): (builder: Builder) => void { +export function storeHashmapE(hashmapE: HashmapE, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void { if ((hashmapE.kind == 'HashmapE_hme_empty')) { return ((builder: Builder) => { builder.storeUint(0b0, 1); @@ -2936,9 +2912,7 @@ export function hashmapAug_get_l(label: HmLabel): number { throw new Error(''); } -export function loadHashmapAug(slice: Slice, n: number, loadX: (slice: Slice) => X -, loadY: (slice: Slice) => Y -): HashmapAug { +export function loadHashmapAug(slice: Slice, n: number, loadX: (slice: Slice) => X, loadY: (slice: Slice) => Y): HashmapAug { let label: HmLabel = loadHmLabel(slice, n); let l = hashmapAug_get_l(label); let node: HashmapAugNode = loadHashmapAugNode(slice, (n - l), loadX, loadY); @@ -2953,11 +2927,7 @@ export function loadHashmapAug(slice: Slice, n: number, loadX: (slice: Sli } -export function storeHashmapAug(hashmapAug: HashmapAug, storeX: (x: X) => (builder: Builder) => void - -, storeY: (y: Y) => (builder: Builder) => void - -): (builder: Builder) => void { +export function storeHashmapAug(hashmapAug: HashmapAug, storeX: (x: X) => (builder: Builder) => void, storeY: (y: Y) => (builder: Builder) => void): (builder: Builder) => void { return ((builder: Builder) => { storeHmLabel(hashmapAug.label)(builder); storeHashmapAugNode(hashmapAug.node, storeX, storeY)(builder); @@ -2965,9 +2935,7 @@ export function storeHashmapAug(hashmapAug: HashmapAug, storeX: (x: } -export function loadHashmapAugNode(slice: Slice, arg0: number, loadX: (slice: Slice) => X -, loadY: (slice: Slice) => Y -): HashmapAugNode { +export function loadHashmapAugNode(slice: Slice, arg0: number, loadX: (slice: Slice) => X, loadY: (slice: Slice) => Y): HashmapAugNode { if ((arg0 == 0)) { let extra: Y = loadY(slice); let value: X = loadX(slice); @@ -2996,11 +2964,7 @@ export function loadHashmapAugNode(slice: Slice, arg0: number, loadX: (sli throw new Error(''); } -export function storeHashmapAugNode(hashmapAugNode: HashmapAugNode, storeX: (x: X) => (builder: Builder) => void - -, storeY: (y: Y) => (builder: Builder) => void - -): (builder: Builder) => void { +export function storeHashmapAugNode(hashmapAugNode: HashmapAugNode, storeX: (x: X) => (builder: Builder) => void, storeY: (y: Y) => (builder: Builder) => void): (builder: Builder) => void { if ((hashmapAugNode.kind == 'HashmapAugNode_ahmn_leaf')) { return ((builder: Builder) => { storeY(hashmapAugNode.extra)(builder); @@ -3023,9 +2987,7 @@ export function storeHashmapAugNode(hashmapAugNode: HashmapAugNode, throw new Error(''); } -export function loadHashmapAugE(slice: Slice, n: number, loadX: (slice: Slice) => X -, loadY: (slice: Slice) => Y -): HashmapAugE { +export function loadHashmapAugE(slice: Slice, n: number, loadX: (slice: Slice) => X, loadY: (slice: Slice) => Y): HashmapAugE { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { slice.loadUint(1); let extra: Y = loadY(slice); @@ -3052,11 +3014,7 @@ export function loadHashmapAugE(slice: Slice, n: number, loadX: (slice: Sl throw new Error(''); } -export function storeHashmapAugE(hashmapAugE: HashmapAugE, storeX: (x: X) => (builder: Builder) => void - -, storeY: (y: Y) => (builder: Builder) => void - -): (builder: Builder) => void { +export function storeHashmapAugE(hashmapAugE: HashmapAugE, storeX: (x: X) => (builder: Builder) => void, storeY: (y: Y) => (builder: Builder) => void): (builder: Builder) => void { if ((hashmapAugE.kind == 'HashmapAugE_ahme_empty')) { return ((builder: Builder) => { builder.storeUint(0b0, 1); @@ -3093,8 +3051,7 @@ export function varHashmap_get_l(label: HmLabel): number { throw new Error(''); } -export function loadVarHashmap(slice: Slice, n: number, loadX: (slice: Slice) => X -): VarHashmap { +export function loadVarHashmap(slice: Slice, n: number, loadX: (slice: Slice) => X): VarHashmap { let label: HmLabel = loadHmLabel(slice, n); let l = varHashmap_get_l(label); let node: VarHashmapNode = loadVarHashmapNode(slice, (n - l), loadX); @@ -3109,9 +3066,7 @@ export function loadVarHashmap(slice: Slice, n: number, loadX: (slice: Slice) } -export function storeVarHashmap(varHashmap: VarHashmap, storeX: (x: X) => (builder: Builder) => void - -): (builder: Builder) => void { +export function storeVarHashmap(varHashmap: VarHashmap, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void { return ((builder: Builder) => { storeHmLabel(varHashmap.label)(builder); storeVarHashmapNode(varHashmap.node, storeX)(builder); @@ -3119,8 +3074,7 @@ export function storeVarHashmap(varHashmap: VarHashmap, storeX: (x: X) => } -export function loadVarHashmapNode(slice: Slice, arg0: number, loadX: (slice: Slice) => X -): VarHashmapNode { +export function loadVarHashmapNode(slice: Slice, arg0: number, loadX: (slice: Slice) => X): VarHashmapNode { if (((slice.remainingBits >= 2) && (slice.preloadUint(2) == 0b00))) { slice.loadUint(2); let value: X = loadX(slice); @@ -3165,9 +3119,7 @@ export function loadVarHashmapNode(slice: Slice, arg0: number, loadX: (slice: throw new Error(''); } -export function storeVarHashmapNode(varHashmapNode: VarHashmapNode, storeX: (x: X) => (builder: Builder) => void - -): (builder: Builder) => void { +export function storeVarHashmapNode(varHashmapNode: VarHashmapNode, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void { if ((varHashmapNode.kind == 'VarHashmapNode_vhmn_leaf')) { return ((builder: Builder) => { builder.storeUint(0b00, 2); @@ -3202,8 +3154,7 @@ export function storeVarHashmapNode(varHashmapNode: VarHashmapNode, storeX throw new Error(''); } -export function loadVarHashmapE(slice: Slice, n: number, loadX: (slice: Slice) => X -): VarHashmapE { +export function loadVarHashmapE(slice: Slice, n: number, loadX: (slice: Slice) => X): VarHashmapE { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { slice.loadUint(1); return { @@ -3226,9 +3177,7 @@ export function loadVarHashmapE(slice: Slice, n: number, loadX: (slice: Slice throw new Error(''); } -export function storeVarHashmapE(varHashmapE: VarHashmapE, storeX: (x: X) => (builder: Builder) => void - -): (builder: Builder) => void { +export function storeVarHashmapE(varHashmapE: VarHashmapE, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void { if ((varHashmapE.kind == 'VarHashmapE_vhme_empty')) { return ((builder: Builder) => { builder.storeUint(0b0, 1); @@ -3263,8 +3212,7 @@ export function pfxHashmap_get_l(label: HmLabel): number { throw new Error(''); } -export function loadPfxHashmap(slice: Slice, n: number, loadX: (slice: Slice) => X -): PfxHashmap { +export function loadPfxHashmap(slice: Slice, n: number, loadX: (slice: Slice) => X): PfxHashmap { let label: HmLabel = loadHmLabel(slice, n); let l = pfxHashmap_get_l(label); let node: PfxHashmapNode = loadPfxHashmapNode(slice, (n - l), loadX); @@ -3279,9 +3227,7 @@ export function loadPfxHashmap(slice: Slice, n: number, loadX: (slice: Slice) } -export function storePfxHashmap(pfxHashmap: PfxHashmap, storeX: (x: X) => (builder: Builder) => void - -): (builder: Builder) => void { +export function storePfxHashmap(pfxHashmap: PfxHashmap, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void { return ((builder: Builder) => { storeHmLabel(pfxHashmap.label)(builder); storePfxHashmapNode(pfxHashmap.node, storeX)(builder); @@ -3289,8 +3235,7 @@ export function storePfxHashmap(pfxHashmap: PfxHashmap, storeX: (x: X) => } -export function loadPfxHashmapNode(slice: Slice, arg0: number, loadX: (slice: Slice) => X -): PfxHashmapNode { +export function loadPfxHashmapNode(slice: Slice, arg0: number, loadX: (slice: Slice) => X): PfxHashmapNode { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { slice.loadUint(1); let value: X = loadX(slice); @@ -3318,9 +3263,7 @@ export function loadPfxHashmapNode(slice: Slice, arg0: number, loadX: (slice: throw new Error(''); } -export function storePfxHashmapNode(pfxHashmapNode: PfxHashmapNode, storeX: (x: X) => (builder: Builder) => void - -): (builder: Builder) => void { +export function storePfxHashmapNode(pfxHashmapNode: PfxHashmapNode, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void { if ((pfxHashmapNode.kind == 'PfxHashmapNode_phmn_leaf')) { return ((builder: Builder) => { builder.storeUint(0b0, 1); @@ -3343,8 +3286,7 @@ export function storePfxHashmapNode(pfxHashmapNode: PfxHashmapNode, storeX throw new Error(''); } -export function loadPfxHashmapE(slice: Slice, n: number, loadX: (slice: Slice) => X -): PfxHashmapE { +export function loadPfxHashmapE(slice: Slice, n: number, loadX: (slice: Slice) => X): PfxHashmapE { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { slice.loadUint(1); return { @@ -3367,9 +3309,7 @@ export function loadPfxHashmapE(slice: Slice, n: number, loadX: (slice: Slice throw new Error(''); } -export function storePfxHashmapE(pfxHashmapE: PfxHashmapE, storeX: (x: X) => (builder: Builder) => void - -): (builder: Builder) => void { +export function storePfxHashmapE(pfxHashmapE: PfxHashmapE, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void { if ((pfxHashmapE.kind == 'PfxHashmapE_phme_empty')) { return ((builder: Builder) => { builder.storeUint(0b0, 1); @@ -3935,8 +3875,7 @@ export function storeSimpleLib(simpleLib: SimpleLib): (builder: Builder) => void } -export function loadMessage(slice: Slice, loadX: (slice: Slice) => X -): Message { +export function loadMessage(slice: Slice, loadX: (slice: Slice) => X): Message { let info: CommonMsgInfo = loadCommonMsgInfo(slice); let init: Maybe> = loadMaybe>(slice, ((slice: Slice) => { return loadEither(slice, loadStateInit, ((slice: Slice) => { @@ -3960,9 +3899,7 @@ export function loadMessage(slice: Slice, loadX: (slice: Slice) => X } -export function storeMessage(message: Message, storeX: (x: X) => (builder: Builder) => void - -): (builder: Builder) => void { +export function storeMessage(message: Message, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void { return ((builder: Builder) => { storeCommonMsgInfo(message.info)(builder); storeMaybe>(message.init, ((arg: Either) => { @@ -3999,8 +3936,7 @@ export function storeMessage(message: Message, storeX: (x: X) => (builder: } -export function loadMessageRelaxed(slice: Slice, loadX: (slice: Slice) => X -): MessageRelaxed { +export function loadMessageRelaxed(slice: Slice, loadX: (slice: Slice) => X): MessageRelaxed { let info: CommonMsgInfoRelaxed = loadCommonMsgInfoRelaxed(slice); let init: Maybe> = loadMaybe>(slice, ((slice: Slice) => { return loadEither(slice, loadStateInit, ((slice: Slice) => { @@ -4024,9 +3960,7 @@ export function loadMessageRelaxed(slice: Slice, loadX: (slice: Slice) => X } -export function storeMessageRelaxed(messageRelaxed: MessageRelaxed, storeX: (x: X) => (builder: Builder) => void - -): (builder: Builder) => void { +export function storeMessageRelaxed(messageRelaxed: MessageRelaxed, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void { return ((builder: Builder) => { storeCommonMsgInfoRelaxed(messageRelaxed.info)(builder); storeMaybe>(messageRelaxed.init, ((arg: Either) => { @@ -5284,8 +5218,7 @@ export function storeTransaction(transaction: Transaction): (builder: Builder) = } -export function loadMERKLE_UPDATE(slice: Slice, loadX: (slice: Slice) => X -): MERKLE_UPDATE { +export function loadMERKLE_UPDATE(slice: Slice, loadX: (slice: Slice) => X): MERKLE_UPDATE { if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x02))) { slice.loadUint(8); let old_hash: BitString = slice.loadBits(256); @@ -5306,9 +5239,7 @@ export function loadMERKLE_UPDATE(slice: Slice, loadX: (slice: Slice) => X throw new Error(''); } -export function storeMERKLE_UPDATE(mERKLE_UPDATE: MERKLE_UPDATE, storeX: (x: X) => (builder: Builder) => void - -): (builder: Builder) => void { +export function storeMERKLE_UPDATE(mERKLE_UPDATE: MERKLE_UPDATE, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void { return ((builder: Builder) => { builder.storeUint(0x02, 8); builder.storeBits(mERKLE_UPDATE.old_hash); @@ -5323,8 +5254,7 @@ export function storeMERKLE_UPDATE(mERKLE_UPDATE: MERKLE_UPDATE, storeX: ( } -export function loadHASH_UPDATE(slice: Slice, loadX: (slice: Slice) => X -): HASH_UPDATE { +export function loadHASH_UPDATE(slice: Slice, loadX: (slice: Slice) => X): HASH_UPDATE { if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x72))) { slice.loadUint(8); let old_hash: BitString = slice.loadBits(256); @@ -5339,9 +5269,7 @@ export function loadHASH_UPDATE(slice: Slice, loadX: (slice: Slice) => X throw new Error(''); } -export function storeHASH_UPDATE(hASH_UPDATE: HASH_UPDATE, storeX: (x: X) => (builder: Builder) => void - -): (builder: Builder) => void { +export function storeHASH_UPDATE(hASH_UPDATE: HASH_UPDATE, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void { return ((builder: Builder) => { builder.storeUint(0x72, 8); builder.storeBits(hASH_UPDATE.old_hash); @@ -5350,8 +5278,7 @@ export function storeHASH_UPDATE(hASH_UPDATE: HASH_UPDATE, storeX: (x: X) } -export function loadMERKLE_PROOF(slice: Slice, loadX: (slice: Slice) => X -): MERKLE_PROOF { +export function loadMERKLE_PROOF(slice: Slice, loadX: (slice: Slice) => X): MERKLE_PROOF { if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x03))) { slice.loadUint(8); let virtual_hash: BitString = slice.loadBits(256); @@ -5369,9 +5296,7 @@ export function loadMERKLE_PROOF(slice: Slice, loadX: (slice: Slice) => X throw new Error(''); } -export function storeMERKLE_PROOF(mERKLE_PROOF: MERKLE_PROOF, storeX: (x: X) => (builder: Builder) => void - -): (builder: Builder) => void { +export function storeMERKLE_PROOF(mERKLE_PROOF: MERKLE_PROOF, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void { return ((builder: Builder) => { builder.storeUint(0x03, 8); builder.storeBits(mERKLE_PROOF.virtual_hash); @@ -6944,8 +6869,7 @@ export function storeValueFlow(valueFlow: ValueFlow): (builder: Builder) => void } -export function loadBinTree(slice: Slice, loadX: (slice: Slice) => X -): BinTree { +export function loadBinTree(slice: Slice, loadX: (slice: Slice) => X): BinTree { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { slice.loadUint(1); let leaf: X = loadX(slice); @@ -6971,9 +6895,7 @@ export function loadBinTree(slice: Slice, loadX: (slice: Slice) => X throw new Error(''); } -export function storeBinTree(binTree: BinTree, storeX: (x: X) => (builder: Builder) => void - -): (builder: Builder) => void { +export function storeBinTree(binTree: BinTree, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void { if ((binTree.kind == 'BinTree_bt_leaf')) { return ((builder: Builder) => { builder.storeUint(0b0, 1); @@ -7254,9 +7176,7 @@ export function storeShardHashes(shardHashes: ShardHashes): (builder: Builder) = } -export function loadBinTreeAug(slice: Slice, loadX: (slice: Slice) => X -, loadY: (slice: Slice) => Y -): BinTreeAug { +export function loadBinTreeAug(slice: Slice, loadX: (slice: Slice) => X, loadY: (slice: Slice) => Y): BinTreeAug { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { slice.loadUint(1); let extra: Y = loadY(slice); @@ -7286,11 +7206,7 @@ export function loadBinTreeAug(slice: Slice, loadX: (slice: Slice) => X throw new Error(''); } -export function storeBinTreeAug(binTreeAug: BinTreeAug, storeX: (x: X) => (builder: Builder) => void - -, storeY: (y: Y) => (builder: Builder) => void - -): (builder: Builder) => void { +export function storeBinTreeAug(binTreeAug: BinTreeAug, storeX: (x: X) => (builder: Builder) => void, storeY: (y: Y) => (builder: Builder) => void): (builder: Builder) => void { if ((binTreeAug.kind == 'BinTreeAug_bta_leaf')) { return ((builder: Builder) => { builder.storeUint(0b0, 1); diff --git a/generated_test.ts b/generated_test.ts index 75eb7ad..9f24515 100644 --- a/generated_test.ts +++ b/generated_test.ts @@ -589,8 +589,7 @@ export function storeSharpConstructor(sharpConstructor: SharpConstructor): (buil } -export function loadMaybe(slice: Slice, loadTheType: (slice: Slice) => TheType -): Maybe { +export function loadMaybe(slice: Slice, loadTheType: (slice: Slice) => TheType): Maybe { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { slice.loadUint(1); return { @@ -610,9 +609,7 @@ export function loadMaybe(slice: Slice, loadTheType: (slice: Slice) => throw new Error(''); } -export function storeMaybe(maybe: Maybe, storeTheType: (theType: TheType) => (builder: Builder) => void - -): (builder: Builder) => void { +export function storeMaybe(maybe: Maybe, storeTheType: (theType: TheType) => (builder: Builder) => void): (builder: Builder) => void { if ((maybe.kind == 'Maybe_nothing')) { return ((builder: Builder) => { builder.storeUint(0b0, 1); @@ -645,9 +642,7 @@ export function storeTypedParam(typedParam: TypedParam): (builder: Builder) => v } -export function loadEither(slice: Slice, loadX: (slice: Slice) => X -, loadY: (slice: Slice) => Y -): Either { +export function loadEither(slice: Slice, loadX: (slice: Slice) => X, loadY: (slice: Slice) => Y): Either { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { slice.loadUint(1); let value: X = loadX(slice); @@ -669,11 +664,7 @@ export function loadEither(slice: Slice, loadX: (slice: Slice) => X throw new Error(''); } -export function storeEither(either: Either, storeX: (x: X) => (builder: Builder) => void - -, storeY: (y: Y) => (builder: Builder) => void - -): (builder: Builder) => void { +export function storeEither(either: Either, storeX: (x: X) => (builder: Builder) => void, storeY: (y: Y) => (builder: Builder) => void): (builder: Builder) => void { if ((either.kind == 'Either_left')) { return ((builder: Builder) => { builder.storeUint(0b0, 1); @@ -841,8 +832,7 @@ export function storeCellsSimple(_cellsSimple: CellsSimple): (builder: Builder) } -export function loadIntBits(slice: Slice, loadArg: (slice: Slice) => Arg -): IntBits { +export function loadIntBits(slice: Slice, loadArg: (slice: Slice) => Arg): IntBits { let d: number = slice.loadInt(11); let g: BitString = slice.loadBits(2); let arg: Arg = loadArg(slice); @@ -857,9 +847,7 @@ export function loadIntBits(slice: Slice, loadArg: (slice: Slice) => Arg } -export function storeIntBits(intBits: IntBits, storeArg: (arg: Arg) => (builder: Builder) => void - -): (builder: Builder) => void { +export function storeIntBits(intBits: IntBits, storeArg: (arg: Arg) => (builder: Builder) => void): (builder: Builder) => void { return ((builder: Builder) => { builder.storeInt(intBits.d, 11); builder.storeBits(intBits.g); @@ -995,8 +983,7 @@ export function storeLessThan(lessThan: LessThan): (builder: Builder) => void { } -export function loadOneComb(slice: Slice, loadA: (slice: Slice) => A -): OneComb { +export function loadOneComb(slice: Slice, loadA: (slice: Slice) => A): OneComb { let t: number = slice.loadUint(32); let x: A = loadA(slice); return { @@ -1007,9 +994,7 @@ export function loadOneComb(slice: Slice, loadA: (slice: Slice) => A } -export function storeOneComb(oneComb: OneComb, storeA: (a: A) => (builder: Builder) => void - -): (builder: Builder) => void { +export function storeOneComb(oneComb: OneComb, storeA: (a: A) => (builder: Builder) => void): (builder: Builder) => void { return ((builder: Builder) => { builder.storeUint(oneComb.t, 32); storeA(oneComb.x)(builder); @@ -1398,8 +1383,7 @@ export function storeUnaryUserCheckOrder(unaryUserCheckOrder: UnaryUserCheckOrde } -export function loadCombArgCellRef(slice: Slice, loadX: (slice: Slice) => X -): CombArgCellRef { +export function loadCombArgCellRef(slice: Slice, loadX: (slice: Slice) => X): CombArgCellRef { let info: number = slice.loadInt(32); let init: Maybe> = loadMaybe>(slice, ((slice: Slice) => { return loadEither(slice, loadX, ((slice: Slice) => { @@ -1429,9 +1413,7 @@ export function loadCombArgCellRef(slice: Slice, loadX: (slice: Slice) => X } -export function storeCombArgCellRef(combArgCellRef: CombArgCellRef, storeX: (x: X) => (builder: Builder) => void - -): (builder: Builder) => void { +export function storeCombArgCellRef(combArgCellRef: CombArgCellRef, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void { return ((builder: Builder) => { builder.storeInt(combArgCellRef.info, 32); storeMaybe>(combArgCellRef.init, ((arg: Either) => { @@ -1626,8 +1608,7 @@ export function hashmap_get_l(label: HmLabel): number { throw new Error(''); } -export function loadHashmap(slice: Slice, n: number, loadX: (slice: Slice) => X -): Hashmap { +export function loadHashmap(slice: Slice, n: number, loadX: (slice: Slice) => X): Hashmap { let label: HmLabel = loadHmLabel(slice, n); let l = hashmap_get_l(label); let node: HashmapNode = loadHashmapNode(slice, (n - l), loadX); @@ -1642,9 +1623,7 @@ export function loadHashmap(slice: Slice, n: number, loadX: (slice: Slice) => } -export function storeHashmap(hashmap: Hashmap, storeX: (x: X) => (builder: Builder) => void - -): (builder: Builder) => void { +export function storeHashmap(hashmap: Hashmap, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void { return ((builder: Builder) => { storeHmLabel(hashmap.label)(builder); storeHashmapNode(hashmap.node, storeX)(builder); @@ -1652,8 +1631,7 @@ export function storeHashmap(hashmap: Hashmap, storeX: (x: X) => (builder: } -export function loadHashmapNode(slice: Slice, arg0: number, loadX: (slice: Slice) => X -): HashmapNode { +export function loadHashmapNode(slice: Slice, arg0: number, loadX: (slice: Slice) => X): HashmapNode { if ((arg0 == 0)) { let value: X = loadX(slice); return { @@ -1678,9 +1656,7 @@ export function loadHashmapNode(slice: Slice, arg0: number, loadX: (slice: Sl throw new Error(''); } -export function storeHashmapNode(hashmapNode: HashmapNode, storeX: (x: X) => (builder: Builder) => void - -): (builder: Builder) => void { +export function storeHashmapNode(hashmapNode: HashmapNode, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void { if ((hashmapNode.kind == 'HashmapNode_hmn_leaf')) { return ((builder: Builder) => { storeX(hashmapNode.value)(builder); @@ -1800,8 +1776,7 @@ export function storeHmLabel(hmLabel: HmLabel): (builder: Builder) => void { throw new Error(''); } -export function loadHashmapE(slice: Slice, n: number, loadX: (slice: Slice) => X -): HashmapE { +export function loadHashmapE(slice: Slice, n: number, loadX: (slice: Slice) => X): HashmapE { if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { slice.loadUint(1); return { @@ -1824,9 +1799,7 @@ export function loadHashmapE(slice: Slice, n: number, loadX: (slice: Slice) = throw new Error(''); } -export function storeHashmapE(hashmapE: HashmapE, storeX: (x: X) => (builder: Builder) => void - -): (builder: Builder) => void { +export function storeHashmapE(hashmapE: HashmapE, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void { if ((hashmapE.kind == 'HashmapE_hme_empty')) { return ((builder: Builder) => { builder.storeUint(0b0, 1); diff --git a/src/codegen/tsgen.ts b/src/codegen/tsgen.ts index 16dd1d0..67669b5 100644 --- a/src/codegen/tsgen.ts +++ b/src/codegen/tsgen.ts @@ -356,7 +356,7 @@ export function toCode(node: TheNode, code: CodeBuilder = new CodeBuilder()): Co } if (node.type == "ArrowFunctionType") { - code.add(`(${toCodeArray(node.parameters, new CodeBuilder(), ', ').render()}) => ${node.returnType ? toCode(node.returnType).render() : ''}`) + code.add(`(${toCodeArray(node.parameters, new CodeBuilder(), ', ').render()}) => ${node.returnType ? toCode(node.returnType).render() : ''}`, false) } if (node.type == "TypeWithParameters") { From 4d04c58940578c5c8f353f71f390dbedccb50cd0 Mon Sep 17 00:00:00 2001 From: polyprogrammist Date: Tue, 12 Dec 2023 01:27:09 -0500 Subject: [PATCH 08/10] tmp --- generated_block.ts | 992 +++++++++++++++++-------------------- generated_test.ts | 247 +++++---- src/codegen/CodeBuilder.ts | 4 +- src/codegen/main.ts | 4 +- src/codegen/tsgen.ts | 27 +- 5 files changed, 593 insertions(+), 681 deletions(-) diff --git a/generated_block.ts b/generated_block.ts index 992dc88..1955251 100644 --- a/generated_block.ts +++ b/generated_block.ts @@ -2602,14 +2602,17 @@ export function hashmap_get_l(label: HmLabel): number { if ((label.kind == 'HmLabel_hml_short')) { let n = label.n; return n + } if ((label.kind == 'HmLabel_hml_long')) { let n = label.n; return n + } if ((label.kind == 'HmLabel_hml_same')) { let n = label.n; return n + } throw new Error(''); } @@ -2686,10 +2689,12 @@ export function storeHashmapNode(hashmapNode: HashmapNode, storeX: (x: X) export function hmLabel_hml_short_get_n(len: Unary): number { if ((len.kind == 'Unary_unary_zero')) { return 0 + } if ((len.kind == 'Unary_unary_succ')) { let n = len.n; return (n + 1) + } throw new Error(''); } @@ -2700,9 +2705,9 @@ export function loadHmLabel(slice: Slice, m: number): HmLabel { let len: Unary = loadUnary(slice); let n = hmLabel_hml_short_get_n(len); let s: Array = Array.from(Array(n).keys()).map(((arg: number) => { - return slice.loadBits(1) -}) -); + return slice.loadBits(1) + + })); if ((!(n <= m))) { throw new Error(''); } @@ -2719,9 +2724,9 @@ export function loadHmLabel(slice: Slice, m: number): HmLabel { slice.loadUint(2); let n: number = slice.loadUint(bitLen(m)); let s: Array = Array.from(Array(n).keys()).map(((arg: number) => { - return slice.loadBits(1) -}) -); + return slice.loadBits(1) + + })); return { kind: 'HmLabel_hml_long', m: m, @@ -2751,9 +2756,8 @@ export function storeHmLabel(hmLabel: HmLabel): (builder: Builder) => void { builder.storeUint(0b0, 1); storeUnary(hmLabel.len)(builder); hmLabel.s.forEach(((arg: BitString) => { - builder.storeBits(arg); - }) - ); + builder.storeBits(arg); + })); if ((!(hmLabel.n <= hmLabel.m))) { throw new Error(''); } @@ -2765,9 +2769,8 @@ export function storeHmLabel(hmLabel: HmLabel): (builder: Builder) => void { builder.storeUint(0b10, 2); builder.storeUint(hmLabel.n, bitLen(hmLabel.m)); hmLabel.s.forEach(((arg: BitString) => { - builder.storeBits(arg); - }) - ); + builder.storeBits(arg); + })); }) } @@ -2785,10 +2788,12 @@ export function storeHmLabel(hmLabel: HmLabel): (builder: Builder) => void { export function unary_unary_succ_get_n(x: Unary): number { if ((x.kind == 'Unary_unary_zero')) { return 0 + } if ((x.kind == 'Unary_unary_succ')) { let n = x.n; return (n + 1) + } throw new Error(''); } @@ -2900,14 +2905,17 @@ export function hashmapAug_get_l(label: HmLabel): number { if ((label.kind == 'HmLabel_hml_short')) { let n = label.n; return n + } if ((label.kind == 'HmLabel_hml_long')) { let n = label.n; return n + } if ((label.kind == 'HmLabel_hml_same')) { let n = label.n; return n + } throw new Error(''); } @@ -3039,14 +3047,17 @@ export function varHashmap_get_l(label: HmLabel): number { if ((label.kind == 'HmLabel_hml_short')) { let n = label.n; return n + } if ((label.kind == 'HmLabel_hml_long')) { let n = label.n; return n + } if ((label.kind == 'HmLabel_hml_same')) { let n = label.n; return n + } throw new Error(''); } @@ -3200,14 +3211,17 @@ export function pfxHashmap_get_l(label: HmLabel): number { if ((label.kind == 'HmLabel_hml_short')) { let n = label.n; return n + } if ((label.kind == 'HmLabel_hml_long')) { let n = label.n; return n + } if ((label.kind == 'HmLabel_hml_same')) { let n = label.n; return n + } throw new Error(''); } @@ -3546,9 +3560,9 @@ export function storeGrams(grams: Grams): (builder: Builder) => void { export function loadExtraCurrencyCollection(slice: Slice): ExtraCurrencyCollection { let dict: HashmapE = loadHashmapE(slice, 32, ((slice: Slice) => { - return loadVarUInteger(slice, 32) -}) -); + return loadVarUInteger(slice, 32) + + })); return { kind: 'ExtraCurrencyCollection', dict: dict, @@ -3559,12 +3573,11 @@ export function loadExtraCurrencyCollection(slice: Slice): ExtraCurrencyCollecti export function storeExtraCurrencyCollection(extraCurrencyCollection: ExtraCurrencyCollection): (builder: Builder) => void { return ((builder: Builder) => { storeHashmapE(extraCurrencyCollection.dict, ((arg: VarUInteger) => { - return ((builder: Builder) => { - storeVarUInteger(arg)(builder); - }) + return ((builder: Builder) => { + storeVarUInteger(arg)(builder); + }) - }) - )(builder); + }))(builder); }) } @@ -3785,20 +3798,20 @@ export function loadStateInit(slice: Slice): StateInit { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x91231967))) { slice.loadUint(32); let split_depth: Maybe = loadMaybe(slice, ((slice: Slice) => { - return slice.loadUint(5) -}) -); + return slice.loadUint(5) + + })); let special: Maybe = loadMaybe(slice, loadTickTock); let code: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return slice1 -}) -); + let slice1 = slice.loadRef().beginParse(); + return slice1 + + })); let data: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return slice1 -}) -); + let slice1 = slice.loadRef().beginParse(); + return slice1 + + })); let library: HashmapE = loadHashmapE(slice, 256, loadSimpleLib); return { kind: 'StateInit', @@ -3817,37 +3830,30 @@ export function storeStateInit(stateInit: StateInit): (builder: Builder) => void return ((builder: Builder) => { builder.storeUint(0x91231967, 32); storeMaybe(stateInit.split_depth, ((arg: number) => { - return ((builder: Builder) => { - builder.storeUint(arg, 5); - }) + return ((builder: Builder) => { + builder.storeUint(arg, 5); + }) - }) - )(builder); + }))(builder); storeMaybe(stateInit.special, storeTickTock)(builder); storeMaybe(stateInit.code, ((arg: Slice) => { - return ((builder: Builder) => { - let cell1 = beginCell(); - - cell1.storeSlice(arg); - - builder.storeRef(cell1); + return ((builder: Builder) => { + let cell1 = beginCell(); + cell1.storeSlice(arg); + builder.storeRef(cell1); - }) + }) - }) - )(builder); + }))(builder); storeMaybe(stateInit.data, ((arg: Slice) => { - return ((builder: Builder) => { - let cell1 = beginCell(); - - cell1.storeSlice(arg); - - builder.storeRef(cell1); + return ((builder: Builder) => { + let cell1 = beginCell(); + cell1.storeSlice(arg); + builder.storeRef(cell1); - }) + }) - }) - )(builder); + }))(builder); storeHashmapE(stateInit.library, storeSimpleLib)(builder); }) @@ -3878,18 +3884,18 @@ export function storeSimpleLib(simpleLib: SimpleLib): (builder: Builder) => void export function loadMessage(slice: Slice, loadX: (slice: Slice) => X): Message { let info: CommonMsgInfo = loadCommonMsgInfo(slice); let init: Maybe> = loadMaybe>(slice, ((slice: Slice) => { - return loadEither(slice, loadStateInit, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadStateInit(slice1) - }) - ) -}) -); + return loadEither(slice, loadStateInit, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse(); + return loadStateInit(slice1) + + })) + + })); let body: Either = loadEither(slice, loadX, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadX(slice1) -}) -); + let slice1 = slice.loadRef().beginParse(); + return loadX(slice1) + + })); return { kind: 'Message', info: info, @@ -3903,35 +3909,28 @@ export function storeMessage(message: Message, storeX: (x: X) => (builder: return ((builder: Builder) => { storeCommonMsgInfo(message.info)(builder); storeMaybe>(message.init, ((arg: Either) => { - return ((builder: Builder) => { - storeEither(arg, storeStateInit, ((arg: StateInit) => { return ((builder: Builder) => { - let cell1 = beginCell(); - - storeStateInit(arg)(cell1); + storeEither(arg, storeStateInit, ((arg: StateInit) => { + return ((builder: Builder) => { + let cell1 = beginCell(); + storeStateInit(arg)(cell1); + builder.storeRef(cell1); - builder.storeRef(cell1); + }) + }))(builder); }) - }) - )(builder); - }) - - }) - )(builder); + }))(builder); storeEither(message.body, storeX, ((arg: X) => { - return ((builder: Builder) => { - let cell1 = beginCell(); - - storeX(arg)(cell1); - - builder.storeRef(cell1); + return ((builder: Builder) => { + let cell1 = beginCell(); + storeX(arg)(cell1); + builder.storeRef(cell1); - }) + }) - }) - )(builder); + }))(builder); }) } @@ -3939,18 +3938,18 @@ export function storeMessage(message: Message, storeX: (x: X) => (builder: export function loadMessageRelaxed(slice: Slice, loadX: (slice: Slice) => X): MessageRelaxed { let info: CommonMsgInfoRelaxed = loadCommonMsgInfoRelaxed(slice); let init: Maybe> = loadMaybe>(slice, ((slice: Slice) => { - return loadEither(slice, loadStateInit, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadStateInit(slice1) - }) - ) -}) -); + return loadEither(slice, loadStateInit, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse(); + return loadStateInit(slice1) + + })) + + })); let body: Either = loadEither(slice, loadX, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadX(slice1) -}) -); + let slice1 = slice.loadRef().beginParse(); + return loadX(slice1) + + })); return { kind: 'MessageRelaxed', info: info, @@ -3964,35 +3963,28 @@ export function storeMessageRelaxed(messageRelaxed: MessageRelaxed, storeX return ((builder: Builder) => { storeCommonMsgInfoRelaxed(messageRelaxed.info)(builder); storeMaybe>(messageRelaxed.init, ((arg: Either) => { - return ((builder: Builder) => { - storeEither(arg, storeStateInit, ((arg: StateInit) => { return ((builder: Builder) => { - let cell1 = beginCell(); - - storeStateInit(arg)(cell1); + storeEither(arg, storeStateInit, ((arg: StateInit) => { + return ((builder: Builder) => { + let cell1 = beginCell(); + storeStateInit(arg)(cell1); + builder.storeRef(cell1); - builder.storeRef(cell1); + }) + }))(builder); }) - }) - )(builder); - }) - - }) - )(builder); + }))(builder); storeEither(messageRelaxed.body, storeX, ((arg: X) => { - return ((builder: Builder) => { - let cell1 = beginCell(); - - storeX(arg)(cell1); - - builder.storeRef(cell1); + return ((builder: Builder) => { + let cell1 = beginCell(); + storeX(arg)(cell1); + builder.storeRef(cell1); - }) + }) - }) - )(builder); + }))(builder); }) } @@ -4001,9 +3993,9 @@ export function loadMessageAny(slice: Slice): MessageAny { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x9c54aa4b))) { slice.loadUint(32); let anon0: Message = loadMessage(slice, ((slice: Slice) => { - return slice -}) -); + return slice + + })); return { kind: 'MessageAny', anon0: anon0, @@ -4017,12 +4009,11 @@ export function storeMessageAny(messageAny: MessageAny): (builder: Builder) => v return ((builder: Builder) => { builder.storeUint(0x9c54aa4b, 32); storeMessage(messageAny.anon0, ((arg: Slice) => { - return ((builder: Builder) => { - builder.storeSlice(arg); - }) + return ((builder: Builder) => { + builder.storeSlice(arg); + }) - }) - )(builder); + }))(builder); }) } @@ -4097,9 +4088,9 @@ export function loadMsgEnvelope(slice: Slice): MsgEnvelope { let fwd_fee_remaining: Grams = loadGrams(slice); let slice1 = slice.loadRef().beginParse(); let msg: Message = loadMessage(slice1, ((slice: Slice) => { - return slice -}) -); + return slice + + })); return { kind: 'MsgEnvelope', cur_addr: cur_addr, @@ -4120,12 +4111,11 @@ export function storeMsgEnvelope(msgEnvelope: MsgEnvelope): (builder: Builder) = storeGrams(msgEnvelope.fwd_fee_remaining)(builder); let cell1 = beginCell(); storeMessage(msgEnvelope.msg, ((arg: Slice) => { - return ((builder: Builder) => { - cell1.storeSlice(arg); - }) + return ((builder: Builder) => { + cell1.storeSlice(arg); + }) - }) - )(cell1); + }))(cell1); builder.storeRef(cell1); }) @@ -4136,9 +4126,9 @@ export function loadInMsg(slice: Slice): InMsg { slice.loadUint(3); let slice1 = slice.loadRef().beginParse(); let msg: Message = loadMessage(slice1, ((slice: Slice) => { - return slice -}) -); + return slice + + })); let slice2 = slice.loadRef().beginParse(); let transaction: Transaction = loadTransaction(slice2); return { @@ -4152,9 +4142,9 @@ export function loadInMsg(slice: Slice): InMsg { slice.loadUint(3); let slice1 = slice.loadRef().beginParse(); let msg: Message = loadMessage(slice1, ((slice: Slice) => { - return slice -}) -); + return slice + + })); let slice2 = slice.loadRef().beginParse(); let transaction: Transaction = loadTransaction(slice2); let ihr_fee: Grams = loadGrams(slice); @@ -4254,12 +4244,11 @@ export function storeInMsg(inMsg: InMsg): (builder: Builder) => void { builder.storeUint(0b000, 3); let cell1 = beginCell(); storeMessage(inMsg.msg, ((arg: Slice) => { - return ((builder: Builder) => { - cell1.storeSlice(arg); - }) + return ((builder: Builder) => { + cell1.storeSlice(arg); + }) - }) - )(cell1); + }))(cell1); builder.storeRef(cell1); let cell2 = beginCell(); storeTransaction(inMsg.transaction)(cell2); @@ -4272,12 +4261,11 @@ export function storeInMsg(inMsg: InMsg): (builder: Builder) => void { builder.storeUint(0b010, 3); let cell1 = beginCell(); storeMessage(inMsg.msg, ((arg: Slice) => { - return ((builder: Builder) => { - cell1.storeSlice(arg); - }) + return ((builder: Builder) => { + cell1.storeSlice(arg); + }) - }) - )(cell1); + }))(cell1); builder.storeRef(cell1); let cell2 = beginCell(); storeTransaction(inMsg.transaction)(cell2); @@ -4401,9 +4389,9 @@ export function loadOutMsg(slice: Slice): OutMsg { slice.loadUint(3); let slice1 = slice.loadRef().beginParse(); let msg: Message = loadMessage(slice1, ((slice: Slice) => { - return slice -}) -); + return slice + + })); let slice2 = slice.loadRef().beginParse(); let transaction: Transaction = loadTransaction(slice2); return { @@ -4517,12 +4505,11 @@ export function storeOutMsg(outMsg: OutMsg): (builder: Builder) => void { builder.storeUint(0b000, 3); let cell1 = beginCell(); storeMessage(outMsg.msg, ((arg: Slice) => { - return ((builder: Builder) => { - cell1.storeSlice(arg); - }) + return ((builder: Builder) => { + cell1.storeSlice(arg); + }) - }) - )(cell1); + }))(cell1); builder.storeRef(cell1); let cell2 = beginCell(); storeTransaction(outMsg.transaction)(cell2); @@ -4668,9 +4655,9 @@ export function loadOutMsgQueue(slice: Slice): OutMsgQueue { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xcf5f0da2))) { slice.loadUint(32); let anon0: HashmapAugE = loadHashmapAugE(slice, 352, loadEnqueuedMsg, ((slice: Slice) => { - return slice.loadUint(64) -}) -); + return slice.loadUint(64) + + })); return { kind: 'OutMsgQueue', anon0: anon0, @@ -4684,12 +4671,11 @@ export function storeOutMsgQueue(outMsgQueue: OutMsgQueue): (builder: Builder) = return ((builder: Builder) => { builder.storeUint(0xcf5f0da2, 32); storeHashmapAugE(outMsgQueue.anon0, storeEnqueuedMsg, ((arg: number) => { - return ((builder: Builder) => { - builder.storeUint(arg, 64); - }) + return ((builder: Builder) => { + builder.storeUint(arg, 64); + }) - }) - )(builder); + }))(builder); }) } @@ -5117,21 +5103,21 @@ export function loadTransaction(slice: Slice): Transaction { let end_status: AccountStatus = loadAccountStatus(slice); let slice1 = slice.loadRef().beginParse(); let in_msg: Maybe> = loadMaybe>(slice1, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadMessage(slice1, ((slice: Slice) => { - return slice - }) - ) -}) -); + let slice1 = slice.loadRef().beginParse(); + return loadMessage(slice1, ((slice: Slice) => { + return slice + + })) + + })); let out_msgs: HashmapE> = loadHashmapE>(slice1, 15, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadMessage(slice1, ((slice: Slice) => { - return slice - }) - ) -}) -); + let slice1 = slice.loadRef().beginParse(); + return loadMessage(slice1, ((slice: Slice) => { + return slice + + })) + + })); let total_fees: CurrencyCollection = loadCurrencyCollection(slice); let slice2 = slice.loadRef().beginParse(); let state_update: HASH_UPDATE = loadHASH_UPDATE(slice2, loadAccount); @@ -5171,41 +5157,33 @@ export function storeTransaction(transaction: Transaction): (builder: Builder) = storeAccountStatus(transaction.end_status)(builder); let cell1 = beginCell(); storeMaybe>(transaction.in_msg, ((arg: Message) => { - return ((builder: Builder) => { - let cell1 = beginCell(); + return ((builder: Builder) => { + let cell1 = beginCell(); + storeMessage(arg, ((arg: Slice) => { + return ((builder: Builder) => { + cell1.storeSlice(arg); + }) - storeMessage(arg, ((arg: Slice) => { - return ((builder: Builder) => { - cell1.storeSlice(arg); - }) + }))(cell1); + builder.storeRef(cell1); }) - )(cell1); - - builder.storeRef(cell1); - }) - - }) - )(cell1); + }))(cell1); storeHashmapE>(transaction.out_msgs, ((arg: Message) => { - return ((builder: Builder) => { - let cell1 = beginCell(); + return ((builder: Builder) => { + let cell1 = beginCell(); + storeMessage(arg, ((arg: Slice) => { + return ((builder: Builder) => { + cell1.storeSlice(arg); + }) - storeMessage(arg, ((arg: Slice) => { - return ((builder: Builder) => { - cell1.storeSlice(arg); - }) + }))(cell1); + builder.storeRef(cell1); }) - )(cell1); - - builder.storeRef(cell1); - - }) - }) - )(cell1); + }))(cell1); builder.storeRef(cell1); storeCurrencyCollection(transaction.total_fees)(builder); let cell2 = beginCell(); @@ -5313,10 +5291,10 @@ export function loadAccountBlock(slice: Slice): AccountBlock { slice.loadUint(4); let account_addr: BitString = slice.loadBits(256); let transactions: HashmapAug = loadHashmapAug(slice, 64, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadTransaction(slice1) -}) -, loadCurrencyCollection); + let slice1 = slice.loadRef().beginParse(); + return loadTransaction(slice1) + + }), loadCurrencyCollection); let slice1 = slice.loadRef().beginParse(); let state_update: HASH_UPDATE = loadHASH_UPDATE(slice1, loadAccount); return { @@ -5335,17 +5313,14 @@ export function storeAccountBlock(accountBlock: AccountBlock): (builder: Builder builder.storeUint(0x5, 4); builder.storeBits(accountBlock.account_addr); storeHashmapAug(accountBlock.transactions, ((arg: Transaction) => { - return ((builder: Builder) => { - let cell1 = beginCell(); - - storeTransaction(arg)(cell1); - - builder.storeRef(cell1); + return ((builder: Builder) => { + let cell1 = beginCell(); + storeTransaction(arg)(cell1); + builder.storeRef(cell1); - }) + }) - }) - , storeCurrencyCollection)(builder); + }), storeCurrencyCollection)(builder); let cell1 = beginCell(); storeHASH_UPDATE(accountBlock.state_update, storeAccount)(cell1); builder.storeRef(cell1); @@ -5482,15 +5457,15 @@ export function loadTrComputePhase(slice: Slice): TrComputePhase { let gas_used: VarUInteger = loadVarUInteger(slice1, 7); let gas_limit: VarUInteger = loadVarUInteger(slice1, 7); let gas_credit: Maybe = loadMaybe(slice1, ((slice: Slice) => { - return loadVarUInteger(slice, 3) -}) -); + return loadVarUInteger(slice, 3) + + })); let mode: number = slice1.loadInt(8); let exit_code: number = slice1.loadInt(32); let exit_arg: Maybe = loadMaybe(slice1, ((slice: Slice) => { - return slice1.loadInt(32) -}) -); + return slice1.loadInt(32) + + })); let vm_steps: number = slice1.loadUint(32); let vm_init_state_hash: BitString = slice1.loadBits(256); let vm_final_state_hash: BitString = slice1.loadBits(256); @@ -5534,21 +5509,19 @@ export function storeTrComputePhase(trComputePhase: TrComputePhase): (builder: B storeVarUInteger(trComputePhase.gas_used)(cell1); storeVarUInteger(trComputePhase.gas_limit)(cell1); storeMaybe(trComputePhase.gas_credit, ((arg: VarUInteger) => { - return ((builder: Builder) => { - storeVarUInteger(arg)(builder); - }) + return ((builder: Builder) => { + storeVarUInteger(arg)(builder); + }) - }) - )(cell1); + }))(cell1); cell1.storeInt(trComputePhase.mode, 8); cell1.storeInt(trComputePhase.exit_code, 32); storeMaybe(trComputePhase.exit_arg, ((arg: number) => { - return ((builder: Builder) => { - cell1.storeInt(arg, 32); - }) + return ((builder: Builder) => { + cell1.storeInt(arg, 32); + }) - }) - )(cell1); + }))(cell1); cell1.storeUint(trComputePhase.vm_steps, 32); cell1.storeBits(trComputePhase.vm_init_state_hash); cell1.storeBits(trComputePhase.vm_final_state_hash); @@ -5615,9 +5588,9 @@ export function loadTrActionPhase(slice: Slice): TrActionPhase { let total_action_fees: Maybe = loadMaybe(slice, loadGrams); let result_code: number = slice.loadInt(32); let result_arg: Maybe = loadMaybe(slice, ((slice: Slice) => { - return slice.loadInt(32) -}) -); + return slice.loadInt(32) + + })); let tot_actions: number = slice.loadUint(16); let spec_actions: number = slice.loadUint(16); let skipped_actions: number = slice.loadUint(16); @@ -5654,12 +5627,11 @@ export function storeTrActionPhase(trActionPhase: TrActionPhase): (builder: Buil storeMaybe(trActionPhase.total_action_fees, storeGrams)(builder); builder.storeInt(trActionPhase.result_code, 32); storeMaybe(trActionPhase.result_arg, ((arg: number) => { - return ((builder: Builder) => { - builder.storeInt(arg, 32); - }) + return ((builder: Builder) => { + builder.storeInt(arg, 32); + }) - }) - )(builder); + }))(builder); builder.storeUint(trActionPhase.tot_actions, 16); builder.storeUint(trActionPhase.spec_actions, 16); builder.storeUint(trActionPhase.skipped_actions, 16); @@ -5740,10 +5712,10 @@ export function loadTransactionDescr(slice: Slice): TransactionDescr { let credit_ph: Maybe = loadMaybe(slice, loadTrCreditPhase); let compute_ph: TrComputePhase = loadTrComputePhase(slice); let action: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadTrActionPhase(slice1) -}) -); + let slice1 = slice.loadRef().beginParse(); + return loadTrActionPhase(slice1) + + })); let aborted: Bool = loadBool(slice); let bounce: Maybe = loadMaybe(slice, loadTrBouncePhase); let destroyed: Bool = loadBool(slice); @@ -5775,10 +5747,10 @@ export function loadTransactionDescr(slice: Slice): TransactionDescr { let storage_ph: TrStoragePhase = loadTrStoragePhase(slice); let compute_ph: TrComputePhase = loadTrComputePhase(slice); let action: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadTrActionPhase(slice1) -}) -); + let slice1 = slice.loadRef().beginParse(); + return loadTrActionPhase(slice1) + + })); let aborted: Bool = loadBool(slice); let destroyed: Bool = loadBool(slice); return { @@ -5798,10 +5770,10 @@ export function loadTransactionDescr(slice: Slice): TransactionDescr { let storage_ph: Maybe = loadMaybe(slice, loadTrStoragePhase); let compute_ph: TrComputePhase = loadTrComputePhase(slice); let action: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadTrActionPhase(slice1) -}) -); + let slice1 = slice.loadRef().beginParse(); + return loadTrActionPhase(slice1) + + })); let aborted: Bool = loadBool(slice); let destroyed: Bool = loadBool(slice); return { @@ -5851,10 +5823,10 @@ export function loadTransactionDescr(slice: Slice): TransactionDescr { let credit_ph: Maybe = loadMaybe(slice, loadTrCreditPhase); let compute_ph: TrComputePhase = loadTrComputePhase(slice); let action: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadTrActionPhase(slice1) -}) -); + let slice1 = slice.loadRef().beginParse(); + return loadTrActionPhase(slice1) + + })); let aborted: Bool = loadBool(slice); let destroyed: Bool = loadBool(slice); return { @@ -5882,17 +5854,14 @@ export function storeTransactionDescr(transactionDescr: TransactionDescr): (buil storeMaybe(transactionDescr.credit_ph, storeTrCreditPhase)(builder); storeTrComputePhase(transactionDescr.compute_ph)(builder); storeMaybe(transactionDescr.action, ((arg: TrActionPhase) => { - return ((builder: Builder) => { - let cell1 = beginCell(); - - storeTrActionPhase(arg)(cell1); - - builder.storeRef(cell1); + return ((builder: Builder) => { + let cell1 = beginCell(); + storeTrActionPhase(arg)(cell1); + builder.storeRef(cell1); - }) + }) - }) - )(builder); + }))(builder); storeBool(transactionDescr.aborted)(builder); storeMaybe(transactionDescr.bounce, storeTrBouncePhase)(builder); storeBool(transactionDescr.destroyed)(builder); @@ -5913,17 +5882,14 @@ export function storeTransactionDescr(transactionDescr: TransactionDescr): (buil storeTrStoragePhase(transactionDescr.storage_ph)(builder); storeTrComputePhase(transactionDescr.compute_ph)(builder); storeMaybe(transactionDescr.action, ((arg: TrActionPhase) => { - return ((builder: Builder) => { - let cell1 = beginCell(); - - storeTrActionPhase(arg)(cell1); - - builder.storeRef(cell1); + return ((builder: Builder) => { + let cell1 = beginCell(); + storeTrActionPhase(arg)(cell1); + builder.storeRef(cell1); - }) + }) - }) - )(builder); + }))(builder); storeBool(transactionDescr.aborted)(builder); storeBool(transactionDescr.destroyed)(builder); }) @@ -5936,17 +5902,14 @@ export function storeTransactionDescr(transactionDescr: TransactionDescr): (buil storeMaybe(transactionDescr.storage_ph, storeTrStoragePhase)(builder); storeTrComputePhase(transactionDescr.compute_ph)(builder); storeMaybe(transactionDescr.action, ((arg: TrActionPhase) => { - return ((builder: Builder) => { - let cell1 = beginCell(); - - storeTrActionPhase(arg)(cell1); - - builder.storeRef(cell1); + return ((builder: Builder) => { + let cell1 = beginCell(); + storeTrActionPhase(arg)(cell1); + builder.storeRef(cell1); - }) + }) - }) - )(builder); + }))(builder); storeBool(transactionDescr.aborted)(builder); storeBool(transactionDescr.destroyed)(builder); }) @@ -5983,17 +5946,14 @@ export function storeTransactionDescr(transactionDescr: TransactionDescr): (buil storeMaybe(transactionDescr.credit_ph, storeTrCreditPhase)(builder); storeTrComputePhase(transactionDescr.compute_ph)(builder); storeMaybe(transactionDescr.action, ((arg: TrActionPhase) => { - return ((builder: Builder) => { - let cell1 = beginCell(); - - storeTrActionPhase(arg)(cell1); - - builder.storeRef(cell1); + return ((builder: Builder) => { + let cell1 = beginCell(); + storeTrActionPhase(arg)(cell1); + builder.storeRef(cell1); - }) + }) - }) - )(builder); + }))(builder); storeBool(transactionDescr.aborted)(builder); storeBool(transactionDescr.destroyed)(builder); }) @@ -6115,9 +6075,9 @@ export function loadOutAction(slice: Slice): OutAction { let mode: number = slice.loadUint(8); let slice1 = slice.loadRef().beginParse(); let out_msg: MessageRelaxed = loadMessageRelaxed(slice1, ((slice: Slice) => { - return slice -}) -); + return slice + + })); return { kind: 'OutAction_action_send_msg', mode: mode, @@ -6170,12 +6130,11 @@ export function storeOutAction(outAction: OutAction): (builder: Builder) => void builder.storeUint(outAction.mode, 8); let cell1 = beginCell(); storeMessageRelaxed(outAction.out_msg, ((arg: Slice) => { - return ((builder: Builder) => { - cell1.storeSlice(arg); - }) + return ((builder: Builder) => { + cell1.storeSlice(arg); + }) - }) - )(cell1); + }))(cell1); builder.storeRef(cell1); }) @@ -6392,10 +6351,10 @@ export function loadShardStateUnsplit(slice: Slice): ShardStateUnsplit { let libraries: HashmapE = loadHashmapE(slice3, 256, loadLibDescr); let master_ref: Maybe = loadMaybe(slice3, loadBlkMasterInfo); let custom: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadMcStateExtra(slice1) -}) -); + let slice1 = slice.loadRef().beginParse(); + return loadMcStateExtra(slice1) + + })); return { kind: 'ShardStateUnsplit', global_id: global_id, @@ -6447,17 +6406,14 @@ export function storeShardStateUnsplit(shardStateUnsplit: ShardStateUnsplit): (b storeMaybe(shardStateUnsplit.master_ref, storeBlkMasterInfo)(cell3); builder.storeRef(cell3); storeMaybe(shardStateUnsplit.custom, ((arg: McStateExtra) => { - return ((builder: Builder) => { - let cell1 = beginCell(); - - storeMcStateExtra(arg)(cell1); - - builder.storeRef(cell1); + return ((builder: Builder) => { + let cell1 = beginCell(); + storeMcStateExtra(arg)(cell1); + builder.storeRef(cell1); - }) + }) - }) - )(builder); + }))(builder); }) } @@ -6563,17 +6519,17 @@ export function loadBlockInfo(slice: Slice): BlockInfo { let prev_key_block_seqno: number = slice.loadUint(32); let gen_software: GlobalVersion | undefined = ((flags & (1 << 0)) ? loadGlobalVersion(slice) : undefined); let master_ref: BlkMasterInfo | undefined = (not_master ? ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadBlkMasterInfo(slice1) -}) -(slice) : undefined); + let slice1 = slice.loadRef().beginParse(); + return loadBlkMasterInfo(slice1) + + })(slice) : undefined); let slice1 = slice.loadRef().beginParse(); let prev_ref: BlkPrevInfo = loadBlkPrevInfo(slice1, after_merge); let prev_vert_ref: BlkPrevInfo | undefined = (vert_seqno_incr ? ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadBlkPrevInfo(slice1, 0) -}) -(slice) : undefined); + let slice1 = slice.loadRef().beginParse(); + return loadBlkPrevInfo(slice1, 0) + + })(slice) : undefined); if ((!(flags <= 1))) { throw new Error(''); } @@ -6641,9 +6597,7 @@ export function storeBlockInfo(blockInfo: BlockInfo): (builder: Builder) => void } if ((blockInfo.master_ref != undefined)) { let cell1 = beginCell(); - storeBlkMasterInfo(blockInfo.master_ref)(cell1); - builder.storeRef(cell1); } @@ -6652,9 +6606,7 @@ export function storeBlockInfo(blockInfo: BlockInfo): (builder: Builder) => void builder.storeRef(cell1); if ((blockInfo.prev_vert_ref != undefined)) { let cell1 = beginCell(); - storeBlkPrevInfo(blockInfo.prev_vert_ref)(cell1); - builder.storeRef(cell1); } @@ -6770,10 +6722,10 @@ export function loadBlockExtra(slice: Slice): BlockExtra { let rand_seed: BitString = slice.loadBits(256); let created_by: BitString = slice.loadBits(256); let custom: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadMcBlockExtra(slice1) -}) -); + let slice1 = slice.loadRef().beginParse(); + return loadMcBlockExtra(slice1) + + })); return { kind: 'BlockExtra', in_msg_descr: in_msg_descr, @@ -6803,17 +6755,14 @@ export function storeBlockExtra(blockExtra: BlockExtra): (builder: Builder) => v builder.storeBits(blockExtra.rand_seed); builder.storeBits(blockExtra.created_by); storeMaybe(blockExtra.custom, ((arg: McBlockExtra) => { - return ((builder: Builder) => { - let cell1 = beginCell(); - - storeMcBlockExtra(arg)(cell1); - - builder.storeRef(cell1); + return ((builder: Builder) => { + let cell1 = beginCell(); + storeMcBlockExtra(arg)(cell1); + builder.storeRef(cell1); - }) + }) - }) - )(builder); + }))(builder); }) } @@ -7144,10 +7093,10 @@ export function loadShardHashes(slice: Slice): ShardHashes { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xd7c80ab1))) { slice.loadUint(32); let anon0: HashmapE> = loadHashmapE>(slice, 32, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadBinTree(slice1, loadShardDescr) -}) -); + let slice1 = slice.loadRef().beginParse(); + return loadBinTree(slice1, loadShardDescr) + + })); return { kind: 'ShardHashes', anon0: anon0, @@ -7161,17 +7110,14 @@ export function storeShardHashes(shardHashes: ShardHashes): (builder: Builder) = return ((builder: Builder) => { builder.storeUint(0xd7c80ab1, 32); storeHashmapE>(shardHashes.anon0, ((arg: BinTree) => { - return ((builder: Builder) => { - let cell1 = beginCell(); - - storeBinTree(arg, storeShardDescr)(cell1); - - builder.storeRef(cell1); + return ((builder: Builder) => { + let cell1 = beginCell(); + storeBinTree(arg, storeShardDescr)(cell1); + builder.storeRef(cell1); - }) + }) - }) - )(builder); + }))(builder); }) } @@ -7282,10 +7228,10 @@ export function loadConfigParams(slice: Slice): ConfigParams { let config_addr: BitString = slice.loadBits(256); let slice1 = slice.loadRef().beginParse(); let config: Hashmap = loadHashmap(slice1, 32, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return slice1 -}) -); + let slice1 = slice.loadRef().beginParse(); + return slice1 + + })); return { kind: 'ConfigParams', config_addr: config_addr, @@ -7302,17 +7248,14 @@ export function storeConfigParams(configParams: ConfigParams): (builder: Builder builder.storeBits(configParams.config_addr); let cell1 = beginCell(); storeHashmap(configParams.config, ((arg: Slice) => { - return ((builder: Builder) => { - let cell1 = beginCell(); - - cell1.storeSlice(arg); - - builder.storeRef(cell1); + return ((builder: Builder) => { + let cell1 = beginCell(); + cell1.storeSlice(arg); + builder.storeRef(cell1); - }) + }) - }) - )(cell1); + }))(cell1); builder.storeRef(cell1); }) @@ -7490,9 +7433,9 @@ export function loadBlockCreateStats(slice: Slice): BlockCreateStats { if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x34))) { slice.loadUint(8); let counters: HashmapAugE = loadHashmapAugE(slice, 256, loadCreatorStats, ((slice: Slice) => { - return slice.loadUint(32) -}) -); + return slice.loadUint(32) + + })); return { kind: 'BlockCreateStats_block_create_stats_ext', counters: counters, @@ -7514,12 +7457,11 @@ export function storeBlockCreateStats(blockCreateStats: BlockCreateStats): (buil return ((builder: Builder) => { builder.storeUint(0x34, 8); storeHashmapAugE(blockCreateStats.counters, storeCreatorStats, ((arg: number) => { - return ((builder: Builder) => { - builder.storeUint(arg, 32); - }) + return ((builder: Builder) => { + builder.storeUint(arg, 32); + }) - }) - )(builder); + }))(builder); }) } @@ -7762,15 +7704,15 @@ export function loadMcBlockExtra(slice: Slice): McBlockExtra { let slice1 = slice.loadRef().beginParse(); let prev_blk_signatures: HashmapE = loadHashmapE(slice1, 16, loadCryptoSignaturePair); let recover_create_msg: Maybe = loadMaybe(slice1, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadInMsg(slice1) -}) -); + let slice1 = slice.loadRef().beginParse(); + return loadInMsg(slice1) + + })); let mint_msg: Maybe = loadMaybe(slice1, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadInMsg(slice1) -}) -); + let slice1 = slice.loadRef().beginParse(); + return loadInMsg(slice1) + + })); let config: ConfigParams | undefined = (key_block ? loadConfigParams(slice) : undefined); return { kind: 'McBlockExtra', @@ -7796,29 +7738,23 @@ export function storeMcBlockExtra(mcBlockExtra: McBlockExtra): (builder: Builder let cell1 = beginCell(); storeHashmapE(mcBlockExtra.prev_blk_signatures, storeCryptoSignaturePair)(cell1); storeMaybe(mcBlockExtra.recover_create_msg, ((arg: InMsg) => { - return ((builder: Builder) => { - let cell1 = beginCell(); - - storeInMsg(arg)(cell1); - - builder.storeRef(cell1); + return ((builder: Builder) => { + let cell1 = beginCell(); + storeInMsg(arg)(cell1); + builder.storeRef(cell1); - }) + }) - }) - )(cell1); + }))(cell1); storeMaybe(mcBlockExtra.mint_msg, ((arg: InMsg) => { - return ((builder: Builder) => { - let cell1 = beginCell(); - - storeInMsg(arg)(cell1); - - builder.storeRef(cell1); + return ((builder: Builder) => { + let cell1 = beginCell(); + storeInMsg(arg)(cell1); + builder.storeRef(cell1); - }) + }) - }) - )(cell1); + }))(cell1); builder.storeRef(cell1); if ((mcBlockExtra.config != undefined)) { storeConfigParams(mcBlockExtra.config)(builder); @@ -8717,14 +8653,14 @@ export function loadConfigProposal(slice: Slice): ConfigProposal { slice.loadUint(8); let param_id: number = slice.loadInt(32); let param_value: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return slice1 -}) -); + let slice1 = slice.loadRef().beginParse(); + return slice1 + + })); let if_hash_equal: Maybe = loadMaybe(slice, ((slice: Slice) => { - return slice.loadUint(256) -}) -); + return slice.loadUint(256) + + })); return { kind: 'ConfigProposal', param_id: param_id, @@ -8741,24 +8677,20 @@ export function storeConfigProposal(configProposal: ConfigProposal): (builder: B builder.storeUint(0xf3, 8); builder.storeInt(configProposal.param_id, 32); storeMaybe(configProposal.param_value, ((arg: Slice) => { - return ((builder: Builder) => { - let cell1 = beginCell(); - - cell1.storeSlice(arg); - - builder.storeRef(cell1); + return ((builder: Builder) => { + let cell1 = beginCell(); + cell1.storeSlice(arg); + builder.storeRef(cell1); - }) + }) - }) - )(builder); + }))(builder); storeMaybe(configProposal.if_hash_equal, ((arg: number) => { - return ((builder: Builder) => { - builder.storeUint(arg, 256); - }) + return ((builder: Builder) => { + builder.storeUint(arg, 256); + }) - }) - )(builder); + }))(builder); }) } @@ -9647,9 +9579,9 @@ export function loadOracleBridgeParams(slice: Slice): OracleBridgeParams { let bridge_address: BitString = slice.loadBits(256); let oracle_mutlisig_address: BitString = slice.loadBits(256); let oracles: HashmapE = loadHashmapE(slice, 256, ((slice: Slice) => { - return slice.loadUint(256) -}) -); + return slice.loadUint(256) + + })); let external_chain_address: BitString = slice.loadBits(256); return { kind: 'OracleBridgeParams', @@ -9666,12 +9598,11 @@ export function storeOracleBridgeParams(oracleBridgeParams: OracleBridgeParams): builder.storeBits(oracleBridgeParams.bridge_address); builder.storeBits(oracleBridgeParams.oracle_mutlisig_address); storeHashmapE(oracleBridgeParams.oracles, ((arg: number) => { - return ((builder: Builder) => { - builder.storeUint(arg, 256); - }) + return ((builder: Builder) => { + builder.storeUint(arg, 256); + }) - }) - )(builder); + }))(builder); builder.storeBits(oracleBridgeParams.external_chain_address); }) @@ -9730,10 +9661,10 @@ export function loadBlockProof(slice: Slice): BlockProof { let slice1 = slice.loadRef().beginParse(); let root: Slice = slice1; let signatures: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadBlockSignatures(slice1) -}) -); + let slice1 = slice.loadRef().beginParse(); + return loadBlockSignatures(slice1) + + })); return { kind: 'BlockProof', proof_for: proof_for, @@ -9753,17 +9684,14 @@ export function storeBlockProof(blockProof: BlockProof): (builder: Builder) => v cell1.storeSlice(blockProof.root); builder.storeRef(cell1); storeMaybe(blockProof.signatures, ((arg: BlockSignatures) => { - return ((builder: Builder) => { - let cell1 = beginCell(); - - storeBlockSignatures(arg)(cell1); - - builder.storeRef(cell1); + return ((builder: Builder) => { + let cell1 = beginCell(); + storeBlockSignatures(arg)(cell1); + builder.storeRef(cell1); - }) + }) - }) - )(builder); + }))(builder); }) } @@ -9779,10 +9707,10 @@ export function loadProofChain(slice: Slice, arg0: number): ProofChain { let slice1 = slice.loadRef().beginParse(); let root: Slice = slice1; let prev: ProofChain | undefined = ((arg0 - 1) ? ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadProofChain(slice1, (arg0 - 1)) -}) -(slice) : undefined); + let slice1 = slice.loadRef().beginParse(); + return loadProofChain(slice1, (arg0 - 1)) + + })(slice) : undefined); return { kind: 'ProofChain_chain_link', n: (arg0 - 1), @@ -9807,9 +9735,7 @@ export function storeProofChain(proofChain: ProofChain): (builder: Builder) => v builder.storeRef(cell1); if ((proofChain.prev != undefined)) { let cell1 = beginCell(); - storeProofChain(proofChain.prev)(cell1); - builder.storeRef(cell1); } @@ -9824,10 +9750,10 @@ export function loadTopBlockDescr(slice: Slice): TopBlockDescr { slice.loadUint(8); let proof_for: BlockIdExt = loadBlockIdExt(slice); let signatures: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadBlockSignatures(slice1) -}) -); + let slice1 = slice.loadRef().beginParse(); + return loadBlockSignatures(slice1) + + })); let len: number = slice.loadUint(8); let chain: ProofChain = loadProofChain(slice, len); if ((!(len >= 1))) { @@ -9853,17 +9779,14 @@ export function storeTopBlockDescr(topBlockDescr: TopBlockDescr): (builder: Buil builder.storeUint(0xd5, 8); storeBlockIdExt(topBlockDescr.proof_for)(builder); storeMaybe(topBlockDescr.signatures, ((arg: BlockSignatures) => { - return ((builder: Builder) => { - let cell1 = beginCell(); - - storeBlockSignatures(arg)(cell1); - - builder.storeRef(cell1); + return ((builder: Builder) => { + let cell1 = beginCell(); + storeBlockSignatures(arg)(cell1); + builder.storeRef(cell1); - }) + }) - }) - )(builder); + }))(builder); builder.storeUint(topBlockDescr.len, 8); storeProofChain(topBlockDescr.chain)(builder); if ((!(topBlockDescr.len >= 1))) { @@ -9880,10 +9803,10 @@ export function loadTopBlockDescrSet(slice: Slice): TopBlockDescrSet { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x4ac789f3))) { slice.loadUint(32); let collection: HashmapE = loadHashmapE(slice, 96, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadTopBlockDescr(slice1) -}) -); + let slice1 = slice.loadRef().beginParse(); + return loadTopBlockDescr(slice1) + + })); return { kind: 'TopBlockDescrSet', collection: collection, @@ -9897,17 +9820,14 @@ export function storeTopBlockDescrSet(topBlockDescrSet: TopBlockDescrSet): (buil return ((builder: Builder) => { builder.storeUint(0x4ac789f3, 32); storeHashmapE(topBlockDescrSet.collection, ((arg: TopBlockDescr) => { - return ((builder: Builder) => { - let cell1 = beginCell(); - - storeTopBlockDescr(arg)(cell1); - - builder.storeRef(cell1); + return ((builder: Builder) => { + let cell1 = beginCell(); + storeTopBlockDescr(arg)(cell1); + builder.storeRef(cell1); - }) + }) - }) - )(builder); + }))(builder); }) } @@ -10490,10 +10410,10 @@ export function loadVmLibraries(slice: Slice): VmLibraries { if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xe9be85ef))) { slice.loadUint(32); let libraries: HashmapE = loadHashmapE(slice, 256, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return slice1 -}) -); + let slice1 = slice.loadRef().beginParse(); + return slice1 + + })); return { kind: 'VmLibraries', libraries: libraries, @@ -10507,32 +10427,29 @@ export function storeVmLibraries(vmLibraries: VmLibraries): (builder: Builder) = return ((builder: Builder) => { builder.storeUint(0xe9be85ef, 32); storeHashmapE(vmLibraries.libraries, ((arg: Slice) => { - return ((builder: Builder) => { - let cell1 = beginCell(); - - cell1.storeSlice(arg); - - builder.storeRef(cell1); + return ((builder: Builder) => { + let cell1 = beginCell(); + cell1.storeSlice(arg); + builder.storeRef(cell1); - }) + }) - }) - )(builder); + }))(builder); }) } export function loadVmControlData(slice: Slice): VmControlData { let nargs: Maybe = loadMaybe(slice, ((slice: Slice) => { - return slice.loadUint(13) -}) -); + return slice.loadUint(13) + + })); let stack: Maybe = loadMaybe(slice, loadVmStack); let save: VmSaveList = loadVmSaveList(slice); let cp: Maybe = loadMaybe(slice, ((slice: Slice) => { - return slice.loadInt(16) -}) -); + return slice.loadInt(16) + + })); return { kind: 'VmControlData', nargs: nargs, @@ -10546,21 +10463,19 @@ export function loadVmControlData(slice: Slice): VmControlData { export function storeVmControlData(vmControlData: VmControlData): (builder: Builder) => void { return ((builder: Builder) => { storeMaybe(vmControlData.nargs, ((arg: number) => { - return ((builder: Builder) => { - builder.storeUint(arg, 13); - }) + return ((builder: Builder) => { + builder.storeUint(arg, 13); + }) - }) - )(builder); + }))(builder); storeMaybe(vmControlData.stack, storeVmStack)(builder); storeVmSaveList(vmControlData.save)(builder); storeMaybe(vmControlData.cp, ((arg: number) => { - return ((builder: Builder) => { - builder.storeInt(arg, 16); - }) + return ((builder: Builder) => { + builder.storeInt(arg, 16); + }) - }) - )(builder); + }))(builder); }) } @@ -11339,10 +11254,10 @@ export function storeChanPromise(chanPromise: ChanPromise): (builder: Builder) = export function loadChanSignedPromise(slice: Slice): ChanSignedPromise { let sig: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return slice1.loadBits(512) -}) -); + let slice1 = slice.loadRef().beginParse(); + return slice1.loadBits(512) + + })); let promise: ChanPromise = loadChanPromise(slice); return { kind: 'ChanSignedPromise', @@ -11355,17 +11270,14 @@ export function loadChanSignedPromise(slice: Slice): ChanSignedPromise { export function storeChanSignedPromise(chanSignedPromise: ChanSignedPromise): (builder: Builder) => void { return ((builder: Builder) => { storeMaybe(chanSignedPromise.sig, ((arg: BitString) => { - return ((builder: Builder) => { - let cell1 = beginCell(); - - cell1.storeBits(arg); - - builder.storeRef(cell1); + return ((builder: Builder) => { + let cell1 = beginCell(); + cell1.storeBits(arg); + builder.storeRef(cell1); - }) + }) - }) - )(builder); + }))(builder); storeChanPromise(chanSignedPromise.promise)(builder); }) @@ -11457,15 +11369,15 @@ export function storeChanMsg(chanMsg: ChanMsg): (builder: Builder) => void { export function loadChanSignedMsg(slice: Slice): ChanSignedMsg { let sig_A: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return slice1.loadBits(512) -}) -); + let slice1 = slice.loadRef().beginParse(); + return slice1.loadBits(512) + + })); let sig_B: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return slice1.loadBits(512) -}) -); + let slice1 = slice.loadRef().beginParse(); + return slice1.loadBits(512) + + })); let msg: ChanMsg = loadChanMsg(slice); return { kind: 'ChanSignedMsg', @@ -11479,29 +11391,23 @@ export function loadChanSignedMsg(slice: Slice): ChanSignedMsg { export function storeChanSignedMsg(chanSignedMsg: ChanSignedMsg): (builder: Builder) => void { return ((builder: Builder) => { storeMaybe(chanSignedMsg.sig_A, ((arg: BitString) => { - return ((builder: Builder) => { - let cell1 = beginCell(); - - cell1.storeBits(arg); - - builder.storeRef(cell1); + return ((builder: Builder) => { + let cell1 = beginCell(); + cell1.storeBits(arg); + builder.storeRef(cell1); - }) + }) - }) - )(builder); + }))(builder); storeMaybe(chanSignedMsg.sig_B, ((arg: BitString) => { - return ((builder: Builder) => { - let cell1 = beginCell(); - - cell1.storeBits(arg); - - builder.storeRef(cell1); + return ((builder: Builder) => { + let cell1 = beginCell(); + cell1.storeBits(arg); + builder.storeRef(cell1); - }) + }) - }) - )(builder); + }))(builder); storeChanMsg(chanSignedMsg.msg)(builder); }) diff --git a/generated_test.ts b/generated_test.ts index 9f24515..0bd6d11 100644 --- a/generated_test.ts +++ b/generated_test.ts @@ -859,9 +859,9 @@ export function storeIntBits(intBits: IntBits, storeArg: (arg: Arg) => export function loadIntBitsInside(slice: Slice, arg0: number): IntBitsInside { let a: IntBits = loadIntBits(slice, ((slice: Slice) => { - return slice.loadInt((1 + (arg0 / 2))) -}) -); + return slice.loadInt((1 + (arg0 / 2))) + + })); return { kind: 'IntBitsInside', x: (arg0 / 2), @@ -873,12 +873,11 @@ export function loadIntBitsInside(slice: Slice, arg0: number): IntBitsInside { export function storeIntBitsInside(intBitsInside: IntBitsInside): (builder: Builder) => void { return ((builder: Builder) => { storeIntBits(intBitsInside.a, ((arg: number) => { - return ((builder: Builder) => { - builder.storeInt(arg, (1 + intBitsInside.x)); - }) + return ((builder: Builder) => { + builder.storeInt(arg, (1 + intBitsInside.x)); + }) - }) - )(builder); + }))(builder); }) } @@ -1004,15 +1003,15 @@ export function storeOneComb(oneComb: OneComb, storeA: (a: A) => (builder: export function loadManyComb(slice: Slice): ManyComb { let y: OneComb>> = loadOneComb>>(slice, ((slice: Slice) => { - return loadOneComb>(slice, ((slice: Slice) => { - return loadOneComb(slice, ((slice: Slice) => { - return slice.loadInt(3) - }) - ) - }) - ) -}) -); + return loadOneComb>(slice, ((slice: Slice) => { + return loadOneComb(slice, ((slice: Slice) => { + return slice.loadInt(3) + + })) + + })) + + })); return { kind: 'ManyComb', y: y, @@ -1023,24 +1022,21 @@ export function loadManyComb(slice: Slice): ManyComb { export function storeManyComb(manyComb: ManyComb): (builder: Builder) => void { return ((builder: Builder) => { storeOneComb>>(manyComb.y, ((arg: OneComb>) => { - return ((builder: Builder) => { - storeOneComb>(arg, ((arg: OneComb) => { return ((builder: Builder) => { - storeOneComb(arg, ((arg: number) => { - return ((builder: Builder) => { - builder.storeInt(arg, 3); - }) + storeOneComb>(arg, ((arg: OneComb) => { + return ((builder: Builder) => { + storeOneComb(arg, ((arg: number) => { + return ((builder: Builder) => { + builder.storeInt(arg, 3); + }) - }) - )(builder); - }) + }))(builder); + }) - }) - )(builder); - }) + }))(builder); + }) - }) - )(builder); + }))(builder); }) } @@ -1048,10 +1044,12 @@ export function storeManyComb(manyComb: ManyComb): (builder: Builder) => void { export function unary_unary_succ_get_n(x: Unary): number { if ((x.kind == 'Unary_unary_zero')) { return 0 + } if ((x.kind == 'Unary_unary_succ')) { let n = x.n; return (n + 1) + } throw new Error(''); } @@ -1184,17 +1182,21 @@ export function storeParamConst(paramConst: ParamConst): (builder: Builder) => v export function paramDifNames_c_get_n(x: ParamDifNames): number { if ((x.kind == 'ParamDifNames_a')) { return 1 + } if ((x.kind == 'ParamDifNames_b')) { return 1 + } if ((x.kind == 'ParamDifNames_c')) { let n = x.n; return (n + 1) + } if ((x.kind == 'ParamDifNames_d')) { let m = x.m; return (m * 2) + } throw new Error(''); } @@ -1202,17 +1204,21 @@ export function paramDifNames_c_get_n(x: ParamDifNames): number { export function paramDifNames_d_get_m(x: ParamDifNames): number { if ((x.kind == 'ParamDifNames_a')) { return 1 + } if ((x.kind == 'ParamDifNames_b')) { return 1 + } if ((x.kind == 'ParamDifNames_c')) { let n = x.n; return (n + 1) + } if ((x.kind == 'ParamDifNames_d')) { let m = x.m; return (m * 2) + } throw new Error(''); } @@ -1290,17 +1296,21 @@ export function storeParamDifNames(paramDifNames: ParamDifNames): (builder: Buil export function paramDifNamesUser_get_k(x: ParamDifNames): number { if ((x.kind == 'ParamDifNames_a')) { return 1 + } if ((x.kind == 'ParamDifNames_b')) { return 1 + } if ((x.kind == 'ParamDifNames_c')) { let n = x.n; return (n + 1) + } if ((x.kind == 'ParamDifNames_d')) { let m = x.m; return (m * 2) + } throw new Error(''); } @@ -1356,10 +1366,12 @@ export function storeNegationFromImplicit(negationFromImplicit: NegationFromImpl export function unaryUserCheckOrder_get_l(label: Unary): number { if ((label.kind == 'Unary_unary_zero')) { return 0 + } if ((label.kind == 'Unary_unary_succ')) { let n = label.n; return (n + 1) + } throw new Error(''); } @@ -1386,23 +1398,23 @@ export function storeUnaryUserCheckOrder(unaryUserCheckOrder: UnaryUserCheckOrde export function loadCombArgCellRef(slice: Slice, loadX: (slice: Slice) => X): CombArgCellRef { let info: number = slice.loadInt(32); let init: Maybe> = loadMaybe>(slice, ((slice: Slice) => { - return loadEither(slice, loadX, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return slice1.loadInt(22) - }) - ) -}) -); + return loadEither(slice, loadX, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse(); + return slice1.loadInt(22) + + })) + + })); let other: Either> = loadEither>(slice, loadX, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadOneComb(slice1, loadX) -}) -); + let slice1 = slice.loadRef().beginParse(); + return loadOneComb(slice1, loadX) + + })); let body: Either = loadEither(slice, loadX, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadX(slice1) -}) -); + let slice1 = slice.loadRef().beginParse(); + return loadX(slice1) + + })); return { kind: 'CombArgCellRef', info: info, @@ -1417,56 +1429,46 @@ export function storeCombArgCellRef(combArgCellRef: CombArgCellRef, storeX return ((builder: Builder) => { builder.storeInt(combArgCellRef.info, 32); storeMaybe>(combArgCellRef.init, ((arg: Either) => { - return ((builder: Builder) => { - storeEither(arg, storeX, ((arg: number) => { return ((builder: Builder) => { - let cell1 = beginCell(); - - cell1.storeInt(arg, 22); + storeEither(arg, storeX, ((arg: number) => { + return ((builder: Builder) => { + let cell1 = beginCell(); + cell1.storeInt(arg, 22); + builder.storeRef(cell1); - builder.storeRef(cell1); + }) + }))(builder); }) - }) - )(builder); - }) - - }) - )(builder); + }))(builder); storeEither>(combArgCellRef.other, storeX, ((arg: OneComb) => { - return ((builder: Builder) => { - let cell1 = beginCell(); - - storeOneComb(arg, storeX)(cell1); - - builder.storeRef(cell1); + return ((builder: Builder) => { + let cell1 = beginCell(); + storeOneComb(arg, storeX)(cell1); + builder.storeRef(cell1); - }) + }) - }) - )(builder); + }))(builder); storeEither(combArgCellRef.body, storeX, ((arg: X) => { - return ((builder: Builder) => { - let cell1 = beginCell(); - - storeX(arg)(cell1); - - builder.storeRef(cell1); + return ((builder: Builder) => { + let cell1 = beginCell(); + storeX(arg)(cell1); + builder.storeRef(cell1); - }) + }) - }) - )(builder); + }))(builder); }) } export function loadCombArgCellRefUser(slice: Slice): CombArgCellRefUser { let x: CombArgCellRef = loadCombArgCellRef(slice, ((slice: Slice) => { - return slice.loadInt(12) -}) -); + return slice.loadInt(12) + + })); return { kind: 'CombArgCellRefUser', x: x, @@ -1477,12 +1479,11 @@ export function loadCombArgCellRefUser(slice: Slice): CombArgCellRefUser { export function storeCombArgCellRefUser(combArgCellRefUser: CombArgCellRefUser): (builder: Builder) => void { return ((builder: Builder) => { storeCombArgCellRef(combArgCellRefUser.x, ((arg: number) => { - return ((builder: Builder) => { - builder.storeInt(arg, 12); - }) + return ((builder: Builder) => { + builder.storeInt(arg, 12); + }) - }) - )(builder); + }))(builder); }) } @@ -1572,9 +1573,9 @@ export function storeDollarTag(dollarTag: DollarTag): (builder: Builder) => void export function loadTupleCheck(slice: Slice): TupleCheck { let s: Array = Array.from(Array(3).keys()).map(((arg: number) => { - return slice.loadInt(5) -}) -); + return slice.loadInt(5) + + })); return { kind: 'TupleCheck', s: s, @@ -1585,9 +1586,8 @@ export function loadTupleCheck(slice: Slice): TupleCheck { export function storeTupleCheck(tupleCheck: TupleCheck): (builder: Builder) => void { return ((builder: Builder) => { tupleCheck.s.forEach(((arg: number) => { - builder.storeInt(arg, 5); - }) - ); + builder.storeInt(arg, 5); + })); }) } @@ -1596,14 +1596,17 @@ export function hashmap_get_l(label: HmLabel): number { if ((label.kind == 'HmLabel_hml_short')) { let n = label.n; return n + } if ((label.kind == 'HmLabel_hml_long')) { let n = label.n; return n + } if ((label.kind == 'HmLabel_hml_same')) { let n = label.n; return n + } throw new Error(''); } @@ -1680,10 +1683,12 @@ export function storeHashmapNode(hashmapNode: HashmapNode, storeX: (x: X) export function hmLabel_hml_short_get_n(len: Unary): number { if ((len.kind == 'Unary_unary_zero')) { return 0 + } if ((len.kind == 'Unary_unary_succ')) { let n = len.n; return (n + 1) + } throw new Error(''); } @@ -1694,9 +1699,9 @@ export function loadHmLabel(slice: Slice, m: number): HmLabel { let len: Unary = loadUnary(slice); let n = hmLabel_hml_short_get_n(len); let s: Array = Array.from(Array(n).keys()).map(((arg: number) => { - return slice.loadBits(1) -}) -); + return slice.loadBits(1) + + })); if ((!(n <= m))) { throw new Error(''); } @@ -1713,9 +1718,9 @@ export function loadHmLabel(slice: Slice, m: number): HmLabel { slice.loadUint(2); let n: number = slice.loadUint(bitLen(m)); let s: Array = Array.from(Array(n).keys()).map(((arg: number) => { - return slice.loadBits(1) -}) -); + return slice.loadBits(1) + + })); return { kind: 'HmLabel_hml_long', m: m, @@ -1745,9 +1750,8 @@ export function storeHmLabel(hmLabel: HmLabel): (builder: Builder) => void { builder.storeUint(0b0, 1); storeUnary(hmLabel.len)(builder); hmLabel.s.forEach(((arg: BitString) => { - builder.storeBits(arg); - }) - ); + builder.storeBits(arg); + })); if ((!(hmLabel.n <= hmLabel.m))) { throw new Error(''); } @@ -1759,9 +1763,8 @@ export function storeHmLabel(hmLabel: HmLabel): (builder: Builder) => void { builder.storeUint(0b10, 2); builder.storeUint(hmLabel.n, bitLen(hmLabel.m)); hmLabel.s.forEach(((arg: BitString) => { - builder.storeBits(arg); - }) - ); + builder.storeBits(arg); + })); }) } @@ -1820,9 +1823,9 @@ export function storeHashmapE(hashmapE: HashmapE, storeX: (x: X) => (build export function loadHashmapEUser(slice: Slice): HashmapEUser { let x: HashmapE = loadHashmapE(slice, 8, ((slice: Slice) => { - return slice.loadUint(16) -}) -); + return slice.loadUint(16) + + })); return { kind: 'HashmapEUser', x: x, @@ -1833,12 +1836,11 @@ export function loadHashmapEUser(slice: Slice): HashmapEUser { export function storeHashmapEUser(hashmapEUser: HashmapEUser): (builder: Builder) => void { return ((builder: Builder) => { storeHashmapE(hashmapEUser.x, ((arg: number) => { - return ((builder: Builder) => { - builder.storeUint(arg, 16); - }) + return ((builder: Builder) => { + builder.storeUint(arg, 16); + }) - }) - )(builder); + }))(builder); }) } @@ -2028,9 +2030,9 @@ export function storeParamNamedArgInSecondConstr(paramNamedArgInSecondConstr: Pa export function loadRefCombinatorAny(slice: Slice): RefCombinatorAny { let slice1 = slice.loadRef().beginParse(); let msg: Maybe = loadMaybe(slice1, ((slice: Slice) => { - return slice -}) -); + return slice + + })); return { kind: 'RefCombinatorAny', msg: msg, @@ -2042,12 +2044,11 @@ export function storeRefCombinatorAny(refCombinatorAny: RefCombinatorAny): (buil return ((builder: Builder) => { let cell1 = beginCell(); storeMaybe(refCombinatorAny.msg, ((arg: Slice) => { - return ((builder: Builder) => { - cell1.storeSlice(arg); - }) + return ((builder: Builder) => { + cell1.storeSlice(arg); + }) - }) - )(cell1); + }))(cell1); builder.storeRef(cell1); }) @@ -2078,10 +2079,10 @@ export function storeEqualityExpression(equalityExpression: EqualityExpression): export function loadConditionalRef(slice: Slice): ConditionalRef { let x: number = slice.loadUint(1); let y: Simple | undefined = (x ? ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadSimple(slice1) -}) -(slice) : undefined); + let slice1 = slice.loadRef().beginParse(); + return loadSimple(slice1) + + })(slice) : undefined); return { kind: 'ConditionalRef', x: x, @@ -2095,9 +2096,7 @@ export function storeConditionalRef(conditionalRef: ConditionalRef): (builder: B builder.storeUint(conditionalRef.x, 1); if ((conditionalRef.y != undefined)) { let cell1 = beginCell(); - storeSimple(conditionalRef.y)(cell1); - builder.storeRef(cell1); } diff --git a/src/codegen/CodeBuilder.ts b/src/codegen/CodeBuilder.ts index 6431c84..c52ff16 100644 --- a/src/codegen/CodeBuilder.ts +++ b/src/codegen/CodeBuilder.ts @@ -7,8 +7,8 @@ */ export class CodeBuilder { - private tabLevel = 0 - private code = '' + tabLevel = 0 + code = '' tab() { this.tabLevel++ diff --git a/src/codegen/main.ts b/src/codegen/main.ts index a8c9555..f650f05 100644 --- a/src/codegen/main.ts +++ b/src/codegen/main.ts @@ -180,5 +180,7 @@ export function generate(tree: Program, input: string) { jsCodeDeclarations.forEach(element => { generatedCode += toCode(element, new CodeBuilder()).render() + '\n'; }); - return generatedCode; + // let ex = tFunctionDeclaration(tIdentifier('hello'), tTypeParametersExpression([]), null, [], [tIfStatement(tIdentifier('true'), [tIfStatement(tIdentifier('true'), [tIfStatement(tIdentifier('true'), [tReturnStatement(tNumericLiteral(5))])])])]); + // let ex2 = tFunctionDeclaration(tIdentifier('hello'), tTypeParametersExpression([]), null, [tTypedIdentifier(tIdentifier('x'), tIdentifier('any'))], [tExpressionStatement(tFunctionCall(tIdentifier('hello'), [tArrowFunctionExpression([], [tExpressionStatement(tFunctionCall(tIdentifier('hello'), [tArrowFunctionExpression([], [tExpressionStatement(tFunctionCall(tIdentifier('hello'), [tNumericLiteral(5)]))]) ]))]) ]))]); + return generatedCode;//toCode(ex2, new CodeBuilder()).render() + '\n'; } \ No newline at end of file diff --git a/src/codegen/tsgen.ts b/src/codegen/tsgen.ts index 67669b5..35d27aa 100644 --- a/src/codegen/tsgen.ts +++ b/src/codegen/tsgen.ts @@ -1,4 +1,5 @@ import { CodeBuilder } from "./CodeBuilder"; +import util from 'util' export interface ASTNode { type: TheNode["type"]; @@ -309,7 +310,7 @@ export function toCodeArray(nodeArray: Array, code: CodeBuilder, delime for (let i = 0; i < nodeArray.length; i++) { let currentParam = nodeArray[i]; if (currentParam != undefined) { - code.add(toCode(currentParam).render(), false) + toCode(currentParam, code); } if (i + 1 < nodeArray.length) { code.add(delimeter, false); @@ -337,7 +338,7 @@ export function toCode(node: TheNode, code: CodeBuilder = new CodeBuilder()): Co code.add(`)${node.returnType ? ': ' + toCode(node.returnType).render() : ''} {`) code.inTab(() => { node.body.forEach((statement) => { - toCode(statement, code); + code.append(toCode(statement)); }) }); code.add('}') @@ -349,10 +350,10 @@ export function toCode(node: TheNode, code: CodeBuilder = new CodeBuilder()): Co code.add(`) => {`) code.inTab(() => { node.body.forEach(statement => { - toCode(statement, code); + code.append(toCode(statement)); }) }) - code.add(`})`) + code.add(`})`, false) } if (node.type == "ArrowFunctionType") { @@ -372,7 +373,11 @@ export function toCode(node: TheNode, code: CodeBuilder = new CodeBuilder()): Co } if (node.type == "DeclareVariable") { - code.add(`let ${toCode(node.name).render()}${node.typeName ? ': ' + toCode(node.typeName).render() : ''}${node.init ? ' = ' + toCode(node.init).render() : ''}`, false) + code.add(`let ${toCode(node.name).render()}${node.typeName ? ': ' + toCode(node.typeName).render() : ''}`, false) + if (node.init) { + code.add(' = ', false); + toCode(node.init, code); + } } if (node.type == "ObjectExpression") { @@ -382,7 +387,7 @@ export function toCode(node: TheNode, code: CodeBuilder = new CodeBuilder()): Co code.add(toCode(objectValue).render() + ','); }) }); - code.add('}'); + code.add('}', false); } if (node.type == "MultiStatement") { @@ -397,7 +402,7 @@ export function toCode(node: TheNode, code: CodeBuilder = new CodeBuilder()): Co } if (node.type == "ExpressionStatement") { - code.add(toCode(node.expression).render() + ';') + code.add(toCode(node.expression).render() + ';', false) } if (node.type == "TypeParametersExpression") { @@ -444,20 +449,20 @@ export function toCode(node: TheNode, code: CodeBuilder = new CodeBuilder()): Co code.add(`if (${toCode(node.condition).render()}) {`) code.inTab(() => { node.body.forEach(statement => { - toCode(statement, code); + code.append(toCode(statement)); }) }) - code.add('}') + code.add('}', false) } if (node.type == "ForCycle") { code.add(`for (${toCode(node.init).render()};${toCode(node.cond).render()};${toCode(node.inc).render()}) {`) code.inTab(() => { node.body.forEach(statement => { - toCode(statement, code); + code.append(toCode(statement)); }) }) - code.add(`}`); + code.add(`}`, false); } if (node.type == "UnaryOpExpression") { From 4268401c5f9a6b01d7130104e5183e64f5e60d82 Mon Sep 17 00:00:00 2001 From: polyprogrammist Date: Tue, 12 Dec 2023 01:27:47 -0500 Subject: [PATCH 09/10] tmp --- src/codegen/main.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/codegen/main.ts b/src/codegen/main.ts index f650f05..a8c9555 100644 --- a/src/codegen/main.ts +++ b/src/codegen/main.ts @@ -180,7 +180,5 @@ export function generate(tree: Program, input: string) { jsCodeDeclarations.forEach(element => { generatedCode += toCode(element, new CodeBuilder()).render() + '\n'; }); - // let ex = tFunctionDeclaration(tIdentifier('hello'), tTypeParametersExpression([]), null, [], [tIfStatement(tIdentifier('true'), [tIfStatement(tIdentifier('true'), [tIfStatement(tIdentifier('true'), [tReturnStatement(tNumericLiteral(5))])])])]); - // let ex2 = tFunctionDeclaration(tIdentifier('hello'), tTypeParametersExpression([]), null, [tTypedIdentifier(tIdentifier('x'), tIdentifier('any'))], [tExpressionStatement(tFunctionCall(tIdentifier('hello'), [tArrowFunctionExpression([], [tExpressionStatement(tFunctionCall(tIdentifier('hello'), [tArrowFunctionExpression([], [tExpressionStatement(tFunctionCall(tIdentifier('hello'), [tNumericLiteral(5)]))]) ]))]) ]))]); - return generatedCode;//toCode(ex2, new CodeBuilder()).render() + '\n'; + return generatedCode; } \ No newline at end of file From f694ed1f6cfa427560e9178389e03ab1119201d3 Mon Sep 17 00:00:00 2001 From: polyprogrammist Date: Tue, 12 Dec 2023 01:29:42 -0500 Subject: [PATCH 10/10] tmp --- generate_all.ts | 4 ---- src/codegen/tsgen.ts | 19 ------------------- 2 files changed, 23 deletions(-) diff --git a/generate_all.ts b/generate_all.ts index c670477..fd92b33 100644 --- a/generate_all.ts +++ b/generate_all.ts @@ -26,7 +26,3 @@ function generateCode(filename: string) { // generateCode('my') generateCode('block') generateCode('test') - -// let cb = new CodeBuilder(); - -// fs.writeFile('tmp.ts', cb.render(), () => { }); diff --git a/src/codegen/tsgen.ts b/src/codegen/tsgen.ts index 35d27aa..85ee4a9 100644 --- a/src/codegen/tsgen.ts +++ b/src/codegen/tsgen.ts @@ -287,25 +287,6 @@ export function tMultiStatement(statements: Array): MultiStatement { return { type: "MultiStatement", statements: statements }; } - - -// export function toCodeArray(nodeArray: Array, delimeter: string, prefix: string, printContext: PrintContext, suffix: string) { -// let parameters: string = ''; - -// for (let i = 0; i < nodeArray.length; i++) { -// let currentParam = nodeArray[i]; -// if (currentParam != undefined) { -// parameters += prefix + toCode(currentParam, printContext) + suffix; -// } -// if (i + 1 < nodeArray.length) { -// parameters += delimeter; -// } -// } - -// return parameters; -// } - - export function toCodeArray(nodeArray: Array, code: CodeBuilder, delimeter: string) { for (let i = 0; i < nodeArray.length; i++) { let currentParam = nodeArray[i];