From aa49927dcdea31f0303ec39d4e37e1d04b36f696 Mon Sep 17 00:00:00 2001 From: Jeremy Letang Date: Fri, 28 Jul 2023 20:11:33 +0100 Subject: [PATCH] chore: add rollup config Signed-off-by: Jeremy Letang --- cjs/google.cjs | 7 + cjs/google/protobuf.cjs | 13 + cjs/google/protobuf/ListValue.cjs | 9 + cjs/google/protobuf/ListValue/decode.cjs | 20 ++ cjs/google/protobuf/ListValue/encode.cjs | 21 ++ cjs/google/protobuf/NullValue.cjs | 58 +++ cjs/google/protobuf/Struct.cjs | 11 + cjs/google/protobuf/Struct/FieldsEntry.cjs | 9 + .../protobuf/Struct/FieldsEntry/decode.cjs | 26 ++ .../protobuf/Struct/FieldsEntry/encode.cjs | 22 ++ cjs/google/protobuf/Struct/decode.cjs | 20 ++ cjs/google/protobuf/Struct/encode.cjs | 23 ++ cjs/google/protobuf/Value.cjs | 9 + cjs/google/protobuf/Value/decode.cjs | 43 +++ cjs/google/protobuf/Value/encode.cjs | 44 +++ cjs/index.cjs | 9 + cjs/vega.cjs | 333 ++++++++++++++++++ cjs/vega/Account.cjs | 9 + cjs/vega/Account/decode.cjs | 53 +++ cjs/vega/Account/encode.cjs | 26 ++ cjs/vega/AccountDetails.cjs | 9 + cjs/vega/AccountDetails/decode.cjs | 41 +++ cjs/vega/AccountDetails/encode.cjs | 24 ++ cjs/vega/AccountType.cjs | 139 ++++++++ cjs/vega/Asset.cjs | 11 + cjs/vega/Asset/Status.cjs | 78 ++++ cjs/vega/Asset/decode.cjs | 32 ++ cjs/vega/Asset/encode.cjs | 24 ++ cjs/vega/AssetDetails.cjs | 9 + cjs/vega/AssetDetails/decode.cjs | 52 +++ cjs/vega/AssetDetails/encode.cjs | 33 ++ cjs/vega/AssetDetailsUpdate.cjs | 9 + cjs/vega/AssetDetailsUpdate/decode.cjs | 26 ++ cjs/vega/AssetDetailsUpdate/encode.cjs | 24 ++ cjs/vega/AuctionDuration.cjs | 9 + cjs/vega/AuctionDuration/decode.cjs | 25 ++ cjs/vega/AuctionDuration/encode.cjs | 21 ++ cjs/vega/AuctionIndicativeState.cjs | 9 + cjs/vega/AuctionIndicativeState/decode.cjs | 46 +++ cjs/vega/AuctionIndicativeState/encode.cjs | 24 ++ cjs/vega/AuctionTrigger.cjs | 87 +++++ cjs/vega/BuiltinAsset.cjs | 9 + cjs/vega/BuiltinAsset/decode.cjs | 20 ++ cjs/vega/BuiltinAsset/encode.cjs | 20 ++ cjs/vega/BuiltinAssetDeposit.cjs | 9 + cjs/vega/BuiltinAssetDeposit/decode.cjs | 34 ++ cjs/vega/BuiltinAssetDeposit/encode.cjs | 22 ++ cjs/vega/BuiltinAssetEvent.cjs | 9 + cjs/vega/BuiltinAssetEvent/decode.cjs | 25 ++ cjs/vega/BuiltinAssetEvent/encode.cjs | 32 ++ cjs/vega/BuiltinAssetWithdrawal.cjs | 9 + cjs/vega/BuiltinAssetWithdrawal/decode.cjs | 34 ++ cjs/vega/BuiltinAssetWithdrawal/encode.cjs | 22 ++ cjs/vega/CancelTransfer.cjs | 9 + cjs/vega/CancelTransfer/decode.cjs | 20 ++ cjs/vega/CancelTransfer/encode.cjs | 21 ++ cjs/vega/CancelTransferConfiguration.cjs | 9 + .../CancelTransferConfiguration/decode.cjs | 20 ++ .../CancelTransferConfiguration/encode.cjs | 20 ++ cjs/vega/Candle.cjs | 9 + cjs/vega/Candle/decode.cjs | 71 ++++ cjs/vega/Candle/encode.cjs | 29 ++ cjs/vega/ChainStatus.cjs | 75 ++++ cjs/vega/DataSourceDefinition.cjs | 9 + cjs/vega/DataSourceDefinition/decode.cjs | 29 ++ cjs/vega/DataSourceDefinition/encode.cjs | 34 ++ cjs/vega/DataSourceDefinitionExternal.cjs | 9 + .../DataSourceDefinitionExternal/decode.cjs | 27 ++ .../DataSourceDefinitionExternal/encode.cjs | 32 ++ cjs/vega/DataSourceDefinitionInternal.cjs | 9 + .../DataSourceDefinitionInternal/decode.cjs | 22 ++ .../DataSourceDefinitionInternal/encode.cjs | 26 ++ cjs/vega/DataSourceSpec.cjs | 11 + cjs/vega/DataSourceSpec/Status.cjs | 70 ++++ cjs/vega/DataSourceSpec/decode.cjs | 48 +++ cjs/vega/DataSourceSpec/encode.cjs | 26 ++ cjs/vega/DataSourceSpecConfiguration.cjs | 9 + .../DataSourceSpecConfiguration/decode.cjs | 26 ++ .../DataSourceSpecConfiguration/encode.cjs | 24 ++ cjs/vega/DataSourceSpecConfigurationTime.cjs | 9 + .../decode.cjs | 20 ++ .../encode.cjs | 23 ++ cjs/vega/DataSourceSpecToFutureBinding.cjs | 9 + .../DataSourceSpecToFutureBinding/decode.cjs | 28 ++ .../DataSourceSpecToFutureBinding/encode.cjs | 23 ++ cjs/vega/Delegation.cjs | 9 + cjs/vega/Delegation/decode.cjs | 40 +++ cjs/vega/Delegation/encode.cjs | 23 ++ cjs/vega/Deposit.cjs | 11 + cjs/vega/Deposit/Status.cjs | 74 ++++ cjs/vega/Deposit/decode.cjs | 65 ++++ cjs/vega/Deposit/encode.cjs | 28 ++ cjs/vega/DispatchMetric.cjs | 79 +++++ cjs/vega/DispatchStrategy.cjs | 9 + cjs/vega/DispatchStrategy/decode.cjs | 35 ++ cjs/vega/DispatchStrategy/encode.cjs | 24 ++ cjs/vega/ERC20.cjs | 9 + cjs/vega/ERC20/decode.cjs | 34 ++ cjs/vega/ERC20/encode.cjs | 22 ++ cjs/vega/ERC20AssetDelist.cjs | 9 + cjs/vega/ERC20AssetDelist/decode.cjs | 20 ++ cjs/vega/ERC20AssetDelist/encode.cjs | 20 ++ cjs/vega/ERC20AssetLimitsUpdated.cjs | 9 + cjs/vega/ERC20AssetLimitsUpdated/decode.cjs | 40 +++ cjs/vega/ERC20AssetLimitsUpdated/encode.cjs | 24 ++ cjs/vega/ERC20AssetList.cjs | 9 + cjs/vega/ERC20AssetList/decode.cjs | 25 ++ cjs/vega/ERC20AssetList/encode.cjs | 21 ++ cjs/vega/ERC20Deposit.cjs | 9 + cjs/vega/ERC20Deposit/decode.cjs | 40 +++ cjs/vega/ERC20Deposit/encode.cjs | 24 ++ cjs/vega/ERC20Event.cjs | 9 + cjs/vega/ERC20Event/decode.cjs | 61 ++++ cjs/vega/ERC20Event/encode.cjs | 58 +++ cjs/vega/ERC20MultiSigEvent.cjs | 9 + cjs/vega/ERC20MultiSigEvent/decode.cjs | 41 +++ cjs/vega/ERC20MultiSigEvent/encode.cjs | 44 +++ cjs/vega/ERC20SignerAdded.cjs | 9 + cjs/vega/ERC20SignerAdded/decode.cjs | 34 ++ cjs/vega/ERC20SignerAdded/encode.cjs | 22 ++ cjs/vega/ERC20SignerRemoved.cjs | 9 + cjs/vega/ERC20SignerRemoved/decode.cjs | 34 ++ cjs/vega/ERC20SignerRemoved/encode.cjs | 22 ++ cjs/vega/ERC20ThresholdSet.cjs | 9 + cjs/vega/ERC20ThresholdSet/decode.cjs | 34 ++ cjs/vega/ERC20ThresholdSet/encode.cjs | 22 ++ cjs/vega/ERC20Update.cjs | 9 + cjs/vega/ERC20Update/decode.cjs | 28 ++ cjs/vega/ERC20Update/encode.cjs | 21 ++ cjs/vega/ERC20Withdrawal.cjs | 9 + cjs/vega/ERC20Withdrawal/decode.cjs | 34 ++ cjs/vega/ERC20Withdrawal/encode.cjs | 23 ++ cjs/vega/Epoch.cjs | 9 + cjs/vega/Epoch/decode.cjs | 43 +++ cjs/vega/Epoch/encode.cjs | 29 ++ cjs/vega/EpochAction.cjs | 71 ++++ cjs/vega/EpochData.cjs | 9 + cjs/vega/EpochData/decode.cjs | 30 ++ cjs/vega/EpochData/encode.cjs | 22 ++ cjs/vega/EpochParticipation.cjs | 9 + cjs/vega/EpochParticipation/decode.cjs | 41 +++ cjs/vega/EpochParticipation/encode.cjs | 24 ++ cjs/vega/EpochRewardSummary.cjs | 9 + cjs/vega/EpochRewardSummary/decode.cjs | 46 +++ cjs/vega/EpochRewardSummary/encode.cjs | 24 ++ cjs/vega/EpochTimestamps.cjs | 9 + cjs/vega/EpochTimestamps/decode.cjs | 46 +++ cjs/vega/EpochTimestamps/encode.cjs | 24 ++ cjs/vega/Erc20WithdrawExt.cjs | 9 + cjs/vega/Erc20WithdrawExt/decode.cjs | 20 ++ cjs/vega/Erc20WithdrawExt/encode.cjs | 20 ++ cjs/vega/ErrorDetail.cjs | 9 + cjs/vega/ErrorDetail/decode.cjs | 30 ++ cjs/vega/ErrorDetail/encode.cjs | 22 ++ cjs/vega/EthCallSpec.cjs | 9 + cjs/vega/EthCallSpec/decode.cjs | 49 +++ cjs/vega/EthCallSpec/encode.cjs | 28 ++ cjs/vega/EthCallTrigger.cjs | 9 + cjs/vega/EthCallTrigger/decode.cjs | 20 ++ cjs/vega/EthCallTrigger/encode.cjs | 24 ++ cjs/vega/EthContractCallEvent.cjs | 9 + cjs/vega/EthContractCallEvent/decode.cjs | 40 +++ cjs/vega/EthContractCallEvent/encode.cjs | 23 ++ cjs/vega/EthTimeTrigger.cjs | 9 + cjs/vega/EthTimeTrigger/decode.cjs | 30 ++ cjs/vega/EthTimeTrigger/encode.cjs | 22 ++ cjs/vega/EthereumConfig.cjs | 9 + cjs/vega/EthereumConfig/decode.cjs | 61 ++++ cjs/vega/EthereumConfig/encode.cjs | 43 +++ cjs/vega/EthereumContractConfig.cjs | 9 + cjs/vega/EthereumContractConfig/decode.cjs | 28 ++ cjs/vega/EthereumContractConfig/encode.cjs | 22 ++ cjs/vega/ExternalDataSourceSpec.cjs | 9 + cjs/vega/ExternalDataSourceSpec/decode.cjs | 20 ++ cjs/vega/ExternalDataSourceSpec/encode.cjs | 20 ++ cjs/vega/Fee.cjs | 9 + cjs/vega/Fee/decode.cjs | 34 ++ cjs/vega/Fee/encode.cjs | 22 ++ cjs/vega/FeeFactors.cjs | 9 + cjs/vega/FeeFactors/decode.cjs | 34 ++ cjs/vega/FeeFactors/encode.cjs | 22 ++ cjs/vega/Fees.cjs | 9 + cjs/vega/Fees/decode.cjs | 20 ++ cjs/vega/Fees/encode.cjs | 20 ++ cjs/vega/FinancialAmount.cjs | 9 + cjs/vega/FinancialAmount/decode.cjs | 25 ++ cjs/vega/FinancialAmount/encode.cjs | 21 ++ cjs/vega/Future.cjs | 9 + cjs/vega/Future/decode.cjs | 52 +++ cjs/vega/Future/encode.cjs | 38 ++ cjs/vega/FutureProduct.cjs | 9 + cjs/vega/FutureProduct/decode.cjs | 52 +++ cjs/vega/FutureProduct/encode.cjs | 38 ++ cjs/vega/GovernanceData.cjs | 13 + cjs/vega/GovernanceData/NoPartyEntry.cjs | 9 + .../GovernanceData/NoPartyEntry/decode.cjs | 26 ++ .../GovernanceData/NoPartyEntry/encode.cjs | 22 ++ cjs/vega/GovernanceData/YesPartyEntry.cjs | 9 + .../GovernanceData/YesPartyEntry/decode.cjs | 26 ++ .../GovernanceData/YesPartyEntry/encode.cjs | 22 ++ cjs/vega/GovernanceData/decode.cjs | 49 +++ cjs/vega/GovernanceData/encode.cjs | 35 ++ cjs/vega/GovernanceTransferType.cjs | 71 ++++ cjs/vega/IcebergOrder.cjs | 9 + cjs/vega/IcebergOrder/decode.cjs | 34 ++ cjs/vega/IcebergOrder/encode.cjs | 22 ++ cjs/vega/Instrument.cjs | 9 + cjs/vega/Instrument/decode.cjs | 53 +++ cjs/vega/Instrument/encode.cjs | 32 ++ cjs/vega/InstrumentConfiguration.cjs | 9 + cjs/vega/InstrumentConfiguration/decode.cjs | 36 ++ cjs/vega/InstrumentConfiguration/encode.cjs | 31 ++ cjs/vega/InstrumentMetadata.cjs | 9 + cjs/vega/InstrumentMetadata/decode.cjs | 20 ++ cjs/vega/InstrumentMetadata/encode.cjs | 20 ++ cjs/vega/Interval.cjs | 88 +++++ cjs/vega/KeyValueBundle.cjs | 9 + cjs/vega/KeyValueBundle/decode.cjs | 31 ++ cjs/vega/KeyValueBundle/encode.cjs | 23 ++ cjs/vega/LedgerEntry.cjs | 9 + cjs/vega/LedgerEntry/decode.cjs | 60 ++++ cjs/vega/LedgerEntry/encode.cjs | 29 ++ cjs/vega/LedgerMovement.cjs | 9 + cjs/vega/LedgerMovement/decode.cjs | 26 ++ cjs/vega/LedgerMovement/encode.cjs | 26 ++ cjs/vega/LiquidityMonitoringParameters.cjs | 9 + .../LiquidityMonitoringParameters/decode.cjs | 35 ++ .../LiquidityMonitoringParameters/encode.cjs | 27 ++ cjs/vega/LiquidityOrder.cjs | 9 + cjs/vega/LiquidityOrder/decode.cjs | 35 ++ cjs/vega/LiquidityOrder/encode.cjs | 23 ++ cjs/vega/LiquidityOrderReference.cjs | 9 + cjs/vega/LiquidityOrderReference/decode.cjs | 26 ++ cjs/vega/LiquidityOrderReference/encode.cjs | 23 ++ cjs/vega/LiquidityProviderFeeShare.cjs | 9 + cjs/vega/LiquidityProviderFeeShare/decode.cjs | 46 +++ cjs/vega/LiquidityProviderFeeShare/encode.cjs | 25 ++ cjs/vega/LiquidityProvision.cjs | 11 + cjs/vega/LiquidityProvision/Status.cjs | 86 +++++ cjs/vega/LiquidityProvision/decode.cjs | 90 +++++ cjs/vega/LiquidityProvision/encode.cjs | 39 ++ cjs/vega/LogNormalModelParams.cjs | 9 + cjs/vega/LogNormalModelParams/decode.cjs | 30 ++ cjs/vega/LogNormalModelParams/encode.cjs | 22 ++ cjs/vega/LogNormalRiskModel.cjs | 9 + cjs/vega/LogNormalRiskModel/decode.cjs | 35 ++ cjs/vega/LogNormalRiskModel/encode.cjs | 24 ++ cjs/vega/MarginCalculator.cjs | 9 + cjs/vega/MarginCalculator/decode.cjs | 20 ++ cjs/vega/MarginCalculator/encode.cjs | 21 ++ cjs/vega/MarginLevels.cjs | 9 + cjs/vega/MarginLevels/decode.cjs | 64 ++++ cjs/vega/MarginLevels/encode.cjs | 28 ++ cjs/vega/Market.cjs | 13 + cjs/vega/Market/State.cjs | 98 ++++++ cjs/vega/Market/TradingMode.cjs | 83 +++++ cjs/vega/Market/decode.cjs | 128 +++++++ cjs/vega/Market/encode.cjs | 62 ++++ cjs/vega/MarketData.cjs | 9 + cjs/vega/MarketData/decode.cjs | 205 +++++++++++ cjs/vega/MarketData/encode.cjs | 64 ++++ cjs/vega/MarketDepth.cjs | 9 + cjs/vega/MarketDepth/decode.cjs | 41 +++ cjs/vega/MarketDepth/encode.cjs | 26 ++ cjs/vega/MarketDepthUpdate.cjs | 9 + cjs/vega/MarketDepthUpdate/decode.cjs | 47 +++ cjs/vega/MarketDepthUpdate/encode.cjs | 28 ++ cjs/vega/MarketTimestamps.cjs | 9 + cjs/vega/MarketTimestamps/decode.cjs | 40 +++ cjs/vega/MarketTimestamps/encode.cjs | 23 ++ cjs/vega/MatrixValue.cjs | 9 + cjs/vega/MatrixValue/decode.cjs | 20 ++ cjs/vega/MatrixValue/encode.cjs | 21 ++ cjs/vega/NetworkLimits.cjs | 9 + cjs/vega/NetworkLimits/decode.cjs | 58 +++ cjs/vega/NetworkLimits/encode.cjs | 28 ++ cjs/vega/NetworkParameter.cjs | 9 + cjs/vega/NetworkParameter/decode.cjs | 25 ++ cjs/vega/NetworkParameter/encode.cjs | 21 ++ cjs/vega/NewAsset.cjs | 9 + cjs/vega/NewAsset/decode.cjs | 20 ++ cjs/vega/NewAsset/encode.cjs | 20 ++ cjs/vega/NewFreeform.cjs | 9 + cjs/vega/NewFreeform/decode.cjs | 13 + cjs/vega/NewFreeform/encode.cjs | 17 + cjs/vega/NewMarket.cjs | 9 + cjs/vega/NewMarket/decode.cjs | 20 ++ cjs/vega/NewMarket/encode.cjs | 21 ++ cjs/vega/NewMarketConfiguration.cjs | 9 + cjs/vega/NewMarketConfiguration/decode.cjs | 96 +++++ cjs/vega/NewMarketConfiguration/encode.cjs | 64 ++++ cjs/vega/NewSpotMarket.cjs | 9 + cjs/vega/NewSpotMarket/decode.cjs | 20 ++ cjs/vega/NewSpotMarket/encode.cjs | 21 ++ cjs/vega/NewSpotMarketConfiguration.cjs | 9 + .../NewSpotMarketConfiguration/decode.cjs | 70 ++++ .../NewSpotMarketConfiguration/encode.cjs | 54 +++ cjs/vega/NewTransfer.cjs | 9 + cjs/vega/NewTransfer/decode.cjs | 20 ++ cjs/vega/NewTransfer/encode.cjs | 21 ++ cjs/vega/NewTransferConfiguration.cjs | 9 + cjs/vega/NewTransferConfiguration/decode.cjs | 78 ++++ cjs/vega/NewTransferConfiguration/encode.cjs | 44 +++ cjs/vega/Node.cjs | 9 + cjs/vega/Node/decode.cjs | 129 +++++++ cjs/vega/Node/encode.cjs | 45 +++ cjs/vega/NodeData.cjs | 9 + cjs/vega/NodeData/decode.cjs | 59 ++++ cjs/vega/NodeData/encode.cjs | 28 ++ cjs/vega/NodeSet.cjs | 9 + cjs/vega/NodeSet/decode.cjs | 46 +++ cjs/vega/NodeSet/encode.cjs | 26 ++ cjs/vega/NodeStatus.cjs | 70 ++++ cjs/vega/OneOffTransfer.cjs | 9 + cjs/vega/OneOffTransfer/decode.cjs | 20 ++ cjs/vega/OneOffTransfer/encode.cjs | 20 ++ cjs/vega/Order.cjs | 15 + cjs/vega/Order/Status.cjs | 94 +++++ cjs/vega/Order/TimeInForce.cjs | 87 +++++ cjs/vega/Order/Type.cjs | 74 ++++ cjs/vega/Order/decode.cjs | 155 ++++++++ cjs/vega/Order/encode.cjs | 52 +++ cjs/vega/OrderCancellationConfirmation.cjs | 9 + .../OrderCancellationConfirmation/decode.cjs | 20 ++ .../OrderCancellationConfirmation/encode.cjs | 20 ++ cjs/vega/OrderConfirmation.cjs | 9 + cjs/vega/OrderConfirmation/decode.cjs | 35 ++ cjs/vega/OrderConfirmation/encode.cjs | 27 ++ cjs/vega/OrderError.cjs | 254 +++++++++++++ cjs/vega/Party.cjs | 9 + cjs/vega/Party/decode.cjs | 20 ++ cjs/vega/Party/encode.cjs | 20 ++ cjs/vega/PeggedOrder.cjs | 9 + cjs/vega/PeggedOrder/decode.cjs | 26 ++ cjs/vega/PeggedOrder/encode.cjs | 22 ++ cjs/vega/PeggedReference.cjs | 75 ++++ cjs/vega/Position.cjs | 9 + cjs/vega/Position/decode.cjs | 71 ++++ cjs/vega/Position/encode.cjs | 31 ++ cjs/vega/PositionStatus.cjs | 75 ++++ cjs/vega/PositionTrade.cjs | 9 + cjs/vega/PositionTrade/decode.cjs | 25 ++ cjs/vega/PositionTrade/encode.cjs | 21 ++ cjs/vega/PostTransferBalance.cjs | 9 + cjs/vega/PostTransferBalance/decode.cjs | 26 ++ cjs/vega/PostTransferBalance/encode.cjs | 22 ++ cjs/vega/PriceLevel.cjs | 9 + cjs/vega/PriceLevel/decode.cjs | 34 ++ cjs/vega/PriceLevel/encode.cjs | 22 ++ cjs/vega/PriceMonitoringBounds.cjs | 9 + cjs/vega/PriceMonitoringBounds/decode.cjs | 41 +++ cjs/vega/PriceMonitoringBounds/encode.cjs | 25 ++ cjs/vega/PriceMonitoringParameters.cjs | 9 + cjs/vega/PriceMonitoringParameters/decode.cjs | 20 ++ cjs/vega/PriceMonitoringParameters/encode.cjs | 23 ++ cjs/vega/PriceMonitoringSettings.cjs | 9 + cjs/vega/PriceMonitoringSettings/decode.cjs | 20 ++ cjs/vega/PriceMonitoringSettings/encode.cjs | 21 ++ cjs/vega/PriceMonitoringTrigger.cjs | 9 + cjs/vega/PriceMonitoringTrigger/decode.cjs | 34 ++ cjs/vega/PriceMonitoringTrigger/encode.cjs | 22 ++ cjs/vega/Proposal.cjs | 11 + cjs/vega/Proposal/State.cjs | 90 +++++ cjs/vega/Proposal/decode.cjs | 99 ++++++ cjs/vega/Proposal/encode.cjs | 40 +++ cjs/vega/ProposalError.cjs | 243 +++++++++++++ cjs/vega/ProposalRationale.cjs | 9 + cjs/vega/ProposalRationale/decode.cjs | 25 ++ cjs/vega/ProposalRationale/encode.cjs | 21 ++ cjs/vega/ProposalTerms.cjs | 9 + cjs/vega/ProposalTerms/decode.cjs | 88 +++++ cjs/vega/ProposalTerms/encode.cjs | 89 +++++ cjs/vega/RankingScore.cjs | 9 + cjs/vega/RankingScore/decode.cjs | 53 +++ cjs/vega/RankingScore/encode.cjs | 27 ++ cjs/vega/RecurringTransfer.cjs | 9 + cjs/vega/RecurringTransfer/decode.cjs | 25 ++ cjs/vega/RecurringTransfer/encode.cjs | 21 ++ cjs/vega/Reward.cjs | 9 + cjs/vega/Reward/decode.cjs | 64 ++++ cjs/vega/Reward/encode.cjs | 27 ++ cjs/vega/RewardScore.cjs | 9 + cjs/vega/RewardScore/decode.cjs | 53 +++ cjs/vega/RewardScore/encode.cjs | 27 ++ cjs/vega/RewardSummary.cjs | 9 + cjs/vega/RewardSummary/decode.cjs | 34 ++ cjs/vega/RewardSummary/encode.cjs | 22 ++ cjs/vega/RiskFactor.cjs | 9 + cjs/vega/RiskFactor/decode.cjs | 30 ++ cjs/vega/RiskFactor/encode.cjs | 22 ++ cjs/vega/ScalarValue.cjs | 9 + cjs/vega/ScalarValue/decode.cjs | 20 ++ cjs/vega/ScalarValue/encode.cjs | 20 ++ cjs/vega/ScalingFactors.cjs | 9 + cjs/vega/ScalingFactors/decode.cjs | 34 ++ cjs/vega/ScalingFactors/encode.cjs | 22 ++ cjs/vega/Side.cjs | 70 ++++ cjs/vega/SimpleModelParams.cjs | 9 + cjs/vega/SimpleModelParams/decode.cjs | 46 +++ cjs/vega/SimpleModelParams/encode.cjs | 25 ++ cjs/vega/SimpleRiskModel.cjs | 9 + cjs/vega/SimpleRiskModel/decode.cjs | 20 ++ cjs/vega/SimpleRiskModel/encode.cjs | 20 ++ cjs/vega/Spot.cjs | 9 + cjs/vega/Spot/decode.cjs | 34 ++ cjs/vega/Spot/encode.cjs | 22 ++ cjs/vega/SpotProduct.cjs | 9 + cjs/vega/SpotProduct/decode.cjs | 34 ++ cjs/vega/SpotProduct/encode.cjs | 22 ++ cjs/vega/StakeDeposited.cjs | 9 + cjs/vega/StakeDeposited/decode.cjs | 40 +++ cjs/vega/StakeDeposited/encode.cjs | 23 ++ cjs/vega/StakeRemoved.cjs | 9 + cjs/vega/StakeRemoved/decode.cjs | 40 +++ cjs/vega/StakeRemoved/encode.cjs | 23 ++ cjs/vega/StakeTotalSupply.cjs | 9 + cjs/vega/StakeTotalSupply/decode.cjs | 25 ++ cjs/vega/StakeTotalSupply/encode.cjs | 21 ++ cjs/vega/StakingEvent.cjs | 9 + cjs/vega/StakingEvent/decode.cjs | 41 +++ cjs/vega/StakingEvent/encode.cjs | 42 +++ cjs/vega/StateValueProposal.cjs | 9 + cjs/vega/StateValueProposal/decode.cjs | 35 ++ cjs/vega/StateValueProposal/encode.cjs | 24 ++ cjs/vega/StateVarValue.cjs | 9 + cjs/vega/StateVarValue/decode.cjs | 30 ++ cjs/vega/StateVarValue/encode.cjs | 36 ++ cjs/vega/StopOrder.cjs | 15 + cjs/vega/StopOrder/ExpiryStrategy.cjs | 71 ++++ cjs/vega/StopOrder/Status.cjs | 86 +++++ cjs/vega/StopOrder/TriggerDirection.cjs | 71 ++++ cjs/vega/StopOrder/decode.cjs | 95 +++++ cjs/vega/StopOrder/encode.cjs | 44 +++ cjs/vega/SuccessorConfiguration.cjs | 9 + cjs/vega/SuccessorConfiguration/decode.cjs | 28 ++ cjs/vega/SuccessorConfiguration/encode.cjs | 22 ++ cjs/vega/TargetStakeParameters.cjs | 9 + cjs/vega/TargetStakeParameters/decode.cjs | 25 ++ cjs/vega/TargetStakeParameters/encode.cjs | 21 ++ cjs/vega/TradableInstrument.cjs | 9 + cjs/vega/TradableInstrument/decode.cjs | 45 +++ cjs/vega/TradableInstrument/encode.cjs | 40 +++ cjs/vega/Trade.cjs | 11 + cjs/vega/Trade/Type.cjs | 74 ++++ cjs/vega/Trade/decode.cjs | 109 ++++++ cjs/vega/Trade/encode.cjs | 37 ++ cjs/vega/TradeSet.cjs | 9 + cjs/vega/TradeSet/decode.cjs | 20 ++ cjs/vega/TradeSet/encode.cjs | 21 ++ cjs/vega/Transfer.cjs | 9 + cjs/vega/Transfer/decode.cjs | 48 +++ cjs/vega/Transfer/encode.cjs | 26 ++ cjs/vega/TransferRequest.cjs | 9 + cjs/vega/TransferRequest/decode.cjs | 54 +++ cjs/vega/TransferRequest/encode.cjs | 29 ++ cjs/vega/TransferType.cjs | 195 ++++++++++ cjs/vega/UpdateAsset.cjs | 9 + cjs/vega/UpdateAsset/decode.cjs | 26 ++ cjs/vega/UpdateAsset/encode.cjs | 22 ++ cjs/vega/UpdateFutureProduct.cjs | 9 + cjs/vega/UpdateFutureProduct/decode.cjs | 46 +++ cjs/vega/UpdateFutureProduct/encode.cjs | 37 ++ cjs/vega/UpdateInstrumentConfiguration.cjs | 9 + .../UpdateInstrumentConfiguration/decode.cjs | 26 ++ .../UpdateInstrumentConfiguration/encode.cjs | 27 ++ cjs/vega/UpdateMarket.cjs | 9 + cjs/vega/UpdateMarket/decode.cjs | 26 ++ cjs/vega/UpdateMarket/encode.cjs | 23 ++ cjs/vega/UpdateMarketConfiguration.cjs | 9 + cjs/vega/UpdateMarketConfiguration/decode.cjs | 77 ++++ cjs/vega/UpdateMarketConfiguration/encode.cjs | 58 +++ cjs/vega/UpdateNetworkParameter.cjs | 9 + cjs/vega/UpdateNetworkParameter/decode.cjs | 20 ++ cjs/vega/UpdateNetworkParameter/encode.cjs | 20 ++ cjs/vega/UpdateSpotMarket.cjs | 9 + cjs/vega/UpdateSpotMarket/decode.cjs | 26 ++ cjs/vega/UpdateSpotMarket/encode.cjs | 23 ++ cjs/vega/UpdateSpotMarketConfiguration.cjs | 9 + .../UpdateSpotMarketConfiguration/decode.cjs | 51 +++ .../UpdateSpotMarketConfiguration/encode.cjs | 48 +++ cjs/vega/ValidatorNodeStatus.cjs | 75 ++++ cjs/vega/VectorValue.cjs | 9 + cjs/vega/VectorValue/decode.cjs | 20 ++ cjs/vega/VectorValue/encode.cjs | 20 ++ cjs/vega/Vote.cjs | 11 + cjs/vega/Vote/Value.cjs | 70 ++++ cjs/vega/Vote/decode.cjs | 59 ++++ cjs/vega/Vote/encode.cjs | 30 ++ cjs/vega/WithdrawExt.cjs | 9 + cjs/vega/WithdrawExt/decode.cjs | 20 ++ cjs/vega/WithdrawExt/encode.cjs | 21 ++ cjs/vega/Withdrawal.cjs | 11 + cjs/vega/Withdrawal/Status.cjs | 74 ++++ cjs/vega/Withdrawal/decode.cjs | 78 ++++ cjs/vega/Withdrawal/encode.cjs | 31 ++ cjs/vega/commands.cjs | 7 + cjs/vega/commands/v1.cjs | 79 +++++ cjs/vega/commands/v1/AnnounceNode.cjs | 9 + cjs/vega/commands/v1/AnnounceNode/decode.cjs | 95 +++++ cjs/vega/commands/v1/AnnounceNode/encode.cjs | 35 ++ .../commands/v1/BatchMarketInstructions.cjs | 9 + .../v1/BatchMarketInstructions/decode.cjs | 56 +++ .../v1/BatchMarketInstructions/encode.cjs | 43 +++ cjs/vega/commands/v1/CancelTransfer.cjs | 9 + .../commands/v1/CancelTransfer/decode.cjs | 20 ++ .../commands/v1/CancelTransfer/encode.cjs | 20 ++ cjs/vega/commands/v1/ChainEvent.cjs | 9 + cjs/vega/commands/v1/ChainEvent/decode.cjs | 51 +++ cjs/vega/commands/v1/ChainEvent/encode.cjs | 53 +++ cjs/vega/commands/v1/DelegateSubmission.cjs | 9 + .../commands/v1/DelegateSubmission/decode.cjs | 25 ++ .../commands/v1/DelegateSubmission/encode.cjs | 21 ++ .../v1/EthereumKeyRotateSubmission.cjs | 9 + .../v1/EthereumKeyRotateSubmission/decode.cjs | 47 +++ .../v1/EthereumKeyRotateSubmission/encode.cjs | 26 ++ cjs/vega/commands/v1/IcebergOpts.cjs | 9 + cjs/vega/commands/v1/IcebergOpts/decode.cjs | 28 ++ cjs/vega/commands/v1/IcebergOpts/encode.cjs | 21 ++ cjs/vega/commands/v1/InputData.cjs | 9 + cjs/vega/commands/v1/InputData/decode.cjs | 227 ++++++++++++ cjs/vega/commands/v1/InputData/encode.cjs | 250 +++++++++++++ cjs/vega/commands/v1/IssueSignatures.cjs | 9 + .../commands/v1/IssueSignatures/decode.cjs | 35 ++ .../commands/v1/IssueSignatures/encode.cjs | 23 ++ cjs/vega/commands/v1/KeyRotateSubmission.cjs | 9 + .../v1/KeyRotateSubmission/decode.cjs | 40 +++ .../v1/KeyRotateSubmission/encode.cjs | 23 ++ .../v1/LiquidityProvisionAmendment.cjs | 9 + .../v1/LiquidityProvisionAmendment/decode.cjs | 53 +++ .../v1/LiquidityProvisionAmendment/encode.cjs | 28 ++ .../v1/LiquidityProvisionCancellation.cjs | 9 + .../LiquidityProvisionCancellation/decode.cjs | 20 ++ .../LiquidityProvisionCancellation/encode.cjs | 20 ++ .../v1/LiquidityProvisionSubmission.cjs | 9 + .../LiquidityProvisionSubmission/decode.cjs | 53 +++ .../LiquidityProvisionSubmission/encode.cjs | 28 ++ cjs/vega/commands/v1/NodeSignature.cjs | 9 + cjs/vega/commands/v1/NodeSignature/decode.cjs | 31 ++ cjs/vega/commands/v1/NodeSignature/encode.cjs | 23 ++ cjs/vega/commands/v1/NodeSignatureKind.cjs | 83 +++++ cjs/vega/commands/v1/NodeVote.cjs | 11 + cjs/vega/commands/v1/NodeVote/Type.cjs | 110 ++++++ cjs/vega/commands/v1/NodeVote/decode.cjs | 26 ++ cjs/vega/commands/v1/NodeVote/encode.cjs | 22 ++ cjs/vega/commands/v1/OneOffTransfer.cjs | 9 + .../commands/v1/OneOffTransfer/decode.cjs | 20 ++ .../commands/v1/OneOffTransfer/encode.cjs | 20 ++ cjs/vega/commands/v1/OracleDataSubmission.cjs | 11 + .../v1/OracleDataSubmission/OracleSource.cjs | 71 ++++ .../v1/OracleDataSubmission/decode.cjs | 27 ++ .../v1/OracleDataSubmission/encode.cjs | 27 ++ cjs/vega/commands/v1/OrderAmendment.cjs | 9 + .../commands/v1/OrderAmendment/decode.cjs | 66 ++++ .../commands/v1/OrderAmendment/encode.cjs | 31 ++ cjs/vega/commands/v1/OrderCancellation.cjs | 9 + .../commands/v1/OrderCancellation/decode.cjs | 25 ++ .../commands/v1/OrderCancellation/encode.cjs | 21 ++ cjs/vega/commands/v1/OrderSubmission.cjs | 9 + .../commands/v1/OrderSubmission/decode.cjs | 93 +++++ .../commands/v1/OrderSubmission/encode.cjs | 39 ++ cjs/vega/commands/v1/ProofOfWork.cjs | 9 + cjs/vega/commands/v1/ProofOfWork/decode.cjs | 25 ++ cjs/vega/commands/v1/ProofOfWork/encode.cjs | 21 ++ cjs/vega/commands/v1/ProposalSubmission.cjs | 9 + .../commands/v1/ProposalSubmission/decode.cjs | 36 ++ .../commands/v1/ProposalSubmission/encode.cjs | 25 ++ .../commands/v1/ProtocolUpgradeProposal.cjs | 9 + .../v1/ProtocolUpgradeProposal/decode.cjs | 28 ++ .../v1/ProtocolUpgradeProposal/encode.cjs | 21 ++ cjs/vega/commands/v1/RecurringTransfer.cjs | 9 + .../commands/v1/RecurringTransfer/decode.cjs | 41 +++ .../commands/v1/RecurringTransfer/encode.cjs | 25 ++ cjs/vega/commands/v1/Signature.cjs | 9 + cjs/vega/commands/v1/Signature/decode.cjs | 30 ++ cjs/vega/commands/v1/Signature/encode.cjs | 22 ++ .../commands/v1/StateVariableProposal.cjs | 9 + .../v1/StateVariableProposal/decode.cjs | 20 ++ .../v1/StateVariableProposal/encode.cjs | 21 ++ cjs/vega/commands/v1/StopOrderSetup.cjs | 9 + .../commands/v1/StopOrderSetup/decode.cjs | 46 +++ .../commands/v1/StopOrderSetup/encode.cjs | 38 ++ .../commands/v1/StopOrdersCancellation.cjs | 9 + .../v1/StopOrdersCancellation/decode.cjs | 25 ++ .../v1/StopOrdersCancellation/encode.cjs | 21 ++ cjs/vega/commands/v1/StopOrdersSubmission.cjs | 9 + .../v1/StopOrdersSubmission/decode.cjs | 25 ++ .../v1/StopOrdersSubmission/encode.cjs | 23 ++ cjs/vega/commands/v1/Transaction.cjs | 9 + cjs/vega/commands/v1/Transaction/decode.cjs | 53 +++ cjs/vega/commands/v1/Transaction/encode.cjs | 32 ++ cjs/vega/commands/v1/Transfer.cjs | 9 + cjs/vega/commands/v1/Transfer/decode.cjs | 67 ++++ cjs/vega/commands/v1/Transfer/encode.cjs | 42 +++ cjs/vega/commands/v1/TxVersion.cjs | 70 ++++ cjs/vega/commands/v1/UndelegateSubmission.cjs | 11 + .../v1/UndelegateSubmission/Method.cjs | 70 ++++ .../v1/UndelegateSubmission/decode.cjs | 32 ++ .../v1/UndelegateSubmission/encode.cjs | 24 ++ cjs/vega/commands/v1/ValidatorHeartbeat.cjs | 9 + .../commands/v1/ValidatorHeartbeat/decode.cjs | 41 +++ .../commands/v1/ValidatorHeartbeat/encode.cjs | 26 ++ cjs/vega/commands/v1/VoteSubmission.cjs | 9 + .../commands/v1/VoteSubmission/decode.cjs | 26 ++ .../commands/v1/VoteSubmission/encode.cjs | 22 ++ cjs/vega/commands/v1/WithdrawSubmission.cjs | 9 + .../commands/v1/WithdrawSubmission/decode.cjs | 31 ++ .../commands/v1/WithdrawSubmission/encode.cjs | 23 ++ cjs/vega/data.cjs | 7 + cjs/vega/data/v1.cjs | 23 ++ cjs/vega/data/v1/Condition.cjs | 11 + cjs/vega/data/v1/Condition/Operator.cjs | 82 +++++ cjs/vega/data/v1/Condition/decode.cjs | 26 ++ cjs/vega/data/v1/Condition/encode.cjs | 23 ++ cjs/vega/data/v1/Data.cjs | 9 + cjs/vega/data/v1/Data/decode.cjs | 42 +++ cjs/vega/data/v1/Data/encode.cjs | 28 ++ cjs/vega/data/v1/ETHAddress.cjs | 9 + cjs/vega/data/v1/ETHAddress/decode.cjs | 20 ++ cjs/vega/data/v1/ETHAddress/encode.cjs | 20 ++ cjs/vega/data/v1/ExternalData.cjs | 9 + cjs/vega/data/v1/ExternalData/decode.cjs | 20 ++ cjs/vega/data/v1/ExternalData/encode.cjs | 20 ++ cjs/vega/data/v1/Filter.cjs | 9 + cjs/vega/data/v1/Filter/decode.cjs | 26 ++ cjs/vega/data/v1/Filter/encode.cjs | 25 ++ cjs/vega/data/v1/Property.cjs | 9 + cjs/vega/data/v1/Property/decode.cjs | 25 ++ cjs/vega/data/v1/Property/encode.cjs | 21 ++ cjs/vega/data/v1/PropertyKey.cjs | 11 + cjs/vega/data/v1/PropertyKey/Type.cjs | 86 +++++ cjs/vega/data/v1/PropertyKey/decode.cjs | 35 ++ cjs/vega/data/v1/PropertyKey/encode.cjs | 23 ++ cjs/vega/data/v1/PubKey.cjs | 9 + cjs/vega/data/v1/PubKey/decode.cjs | 20 ++ cjs/vega/data/v1/PubKey/encode.cjs | 20 ++ cjs/vega/data/v1/Signer.cjs | 9 + cjs/vega/data/v1/Signer/decode.cjs | 25 ++ cjs/vega/data/v1/Signer/encode.cjs | 30 ++ package.json | 20 +- rollup.config.js | 26 ++ 640 files changed, 19597 insertions(+), 3 deletions(-) create mode 100644 cjs/google.cjs create mode 100644 cjs/google/protobuf.cjs create mode 100644 cjs/google/protobuf/ListValue.cjs create mode 100644 cjs/google/protobuf/ListValue/decode.cjs create mode 100644 cjs/google/protobuf/ListValue/encode.cjs create mode 100644 cjs/google/protobuf/NullValue.cjs create mode 100644 cjs/google/protobuf/Struct.cjs create mode 100644 cjs/google/protobuf/Struct/FieldsEntry.cjs create mode 100644 cjs/google/protobuf/Struct/FieldsEntry/decode.cjs create mode 100644 cjs/google/protobuf/Struct/FieldsEntry/encode.cjs create mode 100644 cjs/google/protobuf/Struct/decode.cjs create mode 100644 cjs/google/protobuf/Struct/encode.cjs create mode 100644 cjs/google/protobuf/Value.cjs create mode 100644 cjs/google/protobuf/Value/decode.cjs create mode 100644 cjs/google/protobuf/Value/encode.cjs create mode 100644 cjs/index.cjs create mode 100644 cjs/vega.cjs create mode 100644 cjs/vega/Account.cjs create mode 100644 cjs/vega/Account/decode.cjs create mode 100644 cjs/vega/Account/encode.cjs create mode 100644 cjs/vega/AccountDetails.cjs create mode 100644 cjs/vega/AccountDetails/decode.cjs create mode 100644 cjs/vega/AccountDetails/encode.cjs create mode 100644 cjs/vega/AccountType.cjs create mode 100644 cjs/vega/Asset.cjs create mode 100644 cjs/vega/Asset/Status.cjs create mode 100644 cjs/vega/Asset/decode.cjs create mode 100644 cjs/vega/Asset/encode.cjs create mode 100644 cjs/vega/AssetDetails.cjs create mode 100644 cjs/vega/AssetDetails/decode.cjs create mode 100644 cjs/vega/AssetDetails/encode.cjs create mode 100644 cjs/vega/AssetDetailsUpdate.cjs create mode 100644 cjs/vega/AssetDetailsUpdate/decode.cjs create mode 100644 cjs/vega/AssetDetailsUpdate/encode.cjs create mode 100644 cjs/vega/AuctionDuration.cjs create mode 100644 cjs/vega/AuctionDuration/decode.cjs create mode 100644 cjs/vega/AuctionDuration/encode.cjs create mode 100644 cjs/vega/AuctionIndicativeState.cjs create mode 100644 cjs/vega/AuctionIndicativeState/decode.cjs create mode 100644 cjs/vega/AuctionIndicativeState/encode.cjs create mode 100644 cjs/vega/AuctionTrigger.cjs create mode 100644 cjs/vega/BuiltinAsset.cjs create mode 100644 cjs/vega/BuiltinAsset/decode.cjs create mode 100644 cjs/vega/BuiltinAsset/encode.cjs create mode 100644 cjs/vega/BuiltinAssetDeposit.cjs create mode 100644 cjs/vega/BuiltinAssetDeposit/decode.cjs create mode 100644 cjs/vega/BuiltinAssetDeposit/encode.cjs create mode 100644 cjs/vega/BuiltinAssetEvent.cjs create mode 100644 cjs/vega/BuiltinAssetEvent/decode.cjs create mode 100644 cjs/vega/BuiltinAssetEvent/encode.cjs create mode 100644 cjs/vega/BuiltinAssetWithdrawal.cjs create mode 100644 cjs/vega/BuiltinAssetWithdrawal/decode.cjs create mode 100644 cjs/vega/BuiltinAssetWithdrawal/encode.cjs create mode 100644 cjs/vega/CancelTransfer.cjs create mode 100644 cjs/vega/CancelTransfer/decode.cjs create mode 100644 cjs/vega/CancelTransfer/encode.cjs create mode 100644 cjs/vega/CancelTransferConfiguration.cjs create mode 100644 cjs/vega/CancelTransferConfiguration/decode.cjs create mode 100644 cjs/vega/CancelTransferConfiguration/encode.cjs create mode 100644 cjs/vega/Candle.cjs create mode 100644 cjs/vega/Candle/decode.cjs create mode 100644 cjs/vega/Candle/encode.cjs create mode 100644 cjs/vega/ChainStatus.cjs create mode 100644 cjs/vega/DataSourceDefinition.cjs create mode 100644 cjs/vega/DataSourceDefinition/decode.cjs create mode 100644 cjs/vega/DataSourceDefinition/encode.cjs create mode 100644 cjs/vega/DataSourceDefinitionExternal.cjs create mode 100644 cjs/vega/DataSourceDefinitionExternal/decode.cjs create mode 100644 cjs/vega/DataSourceDefinitionExternal/encode.cjs create mode 100644 cjs/vega/DataSourceDefinitionInternal.cjs create mode 100644 cjs/vega/DataSourceDefinitionInternal/decode.cjs create mode 100644 cjs/vega/DataSourceDefinitionInternal/encode.cjs create mode 100644 cjs/vega/DataSourceSpec.cjs create mode 100644 cjs/vega/DataSourceSpec/Status.cjs create mode 100644 cjs/vega/DataSourceSpec/decode.cjs create mode 100644 cjs/vega/DataSourceSpec/encode.cjs create mode 100644 cjs/vega/DataSourceSpecConfiguration.cjs create mode 100644 cjs/vega/DataSourceSpecConfiguration/decode.cjs create mode 100644 cjs/vega/DataSourceSpecConfiguration/encode.cjs create mode 100644 cjs/vega/DataSourceSpecConfigurationTime.cjs create mode 100644 cjs/vega/DataSourceSpecConfigurationTime/decode.cjs create mode 100644 cjs/vega/DataSourceSpecConfigurationTime/encode.cjs create mode 100644 cjs/vega/DataSourceSpecToFutureBinding.cjs create mode 100644 cjs/vega/DataSourceSpecToFutureBinding/decode.cjs create mode 100644 cjs/vega/DataSourceSpecToFutureBinding/encode.cjs create mode 100644 cjs/vega/Delegation.cjs create mode 100644 cjs/vega/Delegation/decode.cjs create mode 100644 cjs/vega/Delegation/encode.cjs create mode 100644 cjs/vega/Deposit.cjs create mode 100644 cjs/vega/Deposit/Status.cjs create mode 100644 cjs/vega/Deposit/decode.cjs create mode 100644 cjs/vega/Deposit/encode.cjs create mode 100644 cjs/vega/DispatchMetric.cjs create mode 100644 cjs/vega/DispatchStrategy.cjs create mode 100644 cjs/vega/DispatchStrategy/decode.cjs create mode 100644 cjs/vega/DispatchStrategy/encode.cjs create mode 100644 cjs/vega/ERC20.cjs create mode 100644 cjs/vega/ERC20/decode.cjs create mode 100644 cjs/vega/ERC20/encode.cjs create mode 100644 cjs/vega/ERC20AssetDelist.cjs create mode 100644 cjs/vega/ERC20AssetDelist/decode.cjs create mode 100644 cjs/vega/ERC20AssetDelist/encode.cjs create mode 100644 cjs/vega/ERC20AssetLimitsUpdated.cjs create mode 100644 cjs/vega/ERC20AssetLimitsUpdated/decode.cjs create mode 100644 cjs/vega/ERC20AssetLimitsUpdated/encode.cjs create mode 100644 cjs/vega/ERC20AssetList.cjs create mode 100644 cjs/vega/ERC20AssetList/decode.cjs create mode 100644 cjs/vega/ERC20AssetList/encode.cjs create mode 100644 cjs/vega/ERC20Deposit.cjs create mode 100644 cjs/vega/ERC20Deposit/decode.cjs create mode 100644 cjs/vega/ERC20Deposit/encode.cjs create mode 100644 cjs/vega/ERC20Event.cjs create mode 100644 cjs/vega/ERC20Event/decode.cjs create mode 100644 cjs/vega/ERC20Event/encode.cjs create mode 100644 cjs/vega/ERC20MultiSigEvent.cjs create mode 100644 cjs/vega/ERC20MultiSigEvent/decode.cjs create mode 100644 cjs/vega/ERC20MultiSigEvent/encode.cjs create mode 100644 cjs/vega/ERC20SignerAdded.cjs create mode 100644 cjs/vega/ERC20SignerAdded/decode.cjs create mode 100644 cjs/vega/ERC20SignerAdded/encode.cjs create mode 100644 cjs/vega/ERC20SignerRemoved.cjs create mode 100644 cjs/vega/ERC20SignerRemoved/decode.cjs create mode 100644 cjs/vega/ERC20SignerRemoved/encode.cjs create mode 100644 cjs/vega/ERC20ThresholdSet.cjs create mode 100644 cjs/vega/ERC20ThresholdSet/decode.cjs create mode 100644 cjs/vega/ERC20ThresholdSet/encode.cjs create mode 100644 cjs/vega/ERC20Update.cjs create mode 100644 cjs/vega/ERC20Update/decode.cjs create mode 100644 cjs/vega/ERC20Update/encode.cjs create mode 100644 cjs/vega/ERC20Withdrawal.cjs create mode 100644 cjs/vega/ERC20Withdrawal/decode.cjs create mode 100644 cjs/vega/ERC20Withdrawal/encode.cjs create mode 100644 cjs/vega/Epoch.cjs create mode 100644 cjs/vega/Epoch/decode.cjs create mode 100644 cjs/vega/Epoch/encode.cjs create mode 100644 cjs/vega/EpochAction.cjs create mode 100644 cjs/vega/EpochData.cjs create mode 100644 cjs/vega/EpochData/decode.cjs create mode 100644 cjs/vega/EpochData/encode.cjs create mode 100644 cjs/vega/EpochParticipation.cjs create mode 100644 cjs/vega/EpochParticipation/decode.cjs create mode 100644 cjs/vega/EpochParticipation/encode.cjs create mode 100644 cjs/vega/EpochRewardSummary.cjs create mode 100644 cjs/vega/EpochRewardSummary/decode.cjs create mode 100644 cjs/vega/EpochRewardSummary/encode.cjs create mode 100644 cjs/vega/EpochTimestamps.cjs create mode 100644 cjs/vega/EpochTimestamps/decode.cjs create mode 100644 cjs/vega/EpochTimestamps/encode.cjs create mode 100644 cjs/vega/Erc20WithdrawExt.cjs create mode 100644 cjs/vega/Erc20WithdrawExt/decode.cjs create mode 100644 cjs/vega/Erc20WithdrawExt/encode.cjs create mode 100644 cjs/vega/ErrorDetail.cjs create mode 100644 cjs/vega/ErrorDetail/decode.cjs create mode 100644 cjs/vega/ErrorDetail/encode.cjs create mode 100644 cjs/vega/EthCallSpec.cjs create mode 100644 cjs/vega/EthCallSpec/decode.cjs create mode 100644 cjs/vega/EthCallSpec/encode.cjs create mode 100644 cjs/vega/EthCallTrigger.cjs create mode 100644 cjs/vega/EthCallTrigger/decode.cjs create mode 100644 cjs/vega/EthCallTrigger/encode.cjs create mode 100644 cjs/vega/EthContractCallEvent.cjs create mode 100644 cjs/vega/EthContractCallEvent/decode.cjs create mode 100644 cjs/vega/EthContractCallEvent/encode.cjs create mode 100644 cjs/vega/EthTimeTrigger.cjs create mode 100644 cjs/vega/EthTimeTrigger/decode.cjs create mode 100644 cjs/vega/EthTimeTrigger/encode.cjs create mode 100644 cjs/vega/EthereumConfig.cjs create mode 100644 cjs/vega/EthereumConfig/decode.cjs create mode 100644 cjs/vega/EthereumConfig/encode.cjs create mode 100644 cjs/vega/EthereumContractConfig.cjs create mode 100644 cjs/vega/EthereumContractConfig/decode.cjs create mode 100644 cjs/vega/EthereumContractConfig/encode.cjs create mode 100644 cjs/vega/ExternalDataSourceSpec.cjs create mode 100644 cjs/vega/ExternalDataSourceSpec/decode.cjs create mode 100644 cjs/vega/ExternalDataSourceSpec/encode.cjs create mode 100644 cjs/vega/Fee.cjs create mode 100644 cjs/vega/Fee/decode.cjs create mode 100644 cjs/vega/Fee/encode.cjs create mode 100644 cjs/vega/FeeFactors.cjs create mode 100644 cjs/vega/FeeFactors/decode.cjs create mode 100644 cjs/vega/FeeFactors/encode.cjs create mode 100644 cjs/vega/Fees.cjs create mode 100644 cjs/vega/Fees/decode.cjs create mode 100644 cjs/vega/Fees/encode.cjs create mode 100644 cjs/vega/FinancialAmount.cjs create mode 100644 cjs/vega/FinancialAmount/decode.cjs create mode 100644 cjs/vega/FinancialAmount/encode.cjs create mode 100644 cjs/vega/Future.cjs create mode 100644 cjs/vega/Future/decode.cjs create mode 100644 cjs/vega/Future/encode.cjs create mode 100644 cjs/vega/FutureProduct.cjs create mode 100644 cjs/vega/FutureProduct/decode.cjs create mode 100644 cjs/vega/FutureProduct/encode.cjs create mode 100644 cjs/vega/GovernanceData.cjs create mode 100644 cjs/vega/GovernanceData/NoPartyEntry.cjs create mode 100644 cjs/vega/GovernanceData/NoPartyEntry/decode.cjs create mode 100644 cjs/vega/GovernanceData/NoPartyEntry/encode.cjs create mode 100644 cjs/vega/GovernanceData/YesPartyEntry.cjs create mode 100644 cjs/vega/GovernanceData/YesPartyEntry/decode.cjs create mode 100644 cjs/vega/GovernanceData/YesPartyEntry/encode.cjs create mode 100644 cjs/vega/GovernanceData/decode.cjs create mode 100644 cjs/vega/GovernanceData/encode.cjs create mode 100644 cjs/vega/GovernanceTransferType.cjs create mode 100644 cjs/vega/IcebergOrder.cjs create mode 100644 cjs/vega/IcebergOrder/decode.cjs create mode 100644 cjs/vega/IcebergOrder/encode.cjs create mode 100644 cjs/vega/Instrument.cjs create mode 100644 cjs/vega/Instrument/decode.cjs create mode 100644 cjs/vega/Instrument/encode.cjs create mode 100644 cjs/vega/InstrumentConfiguration.cjs create mode 100644 cjs/vega/InstrumentConfiguration/decode.cjs create mode 100644 cjs/vega/InstrumentConfiguration/encode.cjs create mode 100644 cjs/vega/InstrumentMetadata.cjs create mode 100644 cjs/vega/InstrumentMetadata/decode.cjs create mode 100644 cjs/vega/InstrumentMetadata/encode.cjs create mode 100644 cjs/vega/Interval.cjs create mode 100644 cjs/vega/KeyValueBundle.cjs create mode 100644 cjs/vega/KeyValueBundle/decode.cjs create mode 100644 cjs/vega/KeyValueBundle/encode.cjs create mode 100644 cjs/vega/LedgerEntry.cjs create mode 100644 cjs/vega/LedgerEntry/decode.cjs create mode 100644 cjs/vega/LedgerEntry/encode.cjs create mode 100644 cjs/vega/LedgerMovement.cjs create mode 100644 cjs/vega/LedgerMovement/decode.cjs create mode 100644 cjs/vega/LedgerMovement/encode.cjs create mode 100644 cjs/vega/LiquidityMonitoringParameters.cjs create mode 100644 cjs/vega/LiquidityMonitoringParameters/decode.cjs create mode 100644 cjs/vega/LiquidityMonitoringParameters/encode.cjs create mode 100644 cjs/vega/LiquidityOrder.cjs create mode 100644 cjs/vega/LiquidityOrder/decode.cjs create mode 100644 cjs/vega/LiquidityOrder/encode.cjs create mode 100644 cjs/vega/LiquidityOrderReference.cjs create mode 100644 cjs/vega/LiquidityOrderReference/decode.cjs create mode 100644 cjs/vega/LiquidityOrderReference/encode.cjs create mode 100644 cjs/vega/LiquidityProviderFeeShare.cjs create mode 100644 cjs/vega/LiquidityProviderFeeShare/decode.cjs create mode 100644 cjs/vega/LiquidityProviderFeeShare/encode.cjs create mode 100644 cjs/vega/LiquidityProvision.cjs create mode 100644 cjs/vega/LiquidityProvision/Status.cjs create mode 100644 cjs/vega/LiquidityProvision/decode.cjs create mode 100644 cjs/vega/LiquidityProvision/encode.cjs create mode 100644 cjs/vega/LogNormalModelParams.cjs create mode 100644 cjs/vega/LogNormalModelParams/decode.cjs create mode 100644 cjs/vega/LogNormalModelParams/encode.cjs create mode 100644 cjs/vega/LogNormalRiskModel.cjs create mode 100644 cjs/vega/LogNormalRiskModel/decode.cjs create mode 100644 cjs/vega/LogNormalRiskModel/encode.cjs create mode 100644 cjs/vega/MarginCalculator.cjs create mode 100644 cjs/vega/MarginCalculator/decode.cjs create mode 100644 cjs/vega/MarginCalculator/encode.cjs create mode 100644 cjs/vega/MarginLevels.cjs create mode 100644 cjs/vega/MarginLevels/decode.cjs create mode 100644 cjs/vega/MarginLevels/encode.cjs create mode 100644 cjs/vega/Market.cjs create mode 100644 cjs/vega/Market/State.cjs create mode 100644 cjs/vega/Market/TradingMode.cjs create mode 100644 cjs/vega/Market/decode.cjs create mode 100644 cjs/vega/Market/encode.cjs create mode 100644 cjs/vega/MarketData.cjs create mode 100644 cjs/vega/MarketData/decode.cjs create mode 100644 cjs/vega/MarketData/encode.cjs create mode 100644 cjs/vega/MarketDepth.cjs create mode 100644 cjs/vega/MarketDepth/decode.cjs create mode 100644 cjs/vega/MarketDepth/encode.cjs create mode 100644 cjs/vega/MarketDepthUpdate.cjs create mode 100644 cjs/vega/MarketDepthUpdate/decode.cjs create mode 100644 cjs/vega/MarketDepthUpdate/encode.cjs create mode 100644 cjs/vega/MarketTimestamps.cjs create mode 100644 cjs/vega/MarketTimestamps/decode.cjs create mode 100644 cjs/vega/MarketTimestamps/encode.cjs create mode 100644 cjs/vega/MatrixValue.cjs create mode 100644 cjs/vega/MatrixValue/decode.cjs create mode 100644 cjs/vega/MatrixValue/encode.cjs create mode 100644 cjs/vega/NetworkLimits.cjs create mode 100644 cjs/vega/NetworkLimits/decode.cjs create mode 100644 cjs/vega/NetworkLimits/encode.cjs create mode 100644 cjs/vega/NetworkParameter.cjs create mode 100644 cjs/vega/NetworkParameter/decode.cjs create mode 100644 cjs/vega/NetworkParameter/encode.cjs create mode 100644 cjs/vega/NewAsset.cjs create mode 100644 cjs/vega/NewAsset/decode.cjs create mode 100644 cjs/vega/NewAsset/encode.cjs create mode 100644 cjs/vega/NewFreeform.cjs create mode 100644 cjs/vega/NewFreeform/decode.cjs create mode 100644 cjs/vega/NewFreeform/encode.cjs create mode 100644 cjs/vega/NewMarket.cjs create mode 100644 cjs/vega/NewMarket/decode.cjs create mode 100644 cjs/vega/NewMarket/encode.cjs create mode 100644 cjs/vega/NewMarketConfiguration.cjs create mode 100644 cjs/vega/NewMarketConfiguration/decode.cjs create mode 100644 cjs/vega/NewMarketConfiguration/encode.cjs create mode 100644 cjs/vega/NewSpotMarket.cjs create mode 100644 cjs/vega/NewSpotMarket/decode.cjs create mode 100644 cjs/vega/NewSpotMarket/encode.cjs create mode 100644 cjs/vega/NewSpotMarketConfiguration.cjs create mode 100644 cjs/vega/NewSpotMarketConfiguration/decode.cjs create mode 100644 cjs/vega/NewSpotMarketConfiguration/encode.cjs create mode 100644 cjs/vega/NewTransfer.cjs create mode 100644 cjs/vega/NewTransfer/decode.cjs create mode 100644 cjs/vega/NewTransfer/encode.cjs create mode 100644 cjs/vega/NewTransferConfiguration.cjs create mode 100644 cjs/vega/NewTransferConfiguration/decode.cjs create mode 100644 cjs/vega/NewTransferConfiguration/encode.cjs create mode 100644 cjs/vega/Node.cjs create mode 100644 cjs/vega/Node/decode.cjs create mode 100644 cjs/vega/Node/encode.cjs create mode 100644 cjs/vega/NodeData.cjs create mode 100644 cjs/vega/NodeData/decode.cjs create mode 100644 cjs/vega/NodeData/encode.cjs create mode 100644 cjs/vega/NodeSet.cjs create mode 100644 cjs/vega/NodeSet/decode.cjs create mode 100644 cjs/vega/NodeSet/encode.cjs create mode 100644 cjs/vega/NodeStatus.cjs create mode 100644 cjs/vega/OneOffTransfer.cjs create mode 100644 cjs/vega/OneOffTransfer/decode.cjs create mode 100644 cjs/vega/OneOffTransfer/encode.cjs create mode 100644 cjs/vega/Order.cjs create mode 100644 cjs/vega/Order/Status.cjs create mode 100644 cjs/vega/Order/TimeInForce.cjs create mode 100644 cjs/vega/Order/Type.cjs create mode 100644 cjs/vega/Order/decode.cjs create mode 100644 cjs/vega/Order/encode.cjs create mode 100644 cjs/vega/OrderCancellationConfirmation.cjs create mode 100644 cjs/vega/OrderCancellationConfirmation/decode.cjs create mode 100644 cjs/vega/OrderCancellationConfirmation/encode.cjs create mode 100644 cjs/vega/OrderConfirmation.cjs create mode 100644 cjs/vega/OrderConfirmation/decode.cjs create mode 100644 cjs/vega/OrderConfirmation/encode.cjs create mode 100644 cjs/vega/OrderError.cjs create mode 100644 cjs/vega/Party.cjs create mode 100644 cjs/vega/Party/decode.cjs create mode 100644 cjs/vega/Party/encode.cjs create mode 100644 cjs/vega/PeggedOrder.cjs create mode 100644 cjs/vega/PeggedOrder/decode.cjs create mode 100644 cjs/vega/PeggedOrder/encode.cjs create mode 100644 cjs/vega/PeggedReference.cjs create mode 100644 cjs/vega/Position.cjs create mode 100644 cjs/vega/Position/decode.cjs create mode 100644 cjs/vega/Position/encode.cjs create mode 100644 cjs/vega/PositionStatus.cjs create mode 100644 cjs/vega/PositionTrade.cjs create mode 100644 cjs/vega/PositionTrade/decode.cjs create mode 100644 cjs/vega/PositionTrade/encode.cjs create mode 100644 cjs/vega/PostTransferBalance.cjs create mode 100644 cjs/vega/PostTransferBalance/decode.cjs create mode 100644 cjs/vega/PostTransferBalance/encode.cjs create mode 100644 cjs/vega/PriceLevel.cjs create mode 100644 cjs/vega/PriceLevel/decode.cjs create mode 100644 cjs/vega/PriceLevel/encode.cjs create mode 100644 cjs/vega/PriceMonitoringBounds.cjs create mode 100644 cjs/vega/PriceMonitoringBounds/decode.cjs create mode 100644 cjs/vega/PriceMonitoringBounds/encode.cjs create mode 100644 cjs/vega/PriceMonitoringParameters.cjs create mode 100644 cjs/vega/PriceMonitoringParameters/decode.cjs create mode 100644 cjs/vega/PriceMonitoringParameters/encode.cjs create mode 100644 cjs/vega/PriceMonitoringSettings.cjs create mode 100644 cjs/vega/PriceMonitoringSettings/decode.cjs create mode 100644 cjs/vega/PriceMonitoringSettings/encode.cjs create mode 100644 cjs/vega/PriceMonitoringTrigger.cjs create mode 100644 cjs/vega/PriceMonitoringTrigger/decode.cjs create mode 100644 cjs/vega/PriceMonitoringTrigger/encode.cjs create mode 100644 cjs/vega/Proposal.cjs create mode 100644 cjs/vega/Proposal/State.cjs create mode 100644 cjs/vega/Proposal/decode.cjs create mode 100644 cjs/vega/Proposal/encode.cjs create mode 100644 cjs/vega/ProposalError.cjs create mode 100644 cjs/vega/ProposalRationale.cjs create mode 100644 cjs/vega/ProposalRationale/decode.cjs create mode 100644 cjs/vega/ProposalRationale/encode.cjs create mode 100644 cjs/vega/ProposalTerms.cjs create mode 100644 cjs/vega/ProposalTerms/decode.cjs create mode 100644 cjs/vega/ProposalTerms/encode.cjs create mode 100644 cjs/vega/RankingScore.cjs create mode 100644 cjs/vega/RankingScore/decode.cjs create mode 100644 cjs/vega/RankingScore/encode.cjs create mode 100644 cjs/vega/RecurringTransfer.cjs create mode 100644 cjs/vega/RecurringTransfer/decode.cjs create mode 100644 cjs/vega/RecurringTransfer/encode.cjs create mode 100644 cjs/vega/Reward.cjs create mode 100644 cjs/vega/Reward/decode.cjs create mode 100644 cjs/vega/Reward/encode.cjs create mode 100644 cjs/vega/RewardScore.cjs create mode 100644 cjs/vega/RewardScore/decode.cjs create mode 100644 cjs/vega/RewardScore/encode.cjs create mode 100644 cjs/vega/RewardSummary.cjs create mode 100644 cjs/vega/RewardSummary/decode.cjs create mode 100644 cjs/vega/RewardSummary/encode.cjs create mode 100644 cjs/vega/RiskFactor.cjs create mode 100644 cjs/vega/RiskFactor/decode.cjs create mode 100644 cjs/vega/RiskFactor/encode.cjs create mode 100644 cjs/vega/ScalarValue.cjs create mode 100644 cjs/vega/ScalarValue/decode.cjs create mode 100644 cjs/vega/ScalarValue/encode.cjs create mode 100644 cjs/vega/ScalingFactors.cjs create mode 100644 cjs/vega/ScalingFactors/decode.cjs create mode 100644 cjs/vega/ScalingFactors/encode.cjs create mode 100644 cjs/vega/Side.cjs create mode 100644 cjs/vega/SimpleModelParams.cjs create mode 100644 cjs/vega/SimpleModelParams/decode.cjs create mode 100644 cjs/vega/SimpleModelParams/encode.cjs create mode 100644 cjs/vega/SimpleRiskModel.cjs create mode 100644 cjs/vega/SimpleRiskModel/decode.cjs create mode 100644 cjs/vega/SimpleRiskModel/encode.cjs create mode 100644 cjs/vega/Spot.cjs create mode 100644 cjs/vega/Spot/decode.cjs create mode 100644 cjs/vega/Spot/encode.cjs create mode 100644 cjs/vega/SpotProduct.cjs create mode 100644 cjs/vega/SpotProduct/decode.cjs create mode 100644 cjs/vega/SpotProduct/encode.cjs create mode 100644 cjs/vega/StakeDeposited.cjs create mode 100644 cjs/vega/StakeDeposited/decode.cjs create mode 100644 cjs/vega/StakeDeposited/encode.cjs create mode 100644 cjs/vega/StakeRemoved.cjs create mode 100644 cjs/vega/StakeRemoved/decode.cjs create mode 100644 cjs/vega/StakeRemoved/encode.cjs create mode 100644 cjs/vega/StakeTotalSupply.cjs create mode 100644 cjs/vega/StakeTotalSupply/decode.cjs create mode 100644 cjs/vega/StakeTotalSupply/encode.cjs create mode 100644 cjs/vega/StakingEvent.cjs create mode 100644 cjs/vega/StakingEvent/decode.cjs create mode 100644 cjs/vega/StakingEvent/encode.cjs create mode 100644 cjs/vega/StateValueProposal.cjs create mode 100644 cjs/vega/StateValueProposal/decode.cjs create mode 100644 cjs/vega/StateValueProposal/encode.cjs create mode 100644 cjs/vega/StateVarValue.cjs create mode 100644 cjs/vega/StateVarValue/decode.cjs create mode 100644 cjs/vega/StateVarValue/encode.cjs create mode 100644 cjs/vega/StopOrder.cjs create mode 100644 cjs/vega/StopOrder/ExpiryStrategy.cjs create mode 100644 cjs/vega/StopOrder/Status.cjs create mode 100644 cjs/vega/StopOrder/TriggerDirection.cjs create mode 100644 cjs/vega/StopOrder/decode.cjs create mode 100644 cjs/vega/StopOrder/encode.cjs create mode 100644 cjs/vega/SuccessorConfiguration.cjs create mode 100644 cjs/vega/SuccessorConfiguration/decode.cjs create mode 100644 cjs/vega/SuccessorConfiguration/encode.cjs create mode 100644 cjs/vega/TargetStakeParameters.cjs create mode 100644 cjs/vega/TargetStakeParameters/decode.cjs create mode 100644 cjs/vega/TargetStakeParameters/encode.cjs create mode 100644 cjs/vega/TradableInstrument.cjs create mode 100644 cjs/vega/TradableInstrument/decode.cjs create mode 100644 cjs/vega/TradableInstrument/encode.cjs create mode 100644 cjs/vega/Trade.cjs create mode 100644 cjs/vega/Trade/Type.cjs create mode 100644 cjs/vega/Trade/decode.cjs create mode 100644 cjs/vega/Trade/encode.cjs create mode 100644 cjs/vega/TradeSet.cjs create mode 100644 cjs/vega/TradeSet/decode.cjs create mode 100644 cjs/vega/TradeSet/encode.cjs create mode 100644 cjs/vega/Transfer.cjs create mode 100644 cjs/vega/Transfer/decode.cjs create mode 100644 cjs/vega/Transfer/encode.cjs create mode 100644 cjs/vega/TransferRequest.cjs create mode 100644 cjs/vega/TransferRequest/decode.cjs create mode 100644 cjs/vega/TransferRequest/encode.cjs create mode 100644 cjs/vega/TransferType.cjs create mode 100644 cjs/vega/UpdateAsset.cjs create mode 100644 cjs/vega/UpdateAsset/decode.cjs create mode 100644 cjs/vega/UpdateAsset/encode.cjs create mode 100644 cjs/vega/UpdateFutureProduct.cjs create mode 100644 cjs/vega/UpdateFutureProduct/decode.cjs create mode 100644 cjs/vega/UpdateFutureProduct/encode.cjs create mode 100644 cjs/vega/UpdateInstrumentConfiguration.cjs create mode 100644 cjs/vega/UpdateInstrumentConfiguration/decode.cjs create mode 100644 cjs/vega/UpdateInstrumentConfiguration/encode.cjs create mode 100644 cjs/vega/UpdateMarket.cjs create mode 100644 cjs/vega/UpdateMarket/decode.cjs create mode 100644 cjs/vega/UpdateMarket/encode.cjs create mode 100644 cjs/vega/UpdateMarketConfiguration.cjs create mode 100644 cjs/vega/UpdateMarketConfiguration/decode.cjs create mode 100644 cjs/vega/UpdateMarketConfiguration/encode.cjs create mode 100644 cjs/vega/UpdateNetworkParameter.cjs create mode 100644 cjs/vega/UpdateNetworkParameter/decode.cjs create mode 100644 cjs/vega/UpdateNetworkParameter/encode.cjs create mode 100644 cjs/vega/UpdateSpotMarket.cjs create mode 100644 cjs/vega/UpdateSpotMarket/decode.cjs create mode 100644 cjs/vega/UpdateSpotMarket/encode.cjs create mode 100644 cjs/vega/UpdateSpotMarketConfiguration.cjs create mode 100644 cjs/vega/UpdateSpotMarketConfiguration/decode.cjs create mode 100644 cjs/vega/UpdateSpotMarketConfiguration/encode.cjs create mode 100644 cjs/vega/ValidatorNodeStatus.cjs create mode 100644 cjs/vega/VectorValue.cjs create mode 100644 cjs/vega/VectorValue/decode.cjs create mode 100644 cjs/vega/VectorValue/encode.cjs create mode 100644 cjs/vega/Vote.cjs create mode 100644 cjs/vega/Vote/Value.cjs create mode 100644 cjs/vega/Vote/decode.cjs create mode 100644 cjs/vega/Vote/encode.cjs create mode 100644 cjs/vega/WithdrawExt.cjs create mode 100644 cjs/vega/WithdrawExt/decode.cjs create mode 100644 cjs/vega/WithdrawExt/encode.cjs create mode 100644 cjs/vega/Withdrawal.cjs create mode 100644 cjs/vega/Withdrawal/Status.cjs create mode 100644 cjs/vega/Withdrawal/decode.cjs create mode 100644 cjs/vega/Withdrawal/encode.cjs create mode 100644 cjs/vega/commands.cjs create mode 100644 cjs/vega/commands/v1.cjs create mode 100644 cjs/vega/commands/v1/AnnounceNode.cjs create mode 100644 cjs/vega/commands/v1/AnnounceNode/decode.cjs create mode 100644 cjs/vega/commands/v1/AnnounceNode/encode.cjs create mode 100644 cjs/vega/commands/v1/BatchMarketInstructions.cjs create mode 100644 cjs/vega/commands/v1/BatchMarketInstructions/decode.cjs create mode 100644 cjs/vega/commands/v1/BatchMarketInstructions/encode.cjs create mode 100644 cjs/vega/commands/v1/CancelTransfer.cjs create mode 100644 cjs/vega/commands/v1/CancelTransfer/decode.cjs create mode 100644 cjs/vega/commands/v1/CancelTransfer/encode.cjs create mode 100644 cjs/vega/commands/v1/ChainEvent.cjs create mode 100644 cjs/vega/commands/v1/ChainEvent/decode.cjs create mode 100644 cjs/vega/commands/v1/ChainEvent/encode.cjs create mode 100644 cjs/vega/commands/v1/DelegateSubmission.cjs create mode 100644 cjs/vega/commands/v1/DelegateSubmission/decode.cjs create mode 100644 cjs/vega/commands/v1/DelegateSubmission/encode.cjs create mode 100644 cjs/vega/commands/v1/EthereumKeyRotateSubmission.cjs create mode 100644 cjs/vega/commands/v1/EthereumKeyRotateSubmission/decode.cjs create mode 100644 cjs/vega/commands/v1/EthereumKeyRotateSubmission/encode.cjs create mode 100644 cjs/vega/commands/v1/IcebergOpts.cjs create mode 100644 cjs/vega/commands/v1/IcebergOpts/decode.cjs create mode 100644 cjs/vega/commands/v1/IcebergOpts/encode.cjs create mode 100644 cjs/vega/commands/v1/InputData.cjs create mode 100644 cjs/vega/commands/v1/InputData/decode.cjs create mode 100644 cjs/vega/commands/v1/InputData/encode.cjs create mode 100644 cjs/vega/commands/v1/IssueSignatures.cjs create mode 100644 cjs/vega/commands/v1/IssueSignatures/decode.cjs create mode 100644 cjs/vega/commands/v1/IssueSignatures/encode.cjs create mode 100644 cjs/vega/commands/v1/KeyRotateSubmission.cjs create mode 100644 cjs/vega/commands/v1/KeyRotateSubmission/decode.cjs create mode 100644 cjs/vega/commands/v1/KeyRotateSubmission/encode.cjs create mode 100644 cjs/vega/commands/v1/LiquidityProvisionAmendment.cjs create mode 100644 cjs/vega/commands/v1/LiquidityProvisionAmendment/decode.cjs create mode 100644 cjs/vega/commands/v1/LiquidityProvisionAmendment/encode.cjs create mode 100644 cjs/vega/commands/v1/LiquidityProvisionCancellation.cjs create mode 100644 cjs/vega/commands/v1/LiquidityProvisionCancellation/decode.cjs create mode 100644 cjs/vega/commands/v1/LiquidityProvisionCancellation/encode.cjs create mode 100644 cjs/vega/commands/v1/LiquidityProvisionSubmission.cjs create mode 100644 cjs/vega/commands/v1/LiquidityProvisionSubmission/decode.cjs create mode 100644 cjs/vega/commands/v1/LiquidityProvisionSubmission/encode.cjs create mode 100644 cjs/vega/commands/v1/NodeSignature.cjs create mode 100644 cjs/vega/commands/v1/NodeSignature/decode.cjs create mode 100644 cjs/vega/commands/v1/NodeSignature/encode.cjs create mode 100644 cjs/vega/commands/v1/NodeSignatureKind.cjs create mode 100644 cjs/vega/commands/v1/NodeVote.cjs create mode 100644 cjs/vega/commands/v1/NodeVote/Type.cjs create mode 100644 cjs/vega/commands/v1/NodeVote/decode.cjs create mode 100644 cjs/vega/commands/v1/NodeVote/encode.cjs create mode 100644 cjs/vega/commands/v1/OneOffTransfer.cjs create mode 100644 cjs/vega/commands/v1/OneOffTransfer/decode.cjs create mode 100644 cjs/vega/commands/v1/OneOffTransfer/encode.cjs create mode 100644 cjs/vega/commands/v1/OracleDataSubmission.cjs create mode 100644 cjs/vega/commands/v1/OracleDataSubmission/OracleSource.cjs create mode 100644 cjs/vega/commands/v1/OracleDataSubmission/decode.cjs create mode 100644 cjs/vega/commands/v1/OracleDataSubmission/encode.cjs create mode 100644 cjs/vega/commands/v1/OrderAmendment.cjs create mode 100644 cjs/vega/commands/v1/OrderAmendment/decode.cjs create mode 100644 cjs/vega/commands/v1/OrderAmendment/encode.cjs create mode 100644 cjs/vega/commands/v1/OrderCancellation.cjs create mode 100644 cjs/vega/commands/v1/OrderCancellation/decode.cjs create mode 100644 cjs/vega/commands/v1/OrderCancellation/encode.cjs create mode 100644 cjs/vega/commands/v1/OrderSubmission.cjs create mode 100644 cjs/vega/commands/v1/OrderSubmission/decode.cjs create mode 100644 cjs/vega/commands/v1/OrderSubmission/encode.cjs create mode 100644 cjs/vega/commands/v1/ProofOfWork.cjs create mode 100644 cjs/vega/commands/v1/ProofOfWork/decode.cjs create mode 100644 cjs/vega/commands/v1/ProofOfWork/encode.cjs create mode 100644 cjs/vega/commands/v1/ProposalSubmission.cjs create mode 100644 cjs/vega/commands/v1/ProposalSubmission/decode.cjs create mode 100644 cjs/vega/commands/v1/ProposalSubmission/encode.cjs create mode 100644 cjs/vega/commands/v1/ProtocolUpgradeProposal.cjs create mode 100644 cjs/vega/commands/v1/ProtocolUpgradeProposal/decode.cjs create mode 100644 cjs/vega/commands/v1/ProtocolUpgradeProposal/encode.cjs create mode 100644 cjs/vega/commands/v1/RecurringTransfer.cjs create mode 100644 cjs/vega/commands/v1/RecurringTransfer/decode.cjs create mode 100644 cjs/vega/commands/v1/RecurringTransfer/encode.cjs create mode 100644 cjs/vega/commands/v1/Signature.cjs create mode 100644 cjs/vega/commands/v1/Signature/decode.cjs create mode 100644 cjs/vega/commands/v1/Signature/encode.cjs create mode 100644 cjs/vega/commands/v1/StateVariableProposal.cjs create mode 100644 cjs/vega/commands/v1/StateVariableProposal/decode.cjs create mode 100644 cjs/vega/commands/v1/StateVariableProposal/encode.cjs create mode 100644 cjs/vega/commands/v1/StopOrderSetup.cjs create mode 100644 cjs/vega/commands/v1/StopOrderSetup/decode.cjs create mode 100644 cjs/vega/commands/v1/StopOrderSetup/encode.cjs create mode 100644 cjs/vega/commands/v1/StopOrdersCancellation.cjs create mode 100644 cjs/vega/commands/v1/StopOrdersCancellation/decode.cjs create mode 100644 cjs/vega/commands/v1/StopOrdersCancellation/encode.cjs create mode 100644 cjs/vega/commands/v1/StopOrdersSubmission.cjs create mode 100644 cjs/vega/commands/v1/StopOrdersSubmission/decode.cjs create mode 100644 cjs/vega/commands/v1/StopOrdersSubmission/encode.cjs create mode 100644 cjs/vega/commands/v1/Transaction.cjs create mode 100644 cjs/vega/commands/v1/Transaction/decode.cjs create mode 100644 cjs/vega/commands/v1/Transaction/encode.cjs create mode 100644 cjs/vega/commands/v1/Transfer.cjs create mode 100644 cjs/vega/commands/v1/Transfer/decode.cjs create mode 100644 cjs/vega/commands/v1/Transfer/encode.cjs create mode 100644 cjs/vega/commands/v1/TxVersion.cjs create mode 100644 cjs/vega/commands/v1/UndelegateSubmission.cjs create mode 100644 cjs/vega/commands/v1/UndelegateSubmission/Method.cjs create mode 100644 cjs/vega/commands/v1/UndelegateSubmission/decode.cjs create mode 100644 cjs/vega/commands/v1/UndelegateSubmission/encode.cjs create mode 100644 cjs/vega/commands/v1/ValidatorHeartbeat.cjs create mode 100644 cjs/vega/commands/v1/ValidatorHeartbeat/decode.cjs create mode 100644 cjs/vega/commands/v1/ValidatorHeartbeat/encode.cjs create mode 100644 cjs/vega/commands/v1/VoteSubmission.cjs create mode 100644 cjs/vega/commands/v1/VoteSubmission/decode.cjs create mode 100644 cjs/vega/commands/v1/VoteSubmission/encode.cjs create mode 100644 cjs/vega/commands/v1/WithdrawSubmission.cjs create mode 100644 cjs/vega/commands/v1/WithdrawSubmission/decode.cjs create mode 100644 cjs/vega/commands/v1/WithdrawSubmission/encode.cjs create mode 100644 cjs/vega/data.cjs create mode 100644 cjs/vega/data/v1.cjs create mode 100644 cjs/vega/data/v1/Condition.cjs create mode 100644 cjs/vega/data/v1/Condition/Operator.cjs create mode 100644 cjs/vega/data/v1/Condition/decode.cjs create mode 100644 cjs/vega/data/v1/Condition/encode.cjs create mode 100644 cjs/vega/data/v1/Data.cjs create mode 100644 cjs/vega/data/v1/Data/decode.cjs create mode 100644 cjs/vega/data/v1/Data/encode.cjs create mode 100644 cjs/vega/data/v1/ETHAddress.cjs create mode 100644 cjs/vega/data/v1/ETHAddress/decode.cjs create mode 100644 cjs/vega/data/v1/ETHAddress/encode.cjs create mode 100644 cjs/vega/data/v1/ExternalData.cjs create mode 100644 cjs/vega/data/v1/ExternalData/decode.cjs create mode 100644 cjs/vega/data/v1/ExternalData/encode.cjs create mode 100644 cjs/vega/data/v1/Filter.cjs create mode 100644 cjs/vega/data/v1/Filter/decode.cjs create mode 100644 cjs/vega/data/v1/Filter/encode.cjs create mode 100644 cjs/vega/data/v1/Property.cjs create mode 100644 cjs/vega/data/v1/Property/decode.cjs create mode 100644 cjs/vega/data/v1/Property/encode.cjs create mode 100644 cjs/vega/data/v1/PropertyKey.cjs create mode 100644 cjs/vega/data/v1/PropertyKey/Type.cjs create mode 100644 cjs/vega/data/v1/PropertyKey/decode.cjs create mode 100644 cjs/vega/data/v1/PropertyKey/encode.cjs create mode 100644 cjs/vega/data/v1/PubKey.cjs create mode 100644 cjs/vega/data/v1/PubKey/decode.cjs create mode 100644 cjs/vega/data/v1/PubKey/encode.cjs create mode 100644 cjs/vega/data/v1/Signer.cjs create mode 100644 cjs/vega/data/v1/Signer/decode.cjs create mode 100644 cjs/vega/data/v1/Signer/encode.cjs create mode 100644 rollup.config.js diff --git a/cjs/google.cjs b/cjs/google.cjs new file mode 100644 index 0000000..a2176b4 --- /dev/null +++ b/cjs/google.cjs @@ -0,0 +1,7 @@ +'use strict'; + +var protobuf = require('./google/protobuf.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.protobuf = protobuf; diff --git a/cjs/google/protobuf.cjs b/cjs/google/protobuf.cjs new file mode 100644 index 0000000..3610f3c --- /dev/null +++ b/cjs/google/protobuf.cjs @@ -0,0 +1,13 @@ +'use strict'; + +var NullValue = require('./protobuf/NullValue.cjs'); +var Struct = require('./protobuf/Struct.cjs'); +var Value = require('./protobuf/Value.cjs'); +var ListValue = require('./protobuf/ListValue.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.NullValue = NullValue; +exports.Struct = Struct; +exports.Value = Value; +exports.ListValue = ListValue; diff --git a/cjs/google/protobuf/ListValue.cjs b/cjs/google/protobuf/ListValue.cjs new file mode 100644 index 0000000..3672ad2 --- /dev/null +++ b/cjs/google/protobuf/ListValue.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./ListValue/encode.cjs'); +var decode = require('./ListValue/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/google/protobuf/ListValue/decode.cjs b/cjs/google/protobuf/ListValue/decode.cjs new file mode 100644 index 0000000..f97ca29 --- /dev/null +++ b/cjs/google/protobuf/ListValue/decode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var decode$1 = require('../Value/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + const field$values = []; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$values.push(decode$1.decode(data)); + break + } + } + return { values: field$values } +} + +exports.decode = decode; diff --git a/cjs/google/protobuf/ListValue/encode.cjs b/cjs/google/protobuf/ListValue/encode.cjs new file mode 100644 index 0000000..95dffb0 --- /dev/null +++ b/cjs/google/protobuf/ListValue/encode.cjs @@ -0,0 +1,21 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var encode$1 = require('../Value/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.values?.length) + obj.values.forEach((v) => writer.bytes(1, encode$1.encode(v))); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/google/protobuf/NullValue.cjs b/cjs/google/protobuf/NullValue.cjs new file mode 100644 index 0000000..09941df --- /dev/null +++ b/cjs/google/protobuf/NullValue.cjs @@ -0,0 +1,58 @@ +'use strict'; + +var assert = require('nanoassert'); +var types = require('protobuf-codec/encode/types'); +var types$1 = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +const NULL_VALUE = 0; + +const enumValues = new Map([[0, 'NULL_VALUE']]); +const enumNames = new Map([['NULL_VALUE', 0]]); + +function encode(value, buf, byteOffset = 0) { + if (typeof value === 'string') return encode(parse(value), buf, byteOffset) + if (value == null) throw new Error('Invalid NullValue value (' + value + ')') + + return types.enumerable.encode(value, buf, byteOffset) +} + +function decode(varint) { + const int = types$1.enumerable(varint); + + return stringify(int) ?? int +} + +function encodingLength(value) { + if (typeof value === 'string') return encodingLength(parse(value)) + assert(value != null, 'Invalid NullValue value (' + value + ')'); + + if (0 <= value && value <= 0) return 1 + + // enumerable max value in case of unknown value + return 5 +} + +/** + * Convert an enum value to it's human readable name. + * Returns undefined on an unknown value. + */ +function stringify(int) { + return enumValues.get(int) +} + +/** + * Convert an enum string names to it's machine integer value. + * Returns undefined on an unknown name. + */ +function parse(str) { + return enumNames.get(str) +} + +exports.NULL_VALUE = NULL_VALUE; +exports.decode = decode; +exports.encode = encode; +exports.encodingLength = encodingLength; +exports.parse = parse; +exports.stringify = stringify; diff --git a/cjs/google/protobuf/Struct.cjs b/cjs/google/protobuf/Struct.cjs new file mode 100644 index 0000000..684a5d0 --- /dev/null +++ b/cjs/google/protobuf/Struct.cjs @@ -0,0 +1,11 @@ +'use strict'; + +var encode = require('./Struct/encode.cjs'); +var decode = require('./Struct/decode.cjs'); +var FieldsEntry = require('./Struct/FieldsEntry.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; +exports.FieldsEntry = FieldsEntry; diff --git a/cjs/google/protobuf/Struct/FieldsEntry.cjs b/cjs/google/protobuf/Struct/FieldsEntry.cjs new file mode 100644 index 0000000..df3c716 --- /dev/null +++ b/cjs/google/protobuf/Struct/FieldsEntry.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./FieldsEntry/encode.cjs'); +var decode = require('./FieldsEntry/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/google/protobuf/Struct/FieldsEntry/decode.cjs b/cjs/google/protobuf/Struct/FieldsEntry/decode.cjs new file mode 100644 index 0000000..5631d0f --- /dev/null +++ b/cjs/google/protobuf/Struct/FieldsEntry/decode.cjs @@ -0,0 +1,26 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$1 = require('../../Value/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$key = ''; + let field$value = {}; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$key = types.string(data); + break + + case 2: + field$value = decode$1.decode(data); + break + } + } + return { key: field$key, value: field$value } +} + +exports.decode = decode; diff --git a/cjs/google/protobuf/Struct/FieldsEntry/encode.cjs b/cjs/google/protobuf/Struct/FieldsEntry/encode.cjs new file mode 100644 index 0000000..a138af0 --- /dev/null +++ b/cjs/google/protobuf/Struct/FieldsEntry/encode.cjs @@ -0,0 +1,22 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../../Value/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.key) writer.bytes(1, obj.key, types.string); + if (obj.value) writer.bytes(2, encode$1.encode(obj.value)); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/google/protobuf/Struct/decode.cjs b/cjs/google/protobuf/Struct/decode.cjs new file mode 100644 index 0000000..5c19a34 --- /dev/null +++ b/cjs/google/protobuf/Struct/decode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var decode$1 = require('./FieldsEntry/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + const field$fields = []; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$fields.push(decode$1.decode(data)); + break + } + } + return { fields: field$fields } +} + +exports.decode = decode; diff --git a/cjs/google/protobuf/Struct/encode.cjs b/cjs/google/protobuf/Struct/encode.cjs new file mode 100644 index 0000000..e43be8e --- /dev/null +++ b/cjs/google/protobuf/Struct/encode.cjs @@ -0,0 +1,23 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var encode$1 = require('./FieldsEntry/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.fields?.length) + obj.fields.forEach((v) => + writer.bytes(1, encode$1.encode(v)) + ); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/google/protobuf/Value.cjs b/cjs/google/protobuf/Value.cjs new file mode 100644 index 0000000..5212476 --- /dev/null +++ b/cjs/google/protobuf/Value.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./Value/encode.cjs'); +var decode = require('./Value/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/google/protobuf/Value/decode.cjs b/cjs/google/protobuf/Value/decode.cjs new file mode 100644 index 0000000..b6f4b0a --- /dev/null +++ b/cjs/google/protobuf/Value/decode.cjs @@ -0,0 +1,43 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var NullValue = require('../NullValue.cjs'); +var decode$2 = require('../Struct/decode.cjs'); +var decode$1 = require('../ListValue/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$kind = null; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$kind = { nullValue: NullValue.decode(data) }; + break + + case 2: + field$kind = { numberValue: types.double(data) }; + break + + case 3: + field$kind = { stringValue: types.string(data) }; + break + + case 4: + field$kind = { boolValue: types.bool(data) }; + break + + case 5: + field$kind = { structValue: decode$2.decode(data) }; + break + + case 6: + field$kind = { listValue: decode$1.decode(data) }; + break + } + } + return { kind: field$kind } +} + +exports.decode = decode; diff --git a/cjs/google/protobuf/Value/encode.cjs b/cjs/google/protobuf/Value/encode.cjs new file mode 100644 index 0000000..c51d391 --- /dev/null +++ b/cjs/google/protobuf/Value/encode.cjs @@ -0,0 +1,44 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var NullValue = require('../NullValue.cjs'); +var encode$1 = require('../Struct/encode.cjs'); +var encode$2 = require('../ListValue/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.kind?.nullValue ?? obj.nullValue) + writer.varint( + 1, + obj.kind?.nullValue ?? obj.nullValue, + NullValue + ); + if (obj.kind?.numberValue ?? obj.numberValue) + writer.fixed64(2, obj.kind?.numberValue ?? obj.numberValue, types.double); + if (obj.kind?.stringValue ?? obj.stringValue) + writer.bytes(3, obj.kind?.stringValue ?? obj.stringValue, types.string); + if (obj.kind?.boolValue ?? obj.boolValue) + writer.varint(4, obj.kind?.boolValue ?? obj.boolValue, types.bool); + if (obj.kind?.structValue ?? obj.structValue) + writer.bytes( + 5, + encode$1.encode(obj.kind?.structValue ?? obj.structValue) + ); + if (obj.kind?.listValue ?? obj.listValue) + writer.bytes( + 6, + encode$2.encode(obj.kind?.listValue ?? obj.listValue) + ); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/index.cjs b/cjs/index.cjs new file mode 100644 index 0000000..cc4f79b --- /dev/null +++ b/cjs/index.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var vega = require('./vega.cjs'); +var google = require('./google.cjs'); + + + +exports.vega = vega; +exports.google = google; diff --git a/cjs/vega.cjs b/cjs/vega.cjs new file mode 100644 index 0000000..35ae602 --- /dev/null +++ b/cjs/vega.cjs @@ -0,0 +1,333 @@ +'use strict'; + +var commands = require('./vega/commands.cjs'); +var data = require('./vega/data.cjs'); +var Side = require('./vega/Side.cjs'); +var Interval = require('./vega/Interval.cjs'); +var PositionStatus = require('./vega/PositionStatus.cjs'); +var AuctionTrigger = require('./vega/AuctionTrigger.cjs'); +var PeggedReference = require('./vega/PeggedReference.cjs'); +var OrderError = require('./vega/OrderError.cjs'); +var ChainStatus = require('./vega/ChainStatus.cjs'); +var AccountType = require('./vega/AccountType.cjs'); +var TransferType = require('./vega/TransferType.cjs'); +var DispatchMetric = require('./vega/DispatchMetric.cjs'); +var NodeStatus = require('./vega/NodeStatus.cjs'); +var EpochAction = require('./vega/EpochAction.cjs'); +var ValidatorNodeStatus = require('./vega/ValidatorNodeStatus.cjs'); +var ProposalError = require('./vega/ProposalError.cjs'); +var GovernanceTransferType = require('./vega/GovernanceTransferType.cjs'); +var EthContractCallEvent = require('./vega/EthContractCallEvent.cjs'); +var BuiltinAssetDeposit = require('./vega/BuiltinAssetDeposit.cjs'); +var BuiltinAssetWithdrawal = require('./vega/BuiltinAssetWithdrawal.cjs'); +var BuiltinAssetEvent = require('./vega/BuiltinAssetEvent.cjs'); +var ERC20AssetList = require('./vega/ERC20AssetList.cjs'); +var ERC20AssetDelist = require('./vega/ERC20AssetDelist.cjs'); +var ERC20AssetLimitsUpdated = require('./vega/ERC20AssetLimitsUpdated.cjs'); +var ERC20Deposit = require('./vega/ERC20Deposit.cjs'); +var ERC20Withdrawal = require('./vega/ERC20Withdrawal.cjs'); +var ERC20Event = require('./vega/ERC20Event.cjs'); +var ERC20SignerAdded = require('./vega/ERC20SignerAdded.cjs'); +var ERC20SignerRemoved = require('./vega/ERC20SignerRemoved.cjs'); +var ERC20ThresholdSet = require('./vega/ERC20ThresholdSet.cjs'); +var ERC20MultiSigEvent = require('./vega/ERC20MultiSigEvent.cjs'); +var StakingEvent = require('./vega/StakingEvent.cjs'); +var StakeDeposited = require('./vega/StakeDeposited.cjs'); +var StakeRemoved = require('./vega/StakeRemoved.cjs'); +var StakeTotalSupply = require('./vega/StakeTotalSupply.cjs'); +var DataSourceDefinition = require('./vega/DataSourceDefinition.cjs'); +var DataSourceSpecConfigurationTime = require('./vega/DataSourceSpecConfigurationTime.cjs'); +var DataSourceDefinitionInternal = require('./vega/DataSourceDefinitionInternal.cjs'); +var DataSourceDefinitionExternal = require('./vega/DataSourceDefinitionExternal.cjs'); +var DataSourceSpecConfiguration = require('./vega/DataSourceSpecConfiguration.cjs'); +var EthCallSpec = require('./vega/EthCallSpec.cjs'); +var EthCallTrigger = require('./vega/EthCallTrigger.cjs'); +var EthTimeTrigger = require('./vega/EthTimeTrigger.cjs'); +var DataSourceSpec = require('./vega/DataSourceSpec.cjs'); +var ExternalDataSourceSpec = require('./vega/ExternalDataSourceSpec.cjs'); +var AuctionDuration = require('./vega/AuctionDuration.cjs'); +var Spot = require('./vega/Spot.cjs'); +var Future = require('./vega/Future.cjs'); +var DataSourceSpecToFutureBinding = require('./vega/DataSourceSpecToFutureBinding.cjs'); +var InstrumentMetadata = require('./vega/InstrumentMetadata.cjs'); +var Instrument = require('./vega/Instrument.cjs'); +var LogNormalRiskModel = require('./vega/LogNormalRiskModel.cjs'); +var LogNormalModelParams = require('./vega/LogNormalModelParams.cjs'); +var SimpleRiskModel = require('./vega/SimpleRiskModel.cjs'); +var SimpleModelParams = require('./vega/SimpleModelParams.cjs'); +var ScalingFactors = require('./vega/ScalingFactors.cjs'); +var MarginCalculator = require('./vega/MarginCalculator.cjs'); +var TradableInstrument = require('./vega/TradableInstrument.cjs'); +var FeeFactors = require('./vega/FeeFactors.cjs'); +var Fees = require('./vega/Fees.cjs'); +var PriceMonitoringTrigger = require('./vega/PriceMonitoringTrigger.cjs'); +var PriceMonitoringParameters = require('./vega/PriceMonitoringParameters.cjs'); +var PriceMonitoringSettings = require('./vega/PriceMonitoringSettings.cjs'); +var LiquidityMonitoringParameters = require('./vega/LiquidityMonitoringParameters.cjs'); +var TargetStakeParameters = require('./vega/TargetStakeParameters.cjs'); +var Market = require('./vega/Market.cjs'); +var MarketTimestamps = require('./vega/MarketTimestamps.cjs'); +var StopOrder = require('./vega/StopOrder.cjs'); +var Party = require('./vega/Party.cjs'); +var RiskFactor = require('./vega/RiskFactor.cjs'); +var PeggedOrder = require('./vega/PeggedOrder.cjs'); +var IcebergOrder = require('./vega/IcebergOrder.cjs'); +var Order = require('./vega/Order.cjs'); +var OrderCancellationConfirmation = require('./vega/OrderCancellationConfirmation.cjs'); +var OrderConfirmation = require('./vega/OrderConfirmation.cjs'); +var AuctionIndicativeState = require('./vega/AuctionIndicativeState.cjs'); +var Trade = require('./vega/Trade.cjs'); +var Fee = require('./vega/Fee.cjs'); +var TradeSet = require('./vega/TradeSet.cjs'); +var Candle = require('./vega/Candle.cjs'); +var PriceLevel = require('./vega/PriceLevel.cjs'); +var MarketDepth = require('./vega/MarketDepth.cjs'); +var MarketDepthUpdate = require('./vega/MarketDepthUpdate.cjs'); +var Position = require('./vega/Position.cjs'); +var PositionTrade = require('./vega/PositionTrade.cjs'); +var Deposit = require('./vega/Deposit.cjs'); +var Withdrawal = require('./vega/Withdrawal.cjs'); +var WithdrawExt = require('./vega/WithdrawExt.cjs'); +var Erc20WithdrawExt = require('./vega/Erc20WithdrawExt.cjs'); +var Account = require('./vega/Account.cjs'); +var FinancialAmount = require('./vega/FinancialAmount.cjs'); +var Transfer = require('./vega/Transfer.cjs'); +var DispatchStrategy = require('./vega/DispatchStrategy.cjs'); +var TransferRequest = require('./vega/TransferRequest.cjs'); +var AccountDetails = require('./vega/AccountDetails.cjs'); +var LedgerEntry = require('./vega/LedgerEntry.cjs'); +var PostTransferBalance = require('./vega/PostTransferBalance.cjs'); +var LedgerMovement = require('./vega/LedgerMovement.cjs'); +var MarginLevels = require('./vega/MarginLevels.cjs'); +var MarketData = require('./vega/MarketData.cjs'); +var LiquidityProviderFeeShare = require('./vega/LiquidityProviderFeeShare.cjs'); +var PriceMonitoringBounds = require('./vega/PriceMonitoringBounds.cjs'); +var ErrorDetail = require('./vega/ErrorDetail.cjs'); +var NetworkParameter = require('./vega/NetworkParameter.cjs'); +var NetworkLimits = require('./vega/NetworkLimits.cjs'); +var LiquidityOrder = require('./vega/LiquidityOrder.cjs'); +var LiquidityOrderReference = require('./vega/LiquidityOrderReference.cjs'); +var LiquidityProvision = require('./vega/LiquidityProvision.cjs'); +var EthereumConfig = require('./vega/EthereumConfig.cjs'); +var EthereumContractConfig = require('./vega/EthereumContractConfig.cjs'); +var EpochTimestamps = require('./vega/EpochTimestamps.cjs'); +var Epoch = require('./vega/Epoch.cjs'); +var EpochParticipation = require('./vega/EpochParticipation.cjs'); +var EpochData = require('./vega/EpochData.cjs'); +var RankingScore = require('./vega/RankingScore.cjs'); +var RewardScore = require('./vega/RewardScore.cjs'); +var Node = require('./vega/Node.cjs'); +var NodeSet = require('./vega/NodeSet.cjs'); +var NodeData = require('./vega/NodeData.cjs'); +var Delegation = require('./vega/Delegation.cjs'); +var Reward = require('./vega/Reward.cjs'); +var RewardSummary = require('./vega/RewardSummary.cjs'); +var EpochRewardSummary = require('./vega/EpochRewardSummary.cjs'); +var StateValueProposal = require('./vega/StateValueProposal.cjs'); +var KeyValueBundle = require('./vega/KeyValueBundle.cjs'); +var StateVarValue = require('./vega/StateVarValue.cjs'); +var ScalarValue = require('./vega/ScalarValue.cjs'); +var VectorValue = require('./vega/VectorValue.cjs'); +var MatrixValue = require('./vega/MatrixValue.cjs'); +var Asset = require('./vega/Asset.cjs'); +var AssetDetails = require('./vega/AssetDetails.cjs'); +var BuiltinAsset = require('./vega/BuiltinAsset.cjs'); +var ERC20 = require('./vega/ERC20.cjs'); +var AssetDetailsUpdate = require('./vega/AssetDetailsUpdate.cjs'); +var ERC20Update = require('./vega/ERC20Update.cjs'); +var SpotProduct = require('./vega/SpotProduct.cjs'); +var FutureProduct = require('./vega/FutureProduct.cjs'); +var InstrumentConfiguration = require('./vega/InstrumentConfiguration.cjs'); +var NewSpotMarketConfiguration = require('./vega/NewSpotMarketConfiguration.cjs'); +var NewMarketConfiguration = require('./vega/NewMarketConfiguration.cjs'); +var NewSpotMarket = require('./vega/NewSpotMarket.cjs'); +var SuccessorConfiguration = require('./vega/SuccessorConfiguration.cjs'); +var NewMarket = require('./vega/NewMarket.cjs'); +var UpdateMarket = require('./vega/UpdateMarket.cjs'); +var UpdateSpotMarket = require('./vega/UpdateSpotMarket.cjs'); +var UpdateMarketConfiguration = require('./vega/UpdateMarketConfiguration.cjs'); +var UpdateSpotMarketConfiguration = require('./vega/UpdateSpotMarketConfiguration.cjs'); +var UpdateInstrumentConfiguration = require('./vega/UpdateInstrumentConfiguration.cjs'); +var UpdateFutureProduct = require('./vega/UpdateFutureProduct.cjs'); +var UpdateNetworkParameter = require('./vega/UpdateNetworkParameter.cjs'); +var NewAsset = require('./vega/NewAsset.cjs'); +var UpdateAsset = require('./vega/UpdateAsset.cjs'); +var NewFreeform = require('./vega/NewFreeform.cjs'); +var ProposalTerms = require('./vega/ProposalTerms.cjs'); +var ProposalRationale = require('./vega/ProposalRationale.cjs'); +var GovernanceData = require('./vega/GovernanceData.cjs'); +var Proposal = require('./vega/Proposal.cjs'); +var Vote = require('./vega/Vote.cjs'); +var CancelTransfer = require('./vega/CancelTransfer.cjs'); +var CancelTransferConfiguration = require('./vega/CancelTransferConfiguration.cjs'); +var NewTransfer = require('./vega/NewTransfer.cjs'); +var NewTransferConfiguration = require('./vega/NewTransferConfiguration.cjs'); +var OneOffTransfer = require('./vega/OneOffTransfer.cjs'); +var RecurringTransfer = require('./vega/RecurringTransfer.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.commands = commands; +exports.data = data; +exports.Side = Side; +exports.Interval = Interval; +exports.PositionStatus = PositionStatus; +exports.AuctionTrigger = AuctionTrigger; +exports.PeggedReference = PeggedReference; +exports.OrderError = OrderError; +exports.ChainStatus = ChainStatus; +exports.AccountType = AccountType; +exports.TransferType = TransferType; +exports.DispatchMetric = DispatchMetric; +exports.NodeStatus = NodeStatus; +exports.EpochAction = EpochAction; +exports.ValidatorNodeStatus = ValidatorNodeStatus; +exports.ProposalError = ProposalError; +exports.GovernanceTransferType = GovernanceTransferType; +exports.EthContractCallEvent = EthContractCallEvent; +exports.BuiltinAssetDeposit = BuiltinAssetDeposit; +exports.BuiltinAssetWithdrawal = BuiltinAssetWithdrawal; +exports.BuiltinAssetEvent = BuiltinAssetEvent; +exports.ERC20AssetList = ERC20AssetList; +exports.ERC20AssetDelist = ERC20AssetDelist; +exports.ERC20AssetLimitsUpdated = ERC20AssetLimitsUpdated; +exports.ERC20Deposit = ERC20Deposit; +exports.ERC20Withdrawal = ERC20Withdrawal; +exports.ERC20Event = ERC20Event; +exports.ERC20SignerAdded = ERC20SignerAdded; +exports.ERC20SignerRemoved = ERC20SignerRemoved; +exports.ERC20ThresholdSet = ERC20ThresholdSet; +exports.ERC20MultiSigEvent = ERC20MultiSigEvent; +exports.StakingEvent = StakingEvent; +exports.StakeDeposited = StakeDeposited; +exports.StakeRemoved = StakeRemoved; +exports.StakeTotalSupply = StakeTotalSupply; +exports.DataSourceDefinition = DataSourceDefinition; +exports.DataSourceSpecConfigurationTime = DataSourceSpecConfigurationTime; +exports.DataSourceDefinitionInternal = DataSourceDefinitionInternal; +exports.DataSourceDefinitionExternal = DataSourceDefinitionExternal; +exports.DataSourceSpecConfiguration = DataSourceSpecConfiguration; +exports.EthCallSpec = EthCallSpec; +exports.EthCallTrigger = EthCallTrigger; +exports.EthTimeTrigger = EthTimeTrigger; +exports.DataSourceSpec = DataSourceSpec; +exports.ExternalDataSourceSpec = ExternalDataSourceSpec; +exports.AuctionDuration = AuctionDuration; +exports.Spot = Spot; +exports.Future = Future; +exports.DataSourceSpecToFutureBinding = DataSourceSpecToFutureBinding; +exports.InstrumentMetadata = InstrumentMetadata; +exports.Instrument = Instrument; +exports.LogNormalRiskModel = LogNormalRiskModel; +exports.LogNormalModelParams = LogNormalModelParams; +exports.SimpleRiskModel = SimpleRiskModel; +exports.SimpleModelParams = SimpleModelParams; +exports.ScalingFactors = ScalingFactors; +exports.MarginCalculator = MarginCalculator; +exports.TradableInstrument = TradableInstrument; +exports.FeeFactors = FeeFactors; +exports.Fees = Fees; +exports.PriceMonitoringTrigger = PriceMonitoringTrigger; +exports.PriceMonitoringParameters = PriceMonitoringParameters; +exports.PriceMonitoringSettings = PriceMonitoringSettings; +exports.LiquidityMonitoringParameters = LiquidityMonitoringParameters; +exports.TargetStakeParameters = TargetStakeParameters; +exports.Market = Market; +exports.MarketTimestamps = MarketTimestamps; +exports.StopOrder = StopOrder; +exports.Party = Party; +exports.RiskFactor = RiskFactor; +exports.PeggedOrder = PeggedOrder; +exports.IcebergOrder = IcebergOrder; +exports.Order = Order; +exports.OrderCancellationConfirmation = OrderCancellationConfirmation; +exports.OrderConfirmation = OrderConfirmation; +exports.AuctionIndicativeState = AuctionIndicativeState; +exports.Trade = Trade; +exports.Fee = Fee; +exports.TradeSet = TradeSet; +exports.Candle = Candle; +exports.PriceLevel = PriceLevel; +exports.MarketDepth = MarketDepth; +exports.MarketDepthUpdate = MarketDepthUpdate; +exports.Position = Position; +exports.PositionTrade = PositionTrade; +exports.Deposit = Deposit; +exports.Withdrawal = Withdrawal; +exports.WithdrawExt = WithdrawExt; +exports.Erc20WithdrawExt = Erc20WithdrawExt; +exports.Account = Account; +exports.FinancialAmount = FinancialAmount; +exports.Transfer = Transfer; +exports.DispatchStrategy = DispatchStrategy; +exports.TransferRequest = TransferRequest; +exports.AccountDetails = AccountDetails; +exports.LedgerEntry = LedgerEntry; +exports.PostTransferBalance = PostTransferBalance; +exports.LedgerMovement = LedgerMovement; +exports.MarginLevels = MarginLevels; +exports.MarketData = MarketData; +exports.LiquidityProviderFeeShare = LiquidityProviderFeeShare; +exports.PriceMonitoringBounds = PriceMonitoringBounds; +exports.ErrorDetail = ErrorDetail; +exports.NetworkParameter = NetworkParameter; +exports.NetworkLimits = NetworkLimits; +exports.LiquidityOrder = LiquidityOrder; +exports.LiquidityOrderReference = LiquidityOrderReference; +exports.LiquidityProvision = LiquidityProvision; +exports.EthereumConfig = EthereumConfig; +exports.EthereumContractConfig = EthereumContractConfig; +exports.EpochTimestamps = EpochTimestamps; +exports.Epoch = Epoch; +exports.EpochParticipation = EpochParticipation; +exports.EpochData = EpochData; +exports.RankingScore = RankingScore; +exports.RewardScore = RewardScore; +exports.Node = Node; +exports.NodeSet = NodeSet; +exports.NodeData = NodeData; +exports.Delegation = Delegation; +exports.Reward = Reward; +exports.RewardSummary = RewardSummary; +exports.EpochRewardSummary = EpochRewardSummary; +exports.StateValueProposal = StateValueProposal; +exports.KeyValueBundle = KeyValueBundle; +exports.StateVarValue = StateVarValue; +exports.ScalarValue = ScalarValue; +exports.VectorValue = VectorValue; +exports.MatrixValue = MatrixValue; +exports.Asset = Asset; +exports.AssetDetails = AssetDetails; +exports.BuiltinAsset = BuiltinAsset; +exports.ERC20 = ERC20; +exports.AssetDetailsUpdate = AssetDetailsUpdate; +exports.ERC20Update = ERC20Update; +exports.SpotProduct = SpotProduct; +exports.FutureProduct = FutureProduct; +exports.InstrumentConfiguration = InstrumentConfiguration; +exports.NewSpotMarketConfiguration = NewSpotMarketConfiguration; +exports.NewMarketConfiguration = NewMarketConfiguration; +exports.NewSpotMarket = NewSpotMarket; +exports.SuccessorConfiguration = SuccessorConfiguration; +exports.NewMarket = NewMarket; +exports.UpdateMarket = UpdateMarket; +exports.UpdateSpotMarket = UpdateSpotMarket; +exports.UpdateMarketConfiguration = UpdateMarketConfiguration; +exports.UpdateSpotMarketConfiguration = UpdateSpotMarketConfiguration; +exports.UpdateInstrumentConfiguration = UpdateInstrumentConfiguration; +exports.UpdateFutureProduct = UpdateFutureProduct; +exports.UpdateNetworkParameter = UpdateNetworkParameter; +exports.NewAsset = NewAsset; +exports.UpdateAsset = UpdateAsset; +exports.NewFreeform = NewFreeform; +exports.ProposalTerms = ProposalTerms; +exports.ProposalRationale = ProposalRationale; +exports.GovernanceData = GovernanceData; +exports.Proposal = Proposal; +exports.Vote = Vote; +exports.CancelTransfer = CancelTransfer; +exports.CancelTransferConfiguration = CancelTransferConfiguration; +exports.NewTransfer = NewTransfer; +exports.NewTransferConfiguration = NewTransferConfiguration; +exports.OneOffTransfer = OneOffTransfer; +exports.RecurringTransfer = RecurringTransfer; diff --git a/cjs/vega/Account.cjs b/cjs/vega/Account.cjs new file mode 100644 index 0000000..652d2a7 --- /dev/null +++ b/cjs/vega/Account.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./Account/encode.cjs'); +var decode = require('./Account/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/Account/decode.cjs b/cjs/vega/Account/decode.cjs new file mode 100644 index 0000000..fbfc514 --- /dev/null +++ b/cjs/vega/Account/decode.cjs @@ -0,0 +1,53 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var AccountType = require('../AccountType.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$id = ''; + let field$owner = ''; + let field$balance = ''; + let field$asset = ''; + let field$marketId = ''; + let field$type = 0; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$id = types.string(data); + break + + case 2: + field$owner = types.string(data); + break + + case 3: + field$balance = types.string(data); + break + + case 4: + field$asset = types.string(data); + break + + case 5: + field$marketId = types.string(data); + break + + case 6: + field$type = AccountType.decode(data); + break + } + } + return { + id: field$id, + owner: field$owner, + balance: field$balance, + asset: field$asset, + marketId: field$marketId, + type: field$type + } +} + +exports.decode = decode; diff --git a/cjs/vega/Account/encode.cjs b/cjs/vega/Account/encode.cjs new file mode 100644 index 0000000..6040537 --- /dev/null +++ b/cjs/vega/Account/encode.cjs @@ -0,0 +1,26 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var AccountType = require('../AccountType.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.id) writer.bytes(1, obj.id, types.string); + if (obj.owner) writer.bytes(2, obj.owner, types.string); + if (obj.balance) writer.bytes(3, obj.balance, types.string); + if (obj.asset) writer.bytes(4, obj.asset, types.string); + if (obj.marketId) writer.bytes(5, obj.marketId, types.string); + if (obj.type) writer.varint(6, obj.type, AccountType); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/AccountDetails.cjs b/cjs/vega/AccountDetails.cjs new file mode 100644 index 0000000..c1981de --- /dev/null +++ b/cjs/vega/AccountDetails.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./AccountDetails/encode.cjs'); +var decode = require('./AccountDetails/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/AccountDetails/decode.cjs b/cjs/vega/AccountDetails/decode.cjs new file mode 100644 index 0000000..52cff90 --- /dev/null +++ b/cjs/vega/AccountDetails/decode.cjs @@ -0,0 +1,41 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var AccountType = require('../AccountType.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$assetId = ''; + let field$type = 0; + let field$owner = null; + let field$marketId = null; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$assetId = types.string(data); + break + + case 2: + field$type = AccountType.decode(data); + break + + case 3: + field$owner = types.string(data); + break + + case 4: + field$marketId = types.string(data); + break + } + } + return { + assetId: field$assetId, + type: field$type, + owner: field$owner, + marketId: field$marketId + } +} + +exports.decode = decode; diff --git a/cjs/vega/AccountDetails/encode.cjs b/cjs/vega/AccountDetails/encode.cjs new file mode 100644 index 0000000..9876d51 --- /dev/null +++ b/cjs/vega/AccountDetails/encode.cjs @@ -0,0 +1,24 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var AccountType = require('../AccountType.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.assetId) writer.bytes(1, obj.assetId, types.string); + if (obj.type) writer.varint(2, obj.type, AccountType); + if (obj.owner) writer.bytes(3, obj.owner, types.string); + if (obj.marketId) writer.bytes(4, obj.marketId, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/AccountType.cjs b/cjs/vega/AccountType.cjs new file mode 100644 index 0000000..9115002 --- /dev/null +++ b/cjs/vega/AccountType.cjs @@ -0,0 +1,139 @@ +'use strict'; + +var assert = require('nanoassert'); +var types = require('protobuf-codec/encode/types'); +var types$1 = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +const ACCOUNT_TYPE_UNSPECIFIED = 0; +const ACCOUNT_TYPE_INSURANCE = 1; +const ACCOUNT_TYPE_SETTLEMENT = 2; +const ACCOUNT_TYPE_MARGIN = 3; +const ACCOUNT_TYPE_GENERAL = 4; +const ACCOUNT_TYPE_FEES_INFRASTRUCTURE = 5; +const ACCOUNT_TYPE_FEES_LIQUIDITY = 6; +const ACCOUNT_TYPE_FEES_MAKER = 7; +const ACCOUNT_TYPE_BOND = 9; +const ACCOUNT_TYPE_EXTERNAL = 10; +const ACCOUNT_TYPE_GLOBAL_INSURANCE = 11; +const ACCOUNT_TYPE_GLOBAL_REWARD = 12; +const ACCOUNT_TYPE_PENDING_TRANSFERS = 13; +const ACCOUNT_TYPE_REWARD_MAKER_PAID_FEES = 14; +const ACCOUNT_TYPE_REWARD_MAKER_RECEIVED_FEES = 15; +const ACCOUNT_TYPE_REWARD_LP_RECEIVED_FEES = 16; +const ACCOUNT_TYPE_REWARD_MARKET_PROPOSERS = 17; +const ACCOUNT_TYPE_HOLDING = 18; +const ACCOUNT_TYPE_LP_LIQUIDITY_FEES = 19; +const ACCOUNT_TYPE_LIQUIDITY_FEES_BONUS_DISTRIBUTION = 20; + +const enumValues = new Map([ + [0, 'ACCOUNT_TYPE_UNSPECIFIED'], + [1, 'ACCOUNT_TYPE_INSURANCE'], + [2, 'ACCOUNT_TYPE_SETTLEMENT'], + [3, 'ACCOUNT_TYPE_MARGIN'], + [4, 'ACCOUNT_TYPE_GENERAL'], + [5, 'ACCOUNT_TYPE_FEES_INFRASTRUCTURE'], + [6, 'ACCOUNT_TYPE_FEES_LIQUIDITY'], + [7, 'ACCOUNT_TYPE_FEES_MAKER'], + [9, 'ACCOUNT_TYPE_BOND'], + [10, 'ACCOUNT_TYPE_EXTERNAL'], + [11, 'ACCOUNT_TYPE_GLOBAL_INSURANCE'], + [12, 'ACCOUNT_TYPE_GLOBAL_REWARD'], + [13, 'ACCOUNT_TYPE_PENDING_TRANSFERS'], + [14, 'ACCOUNT_TYPE_REWARD_MAKER_PAID_FEES'], + [15, 'ACCOUNT_TYPE_REWARD_MAKER_RECEIVED_FEES'], + [16, 'ACCOUNT_TYPE_REWARD_LP_RECEIVED_FEES'], + [17, 'ACCOUNT_TYPE_REWARD_MARKET_PROPOSERS'], + [18, 'ACCOUNT_TYPE_HOLDING'], + [19, 'ACCOUNT_TYPE_LP_LIQUIDITY_FEES'], + [20, 'ACCOUNT_TYPE_LIQUIDITY_FEES_BONUS_DISTRIBUTION'] +]); +const enumNames = new Map([ + ['ACCOUNT_TYPE_UNSPECIFIED', 0], + ['ACCOUNT_TYPE_INSURANCE', 1], + ['ACCOUNT_TYPE_SETTLEMENT', 2], + ['ACCOUNT_TYPE_MARGIN', 3], + ['ACCOUNT_TYPE_GENERAL', 4], + ['ACCOUNT_TYPE_FEES_INFRASTRUCTURE', 5], + ['ACCOUNT_TYPE_FEES_LIQUIDITY', 6], + ['ACCOUNT_TYPE_FEES_MAKER', 7], + ['ACCOUNT_TYPE_BOND', 9], + ['ACCOUNT_TYPE_EXTERNAL', 10], + ['ACCOUNT_TYPE_GLOBAL_INSURANCE', 11], + ['ACCOUNT_TYPE_GLOBAL_REWARD', 12], + ['ACCOUNT_TYPE_PENDING_TRANSFERS', 13], + ['ACCOUNT_TYPE_REWARD_MAKER_PAID_FEES', 14], + ['ACCOUNT_TYPE_REWARD_MAKER_RECEIVED_FEES', 15], + ['ACCOUNT_TYPE_REWARD_LP_RECEIVED_FEES', 16], + ['ACCOUNT_TYPE_REWARD_MARKET_PROPOSERS', 17], + ['ACCOUNT_TYPE_HOLDING', 18], + ['ACCOUNT_TYPE_LP_LIQUIDITY_FEES', 19], + ['ACCOUNT_TYPE_LIQUIDITY_FEES_BONUS_DISTRIBUTION', 20] +]); + +function encode(value, buf, byteOffset = 0) { + if (typeof value === 'string') return encode(parse(value), buf, byteOffset) + if (value == null) + throw new Error('Invalid AccountType value (' + value + ')') + + return types.enumerable.encode(value, buf, byteOffset) +} + +function decode(varint) { + const int = types$1.enumerable(varint); + + return stringify(int) ?? int +} + +function encodingLength(value) { + if (typeof value === 'string') return encodingLength(parse(value)) + assert(value != null, 'Invalid AccountType value (' + value + ')'); + + if (0 <= value && value <= 20) return 1 + + // enumerable max value in case of unknown value + return 5 +} + +/** + * Convert an enum value to it's human readable name. + * Returns undefined on an unknown value. + */ +function stringify(int) { + return enumValues.get(int) +} + +/** + * Convert an enum string names to it's machine integer value. + * Returns undefined on an unknown name. + */ +function parse(str) { + return enumNames.get(str) +} + +exports.ACCOUNT_TYPE_BOND = ACCOUNT_TYPE_BOND; +exports.ACCOUNT_TYPE_EXTERNAL = ACCOUNT_TYPE_EXTERNAL; +exports.ACCOUNT_TYPE_FEES_INFRASTRUCTURE = ACCOUNT_TYPE_FEES_INFRASTRUCTURE; +exports.ACCOUNT_TYPE_FEES_LIQUIDITY = ACCOUNT_TYPE_FEES_LIQUIDITY; +exports.ACCOUNT_TYPE_FEES_MAKER = ACCOUNT_TYPE_FEES_MAKER; +exports.ACCOUNT_TYPE_GENERAL = ACCOUNT_TYPE_GENERAL; +exports.ACCOUNT_TYPE_GLOBAL_INSURANCE = ACCOUNT_TYPE_GLOBAL_INSURANCE; +exports.ACCOUNT_TYPE_GLOBAL_REWARD = ACCOUNT_TYPE_GLOBAL_REWARD; +exports.ACCOUNT_TYPE_HOLDING = ACCOUNT_TYPE_HOLDING; +exports.ACCOUNT_TYPE_INSURANCE = ACCOUNT_TYPE_INSURANCE; +exports.ACCOUNT_TYPE_LIQUIDITY_FEES_BONUS_DISTRIBUTION = ACCOUNT_TYPE_LIQUIDITY_FEES_BONUS_DISTRIBUTION; +exports.ACCOUNT_TYPE_LP_LIQUIDITY_FEES = ACCOUNT_TYPE_LP_LIQUIDITY_FEES; +exports.ACCOUNT_TYPE_MARGIN = ACCOUNT_TYPE_MARGIN; +exports.ACCOUNT_TYPE_PENDING_TRANSFERS = ACCOUNT_TYPE_PENDING_TRANSFERS; +exports.ACCOUNT_TYPE_REWARD_LP_RECEIVED_FEES = ACCOUNT_TYPE_REWARD_LP_RECEIVED_FEES; +exports.ACCOUNT_TYPE_REWARD_MAKER_PAID_FEES = ACCOUNT_TYPE_REWARD_MAKER_PAID_FEES; +exports.ACCOUNT_TYPE_REWARD_MAKER_RECEIVED_FEES = ACCOUNT_TYPE_REWARD_MAKER_RECEIVED_FEES; +exports.ACCOUNT_TYPE_REWARD_MARKET_PROPOSERS = ACCOUNT_TYPE_REWARD_MARKET_PROPOSERS; +exports.ACCOUNT_TYPE_SETTLEMENT = ACCOUNT_TYPE_SETTLEMENT; +exports.ACCOUNT_TYPE_UNSPECIFIED = ACCOUNT_TYPE_UNSPECIFIED; +exports.decode = decode; +exports.encode = encode; +exports.encodingLength = encodingLength; +exports.parse = parse; +exports.stringify = stringify; diff --git a/cjs/vega/Asset.cjs b/cjs/vega/Asset.cjs new file mode 100644 index 0000000..538cb2b --- /dev/null +++ b/cjs/vega/Asset.cjs @@ -0,0 +1,11 @@ +'use strict'; + +var encode = require('./Asset/encode.cjs'); +var decode = require('./Asset/decode.cjs'); +var Status = require('./Asset/Status.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; +exports.Status = Status; diff --git a/cjs/vega/Asset/Status.cjs b/cjs/vega/Asset/Status.cjs new file mode 100644 index 0000000..fcffc10 --- /dev/null +++ b/cjs/vega/Asset/Status.cjs @@ -0,0 +1,78 @@ +'use strict'; + +var assert = require('nanoassert'); +var types = require('protobuf-codec/encode/types'); +var types$1 = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +const STATUS_UNSPECIFIED = 0; +const STATUS_PROPOSED = 1; +const STATUS_REJECTED = 2; +const STATUS_PENDING_LISTING = 3; +const STATUS_ENABLED = 4; + +const enumValues = new Map([ + [0, 'STATUS_UNSPECIFIED'], + [1, 'STATUS_PROPOSED'], + [2, 'STATUS_REJECTED'], + [3, 'STATUS_PENDING_LISTING'], + [4, 'STATUS_ENABLED'] +]); +const enumNames = new Map([ + ['STATUS_UNSPECIFIED', 0], + ['STATUS_PROPOSED', 1], + ['STATUS_REJECTED', 2], + ['STATUS_PENDING_LISTING', 3], + ['STATUS_ENABLED', 4] +]); + +function encode(value, buf, byteOffset = 0) { + if (typeof value === 'string') return encode(parse(value), buf, byteOffset) + if (value == null) throw new Error('Invalid Status value (' + value + ')') + + return types.enumerable.encode(value, buf, byteOffset) +} + +function decode(varint) { + const int = types$1.enumerable(varint); + + return stringify(int) ?? int +} + +function encodingLength(value) { + if (typeof value === 'string') return encodingLength(parse(value)) + assert(value != null, 'Invalid Status value (' + value + ')'); + + if (0 <= value && value <= 4) return 1 + + // enumerable max value in case of unknown value + return 5 +} + +/** + * Convert an enum value to it's human readable name. + * Returns undefined on an unknown value. + */ +function stringify(int) { + return enumValues.get(int) +} + +/** + * Convert an enum string names to it's machine integer value. + * Returns undefined on an unknown name. + */ +function parse(str) { + return enumNames.get(str) +} + +exports.STATUS_ENABLED = STATUS_ENABLED; +exports.STATUS_PENDING_LISTING = STATUS_PENDING_LISTING; +exports.STATUS_PROPOSED = STATUS_PROPOSED; +exports.STATUS_REJECTED = STATUS_REJECTED; +exports.STATUS_UNSPECIFIED = STATUS_UNSPECIFIED; +exports.decode = decode; +exports.encode = encode; +exports.encodingLength = encodingLength; +exports.parse = parse; +exports.stringify = stringify; diff --git a/cjs/vega/Asset/decode.cjs b/cjs/vega/Asset/decode.cjs new file mode 100644 index 0000000..45b939d --- /dev/null +++ b/cjs/vega/Asset/decode.cjs @@ -0,0 +1,32 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$1 = require('../AssetDetails/decode.cjs'); +var Status = require('./Status.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$id = ''; + let field$details = {}; + let field$status = 0; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$id = types.string(data); + break + + case 2: + field$details = decode$1.decode(data); + break + + case 3: + field$status = Status.decode(data); + break + } + } + return { id: field$id, details: field$details, status: field$status } +} + +exports.decode = decode; diff --git a/cjs/vega/Asset/encode.cjs b/cjs/vega/Asset/encode.cjs new file mode 100644 index 0000000..c612b0e --- /dev/null +++ b/cjs/vega/Asset/encode.cjs @@ -0,0 +1,24 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../AssetDetails/encode.cjs'); +var Status = require('./Status.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.id) writer.bytes(1, obj.id, types.string); + if (obj.details) writer.bytes(2, encode$1.encode(obj.details)); + if (obj.status) writer.varint(3, obj.status, Status); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/AssetDetails.cjs b/cjs/vega/AssetDetails.cjs new file mode 100644 index 0000000..65e02d0 --- /dev/null +++ b/cjs/vega/AssetDetails.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./AssetDetails/encode.cjs'); +var decode = require('./AssetDetails/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/AssetDetails/decode.cjs b/cjs/vega/AssetDetails/decode.cjs new file mode 100644 index 0000000..ae47bd2 --- /dev/null +++ b/cjs/vega/AssetDetails/decode.cjs @@ -0,0 +1,52 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$2 = require('../BuiltinAsset/decode.cjs'); +var decode$1 = require('../ERC20/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$name = ''; + let field$symbol = ''; + let field$decimals = 0n; + let field$quantum = ''; + let field$source = null; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$name = types.string(data); + break + + case 2: + field$symbol = types.string(data); + break + + case 4: + field$decimals = types.uint64(data); + break + + case 5: + field$quantum = types.string(data); + break + + case 101: + field$source = { builtinAsset: decode$2.decode(data) }; + break + + case 102: + field$source = { erc20: decode$1.decode(data) }; + break + } + } + return { + name: field$name, + symbol: field$symbol, + decimals: field$decimals, + quantum: field$quantum, + source: field$source + } +} + +exports.decode = decode; diff --git a/cjs/vega/AssetDetails/encode.cjs b/cjs/vega/AssetDetails/encode.cjs new file mode 100644 index 0000000..c287ebd --- /dev/null +++ b/cjs/vega/AssetDetails/encode.cjs @@ -0,0 +1,33 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../BuiltinAsset/encode.cjs'); +var encode$2 = require('../ERC20/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.name) writer.bytes(1, obj.name, types.string); + if (obj.symbol) writer.bytes(2, obj.symbol, types.string); + if (obj.decimals) writer.varint(4, obj.decimals, types.uint64); + if (obj.quantum) writer.bytes(5, obj.quantum, types.string); + + if (obj.source?.builtinAsset ?? obj.builtinAsset) + writer.bytes( + 101, + encode$1.encode(obj.source?.builtinAsset ?? obj.builtinAsset) + ); + if (obj.source?.erc20 ?? obj.erc20) + writer.bytes(102, encode$2.encode(obj.source?.erc20 ?? obj.erc20)); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/AssetDetailsUpdate.cjs b/cjs/vega/AssetDetailsUpdate.cjs new file mode 100644 index 0000000..bb8a041 --- /dev/null +++ b/cjs/vega/AssetDetailsUpdate.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./AssetDetailsUpdate/encode.cjs'); +var decode = require('./AssetDetailsUpdate/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/AssetDetailsUpdate/decode.cjs b/cjs/vega/AssetDetailsUpdate/decode.cjs new file mode 100644 index 0000000..f42edca --- /dev/null +++ b/cjs/vega/AssetDetailsUpdate/decode.cjs @@ -0,0 +1,26 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$1 = require('../ERC20Update/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$quantum = ''; + let field$source = null; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 5: + field$quantum = types.string(data); + break + + case 101: + field$source = { erc20: decode$1.decode(data) }; + break + } + } + return { quantum: field$quantum, source: field$source } +} + +exports.decode = decode; diff --git a/cjs/vega/AssetDetailsUpdate/encode.cjs b/cjs/vega/AssetDetailsUpdate/encode.cjs new file mode 100644 index 0000000..e5dea3c --- /dev/null +++ b/cjs/vega/AssetDetailsUpdate/encode.cjs @@ -0,0 +1,24 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../ERC20Update/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.quantum) writer.bytes(5, obj.quantum, types.string); + + if (obj.source?.erc20 ?? obj.erc20) + writer.bytes(101, encode$1.encode(obj.source?.erc20 ?? obj.erc20)); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/AuctionDuration.cjs b/cjs/vega/AuctionDuration.cjs new file mode 100644 index 0000000..e6e3e4b --- /dev/null +++ b/cjs/vega/AuctionDuration.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./AuctionDuration/encode.cjs'); +var decode = require('./AuctionDuration/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/AuctionDuration/decode.cjs b/cjs/vega/AuctionDuration/decode.cjs new file mode 100644 index 0000000..a9bb90c --- /dev/null +++ b/cjs/vega/AuctionDuration/decode.cjs @@ -0,0 +1,25 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$duration = 0n; + let field$volume = 0n; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$duration = types.int64(data); + break + + case 2: + field$volume = types.uint64(data); + break + } + } + return { duration: field$duration, volume: field$volume } +} + +exports.decode = decode; diff --git a/cjs/vega/AuctionDuration/encode.cjs b/cjs/vega/AuctionDuration/encode.cjs new file mode 100644 index 0000000..a53f842 --- /dev/null +++ b/cjs/vega/AuctionDuration/encode.cjs @@ -0,0 +1,21 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.duration) writer.varint(1, obj.duration, types.int64); + if (obj.volume) writer.varint(2, obj.volume, types.uint64); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/AuctionIndicativeState.cjs b/cjs/vega/AuctionIndicativeState.cjs new file mode 100644 index 0000000..a1f3824 --- /dev/null +++ b/cjs/vega/AuctionIndicativeState.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./AuctionIndicativeState/encode.cjs'); +var decode = require('./AuctionIndicativeState/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/AuctionIndicativeState/decode.cjs b/cjs/vega/AuctionIndicativeState/decode.cjs new file mode 100644 index 0000000..d4d0a0b --- /dev/null +++ b/cjs/vega/AuctionIndicativeState/decode.cjs @@ -0,0 +1,46 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$marketId = ''; + let field$indicativePrice = ''; + let field$indicativeVolume = 0n; + let field$auctionStart = 0n; + let field$auctionEnd = 0n; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$marketId = types.string(data); + break + + case 2: + field$indicativePrice = types.string(data); + break + + case 3: + field$indicativeVolume = types.uint64(data); + break + + case 4: + field$auctionStart = types.int64(data); + break + + case 5: + field$auctionEnd = types.int64(data); + break + } + } + return { + marketId: field$marketId, + indicativePrice: field$indicativePrice, + indicativeVolume: field$indicativeVolume, + auctionStart: field$auctionStart, + auctionEnd: field$auctionEnd + } +} + +exports.decode = decode; diff --git a/cjs/vega/AuctionIndicativeState/encode.cjs b/cjs/vega/AuctionIndicativeState/encode.cjs new file mode 100644 index 0000000..3f8b732 --- /dev/null +++ b/cjs/vega/AuctionIndicativeState/encode.cjs @@ -0,0 +1,24 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.marketId) writer.bytes(1, obj.marketId, types.string); + if (obj.indicativePrice) writer.bytes(2, obj.indicativePrice, types.string); + if (obj.indicativeVolume) writer.varint(3, obj.indicativeVolume, types.uint64); + if (obj.auctionStart) writer.varint(4, obj.auctionStart, types.int64); + if (obj.auctionEnd) writer.varint(5, obj.auctionEnd, types.int64); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/AuctionTrigger.cjs b/cjs/vega/AuctionTrigger.cjs new file mode 100644 index 0000000..8e45350 --- /dev/null +++ b/cjs/vega/AuctionTrigger.cjs @@ -0,0 +1,87 @@ +'use strict'; + +var assert = require('nanoassert'); +var types = require('protobuf-codec/encode/types'); +var types$1 = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +const AUCTION_TRIGGER_UNSPECIFIED = 0; +const AUCTION_TRIGGER_BATCH = 1; +const AUCTION_TRIGGER_OPENING = 2; +const AUCTION_TRIGGER_PRICE = 3; +const AUCTION_TRIGGER_LIQUIDITY = 4; +const AUCTION_TRIGGER_LIQUIDITY_TARGET_NOT_MET = 5; +const AUCTION_TRIGGER_UNABLE_TO_DEPLOY_LP_ORDERS = 6; + +const enumValues = new Map([ + [0, 'AUCTION_TRIGGER_UNSPECIFIED'], + [1, 'AUCTION_TRIGGER_BATCH'], + [2, 'AUCTION_TRIGGER_OPENING'], + [3, 'AUCTION_TRIGGER_PRICE'], + [4, 'AUCTION_TRIGGER_LIQUIDITY'], + [5, 'AUCTION_TRIGGER_LIQUIDITY_TARGET_NOT_MET'], + [6, 'AUCTION_TRIGGER_UNABLE_TO_DEPLOY_LP_ORDERS'] +]); +const enumNames = new Map([ + ['AUCTION_TRIGGER_UNSPECIFIED', 0], + ['AUCTION_TRIGGER_BATCH', 1], + ['AUCTION_TRIGGER_OPENING', 2], + ['AUCTION_TRIGGER_PRICE', 3], + ['AUCTION_TRIGGER_LIQUIDITY', 4], + ['AUCTION_TRIGGER_LIQUIDITY_TARGET_NOT_MET', 5], + ['AUCTION_TRIGGER_UNABLE_TO_DEPLOY_LP_ORDERS', 6] +]); + +function encode(value, buf, byteOffset = 0) { + if (typeof value === 'string') return encode(parse(value), buf, byteOffset) + if (value == null) + throw new Error('Invalid AuctionTrigger value (' + value + ')') + + return types.enumerable.encode(value, buf, byteOffset) +} + +function decode(varint) { + const int = types$1.enumerable(varint); + + return stringify(int) ?? int +} + +function encodingLength(value) { + if (typeof value === 'string') return encodingLength(parse(value)) + assert(value != null, 'Invalid AuctionTrigger value (' + value + ')'); + + if (0 <= value && value <= 6) return 1 + + // enumerable max value in case of unknown value + return 5 +} + +/** + * Convert an enum value to it's human readable name. + * Returns undefined on an unknown value. + */ +function stringify(int) { + return enumValues.get(int) +} + +/** + * Convert an enum string names to it's machine integer value. + * Returns undefined on an unknown name. + */ +function parse(str) { + return enumNames.get(str) +} + +exports.AUCTION_TRIGGER_BATCH = AUCTION_TRIGGER_BATCH; +exports.AUCTION_TRIGGER_LIQUIDITY = AUCTION_TRIGGER_LIQUIDITY; +exports.AUCTION_TRIGGER_LIQUIDITY_TARGET_NOT_MET = AUCTION_TRIGGER_LIQUIDITY_TARGET_NOT_MET; +exports.AUCTION_TRIGGER_OPENING = AUCTION_TRIGGER_OPENING; +exports.AUCTION_TRIGGER_PRICE = AUCTION_TRIGGER_PRICE; +exports.AUCTION_TRIGGER_UNABLE_TO_DEPLOY_LP_ORDERS = AUCTION_TRIGGER_UNABLE_TO_DEPLOY_LP_ORDERS; +exports.AUCTION_TRIGGER_UNSPECIFIED = AUCTION_TRIGGER_UNSPECIFIED; +exports.decode = decode; +exports.encode = encode; +exports.encodingLength = encodingLength; +exports.parse = parse; +exports.stringify = stringify; diff --git a/cjs/vega/BuiltinAsset.cjs b/cjs/vega/BuiltinAsset.cjs new file mode 100644 index 0000000..be4d5e3 --- /dev/null +++ b/cjs/vega/BuiltinAsset.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./BuiltinAsset/encode.cjs'); +var decode = require('./BuiltinAsset/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/BuiltinAsset/decode.cjs b/cjs/vega/BuiltinAsset/decode.cjs new file mode 100644 index 0000000..6457c0f --- /dev/null +++ b/cjs/vega/BuiltinAsset/decode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$maxFaucetAmountMint = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$maxFaucetAmountMint = types.string(data); + break + } + } + return { maxFaucetAmountMint: field$maxFaucetAmountMint } +} + +exports.decode = decode; diff --git a/cjs/vega/BuiltinAsset/encode.cjs b/cjs/vega/BuiltinAsset/encode.cjs new file mode 100644 index 0000000..a967586 --- /dev/null +++ b/cjs/vega/BuiltinAsset/encode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.maxFaucetAmountMint) writer.bytes(1, obj.maxFaucetAmountMint, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/BuiltinAssetDeposit.cjs b/cjs/vega/BuiltinAssetDeposit.cjs new file mode 100644 index 0000000..41954c6 --- /dev/null +++ b/cjs/vega/BuiltinAssetDeposit.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./BuiltinAssetDeposit/encode.cjs'); +var decode = require('./BuiltinAssetDeposit/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/BuiltinAssetDeposit/decode.cjs b/cjs/vega/BuiltinAssetDeposit/decode.cjs new file mode 100644 index 0000000..7f0eb9c --- /dev/null +++ b/cjs/vega/BuiltinAssetDeposit/decode.cjs @@ -0,0 +1,34 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$vegaAssetId = ''; + let field$partyId = ''; + let field$amount = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$vegaAssetId = types.string(data); + break + + case 2: + field$partyId = types.string(data); + break + + case 3: + field$amount = types.string(data); + break + } + } + return { + vegaAssetId: field$vegaAssetId, + partyId: field$partyId, + amount: field$amount + } +} + +exports.decode = decode; diff --git a/cjs/vega/BuiltinAssetDeposit/encode.cjs b/cjs/vega/BuiltinAssetDeposit/encode.cjs new file mode 100644 index 0000000..40094ad --- /dev/null +++ b/cjs/vega/BuiltinAssetDeposit/encode.cjs @@ -0,0 +1,22 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.vegaAssetId) writer.bytes(1, obj.vegaAssetId, types.string); + if (obj.partyId) writer.bytes(2, obj.partyId, types.string); + if (obj.amount) writer.bytes(3, obj.amount, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/BuiltinAssetEvent.cjs b/cjs/vega/BuiltinAssetEvent.cjs new file mode 100644 index 0000000..24b04d8 --- /dev/null +++ b/cjs/vega/BuiltinAssetEvent.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./BuiltinAssetEvent/encode.cjs'); +var decode = require('./BuiltinAssetEvent/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/BuiltinAssetEvent/decode.cjs b/cjs/vega/BuiltinAssetEvent/decode.cjs new file mode 100644 index 0000000..e866037 --- /dev/null +++ b/cjs/vega/BuiltinAssetEvent/decode.cjs @@ -0,0 +1,25 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var decode$2 = require('../BuiltinAssetDeposit/decode.cjs'); +var decode$1 = require('../BuiltinAssetWithdrawal/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$action = null; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1001: + field$action = { deposit: decode$2.decode(data) }; + break + + case 1002: + field$action = { withdrawal: decode$1.decode(data) }; + break + } + } + return { action: field$action } +} + +exports.decode = decode; diff --git a/cjs/vega/BuiltinAssetEvent/encode.cjs b/cjs/vega/BuiltinAssetEvent/encode.cjs new file mode 100644 index 0000000..0f8cec9 --- /dev/null +++ b/cjs/vega/BuiltinAssetEvent/encode.cjs @@ -0,0 +1,32 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var encode$1 = require('../BuiltinAssetDeposit/encode.cjs'); +var encode$2 = require('../BuiltinAssetWithdrawal/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.action?.deposit ?? obj.deposit) + writer.bytes( + 1001, + encode$1.encode(obj.action?.deposit ?? obj.deposit) + ); + if (obj.action?.withdrawal ?? obj.withdrawal) + writer.bytes( + 1002, + encode$2.encode( + obj.action?.withdrawal ?? obj.withdrawal + ) + ); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/BuiltinAssetWithdrawal.cjs b/cjs/vega/BuiltinAssetWithdrawal.cjs new file mode 100644 index 0000000..ddfeb09 --- /dev/null +++ b/cjs/vega/BuiltinAssetWithdrawal.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./BuiltinAssetWithdrawal/encode.cjs'); +var decode = require('./BuiltinAssetWithdrawal/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/BuiltinAssetWithdrawal/decode.cjs b/cjs/vega/BuiltinAssetWithdrawal/decode.cjs new file mode 100644 index 0000000..7f0eb9c --- /dev/null +++ b/cjs/vega/BuiltinAssetWithdrawal/decode.cjs @@ -0,0 +1,34 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$vegaAssetId = ''; + let field$partyId = ''; + let field$amount = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$vegaAssetId = types.string(data); + break + + case 2: + field$partyId = types.string(data); + break + + case 3: + field$amount = types.string(data); + break + } + } + return { + vegaAssetId: field$vegaAssetId, + partyId: field$partyId, + amount: field$amount + } +} + +exports.decode = decode; diff --git a/cjs/vega/BuiltinAssetWithdrawal/encode.cjs b/cjs/vega/BuiltinAssetWithdrawal/encode.cjs new file mode 100644 index 0000000..40094ad --- /dev/null +++ b/cjs/vega/BuiltinAssetWithdrawal/encode.cjs @@ -0,0 +1,22 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.vegaAssetId) writer.bytes(1, obj.vegaAssetId, types.string); + if (obj.partyId) writer.bytes(2, obj.partyId, types.string); + if (obj.amount) writer.bytes(3, obj.amount, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/CancelTransfer.cjs b/cjs/vega/CancelTransfer.cjs new file mode 100644 index 0000000..38f9716 --- /dev/null +++ b/cjs/vega/CancelTransfer.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./CancelTransfer/encode.cjs'); +var decode = require('./CancelTransfer/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/CancelTransfer/decode.cjs b/cjs/vega/CancelTransfer/decode.cjs new file mode 100644 index 0000000..4e4fd30 --- /dev/null +++ b/cjs/vega/CancelTransfer/decode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var decode$1 = require('../CancelTransferConfiguration/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$changes = {}; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$changes = decode$1.decode(data); + break + } + } + return { changes: field$changes } +} + +exports.decode = decode; diff --git a/cjs/vega/CancelTransfer/encode.cjs b/cjs/vega/CancelTransfer/encode.cjs new file mode 100644 index 0000000..572378d --- /dev/null +++ b/cjs/vega/CancelTransfer/encode.cjs @@ -0,0 +1,21 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var encode$1 = require('../CancelTransferConfiguration/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.changes) + writer.bytes(1, encode$1.encode(obj.changes)); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/CancelTransferConfiguration.cjs b/cjs/vega/CancelTransferConfiguration.cjs new file mode 100644 index 0000000..d8989d0 --- /dev/null +++ b/cjs/vega/CancelTransferConfiguration.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./CancelTransferConfiguration/encode.cjs'); +var decode = require('./CancelTransferConfiguration/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/CancelTransferConfiguration/decode.cjs b/cjs/vega/CancelTransferConfiguration/decode.cjs new file mode 100644 index 0000000..17cb53a --- /dev/null +++ b/cjs/vega/CancelTransferConfiguration/decode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$transferId = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$transferId = types.string(data); + break + } + } + return { transferId: field$transferId } +} + +exports.decode = decode; diff --git a/cjs/vega/CancelTransferConfiguration/encode.cjs b/cjs/vega/CancelTransferConfiguration/encode.cjs new file mode 100644 index 0000000..f35b600 --- /dev/null +++ b/cjs/vega/CancelTransferConfiguration/encode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.transferId) writer.bytes(1, obj.transferId, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/Candle.cjs b/cjs/vega/Candle.cjs new file mode 100644 index 0000000..39d9418 --- /dev/null +++ b/cjs/vega/Candle.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./Candle/encode.cjs'); +var decode = require('./Candle/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/Candle/decode.cjs b/cjs/vega/Candle/decode.cjs new file mode 100644 index 0000000..cddb9bb --- /dev/null +++ b/cjs/vega/Candle/decode.cjs @@ -0,0 +1,71 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var Interval = require('../Interval.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$timestamp = 0n; + let field$datetime = ''; + let field$high = ''; + let field$low = ''; + let field$open = ''; + let field$close = ''; + let field$volume = 0n; + let field$interval = 0; + let field$notional = 0n; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$timestamp = types.int64(data); + break + + case 2: + field$datetime = types.string(data); + break + + case 3: + field$high = types.string(data); + break + + case 4: + field$low = types.string(data); + break + + case 5: + field$open = types.string(data); + break + + case 6: + field$close = types.string(data); + break + + case 7: + field$volume = types.uint64(data); + break + + case 8: + field$interval = Interval.decode(data); + break + + case 9: + field$notional = types.uint64(data); + break + } + } + return { + timestamp: field$timestamp, + datetime: field$datetime, + high: field$high, + low: field$low, + open: field$open, + close: field$close, + volume: field$volume, + interval: field$interval, + notional: field$notional + } +} + +exports.decode = decode; diff --git a/cjs/vega/Candle/encode.cjs b/cjs/vega/Candle/encode.cjs new file mode 100644 index 0000000..cd7b83a --- /dev/null +++ b/cjs/vega/Candle/encode.cjs @@ -0,0 +1,29 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var Interval = require('../Interval.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.timestamp) writer.varint(1, obj.timestamp, types.int64); + if (obj.datetime) writer.bytes(2, obj.datetime, types.string); + if (obj.high) writer.bytes(3, obj.high, types.string); + if (obj.low) writer.bytes(4, obj.low, types.string); + if (obj.open) writer.bytes(5, obj.open, types.string); + if (obj.close) writer.bytes(6, obj.close, types.string); + if (obj.volume) writer.varint(7, obj.volume, types.uint64); + if (obj.interval) writer.varint(8, obj.interval, Interval); + if (obj.notional) writer.varint(9, obj.notional, types.uint64); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/ChainStatus.cjs b/cjs/vega/ChainStatus.cjs new file mode 100644 index 0000000..ea9ddf8 --- /dev/null +++ b/cjs/vega/ChainStatus.cjs @@ -0,0 +1,75 @@ +'use strict'; + +var assert = require('nanoassert'); +var types = require('protobuf-codec/encode/types'); +var types$1 = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +const CHAIN_STATUS_UNSPECIFIED = 0; +const CHAIN_STATUS_DISCONNECTED = 1; +const CHAIN_STATUS_REPLAYING = 2; +const CHAIN_STATUS_CONNECTED = 3; + +const enumValues = new Map([ + [0, 'CHAIN_STATUS_UNSPECIFIED'], + [1, 'CHAIN_STATUS_DISCONNECTED'], + [2, 'CHAIN_STATUS_REPLAYING'], + [3, 'CHAIN_STATUS_CONNECTED'] +]); +const enumNames = new Map([ + ['CHAIN_STATUS_UNSPECIFIED', 0], + ['CHAIN_STATUS_DISCONNECTED', 1], + ['CHAIN_STATUS_REPLAYING', 2], + ['CHAIN_STATUS_CONNECTED', 3] +]); + +function encode(value, buf, byteOffset = 0) { + if (typeof value === 'string') return encode(parse(value), buf, byteOffset) + if (value == null) + throw new Error('Invalid ChainStatus value (' + value + ')') + + return types.enumerable.encode(value, buf, byteOffset) +} + +function decode(varint) { + const int = types$1.enumerable(varint); + + return stringify(int) ?? int +} + +function encodingLength(value) { + if (typeof value === 'string') return encodingLength(parse(value)) + assert(value != null, 'Invalid ChainStatus value (' + value + ')'); + + if (0 <= value && value <= 3) return 1 + + // enumerable max value in case of unknown value + return 5 +} + +/** + * Convert an enum value to it's human readable name. + * Returns undefined on an unknown value. + */ +function stringify(int) { + return enumValues.get(int) +} + +/** + * Convert an enum string names to it's machine integer value. + * Returns undefined on an unknown name. + */ +function parse(str) { + return enumNames.get(str) +} + +exports.CHAIN_STATUS_CONNECTED = CHAIN_STATUS_CONNECTED; +exports.CHAIN_STATUS_DISCONNECTED = CHAIN_STATUS_DISCONNECTED; +exports.CHAIN_STATUS_REPLAYING = CHAIN_STATUS_REPLAYING; +exports.CHAIN_STATUS_UNSPECIFIED = CHAIN_STATUS_UNSPECIFIED; +exports.decode = decode; +exports.encode = encode; +exports.encodingLength = encodingLength; +exports.parse = parse; +exports.stringify = stringify; diff --git a/cjs/vega/DataSourceDefinition.cjs b/cjs/vega/DataSourceDefinition.cjs new file mode 100644 index 0000000..40e153f --- /dev/null +++ b/cjs/vega/DataSourceDefinition.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./DataSourceDefinition/encode.cjs'); +var decode = require('./DataSourceDefinition/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/DataSourceDefinition/decode.cjs b/cjs/vega/DataSourceDefinition/decode.cjs new file mode 100644 index 0000000..2647c8b --- /dev/null +++ b/cjs/vega/DataSourceDefinition/decode.cjs @@ -0,0 +1,29 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var decode$2 = require('../DataSourceDefinitionInternal/decode.cjs'); +var decode$1 = require('../DataSourceDefinitionExternal/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$source_type = null; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$source_type = { + internal: decode$2.decode(data) + }; + break + + case 2: + field$source_type = { + external: decode$1.decode(data) + }; + break + } + } + return { source_type: field$source_type } +} + +exports.decode = decode; diff --git a/cjs/vega/DataSourceDefinition/encode.cjs b/cjs/vega/DataSourceDefinition/encode.cjs new file mode 100644 index 0000000..0843801 --- /dev/null +++ b/cjs/vega/DataSourceDefinition/encode.cjs @@ -0,0 +1,34 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var encode$1 = require('../DataSourceDefinitionInternal/encode.cjs'); +var encode$2 = require('../DataSourceDefinitionExternal/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.source_type?.internal ?? obj.internal) + writer.bytes( + 1, + encode$1.encode( + obj.source_type?.internal ?? obj.internal + ) + ); + if (obj.source_type?.external ?? obj.external) + writer.bytes( + 2, + encode$2.encode( + obj.source_type?.external ?? obj.external + ) + ); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/DataSourceDefinitionExternal.cjs b/cjs/vega/DataSourceDefinitionExternal.cjs new file mode 100644 index 0000000..c2786fb --- /dev/null +++ b/cjs/vega/DataSourceDefinitionExternal.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./DataSourceDefinitionExternal/encode.cjs'); +var decode = require('./DataSourceDefinitionExternal/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/DataSourceDefinitionExternal/decode.cjs b/cjs/vega/DataSourceDefinitionExternal/decode.cjs new file mode 100644 index 0000000..e17dbae --- /dev/null +++ b/cjs/vega/DataSourceDefinitionExternal/decode.cjs @@ -0,0 +1,27 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var decode$2 = require('../DataSourceSpecConfiguration/decode.cjs'); +var decode$1 = require('../EthCallSpec/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$source_type = null; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$source_type = { + oracle: decode$2.decode(data) + }; + break + + case 2: + field$source_type = { ethCall: decode$1.decode(data) }; + break + } + } + return { source_type: field$source_type } +} + +exports.decode = decode; diff --git a/cjs/vega/DataSourceDefinitionExternal/encode.cjs b/cjs/vega/DataSourceDefinitionExternal/encode.cjs new file mode 100644 index 0000000..01bab92 --- /dev/null +++ b/cjs/vega/DataSourceDefinitionExternal/encode.cjs @@ -0,0 +1,32 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var encode$1 = require('../DataSourceSpecConfiguration/encode.cjs'); +var encode$2 = require('../EthCallSpec/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.source_type?.oracle ?? obj.oracle) + writer.bytes( + 1, + encode$1.encode( + obj.source_type?.oracle ?? obj.oracle + ) + ); + if (obj.source_type?.ethCall ?? obj.ethCall) + writer.bytes( + 2, + encode$2.encode(obj.source_type?.ethCall ?? obj.ethCall) + ); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/DataSourceDefinitionInternal.cjs b/cjs/vega/DataSourceDefinitionInternal.cjs new file mode 100644 index 0000000..f39b414 --- /dev/null +++ b/cjs/vega/DataSourceDefinitionInternal.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./DataSourceDefinitionInternal/encode.cjs'); +var decode = require('./DataSourceDefinitionInternal/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/DataSourceDefinitionInternal/decode.cjs b/cjs/vega/DataSourceDefinitionInternal/decode.cjs new file mode 100644 index 0000000..32c1208 --- /dev/null +++ b/cjs/vega/DataSourceDefinitionInternal/decode.cjs @@ -0,0 +1,22 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var decode$1 = require('../DataSourceSpecConfigurationTime/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$source_type = null; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$source_type = { + time: decode$1.decode(data) + }; + break + } + } + return { source_type: field$source_type } +} + +exports.decode = decode; diff --git a/cjs/vega/DataSourceDefinitionInternal/encode.cjs b/cjs/vega/DataSourceDefinitionInternal/encode.cjs new file mode 100644 index 0000000..9640713 --- /dev/null +++ b/cjs/vega/DataSourceDefinitionInternal/encode.cjs @@ -0,0 +1,26 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var encode$1 = require('../DataSourceSpecConfigurationTime/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.source_type?.time ?? obj.time) + writer.bytes( + 1, + encode$1.encode( + obj.source_type?.time ?? obj.time + ) + ); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/DataSourceSpec.cjs b/cjs/vega/DataSourceSpec.cjs new file mode 100644 index 0000000..ed5ba49 --- /dev/null +++ b/cjs/vega/DataSourceSpec.cjs @@ -0,0 +1,11 @@ +'use strict'; + +var encode = require('./DataSourceSpec/encode.cjs'); +var decode = require('./DataSourceSpec/decode.cjs'); +var Status = require('./DataSourceSpec/Status.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; +exports.Status = Status; diff --git a/cjs/vega/DataSourceSpec/Status.cjs b/cjs/vega/DataSourceSpec/Status.cjs new file mode 100644 index 0000000..9e3e209 --- /dev/null +++ b/cjs/vega/DataSourceSpec/Status.cjs @@ -0,0 +1,70 @@ +'use strict'; + +var assert = require('nanoassert'); +var types = require('protobuf-codec/encode/types'); +var types$1 = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +const STATUS_UNSPECIFIED = 0; +const STATUS_ACTIVE = 1; +const STATUS_DEACTIVATED = 2; + +const enumValues = new Map([ + [0, 'STATUS_UNSPECIFIED'], + [1, 'STATUS_ACTIVE'], + [2, 'STATUS_DEACTIVATED'] +]); +const enumNames = new Map([ + ['STATUS_UNSPECIFIED', 0], + ['STATUS_ACTIVE', 1], + ['STATUS_DEACTIVATED', 2] +]); + +function encode(value, buf, byteOffset = 0) { + if (typeof value === 'string') return encode(parse(value), buf, byteOffset) + if (value == null) throw new Error('Invalid Status value (' + value + ')') + + return types.enumerable.encode(value, buf, byteOffset) +} + +function decode(varint) { + const int = types$1.enumerable(varint); + + return stringify(int) ?? int +} + +function encodingLength(value) { + if (typeof value === 'string') return encodingLength(parse(value)) + assert(value != null, 'Invalid Status value (' + value + ')'); + + if (0 <= value && value <= 2) return 1 + + // enumerable max value in case of unknown value + return 5 +} + +/** + * Convert an enum value to it's human readable name. + * Returns undefined on an unknown value. + */ +function stringify(int) { + return enumValues.get(int) +} + +/** + * Convert an enum string names to it's machine integer value. + * Returns undefined on an unknown name. + */ +function parse(str) { + return enumNames.get(str) +} + +exports.STATUS_ACTIVE = STATUS_ACTIVE; +exports.STATUS_DEACTIVATED = STATUS_DEACTIVATED; +exports.STATUS_UNSPECIFIED = STATUS_UNSPECIFIED; +exports.decode = decode; +exports.encode = encode; +exports.encodingLength = encodingLength; +exports.parse = parse; +exports.stringify = stringify; diff --git a/cjs/vega/DataSourceSpec/decode.cjs b/cjs/vega/DataSourceSpec/decode.cjs new file mode 100644 index 0000000..11688ca --- /dev/null +++ b/cjs/vega/DataSourceSpec/decode.cjs @@ -0,0 +1,48 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$1 = require('../DataSourceDefinition/decode.cjs'); +var Status = require('./Status.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$id = ''; + let field$createdAt = 0n; + let field$updatedAt = 0n; + let field$data = {}; + let field$status = 0; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$id = types.string(data); + break + + case 2: + field$createdAt = types.int64(data); + break + + case 3: + field$updatedAt = types.int64(data); + break + + case 4: + field$data = decode$1.decode(data); + break + + case 5: + field$status = Status.decode(data); + break + } + } + return { + id: field$id, + createdAt: field$createdAt, + updatedAt: field$updatedAt, + data: field$data, + status: field$status + } +} + +exports.decode = decode; diff --git a/cjs/vega/DataSourceSpec/encode.cjs b/cjs/vega/DataSourceSpec/encode.cjs new file mode 100644 index 0000000..3ba80af --- /dev/null +++ b/cjs/vega/DataSourceSpec/encode.cjs @@ -0,0 +1,26 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../DataSourceDefinition/encode.cjs'); +var Status = require('./Status.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.id) writer.bytes(1, obj.id, types.string); + if (obj.createdAt) writer.varint(2, obj.createdAt, types.int64); + if (obj.updatedAt) writer.varint(3, obj.updatedAt, types.int64); + if (obj.data) writer.bytes(4, encode$1.encode(obj.data)); + if (obj.status) writer.varint(5, obj.status, Status); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/DataSourceSpecConfiguration.cjs b/cjs/vega/DataSourceSpecConfiguration.cjs new file mode 100644 index 0000000..888d41b --- /dev/null +++ b/cjs/vega/DataSourceSpecConfiguration.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./DataSourceSpecConfiguration/encode.cjs'); +var decode = require('./DataSourceSpecConfiguration/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/DataSourceSpecConfiguration/decode.cjs b/cjs/vega/DataSourceSpecConfiguration/decode.cjs new file mode 100644 index 0000000..13a2945 --- /dev/null +++ b/cjs/vega/DataSourceSpecConfiguration/decode.cjs @@ -0,0 +1,26 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var decode$2 = require('../data/v1/Signer/decode.cjs'); +var decode$1 = require('../data/v1/Filter/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + const field$signers = []; + const field$filters = []; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$signers.push(decode$2.decode(data)); + break + + case 2: + field$filters.push(decode$1.decode(data)); + break + } + } + return { signers: field$signers, filters: field$filters } +} + +exports.decode = decode; diff --git a/cjs/vega/DataSourceSpecConfiguration/encode.cjs b/cjs/vega/DataSourceSpecConfiguration/encode.cjs new file mode 100644 index 0000000..6380e65 --- /dev/null +++ b/cjs/vega/DataSourceSpecConfiguration/encode.cjs @@ -0,0 +1,24 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var encode$1 = require('../data/v1/Signer/encode.cjs'); +var encode$2 = require('../data/v1/Filter/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.signers?.length) + obj.signers.forEach((v) => writer.bytes(1, encode$1.encode(v))); + if (obj.filters?.length) + obj.filters.forEach((v) => writer.bytes(2, encode$2.encode(v))); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/DataSourceSpecConfigurationTime.cjs b/cjs/vega/DataSourceSpecConfigurationTime.cjs new file mode 100644 index 0000000..0edf426 --- /dev/null +++ b/cjs/vega/DataSourceSpecConfigurationTime.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./DataSourceSpecConfigurationTime/encode.cjs'); +var decode = require('./DataSourceSpecConfigurationTime/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/DataSourceSpecConfigurationTime/decode.cjs b/cjs/vega/DataSourceSpecConfigurationTime/decode.cjs new file mode 100644 index 0000000..b093588 --- /dev/null +++ b/cjs/vega/DataSourceSpecConfigurationTime/decode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var decode$1 = require('../data/v1/Condition/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + const field$conditions = []; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$conditions.push(decode$1.decode(data)); + break + } + } + return { conditions: field$conditions } +} + +exports.decode = decode; diff --git a/cjs/vega/DataSourceSpecConfigurationTime/encode.cjs b/cjs/vega/DataSourceSpecConfigurationTime/encode.cjs new file mode 100644 index 0000000..9759efe --- /dev/null +++ b/cjs/vega/DataSourceSpecConfigurationTime/encode.cjs @@ -0,0 +1,23 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var encode$1 = require('../data/v1/Condition/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.conditions?.length) + obj.conditions.forEach((v) => + writer.bytes(1, encode$1.encode(v)) + ); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/DataSourceSpecToFutureBinding.cjs b/cjs/vega/DataSourceSpecToFutureBinding.cjs new file mode 100644 index 0000000..c9e8e2c --- /dev/null +++ b/cjs/vega/DataSourceSpecToFutureBinding.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./DataSourceSpecToFutureBinding/encode.cjs'); +var decode = require('./DataSourceSpecToFutureBinding/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/DataSourceSpecToFutureBinding/decode.cjs b/cjs/vega/DataSourceSpecToFutureBinding/decode.cjs new file mode 100644 index 0000000..65c7768 --- /dev/null +++ b/cjs/vega/DataSourceSpecToFutureBinding/decode.cjs @@ -0,0 +1,28 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$settlementDataProperty = ''; + let field$tradingTerminationProperty = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$settlementDataProperty = types.string(data); + break + + case 2: + field$tradingTerminationProperty = types.string(data); + break + } + } + return { + settlementDataProperty: field$settlementDataProperty, + tradingTerminationProperty: field$tradingTerminationProperty + } +} + +exports.decode = decode; diff --git a/cjs/vega/DataSourceSpecToFutureBinding/encode.cjs b/cjs/vega/DataSourceSpecToFutureBinding/encode.cjs new file mode 100644 index 0000000..29f93fb --- /dev/null +++ b/cjs/vega/DataSourceSpecToFutureBinding/encode.cjs @@ -0,0 +1,23 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.settlementDataProperty) + writer.bytes(1, obj.settlementDataProperty, types.string); + if (obj.tradingTerminationProperty) + writer.bytes(2, obj.tradingTerminationProperty, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/Delegation.cjs b/cjs/vega/Delegation.cjs new file mode 100644 index 0000000..96447c1 --- /dev/null +++ b/cjs/vega/Delegation.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./Delegation/encode.cjs'); +var decode = require('./Delegation/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/Delegation/decode.cjs b/cjs/vega/Delegation/decode.cjs new file mode 100644 index 0000000..4d50fe9 --- /dev/null +++ b/cjs/vega/Delegation/decode.cjs @@ -0,0 +1,40 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$party = ''; + let field$nodeId = ''; + let field$amount = ''; + let field$epochSeq = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$party = types.string(data); + break + + case 2: + field$nodeId = types.string(data); + break + + case 3: + field$amount = types.string(data); + break + + case 4: + field$epochSeq = types.string(data); + break + } + } + return { + party: field$party, + nodeId: field$nodeId, + amount: field$amount, + epochSeq: field$epochSeq + } +} + +exports.decode = decode; diff --git a/cjs/vega/Delegation/encode.cjs b/cjs/vega/Delegation/encode.cjs new file mode 100644 index 0000000..c630fec --- /dev/null +++ b/cjs/vega/Delegation/encode.cjs @@ -0,0 +1,23 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.party) writer.bytes(1, obj.party, types.string); + if (obj.nodeId) writer.bytes(2, obj.nodeId, types.string); + if (obj.amount) writer.bytes(3, obj.amount, types.string); + if (obj.epochSeq) writer.bytes(4, obj.epochSeq, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/Deposit.cjs b/cjs/vega/Deposit.cjs new file mode 100644 index 0000000..c862d4b --- /dev/null +++ b/cjs/vega/Deposit.cjs @@ -0,0 +1,11 @@ +'use strict'; + +var encode = require('./Deposit/encode.cjs'); +var decode = require('./Deposit/decode.cjs'); +var Status = require('./Deposit/Status.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; +exports.Status = Status; diff --git a/cjs/vega/Deposit/Status.cjs b/cjs/vega/Deposit/Status.cjs new file mode 100644 index 0000000..704e16c --- /dev/null +++ b/cjs/vega/Deposit/Status.cjs @@ -0,0 +1,74 @@ +'use strict'; + +var assert = require('nanoassert'); +var types = require('protobuf-codec/encode/types'); +var types$1 = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +const STATUS_UNSPECIFIED = 0; +const STATUS_OPEN = 1; +const STATUS_CANCELLED = 2; +const STATUS_FINALIZED = 3; + +const enumValues = new Map([ + [0, 'STATUS_UNSPECIFIED'], + [1, 'STATUS_OPEN'], + [2, 'STATUS_CANCELLED'], + [3, 'STATUS_FINALIZED'] +]); +const enumNames = new Map([ + ['STATUS_UNSPECIFIED', 0], + ['STATUS_OPEN', 1], + ['STATUS_CANCELLED', 2], + ['STATUS_FINALIZED', 3] +]); + +function encode(value, buf, byteOffset = 0) { + if (typeof value === 'string') return encode(parse(value), buf, byteOffset) + if (value == null) throw new Error('Invalid Status value (' + value + ')') + + return types.enumerable.encode(value, buf, byteOffset) +} + +function decode(varint) { + const int = types$1.enumerable(varint); + + return stringify(int) ?? int +} + +function encodingLength(value) { + if (typeof value === 'string') return encodingLength(parse(value)) + assert(value != null, 'Invalid Status value (' + value + ')'); + + if (0 <= value && value <= 3) return 1 + + // enumerable max value in case of unknown value + return 5 +} + +/** + * Convert an enum value to it's human readable name. + * Returns undefined on an unknown value. + */ +function stringify(int) { + return enumValues.get(int) +} + +/** + * Convert an enum string names to it's machine integer value. + * Returns undefined on an unknown name. + */ +function parse(str) { + return enumNames.get(str) +} + +exports.STATUS_CANCELLED = STATUS_CANCELLED; +exports.STATUS_FINALIZED = STATUS_FINALIZED; +exports.STATUS_OPEN = STATUS_OPEN; +exports.STATUS_UNSPECIFIED = STATUS_UNSPECIFIED; +exports.decode = decode; +exports.encode = encode; +exports.encodingLength = encodingLength; +exports.parse = parse; +exports.stringify = stringify; diff --git a/cjs/vega/Deposit/decode.cjs b/cjs/vega/Deposit/decode.cjs new file mode 100644 index 0000000..6fa2a6c --- /dev/null +++ b/cjs/vega/Deposit/decode.cjs @@ -0,0 +1,65 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var Status = require('./Status.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$id = ''; + let field$status = 0; + let field$partyId = ''; + let field$asset = ''; + let field$amount = ''; + let field$txHash = ''; + let field$creditedTimestamp = 0n; + let field$createdTimestamp = 0n; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$id = types.string(data); + break + + case 2: + field$status = Status.decode(data); + break + + case 3: + field$partyId = types.string(data); + break + + case 4: + field$asset = types.string(data); + break + + case 5: + field$amount = types.string(data); + break + + case 6: + field$txHash = types.string(data); + break + + case 7: + field$creditedTimestamp = types.int64(data); + break + + case 8: + field$createdTimestamp = types.int64(data); + break + } + } + return { + id: field$id, + status: field$status, + partyId: field$partyId, + asset: field$asset, + amount: field$amount, + txHash: field$txHash, + creditedTimestamp: field$creditedTimestamp, + createdTimestamp: field$createdTimestamp + } +} + +exports.decode = decode; diff --git a/cjs/vega/Deposit/encode.cjs b/cjs/vega/Deposit/encode.cjs new file mode 100644 index 0000000..b141b0b --- /dev/null +++ b/cjs/vega/Deposit/encode.cjs @@ -0,0 +1,28 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var Status = require('./Status.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.id) writer.bytes(1, obj.id, types.string); + if (obj.status) writer.varint(2, obj.status, Status); + if (obj.partyId) writer.bytes(3, obj.partyId, types.string); + if (obj.asset) writer.bytes(4, obj.asset, types.string); + if (obj.amount) writer.bytes(5, obj.amount, types.string); + if (obj.txHash) writer.bytes(6, obj.txHash, types.string); + if (obj.creditedTimestamp) writer.varint(7, obj.creditedTimestamp, types.int64); + if (obj.createdTimestamp) writer.varint(8, obj.createdTimestamp, types.int64); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/DispatchMetric.cjs b/cjs/vega/DispatchMetric.cjs new file mode 100644 index 0000000..d39a95f --- /dev/null +++ b/cjs/vega/DispatchMetric.cjs @@ -0,0 +1,79 @@ +'use strict'; + +var assert = require('nanoassert'); +var types = require('protobuf-codec/encode/types'); +var types$1 = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +const DISPATCH_METRIC_UNSPECIFIED = 0; +const DISPATCH_METRIC_MAKER_FEES_PAID = 1; +const DISPATCH_METRIC_MAKER_FEES_RECEIVED = 2; +const DISPATCH_METRIC_LP_FEES_RECEIVED = 3; +const DISPATCH_METRIC_MARKET_VALUE = 4; + +const enumValues = new Map([ + [0, 'DISPATCH_METRIC_UNSPECIFIED'], + [1, 'DISPATCH_METRIC_MAKER_FEES_PAID'], + [2, 'DISPATCH_METRIC_MAKER_FEES_RECEIVED'], + [3, 'DISPATCH_METRIC_LP_FEES_RECEIVED'], + [4, 'DISPATCH_METRIC_MARKET_VALUE'] +]); +const enumNames = new Map([ + ['DISPATCH_METRIC_UNSPECIFIED', 0], + ['DISPATCH_METRIC_MAKER_FEES_PAID', 1], + ['DISPATCH_METRIC_MAKER_FEES_RECEIVED', 2], + ['DISPATCH_METRIC_LP_FEES_RECEIVED', 3], + ['DISPATCH_METRIC_MARKET_VALUE', 4] +]); + +function encode(value, buf, byteOffset = 0) { + if (typeof value === 'string') return encode(parse(value), buf, byteOffset) + if (value == null) + throw new Error('Invalid DispatchMetric value (' + value + ')') + + return types.enumerable.encode(value, buf, byteOffset) +} + +function decode(varint) { + const int = types$1.enumerable(varint); + + return stringify(int) ?? int +} + +function encodingLength(value) { + if (typeof value === 'string') return encodingLength(parse(value)) + assert(value != null, 'Invalid DispatchMetric value (' + value + ')'); + + if (0 <= value && value <= 4) return 1 + + // enumerable max value in case of unknown value + return 5 +} + +/** + * Convert an enum value to it's human readable name. + * Returns undefined on an unknown value. + */ +function stringify(int) { + return enumValues.get(int) +} + +/** + * Convert an enum string names to it's machine integer value. + * Returns undefined on an unknown name. + */ +function parse(str) { + return enumNames.get(str) +} + +exports.DISPATCH_METRIC_LP_FEES_RECEIVED = DISPATCH_METRIC_LP_FEES_RECEIVED; +exports.DISPATCH_METRIC_MAKER_FEES_PAID = DISPATCH_METRIC_MAKER_FEES_PAID; +exports.DISPATCH_METRIC_MAKER_FEES_RECEIVED = DISPATCH_METRIC_MAKER_FEES_RECEIVED; +exports.DISPATCH_METRIC_MARKET_VALUE = DISPATCH_METRIC_MARKET_VALUE; +exports.DISPATCH_METRIC_UNSPECIFIED = DISPATCH_METRIC_UNSPECIFIED; +exports.decode = decode; +exports.encode = encode; +exports.encodingLength = encodingLength; +exports.parse = parse; +exports.stringify = stringify; diff --git a/cjs/vega/DispatchStrategy.cjs b/cjs/vega/DispatchStrategy.cjs new file mode 100644 index 0000000..32303b8 --- /dev/null +++ b/cjs/vega/DispatchStrategy.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./DispatchStrategy/encode.cjs'); +var decode = require('./DispatchStrategy/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/DispatchStrategy/decode.cjs b/cjs/vega/DispatchStrategy/decode.cjs new file mode 100644 index 0000000..36e7718 --- /dev/null +++ b/cjs/vega/DispatchStrategy/decode.cjs @@ -0,0 +1,35 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var DispatchMetric = require('../DispatchMetric.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$assetForMetric = ''; + let field$metric = 0; + const field$markets = []; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$assetForMetric = types.string(data); + break + + case 2: + field$metric = DispatchMetric.decode(data); + break + + case 3: + field$markets.push(types.string(data)); + break + } + } + return { + assetForMetric: field$assetForMetric, + metric: field$metric, + markets: field$markets + } +} + +exports.decode = decode; diff --git a/cjs/vega/DispatchStrategy/encode.cjs b/cjs/vega/DispatchStrategy/encode.cjs new file mode 100644 index 0000000..3717fc2 --- /dev/null +++ b/cjs/vega/DispatchStrategy/encode.cjs @@ -0,0 +1,24 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var DispatchMetric = require('../DispatchMetric.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.assetForMetric) writer.bytes(1, obj.assetForMetric, types.string); + if (obj.metric) writer.varint(2, obj.metric, DispatchMetric); + if (obj.markets?.length) + obj.markets.forEach((v) => writer.bytes(3, v, types.string)); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/ERC20.cjs b/cjs/vega/ERC20.cjs new file mode 100644 index 0000000..7c09ac5 --- /dev/null +++ b/cjs/vega/ERC20.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./ERC20/encode.cjs'); +var decode = require('./ERC20/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/ERC20/decode.cjs b/cjs/vega/ERC20/decode.cjs new file mode 100644 index 0000000..fcf91de --- /dev/null +++ b/cjs/vega/ERC20/decode.cjs @@ -0,0 +1,34 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$contractAddress = ''; + let field$lifetimeLimit = ''; + let field$withdrawThreshold = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$contractAddress = types.string(data); + break + + case 2: + field$lifetimeLimit = types.string(data); + break + + case 3: + field$withdrawThreshold = types.string(data); + break + } + } + return { + contractAddress: field$contractAddress, + lifetimeLimit: field$lifetimeLimit, + withdrawThreshold: field$withdrawThreshold + } +} + +exports.decode = decode; diff --git a/cjs/vega/ERC20/encode.cjs b/cjs/vega/ERC20/encode.cjs new file mode 100644 index 0000000..89da377 --- /dev/null +++ b/cjs/vega/ERC20/encode.cjs @@ -0,0 +1,22 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.contractAddress) writer.bytes(1, obj.contractAddress, types.string); + if (obj.lifetimeLimit) writer.bytes(2, obj.lifetimeLimit, types.string); + if (obj.withdrawThreshold) writer.bytes(3, obj.withdrawThreshold, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/ERC20AssetDelist.cjs b/cjs/vega/ERC20AssetDelist.cjs new file mode 100644 index 0000000..a81186b --- /dev/null +++ b/cjs/vega/ERC20AssetDelist.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./ERC20AssetDelist/encode.cjs'); +var decode = require('./ERC20AssetDelist/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/ERC20AssetDelist/decode.cjs b/cjs/vega/ERC20AssetDelist/decode.cjs new file mode 100644 index 0000000..dbc41e0 --- /dev/null +++ b/cjs/vega/ERC20AssetDelist/decode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$vegaAssetId = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$vegaAssetId = types.string(data); + break + } + } + return { vegaAssetId: field$vegaAssetId } +} + +exports.decode = decode; diff --git a/cjs/vega/ERC20AssetDelist/encode.cjs b/cjs/vega/ERC20AssetDelist/encode.cjs new file mode 100644 index 0000000..d807136 --- /dev/null +++ b/cjs/vega/ERC20AssetDelist/encode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.vegaAssetId) writer.bytes(1, obj.vegaAssetId, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/ERC20AssetLimitsUpdated.cjs b/cjs/vega/ERC20AssetLimitsUpdated.cjs new file mode 100644 index 0000000..56ce773 --- /dev/null +++ b/cjs/vega/ERC20AssetLimitsUpdated.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./ERC20AssetLimitsUpdated/encode.cjs'); +var decode = require('./ERC20AssetLimitsUpdated/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/ERC20AssetLimitsUpdated/decode.cjs b/cjs/vega/ERC20AssetLimitsUpdated/decode.cjs new file mode 100644 index 0000000..314e20e --- /dev/null +++ b/cjs/vega/ERC20AssetLimitsUpdated/decode.cjs @@ -0,0 +1,40 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$vegaAssetId = ''; + let field$sourceEthereumAddress = ''; + let field$lifetimeLimits = ''; + let field$withdrawThreshold = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$vegaAssetId = types.string(data); + break + + case 2: + field$sourceEthereumAddress = types.string(data); + break + + case 3: + field$lifetimeLimits = types.string(data); + break + + case 4: + field$withdrawThreshold = types.string(data); + break + } + } + return { + vegaAssetId: field$vegaAssetId, + sourceEthereumAddress: field$sourceEthereumAddress, + lifetimeLimits: field$lifetimeLimits, + withdrawThreshold: field$withdrawThreshold + } +} + +exports.decode = decode; diff --git a/cjs/vega/ERC20AssetLimitsUpdated/encode.cjs b/cjs/vega/ERC20AssetLimitsUpdated/encode.cjs new file mode 100644 index 0000000..2f81fb2 --- /dev/null +++ b/cjs/vega/ERC20AssetLimitsUpdated/encode.cjs @@ -0,0 +1,24 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.vegaAssetId) writer.bytes(1, obj.vegaAssetId, types.string); + if (obj.sourceEthereumAddress) + writer.bytes(2, obj.sourceEthereumAddress, types.string); + if (obj.lifetimeLimits) writer.bytes(3, obj.lifetimeLimits, types.string); + if (obj.withdrawThreshold) writer.bytes(4, obj.withdrawThreshold, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/ERC20AssetList.cjs b/cjs/vega/ERC20AssetList.cjs new file mode 100644 index 0000000..d98b05e --- /dev/null +++ b/cjs/vega/ERC20AssetList.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./ERC20AssetList/encode.cjs'); +var decode = require('./ERC20AssetList/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/ERC20AssetList/decode.cjs b/cjs/vega/ERC20AssetList/decode.cjs new file mode 100644 index 0000000..058eda8 --- /dev/null +++ b/cjs/vega/ERC20AssetList/decode.cjs @@ -0,0 +1,25 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$vegaAssetId = ''; + let field$assetSource = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$vegaAssetId = types.string(data); + break + + case 2: + field$assetSource = types.string(data); + break + } + } + return { vegaAssetId: field$vegaAssetId, assetSource: field$assetSource } +} + +exports.decode = decode; diff --git a/cjs/vega/ERC20AssetList/encode.cjs b/cjs/vega/ERC20AssetList/encode.cjs new file mode 100644 index 0000000..679abd1 --- /dev/null +++ b/cjs/vega/ERC20AssetList/encode.cjs @@ -0,0 +1,21 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.vegaAssetId) writer.bytes(1, obj.vegaAssetId, types.string); + if (obj.assetSource) writer.bytes(2, obj.assetSource, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/ERC20Deposit.cjs b/cjs/vega/ERC20Deposit.cjs new file mode 100644 index 0000000..5f17308 --- /dev/null +++ b/cjs/vega/ERC20Deposit.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./ERC20Deposit/encode.cjs'); +var decode = require('./ERC20Deposit/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/ERC20Deposit/decode.cjs b/cjs/vega/ERC20Deposit/decode.cjs new file mode 100644 index 0000000..adf04f0 --- /dev/null +++ b/cjs/vega/ERC20Deposit/decode.cjs @@ -0,0 +1,40 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$vegaAssetId = ''; + let field$sourceEthereumAddress = ''; + let field$targetPartyId = ''; + let field$amount = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$vegaAssetId = types.string(data); + break + + case 2: + field$sourceEthereumAddress = types.string(data); + break + + case 3: + field$targetPartyId = types.string(data); + break + + case 4: + field$amount = types.string(data); + break + } + } + return { + vegaAssetId: field$vegaAssetId, + sourceEthereumAddress: field$sourceEthereumAddress, + targetPartyId: field$targetPartyId, + amount: field$amount + } +} + +exports.decode = decode; diff --git a/cjs/vega/ERC20Deposit/encode.cjs b/cjs/vega/ERC20Deposit/encode.cjs new file mode 100644 index 0000000..afd29fb --- /dev/null +++ b/cjs/vega/ERC20Deposit/encode.cjs @@ -0,0 +1,24 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.vegaAssetId) writer.bytes(1, obj.vegaAssetId, types.string); + if (obj.sourceEthereumAddress) + writer.bytes(2, obj.sourceEthereumAddress, types.string); + if (obj.targetPartyId) writer.bytes(3, obj.targetPartyId, types.string); + if (obj.amount) writer.bytes(4, obj.amount, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/ERC20Event.cjs b/cjs/vega/ERC20Event.cjs new file mode 100644 index 0000000..64d8ed6 --- /dev/null +++ b/cjs/vega/ERC20Event.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./ERC20Event/encode.cjs'); +var decode = require('./ERC20Event/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/ERC20Event/decode.cjs b/cjs/vega/ERC20Event/decode.cjs new file mode 100644 index 0000000..5ba2a0f --- /dev/null +++ b/cjs/vega/ERC20Event/decode.cjs @@ -0,0 +1,61 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$5 = require('../ERC20AssetList/decode.cjs'); +var decode$4 = require('../ERC20AssetDelist/decode.cjs'); +var decode$3 = require('../ERC20Deposit/decode.cjs'); +var decode$2 = require('../ERC20Withdrawal/decode.cjs'); +var decode$1 = require('../ERC20AssetLimitsUpdated/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$index = 0n; + let field$block = 0n; + let field$action = null; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$index = types.uint64(data); + break + + case 2: + field$block = types.uint64(data); + break + + case 1001: + field$action = { assetList: decode$5.decode(data) }; + break + + case 1002: + field$action = { assetDelist: decode$4.decode(data) }; + break + + case 1003: + field$action = { deposit: decode$3.decode(data) }; + break + + case 1004: + field$action = { withdrawal: decode$2.decode(data) }; + break + + case 1005: + field$action = { + assetLimitsUpdated: decode$1.decode(data) + }; + break + + case 1006: + field$action = { bridgeStopped: types.bool(data) }; + break + + case 1007: + field$action = { bridgeResumed: types.bool(data) }; + break + } + } + return { index: field$index, block: field$block, action: field$action } +} + +exports.decode = decode; diff --git a/cjs/vega/ERC20Event/encode.cjs b/cjs/vega/ERC20Event/encode.cjs new file mode 100644 index 0000000..6de92c0 --- /dev/null +++ b/cjs/vega/ERC20Event/encode.cjs @@ -0,0 +1,58 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../ERC20AssetList/encode.cjs'); +var encode$2 = require('../ERC20AssetDelist/encode.cjs'); +var encode$3 = require('../ERC20Deposit/encode.cjs'); +var encode$4 = require('../ERC20Withdrawal/encode.cjs'); +var encode$5 = require('../ERC20AssetLimitsUpdated/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.index) writer.varint(1, obj.index, types.uint64); + if (obj.block) writer.varint(2, obj.block, types.uint64); + + if (obj.action?.assetList ?? obj.assetList) + writer.bytes( + 1001, + encode$1.encode(obj.action?.assetList ?? obj.assetList) + ); + if (obj.action?.assetDelist ?? obj.assetDelist) + writer.bytes( + 1002, + encode$2.encode(obj.action?.assetDelist ?? obj.assetDelist) + ); + if (obj.action?.deposit ?? obj.deposit) + writer.bytes( + 1003, + encode$3.encode(obj.action?.deposit ?? obj.deposit) + ); + if (obj.action?.withdrawal ?? obj.withdrawal) + writer.bytes( + 1004, + encode$4.encode(obj.action?.withdrawal ?? obj.withdrawal) + ); + if (obj.action?.assetLimitsUpdated ?? obj.assetLimitsUpdated) + writer.bytes( + 1005, + encode$5.encode( + obj.action?.assetLimitsUpdated ?? obj.assetLimitsUpdated + ) + ); + if (obj.action?.bridgeStopped ?? obj.bridgeStopped) + writer.varint(1006, obj.action?.bridgeStopped ?? obj.bridgeStopped, types.bool); + if (obj.action?.bridgeResumed ?? obj.bridgeResumed) + writer.varint(1007, obj.action?.bridgeResumed ?? obj.bridgeResumed, types.bool); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/ERC20MultiSigEvent.cjs b/cjs/vega/ERC20MultiSigEvent.cjs new file mode 100644 index 0000000..077c601 --- /dev/null +++ b/cjs/vega/ERC20MultiSigEvent.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./ERC20MultiSigEvent/encode.cjs'); +var decode = require('./ERC20MultiSigEvent/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/ERC20MultiSigEvent/decode.cjs b/cjs/vega/ERC20MultiSigEvent/decode.cjs new file mode 100644 index 0000000..f1db012 --- /dev/null +++ b/cjs/vega/ERC20MultiSigEvent/decode.cjs @@ -0,0 +1,41 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$3 = require('../ERC20SignerAdded/decode.cjs'); +var decode$2 = require('../ERC20SignerRemoved/decode.cjs'); +var decode$1 = require('../ERC20ThresholdSet/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$index = 0n; + let field$block = 0n; + let field$action = null; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$index = types.uint64(data); + break + + case 2: + field$block = types.uint64(data); + break + + case 1001: + field$action = { signerAdded: decode$3.decode(data) }; + break + + case 1002: + field$action = { signerRemoved: decode$2.decode(data) }; + break + + case 1003: + field$action = { thresholdSet: decode$1.decode(data) }; + break + } + } + return { index: field$index, block: field$block, action: field$action } +} + +exports.decode = decode; diff --git a/cjs/vega/ERC20MultiSigEvent/encode.cjs b/cjs/vega/ERC20MultiSigEvent/encode.cjs new file mode 100644 index 0000000..396b06a --- /dev/null +++ b/cjs/vega/ERC20MultiSigEvent/encode.cjs @@ -0,0 +1,44 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../ERC20SignerAdded/encode.cjs'); +var encode$2 = require('../ERC20SignerRemoved/encode.cjs'); +var encode$3 = require('../ERC20ThresholdSet/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.index) writer.varint(1, obj.index, types.uint64); + if (obj.block) writer.varint(2, obj.block, types.uint64); + + if (obj.action?.signerAdded ?? obj.signerAdded) + writer.bytes( + 1001, + encode$1.encode(obj.action?.signerAdded ?? obj.signerAdded) + ); + if (obj.action?.signerRemoved ?? obj.signerRemoved) + writer.bytes( + 1002, + encode$2.encode( + obj.action?.signerRemoved ?? obj.signerRemoved + ) + ); + if (obj.action?.thresholdSet ?? obj.thresholdSet) + writer.bytes( + 1003, + encode$3.encode( + obj.action?.thresholdSet ?? obj.thresholdSet + ) + ); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/ERC20SignerAdded.cjs b/cjs/vega/ERC20SignerAdded.cjs new file mode 100644 index 0000000..5cac6f9 --- /dev/null +++ b/cjs/vega/ERC20SignerAdded.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./ERC20SignerAdded/encode.cjs'); +var decode = require('./ERC20SignerAdded/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/ERC20SignerAdded/decode.cjs b/cjs/vega/ERC20SignerAdded/decode.cjs new file mode 100644 index 0000000..8681993 --- /dev/null +++ b/cjs/vega/ERC20SignerAdded/decode.cjs @@ -0,0 +1,34 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$newSigner = ''; + let field$nonce = ''; + let field$blockTime = 0n; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$newSigner = types.string(data); + break + + case 2: + field$nonce = types.string(data); + break + + case 3: + field$blockTime = types.int64(data); + break + } + } + return { + newSigner: field$newSigner, + nonce: field$nonce, + blockTime: field$blockTime + } +} + +exports.decode = decode; diff --git a/cjs/vega/ERC20SignerAdded/encode.cjs b/cjs/vega/ERC20SignerAdded/encode.cjs new file mode 100644 index 0000000..dad24bd --- /dev/null +++ b/cjs/vega/ERC20SignerAdded/encode.cjs @@ -0,0 +1,22 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.newSigner) writer.bytes(1, obj.newSigner, types.string); + if (obj.nonce) writer.bytes(2, obj.nonce, types.string); + if (obj.blockTime) writer.varint(3, obj.blockTime, types.int64); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/ERC20SignerRemoved.cjs b/cjs/vega/ERC20SignerRemoved.cjs new file mode 100644 index 0000000..38d1d90 --- /dev/null +++ b/cjs/vega/ERC20SignerRemoved.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./ERC20SignerRemoved/encode.cjs'); +var decode = require('./ERC20SignerRemoved/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/ERC20SignerRemoved/decode.cjs b/cjs/vega/ERC20SignerRemoved/decode.cjs new file mode 100644 index 0000000..1689e4a --- /dev/null +++ b/cjs/vega/ERC20SignerRemoved/decode.cjs @@ -0,0 +1,34 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$oldSigner = ''; + let field$nonce = ''; + let field$blockTime = 0n; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$oldSigner = types.string(data); + break + + case 2: + field$nonce = types.string(data); + break + + case 3: + field$blockTime = types.int64(data); + break + } + } + return { + oldSigner: field$oldSigner, + nonce: field$nonce, + blockTime: field$blockTime + } +} + +exports.decode = decode; diff --git a/cjs/vega/ERC20SignerRemoved/encode.cjs b/cjs/vega/ERC20SignerRemoved/encode.cjs new file mode 100644 index 0000000..e38a157 --- /dev/null +++ b/cjs/vega/ERC20SignerRemoved/encode.cjs @@ -0,0 +1,22 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.oldSigner) writer.bytes(1, obj.oldSigner, types.string); + if (obj.nonce) writer.bytes(2, obj.nonce, types.string); + if (obj.blockTime) writer.varint(3, obj.blockTime, types.int64); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/ERC20ThresholdSet.cjs b/cjs/vega/ERC20ThresholdSet.cjs new file mode 100644 index 0000000..765228a --- /dev/null +++ b/cjs/vega/ERC20ThresholdSet.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./ERC20ThresholdSet/encode.cjs'); +var decode = require('./ERC20ThresholdSet/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/ERC20ThresholdSet/decode.cjs b/cjs/vega/ERC20ThresholdSet/decode.cjs new file mode 100644 index 0000000..6b2a9f9 --- /dev/null +++ b/cjs/vega/ERC20ThresholdSet/decode.cjs @@ -0,0 +1,34 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$newThreshold = 0; + let field$nonce = ''; + let field$blockTime = 0n; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$newThreshold = types.uint32(data); + break + + case 2: + field$nonce = types.string(data); + break + + case 3: + field$blockTime = types.int64(data); + break + } + } + return { + newThreshold: field$newThreshold, + nonce: field$nonce, + blockTime: field$blockTime + } +} + +exports.decode = decode; diff --git a/cjs/vega/ERC20ThresholdSet/encode.cjs b/cjs/vega/ERC20ThresholdSet/encode.cjs new file mode 100644 index 0000000..5ae7d68 --- /dev/null +++ b/cjs/vega/ERC20ThresholdSet/encode.cjs @@ -0,0 +1,22 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.newThreshold) writer.varint(1, obj.newThreshold, types.uint32); + if (obj.nonce) writer.bytes(2, obj.nonce, types.string); + if (obj.blockTime) writer.varint(3, obj.blockTime, types.int64); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/ERC20Update.cjs b/cjs/vega/ERC20Update.cjs new file mode 100644 index 0000000..36c7631 --- /dev/null +++ b/cjs/vega/ERC20Update.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./ERC20Update/encode.cjs'); +var decode = require('./ERC20Update/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/ERC20Update/decode.cjs b/cjs/vega/ERC20Update/decode.cjs new file mode 100644 index 0000000..8f75cfe --- /dev/null +++ b/cjs/vega/ERC20Update/decode.cjs @@ -0,0 +1,28 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$lifetimeLimit = ''; + let field$withdrawThreshold = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$lifetimeLimit = types.string(data); + break + + case 2: + field$withdrawThreshold = types.string(data); + break + } + } + return { + lifetimeLimit: field$lifetimeLimit, + withdrawThreshold: field$withdrawThreshold + } +} + +exports.decode = decode; diff --git a/cjs/vega/ERC20Update/encode.cjs b/cjs/vega/ERC20Update/encode.cjs new file mode 100644 index 0000000..e512c2b --- /dev/null +++ b/cjs/vega/ERC20Update/encode.cjs @@ -0,0 +1,21 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.lifetimeLimit) writer.bytes(1, obj.lifetimeLimit, types.string); + if (obj.withdrawThreshold) writer.bytes(2, obj.withdrawThreshold, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/ERC20Withdrawal.cjs b/cjs/vega/ERC20Withdrawal.cjs new file mode 100644 index 0000000..8cedbe5 --- /dev/null +++ b/cjs/vega/ERC20Withdrawal.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./ERC20Withdrawal/encode.cjs'); +var decode = require('./ERC20Withdrawal/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/ERC20Withdrawal/decode.cjs b/cjs/vega/ERC20Withdrawal/decode.cjs new file mode 100644 index 0000000..0490cb4 --- /dev/null +++ b/cjs/vega/ERC20Withdrawal/decode.cjs @@ -0,0 +1,34 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$vegaAssetId = ''; + let field$targetEthereumAddress = ''; + let field$referenceNonce = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$vegaAssetId = types.string(data); + break + + case 2: + field$targetEthereumAddress = types.string(data); + break + + case 3: + field$referenceNonce = types.string(data); + break + } + } + return { + vegaAssetId: field$vegaAssetId, + targetEthereumAddress: field$targetEthereumAddress, + referenceNonce: field$referenceNonce + } +} + +exports.decode = decode; diff --git a/cjs/vega/ERC20Withdrawal/encode.cjs b/cjs/vega/ERC20Withdrawal/encode.cjs new file mode 100644 index 0000000..20ff65e --- /dev/null +++ b/cjs/vega/ERC20Withdrawal/encode.cjs @@ -0,0 +1,23 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.vegaAssetId) writer.bytes(1, obj.vegaAssetId, types.string); + if (obj.targetEthereumAddress) + writer.bytes(2, obj.targetEthereumAddress, types.string); + if (obj.referenceNonce) writer.bytes(3, obj.referenceNonce, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/Epoch.cjs b/cjs/vega/Epoch.cjs new file mode 100644 index 0000000..012e9a0 --- /dev/null +++ b/cjs/vega/Epoch.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./Epoch/encode.cjs'); +var decode = require('./Epoch/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/Epoch/decode.cjs b/cjs/vega/Epoch/decode.cjs new file mode 100644 index 0000000..4f4063d --- /dev/null +++ b/cjs/vega/Epoch/decode.cjs @@ -0,0 +1,43 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$3 = require('../EpochTimestamps/decode.cjs'); +var decode$2 = require('../Node/decode.cjs'); +var decode$1 = require('../Delegation/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$seq = 0n; + let field$timestamps = {}; + const field$validators = []; + const field$delegations = []; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$seq = types.uint64(data); + break + + case 2: + field$timestamps = decode$3.decode(data); + break + + case 3: + field$validators.push(decode$2.decode(data)); + break + + case 4: + field$delegations.push(decode$1.decode(data)); + break + } + } + return { + seq: field$seq, + timestamps: field$timestamps, + validators: field$validators, + delegations: field$delegations + } +} + +exports.decode = decode; diff --git a/cjs/vega/Epoch/encode.cjs b/cjs/vega/Epoch/encode.cjs new file mode 100644 index 0000000..07bdfcf --- /dev/null +++ b/cjs/vega/Epoch/encode.cjs @@ -0,0 +1,29 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../EpochTimestamps/encode.cjs'); +var encode$2 = require('../Node/encode.cjs'); +var encode$3 = require('../Delegation/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.seq) writer.varint(1, obj.seq, types.uint64); + if (obj.timestamps) + writer.bytes(2, encode$1.encode(obj.timestamps)); + if (obj.validators?.length) + obj.validators.forEach((v) => writer.bytes(3, encode$2.encode(v))); + if (obj.delegations?.length) + obj.delegations.forEach((v) => writer.bytes(4, encode$3.encode(v))); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/EpochAction.cjs b/cjs/vega/EpochAction.cjs new file mode 100644 index 0000000..53171f2 --- /dev/null +++ b/cjs/vega/EpochAction.cjs @@ -0,0 +1,71 @@ +'use strict'; + +var assert = require('nanoassert'); +var types = require('protobuf-codec/encode/types'); +var types$1 = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +const EPOCH_ACTION_UNSPECIFIED = 0; +const EPOCH_ACTION_START = 1; +const EPOCH_ACTION_END = 2; + +const enumValues = new Map([ + [0, 'EPOCH_ACTION_UNSPECIFIED'], + [1, 'EPOCH_ACTION_START'], + [2, 'EPOCH_ACTION_END'] +]); +const enumNames = new Map([ + ['EPOCH_ACTION_UNSPECIFIED', 0], + ['EPOCH_ACTION_START', 1], + ['EPOCH_ACTION_END', 2] +]); + +function encode(value, buf, byteOffset = 0) { + if (typeof value === 'string') return encode(parse(value), buf, byteOffset) + if (value == null) + throw new Error('Invalid EpochAction value (' + value + ')') + + return types.enumerable.encode(value, buf, byteOffset) +} + +function decode(varint) { + const int = types$1.enumerable(varint); + + return stringify(int) ?? int +} + +function encodingLength(value) { + if (typeof value === 'string') return encodingLength(parse(value)) + assert(value != null, 'Invalid EpochAction value (' + value + ')'); + + if (0 <= value && value <= 2) return 1 + + // enumerable max value in case of unknown value + return 5 +} + +/** + * Convert an enum value to it's human readable name. + * Returns undefined on an unknown value. + */ +function stringify(int) { + return enumValues.get(int) +} + +/** + * Convert an enum string names to it's machine integer value. + * Returns undefined on an unknown name. + */ +function parse(str) { + return enumNames.get(str) +} + +exports.EPOCH_ACTION_END = EPOCH_ACTION_END; +exports.EPOCH_ACTION_START = EPOCH_ACTION_START; +exports.EPOCH_ACTION_UNSPECIFIED = EPOCH_ACTION_UNSPECIFIED; +exports.decode = decode; +exports.encode = encode; +exports.encodingLength = encodingLength; +exports.parse = parse; +exports.stringify = stringify; diff --git a/cjs/vega/EpochData.cjs b/cjs/vega/EpochData.cjs new file mode 100644 index 0000000..637ff9b --- /dev/null +++ b/cjs/vega/EpochData.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./EpochData/encode.cjs'); +var decode = require('./EpochData/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/EpochData/decode.cjs b/cjs/vega/EpochData/decode.cjs new file mode 100644 index 0000000..be1cf89 --- /dev/null +++ b/cjs/vega/EpochData/decode.cjs @@ -0,0 +1,30 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$total = 0; + let field$offline = 0; + let field$online = 0; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$total = types.int32(data); + break + + case 2: + field$offline = types.int32(data); + break + + case 3: + field$online = types.int32(data); + break + } + } + return { total: field$total, offline: field$offline, online: field$online } +} + +exports.decode = decode; diff --git a/cjs/vega/EpochData/encode.cjs b/cjs/vega/EpochData/encode.cjs new file mode 100644 index 0000000..6e2da20 --- /dev/null +++ b/cjs/vega/EpochData/encode.cjs @@ -0,0 +1,22 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.total) writer.varint(1, obj.total, types.int32); + if (obj.offline) writer.varint(2, obj.offline, types.int32); + if (obj.online) writer.varint(3, obj.online, types.int32); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/EpochParticipation.cjs b/cjs/vega/EpochParticipation.cjs new file mode 100644 index 0000000..95e8101 --- /dev/null +++ b/cjs/vega/EpochParticipation.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./EpochParticipation/encode.cjs'); +var decode = require('./EpochParticipation/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/EpochParticipation/decode.cjs b/cjs/vega/EpochParticipation/decode.cjs new file mode 100644 index 0000000..1f40593 --- /dev/null +++ b/cjs/vega/EpochParticipation/decode.cjs @@ -0,0 +1,41 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$1 = require('../Epoch/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$epoch = {}; + let field$offline = 0n; + let field$online = 0n; + let field$totalRewards = 0; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$epoch = decode$1.decode(data); + break + + case 2: + field$offline = types.uint64(data); + break + + case 3: + field$online = types.uint64(data); + break + + case 4: + field$totalRewards = types.double(data); + break + } + } + return { + epoch: field$epoch, + offline: field$offline, + online: field$online, + totalRewards: field$totalRewards + } +} + +exports.decode = decode; diff --git a/cjs/vega/EpochParticipation/encode.cjs b/cjs/vega/EpochParticipation/encode.cjs new file mode 100644 index 0000000..b87bf68 --- /dev/null +++ b/cjs/vega/EpochParticipation/encode.cjs @@ -0,0 +1,24 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../Epoch/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.epoch) writer.bytes(1, encode$1.encode(obj.epoch)); + if (obj.offline) writer.varint(2, obj.offline, types.uint64); + if (obj.online) writer.varint(3, obj.online, types.uint64); + if (obj.totalRewards) writer.fixed64(4, obj.totalRewards, types.double); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/EpochRewardSummary.cjs b/cjs/vega/EpochRewardSummary.cjs new file mode 100644 index 0000000..5da3bae --- /dev/null +++ b/cjs/vega/EpochRewardSummary.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./EpochRewardSummary/encode.cjs'); +var decode = require('./EpochRewardSummary/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/EpochRewardSummary/decode.cjs b/cjs/vega/EpochRewardSummary/decode.cjs new file mode 100644 index 0000000..55c055d --- /dev/null +++ b/cjs/vega/EpochRewardSummary/decode.cjs @@ -0,0 +1,46 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$epoch = 0n; + let field$assetId = ''; + let field$marketId = ''; + let field$rewardType = ''; + let field$amount = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$epoch = types.uint64(data); + break + + case 2: + field$assetId = types.string(data); + break + + case 3: + field$marketId = types.string(data); + break + + case 4: + field$rewardType = types.string(data); + break + + case 5: + field$amount = types.string(data); + break + } + } + return { + epoch: field$epoch, + assetId: field$assetId, + marketId: field$marketId, + rewardType: field$rewardType, + amount: field$amount + } +} + +exports.decode = decode; diff --git a/cjs/vega/EpochRewardSummary/encode.cjs b/cjs/vega/EpochRewardSummary/encode.cjs new file mode 100644 index 0000000..45fafad --- /dev/null +++ b/cjs/vega/EpochRewardSummary/encode.cjs @@ -0,0 +1,24 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.epoch) writer.varint(1, obj.epoch, types.uint64); + if (obj.assetId) writer.bytes(2, obj.assetId, types.string); + if (obj.marketId) writer.bytes(3, obj.marketId, types.string); + if (obj.rewardType) writer.bytes(4, obj.rewardType, types.string); + if (obj.amount) writer.bytes(5, obj.amount, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/EpochTimestamps.cjs b/cjs/vega/EpochTimestamps.cjs new file mode 100644 index 0000000..55fe33c --- /dev/null +++ b/cjs/vega/EpochTimestamps.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./EpochTimestamps/encode.cjs'); +var decode = require('./EpochTimestamps/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/EpochTimestamps/decode.cjs b/cjs/vega/EpochTimestamps/decode.cjs new file mode 100644 index 0000000..2d8e53d --- /dev/null +++ b/cjs/vega/EpochTimestamps/decode.cjs @@ -0,0 +1,46 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$startTime = 0n; + let field$expiryTime = 0n; + let field$endTime = 0n; + let field$firstBlock = 0n; + let field$lastBlock = 0n; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$startTime = types.int64(data); + break + + case 2: + field$expiryTime = types.int64(data); + break + + case 3: + field$endTime = types.int64(data); + break + + case 4: + field$firstBlock = types.uint64(data); + break + + case 5: + field$lastBlock = types.uint64(data); + break + } + } + return { + startTime: field$startTime, + expiryTime: field$expiryTime, + endTime: field$endTime, + firstBlock: field$firstBlock, + lastBlock: field$lastBlock + } +} + +exports.decode = decode; diff --git a/cjs/vega/EpochTimestamps/encode.cjs b/cjs/vega/EpochTimestamps/encode.cjs new file mode 100644 index 0000000..8da6b3c --- /dev/null +++ b/cjs/vega/EpochTimestamps/encode.cjs @@ -0,0 +1,24 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.startTime) writer.varint(1, obj.startTime, types.int64); + if (obj.expiryTime) writer.varint(2, obj.expiryTime, types.int64); + if (obj.endTime) writer.varint(3, obj.endTime, types.int64); + if (obj.firstBlock) writer.varint(4, obj.firstBlock, types.uint64); + if (obj.lastBlock) writer.varint(5, obj.lastBlock, types.uint64); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/Erc20WithdrawExt.cjs b/cjs/vega/Erc20WithdrawExt.cjs new file mode 100644 index 0000000..41024f0 --- /dev/null +++ b/cjs/vega/Erc20WithdrawExt.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./Erc20WithdrawExt/encode.cjs'); +var decode = require('./Erc20WithdrawExt/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/Erc20WithdrawExt/decode.cjs b/cjs/vega/Erc20WithdrawExt/decode.cjs new file mode 100644 index 0000000..1049697 --- /dev/null +++ b/cjs/vega/Erc20WithdrawExt/decode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$receiverAddress = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$receiverAddress = types.string(data); + break + } + } + return { receiverAddress: field$receiverAddress } +} + +exports.decode = decode; diff --git a/cjs/vega/Erc20WithdrawExt/encode.cjs b/cjs/vega/Erc20WithdrawExt/encode.cjs new file mode 100644 index 0000000..d840a6d --- /dev/null +++ b/cjs/vega/Erc20WithdrawExt/encode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.receiverAddress) writer.bytes(1, obj.receiverAddress, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/ErrorDetail.cjs b/cjs/vega/ErrorDetail.cjs new file mode 100644 index 0000000..a5343fa --- /dev/null +++ b/cjs/vega/ErrorDetail.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./ErrorDetail/encode.cjs'); +var decode = require('./ErrorDetail/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/ErrorDetail/decode.cjs b/cjs/vega/ErrorDetail/decode.cjs new file mode 100644 index 0000000..949f137 --- /dev/null +++ b/cjs/vega/ErrorDetail/decode.cjs @@ -0,0 +1,30 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$code = 0; + let field$message = ''; + let field$inner = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$code = types.int32(data); + break + + case 2: + field$message = types.string(data); + break + + case 3: + field$inner = types.string(data); + break + } + } + return { code: field$code, message: field$message, inner: field$inner } +} + +exports.decode = decode; diff --git a/cjs/vega/ErrorDetail/encode.cjs b/cjs/vega/ErrorDetail/encode.cjs new file mode 100644 index 0000000..1c9330e --- /dev/null +++ b/cjs/vega/ErrorDetail/encode.cjs @@ -0,0 +1,22 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.code) writer.varint(1, obj.code, types.int32); + if (obj.message) writer.bytes(2, obj.message, types.string); + if (obj.inner) writer.bytes(3, obj.inner, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/EthCallSpec.cjs b/cjs/vega/EthCallSpec.cjs new file mode 100644 index 0000000..aecc83f --- /dev/null +++ b/cjs/vega/EthCallSpec.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./EthCallSpec/encode.cjs'); +var decode = require('./EthCallSpec/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/EthCallSpec/decode.cjs b/cjs/vega/EthCallSpec/decode.cjs new file mode 100644 index 0000000..6a31cbe --- /dev/null +++ b/cjs/vega/EthCallSpec/decode.cjs @@ -0,0 +1,49 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$3 = require('../../google/protobuf/ListValue/decode.cjs'); +var decode$2 = require('../../google/protobuf/Value/decode.cjs'); +var decode$1 = require('../EthCallTrigger/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$address = ''; + let field$abi = {}; + let field$method = ''; + const field$args = []; + let field$trigger = {}; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$address = types.string(data); + break + + case 2: + field$abi = decode$3.decode(data); + break + + case 3: + field$method = types.string(data); + break + + case 4: + field$args.push(decode$2.decode(data)); + break + + case 5: + field$trigger = decode$1.decode(data); + break + } + } + return { + address: field$address, + abi: field$abi, + method: field$method, + args: field$args, + trigger: field$trigger + } +} + +exports.decode = decode; diff --git a/cjs/vega/EthCallSpec/encode.cjs b/cjs/vega/EthCallSpec/encode.cjs new file mode 100644 index 0000000..ba6d4b9 --- /dev/null +++ b/cjs/vega/EthCallSpec/encode.cjs @@ -0,0 +1,28 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../../google/protobuf/ListValue/encode.cjs'); +var encode$2 = require('../../google/protobuf/Value/encode.cjs'); +var encode$3 = require('../EthCallTrigger/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.address) writer.bytes(1, obj.address, types.string); + if (obj.abi) writer.bytes(2, encode$1.encode(obj.abi)); + if (obj.method) writer.bytes(3, obj.method, types.string); + if (obj.args?.length) + obj.args.forEach((v) => writer.bytes(4, encode$2.encode(v))); + if (obj.trigger) writer.bytes(5, encode$3.encode(obj.trigger)); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/EthCallTrigger.cjs b/cjs/vega/EthCallTrigger.cjs new file mode 100644 index 0000000..0d3c308 --- /dev/null +++ b/cjs/vega/EthCallTrigger.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./EthCallTrigger/encode.cjs'); +var decode = require('./EthCallTrigger/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/EthCallTrigger/decode.cjs b/cjs/vega/EthCallTrigger/decode.cjs new file mode 100644 index 0000000..87cb0ea --- /dev/null +++ b/cjs/vega/EthCallTrigger/decode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var decode$1 = require('../EthTimeTrigger/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$trigger = null; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$trigger = { timeTrigger: decode$1.decode(data) }; + break + } + } + return { trigger: field$trigger } +} + +exports.decode = decode; diff --git a/cjs/vega/EthCallTrigger/encode.cjs b/cjs/vega/EthCallTrigger/encode.cjs new file mode 100644 index 0000000..b152d4a --- /dev/null +++ b/cjs/vega/EthCallTrigger/encode.cjs @@ -0,0 +1,24 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var encode$1 = require('../EthTimeTrigger/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.trigger?.timeTrigger ?? obj.timeTrigger) + writer.bytes( + 1, + encode$1.encode(obj.trigger?.timeTrigger ?? obj.timeTrigger) + ); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/EthContractCallEvent.cjs b/cjs/vega/EthContractCallEvent.cjs new file mode 100644 index 0000000..36d1291 --- /dev/null +++ b/cjs/vega/EthContractCallEvent.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./EthContractCallEvent/encode.cjs'); +var decode = require('./EthContractCallEvent/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/EthContractCallEvent/decode.cjs b/cjs/vega/EthContractCallEvent/decode.cjs new file mode 100644 index 0000000..0b9d883 --- /dev/null +++ b/cjs/vega/EthContractCallEvent/decode.cjs @@ -0,0 +1,40 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$specId = ''; + let field$blockHeight = 0n; + let field$blockTime = 0n; + let field$result = new Uint8Array(0); + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$specId = types.string(data); + break + + case 2: + field$blockHeight = types.uint64(data); + break + + case 3: + field$blockTime = types.uint64(data); + break + + case 4: + field$result = types.bytes(data); + break + } + } + return { + specId: field$specId, + blockHeight: field$blockHeight, + blockTime: field$blockTime, + result: field$result + } +} + +exports.decode = decode; diff --git a/cjs/vega/EthContractCallEvent/encode.cjs b/cjs/vega/EthContractCallEvent/encode.cjs new file mode 100644 index 0000000..c085c25 --- /dev/null +++ b/cjs/vega/EthContractCallEvent/encode.cjs @@ -0,0 +1,23 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.specId) writer.bytes(1, obj.specId, types.string); + if (obj.blockHeight) writer.varint(2, obj.blockHeight, types.uint64); + if (obj.blockTime) writer.varint(3, obj.blockTime, types.uint64); + if (obj.result) writer.bytes(4, obj.result, types.bytes); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/EthTimeTrigger.cjs b/cjs/vega/EthTimeTrigger.cjs new file mode 100644 index 0000000..7e834ab --- /dev/null +++ b/cjs/vega/EthTimeTrigger.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./EthTimeTrigger/encode.cjs'); +var decode = require('./EthTimeTrigger/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/EthTimeTrigger/decode.cjs b/cjs/vega/EthTimeTrigger/decode.cjs new file mode 100644 index 0000000..bf59121 --- /dev/null +++ b/cjs/vega/EthTimeTrigger/decode.cjs @@ -0,0 +1,30 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$initial = null; + let field$every = null; + let field$until = null; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$initial = types.uint64(data); + break + + case 2: + field$every = types.uint64(data); + break + + case 3: + field$until = types.uint64(data); + break + } + } + return { initial: field$initial, every: field$every, until: field$until } +} + +exports.decode = decode; diff --git a/cjs/vega/EthTimeTrigger/encode.cjs b/cjs/vega/EthTimeTrigger/encode.cjs new file mode 100644 index 0000000..c628f7a --- /dev/null +++ b/cjs/vega/EthTimeTrigger/encode.cjs @@ -0,0 +1,22 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.initial) writer.varint(1, obj.initial, types.uint64); + if (obj.every) writer.varint(2, obj.every, types.uint64); + if (obj.until) writer.varint(3, obj.until, types.uint64); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/EthereumConfig.cjs b/cjs/vega/EthereumConfig.cjs new file mode 100644 index 0000000..49846a2 --- /dev/null +++ b/cjs/vega/EthereumConfig.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./EthereumConfig/encode.cjs'); +var decode = require('./EthereumConfig/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/EthereumConfig/decode.cjs b/cjs/vega/EthereumConfig/decode.cjs new file mode 100644 index 0000000..f4053a5 --- /dev/null +++ b/cjs/vega/EthereumConfig/decode.cjs @@ -0,0 +1,61 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$1 = require('../EthereumContractConfig/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$networkId = ''; + let field$chainId = ''; + let field$collateralBridgeContract = {}; + let field$confirmations = 0; + let field$stakingBridgeContract = {}; + let field$tokenVestingContract = {}; + let field$multisigControlContract = {}; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$networkId = types.string(data); + break + + case 2: + field$chainId = types.string(data); + break + + case 3: + field$collateralBridgeContract = + decode$1.decode(data); + break + + case 4: + field$confirmations = types.uint32(data); + break + + case 5: + field$stakingBridgeContract = decode$1.decode(data); + break + + case 6: + field$tokenVestingContract = decode$1.decode(data); + break + + case 7: + field$multisigControlContract = + decode$1.decode(data); + break + } + } + return { + networkId: field$networkId, + chainId: field$chainId, + collateralBridgeContract: field$collateralBridgeContract, + confirmations: field$confirmations, + stakingBridgeContract: field$stakingBridgeContract, + tokenVestingContract: field$tokenVestingContract, + multisigControlContract: field$multisigControlContract + } +} + +exports.decode = decode; diff --git a/cjs/vega/EthereumConfig/encode.cjs b/cjs/vega/EthereumConfig/encode.cjs new file mode 100644 index 0000000..ac2e392 --- /dev/null +++ b/cjs/vega/EthereumConfig/encode.cjs @@ -0,0 +1,43 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../EthereumContractConfig/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.networkId) writer.bytes(1, obj.networkId, types.string); + if (obj.chainId) writer.bytes(2, obj.chainId, types.string); + if (obj.collateralBridgeContract) + writer.bytes( + 3, + encode$1.encode(obj.collateralBridgeContract) + ); + if (obj.confirmations) writer.varint(4, obj.confirmations, types.uint32); + if (obj.stakingBridgeContract) + writer.bytes( + 5, + encode$1.encode(obj.stakingBridgeContract) + ); + if (obj.tokenVestingContract) + writer.bytes( + 6, + encode$1.encode(obj.tokenVestingContract) + ); + if (obj.multisigControlContract) + writer.bytes( + 7, + encode$1.encode(obj.multisigControlContract) + ); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/EthereumContractConfig.cjs b/cjs/vega/EthereumContractConfig.cjs new file mode 100644 index 0000000..2035bf8 --- /dev/null +++ b/cjs/vega/EthereumContractConfig.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./EthereumContractConfig/encode.cjs'); +var decode = require('./EthereumContractConfig/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/EthereumContractConfig/decode.cjs b/cjs/vega/EthereumContractConfig/decode.cjs new file mode 100644 index 0000000..45fe1b8 --- /dev/null +++ b/cjs/vega/EthereumContractConfig/decode.cjs @@ -0,0 +1,28 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$address = ''; + let field$deploymentBlockHeight = 0n; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$address = types.string(data); + break + + case 6: + field$deploymentBlockHeight = types.uint64(data); + break + } + } + return { + address: field$address, + deploymentBlockHeight: field$deploymentBlockHeight + } +} + +exports.decode = decode; diff --git a/cjs/vega/EthereumContractConfig/encode.cjs b/cjs/vega/EthereumContractConfig/encode.cjs new file mode 100644 index 0000000..964d606 --- /dev/null +++ b/cjs/vega/EthereumContractConfig/encode.cjs @@ -0,0 +1,22 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.address) writer.bytes(1, obj.address, types.string); + if (obj.deploymentBlockHeight) + writer.varint(6, obj.deploymentBlockHeight, types.uint64); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/ExternalDataSourceSpec.cjs b/cjs/vega/ExternalDataSourceSpec.cjs new file mode 100644 index 0000000..8afe4da --- /dev/null +++ b/cjs/vega/ExternalDataSourceSpec.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./ExternalDataSourceSpec/encode.cjs'); +var decode = require('./ExternalDataSourceSpec/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/ExternalDataSourceSpec/decode.cjs b/cjs/vega/ExternalDataSourceSpec/decode.cjs new file mode 100644 index 0000000..25668d3 --- /dev/null +++ b/cjs/vega/ExternalDataSourceSpec/decode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var decode$1 = require('../DataSourceSpec/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$spec = {}; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$spec = decode$1.decode(data); + break + } + } + return { spec: field$spec } +} + +exports.decode = decode; diff --git a/cjs/vega/ExternalDataSourceSpec/encode.cjs b/cjs/vega/ExternalDataSourceSpec/encode.cjs new file mode 100644 index 0000000..5c936dd --- /dev/null +++ b/cjs/vega/ExternalDataSourceSpec/encode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var encode$1 = require('../DataSourceSpec/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.spec) writer.bytes(1, encode$1.encode(obj.spec)); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/Fee.cjs b/cjs/vega/Fee.cjs new file mode 100644 index 0000000..9427771 --- /dev/null +++ b/cjs/vega/Fee.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./Fee/encode.cjs'); +var decode = require('./Fee/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/Fee/decode.cjs b/cjs/vega/Fee/decode.cjs new file mode 100644 index 0000000..68be631 --- /dev/null +++ b/cjs/vega/Fee/decode.cjs @@ -0,0 +1,34 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$makerFee = ''; + let field$infrastructureFee = ''; + let field$liquidityFee = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$makerFee = types.string(data); + break + + case 2: + field$infrastructureFee = types.string(data); + break + + case 3: + field$liquidityFee = types.string(data); + break + } + } + return { + makerFee: field$makerFee, + infrastructureFee: field$infrastructureFee, + liquidityFee: field$liquidityFee + } +} + +exports.decode = decode; diff --git a/cjs/vega/Fee/encode.cjs b/cjs/vega/Fee/encode.cjs new file mode 100644 index 0000000..47e8163 --- /dev/null +++ b/cjs/vega/Fee/encode.cjs @@ -0,0 +1,22 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.makerFee) writer.bytes(1, obj.makerFee, types.string); + if (obj.infrastructureFee) writer.bytes(2, obj.infrastructureFee, types.string); + if (obj.liquidityFee) writer.bytes(3, obj.liquidityFee, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/FeeFactors.cjs b/cjs/vega/FeeFactors.cjs new file mode 100644 index 0000000..8ad7611 --- /dev/null +++ b/cjs/vega/FeeFactors.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./FeeFactors/encode.cjs'); +var decode = require('./FeeFactors/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/FeeFactors/decode.cjs b/cjs/vega/FeeFactors/decode.cjs new file mode 100644 index 0000000..68be631 --- /dev/null +++ b/cjs/vega/FeeFactors/decode.cjs @@ -0,0 +1,34 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$makerFee = ''; + let field$infrastructureFee = ''; + let field$liquidityFee = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$makerFee = types.string(data); + break + + case 2: + field$infrastructureFee = types.string(data); + break + + case 3: + field$liquidityFee = types.string(data); + break + } + } + return { + makerFee: field$makerFee, + infrastructureFee: field$infrastructureFee, + liquidityFee: field$liquidityFee + } +} + +exports.decode = decode; diff --git a/cjs/vega/FeeFactors/encode.cjs b/cjs/vega/FeeFactors/encode.cjs new file mode 100644 index 0000000..47e8163 --- /dev/null +++ b/cjs/vega/FeeFactors/encode.cjs @@ -0,0 +1,22 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.makerFee) writer.bytes(1, obj.makerFee, types.string); + if (obj.infrastructureFee) writer.bytes(2, obj.infrastructureFee, types.string); + if (obj.liquidityFee) writer.bytes(3, obj.liquidityFee, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/Fees.cjs b/cjs/vega/Fees.cjs new file mode 100644 index 0000000..1494214 --- /dev/null +++ b/cjs/vega/Fees.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./Fees/encode.cjs'); +var decode = require('./Fees/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/Fees/decode.cjs b/cjs/vega/Fees/decode.cjs new file mode 100644 index 0000000..f5a8521 --- /dev/null +++ b/cjs/vega/Fees/decode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var decode$1 = require('../FeeFactors/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$factors = {}; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$factors = decode$1.decode(data); + break + } + } + return { factors: field$factors } +} + +exports.decode = decode; diff --git a/cjs/vega/Fees/encode.cjs b/cjs/vega/Fees/encode.cjs new file mode 100644 index 0000000..8b375db --- /dev/null +++ b/cjs/vega/Fees/encode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var encode$1 = require('../FeeFactors/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.factors) writer.bytes(1, encode$1.encode(obj.factors)); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/FinancialAmount.cjs b/cjs/vega/FinancialAmount.cjs new file mode 100644 index 0000000..3333878 --- /dev/null +++ b/cjs/vega/FinancialAmount.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./FinancialAmount/encode.cjs'); +var decode = require('./FinancialAmount/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/FinancialAmount/decode.cjs b/cjs/vega/FinancialAmount/decode.cjs new file mode 100644 index 0000000..2dd108e --- /dev/null +++ b/cjs/vega/FinancialAmount/decode.cjs @@ -0,0 +1,25 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$amount = ''; + let field$asset = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$amount = types.string(data); + break + + case 2: + field$asset = types.string(data); + break + } + } + return { amount: field$amount, asset: field$asset } +} + +exports.decode = decode; diff --git a/cjs/vega/FinancialAmount/encode.cjs b/cjs/vega/FinancialAmount/encode.cjs new file mode 100644 index 0000000..4ac01b2 --- /dev/null +++ b/cjs/vega/FinancialAmount/encode.cjs @@ -0,0 +1,21 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.amount) writer.bytes(1, obj.amount, types.string); + if (obj.asset) writer.bytes(2, obj.asset, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/Future.cjs b/cjs/vega/Future.cjs new file mode 100644 index 0000000..8f12b71 --- /dev/null +++ b/cjs/vega/Future.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./Future/encode.cjs'); +var decode = require('./Future/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/Future/decode.cjs b/cjs/vega/Future/decode.cjs new file mode 100644 index 0000000..b05390c --- /dev/null +++ b/cjs/vega/Future/decode.cjs @@ -0,0 +1,52 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$2 = require('../DataSourceSpec/decode.cjs'); +var decode$1 = require('../DataSourceSpecToFutureBinding/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$settlementAsset = ''; + let field$quoteName = ''; + let field$dataSourceSpecForSettlementData = {}; + let field$dataSourceSpecForTradingTermination = {}; + let field$dataSourceSpecBinding = {}; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$settlementAsset = types.string(data); + break + + case 2: + field$quoteName = types.string(data); + break + + case 3: + field$dataSourceSpecForSettlementData = + decode$2.decode(data); + break + + case 4: + field$dataSourceSpecForTradingTermination = + decode$2.decode(data); + break + + case 5: + field$dataSourceSpecBinding = + decode$1.decode(data); + break + } + } + return { + settlementAsset: field$settlementAsset, + quoteName: field$quoteName, + dataSourceSpecForSettlementData: field$dataSourceSpecForSettlementData, + dataSourceSpecForTradingTermination: + field$dataSourceSpecForTradingTermination, + dataSourceSpecBinding: field$dataSourceSpecBinding + } +} + +exports.decode = decode; diff --git a/cjs/vega/Future/encode.cjs b/cjs/vega/Future/encode.cjs new file mode 100644 index 0000000..a6ea2d9 --- /dev/null +++ b/cjs/vega/Future/encode.cjs @@ -0,0 +1,38 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../DataSourceSpec/encode.cjs'); +var encode$2 = require('../DataSourceSpecToFutureBinding/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.settlementAsset) writer.bytes(1, obj.settlementAsset, types.string); + if (obj.quoteName) writer.bytes(2, obj.quoteName, types.string); + if (obj.dataSourceSpecForSettlementData) + writer.bytes( + 3, + encode$1.encode(obj.dataSourceSpecForSettlementData) + ); + if (obj.dataSourceSpecForTradingTermination) + writer.bytes( + 4, + encode$1.encode(obj.dataSourceSpecForTradingTermination) + ); + if (obj.dataSourceSpecBinding) + writer.bytes( + 5, + encode$2.encode(obj.dataSourceSpecBinding) + ); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/FutureProduct.cjs b/cjs/vega/FutureProduct.cjs new file mode 100644 index 0000000..f4c7512 --- /dev/null +++ b/cjs/vega/FutureProduct.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./FutureProduct/encode.cjs'); +var decode = require('./FutureProduct/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/FutureProduct/decode.cjs b/cjs/vega/FutureProduct/decode.cjs new file mode 100644 index 0000000..3b25e6b --- /dev/null +++ b/cjs/vega/FutureProduct/decode.cjs @@ -0,0 +1,52 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$2 = require('../DataSourceDefinition/decode.cjs'); +var decode$1 = require('../DataSourceSpecToFutureBinding/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$settlementAsset = ''; + let field$quoteName = ''; + let field$dataSourceSpecForSettlementData = {}; + let field$dataSourceSpecForTradingTermination = {}; + let field$dataSourceSpecBinding = {}; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$settlementAsset = types.string(data); + break + + case 2: + field$quoteName = types.string(data); + break + + case 3: + field$dataSourceSpecForSettlementData = + decode$2.decode(data); + break + + case 4: + field$dataSourceSpecForTradingTermination = + decode$2.decode(data); + break + + case 5: + field$dataSourceSpecBinding = + decode$1.decode(data); + break + } + } + return { + settlementAsset: field$settlementAsset, + quoteName: field$quoteName, + dataSourceSpecForSettlementData: field$dataSourceSpecForSettlementData, + dataSourceSpecForTradingTermination: + field$dataSourceSpecForTradingTermination, + dataSourceSpecBinding: field$dataSourceSpecBinding + } +} + +exports.decode = decode; diff --git a/cjs/vega/FutureProduct/encode.cjs b/cjs/vega/FutureProduct/encode.cjs new file mode 100644 index 0000000..a5879aa --- /dev/null +++ b/cjs/vega/FutureProduct/encode.cjs @@ -0,0 +1,38 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../DataSourceDefinition/encode.cjs'); +var encode$2 = require('../DataSourceSpecToFutureBinding/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.settlementAsset) writer.bytes(1, obj.settlementAsset, types.string); + if (obj.quoteName) writer.bytes(2, obj.quoteName, types.string); + if (obj.dataSourceSpecForSettlementData) + writer.bytes( + 3, + encode$1.encode(obj.dataSourceSpecForSettlementData) + ); + if (obj.dataSourceSpecForTradingTermination) + writer.bytes( + 4, + encode$1.encode(obj.dataSourceSpecForTradingTermination) + ); + if (obj.dataSourceSpecBinding) + writer.bytes( + 5, + encode$2.encode(obj.dataSourceSpecBinding) + ); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/GovernanceData.cjs b/cjs/vega/GovernanceData.cjs new file mode 100644 index 0000000..ba0022b --- /dev/null +++ b/cjs/vega/GovernanceData.cjs @@ -0,0 +1,13 @@ +'use strict'; + +var encode = require('./GovernanceData/encode.cjs'); +var decode = require('./GovernanceData/decode.cjs'); +var YesPartyEntry = require('./GovernanceData/YesPartyEntry.cjs'); +var NoPartyEntry = require('./GovernanceData/NoPartyEntry.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; +exports.YesPartyEntry = YesPartyEntry; +exports.NoPartyEntry = NoPartyEntry; diff --git a/cjs/vega/GovernanceData/NoPartyEntry.cjs b/cjs/vega/GovernanceData/NoPartyEntry.cjs new file mode 100644 index 0000000..de48cfa --- /dev/null +++ b/cjs/vega/GovernanceData/NoPartyEntry.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./NoPartyEntry/encode.cjs'); +var decode = require('./NoPartyEntry/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/GovernanceData/NoPartyEntry/decode.cjs b/cjs/vega/GovernanceData/NoPartyEntry/decode.cjs new file mode 100644 index 0000000..673f7b2 --- /dev/null +++ b/cjs/vega/GovernanceData/NoPartyEntry/decode.cjs @@ -0,0 +1,26 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$1 = require('../../Vote/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$key = ''; + let field$value = {}; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$key = types.string(data); + break + + case 2: + field$value = decode$1.decode(data); + break + } + } + return { key: field$key, value: field$value } +} + +exports.decode = decode; diff --git a/cjs/vega/GovernanceData/NoPartyEntry/encode.cjs b/cjs/vega/GovernanceData/NoPartyEntry/encode.cjs new file mode 100644 index 0000000..8673cd4 --- /dev/null +++ b/cjs/vega/GovernanceData/NoPartyEntry/encode.cjs @@ -0,0 +1,22 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../../Vote/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.key) writer.bytes(1, obj.key, types.string); + if (obj.value) writer.bytes(2, encode$1.encode(obj.value)); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/GovernanceData/YesPartyEntry.cjs b/cjs/vega/GovernanceData/YesPartyEntry.cjs new file mode 100644 index 0000000..c99b173 --- /dev/null +++ b/cjs/vega/GovernanceData/YesPartyEntry.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./YesPartyEntry/encode.cjs'); +var decode = require('./YesPartyEntry/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/GovernanceData/YesPartyEntry/decode.cjs b/cjs/vega/GovernanceData/YesPartyEntry/decode.cjs new file mode 100644 index 0000000..673f7b2 --- /dev/null +++ b/cjs/vega/GovernanceData/YesPartyEntry/decode.cjs @@ -0,0 +1,26 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$1 = require('../../Vote/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$key = ''; + let field$value = {}; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$key = types.string(data); + break + + case 2: + field$value = decode$1.decode(data); + break + } + } + return { key: field$key, value: field$value } +} + +exports.decode = decode; diff --git a/cjs/vega/GovernanceData/YesPartyEntry/encode.cjs b/cjs/vega/GovernanceData/YesPartyEntry/encode.cjs new file mode 100644 index 0000000..8673cd4 --- /dev/null +++ b/cjs/vega/GovernanceData/YesPartyEntry/encode.cjs @@ -0,0 +1,22 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../../Vote/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.key) writer.bytes(1, obj.key, types.string); + if (obj.value) writer.bytes(2, encode$1.encode(obj.value)); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/GovernanceData/decode.cjs b/cjs/vega/GovernanceData/decode.cjs new file mode 100644 index 0000000..5f9eb13 --- /dev/null +++ b/cjs/vega/GovernanceData/decode.cjs @@ -0,0 +1,49 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var decode$4 = require('../Proposal/decode.cjs'); +var decode$3 = require('../Vote/decode.cjs'); +var decode$2 = require('./YesPartyEntry/decode.cjs'); +var decode$1 = require('./NoPartyEntry/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$proposal = {}; + const field$yes = []; + const field$no = []; + const field$yesParty = []; + const field$noParty = []; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$proposal = decode$4.decode(data); + break + + case 2: + field$yes.push(decode$3.decode(data)); + break + + case 3: + field$no.push(decode$3.decode(data)); + break + + case 4: + field$yesParty.push(decode$2.decode(data)); + break + + case 5: + field$noParty.push(decode$1.decode(data)); + break + } + } + return { + proposal: field$proposal, + yes: field$yes, + no: field$no, + yesParty: field$yesParty, + noParty: field$noParty + } +} + +exports.decode = decode; diff --git a/cjs/vega/GovernanceData/encode.cjs b/cjs/vega/GovernanceData/encode.cjs new file mode 100644 index 0000000..b7f0963 --- /dev/null +++ b/cjs/vega/GovernanceData/encode.cjs @@ -0,0 +1,35 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var encode$1 = require('../Proposal/encode.cjs'); +var encode$2 = require('../Vote/encode.cjs'); +var encode$3 = require('./YesPartyEntry/encode.cjs'); +var encode$4 = require('./NoPartyEntry/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.proposal) writer.bytes(1, encode$1.encode(obj.proposal)); + if (obj.yes?.length) + obj.yes.forEach((v) => writer.bytes(2, encode$2.encode(v))); + if (obj.no?.length) + obj.no.forEach((v) => writer.bytes(3, encode$2.encode(v))); + if (obj.yesParty?.length) + obj.yesParty.forEach((v) => + writer.bytes(4, encode$3.encode(v)) + ); + if (obj.noParty?.length) + obj.noParty.forEach((v) => + writer.bytes(5, encode$4.encode(v)) + ); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/GovernanceTransferType.cjs b/cjs/vega/GovernanceTransferType.cjs new file mode 100644 index 0000000..4b9e245 --- /dev/null +++ b/cjs/vega/GovernanceTransferType.cjs @@ -0,0 +1,71 @@ +'use strict'; + +var assert = require('nanoassert'); +var types = require('protobuf-codec/encode/types'); +var types$1 = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +const GOVERNANCE_TRANSFER_TYPE_UNSPECIFIED = 0; +const GOVERNANCE_TRANSFER_TYPE_ALL_OR_NOTHING = 1; +const GOVERNANCE_TRANSFER_TYPE_BEST_EFFORT = 2; + +const enumValues = new Map([ + [0, 'GOVERNANCE_TRANSFER_TYPE_UNSPECIFIED'], + [1, 'GOVERNANCE_TRANSFER_TYPE_ALL_OR_NOTHING'], + [2, 'GOVERNANCE_TRANSFER_TYPE_BEST_EFFORT'] +]); +const enumNames = new Map([ + ['GOVERNANCE_TRANSFER_TYPE_UNSPECIFIED', 0], + ['GOVERNANCE_TRANSFER_TYPE_ALL_OR_NOTHING', 1], + ['GOVERNANCE_TRANSFER_TYPE_BEST_EFFORT', 2] +]); + +function encode(value, buf, byteOffset = 0) { + if (typeof value === 'string') return encode(parse(value), buf, byteOffset) + if (value == null) + throw new Error('Invalid GovernanceTransferType value (' + value + ')') + + return types.enumerable.encode(value, buf, byteOffset) +} + +function decode(varint) { + const int = types$1.enumerable(varint); + + return stringify(int) ?? int +} + +function encodingLength(value) { + if (typeof value === 'string') return encodingLength(parse(value)) + assert(value != null, 'Invalid GovernanceTransferType value (' + value + ')'); + + if (0 <= value && value <= 2) return 1 + + // enumerable max value in case of unknown value + return 5 +} + +/** + * Convert an enum value to it's human readable name. + * Returns undefined on an unknown value. + */ +function stringify(int) { + return enumValues.get(int) +} + +/** + * Convert an enum string names to it's machine integer value. + * Returns undefined on an unknown name. + */ +function parse(str) { + return enumNames.get(str) +} + +exports.GOVERNANCE_TRANSFER_TYPE_ALL_OR_NOTHING = GOVERNANCE_TRANSFER_TYPE_ALL_OR_NOTHING; +exports.GOVERNANCE_TRANSFER_TYPE_BEST_EFFORT = GOVERNANCE_TRANSFER_TYPE_BEST_EFFORT; +exports.GOVERNANCE_TRANSFER_TYPE_UNSPECIFIED = GOVERNANCE_TRANSFER_TYPE_UNSPECIFIED; +exports.decode = decode; +exports.encode = encode; +exports.encodingLength = encodingLength; +exports.parse = parse; +exports.stringify = stringify; diff --git a/cjs/vega/IcebergOrder.cjs b/cjs/vega/IcebergOrder.cjs new file mode 100644 index 0000000..75c8034 --- /dev/null +++ b/cjs/vega/IcebergOrder.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./IcebergOrder/encode.cjs'); +var decode = require('./IcebergOrder/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/IcebergOrder/decode.cjs b/cjs/vega/IcebergOrder/decode.cjs new file mode 100644 index 0000000..6f7db3a --- /dev/null +++ b/cjs/vega/IcebergOrder/decode.cjs @@ -0,0 +1,34 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$peakSize = 0n; + let field$minimumVisibleSize = 0n; + let field$reservedRemaining = 0n; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$peakSize = types.uint64(data); + break + + case 2: + field$minimumVisibleSize = types.uint64(data); + break + + case 3: + field$reservedRemaining = types.uint64(data); + break + } + } + return { + peakSize: field$peakSize, + minimumVisibleSize: field$minimumVisibleSize, + reservedRemaining: field$reservedRemaining + } +} + +exports.decode = decode; diff --git a/cjs/vega/IcebergOrder/encode.cjs b/cjs/vega/IcebergOrder/encode.cjs new file mode 100644 index 0000000..038ce68 --- /dev/null +++ b/cjs/vega/IcebergOrder/encode.cjs @@ -0,0 +1,22 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.peakSize) writer.varint(1, obj.peakSize, types.uint64); + if (obj.minimumVisibleSize) writer.varint(2, obj.minimumVisibleSize, types.uint64); + if (obj.reservedRemaining) writer.varint(3, obj.reservedRemaining, types.uint64); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/Instrument.cjs b/cjs/vega/Instrument.cjs new file mode 100644 index 0000000..24fd53b --- /dev/null +++ b/cjs/vega/Instrument.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./Instrument/encode.cjs'); +var decode = require('./Instrument/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/Instrument/decode.cjs b/cjs/vega/Instrument/decode.cjs new file mode 100644 index 0000000..a5e051d --- /dev/null +++ b/cjs/vega/Instrument/decode.cjs @@ -0,0 +1,53 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$3 = require('../InstrumentMetadata/decode.cjs'); +var decode$2 = require('../Future/decode.cjs'); +var decode$1 = require('../Spot/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$id = ''; + let field$code = ''; + let field$name = ''; + let field$metadata = {}; + let field$product = null; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$id = types.string(data); + break + + case 2: + field$code = types.string(data); + break + + case 3: + field$name = types.string(data); + break + + case 4: + field$metadata = decode$3.decode(data); + break + + case 100: + field$product = { future: decode$2.decode(data) }; + break + + case 101: + field$product = { spot: decode$1.decode(data) }; + break + } + } + return { + id: field$id, + code: field$code, + name: field$name, + metadata: field$metadata, + product: field$product + } +} + +exports.decode = decode; diff --git a/cjs/vega/Instrument/encode.cjs b/cjs/vega/Instrument/encode.cjs new file mode 100644 index 0000000..853b777 --- /dev/null +++ b/cjs/vega/Instrument/encode.cjs @@ -0,0 +1,32 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../InstrumentMetadata/encode.cjs'); +var encode$2 = require('../Future/encode.cjs'); +var encode$3 = require('../Spot/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.id) writer.bytes(1, obj.id, types.string); + if (obj.code) writer.bytes(2, obj.code, types.string); + if (obj.name) writer.bytes(3, obj.name, types.string); + if (obj.metadata) + writer.bytes(4, encode$1.encode(obj.metadata)); + + if (obj.product?.future ?? obj.future) + writer.bytes(100, encode$2.encode(obj.product?.future ?? obj.future)); + if (obj.product?.spot ?? obj.spot) + writer.bytes(101, encode$3.encode(obj.product?.spot ?? obj.spot)); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/InstrumentConfiguration.cjs b/cjs/vega/InstrumentConfiguration.cjs new file mode 100644 index 0000000..f678e33 --- /dev/null +++ b/cjs/vega/InstrumentConfiguration.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./InstrumentConfiguration/encode.cjs'); +var decode = require('./InstrumentConfiguration/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/InstrumentConfiguration/decode.cjs b/cjs/vega/InstrumentConfiguration/decode.cjs new file mode 100644 index 0000000..a7dac5c --- /dev/null +++ b/cjs/vega/InstrumentConfiguration/decode.cjs @@ -0,0 +1,36 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$2 = require('../FutureProduct/decode.cjs'); +var decode$1 = require('../SpotProduct/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$name = ''; + let field$code = ''; + let field$product = null; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$name = types.string(data); + break + + case 2: + field$code = types.string(data); + break + + case 100: + field$product = { future: decode$2.decode(data) }; + break + + case 101: + field$product = { spot: decode$1.decode(data) }; + break + } + } + return { name: field$name, code: field$code, product: field$product } +} + +exports.decode = decode; diff --git a/cjs/vega/InstrumentConfiguration/encode.cjs b/cjs/vega/InstrumentConfiguration/encode.cjs new file mode 100644 index 0000000..aec51f2 --- /dev/null +++ b/cjs/vega/InstrumentConfiguration/encode.cjs @@ -0,0 +1,31 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../FutureProduct/encode.cjs'); +var encode$2 = require('../SpotProduct/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.name) writer.bytes(1, obj.name, types.string); + if (obj.code) writer.bytes(2, obj.code, types.string); + + if (obj.product?.future ?? obj.future) + writer.bytes( + 100, + encode$1.encode(obj.product?.future ?? obj.future) + ); + if (obj.product?.spot ?? obj.spot) + writer.bytes(101, encode$2.encode(obj.product?.spot ?? obj.spot)); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/InstrumentMetadata.cjs b/cjs/vega/InstrumentMetadata.cjs new file mode 100644 index 0000000..698519d --- /dev/null +++ b/cjs/vega/InstrumentMetadata.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./InstrumentMetadata/encode.cjs'); +var decode = require('./InstrumentMetadata/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/InstrumentMetadata/decode.cjs b/cjs/vega/InstrumentMetadata/decode.cjs new file mode 100644 index 0000000..9c22305 --- /dev/null +++ b/cjs/vega/InstrumentMetadata/decode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + const field$tags = []; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$tags.push(types.string(data)); + break + } + } + return { tags: field$tags } +} + +exports.decode = decode; diff --git a/cjs/vega/InstrumentMetadata/encode.cjs b/cjs/vega/InstrumentMetadata/encode.cjs new file mode 100644 index 0000000..e3af49a --- /dev/null +++ b/cjs/vega/InstrumentMetadata/encode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.tags?.length) obj.tags.forEach((v) => writer.bytes(1, v, types.string)); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/Interval.cjs b/cjs/vega/Interval.cjs new file mode 100644 index 0000000..40e641a --- /dev/null +++ b/cjs/vega/Interval.cjs @@ -0,0 +1,88 @@ +'use strict'; + +var assert = require('nanoassert'); +var types = require('protobuf-codec/encode/types'); +var types$1 = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +const INTERVAL_UNSPECIFIED = 0; +const INTERVAL_BLOCK = -1; +const INTERVAL_I1M = 60; +const INTERVAL_I5M = 300; +const INTERVAL_I15M = 900; +const INTERVAL_I1H = 3600; +const INTERVAL_I6H = 21600; +const INTERVAL_I1D = 86400; + +const enumValues = new Map([ + [0, 'INTERVAL_UNSPECIFIED'], + [-1, 'INTERVAL_BLOCK'], + [60, 'INTERVAL_I1M'], + [300, 'INTERVAL_I5M'], + [900, 'INTERVAL_I15M'], + [3600, 'INTERVAL_I1H'], + [21600, 'INTERVAL_I6H'], + [86400, 'INTERVAL_I1D'] +]); +const enumNames = new Map([ + ['INTERVAL_UNSPECIFIED', 0], + ['INTERVAL_BLOCK', -1], + ['INTERVAL_I1M', 60], + ['INTERVAL_I5M', 300], + ['INTERVAL_I15M', 900], + ['INTERVAL_I1H', 3600], + ['INTERVAL_I6H', 21600], + ['INTERVAL_I1D', 86400] +]); + +function encode(value, buf, byteOffset = 0) { + if (typeof value === 'string') return encode(parse(value), buf, byteOffset) + if (value == null) throw new Error('Invalid Interval value (' + value + ')') + + return types.enumerable.encode(value, buf, byteOffset) +} + +function decode(varint) { + const int = types$1.enumerable(varint); + + return stringify(int) ?? int +} + +function encodingLength(value) { + if (typeof value === 'string') return encodingLength(parse(value)) + assert(value != null, 'Invalid Interval value (' + value + ')'); + + // This enum may fully consume the max allowed size + return 5 +} + +/** + * Convert an enum value to it's human readable name. + * Returns undefined on an unknown value. + */ +function stringify(int) { + return enumValues.get(int) +} + +/** + * Convert an enum string names to it's machine integer value. + * Returns undefined on an unknown name. + */ +function parse(str) { + return enumNames.get(str) +} + +exports.INTERVAL_BLOCK = INTERVAL_BLOCK; +exports.INTERVAL_I15M = INTERVAL_I15M; +exports.INTERVAL_I1D = INTERVAL_I1D; +exports.INTERVAL_I1H = INTERVAL_I1H; +exports.INTERVAL_I1M = INTERVAL_I1M; +exports.INTERVAL_I5M = INTERVAL_I5M; +exports.INTERVAL_I6H = INTERVAL_I6H; +exports.INTERVAL_UNSPECIFIED = INTERVAL_UNSPECIFIED; +exports.decode = decode; +exports.encode = encode; +exports.encodingLength = encodingLength; +exports.parse = parse; +exports.stringify = stringify; diff --git a/cjs/vega/KeyValueBundle.cjs b/cjs/vega/KeyValueBundle.cjs new file mode 100644 index 0000000..ff5f2b8 --- /dev/null +++ b/cjs/vega/KeyValueBundle.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./KeyValueBundle/encode.cjs'); +var decode = require('./KeyValueBundle/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/KeyValueBundle/decode.cjs b/cjs/vega/KeyValueBundle/decode.cjs new file mode 100644 index 0000000..f062b3e --- /dev/null +++ b/cjs/vega/KeyValueBundle/decode.cjs @@ -0,0 +1,31 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$1 = require('../StateVarValue/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$key = ''; + let field$tolerance = ''; + let field$value = {}; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$key = types.string(data); + break + + case 2: + field$tolerance = types.string(data); + break + + case 3: + field$value = decode$1.decode(data); + break + } + } + return { key: field$key, tolerance: field$tolerance, value: field$value } +} + +exports.decode = decode; diff --git a/cjs/vega/KeyValueBundle/encode.cjs b/cjs/vega/KeyValueBundle/encode.cjs new file mode 100644 index 0000000..addf68b --- /dev/null +++ b/cjs/vega/KeyValueBundle/encode.cjs @@ -0,0 +1,23 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../StateVarValue/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.key) writer.bytes(1, obj.key, types.string); + if (obj.tolerance) writer.bytes(2, obj.tolerance, types.string); + if (obj.value) writer.bytes(3, encode$1.encode(obj.value)); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/LedgerEntry.cjs b/cjs/vega/LedgerEntry.cjs new file mode 100644 index 0000000..0d82fc7 --- /dev/null +++ b/cjs/vega/LedgerEntry.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./LedgerEntry/encode.cjs'); +var decode = require('./LedgerEntry/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/LedgerEntry/decode.cjs b/cjs/vega/LedgerEntry/decode.cjs new file mode 100644 index 0000000..8469338 --- /dev/null +++ b/cjs/vega/LedgerEntry/decode.cjs @@ -0,0 +1,60 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$1 = require('../AccountDetails/decode.cjs'); +var TransferType = require('../TransferType.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$fromAccount = {}; + let field$toAccount = {}; + let field$amount = ''; + let field$type = 0; + let field$timestamp = 0n; + let field$fromAccountBalance = ''; + let field$toAccountBalance = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$fromAccount = decode$1.decode(data); + break + + case 2: + field$toAccount = decode$1.decode(data); + break + + case 3: + field$amount = types.string(data); + break + + case 4: + field$type = TransferType.decode(data); + break + + case 5: + field$timestamp = types.int64(data); + break + + case 6: + field$fromAccountBalance = types.string(data); + break + + case 7: + field$toAccountBalance = types.string(data); + break + } + } + return { + fromAccount: field$fromAccount, + toAccount: field$toAccount, + amount: field$amount, + type: field$type, + timestamp: field$timestamp, + fromAccountBalance: field$fromAccountBalance, + toAccountBalance: field$toAccountBalance + } +} + +exports.decode = decode; diff --git a/cjs/vega/LedgerEntry/encode.cjs b/cjs/vega/LedgerEntry/encode.cjs new file mode 100644 index 0000000..a1b66c4 --- /dev/null +++ b/cjs/vega/LedgerEntry/encode.cjs @@ -0,0 +1,29 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../AccountDetails/encode.cjs'); +var TransferType = require('../TransferType.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.fromAccount) + writer.bytes(1, encode$1.encode(obj.fromAccount)); + if (obj.toAccount) writer.bytes(2, encode$1.encode(obj.toAccount)); + if (obj.amount) writer.bytes(3, obj.amount, types.string); + if (obj.type) writer.varint(4, obj.type, TransferType); + if (obj.timestamp) writer.varint(5, obj.timestamp, types.int64); + if (obj.fromAccountBalance) writer.bytes(6, obj.fromAccountBalance, types.string); + if (obj.toAccountBalance) writer.bytes(7, obj.toAccountBalance, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/LedgerMovement.cjs b/cjs/vega/LedgerMovement.cjs new file mode 100644 index 0000000..85d3036 --- /dev/null +++ b/cjs/vega/LedgerMovement.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./LedgerMovement/encode.cjs'); +var decode = require('./LedgerMovement/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/LedgerMovement/decode.cjs b/cjs/vega/LedgerMovement/decode.cjs new file mode 100644 index 0000000..cf9667d --- /dev/null +++ b/cjs/vega/LedgerMovement/decode.cjs @@ -0,0 +1,26 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var decode$2 = require('../LedgerEntry/decode.cjs'); +var decode$1 = require('../PostTransferBalance/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + const field$entries = []; + const field$balances = []; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$entries.push(decode$2.decode(data)); + break + + case 2: + field$balances.push(decode$1.decode(data)); + break + } + } + return { entries: field$entries, balances: field$balances } +} + +exports.decode = decode; diff --git a/cjs/vega/LedgerMovement/encode.cjs b/cjs/vega/LedgerMovement/encode.cjs new file mode 100644 index 0000000..c5512f7 --- /dev/null +++ b/cjs/vega/LedgerMovement/encode.cjs @@ -0,0 +1,26 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var encode$1 = require('../LedgerEntry/encode.cjs'); +var encode$2 = require('../PostTransferBalance/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.entries?.length) + obj.entries.forEach((v) => writer.bytes(1, encode$1.encode(v))); + if (obj.balances?.length) + obj.balances.forEach((v) => + writer.bytes(2, encode$2.encode(v)) + ); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/LiquidityMonitoringParameters.cjs b/cjs/vega/LiquidityMonitoringParameters.cjs new file mode 100644 index 0000000..a04db59 --- /dev/null +++ b/cjs/vega/LiquidityMonitoringParameters.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./LiquidityMonitoringParameters/encode.cjs'); +var decode = require('./LiquidityMonitoringParameters/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/LiquidityMonitoringParameters/decode.cjs b/cjs/vega/LiquidityMonitoringParameters/decode.cjs new file mode 100644 index 0000000..71e58f0 --- /dev/null +++ b/cjs/vega/LiquidityMonitoringParameters/decode.cjs @@ -0,0 +1,35 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$1 = require('../TargetStakeParameters/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$targetStakeParameters = {}; + let field$triggeringRatio = ''; + let field$auctionExtension = 0n; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$targetStakeParameters = decode$1.decode(data); + break + + case 2: + field$triggeringRatio = types.string(data); + break + + case 3: + field$auctionExtension = types.int64(data); + break + } + } + return { + targetStakeParameters: field$targetStakeParameters, + triggeringRatio: field$triggeringRatio, + auctionExtension: field$auctionExtension + } +} + +exports.decode = decode; diff --git a/cjs/vega/LiquidityMonitoringParameters/encode.cjs b/cjs/vega/LiquidityMonitoringParameters/encode.cjs new file mode 100644 index 0000000..3a9fcc5 --- /dev/null +++ b/cjs/vega/LiquidityMonitoringParameters/encode.cjs @@ -0,0 +1,27 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../TargetStakeParameters/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.targetStakeParameters) + writer.bytes( + 1, + encode$1.encode(obj.targetStakeParameters) + ); + if (obj.triggeringRatio) writer.bytes(2, obj.triggeringRatio, types.string); + if (obj.auctionExtension) writer.varint(3, obj.auctionExtension, types.int64); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/LiquidityOrder.cjs b/cjs/vega/LiquidityOrder.cjs new file mode 100644 index 0000000..8a4c216 --- /dev/null +++ b/cjs/vega/LiquidityOrder.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./LiquidityOrder/encode.cjs'); +var decode = require('./LiquidityOrder/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/LiquidityOrder/decode.cjs b/cjs/vega/LiquidityOrder/decode.cjs new file mode 100644 index 0000000..967f661 --- /dev/null +++ b/cjs/vega/LiquidityOrder/decode.cjs @@ -0,0 +1,35 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var PeggedReference = require('../PeggedReference.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$reference = 0; + let field$proportion = 0; + let field$offset = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$reference = PeggedReference.decode(data); + break + + case 2: + field$proportion = types.uint32(data); + break + + case 3: + field$offset = types.string(data); + break + } + } + return { + reference: field$reference, + proportion: field$proportion, + offset: field$offset + } +} + +exports.decode = decode; diff --git a/cjs/vega/LiquidityOrder/encode.cjs b/cjs/vega/LiquidityOrder/encode.cjs new file mode 100644 index 0000000..dc5cdf5 --- /dev/null +++ b/cjs/vega/LiquidityOrder/encode.cjs @@ -0,0 +1,23 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var PeggedReference = require('../PeggedReference.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.reference) writer.varint(1, obj.reference, PeggedReference); + if (obj.proportion) writer.varint(2, obj.proportion, types.uint32); + if (obj.offset) writer.bytes(3, obj.offset, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/LiquidityOrderReference.cjs b/cjs/vega/LiquidityOrderReference.cjs new file mode 100644 index 0000000..e003a3b --- /dev/null +++ b/cjs/vega/LiquidityOrderReference.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./LiquidityOrderReference/encode.cjs'); +var decode = require('./LiquidityOrderReference/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/LiquidityOrderReference/decode.cjs b/cjs/vega/LiquidityOrderReference/decode.cjs new file mode 100644 index 0000000..558b7fb --- /dev/null +++ b/cjs/vega/LiquidityOrderReference/decode.cjs @@ -0,0 +1,26 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$1 = require('../LiquidityOrder/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$orderId = ''; + let field$liquidityOrder = {}; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$orderId = types.string(data); + break + + case 2: + field$liquidityOrder = decode$1.decode(data); + break + } + } + return { orderId: field$orderId, liquidityOrder: field$liquidityOrder } +} + +exports.decode = decode; diff --git a/cjs/vega/LiquidityOrderReference/encode.cjs b/cjs/vega/LiquidityOrderReference/encode.cjs new file mode 100644 index 0000000..30a1e5e --- /dev/null +++ b/cjs/vega/LiquidityOrderReference/encode.cjs @@ -0,0 +1,23 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../LiquidityOrder/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.orderId) writer.bytes(1, obj.orderId, types.string); + if (obj.liquidityOrder) + writer.bytes(2, encode$1.encode(obj.liquidityOrder)); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/LiquidityProviderFeeShare.cjs b/cjs/vega/LiquidityProviderFeeShare.cjs new file mode 100644 index 0000000..f51cacd --- /dev/null +++ b/cjs/vega/LiquidityProviderFeeShare.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./LiquidityProviderFeeShare/encode.cjs'); +var decode = require('./LiquidityProviderFeeShare/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/LiquidityProviderFeeShare/decode.cjs b/cjs/vega/LiquidityProviderFeeShare/decode.cjs new file mode 100644 index 0000000..17e632e --- /dev/null +++ b/cjs/vega/LiquidityProviderFeeShare/decode.cjs @@ -0,0 +1,46 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$party = ''; + let field$equityLikeShare = ''; + let field$averageEntryValuation = ''; + let field$averageScore = ''; + let field$virtualStake = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$party = types.string(data); + break + + case 2: + field$equityLikeShare = types.string(data); + break + + case 3: + field$averageEntryValuation = types.string(data); + break + + case 4: + field$averageScore = types.string(data); + break + + case 5: + field$virtualStake = types.string(data); + break + } + } + return { + party: field$party, + equityLikeShare: field$equityLikeShare, + averageEntryValuation: field$averageEntryValuation, + averageScore: field$averageScore, + virtualStake: field$virtualStake + } +} + +exports.decode = decode; diff --git a/cjs/vega/LiquidityProviderFeeShare/encode.cjs b/cjs/vega/LiquidityProviderFeeShare/encode.cjs new file mode 100644 index 0000000..5c93ee9 --- /dev/null +++ b/cjs/vega/LiquidityProviderFeeShare/encode.cjs @@ -0,0 +1,25 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.party) writer.bytes(1, obj.party, types.string); + if (obj.equityLikeShare) writer.bytes(2, obj.equityLikeShare, types.string); + if (obj.averageEntryValuation) + writer.bytes(3, obj.averageEntryValuation, types.string); + if (obj.averageScore) writer.bytes(4, obj.averageScore, types.string); + if (obj.virtualStake) writer.bytes(5, obj.virtualStake, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/LiquidityProvision.cjs b/cjs/vega/LiquidityProvision.cjs new file mode 100644 index 0000000..a67dd1a --- /dev/null +++ b/cjs/vega/LiquidityProvision.cjs @@ -0,0 +1,11 @@ +'use strict'; + +var encode = require('./LiquidityProvision/encode.cjs'); +var decode = require('./LiquidityProvision/decode.cjs'); +var Status = require('./LiquidityProvision/Status.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; +exports.Status = Status; diff --git a/cjs/vega/LiquidityProvision/Status.cjs b/cjs/vega/LiquidityProvision/Status.cjs new file mode 100644 index 0000000..5a9fff5 --- /dev/null +++ b/cjs/vega/LiquidityProvision/Status.cjs @@ -0,0 +1,86 @@ +'use strict'; + +var assert = require('nanoassert'); +var types = require('protobuf-codec/encode/types'); +var types$1 = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +const STATUS_UNSPECIFIED = 0; +const STATUS_ACTIVE = 1; +const STATUS_STOPPED = 2; +const STATUS_CANCELLED = 3; +const STATUS_REJECTED = 4; +const STATUS_UNDEPLOYED = 5; +const STATUS_PENDING = 6; + +const enumValues = new Map([ + [0, 'STATUS_UNSPECIFIED'], + [1, 'STATUS_ACTIVE'], + [2, 'STATUS_STOPPED'], + [3, 'STATUS_CANCELLED'], + [4, 'STATUS_REJECTED'], + [5, 'STATUS_UNDEPLOYED'], + [6, 'STATUS_PENDING'] +]); +const enumNames = new Map([ + ['STATUS_UNSPECIFIED', 0], + ['STATUS_ACTIVE', 1], + ['STATUS_STOPPED', 2], + ['STATUS_CANCELLED', 3], + ['STATUS_REJECTED', 4], + ['STATUS_UNDEPLOYED', 5], + ['STATUS_PENDING', 6] +]); + +function encode(value, buf, byteOffset = 0) { + if (typeof value === 'string') return encode(parse(value), buf, byteOffset) + if (value == null) throw new Error('Invalid Status value (' + value + ')') + + return types.enumerable.encode(value, buf, byteOffset) +} + +function decode(varint) { + const int = types$1.enumerable(varint); + + return stringify(int) ?? int +} + +function encodingLength(value) { + if (typeof value === 'string') return encodingLength(parse(value)) + assert(value != null, 'Invalid Status value (' + value + ')'); + + if (0 <= value && value <= 6) return 1 + + // enumerable max value in case of unknown value + return 5 +} + +/** + * Convert an enum value to it's human readable name. + * Returns undefined on an unknown value. + */ +function stringify(int) { + return enumValues.get(int) +} + +/** + * Convert an enum string names to it's machine integer value. + * Returns undefined on an unknown name. + */ +function parse(str) { + return enumNames.get(str) +} + +exports.STATUS_ACTIVE = STATUS_ACTIVE; +exports.STATUS_CANCELLED = STATUS_CANCELLED; +exports.STATUS_PENDING = STATUS_PENDING; +exports.STATUS_REJECTED = STATUS_REJECTED; +exports.STATUS_STOPPED = STATUS_STOPPED; +exports.STATUS_UNDEPLOYED = STATUS_UNDEPLOYED; +exports.STATUS_UNSPECIFIED = STATUS_UNSPECIFIED; +exports.decode = decode; +exports.encode = encode; +exports.encodingLength = encodingLength; +exports.parse = parse; +exports.stringify = stringify; diff --git a/cjs/vega/LiquidityProvision/decode.cjs b/cjs/vega/LiquidityProvision/decode.cjs new file mode 100644 index 0000000..559f909 --- /dev/null +++ b/cjs/vega/LiquidityProvision/decode.cjs @@ -0,0 +1,90 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$1 = require('../LiquidityOrderReference/decode.cjs'); +var Status = require('./Status.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$id = ''; + let field$partyId = ''; + let field$createdAt = 0n; + let field$updatedAt = 0n; + let field$marketId = ''; + let field$commitmentAmount = ''; + let field$fee = ''; + const field$sells = []; + const field$buys = []; + let field$version = 0n; + let field$status = 0; + let field$reference = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$id = types.string(data); + break + + case 2: + field$partyId = types.string(data); + break + + case 3: + field$createdAt = types.int64(data); + break + + case 4: + field$updatedAt = types.int64(data); + break + + case 5: + field$marketId = types.string(data); + break + + case 6: + field$commitmentAmount = types.string(data); + break + + case 7: + field$fee = types.string(data); + break + + case 8: + field$sells.push(decode$1.decode(data)); + break + + case 9: + field$buys.push(decode$1.decode(data)); + break + + case 10: + field$version = types.uint64(data); + break + + case 11: + field$status = Status.decode(data); + break + + case 12: + field$reference = types.string(data); + break + } + } + return { + id: field$id, + partyId: field$partyId, + createdAt: field$createdAt, + updatedAt: field$updatedAt, + marketId: field$marketId, + commitmentAmount: field$commitmentAmount, + fee: field$fee, + sells: field$sells, + buys: field$buys, + version: field$version, + status: field$status, + reference: field$reference + } +} + +exports.decode = decode; diff --git a/cjs/vega/LiquidityProvision/encode.cjs b/cjs/vega/LiquidityProvision/encode.cjs new file mode 100644 index 0000000..300f66b --- /dev/null +++ b/cjs/vega/LiquidityProvision/encode.cjs @@ -0,0 +1,39 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../LiquidityOrderReference/encode.cjs'); +var Status = require('./Status.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.id) writer.bytes(1, obj.id, types.string); + if (obj.partyId) writer.bytes(2, obj.partyId, types.string); + if (obj.createdAt) writer.varint(3, obj.createdAt, types.int64); + if (obj.updatedAt) writer.varint(4, obj.updatedAt, types.int64); + if (obj.marketId) writer.bytes(5, obj.marketId, types.string); + if (obj.commitmentAmount) writer.bytes(6, obj.commitmentAmount, types.string); + if (obj.fee) writer.bytes(7, obj.fee, types.string); + if (obj.sells?.length) + obj.sells.forEach((v) => + writer.bytes(8, encode$1.encode(v)) + ); + if (obj.buys?.length) + obj.buys.forEach((v) => + writer.bytes(9, encode$1.encode(v)) + ); + if (obj.version) writer.varint(10, obj.version, types.uint64); + if (obj.status) writer.varint(11, obj.status, Status); + if (obj.reference) writer.bytes(12, obj.reference, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/LogNormalModelParams.cjs b/cjs/vega/LogNormalModelParams.cjs new file mode 100644 index 0000000..74bcccc --- /dev/null +++ b/cjs/vega/LogNormalModelParams.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./LogNormalModelParams/encode.cjs'); +var decode = require('./LogNormalModelParams/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/LogNormalModelParams/decode.cjs b/cjs/vega/LogNormalModelParams/decode.cjs new file mode 100644 index 0000000..cbe1a46 --- /dev/null +++ b/cjs/vega/LogNormalModelParams/decode.cjs @@ -0,0 +1,30 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$mu = 0; + let field$r = 0; + let field$sigma = 0; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$mu = types.double(data); + break + + case 2: + field$r = types.double(data); + break + + case 3: + field$sigma = types.double(data); + break + } + } + return { mu: field$mu, r: field$r, sigma: field$sigma } +} + +exports.decode = decode; diff --git a/cjs/vega/LogNormalModelParams/encode.cjs b/cjs/vega/LogNormalModelParams/encode.cjs new file mode 100644 index 0000000..6016b3b --- /dev/null +++ b/cjs/vega/LogNormalModelParams/encode.cjs @@ -0,0 +1,22 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.mu) writer.fixed64(1, obj.mu, types.double); + if (obj.r) writer.fixed64(2, obj.r, types.double); + if (obj.sigma) writer.fixed64(3, obj.sigma, types.double); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/LogNormalRiskModel.cjs b/cjs/vega/LogNormalRiskModel.cjs new file mode 100644 index 0000000..b60fa49 --- /dev/null +++ b/cjs/vega/LogNormalRiskModel.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./LogNormalRiskModel/encode.cjs'); +var decode = require('./LogNormalRiskModel/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/LogNormalRiskModel/decode.cjs b/cjs/vega/LogNormalRiskModel/decode.cjs new file mode 100644 index 0000000..cffce83 --- /dev/null +++ b/cjs/vega/LogNormalRiskModel/decode.cjs @@ -0,0 +1,35 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$1 = require('../LogNormalModelParams/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$riskAversionParameter = 0; + let field$tau = 0; + let field$params = {}; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$riskAversionParameter = types.double(data); + break + + case 2: + field$tau = types.double(data); + break + + case 3: + field$params = decode$1.decode(data); + break + } + } + return { + riskAversionParameter: field$riskAversionParameter, + tau: field$tau, + params: field$params + } +} + +exports.decode = decode; diff --git a/cjs/vega/LogNormalRiskModel/encode.cjs b/cjs/vega/LogNormalRiskModel/encode.cjs new file mode 100644 index 0000000..fa9ee3d --- /dev/null +++ b/cjs/vega/LogNormalRiskModel/encode.cjs @@ -0,0 +1,24 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../LogNormalModelParams/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.riskAversionParameter) + writer.fixed64(1, obj.riskAversionParameter, types.double); + if (obj.tau) writer.fixed64(2, obj.tau, types.double); + if (obj.params) writer.bytes(3, encode$1.encode(obj.params)); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/MarginCalculator.cjs b/cjs/vega/MarginCalculator.cjs new file mode 100644 index 0000000..3d443dc --- /dev/null +++ b/cjs/vega/MarginCalculator.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./MarginCalculator/encode.cjs'); +var decode = require('./MarginCalculator/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/MarginCalculator/decode.cjs b/cjs/vega/MarginCalculator/decode.cjs new file mode 100644 index 0000000..c74341b --- /dev/null +++ b/cjs/vega/MarginCalculator/decode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var decode$1 = require('../ScalingFactors/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$scalingFactors = {}; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$scalingFactors = decode$1.decode(data); + break + } + } + return { scalingFactors: field$scalingFactors } +} + +exports.decode = decode; diff --git a/cjs/vega/MarginCalculator/encode.cjs b/cjs/vega/MarginCalculator/encode.cjs new file mode 100644 index 0000000..65f5820 --- /dev/null +++ b/cjs/vega/MarginCalculator/encode.cjs @@ -0,0 +1,21 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var encode$1 = require('../ScalingFactors/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.scalingFactors) + writer.bytes(1, encode$1.encode(obj.scalingFactors)); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/MarginLevels.cjs b/cjs/vega/MarginLevels.cjs new file mode 100644 index 0000000..3483321 --- /dev/null +++ b/cjs/vega/MarginLevels.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./MarginLevels/encode.cjs'); +var decode = require('./MarginLevels/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/MarginLevels/decode.cjs b/cjs/vega/MarginLevels/decode.cjs new file mode 100644 index 0000000..7c4900b --- /dev/null +++ b/cjs/vega/MarginLevels/decode.cjs @@ -0,0 +1,64 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$maintenanceMargin = ''; + let field$searchLevel = ''; + let field$initialMargin = ''; + let field$collateralReleaseLevel = ''; + let field$partyId = ''; + let field$marketId = ''; + let field$asset = ''; + let field$timestamp = 0n; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$maintenanceMargin = types.string(data); + break + + case 2: + field$searchLevel = types.string(data); + break + + case 3: + field$initialMargin = types.string(data); + break + + case 4: + field$collateralReleaseLevel = types.string(data); + break + + case 5: + field$partyId = types.string(data); + break + + case 6: + field$marketId = types.string(data); + break + + case 7: + field$asset = types.string(data); + break + + case 8: + field$timestamp = types.int64(data); + break + } + } + return { + maintenanceMargin: field$maintenanceMargin, + searchLevel: field$searchLevel, + initialMargin: field$initialMargin, + collateralReleaseLevel: field$collateralReleaseLevel, + partyId: field$partyId, + marketId: field$marketId, + asset: field$asset, + timestamp: field$timestamp + } +} + +exports.decode = decode; diff --git a/cjs/vega/MarginLevels/encode.cjs b/cjs/vega/MarginLevels/encode.cjs new file mode 100644 index 0000000..45e23ac --- /dev/null +++ b/cjs/vega/MarginLevels/encode.cjs @@ -0,0 +1,28 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.maintenanceMargin) writer.bytes(1, obj.maintenanceMargin, types.string); + if (obj.searchLevel) writer.bytes(2, obj.searchLevel, types.string); + if (obj.initialMargin) writer.bytes(3, obj.initialMargin, types.string); + if (obj.collateralReleaseLevel) + writer.bytes(4, obj.collateralReleaseLevel, types.string); + if (obj.partyId) writer.bytes(5, obj.partyId, types.string); + if (obj.marketId) writer.bytes(6, obj.marketId, types.string); + if (obj.asset) writer.bytes(7, obj.asset, types.string); + if (obj.timestamp) writer.varint(8, obj.timestamp, types.int64); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/Market.cjs b/cjs/vega/Market.cjs new file mode 100644 index 0000000..4c3bfb0 --- /dev/null +++ b/cjs/vega/Market.cjs @@ -0,0 +1,13 @@ +'use strict'; + +var encode = require('./Market/encode.cjs'); +var decode = require('./Market/decode.cjs'); +var State = require('./Market/State.cjs'); +var TradingMode = require('./Market/TradingMode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; +exports.State = State; +exports.TradingMode = TradingMode; diff --git a/cjs/vega/Market/State.cjs b/cjs/vega/Market/State.cjs new file mode 100644 index 0000000..157e7a1 --- /dev/null +++ b/cjs/vega/Market/State.cjs @@ -0,0 +1,98 @@ +'use strict'; + +var assert = require('nanoassert'); +var types = require('protobuf-codec/encode/types'); +var types$1 = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +const STATE_UNSPECIFIED = 0; +const STATE_PROPOSED = 1; +const STATE_REJECTED = 2; +const STATE_PENDING = 3; +const STATE_CANCELLED = 4; +const STATE_ACTIVE = 5; +const STATE_SUSPENDED = 6; +const STATE_CLOSED = 7; +const STATE_TRADING_TERMINATED = 8; +const STATE_SETTLED = 9; + +const enumValues = new Map([ + [0, 'STATE_UNSPECIFIED'], + [1, 'STATE_PROPOSED'], + [2, 'STATE_REJECTED'], + [3, 'STATE_PENDING'], + [4, 'STATE_CANCELLED'], + [5, 'STATE_ACTIVE'], + [6, 'STATE_SUSPENDED'], + [7, 'STATE_CLOSED'], + [8, 'STATE_TRADING_TERMINATED'], + [9, 'STATE_SETTLED'] +]); +const enumNames = new Map([ + ['STATE_UNSPECIFIED', 0], + ['STATE_PROPOSED', 1], + ['STATE_REJECTED', 2], + ['STATE_PENDING', 3], + ['STATE_CANCELLED', 4], + ['STATE_ACTIVE', 5], + ['STATE_SUSPENDED', 6], + ['STATE_CLOSED', 7], + ['STATE_TRADING_TERMINATED', 8], + ['STATE_SETTLED', 9] +]); + +function encode(value, buf, byteOffset = 0) { + if (typeof value === 'string') return encode(parse(value), buf, byteOffset) + if (value == null) throw new Error('Invalid State value (' + value + ')') + + return types.enumerable.encode(value, buf, byteOffset) +} + +function decode(varint) { + const int = types$1.enumerable(varint); + + return stringify(int) ?? int +} + +function encodingLength(value) { + if (typeof value === 'string') return encodingLength(parse(value)) + assert(value != null, 'Invalid State value (' + value + ')'); + + if (0 <= value && value <= 9) return 1 + + // enumerable max value in case of unknown value + return 5 +} + +/** + * Convert an enum value to it's human readable name. + * Returns undefined on an unknown value. + */ +function stringify(int) { + return enumValues.get(int) +} + +/** + * Convert an enum string names to it's machine integer value. + * Returns undefined on an unknown name. + */ +function parse(str) { + return enumNames.get(str) +} + +exports.STATE_ACTIVE = STATE_ACTIVE; +exports.STATE_CANCELLED = STATE_CANCELLED; +exports.STATE_CLOSED = STATE_CLOSED; +exports.STATE_PENDING = STATE_PENDING; +exports.STATE_PROPOSED = STATE_PROPOSED; +exports.STATE_REJECTED = STATE_REJECTED; +exports.STATE_SETTLED = STATE_SETTLED; +exports.STATE_SUSPENDED = STATE_SUSPENDED; +exports.STATE_TRADING_TERMINATED = STATE_TRADING_TERMINATED; +exports.STATE_UNSPECIFIED = STATE_UNSPECIFIED; +exports.decode = decode; +exports.encode = encode; +exports.encodingLength = encodingLength; +exports.parse = parse; +exports.stringify = stringify; diff --git a/cjs/vega/Market/TradingMode.cjs b/cjs/vega/Market/TradingMode.cjs new file mode 100644 index 0000000..7246f87 --- /dev/null +++ b/cjs/vega/Market/TradingMode.cjs @@ -0,0 +1,83 @@ +'use strict'; + +var assert = require('nanoassert'); +var types = require('protobuf-codec/encode/types'); +var types$1 = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +const TRADING_MODE_UNSPECIFIED = 0; +const TRADING_MODE_CONTINUOUS = 1; +const TRADING_MODE_BATCH_AUCTION = 2; +const TRADING_MODE_OPENING_AUCTION = 3; +const TRADING_MODE_MONITORING_AUCTION = 4; +const TRADING_MODE_NO_TRADING = 5; + +const enumValues = new Map([ + [0, 'TRADING_MODE_UNSPECIFIED'], + [1, 'TRADING_MODE_CONTINUOUS'], + [2, 'TRADING_MODE_BATCH_AUCTION'], + [3, 'TRADING_MODE_OPENING_AUCTION'], + [4, 'TRADING_MODE_MONITORING_AUCTION'], + [5, 'TRADING_MODE_NO_TRADING'] +]); +const enumNames = new Map([ + ['TRADING_MODE_UNSPECIFIED', 0], + ['TRADING_MODE_CONTINUOUS', 1], + ['TRADING_MODE_BATCH_AUCTION', 2], + ['TRADING_MODE_OPENING_AUCTION', 3], + ['TRADING_MODE_MONITORING_AUCTION', 4], + ['TRADING_MODE_NO_TRADING', 5] +]); + +function encode(value, buf, byteOffset = 0) { + if (typeof value === 'string') return encode(parse(value), buf, byteOffset) + if (value == null) + throw new Error('Invalid TradingMode value (' + value + ')') + + return types.enumerable.encode(value, buf, byteOffset) +} + +function decode(varint) { + const int = types$1.enumerable(varint); + + return stringify(int) ?? int +} + +function encodingLength(value) { + if (typeof value === 'string') return encodingLength(parse(value)) + assert(value != null, 'Invalid TradingMode value (' + value + ')'); + + if (0 <= value && value <= 5) return 1 + + // enumerable max value in case of unknown value + return 5 +} + +/** + * Convert an enum value to it's human readable name. + * Returns undefined on an unknown value. + */ +function stringify(int) { + return enumValues.get(int) +} + +/** + * Convert an enum string names to it's machine integer value. + * Returns undefined on an unknown name. + */ +function parse(str) { + return enumNames.get(str) +} + +exports.TRADING_MODE_BATCH_AUCTION = TRADING_MODE_BATCH_AUCTION; +exports.TRADING_MODE_CONTINUOUS = TRADING_MODE_CONTINUOUS; +exports.TRADING_MODE_MONITORING_AUCTION = TRADING_MODE_MONITORING_AUCTION; +exports.TRADING_MODE_NO_TRADING = TRADING_MODE_NO_TRADING; +exports.TRADING_MODE_OPENING_AUCTION = TRADING_MODE_OPENING_AUCTION; +exports.TRADING_MODE_UNSPECIFIED = TRADING_MODE_UNSPECIFIED; +exports.decode = decode; +exports.encode = encode; +exports.encodingLength = encodingLength; +exports.parse = parse; +exports.stringify = stringify; diff --git a/cjs/vega/Market/decode.cjs b/cjs/vega/Market/decode.cjs new file mode 100644 index 0000000..ca0a709 --- /dev/null +++ b/cjs/vega/Market/decode.cjs @@ -0,0 +1,128 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$6 = require('../TradableInstrument/decode.cjs'); +var decode$5 = require('../Fees/decode.cjs'); +var decode$4 = require('../AuctionDuration/decode.cjs'); +var decode$3 = require('../PriceMonitoringSettings/decode.cjs'); +var decode$2 = require('../LiquidityMonitoringParameters/decode.cjs'); +var TradingMode = require('./TradingMode.cjs'); +var State = require('./State.cjs'); +var decode$1 = require('../MarketTimestamps/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$id = ''; + let field$tradableInstrument = {}; + let field$decimalPlaces = 0n; + let field$fees = {}; + let field$openingAuction = {}; + let field$priceMonitoringSettings = {}; + let field$liquidityMonitoringParameters = {}; + let field$tradingMode = 0; + let field$state = 0; + let field$marketTimestamps = {}; + let field$positionDecimalPlaces = 0n; + let field$lpPriceRange = ''; + let field$linearSlippageFactor = ''; + let field$quadraticSlippageFactor = ''; + let field$parentMarketId = null; + let field$insurancePoolFraction = null; + let field$successorMarketId = null; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$id = types.string(data); + break + + case 2: + field$tradableInstrument = decode$6.decode(data); + break + + case 3: + field$decimalPlaces = types.uint64(data); + break + + case 4: + field$fees = decode$5.decode(data); + break + + case 5: + field$openingAuction = decode$4.decode(data); + break + + case 6: + field$priceMonitoringSettings = + decode$3.decode(data); + break + + case 7: + field$liquidityMonitoringParameters = + decode$2.decode(data); + break + + case 8: + field$tradingMode = TradingMode.decode(data); + break + + case 9: + field$state = State.decode(data); + break + + case 10: + field$marketTimestamps = decode$1.decode(data); + break + + case 11: + field$positionDecimalPlaces = types.int64(data); + break + + case 12: + field$lpPriceRange = types.string(data); + break + + case 13: + field$linearSlippageFactor = types.string(data); + break + + case 14: + field$quadraticSlippageFactor = types.string(data); + break + + case 15: + field$parentMarketId = types.string(data); + break + + case 16: + field$insurancePoolFraction = types.string(data); + break + + case 17: + field$successorMarketId = types.string(data); + break + } + } + return { + id: field$id, + tradableInstrument: field$tradableInstrument, + decimalPlaces: field$decimalPlaces, + fees: field$fees, + openingAuction: field$openingAuction, + priceMonitoringSettings: field$priceMonitoringSettings, + liquidityMonitoringParameters: field$liquidityMonitoringParameters, + tradingMode: field$tradingMode, + state: field$state, + marketTimestamps: field$marketTimestamps, + positionDecimalPlaces: field$positionDecimalPlaces, + lpPriceRange: field$lpPriceRange, + linearSlippageFactor: field$linearSlippageFactor, + quadraticSlippageFactor: field$quadraticSlippageFactor, + parentMarketId: field$parentMarketId, + insurancePoolFraction: field$insurancePoolFraction, + successorMarketId: field$successorMarketId + } +} + +exports.decode = decode; diff --git a/cjs/vega/Market/encode.cjs b/cjs/vega/Market/encode.cjs new file mode 100644 index 0000000..bf30aaf --- /dev/null +++ b/cjs/vega/Market/encode.cjs @@ -0,0 +1,62 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../TradableInstrument/encode.cjs'); +var encode$2 = require('../Fees/encode.cjs'); +var encode$3 = require('../AuctionDuration/encode.cjs'); +var encode$4 = require('../PriceMonitoringSettings/encode.cjs'); +var encode$5 = require('../LiquidityMonitoringParameters/encode.cjs'); +var TradingMode = require('./TradingMode.cjs'); +var State = require('./State.cjs'); +var encode$6 = require('../MarketTimestamps/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.id) writer.bytes(1, obj.id, types.string); + if (obj.tradableInstrument) + writer.bytes(2, encode$1.encode(obj.tradableInstrument)); + if (obj.decimalPlaces) writer.varint(3, obj.decimalPlaces, types.uint64); + if (obj.fees) writer.bytes(4, encode$2.encode(obj.fees)); + if (obj.openingAuction) + writer.bytes(5, encode$3.encode(obj.openingAuction)); + if (obj.priceMonitoringSettings) + writer.bytes( + 6, + encode$4.encode(obj.priceMonitoringSettings) + ); + if (obj.liquidityMonitoringParameters) + writer.bytes( + 7, + encode$5.encode( + obj.liquidityMonitoringParameters + ) + ); + if (obj.tradingMode) + writer.varint(8, obj.tradingMode, TradingMode); + if (obj.state) writer.varint(9, obj.state, State); + if (obj.marketTimestamps) + writer.bytes(10, encode$6.encode(obj.marketTimestamps)); + if (obj.positionDecimalPlaces) + writer.varint(11, obj.positionDecimalPlaces, types.int64); + if (obj.lpPriceRange) writer.bytes(12, obj.lpPriceRange, types.string); + if (obj.linearSlippageFactor) + writer.bytes(13, obj.linearSlippageFactor, types.string); + if (obj.quadraticSlippageFactor) + writer.bytes(14, obj.quadraticSlippageFactor, types.string); + if (obj.parentMarketId) writer.bytes(15, obj.parentMarketId, types.string); + if (obj.insurancePoolFraction) + writer.bytes(16, obj.insurancePoolFraction, types.string); + if (obj.successorMarketId) writer.bytes(17, obj.successorMarketId, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/MarketData.cjs b/cjs/vega/MarketData.cjs new file mode 100644 index 0000000..2323f7f --- /dev/null +++ b/cjs/vega/MarketData.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./MarketData/encode.cjs'); +var decode = require('./MarketData/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/MarketData/decode.cjs b/cjs/vega/MarketData/decode.cjs new file mode 100644 index 0000000..9d55a97 --- /dev/null +++ b/cjs/vega/MarketData/decode.cjs @@ -0,0 +1,205 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var TradingMode = require('../Market/TradingMode.cjs'); +var AuctionTrigger = require('../AuctionTrigger.cjs'); +var decode$2 = require('../PriceMonitoringBounds/decode.cjs'); +var decode$1 = require('../LiquidityProviderFeeShare/decode.cjs'); +var State = require('../Market/State.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$markPrice = ''; + let field$bestBidPrice = ''; + let field$bestBidVolume = 0n; + let field$bestOfferPrice = ''; + let field$bestOfferVolume = 0n; + let field$bestStaticBidPrice = ''; + let field$bestStaticBidVolume = 0n; + let field$bestStaticOfferPrice = ''; + let field$bestStaticOfferVolume = 0n; + let field$midPrice = ''; + let field$staticMidPrice = ''; + let field$market = ''; + let field$timestamp = 0n; + let field$openInterest = 0n; + let field$auctionEnd = 0n; + let field$auctionStart = 0n; + let field$indicativePrice = ''; + let field$indicativeVolume = 0n; + let field$marketTradingMode = 0; + let field$trigger = 0; + let field$extensionTrigger = 0; + let field$targetStake = ''; + let field$suppliedStake = ''; + const field$priceMonitoringBounds = []; + let field$marketValueProxy = ''; + const field$liquidityProviderFeeShare = []; + let field$marketState = 0; + let field$nextMarkToMarket = 0n; + let field$lastTradedPrice = ''; + let field$marketGrowth = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$markPrice = types.string(data); + break + + case 2: + field$bestBidPrice = types.string(data); + break + + case 3: + field$bestBidVolume = types.uint64(data); + break + + case 4: + field$bestOfferPrice = types.string(data); + break + + case 5: + field$bestOfferVolume = types.uint64(data); + break + + case 6: + field$bestStaticBidPrice = types.string(data); + break + + case 7: + field$bestStaticBidVolume = types.uint64(data); + break + + case 8: + field$bestStaticOfferPrice = types.string(data); + break + + case 9: + field$bestStaticOfferVolume = types.uint64(data); + break + + case 10: + field$midPrice = types.string(data); + break + + case 11: + field$staticMidPrice = types.string(data); + break + + case 12: + field$market = types.string(data); + break + + case 13: + field$timestamp = types.int64(data); + break + + case 14: + field$openInterest = types.uint64(data); + break + + case 15: + field$auctionEnd = types.int64(data); + break + + case 16: + field$auctionStart = types.int64(data); + break + + case 17: + field$indicativePrice = types.string(data); + break + + case 18: + field$indicativeVolume = types.uint64(data); + break + + case 19: + field$marketTradingMode = TradingMode.decode(data); + break + + case 20: + field$trigger = AuctionTrigger.decode(data); + break + + case 21: + field$extensionTrigger = AuctionTrigger.decode(data); + break + + case 22: + field$targetStake = types.string(data); + break + + case 23: + field$suppliedStake = types.string(data); + break + + case 24: + field$priceMonitoringBounds.push( + decode$2.decode(data) + ); + break + + case 25: + field$marketValueProxy = types.string(data); + break + + case 26: + field$liquidityProviderFeeShare.push( + decode$1.decode(data) + ); + break + + case 27: + field$marketState = State.decode(data); + break + + case 28: + field$nextMarkToMarket = types.int64(data); + break + + case 29: + field$lastTradedPrice = types.string(data); + break + + case 30: + field$marketGrowth = types.string(data); + break + } + } + return { + markPrice: field$markPrice, + bestBidPrice: field$bestBidPrice, + bestBidVolume: field$bestBidVolume, + bestOfferPrice: field$bestOfferPrice, + bestOfferVolume: field$bestOfferVolume, + bestStaticBidPrice: field$bestStaticBidPrice, + bestStaticBidVolume: field$bestStaticBidVolume, + bestStaticOfferPrice: field$bestStaticOfferPrice, + bestStaticOfferVolume: field$bestStaticOfferVolume, + midPrice: field$midPrice, + staticMidPrice: field$staticMidPrice, + market: field$market, + timestamp: field$timestamp, + openInterest: field$openInterest, + auctionEnd: field$auctionEnd, + auctionStart: field$auctionStart, + indicativePrice: field$indicativePrice, + indicativeVolume: field$indicativeVolume, + marketTradingMode: field$marketTradingMode, + trigger: field$trigger, + extensionTrigger: field$extensionTrigger, + targetStake: field$targetStake, + suppliedStake: field$suppliedStake, + priceMonitoringBounds: field$priceMonitoringBounds, + marketValueProxy: field$marketValueProxy, + liquidityProviderFeeShare: field$liquidityProviderFeeShare, + marketState: field$marketState, + nextMarkToMarket: field$nextMarkToMarket, + lastTradedPrice: field$lastTradedPrice, + marketGrowth: field$marketGrowth + } +} + +exports.decode = decode; diff --git a/cjs/vega/MarketData/encode.cjs b/cjs/vega/MarketData/encode.cjs new file mode 100644 index 0000000..ebd33d2 --- /dev/null +++ b/cjs/vega/MarketData/encode.cjs @@ -0,0 +1,64 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var TradingMode = require('../Market/TradingMode.cjs'); +var AuctionTrigger = require('../AuctionTrigger.cjs'); +var encode$1 = require('../PriceMonitoringBounds/encode.cjs'); +var encode$2 = require('../LiquidityProviderFeeShare/encode.cjs'); +var State = require('../Market/State.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.markPrice) writer.bytes(1, obj.markPrice, types.string); + if (obj.bestBidPrice) writer.bytes(2, obj.bestBidPrice, types.string); + if (obj.bestBidVolume) writer.varint(3, obj.bestBidVolume, types.uint64); + if (obj.bestOfferPrice) writer.bytes(4, obj.bestOfferPrice, types.string); + if (obj.bestOfferVolume) writer.varint(5, obj.bestOfferVolume, types.uint64); + if (obj.bestStaticBidPrice) writer.bytes(6, obj.bestStaticBidPrice, types.string); + if (obj.bestStaticBidVolume) writer.varint(7, obj.bestStaticBidVolume, types.uint64); + if (obj.bestStaticOfferPrice) + writer.bytes(8, obj.bestStaticOfferPrice, types.string); + if (obj.bestStaticOfferVolume) + writer.varint(9, obj.bestStaticOfferVolume, types.uint64); + if (obj.midPrice) writer.bytes(10, obj.midPrice, types.string); + if (obj.staticMidPrice) writer.bytes(11, obj.staticMidPrice, types.string); + if (obj.market) writer.bytes(12, obj.market, types.string); + if (obj.timestamp) writer.varint(13, obj.timestamp, types.int64); + if (obj.openInterest) writer.varint(14, obj.openInterest, types.uint64); + if (obj.auctionEnd) writer.varint(15, obj.auctionEnd, types.int64); + if (obj.auctionStart) writer.varint(16, obj.auctionStart, types.int64); + if (obj.indicativePrice) writer.bytes(17, obj.indicativePrice, types.string); + if (obj.indicativeVolume) writer.varint(18, obj.indicativeVolume, types.uint64); + if (obj.marketTradingMode) + writer.varint(19, obj.marketTradingMode, TradingMode); + if (obj.trigger) writer.varint(20, obj.trigger, AuctionTrigger); + if (obj.extensionTrigger) + writer.varint(21, obj.extensionTrigger, AuctionTrigger); + if (obj.targetStake) writer.bytes(22, obj.targetStake, types.string); + if (obj.suppliedStake) writer.bytes(23, obj.suppliedStake, types.string); + if (obj.priceMonitoringBounds?.length) + obj.priceMonitoringBounds.forEach((v) => + writer.bytes(24, encode$1.encode(v)) + ); + if (obj.marketValueProxy) writer.bytes(25, obj.marketValueProxy, types.string); + if (obj.liquidityProviderFeeShare?.length) + obj.liquidityProviderFeeShare.forEach((v) => + writer.bytes(26, encode$2.encode(v)) + ); + if (obj.marketState) writer.varint(27, obj.marketState, State); + if (obj.nextMarkToMarket) writer.varint(28, obj.nextMarkToMarket, types.int64); + if (obj.lastTradedPrice) writer.bytes(29, obj.lastTradedPrice, types.string); + if (obj.marketGrowth) writer.bytes(30, obj.marketGrowth, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/MarketDepth.cjs b/cjs/vega/MarketDepth.cjs new file mode 100644 index 0000000..cd3fb12 --- /dev/null +++ b/cjs/vega/MarketDepth.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./MarketDepth/encode.cjs'); +var decode = require('./MarketDepth/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/MarketDepth/decode.cjs b/cjs/vega/MarketDepth/decode.cjs new file mode 100644 index 0000000..732bec4 --- /dev/null +++ b/cjs/vega/MarketDepth/decode.cjs @@ -0,0 +1,41 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$1 = require('../PriceLevel/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$marketId = ''; + const field$buy = []; + const field$sell = []; + let field$sequenceNumber = 0n; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$marketId = types.string(data); + break + + case 2: + field$buy.push(decode$1.decode(data)); + break + + case 3: + field$sell.push(decode$1.decode(data)); + break + + case 4: + field$sequenceNumber = types.uint64(data); + break + } + } + return { + marketId: field$marketId, + buy: field$buy, + sell: field$sell, + sequenceNumber: field$sequenceNumber + } +} + +exports.decode = decode; diff --git a/cjs/vega/MarketDepth/encode.cjs b/cjs/vega/MarketDepth/encode.cjs new file mode 100644 index 0000000..7c40cdd --- /dev/null +++ b/cjs/vega/MarketDepth/encode.cjs @@ -0,0 +1,26 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../PriceLevel/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.marketId) writer.bytes(1, obj.marketId, types.string); + if (obj.buy?.length) + obj.buy.forEach((v) => writer.bytes(2, encode$1.encode(v))); + if (obj.sell?.length) + obj.sell.forEach((v) => writer.bytes(3, encode$1.encode(v))); + if (obj.sequenceNumber) writer.varint(4, obj.sequenceNumber, types.uint64); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/MarketDepthUpdate.cjs b/cjs/vega/MarketDepthUpdate.cjs new file mode 100644 index 0000000..f49e6ef --- /dev/null +++ b/cjs/vega/MarketDepthUpdate.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./MarketDepthUpdate/encode.cjs'); +var decode = require('./MarketDepthUpdate/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/MarketDepthUpdate/decode.cjs b/cjs/vega/MarketDepthUpdate/decode.cjs new file mode 100644 index 0000000..872275d --- /dev/null +++ b/cjs/vega/MarketDepthUpdate/decode.cjs @@ -0,0 +1,47 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$1 = require('../PriceLevel/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$marketId = ''; + const field$buy = []; + const field$sell = []; + let field$sequenceNumber = 0n; + let field$previousSequenceNumber = 0n; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$marketId = types.string(data); + break + + case 2: + field$buy.push(decode$1.decode(data)); + break + + case 3: + field$sell.push(decode$1.decode(data)); + break + + case 4: + field$sequenceNumber = types.uint64(data); + break + + case 5: + field$previousSequenceNumber = types.uint64(data); + break + } + } + return { + marketId: field$marketId, + buy: field$buy, + sell: field$sell, + sequenceNumber: field$sequenceNumber, + previousSequenceNumber: field$previousSequenceNumber + } +} + +exports.decode = decode; diff --git a/cjs/vega/MarketDepthUpdate/encode.cjs b/cjs/vega/MarketDepthUpdate/encode.cjs new file mode 100644 index 0000000..9a9da76 --- /dev/null +++ b/cjs/vega/MarketDepthUpdate/encode.cjs @@ -0,0 +1,28 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../PriceLevel/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.marketId) writer.bytes(1, obj.marketId, types.string); + if (obj.buy?.length) + obj.buy.forEach((v) => writer.bytes(2, encode$1.encode(v))); + if (obj.sell?.length) + obj.sell.forEach((v) => writer.bytes(3, encode$1.encode(v))); + if (obj.sequenceNumber) writer.varint(4, obj.sequenceNumber, types.uint64); + if (obj.previousSequenceNumber) + writer.varint(5, obj.previousSequenceNumber, types.uint64); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/MarketTimestamps.cjs b/cjs/vega/MarketTimestamps.cjs new file mode 100644 index 0000000..e788d90 --- /dev/null +++ b/cjs/vega/MarketTimestamps.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./MarketTimestamps/encode.cjs'); +var decode = require('./MarketTimestamps/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/MarketTimestamps/decode.cjs b/cjs/vega/MarketTimestamps/decode.cjs new file mode 100644 index 0000000..91cfccb --- /dev/null +++ b/cjs/vega/MarketTimestamps/decode.cjs @@ -0,0 +1,40 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$proposed = 0n; + let field$pending = 0n; + let field$open = 0n; + let field$close = 0n; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$proposed = types.int64(data); + break + + case 2: + field$pending = types.int64(data); + break + + case 3: + field$open = types.int64(data); + break + + case 4: + field$close = types.int64(data); + break + } + } + return { + proposed: field$proposed, + pending: field$pending, + open: field$open, + close: field$close + } +} + +exports.decode = decode; diff --git a/cjs/vega/MarketTimestamps/encode.cjs b/cjs/vega/MarketTimestamps/encode.cjs new file mode 100644 index 0000000..14fdf57 --- /dev/null +++ b/cjs/vega/MarketTimestamps/encode.cjs @@ -0,0 +1,23 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.proposed) writer.varint(1, obj.proposed, types.int64); + if (obj.pending) writer.varint(2, obj.pending, types.int64); + if (obj.open) writer.varint(3, obj.open, types.int64); + if (obj.close) writer.varint(4, obj.close, types.int64); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/MatrixValue.cjs b/cjs/vega/MatrixValue.cjs new file mode 100644 index 0000000..c889b2f --- /dev/null +++ b/cjs/vega/MatrixValue.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./MatrixValue/encode.cjs'); +var decode = require('./MatrixValue/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/MatrixValue/decode.cjs b/cjs/vega/MatrixValue/decode.cjs new file mode 100644 index 0000000..5f1b53a --- /dev/null +++ b/cjs/vega/MatrixValue/decode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var decode$1 = require('../VectorValue/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + const field$value = []; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$value.push(decode$1.decode(data)); + break + } + } + return { value: field$value } +} + +exports.decode = decode; diff --git a/cjs/vega/MatrixValue/encode.cjs b/cjs/vega/MatrixValue/encode.cjs new file mode 100644 index 0000000..0fd8590 --- /dev/null +++ b/cjs/vega/MatrixValue/encode.cjs @@ -0,0 +1,21 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var encode$1 = require('../VectorValue/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.value?.length) + obj.value.forEach((v) => writer.bytes(1, encode$1.encode(v))); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/NetworkLimits.cjs b/cjs/vega/NetworkLimits.cjs new file mode 100644 index 0000000..f1c851d --- /dev/null +++ b/cjs/vega/NetworkLimits.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./NetworkLimits/encode.cjs'); +var decode = require('./NetworkLimits/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/NetworkLimits/decode.cjs b/cjs/vega/NetworkLimits/decode.cjs new file mode 100644 index 0000000..6e0b178 --- /dev/null +++ b/cjs/vega/NetworkLimits/decode.cjs @@ -0,0 +1,58 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$canProposeMarket = false; + let field$canProposeAsset = false; + let field$proposeMarketEnabled = false; + let field$proposeAssetEnabled = false; + let field$genesisLoaded = false; + let field$proposeMarketEnabledFrom = 0n; + let field$proposeAssetEnabledFrom = 0n; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$canProposeMarket = types.bool(data); + break + + case 2: + field$canProposeAsset = types.bool(data); + break + + case 4: + field$proposeMarketEnabled = types.bool(data); + break + + case 5: + field$proposeAssetEnabled = types.bool(data); + break + + case 7: + field$genesisLoaded = types.bool(data); + break + + case 8: + field$proposeMarketEnabledFrom = types.int64(data); + break + + case 9: + field$proposeAssetEnabledFrom = types.int64(data); + break + } + } + return { + canProposeMarket: field$canProposeMarket, + canProposeAsset: field$canProposeAsset, + proposeMarketEnabled: field$proposeMarketEnabled, + proposeAssetEnabled: field$proposeAssetEnabled, + genesisLoaded: field$genesisLoaded, + proposeMarketEnabledFrom: field$proposeMarketEnabledFrom, + proposeAssetEnabledFrom: field$proposeAssetEnabledFrom + } +} + +exports.decode = decode; diff --git a/cjs/vega/NetworkLimits/encode.cjs b/cjs/vega/NetworkLimits/encode.cjs new file mode 100644 index 0000000..ea1ae84 --- /dev/null +++ b/cjs/vega/NetworkLimits/encode.cjs @@ -0,0 +1,28 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.canProposeMarket) writer.varint(1, obj.canProposeMarket, types.bool); + if (obj.canProposeAsset) writer.varint(2, obj.canProposeAsset, types.bool); + if (obj.proposeMarketEnabled) writer.varint(4, obj.proposeMarketEnabled, types.bool); + if (obj.proposeAssetEnabled) writer.varint(5, obj.proposeAssetEnabled, types.bool); + if (obj.genesisLoaded) writer.varint(7, obj.genesisLoaded, types.bool); + if (obj.proposeMarketEnabledFrom) + writer.varint(8, obj.proposeMarketEnabledFrom, types.int64); + if (obj.proposeAssetEnabledFrom) + writer.varint(9, obj.proposeAssetEnabledFrom, types.int64); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/NetworkParameter.cjs b/cjs/vega/NetworkParameter.cjs new file mode 100644 index 0000000..b013c50 --- /dev/null +++ b/cjs/vega/NetworkParameter.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./NetworkParameter/encode.cjs'); +var decode = require('./NetworkParameter/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/NetworkParameter/decode.cjs b/cjs/vega/NetworkParameter/decode.cjs new file mode 100644 index 0000000..00d2423 --- /dev/null +++ b/cjs/vega/NetworkParameter/decode.cjs @@ -0,0 +1,25 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$key = ''; + let field$value = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$key = types.string(data); + break + + case 2: + field$value = types.string(data); + break + } + } + return { key: field$key, value: field$value } +} + +exports.decode = decode; diff --git a/cjs/vega/NetworkParameter/encode.cjs b/cjs/vega/NetworkParameter/encode.cjs new file mode 100644 index 0000000..4f7d253 --- /dev/null +++ b/cjs/vega/NetworkParameter/encode.cjs @@ -0,0 +1,21 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.key) writer.bytes(1, obj.key, types.string); + if (obj.value) writer.bytes(2, obj.value, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/NewAsset.cjs b/cjs/vega/NewAsset.cjs new file mode 100644 index 0000000..4e4555e --- /dev/null +++ b/cjs/vega/NewAsset.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./NewAsset/encode.cjs'); +var decode = require('./NewAsset/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/NewAsset/decode.cjs b/cjs/vega/NewAsset/decode.cjs new file mode 100644 index 0000000..2b13ef8 --- /dev/null +++ b/cjs/vega/NewAsset/decode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var decode$1 = require('../AssetDetails/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$changes = {}; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$changes = decode$1.decode(data); + break + } + } + return { changes: field$changes } +} + +exports.decode = decode; diff --git a/cjs/vega/NewAsset/encode.cjs b/cjs/vega/NewAsset/encode.cjs new file mode 100644 index 0000000..d964603 --- /dev/null +++ b/cjs/vega/NewAsset/encode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var encode$1 = require('../AssetDetails/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.changes) writer.bytes(1, encode$1.encode(obj.changes)); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/NewFreeform.cjs b/cjs/vega/NewFreeform.cjs new file mode 100644 index 0000000..1f84a40 --- /dev/null +++ b/cjs/vega/NewFreeform.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./NewFreeform/encode.cjs'); +var decode = require('./NewFreeform/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/NewFreeform/decode.cjs b/cjs/vega/NewFreeform/decode.cjs new file mode 100644 index 0000000..e62c080 --- /dev/null +++ b/cjs/vega/NewFreeform/decode.cjs @@ -0,0 +1,13 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + } + return {} +} + +exports.decode = decode; diff --git a/cjs/vega/NewFreeform/encode.cjs b/cjs/vega/NewFreeform/encode.cjs new file mode 100644 index 0000000..380d8dc --- /dev/null +++ b/cjs/vega/NewFreeform/encode.cjs @@ -0,0 +1,17 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/NewMarket.cjs b/cjs/vega/NewMarket.cjs new file mode 100644 index 0000000..a347b48 --- /dev/null +++ b/cjs/vega/NewMarket.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./NewMarket/encode.cjs'); +var decode = require('./NewMarket/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/NewMarket/decode.cjs b/cjs/vega/NewMarket/decode.cjs new file mode 100644 index 0000000..06e5b7a --- /dev/null +++ b/cjs/vega/NewMarket/decode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var decode$1 = require('../NewMarketConfiguration/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$changes = {}; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$changes = decode$1.decode(data); + break + } + } + return { changes: field$changes } +} + +exports.decode = decode; diff --git a/cjs/vega/NewMarket/encode.cjs b/cjs/vega/NewMarket/encode.cjs new file mode 100644 index 0000000..61ab2ae --- /dev/null +++ b/cjs/vega/NewMarket/encode.cjs @@ -0,0 +1,21 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var encode$1 = require('../NewMarketConfiguration/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.changes) + writer.bytes(1, encode$1.encode(obj.changes)); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/NewMarketConfiguration.cjs b/cjs/vega/NewMarketConfiguration.cjs new file mode 100644 index 0000000..d5f6bdf --- /dev/null +++ b/cjs/vega/NewMarketConfiguration.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./NewMarketConfiguration/encode.cjs'); +var decode = require('./NewMarketConfiguration/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/NewMarketConfiguration/decode.cjs b/cjs/vega/NewMarketConfiguration/decode.cjs new file mode 100644 index 0000000..652f014 --- /dev/null +++ b/cjs/vega/NewMarketConfiguration/decode.cjs @@ -0,0 +1,96 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$6 = require('../InstrumentConfiguration/decode.cjs'); +var decode$5 = require('../PriceMonitoringParameters/decode.cjs'); +var decode$4 = require('../LiquidityMonitoringParameters/decode.cjs'); +var decode$3 = require('../SimpleModelParams/decode.cjs'); +var decode$2 = require('../LogNormalRiskModel/decode.cjs'); +var decode$1 = require('../SuccessorConfiguration/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$instrument = {}; + let field$decimalPlaces = 0n; + const field$metadata = []; + let field$priceMonitoringParameters = {}; + let field$liquidityMonitoringParameters = {}; + let field$positionDecimalPlaces = 0n; + let field$lpPriceRange = ''; + let field$linearSlippageFactor = ''; + let field$quadraticSlippageFactor = ''; + let field$successor = null; + let field$risk_parameters = null; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$instrument = decode$6.decode(data); + break + + case 2: + field$decimalPlaces = types.uint64(data); + break + + case 3: + field$metadata.push(types.string(data)); + break + + case 4: + field$priceMonitoringParameters = + decode$5.decode(data); + break + + case 5: + field$liquidityMonitoringParameters = + decode$4.decode(data); + break + + case 100: + field$risk_parameters = { simple: decode$3.decode(data) }; + break + + case 101: + field$risk_parameters = { + logNormal: decode$2.decode(data) + }; + break + + case 6: + field$positionDecimalPlaces = types.int64(data); + break + + case 8: + field$lpPriceRange = types.string(data); + break + + case 9: + field$linearSlippageFactor = types.string(data); + break + + case 10: + field$quadraticSlippageFactor = types.string(data); + break + + case 11: + field$successor = decode$1.decode(data); + break + } + } + return { + instrument: field$instrument, + decimalPlaces: field$decimalPlaces, + metadata: field$metadata, + priceMonitoringParameters: field$priceMonitoringParameters, + liquidityMonitoringParameters: field$liquidityMonitoringParameters, + positionDecimalPlaces: field$positionDecimalPlaces, + lpPriceRange: field$lpPriceRange, + linearSlippageFactor: field$linearSlippageFactor, + quadraticSlippageFactor: field$quadraticSlippageFactor, + successor: field$successor, + risk_parameters: field$risk_parameters + } +} + +exports.decode = decode; diff --git a/cjs/vega/NewMarketConfiguration/encode.cjs b/cjs/vega/NewMarketConfiguration/encode.cjs new file mode 100644 index 0000000..a79635c --- /dev/null +++ b/cjs/vega/NewMarketConfiguration/encode.cjs @@ -0,0 +1,64 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../InstrumentConfiguration/encode.cjs'); +var encode$2 = require('../PriceMonitoringParameters/encode.cjs'); +var encode$3 = require('../LiquidityMonitoringParameters/encode.cjs'); +var encode$5 = require('../SimpleModelParams/encode.cjs'); +var encode$6 = require('../LogNormalRiskModel/encode.cjs'); +var encode$4 = require('../SuccessorConfiguration/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.instrument) + writer.bytes(1, encode$1.encode(obj.instrument)); + if (obj.decimalPlaces) writer.varint(2, obj.decimalPlaces, types.uint64); + if (obj.metadata?.length) + obj.metadata.forEach((v) => writer.bytes(3, v, types.string)); + if (obj.priceMonitoringParameters) + writer.bytes( + 4, + encode$2.encode(obj.priceMonitoringParameters) + ); + if (obj.liquidityMonitoringParameters) + writer.bytes( + 5, + encode$3.encode( + obj.liquidityMonitoringParameters + ) + ); + if (obj.positionDecimalPlaces) + writer.varint(6, obj.positionDecimalPlaces, types.int64); + if (obj.lpPriceRange) writer.bytes(8, obj.lpPriceRange, types.string); + if (obj.linearSlippageFactor) + writer.bytes(9, obj.linearSlippageFactor, types.string); + if (obj.quadraticSlippageFactor) + writer.bytes(10, obj.quadraticSlippageFactor, types.string); + if (obj.successor) + writer.bytes(11, encode$4.encode(obj.successor)); + + if (obj.risk_parameters?.simple ?? obj.simple) + writer.bytes( + 100, + encode$5.encode(obj.risk_parameters?.simple ?? obj.simple) + ); + if (obj.risk_parameters?.logNormal ?? obj.logNormal) + writer.bytes( + 101, + encode$6.encode( + obj.risk_parameters?.logNormal ?? obj.logNormal + ) + ); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/NewSpotMarket.cjs b/cjs/vega/NewSpotMarket.cjs new file mode 100644 index 0000000..a569cb1 --- /dev/null +++ b/cjs/vega/NewSpotMarket.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./NewSpotMarket/encode.cjs'); +var decode = require('./NewSpotMarket/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/NewSpotMarket/decode.cjs b/cjs/vega/NewSpotMarket/decode.cjs new file mode 100644 index 0000000..1d53a8a --- /dev/null +++ b/cjs/vega/NewSpotMarket/decode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var decode$1 = require('../NewSpotMarketConfiguration/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$changes = {}; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$changes = decode$1.decode(data); + break + } + } + return { changes: field$changes } +} + +exports.decode = decode; diff --git a/cjs/vega/NewSpotMarket/encode.cjs b/cjs/vega/NewSpotMarket/encode.cjs new file mode 100644 index 0000000..6936fe7 --- /dev/null +++ b/cjs/vega/NewSpotMarket/encode.cjs @@ -0,0 +1,21 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var encode$1 = require('../NewSpotMarketConfiguration/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.changes) + writer.bytes(1, encode$1.encode(obj.changes)); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/NewSpotMarketConfiguration.cjs b/cjs/vega/NewSpotMarketConfiguration.cjs new file mode 100644 index 0000000..905724d --- /dev/null +++ b/cjs/vega/NewSpotMarketConfiguration.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./NewSpotMarketConfiguration/encode.cjs'); +var decode = require('./NewSpotMarketConfiguration/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/NewSpotMarketConfiguration/decode.cjs b/cjs/vega/NewSpotMarketConfiguration/decode.cjs new file mode 100644 index 0000000..2fe4114 --- /dev/null +++ b/cjs/vega/NewSpotMarketConfiguration/decode.cjs @@ -0,0 +1,70 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$5 = require('../InstrumentConfiguration/decode.cjs'); +var decode$4 = require('../PriceMonitoringParameters/decode.cjs'); +var decode$3 = require('../TargetStakeParameters/decode.cjs'); +var decode$2 = require('../SimpleModelParams/decode.cjs'); +var decode$1 = require('../LogNormalRiskModel/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$instrument = {}; + let field$decimalPlaces = 0n; + const field$metadata = []; + let field$priceMonitoringParameters = {}; + let field$targetStakeParameters = {}; + let field$positionDecimalPlaces = 0n; + let field$risk_parameters = null; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$instrument = decode$5.decode(data); + break + + case 2: + field$decimalPlaces = types.uint64(data); + break + + case 3: + field$metadata.push(types.string(data)); + break + + case 4: + field$priceMonitoringParameters = + decode$4.decode(data); + break + + case 5: + field$targetStakeParameters = decode$3.decode(data); + break + + case 100: + field$risk_parameters = { simple: decode$2.decode(data) }; + break + + case 101: + field$risk_parameters = { + logNormal: decode$1.decode(data) + }; + break + + case 6: + field$positionDecimalPlaces = types.int64(data); + break + } + } + return { + instrument: field$instrument, + decimalPlaces: field$decimalPlaces, + metadata: field$metadata, + priceMonitoringParameters: field$priceMonitoringParameters, + targetStakeParameters: field$targetStakeParameters, + positionDecimalPlaces: field$positionDecimalPlaces, + risk_parameters: field$risk_parameters + } +} + +exports.decode = decode; diff --git a/cjs/vega/NewSpotMarketConfiguration/encode.cjs b/cjs/vega/NewSpotMarketConfiguration/encode.cjs new file mode 100644 index 0000000..e0a4e32 --- /dev/null +++ b/cjs/vega/NewSpotMarketConfiguration/encode.cjs @@ -0,0 +1,54 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../InstrumentConfiguration/encode.cjs'); +var encode$2 = require('../PriceMonitoringParameters/encode.cjs'); +var encode$3 = require('../TargetStakeParameters/encode.cjs'); +var encode$4 = require('../SimpleModelParams/encode.cjs'); +var encode$5 = require('../LogNormalRiskModel/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.instrument) + writer.bytes(1, encode$1.encode(obj.instrument)); + if (obj.decimalPlaces) writer.varint(2, obj.decimalPlaces, types.uint64); + if (obj.metadata?.length) + obj.metadata.forEach((v) => writer.bytes(3, v, types.string)); + if (obj.priceMonitoringParameters) + writer.bytes( + 4, + encode$2.encode(obj.priceMonitoringParameters) + ); + if (obj.targetStakeParameters) + writer.bytes( + 5, + encode$3.encode(obj.targetStakeParameters) + ); + if (obj.positionDecimalPlaces) + writer.varint(6, obj.positionDecimalPlaces, types.int64); + + if (obj.risk_parameters?.simple ?? obj.simple) + writer.bytes( + 100, + encode$4.encode(obj.risk_parameters?.simple ?? obj.simple) + ); + if (obj.risk_parameters?.logNormal ?? obj.logNormal) + writer.bytes( + 101, + encode$5.encode( + obj.risk_parameters?.logNormal ?? obj.logNormal + ) + ); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/NewTransfer.cjs b/cjs/vega/NewTransfer.cjs new file mode 100644 index 0000000..43128e0 --- /dev/null +++ b/cjs/vega/NewTransfer.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./NewTransfer/encode.cjs'); +var decode = require('./NewTransfer/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/NewTransfer/decode.cjs b/cjs/vega/NewTransfer/decode.cjs new file mode 100644 index 0000000..e05cc3c --- /dev/null +++ b/cjs/vega/NewTransfer/decode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var decode$1 = require('../NewTransferConfiguration/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$changes = {}; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$changes = decode$1.decode(data); + break + } + } + return { changes: field$changes } +} + +exports.decode = decode; diff --git a/cjs/vega/NewTransfer/encode.cjs b/cjs/vega/NewTransfer/encode.cjs new file mode 100644 index 0000000..e58982d --- /dev/null +++ b/cjs/vega/NewTransfer/encode.cjs @@ -0,0 +1,21 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var encode$1 = require('../NewTransferConfiguration/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.changes) + writer.bytes(1, encode$1.encode(obj.changes)); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/NewTransferConfiguration.cjs b/cjs/vega/NewTransferConfiguration.cjs new file mode 100644 index 0000000..8f4051d --- /dev/null +++ b/cjs/vega/NewTransferConfiguration.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./NewTransferConfiguration/encode.cjs'); +var decode = require('./NewTransferConfiguration/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/NewTransferConfiguration/decode.cjs b/cjs/vega/NewTransferConfiguration/decode.cjs new file mode 100644 index 0000000..da392ef --- /dev/null +++ b/cjs/vega/NewTransferConfiguration/decode.cjs @@ -0,0 +1,78 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var AccountType = require('../AccountType.cjs'); +var GovernanceTransferType = require('../GovernanceTransferType.cjs'); +var decode$2 = require('../OneOffTransfer/decode.cjs'); +var decode$1 = require('../RecurringTransfer/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$sourceType = 0; + let field$source = ''; + let field$transferType = 0; + let field$amount = ''; + let field$asset = ''; + let field$fractionOfBalance = ''; + let field$destinationType = 0; + let field$destination = ''; + let field$kind = null; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$sourceType = AccountType.decode(data); + break + + case 2: + field$source = types.string(data); + break + + case 3: + field$transferType = GovernanceTransferType.decode(data); + break + + case 4: + field$amount = types.string(data); + break + + case 5: + field$asset = types.string(data); + break + + case 6: + field$fractionOfBalance = types.string(data); + break + + case 7: + field$destinationType = AccountType.decode(data); + break + + case 8: + field$destination = types.string(data); + break + + case 101: + field$kind = { oneOff: decode$2.decode(data) }; + break + + case 102: + field$kind = { recurring: decode$1.decode(data) }; + break + } + } + return { + sourceType: field$sourceType, + source: field$source, + transferType: field$transferType, + amount: field$amount, + asset: field$asset, + fractionOfBalance: field$fractionOfBalance, + destinationType: field$destinationType, + destination: field$destination, + kind: field$kind + } +} + +exports.decode = decode; diff --git a/cjs/vega/NewTransferConfiguration/encode.cjs b/cjs/vega/NewTransferConfiguration/encode.cjs new file mode 100644 index 0000000..2566c90 --- /dev/null +++ b/cjs/vega/NewTransferConfiguration/encode.cjs @@ -0,0 +1,44 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var AccountType = require('../AccountType.cjs'); +var GovernanceTransferType = require('../GovernanceTransferType.cjs'); +var encode$1 = require('../OneOffTransfer/encode.cjs'); +var encode$2 = require('../RecurringTransfer/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.sourceType) writer.varint(1, obj.sourceType, AccountType); + if (obj.source) writer.bytes(2, obj.source, types.string); + if (obj.transferType) + writer.varint(3, obj.transferType, GovernanceTransferType); + if (obj.amount) writer.bytes(4, obj.amount, types.string); + if (obj.asset) writer.bytes(5, obj.asset, types.string); + if (obj.fractionOfBalance) writer.bytes(6, obj.fractionOfBalance, types.string); + if (obj.destinationType) + writer.varint(7, obj.destinationType, AccountType); + if (obj.destination) writer.bytes(8, obj.destination, types.string); + + if (obj.kind?.oneOff ?? obj.oneOff) + writer.bytes( + 101, + encode$1.encode(obj.kind?.oneOff ?? obj.oneOff) + ); + if (obj.kind?.recurring ?? obj.recurring) + writer.bytes( + 102, + encode$2.encode(obj.kind?.recurring ?? obj.recurring) + ); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/Node.cjs b/cjs/vega/Node.cjs new file mode 100644 index 0000000..f97fe5c --- /dev/null +++ b/cjs/vega/Node.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./Node/encode.cjs'); +var decode = require('./Node/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/Node/decode.cjs b/cjs/vega/Node/decode.cjs new file mode 100644 index 0000000..261f7fb --- /dev/null +++ b/cjs/vega/Node/decode.cjs @@ -0,0 +1,129 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$4 = require('../EpochData/decode.cjs'); +var NodeStatus = require('../NodeStatus.cjs'); +var decode$3 = require('../Delegation/decode.cjs'); +var decode$2 = require('../RewardScore/decode.cjs'); +var decode$1 = require('../RankingScore/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$id = ''; + let field$pubKey = ''; + let field$tmPubKey = ''; + let field$ethereumAddress = ''; + let field$infoUrl = ''; + let field$location = ''; + let field$stakedByOperator = ''; + let field$stakedByDelegates = ''; + let field$stakedTotal = ''; + let field$maxIntendedStake = ''; + let field$pendingStake = ''; + let field$epochData = {}; + let field$status = 0; + const field$delegations = []; + let field$rewardScore = {}; + let field$rankingScore = {}; + let field$name = ''; + let field$avatarUrl = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$id = types.string(data); + break + + case 2: + field$pubKey = types.string(data); + break + + case 3: + field$tmPubKey = types.string(data); + break + + case 4: + field$ethereumAddress = types.string(data); + break + + case 5: + field$infoUrl = types.string(data); + break + + case 6: + field$location = types.string(data); + break + + case 7: + field$stakedByOperator = types.string(data); + break + + case 8: + field$stakedByDelegates = types.string(data); + break + + case 9: + field$stakedTotal = types.string(data); + break + + case 10: + field$maxIntendedStake = types.string(data); + break + + case 11: + field$pendingStake = types.string(data); + break + + case 12: + field$epochData = decode$4.decode(data); + break + + case 13: + field$status = NodeStatus.decode(data); + break + + case 14: + field$delegations.push(decode$3.decode(data)); + break + + case 15: + field$rewardScore = decode$2.decode(data); + break + + case 16: + field$rankingScore = decode$1.decode(data); + break + + case 17: + field$name = types.string(data); + break + + case 18: + field$avatarUrl = types.string(data); + break + } + } + return { + id: field$id, + pubKey: field$pubKey, + tmPubKey: field$tmPubKey, + ethereumAddress: field$ethereumAddress, + infoUrl: field$infoUrl, + location: field$location, + stakedByOperator: field$stakedByOperator, + stakedByDelegates: field$stakedByDelegates, + stakedTotal: field$stakedTotal, + maxIntendedStake: field$maxIntendedStake, + pendingStake: field$pendingStake, + epochData: field$epochData, + status: field$status, + delegations: field$delegations, + rewardScore: field$rewardScore, + rankingScore: field$rankingScore, + name: field$name, + avatarUrl: field$avatarUrl + } +} + +exports.decode = decode; diff --git a/cjs/vega/Node/encode.cjs b/cjs/vega/Node/encode.cjs new file mode 100644 index 0000000..01d883b --- /dev/null +++ b/cjs/vega/Node/encode.cjs @@ -0,0 +1,45 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../EpochData/encode.cjs'); +var NodeStatus = require('../NodeStatus.cjs'); +var encode$2 = require('../Delegation/encode.cjs'); +var encode$3 = require('../RewardScore/encode.cjs'); +var encode$4 = require('../RankingScore/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.id) writer.bytes(1, obj.id, types.string); + if (obj.pubKey) writer.bytes(2, obj.pubKey, types.string); + if (obj.tmPubKey) writer.bytes(3, obj.tmPubKey, types.string); + if (obj.ethereumAddress) writer.bytes(4, obj.ethereumAddress, types.string); + if (obj.infoUrl) writer.bytes(5, obj.infoUrl, types.string); + if (obj.location) writer.bytes(6, obj.location, types.string); + if (obj.stakedByOperator) writer.bytes(7, obj.stakedByOperator, types.string); + if (obj.stakedByDelegates) writer.bytes(8, obj.stakedByDelegates, types.string); + if (obj.stakedTotal) writer.bytes(9, obj.stakedTotal, types.string); + if (obj.maxIntendedStake) writer.bytes(10, obj.maxIntendedStake, types.string); + if (obj.pendingStake) writer.bytes(11, obj.pendingStake, types.string); + if (obj.epochData) writer.bytes(12, encode$1.encode(obj.epochData)); + if (obj.status) writer.varint(13, obj.status, NodeStatus); + if (obj.delegations?.length) + obj.delegations.forEach((v) => writer.bytes(14, encode$2.encode(v))); + if (obj.rewardScore) + writer.bytes(15, encode$3.encode(obj.rewardScore)); + if (obj.rankingScore) + writer.bytes(16, encode$4.encode(obj.rankingScore)); + if (obj.name) writer.bytes(17, obj.name, types.string); + if (obj.avatarUrl) writer.bytes(18, obj.avatarUrl, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/NodeData.cjs b/cjs/vega/NodeData.cjs new file mode 100644 index 0000000..10a76ec --- /dev/null +++ b/cjs/vega/NodeData.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./NodeData/encode.cjs'); +var decode = require('./NodeData/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/NodeData/decode.cjs b/cjs/vega/NodeData/decode.cjs new file mode 100644 index 0000000..7b4bbd4 --- /dev/null +++ b/cjs/vega/NodeData/decode.cjs @@ -0,0 +1,59 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$1 = require('../NodeSet/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$stakedTotal = ''; + let field$totalNodes = 0; + let field$inactiveNodes = 0; + let field$tendermintNodes = {}; + let field$ersatzNodes = {}; + let field$pendingNodes = {}; + let field$uptime = 0; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$stakedTotal = types.string(data); + break + + case 2: + field$totalNodes = types.uint32(data); + break + + case 3: + field$inactiveNodes = types.uint32(data); + break + + case 4: + field$tendermintNodes = decode$1.decode(data); + break + + case 5: + field$ersatzNodes = decode$1.decode(data); + break + + case 6: + field$pendingNodes = decode$1.decode(data); + break + + case 7: + field$uptime = types.float(data); + break + } + } + return { + stakedTotal: field$stakedTotal, + totalNodes: field$totalNodes, + inactiveNodes: field$inactiveNodes, + tendermintNodes: field$tendermintNodes, + ersatzNodes: field$ersatzNodes, + pendingNodes: field$pendingNodes, + uptime: field$uptime + } +} + +exports.decode = decode; diff --git a/cjs/vega/NodeData/encode.cjs b/cjs/vega/NodeData/encode.cjs new file mode 100644 index 0000000..92ca345 --- /dev/null +++ b/cjs/vega/NodeData/encode.cjs @@ -0,0 +1,28 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../NodeSet/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.stakedTotal) writer.bytes(1, obj.stakedTotal, types.string); + if (obj.totalNodes) writer.varint(2, obj.totalNodes, types.uint32); + if (obj.inactiveNodes) writer.varint(3, obj.inactiveNodes, types.uint32); + if (obj.tendermintNodes) + writer.bytes(4, encode$1.encode(obj.tendermintNodes)); + if (obj.ersatzNodes) writer.bytes(5, encode$1.encode(obj.ersatzNodes)); + if (obj.pendingNodes) writer.bytes(6, encode$1.encode(obj.pendingNodes)); + if (obj.uptime) writer.fixed32(7, obj.uptime, types.float); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/NodeSet.cjs b/cjs/vega/NodeSet.cjs new file mode 100644 index 0000000..b907ddc --- /dev/null +++ b/cjs/vega/NodeSet.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./NodeSet/encode.cjs'); +var decode = require('./NodeSet/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/NodeSet/decode.cjs b/cjs/vega/NodeSet/decode.cjs new file mode 100644 index 0000000..54b7a4b --- /dev/null +++ b/cjs/vega/NodeSet/decode.cjs @@ -0,0 +1,46 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$total = 0; + let field$inactive = 0; + const field$promoted = []; + const field$demoted = []; + let field$maximum = null; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$total = types.uint32(data); + break + + case 2: + field$inactive = types.uint32(data); + break + + case 3: + field$promoted.push(types.string(data)); + break + + case 4: + field$demoted.push(types.string(data)); + break + + case 5: + field$maximum = types.uint32(data); + break + } + } + return { + total: field$total, + inactive: field$inactive, + promoted: field$promoted, + demoted: field$demoted, + maximum: field$maximum + } +} + +exports.decode = decode; diff --git a/cjs/vega/NodeSet/encode.cjs b/cjs/vega/NodeSet/encode.cjs new file mode 100644 index 0000000..c33bf50 --- /dev/null +++ b/cjs/vega/NodeSet/encode.cjs @@ -0,0 +1,26 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.total) writer.varint(1, obj.total, types.uint32); + if (obj.inactive) writer.varint(2, obj.inactive, types.uint32); + if (obj.promoted?.length) + obj.promoted.forEach((v) => writer.bytes(3, v, types.string)); + if (obj.demoted?.length) + obj.demoted.forEach((v) => writer.bytes(4, v, types.string)); + if (obj.maximum) writer.varint(5, obj.maximum, types.uint32); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/NodeStatus.cjs b/cjs/vega/NodeStatus.cjs new file mode 100644 index 0000000..de554b2 --- /dev/null +++ b/cjs/vega/NodeStatus.cjs @@ -0,0 +1,70 @@ +'use strict'; + +var assert = require('nanoassert'); +var types = require('protobuf-codec/encode/types'); +var types$1 = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +const NODE_STATUS_UNSPECIFIED = 0; +const NODE_STATUS_VALIDATOR = 1; +const NODE_STATUS_NON_VALIDATOR = 2; + +const enumValues = new Map([ + [0, 'NODE_STATUS_UNSPECIFIED'], + [1, 'NODE_STATUS_VALIDATOR'], + [2, 'NODE_STATUS_NON_VALIDATOR'] +]); +const enumNames = new Map([ + ['NODE_STATUS_UNSPECIFIED', 0], + ['NODE_STATUS_VALIDATOR', 1], + ['NODE_STATUS_NON_VALIDATOR', 2] +]); + +function encode(value, buf, byteOffset = 0) { + if (typeof value === 'string') return encode(parse(value), buf, byteOffset) + if (value == null) throw new Error('Invalid NodeStatus value (' + value + ')') + + return types.enumerable.encode(value, buf, byteOffset) +} + +function decode(varint) { + const int = types$1.enumerable(varint); + + return stringify(int) ?? int +} + +function encodingLength(value) { + if (typeof value === 'string') return encodingLength(parse(value)) + assert(value != null, 'Invalid NodeStatus value (' + value + ')'); + + if (0 <= value && value <= 2) return 1 + + // enumerable max value in case of unknown value + return 5 +} + +/** + * Convert an enum value to it's human readable name. + * Returns undefined on an unknown value. + */ +function stringify(int) { + return enumValues.get(int) +} + +/** + * Convert an enum string names to it's machine integer value. + * Returns undefined on an unknown name. + */ +function parse(str) { + return enumNames.get(str) +} + +exports.NODE_STATUS_NON_VALIDATOR = NODE_STATUS_NON_VALIDATOR; +exports.NODE_STATUS_UNSPECIFIED = NODE_STATUS_UNSPECIFIED; +exports.NODE_STATUS_VALIDATOR = NODE_STATUS_VALIDATOR; +exports.decode = decode; +exports.encode = encode; +exports.encodingLength = encodingLength; +exports.parse = parse; +exports.stringify = stringify; diff --git a/cjs/vega/OneOffTransfer.cjs b/cjs/vega/OneOffTransfer.cjs new file mode 100644 index 0000000..2df3aec --- /dev/null +++ b/cjs/vega/OneOffTransfer.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./OneOffTransfer/encode.cjs'); +var decode = require('./OneOffTransfer/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/OneOffTransfer/decode.cjs b/cjs/vega/OneOffTransfer/decode.cjs new file mode 100644 index 0000000..fae97ab --- /dev/null +++ b/cjs/vega/OneOffTransfer/decode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$deliverOn = 0n; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$deliverOn = types.int64(data); + break + } + } + return { deliverOn: field$deliverOn } +} + +exports.decode = decode; diff --git a/cjs/vega/OneOffTransfer/encode.cjs b/cjs/vega/OneOffTransfer/encode.cjs new file mode 100644 index 0000000..b1501e9 --- /dev/null +++ b/cjs/vega/OneOffTransfer/encode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.deliverOn) writer.varint(1, obj.deliverOn, types.int64); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/Order.cjs b/cjs/vega/Order.cjs new file mode 100644 index 0000000..dc71300 --- /dev/null +++ b/cjs/vega/Order.cjs @@ -0,0 +1,15 @@ +'use strict'; + +var encode = require('./Order/encode.cjs'); +var decode = require('./Order/decode.cjs'); +var TimeInForce = require('./Order/TimeInForce.cjs'); +var Type = require('./Order/Type.cjs'); +var Status = require('./Order/Status.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; +exports.TimeInForce = TimeInForce; +exports.Type = Type; +exports.Status = Status; diff --git a/cjs/vega/Order/Status.cjs b/cjs/vega/Order/Status.cjs new file mode 100644 index 0000000..221cc27 --- /dev/null +++ b/cjs/vega/Order/Status.cjs @@ -0,0 +1,94 @@ +'use strict'; + +var assert = require('nanoassert'); +var types = require('protobuf-codec/encode/types'); +var types$1 = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +const STATUS_UNSPECIFIED = 0; +const STATUS_ACTIVE = 1; +const STATUS_EXPIRED = 2; +const STATUS_CANCELLED = 3; +const STATUS_STOPPED = 4; +const STATUS_FILLED = 5; +const STATUS_REJECTED = 6; +const STATUS_PARTIALLY_FILLED = 7; +const STATUS_PARKED = 8; + +const enumValues = new Map([ + [0, 'STATUS_UNSPECIFIED'], + [1, 'STATUS_ACTIVE'], + [2, 'STATUS_EXPIRED'], + [3, 'STATUS_CANCELLED'], + [4, 'STATUS_STOPPED'], + [5, 'STATUS_FILLED'], + [6, 'STATUS_REJECTED'], + [7, 'STATUS_PARTIALLY_FILLED'], + [8, 'STATUS_PARKED'] +]); +const enumNames = new Map([ + ['STATUS_UNSPECIFIED', 0], + ['STATUS_ACTIVE', 1], + ['STATUS_EXPIRED', 2], + ['STATUS_CANCELLED', 3], + ['STATUS_STOPPED', 4], + ['STATUS_FILLED', 5], + ['STATUS_REJECTED', 6], + ['STATUS_PARTIALLY_FILLED', 7], + ['STATUS_PARKED', 8] +]); + +function encode(value, buf, byteOffset = 0) { + if (typeof value === 'string') return encode(parse(value), buf, byteOffset) + if (value == null) throw new Error('Invalid Status value (' + value + ')') + + return types.enumerable.encode(value, buf, byteOffset) +} + +function decode(varint) { + const int = types$1.enumerable(varint); + + return stringify(int) ?? int +} + +function encodingLength(value) { + if (typeof value === 'string') return encodingLength(parse(value)) + assert(value != null, 'Invalid Status value (' + value + ')'); + + if (0 <= value && value <= 8) return 1 + + // enumerable max value in case of unknown value + return 5 +} + +/** + * Convert an enum value to it's human readable name. + * Returns undefined on an unknown value. + */ +function stringify(int) { + return enumValues.get(int) +} + +/** + * Convert an enum string names to it's machine integer value. + * Returns undefined on an unknown name. + */ +function parse(str) { + return enumNames.get(str) +} + +exports.STATUS_ACTIVE = STATUS_ACTIVE; +exports.STATUS_CANCELLED = STATUS_CANCELLED; +exports.STATUS_EXPIRED = STATUS_EXPIRED; +exports.STATUS_FILLED = STATUS_FILLED; +exports.STATUS_PARKED = STATUS_PARKED; +exports.STATUS_PARTIALLY_FILLED = STATUS_PARTIALLY_FILLED; +exports.STATUS_REJECTED = STATUS_REJECTED; +exports.STATUS_STOPPED = STATUS_STOPPED; +exports.STATUS_UNSPECIFIED = STATUS_UNSPECIFIED; +exports.decode = decode; +exports.encode = encode; +exports.encodingLength = encodingLength; +exports.parse = parse; +exports.stringify = stringify; diff --git a/cjs/vega/Order/TimeInForce.cjs b/cjs/vega/Order/TimeInForce.cjs new file mode 100644 index 0000000..898f03b --- /dev/null +++ b/cjs/vega/Order/TimeInForce.cjs @@ -0,0 +1,87 @@ +'use strict'; + +var assert = require('nanoassert'); +var types = require('protobuf-codec/encode/types'); +var types$1 = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +const TIME_IN_FORCE_UNSPECIFIED = 0; +const TIME_IN_FORCE_GTC = 1; +const TIME_IN_FORCE_GTT = 2; +const TIME_IN_FORCE_IOC = 3; +const TIME_IN_FORCE_FOK = 4; +const TIME_IN_FORCE_GFA = 5; +const TIME_IN_FORCE_GFN = 6; + +const enumValues = new Map([ + [0, 'TIME_IN_FORCE_UNSPECIFIED'], + [1, 'TIME_IN_FORCE_GTC'], + [2, 'TIME_IN_FORCE_GTT'], + [3, 'TIME_IN_FORCE_IOC'], + [4, 'TIME_IN_FORCE_FOK'], + [5, 'TIME_IN_FORCE_GFA'], + [6, 'TIME_IN_FORCE_GFN'] +]); +const enumNames = new Map([ + ['TIME_IN_FORCE_UNSPECIFIED', 0], + ['TIME_IN_FORCE_GTC', 1], + ['TIME_IN_FORCE_GTT', 2], + ['TIME_IN_FORCE_IOC', 3], + ['TIME_IN_FORCE_FOK', 4], + ['TIME_IN_FORCE_GFA', 5], + ['TIME_IN_FORCE_GFN', 6] +]); + +function encode(value, buf, byteOffset = 0) { + if (typeof value === 'string') return encode(parse(value), buf, byteOffset) + if (value == null) + throw new Error('Invalid TimeInForce value (' + value + ')') + + return types.enumerable.encode(value, buf, byteOffset) +} + +function decode(varint) { + const int = types$1.enumerable(varint); + + return stringify(int) ?? int +} + +function encodingLength(value) { + if (typeof value === 'string') return encodingLength(parse(value)) + assert(value != null, 'Invalid TimeInForce value (' + value + ')'); + + if (0 <= value && value <= 6) return 1 + + // enumerable max value in case of unknown value + return 5 +} + +/** + * Convert an enum value to it's human readable name. + * Returns undefined on an unknown value. + */ +function stringify(int) { + return enumValues.get(int) +} + +/** + * Convert an enum string names to it's machine integer value. + * Returns undefined on an unknown name. + */ +function parse(str) { + return enumNames.get(str) +} + +exports.TIME_IN_FORCE_FOK = TIME_IN_FORCE_FOK; +exports.TIME_IN_FORCE_GFA = TIME_IN_FORCE_GFA; +exports.TIME_IN_FORCE_GFN = TIME_IN_FORCE_GFN; +exports.TIME_IN_FORCE_GTC = TIME_IN_FORCE_GTC; +exports.TIME_IN_FORCE_GTT = TIME_IN_FORCE_GTT; +exports.TIME_IN_FORCE_IOC = TIME_IN_FORCE_IOC; +exports.TIME_IN_FORCE_UNSPECIFIED = TIME_IN_FORCE_UNSPECIFIED; +exports.decode = decode; +exports.encode = encode; +exports.encodingLength = encodingLength; +exports.parse = parse; +exports.stringify = stringify; diff --git a/cjs/vega/Order/Type.cjs b/cjs/vega/Order/Type.cjs new file mode 100644 index 0000000..2915a88 --- /dev/null +++ b/cjs/vega/Order/Type.cjs @@ -0,0 +1,74 @@ +'use strict'; + +var assert = require('nanoassert'); +var types = require('protobuf-codec/encode/types'); +var types$1 = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +const TYPE_UNSPECIFIED = 0; +const TYPE_LIMIT = 1; +const TYPE_MARKET = 2; +const TYPE_NETWORK = 3; + +const enumValues = new Map([ + [0, 'TYPE_UNSPECIFIED'], + [1, 'TYPE_LIMIT'], + [2, 'TYPE_MARKET'], + [3, 'TYPE_NETWORK'] +]); +const enumNames = new Map([ + ['TYPE_UNSPECIFIED', 0], + ['TYPE_LIMIT', 1], + ['TYPE_MARKET', 2], + ['TYPE_NETWORK', 3] +]); + +function encode(value, buf, byteOffset = 0) { + if (typeof value === 'string') return encode(parse(value), buf, byteOffset) + if (value == null) throw new Error('Invalid Type value (' + value + ')') + + return types.enumerable.encode(value, buf, byteOffset) +} + +function decode(varint) { + const int = types$1.enumerable(varint); + + return stringify(int) ?? int +} + +function encodingLength(value) { + if (typeof value === 'string') return encodingLength(parse(value)) + assert(value != null, 'Invalid Type value (' + value + ')'); + + if (0 <= value && value <= 3) return 1 + + // enumerable max value in case of unknown value + return 5 +} + +/** + * Convert an enum value to it's human readable name. + * Returns undefined on an unknown value. + */ +function stringify(int) { + return enumValues.get(int) +} + +/** + * Convert an enum string names to it's machine integer value. + * Returns undefined on an unknown name. + */ +function parse(str) { + return enumNames.get(str) +} + +exports.TYPE_LIMIT = TYPE_LIMIT; +exports.TYPE_MARKET = TYPE_MARKET; +exports.TYPE_NETWORK = TYPE_NETWORK; +exports.TYPE_UNSPECIFIED = TYPE_UNSPECIFIED; +exports.decode = decode; +exports.encode = encode; +exports.encodingLength = encodingLength; +exports.parse = parse; +exports.stringify = stringify; diff --git a/cjs/vega/Order/decode.cjs b/cjs/vega/Order/decode.cjs new file mode 100644 index 0000000..d6ca4dc --- /dev/null +++ b/cjs/vega/Order/decode.cjs @@ -0,0 +1,155 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var Side = require('../Side.cjs'); +var TimeInForce = require('./TimeInForce.cjs'); +var Type = require('./Type.cjs'); +var Status = require('./Status.cjs'); +var OrderError = require('../OrderError.cjs'); +var decode$2 = require('../PeggedOrder/decode.cjs'); +var decode$1 = require('../IcebergOrder/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$id = ''; + let field$marketId = ''; + let field$partyId = ''; + let field$side = 0; + let field$price = ''; + let field$size = 0n; + let field$remaining = 0n; + let field$timeInForce = 0; + let field$type = 0; + let field$createdAt = 0n; + let field$status = 0; + let field$expiresAt = 0n; + let field$reference = ''; + let field$reason = null; + let field$updatedAt = 0n; + let field$version = 0n; + let field$batchId = 0n; + let field$peggedOrder = {}; + let field$liquidityProvisionId = ''; + let field$postOnly = false; + let field$reduceOnly = false; + let field$icebergOrder = null; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$id = types.string(data); + break + + case 2: + field$marketId = types.string(data); + break + + case 3: + field$partyId = types.string(data); + break + + case 4: + field$side = Side.decode(data); + break + + case 5: + field$price = types.string(data); + break + + case 6: + field$size = types.uint64(data); + break + + case 7: + field$remaining = types.uint64(data); + break + + case 8: + field$timeInForce = TimeInForce.decode(data); + break + + case 9: + field$type = Type.decode(data); + break + + case 10: + field$createdAt = types.int64(data); + break + + case 11: + field$status = Status.decode(data); + break + + case 12: + field$expiresAt = types.int64(data); + break + + case 13: + field$reference = types.string(data); + break + + case 14: + field$reason = OrderError.decode(data); + break + + case 15: + field$updatedAt = types.int64(data); + break + + case 16: + field$version = types.uint64(data); + break + + case 17: + field$batchId = types.uint64(data); + break + + case 18: + field$peggedOrder = decode$2.decode(data); + break + + case 19: + field$liquidityProvisionId = types.string(data); + break + + case 20: + field$postOnly = types.bool(data); + break + + case 21: + field$reduceOnly = types.bool(data); + break + + case 22: + field$icebergOrder = decode$1.decode(data); + break + } + } + return { + id: field$id, + marketId: field$marketId, + partyId: field$partyId, + side: field$side, + price: field$price, + size: field$size, + remaining: field$remaining, + timeInForce: field$timeInForce, + type: field$type, + createdAt: field$createdAt, + status: field$status, + expiresAt: field$expiresAt, + reference: field$reference, + reason: field$reason, + updatedAt: field$updatedAt, + version: field$version, + batchId: field$batchId, + peggedOrder: field$peggedOrder, + liquidityProvisionId: field$liquidityProvisionId, + postOnly: field$postOnly, + reduceOnly: field$reduceOnly, + icebergOrder: field$icebergOrder + } +} + +exports.decode = decode; diff --git a/cjs/vega/Order/encode.cjs b/cjs/vega/Order/encode.cjs new file mode 100644 index 0000000..e5c8a26 --- /dev/null +++ b/cjs/vega/Order/encode.cjs @@ -0,0 +1,52 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var Side = require('../Side.cjs'); +var TimeInForce = require('./TimeInForce.cjs'); +var Type = require('./Type.cjs'); +var Status = require('./Status.cjs'); +var OrderError = require('../OrderError.cjs'); +var encode$1 = require('../PeggedOrder/encode.cjs'); +var encode$2 = require('../IcebergOrder/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.id) writer.bytes(1, obj.id, types.string); + if (obj.marketId) writer.bytes(2, obj.marketId, types.string); + if (obj.partyId) writer.bytes(3, obj.partyId, types.string); + if (obj.side) writer.varint(4, obj.side, Side); + if (obj.price) writer.bytes(5, obj.price, types.string); + if (obj.size) writer.varint(6, obj.size, types.uint64); + if (obj.remaining) writer.varint(7, obj.remaining, types.uint64); + if (obj.timeInForce) + writer.varint(8, obj.timeInForce, TimeInForce); + if (obj.type) writer.varint(9, obj.type, Type); + if (obj.createdAt) writer.varint(10, obj.createdAt, types.int64); + if (obj.status) writer.varint(11, obj.status, Status); + if (obj.expiresAt) writer.varint(12, obj.expiresAt, types.int64); + if (obj.reference) writer.bytes(13, obj.reference, types.string); + if (obj.reason) writer.varint(14, obj.reason, OrderError); + if (obj.updatedAt) writer.varint(15, obj.updatedAt, types.int64); + if (obj.version) writer.varint(16, obj.version, types.uint64); + if (obj.batchId) writer.varint(17, obj.batchId, types.uint64); + if (obj.peggedOrder) + writer.bytes(18, encode$1.encode(obj.peggedOrder)); + if (obj.liquidityProvisionId) + writer.bytes(19, obj.liquidityProvisionId, types.string); + if (obj.postOnly) writer.varint(20, obj.postOnly, types.bool); + if (obj.reduceOnly) writer.varint(21, obj.reduceOnly, types.bool); + if (obj.icebergOrder) + writer.bytes(22, encode$2.encode(obj.icebergOrder)); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/OrderCancellationConfirmation.cjs b/cjs/vega/OrderCancellationConfirmation.cjs new file mode 100644 index 0000000..e0ca755 --- /dev/null +++ b/cjs/vega/OrderCancellationConfirmation.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./OrderCancellationConfirmation/encode.cjs'); +var decode = require('./OrderCancellationConfirmation/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/OrderCancellationConfirmation/decode.cjs b/cjs/vega/OrderCancellationConfirmation/decode.cjs new file mode 100644 index 0000000..791ce5f --- /dev/null +++ b/cjs/vega/OrderCancellationConfirmation/decode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var decode$1 = require('../Order/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$order = {}; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$order = decode$1.decode(data); + break + } + } + return { order: field$order } +} + +exports.decode = decode; diff --git a/cjs/vega/OrderCancellationConfirmation/encode.cjs b/cjs/vega/OrderCancellationConfirmation/encode.cjs new file mode 100644 index 0000000..71c4ae8 --- /dev/null +++ b/cjs/vega/OrderCancellationConfirmation/encode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var encode$1 = require('../Order/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.order) writer.bytes(1, encode$1.encode(obj.order)); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/OrderConfirmation.cjs b/cjs/vega/OrderConfirmation.cjs new file mode 100644 index 0000000..2fbaba9 --- /dev/null +++ b/cjs/vega/OrderConfirmation.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./OrderConfirmation/encode.cjs'); +var decode = require('./OrderConfirmation/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/OrderConfirmation/decode.cjs b/cjs/vega/OrderConfirmation/decode.cjs new file mode 100644 index 0000000..4caac46 --- /dev/null +++ b/cjs/vega/OrderConfirmation/decode.cjs @@ -0,0 +1,35 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var decode$1 = require('../Order/decode.cjs'); +var decode$2 = require('../Trade/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$order = {}; + const field$trades = []; + const field$passiveOrdersAffected = []; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$order = decode$1.decode(data); + break + + case 2: + field$trades.push(decode$2.decode(data)); + break + + case 3: + field$passiveOrdersAffected.push(decode$1.decode(data)); + break + } + } + return { + order: field$order, + trades: field$trades, + passiveOrdersAffected: field$passiveOrdersAffected + } +} + +exports.decode = decode; diff --git a/cjs/vega/OrderConfirmation/encode.cjs b/cjs/vega/OrderConfirmation/encode.cjs new file mode 100644 index 0000000..bf7b4a7 --- /dev/null +++ b/cjs/vega/OrderConfirmation/encode.cjs @@ -0,0 +1,27 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var encode$1 = require('../Order/encode.cjs'); +var encode$2 = require('../Trade/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.order) writer.bytes(1, encode$1.encode(obj.order)); + if (obj.trades?.length) + obj.trades.forEach((v) => writer.bytes(2, encode$2.encode(v))); + if (obj.passiveOrdersAffected?.length) + obj.passiveOrdersAffected.forEach((v) => + writer.bytes(3, encode$1.encode(v)) + ); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/OrderError.cjs b/cjs/vega/OrderError.cjs new file mode 100644 index 0000000..500afb1 --- /dev/null +++ b/cjs/vega/OrderError.cjs @@ -0,0 +1,254 @@ +'use strict'; + +var assert = require('nanoassert'); +var types = require('protobuf-codec/encode/types'); +var types$1 = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +const ORDER_ERROR_UNSPECIFIED = 0; +const ORDER_ERROR_INVALID_MARKET_ID = 1; +const ORDER_ERROR_INVALID_ORDER_ID = 2; +const ORDER_ERROR_OUT_OF_SEQUENCE = 3; +const ORDER_ERROR_INVALID_REMAINING_SIZE = 4; +const ORDER_ERROR_TIME_FAILURE = 5; +const ORDER_ERROR_REMOVAL_FAILURE = 6; +const ORDER_ERROR_INVALID_EXPIRATION_DATETIME = 7; +const ORDER_ERROR_INVALID_ORDER_REFERENCE = 8; +const ORDER_ERROR_EDIT_NOT_ALLOWED = 9; +const ORDER_ERROR_AMEND_FAILURE = 10; +const ORDER_ERROR_NOT_FOUND = 11; +const ORDER_ERROR_INVALID_PARTY_ID = 12; +const ORDER_ERROR_MARKET_CLOSED = 13; +const ORDER_ERROR_MARGIN_CHECK_FAILED = 14; +const ORDER_ERROR_MISSING_GENERAL_ACCOUNT = 15; +const ORDER_ERROR_INTERNAL_ERROR = 16; +const ORDER_ERROR_INVALID_SIZE = 17; +const ORDER_ERROR_INVALID_PERSISTENCE = 18; +const ORDER_ERROR_INVALID_TYPE = 19; +const ORDER_ERROR_SELF_TRADING = 20; +const ORDER_ERROR_INSUFFICIENT_FUNDS_TO_PAY_FEES = 21; +const ORDER_ERROR_INCORRECT_MARKET_TYPE = 22; +const ORDER_ERROR_INVALID_TIME_IN_FORCE = 23; +const ORDER_ERROR_CANNOT_SEND_GFN_ORDER_DURING_AN_AUCTION = 24; +const ORDER_ERROR_CANNOT_SEND_GFA_ORDER_DURING_CONTINUOUS_TRADING = 25; +const ORDER_ERROR_CANNOT_AMEND_TO_GTT_WITHOUT_EXPIRYAT = 26; +const ORDER_ERROR_EXPIRYAT_BEFORE_CREATEDAT = 27; +const ORDER_ERROR_CANNOT_HAVE_GTC_AND_EXPIRYAT = 28; +const ORDER_ERROR_CANNOT_AMEND_TO_FOK_OR_IOC = 29; +const ORDER_ERROR_CANNOT_AMEND_TO_GFA_OR_GFN = 30; +const ORDER_ERROR_CANNOT_AMEND_FROM_GFA_OR_GFN = 31; +const ORDER_ERROR_CANNOT_SEND_IOC_ORDER_DURING_AUCTION = 32; +const ORDER_ERROR_CANNOT_SEND_FOK_ORDER_DURING_AUCTION = 33; +const ORDER_ERROR_MUST_BE_LIMIT_ORDER = 34; +const ORDER_ERROR_MUST_BE_GTT_OR_GTC = 35; +const ORDER_ERROR_WITHOUT_REFERENCE_PRICE = 36; +const ORDER_ERROR_BUY_CANNOT_REFERENCE_BEST_ASK_PRICE = 37; +const ORDER_ERROR_OFFSET_MUST_BE_GREATER_OR_EQUAL_TO_ZERO = 40; +const ORDER_ERROR_SELL_CANNOT_REFERENCE_BEST_BID_PRICE = 41; +const ORDER_ERROR_OFFSET_MUST_BE_GREATER_THAN_ZERO = 42; +const ORDER_ERROR_INSUFFICIENT_ASSET_BALANCE = 43; +const ORDER_ERROR_CANNOT_AMEND_PEGGED_ORDER_DETAILS_ON_NON_PEGGED_ORDER = 44; +const ORDER_ERROR_UNABLE_TO_REPRICE_PEGGED_ORDER = 45; +const ORDER_ERROR_UNABLE_TO_AMEND_PRICE_ON_PEGGED_ORDER = 46; +const ORDER_ERROR_NON_PERSISTENT_ORDER_OUT_OF_PRICE_BOUNDS = 47; +const ORDER_ERROR_TOO_MANY_PEGGED_ORDERS = 48; +const ORDER_ERROR_POST_ONLY_ORDER_WOULD_TRADE = 49; +const ORDER_ERROR_REDUCE_ONLY_ORDER_WOULD_NOT_REDUCE_POSITION = 50; + +const enumValues = new Map([ + [0, 'ORDER_ERROR_UNSPECIFIED'], + [1, 'ORDER_ERROR_INVALID_MARKET_ID'], + [2, 'ORDER_ERROR_INVALID_ORDER_ID'], + [3, 'ORDER_ERROR_OUT_OF_SEQUENCE'], + [4, 'ORDER_ERROR_INVALID_REMAINING_SIZE'], + [5, 'ORDER_ERROR_TIME_FAILURE'], + [6, 'ORDER_ERROR_REMOVAL_FAILURE'], + [7, 'ORDER_ERROR_INVALID_EXPIRATION_DATETIME'], + [8, 'ORDER_ERROR_INVALID_ORDER_REFERENCE'], + [9, 'ORDER_ERROR_EDIT_NOT_ALLOWED'], + [10, 'ORDER_ERROR_AMEND_FAILURE'], + [11, 'ORDER_ERROR_NOT_FOUND'], + [12, 'ORDER_ERROR_INVALID_PARTY_ID'], + [13, 'ORDER_ERROR_MARKET_CLOSED'], + [14, 'ORDER_ERROR_MARGIN_CHECK_FAILED'], + [15, 'ORDER_ERROR_MISSING_GENERAL_ACCOUNT'], + [16, 'ORDER_ERROR_INTERNAL_ERROR'], + [17, 'ORDER_ERROR_INVALID_SIZE'], + [18, 'ORDER_ERROR_INVALID_PERSISTENCE'], + [19, 'ORDER_ERROR_INVALID_TYPE'], + [20, 'ORDER_ERROR_SELF_TRADING'], + [21, 'ORDER_ERROR_INSUFFICIENT_FUNDS_TO_PAY_FEES'], + [22, 'ORDER_ERROR_INCORRECT_MARKET_TYPE'], + [23, 'ORDER_ERROR_INVALID_TIME_IN_FORCE'], + [24, 'ORDER_ERROR_CANNOT_SEND_GFN_ORDER_DURING_AN_AUCTION'], + [25, 'ORDER_ERROR_CANNOT_SEND_GFA_ORDER_DURING_CONTINUOUS_TRADING'], + [26, 'ORDER_ERROR_CANNOT_AMEND_TO_GTT_WITHOUT_EXPIRYAT'], + [27, 'ORDER_ERROR_EXPIRYAT_BEFORE_CREATEDAT'], + [28, 'ORDER_ERROR_CANNOT_HAVE_GTC_AND_EXPIRYAT'], + [29, 'ORDER_ERROR_CANNOT_AMEND_TO_FOK_OR_IOC'], + [30, 'ORDER_ERROR_CANNOT_AMEND_TO_GFA_OR_GFN'], + [31, 'ORDER_ERROR_CANNOT_AMEND_FROM_GFA_OR_GFN'], + [32, 'ORDER_ERROR_CANNOT_SEND_IOC_ORDER_DURING_AUCTION'], + [33, 'ORDER_ERROR_CANNOT_SEND_FOK_ORDER_DURING_AUCTION'], + [34, 'ORDER_ERROR_MUST_BE_LIMIT_ORDER'], + [35, 'ORDER_ERROR_MUST_BE_GTT_OR_GTC'], + [36, 'ORDER_ERROR_WITHOUT_REFERENCE_PRICE'], + [37, 'ORDER_ERROR_BUY_CANNOT_REFERENCE_BEST_ASK_PRICE'], + [40, 'ORDER_ERROR_OFFSET_MUST_BE_GREATER_OR_EQUAL_TO_ZERO'], + [41, 'ORDER_ERROR_SELL_CANNOT_REFERENCE_BEST_BID_PRICE'], + [42, 'ORDER_ERROR_OFFSET_MUST_BE_GREATER_THAN_ZERO'], + [43, 'ORDER_ERROR_INSUFFICIENT_ASSET_BALANCE'], + [44, 'ORDER_ERROR_CANNOT_AMEND_PEGGED_ORDER_DETAILS_ON_NON_PEGGED_ORDER'], + [45, 'ORDER_ERROR_UNABLE_TO_REPRICE_PEGGED_ORDER'], + [46, 'ORDER_ERROR_UNABLE_TO_AMEND_PRICE_ON_PEGGED_ORDER'], + [47, 'ORDER_ERROR_NON_PERSISTENT_ORDER_OUT_OF_PRICE_BOUNDS'], + [48, 'ORDER_ERROR_TOO_MANY_PEGGED_ORDERS'], + [49, 'ORDER_ERROR_POST_ONLY_ORDER_WOULD_TRADE'], + [50, 'ORDER_ERROR_REDUCE_ONLY_ORDER_WOULD_NOT_REDUCE_POSITION'] +]); +const enumNames = new Map([ + ['ORDER_ERROR_UNSPECIFIED', 0], + ['ORDER_ERROR_INVALID_MARKET_ID', 1], + ['ORDER_ERROR_INVALID_ORDER_ID', 2], + ['ORDER_ERROR_OUT_OF_SEQUENCE', 3], + ['ORDER_ERROR_INVALID_REMAINING_SIZE', 4], + ['ORDER_ERROR_TIME_FAILURE', 5], + ['ORDER_ERROR_REMOVAL_FAILURE', 6], + ['ORDER_ERROR_INVALID_EXPIRATION_DATETIME', 7], + ['ORDER_ERROR_INVALID_ORDER_REFERENCE', 8], + ['ORDER_ERROR_EDIT_NOT_ALLOWED', 9], + ['ORDER_ERROR_AMEND_FAILURE', 10], + ['ORDER_ERROR_NOT_FOUND', 11], + ['ORDER_ERROR_INVALID_PARTY_ID', 12], + ['ORDER_ERROR_MARKET_CLOSED', 13], + ['ORDER_ERROR_MARGIN_CHECK_FAILED', 14], + ['ORDER_ERROR_MISSING_GENERAL_ACCOUNT', 15], + ['ORDER_ERROR_INTERNAL_ERROR', 16], + ['ORDER_ERROR_INVALID_SIZE', 17], + ['ORDER_ERROR_INVALID_PERSISTENCE', 18], + ['ORDER_ERROR_INVALID_TYPE', 19], + ['ORDER_ERROR_SELF_TRADING', 20], + ['ORDER_ERROR_INSUFFICIENT_FUNDS_TO_PAY_FEES', 21], + ['ORDER_ERROR_INCORRECT_MARKET_TYPE', 22], + ['ORDER_ERROR_INVALID_TIME_IN_FORCE', 23], + ['ORDER_ERROR_CANNOT_SEND_GFN_ORDER_DURING_AN_AUCTION', 24], + ['ORDER_ERROR_CANNOT_SEND_GFA_ORDER_DURING_CONTINUOUS_TRADING', 25], + ['ORDER_ERROR_CANNOT_AMEND_TO_GTT_WITHOUT_EXPIRYAT', 26], + ['ORDER_ERROR_EXPIRYAT_BEFORE_CREATEDAT', 27], + ['ORDER_ERROR_CANNOT_HAVE_GTC_AND_EXPIRYAT', 28], + ['ORDER_ERROR_CANNOT_AMEND_TO_FOK_OR_IOC', 29], + ['ORDER_ERROR_CANNOT_AMEND_TO_GFA_OR_GFN', 30], + ['ORDER_ERROR_CANNOT_AMEND_FROM_GFA_OR_GFN', 31], + ['ORDER_ERROR_CANNOT_SEND_IOC_ORDER_DURING_AUCTION', 32], + ['ORDER_ERROR_CANNOT_SEND_FOK_ORDER_DURING_AUCTION', 33], + ['ORDER_ERROR_MUST_BE_LIMIT_ORDER', 34], + ['ORDER_ERROR_MUST_BE_GTT_OR_GTC', 35], + ['ORDER_ERROR_WITHOUT_REFERENCE_PRICE', 36], + ['ORDER_ERROR_BUY_CANNOT_REFERENCE_BEST_ASK_PRICE', 37], + ['ORDER_ERROR_OFFSET_MUST_BE_GREATER_OR_EQUAL_TO_ZERO', 40], + ['ORDER_ERROR_SELL_CANNOT_REFERENCE_BEST_BID_PRICE', 41], + ['ORDER_ERROR_OFFSET_MUST_BE_GREATER_THAN_ZERO', 42], + ['ORDER_ERROR_INSUFFICIENT_ASSET_BALANCE', 43], + ['ORDER_ERROR_CANNOT_AMEND_PEGGED_ORDER_DETAILS_ON_NON_PEGGED_ORDER', 44], + ['ORDER_ERROR_UNABLE_TO_REPRICE_PEGGED_ORDER', 45], + ['ORDER_ERROR_UNABLE_TO_AMEND_PRICE_ON_PEGGED_ORDER', 46], + ['ORDER_ERROR_NON_PERSISTENT_ORDER_OUT_OF_PRICE_BOUNDS', 47], + ['ORDER_ERROR_TOO_MANY_PEGGED_ORDERS', 48], + ['ORDER_ERROR_POST_ONLY_ORDER_WOULD_TRADE', 49], + ['ORDER_ERROR_REDUCE_ONLY_ORDER_WOULD_NOT_REDUCE_POSITION', 50] +]); + +function encode(value, buf, byteOffset = 0) { + if (typeof value === 'string') return encode(parse(value), buf, byteOffset) + if (value == null) throw new Error('Invalid OrderError value (' + value + ')') + + return types.enumerable.encode(value, buf, byteOffset) +} + +function decode(varint) { + const int = types$1.enumerable(varint); + + return stringify(int) ?? int +} + +function encodingLength(value) { + if (typeof value === 'string') return encodingLength(parse(value)) + assert(value != null, 'Invalid OrderError value (' + value + ')'); + + if (0 <= value && value <= 50) return 1 + + // enumerable max value in case of unknown value + return 5 +} + +/** + * Convert an enum value to it's human readable name. + * Returns undefined on an unknown value. + */ +function stringify(int) { + return enumValues.get(int) +} + +/** + * Convert an enum string names to it's machine integer value. + * Returns undefined on an unknown name. + */ +function parse(str) { + return enumNames.get(str) +} + +exports.ORDER_ERROR_AMEND_FAILURE = ORDER_ERROR_AMEND_FAILURE; +exports.ORDER_ERROR_BUY_CANNOT_REFERENCE_BEST_ASK_PRICE = ORDER_ERROR_BUY_CANNOT_REFERENCE_BEST_ASK_PRICE; +exports.ORDER_ERROR_CANNOT_AMEND_FROM_GFA_OR_GFN = ORDER_ERROR_CANNOT_AMEND_FROM_GFA_OR_GFN; +exports.ORDER_ERROR_CANNOT_AMEND_PEGGED_ORDER_DETAILS_ON_NON_PEGGED_ORDER = ORDER_ERROR_CANNOT_AMEND_PEGGED_ORDER_DETAILS_ON_NON_PEGGED_ORDER; +exports.ORDER_ERROR_CANNOT_AMEND_TO_FOK_OR_IOC = ORDER_ERROR_CANNOT_AMEND_TO_FOK_OR_IOC; +exports.ORDER_ERROR_CANNOT_AMEND_TO_GFA_OR_GFN = ORDER_ERROR_CANNOT_AMEND_TO_GFA_OR_GFN; +exports.ORDER_ERROR_CANNOT_AMEND_TO_GTT_WITHOUT_EXPIRYAT = ORDER_ERROR_CANNOT_AMEND_TO_GTT_WITHOUT_EXPIRYAT; +exports.ORDER_ERROR_CANNOT_HAVE_GTC_AND_EXPIRYAT = ORDER_ERROR_CANNOT_HAVE_GTC_AND_EXPIRYAT; +exports.ORDER_ERROR_CANNOT_SEND_FOK_ORDER_DURING_AUCTION = ORDER_ERROR_CANNOT_SEND_FOK_ORDER_DURING_AUCTION; +exports.ORDER_ERROR_CANNOT_SEND_GFA_ORDER_DURING_CONTINUOUS_TRADING = ORDER_ERROR_CANNOT_SEND_GFA_ORDER_DURING_CONTINUOUS_TRADING; +exports.ORDER_ERROR_CANNOT_SEND_GFN_ORDER_DURING_AN_AUCTION = ORDER_ERROR_CANNOT_SEND_GFN_ORDER_DURING_AN_AUCTION; +exports.ORDER_ERROR_CANNOT_SEND_IOC_ORDER_DURING_AUCTION = ORDER_ERROR_CANNOT_SEND_IOC_ORDER_DURING_AUCTION; +exports.ORDER_ERROR_EDIT_NOT_ALLOWED = ORDER_ERROR_EDIT_NOT_ALLOWED; +exports.ORDER_ERROR_EXPIRYAT_BEFORE_CREATEDAT = ORDER_ERROR_EXPIRYAT_BEFORE_CREATEDAT; +exports.ORDER_ERROR_INCORRECT_MARKET_TYPE = ORDER_ERROR_INCORRECT_MARKET_TYPE; +exports.ORDER_ERROR_INSUFFICIENT_ASSET_BALANCE = ORDER_ERROR_INSUFFICIENT_ASSET_BALANCE; +exports.ORDER_ERROR_INSUFFICIENT_FUNDS_TO_PAY_FEES = ORDER_ERROR_INSUFFICIENT_FUNDS_TO_PAY_FEES; +exports.ORDER_ERROR_INTERNAL_ERROR = ORDER_ERROR_INTERNAL_ERROR; +exports.ORDER_ERROR_INVALID_EXPIRATION_DATETIME = ORDER_ERROR_INVALID_EXPIRATION_DATETIME; +exports.ORDER_ERROR_INVALID_MARKET_ID = ORDER_ERROR_INVALID_MARKET_ID; +exports.ORDER_ERROR_INVALID_ORDER_ID = ORDER_ERROR_INVALID_ORDER_ID; +exports.ORDER_ERROR_INVALID_ORDER_REFERENCE = ORDER_ERROR_INVALID_ORDER_REFERENCE; +exports.ORDER_ERROR_INVALID_PARTY_ID = ORDER_ERROR_INVALID_PARTY_ID; +exports.ORDER_ERROR_INVALID_PERSISTENCE = ORDER_ERROR_INVALID_PERSISTENCE; +exports.ORDER_ERROR_INVALID_REMAINING_SIZE = ORDER_ERROR_INVALID_REMAINING_SIZE; +exports.ORDER_ERROR_INVALID_SIZE = ORDER_ERROR_INVALID_SIZE; +exports.ORDER_ERROR_INVALID_TIME_IN_FORCE = ORDER_ERROR_INVALID_TIME_IN_FORCE; +exports.ORDER_ERROR_INVALID_TYPE = ORDER_ERROR_INVALID_TYPE; +exports.ORDER_ERROR_MARGIN_CHECK_FAILED = ORDER_ERROR_MARGIN_CHECK_FAILED; +exports.ORDER_ERROR_MARKET_CLOSED = ORDER_ERROR_MARKET_CLOSED; +exports.ORDER_ERROR_MISSING_GENERAL_ACCOUNT = ORDER_ERROR_MISSING_GENERAL_ACCOUNT; +exports.ORDER_ERROR_MUST_BE_GTT_OR_GTC = ORDER_ERROR_MUST_BE_GTT_OR_GTC; +exports.ORDER_ERROR_MUST_BE_LIMIT_ORDER = ORDER_ERROR_MUST_BE_LIMIT_ORDER; +exports.ORDER_ERROR_NON_PERSISTENT_ORDER_OUT_OF_PRICE_BOUNDS = ORDER_ERROR_NON_PERSISTENT_ORDER_OUT_OF_PRICE_BOUNDS; +exports.ORDER_ERROR_NOT_FOUND = ORDER_ERROR_NOT_FOUND; +exports.ORDER_ERROR_OFFSET_MUST_BE_GREATER_OR_EQUAL_TO_ZERO = ORDER_ERROR_OFFSET_MUST_BE_GREATER_OR_EQUAL_TO_ZERO; +exports.ORDER_ERROR_OFFSET_MUST_BE_GREATER_THAN_ZERO = ORDER_ERROR_OFFSET_MUST_BE_GREATER_THAN_ZERO; +exports.ORDER_ERROR_OUT_OF_SEQUENCE = ORDER_ERROR_OUT_OF_SEQUENCE; +exports.ORDER_ERROR_POST_ONLY_ORDER_WOULD_TRADE = ORDER_ERROR_POST_ONLY_ORDER_WOULD_TRADE; +exports.ORDER_ERROR_REDUCE_ONLY_ORDER_WOULD_NOT_REDUCE_POSITION = ORDER_ERROR_REDUCE_ONLY_ORDER_WOULD_NOT_REDUCE_POSITION; +exports.ORDER_ERROR_REMOVAL_FAILURE = ORDER_ERROR_REMOVAL_FAILURE; +exports.ORDER_ERROR_SELF_TRADING = ORDER_ERROR_SELF_TRADING; +exports.ORDER_ERROR_SELL_CANNOT_REFERENCE_BEST_BID_PRICE = ORDER_ERROR_SELL_CANNOT_REFERENCE_BEST_BID_PRICE; +exports.ORDER_ERROR_TIME_FAILURE = ORDER_ERROR_TIME_FAILURE; +exports.ORDER_ERROR_TOO_MANY_PEGGED_ORDERS = ORDER_ERROR_TOO_MANY_PEGGED_ORDERS; +exports.ORDER_ERROR_UNABLE_TO_AMEND_PRICE_ON_PEGGED_ORDER = ORDER_ERROR_UNABLE_TO_AMEND_PRICE_ON_PEGGED_ORDER; +exports.ORDER_ERROR_UNABLE_TO_REPRICE_PEGGED_ORDER = ORDER_ERROR_UNABLE_TO_REPRICE_PEGGED_ORDER; +exports.ORDER_ERROR_UNSPECIFIED = ORDER_ERROR_UNSPECIFIED; +exports.ORDER_ERROR_WITHOUT_REFERENCE_PRICE = ORDER_ERROR_WITHOUT_REFERENCE_PRICE; +exports.decode = decode; +exports.encode = encode; +exports.encodingLength = encodingLength; +exports.parse = parse; +exports.stringify = stringify; diff --git a/cjs/vega/Party.cjs b/cjs/vega/Party.cjs new file mode 100644 index 0000000..e9ff395 --- /dev/null +++ b/cjs/vega/Party.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./Party/encode.cjs'); +var decode = require('./Party/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/Party/decode.cjs b/cjs/vega/Party/decode.cjs new file mode 100644 index 0000000..bbd974a --- /dev/null +++ b/cjs/vega/Party/decode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$id = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$id = types.string(data); + break + } + } + return { id: field$id } +} + +exports.decode = decode; diff --git a/cjs/vega/Party/encode.cjs b/cjs/vega/Party/encode.cjs new file mode 100644 index 0000000..e19fde3 --- /dev/null +++ b/cjs/vega/Party/encode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.id) writer.bytes(1, obj.id, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/PeggedOrder.cjs b/cjs/vega/PeggedOrder.cjs new file mode 100644 index 0000000..6ba7cdf --- /dev/null +++ b/cjs/vega/PeggedOrder.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./PeggedOrder/encode.cjs'); +var decode = require('./PeggedOrder/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/PeggedOrder/decode.cjs b/cjs/vega/PeggedOrder/decode.cjs new file mode 100644 index 0000000..c2055e6 --- /dev/null +++ b/cjs/vega/PeggedOrder/decode.cjs @@ -0,0 +1,26 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var PeggedReference = require('../PeggedReference.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$reference = 0; + let field$offset = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$reference = PeggedReference.decode(data); + break + + case 2: + field$offset = types.string(data); + break + } + } + return { reference: field$reference, offset: field$offset } +} + +exports.decode = decode; diff --git a/cjs/vega/PeggedOrder/encode.cjs b/cjs/vega/PeggedOrder/encode.cjs new file mode 100644 index 0000000..18b34c9 --- /dev/null +++ b/cjs/vega/PeggedOrder/encode.cjs @@ -0,0 +1,22 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var PeggedReference = require('../PeggedReference.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.reference) writer.varint(1, obj.reference, PeggedReference); + if (obj.offset) writer.bytes(2, obj.offset, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/PeggedReference.cjs b/cjs/vega/PeggedReference.cjs new file mode 100644 index 0000000..6ff1f4e --- /dev/null +++ b/cjs/vega/PeggedReference.cjs @@ -0,0 +1,75 @@ +'use strict'; + +var assert = require('nanoassert'); +var types = require('protobuf-codec/encode/types'); +var types$1 = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +const PEGGED_REFERENCE_UNSPECIFIED = 0; +const PEGGED_REFERENCE_MID = 1; +const PEGGED_REFERENCE_BEST_BID = 2; +const PEGGED_REFERENCE_BEST_ASK = 3; + +const enumValues = new Map([ + [0, 'PEGGED_REFERENCE_UNSPECIFIED'], + [1, 'PEGGED_REFERENCE_MID'], + [2, 'PEGGED_REFERENCE_BEST_BID'], + [3, 'PEGGED_REFERENCE_BEST_ASK'] +]); +const enumNames = new Map([ + ['PEGGED_REFERENCE_UNSPECIFIED', 0], + ['PEGGED_REFERENCE_MID', 1], + ['PEGGED_REFERENCE_BEST_BID', 2], + ['PEGGED_REFERENCE_BEST_ASK', 3] +]); + +function encode(value, buf, byteOffset = 0) { + if (typeof value === 'string') return encode(parse(value), buf, byteOffset) + if (value == null) + throw new Error('Invalid PeggedReference value (' + value + ')') + + return types.enumerable.encode(value, buf, byteOffset) +} + +function decode(varint) { + const int = types$1.enumerable(varint); + + return stringify(int) ?? int +} + +function encodingLength(value) { + if (typeof value === 'string') return encodingLength(parse(value)) + assert(value != null, 'Invalid PeggedReference value (' + value + ')'); + + if (0 <= value && value <= 3) return 1 + + // enumerable max value in case of unknown value + return 5 +} + +/** + * Convert an enum value to it's human readable name. + * Returns undefined on an unknown value. + */ +function stringify(int) { + return enumValues.get(int) +} + +/** + * Convert an enum string names to it's machine integer value. + * Returns undefined on an unknown name. + */ +function parse(str) { + return enumNames.get(str) +} + +exports.PEGGED_REFERENCE_BEST_ASK = PEGGED_REFERENCE_BEST_ASK; +exports.PEGGED_REFERENCE_BEST_BID = PEGGED_REFERENCE_BEST_BID; +exports.PEGGED_REFERENCE_MID = PEGGED_REFERENCE_MID; +exports.PEGGED_REFERENCE_UNSPECIFIED = PEGGED_REFERENCE_UNSPECIFIED; +exports.decode = decode; +exports.encode = encode; +exports.encodingLength = encodingLength; +exports.parse = parse; +exports.stringify = stringify; diff --git a/cjs/vega/Position.cjs b/cjs/vega/Position.cjs new file mode 100644 index 0000000..1c43a8e --- /dev/null +++ b/cjs/vega/Position.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./Position/encode.cjs'); +var decode = require('./Position/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/Position/decode.cjs b/cjs/vega/Position/decode.cjs new file mode 100644 index 0000000..680cc66 --- /dev/null +++ b/cjs/vega/Position/decode.cjs @@ -0,0 +1,71 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var PositionStatus = require('../PositionStatus.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$marketId = ''; + let field$partyId = ''; + let field$openVolume = 0n; + let field$realisedPnl = ''; + let field$unrealisedPnl = ''; + let field$averageEntryPrice = ''; + let field$updatedAt = 0n; + let field$lossSocialisationAmount = ''; + let field$positionStatus = 0; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$marketId = types.string(data); + break + + case 2: + field$partyId = types.string(data); + break + + case 3: + field$openVolume = types.int64(data); + break + + case 4: + field$realisedPnl = types.string(data); + break + + case 5: + field$unrealisedPnl = types.string(data); + break + + case 6: + field$averageEntryPrice = types.string(data); + break + + case 7: + field$updatedAt = types.int64(data); + break + + case 8: + field$lossSocialisationAmount = types.string(data); + break + + case 9: + field$positionStatus = PositionStatus.decode(data); + break + } + } + return { + marketId: field$marketId, + partyId: field$partyId, + openVolume: field$openVolume, + realisedPnl: field$realisedPnl, + unrealisedPnl: field$unrealisedPnl, + averageEntryPrice: field$averageEntryPrice, + updatedAt: field$updatedAt, + lossSocialisationAmount: field$lossSocialisationAmount, + positionStatus: field$positionStatus + } +} + +exports.decode = decode; diff --git a/cjs/vega/Position/encode.cjs b/cjs/vega/Position/encode.cjs new file mode 100644 index 0000000..fac325f --- /dev/null +++ b/cjs/vega/Position/encode.cjs @@ -0,0 +1,31 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var PositionStatus = require('../PositionStatus.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.marketId) writer.bytes(1, obj.marketId, types.string); + if (obj.partyId) writer.bytes(2, obj.partyId, types.string); + if (obj.openVolume) writer.varint(3, obj.openVolume, types.int64); + if (obj.realisedPnl) writer.bytes(4, obj.realisedPnl, types.string); + if (obj.unrealisedPnl) writer.bytes(5, obj.unrealisedPnl, types.string); + if (obj.averageEntryPrice) writer.bytes(6, obj.averageEntryPrice, types.string); + if (obj.updatedAt) writer.varint(7, obj.updatedAt, types.int64); + if (obj.lossSocialisationAmount) + writer.bytes(8, obj.lossSocialisationAmount, types.string); + if (obj.positionStatus) + writer.varint(9, obj.positionStatus, PositionStatus); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/PositionStatus.cjs b/cjs/vega/PositionStatus.cjs new file mode 100644 index 0000000..6e8ae7c --- /dev/null +++ b/cjs/vega/PositionStatus.cjs @@ -0,0 +1,75 @@ +'use strict'; + +var assert = require('nanoassert'); +var types = require('protobuf-codec/encode/types'); +var types$1 = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +const POSITION_STATUS_UNSPECIFIED = 0; +const POSITION_STATUS_ORDERS_CLOSED = 1; +const POSITION_STATUS_CLOSED_OUT = 2; +const POSITION_STATUS_DISTRESSED = 4; + +const enumValues = new Map([ + [0, 'POSITION_STATUS_UNSPECIFIED'], + [1, 'POSITION_STATUS_ORDERS_CLOSED'], + [2, 'POSITION_STATUS_CLOSED_OUT'], + [4, 'POSITION_STATUS_DISTRESSED'] +]); +const enumNames = new Map([ + ['POSITION_STATUS_UNSPECIFIED', 0], + ['POSITION_STATUS_ORDERS_CLOSED', 1], + ['POSITION_STATUS_CLOSED_OUT', 2], + ['POSITION_STATUS_DISTRESSED', 4] +]); + +function encode(value, buf, byteOffset = 0) { + if (typeof value === 'string') return encode(parse(value), buf, byteOffset) + if (value == null) + throw new Error('Invalid PositionStatus value (' + value + ')') + + return types.enumerable.encode(value, buf, byteOffset) +} + +function decode(varint) { + const int = types$1.enumerable(varint); + + return stringify(int) ?? int +} + +function encodingLength(value) { + if (typeof value === 'string') return encodingLength(parse(value)) + assert(value != null, 'Invalid PositionStatus value (' + value + ')'); + + if (0 <= value && value <= 4) return 1 + + // enumerable max value in case of unknown value + return 5 +} + +/** + * Convert an enum value to it's human readable name. + * Returns undefined on an unknown value. + */ +function stringify(int) { + return enumValues.get(int) +} + +/** + * Convert an enum string names to it's machine integer value. + * Returns undefined on an unknown name. + */ +function parse(str) { + return enumNames.get(str) +} + +exports.POSITION_STATUS_CLOSED_OUT = POSITION_STATUS_CLOSED_OUT; +exports.POSITION_STATUS_DISTRESSED = POSITION_STATUS_DISTRESSED; +exports.POSITION_STATUS_ORDERS_CLOSED = POSITION_STATUS_ORDERS_CLOSED; +exports.POSITION_STATUS_UNSPECIFIED = POSITION_STATUS_UNSPECIFIED; +exports.decode = decode; +exports.encode = encode; +exports.encodingLength = encodingLength; +exports.parse = parse; +exports.stringify = stringify; diff --git a/cjs/vega/PositionTrade.cjs b/cjs/vega/PositionTrade.cjs new file mode 100644 index 0000000..3c0f633 --- /dev/null +++ b/cjs/vega/PositionTrade.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./PositionTrade/encode.cjs'); +var decode = require('./PositionTrade/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/PositionTrade/decode.cjs b/cjs/vega/PositionTrade/decode.cjs new file mode 100644 index 0000000..008c489 --- /dev/null +++ b/cjs/vega/PositionTrade/decode.cjs @@ -0,0 +1,25 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$volume = 0n; + let field$price = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$volume = types.int64(data); + break + + case 2: + field$price = types.string(data); + break + } + } + return { volume: field$volume, price: field$price } +} + +exports.decode = decode; diff --git a/cjs/vega/PositionTrade/encode.cjs b/cjs/vega/PositionTrade/encode.cjs new file mode 100644 index 0000000..3faf5e2 --- /dev/null +++ b/cjs/vega/PositionTrade/encode.cjs @@ -0,0 +1,21 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.volume) writer.varint(1, obj.volume, types.int64); + if (obj.price) writer.bytes(2, obj.price, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/PostTransferBalance.cjs b/cjs/vega/PostTransferBalance.cjs new file mode 100644 index 0000000..4c80e90 --- /dev/null +++ b/cjs/vega/PostTransferBalance.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./PostTransferBalance/encode.cjs'); +var decode = require('./PostTransferBalance/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/PostTransferBalance/decode.cjs b/cjs/vega/PostTransferBalance/decode.cjs new file mode 100644 index 0000000..8f50367 --- /dev/null +++ b/cjs/vega/PostTransferBalance/decode.cjs @@ -0,0 +1,26 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$1 = require('../AccountDetails/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$account = {}; + let field$balance = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$account = decode$1.decode(data); + break + + case 2: + field$balance = types.string(data); + break + } + } + return { account: field$account, balance: field$balance } +} + +exports.decode = decode; diff --git a/cjs/vega/PostTransferBalance/encode.cjs b/cjs/vega/PostTransferBalance/encode.cjs new file mode 100644 index 0000000..570cba0 --- /dev/null +++ b/cjs/vega/PostTransferBalance/encode.cjs @@ -0,0 +1,22 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../AccountDetails/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.account) writer.bytes(1, encode$1.encode(obj.account)); + if (obj.balance) writer.bytes(2, obj.balance, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/PriceLevel.cjs b/cjs/vega/PriceLevel.cjs new file mode 100644 index 0000000..d9d811b --- /dev/null +++ b/cjs/vega/PriceLevel.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./PriceLevel/encode.cjs'); +var decode = require('./PriceLevel/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/PriceLevel/decode.cjs b/cjs/vega/PriceLevel/decode.cjs new file mode 100644 index 0000000..308f9b7 --- /dev/null +++ b/cjs/vega/PriceLevel/decode.cjs @@ -0,0 +1,34 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$price = ''; + let field$numberOfOrders = 0n; + let field$volume = 0n; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$price = types.string(data); + break + + case 2: + field$numberOfOrders = types.uint64(data); + break + + case 3: + field$volume = types.uint64(data); + break + } + } + return { + price: field$price, + numberOfOrders: field$numberOfOrders, + volume: field$volume + } +} + +exports.decode = decode; diff --git a/cjs/vega/PriceLevel/encode.cjs b/cjs/vega/PriceLevel/encode.cjs new file mode 100644 index 0000000..3cac7ad --- /dev/null +++ b/cjs/vega/PriceLevel/encode.cjs @@ -0,0 +1,22 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.price) writer.bytes(1, obj.price, types.string); + if (obj.numberOfOrders) writer.varint(2, obj.numberOfOrders, types.uint64); + if (obj.volume) writer.varint(3, obj.volume, types.uint64); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/PriceMonitoringBounds.cjs b/cjs/vega/PriceMonitoringBounds.cjs new file mode 100644 index 0000000..741fa3c --- /dev/null +++ b/cjs/vega/PriceMonitoringBounds.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./PriceMonitoringBounds/encode.cjs'); +var decode = require('./PriceMonitoringBounds/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/PriceMonitoringBounds/decode.cjs b/cjs/vega/PriceMonitoringBounds/decode.cjs new file mode 100644 index 0000000..504ebaf --- /dev/null +++ b/cjs/vega/PriceMonitoringBounds/decode.cjs @@ -0,0 +1,41 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$1 = require('../PriceMonitoringTrigger/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$minValidPrice = ''; + let field$maxValidPrice = ''; + let field$trigger = {}; + let field$referencePrice = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$minValidPrice = types.string(data); + break + + case 2: + field$maxValidPrice = types.string(data); + break + + case 3: + field$trigger = decode$1.decode(data); + break + + case 4: + field$referencePrice = types.string(data); + break + } + } + return { + minValidPrice: field$minValidPrice, + maxValidPrice: field$maxValidPrice, + trigger: field$trigger, + referencePrice: field$referencePrice + } +} + +exports.decode = decode; diff --git a/cjs/vega/PriceMonitoringBounds/encode.cjs b/cjs/vega/PriceMonitoringBounds/encode.cjs new file mode 100644 index 0000000..56f48e2 --- /dev/null +++ b/cjs/vega/PriceMonitoringBounds/encode.cjs @@ -0,0 +1,25 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../PriceMonitoringTrigger/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.minValidPrice) writer.bytes(1, obj.minValidPrice, types.string); + if (obj.maxValidPrice) writer.bytes(2, obj.maxValidPrice, types.string); + if (obj.trigger) + writer.bytes(3, encode$1.encode(obj.trigger)); + if (obj.referencePrice) writer.bytes(4, obj.referencePrice, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/PriceMonitoringParameters.cjs b/cjs/vega/PriceMonitoringParameters.cjs new file mode 100644 index 0000000..52c213b --- /dev/null +++ b/cjs/vega/PriceMonitoringParameters.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./PriceMonitoringParameters/encode.cjs'); +var decode = require('./PriceMonitoringParameters/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/PriceMonitoringParameters/decode.cjs b/cjs/vega/PriceMonitoringParameters/decode.cjs new file mode 100644 index 0000000..68e0cb1 --- /dev/null +++ b/cjs/vega/PriceMonitoringParameters/decode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var decode$1 = require('../PriceMonitoringTrigger/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + const field$triggers = []; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$triggers.push(decode$1.decode(data)); + break + } + } + return { triggers: field$triggers } +} + +exports.decode = decode; diff --git a/cjs/vega/PriceMonitoringParameters/encode.cjs b/cjs/vega/PriceMonitoringParameters/encode.cjs new file mode 100644 index 0000000..31c7af7 --- /dev/null +++ b/cjs/vega/PriceMonitoringParameters/encode.cjs @@ -0,0 +1,23 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var encode$1 = require('../PriceMonitoringTrigger/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.triggers?.length) + obj.triggers.forEach((v) => + writer.bytes(1, encode$1.encode(v)) + ); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/PriceMonitoringSettings.cjs b/cjs/vega/PriceMonitoringSettings.cjs new file mode 100644 index 0000000..7fc439d --- /dev/null +++ b/cjs/vega/PriceMonitoringSettings.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./PriceMonitoringSettings/encode.cjs'); +var decode = require('./PriceMonitoringSettings/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/PriceMonitoringSettings/decode.cjs b/cjs/vega/PriceMonitoringSettings/decode.cjs new file mode 100644 index 0000000..3be591f --- /dev/null +++ b/cjs/vega/PriceMonitoringSettings/decode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var decode$1 = require('../PriceMonitoringParameters/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$parameters = {}; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$parameters = decode$1.decode(data); + break + } + } + return { parameters: field$parameters } +} + +exports.decode = decode; diff --git a/cjs/vega/PriceMonitoringSettings/encode.cjs b/cjs/vega/PriceMonitoringSettings/encode.cjs new file mode 100644 index 0000000..5405e3d --- /dev/null +++ b/cjs/vega/PriceMonitoringSettings/encode.cjs @@ -0,0 +1,21 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var encode$1 = require('../PriceMonitoringParameters/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.parameters) + writer.bytes(1, encode$1.encode(obj.parameters)); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/PriceMonitoringTrigger.cjs b/cjs/vega/PriceMonitoringTrigger.cjs new file mode 100644 index 0000000..ca8f3e1 --- /dev/null +++ b/cjs/vega/PriceMonitoringTrigger.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./PriceMonitoringTrigger/encode.cjs'); +var decode = require('./PriceMonitoringTrigger/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/PriceMonitoringTrigger/decode.cjs b/cjs/vega/PriceMonitoringTrigger/decode.cjs new file mode 100644 index 0000000..80f0a3b --- /dev/null +++ b/cjs/vega/PriceMonitoringTrigger/decode.cjs @@ -0,0 +1,34 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$horizon = 0n; + let field$probability = ''; + let field$auctionExtension = 0n; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$horizon = types.int64(data); + break + + case 2: + field$probability = types.string(data); + break + + case 3: + field$auctionExtension = types.int64(data); + break + } + } + return { + horizon: field$horizon, + probability: field$probability, + auctionExtension: field$auctionExtension + } +} + +exports.decode = decode; diff --git a/cjs/vega/PriceMonitoringTrigger/encode.cjs b/cjs/vega/PriceMonitoringTrigger/encode.cjs new file mode 100644 index 0000000..d27c41b --- /dev/null +++ b/cjs/vega/PriceMonitoringTrigger/encode.cjs @@ -0,0 +1,22 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.horizon) writer.varint(1, obj.horizon, types.int64); + if (obj.probability) writer.bytes(2, obj.probability, types.string); + if (obj.auctionExtension) writer.varint(3, obj.auctionExtension, types.int64); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/Proposal.cjs b/cjs/vega/Proposal.cjs new file mode 100644 index 0000000..637acd5 --- /dev/null +++ b/cjs/vega/Proposal.cjs @@ -0,0 +1,11 @@ +'use strict'; + +var encode = require('./Proposal/encode.cjs'); +var decode = require('./Proposal/decode.cjs'); +var State = require('./Proposal/State.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; +exports.State = State; diff --git a/cjs/vega/Proposal/State.cjs b/cjs/vega/Proposal/State.cjs new file mode 100644 index 0000000..9997fb9 --- /dev/null +++ b/cjs/vega/Proposal/State.cjs @@ -0,0 +1,90 @@ +'use strict'; + +var assert = require('nanoassert'); +var types = require('protobuf-codec/encode/types'); +var types$1 = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +const STATE_UNSPECIFIED = 0; +const STATE_FAILED = 1; +const STATE_OPEN = 2; +const STATE_PASSED = 3; +const STATE_REJECTED = 4; +const STATE_DECLINED = 5; +const STATE_ENACTED = 6; +const STATE_WAITING_FOR_NODE_VOTE = 7; + +const enumValues = new Map([ + [0, 'STATE_UNSPECIFIED'], + [1, 'STATE_FAILED'], + [2, 'STATE_OPEN'], + [3, 'STATE_PASSED'], + [4, 'STATE_REJECTED'], + [5, 'STATE_DECLINED'], + [6, 'STATE_ENACTED'], + [7, 'STATE_WAITING_FOR_NODE_VOTE'] +]); +const enumNames = new Map([ + ['STATE_UNSPECIFIED', 0], + ['STATE_FAILED', 1], + ['STATE_OPEN', 2], + ['STATE_PASSED', 3], + ['STATE_REJECTED', 4], + ['STATE_DECLINED', 5], + ['STATE_ENACTED', 6], + ['STATE_WAITING_FOR_NODE_VOTE', 7] +]); + +function encode(value, buf, byteOffset = 0) { + if (typeof value === 'string') return encode(parse(value), buf, byteOffset) + if (value == null) throw new Error('Invalid State value (' + value + ')') + + return types.enumerable.encode(value, buf, byteOffset) +} + +function decode(varint) { + const int = types$1.enumerable(varint); + + return stringify(int) ?? int +} + +function encodingLength(value) { + if (typeof value === 'string') return encodingLength(parse(value)) + assert(value != null, 'Invalid State value (' + value + ')'); + + if (0 <= value && value <= 7) return 1 + + // enumerable max value in case of unknown value + return 5 +} + +/** + * Convert an enum value to it's human readable name. + * Returns undefined on an unknown value. + */ +function stringify(int) { + return enumValues.get(int) +} + +/** + * Convert an enum string names to it's machine integer value. + * Returns undefined on an unknown name. + */ +function parse(str) { + return enumNames.get(str) +} + +exports.STATE_DECLINED = STATE_DECLINED; +exports.STATE_ENACTED = STATE_ENACTED; +exports.STATE_FAILED = STATE_FAILED; +exports.STATE_OPEN = STATE_OPEN; +exports.STATE_PASSED = STATE_PASSED; +exports.STATE_REJECTED = STATE_REJECTED; +exports.STATE_UNSPECIFIED = STATE_UNSPECIFIED; +exports.STATE_WAITING_FOR_NODE_VOTE = STATE_WAITING_FOR_NODE_VOTE; +exports.decode = decode; +exports.encode = encode; +exports.encodingLength = encodingLength; +exports.parse = parse; +exports.stringify = stringify; diff --git a/cjs/vega/Proposal/decode.cjs b/cjs/vega/Proposal/decode.cjs new file mode 100644 index 0000000..f94d5cc --- /dev/null +++ b/cjs/vega/Proposal/decode.cjs @@ -0,0 +1,99 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var State = require('./State.cjs'); +var decode$2 = require('../ProposalTerms/decode.cjs'); +var ProposalError = require('../ProposalError.cjs'); +var decode$1 = require('../ProposalRationale/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$id = ''; + let field$reference = ''; + let field$partyId = ''; + let field$state = 0; + let field$timestamp = 0n; + let field$terms = {}; + let field$reason = null; + let field$errorDetails = null; + let field$rationale = {}; + let field$requiredParticipation = ''; + let field$requiredMajority = ''; + let field$requiredLiquidityProviderParticipation = null; + let field$requiredLiquidityProviderMajority = null; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$id = types.string(data); + break + + case 2: + field$reference = types.string(data); + break + + case 3: + field$partyId = types.string(data); + break + + case 4: + field$state = State.decode(data); + break + + case 5: + field$timestamp = types.int64(data); + break + + case 6: + field$terms = decode$2.decode(data); + break + + case 7: + field$reason = ProposalError.decode(data); + break + + case 8: + field$errorDetails = types.string(data); + break + + case 9: + field$rationale = decode$1.decode(data); + break + + case 10: + field$requiredParticipation = types.string(data); + break + + case 11: + field$requiredMajority = types.string(data); + break + + case 12: + field$requiredLiquidityProviderParticipation = types.string(data); + break + + case 13: + field$requiredLiquidityProviderMajority = types.string(data); + break + } + } + return { + id: field$id, + reference: field$reference, + partyId: field$partyId, + state: field$state, + timestamp: field$timestamp, + terms: field$terms, + reason: field$reason, + errorDetails: field$errorDetails, + rationale: field$rationale, + requiredParticipation: field$requiredParticipation, + requiredMajority: field$requiredMajority, + requiredLiquidityProviderParticipation: + field$requiredLiquidityProviderParticipation, + requiredLiquidityProviderMajority: field$requiredLiquidityProviderMajority + } +} + +exports.decode = decode; diff --git a/cjs/vega/Proposal/encode.cjs b/cjs/vega/Proposal/encode.cjs new file mode 100644 index 0000000..de73c98 --- /dev/null +++ b/cjs/vega/Proposal/encode.cjs @@ -0,0 +1,40 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var State = require('./State.cjs'); +var encode$1 = require('../ProposalTerms/encode.cjs'); +var ProposalError = require('../ProposalError.cjs'); +var encode$2 = require('../ProposalRationale/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.id) writer.bytes(1, obj.id, types.string); + if (obj.reference) writer.bytes(2, obj.reference, types.string); + if (obj.partyId) writer.bytes(3, obj.partyId, types.string); + if (obj.state) writer.varint(4, obj.state, State); + if (obj.timestamp) writer.varint(5, obj.timestamp, types.int64); + if (obj.terms) writer.bytes(6, encode$1.encode(obj.terms)); + if (obj.reason) writer.varint(7, obj.reason, ProposalError); + if (obj.errorDetails) writer.bytes(8, obj.errorDetails, types.string); + if (obj.rationale) + writer.bytes(9, encode$2.encode(obj.rationale)); + if (obj.requiredParticipation) + writer.bytes(10, obj.requiredParticipation, types.string); + if (obj.requiredMajority) writer.bytes(11, obj.requiredMajority, types.string); + if (obj.requiredLiquidityProviderParticipation) + writer.bytes(12, obj.requiredLiquidityProviderParticipation, types.string); + if (obj.requiredLiquidityProviderMajority) + writer.bytes(13, obj.requiredLiquidityProviderMajority, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/ProposalError.cjs b/cjs/vega/ProposalError.cjs new file mode 100644 index 0000000..abd00e3 --- /dev/null +++ b/cjs/vega/ProposalError.cjs @@ -0,0 +1,243 @@ +'use strict'; + +var assert = require('nanoassert'); +var types = require('protobuf-codec/encode/types'); +var types$1 = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +const PROPOSAL_ERROR_UNSPECIFIED = 0; +const PROPOSAL_ERROR_CLOSE_TIME_TOO_SOON = 1; +const PROPOSAL_ERROR_CLOSE_TIME_TOO_LATE = 2; +const PROPOSAL_ERROR_ENACT_TIME_TOO_SOON = 3; +const PROPOSAL_ERROR_ENACT_TIME_TOO_LATE = 4; +const PROPOSAL_ERROR_INSUFFICIENT_TOKENS = 5; +const PROPOSAL_ERROR_INVALID_INSTRUMENT_SECURITY = 6; +const PROPOSAL_ERROR_NO_PRODUCT = 7; +const PROPOSAL_ERROR_UNSUPPORTED_PRODUCT = 8; +const PROPOSAL_ERROR_NO_TRADING_MODE = 11; +const PROPOSAL_ERROR_UNSUPPORTED_TRADING_MODE = 12; +const PROPOSAL_ERROR_NODE_VALIDATION_FAILED = 13; +const PROPOSAL_ERROR_MISSING_BUILTIN_ASSET_FIELD = 14; +const PROPOSAL_ERROR_MISSING_ERC20_CONTRACT_ADDRESS = 15; +const PROPOSAL_ERROR_INVALID_ASSET = 16; +const PROPOSAL_ERROR_INCOMPATIBLE_TIMESTAMPS = 17; +const PROPOSAL_ERROR_NO_RISK_PARAMETERS = 18; +const PROPOSAL_ERROR_NETWORK_PARAMETER_INVALID_KEY = 19; +const PROPOSAL_ERROR_NETWORK_PARAMETER_INVALID_VALUE = 20; +const PROPOSAL_ERROR_NETWORK_PARAMETER_VALIDATION_FAILED = 21; +const PROPOSAL_ERROR_OPENING_AUCTION_DURATION_TOO_SMALL = 22; +const PROPOSAL_ERROR_OPENING_AUCTION_DURATION_TOO_LARGE = 23; +const PROPOSAL_ERROR_COULD_NOT_INSTANTIATE_MARKET = 25; +const PROPOSAL_ERROR_INVALID_FUTURE_PRODUCT = 26; +const PROPOSAL_ERROR_INVALID_RISK_PARAMETER = 30; +const PROPOSAL_ERROR_MAJORITY_THRESHOLD_NOT_REACHED = 31; +const PROPOSAL_ERROR_PARTICIPATION_THRESHOLD_NOT_REACHED = 32; +const PROPOSAL_ERROR_INVALID_ASSET_DETAILS = 33; +const PROPOSAL_ERROR_UNKNOWN_TYPE = 34; +const PROPOSAL_ERROR_UNKNOWN_RISK_PARAMETER_TYPE = 35; +const PROPOSAL_ERROR_INVALID_FREEFORM = 36; +const PROPOSAL_ERROR_INSUFFICIENT_EQUITY_LIKE_SHARE = 37; +const PROPOSAL_ERROR_INVALID_MARKET = 38; +const PROPOSAL_ERROR_TOO_MANY_MARKET_DECIMAL_PLACES = 39; +const PROPOSAL_ERROR_TOO_MANY_PRICE_MONITORING_TRIGGERS = 40; +const PROPOSAL_ERROR_ERC20_ADDRESS_ALREADY_IN_USE = 41; +const PROPOSAL_ERROR_LP_PRICE_RANGE_NONPOSITIVE = 42; +const PROPOSAL_ERROR_LP_PRICE_RANGE_TOO_LARGE = 43; +const PROPOSAL_ERROR_LINEAR_SLIPPAGE_FACTOR_OUT_OF_RANGE = 44; +const PROPOSAL_ERROR_QUADRATIC_SLIPPAGE_FACTOR_OUT_OF_RANGE = 45; +const PROPOSAL_ERROR_INVALID_SPOT = 46; +const PROPOSAL_ERROR_SPOT_PRODUCT_DISABLED = 47; +const PROPOSAL_ERROR_INVALID_SUCCESSOR_MARKET = 48; +const PROPOSAL_ERROR_GOVERNANCE_TRANSFER_PROPOSAL_FAILED = 49; +const PROPOSAL_ERROR_GOVERNANCE_TRANSFER_PROPOSAL_INVALID = 50; +const PROPOSAL_ERROR_GOVERNANCE_CANCEL_TRANSFER_PROPOSAL_INVALID = 51; + +const enumValues = new Map([ + [0, 'PROPOSAL_ERROR_UNSPECIFIED'], + [1, 'PROPOSAL_ERROR_CLOSE_TIME_TOO_SOON'], + [2, 'PROPOSAL_ERROR_CLOSE_TIME_TOO_LATE'], + [3, 'PROPOSAL_ERROR_ENACT_TIME_TOO_SOON'], + [4, 'PROPOSAL_ERROR_ENACT_TIME_TOO_LATE'], + [5, 'PROPOSAL_ERROR_INSUFFICIENT_TOKENS'], + [6, 'PROPOSAL_ERROR_INVALID_INSTRUMENT_SECURITY'], + [7, 'PROPOSAL_ERROR_NO_PRODUCT'], + [8, 'PROPOSAL_ERROR_UNSUPPORTED_PRODUCT'], + [11, 'PROPOSAL_ERROR_NO_TRADING_MODE'], + [12, 'PROPOSAL_ERROR_UNSUPPORTED_TRADING_MODE'], + [13, 'PROPOSAL_ERROR_NODE_VALIDATION_FAILED'], + [14, 'PROPOSAL_ERROR_MISSING_BUILTIN_ASSET_FIELD'], + [15, 'PROPOSAL_ERROR_MISSING_ERC20_CONTRACT_ADDRESS'], + [16, 'PROPOSAL_ERROR_INVALID_ASSET'], + [17, 'PROPOSAL_ERROR_INCOMPATIBLE_TIMESTAMPS'], + [18, 'PROPOSAL_ERROR_NO_RISK_PARAMETERS'], + [19, 'PROPOSAL_ERROR_NETWORK_PARAMETER_INVALID_KEY'], + [20, 'PROPOSAL_ERROR_NETWORK_PARAMETER_INVALID_VALUE'], + [21, 'PROPOSAL_ERROR_NETWORK_PARAMETER_VALIDATION_FAILED'], + [22, 'PROPOSAL_ERROR_OPENING_AUCTION_DURATION_TOO_SMALL'], + [23, 'PROPOSAL_ERROR_OPENING_AUCTION_DURATION_TOO_LARGE'], + [25, 'PROPOSAL_ERROR_COULD_NOT_INSTANTIATE_MARKET'], + [26, 'PROPOSAL_ERROR_INVALID_FUTURE_PRODUCT'], + [30, 'PROPOSAL_ERROR_INVALID_RISK_PARAMETER'], + [31, 'PROPOSAL_ERROR_MAJORITY_THRESHOLD_NOT_REACHED'], + [32, 'PROPOSAL_ERROR_PARTICIPATION_THRESHOLD_NOT_REACHED'], + [33, 'PROPOSAL_ERROR_INVALID_ASSET_DETAILS'], + [34, 'PROPOSAL_ERROR_UNKNOWN_TYPE'], + [35, 'PROPOSAL_ERROR_UNKNOWN_RISK_PARAMETER_TYPE'], + [36, 'PROPOSAL_ERROR_INVALID_FREEFORM'], + [37, 'PROPOSAL_ERROR_INSUFFICIENT_EQUITY_LIKE_SHARE'], + [38, 'PROPOSAL_ERROR_INVALID_MARKET'], + [39, 'PROPOSAL_ERROR_TOO_MANY_MARKET_DECIMAL_PLACES'], + [40, 'PROPOSAL_ERROR_TOO_MANY_PRICE_MONITORING_TRIGGERS'], + [41, 'PROPOSAL_ERROR_ERC20_ADDRESS_ALREADY_IN_USE'], + [42, 'PROPOSAL_ERROR_LP_PRICE_RANGE_NONPOSITIVE'], + [43, 'PROPOSAL_ERROR_LP_PRICE_RANGE_TOO_LARGE'], + [44, 'PROPOSAL_ERROR_LINEAR_SLIPPAGE_FACTOR_OUT_OF_RANGE'], + [45, 'PROPOSAL_ERROR_QUADRATIC_SLIPPAGE_FACTOR_OUT_OF_RANGE'], + [46, 'PROPOSAL_ERROR_INVALID_SPOT'], + [47, 'PROPOSAL_ERROR_SPOT_PRODUCT_DISABLED'], + [48, 'PROPOSAL_ERROR_INVALID_SUCCESSOR_MARKET'], + [49, 'PROPOSAL_ERROR_GOVERNANCE_TRANSFER_PROPOSAL_FAILED'], + [50, 'PROPOSAL_ERROR_GOVERNANCE_TRANSFER_PROPOSAL_INVALID'], + [51, 'PROPOSAL_ERROR_GOVERNANCE_CANCEL_TRANSFER_PROPOSAL_INVALID'] +]); +const enumNames = new Map([ + ['PROPOSAL_ERROR_UNSPECIFIED', 0], + ['PROPOSAL_ERROR_CLOSE_TIME_TOO_SOON', 1], + ['PROPOSAL_ERROR_CLOSE_TIME_TOO_LATE', 2], + ['PROPOSAL_ERROR_ENACT_TIME_TOO_SOON', 3], + ['PROPOSAL_ERROR_ENACT_TIME_TOO_LATE', 4], + ['PROPOSAL_ERROR_INSUFFICIENT_TOKENS', 5], + ['PROPOSAL_ERROR_INVALID_INSTRUMENT_SECURITY', 6], + ['PROPOSAL_ERROR_NO_PRODUCT', 7], + ['PROPOSAL_ERROR_UNSUPPORTED_PRODUCT', 8], + ['PROPOSAL_ERROR_NO_TRADING_MODE', 11], + ['PROPOSAL_ERROR_UNSUPPORTED_TRADING_MODE', 12], + ['PROPOSAL_ERROR_NODE_VALIDATION_FAILED', 13], + ['PROPOSAL_ERROR_MISSING_BUILTIN_ASSET_FIELD', 14], + ['PROPOSAL_ERROR_MISSING_ERC20_CONTRACT_ADDRESS', 15], + ['PROPOSAL_ERROR_INVALID_ASSET', 16], + ['PROPOSAL_ERROR_INCOMPATIBLE_TIMESTAMPS', 17], + ['PROPOSAL_ERROR_NO_RISK_PARAMETERS', 18], + ['PROPOSAL_ERROR_NETWORK_PARAMETER_INVALID_KEY', 19], + ['PROPOSAL_ERROR_NETWORK_PARAMETER_INVALID_VALUE', 20], + ['PROPOSAL_ERROR_NETWORK_PARAMETER_VALIDATION_FAILED', 21], + ['PROPOSAL_ERROR_OPENING_AUCTION_DURATION_TOO_SMALL', 22], + ['PROPOSAL_ERROR_OPENING_AUCTION_DURATION_TOO_LARGE', 23], + ['PROPOSAL_ERROR_COULD_NOT_INSTANTIATE_MARKET', 25], + ['PROPOSAL_ERROR_INVALID_FUTURE_PRODUCT', 26], + ['PROPOSAL_ERROR_INVALID_RISK_PARAMETER', 30], + ['PROPOSAL_ERROR_MAJORITY_THRESHOLD_NOT_REACHED', 31], + ['PROPOSAL_ERROR_PARTICIPATION_THRESHOLD_NOT_REACHED', 32], + ['PROPOSAL_ERROR_INVALID_ASSET_DETAILS', 33], + ['PROPOSAL_ERROR_UNKNOWN_TYPE', 34], + ['PROPOSAL_ERROR_UNKNOWN_RISK_PARAMETER_TYPE', 35], + ['PROPOSAL_ERROR_INVALID_FREEFORM', 36], + ['PROPOSAL_ERROR_INSUFFICIENT_EQUITY_LIKE_SHARE', 37], + ['PROPOSAL_ERROR_INVALID_MARKET', 38], + ['PROPOSAL_ERROR_TOO_MANY_MARKET_DECIMAL_PLACES', 39], + ['PROPOSAL_ERROR_TOO_MANY_PRICE_MONITORING_TRIGGERS', 40], + ['PROPOSAL_ERROR_ERC20_ADDRESS_ALREADY_IN_USE', 41], + ['PROPOSAL_ERROR_LP_PRICE_RANGE_NONPOSITIVE', 42], + ['PROPOSAL_ERROR_LP_PRICE_RANGE_TOO_LARGE', 43], + ['PROPOSAL_ERROR_LINEAR_SLIPPAGE_FACTOR_OUT_OF_RANGE', 44], + ['PROPOSAL_ERROR_QUADRATIC_SLIPPAGE_FACTOR_OUT_OF_RANGE', 45], + ['PROPOSAL_ERROR_INVALID_SPOT', 46], + ['PROPOSAL_ERROR_SPOT_PRODUCT_DISABLED', 47], + ['PROPOSAL_ERROR_INVALID_SUCCESSOR_MARKET', 48], + ['PROPOSAL_ERROR_GOVERNANCE_TRANSFER_PROPOSAL_FAILED', 49], + ['PROPOSAL_ERROR_GOVERNANCE_TRANSFER_PROPOSAL_INVALID', 50], + ['PROPOSAL_ERROR_GOVERNANCE_CANCEL_TRANSFER_PROPOSAL_INVALID', 51] +]); + +function encode(value, buf, byteOffset = 0) { + if (typeof value === 'string') return encode(parse(value), buf, byteOffset) + if (value == null) + throw new Error('Invalid ProposalError value (' + value + ')') + + return types.enumerable.encode(value, buf, byteOffset) +} + +function decode(varint) { + const int = types$1.enumerable(varint); + + return stringify(int) ?? int +} + +function encodingLength(value) { + if (typeof value === 'string') return encodingLength(parse(value)) + assert(value != null, 'Invalid ProposalError value (' + value + ')'); + + if (0 <= value && value <= 51) return 1 + + // enumerable max value in case of unknown value + return 5 +} + +/** + * Convert an enum value to it's human readable name. + * Returns undefined on an unknown value. + */ +function stringify(int) { + return enumValues.get(int) +} + +/** + * Convert an enum string names to it's machine integer value. + * Returns undefined on an unknown name. + */ +function parse(str) { + return enumNames.get(str) +} + +exports.PROPOSAL_ERROR_CLOSE_TIME_TOO_LATE = PROPOSAL_ERROR_CLOSE_TIME_TOO_LATE; +exports.PROPOSAL_ERROR_CLOSE_TIME_TOO_SOON = PROPOSAL_ERROR_CLOSE_TIME_TOO_SOON; +exports.PROPOSAL_ERROR_COULD_NOT_INSTANTIATE_MARKET = PROPOSAL_ERROR_COULD_NOT_INSTANTIATE_MARKET; +exports.PROPOSAL_ERROR_ENACT_TIME_TOO_LATE = PROPOSAL_ERROR_ENACT_TIME_TOO_LATE; +exports.PROPOSAL_ERROR_ENACT_TIME_TOO_SOON = PROPOSAL_ERROR_ENACT_TIME_TOO_SOON; +exports.PROPOSAL_ERROR_ERC20_ADDRESS_ALREADY_IN_USE = PROPOSAL_ERROR_ERC20_ADDRESS_ALREADY_IN_USE; +exports.PROPOSAL_ERROR_GOVERNANCE_CANCEL_TRANSFER_PROPOSAL_INVALID = PROPOSAL_ERROR_GOVERNANCE_CANCEL_TRANSFER_PROPOSAL_INVALID; +exports.PROPOSAL_ERROR_GOVERNANCE_TRANSFER_PROPOSAL_FAILED = PROPOSAL_ERROR_GOVERNANCE_TRANSFER_PROPOSAL_FAILED; +exports.PROPOSAL_ERROR_GOVERNANCE_TRANSFER_PROPOSAL_INVALID = PROPOSAL_ERROR_GOVERNANCE_TRANSFER_PROPOSAL_INVALID; +exports.PROPOSAL_ERROR_INCOMPATIBLE_TIMESTAMPS = PROPOSAL_ERROR_INCOMPATIBLE_TIMESTAMPS; +exports.PROPOSAL_ERROR_INSUFFICIENT_EQUITY_LIKE_SHARE = PROPOSAL_ERROR_INSUFFICIENT_EQUITY_LIKE_SHARE; +exports.PROPOSAL_ERROR_INSUFFICIENT_TOKENS = PROPOSAL_ERROR_INSUFFICIENT_TOKENS; +exports.PROPOSAL_ERROR_INVALID_ASSET = PROPOSAL_ERROR_INVALID_ASSET; +exports.PROPOSAL_ERROR_INVALID_ASSET_DETAILS = PROPOSAL_ERROR_INVALID_ASSET_DETAILS; +exports.PROPOSAL_ERROR_INVALID_FREEFORM = PROPOSAL_ERROR_INVALID_FREEFORM; +exports.PROPOSAL_ERROR_INVALID_FUTURE_PRODUCT = PROPOSAL_ERROR_INVALID_FUTURE_PRODUCT; +exports.PROPOSAL_ERROR_INVALID_INSTRUMENT_SECURITY = PROPOSAL_ERROR_INVALID_INSTRUMENT_SECURITY; +exports.PROPOSAL_ERROR_INVALID_MARKET = PROPOSAL_ERROR_INVALID_MARKET; +exports.PROPOSAL_ERROR_INVALID_RISK_PARAMETER = PROPOSAL_ERROR_INVALID_RISK_PARAMETER; +exports.PROPOSAL_ERROR_INVALID_SPOT = PROPOSAL_ERROR_INVALID_SPOT; +exports.PROPOSAL_ERROR_INVALID_SUCCESSOR_MARKET = PROPOSAL_ERROR_INVALID_SUCCESSOR_MARKET; +exports.PROPOSAL_ERROR_LINEAR_SLIPPAGE_FACTOR_OUT_OF_RANGE = PROPOSAL_ERROR_LINEAR_SLIPPAGE_FACTOR_OUT_OF_RANGE; +exports.PROPOSAL_ERROR_LP_PRICE_RANGE_NONPOSITIVE = PROPOSAL_ERROR_LP_PRICE_RANGE_NONPOSITIVE; +exports.PROPOSAL_ERROR_LP_PRICE_RANGE_TOO_LARGE = PROPOSAL_ERROR_LP_PRICE_RANGE_TOO_LARGE; +exports.PROPOSAL_ERROR_MAJORITY_THRESHOLD_NOT_REACHED = PROPOSAL_ERROR_MAJORITY_THRESHOLD_NOT_REACHED; +exports.PROPOSAL_ERROR_MISSING_BUILTIN_ASSET_FIELD = PROPOSAL_ERROR_MISSING_BUILTIN_ASSET_FIELD; +exports.PROPOSAL_ERROR_MISSING_ERC20_CONTRACT_ADDRESS = PROPOSAL_ERROR_MISSING_ERC20_CONTRACT_ADDRESS; +exports.PROPOSAL_ERROR_NETWORK_PARAMETER_INVALID_KEY = PROPOSAL_ERROR_NETWORK_PARAMETER_INVALID_KEY; +exports.PROPOSAL_ERROR_NETWORK_PARAMETER_INVALID_VALUE = PROPOSAL_ERROR_NETWORK_PARAMETER_INVALID_VALUE; +exports.PROPOSAL_ERROR_NETWORK_PARAMETER_VALIDATION_FAILED = PROPOSAL_ERROR_NETWORK_PARAMETER_VALIDATION_FAILED; +exports.PROPOSAL_ERROR_NODE_VALIDATION_FAILED = PROPOSAL_ERROR_NODE_VALIDATION_FAILED; +exports.PROPOSAL_ERROR_NO_PRODUCT = PROPOSAL_ERROR_NO_PRODUCT; +exports.PROPOSAL_ERROR_NO_RISK_PARAMETERS = PROPOSAL_ERROR_NO_RISK_PARAMETERS; +exports.PROPOSAL_ERROR_NO_TRADING_MODE = PROPOSAL_ERROR_NO_TRADING_MODE; +exports.PROPOSAL_ERROR_OPENING_AUCTION_DURATION_TOO_LARGE = PROPOSAL_ERROR_OPENING_AUCTION_DURATION_TOO_LARGE; +exports.PROPOSAL_ERROR_OPENING_AUCTION_DURATION_TOO_SMALL = PROPOSAL_ERROR_OPENING_AUCTION_DURATION_TOO_SMALL; +exports.PROPOSAL_ERROR_PARTICIPATION_THRESHOLD_NOT_REACHED = PROPOSAL_ERROR_PARTICIPATION_THRESHOLD_NOT_REACHED; +exports.PROPOSAL_ERROR_QUADRATIC_SLIPPAGE_FACTOR_OUT_OF_RANGE = PROPOSAL_ERROR_QUADRATIC_SLIPPAGE_FACTOR_OUT_OF_RANGE; +exports.PROPOSAL_ERROR_SPOT_PRODUCT_DISABLED = PROPOSAL_ERROR_SPOT_PRODUCT_DISABLED; +exports.PROPOSAL_ERROR_TOO_MANY_MARKET_DECIMAL_PLACES = PROPOSAL_ERROR_TOO_MANY_MARKET_DECIMAL_PLACES; +exports.PROPOSAL_ERROR_TOO_MANY_PRICE_MONITORING_TRIGGERS = PROPOSAL_ERROR_TOO_MANY_PRICE_MONITORING_TRIGGERS; +exports.PROPOSAL_ERROR_UNKNOWN_RISK_PARAMETER_TYPE = PROPOSAL_ERROR_UNKNOWN_RISK_PARAMETER_TYPE; +exports.PROPOSAL_ERROR_UNKNOWN_TYPE = PROPOSAL_ERROR_UNKNOWN_TYPE; +exports.PROPOSAL_ERROR_UNSPECIFIED = PROPOSAL_ERROR_UNSPECIFIED; +exports.PROPOSAL_ERROR_UNSUPPORTED_PRODUCT = PROPOSAL_ERROR_UNSUPPORTED_PRODUCT; +exports.PROPOSAL_ERROR_UNSUPPORTED_TRADING_MODE = PROPOSAL_ERROR_UNSUPPORTED_TRADING_MODE; +exports.decode = decode; +exports.encode = encode; +exports.encodingLength = encodingLength; +exports.parse = parse; +exports.stringify = stringify; diff --git a/cjs/vega/ProposalRationale.cjs b/cjs/vega/ProposalRationale.cjs new file mode 100644 index 0000000..f97d6fe --- /dev/null +++ b/cjs/vega/ProposalRationale.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./ProposalRationale/encode.cjs'); +var decode = require('./ProposalRationale/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/ProposalRationale/decode.cjs b/cjs/vega/ProposalRationale/decode.cjs new file mode 100644 index 0000000..32dada9 --- /dev/null +++ b/cjs/vega/ProposalRationale/decode.cjs @@ -0,0 +1,25 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$description = ''; + let field$title = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$description = types.string(data); + break + + case 4: + field$title = types.string(data); + break + } + } + return { description: field$description, title: field$title } +} + +exports.decode = decode; diff --git a/cjs/vega/ProposalRationale/encode.cjs b/cjs/vega/ProposalRationale/encode.cjs new file mode 100644 index 0000000..384a22d --- /dev/null +++ b/cjs/vega/ProposalRationale/encode.cjs @@ -0,0 +1,21 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.description) writer.bytes(1, obj.description, types.string); + if (obj.title) writer.bytes(4, obj.title, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/ProposalTerms.cjs b/cjs/vega/ProposalTerms.cjs new file mode 100644 index 0000000..31bed2f --- /dev/null +++ b/cjs/vega/ProposalTerms.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./ProposalTerms/encode.cjs'); +var decode = require('./ProposalTerms/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/ProposalTerms/decode.cjs b/cjs/vega/ProposalTerms/decode.cjs new file mode 100644 index 0000000..e857701 --- /dev/null +++ b/cjs/vega/ProposalTerms/decode.cjs @@ -0,0 +1,88 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$a = require('../UpdateMarket/decode.cjs'); +var decode$9 = require('../NewMarket/decode.cjs'); +var decode$8 = require('../UpdateNetworkParameter/decode.cjs'); +var decode$7 = require('../NewAsset/decode.cjs'); +var decode$6 = require('../NewFreeform/decode.cjs'); +var decode$5 = require('../UpdateAsset/decode.cjs'); +var decode$4 = require('../NewSpotMarket/decode.cjs'); +var decode$3 = require('../UpdateSpotMarket/decode.cjs'); +var decode$2 = require('../NewTransfer/decode.cjs'); +var decode$1 = require('../CancelTransfer/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$closingTimestamp = 0n; + let field$enactmentTimestamp = 0n; + let field$validationTimestamp = 0n; + let field$change = null; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$closingTimestamp = types.int64(data); + break + + case 2: + field$enactmentTimestamp = types.int64(data); + break + + case 3: + field$validationTimestamp = types.int64(data); + break + + case 101: + field$change = { updateMarket: decode$a.decode(data) }; + break + + case 102: + field$change = { newMarket: decode$9.decode(data) }; + break + + case 103: + field$change = { + updateNetworkParameter: decode$8.decode(data) + }; + break + + case 104: + field$change = { newAsset: decode$7.decode(data) }; + break + + case 105: + field$change = { newFreeform: decode$6.decode(data) }; + break + + case 106: + field$change = { updateAsset: decode$5.decode(data) }; + break + + case 107: + field$change = { newSpotMarket: decode$4.decode(data) }; + break + + case 108: + field$change = { updateSpotMarket: decode$3.decode(data) }; + break + + case 109: + field$change = { newTransfer: decode$2.decode(data) }; + break + + case 110: + field$change = { cancelTransfer: decode$1.decode(data) }; + break + } + } + return { + closingTimestamp: field$closingTimestamp, + enactmentTimestamp: field$enactmentTimestamp, + validationTimestamp: field$validationTimestamp, + change: field$change + } +} + +exports.decode = decode; diff --git a/cjs/vega/ProposalTerms/encode.cjs b/cjs/vega/ProposalTerms/encode.cjs new file mode 100644 index 0000000..f3ddf2d --- /dev/null +++ b/cjs/vega/ProposalTerms/encode.cjs @@ -0,0 +1,89 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../UpdateMarket/encode.cjs'); +var encode$2 = require('../NewMarket/encode.cjs'); +var encode$3 = require('../UpdateNetworkParameter/encode.cjs'); +var encode$4 = require('../NewAsset/encode.cjs'); +var encode$5 = require('../NewFreeform/encode.cjs'); +var encode$6 = require('../UpdateAsset/encode.cjs'); +var encode$7 = require('../NewSpotMarket/encode.cjs'); +var encode$8 = require('../UpdateSpotMarket/encode.cjs'); +var encode$9 = require('../NewTransfer/encode.cjs'); +var encode$a = require('../CancelTransfer/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.closingTimestamp) writer.varint(1, obj.closingTimestamp, types.int64); + if (obj.enactmentTimestamp) writer.varint(2, obj.enactmentTimestamp, types.int64); + if (obj.validationTimestamp) writer.varint(3, obj.validationTimestamp, types.int64); + + if (obj.change?.updateMarket ?? obj.updateMarket) + writer.bytes( + 101, + encode$1.encode(obj.change?.updateMarket ?? obj.updateMarket) + ); + if (obj.change?.newMarket ?? obj.newMarket) + writer.bytes( + 102, + encode$2.encode(obj.change?.newMarket ?? obj.newMarket) + ); + if (obj.change?.updateNetworkParameter ?? obj.updateNetworkParameter) + writer.bytes( + 103, + encode$3.encode( + obj.change?.updateNetworkParameter ?? obj.updateNetworkParameter + ) + ); + if (obj.change?.newAsset ?? obj.newAsset) + writer.bytes( + 104, + encode$4.encode(obj.change?.newAsset ?? obj.newAsset) + ); + if (obj.change?.newFreeform ?? obj.newFreeform) + writer.bytes( + 105, + encode$5.encode(obj.change?.newFreeform ?? obj.newFreeform) + ); + if (obj.change?.updateAsset ?? obj.updateAsset) + writer.bytes( + 106, + encode$6.encode(obj.change?.updateAsset ?? obj.updateAsset) + ); + if (obj.change?.newSpotMarket ?? obj.newSpotMarket) + writer.bytes( + 107, + encode$7.encode(obj.change?.newSpotMarket ?? obj.newSpotMarket) + ); + if (obj.change?.updateSpotMarket ?? obj.updateSpotMarket) + writer.bytes( + 108, + encode$8.encode( + obj.change?.updateSpotMarket ?? obj.updateSpotMarket + ) + ); + if (obj.change?.newTransfer ?? obj.newTransfer) + writer.bytes( + 109, + encode$9.encode(obj.change?.newTransfer ?? obj.newTransfer) + ); + if (obj.change?.cancelTransfer ?? obj.cancelTransfer) + writer.bytes( + 110, + encode$a.encode( + obj.change?.cancelTransfer ?? obj.cancelTransfer + ) + ); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/RankingScore.cjs b/cjs/vega/RankingScore.cjs new file mode 100644 index 0000000..639826a --- /dev/null +++ b/cjs/vega/RankingScore.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./RankingScore/encode.cjs'); +var decode = require('./RankingScore/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/RankingScore/decode.cjs b/cjs/vega/RankingScore/decode.cjs new file mode 100644 index 0000000..5e4e205 --- /dev/null +++ b/cjs/vega/RankingScore/decode.cjs @@ -0,0 +1,53 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var ValidatorNodeStatus = require('../ValidatorNodeStatus.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$stakeScore = ''; + let field$performanceScore = ''; + let field$previousStatus = 0; + let field$status = 0; + let field$votingPower = 0; + let field$rankingScore = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$stakeScore = types.string(data); + break + + case 2: + field$performanceScore = types.string(data); + break + + case 3: + field$previousStatus = ValidatorNodeStatus.decode(data); + break + + case 4: + field$status = ValidatorNodeStatus.decode(data); + break + + case 5: + field$votingPower = types.uint32(data); + break + + case 6: + field$rankingScore = types.string(data); + break + } + } + return { + stakeScore: field$stakeScore, + performanceScore: field$performanceScore, + previousStatus: field$previousStatus, + status: field$status, + votingPower: field$votingPower, + rankingScore: field$rankingScore + } +} + +exports.decode = decode; diff --git a/cjs/vega/RankingScore/encode.cjs b/cjs/vega/RankingScore/encode.cjs new file mode 100644 index 0000000..bab27e6 --- /dev/null +++ b/cjs/vega/RankingScore/encode.cjs @@ -0,0 +1,27 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var ValidatorNodeStatus = require('../ValidatorNodeStatus.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.stakeScore) writer.bytes(1, obj.stakeScore, types.string); + if (obj.performanceScore) writer.bytes(2, obj.performanceScore, types.string); + if (obj.previousStatus) + writer.varint(3, obj.previousStatus, ValidatorNodeStatus); + if (obj.status) writer.varint(4, obj.status, ValidatorNodeStatus); + if (obj.votingPower) writer.varint(5, obj.votingPower, types.uint32); + if (obj.rankingScore) writer.bytes(6, obj.rankingScore, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/RecurringTransfer.cjs b/cjs/vega/RecurringTransfer.cjs new file mode 100644 index 0000000..ccc0aa5 --- /dev/null +++ b/cjs/vega/RecurringTransfer.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./RecurringTransfer/encode.cjs'); +var decode = require('./RecurringTransfer/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/RecurringTransfer/decode.cjs b/cjs/vega/RecurringTransfer/decode.cjs new file mode 100644 index 0000000..100c68d --- /dev/null +++ b/cjs/vega/RecurringTransfer/decode.cjs @@ -0,0 +1,25 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$startEpoch = 0n; + let field$endEpoch = null; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$startEpoch = types.uint64(data); + break + + case 2: + field$endEpoch = types.uint64(data); + break + } + } + return { startEpoch: field$startEpoch, endEpoch: field$endEpoch } +} + +exports.decode = decode; diff --git a/cjs/vega/RecurringTransfer/encode.cjs b/cjs/vega/RecurringTransfer/encode.cjs new file mode 100644 index 0000000..3e80a51 --- /dev/null +++ b/cjs/vega/RecurringTransfer/encode.cjs @@ -0,0 +1,21 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.startEpoch) writer.varint(1, obj.startEpoch, types.uint64); + if (obj.endEpoch) writer.varint(2, obj.endEpoch, types.uint64); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/Reward.cjs b/cjs/vega/Reward.cjs new file mode 100644 index 0000000..1139221 --- /dev/null +++ b/cjs/vega/Reward.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./Reward/encode.cjs'); +var decode = require('./Reward/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/Reward/decode.cjs b/cjs/vega/Reward/decode.cjs new file mode 100644 index 0000000..fa42e49 --- /dev/null +++ b/cjs/vega/Reward/decode.cjs @@ -0,0 +1,64 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$assetId = ''; + let field$partyId = ''; + let field$epoch = 0n; + let field$amount = ''; + let field$percentageOfTotal = ''; + let field$receivedAt = 0n; + let field$marketId = ''; + let field$rewardType = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$assetId = types.string(data); + break + + case 2: + field$partyId = types.string(data); + break + + case 3: + field$epoch = types.uint64(data); + break + + case 4: + field$amount = types.string(data); + break + + case 5: + field$percentageOfTotal = types.string(data); + break + + case 6: + field$receivedAt = types.int64(data); + break + + case 7: + field$marketId = types.string(data); + break + + case 8: + field$rewardType = types.string(data); + break + } + } + return { + assetId: field$assetId, + partyId: field$partyId, + epoch: field$epoch, + amount: field$amount, + percentageOfTotal: field$percentageOfTotal, + receivedAt: field$receivedAt, + marketId: field$marketId, + rewardType: field$rewardType + } +} + +exports.decode = decode; diff --git a/cjs/vega/Reward/encode.cjs b/cjs/vega/Reward/encode.cjs new file mode 100644 index 0000000..d9bd2a6 --- /dev/null +++ b/cjs/vega/Reward/encode.cjs @@ -0,0 +1,27 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.assetId) writer.bytes(1, obj.assetId, types.string); + if (obj.partyId) writer.bytes(2, obj.partyId, types.string); + if (obj.epoch) writer.varint(3, obj.epoch, types.uint64); + if (obj.amount) writer.bytes(4, obj.amount, types.string); + if (obj.percentageOfTotal) writer.bytes(5, obj.percentageOfTotal, types.string); + if (obj.receivedAt) writer.varint(6, obj.receivedAt, types.int64); + if (obj.marketId) writer.bytes(7, obj.marketId, types.string); + if (obj.rewardType) writer.bytes(8, obj.rewardType, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/RewardScore.cjs b/cjs/vega/RewardScore.cjs new file mode 100644 index 0000000..82f8995 --- /dev/null +++ b/cjs/vega/RewardScore.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./RewardScore/encode.cjs'); +var decode = require('./RewardScore/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/RewardScore/decode.cjs b/cjs/vega/RewardScore/decode.cjs new file mode 100644 index 0000000..d47b57a --- /dev/null +++ b/cjs/vega/RewardScore/decode.cjs @@ -0,0 +1,53 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var ValidatorNodeStatus = require('../ValidatorNodeStatus.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$rawValidatorScore = ''; + let field$performanceScore = ''; + let field$multisigScore = ''; + let field$validatorScore = ''; + let field$normalisedScore = ''; + let field$validatorStatus = 0; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$rawValidatorScore = types.string(data); + break + + case 2: + field$performanceScore = types.string(data); + break + + case 3: + field$multisigScore = types.string(data); + break + + case 4: + field$validatorScore = types.string(data); + break + + case 5: + field$normalisedScore = types.string(data); + break + + case 6: + field$validatorStatus = ValidatorNodeStatus.decode(data); + break + } + } + return { + rawValidatorScore: field$rawValidatorScore, + performanceScore: field$performanceScore, + multisigScore: field$multisigScore, + validatorScore: field$validatorScore, + normalisedScore: field$normalisedScore, + validatorStatus: field$validatorStatus + } +} + +exports.decode = decode; diff --git a/cjs/vega/RewardScore/encode.cjs b/cjs/vega/RewardScore/encode.cjs new file mode 100644 index 0000000..5ea3c20 --- /dev/null +++ b/cjs/vega/RewardScore/encode.cjs @@ -0,0 +1,27 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var ValidatorNodeStatus = require('../ValidatorNodeStatus.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.rawValidatorScore) writer.bytes(1, obj.rawValidatorScore, types.string); + if (obj.performanceScore) writer.bytes(2, obj.performanceScore, types.string); + if (obj.multisigScore) writer.bytes(3, obj.multisigScore, types.string); + if (obj.validatorScore) writer.bytes(4, obj.validatorScore, types.string); + if (obj.normalisedScore) writer.bytes(5, obj.normalisedScore, types.string); + if (obj.validatorStatus) + writer.varint(6, obj.validatorStatus, ValidatorNodeStatus); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/RewardSummary.cjs b/cjs/vega/RewardSummary.cjs new file mode 100644 index 0000000..8fc6090 --- /dev/null +++ b/cjs/vega/RewardSummary.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./RewardSummary/encode.cjs'); +var decode = require('./RewardSummary/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/RewardSummary/decode.cjs b/cjs/vega/RewardSummary/decode.cjs new file mode 100644 index 0000000..c07bc6b --- /dev/null +++ b/cjs/vega/RewardSummary/decode.cjs @@ -0,0 +1,34 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$assetId = ''; + let field$partyId = ''; + let field$amount = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$assetId = types.string(data); + break + + case 2: + field$partyId = types.string(data); + break + + case 3: + field$amount = types.string(data); + break + } + } + return { + assetId: field$assetId, + partyId: field$partyId, + amount: field$amount + } +} + +exports.decode = decode; diff --git a/cjs/vega/RewardSummary/encode.cjs b/cjs/vega/RewardSummary/encode.cjs new file mode 100644 index 0000000..5094b25 --- /dev/null +++ b/cjs/vega/RewardSummary/encode.cjs @@ -0,0 +1,22 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.assetId) writer.bytes(1, obj.assetId, types.string); + if (obj.partyId) writer.bytes(2, obj.partyId, types.string); + if (obj.amount) writer.bytes(3, obj.amount, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/RiskFactor.cjs b/cjs/vega/RiskFactor.cjs new file mode 100644 index 0000000..8e79903 --- /dev/null +++ b/cjs/vega/RiskFactor.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./RiskFactor/encode.cjs'); +var decode = require('./RiskFactor/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/RiskFactor/decode.cjs b/cjs/vega/RiskFactor/decode.cjs new file mode 100644 index 0000000..06e4d13 --- /dev/null +++ b/cjs/vega/RiskFactor/decode.cjs @@ -0,0 +1,30 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$market = ''; + let field$short = ''; + let field$long = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$market = types.string(data); + break + + case 2: + field$short = types.string(data); + break + + case 3: + field$long = types.string(data); + break + } + } + return { market: field$market, short: field$short, long: field$long } +} + +exports.decode = decode; diff --git a/cjs/vega/RiskFactor/encode.cjs b/cjs/vega/RiskFactor/encode.cjs new file mode 100644 index 0000000..554eeb0 --- /dev/null +++ b/cjs/vega/RiskFactor/encode.cjs @@ -0,0 +1,22 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.market) writer.bytes(1, obj.market, types.string); + if (obj.short) writer.bytes(2, obj.short, types.string); + if (obj.long) writer.bytes(3, obj.long, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/ScalarValue.cjs b/cjs/vega/ScalarValue.cjs new file mode 100644 index 0000000..2ca81c7 --- /dev/null +++ b/cjs/vega/ScalarValue.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./ScalarValue/encode.cjs'); +var decode = require('./ScalarValue/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/ScalarValue/decode.cjs b/cjs/vega/ScalarValue/decode.cjs new file mode 100644 index 0000000..18a3ae1 --- /dev/null +++ b/cjs/vega/ScalarValue/decode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$value = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$value = types.string(data); + break + } + } + return { value: field$value } +} + +exports.decode = decode; diff --git a/cjs/vega/ScalarValue/encode.cjs b/cjs/vega/ScalarValue/encode.cjs new file mode 100644 index 0000000..4033d4b --- /dev/null +++ b/cjs/vega/ScalarValue/encode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.value) writer.bytes(1, obj.value, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/ScalingFactors.cjs b/cjs/vega/ScalingFactors.cjs new file mode 100644 index 0000000..295ed0d --- /dev/null +++ b/cjs/vega/ScalingFactors.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./ScalingFactors/encode.cjs'); +var decode = require('./ScalingFactors/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/ScalingFactors/decode.cjs b/cjs/vega/ScalingFactors/decode.cjs new file mode 100644 index 0000000..1ff5cd9 --- /dev/null +++ b/cjs/vega/ScalingFactors/decode.cjs @@ -0,0 +1,34 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$searchLevel = 0; + let field$initialMargin = 0; + let field$collateralRelease = 0; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$searchLevel = types.double(data); + break + + case 2: + field$initialMargin = types.double(data); + break + + case 3: + field$collateralRelease = types.double(data); + break + } + } + return { + searchLevel: field$searchLevel, + initialMargin: field$initialMargin, + collateralRelease: field$collateralRelease + } +} + +exports.decode = decode; diff --git a/cjs/vega/ScalingFactors/encode.cjs b/cjs/vega/ScalingFactors/encode.cjs new file mode 100644 index 0000000..c1793d4 --- /dev/null +++ b/cjs/vega/ScalingFactors/encode.cjs @@ -0,0 +1,22 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.searchLevel) writer.fixed64(1, obj.searchLevel, types.double); + if (obj.initialMargin) writer.fixed64(2, obj.initialMargin, types.double); + if (obj.collateralRelease) writer.fixed64(3, obj.collateralRelease, types.double); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/Side.cjs b/cjs/vega/Side.cjs new file mode 100644 index 0000000..37212cc --- /dev/null +++ b/cjs/vega/Side.cjs @@ -0,0 +1,70 @@ +'use strict'; + +var assert = require('nanoassert'); +var types = require('protobuf-codec/encode/types'); +var types$1 = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +const SIDE_UNSPECIFIED = 0; +const SIDE_BUY = 1; +const SIDE_SELL = 2; + +const enumValues = new Map([ + [0, 'SIDE_UNSPECIFIED'], + [1, 'SIDE_BUY'], + [2, 'SIDE_SELL'] +]); +const enumNames = new Map([ + ['SIDE_UNSPECIFIED', 0], + ['SIDE_BUY', 1], + ['SIDE_SELL', 2] +]); + +function encode(value, buf, byteOffset = 0) { + if (typeof value === 'string') return encode(parse(value), buf, byteOffset) + if (value == null) throw new Error('Invalid Side value (' + value + ')') + + return types.enumerable.encode(value, buf, byteOffset) +} + +function decode(varint) { + const int = types$1.enumerable(varint); + + return stringify(int) ?? int +} + +function encodingLength(value) { + if (typeof value === 'string') return encodingLength(parse(value)) + assert(value != null, 'Invalid Side value (' + value + ')'); + + if (0 <= value && value <= 2) return 1 + + // enumerable max value in case of unknown value + return 5 +} + +/** + * Convert an enum value to it's human readable name. + * Returns undefined on an unknown value. + */ +function stringify(int) { + return enumValues.get(int) +} + +/** + * Convert an enum string names to it's machine integer value. + * Returns undefined on an unknown name. + */ +function parse(str) { + return enumNames.get(str) +} + +exports.SIDE_BUY = SIDE_BUY; +exports.SIDE_SELL = SIDE_SELL; +exports.SIDE_UNSPECIFIED = SIDE_UNSPECIFIED; +exports.decode = decode; +exports.encode = encode; +exports.encodingLength = encodingLength; +exports.parse = parse; +exports.stringify = stringify; diff --git a/cjs/vega/SimpleModelParams.cjs b/cjs/vega/SimpleModelParams.cjs new file mode 100644 index 0000000..926ea21 --- /dev/null +++ b/cjs/vega/SimpleModelParams.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./SimpleModelParams/encode.cjs'); +var decode = require('./SimpleModelParams/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/SimpleModelParams/decode.cjs b/cjs/vega/SimpleModelParams/decode.cjs new file mode 100644 index 0000000..36f1d62 --- /dev/null +++ b/cjs/vega/SimpleModelParams/decode.cjs @@ -0,0 +1,46 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$factorLong = 0; + let field$factorShort = 0; + let field$maxMoveUp = 0; + let field$minMoveDown = 0; + let field$probabilityOfTrading = 0; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$factorLong = types.double(data); + break + + case 2: + field$factorShort = types.double(data); + break + + case 3: + field$maxMoveUp = types.double(data); + break + + case 4: + field$minMoveDown = types.double(data); + break + + case 5: + field$probabilityOfTrading = types.double(data); + break + } + } + return { + factorLong: field$factorLong, + factorShort: field$factorShort, + maxMoveUp: field$maxMoveUp, + minMoveDown: field$minMoveDown, + probabilityOfTrading: field$probabilityOfTrading + } +} + +exports.decode = decode; diff --git a/cjs/vega/SimpleModelParams/encode.cjs b/cjs/vega/SimpleModelParams/encode.cjs new file mode 100644 index 0000000..98df63b --- /dev/null +++ b/cjs/vega/SimpleModelParams/encode.cjs @@ -0,0 +1,25 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.factorLong) writer.fixed64(1, obj.factorLong, types.double); + if (obj.factorShort) writer.fixed64(2, obj.factorShort, types.double); + if (obj.maxMoveUp) writer.fixed64(3, obj.maxMoveUp, types.double); + if (obj.minMoveDown) writer.fixed64(4, obj.minMoveDown, types.double); + if (obj.probabilityOfTrading) + writer.fixed64(5, obj.probabilityOfTrading, types.double); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/SimpleRiskModel.cjs b/cjs/vega/SimpleRiskModel.cjs new file mode 100644 index 0000000..52a51f0 --- /dev/null +++ b/cjs/vega/SimpleRiskModel.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./SimpleRiskModel/encode.cjs'); +var decode = require('./SimpleRiskModel/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/SimpleRiskModel/decode.cjs b/cjs/vega/SimpleRiskModel/decode.cjs new file mode 100644 index 0000000..754ecb1 --- /dev/null +++ b/cjs/vega/SimpleRiskModel/decode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var decode$1 = require('../SimpleModelParams/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$params = {}; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$params = decode$1.decode(data); + break + } + } + return { params: field$params } +} + +exports.decode = decode; diff --git a/cjs/vega/SimpleRiskModel/encode.cjs b/cjs/vega/SimpleRiskModel/encode.cjs new file mode 100644 index 0000000..7656879 --- /dev/null +++ b/cjs/vega/SimpleRiskModel/encode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var encode$1 = require('../SimpleModelParams/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.params) writer.bytes(1, encode$1.encode(obj.params)); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/Spot.cjs b/cjs/vega/Spot.cjs new file mode 100644 index 0000000..40d5e86 --- /dev/null +++ b/cjs/vega/Spot.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./Spot/encode.cjs'); +var decode = require('./Spot/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/Spot/decode.cjs b/cjs/vega/Spot/decode.cjs new file mode 100644 index 0000000..d8de941 --- /dev/null +++ b/cjs/vega/Spot/decode.cjs @@ -0,0 +1,34 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$baseAsset = ''; + let field$quoteAsset = ''; + let field$name = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$baseAsset = types.string(data); + break + + case 2: + field$quoteAsset = types.string(data); + break + + case 3: + field$name = types.string(data); + break + } + } + return { + baseAsset: field$baseAsset, + quoteAsset: field$quoteAsset, + name: field$name + } +} + +exports.decode = decode; diff --git a/cjs/vega/Spot/encode.cjs b/cjs/vega/Spot/encode.cjs new file mode 100644 index 0000000..b710fc8 --- /dev/null +++ b/cjs/vega/Spot/encode.cjs @@ -0,0 +1,22 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.baseAsset) writer.bytes(1, obj.baseAsset, types.string); + if (obj.quoteAsset) writer.bytes(2, obj.quoteAsset, types.string); + if (obj.name) writer.bytes(3, obj.name, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/SpotProduct.cjs b/cjs/vega/SpotProduct.cjs new file mode 100644 index 0000000..6606561 --- /dev/null +++ b/cjs/vega/SpotProduct.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./SpotProduct/encode.cjs'); +var decode = require('./SpotProduct/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/SpotProduct/decode.cjs b/cjs/vega/SpotProduct/decode.cjs new file mode 100644 index 0000000..d8de941 --- /dev/null +++ b/cjs/vega/SpotProduct/decode.cjs @@ -0,0 +1,34 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$baseAsset = ''; + let field$quoteAsset = ''; + let field$name = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$baseAsset = types.string(data); + break + + case 2: + field$quoteAsset = types.string(data); + break + + case 3: + field$name = types.string(data); + break + } + } + return { + baseAsset: field$baseAsset, + quoteAsset: field$quoteAsset, + name: field$name + } +} + +exports.decode = decode; diff --git a/cjs/vega/SpotProduct/encode.cjs b/cjs/vega/SpotProduct/encode.cjs new file mode 100644 index 0000000..b710fc8 --- /dev/null +++ b/cjs/vega/SpotProduct/encode.cjs @@ -0,0 +1,22 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.baseAsset) writer.bytes(1, obj.baseAsset, types.string); + if (obj.quoteAsset) writer.bytes(2, obj.quoteAsset, types.string); + if (obj.name) writer.bytes(3, obj.name, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/StakeDeposited.cjs b/cjs/vega/StakeDeposited.cjs new file mode 100644 index 0000000..8144093 --- /dev/null +++ b/cjs/vega/StakeDeposited.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./StakeDeposited/encode.cjs'); +var decode = require('./StakeDeposited/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/StakeDeposited/decode.cjs b/cjs/vega/StakeDeposited/decode.cjs new file mode 100644 index 0000000..7b20b79 --- /dev/null +++ b/cjs/vega/StakeDeposited/decode.cjs @@ -0,0 +1,40 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$ethereumAddress = ''; + let field$vegaPublicKey = ''; + let field$amount = ''; + let field$blockTime = 0n; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$ethereumAddress = types.string(data); + break + + case 2: + field$vegaPublicKey = types.string(data); + break + + case 3: + field$amount = types.string(data); + break + + case 4: + field$blockTime = types.int64(data); + break + } + } + return { + ethereumAddress: field$ethereumAddress, + vegaPublicKey: field$vegaPublicKey, + amount: field$amount, + blockTime: field$blockTime + } +} + +exports.decode = decode; diff --git a/cjs/vega/StakeDeposited/encode.cjs b/cjs/vega/StakeDeposited/encode.cjs new file mode 100644 index 0000000..dcb80b7 --- /dev/null +++ b/cjs/vega/StakeDeposited/encode.cjs @@ -0,0 +1,23 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.ethereumAddress) writer.bytes(1, obj.ethereumAddress, types.string); + if (obj.vegaPublicKey) writer.bytes(2, obj.vegaPublicKey, types.string); + if (obj.amount) writer.bytes(3, obj.amount, types.string); + if (obj.blockTime) writer.varint(4, obj.blockTime, types.int64); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/StakeRemoved.cjs b/cjs/vega/StakeRemoved.cjs new file mode 100644 index 0000000..7c3bca2 --- /dev/null +++ b/cjs/vega/StakeRemoved.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./StakeRemoved/encode.cjs'); +var decode = require('./StakeRemoved/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/StakeRemoved/decode.cjs b/cjs/vega/StakeRemoved/decode.cjs new file mode 100644 index 0000000..7b20b79 --- /dev/null +++ b/cjs/vega/StakeRemoved/decode.cjs @@ -0,0 +1,40 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$ethereumAddress = ''; + let field$vegaPublicKey = ''; + let field$amount = ''; + let field$blockTime = 0n; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$ethereumAddress = types.string(data); + break + + case 2: + field$vegaPublicKey = types.string(data); + break + + case 3: + field$amount = types.string(data); + break + + case 4: + field$blockTime = types.int64(data); + break + } + } + return { + ethereumAddress: field$ethereumAddress, + vegaPublicKey: field$vegaPublicKey, + amount: field$amount, + blockTime: field$blockTime + } +} + +exports.decode = decode; diff --git a/cjs/vega/StakeRemoved/encode.cjs b/cjs/vega/StakeRemoved/encode.cjs new file mode 100644 index 0000000..dcb80b7 --- /dev/null +++ b/cjs/vega/StakeRemoved/encode.cjs @@ -0,0 +1,23 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.ethereumAddress) writer.bytes(1, obj.ethereumAddress, types.string); + if (obj.vegaPublicKey) writer.bytes(2, obj.vegaPublicKey, types.string); + if (obj.amount) writer.bytes(3, obj.amount, types.string); + if (obj.blockTime) writer.varint(4, obj.blockTime, types.int64); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/StakeTotalSupply.cjs b/cjs/vega/StakeTotalSupply.cjs new file mode 100644 index 0000000..558b191 --- /dev/null +++ b/cjs/vega/StakeTotalSupply.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./StakeTotalSupply/encode.cjs'); +var decode = require('./StakeTotalSupply/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/StakeTotalSupply/decode.cjs b/cjs/vega/StakeTotalSupply/decode.cjs new file mode 100644 index 0000000..56cdc2d --- /dev/null +++ b/cjs/vega/StakeTotalSupply/decode.cjs @@ -0,0 +1,25 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$tokenAddress = ''; + let field$totalSupply = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$tokenAddress = types.string(data); + break + + case 2: + field$totalSupply = types.string(data); + break + } + } + return { tokenAddress: field$tokenAddress, totalSupply: field$totalSupply } +} + +exports.decode = decode; diff --git a/cjs/vega/StakeTotalSupply/encode.cjs b/cjs/vega/StakeTotalSupply/encode.cjs new file mode 100644 index 0000000..bf5ed32 --- /dev/null +++ b/cjs/vega/StakeTotalSupply/encode.cjs @@ -0,0 +1,21 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.tokenAddress) writer.bytes(1, obj.tokenAddress, types.string); + if (obj.totalSupply) writer.bytes(2, obj.totalSupply, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/StakingEvent.cjs b/cjs/vega/StakingEvent.cjs new file mode 100644 index 0000000..e094cf2 --- /dev/null +++ b/cjs/vega/StakingEvent.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./StakingEvent/encode.cjs'); +var decode = require('./StakingEvent/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/StakingEvent/decode.cjs b/cjs/vega/StakingEvent/decode.cjs new file mode 100644 index 0000000..e70604f --- /dev/null +++ b/cjs/vega/StakingEvent/decode.cjs @@ -0,0 +1,41 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$3 = require('../StakeDeposited/decode.cjs'); +var decode$2 = require('../StakeRemoved/decode.cjs'); +var decode$1 = require('../StakeTotalSupply/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$index = 0n; + let field$block = 0n; + let field$action = null; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$index = types.uint64(data); + break + + case 2: + field$block = types.uint64(data); + break + + case 1001: + field$action = { stakeDeposited: decode$3.decode(data) }; + break + + case 1002: + field$action = { stakeRemoved: decode$2.decode(data) }; + break + + case 1003: + field$action = { totalSupply: decode$1.decode(data) }; + break + } + } + return { index: field$index, block: field$block, action: field$action } +} + +exports.decode = decode; diff --git a/cjs/vega/StakingEvent/encode.cjs b/cjs/vega/StakingEvent/encode.cjs new file mode 100644 index 0000000..a89ca7d --- /dev/null +++ b/cjs/vega/StakingEvent/encode.cjs @@ -0,0 +1,42 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../StakeDeposited/encode.cjs'); +var encode$2 = require('../StakeRemoved/encode.cjs'); +var encode$3 = require('../StakeTotalSupply/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.index) writer.varint(1, obj.index, types.uint64); + if (obj.block) writer.varint(2, obj.block, types.uint64); + + if (obj.action?.stakeDeposited ?? obj.stakeDeposited) + writer.bytes( + 1001, + encode$1.encode( + obj.action?.stakeDeposited ?? obj.stakeDeposited + ) + ); + if (obj.action?.stakeRemoved ?? obj.stakeRemoved) + writer.bytes( + 1002, + encode$2.encode(obj.action?.stakeRemoved ?? obj.stakeRemoved) + ); + if (obj.action?.totalSupply ?? obj.totalSupply) + writer.bytes( + 1003, + encode$3.encode(obj.action?.totalSupply ?? obj.totalSupply) + ); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/StateValueProposal.cjs b/cjs/vega/StateValueProposal.cjs new file mode 100644 index 0000000..1320783 --- /dev/null +++ b/cjs/vega/StateValueProposal.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./StateValueProposal/encode.cjs'); +var decode = require('./StateValueProposal/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/StateValueProposal/decode.cjs b/cjs/vega/StateValueProposal/decode.cjs new file mode 100644 index 0000000..5c2ab84 --- /dev/null +++ b/cjs/vega/StateValueProposal/decode.cjs @@ -0,0 +1,35 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$1 = require('../KeyValueBundle/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$stateVarId = ''; + let field$eventId = ''; + const field$kvb = []; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$stateVarId = types.string(data); + break + + case 2: + field$eventId = types.string(data); + break + + case 3: + field$kvb.push(decode$1.decode(data)); + break + } + } + return { + stateVarId: field$stateVarId, + eventId: field$eventId, + kvb: field$kvb + } +} + +exports.decode = decode; diff --git a/cjs/vega/StateValueProposal/encode.cjs b/cjs/vega/StateValueProposal/encode.cjs new file mode 100644 index 0000000..e2961aa --- /dev/null +++ b/cjs/vega/StateValueProposal/encode.cjs @@ -0,0 +1,24 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../KeyValueBundle/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.stateVarId) writer.bytes(1, obj.stateVarId, types.string); + if (obj.eventId) writer.bytes(2, obj.eventId, types.string); + if (obj.kvb?.length) + obj.kvb.forEach((v) => writer.bytes(3, encode$1.encode(v))); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/StateVarValue.cjs b/cjs/vega/StateVarValue.cjs new file mode 100644 index 0000000..864c99e --- /dev/null +++ b/cjs/vega/StateVarValue.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./StateVarValue/encode.cjs'); +var decode = require('./StateVarValue/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/StateVarValue/decode.cjs b/cjs/vega/StateVarValue/decode.cjs new file mode 100644 index 0000000..e1bf08e --- /dev/null +++ b/cjs/vega/StateVarValue/decode.cjs @@ -0,0 +1,30 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var decode$3 = require('../ScalarValue/decode.cjs'); +var decode$2 = require('../VectorValue/decode.cjs'); +var decode$1 = require('../MatrixValue/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$value = null; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$value = { scalarVal: decode$3.decode(data) }; + break + + case 2: + field$value = { vectorVal: decode$2.decode(data) }; + break + + case 3: + field$value = { matrixVal: decode$1.decode(data) }; + break + } + } + return { value: field$value } +} + +exports.decode = decode; diff --git a/cjs/vega/StateVarValue/encode.cjs b/cjs/vega/StateVarValue/encode.cjs new file mode 100644 index 0000000..b018904 --- /dev/null +++ b/cjs/vega/StateVarValue/encode.cjs @@ -0,0 +1,36 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var encode$1 = require('../ScalarValue/encode.cjs'); +var encode$2 = require('../VectorValue/encode.cjs'); +var encode$3 = require('../MatrixValue/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.value?.scalarVal ?? obj.scalarVal) + writer.bytes( + 1, + encode$1.encode(obj.value?.scalarVal ?? obj.scalarVal) + ); + if (obj.value?.vectorVal ?? obj.vectorVal) + writer.bytes( + 2, + encode$2.encode(obj.value?.vectorVal ?? obj.vectorVal) + ); + if (obj.value?.matrixVal ?? obj.matrixVal) + writer.bytes( + 3, + encode$3.encode(obj.value?.matrixVal ?? obj.matrixVal) + ); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/StopOrder.cjs b/cjs/vega/StopOrder.cjs new file mode 100644 index 0000000..d103626 --- /dev/null +++ b/cjs/vega/StopOrder.cjs @@ -0,0 +1,15 @@ +'use strict'; + +var encode = require('./StopOrder/encode.cjs'); +var decode = require('./StopOrder/decode.cjs'); +var ExpiryStrategy = require('./StopOrder/ExpiryStrategy.cjs'); +var TriggerDirection = require('./StopOrder/TriggerDirection.cjs'); +var Status = require('./StopOrder/Status.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; +exports.ExpiryStrategy = ExpiryStrategy; +exports.TriggerDirection = TriggerDirection; +exports.Status = Status; diff --git a/cjs/vega/StopOrder/ExpiryStrategy.cjs b/cjs/vega/StopOrder/ExpiryStrategy.cjs new file mode 100644 index 0000000..0bf70cc --- /dev/null +++ b/cjs/vega/StopOrder/ExpiryStrategy.cjs @@ -0,0 +1,71 @@ +'use strict'; + +var assert = require('nanoassert'); +var types = require('protobuf-codec/encode/types'); +var types$1 = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +const EXPIRY_STRATEGY_UNSPECIFIED = 0; +const EXPIRY_STRATEGY_CANCELS = 1; +const EXPIRY_STRATEGY_SUBMIT = 2; + +const enumValues = new Map([ + [0, 'EXPIRY_STRATEGY_UNSPECIFIED'], + [1, 'EXPIRY_STRATEGY_CANCELS'], + [2, 'EXPIRY_STRATEGY_SUBMIT'] +]); +const enumNames = new Map([ + ['EXPIRY_STRATEGY_UNSPECIFIED', 0], + ['EXPIRY_STRATEGY_CANCELS', 1], + ['EXPIRY_STRATEGY_SUBMIT', 2] +]); + +function encode(value, buf, byteOffset = 0) { + if (typeof value === 'string') return encode(parse(value), buf, byteOffset) + if (value == null) + throw new Error('Invalid ExpiryStrategy value (' + value + ')') + + return types.enumerable.encode(value, buf, byteOffset) +} + +function decode(varint) { + const int = types$1.enumerable(varint); + + return stringify(int) ?? int +} + +function encodingLength(value) { + if (typeof value === 'string') return encodingLength(parse(value)) + assert(value != null, 'Invalid ExpiryStrategy value (' + value + ')'); + + if (0 <= value && value <= 2) return 1 + + // enumerable max value in case of unknown value + return 5 +} + +/** + * Convert an enum value to it's human readable name. + * Returns undefined on an unknown value. + */ +function stringify(int) { + return enumValues.get(int) +} + +/** + * Convert an enum string names to it's machine integer value. + * Returns undefined on an unknown name. + */ +function parse(str) { + return enumNames.get(str) +} + +exports.EXPIRY_STRATEGY_CANCELS = EXPIRY_STRATEGY_CANCELS; +exports.EXPIRY_STRATEGY_SUBMIT = EXPIRY_STRATEGY_SUBMIT; +exports.EXPIRY_STRATEGY_UNSPECIFIED = EXPIRY_STRATEGY_UNSPECIFIED; +exports.decode = decode; +exports.encode = encode; +exports.encodingLength = encodingLength; +exports.parse = parse; +exports.stringify = stringify; diff --git a/cjs/vega/StopOrder/Status.cjs b/cjs/vega/StopOrder/Status.cjs new file mode 100644 index 0000000..a53d0f6 --- /dev/null +++ b/cjs/vega/StopOrder/Status.cjs @@ -0,0 +1,86 @@ +'use strict'; + +var assert = require('nanoassert'); +var types = require('protobuf-codec/encode/types'); +var types$1 = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +const STATUS_UNSPECIFIED = 0; +const STATUS_PENDING = 1; +const STATUS_CANCELLED = 2; +const STATUS_STOPPED = 3; +const STATUS_TRIGGERED = 4; +const STATUS_EXPIRED = 5; +const STATUS_REJECTED = 6; + +const enumValues = new Map([ + [0, 'STATUS_UNSPECIFIED'], + [1, 'STATUS_PENDING'], + [2, 'STATUS_CANCELLED'], + [3, 'STATUS_STOPPED'], + [4, 'STATUS_TRIGGERED'], + [5, 'STATUS_EXPIRED'], + [6, 'STATUS_REJECTED'] +]); +const enumNames = new Map([ + ['STATUS_UNSPECIFIED', 0], + ['STATUS_PENDING', 1], + ['STATUS_CANCELLED', 2], + ['STATUS_STOPPED', 3], + ['STATUS_TRIGGERED', 4], + ['STATUS_EXPIRED', 5], + ['STATUS_REJECTED', 6] +]); + +function encode(value, buf, byteOffset = 0) { + if (typeof value === 'string') return encode(parse(value), buf, byteOffset) + if (value == null) throw new Error('Invalid Status value (' + value + ')') + + return types.enumerable.encode(value, buf, byteOffset) +} + +function decode(varint) { + const int = types$1.enumerable(varint); + + return stringify(int) ?? int +} + +function encodingLength(value) { + if (typeof value === 'string') return encodingLength(parse(value)) + assert(value != null, 'Invalid Status value (' + value + ')'); + + if (0 <= value && value <= 6) return 1 + + // enumerable max value in case of unknown value + return 5 +} + +/** + * Convert an enum value to it's human readable name. + * Returns undefined on an unknown value. + */ +function stringify(int) { + return enumValues.get(int) +} + +/** + * Convert an enum string names to it's machine integer value. + * Returns undefined on an unknown name. + */ +function parse(str) { + return enumNames.get(str) +} + +exports.STATUS_CANCELLED = STATUS_CANCELLED; +exports.STATUS_EXPIRED = STATUS_EXPIRED; +exports.STATUS_PENDING = STATUS_PENDING; +exports.STATUS_REJECTED = STATUS_REJECTED; +exports.STATUS_STOPPED = STATUS_STOPPED; +exports.STATUS_TRIGGERED = STATUS_TRIGGERED; +exports.STATUS_UNSPECIFIED = STATUS_UNSPECIFIED; +exports.decode = decode; +exports.encode = encode; +exports.encodingLength = encodingLength; +exports.parse = parse; +exports.stringify = stringify; diff --git a/cjs/vega/StopOrder/TriggerDirection.cjs b/cjs/vega/StopOrder/TriggerDirection.cjs new file mode 100644 index 0000000..3179726 --- /dev/null +++ b/cjs/vega/StopOrder/TriggerDirection.cjs @@ -0,0 +1,71 @@ +'use strict'; + +var assert = require('nanoassert'); +var types = require('protobuf-codec/encode/types'); +var types$1 = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +const TRIGGER_DIRECTION_UNSPECIFIED = 0; +const TRIGGER_DIRECTION_RISES_ABOVE = 1; +const TRIGGER_DIRECTION_FALLS_BELOW = 2; + +const enumValues = new Map([ + [0, 'TRIGGER_DIRECTION_UNSPECIFIED'], + [1, 'TRIGGER_DIRECTION_RISES_ABOVE'], + [2, 'TRIGGER_DIRECTION_FALLS_BELOW'] +]); +const enumNames = new Map([ + ['TRIGGER_DIRECTION_UNSPECIFIED', 0], + ['TRIGGER_DIRECTION_RISES_ABOVE', 1], + ['TRIGGER_DIRECTION_FALLS_BELOW', 2] +]); + +function encode(value, buf, byteOffset = 0) { + if (typeof value === 'string') return encode(parse(value), buf, byteOffset) + if (value == null) + throw new Error('Invalid TriggerDirection value (' + value + ')') + + return types.enumerable.encode(value, buf, byteOffset) +} + +function decode(varint) { + const int = types$1.enumerable(varint); + + return stringify(int) ?? int +} + +function encodingLength(value) { + if (typeof value === 'string') return encodingLength(parse(value)) + assert(value != null, 'Invalid TriggerDirection value (' + value + ')'); + + if (0 <= value && value <= 2) return 1 + + // enumerable max value in case of unknown value + return 5 +} + +/** + * Convert an enum value to it's human readable name. + * Returns undefined on an unknown value. + */ +function stringify(int) { + return enumValues.get(int) +} + +/** + * Convert an enum string names to it's machine integer value. + * Returns undefined on an unknown name. + */ +function parse(str) { + return enumNames.get(str) +} + +exports.TRIGGER_DIRECTION_FALLS_BELOW = TRIGGER_DIRECTION_FALLS_BELOW; +exports.TRIGGER_DIRECTION_RISES_ABOVE = TRIGGER_DIRECTION_RISES_ABOVE; +exports.TRIGGER_DIRECTION_UNSPECIFIED = TRIGGER_DIRECTION_UNSPECIFIED; +exports.decode = decode; +exports.encode = encode; +exports.encodingLength = encodingLength; +exports.parse = parse; +exports.stringify = stringify; diff --git a/cjs/vega/StopOrder/decode.cjs b/cjs/vega/StopOrder/decode.cjs new file mode 100644 index 0000000..d4397be --- /dev/null +++ b/cjs/vega/StopOrder/decode.cjs @@ -0,0 +1,95 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var ExpiryStrategy = require('./ExpiryStrategy.cjs'); +var TriggerDirection = require('./TriggerDirection.cjs'); +var Status = require('./Status.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$id = ''; + let field$ocoLinkId = null; + let field$expiresAt = null; + let field$expiryStrategy = null; + let field$triggerDirection = 0; + let field$status = 0; + let field$createdAt = 0n; + let field$updatedAt = null; + let field$orderId = ''; + let field$partyId = ''; + let field$marketId = ''; + let field$trigger = null; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$id = types.string(data); + break + + case 2: + field$ocoLinkId = types.string(data); + break + + case 3: + field$expiresAt = types.int64(data); + break + + case 4: + field$expiryStrategy = ExpiryStrategy.decode(data); + break + + case 5: + field$triggerDirection = TriggerDirection.decode(data); + break + + case 6: + field$status = Status.decode(data); + break + + case 7: + field$createdAt = types.int64(data); + break + + case 8: + field$updatedAt = types.int64(data); + break + + case 9: + field$orderId = types.string(data); + break + + case 10: + field$partyId = types.string(data); + break + + case 11: + field$marketId = types.string(data); + break + + case 100: + field$trigger = { price: types.string(data) }; + break + + case 101: + field$trigger = { trailingPercentOffset: types.string(data) }; + break + } + } + return { + id: field$id, + ocoLinkId: field$ocoLinkId, + expiresAt: field$expiresAt, + expiryStrategy: field$expiryStrategy, + triggerDirection: field$triggerDirection, + status: field$status, + createdAt: field$createdAt, + updatedAt: field$updatedAt, + orderId: field$orderId, + partyId: field$partyId, + marketId: field$marketId, + trigger: field$trigger + } +} + +exports.decode = decode; diff --git a/cjs/vega/StopOrder/encode.cjs b/cjs/vega/StopOrder/encode.cjs new file mode 100644 index 0000000..9abbc36 --- /dev/null +++ b/cjs/vega/StopOrder/encode.cjs @@ -0,0 +1,44 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var ExpiryStrategy = require('./ExpiryStrategy.cjs'); +var TriggerDirection = require('./TriggerDirection.cjs'); +var Status = require('./Status.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.id) writer.bytes(1, obj.id, types.string); + if (obj.ocoLinkId) writer.bytes(2, obj.ocoLinkId, types.string); + if (obj.expiresAt) writer.varint(3, obj.expiresAt, types.int64); + if (obj.expiryStrategy) + writer.varint(4, obj.expiryStrategy, ExpiryStrategy); + if (obj.triggerDirection) + writer.varint(5, obj.triggerDirection, TriggerDirection); + if (obj.status) writer.varint(6, obj.status, Status); + if (obj.createdAt) writer.varint(7, obj.createdAt, types.int64); + if (obj.updatedAt) writer.varint(8, obj.updatedAt, types.int64); + if (obj.orderId) writer.bytes(9, obj.orderId, types.string); + if (obj.partyId) writer.bytes(10, obj.partyId, types.string); + if (obj.marketId) writer.bytes(11, obj.marketId, types.string); + + if (obj.trigger?.price ?? obj.price) + writer.bytes(100, obj.trigger?.price ?? obj.price, types.string); + if (obj.trigger?.trailingPercentOffset ?? obj.trailingPercentOffset) + writer.bytes( + 101, + obj.trigger?.trailingPercentOffset ?? obj.trailingPercentOffset, + types.string + ); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/SuccessorConfiguration.cjs b/cjs/vega/SuccessorConfiguration.cjs new file mode 100644 index 0000000..d8569b0 --- /dev/null +++ b/cjs/vega/SuccessorConfiguration.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./SuccessorConfiguration/encode.cjs'); +var decode = require('./SuccessorConfiguration/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/SuccessorConfiguration/decode.cjs b/cjs/vega/SuccessorConfiguration/decode.cjs new file mode 100644 index 0000000..2732565 --- /dev/null +++ b/cjs/vega/SuccessorConfiguration/decode.cjs @@ -0,0 +1,28 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$parentMarketId = ''; + let field$insurancePoolFraction = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$parentMarketId = types.string(data); + break + + case 2: + field$insurancePoolFraction = types.string(data); + break + } + } + return { + parentMarketId: field$parentMarketId, + insurancePoolFraction: field$insurancePoolFraction + } +} + +exports.decode = decode; diff --git a/cjs/vega/SuccessorConfiguration/encode.cjs b/cjs/vega/SuccessorConfiguration/encode.cjs new file mode 100644 index 0000000..f908c58 --- /dev/null +++ b/cjs/vega/SuccessorConfiguration/encode.cjs @@ -0,0 +1,22 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.parentMarketId) writer.bytes(1, obj.parentMarketId, types.string); + if (obj.insurancePoolFraction) + writer.bytes(2, obj.insurancePoolFraction, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/TargetStakeParameters.cjs b/cjs/vega/TargetStakeParameters.cjs new file mode 100644 index 0000000..ca3f39e --- /dev/null +++ b/cjs/vega/TargetStakeParameters.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./TargetStakeParameters/encode.cjs'); +var decode = require('./TargetStakeParameters/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/TargetStakeParameters/decode.cjs b/cjs/vega/TargetStakeParameters/decode.cjs new file mode 100644 index 0000000..f77d194 --- /dev/null +++ b/cjs/vega/TargetStakeParameters/decode.cjs @@ -0,0 +1,25 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$timeWindow = 0n; + let field$scalingFactor = 0; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$timeWindow = types.int64(data); + break + + case 2: + field$scalingFactor = types.double(data); + break + } + } + return { timeWindow: field$timeWindow, scalingFactor: field$scalingFactor } +} + +exports.decode = decode; diff --git a/cjs/vega/TargetStakeParameters/encode.cjs b/cjs/vega/TargetStakeParameters/encode.cjs new file mode 100644 index 0000000..1859514 --- /dev/null +++ b/cjs/vega/TargetStakeParameters/encode.cjs @@ -0,0 +1,21 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.timeWindow) writer.varint(1, obj.timeWindow, types.int64); + if (obj.scalingFactor) writer.fixed64(2, obj.scalingFactor, types.double); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/TradableInstrument.cjs b/cjs/vega/TradableInstrument.cjs new file mode 100644 index 0000000..0e5feea --- /dev/null +++ b/cjs/vega/TradableInstrument.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./TradableInstrument/encode.cjs'); +var decode = require('./TradableInstrument/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/TradableInstrument/decode.cjs b/cjs/vega/TradableInstrument/decode.cjs new file mode 100644 index 0000000..353f20a --- /dev/null +++ b/cjs/vega/TradableInstrument/decode.cjs @@ -0,0 +1,45 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var decode$4 = require('../Instrument/decode.cjs'); +var decode$3 = require('../MarginCalculator/decode.cjs'); +var decode$2 = require('../LogNormalRiskModel/decode.cjs'); +var decode$1 = require('../SimpleRiskModel/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$instrument = {}; + let field$marginCalculator = {}; + let field$risk_model = null; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$instrument = decode$4.decode(data); + break + + case 2: + field$marginCalculator = decode$3.decode(data); + break + + case 100: + field$risk_model = { + logNormalRiskModel: decode$2.decode(data) + }; + break + + case 101: + field$risk_model = { + simpleRiskModel: decode$1.decode(data) + }; + break + } + } + return { + instrument: field$instrument, + marginCalculator: field$marginCalculator, + risk_model: field$risk_model + } +} + +exports.decode = decode; diff --git a/cjs/vega/TradableInstrument/encode.cjs b/cjs/vega/TradableInstrument/encode.cjs new file mode 100644 index 0000000..bf585a8 --- /dev/null +++ b/cjs/vega/TradableInstrument/encode.cjs @@ -0,0 +1,40 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var encode$1 = require('../Instrument/encode.cjs'); +var encode$2 = require('../MarginCalculator/encode.cjs'); +var encode$3 = require('../LogNormalRiskModel/encode.cjs'); +var encode$4 = require('../SimpleRiskModel/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.instrument) writer.bytes(1, encode$1.encode(obj.instrument)); + if (obj.marginCalculator) + writer.bytes(2, encode$2.encode(obj.marginCalculator)); + + if (obj.risk_model?.logNormalRiskModel ?? obj.logNormalRiskModel) + writer.bytes( + 100, + encode$3.encode( + obj.risk_model?.logNormalRiskModel ?? obj.logNormalRiskModel + ) + ); + if (obj.risk_model?.simpleRiskModel ?? obj.simpleRiskModel) + writer.bytes( + 101, + encode$4.encode( + obj.risk_model?.simpleRiskModel ?? obj.simpleRiskModel + ) + ); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/Trade.cjs b/cjs/vega/Trade.cjs new file mode 100644 index 0000000..ef5ce62 --- /dev/null +++ b/cjs/vega/Trade.cjs @@ -0,0 +1,11 @@ +'use strict'; + +var encode = require('./Trade/encode.cjs'); +var decode = require('./Trade/decode.cjs'); +var Type = require('./Trade/Type.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; +exports.Type = Type; diff --git a/cjs/vega/Trade/Type.cjs b/cjs/vega/Trade/Type.cjs new file mode 100644 index 0000000..382a7bc --- /dev/null +++ b/cjs/vega/Trade/Type.cjs @@ -0,0 +1,74 @@ +'use strict'; + +var assert = require('nanoassert'); +var types = require('protobuf-codec/encode/types'); +var types$1 = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +const TYPE_UNSPECIFIED = 0; +const TYPE_DEFAULT = 1; +const TYPE_NETWORK_CLOSE_OUT_GOOD = 2; +const TYPE_NETWORK_CLOSE_OUT_BAD = 3; + +const enumValues = new Map([ + [0, 'TYPE_UNSPECIFIED'], + [1, 'TYPE_DEFAULT'], + [2, 'TYPE_NETWORK_CLOSE_OUT_GOOD'], + [3, 'TYPE_NETWORK_CLOSE_OUT_BAD'] +]); +const enumNames = new Map([ + ['TYPE_UNSPECIFIED', 0], + ['TYPE_DEFAULT', 1], + ['TYPE_NETWORK_CLOSE_OUT_GOOD', 2], + ['TYPE_NETWORK_CLOSE_OUT_BAD', 3] +]); + +function encode(value, buf, byteOffset = 0) { + if (typeof value === 'string') return encode(parse(value), buf, byteOffset) + if (value == null) throw new Error('Invalid Type value (' + value + ')') + + return types.enumerable.encode(value, buf, byteOffset) +} + +function decode(varint) { + const int = types$1.enumerable(varint); + + return stringify(int) ?? int +} + +function encodingLength(value) { + if (typeof value === 'string') return encodingLength(parse(value)) + assert(value != null, 'Invalid Type value (' + value + ')'); + + if (0 <= value && value <= 3) return 1 + + // enumerable max value in case of unknown value + return 5 +} + +/** + * Convert an enum value to it's human readable name. + * Returns undefined on an unknown value. + */ +function stringify(int) { + return enumValues.get(int) +} + +/** + * Convert an enum string names to it's machine integer value. + * Returns undefined on an unknown name. + */ +function parse(str) { + return enumNames.get(str) +} + +exports.TYPE_DEFAULT = TYPE_DEFAULT; +exports.TYPE_NETWORK_CLOSE_OUT_BAD = TYPE_NETWORK_CLOSE_OUT_BAD; +exports.TYPE_NETWORK_CLOSE_OUT_GOOD = TYPE_NETWORK_CLOSE_OUT_GOOD; +exports.TYPE_UNSPECIFIED = TYPE_UNSPECIFIED; +exports.decode = decode; +exports.encode = encode; +exports.encodingLength = encodingLength; +exports.parse = parse; +exports.stringify = stringify; diff --git a/cjs/vega/Trade/decode.cjs b/cjs/vega/Trade/decode.cjs new file mode 100644 index 0000000..4495e5a --- /dev/null +++ b/cjs/vega/Trade/decode.cjs @@ -0,0 +1,109 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var Side = require('../Side.cjs'); +var Type = require('./Type.cjs'); +var decode$1 = require('../Fee/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$id = ''; + let field$marketId = ''; + let field$price = ''; + let field$size = 0n; + let field$buyer = ''; + let field$seller = ''; + let field$aggressor = 0; + let field$buyOrder = ''; + let field$sellOrder = ''; + let field$timestamp = 0n; + let field$type = 0; + let field$buyerFee = {}; + let field$sellerFee = {}; + let field$buyerAuctionBatch = 0n; + let field$sellerAuctionBatch = 0n; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$id = types.string(data); + break + + case 2: + field$marketId = types.string(data); + break + + case 3: + field$price = types.string(data); + break + + case 4: + field$size = types.uint64(data); + break + + case 5: + field$buyer = types.string(data); + break + + case 6: + field$seller = types.string(data); + break + + case 7: + field$aggressor = Side.decode(data); + break + + case 8: + field$buyOrder = types.string(data); + break + + case 9: + field$sellOrder = types.string(data); + break + + case 10: + field$timestamp = types.int64(data); + break + + case 11: + field$type = Type.decode(data); + break + + case 12: + field$buyerFee = decode$1.decode(data); + break + + case 13: + field$sellerFee = decode$1.decode(data); + break + + case 14: + field$buyerAuctionBatch = types.uint64(data); + break + + case 15: + field$sellerAuctionBatch = types.uint64(data); + break + } + } + return { + id: field$id, + marketId: field$marketId, + price: field$price, + size: field$size, + buyer: field$buyer, + seller: field$seller, + aggressor: field$aggressor, + buyOrder: field$buyOrder, + sellOrder: field$sellOrder, + timestamp: field$timestamp, + type: field$type, + buyerFee: field$buyerFee, + sellerFee: field$sellerFee, + buyerAuctionBatch: field$buyerAuctionBatch, + sellerAuctionBatch: field$sellerAuctionBatch + } +} + +exports.decode = decode; diff --git a/cjs/vega/Trade/encode.cjs b/cjs/vega/Trade/encode.cjs new file mode 100644 index 0000000..6c71cee --- /dev/null +++ b/cjs/vega/Trade/encode.cjs @@ -0,0 +1,37 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var Side = require('../Side.cjs'); +var Type = require('./Type.cjs'); +var encode$1 = require('../Fee/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.id) writer.bytes(1, obj.id, types.string); + if (obj.marketId) writer.bytes(2, obj.marketId, types.string); + if (obj.price) writer.bytes(3, obj.price, types.string); + if (obj.size) writer.varint(4, obj.size, types.uint64); + if (obj.buyer) writer.bytes(5, obj.buyer, types.string); + if (obj.seller) writer.bytes(6, obj.seller, types.string); + if (obj.aggressor) writer.varint(7, obj.aggressor, Side); + if (obj.buyOrder) writer.bytes(8, obj.buyOrder, types.string); + if (obj.sellOrder) writer.bytes(9, obj.sellOrder, types.string); + if (obj.timestamp) writer.varint(10, obj.timestamp, types.int64); + if (obj.type) writer.varint(11, obj.type, Type); + if (obj.buyerFee) writer.bytes(12, encode$1.encode(obj.buyerFee)); + if (obj.sellerFee) writer.bytes(13, encode$1.encode(obj.sellerFee)); + if (obj.buyerAuctionBatch) writer.varint(14, obj.buyerAuctionBatch, types.uint64); + if (obj.sellerAuctionBatch) writer.varint(15, obj.sellerAuctionBatch, types.uint64); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/TradeSet.cjs b/cjs/vega/TradeSet.cjs new file mode 100644 index 0000000..87139b4 --- /dev/null +++ b/cjs/vega/TradeSet.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./TradeSet/encode.cjs'); +var decode = require('./TradeSet/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/TradeSet/decode.cjs b/cjs/vega/TradeSet/decode.cjs new file mode 100644 index 0000000..8a6066f --- /dev/null +++ b/cjs/vega/TradeSet/decode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var decode$1 = require('../Trade/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + const field$trades = []; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$trades.push(decode$1.decode(data)); + break + } + } + return { trades: field$trades } +} + +exports.decode = decode; diff --git a/cjs/vega/TradeSet/encode.cjs b/cjs/vega/TradeSet/encode.cjs new file mode 100644 index 0000000..8bb048d --- /dev/null +++ b/cjs/vega/TradeSet/encode.cjs @@ -0,0 +1,21 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var encode$1 = require('../Trade/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.trades?.length) + obj.trades.forEach((v) => writer.bytes(1, encode$1.encode(v))); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/Transfer.cjs b/cjs/vega/Transfer.cjs new file mode 100644 index 0000000..87b3586 --- /dev/null +++ b/cjs/vega/Transfer.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./Transfer/encode.cjs'); +var decode = require('./Transfer/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/Transfer/decode.cjs b/cjs/vega/Transfer/decode.cjs new file mode 100644 index 0000000..e36b696 --- /dev/null +++ b/cjs/vega/Transfer/decode.cjs @@ -0,0 +1,48 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$1 = require('../FinancialAmount/decode.cjs'); +var TransferType = require('../TransferType.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$owner = ''; + let field$amount = {}; + let field$type = 0; + let field$minAmount = ''; + let field$marketId = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$owner = types.string(data); + break + + case 2: + field$amount = decode$1.decode(data); + break + + case 3: + field$type = TransferType.decode(data); + break + + case 4: + field$minAmount = types.string(data); + break + + case 5: + field$marketId = types.string(data); + break + } + } + return { + owner: field$owner, + amount: field$amount, + type: field$type, + minAmount: field$minAmount, + marketId: field$marketId + } +} + +exports.decode = decode; diff --git a/cjs/vega/Transfer/encode.cjs b/cjs/vega/Transfer/encode.cjs new file mode 100644 index 0000000..bb21631 --- /dev/null +++ b/cjs/vega/Transfer/encode.cjs @@ -0,0 +1,26 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../FinancialAmount/encode.cjs'); +var TransferType = require('../TransferType.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.owner) writer.bytes(1, obj.owner, types.string); + if (obj.amount) writer.bytes(2, encode$1.encode(obj.amount)); + if (obj.type) writer.varint(3, obj.type, TransferType); + if (obj.minAmount) writer.bytes(4, obj.minAmount, types.string); + if (obj.marketId) writer.bytes(5, obj.marketId, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/TransferRequest.cjs b/cjs/vega/TransferRequest.cjs new file mode 100644 index 0000000..348d3de --- /dev/null +++ b/cjs/vega/TransferRequest.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./TransferRequest/encode.cjs'); +var decode = require('./TransferRequest/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/TransferRequest/decode.cjs b/cjs/vega/TransferRequest/decode.cjs new file mode 100644 index 0000000..9d6293a --- /dev/null +++ b/cjs/vega/TransferRequest/decode.cjs @@ -0,0 +1,54 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$1 = require('../Account/decode.cjs'); +var TransferType = require('../TransferType.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + const field$fromAccount = []; + const field$toAccount = []; + let field$amount = ''; + let field$minAmount = ''; + let field$asset = ''; + let field$type = 0; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$fromAccount.push(decode$1.decode(data)); + break + + case 2: + field$toAccount.push(decode$1.decode(data)); + break + + case 3: + field$amount = types.string(data); + break + + case 4: + field$minAmount = types.string(data); + break + + case 5: + field$asset = types.string(data); + break + + case 7: + field$type = TransferType.decode(data); + break + } + } + return { + fromAccount: field$fromAccount, + toAccount: field$toAccount, + amount: field$amount, + minAmount: field$minAmount, + asset: field$asset, + type: field$type + } +} + +exports.decode = decode; diff --git a/cjs/vega/TransferRequest/encode.cjs b/cjs/vega/TransferRequest/encode.cjs new file mode 100644 index 0000000..db24853 --- /dev/null +++ b/cjs/vega/TransferRequest/encode.cjs @@ -0,0 +1,29 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../Account/encode.cjs'); +var TransferType = require('../TransferType.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.fromAccount?.length) + obj.fromAccount.forEach((v) => writer.bytes(1, encode$1.encode(v))); + if (obj.toAccount?.length) + obj.toAccount.forEach((v) => writer.bytes(2, encode$1.encode(v))); + if (obj.amount) writer.bytes(3, obj.amount, types.string); + if (obj.minAmount) writer.bytes(4, obj.minAmount, types.string); + if (obj.asset) writer.bytes(5, obj.asset, types.string); + if (obj.type) writer.varint(7, obj.type, TransferType); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/TransferType.cjs b/cjs/vega/TransferType.cjs new file mode 100644 index 0000000..bfb2423 --- /dev/null +++ b/cjs/vega/TransferType.cjs @@ -0,0 +1,195 @@ +'use strict'; + +var assert = require('nanoassert'); +var types = require('protobuf-codec/encode/types'); +var types$1 = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +const TRANSFER_TYPE_UNSPECIFIED = 0; +const TRANSFER_TYPE_LOSS = 1; +const TRANSFER_TYPE_WIN = 2; +const TRANSFER_TYPE_MTM_LOSS = 4; +const TRANSFER_TYPE_MTM_WIN = 5; +const TRANSFER_TYPE_MARGIN_LOW = 6; +const TRANSFER_TYPE_MARGIN_HIGH = 7; +const TRANSFER_TYPE_MARGIN_CONFISCATED = 8; +const TRANSFER_TYPE_MAKER_FEE_PAY = 9; +const TRANSFER_TYPE_MAKER_FEE_RECEIVE = 10; +const TRANSFER_TYPE_INFRASTRUCTURE_FEE_PAY = 11; +const TRANSFER_TYPE_INFRASTRUCTURE_FEE_DISTRIBUTE = 12; +const TRANSFER_TYPE_LIQUIDITY_FEE_PAY = 13; +const TRANSFER_TYPE_LIQUIDITY_FEE_DISTRIBUTE = 14; +const TRANSFER_TYPE_BOND_LOW = 15; +const TRANSFER_TYPE_BOND_HIGH = 16; +const TRANSFER_TYPE_WITHDRAW = 18; +const TRANSFER_TYPE_DEPOSIT = 19; +const TRANSFER_TYPE_BOND_SLASHING = 20; +const TRANSFER_TYPE_REWARD_PAYOUT = 21; +const TRANSFER_TYPE_TRANSFER_FUNDS_SEND = 22; +const TRANSFER_TYPE_TRANSFER_FUNDS_DISTRIBUTE = 23; +const TRANSFER_TYPE_CLEAR_ACCOUNT = 24; +const TRANSFER_TYPE_CHECKPOINT_BALANCE_RESTORE = 25; +const TRANSFER_TYPE_SPOT = 26; +const TRANSFER_TYPE_HOLDING_LOCK = 27; +const TRANSFER_TYPE_HOLDING_RELEASE = 28; +const TRANSFER_TYPE_SUCCESSOR_INSURANCE_FRACTION = 29; +const TRANSFER_TYPE_LIQUIDITY_FEE_ALLOCATE = 30; +const TRANSFER_TYPE_LIQUIDITY_FEE_NET_DISTRIBUTE = 31; +const TRANSFER_TYPE_SLA_PENALTY_BOND_APPLY = 32; +const TRANSFER_TYPE_SLA_PENALTY_LP_FEE_APPLY = 33; +const TRANSFER_TYPE_LIQUIDITY_FEE_UNPAID_COLLECT = 34; +const TRANSFER_TYPE_SLA_PERFORMANCE_BONUS_DISTRIBUTE = 35; + +const enumValues = new Map([ + [0, 'TRANSFER_TYPE_UNSPECIFIED'], + [1, 'TRANSFER_TYPE_LOSS'], + [2, 'TRANSFER_TYPE_WIN'], + [4, 'TRANSFER_TYPE_MTM_LOSS'], + [5, 'TRANSFER_TYPE_MTM_WIN'], + [6, 'TRANSFER_TYPE_MARGIN_LOW'], + [7, 'TRANSFER_TYPE_MARGIN_HIGH'], + [8, 'TRANSFER_TYPE_MARGIN_CONFISCATED'], + [9, 'TRANSFER_TYPE_MAKER_FEE_PAY'], + [10, 'TRANSFER_TYPE_MAKER_FEE_RECEIVE'], + [11, 'TRANSFER_TYPE_INFRASTRUCTURE_FEE_PAY'], + [12, 'TRANSFER_TYPE_INFRASTRUCTURE_FEE_DISTRIBUTE'], + [13, 'TRANSFER_TYPE_LIQUIDITY_FEE_PAY'], + [14, 'TRANSFER_TYPE_LIQUIDITY_FEE_DISTRIBUTE'], + [15, 'TRANSFER_TYPE_BOND_LOW'], + [16, 'TRANSFER_TYPE_BOND_HIGH'], + [18, 'TRANSFER_TYPE_WITHDRAW'], + [19, 'TRANSFER_TYPE_DEPOSIT'], + [20, 'TRANSFER_TYPE_BOND_SLASHING'], + [21, 'TRANSFER_TYPE_REWARD_PAYOUT'], + [22, 'TRANSFER_TYPE_TRANSFER_FUNDS_SEND'], + [23, 'TRANSFER_TYPE_TRANSFER_FUNDS_DISTRIBUTE'], + [24, 'TRANSFER_TYPE_CLEAR_ACCOUNT'], + [25, 'TRANSFER_TYPE_CHECKPOINT_BALANCE_RESTORE'], + [26, 'TRANSFER_TYPE_SPOT'], + [27, 'TRANSFER_TYPE_HOLDING_LOCK'], + [28, 'TRANSFER_TYPE_HOLDING_RELEASE'], + [29, 'TRANSFER_TYPE_SUCCESSOR_INSURANCE_FRACTION'], + [30, 'TRANSFER_TYPE_LIQUIDITY_FEE_ALLOCATE'], + [31, 'TRANSFER_TYPE_LIQUIDITY_FEE_NET_DISTRIBUTE'], + [32, 'TRANSFER_TYPE_SLA_PENALTY_BOND_APPLY'], + [33, 'TRANSFER_TYPE_SLA_PENALTY_LP_FEE_APPLY'], + [34, 'TRANSFER_TYPE_LIQUIDITY_FEE_UNPAID_COLLECT'], + [35, 'TRANSFER_TYPE_SLA_PERFORMANCE_BONUS_DISTRIBUTE'] +]); +const enumNames = new Map([ + ['TRANSFER_TYPE_UNSPECIFIED', 0], + ['TRANSFER_TYPE_LOSS', 1], + ['TRANSFER_TYPE_WIN', 2], + ['TRANSFER_TYPE_MTM_LOSS', 4], + ['TRANSFER_TYPE_MTM_WIN', 5], + ['TRANSFER_TYPE_MARGIN_LOW', 6], + ['TRANSFER_TYPE_MARGIN_HIGH', 7], + ['TRANSFER_TYPE_MARGIN_CONFISCATED', 8], + ['TRANSFER_TYPE_MAKER_FEE_PAY', 9], + ['TRANSFER_TYPE_MAKER_FEE_RECEIVE', 10], + ['TRANSFER_TYPE_INFRASTRUCTURE_FEE_PAY', 11], + ['TRANSFER_TYPE_INFRASTRUCTURE_FEE_DISTRIBUTE', 12], + ['TRANSFER_TYPE_LIQUIDITY_FEE_PAY', 13], + ['TRANSFER_TYPE_LIQUIDITY_FEE_DISTRIBUTE', 14], + ['TRANSFER_TYPE_BOND_LOW', 15], + ['TRANSFER_TYPE_BOND_HIGH', 16], + ['TRANSFER_TYPE_WITHDRAW', 18], + ['TRANSFER_TYPE_DEPOSIT', 19], + ['TRANSFER_TYPE_BOND_SLASHING', 20], + ['TRANSFER_TYPE_REWARD_PAYOUT', 21], + ['TRANSFER_TYPE_TRANSFER_FUNDS_SEND', 22], + ['TRANSFER_TYPE_TRANSFER_FUNDS_DISTRIBUTE', 23], + ['TRANSFER_TYPE_CLEAR_ACCOUNT', 24], + ['TRANSFER_TYPE_CHECKPOINT_BALANCE_RESTORE', 25], + ['TRANSFER_TYPE_SPOT', 26], + ['TRANSFER_TYPE_HOLDING_LOCK', 27], + ['TRANSFER_TYPE_HOLDING_RELEASE', 28], + ['TRANSFER_TYPE_SUCCESSOR_INSURANCE_FRACTION', 29], + ['TRANSFER_TYPE_LIQUIDITY_FEE_ALLOCATE', 30], + ['TRANSFER_TYPE_LIQUIDITY_FEE_NET_DISTRIBUTE', 31], + ['TRANSFER_TYPE_SLA_PENALTY_BOND_APPLY', 32], + ['TRANSFER_TYPE_SLA_PENALTY_LP_FEE_APPLY', 33], + ['TRANSFER_TYPE_LIQUIDITY_FEE_UNPAID_COLLECT', 34], + ['TRANSFER_TYPE_SLA_PERFORMANCE_BONUS_DISTRIBUTE', 35] +]); + +function encode(value, buf, byteOffset = 0) { + if (typeof value === 'string') return encode(parse(value), buf, byteOffset) + if (value == null) + throw new Error('Invalid TransferType value (' + value + ')') + + return types.enumerable.encode(value, buf, byteOffset) +} + +function decode(varint) { + const int = types$1.enumerable(varint); + + return stringify(int) ?? int +} + +function encodingLength(value) { + if (typeof value === 'string') return encodingLength(parse(value)) + assert(value != null, 'Invalid TransferType value (' + value + ')'); + + if (0 <= value && value <= 35) return 1 + + // enumerable max value in case of unknown value + return 5 +} + +/** + * Convert an enum value to it's human readable name. + * Returns undefined on an unknown value. + */ +function stringify(int) { + return enumValues.get(int) +} + +/** + * Convert an enum string names to it's machine integer value. + * Returns undefined on an unknown name. + */ +function parse(str) { + return enumNames.get(str) +} + +exports.TRANSFER_TYPE_BOND_HIGH = TRANSFER_TYPE_BOND_HIGH; +exports.TRANSFER_TYPE_BOND_LOW = TRANSFER_TYPE_BOND_LOW; +exports.TRANSFER_TYPE_BOND_SLASHING = TRANSFER_TYPE_BOND_SLASHING; +exports.TRANSFER_TYPE_CHECKPOINT_BALANCE_RESTORE = TRANSFER_TYPE_CHECKPOINT_BALANCE_RESTORE; +exports.TRANSFER_TYPE_CLEAR_ACCOUNT = TRANSFER_TYPE_CLEAR_ACCOUNT; +exports.TRANSFER_TYPE_DEPOSIT = TRANSFER_TYPE_DEPOSIT; +exports.TRANSFER_TYPE_HOLDING_LOCK = TRANSFER_TYPE_HOLDING_LOCK; +exports.TRANSFER_TYPE_HOLDING_RELEASE = TRANSFER_TYPE_HOLDING_RELEASE; +exports.TRANSFER_TYPE_INFRASTRUCTURE_FEE_DISTRIBUTE = TRANSFER_TYPE_INFRASTRUCTURE_FEE_DISTRIBUTE; +exports.TRANSFER_TYPE_INFRASTRUCTURE_FEE_PAY = TRANSFER_TYPE_INFRASTRUCTURE_FEE_PAY; +exports.TRANSFER_TYPE_LIQUIDITY_FEE_ALLOCATE = TRANSFER_TYPE_LIQUIDITY_FEE_ALLOCATE; +exports.TRANSFER_TYPE_LIQUIDITY_FEE_DISTRIBUTE = TRANSFER_TYPE_LIQUIDITY_FEE_DISTRIBUTE; +exports.TRANSFER_TYPE_LIQUIDITY_FEE_NET_DISTRIBUTE = TRANSFER_TYPE_LIQUIDITY_FEE_NET_DISTRIBUTE; +exports.TRANSFER_TYPE_LIQUIDITY_FEE_PAY = TRANSFER_TYPE_LIQUIDITY_FEE_PAY; +exports.TRANSFER_TYPE_LIQUIDITY_FEE_UNPAID_COLLECT = TRANSFER_TYPE_LIQUIDITY_FEE_UNPAID_COLLECT; +exports.TRANSFER_TYPE_LOSS = TRANSFER_TYPE_LOSS; +exports.TRANSFER_TYPE_MAKER_FEE_PAY = TRANSFER_TYPE_MAKER_FEE_PAY; +exports.TRANSFER_TYPE_MAKER_FEE_RECEIVE = TRANSFER_TYPE_MAKER_FEE_RECEIVE; +exports.TRANSFER_TYPE_MARGIN_CONFISCATED = TRANSFER_TYPE_MARGIN_CONFISCATED; +exports.TRANSFER_TYPE_MARGIN_HIGH = TRANSFER_TYPE_MARGIN_HIGH; +exports.TRANSFER_TYPE_MARGIN_LOW = TRANSFER_TYPE_MARGIN_LOW; +exports.TRANSFER_TYPE_MTM_LOSS = TRANSFER_TYPE_MTM_LOSS; +exports.TRANSFER_TYPE_MTM_WIN = TRANSFER_TYPE_MTM_WIN; +exports.TRANSFER_TYPE_REWARD_PAYOUT = TRANSFER_TYPE_REWARD_PAYOUT; +exports.TRANSFER_TYPE_SLA_PENALTY_BOND_APPLY = TRANSFER_TYPE_SLA_PENALTY_BOND_APPLY; +exports.TRANSFER_TYPE_SLA_PENALTY_LP_FEE_APPLY = TRANSFER_TYPE_SLA_PENALTY_LP_FEE_APPLY; +exports.TRANSFER_TYPE_SLA_PERFORMANCE_BONUS_DISTRIBUTE = TRANSFER_TYPE_SLA_PERFORMANCE_BONUS_DISTRIBUTE; +exports.TRANSFER_TYPE_SPOT = TRANSFER_TYPE_SPOT; +exports.TRANSFER_TYPE_SUCCESSOR_INSURANCE_FRACTION = TRANSFER_TYPE_SUCCESSOR_INSURANCE_FRACTION; +exports.TRANSFER_TYPE_TRANSFER_FUNDS_DISTRIBUTE = TRANSFER_TYPE_TRANSFER_FUNDS_DISTRIBUTE; +exports.TRANSFER_TYPE_TRANSFER_FUNDS_SEND = TRANSFER_TYPE_TRANSFER_FUNDS_SEND; +exports.TRANSFER_TYPE_UNSPECIFIED = TRANSFER_TYPE_UNSPECIFIED; +exports.TRANSFER_TYPE_WIN = TRANSFER_TYPE_WIN; +exports.TRANSFER_TYPE_WITHDRAW = TRANSFER_TYPE_WITHDRAW; +exports.decode = decode; +exports.encode = encode; +exports.encodingLength = encodingLength; +exports.parse = parse; +exports.stringify = stringify; diff --git a/cjs/vega/UpdateAsset.cjs b/cjs/vega/UpdateAsset.cjs new file mode 100644 index 0000000..d848e73 --- /dev/null +++ b/cjs/vega/UpdateAsset.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./UpdateAsset/encode.cjs'); +var decode = require('./UpdateAsset/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/UpdateAsset/decode.cjs b/cjs/vega/UpdateAsset/decode.cjs new file mode 100644 index 0000000..714504f --- /dev/null +++ b/cjs/vega/UpdateAsset/decode.cjs @@ -0,0 +1,26 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$1 = require('../AssetDetailsUpdate/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$assetId = ''; + let field$changes = {}; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$assetId = types.string(data); + break + + case 2: + field$changes = decode$1.decode(data); + break + } + } + return { assetId: field$assetId, changes: field$changes } +} + +exports.decode = decode; diff --git a/cjs/vega/UpdateAsset/encode.cjs b/cjs/vega/UpdateAsset/encode.cjs new file mode 100644 index 0000000..a554785 --- /dev/null +++ b/cjs/vega/UpdateAsset/encode.cjs @@ -0,0 +1,22 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../AssetDetailsUpdate/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.assetId) writer.bytes(1, obj.assetId, types.string); + if (obj.changes) writer.bytes(2, encode$1.encode(obj.changes)); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/UpdateFutureProduct.cjs b/cjs/vega/UpdateFutureProduct.cjs new file mode 100644 index 0000000..6b1b91b --- /dev/null +++ b/cjs/vega/UpdateFutureProduct.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./UpdateFutureProduct/encode.cjs'); +var decode = require('./UpdateFutureProduct/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/UpdateFutureProduct/decode.cjs b/cjs/vega/UpdateFutureProduct/decode.cjs new file mode 100644 index 0000000..ffb19e3 --- /dev/null +++ b/cjs/vega/UpdateFutureProduct/decode.cjs @@ -0,0 +1,46 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$2 = require('../DataSourceDefinition/decode.cjs'); +var decode$1 = require('../DataSourceSpecToFutureBinding/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$quoteName = ''; + let field$dataSourceSpecForSettlementData = {}; + let field$dataSourceSpecForTradingTermination = {}; + let field$dataSourceSpecBinding = {}; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$quoteName = types.string(data); + break + + case 2: + field$dataSourceSpecForSettlementData = + decode$2.decode(data); + break + + case 3: + field$dataSourceSpecForTradingTermination = + decode$2.decode(data); + break + + case 4: + field$dataSourceSpecBinding = + decode$1.decode(data); + break + } + } + return { + quoteName: field$quoteName, + dataSourceSpecForSettlementData: field$dataSourceSpecForSettlementData, + dataSourceSpecForTradingTermination: + field$dataSourceSpecForTradingTermination, + dataSourceSpecBinding: field$dataSourceSpecBinding + } +} + +exports.decode = decode; diff --git a/cjs/vega/UpdateFutureProduct/encode.cjs b/cjs/vega/UpdateFutureProduct/encode.cjs new file mode 100644 index 0000000..a55def1 --- /dev/null +++ b/cjs/vega/UpdateFutureProduct/encode.cjs @@ -0,0 +1,37 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../DataSourceDefinition/encode.cjs'); +var encode$2 = require('../DataSourceSpecToFutureBinding/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.quoteName) writer.bytes(1, obj.quoteName, types.string); + if (obj.dataSourceSpecForSettlementData) + writer.bytes( + 2, + encode$1.encode(obj.dataSourceSpecForSettlementData) + ); + if (obj.dataSourceSpecForTradingTermination) + writer.bytes( + 3, + encode$1.encode(obj.dataSourceSpecForTradingTermination) + ); + if (obj.dataSourceSpecBinding) + writer.bytes( + 4, + encode$2.encode(obj.dataSourceSpecBinding) + ); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/UpdateInstrumentConfiguration.cjs b/cjs/vega/UpdateInstrumentConfiguration.cjs new file mode 100644 index 0000000..62f0e6a --- /dev/null +++ b/cjs/vega/UpdateInstrumentConfiguration.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./UpdateInstrumentConfiguration/encode.cjs'); +var decode = require('./UpdateInstrumentConfiguration/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/UpdateInstrumentConfiguration/decode.cjs b/cjs/vega/UpdateInstrumentConfiguration/decode.cjs new file mode 100644 index 0000000..947646a --- /dev/null +++ b/cjs/vega/UpdateInstrumentConfiguration/decode.cjs @@ -0,0 +1,26 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$1 = require('../UpdateFutureProduct/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$code = ''; + let field$product = null; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$code = types.string(data); + break + + case 100: + field$product = { future: decode$1.decode(data) }; + break + } + } + return { code: field$code, product: field$product } +} + +exports.decode = decode; diff --git a/cjs/vega/UpdateInstrumentConfiguration/encode.cjs b/cjs/vega/UpdateInstrumentConfiguration/encode.cjs new file mode 100644 index 0000000..fc86315 --- /dev/null +++ b/cjs/vega/UpdateInstrumentConfiguration/encode.cjs @@ -0,0 +1,27 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../UpdateFutureProduct/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.code) writer.bytes(1, obj.code, types.string); + + if (obj.product?.future ?? obj.future) + writer.bytes( + 100, + encode$1.encode(obj.product?.future ?? obj.future) + ); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/UpdateMarket.cjs b/cjs/vega/UpdateMarket.cjs new file mode 100644 index 0000000..04139de --- /dev/null +++ b/cjs/vega/UpdateMarket.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./UpdateMarket/encode.cjs'); +var decode = require('./UpdateMarket/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/UpdateMarket/decode.cjs b/cjs/vega/UpdateMarket/decode.cjs new file mode 100644 index 0000000..7cf1505 --- /dev/null +++ b/cjs/vega/UpdateMarket/decode.cjs @@ -0,0 +1,26 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$1 = require('../UpdateMarketConfiguration/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$marketId = ''; + let field$changes = {}; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$marketId = types.string(data); + break + + case 2: + field$changes = decode$1.decode(data); + break + } + } + return { marketId: field$marketId, changes: field$changes } +} + +exports.decode = decode; diff --git a/cjs/vega/UpdateMarket/encode.cjs b/cjs/vega/UpdateMarket/encode.cjs new file mode 100644 index 0000000..8f66967 --- /dev/null +++ b/cjs/vega/UpdateMarket/encode.cjs @@ -0,0 +1,23 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../UpdateMarketConfiguration/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.marketId) writer.bytes(1, obj.marketId, types.string); + if (obj.changes) + writer.bytes(2, encode$1.encode(obj.changes)); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/UpdateMarketConfiguration.cjs b/cjs/vega/UpdateMarketConfiguration.cjs new file mode 100644 index 0000000..b88c165 --- /dev/null +++ b/cjs/vega/UpdateMarketConfiguration.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./UpdateMarketConfiguration/encode.cjs'); +var decode = require('./UpdateMarketConfiguration/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/UpdateMarketConfiguration/decode.cjs b/cjs/vega/UpdateMarketConfiguration/decode.cjs new file mode 100644 index 0000000..e26af9f --- /dev/null +++ b/cjs/vega/UpdateMarketConfiguration/decode.cjs @@ -0,0 +1,77 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$5 = require('../UpdateInstrumentConfiguration/decode.cjs'); +var decode$4 = require('../PriceMonitoringParameters/decode.cjs'); +var decode$3 = require('../LiquidityMonitoringParameters/decode.cjs'); +var decode$2 = require('../SimpleModelParams/decode.cjs'); +var decode$1 = require('../LogNormalRiskModel/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$instrument = {}; + const field$metadata = []; + let field$priceMonitoringParameters = {}; + let field$liquidityMonitoringParameters = {}; + let field$lpPriceRange = ''; + let field$linearSlippageFactor = ''; + let field$quadraticSlippageFactor = ''; + let field$risk_parameters = null; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$instrument = decode$5.decode(data); + break + + case 2: + field$metadata.push(types.string(data)); + break + + case 3: + field$priceMonitoringParameters = + decode$4.decode(data); + break + + case 4: + field$liquidityMonitoringParameters = + decode$3.decode(data); + break + + case 100: + field$risk_parameters = { simple: decode$2.decode(data) }; + break + + case 101: + field$risk_parameters = { + logNormal: decode$1.decode(data) + }; + break + + case 5: + field$lpPriceRange = types.string(data); + break + + case 6: + field$linearSlippageFactor = types.string(data); + break + + case 7: + field$quadraticSlippageFactor = types.string(data); + break + } + } + return { + instrument: field$instrument, + metadata: field$metadata, + priceMonitoringParameters: field$priceMonitoringParameters, + liquidityMonitoringParameters: field$liquidityMonitoringParameters, + lpPriceRange: field$lpPriceRange, + linearSlippageFactor: field$linearSlippageFactor, + quadraticSlippageFactor: field$quadraticSlippageFactor, + risk_parameters: field$risk_parameters + } +} + +exports.decode = decode; diff --git a/cjs/vega/UpdateMarketConfiguration/encode.cjs b/cjs/vega/UpdateMarketConfiguration/encode.cjs new file mode 100644 index 0000000..89f02e8 --- /dev/null +++ b/cjs/vega/UpdateMarketConfiguration/encode.cjs @@ -0,0 +1,58 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../UpdateInstrumentConfiguration/encode.cjs'); +var encode$2 = require('../PriceMonitoringParameters/encode.cjs'); +var encode$3 = require('../LiquidityMonitoringParameters/encode.cjs'); +var encode$4 = require('../SimpleModelParams/encode.cjs'); +var encode$5 = require('../LogNormalRiskModel/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.instrument) + writer.bytes(1, encode$1.encode(obj.instrument)); + if (obj.metadata?.length) + obj.metadata.forEach((v) => writer.bytes(2, v, types.string)); + if (obj.priceMonitoringParameters) + writer.bytes( + 3, + encode$2.encode(obj.priceMonitoringParameters) + ); + if (obj.liquidityMonitoringParameters) + writer.bytes( + 4, + encode$3.encode( + obj.liquidityMonitoringParameters + ) + ); + if (obj.lpPriceRange) writer.bytes(5, obj.lpPriceRange, types.string); + if (obj.linearSlippageFactor) + writer.bytes(6, obj.linearSlippageFactor, types.string); + if (obj.quadraticSlippageFactor) + writer.bytes(7, obj.quadraticSlippageFactor, types.string); + + if (obj.risk_parameters?.simple ?? obj.simple) + writer.bytes( + 100, + encode$4.encode(obj.risk_parameters?.simple ?? obj.simple) + ); + if (obj.risk_parameters?.logNormal ?? obj.logNormal) + writer.bytes( + 101, + encode$5.encode( + obj.risk_parameters?.logNormal ?? obj.logNormal + ) + ); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/UpdateNetworkParameter.cjs b/cjs/vega/UpdateNetworkParameter.cjs new file mode 100644 index 0000000..6169e74 --- /dev/null +++ b/cjs/vega/UpdateNetworkParameter.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./UpdateNetworkParameter/encode.cjs'); +var decode = require('./UpdateNetworkParameter/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/UpdateNetworkParameter/decode.cjs b/cjs/vega/UpdateNetworkParameter/decode.cjs new file mode 100644 index 0000000..8d18b9a --- /dev/null +++ b/cjs/vega/UpdateNetworkParameter/decode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var decode$1 = require('../NetworkParameter/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$changes = {}; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$changes = decode$1.decode(data); + break + } + } + return { changes: field$changes } +} + +exports.decode = decode; diff --git a/cjs/vega/UpdateNetworkParameter/encode.cjs b/cjs/vega/UpdateNetworkParameter/encode.cjs new file mode 100644 index 0000000..48a522e --- /dev/null +++ b/cjs/vega/UpdateNetworkParameter/encode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var encode$1 = require('../NetworkParameter/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.changes) writer.bytes(1, encode$1.encode(obj.changes)); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/UpdateSpotMarket.cjs b/cjs/vega/UpdateSpotMarket.cjs new file mode 100644 index 0000000..18939f1 --- /dev/null +++ b/cjs/vega/UpdateSpotMarket.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./UpdateSpotMarket/encode.cjs'); +var decode = require('./UpdateSpotMarket/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/UpdateSpotMarket/decode.cjs b/cjs/vega/UpdateSpotMarket/decode.cjs new file mode 100644 index 0000000..6ae7a17 --- /dev/null +++ b/cjs/vega/UpdateSpotMarket/decode.cjs @@ -0,0 +1,26 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$1 = require('../UpdateSpotMarketConfiguration/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$marketId = ''; + let field$changes = {}; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$marketId = types.string(data); + break + + case 2: + field$changes = decode$1.decode(data); + break + } + } + return { marketId: field$marketId, changes: field$changes } +} + +exports.decode = decode; diff --git a/cjs/vega/UpdateSpotMarket/encode.cjs b/cjs/vega/UpdateSpotMarket/encode.cjs new file mode 100644 index 0000000..30738e8 --- /dev/null +++ b/cjs/vega/UpdateSpotMarket/encode.cjs @@ -0,0 +1,23 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../UpdateSpotMarketConfiguration/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.marketId) writer.bytes(1, obj.marketId, types.string); + if (obj.changes) + writer.bytes(2, encode$1.encode(obj.changes)); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/UpdateSpotMarketConfiguration.cjs b/cjs/vega/UpdateSpotMarketConfiguration.cjs new file mode 100644 index 0000000..8396b8a --- /dev/null +++ b/cjs/vega/UpdateSpotMarketConfiguration.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./UpdateSpotMarketConfiguration/encode.cjs'); +var decode = require('./UpdateSpotMarketConfiguration/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/UpdateSpotMarketConfiguration/decode.cjs b/cjs/vega/UpdateSpotMarketConfiguration/decode.cjs new file mode 100644 index 0000000..688656c --- /dev/null +++ b/cjs/vega/UpdateSpotMarketConfiguration/decode.cjs @@ -0,0 +1,51 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$4 = require('../PriceMonitoringParameters/decode.cjs'); +var decode$3 = require('../TargetStakeParameters/decode.cjs'); +var decode$2 = require('../SimpleModelParams/decode.cjs'); +var decode$1 = require('../LogNormalRiskModel/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + const field$metadata = []; + let field$priceMonitoringParameters = {}; + let field$targetStakeParameters = {}; + let field$risk_parameters = null; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$metadata.push(types.string(data)); + break + + case 2: + field$priceMonitoringParameters = + decode$4.decode(data); + break + + case 3: + field$targetStakeParameters = decode$3.decode(data); + break + + case 100: + field$risk_parameters = { simple: decode$2.decode(data) }; + break + + case 101: + field$risk_parameters = { + logNormal: decode$1.decode(data) + }; + break + } + } + return { + metadata: field$metadata, + priceMonitoringParameters: field$priceMonitoringParameters, + targetStakeParameters: field$targetStakeParameters, + risk_parameters: field$risk_parameters + } +} + +exports.decode = decode; diff --git a/cjs/vega/UpdateSpotMarketConfiguration/encode.cjs b/cjs/vega/UpdateSpotMarketConfiguration/encode.cjs new file mode 100644 index 0000000..1f5ead4 --- /dev/null +++ b/cjs/vega/UpdateSpotMarketConfiguration/encode.cjs @@ -0,0 +1,48 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../PriceMonitoringParameters/encode.cjs'); +var encode$2 = require('../TargetStakeParameters/encode.cjs'); +var encode$3 = require('../SimpleModelParams/encode.cjs'); +var encode$4 = require('../LogNormalRiskModel/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.metadata?.length) + obj.metadata.forEach((v) => writer.bytes(1, v, types.string)); + if (obj.priceMonitoringParameters) + writer.bytes( + 2, + encode$1.encode(obj.priceMonitoringParameters) + ); + if (obj.targetStakeParameters) + writer.bytes( + 3, + encode$2.encode(obj.targetStakeParameters) + ); + + if (obj.risk_parameters?.simple ?? obj.simple) + writer.bytes( + 100, + encode$3.encode(obj.risk_parameters?.simple ?? obj.simple) + ); + if (obj.risk_parameters?.logNormal ?? obj.logNormal) + writer.bytes( + 101, + encode$4.encode( + obj.risk_parameters?.logNormal ?? obj.logNormal + ) + ); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/ValidatorNodeStatus.cjs b/cjs/vega/ValidatorNodeStatus.cjs new file mode 100644 index 0000000..7fad577 --- /dev/null +++ b/cjs/vega/ValidatorNodeStatus.cjs @@ -0,0 +1,75 @@ +'use strict'; + +var assert = require('nanoassert'); +var types = require('protobuf-codec/encode/types'); +var types$1 = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +const VALIDATOR_NODE_STATUS_UNSPECIFIED = 0; +const VALIDATOR_NODE_STATUS_TENDERMINT = 1; +const VALIDATOR_NODE_STATUS_ERSATZ = 2; +const VALIDATOR_NODE_STATUS_PENDING = 3; + +const enumValues = new Map([ + [0, 'VALIDATOR_NODE_STATUS_UNSPECIFIED'], + [1, 'VALIDATOR_NODE_STATUS_TENDERMINT'], + [2, 'VALIDATOR_NODE_STATUS_ERSATZ'], + [3, 'VALIDATOR_NODE_STATUS_PENDING'] +]); +const enumNames = new Map([ + ['VALIDATOR_NODE_STATUS_UNSPECIFIED', 0], + ['VALIDATOR_NODE_STATUS_TENDERMINT', 1], + ['VALIDATOR_NODE_STATUS_ERSATZ', 2], + ['VALIDATOR_NODE_STATUS_PENDING', 3] +]); + +function encode(value, buf, byteOffset = 0) { + if (typeof value === 'string') return encode(parse(value), buf, byteOffset) + if (value == null) + throw new Error('Invalid ValidatorNodeStatus value (' + value + ')') + + return types.enumerable.encode(value, buf, byteOffset) +} + +function decode(varint) { + const int = types$1.enumerable(varint); + + return stringify(int) ?? int +} + +function encodingLength(value) { + if (typeof value === 'string') return encodingLength(parse(value)) + assert(value != null, 'Invalid ValidatorNodeStatus value (' + value + ')'); + + if (0 <= value && value <= 3) return 1 + + // enumerable max value in case of unknown value + return 5 +} + +/** + * Convert an enum value to it's human readable name. + * Returns undefined on an unknown value. + */ +function stringify(int) { + return enumValues.get(int) +} + +/** + * Convert an enum string names to it's machine integer value. + * Returns undefined on an unknown name. + */ +function parse(str) { + return enumNames.get(str) +} + +exports.VALIDATOR_NODE_STATUS_ERSATZ = VALIDATOR_NODE_STATUS_ERSATZ; +exports.VALIDATOR_NODE_STATUS_PENDING = VALIDATOR_NODE_STATUS_PENDING; +exports.VALIDATOR_NODE_STATUS_TENDERMINT = VALIDATOR_NODE_STATUS_TENDERMINT; +exports.VALIDATOR_NODE_STATUS_UNSPECIFIED = VALIDATOR_NODE_STATUS_UNSPECIFIED; +exports.decode = decode; +exports.encode = encode; +exports.encodingLength = encodingLength; +exports.parse = parse; +exports.stringify = stringify; diff --git a/cjs/vega/VectorValue.cjs b/cjs/vega/VectorValue.cjs new file mode 100644 index 0000000..b408d21 --- /dev/null +++ b/cjs/vega/VectorValue.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./VectorValue/encode.cjs'); +var decode = require('./VectorValue/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/VectorValue/decode.cjs b/cjs/vega/VectorValue/decode.cjs new file mode 100644 index 0000000..ff80ca1 --- /dev/null +++ b/cjs/vega/VectorValue/decode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + const field$value = []; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$value.push(types.string(data)); + break + } + } + return { value: field$value } +} + +exports.decode = decode; diff --git a/cjs/vega/VectorValue/encode.cjs b/cjs/vega/VectorValue/encode.cjs new file mode 100644 index 0000000..9c84f09 --- /dev/null +++ b/cjs/vega/VectorValue/encode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.value?.length) obj.value.forEach((v) => writer.bytes(1, v, types.string)); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/Vote.cjs b/cjs/vega/Vote.cjs new file mode 100644 index 0000000..9c46fff --- /dev/null +++ b/cjs/vega/Vote.cjs @@ -0,0 +1,11 @@ +'use strict'; + +var encode = require('./Vote/encode.cjs'); +var decode = require('./Vote/decode.cjs'); +var Value = require('./Vote/Value.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; +exports.Value = Value; diff --git a/cjs/vega/Vote/Value.cjs b/cjs/vega/Vote/Value.cjs new file mode 100644 index 0000000..2513678 --- /dev/null +++ b/cjs/vega/Vote/Value.cjs @@ -0,0 +1,70 @@ +'use strict'; + +var assert = require('nanoassert'); +var types = require('protobuf-codec/encode/types'); +var types$1 = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +const VALUE_UNSPECIFIED = 0; +const VALUE_NO = 1; +const VALUE_YES = 2; + +const enumValues = new Map([ + [0, 'VALUE_UNSPECIFIED'], + [1, 'VALUE_NO'], + [2, 'VALUE_YES'] +]); +const enumNames = new Map([ + ['VALUE_UNSPECIFIED', 0], + ['VALUE_NO', 1], + ['VALUE_YES', 2] +]); + +function encode(value, buf, byteOffset = 0) { + if (typeof value === 'string') return encode(parse(value), buf, byteOffset) + if (value == null) throw new Error('Invalid Value value (' + value + ')') + + return types.enumerable.encode(value, buf, byteOffset) +} + +function decode(varint) { + const int = types$1.enumerable(varint); + + return stringify(int) ?? int +} + +function encodingLength(value) { + if (typeof value === 'string') return encodingLength(parse(value)) + assert(value != null, 'Invalid Value value (' + value + ')'); + + if (0 <= value && value <= 2) return 1 + + // enumerable max value in case of unknown value + return 5 +} + +/** + * Convert an enum value to it's human readable name. + * Returns undefined on an unknown value. + */ +function stringify(int) { + return enumValues.get(int) +} + +/** + * Convert an enum string names to it's machine integer value. + * Returns undefined on an unknown name. + */ +function parse(str) { + return enumNames.get(str) +} + +exports.VALUE_NO = VALUE_NO; +exports.VALUE_UNSPECIFIED = VALUE_UNSPECIFIED; +exports.VALUE_YES = VALUE_YES; +exports.decode = decode; +exports.encode = encode; +exports.encodingLength = encodingLength; +exports.parse = parse; +exports.stringify = stringify; diff --git a/cjs/vega/Vote/decode.cjs b/cjs/vega/Vote/decode.cjs new file mode 100644 index 0000000..9f753c0 --- /dev/null +++ b/cjs/vega/Vote/decode.cjs @@ -0,0 +1,59 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var Value = require('./Value.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$partyId = ''; + let field$value = 0; + let field$proposalId = ''; + let field$timestamp = 0n; + let field$totalGovernanceTokenBalance = ''; + let field$totalGovernanceTokenWeight = ''; + let field$totalEquityLikeShareWeight = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$partyId = types.string(data); + break + + case 2: + field$value = Value.decode(data); + break + + case 3: + field$proposalId = types.string(data); + break + + case 4: + field$timestamp = types.int64(data); + break + + case 5: + field$totalGovernanceTokenBalance = types.string(data); + break + + case 6: + field$totalGovernanceTokenWeight = types.string(data); + break + + case 7: + field$totalEquityLikeShareWeight = types.string(data); + break + } + } + return { + partyId: field$partyId, + value: field$value, + proposalId: field$proposalId, + timestamp: field$timestamp, + totalGovernanceTokenBalance: field$totalGovernanceTokenBalance, + totalGovernanceTokenWeight: field$totalGovernanceTokenWeight, + totalEquityLikeShareWeight: field$totalEquityLikeShareWeight + } +} + +exports.decode = decode; diff --git a/cjs/vega/Vote/encode.cjs b/cjs/vega/Vote/encode.cjs new file mode 100644 index 0000000..327e00a --- /dev/null +++ b/cjs/vega/Vote/encode.cjs @@ -0,0 +1,30 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var Value = require('./Value.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.partyId) writer.bytes(1, obj.partyId, types.string); + if (obj.value) writer.varint(2, obj.value, Value); + if (obj.proposalId) writer.bytes(3, obj.proposalId, types.string); + if (obj.timestamp) writer.varint(4, obj.timestamp, types.int64); + if (obj.totalGovernanceTokenBalance) + writer.bytes(5, obj.totalGovernanceTokenBalance, types.string); + if (obj.totalGovernanceTokenWeight) + writer.bytes(6, obj.totalGovernanceTokenWeight, types.string); + if (obj.totalEquityLikeShareWeight) + writer.bytes(7, obj.totalEquityLikeShareWeight, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/WithdrawExt.cjs b/cjs/vega/WithdrawExt.cjs new file mode 100644 index 0000000..5617023 --- /dev/null +++ b/cjs/vega/WithdrawExt.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./WithdrawExt/encode.cjs'); +var decode = require('./WithdrawExt/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/WithdrawExt/decode.cjs b/cjs/vega/WithdrawExt/decode.cjs new file mode 100644 index 0000000..49d2e74 --- /dev/null +++ b/cjs/vega/WithdrawExt/decode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var decode$1 = require('../Erc20WithdrawExt/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$ext = null; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$ext = { erc20: decode$1.decode(data) }; + break + } + } + return { ext: field$ext } +} + +exports.decode = decode; diff --git a/cjs/vega/WithdrawExt/encode.cjs b/cjs/vega/WithdrawExt/encode.cjs new file mode 100644 index 0000000..0029325 --- /dev/null +++ b/cjs/vega/WithdrawExt/encode.cjs @@ -0,0 +1,21 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var encode$1 = require('../Erc20WithdrawExt/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.ext?.erc20 ?? obj.erc20) + writer.bytes(1, encode$1.encode(obj.ext?.erc20 ?? obj.erc20)); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/Withdrawal.cjs b/cjs/vega/Withdrawal.cjs new file mode 100644 index 0000000..667da57 --- /dev/null +++ b/cjs/vega/Withdrawal.cjs @@ -0,0 +1,11 @@ +'use strict'; + +var encode = require('./Withdrawal/encode.cjs'); +var decode = require('./Withdrawal/decode.cjs'); +var Status = require('./Withdrawal/Status.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; +exports.Status = Status; diff --git a/cjs/vega/Withdrawal/Status.cjs b/cjs/vega/Withdrawal/Status.cjs new file mode 100644 index 0000000..7d6461b --- /dev/null +++ b/cjs/vega/Withdrawal/Status.cjs @@ -0,0 +1,74 @@ +'use strict'; + +var assert = require('nanoassert'); +var types = require('protobuf-codec/encode/types'); +var types$1 = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +const STATUS_UNSPECIFIED = 0; +const STATUS_OPEN = 1; +const STATUS_REJECTED = 2; +const STATUS_FINALIZED = 3; + +const enumValues = new Map([ + [0, 'STATUS_UNSPECIFIED'], + [1, 'STATUS_OPEN'], + [2, 'STATUS_REJECTED'], + [3, 'STATUS_FINALIZED'] +]); +const enumNames = new Map([ + ['STATUS_UNSPECIFIED', 0], + ['STATUS_OPEN', 1], + ['STATUS_REJECTED', 2], + ['STATUS_FINALIZED', 3] +]); + +function encode(value, buf, byteOffset = 0) { + if (typeof value === 'string') return encode(parse(value), buf, byteOffset) + if (value == null) throw new Error('Invalid Status value (' + value + ')') + + return types.enumerable.encode(value, buf, byteOffset) +} + +function decode(varint) { + const int = types$1.enumerable(varint); + + return stringify(int) ?? int +} + +function encodingLength(value) { + if (typeof value === 'string') return encodingLength(parse(value)) + assert(value != null, 'Invalid Status value (' + value + ')'); + + if (0 <= value && value <= 3) return 1 + + // enumerable max value in case of unknown value + return 5 +} + +/** + * Convert an enum value to it's human readable name. + * Returns undefined on an unknown value. + */ +function stringify(int) { + return enumValues.get(int) +} + +/** + * Convert an enum string names to it's machine integer value. + * Returns undefined on an unknown name. + */ +function parse(str) { + return enumNames.get(str) +} + +exports.STATUS_FINALIZED = STATUS_FINALIZED; +exports.STATUS_OPEN = STATUS_OPEN; +exports.STATUS_REJECTED = STATUS_REJECTED; +exports.STATUS_UNSPECIFIED = STATUS_UNSPECIFIED; +exports.decode = decode; +exports.encode = encode; +exports.encodingLength = encodingLength; +exports.parse = parse; +exports.stringify = stringify; diff --git a/cjs/vega/Withdrawal/decode.cjs b/cjs/vega/Withdrawal/decode.cjs new file mode 100644 index 0000000..70643c2 --- /dev/null +++ b/cjs/vega/Withdrawal/decode.cjs @@ -0,0 +1,78 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var Status = require('./Status.cjs'); +var decode$1 = require('../WithdrawExt/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$id = ''; + let field$partyId = ''; + let field$amount = ''; + let field$asset = ''; + let field$status = 0; + let field$ref = ''; + let field$txHash = ''; + let field$createdTimestamp = 0n; + let field$withdrawnTimestamp = 0n; + let field$ext = {}; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$id = types.string(data); + break + + case 2: + field$partyId = types.string(data); + break + + case 3: + field$amount = types.string(data); + break + + case 4: + field$asset = types.string(data); + break + + case 5: + field$status = Status.decode(data); + break + + case 6: + field$ref = types.string(data); + break + + case 8: + field$txHash = types.string(data); + break + + case 9: + field$createdTimestamp = types.int64(data); + break + + case 10: + field$withdrawnTimestamp = types.int64(data); + break + + case 11: + field$ext = decode$1.decode(data); + break + } + } + return { + id: field$id, + partyId: field$partyId, + amount: field$amount, + asset: field$asset, + status: field$status, + ref: field$ref, + txHash: field$txHash, + createdTimestamp: field$createdTimestamp, + withdrawnTimestamp: field$withdrawnTimestamp, + ext: field$ext + } +} + +exports.decode = decode; diff --git a/cjs/vega/Withdrawal/encode.cjs b/cjs/vega/Withdrawal/encode.cjs new file mode 100644 index 0000000..68bc2be --- /dev/null +++ b/cjs/vega/Withdrawal/encode.cjs @@ -0,0 +1,31 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var Status = require('./Status.cjs'); +var encode$1 = require('../WithdrawExt/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.id) writer.bytes(1, obj.id, types.string); + if (obj.partyId) writer.bytes(2, obj.partyId, types.string); + if (obj.amount) writer.bytes(3, obj.amount, types.string); + if (obj.asset) writer.bytes(4, obj.asset, types.string); + if (obj.status) writer.varint(5, obj.status, Status); + if (obj.ref) writer.bytes(6, obj.ref, types.string); + if (obj.txHash) writer.bytes(8, obj.txHash, types.string); + if (obj.createdTimestamp) writer.varint(9, obj.createdTimestamp, types.int64); + if (obj.withdrawnTimestamp) writer.varint(10, obj.withdrawnTimestamp, types.int64); + if (obj.ext) writer.bytes(11, encode$1.encode(obj.ext)); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/commands.cjs b/cjs/vega/commands.cjs new file mode 100644 index 0000000..5a46b81 --- /dev/null +++ b/cjs/vega/commands.cjs @@ -0,0 +1,7 @@ +'use strict'; + +var v1 = require('./commands/v1.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.v1 = v1; diff --git a/cjs/vega/commands/v1.cjs b/cjs/vega/commands/v1.cjs new file mode 100644 index 0000000..add8f42 --- /dev/null +++ b/cjs/vega/commands/v1.cjs @@ -0,0 +1,79 @@ +'use strict'; + +var NodeSignatureKind = require('./v1/NodeSignatureKind.cjs'); +var TxVersion = require('./v1/TxVersion.cjs'); +var Signature = require('./v1/Signature.cjs'); +var ValidatorHeartbeat = require('./v1/ValidatorHeartbeat.cjs'); +var AnnounceNode = require('./v1/AnnounceNode.cjs'); +var NodeVote = require('./v1/NodeVote.cjs'); +var NodeSignature = require('./v1/NodeSignature.cjs'); +var ChainEvent = require('./v1/ChainEvent.cjs'); +var KeyRotateSubmission = require('./v1/KeyRotateSubmission.cjs'); +var EthereumKeyRotateSubmission = require('./v1/EthereumKeyRotateSubmission.cjs'); +var StateVariableProposal = require('./v1/StateVariableProposal.cjs'); +var ProtocolUpgradeProposal = require('./v1/ProtocolUpgradeProposal.cjs'); +var BatchMarketInstructions = require('./v1/BatchMarketInstructions.cjs'); +var StopOrdersSubmission = require('./v1/StopOrdersSubmission.cjs'); +var StopOrderSetup = require('./v1/StopOrderSetup.cjs'); +var StopOrdersCancellation = require('./v1/StopOrdersCancellation.cjs'); +var OrderSubmission = require('./v1/OrderSubmission.cjs'); +var IcebergOpts = require('./v1/IcebergOpts.cjs'); +var OrderCancellation = require('./v1/OrderCancellation.cjs'); +var OrderAmendment = require('./v1/OrderAmendment.cjs'); +var LiquidityProvisionSubmission = require('./v1/LiquidityProvisionSubmission.cjs'); +var LiquidityProvisionCancellation = require('./v1/LiquidityProvisionCancellation.cjs'); +var LiquidityProvisionAmendment = require('./v1/LiquidityProvisionAmendment.cjs'); +var WithdrawSubmission = require('./v1/WithdrawSubmission.cjs'); +var ProposalSubmission = require('./v1/ProposalSubmission.cjs'); +var VoteSubmission = require('./v1/VoteSubmission.cjs'); +var DelegateSubmission = require('./v1/DelegateSubmission.cjs'); +var UndelegateSubmission = require('./v1/UndelegateSubmission.cjs'); +var Transfer = require('./v1/Transfer.cjs'); +var OneOffTransfer = require('./v1/OneOffTransfer.cjs'); +var RecurringTransfer = require('./v1/RecurringTransfer.cjs'); +var CancelTransfer = require('./v1/CancelTransfer.cjs'); +var IssueSignatures = require('./v1/IssueSignatures.cjs'); +var OracleDataSubmission = require('./v1/OracleDataSubmission.cjs'); +var InputData = require('./v1/InputData.cjs'); +var Transaction = require('./v1/Transaction.cjs'); +var ProofOfWork = require('./v1/ProofOfWork.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.NodeSignatureKind = NodeSignatureKind; +exports.TxVersion = TxVersion; +exports.Signature = Signature; +exports.ValidatorHeartbeat = ValidatorHeartbeat; +exports.AnnounceNode = AnnounceNode; +exports.NodeVote = NodeVote; +exports.NodeSignature = NodeSignature; +exports.ChainEvent = ChainEvent; +exports.KeyRotateSubmission = KeyRotateSubmission; +exports.EthereumKeyRotateSubmission = EthereumKeyRotateSubmission; +exports.StateVariableProposal = StateVariableProposal; +exports.ProtocolUpgradeProposal = ProtocolUpgradeProposal; +exports.BatchMarketInstructions = BatchMarketInstructions; +exports.StopOrdersSubmission = StopOrdersSubmission; +exports.StopOrderSetup = StopOrderSetup; +exports.StopOrdersCancellation = StopOrdersCancellation; +exports.OrderSubmission = OrderSubmission; +exports.IcebergOpts = IcebergOpts; +exports.OrderCancellation = OrderCancellation; +exports.OrderAmendment = OrderAmendment; +exports.LiquidityProvisionSubmission = LiquidityProvisionSubmission; +exports.LiquidityProvisionCancellation = LiquidityProvisionCancellation; +exports.LiquidityProvisionAmendment = LiquidityProvisionAmendment; +exports.WithdrawSubmission = WithdrawSubmission; +exports.ProposalSubmission = ProposalSubmission; +exports.VoteSubmission = VoteSubmission; +exports.DelegateSubmission = DelegateSubmission; +exports.UndelegateSubmission = UndelegateSubmission; +exports.Transfer = Transfer; +exports.OneOffTransfer = OneOffTransfer; +exports.RecurringTransfer = RecurringTransfer; +exports.CancelTransfer = CancelTransfer; +exports.IssueSignatures = IssueSignatures; +exports.OracleDataSubmission = OracleDataSubmission; +exports.InputData = InputData; +exports.Transaction = Transaction; +exports.ProofOfWork = ProofOfWork; diff --git a/cjs/vega/commands/v1/AnnounceNode.cjs b/cjs/vega/commands/v1/AnnounceNode.cjs new file mode 100644 index 0000000..b253f79 --- /dev/null +++ b/cjs/vega/commands/v1/AnnounceNode.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./AnnounceNode/encode.cjs'); +var decode = require('./AnnounceNode/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/commands/v1/AnnounceNode/decode.cjs b/cjs/vega/commands/v1/AnnounceNode/decode.cjs new file mode 100644 index 0000000..7784907 --- /dev/null +++ b/cjs/vega/commands/v1/AnnounceNode/decode.cjs @@ -0,0 +1,95 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$1 = require('../Signature/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$vegaPubKey = ''; + let field$ethereumAddress = ''; + let field$chainPubKey = ''; + let field$infoUrl = ''; + let field$country = ''; + let field$id = ''; + let field$name = ''; + let field$avatarUrl = ''; + let field$vegaPubKeyIndex = 0; + let field$fromEpoch = 0n; + let field$ethereumSignature = {}; + let field$vegaSignature = {}; + let field$submitterAddress = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$vegaPubKey = types.string(data); + break + + case 2: + field$ethereumAddress = types.string(data); + break + + case 3: + field$chainPubKey = types.string(data); + break + + case 4: + field$infoUrl = types.string(data); + break + + case 5: + field$country = types.string(data); + break + + case 6: + field$id = types.string(data); + break + + case 7: + field$name = types.string(data); + break + + case 8: + field$avatarUrl = types.string(data); + break + + case 9: + field$vegaPubKeyIndex = types.uint32(data); + break + + case 10: + field$fromEpoch = types.uint64(data); + break + + case 11: + field$ethereumSignature = decode$1.decode(data); + break + + case 12: + field$vegaSignature = decode$1.decode(data); + break + + case 13: + field$submitterAddress = types.string(data); + break + } + } + return { + vegaPubKey: field$vegaPubKey, + ethereumAddress: field$ethereumAddress, + chainPubKey: field$chainPubKey, + infoUrl: field$infoUrl, + country: field$country, + id: field$id, + name: field$name, + avatarUrl: field$avatarUrl, + vegaPubKeyIndex: field$vegaPubKeyIndex, + fromEpoch: field$fromEpoch, + ethereumSignature: field$ethereumSignature, + vegaSignature: field$vegaSignature, + submitterAddress: field$submitterAddress + } +} + +exports.decode = decode; diff --git a/cjs/vega/commands/v1/AnnounceNode/encode.cjs b/cjs/vega/commands/v1/AnnounceNode/encode.cjs new file mode 100644 index 0000000..3825af8 --- /dev/null +++ b/cjs/vega/commands/v1/AnnounceNode/encode.cjs @@ -0,0 +1,35 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../Signature/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.vegaPubKey) writer.bytes(1, obj.vegaPubKey, types.string); + if (obj.ethereumAddress) writer.bytes(2, obj.ethereumAddress, types.string); + if (obj.chainPubKey) writer.bytes(3, obj.chainPubKey, types.string); + if (obj.infoUrl) writer.bytes(4, obj.infoUrl, types.string); + if (obj.country) writer.bytes(5, obj.country, types.string); + if (obj.id) writer.bytes(6, obj.id, types.string); + if (obj.name) writer.bytes(7, obj.name, types.string); + if (obj.avatarUrl) writer.bytes(8, obj.avatarUrl, types.string); + if (obj.vegaPubKeyIndex) writer.varint(9, obj.vegaPubKeyIndex, types.uint32); + if (obj.fromEpoch) writer.varint(10, obj.fromEpoch, types.uint64); + if (obj.ethereumSignature) + writer.bytes(11, encode$1.encode(obj.ethereumSignature)); + if (obj.vegaSignature) + writer.bytes(12, encode$1.encode(obj.vegaSignature)); + if (obj.submitterAddress) writer.bytes(13, obj.submitterAddress, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/commands/v1/BatchMarketInstructions.cjs b/cjs/vega/commands/v1/BatchMarketInstructions.cjs new file mode 100644 index 0000000..8cfb884 --- /dev/null +++ b/cjs/vega/commands/v1/BatchMarketInstructions.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./BatchMarketInstructions/encode.cjs'); +var decode = require('./BatchMarketInstructions/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/commands/v1/BatchMarketInstructions/decode.cjs b/cjs/vega/commands/v1/BatchMarketInstructions/decode.cjs new file mode 100644 index 0000000..3a8adc8 --- /dev/null +++ b/cjs/vega/commands/v1/BatchMarketInstructions/decode.cjs @@ -0,0 +1,56 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var decode$5 = require('../OrderCancellation/decode.cjs'); +var decode$4 = require('../OrderAmendment/decode.cjs'); +var decode$3 = require('../OrderSubmission/decode.cjs'); +var decode$2 = require('../StopOrdersCancellation/decode.cjs'); +var decode$1 = require('../StopOrdersSubmission/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + const field$cancellations = []; + const field$amendments = []; + const field$submissions = []; + const field$stopOrdersCancellation = []; + const field$stopOrdersSubmission = []; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$cancellations.push( + decode$5.decode(data) + ); + break + + case 2: + field$amendments.push(decode$4.decode(data)); + break + + case 3: + field$submissions.push(decode$3.decode(data)); + break + + case 4: + field$stopOrdersCancellation.push( + decode$2.decode(data) + ); + break + + case 5: + field$stopOrdersSubmission.push( + decode$1.decode(data) + ); + break + } + } + return { + cancellations: field$cancellations, + amendments: field$amendments, + submissions: field$submissions, + stopOrdersCancellation: field$stopOrdersCancellation, + stopOrdersSubmission: field$stopOrdersSubmission + } +} + +exports.decode = decode; diff --git a/cjs/vega/commands/v1/BatchMarketInstructions/encode.cjs b/cjs/vega/commands/v1/BatchMarketInstructions/encode.cjs new file mode 100644 index 0000000..d968df0 --- /dev/null +++ b/cjs/vega/commands/v1/BatchMarketInstructions/encode.cjs @@ -0,0 +1,43 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var encode$1 = require('../OrderCancellation/encode.cjs'); +var encode$2 = require('../OrderAmendment/encode.cjs'); +var encode$3 = require('../OrderSubmission/encode.cjs'); +var encode$4 = require('../StopOrdersCancellation/encode.cjs'); +var encode$5 = require('../StopOrdersSubmission/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.cancellations?.length) + obj.cancellations.forEach((v) => + writer.bytes(1, encode$1.encode(v)) + ); + if (obj.amendments?.length) + obj.amendments.forEach((v) => + writer.bytes(2, encode$2.encode(v)) + ); + if (obj.submissions?.length) + obj.submissions.forEach((v) => + writer.bytes(3, encode$3.encode(v)) + ); + if (obj.stopOrdersCancellation?.length) + obj.stopOrdersCancellation.forEach((v) => + writer.bytes(4, encode$4.encode(v)) + ); + if (obj.stopOrdersSubmission?.length) + obj.stopOrdersSubmission.forEach((v) => + writer.bytes(5, encode$5.encode(v)) + ); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/commands/v1/CancelTransfer.cjs b/cjs/vega/commands/v1/CancelTransfer.cjs new file mode 100644 index 0000000..38f9716 --- /dev/null +++ b/cjs/vega/commands/v1/CancelTransfer.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./CancelTransfer/encode.cjs'); +var decode = require('./CancelTransfer/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/commands/v1/CancelTransfer/decode.cjs b/cjs/vega/commands/v1/CancelTransfer/decode.cjs new file mode 100644 index 0000000..17cb53a --- /dev/null +++ b/cjs/vega/commands/v1/CancelTransfer/decode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$transferId = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$transferId = types.string(data); + break + } + } + return { transferId: field$transferId } +} + +exports.decode = decode; diff --git a/cjs/vega/commands/v1/CancelTransfer/encode.cjs b/cjs/vega/commands/v1/CancelTransfer/encode.cjs new file mode 100644 index 0000000..f35b600 --- /dev/null +++ b/cjs/vega/commands/v1/CancelTransfer/encode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.transferId) writer.bytes(1, obj.transferId, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/commands/v1/ChainEvent.cjs b/cjs/vega/commands/v1/ChainEvent.cjs new file mode 100644 index 0000000..fc4f7a9 --- /dev/null +++ b/cjs/vega/commands/v1/ChainEvent.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./ChainEvent/encode.cjs'); +var decode = require('./ChainEvent/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/commands/v1/ChainEvent/decode.cjs b/cjs/vega/commands/v1/ChainEvent/decode.cjs new file mode 100644 index 0000000..732a818 --- /dev/null +++ b/cjs/vega/commands/v1/ChainEvent/decode.cjs @@ -0,0 +1,51 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$5 = require('../../../BuiltinAssetEvent/decode.cjs'); +var decode$4 = require('../../../ERC20Event/decode.cjs'); +var decode$3 = require('../../../StakingEvent/decode.cjs'); +var decode$2 = require('../../../ERC20MultiSigEvent/decode.cjs'); +var decode$1 = require('../../../EthContractCallEvent/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$txId = ''; + let field$nonce = 0n; + let field$event = null; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$txId = types.string(data); + break + + case 2: + field$nonce = types.uint64(data); + break + + case 1001: + field$event = { builtin: decode$5.decode(data) }; + break + + case 1002: + field$event = { erc20: decode$4.decode(data) }; + break + + case 1005: + field$event = { stakingEvent: decode$3.decode(data) }; + break + + case 1006: + field$event = { erc20Multisig: decode$2.decode(data) }; + break + + case 1007: + field$event = { contractCall: decode$1.decode(data) }; + break + } + } + return { txId: field$txId, nonce: field$nonce, event: field$event } +} + +exports.decode = decode; diff --git a/cjs/vega/commands/v1/ChainEvent/encode.cjs b/cjs/vega/commands/v1/ChainEvent/encode.cjs new file mode 100644 index 0000000..bc27f99 --- /dev/null +++ b/cjs/vega/commands/v1/ChainEvent/encode.cjs @@ -0,0 +1,53 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../../../BuiltinAssetEvent/encode.cjs'); +var encode$2 = require('../../../ERC20Event/encode.cjs'); +var encode$3 = require('../../../StakingEvent/encode.cjs'); +var encode$4 = require('../../../ERC20MultiSigEvent/encode.cjs'); +var encode$5 = require('../../../EthContractCallEvent/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.txId) writer.bytes(1, obj.txId, types.string); + if (obj.nonce) writer.varint(2, obj.nonce, types.uint64); + + if (obj.event?.builtin ?? obj.builtin) + writer.bytes( + 1001, + encode$1.encode(obj.event?.builtin ?? obj.builtin) + ); + if (obj.event?.erc20 ?? obj.erc20) + writer.bytes(1002, encode$2.encode(obj.event?.erc20 ?? obj.erc20)); + if (obj.event?.stakingEvent ?? obj.stakingEvent) + writer.bytes( + 1005, + encode$3.encode(obj.event?.stakingEvent ?? obj.stakingEvent) + ); + if (obj.event?.erc20Multisig ?? obj.erc20Multisig) + writer.bytes( + 1006, + encode$4.encode( + obj.event?.erc20Multisig ?? obj.erc20Multisig + ) + ); + if (obj.event?.contractCall ?? obj.contractCall) + writer.bytes( + 1007, + encode$5.encode( + obj.event?.contractCall ?? obj.contractCall + ) + ); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/commands/v1/DelegateSubmission.cjs b/cjs/vega/commands/v1/DelegateSubmission.cjs new file mode 100644 index 0000000..2bf9439 --- /dev/null +++ b/cjs/vega/commands/v1/DelegateSubmission.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./DelegateSubmission/encode.cjs'); +var decode = require('./DelegateSubmission/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/commands/v1/DelegateSubmission/decode.cjs b/cjs/vega/commands/v1/DelegateSubmission/decode.cjs new file mode 100644 index 0000000..1932521 --- /dev/null +++ b/cjs/vega/commands/v1/DelegateSubmission/decode.cjs @@ -0,0 +1,25 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$nodeId = ''; + let field$amount = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$nodeId = types.string(data); + break + + case 2: + field$amount = types.string(data); + break + } + } + return { nodeId: field$nodeId, amount: field$amount } +} + +exports.decode = decode; diff --git a/cjs/vega/commands/v1/DelegateSubmission/encode.cjs b/cjs/vega/commands/v1/DelegateSubmission/encode.cjs new file mode 100644 index 0000000..fc1005f --- /dev/null +++ b/cjs/vega/commands/v1/DelegateSubmission/encode.cjs @@ -0,0 +1,21 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.nodeId) writer.bytes(1, obj.nodeId, types.string); + if (obj.amount) writer.bytes(2, obj.amount, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/commands/v1/EthereumKeyRotateSubmission.cjs b/cjs/vega/commands/v1/EthereumKeyRotateSubmission.cjs new file mode 100644 index 0000000..2251afb --- /dev/null +++ b/cjs/vega/commands/v1/EthereumKeyRotateSubmission.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./EthereumKeyRotateSubmission/encode.cjs'); +var decode = require('./EthereumKeyRotateSubmission/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/commands/v1/EthereumKeyRotateSubmission/decode.cjs b/cjs/vega/commands/v1/EthereumKeyRotateSubmission/decode.cjs new file mode 100644 index 0000000..84701f0 --- /dev/null +++ b/cjs/vega/commands/v1/EthereumKeyRotateSubmission/decode.cjs @@ -0,0 +1,47 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$1 = require('../Signature/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$targetBlock = 0n; + let field$newAddress = ''; + let field$currentAddress = ''; + let field$submitterAddress = ''; + let field$ethereumSignature = {}; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$targetBlock = types.uint64(data); + break + + case 2: + field$newAddress = types.string(data); + break + + case 3: + field$currentAddress = types.string(data); + break + + case 4: + field$submitterAddress = types.string(data); + break + + case 5: + field$ethereumSignature = decode$1.decode(data); + break + } + } + return { + targetBlock: field$targetBlock, + newAddress: field$newAddress, + currentAddress: field$currentAddress, + submitterAddress: field$submitterAddress, + ethereumSignature: field$ethereumSignature + } +} + +exports.decode = decode; diff --git a/cjs/vega/commands/v1/EthereumKeyRotateSubmission/encode.cjs b/cjs/vega/commands/v1/EthereumKeyRotateSubmission/encode.cjs new file mode 100644 index 0000000..0cfff95 --- /dev/null +++ b/cjs/vega/commands/v1/EthereumKeyRotateSubmission/encode.cjs @@ -0,0 +1,26 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../Signature/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.targetBlock) writer.varint(1, obj.targetBlock, types.uint64); + if (obj.newAddress) writer.bytes(2, obj.newAddress, types.string); + if (obj.currentAddress) writer.bytes(3, obj.currentAddress, types.string); + if (obj.submitterAddress) writer.bytes(4, obj.submitterAddress, types.string); + if (obj.ethereumSignature) + writer.bytes(5, encode$1.encode(obj.ethereumSignature)); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/commands/v1/IcebergOpts.cjs b/cjs/vega/commands/v1/IcebergOpts.cjs new file mode 100644 index 0000000..182e2cf --- /dev/null +++ b/cjs/vega/commands/v1/IcebergOpts.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./IcebergOpts/encode.cjs'); +var decode = require('./IcebergOpts/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/commands/v1/IcebergOpts/decode.cjs b/cjs/vega/commands/v1/IcebergOpts/decode.cjs new file mode 100644 index 0000000..8cf64ad --- /dev/null +++ b/cjs/vega/commands/v1/IcebergOpts/decode.cjs @@ -0,0 +1,28 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$peakSize = 0n; + let field$minimumVisibleSize = 0n; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$peakSize = types.uint64(data); + break + + case 2: + field$minimumVisibleSize = types.uint64(data); + break + } + } + return { + peakSize: field$peakSize, + minimumVisibleSize: field$minimumVisibleSize + } +} + +exports.decode = decode; diff --git a/cjs/vega/commands/v1/IcebergOpts/encode.cjs b/cjs/vega/commands/v1/IcebergOpts/encode.cjs new file mode 100644 index 0000000..d78f2f0 --- /dev/null +++ b/cjs/vega/commands/v1/IcebergOpts/encode.cjs @@ -0,0 +1,21 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.peakSize) writer.varint(1, obj.peakSize, types.uint64); + if (obj.minimumVisibleSize) writer.varint(2, obj.minimumVisibleSize, types.uint64); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/commands/v1/InputData.cjs b/cjs/vega/commands/v1/InputData.cjs new file mode 100644 index 0000000..ef5f002 --- /dev/null +++ b/cjs/vega/commands/v1/InputData.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./InputData/encode.cjs'); +var decode = require('./InputData/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/commands/v1/InputData/decode.cjs b/cjs/vega/commands/v1/InputData/decode.cjs new file mode 100644 index 0000000..8beb20b --- /dev/null +++ b/cjs/vega/commands/v1/InputData/decode.cjs @@ -0,0 +1,227 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$r = require('../OrderSubmission/decode.cjs'); +var decode$q = require('../OrderCancellation/decode.cjs'); +var decode$p = require('../OrderAmendment/decode.cjs'); +var decode$o = require('../WithdrawSubmission/decode.cjs'); +var decode$n = require('../ProposalSubmission/decode.cjs'); +var decode$m = require('../VoteSubmission/decode.cjs'); +var decode$l = require('../LiquidityProvisionSubmission/decode.cjs'); +var decode$k = require('../DelegateSubmission/decode.cjs'); +var decode$j = require('../UndelegateSubmission/decode.cjs'); +var decode$i = require('../LiquidityProvisionCancellation/decode.cjs'); +var decode$h = require('../LiquidityProvisionAmendment/decode.cjs'); +var decode$g = require('../Transfer/decode.cjs'); +var decode$f = require('../CancelTransfer/decode.cjs'); +var decode$e = require('../AnnounceNode/decode.cjs'); +var decode$d = require('../BatchMarketInstructions/decode.cjs'); +var decode$c = require('../StopOrdersSubmission/decode.cjs'); +var decode$b = require('../StopOrdersCancellation/decode.cjs'); +var decode$a = require('../NodeVote/decode.cjs'); +var decode$9 = require('../NodeSignature/decode.cjs'); +var decode$8 = require('../ChainEvent/decode.cjs'); +var decode$7 = require('../KeyRotateSubmission/decode.cjs'); +var decode$6 = require('../StateVariableProposal/decode.cjs'); +var decode$5 = require('../ValidatorHeartbeat/decode.cjs'); +var decode$4 = require('../EthereumKeyRotateSubmission/decode.cjs'); +var decode$3 = require('../ProtocolUpgradeProposal/decode.cjs'); +var decode$2 = require('../IssueSignatures/decode.cjs'); +var decode$1 = require('../OracleDataSubmission/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$nonce = 0n; + let field$blockHeight = 0n; + let field$command = null; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$nonce = types.uint64(data); + break + + case 2: + field$blockHeight = types.uint64(data); + break + + case 1001: + field$command = { + orderSubmission: decode$r.decode(data) + }; + break + + case 1002: + field$command = { + orderCancellation: decode$q.decode(data) + }; + break + + case 1003: + field$command = { + orderAmendment: decode$p.decode(data) + }; + break + + case 1004: + field$command = { + withdrawSubmission: decode$o.decode(data) + }; + break + + case 1005: + field$command = { + proposalSubmission: decode$n.decode(data) + }; + break + + case 1006: + field$command = { + voteSubmission: decode$m.decode(data) + }; + break + + case 1007: + field$command = { + liquidityProvisionSubmission: + decode$l.decode(data) + }; + break + + case 1008: + field$command = { + delegateSubmission: decode$k.decode(data) + }; + break + + case 1009: + field$command = { + undelegateSubmission: + decode$j.decode(data) + }; + break + + case 1010: + field$command = { + liquidityProvisionCancellation: + decode$i.decode(data) + }; + break + + case 1011: + field$command = { + liquidityProvisionAmendment: + decode$h.decode(data) + }; + break + + case 1012: + field$command = { transfer: decode$g.decode(data) }; + break + + case 1013: + field$command = { + cancelTransfer: decode$f.decode(data) + }; + break + + case 1014: + field$command = { + announceNode: decode$e.decode(data) + }; + break + + case 1015: + field$command = { + batchMarketInstructions: + decode$d.decode(data) + }; + break + + case 1016: + field$command = { + stopOrdersSubmission: + decode$c.decode(data) + }; + break + + case 1017: + field$command = { + stopOrdersCancellation: + decode$b.decode(data) + }; + break + + case 2002: + field$command = { nodeVote: decode$a.decode(data) }; + break + + case 2003: + field$command = { + nodeSignature: decode$9.decode(data) + }; + break + + case 2004: + field$command = { + chainEvent: decode$8.decode(data) + }; + break + + case 2005: + field$command = { + keyRotateSubmission: + decode$7.decode(data) + }; + break + + case 2006: + field$command = { + stateVariableProposal: + decode$6.decode(data) + }; + break + + case 2007: + field$command = { + validatorHeartbeat: decode$5.decode(data) + }; + break + + case 2008: + field$command = { + ethereumKeyRotateSubmission: + decode$4.decode(data) + }; + break + + case 2009: + field$command = { + protocolUpgradeProposal: + decode$3.decode(data) + }; + break + + case 2010: + field$command = { + issueSignatures: decode$2.decode(data) + }; + break + + case 3001: + field$command = { + oracleDataSubmission: + decode$1.decode(data) + }; + break + } + } + return { + nonce: field$nonce, + blockHeight: field$blockHeight, + command: field$command + } +} + +exports.decode = decode; diff --git a/cjs/vega/commands/v1/InputData/encode.cjs b/cjs/vega/commands/v1/InputData/encode.cjs new file mode 100644 index 0000000..d97bcb9 --- /dev/null +++ b/cjs/vega/commands/v1/InputData/encode.cjs @@ -0,0 +1,250 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../OrderSubmission/encode.cjs'); +var encode$2 = require('../OrderCancellation/encode.cjs'); +var encode$3 = require('../OrderAmendment/encode.cjs'); +var encode$4 = require('../WithdrawSubmission/encode.cjs'); +var encode$5 = require('../ProposalSubmission/encode.cjs'); +var encode$6 = require('../VoteSubmission/encode.cjs'); +var encode$7 = require('../LiquidityProvisionSubmission/encode.cjs'); +var encode$8 = require('../DelegateSubmission/encode.cjs'); +var encode$9 = require('../UndelegateSubmission/encode.cjs'); +var encode$a = require('../LiquidityProvisionCancellation/encode.cjs'); +var encode$b = require('../LiquidityProvisionAmendment/encode.cjs'); +var encode$c = require('../Transfer/encode.cjs'); +var encode$d = require('../CancelTransfer/encode.cjs'); +var encode$e = require('../AnnounceNode/encode.cjs'); +var encode$f = require('../BatchMarketInstructions/encode.cjs'); +var encode$g = require('../StopOrdersSubmission/encode.cjs'); +var encode$h = require('../StopOrdersCancellation/encode.cjs'); +var encode$i = require('../NodeVote/encode.cjs'); +var encode$j = require('../NodeSignature/encode.cjs'); +var encode$k = require('../ChainEvent/encode.cjs'); +var encode$l = require('../KeyRotateSubmission/encode.cjs'); +var encode$m = require('../StateVariableProposal/encode.cjs'); +var encode$n = require('../ValidatorHeartbeat/encode.cjs'); +var encode$o = require('../EthereumKeyRotateSubmission/encode.cjs'); +var encode$p = require('../ProtocolUpgradeProposal/encode.cjs'); +var encode$q = require('../IssueSignatures/encode.cjs'); +var encode$r = require('../OracleDataSubmission/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.nonce) writer.varint(1, obj.nonce, types.uint64); + if (obj.blockHeight) writer.varint(2, obj.blockHeight, types.uint64); + + if (obj.command?.orderSubmission ?? obj.orderSubmission) + writer.bytes( + 1001, + encode$1.encode( + obj.command?.orderSubmission ?? obj.orderSubmission + ) + ); + if (obj.command?.orderCancellation ?? obj.orderCancellation) + writer.bytes( + 1002, + encode$2.encode( + obj.command?.orderCancellation ?? obj.orderCancellation + ) + ); + if (obj.command?.orderAmendment ?? obj.orderAmendment) + writer.bytes( + 1003, + encode$3.encode( + obj.command?.orderAmendment ?? obj.orderAmendment + ) + ); + if (obj.command?.withdrawSubmission ?? obj.withdrawSubmission) + writer.bytes( + 1004, + encode$4.encode( + obj.command?.withdrawSubmission ?? obj.withdrawSubmission + ) + ); + if (obj.command?.proposalSubmission ?? obj.proposalSubmission) + writer.bytes( + 1005, + encode$5.encode( + obj.command?.proposalSubmission ?? obj.proposalSubmission + ) + ); + if (obj.command?.voteSubmission ?? obj.voteSubmission) + writer.bytes( + 1006, + encode$6.encode( + obj.command?.voteSubmission ?? obj.voteSubmission + ) + ); + if ( + obj.command?.liquidityProvisionSubmission ?? + obj.liquidityProvisionSubmission + ) + writer.bytes( + 1007, + encode$7.encode( + obj.command?.liquidityProvisionSubmission ?? + obj.liquidityProvisionSubmission + ) + ); + if (obj.command?.delegateSubmission ?? obj.delegateSubmission) + writer.bytes( + 1008, + encode$8.encode( + obj.command?.delegateSubmission ?? obj.delegateSubmission + ) + ); + if (obj.command?.undelegateSubmission ?? obj.undelegateSubmission) + writer.bytes( + 1009, + encode$9.encode( + obj.command?.undelegateSubmission ?? obj.undelegateSubmission + ) + ); + if ( + obj.command?.liquidityProvisionCancellation ?? + obj.liquidityProvisionCancellation + ) + writer.bytes( + 1010, + encode$a.encode( + obj.command?.liquidityProvisionCancellation ?? + obj.liquidityProvisionCancellation + ) + ); + if ( + obj.command?.liquidityProvisionAmendment ?? + obj.liquidityProvisionAmendment + ) + writer.bytes( + 1011, + encode$b.encode( + obj.command?.liquidityProvisionAmendment ?? + obj.liquidityProvisionAmendment + ) + ); + if (obj.command?.transfer ?? obj.transfer) + writer.bytes( + 1012, + encode$c.encode(obj.command?.transfer ?? obj.transfer) + ); + if (obj.command?.cancelTransfer ?? obj.cancelTransfer) + writer.bytes( + 1013, + encode$d.encode( + obj.command?.cancelTransfer ?? obj.cancelTransfer + ) + ); + if (obj.command?.announceNode ?? obj.announceNode) + writer.bytes( + 1014, + encode$e.encode( + obj.command?.announceNode ?? obj.announceNode + ) + ); + if (obj.command?.batchMarketInstructions ?? obj.batchMarketInstructions) + writer.bytes( + 1015, + encode$f.encode( + obj.command?.batchMarketInstructions ?? obj.batchMarketInstructions + ) + ); + if (obj.command?.stopOrdersSubmission ?? obj.stopOrdersSubmission) + writer.bytes( + 1016, + encode$g.encode( + obj.command?.stopOrdersSubmission ?? obj.stopOrdersSubmission + ) + ); + if (obj.command?.stopOrdersCancellation ?? obj.stopOrdersCancellation) + writer.bytes( + 1017, + encode$h.encode( + obj.command?.stopOrdersCancellation ?? obj.stopOrdersCancellation + ) + ); + if (obj.command?.nodeVote ?? obj.nodeVote) + writer.bytes( + 2002, + encode$i.encode(obj.command?.nodeVote ?? obj.nodeVote) + ); + if (obj.command?.nodeSignature ?? obj.nodeSignature) + writer.bytes( + 2003, + encode$j.encode( + obj.command?.nodeSignature ?? obj.nodeSignature + ) + ); + if (obj.command?.chainEvent ?? obj.chainEvent) + writer.bytes( + 2004, + encode$k.encode( + obj.command?.chainEvent ?? obj.chainEvent + ) + ); + if (obj.command?.keyRotateSubmission ?? obj.keyRotateSubmission) + writer.bytes( + 2005, + encode$l.encode( + obj.command?.keyRotateSubmission ?? obj.keyRotateSubmission + ) + ); + if (obj.command?.stateVariableProposal ?? obj.stateVariableProposal) + writer.bytes( + 2006, + encode$m.encode( + obj.command?.stateVariableProposal ?? obj.stateVariableProposal + ) + ); + if (obj.command?.validatorHeartbeat ?? obj.validatorHeartbeat) + writer.bytes( + 2007, + encode$n.encode( + obj.command?.validatorHeartbeat ?? obj.validatorHeartbeat + ) + ); + if ( + obj.command?.ethereumKeyRotateSubmission ?? + obj.ethereumKeyRotateSubmission + ) + writer.bytes( + 2008, + encode$o.encode( + obj.command?.ethereumKeyRotateSubmission ?? + obj.ethereumKeyRotateSubmission + ) + ); + if (obj.command?.protocolUpgradeProposal ?? obj.protocolUpgradeProposal) + writer.bytes( + 2009, + encode$p.encode( + obj.command?.protocolUpgradeProposal ?? obj.protocolUpgradeProposal + ) + ); + if (obj.command?.issueSignatures ?? obj.issueSignatures) + writer.bytes( + 2010, + encode$q.encode( + obj.command?.issueSignatures ?? obj.issueSignatures + ) + ); + if (obj.command?.oracleDataSubmission ?? obj.oracleDataSubmission) + writer.bytes( + 3001, + encode$r.encode( + obj.command?.oracleDataSubmission ?? obj.oracleDataSubmission + ) + ); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/commands/v1/IssueSignatures.cjs b/cjs/vega/commands/v1/IssueSignatures.cjs new file mode 100644 index 0000000..6cface7 --- /dev/null +++ b/cjs/vega/commands/v1/IssueSignatures.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./IssueSignatures/encode.cjs'); +var decode = require('./IssueSignatures/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/commands/v1/IssueSignatures/decode.cjs b/cjs/vega/commands/v1/IssueSignatures/decode.cjs new file mode 100644 index 0000000..4cf5c5f --- /dev/null +++ b/cjs/vega/commands/v1/IssueSignatures/decode.cjs @@ -0,0 +1,35 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var NodeSignatureKind = require('../NodeSignatureKind.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$submitter = ''; + let field$kind = 0; + let field$validatorNodeId = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$submitter = types.string(data); + break + + case 2: + field$kind = NodeSignatureKind.decode(data); + break + + case 3: + field$validatorNodeId = types.string(data); + break + } + } + return { + submitter: field$submitter, + kind: field$kind, + validatorNodeId: field$validatorNodeId + } +} + +exports.decode = decode; diff --git a/cjs/vega/commands/v1/IssueSignatures/encode.cjs b/cjs/vega/commands/v1/IssueSignatures/encode.cjs new file mode 100644 index 0000000..6e3c900 --- /dev/null +++ b/cjs/vega/commands/v1/IssueSignatures/encode.cjs @@ -0,0 +1,23 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var NodeSignatureKind = require('../NodeSignatureKind.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.submitter) writer.bytes(1, obj.submitter, types.string); + if (obj.kind) writer.varint(2, obj.kind, NodeSignatureKind); + if (obj.validatorNodeId) writer.bytes(3, obj.validatorNodeId, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/commands/v1/KeyRotateSubmission.cjs b/cjs/vega/commands/v1/KeyRotateSubmission.cjs new file mode 100644 index 0000000..dc2d7d6 --- /dev/null +++ b/cjs/vega/commands/v1/KeyRotateSubmission.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./KeyRotateSubmission/encode.cjs'); +var decode = require('./KeyRotateSubmission/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/commands/v1/KeyRotateSubmission/decode.cjs b/cjs/vega/commands/v1/KeyRotateSubmission/decode.cjs new file mode 100644 index 0000000..83312fc --- /dev/null +++ b/cjs/vega/commands/v1/KeyRotateSubmission/decode.cjs @@ -0,0 +1,40 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$newPubKeyIndex = 0; + let field$targetBlock = 0n; + let field$newPubKey = ''; + let field$currentPubKeyHash = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$newPubKeyIndex = types.uint32(data); + break + + case 2: + field$targetBlock = types.uint64(data); + break + + case 3: + field$newPubKey = types.string(data); + break + + case 4: + field$currentPubKeyHash = types.string(data); + break + } + } + return { + newPubKeyIndex: field$newPubKeyIndex, + targetBlock: field$targetBlock, + newPubKey: field$newPubKey, + currentPubKeyHash: field$currentPubKeyHash + } +} + +exports.decode = decode; diff --git a/cjs/vega/commands/v1/KeyRotateSubmission/encode.cjs b/cjs/vega/commands/v1/KeyRotateSubmission/encode.cjs new file mode 100644 index 0000000..354359e --- /dev/null +++ b/cjs/vega/commands/v1/KeyRotateSubmission/encode.cjs @@ -0,0 +1,23 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.newPubKeyIndex) writer.varint(1, obj.newPubKeyIndex, types.uint32); + if (obj.targetBlock) writer.varint(2, obj.targetBlock, types.uint64); + if (obj.newPubKey) writer.bytes(3, obj.newPubKey, types.string); + if (obj.currentPubKeyHash) writer.bytes(4, obj.currentPubKeyHash, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/commands/v1/LiquidityProvisionAmendment.cjs b/cjs/vega/commands/v1/LiquidityProvisionAmendment.cjs new file mode 100644 index 0000000..2ea9f74 --- /dev/null +++ b/cjs/vega/commands/v1/LiquidityProvisionAmendment.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./LiquidityProvisionAmendment/encode.cjs'); +var decode = require('./LiquidityProvisionAmendment/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/commands/v1/LiquidityProvisionAmendment/decode.cjs b/cjs/vega/commands/v1/LiquidityProvisionAmendment/decode.cjs new file mode 100644 index 0000000..05809c8 --- /dev/null +++ b/cjs/vega/commands/v1/LiquidityProvisionAmendment/decode.cjs @@ -0,0 +1,53 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$1 = require('../../../LiquidityOrder/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$marketId = ''; + let field$commitmentAmount = ''; + let field$fee = ''; + const field$sells = []; + const field$buys = []; + let field$reference = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$marketId = types.string(data); + break + + case 2: + field$commitmentAmount = types.string(data); + break + + case 3: + field$fee = types.string(data); + break + + case 4: + field$sells.push(decode$1.decode(data)); + break + + case 5: + field$buys.push(decode$1.decode(data)); + break + + case 6: + field$reference = types.string(data); + break + } + } + return { + marketId: field$marketId, + commitmentAmount: field$commitmentAmount, + fee: field$fee, + sells: field$sells, + buys: field$buys, + reference: field$reference + } +} + +exports.decode = decode; diff --git a/cjs/vega/commands/v1/LiquidityProvisionAmendment/encode.cjs b/cjs/vega/commands/v1/LiquidityProvisionAmendment/encode.cjs new file mode 100644 index 0000000..c0146ef --- /dev/null +++ b/cjs/vega/commands/v1/LiquidityProvisionAmendment/encode.cjs @@ -0,0 +1,28 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../../../LiquidityOrder/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.marketId) writer.bytes(1, obj.marketId, types.string); + if (obj.commitmentAmount) writer.bytes(2, obj.commitmentAmount, types.string); + if (obj.fee) writer.bytes(3, obj.fee, types.string); + if (obj.sells?.length) + obj.sells.forEach((v) => writer.bytes(4, encode$1.encode(v))); + if (obj.buys?.length) + obj.buys.forEach((v) => writer.bytes(5, encode$1.encode(v))); + if (obj.reference) writer.bytes(6, obj.reference, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/commands/v1/LiquidityProvisionCancellation.cjs b/cjs/vega/commands/v1/LiquidityProvisionCancellation.cjs new file mode 100644 index 0000000..2885dbe --- /dev/null +++ b/cjs/vega/commands/v1/LiquidityProvisionCancellation.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./LiquidityProvisionCancellation/encode.cjs'); +var decode = require('./LiquidityProvisionCancellation/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/commands/v1/LiquidityProvisionCancellation/decode.cjs b/cjs/vega/commands/v1/LiquidityProvisionCancellation/decode.cjs new file mode 100644 index 0000000..aea3634 --- /dev/null +++ b/cjs/vega/commands/v1/LiquidityProvisionCancellation/decode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$marketId = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$marketId = types.string(data); + break + } + } + return { marketId: field$marketId } +} + +exports.decode = decode; diff --git a/cjs/vega/commands/v1/LiquidityProvisionCancellation/encode.cjs b/cjs/vega/commands/v1/LiquidityProvisionCancellation/encode.cjs new file mode 100644 index 0000000..b753e9d --- /dev/null +++ b/cjs/vega/commands/v1/LiquidityProvisionCancellation/encode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.marketId) writer.bytes(1, obj.marketId, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/commands/v1/LiquidityProvisionSubmission.cjs b/cjs/vega/commands/v1/LiquidityProvisionSubmission.cjs new file mode 100644 index 0000000..9d68d1e --- /dev/null +++ b/cjs/vega/commands/v1/LiquidityProvisionSubmission.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./LiquidityProvisionSubmission/encode.cjs'); +var decode = require('./LiquidityProvisionSubmission/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/commands/v1/LiquidityProvisionSubmission/decode.cjs b/cjs/vega/commands/v1/LiquidityProvisionSubmission/decode.cjs new file mode 100644 index 0000000..05809c8 --- /dev/null +++ b/cjs/vega/commands/v1/LiquidityProvisionSubmission/decode.cjs @@ -0,0 +1,53 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$1 = require('../../../LiquidityOrder/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$marketId = ''; + let field$commitmentAmount = ''; + let field$fee = ''; + const field$sells = []; + const field$buys = []; + let field$reference = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$marketId = types.string(data); + break + + case 2: + field$commitmentAmount = types.string(data); + break + + case 3: + field$fee = types.string(data); + break + + case 4: + field$sells.push(decode$1.decode(data)); + break + + case 5: + field$buys.push(decode$1.decode(data)); + break + + case 6: + field$reference = types.string(data); + break + } + } + return { + marketId: field$marketId, + commitmentAmount: field$commitmentAmount, + fee: field$fee, + sells: field$sells, + buys: field$buys, + reference: field$reference + } +} + +exports.decode = decode; diff --git a/cjs/vega/commands/v1/LiquidityProvisionSubmission/encode.cjs b/cjs/vega/commands/v1/LiquidityProvisionSubmission/encode.cjs new file mode 100644 index 0000000..c0146ef --- /dev/null +++ b/cjs/vega/commands/v1/LiquidityProvisionSubmission/encode.cjs @@ -0,0 +1,28 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../../../LiquidityOrder/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.marketId) writer.bytes(1, obj.marketId, types.string); + if (obj.commitmentAmount) writer.bytes(2, obj.commitmentAmount, types.string); + if (obj.fee) writer.bytes(3, obj.fee, types.string); + if (obj.sells?.length) + obj.sells.forEach((v) => writer.bytes(4, encode$1.encode(v))); + if (obj.buys?.length) + obj.buys.forEach((v) => writer.bytes(5, encode$1.encode(v))); + if (obj.reference) writer.bytes(6, obj.reference, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/commands/v1/NodeSignature.cjs b/cjs/vega/commands/v1/NodeSignature.cjs new file mode 100644 index 0000000..4295191 --- /dev/null +++ b/cjs/vega/commands/v1/NodeSignature.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./NodeSignature/encode.cjs'); +var decode = require('./NodeSignature/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/commands/v1/NodeSignature/decode.cjs b/cjs/vega/commands/v1/NodeSignature/decode.cjs new file mode 100644 index 0000000..9addc57 --- /dev/null +++ b/cjs/vega/commands/v1/NodeSignature/decode.cjs @@ -0,0 +1,31 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var NodeSignatureKind = require('../NodeSignatureKind.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$id = ''; + let field$sig = new Uint8Array(0); + let field$kind = 0; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$id = types.string(data); + break + + case 2: + field$sig = types.bytes(data); + break + + case 3: + field$kind = NodeSignatureKind.decode(data); + break + } + } + return { id: field$id, sig: field$sig, kind: field$kind } +} + +exports.decode = decode; diff --git a/cjs/vega/commands/v1/NodeSignature/encode.cjs b/cjs/vega/commands/v1/NodeSignature/encode.cjs new file mode 100644 index 0000000..4fa4939 --- /dev/null +++ b/cjs/vega/commands/v1/NodeSignature/encode.cjs @@ -0,0 +1,23 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var NodeSignatureKind = require('../NodeSignatureKind.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.id) writer.bytes(1, obj.id, types.string); + if (obj.sig) writer.bytes(2, obj.sig, types.bytes); + if (obj.kind) writer.varint(3, obj.kind, NodeSignatureKind); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/commands/v1/NodeSignatureKind.cjs b/cjs/vega/commands/v1/NodeSignatureKind.cjs new file mode 100644 index 0000000..f3c76a4 --- /dev/null +++ b/cjs/vega/commands/v1/NodeSignatureKind.cjs @@ -0,0 +1,83 @@ +'use strict'; + +var assert = require('nanoassert'); +var types = require('protobuf-codec/encode/types'); +var types$1 = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +const NODE_SIGNATURE_KIND_UNSPECIFIED = 0; +const NODE_SIGNATURE_KIND_ASSET_NEW = 1; +const NODE_SIGNATURE_KIND_ASSET_WITHDRAWAL = 2; +const NODE_SIGNATURE_KIND_ERC20_MULTISIG_SIGNER_ADDED = 3; +const NODE_SIGNATURE_KIND_ERC20_MULTISIG_SIGNER_REMOVED = 4; +const NODE_SIGNATURE_KIND_ASSET_UPDATE = 5; + +const enumValues = new Map([ + [0, 'NODE_SIGNATURE_KIND_UNSPECIFIED'], + [1, 'NODE_SIGNATURE_KIND_ASSET_NEW'], + [2, 'NODE_SIGNATURE_KIND_ASSET_WITHDRAWAL'], + [3, 'NODE_SIGNATURE_KIND_ERC20_MULTISIG_SIGNER_ADDED'], + [4, 'NODE_SIGNATURE_KIND_ERC20_MULTISIG_SIGNER_REMOVED'], + [5, 'NODE_SIGNATURE_KIND_ASSET_UPDATE'] +]); +const enumNames = new Map([ + ['NODE_SIGNATURE_KIND_UNSPECIFIED', 0], + ['NODE_SIGNATURE_KIND_ASSET_NEW', 1], + ['NODE_SIGNATURE_KIND_ASSET_WITHDRAWAL', 2], + ['NODE_SIGNATURE_KIND_ERC20_MULTISIG_SIGNER_ADDED', 3], + ['NODE_SIGNATURE_KIND_ERC20_MULTISIG_SIGNER_REMOVED', 4], + ['NODE_SIGNATURE_KIND_ASSET_UPDATE', 5] +]); + +function encode(value, buf, byteOffset = 0) { + if (typeof value === 'string') return encode(parse(value), buf, byteOffset) + if (value == null) + throw new Error('Invalid NodeSignatureKind value (' + value + ')') + + return types.enumerable.encode(value, buf, byteOffset) +} + +function decode(varint) { + const int = types$1.enumerable(varint); + + return stringify(int) ?? int +} + +function encodingLength(value) { + if (typeof value === 'string') return encodingLength(parse(value)) + assert(value != null, 'Invalid NodeSignatureKind value (' + value + ')'); + + if (0 <= value && value <= 5) return 1 + + // enumerable max value in case of unknown value + return 5 +} + +/** + * Convert an enum value to it's human readable name. + * Returns undefined on an unknown value. + */ +function stringify(int) { + return enumValues.get(int) +} + +/** + * Convert an enum string names to it's machine integer value. + * Returns undefined on an unknown name. + */ +function parse(str) { + return enumNames.get(str) +} + +exports.NODE_SIGNATURE_KIND_ASSET_NEW = NODE_SIGNATURE_KIND_ASSET_NEW; +exports.NODE_SIGNATURE_KIND_ASSET_UPDATE = NODE_SIGNATURE_KIND_ASSET_UPDATE; +exports.NODE_SIGNATURE_KIND_ASSET_WITHDRAWAL = NODE_SIGNATURE_KIND_ASSET_WITHDRAWAL; +exports.NODE_SIGNATURE_KIND_ERC20_MULTISIG_SIGNER_ADDED = NODE_SIGNATURE_KIND_ERC20_MULTISIG_SIGNER_ADDED; +exports.NODE_SIGNATURE_KIND_ERC20_MULTISIG_SIGNER_REMOVED = NODE_SIGNATURE_KIND_ERC20_MULTISIG_SIGNER_REMOVED; +exports.NODE_SIGNATURE_KIND_UNSPECIFIED = NODE_SIGNATURE_KIND_UNSPECIFIED; +exports.decode = decode; +exports.encode = encode; +exports.encodingLength = encodingLength; +exports.parse = parse; +exports.stringify = stringify; diff --git a/cjs/vega/commands/v1/NodeVote.cjs b/cjs/vega/commands/v1/NodeVote.cjs new file mode 100644 index 0000000..d1a282a --- /dev/null +++ b/cjs/vega/commands/v1/NodeVote.cjs @@ -0,0 +1,11 @@ +'use strict'; + +var encode = require('./NodeVote/encode.cjs'); +var decode = require('./NodeVote/decode.cjs'); +var Type = require('./NodeVote/Type.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; +exports.Type = Type; diff --git a/cjs/vega/commands/v1/NodeVote/Type.cjs b/cjs/vega/commands/v1/NodeVote/Type.cjs new file mode 100644 index 0000000..bffb489 --- /dev/null +++ b/cjs/vega/commands/v1/NodeVote/Type.cjs @@ -0,0 +1,110 @@ +'use strict'; + +var assert = require('nanoassert'); +var types = require('protobuf-codec/encode/types'); +var types$1 = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +const TYPE_UNSPECIFIED = 0; +const TYPE_STAKE_DEPOSITED = 1; +const TYPE_STAKE_REMOVED = 2; +const TYPE_FUNDS_DEPOSITED = 3; +const TYPE_SIGNER_ADDED = 4; +const TYPE_SIGNER_REMOVED = 5; +const TYPE_BRIDGE_STOPPED = 6; +const TYPE_BRIDGE_RESUMED = 7; +const TYPE_ASSET_LISTED = 8; +const TYPE_LIMITS_UPDATED = 9; +const TYPE_STAKE_TOTAL_SUPPLY = 10; +const TYPE_SIGNER_THRESHOLD_SET = 11; +const TYPE_GOVERNANCE_VALIDATE_ASSET = 12; + +const enumValues = new Map([ + [0, 'TYPE_UNSPECIFIED'], + [1, 'TYPE_STAKE_DEPOSITED'], + [2, 'TYPE_STAKE_REMOVED'], + [3, 'TYPE_FUNDS_DEPOSITED'], + [4, 'TYPE_SIGNER_ADDED'], + [5, 'TYPE_SIGNER_REMOVED'], + [6, 'TYPE_BRIDGE_STOPPED'], + [7, 'TYPE_BRIDGE_RESUMED'], + [8, 'TYPE_ASSET_LISTED'], + [9, 'TYPE_LIMITS_UPDATED'], + [10, 'TYPE_STAKE_TOTAL_SUPPLY'], + [11, 'TYPE_SIGNER_THRESHOLD_SET'], + [12, 'TYPE_GOVERNANCE_VALIDATE_ASSET'] +]); +const enumNames = new Map([ + ['TYPE_UNSPECIFIED', 0], + ['TYPE_STAKE_DEPOSITED', 1], + ['TYPE_STAKE_REMOVED', 2], + ['TYPE_FUNDS_DEPOSITED', 3], + ['TYPE_SIGNER_ADDED', 4], + ['TYPE_SIGNER_REMOVED', 5], + ['TYPE_BRIDGE_STOPPED', 6], + ['TYPE_BRIDGE_RESUMED', 7], + ['TYPE_ASSET_LISTED', 8], + ['TYPE_LIMITS_UPDATED', 9], + ['TYPE_STAKE_TOTAL_SUPPLY', 10], + ['TYPE_SIGNER_THRESHOLD_SET', 11], + ['TYPE_GOVERNANCE_VALIDATE_ASSET', 12] +]); + +function encode(value, buf, byteOffset = 0) { + if (typeof value === 'string') return encode(parse(value), buf, byteOffset) + if (value == null) throw new Error('Invalid Type value (' + value + ')') + + return types.enumerable.encode(value, buf, byteOffset) +} + +function decode(varint) { + const int = types$1.enumerable(varint); + + return stringify(int) ?? int +} + +function encodingLength(value) { + if (typeof value === 'string') return encodingLength(parse(value)) + assert(value != null, 'Invalid Type value (' + value + ')'); + + if (0 <= value && value <= 12) return 1 + + // enumerable max value in case of unknown value + return 5 +} + +/** + * Convert an enum value to it's human readable name. + * Returns undefined on an unknown value. + */ +function stringify(int) { + return enumValues.get(int) +} + +/** + * Convert an enum string names to it's machine integer value. + * Returns undefined on an unknown name. + */ +function parse(str) { + return enumNames.get(str) +} + +exports.TYPE_ASSET_LISTED = TYPE_ASSET_LISTED; +exports.TYPE_BRIDGE_RESUMED = TYPE_BRIDGE_RESUMED; +exports.TYPE_BRIDGE_STOPPED = TYPE_BRIDGE_STOPPED; +exports.TYPE_FUNDS_DEPOSITED = TYPE_FUNDS_DEPOSITED; +exports.TYPE_GOVERNANCE_VALIDATE_ASSET = TYPE_GOVERNANCE_VALIDATE_ASSET; +exports.TYPE_LIMITS_UPDATED = TYPE_LIMITS_UPDATED; +exports.TYPE_SIGNER_ADDED = TYPE_SIGNER_ADDED; +exports.TYPE_SIGNER_REMOVED = TYPE_SIGNER_REMOVED; +exports.TYPE_SIGNER_THRESHOLD_SET = TYPE_SIGNER_THRESHOLD_SET; +exports.TYPE_STAKE_DEPOSITED = TYPE_STAKE_DEPOSITED; +exports.TYPE_STAKE_REMOVED = TYPE_STAKE_REMOVED; +exports.TYPE_STAKE_TOTAL_SUPPLY = TYPE_STAKE_TOTAL_SUPPLY; +exports.TYPE_UNSPECIFIED = TYPE_UNSPECIFIED; +exports.decode = decode; +exports.encode = encode; +exports.encodingLength = encodingLength; +exports.parse = parse; +exports.stringify = stringify; diff --git a/cjs/vega/commands/v1/NodeVote/decode.cjs b/cjs/vega/commands/v1/NodeVote/decode.cjs new file mode 100644 index 0000000..d590a2b --- /dev/null +++ b/cjs/vega/commands/v1/NodeVote/decode.cjs @@ -0,0 +1,26 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var Type = require('./Type.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$reference = ''; + let field$type = 0; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 2: + field$reference = types.string(data); + break + + case 3: + field$type = Type.decode(data); + break + } + } + return { reference: field$reference, type: field$type } +} + +exports.decode = decode; diff --git a/cjs/vega/commands/v1/NodeVote/encode.cjs b/cjs/vega/commands/v1/NodeVote/encode.cjs new file mode 100644 index 0000000..4acb511 --- /dev/null +++ b/cjs/vega/commands/v1/NodeVote/encode.cjs @@ -0,0 +1,22 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var Type = require('./Type.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.reference) writer.bytes(2, obj.reference, types.string); + if (obj.type) writer.varint(3, obj.type, Type); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/commands/v1/OneOffTransfer.cjs b/cjs/vega/commands/v1/OneOffTransfer.cjs new file mode 100644 index 0000000..2df3aec --- /dev/null +++ b/cjs/vega/commands/v1/OneOffTransfer.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./OneOffTransfer/encode.cjs'); +var decode = require('./OneOffTransfer/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/commands/v1/OneOffTransfer/decode.cjs b/cjs/vega/commands/v1/OneOffTransfer/decode.cjs new file mode 100644 index 0000000..fae97ab --- /dev/null +++ b/cjs/vega/commands/v1/OneOffTransfer/decode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$deliverOn = 0n; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$deliverOn = types.int64(data); + break + } + } + return { deliverOn: field$deliverOn } +} + +exports.decode = decode; diff --git a/cjs/vega/commands/v1/OneOffTransfer/encode.cjs b/cjs/vega/commands/v1/OneOffTransfer/encode.cjs new file mode 100644 index 0000000..b1501e9 --- /dev/null +++ b/cjs/vega/commands/v1/OneOffTransfer/encode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.deliverOn) writer.varint(1, obj.deliverOn, types.int64); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/commands/v1/OracleDataSubmission.cjs b/cjs/vega/commands/v1/OracleDataSubmission.cjs new file mode 100644 index 0000000..9140eaf --- /dev/null +++ b/cjs/vega/commands/v1/OracleDataSubmission.cjs @@ -0,0 +1,11 @@ +'use strict'; + +var encode = require('./OracleDataSubmission/encode.cjs'); +var decode = require('./OracleDataSubmission/decode.cjs'); +var OracleSource = require('./OracleDataSubmission/OracleSource.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; +exports.OracleSource = OracleSource; diff --git a/cjs/vega/commands/v1/OracleDataSubmission/OracleSource.cjs b/cjs/vega/commands/v1/OracleDataSubmission/OracleSource.cjs new file mode 100644 index 0000000..fc7c19a --- /dev/null +++ b/cjs/vega/commands/v1/OracleDataSubmission/OracleSource.cjs @@ -0,0 +1,71 @@ +'use strict'; + +var assert = require('nanoassert'); +var types = require('protobuf-codec/encode/types'); +var types$1 = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +const ORACLE_SOURCE_UNSPECIFIED = 0; +const ORACLE_SOURCE_OPEN_ORACLE = 1; +const ORACLE_SOURCE_JSON = 2; + +const enumValues = new Map([ + [0, 'ORACLE_SOURCE_UNSPECIFIED'], + [1, 'ORACLE_SOURCE_OPEN_ORACLE'], + [2, 'ORACLE_SOURCE_JSON'] +]); +const enumNames = new Map([ + ['ORACLE_SOURCE_UNSPECIFIED', 0], + ['ORACLE_SOURCE_OPEN_ORACLE', 1], + ['ORACLE_SOURCE_JSON', 2] +]); + +function encode(value, buf, byteOffset = 0) { + if (typeof value === 'string') return encode(parse(value), buf, byteOffset) + if (value == null) + throw new Error('Invalid OracleSource value (' + value + ')') + + return types.enumerable.encode(value, buf, byteOffset) +} + +function decode(varint) { + const int = types$1.enumerable(varint); + + return stringify(int) ?? int +} + +function encodingLength(value) { + if (typeof value === 'string') return encodingLength(parse(value)) + assert(value != null, 'Invalid OracleSource value (' + value + ')'); + + if (0 <= value && value <= 2) return 1 + + // enumerable max value in case of unknown value + return 5 +} + +/** + * Convert an enum value to it's human readable name. + * Returns undefined on an unknown value. + */ +function stringify(int) { + return enumValues.get(int) +} + +/** + * Convert an enum string names to it's machine integer value. + * Returns undefined on an unknown name. + */ +function parse(str) { + return enumNames.get(str) +} + +exports.ORACLE_SOURCE_JSON = ORACLE_SOURCE_JSON; +exports.ORACLE_SOURCE_OPEN_ORACLE = ORACLE_SOURCE_OPEN_ORACLE; +exports.ORACLE_SOURCE_UNSPECIFIED = ORACLE_SOURCE_UNSPECIFIED; +exports.decode = decode; +exports.encode = encode; +exports.encodingLength = encodingLength; +exports.parse = parse; +exports.stringify = stringify; diff --git a/cjs/vega/commands/v1/OracleDataSubmission/decode.cjs b/cjs/vega/commands/v1/OracleDataSubmission/decode.cjs new file mode 100644 index 0000000..febcf64 --- /dev/null +++ b/cjs/vega/commands/v1/OracleDataSubmission/decode.cjs @@ -0,0 +1,27 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var OracleSource = require('./OracleSource.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$source = 0; + let field$payload = new Uint8Array(0); + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$source = + OracleSource.decode(data); + break + + case 2: + field$payload = types.bytes(data); + break + } + } + return { source: field$source, payload: field$payload } +} + +exports.decode = decode; diff --git a/cjs/vega/commands/v1/OracleDataSubmission/encode.cjs b/cjs/vega/commands/v1/OracleDataSubmission/encode.cjs new file mode 100644 index 0000000..4a8ad18 --- /dev/null +++ b/cjs/vega/commands/v1/OracleDataSubmission/encode.cjs @@ -0,0 +1,27 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var OracleSource = require('./OracleSource.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.source) + writer.varint( + 1, + obj.source, + OracleSource + ); + if (obj.payload) writer.bytes(2, obj.payload, types.bytes); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/commands/v1/OrderAmendment.cjs b/cjs/vega/commands/v1/OrderAmendment.cjs new file mode 100644 index 0000000..f967b2c --- /dev/null +++ b/cjs/vega/commands/v1/OrderAmendment.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./OrderAmendment/encode.cjs'); +var decode = require('./OrderAmendment/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/commands/v1/OrderAmendment/decode.cjs b/cjs/vega/commands/v1/OrderAmendment/decode.cjs new file mode 100644 index 0000000..5209316 --- /dev/null +++ b/cjs/vega/commands/v1/OrderAmendment/decode.cjs @@ -0,0 +1,66 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var TimeInForce = require('../../../Order/TimeInForce.cjs'); +var PeggedReference = require('../../../PeggedReference.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$orderId = ''; + let field$marketId = ''; + let field$price = null; + let field$sizeDelta = 0n; + let field$expiresAt = null; + let field$timeInForce = 0; + let field$peggedOffset = ''; + let field$peggedReference = 0; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$orderId = types.string(data); + break + + case 2: + field$marketId = types.string(data); + break + + case 3: + field$price = types.string(data); + break + + case 4: + field$sizeDelta = types.int64(data); + break + + case 5: + field$expiresAt = types.int64(data); + break + + case 6: + field$timeInForce = TimeInForce.decode(data); + break + + case 7: + field$peggedOffset = types.string(data); + break + + case 8: + field$peggedReference = PeggedReference.decode(data); + break + } + } + return { + orderId: field$orderId, + marketId: field$marketId, + price: field$price, + sizeDelta: field$sizeDelta, + expiresAt: field$expiresAt, + timeInForce: field$timeInForce, + peggedOffset: field$peggedOffset, + peggedReference: field$peggedReference + } +} + +exports.decode = decode; diff --git a/cjs/vega/commands/v1/OrderAmendment/encode.cjs b/cjs/vega/commands/v1/OrderAmendment/encode.cjs new file mode 100644 index 0000000..2f0e265 --- /dev/null +++ b/cjs/vega/commands/v1/OrderAmendment/encode.cjs @@ -0,0 +1,31 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var TimeInForce = require('../../../Order/TimeInForce.cjs'); +var PeggedReference = require('../../../PeggedReference.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.orderId) writer.bytes(1, obj.orderId, types.string); + if (obj.marketId) writer.bytes(2, obj.marketId, types.string); + if (obj.price) writer.bytes(3, obj.price, types.string); + if (obj.sizeDelta) writer.varint(4, obj.sizeDelta, types.int64); + if (obj.expiresAt) writer.varint(5, obj.expiresAt, types.int64); + if (obj.timeInForce) + writer.varint(6, obj.timeInForce, TimeInForce); + if (obj.peggedOffset) writer.bytes(7, obj.peggedOffset, types.string); + if (obj.peggedReference) + writer.varint(8, obj.peggedReference, PeggedReference); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/commands/v1/OrderCancellation.cjs b/cjs/vega/commands/v1/OrderCancellation.cjs new file mode 100644 index 0000000..45b7bc0 --- /dev/null +++ b/cjs/vega/commands/v1/OrderCancellation.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./OrderCancellation/encode.cjs'); +var decode = require('./OrderCancellation/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/commands/v1/OrderCancellation/decode.cjs b/cjs/vega/commands/v1/OrderCancellation/decode.cjs new file mode 100644 index 0000000..e24c395 --- /dev/null +++ b/cjs/vega/commands/v1/OrderCancellation/decode.cjs @@ -0,0 +1,25 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$orderId = ''; + let field$marketId = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$orderId = types.string(data); + break + + case 2: + field$marketId = types.string(data); + break + } + } + return { orderId: field$orderId, marketId: field$marketId } +} + +exports.decode = decode; diff --git a/cjs/vega/commands/v1/OrderCancellation/encode.cjs b/cjs/vega/commands/v1/OrderCancellation/encode.cjs new file mode 100644 index 0000000..c4125ee --- /dev/null +++ b/cjs/vega/commands/v1/OrderCancellation/encode.cjs @@ -0,0 +1,21 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.orderId) writer.bytes(1, obj.orderId, types.string); + if (obj.marketId) writer.bytes(2, obj.marketId, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/commands/v1/OrderSubmission.cjs b/cjs/vega/commands/v1/OrderSubmission.cjs new file mode 100644 index 0000000..7fb2365 --- /dev/null +++ b/cjs/vega/commands/v1/OrderSubmission.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./OrderSubmission/encode.cjs'); +var decode = require('./OrderSubmission/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/commands/v1/OrderSubmission/decode.cjs b/cjs/vega/commands/v1/OrderSubmission/decode.cjs new file mode 100644 index 0000000..b1c68d5 --- /dev/null +++ b/cjs/vega/commands/v1/OrderSubmission/decode.cjs @@ -0,0 +1,93 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var Side = require('../../../Side.cjs'); +var TimeInForce = require('../../../Order/TimeInForce.cjs'); +var Type = require('../../../Order/Type.cjs'); +var decode$2 = require('../../../PeggedOrder/decode.cjs'); +var decode$1 = require('../IcebergOpts/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$marketId = ''; + let field$price = ''; + let field$size = 0n; + let field$side = 0; + let field$timeInForce = 0; + let field$expiresAt = 0n; + let field$type = 0; + let field$reference = ''; + let field$peggedOrder = {}; + let field$postOnly = false; + let field$reduceOnly = false; + let field$icebergOpts = null; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$marketId = types.string(data); + break + + case 2: + field$price = types.string(data); + break + + case 3: + field$size = types.uint64(data); + break + + case 4: + field$side = Side.decode(data); + break + + case 5: + field$timeInForce = TimeInForce.decode(data); + break + + case 6: + field$expiresAt = types.int64(data); + break + + case 7: + field$type = Type.decode(data); + break + + case 8: + field$reference = types.string(data); + break + + case 9: + field$peggedOrder = decode$2.decode(data); + break + + case 10: + field$postOnly = types.bool(data); + break + + case 11: + field$reduceOnly = types.bool(data); + break + + case 12: + field$icebergOpts = decode$1.decode(data); + break + } + } + return { + marketId: field$marketId, + price: field$price, + size: field$size, + side: field$side, + timeInForce: field$timeInForce, + expiresAt: field$expiresAt, + type: field$type, + reference: field$reference, + peggedOrder: field$peggedOrder, + postOnly: field$postOnly, + reduceOnly: field$reduceOnly, + icebergOpts: field$icebergOpts + } +} + +exports.decode = decode; diff --git a/cjs/vega/commands/v1/OrderSubmission/encode.cjs b/cjs/vega/commands/v1/OrderSubmission/encode.cjs new file mode 100644 index 0000000..9a463af --- /dev/null +++ b/cjs/vega/commands/v1/OrderSubmission/encode.cjs @@ -0,0 +1,39 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var Side = require('../../../Side.cjs'); +var TimeInForce = require('../../../Order/TimeInForce.cjs'); +var Type = require('../../../Order/Type.cjs'); +var encode$1 = require('../../../PeggedOrder/encode.cjs'); +var encode$2 = require('../IcebergOpts/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.marketId) writer.bytes(1, obj.marketId, types.string); + if (obj.price) writer.bytes(2, obj.price, types.string); + if (obj.size) writer.varint(3, obj.size, types.uint64); + if (obj.side) writer.varint(4, obj.side, Side); + if (obj.timeInForce) + writer.varint(5, obj.timeInForce, TimeInForce); + if (obj.expiresAt) writer.varint(6, obj.expiresAt, types.int64); + if (obj.type) writer.varint(7, obj.type, Type); + if (obj.reference) writer.bytes(8, obj.reference, types.string); + if (obj.peggedOrder) + writer.bytes(9, encode$1.encode(obj.peggedOrder)); + if (obj.postOnly) writer.varint(10, obj.postOnly, types.bool); + if (obj.reduceOnly) writer.varint(11, obj.reduceOnly, types.bool); + if (obj.icebergOpts) + writer.bytes(12, encode$2.encode(obj.icebergOpts)); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/commands/v1/ProofOfWork.cjs b/cjs/vega/commands/v1/ProofOfWork.cjs new file mode 100644 index 0000000..c71767b --- /dev/null +++ b/cjs/vega/commands/v1/ProofOfWork.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./ProofOfWork/encode.cjs'); +var decode = require('./ProofOfWork/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/commands/v1/ProofOfWork/decode.cjs b/cjs/vega/commands/v1/ProofOfWork/decode.cjs new file mode 100644 index 0000000..7710aee --- /dev/null +++ b/cjs/vega/commands/v1/ProofOfWork/decode.cjs @@ -0,0 +1,25 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$tid = ''; + let field$nonce = 0n; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$tid = types.string(data); + break + + case 2: + field$nonce = types.uint64(data); + break + } + } + return { tid: field$tid, nonce: field$nonce } +} + +exports.decode = decode; diff --git a/cjs/vega/commands/v1/ProofOfWork/encode.cjs b/cjs/vega/commands/v1/ProofOfWork/encode.cjs new file mode 100644 index 0000000..e002f4f --- /dev/null +++ b/cjs/vega/commands/v1/ProofOfWork/encode.cjs @@ -0,0 +1,21 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.tid) writer.bytes(1, obj.tid, types.string); + if (obj.nonce) writer.varint(2, obj.nonce, types.uint64); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/commands/v1/ProposalSubmission.cjs b/cjs/vega/commands/v1/ProposalSubmission.cjs new file mode 100644 index 0000000..96da038 --- /dev/null +++ b/cjs/vega/commands/v1/ProposalSubmission.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./ProposalSubmission/encode.cjs'); +var decode = require('./ProposalSubmission/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/commands/v1/ProposalSubmission/decode.cjs b/cjs/vega/commands/v1/ProposalSubmission/decode.cjs new file mode 100644 index 0000000..96ed525 --- /dev/null +++ b/cjs/vega/commands/v1/ProposalSubmission/decode.cjs @@ -0,0 +1,36 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$2 = require('../../../ProposalTerms/decode.cjs'); +var decode$1 = require('../../../ProposalRationale/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$reference = ''; + let field$terms = {}; + let field$rationale = {}; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$reference = types.string(data); + break + + case 2: + field$terms = decode$2.decode(data); + break + + case 3: + field$rationale = decode$1.decode(data); + break + } + } + return { + reference: field$reference, + terms: field$terms, + rationale: field$rationale + } +} + +exports.decode = decode; diff --git a/cjs/vega/commands/v1/ProposalSubmission/encode.cjs b/cjs/vega/commands/v1/ProposalSubmission/encode.cjs new file mode 100644 index 0000000..21064f4 --- /dev/null +++ b/cjs/vega/commands/v1/ProposalSubmission/encode.cjs @@ -0,0 +1,25 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../../../ProposalTerms/encode.cjs'); +var encode$2 = require('../../../ProposalRationale/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.reference) writer.bytes(1, obj.reference, types.string); + if (obj.terms) writer.bytes(2, encode$1.encode(obj.terms)); + if (obj.rationale) + writer.bytes(3, encode$2.encode(obj.rationale)); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/commands/v1/ProtocolUpgradeProposal.cjs b/cjs/vega/commands/v1/ProtocolUpgradeProposal.cjs new file mode 100644 index 0000000..bee881d --- /dev/null +++ b/cjs/vega/commands/v1/ProtocolUpgradeProposal.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./ProtocolUpgradeProposal/encode.cjs'); +var decode = require('./ProtocolUpgradeProposal/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/commands/v1/ProtocolUpgradeProposal/decode.cjs b/cjs/vega/commands/v1/ProtocolUpgradeProposal/decode.cjs new file mode 100644 index 0000000..d760570 --- /dev/null +++ b/cjs/vega/commands/v1/ProtocolUpgradeProposal/decode.cjs @@ -0,0 +1,28 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$upgradeBlockHeight = 0n; + let field$vegaReleaseTag = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$upgradeBlockHeight = types.uint64(data); + break + + case 2: + field$vegaReleaseTag = types.string(data); + break + } + } + return { + upgradeBlockHeight: field$upgradeBlockHeight, + vegaReleaseTag: field$vegaReleaseTag + } +} + +exports.decode = decode; diff --git a/cjs/vega/commands/v1/ProtocolUpgradeProposal/encode.cjs b/cjs/vega/commands/v1/ProtocolUpgradeProposal/encode.cjs new file mode 100644 index 0000000..779e15f --- /dev/null +++ b/cjs/vega/commands/v1/ProtocolUpgradeProposal/encode.cjs @@ -0,0 +1,21 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.upgradeBlockHeight) writer.varint(1, obj.upgradeBlockHeight, types.uint64); + if (obj.vegaReleaseTag) writer.bytes(2, obj.vegaReleaseTag, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/commands/v1/RecurringTransfer.cjs b/cjs/vega/commands/v1/RecurringTransfer.cjs new file mode 100644 index 0000000..ccc0aa5 --- /dev/null +++ b/cjs/vega/commands/v1/RecurringTransfer.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./RecurringTransfer/encode.cjs'); +var decode = require('./RecurringTransfer/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/commands/v1/RecurringTransfer/decode.cjs b/cjs/vega/commands/v1/RecurringTransfer/decode.cjs new file mode 100644 index 0000000..288d326 --- /dev/null +++ b/cjs/vega/commands/v1/RecurringTransfer/decode.cjs @@ -0,0 +1,41 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$1 = require('../../../DispatchStrategy/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$startEpoch = 0n; + let field$endEpoch = null; + let field$factor = ''; + let field$dispatchStrategy = {}; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$startEpoch = types.uint64(data); + break + + case 2: + field$endEpoch = types.uint64(data); + break + + case 3: + field$factor = types.string(data); + break + + case 4: + field$dispatchStrategy = decode$1.decode(data); + break + } + } + return { + startEpoch: field$startEpoch, + endEpoch: field$endEpoch, + factor: field$factor, + dispatchStrategy: field$dispatchStrategy + } +} + +exports.decode = decode; diff --git a/cjs/vega/commands/v1/RecurringTransfer/encode.cjs b/cjs/vega/commands/v1/RecurringTransfer/encode.cjs new file mode 100644 index 0000000..747c852 --- /dev/null +++ b/cjs/vega/commands/v1/RecurringTransfer/encode.cjs @@ -0,0 +1,25 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../../../DispatchStrategy/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.startEpoch) writer.varint(1, obj.startEpoch, types.uint64); + if (obj.endEpoch) writer.varint(2, obj.endEpoch, types.uint64); + if (obj.factor) writer.bytes(3, obj.factor, types.string); + if (obj.dispatchStrategy) + writer.bytes(4, encode$1.encode(obj.dispatchStrategy)); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/commands/v1/Signature.cjs b/cjs/vega/commands/v1/Signature.cjs new file mode 100644 index 0000000..d43dc02 --- /dev/null +++ b/cjs/vega/commands/v1/Signature.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./Signature/encode.cjs'); +var decode = require('./Signature/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/commands/v1/Signature/decode.cjs b/cjs/vega/commands/v1/Signature/decode.cjs new file mode 100644 index 0000000..d914273 --- /dev/null +++ b/cjs/vega/commands/v1/Signature/decode.cjs @@ -0,0 +1,30 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$value = ''; + let field$algo = ''; + let field$version = 0; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$value = types.string(data); + break + + case 2: + field$algo = types.string(data); + break + + case 3: + field$version = types.uint32(data); + break + } + } + return { value: field$value, algo: field$algo, version: field$version } +} + +exports.decode = decode; diff --git a/cjs/vega/commands/v1/Signature/encode.cjs b/cjs/vega/commands/v1/Signature/encode.cjs new file mode 100644 index 0000000..4c5d964 --- /dev/null +++ b/cjs/vega/commands/v1/Signature/encode.cjs @@ -0,0 +1,22 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.value) writer.bytes(1, obj.value, types.string); + if (obj.algo) writer.bytes(2, obj.algo, types.string); + if (obj.version) writer.varint(3, obj.version, types.uint32); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/commands/v1/StateVariableProposal.cjs b/cjs/vega/commands/v1/StateVariableProposal.cjs new file mode 100644 index 0000000..e2370e7 --- /dev/null +++ b/cjs/vega/commands/v1/StateVariableProposal.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./StateVariableProposal/encode.cjs'); +var decode = require('./StateVariableProposal/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/commands/v1/StateVariableProposal/decode.cjs b/cjs/vega/commands/v1/StateVariableProposal/decode.cjs new file mode 100644 index 0000000..bbc6350 --- /dev/null +++ b/cjs/vega/commands/v1/StateVariableProposal/decode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var decode$1 = require('../../../StateValueProposal/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$proposal = {}; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$proposal = decode$1.decode(data); + break + } + } + return { proposal: field$proposal } +} + +exports.decode = decode; diff --git a/cjs/vega/commands/v1/StateVariableProposal/encode.cjs b/cjs/vega/commands/v1/StateVariableProposal/encode.cjs new file mode 100644 index 0000000..e682f58 --- /dev/null +++ b/cjs/vega/commands/v1/StateVariableProposal/encode.cjs @@ -0,0 +1,21 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var encode$1 = require('../../../StateValueProposal/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.proposal) + writer.bytes(1, encode$1.encode(obj.proposal)); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/commands/v1/StopOrderSetup.cjs b/cjs/vega/commands/v1/StopOrderSetup.cjs new file mode 100644 index 0000000..4cf790d --- /dev/null +++ b/cjs/vega/commands/v1/StopOrderSetup.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./StopOrderSetup/encode.cjs'); +var decode = require('./StopOrderSetup/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/commands/v1/StopOrderSetup/decode.cjs b/cjs/vega/commands/v1/StopOrderSetup/decode.cjs new file mode 100644 index 0000000..0c7faa9 --- /dev/null +++ b/cjs/vega/commands/v1/StopOrderSetup/decode.cjs @@ -0,0 +1,46 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$1 = require('../OrderSubmission/decode.cjs'); +var ExpiryStrategy = require('../../../StopOrder/ExpiryStrategy.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$orderSubmission = {}; + let field$expiresAt = null; + let field$expiryStrategy = null; + let field$trigger = null; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$orderSubmission = decode$1.decode(data); + break + + case 2: + field$expiresAt = types.int64(data); + break + + case 3: + field$expiryStrategy = ExpiryStrategy.decode(data); + break + + case 100: + field$trigger = { price: types.string(data) }; + break + + case 101: + field$trigger = { trailingPercentOffset: types.string(data) }; + break + } + } + return { + orderSubmission: field$orderSubmission, + expiresAt: field$expiresAt, + expiryStrategy: field$expiryStrategy, + trigger: field$trigger + } +} + +exports.decode = decode; diff --git a/cjs/vega/commands/v1/StopOrderSetup/encode.cjs b/cjs/vega/commands/v1/StopOrderSetup/encode.cjs new file mode 100644 index 0000000..6ee2871 --- /dev/null +++ b/cjs/vega/commands/v1/StopOrderSetup/encode.cjs @@ -0,0 +1,38 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../OrderSubmission/encode.cjs'); +var ExpiryStrategy = require('../../../StopOrder/ExpiryStrategy.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.orderSubmission) + writer.bytes( + 1, + encode$1.encode(obj.orderSubmission) + ); + if (obj.expiresAt) writer.varint(2, obj.expiresAt, types.int64); + if (obj.expiryStrategy) + writer.varint(3, obj.expiryStrategy, ExpiryStrategy); + + if (obj.trigger?.price ?? obj.price) + writer.bytes(100, obj.trigger?.price ?? obj.price, types.string); + if (obj.trigger?.trailingPercentOffset ?? obj.trailingPercentOffset) + writer.bytes( + 101, + obj.trigger?.trailingPercentOffset ?? obj.trailingPercentOffset, + types.string + ); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/commands/v1/StopOrdersCancellation.cjs b/cjs/vega/commands/v1/StopOrdersCancellation.cjs new file mode 100644 index 0000000..7c8e882 --- /dev/null +++ b/cjs/vega/commands/v1/StopOrdersCancellation.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./StopOrdersCancellation/encode.cjs'); +var decode = require('./StopOrdersCancellation/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/commands/v1/StopOrdersCancellation/decode.cjs b/cjs/vega/commands/v1/StopOrdersCancellation/decode.cjs new file mode 100644 index 0000000..84b663d --- /dev/null +++ b/cjs/vega/commands/v1/StopOrdersCancellation/decode.cjs @@ -0,0 +1,25 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$marketId = null; + let field$stopOrderId = null; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$marketId = types.string(data); + break + + case 2: + field$stopOrderId = types.string(data); + break + } + } + return { marketId: field$marketId, stopOrderId: field$stopOrderId } +} + +exports.decode = decode; diff --git a/cjs/vega/commands/v1/StopOrdersCancellation/encode.cjs b/cjs/vega/commands/v1/StopOrdersCancellation/encode.cjs new file mode 100644 index 0000000..d775995 --- /dev/null +++ b/cjs/vega/commands/v1/StopOrdersCancellation/encode.cjs @@ -0,0 +1,21 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.marketId) writer.bytes(1, obj.marketId, types.string); + if (obj.stopOrderId) writer.bytes(2, obj.stopOrderId, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/commands/v1/StopOrdersSubmission.cjs b/cjs/vega/commands/v1/StopOrdersSubmission.cjs new file mode 100644 index 0000000..6364726 --- /dev/null +++ b/cjs/vega/commands/v1/StopOrdersSubmission.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./StopOrdersSubmission/encode.cjs'); +var decode = require('./StopOrdersSubmission/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/commands/v1/StopOrdersSubmission/decode.cjs b/cjs/vega/commands/v1/StopOrdersSubmission/decode.cjs new file mode 100644 index 0000000..d206a5e --- /dev/null +++ b/cjs/vega/commands/v1/StopOrdersSubmission/decode.cjs @@ -0,0 +1,25 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var decode$1 = require('../StopOrderSetup/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$risesAbove = null; + let field$fallsBelow = null; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$risesAbove = decode$1.decode(data); + break + + case 2: + field$fallsBelow = decode$1.decode(data); + break + } + } + return { risesAbove: field$risesAbove, fallsBelow: field$fallsBelow } +} + +exports.decode = decode; diff --git a/cjs/vega/commands/v1/StopOrdersSubmission/encode.cjs b/cjs/vega/commands/v1/StopOrdersSubmission/encode.cjs new file mode 100644 index 0000000..8c0ebef --- /dev/null +++ b/cjs/vega/commands/v1/StopOrdersSubmission/encode.cjs @@ -0,0 +1,23 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var encode$1 = require('../StopOrderSetup/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.risesAbove) + writer.bytes(1, encode$1.encode(obj.risesAbove)); + if (obj.fallsBelow) + writer.bytes(2, encode$1.encode(obj.fallsBelow)); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/commands/v1/Transaction.cjs b/cjs/vega/commands/v1/Transaction.cjs new file mode 100644 index 0000000..8203a1b --- /dev/null +++ b/cjs/vega/commands/v1/Transaction.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./Transaction/encode.cjs'); +var decode = require('./Transaction/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/commands/v1/Transaction/decode.cjs b/cjs/vega/commands/v1/Transaction/decode.cjs new file mode 100644 index 0000000..5ab72ce --- /dev/null +++ b/cjs/vega/commands/v1/Transaction/decode.cjs @@ -0,0 +1,53 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$2 = require('../Signature/decode.cjs'); +var TxVersion = require('../TxVersion.cjs'); +var decode$1 = require('../ProofOfWork/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$inputData = new Uint8Array(0); + let field$signature = {}; + let field$version = 0; + let field$pow = {}; + let field$from = null; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$inputData = types.bytes(data); + break + + case 2: + field$signature = decode$2.decode(data); + break + + case 1001: + field$from = { address: types.string(data) }; + break + + case 1002: + field$from = { pubKey: types.string(data) }; + break + + case 2000: + field$version = TxVersion.decode(data); + break + + case 3000: + field$pow = decode$1.decode(data); + break + } + } + return { + inputData: field$inputData, + signature: field$signature, + version: field$version, + pow: field$pow, + from: field$from + } +} + +exports.decode = decode; diff --git a/cjs/vega/commands/v1/Transaction/encode.cjs b/cjs/vega/commands/v1/Transaction/encode.cjs new file mode 100644 index 0000000..3a0f36e --- /dev/null +++ b/cjs/vega/commands/v1/Transaction/encode.cjs @@ -0,0 +1,32 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../Signature/encode.cjs'); +var TxVersion = require('../TxVersion.cjs'); +var encode$2 = require('../ProofOfWork/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.inputData) writer.bytes(1, obj.inputData, types.bytes); + if (obj.signature) + writer.bytes(2, encode$1.encode(obj.signature)); + if (obj.version) writer.varint(2000, obj.version, TxVersion); + if (obj.pow) writer.bytes(3000, encode$2.encode(obj.pow)); + + if (obj.from?.address ?? obj.address) + writer.bytes(1001, obj.from?.address ?? obj.address, types.string); + if (obj.from?.pubKey ?? obj.pubKey) + writer.bytes(1002, obj.from?.pubKey ?? obj.pubKey, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/commands/v1/Transfer.cjs b/cjs/vega/commands/v1/Transfer.cjs new file mode 100644 index 0000000..87b3586 --- /dev/null +++ b/cjs/vega/commands/v1/Transfer.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./Transfer/encode.cjs'); +var decode = require('./Transfer/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/commands/v1/Transfer/decode.cjs b/cjs/vega/commands/v1/Transfer/decode.cjs new file mode 100644 index 0000000..2f6ae99 --- /dev/null +++ b/cjs/vega/commands/v1/Transfer/decode.cjs @@ -0,0 +1,67 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var AccountType = require('../../../AccountType.cjs'); +var decode$2 = require('../OneOffTransfer/decode.cjs'); +var decode$1 = require('../RecurringTransfer/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$fromAccountType = 0; + let field$to = ''; + let field$toAccountType = 0; + let field$asset = ''; + let field$amount = ''; + let field$reference = ''; + let field$kind = null; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$fromAccountType = AccountType.decode(data); + break + + case 2: + field$to = types.string(data); + break + + case 3: + field$toAccountType = AccountType.decode(data); + break + + case 4: + field$asset = types.string(data); + break + + case 5: + field$amount = types.string(data); + break + + case 6: + field$reference = types.string(data); + break + + case 101: + field$kind = { oneOff: decode$2.decode(data) }; + break + + case 102: + field$kind = { + recurring: decode$1.decode(data) + }; + break + } + } + return { + fromAccountType: field$fromAccountType, + to: field$to, + toAccountType: field$toAccountType, + asset: field$asset, + amount: field$amount, + reference: field$reference, + kind: field$kind + } +} + +exports.decode = decode; diff --git a/cjs/vega/commands/v1/Transfer/encode.cjs b/cjs/vega/commands/v1/Transfer/encode.cjs new file mode 100644 index 0000000..55f6405 --- /dev/null +++ b/cjs/vega/commands/v1/Transfer/encode.cjs @@ -0,0 +1,42 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var AccountType = require('../../../AccountType.cjs'); +var encode$1 = require('../OneOffTransfer/encode.cjs'); +var encode$2 = require('../RecurringTransfer/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.fromAccountType) + writer.varint(1, obj.fromAccountType, AccountType); + if (obj.to) writer.bytes(2, obj.to, types.string); + if (obj.toAccountType) writer.varint(3, obj.toAccountType, AccountType); + if (obj.asset) writer.bytes(4, obj.asset, types.string); + if (obj.amount) writer.bytes(5, obj.amount, types.string); + if (obj.reference) writer.bytes(6, obj.reference, types.string); + + if (obj.kind?.oneOff ?? obj.oneOff) + writer.bytes( + 101, + encode$1.encode(obj.kind?.oneOff ?? obj.oneOff) + ); + if (obj.kind?.recurring ?? obj.recurring) + writer.bytes( + 102, + encode$2.encode( + obj.kind?.recurring ?? obj.recurring + ) + ); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/commands/v1/TxVersion.cjs b/cjs/vega/commands/v1/TxVersion.cjs new file mode 100644 index 0000000..8eb0d3f --- /dev/null +++ b/cjs/vega/commands/v1/TxVersion.cjs @@ -0,0 +1,70 @@ +'use strict'; + +var assert = require('nanoassert'); +var types = require('protobuf-codec/encode/types'); +var types$1 = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +const TX_VERSION_UNSPECIFIED = 0; +const TX_VERSION_V2 = 2; +const TX_VERSION_V3 = 3; + +const enumValues = new Map([ + [0, 'TX_VERSION_UNSPECIFIED'], + [2, 'TX_VERSION_V2'], + [3, 'TX_VERSION_V3'] +]); +const enumNames = new Map([ + ['TX_VERSION_UNSPECIFIED', 0], + ['TX_VERSION_V2', 2], + ['TX_VERSION_V3', 3] +]); + +function encode(value, buf, byteOffset = 0) { + if (typeof value === 'string') return encode(parse(value), buf, byteOffset) + if (value == null) throw new Error('Invalid TxVersion value (' + value + ')') + + return types.enumerable.encode(value, buf, byteOffset) +} + +function decode(varint) { + const int = types$1.enumerable(varint); + + return stringify(int) ?? int +} + +function encodingLength(value) { + if (typeof value === 'string') return encodingLength(parse(value)) + assert(value != null, 'Invalid TxVersion value (' + value + ')'); + + if (0 <= value && value <= 3) return 1 + + // enumerable max value in case of unknown value + return 5 +} + +/** + * Convert an enum value to it's human readable name. + * Returns undefined on an unknown value. + */ +function stringify(int) { + return enumValues.get(int) +} + +/** + * Convert an enum string names to it's machine integer value. + * Returns undefined on an unknown name. + */ +function parse(str) { + return enumNames.get(str) +} + +exports.TX_VERSION_UNSPECIFIED = TX_VERSION_UNSPECIFIED; +exports.TX_VERSION_V2 = TX_VERSION_V2; +exports.TX_VERSION_V3 = TX_VERSION_V3; +exports.decode = decode; +exports.encode = encode; +exports.encodingLength = encodingLength; +exports.parse = parse; +exports.stringify = stringify; diff --git a/cjs/vega/commands/v1/UndelegateSubmission.cjs b/cjs/vega/commands/v1/UndelegateSubmission.cjs new file mode 100644 index 0000000..75f3f7b --- /dev/null +++ b/cjs/vega/commands/v1/UndelegateSubmission.cjs @@ -0,0 +1,11 @@ +'use strict'; + +var encode = require('./UndelegateSubmission/encode.cjs'); +var decode = require('./UndelegateSubmission/decode.cjs'); +var Method = require('./UndelegateSubmission/Method.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; +exports.Method = Method; diff --git a/cjs/vega/commands/v1/UndelegateSubmission/Method.cjs b/cjs/vega/commands/v1/UndelegateSubmission/Method.cjs new file mode 100644 index 0000000..74ed845 --- /dev/null +++ b/cjs/vega/commands/v1/UndelegateSubmission/Method.cjs @@ -0,0 +1,70 @@ +'use strict'; + +var assert = require('nanoassert'); +var types = require('protobuf-codec/encode/types'); +var types$1 = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +const METHOD_UNSPECIFIED = 0; +const METHOD_NOW = 1; +const METHOD_AT_END_OF_EPOCH = 2; + +const enumValues = new Map([ + [0, 'METHOD_UNSPECIFIED'], + [1, 'METHOD_NOW'], + [2, 'METHOD_AT_END_OF_EPOCH'] +]); +const enumNames = new Map([ + ['METHOD_UNSPECIFIED', 0], + ['METHOD_NOW', 1], + ['METHOD_AT_END_OF_EPOCH', 2] +]); + +function encode(value, buf, byteOffset = 0) { + if (typeof value === 'string') return encode(parse(value), buf, byteOffset) + if (value == null) throw new Error('Invalid Method value (' + value + ')') + + return types.enumerable.encode(value, buf, byteOffset) +} + +function decode(varint) { + const int = types$1.enumerable(varint); + + return stringify(int) ?? int +} + +function encodingLength(value) { + if (typeof value === 'string') return encodingLength(parse(value)) + assert(value != null, 'Invalid Method value (' + value + ')'); + + if (0 <= value && value <= 2) return 1 + + // enumerable max value in case of unknown value + return 5 +} + +/** + * Convert an enum value to it's human readable name. + * Returns undefined on an unknown value. + */ +function stringify(int) { + return enumValues.get(int) +} + +/** + * Convert an enum string names to it's machine integer value. + * Returns undefined on an unknown name. + */ +function parse(str) { + return enumNames.get(str) +} + +exports.METHOD_AT_END_OF_EPOCH = METHOD_AT_END_OF_EPOCH; +exports.METHOD_NOW = METHOD_NOW; +exports.METHOD_UNSPECIFIED = METHOD_UNSPECIFIED; +exports.decode = decode; +exports.encode = encode; +exports.encodingLength = encodingLength; +exports.parse = parse; +exports.stringify = stringify; diff --git a/cjs/vega/commands/v1/UndelegateSubmission/decode.cjs b/cjs/vega/commands/v1/UndelegateSubmission/decode.cjs new file mode 100644 index 0000000..ec6de8c --- /dev/null +++ b/cjs/vega/commands/v1/UndelegateSubmission/decode.cjs @@ -0,0 +1,32 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var Method = require('./Method.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$nodeId = ''; + let field$amount = ''; + let field$method = 0; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$nodeId = types.string(data); + break + + case 2: + field$amount = types.string(data); + break + + case 3: + field$method = + Method.decode(data); + break + } + } + return { nodeId: field$nodeId, amount: field$amount, method: field$method } +} + +exports.decode = decode; diff --git a/cjs/vega/commands/v1/UndelegateSubmission/encode.cjs b/cjs/vega/commands/v1/UndelegateSubmission/encode.cjs new file mode 100644 index 0000000..8251dcc --- /dev/null +++ b/cjs/vega/commands/v1/UndelegateSubmission/encode.cjs @@ -0,0 +1,24 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var Method = require('./Method.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.nodeId) writer.bytes(1, obj.nodeId, types.string); + if (obj.amount) writer.bytes(2, obj.amount, types.string); + if (obj.method) + writer.varint(3, obj.method, Method); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/commands/v1/ValidatorHeartbeat.cjs b/cjs/vega/commands/v1/ValidatorHeartbeat.cjs new file mode 100644 index 0000000..6877949 --- /dev/null +++ b/cjs/vega/commands/v1/ValidatorHeartbeat.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./ValidatorHeartbeat/encode.cjs'); +var decode = require('./ValidatorHeartbeat/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/commands/v1/ValidatorHeartbeat/decode.cjs b/cjs/vega/commands/v1/ValidatorHeartbeat/decode.cjs new file mode 100644 index 0000000..0a0a497 --- /dev/null +++ b/cjs/vega/commands/v1/ValidatorHeartbeat/decode.cjs @@ -0,0 +1,41 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$1 = require('../Signature/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$nodeId = ''; + let field$ethereumSignature = {}; + let field$vegaSignature = {}; + let field$message = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$nodeId = types.string(data); + break + + case 2: + field$ethereumSignature = decode$1.decode(data); + break + + case 3: + field$vegaSignature = decode$1.decode(data); + break + + case 4: + field$message = types.string(data); + break + } + } + return { + nodeId: field$nodeId, + ethereumSignature: field$ethereumSignature, + vegaSignature: field$vegaSignature, + message: field$message + } +} + +exports.decode = decode; diff --git a/cjs/vega/commands/v1/ValidatorHeartbeat/encode.cjs b/cjs/vega/commands/v1/ValidatorHeartbeat/encode.cjs new file mode 100644 index 0000000..f2da498 --- /dev/null +++ b/cjs/vega/commands/v1/ValidatorHeartbeat/encode.cjs @@ -0,0 +1,26 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../Signature/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.nodeId) writer.bytes(1, obj.nodeId, types.string); + if (obj.ethereumSignature) + writer.bytes(2, encode$1.encode(obj.ethereumSignature)); + if (obj.vegaSignature) + writer.bytes(3, encode$1.encode(obj.vegaSignature)); + if (obj.message) writer.bytes(4, obj.message, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/commands/v1/VoteSubmission.cjs b/cjs/vega/commands/v1/VoteSubmission.cjs new file mode 100644 index 0000000..134fa32 --- /dev/null +++ b/cjs/vega/commands/v1/VoteSubmission.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./VoteSubmission/encode.cjs'); +var decode = require('./VoteSubmission/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/commands/v1/VoteSubmission/decode.cjs b/cjs/vega/commands/v1/VoteSubmission/decode.cjs new file mode 100644 index 0000000..69fcbe9 --- /dev/null +++ b/cjs/vega/commands/v1/VoteSubmission/decode.cjs @@ -0,0 +1,26 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var Value = require('../../../Vote/Value.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$proposalId = ''; + let field$value = 0; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$proposalId = types.string(data); + break + + case 2: + field$value = Value.decode(data); + break + } + } + return { proposalId: field$proposalId, value: field$value } +} + +exports.decode = decode; diff --git a/cjs/vega/commands/v1/VoteSubmission/encode.cjs b/cjs/vega/commands/v1/VoteSubmission/encode.cjs new file mode 100644 index 0000000..4110ad0 --- /dev/null +++ b/cjs/vega/commands/v1/VoteSubmission/encode.cjs @@ -0,0 +1,22 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var Value = require('../../../Vote/Value.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.proposalId) writer.bytes(1, obj.proposalId, types.string); + if (obj.value) writer.varint(2, obj.value, Value); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/commands/v1/WithdrawSubmission.cjs b/cjs/vega/commands/v1/WithdrawSubmission.cjs new file mode 100644 index 0000000..24d0e41 --- /dev/null +++ b/cjs/vega/commands/v1/WithdrawSubmission.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./WithdrawSubmission/encode.cjs'); +var decode = require('./WithdrawSubmission/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/commands/v1/WithdrawSubmission/decode.cjs b/cjs/vega/commands/v1/WithdrawSubmission/decode.cjs new file mode 100644 index 0000000..c80a3c8 --- /dev/null +++ b/cjs/vega/commands/v1/WithdrawSubmission/decode.cjs @@ -0,0 +1,31 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$1 = require('../../../WithdrawExt/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$amount = ''; + let field$asset = ''; + let field$ext = {}; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$amount = types.string(data); + break + + case 2: + field$asset = types.string(data); + break + + case 3: + field$ext = decode$1.decode(data); + break + } + } + return { amount: field$amount, asset: field$asset, ext: field$ext } +} + +exports.decode = decode; diff --git a/cjs/vega/commands/v1/WithdrawSubmission/encode.cjs b/cjs/vega/commands/v1/WithdrawSubmission/encode.cjs new file mode 100644 index 0000000..3414c76 --- /dev/null +++ b/cjs/vega/commands/v1/WithdrawSubmission/encode.cjs @@ -0,0 +1,23 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../../../WithdrawExt/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.amount) writer.bytes(1, obj.amount, types.string); + if (obj.asset) writer.bytes(2, obj.asset, types.string); + if (obj.ext) writer.bytes(3, encode$1.encode(obj.ext)); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/data.cjs b/cjs/vega/data.cjs new file mode 100644 index 0000000..6465e81 --- /dev/null +++ b/cjs/vega/data.cjs @@ -0,0 +1,7 @@ +'use strict'; + +var v1 = require('./data/v1.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.v1 = v1; diff --git a/cjs/vega/data/v1.cjs b/cjs/vega/data/v1.cjs new file mode 100644 index 0000000..61d089c --- /dev/null +++ b/cjs/vega/data/v1.cjs @@ -0,0 +1,23 @@ +'use strict'; + +var ETHAddress = require('./v1/ETHAddress.cjs'); +var PubKey = require('./v1/PubKey.cjs'); +var Signer = require('./v1/Signer.cjs'); +var Property = require('./v1/Property.cjs'); +var Data = require('./v1/Data.cjs'); +var ExternalData = require('./v1/ExternalData.cjs'); +var Filter = require('./v1/Filter.cjs'); +var PropertyKey = require('./v1/PropertyKey.cjs'); +var Condition = require('./v1/Condition.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.ETHAddress = ETHAddress; +exports.PubKey = PubKey; +exports.Signer = Signer; +exports.Property = Property; +exports.Data = Data; +exports.ExternalData = ExternalData; +exports.Filter = Filter; +exports.PropertyKey = PropertyKey; +exports.Condition = Condition; diff --git a/cjs/vega/data/v1/Condition.cjs b/cjs/vega/data/v1/Condition.cjs new file mode 100644 index 0000000..4de8361 --- /dev/null +++ b/cjs/vega/data/v1/Condition.cjs @@ -0,0 +1,11 @@ +'use strict'; + +var encode = require('./Condition/encode.cjs'); +var decode = require('./Condition/decode.cjs'); +var Operator = require('./Condition/Operator.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; +exports.Operator = Operator; diff --git a/cjs/vega/data/v1/Condition/Operator.cjs b/cjs/vega/data/v1/Condition/Operator.cjs new file mode 100644 index 0000000..93e0377 --- /dev/null +++ b/cjs/vega/data/v1/Condition/Operator.cjs @@ -0,0 +1,82 @@ +'use strict'; + +var assert = require('nanoassert'); +var types = require('protobuf-codec/encode/types'); +var types$1 = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +const OPERATOR_UNSPECIFIED = 0; +const OPERATOR_EQUALS = 1; +const OPERATOR_GREATER_THAN = 2; +const OPERATOR_GREATER_THAN_OR_EQUAL = 3; +const OPERATOR_LESS_THAN = 4; +const OPERATOR_LESS_THAN_OR_EQUAL = 5; + +const enumValues = new Map([ + [0, 'OPERATOR_UNSPECIFIED'], + [1, 'OPERATOR_EQUALS'], + [2, 'OPERATOR_GREATER_THAN'], + [3, 'OPERATOR_GREATER_THAN_OR_EQUAL'], + [4, 'OPERATOR_LESS_THAN'], + [5, 'OPERATOR_LESS_THAN_OR_EQUAL'] +]); +const enumNames = new Map([ + ['OPERATOR_UNSPECIFIED', 0], + ['OPERATOR_EQUALS', 1], + ['OPERATOR_GREATER_THAN', 2], + ['OPERATOR_GREATER_THAN_OR_EQUAL', 3], + ['OPERATOR_LESS_THAN', 4], + ['OPERATOR_LESS_THAN_OR_EQUAL', 5] +]); + +function encode(value, buf, byteOffset = 0) { + if (typeof value === 'string') return encode(parse(value), buf, byteOffset) + if (value == null) throw new Error('Invalid Operator value (' + value + ')') + + return types.enumerable.encode(value, buf, byteOffset) +} + +function decode(varint) { + const int = types$1.enumerable(varint); + + return stringify(int) ?? int +} + +function encodingLength(value) { + if (typeof value === 'string') return encodingLength(parse(value)) + assert(value != null, 'Invalid Operator value (' + value + ')'); + + if (0 <= value && value <= 5) return 1 + + // enumerable max value in case of unknown value + return 5 +} + +/** + * Convert an enum value to it's human readable name. + * Returns undefined on an unknown value. + */ +function stringify(int) { + return enumValues.get(int) +} + +/** + * Convert an enum string names to it's machine integer value. + * Returns undefined on an unknown name. + */ +function parse(str) { + return enumNames.get(str) +} + +exports.OPERATOR_EQUALS = OPERATOR_EQUALS; +exports.OPERATOR_GREATER_THAN = OPERATOR_GREATER_THAN; +exports.OPERATOR_GREATER_THAN_OR_EQUAL = OPERATOR_GREATER_THAN_OR_EQUAL; +exports.OPERATOR_LESS_THAN = OPERATOR_LESS_THAN; +exports.OPERATOR_LESS_THAN_OR_EQUAL = OPERATOR_LESS_THAN_OR_EQUAL; +exports.OPERATOR_UNSPECIFIED = OPERATOR_UNSPECIFIED; +exports.decode = decode; +exports.encode = encode; +exports.encodingLength = encodingLength; +exports.parse = parse; +exports.stringify = stringify; diff --git a/cjs/vega/data/v1/Condition/decode.cjs b/cjs/vega/data/v1/Condition/decode.cjs new file mode 100644 index 0000000..0d593b5 --- /dev/null +++ b/cjs/vega/data/v1/Condition/decode.cjs @@ -0,0 +1,26 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var Operator = require('./Operator.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$operator = 0; + let field$value = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$operator = Operator.decode(data); + break + + case 2: + field$value = types.string(data); + break + } + } + return { operator: field$operator, value: field$value } +} + +exports.decode = decode; diff --git a/cjs/vega/data/v1/Condition/encode.cjs b/cjs/vega/data/v1/Condition/encode.cjs new file mode 100644 index 0000000..ac4063b --- /dev/null +++ b/cjs/vega/data/v1/Condition/encode.cjs @@ -0,0 +1,23 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var Operator = require('./Operator.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.operator) + writer.varint(1, obj.operator, Operator); + if (obj.value) writer.bytes(2, obj.value, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/data/v1/Data.cjs b/cjs/vega/data/v1/Data.cjs new file mode 100644 index 0000000..0246f4f --- /dev/null +++ b/cjs/vega/data/v1/Data.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./Data/encode.cjs'); +var decode = require('./Data/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/data/v1/Data/decode.cjs b/cjs/vega/data/v1/Data/decode.cjs new file mode 100644 index 0000000..33199e8 --- /dev/null +++ b/cjs/vega/data/v1/Data/decode.cjs @@ -0,0 +1,42 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var decode$2 = require('../Signer/decode.cjs'); +var decode$1 = require('../Property/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + const field$signers = []; + const field$data = []; + const field$matchedSpecIds = []; + let field$broadcastAt = 0n; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$signers.push(decode$2.decode(data)); + break + + case 2: + field$data.push(decode$1.decode(data)); + break + + case 3: + field$matchedSpecIds.push(types.string(data)); + break + + case 4: + field$broadcastAt = types.int64(data); + break + } + } + return { + signers: field$signers, + data: field$data, + matchedSpecIds: field$matchedSpecIds, + broadcastAt: field$broadcastAt + } +} + +exports.decode = decode; diff --git a/cjs/vega/data/v1/Data/encode.cjs b/cjs/vega/data/v1/Data/encode.cjs new file mode 100644 index 0000000..74b9bcd --- /dev/null +++ b/cjs/vega/data/v1/Data/encode.cjs @@ -0,0 +1,28 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var encode$1 = require('../Signer/encode.cjs'); +var encode$2 = require('../Property/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.signers?.length) + obj.signers.forEach((v) => writer.bytes(1, encode$1.encode(v))); + if (obj.data?.length) + obj.data.forEach((v) => writer.bytes(2, encode$2.encode(v))); + if (obj.matchedSpecIds?.length) + obj.matchedSpecIds.forEach((v) => writer.bytes(3, v, types.string)); + if (obj.broadcastAt) writer.varint(4, obj.broadcastAt, types.int64); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/data/v1/ETHAddress.cjs b/cjs/vega/data/v1/ETHAddress.cjs new file mode 100644 index 0000000..6c7cd41 --- /dev/null +++ b/cjs/vega/data/v1/ETHAddress.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./ETHAddress/encode.cjs'); +var decode = require('./ETHAddress/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/data/v1/ETHAddress/decode.cjs b/cjs/vega/data/v1/ETHAddress/decode.cjs new file mode 100644 index 0000000..5720b70 --- /dev/null +++ b/cjs/vega/data/v1/ETHAddress/decode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$address = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$address = types.string(data); + break + } + } + return { address: field$address } +} + +exports.decode = decode; diff --git a/cjs/vega/data/v1/ETHAddress/encode.cjs b/cjs/vega/data/v1/ETHAddress/encode.cjs new file mode 100644 index 0000000..8a16466 --- /dev/null +++ b/cjs/vega/data/v1/ETHAddress/encode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.address) writer.bytes(1, obj.address, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/data/v1/ExternalData.cjs b/cjs/vega/data/v1/ExternalData.cjs new file mode 100644 index 0000000..7d3433a --- /dev/null +++ b/cjs/vega/data/v1/ExternalData.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./ExternalData/encode.cjs'); +var decode = require('./ExternalData/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/data/v1/ExternalData/decode.cjs b/cjs/vega/data/v1/ExternalData/decode.cjs new file mode 100644 index 0000000..2df12ae --- /dev/null +++ b/cjs/vega/data/v1/ExternalData/decode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var decode$1 = require('../Data/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$data = {}; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$data = decode$1.decode(data); + break + } + } + return { data: field$data } +} + +exports.decode = decode; diff --git a/cjs/vega/data/v1/ExternalData/encode.cjs b/cjs/vega/data/v1/ExternalData/encode.cjs new file mode 100644 index 0000000..f4d3346 --- /dev/null +++ b/cjs/vega/data/v1/ExternalData/encode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var encode$1 = require('../Data/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.data) writer.bytes(1, encode$1.encode(obj.data)); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/data/v1/Filter.cjs b/cjs/vega/data/v1/Filter.cjs new file mode 100644 index 0000000..bbbb0c0 --- /dev/null +++ b/cjs/vega/data/v1/Filter.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./Filter/encode.cjs'); +var decode = require('./Filter/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/data/v1/Filter/decode.cjs b/cjs/vega/data/v1/Filter/decode.cjs new file mode 100644 index 0000000..038d83e --- /dev/null +++ b/cjs/vega/data/v1/Filter/decode.cjs @@ -0,0 +1,26 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var decode$2 = require('../PropertyKey/decode.cjs'); +var decode$1 = require('../Condition/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$key = {}; + const field$conditions = []; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$key = decode$2.decode(data); + break + + case 2: + field$conditions.push(decode$1.decode(data)); + break + } + } + return { key: field$key, conditions: field$conditions } +} + +exports.decode = decode; diff --git a/cjs/vega/data/v1/Filter/encode.cjs b/cjs/vega/data/v1/Filter/encode.cjs new file mode 100644 index 0000000..1092dca --- /dev/null +++ b/cjs/vega/data/v1/Filter/encode.cjs @@ -0,0 +1,25 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var encode$1 = require('../PropertyKey/encode.cjs'); +var encode$2 = require('../Condition/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.key) writer.bytes(1, encode$1.encode(obj.key)); + if (obj.conditions?.length) + obj.conditions.forEach((v) => + writer.bytes(2, encode$2.encode(v)) + ); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/data/v1/Property.cjs b/cjs/vega/data/v1/Property.cjs new file mode 100644 index 0000000..502da6f --- /dev/null +++ b/cjs/vega/data/v1/Property.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./Property/encode.cjs'); +var decode = require('./Property/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/data/v1/Property/decode.cjs b/cjs/vega/data/v1/Property/decode.cjs new file mode 100644 index 0000000..4cec604 --- /dev/null +++ b/cjs/vega/data/v1/Property/decode.cjs @@ -0,0 +1,25 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$name = ''; + let field$value = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$name = types.string(data); + break + + case 2: + field$value = types.string(data); + break + } + } + return { name: field$name, value: field$value } +} + +exports.decode = decode; diff --git a/cjs/vega/data/v1/Property/encode.cjs b/cjs/vega/data/v1/Property/encode.cjs new file mode 100644 index 0000000..951f67d --- /dev/null +++ b/cjs/vega/data/v1/Property/encode.cjs @@ -0,0 +1,21 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.name) writer.bytes(1, obj.name, types.string); + if (obj.value) writer.bytes(2, obj.value, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/data/v1/PropertyKey.cjs b/cjs/vega/data/v1/PropertyKey.cjs new file mode 100644 index 0000000..7be55bd --- /dev/null +++ b/cjs/vega/data/v1/PropertyKey.cjs @@ -0,0 +1,11 @@ +'use strict'; + +var encode = require('./PropertyKey/encode.cjs'); +var decode = require('./PropertyKey/decode.cjs'); +var Type = require('./PropertyKey/Type.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; +exports.Type = Type; diff --git a/cjs/vega/data/v1/PropertyKey/Type.cjs b/cjs/vega/data/v1/PropertyKey/Type.cjs new file mode 100644 index 0000000..111cdf2 --- /dev/null +++ b/cjs/vega/data/v1/PropertyKey/Type.cjs @@ -0,0 +1,86 @@ +'use strict'; + +var assert = require('nanoassert'); +var types = require('protobuf-codec/encode/types'); +var types$1 = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +const TYPE_UNSPECIFIED = 0; +const TYPE_EMPTY = 1; +const TYPE_INTEGER = 2; +const TYPE_STRING = 3; +const TYPE_BOOLEAN = 4; +const TYPE_DECIMAL = 5; +const TYPE_TIMESTAMP = 6; + +const enumValues = new Map([ + [0, 'TYPE_UNSPECIFIED'], + [1, 'TYPE_EMPTY'], + [2, 'TYPE_INTEGER'], + [3, 'TYPE_STRING'], + [4, 'TYPE_BOOLEAN'], + [5, 'TYPE_DECIMAL'], + [6, 'TYPE_TIMESTAMP'] +]); +const enumNames = new Map([ + ['TYPE_UNSPECIFIED', 0], + ['TYPE_EMPTY', 1], + ['TYPE_INTEGER', 2], + ['TYPE_STRING', 3], + ['TYPE_BOOLEAN', 4], + ['TYPE_DECIMAL', 5], + ['TYPE_TIMESTAMP', 6] +]); + +function encode(value, buf, byteOffset = 0) { + if (typeof value === 'string') return encode(parse(value), buf, byteOffset) + if (value == null) throw new Error('Invalid Type value (' + value + ')') + + return types.enumerable.encode(value, buf, byteOffset) +} + +function decode(varint) { + const int = types$1.enumerable(varint); + + return stringify(int) ?? int +} + +function encodingLength(value) { + if (typeof value === 'string') return encodingLength(parse(value)) + assert(value != null, 'Invalid Type value (' + value + ')'); + + if (0 <= value && value <= 6) return 1 + + // enumerable max value in case of unknown value + return 5 +} + +/** + * Convert an enum value to it's human readable name. + * Returns undefined on an unknown value. + */ +function stringify(int) { + return enumValues.get(int) +} + +/** + * Convert an enum string names to it's machine integer value. + * Returns undefined on an unknown name. + */ +function parse(str) { + return enumNames.get(str) +} + +exports.TYPE_BOOLEAN = TYPE_BOOLEAN; +exports.TYPE_DECIMAL = TYPE_DECIMAL; +exports.TYPE_EMPTY = TYPE_EMPTY; +exports.TYPE_INTEGER = TYPE_INTEGER; +exports.TYPE_STRING = TYPE_STRING; +exports.TYPE_TIMESTAMP = TYPE_TIMESTAMP; +exports.TYPE_UNSPECIFIED = TYPE_UNSPECIFIED; +exports.decode = decode; +exports.encode = encode; +exports.encodingLength = encodingLength; +exports.parse = parse; +exports.stringify = stringify; diff --git a/cjs/vega/data/v1/PropertyKey/decode.cjs b/cjs/vega/data/v1/PropertyKey/decode.cjs new file mode 100644 index 0000000..7262489 --- /dev/null +++ b/cjs/vega/data/v1/PropertyKey/decode.cjs @@ -0,0 +1,35 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); +var Type = require('./Type.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$name = ''; + let field$type = 0; + let field$numberDecimalPlaces = null; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$name = types.string(data); + break + + case 2: + field$type = Type.decode(data); + break + + case 3: + field$numberDecimalPlaces = types.uint64(data); + break + } + } + return { + name: field$name, + type: field$type, + numberDecimalPlaces: field$numberDecimalPlaces + } +} + +exports.decode = decode; diff --git a/cjs/vega/data/v1/PropertyKey/encode.cjs b/cjs/vega/data/v1/PropertyKey/encode.cjs new file mode 100644 index 0000000..e227d70 --- /dev/null +++ b/cjs/vega/data/v1/PropertyKey/encode.cjs @@ -0,0 +1,23 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); +var Type = require('./Type.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.name) writer.bytes(1, obj.name, types.string); + if (obj.type) writer.varint(2, obj.type, Type); + if (obj.numberDecimalPlaces) writer.varint(3, obj.numberDecimalPlaces, types.uint64); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/data/v1/PubKey.cjs b/cjs/vega/data/v1/PubKey.cjs new file mode 100644 index 0000000..fdd00ed --- /dev/null +++ b/cjs/vega/data/v1/PubKey.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./PubKey/encode.cjs'); +var decode = require('./PubKey/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/data/v1/PubKey/decode.cjs b/cjs/vega/data/v1/PubKey/decode.cjs new file mode 100644 index 0000000..16f45c2 --- /dev/null +++ b/cjs/vega/data/v1/PubKey/decode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var types = require('protobuf-codec/decode/types'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$key = ''; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$key = types.string(data); + break + } + } + return { key: field$key } +} + +exports.decode = decode; diff --git a/cjs/vega/data/v1/PubKey/encode.cjs b/cjs/vega/data/v1/PubKey/encode.cjs new file mode 100644 index 0000000..7e5ed2f --- /dev/null +++ b/cjs/vega/data/v1/PubKey/encode.cjs @@ -0,0 +1,20 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var types = require('protobuf-codec/encode/types'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.key) writer.bytes(1, obj.key, types.string); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/cjs/vega/data/v1/Signer.cjs b/cjs/vega/data/v1/Signer.cjs new file mode 100644 index 0000000..457f58b --- /dev/null +++ b/cjs/vega/data/v1/Signer.cjs @@ -0,0 +1,9 @@ +'use strict'; + +var encode = require('./Signer/encode.cjs'); +var decode = require('./Signer/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +exports.encode = encode.encode; +exports.decode = decode.decode; diff --git a/cjs/vega/data/v1/Signer/decode.cjs b/cjs/vega/data/v1/Signer/decode.cjs new file mode 100644 index 0000000..f27ebaf --- /dev/null +++ b/cjs/vega/data/v1/Signer/decode.cjs @@ -0,0 +1,25 @@ +'use strict'; + +var reader = require('protobuf-codec/decode/reader'); +var decode$2 = require('../PubKey/decode.cjs'); +var decode$1 = require('../ETHAddress/decode.cjs'); + +/// autogenerated by protoc-plugin-js + +function decode(buf, byteOffset = 0, byteLength = buf.byteLength) { + let field$signer = null; + for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { + switch (field) { + case 1: + field$signer = { pubKey: decode$2.decode(data) }; + break + + case 2: + field$signer = { ethAddress: decode$1.decode(data) }; + break + } + } + return { signer: field$signer } +} + +exports.decode = decode; diff --git a/cjs/vega/data/v1/Signer/encode.cjs b/cjs/vega/data/v1/Signer/encode.cjs new file mode 100644 index 0000000..4676bff --- /dev/null +++ b/cjs/vega/data/v1/Signer/encode.cjs @@ -0,0 +1,30 @@ +'use strict'; + +var Writer = require('protobuf-codec/encode/writer'); +var encode$1 = require('../PubKey/encode.cjs'); +var encode$2 = require('../ETHAddress/encode.cjs'); + +/// autogenerated by protoc-plugin-js + +function encode(obj = {}, buf, byteOffset = 0) { + const writer = new Writer(); + + if (obj.signer?.pubKey ?? obj.pubKey) + writer.bytes( + 1, + encode$1.encode(obj.signer?.pubKey ?? obj.pubKey) + ); + if (obj.signer?.ethAddress ?? obj.ethAddress) + writer.bytes( + 2, + encode$2.encode(obj.signer?.ethAddress ?? obj.ethAddress) + ); + + return writer.concat(buf, byteOffset) +} + +// export function encodingLength (obj) { +// throw new Error('Unimplemented') +// } + +exports.encode = encode; diff --git a/package.json b/package.json index 9cc9b1e..960585c 100644 --- a/package.json +++ b/package.json @@ -6,11 +6,21 @@ "types": "dist/index.d.ts", "type": "module", "exports": { - ".": "./dist/index.js", - "./*": "./dist/*.js", - "./*.js": "./dist/*.js" + ".": { + "import": "./dist/index.js", + "require": "./cjs/index.cjs" + }, + "./*": { + "import": "./dist/*.js", + "require": "./cjs/*.cjs" + }, + "./*.js": { + "import": "./dist/*.js", + "require": "./cjs/*.cjs" + } }, "scripts": { + "bundle": "rollup -c", "test": "true" }, "repository": { @@ -28,10 +38,14 @@ "type-fest": "^3.6.0" }, "devDependencies": { + "@babel/preset-env": "^7.20.2", + "@rollup/plugin-commonjs": "^24.0.1", + "@rollup/plugin-node-resolve": "^15.0.1", "@vegaprotocol/crypto": "^0.5.1", "esbuild": "^0.17.8", "got": "^12.4.1", "protoc-plugin-js": "^0.3.0", + "rollup": "^3.10.1", "typescript": "^4.7.4" } } diff --git a/rollup.config.js b/rollup.config.js new file mode 100644 index 0000000..adb8b97 --- /dev/null +++ b/rollup.config.js @@ -0,0 +1,26 @@ +import { nodeResolve } from '@rollup/plugin-node-resolve' +import commonjs from '@rollup/plugin-commonjs' + +export default [ + { + external: [ + /node_modules/ + ], + input: [ + 'dist/index.js', + ], + output: [ + { + dir: 'cjs', + format: 'cjs', + preserveModules: true, + preserveModulesRoot: 'lib', + entryFileNames: '[name].cjs' + } + ], + plugins: [ + nodeResolve(), + commonjs() + ] + } +]