pub fn encode(self) -> Script {
        use ScriptCall::*;
        match self {
            AddCurrencyToAccount { currency } => encode_add_currency_to_account_script(currency),
            AddRecoveryRotationCapability { recovery_address } => {
                encode_add_recovery_rotation_capability_script(recovery_address)
            }
            AddValidatorAndReconfigure {
                sliding_nonce,
                validator_name,
                validator_address,
            } => encode_add_validator_and_reconfigure_script(
                sliding_nonce,
                validator_name,
                validator_address,
            ),
            Burn {
                token,
                sliding_nonce,
                preburn_address,
            } => encode_burn_script(token, sliding_nonce, preburn_address),
            BurnTxnFees { coin_type } => encode_burn_txn_fees_script(coin_type),
            CancelBurn {
                token,
                preburn_address,
            } => encode_cancel_burn_script(token, preburn_address),
            CreateChildVaspAccount {
                coin_type,
                child_address,
                auth_key_prefix,
                add_all_currencies,
                child_initial_balance,
            } => encode_create_child_vasp_account_script(
                coin_type,
                child_address,
                auth_key_prefix,
                add_all_currencies,
                child_initial_balance,
            ),
            CreateDesignatedDealer {
                currency,
                sliding_nonce,
                addr,
                auth_key_prefix,
                human_name,
                base_url,
                compliance_public_key,
                add_all_currencies,
            } => encode_create_designated_dealer_script(
                currency,
                sliding_nonce,
                addr,
                auth_key_prefix,
                human_name,
                base_url,
                compliance_public_key,
                add_all_currencies,
            ),
            CreateParentVaspAccount {
                coin_type,
                sliding_nonce,
                new_account_address,
                auth_key_prefix,
                human_name,
                base_url,
                compliance_public_key,
                add_all_currencies,
            } => encode_create_parent_vasp_account_script(
                coin_type,
                sliding_nonce,
                new_account_address,
                auth_key_prefix,
                human_name,
                base_url,
                compliance_public_key,
                add_all_currencies,
            ),
            CreateRecoveryAddress {} => encode_create_recovery_address_script(),
            CreateTestingAccount {
                coin_type,
                new_account_address,
                auth_key_prefix,
                add_all_currencies,
            } => encode_create_testing_account_script(
                coin_type,
                new_account_address,
                auth_key_prefix,
                add_all_currencies,
            ),
            CreateValidatorAccount {
                sliding_nonce,
                new_account_address,
                auth_key_prefix,
                human_name,
            } => encode_create_validator_account_script(
                sliding_nonce,
                new_account_address,
                auth_key_prefix,
                human_name,
            ),
            CreateValidatorOperatorAccount {
                sliding_nonce,
                new_account_address,
                auth_key_prefix,
                human_name,
            } => encode_create_validator_operator_account_script(
                sliding_nonce,
                new_account_address,
                auth_key_prefix,
                human_name,
            ),
            FreezeAccount {
                sliding_nonce,
                to_freeze_account,
            } => encode_freeze_account_script(sliding_nonce, to_freeze_account),
            MintLbr { amount_lbr } => encode_mint_lbr_script(amount_lbr),
            ModifyPublishingOption { args } => encode_modify_publishing_option_script(args),
            PeerToPeerWithMetadata {
                currency,
                payee,
                amount,
                metadata,
                metadata_signature,
            } => encode_peer_to_peer_with_metadata_script(
                currency,
                payee,
                amount,
                metadata,
                metadata_signature,
            ),
            Preburn { token, amount } => encode_preburn_script(token, amount),
            PublishAccountLimitDefinition { coin_type } => {
                encode_publish_account_limit_definition_script(coin_type)
            }
            PublishSharedEd25519PublicKey { public_key } => {
                encode_publish_shared_ed25519_public_key_script(public_key)
            }
            RegisterValidatorConfig {
                validator_account,
                consensus_pubkey,
                validator_network_identity_pubkey,
                validator_network_address,
                fullnodes_network_identity_pubkey,
                fullnodes_network_address,
            } => encode_register_validator_config_script(
                validator_account,
                consensus_pubkey,
                validator_network_identity_pubkey,
                validator_network_address,
                fullnodes_network_identity_pubkey,
                fullnodes_network_address,
            ),
            RemoveValidatorAndReconfigure {
                sliding_nonce,
                validator_name,
                validator_address,
            } => encode_remove_validator_and_reconfigure_script(
                sliding_nonce,
                validator_name,
                validator_address,
            ),
            RotateAuthenticationKey { new_key } => encode_rotate_authentication_key_script(new_key),
            RotateAuthenticationKeyWithNonce {
                sliding_nonce,
                new_key,
            } => encode_rotate_authentication_key_with_nonce_script(sliding_nonce, new_key),
            RotateAuthenticationKeyWithRecoveryAddress {
                recovery_address,
                to_recover,
                new_key,
            } => encode_rotate_authentication_key_with_recovery_address_script(
                recovery_address,
                to_recover,
                new_key,
            ),
            RotateDualAttestationInfo { new_url, new_key } => {
                encode_rotate_dual_attestation_info_script(new_url, new_key)
            }
            RotateSharedEd25519PublicKey { public_key } => {
                encode_rotate_shared_ed25519_public_key_script(public_key)
            }
            SetValidatorConfigAndReconfigure {
                validator_account,
                consensus_pubkey,
                validator_network_identity_pubkey,
                validator_network_address,
                fullnodes_network_identity_pubkey,
                fullnodes_network_address,
            } => encode_set_validator_config_and_reconfigure_script(
                validator_account,
                consensus_pubkey,
                validator_network_identity_pubkey,
                validator_network_address,
                fullnodes_network_identity_pubkey,
                fullnodes_network_address,
            ),
            SetValidatorOperator {
                operator_name,
                operator_account,
            } => encode_set_validator_operator_script(operator_name, operator_account),
            TestnetMint {
                token,
                payee,
                amount,
            } => encode_testnet_mint_script(token, payee, amount),
            TieredMint {
                coin_type,
                sliding_nonce,
                designated_dealer_address,
                mint_amount,
                tier_index,
            } => encode_tiered_mint_script(
                coin_type,
                sliding_nonce,
                designated_dealer_address,
                mint_amount,
                tier_index,
            ),
            UnfreezeAccount {
                sliding_nonce,
                to_unfreeze_account,
            } => encode_unfreeze_account_script(sliding_nonce, to_unfreeze_account),
            UnmintLbr { amount_lbr } => encode_unmint_lbr_script(amount_lbr),
            UpdateAccountLimitDefinition {
                coin_type,
                limit_address,
                sliding_nonce,
                new_max_inflow,
                new_max_outflow,
                new_max_holding_balance,
                new_time_period,
            } => encode_update_account_limit_definition_script(
                coin_type,
                limit_address,
                sliding_nonce,
                new_max_inflow,
                new_max_outflow,
                new_max_holding_balance,
                new_time_period,
            ),
            UpdateAccountLimitWindowInfo {
                coin_type,
                window_address,
                aggregate_balance,
                new_limit_address,
            } => encode_update_account_limit_window_info_script(
                coin_type,
                window_address,
                aggregate_balance,
                new_limit_address,
            ),
            UpdateDualAttestationLimit {
                sliding_nonce,
                new_micro_lbr_limit,
            } => encode_update_dual_attestation_limit_script(sliding_nonce, new_micro_lbr_limit),
            UpdateExchangeRate {
                currency,
                sliding_nonce,
                new_exchange_rate_numerator,
                new_exchange_rate_denominator,
            } => encode_update_exchange_rate_script(
                currency,
                sliding_nonce,
                new_exchange_rate_numerator,
                new_exchange_rate_denominator,
            ),
            UpdateLibraVersion {
                sliding_nonce,
                major,
            } => encode_update_libra_version_script(sliding_nonce, major),
            UpdateMintingAbility {
                currency,
                allow_minting,
            } => encode_update_minting_ability_script(currency, allow_minting),
        }
    }
/// Build a Libra `Script` from a structured object `ScriptCall`.
Build a Libra `Script` from a structured object `ScriptCall`.
Build a Libra ` Script ` from a structured object ` ScriptCall ` .
pub fn encode(self) -> Script {
        use ScriptCall::*;
        match self {
            AddCurrencyToAccount { currency } => encode_add_currency_to_account_script(currency),
            AddRecoveryRotationCapability { recovery_address } => {
                encode_add_recovery_rotation_capability_script(recovery_address)
            }
            AddValidatorAndReconfigure {
                sliding_nonce,
                validator_name,
                validator_address,
            } => encode_add_validator_and_reconfigure_script(
                sliding_nonce,
                validator_name,
                validator_address,
            ),
            Burn {
                token,
                sliding_nonce,
                preburn_address,
            } => encode_burn_script(token, sliding_nonce, preburn_address),
            BurnTxnFees { coin_type } => encode_burn_txn_fees_script(coin_type),
            CancelBurn {
                token,
                preburn_address,
            } => encode_cancel_burn_script(token, preburn_address),
            CreateChildVaspAccount {
                coin_type,
                child_address,
                auth_key_prefix,
                add_all_currencies,
                child_initial_balance,
            } => encode_create_child_vasp_account_script(
                coin_type,
                child_address,
                auth_key_prefix,
                add_all_currencies,
                child_initial_balance,
            ),
            CreateDesignatedDealer {
                currency,
                sliding_nonce,
                addr,
                auth_key_prefix,
                human_name,
                base_url,
                compliance_public_key,
                add_all_currencies,
            } => encode_create_designated_dealer_script(
                currency,
                sliding_nonce,
                addr,
                auth_key_prefix,
                human_name,
                base_url,
                compliance_public_key,
                add_all_currencies,
            ),
            CreateParentVaspAccount {
                coin_type,
                sliding_nonce,
                new_account_address,
                auth_key_prefix,
                human_name,
                base_url,
                compliance_public_key,
                add_all_currencies,
            } => encode_create_parent_vasp_account_script(
                coin_type,
                sliding_nonce,
                new_account_address,
                auth_key_prefix,
                human_name,
                base_url,
                compliance_public_key,
                add_all_currencies,
            ),
            CreateRecoveryAddress {} => encode_create_recovery_address_script(),
            CreateTestingAccount {
                coin_type,
                new_account_address,
                auth_key_prefix,
                add_all_currencies,
            } => encode_create_testing_account_script(
                coin_type,
                new_account_address,
                auth_key_prefix,
                add_all_currencies,
            ),
            CreateValidatorAccount {
                sliding_nonce,
                new_account_address,
                auth_key_prefix,
                human_name,
            } => encode_create_validator_account_script(
                sliding_nonce,
                new_account_address,
                auth_key_prefix,
                human_name,
            ),
            CreateValidatorOperatorAccount {
                sliding_nonce,
                new_account_address,
                auth_key_prefix,
                human_name,
            } => encode_create_validator_operator_account_script(
                sliding_nonce,
                new_account_address,
                auth_key_prefix,
                human_name,
            ),
            FreezeAccount {
                sliding_nonce,
                to_freeze_account,
            } => encode_freeze_account_script(sliding_nonce, to_freeze_account),
            MintLbr { amount_lbr } => encode_mint_lbr_script(amount_lbr),
            ModifyPublishingOption { args } => encode_modify_publishing_option_script(args),
            PeerToPeerWithMetadata {
                currency,
                payee,
                amount,
                metadata,
                metadata_signature,
            } => encode_peer_to_peer_with_metadata_script(
                currency,
                payee,
                amount,
                metadata,
                metadata_signature,
            ),
            Preburn { token, amount } => encode_preburn_script(token, amount),
            PublishAccountLimitDefinition { coin_type } => {
                encode_publish_account_limit_definition_script(coin_type)
            }
            PublishSharedEd25519PublicKey { public_key } => {
                encode_publish_shared_ed25519_public_key_script(public_key)
            }
            RegisterValidatorConfig {
                validator_account,
                consensus_pubkey,
                validator_network_identity_pubkey,
                validator_network_address,
                fullnodes_network_identity_pubkey,
                fullnodes_network_address,
            } => encode_register_validator_config_script(
                validator_account,
                consensus_pubkey,
                validator_network_identity_pubkey,
                validator_network_address,
                fullnodes_network_identity_pubkey,
                fullnodes_network_address,
            ),
            RemoveValidatorAndReconfigure {
                sliding_nonce,
                validator_name,
                validator_address,
            } => encode_remove_validator_and_reconfigure_script(
                sliding_nonce,
                validator_name,
                validator_address,
            ),
            RotateAuthenticationKey { new_key } => encode_rotate_authentication_key_script(new_key),
            RotateAuthenticationKeyWithNonce {
                sliding_nonce,
                new_key,
            } => encode_rotate_authentication_key_with_nonce_script(sliding_nonce, new_key),
            RotateAuthenticationKeyWithRecoveryAddress {
                recovery_address,
                to_recover,
                new_key,
            } => encode_rotate_authentication_key_with_recovery_address_script(
                recovery_address,
                to_recover,
                new_key,
            ),
            RotateDualAttestationInfo { new_url, new_key } => {
                encode_rotate_dual_attestation_info_script(new_url, new_key)
            }
            RotateSharedEd25519PublicKey { public_key } => {
                encode_rotate_shared_ed25519_public_key_script(public_key)
            }
            SetValidatorConfigAndReconfigure {
                validator_account,
                consensus_pubkey,
                validator_network_identity_pubkey,
                validator_network_address,
                fullnodes_network_identity_pubkey,
                fullnodes_network_address,
            } => encode_set_validator_config_and_reconfigure_script(
                validator_account,
                consensus_pubkey,
                validator_network_identity_pubkey,
                validator_network_address,
                fullnodes_network_identity_pubkey,
                fullnodes_network_address,
            ),
            SetValidatorOperator {
                operator_name,
                operator_account,
            } => encode_set_validator_operator_script(operator_name, operator_account),
            TestnetMint {
                token,
                payee,
                amount,
            } => encode_testnet_mint_script(token, payee, amount),
            TieredMint {
                coin_type,
                sliding_nonce,
                designated_dealer_address,
                mint_amount,
                tier_index,
            } => encode_tiered_mint_script(
                coin_type,
                sliding_nonce,
                designated_dealer_address,
                mint_amount,
                tier_index,
            ),
            UnfreezeAccount {
                sliding_nonce,
                to_unfreeze_account,
            } => encode_unfreeze_account_script(sliding_nonce, to_unfreeze_account),
            UnmintLbr { amount_lbr } => encode_unmint_lbr_script(amount_lbr),
            UpdateAccountLimitDefinition {
                coin_type,
                limit_address,
                sliding_nonce,
                new_max_inflow,
                new_max_outflow,
                new_max_holding_balance,
                new_time_period,
            } => encode_update_account_limit_definition_script(
                coin_type,
                limit_address,
                sliding_nonce,
                new_max_inflow,
                new_max_outflow,
                new_max_holding_balance,
                new_time_period,
            ),
            UpdateAccountLimitWindowInfo {
                coin_type,
                window_address,
                aggregate_balance,
                new_limit_address,
            } => encode_update_account_limit_window_info_script(
                coin_type,
                window_address,
                aggregate_balance,
                new_limit_address,
            ),
            UpdateDualAttestationLimit {
                sliding_nonce,
                new_micro_lbr_limit,
            } => encode_update_dual_attestation_limit_script(sliding_nonce, new_micro_lbr_limit),
            UpdateExchangeRate {
                currency,
                sliding_nonce,
                new_exchange_rate_numerator,
                new_exchange_rate_denominator,
            } => encode_update_exchange_rate_script(
                currency,
                sliding_nonce,
                new_exchange_rate_numerator,
                new_exchange_rate_denominator,
            ),
            UpdateLibraVersion {
                sliding_nonce,
                major,
            } => encode_update_libra_version_script(sliding_nonce, major),
            UpdateMintingAbility {
                currency,
                allow_minting,
            } => encode_update_minting_ability_script(currency, allow_minting),
        }
    }
pub fn encode ( self ) -> Script { use ScriptCall :: * ; match self { AddCurrencyToAccount { currency } => encode_add_currency_to_account_script ( currency ) , AddRecoveryRotationCapability { recovery_address } => { encode_add_recovery_rotation_capability_script ( recovery_address ) } AddValidatorAndReconfigure { sliding_nonce , validator_name , validator_address , } => encode_add_validator_and_reconfigure_script ( sliding_nonce , validator_name , validator_address , ) , Burn { token , sliding_nonce , preburn_address , } => encode_burn_script ( token , sliding_nonce , preburn_address ) , BurnTxnFees { coin_type } => encode_burn_txn_fees_script ( coin_type ) , CancelBurn { token , preburn_address , } => encode_cancel_burn_script ( token , preburn_address ) , CreateChildVaspAccount { coin_type , child_address , auth_key_prefix , add_all_currencies , child_initial_balance , } => encode_create_child_vasp_account_script ( coin_type , child_address , auth_key_prefix , add_all_currencies , child_initial_balance , ) , CreateDesignatedDealer { currency , sliding_nonce , addr , auth_key_prefix , human_name , base_url , compliance_public_key , add_all_currencies , } => encode_create_designated_dealer_script ( currency , sliding_nonce , addr , auth_key_prefix , human_name , base_url , compliance_public_key , add_all_currencies , ) , CreateParentVaspAccount { coin_type , sliding_nonce , new_account_address , auth_key_prefix , human_name , base_url , compliance_public_key , add_all_currencies , } => encode_create_parent_vasp_account_script ( coin_type , sliding_nonce , new_account_address , auth_key_prefix , human_name , base_url , compliance_public_key , add_all_currencies , ) , CreateRecoveryAddress { } => encode_create_recovery_address_script ( ) , CreateTestingAccount { coin_type , new_account_address , auth_key_prefix , add_all_currencies , } => encode_create_testing_account_script ( coin_type , new_account_address , auth_key_prefix , add_all_currencies , ) , CreateValidatorAccount { sliding_nonce , new_account_address , auth_key_prefix , human_name , } => encode_create_validator_account_script ( sliding_nonce , new_account_address , auth_key_prefix , human_name , ) , CreateValidatorOperatorAccount { sliding_nonce , new_account_address , auth_key_prefix , human_name , } => encode_create_validator_operator_account_script ( sliding_nonce , new_account_address , auth_key_prefix , human_name , ) , FreezeAccount { sliding_nonce , to_freeze_account , } => encode_freeze_account_script ( sliding_nonce , to_freeze_account ) , MintLbr { amount_lbr } => encode_mint_lbr_script ( amount_lbr ) , ModifyPublishingOption { args } => encode_modify_publishing_option_script ( args ) , PeerToPeerWithMetadata { currency , payee , amount , metadata , metadata_signature , } => encode_peer_to_peer_with_metadata_script ( currency , payee , amount , metadata , metadata_signature , ) , Preburn { token , amount } => encode_preburn_script ( token , amount ) , PublishAccountLimitDefinition { coin_type } => { encode_publish_account_limit_definition_script ( coin_type ) } PublishSharedEd25519PublicKey { public_key } => { encode_publish_shared_ed25519_public_key_script ( public_key ) } RegisterValidatorConfig { validator_account , consensus_pubkey , validator_network_identity_pubkey , validator_network_address , fullnodes_network_identity_pubkey , fullnodes_network_address , } => encode_register_validator_config_script ( validator_account , consensus_pubkey , validator_network_identity_pubkey , validator_network_address , fullnodes_network_identity_pubkey , fullnodes_network_address , ) , RemoveValidatorAndReconfigure { sliding_nonce , validator_name , validator_address , } => encode_remove_validator_and_reconfigure_script ( sliding_nonce , validator_name , validator_address , ) , RotateAuthenticationKey { new_key } => encode_rotate_authentication_key_script ( new_key ) , RotateAuthenticationKeyWithNonce { sliding_nonce , new_key , } => encode_rotate_authentication_key_with_nonce_script ( sliding_nonce , new_key ) , RotateAuthenticationKeyWithRecoveryAddress { recovery_address , to_recover , new_key , } => encode_rotate_authentication_key_with_recovery_address_script ( recovery_address , to_recover , new_key , ) , RotateDualAttestationInfo { new_url , new_key } => { encode_rotate_dual_attestation_info_script ( new_url , new_key ) } RotateSharedEd25519PublicKey { public_key } => { encode_rotate_shared_ed25519_public_key_script ( public_key ) } SetValidatorConfigAndReconfigure { validator_account , consensus_pubkey , validator_network_identity_pubkey , validator_network_address , fullnodes_network_identity_pubkey , fullnodes_network_address , } => encode_set_validator_config_and_reconfigure_script ( validator_account , consensus_pubkey , validator_network_identity_pubkey , validator_network_address , fullnodes_network_identity_pubkey , fullnodes_network_address , ) , SetValidatorOperator { operator_name , operator_account , } => encode_set_validator_operator_script ( operator_name , operator_account ) , TestnetMint { token , payee , amount , } => encode_testnet_mint_script ( token , payee , amount ) , TieredMint { coin_type , sliding_nonce , designated_dealer_address , mint_amount , tier_index , } => encode_tiered_mint_script ( coin_type , sliding_nonce , designated_dealer_address , mint_amount , tier_index , ) , UnfreezeAccount { sliding_nonce , to_unfreeze_account , } => encode_unfreeze_account_script ( sliding_nonce , to_unfreeze_account ) , UnmintLbr { amount_lbr } => encode_unmint_lbr_script ( amount_lbr ) , UpdateAccountLimitDefinition { coin_type , limit_address , sliding_nonce , new_max_inflow , new_max_outflow , new_max_holding_balance , new_time_period , } => encode_update_account_limit_definition_script ( coin_type , limit_address , sliding_nonce , new_max_inflow , new_max_outflow , new_max_holding_balance , new_time_period , ) , UpdateAccountLimitWindowInfo { coin_type , window_address , aggregate_balance , new_limit_address , } => encode_update_account_limit_window_info_script ( coin_type , window_address , aggregate_balance , new_limit_address , ) , UpdateDualAttestationLimit { sliding_nonce , new_micro_lbr_limit , } => encode_update_dual_attestation_limit_script ( sliding_nonce , new_micro_lbr_limit ) , UpdateExchangeRate { currency , sliding_nonce , new_exchange_rate_numerator , new_exchange_rate_denominator , } => encode_update_exchange_rate_script ( currency , sliding_nonce , new_exchange_rate_numerator , new_exchange_rate_denominator , ) , UpdateLibraVersion { sliding_nonce , major , } => encode_update_libra_version_script ( sliding_nonce , major ) , UpdateMintingAbility { currency , allow_minting , } => encode_update_minting_ability_script ( currency , allow_minting ) , } }
Build a Libra `Script` from a structured object `ScriptCall`.
Build a Libra ` Script ` from a structured object ` ScriptCall ` .
self
self