From a9896e0b4fde33d1d6dfd0341dbeace82896b3a0 Mon Sep 17 00:00:00 2001 From: jpe7s Date: Sun, 11 Aug 2024 14:39:26 -0500 Subject: [PATCH] remove spaces on blank lines. --- build.gradle | 4 +- .../programs/drift/anchor/DriftProgram.java | 274 +++++++++--------- .../programs/drift/anchor/types/AMM.java | 2 +- .../drift/anchor/types/CurveRecord.java | 2 +- .../drift/anchor/types/DepositRecord.java | 2 +- .../drift/anchor/types/FeeStructure.java | 2 +- .../programs/drift/anchor/types/FeeTier.java | 2 +- .../anchor/types/FundingPaymentRecord.java | 2 +- .../drift/anchor/types/FundingRateRecord.java | 2 +- .../anchor/types/HistoricalIndexData.java | 2 +- .../anchor/types/HistoricalOracleData.java | 2 +- .../drift/anchor/types/InsuranceClaim.java | 2 +- .../drift/anchor/types/InsuranceFund.java | 2 +- .../anchor/types/InsuranceFundRecord.java | 2 +- .../anchor/types/InsuranceFundStake.java | 26 +- .../types/InsuranceFundStakeRecord.java | 2 +- .../programs/drift/anchor/types/LPRecord.java | 2 +- .../LiquidateBorrowForPerpPnlRecord.java | 2 +- .../LiquidatePerpPnlForDepositRecord.java | 2 +- .../anchor/types/LiquidatePerpRecord.java | 2 +- .../anchor/types/LiquidateSpotRecord.java | 2 +- .../drift/anchor/types/LiquidationRecord.java | 2 +- .../anchor/types/MarginCalculationMode.java | 12 +- .../drift/anchor/types/MarketIdentifier.java | 2 +- .../drift/anchor/types/ModifyOrderId.java | 12 +- .../drift/anchor/types/ModifyOrderParams.java | 2 +- .../drift/anchor/types/NewUserRecord.java | 2 +- .../drift/anchor/types/OracleGuardRails.java | 2 +- .../programs/drift/anchor/types/Order.java | 2 +- .../drift/anchor/types/OrderActionRecord.java | 2 +- .../types/OrderFillerRewardStructure.java | 2 +- .../drift/anchor/types/OrderParams.java | 2 +- .../drift/anchor/types/OrderRecord.java | 2 +- .../anchor/types/PerpBankruptcyRecord.java | 2 +- .../anchor/types/PerpFulfillmentMethod.java | 18 +- .../drift/anchor/types/PerpMarket.java | 12 +- .../drift/anchor/types/PerpPosition.java | 2 +- .../types/PhoenixV1FulfillmentConfig.java | 26 +- .../drift/anchor/types/PoolBalance.java | 2 +- .../drift/anchor/types/PrelaunchOracle.java | 20 +- .../anchor/types/PrelaunchOracleParams.java | 2 +- .../types/PriceDivergenceGuardRails.java | 2 +- .../types/ProtocolIfSharesTransferConfig.java | 14 +- .../drift/anchor/types/ReferrerName.java | 14 +- .../types/SerumV3FulfillmentConfig.java | 36 +-- .../drift/anchor/types/SettlePnlRecord.java | 2 +- .../anchor/types/SpotBankruptcyRecord.java | 2 +- .../anchor/types/SpotFulfillmentMethod.java | 16 +- .../anchor/types/SpotInterestRecord.java | 2 +- .../drift/anchor/types/SpotMarket.java | 18 +- .../drift/anchor/types/SpotPosition.java | 2 +- .../programs/drift/anchor/types/State.java | 56 ++-- .../drift/anchor/types/SwapRecord.java | 2 +- .../UpdatePerpMarketSummaryStatsParams.java | 2 +- .../programs/drift/anchor/types/User.java | 12 +- .../programs/drift/anchor/types/UserFees.java | 2 +- .../drift/anchor/types/UserStats.java | 14 +- .../anchor/types/ValidityGuardRails.java | 2 +- .../programs/glam/anchor/GlamProgram.java | 36 +-- .../programs/glam/anchor/types/Acl.java | 2 +- .../glam/anchor/types/CompanyField.java | 2 +- .../glam/anchor/types/CompanyModel.java | 2 +- .../glam/anchor/types/CreatedModel.java | 2 +- .../glam/anchor/types/EngineField.java | 2 +- .../glam/anchor/types/EngineFieldValue.java | 90 +++--- .../glam/anchor/types/FundAccount.java | 10 +- .../programs/glam/anchor/types/FundField.java | 2 +- .../glam/anchor/types/FundManagerField.java | 2 +- .../anchor/types/FundMetadataAccount.java | 10 +- .../programs/glam/anchor/types/FundModel.java | 2 +- .../glam/anchor/types/FundOpenfundsModel.java | 2 +- .../glam/anchor/types/ManagerModel.java | 2 +- .../glam/anchor/types/ShareClassField.java | 2 +- .../glam/anchor/types/ShareClassModel.java | 2 +- .../types/ShareClassOpenfundsModel.java | 2 +- .../anchor/MarinadeFinanceProgram.java | 50 ++-- .../anchor/types/AddLiquidityEvent.java | 2 +- .../anchor/types/AddValidatorEvent.java | 2 +- .../anchor/types/BoolValueChange.java | 2 +- .../anchor/types/ChangeAuthorityData.java | 2 +- .../anchor/types/ChangeAuthorityEvent.java | 2 +- .../marinade/anchor/types/ClaimEvent.java | 2 +- .../marinade/anchor/types/ConfigLpEvent.java | 2 +- .../marinade/anchor/types/ConfigLpParams.java | 2 +- .../anchor/types/ConfigMarinadeEvent.java | 2 +- .../anchor/types/ConfigMarinadeParams.java | 2 +- .../anchor/types/DeactivateStakeEvent.java | 2 +- .../marinade/anchor/types/DepositEvent.java | 2 +- .../types/DepositStakeAccountEvent.java | 2 +- .../anchor/types/EmergencyPauseEvent.java | 2 +- .../programs/marinade/anchor/types/Fee.java | 2 +- .../marinade/anchor/types/FeeCents.java | 2 +- .../anchor/types/FeeCentsValueChange.java | 2 +- .../marinade/anchor/types/FeeValueChange.java | 2 +- .../marinade/anchor/types/InitializeData.java | 2 +- .../anchor/types/InitializeEvent.java | 2 +- .../marinade/anchor/types/LiqPool.java | 2 +- .../anchor/types/LiqPoolInitializeData.java | 2 +- .../anchor/types/LiquidUnstakeEvent.java | 2 +- .../programs/marinade/anchor/types/List.java | 2 +- .../anchor/types/MergeStakesEvent.java | 2 +- .../anchor/types/OrderUnstakeEvent.java | 2 +- .../anchor/types/PubkeyValueChange.java | 2 +- .../anchor/types/ReallocStakeListEvent.java | 2 +- .../types/ReallocValidatorListEvent.java | 2 +- .../anchor/types/RedelegateEvent.java | 2 +- .../anchor/types/RemoveLiquidityEvent.java | 2 +- .../anchor/types/RemoveValidatorEvent.java | 2 +- .../marinade/anchor/types/ResumeEvent.java | 2 +- .../anchor/types/SetValidatorScoreEvent.java | 2 +- .../anchor/types/SplitStakeAccountInfo.java | 2 +- .../marinade/anchor/types/StakeList.java | 8 +- .../marinade/anchor/types/StakeRecord.java | 2 +- .../anchor/types/StakeReserveEvent.java | 2 +- .../marinade/anchor/types/StakeSystem.java | 2 +- .../programs/marinade/anchor/types/State.java | 24 +- .../anchor/types/TicketAccountData.java | 16 +- .../marinade/anchor/types/U32ValueChange.java | 2 +- .../marinade/anchor/types/U64ValueChange.java | 2 +- .../anchor/types/UpdateActiveEvent.java | 2 +- .../anchor/types/UpdateDeactivatedEvent.java | 2 +- .../marinade/anchor/types/ValidatorList.java | 8 +- .../anchor/types/ValidatorRecord.java | 2 +- .../anchor/types/ValidatorSystem.java | 2 +- .../types/WithdrawStakeAccountEvent.java | 2 +- 125 files changed, 517 insertions(+), 517 deletions(-) diff --git a/build.gradle b/build.gradle index 64e2f87..9c528d0 100644 --- a/build.gradle +++ b/build.gradle @@ -35,8 +35,8 @@ ext { VCS_URL = 'https://github.com/sava-software/anchor-programs' jsoniter = '2.11.+' sava = '1.0.+' - sava_solana_programs = '1.0.2' - sava_anchor_src_gen = '1.0.3' + sava_solana_programs = '1.0.3' + sava_anchor_src_gen = '1.0.4' bouncycastleMinor = 'jdk18on' bouncycastlePatch = '1.78.1' // https://www.bouncycastle.org/latest_releases.html#LATEST } diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/DriftProgram.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/DriftProgram.java index 59c449b..90d5298 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/DriftProgram.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/DriftProgram.java @@ -65,7 +65,7 @@ public static Instruction initializeUser(final AccountMeta invokedDriftProgramMe putInt16LE(_data, i, subAccountId); i += 2; Borsh.fixedWrite(name, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -114,7 +114,7 @@ public static Instruction initializeReferrerName(final AccountMeta invokedDriftP final byte[] _data = new byte[8 + Borsh.fixedLen(name)]; int i = writeDiscriminator(INITIALIZE_REFERRER_NAME_DISCRIMINATOR, _data, 0); Borsh.fixedWrite(name, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -148,7 +148,7 @@ public static Instruction deposit(final AccountMeta invokedDriftProgramMeta, putInt64LE(_data, i, amount); i += 8; _data[i] = (byte) (reduceOnly ? 1 : 0); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -184,7 +184,7 @@ public static Instruction withdraw(final AccountMeta invokedDriftProgramMeta, putInt64LE(_data, i, amount); i += 8; _data[i] = (byte) (reduceOnly ? 1 : 0); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -213,7 +213,7 @@ public static Instruction transferDeposit(final AccountMeta invokedDriftProgramM putInt16LE(_data, i, marketIndex); i += 2; putInt64LE(_data, i, amount); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -233,7 +233,7 @@ public static Instruction placePerpOrder(final AccountMeta invokedDriftProgramMe final byte[] _data = new byte[8 + Borsh.len(params)]; int i = writeDiscriminator(PLACE_PERP_ORDER_DISCRIMINATOR, _data, 0); Borsh.write(params, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -253,7 +253,7 @@ public static Instruction cancelOrder(final AccountMeta invokedDriftProgramMeta, final byte[] _data = new byte[13]; int i = writeDiscriminator(CANCEL_ORDER_DISCRIMINATOR, _data, 0); Borsh.writeOptional(orderId, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -273,7 +273,7 @@ public static Instruction cancelOrderByUserId(final AccountMeta invokedDriftProg final byte[] _data = new byte[9]; int i = writeDiscriminator(CANCEL_ORDER_BY_USER_ID_DISCRIMINATOR, _data, 0); _data[i] = (byte) userOrderId; - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -297,7 +297,7 @@ public static Instruction cancelOrders(final AccountMeta invokedDriftProgramMeta i += Borsh.writeOptional(marketType, _data, i); i += Borsh.writeOptional(marketIndex, _data, i); Borsh.writeOptional(direction, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -317,7 +317,7 @@ public static Instruction cancelOrdersByIds(final AccountMeta invokedDriftProgra final byte[] _data = new byte[8 + Borsh.len(orderIds)]; int i = writeDiscriminator(CANCEL_ORDERS_BY_IDS_DISCRIMINATOR, _data, 0); Borsh.write(orderIds, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -339,7 +339,7 @@ public static Instruction modifyOrder(final AccountMeta invokedDriftProgramMeta, int i = writeDiscriminator(MODIFY_ORDER_DISCRIMINATOR, _data, 0); i += Borsh.writeOptional(orderId, _data, i); Borsh.write(modifyOrderParams, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -362,7 +362,7 @@ public static Instruction modifyOrderByUserId(final AccountMeta invokedDriftProg _data[i] = (byte) userOrderId; ++i; Borsh.write(modifyOrderParams, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -386,7 +386,7 @@ public static Instruction placeAndTakePerpOrder(final AccountMeta invokedDriftPr int i = writeDiscriminator(PLACE_AND_TAKE_PERP_ORDER_DISCRIMINATOR, _data, 0); i += Borsh.write(params, _data, i); Borsh.writeOptional(makerOrderId, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -414,7 +414,7 @@ public static Instruction placeAndMakePerpOrder(final AccountMeta invokedDriftPr int i = writeDiscriminator(PLACE_AND_MAKE_PERP_ORDER_DISCRIMINATOR, _data, 0); i += Borsh.write(params, _data, i); putInt32LE(_data, i, takerOrderId); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -434,7 +434,7 @@ public static Instruction placeSpotOrder(final AccountMeta invokedDriftProgramMe final byte[] _data = new byte[8 + Borsh.len(params)]; int i = writeDiscriminator(PLACE_SPOT_ORDER_DISCRIMINATOR, _data, 0); Borsh.write(params, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -460,7 +460,7 @@ public static Instruction placeAndTakeSpotOrder(final AccountMeta invokedDriftPr i += Borsh.write(params, _data, i); i += Borsh.writeOptional(fulfillmentType, _data, i); Borsh.writeOptional(makerOrderId, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -491,7 +491,7 @@ public static Instruction placeAndMakeSpotOrder(final AccountMeta invokedDriftPr putInt32LE(_data, i, takerOrderId); i += 4; Borsh.writeOptional(fulfillmentType, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -511,7 +511,7 @@ public static Instruction placeOrders(final AccountMeta invokedDriftProgramMeta, final byte[] _data = new byte[8 + Borsh.len(params)]; int i = writeDiscriminator(PLACE_ORDERS_DISCRIMINATOR, _data, 0); Borsh.write(params, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -554,7 +554,7 @@ public static Instruction beginSwap(final AccountMeta invokedDriftProgramMeta, putInt16LE(_data, i, outMarketIndex); i += 2; putInt64LE(_data, i, amountIn); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -599,7 +599,7 @@ public static Instruction endSwap(final AccountMeta invokedDriftProgramMeta, i += 2; i += Borsh.writeOptional(limitPrice, _data, i); Borsh.writeOptional(reduceOnly, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -622,7 +622,7 @@ public static Instruction addPerpLpShares(final AccountMeta invokedDriftProgramM putInt64LE(_data, i, nShares); i += 8; putInt16LE(_data, i, marketIndex); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -645,7 +645,7 @@ public static Instruction removePerpLpShares(final AccountMeta invokedDriftProgr putInt64LE(_data, i, sharesToBurn); i += 8; putInt16LE(_data, i, marketIndex); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -666,7 +666,7 @@ public static Instruction removePerpLpSharesInExpiringMarket(final AccountMeta i putInt64LE(_data, i, sharesToBurn); i += 8; putInt16LE(_data, i, marketIndex); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -687,7 +687,7 @@ public static Instruction updateUserName(final AccountMeta invokedDriftProgramMe putInt16LE(_data, i, subAccountId); i += 2; Borsh.fixedWrite(name, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -708,7 +708,7 @@ public static Instruction updateUserCustomMarginRatio(final AccountMeta invokedD putInt16LE(_data, i, subAccountId); i += 2; putInt32LE(_data, i, marginRatio); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -729,7 +729,7 @@ public static Instruction updateUserMarginTradingEnabled(final AccountMeta invok putInt16LE(_data, i, subAccountId); i += 2; _data[i] = (byte) (marginTradingEnabled ? 1 : 0); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -750,7 +750,7 @@ public static Instruction updateUserDelegate(final AccountMeta invokedDriftProgr putInt16LE(_data, i, subAccountId); i += 2; delegate.write(_data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -771,7 +771,7 @@ public static Instruction updateUserReduceOnly(final AccountMeta invokedDriftPro putInt16LE(_data, i, subAccountId); i += 2; _data[i] = (byte) (reduceOnly ? 1 : 0); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -792,7 +792,7 @@ public static Instruction updateUserAdvancedLp(final AccountMeta invokedDriftPro putInt16LE(_data, i, subAccountId); i += 2; _data[i] = (byte) (advancedLp ? 1 : 0); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -856,7 +856,7 @@ public static Instruction fillPerpOrder(final AccountMeta invokedDriftProgramMet int i = writeDiscriminator(FILL_PERP_ORDER_DISCRIMINATOR, _data, 0); i += Borsh.writeOptional(orderId, _data, i); Borsh.writeOptional(makerOrderId, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -903,7 +903,7 @@ public static Instruction fillSpotOrder(final AccountMeta invokedDriftProgramMet i += Borsh.writeOptional(orderId, _data, i); i += Borsh.writeOptional(fulfillmentType, _data, i); Borsh.writeOptional(makerOrderId, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -925,7 +925,7 @@ public static Instruction triggerOrder(final AccountMeta invokedDriftProgramMeta final byte[] _data = new byte[12]; int i = writeDiscriminator(TRIGGER_ORDER_DISCRIMINATOR, _data, 0); putInt32LE(_data, i, orderId); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -996,7 +996,7 @@ public static Instruction adminDisableUpdatePerpBidAskTwap(final AccountMeta inv final byte[] _data = new byte[9]; int i = writeDiscriminator(ADMIN_DISABLE_UPDATE_PERP_BID_ASK_TWAP_DISCRIMINATOR, _data, 0); _data[i] = (byte) (disable ? 1 : 0); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -1018,7 +1018,7 @@ public static Instruction settlePnl(final AccountMeta invokedDriftProgramMeta, final byte[] _data = new byte[10]; int i = writeDiscriminator(SETTLE_PNL_DISCRIMINATOR, _data, 0); putInt16LE(_data, i, marketIndex); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -1042,7 +1042,7 @@ public static Instruction settleMultiplePnls(final AccountMeta invokedDriftProgr int i = writeDiscriminator(SETTLE_MULTIPLE_PNLS_DISCRIMINATOR, _data, 0); i += Borsh.write(marketIndexes, _data, i); Borsh.write(mode, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -1071,7 +1071,7 @@ public static Instruction settleLp(final AccountMeta invokedDriftProgramMeta, final byte[] _data = new byte[10]; int i = writeDiscriminator(SETTLE_LP_DISCRIMINATOR, _data, 0); putInt16LE(_data, i, marketIndex); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -1089,7 +1089,7 @@ public static Instruction settleExpiredMarket(final AccountMeta invokedDriftProg final byte[] _data = new byte[10]; int i = writeDiscriminator(SETTLE_EXPIRED_MARKET_DISCRIMINATOR, _data, 0); putInt16LE(_data, i, marketIndex); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -1121,7 +1121,7 @@ public static Instruction liquidatePerp(final AccountMeta invokedDriftProgramMet putInt64LE(_data, i, liquidatorMaxBaseAssetAmount); i += 8; Borsh.writeOptional(limitPrice, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -1156,7 +1156,7 @@ public static Instruction liquidateSpot(final AccountMeta invokedDriftProgramMet putInt128LE(_data, i, liquidatorMaxLiabilityTransfer); i += 16; Borsh.writeOptional(limitPrice, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -1191,7 +1191,7 @@ public static Instruction liquidateBorrowForPerpPnl(final AccountMeta invokedDri putInt128LE(_data, i, liquidatorMaxLiabilityTransfer); i += 16; Borsh.writeOptional(limitPrice, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -1226,7 +1226,7 @@ public static Instruction liquidatePerpPnlForDeposit(final AccountMeta invokedDr putInt128LE(_data, i, liquidatorMaxPnlTransfer); i += 16; Borsh.writeOptional(limitPrice, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -1255,7 +1255,7 @@ public static Instruction resolvePerpPnlDeficit(final AccountMeta invokedDriftPr putInt16LE(_data, i, spotMarketIndex); i += 2; putInt16LE(_data, i, perpMarketIndex); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -1292,7 +1292,7 @@ public static Instruction resolvePerpBankruptcy(final AccountMeta invokedDriftPr putInt16LE(_data, i, quoteSpotMarketIndex); i += 2; putInt16LE(_data, i, marketIndex); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -1326,7 +1326,7 @@ public static Instruction resolveSpotBankruptcy(final AccountMeta invokedDriftPr final byte[] _data = new byte[10]; int i = writeDiscriminator(RESOLVE_SPOT_BANKRUPTCY_DISCRIMINATOR, _data, 0); putInt16LE(_data, i, marketIndex); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -1352,7 +1352,7 @@ public static Instruction settleRevenueToInsuranceFund(final AccountMeta invoked final byte[] _data = new byte[10]; int i = writeDiscriminator(SETTLE_REVENUE_TO_INSURANCE_FUND_DISCRIMINATOR, _data, 0); putInt16LE(_data, i, spotMarketIndex); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -1372,7 +1372,7 @@ public static Instruction updateFundingRate(final AccountMeta invokedDriftProgra final byte[] _data = new byte[10]; int i = writeDiscriminator(UPDATE_FUNDING_RATE_DISCRIMINATOR, _data, 0); putInt16LE(_data, i, marketIndex); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -1441,7 +1441,7 @@ public static Instruction updateAmms(final AccountMeta invokedDriftProgramMeta, final byte[] _data = new byte[8 + Borsh.fixedLen(marketIndexes)]; int i = writeDiscriminator(UPDATE_AMMS_DISCRIMINATOR, _data, 0); Borsh.fixedWrite(marketIndexes, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -1461,7 +1461,7 @@ public static Instruction updateSpotMarketExpiry(final AccountMeta invokedDriftP final byte[] _data = new byte[16]; int i = writeDiscriminator(UPDATE_SPOT_MARKET_EXPIRY_DISCRIMINATOR, _data, 0); putInt64LE(_data, i, expiryTs); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -1512,7 +1512,7 @@ public static Instruction initializeInsuranceFundStake(final AccountMeta invoked final byte[] _data = new byte[10]; int i = writeDiscriminator(INITIALIZE_INSURANCE_FUND_STAKE_DISCRIMINATOR, _data, 0); putInt16LE(_data, i, marketIndex); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -1549,7 +1549,7 @@ public static Instruction addInsuranceFundStake(final AccountMeta invokedDriftPr putInt16LE(_data, i, marketIndex); i += 2; putInt64LE(_data, i, amount); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -1576,7 +1576,7 @@ public static Instruction requestRemoveInsuranceFundStake(final AccountMeta invo putInt16LE(_data, i, marketIndex); i += 2; putInt64LE(_data, i, amount); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -1600,7 +1600,7 @@ public static Instruction cancelRequestRemoveInsuranceFundStake(final AccountMet final byte[] _data = new byte[10]; int i = writeDiscriminator(CANCEL_REQUEST_REMOVE_INSURANCE_FUND_STAKE_DISCRIMINATOR, _data, 0); putInt16LE(_data, i, marketIndex); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -1632,7 +1632,7 @@ public static Instruction removeInsuranceFundStake(final AccountMeta invokedDrif final byte[] _data = new byte[10]; int i = writeDiscriminator(REMOVE_INSURANCE_FUND_STAKE_DISCRIMINATOR, _data, 0); putInt16LE(_data, i, marketIndex); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -1665,7 +1665,7 @@ public static Instruction transferProtocolIfShares(final AccountMeta invokedDrif putInt16LE(_data, i, marketIndex); i += 2; putInt128LE(_data, i, shares); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -1689,7 +1689,7 @@ public static Instruction updatePythPullOracle(final AccountMeta invokedDriftPro int i = writeDiscriminator(UPDATE_PYTH_PULL_ORACLE_DISCRIMINATOR, _data, 0); i += Borsh.fixedWrite(feedId, _data, i); Borsh.write(params, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -1713,7 +1713,7 @@ public static Instruction postPythPullOracleUpdateAtomic(final AccountMeta invok int i = writeDiscriminator(POST_PYTH_PULL_ORACLE_UPDATE_ATOMIC_DISCRIMINATOR, _data, 0); i += Borsh.fixedWrite(feedId, _data, i); Borsh.write(params, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -1824,7 +1824,7 @@ public static Instruction initializeSpotMarket(final AccountMeta invokedDriftPro putInt32LE(_data, i, ifTotalFactor); i += 4; Borsh.fixedWrite(name, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -1852,7 +1852,7 @@ public static Instruction deleteInitializedSpotMarket(final AccountMeta invokedD final byte[] _data = new byte[10]; int i = writeDiscriminator(DELETE_INITIALIZED_SPOT_MARKET_DISCRIMINATOR, _data, 0); putInt16LE(_data, i, marketIndex); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -1888,7 +1888,7 @@ public static Instruction initializeSerumFulfillmentConfig(final AccountMeta inv final byte[] _data = new byte[10]; int i = writeDiscriminator(INITIALIZE_SERUM_FULFILLMENT_CONFIG_DISCRIMINATOR, _data, 0); putInt16LE(_data, i, marketIndex); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -1908,7 +1908,7 @@ public static Instruction updateSerumFulfillmentConfigStatus(final AccountMeta i final byte[] _data = new byte[8 + Borsh.len(status)]; int i = writeDiscriminator(UPDATE_SERUM_FULFILLMENT_CONFIG_STATUS_DISCRIMINATOR, _data, 0); Borsh.write(status, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -1942,7 +1942,7 @@ public static Instruction initializePhoenixFulfillmentConfig(final AccountMeta i final byte[] _data = new byte[10]; int i = writeDiscriminator(INITIALIZE_PHOENIX_FULFILLMENT_CONFIG_DISCRIMINATOR, _data, 0); putInt16LE(_data, i, marketIndex); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -1962,7 +1962,7 @@ public static Instruction phoenixFulfillmentConfigStatus(final AccountMeta invok final byte[] _data = new byte[8 + Borsh.len(status)]; int i = writeDiscriminator(PHOENIX_FULFILLMENT_CONFIG_STATUS_DISCRIMINATOR, _data, 0); Borsh.write(status, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -2073,7 +2073,7 @@ public static Instruction initializePerpMarket(final AccountMeta invokedDriftPro _data[i] = (byte) ammJitIntensity; ++i; Borsh.fixedWrite(name, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -2093,7 +2093,7 @@ public static Instruction deleteInitializedPerpMarket(final AccountMeta invokedD final byte[] _data = new byte[10]; int i = writeDiscriminator(DELETE_INITIALIZED_PERP_MARKET_DISCRIMINATOR, _data, 0); putInt16LE(_data, i, marketIndex); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -2119,7 +2119,7 @@ public static Instruction moveAmmPrice(final AccountMeta invokedDriftProgramMeta putInt128LE(_data, i, quoteAssetReserve); i += 16; putInt128LE(_data, i, sqrtK); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -2142,7 +2142,7 @@ public static Instruction recenterPerpMarketAmm(final AccountMeta invokedDriftPr putInt128LE(_data, i, pegMultiplier); i += 16; putInt128LE(_data, i, sqrtK); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -2166,7 +2166,7 @@ public static Instruction updatePerpMarketAmmSummaryStats(final AccountMeta invo final byte[] _data = new byte[8 + Borsh.len(params)]; int i = writeDiscriminator(UPDATE_PERP_MARKET_AMM_SUMMARY_STATS_DISCRIMINATOR, _data, 0); Borsh.write(params, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -2186,7 +2186,7 @@ public static Instruction updatePerpMarketExpiry(final AccountMeta invokedDriftP final byte[] _data = new byte[16]; int i = writeDiscriminator(UPDATE_PERP_MARKET_EXPIRY_DISCRIMINATOR, _data, 0); putInt64LE(_data, i, expiryTs); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -2233,7 +2233,7 @@ public static Instruction depositIntoPerpMarketFeePool(final AccountMeta invoked final byte[] _data = new byte[16]; int i = writeDiscriminator(DEPOSIT_INTO_PERP_MARKET_FEE_POOL_DISCRIMINATOR, _data, 0); putInt64LE(_data, i, amount); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -2259,7 +2259,7 @@ public static Instruction depositIntoSpotMarketRevenuePool(final AccountMeta inv final byte[] _data = new byte[16]; int i = writeDiscriminator(DEPOSIT_INTO_SPOT_MARKET_REVENUE_POOL_DISCRIMINATOR, _data, 0); putInt64LE(_data, i, amount); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -2281,7 +2281,7 @@ public static Instruction repegAmmCurve(final AccountMeta invokedDriftProgramMet final byte[] _data = new byte[24]; int i = writeDiscriminator(REPEG_AMM_CURVE_DISCRIMINATOR, _data, 0); putInt128LE(_data, i, newPegCandidate); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -2337,7 +2337,7 @@ public static Instruction updateK(final AccountMeta invokedDriftProgramMeta, final byte[] _data = new byte[24]; int i = writeDiscriminator(UPDATE_K_DISCRIMINATOR, _data, 0); putInt128LE(_data, i, sqrtK); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -2360,7 +2360,7 @@ public static Instruction updatePerpMarketMarginRatio(final AccountMeta invokedD putInt32LE(_data, i, marginRatioInitial); i += 4; putInt32LE(_data, i, marginRatioMaintenance); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -2380,7 +2380,7 @@ public static Instruction updatePerpMarketFundingPeriod(final AccountMeta invoke final byte[] _data = new byte[16]; int i = writeDiscriminator(UPDATE_PERP_MARKET_FUNDING_PERIOD_DISCRIMINATOR, _data, 0); putInt64LE(_data, i, fundingPeriod); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -2406,7 +2406,7 @@ public static Instruction updatePerpMarketMaxImbalances(final AccountMeta invoke putInt64LE(_data, i, maxRevenueWithdrawPerPeriod); i += 8; putInt64LE(_data, i, quoteMaxInsurance); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -2429,7 +2429,7 @@ public static Instruction updatePerpMarketLiquidationFee(final AccountMeta invok putInt32LE(_data, i, liquidatorFee); i += 4; putInt32LE(_data, i, ifLiquidationFee); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -2449,7 +2449,7 @@ public static Instruction updateInsuranceFundUnstakingPeriod(final AccountMeta i final byte[] _data = new byte[16]; int i = writeDiscriminator(UPDATE_INSURANCE_FUND_UNSTAKING_PERIOD_DISCRIMINATOR, _data, 0); putInt64LE(_data, i, insuranceFundUnstakingPeriod); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -2472,7 +2472,7 @@ public static Instruction updateSpotMarketLiquidationFee(final AccountMeta invok putInt32LE(_data, i, liquidatorFee); i += 4; putInt32LE(_data, i, ifLiquidationFee); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -2492,7 +2492,7 @@ public static Instruction updateWithdrawGuardThreshold(final AccountMeta invoked final byte[] _data = new byte[16]; int i = writeDiscriminator(UPDATE_WITHDRAW_GUARD_THRESHOLD_DISCRIMINATOR, _data, 0); putInt64LE(_data, i, withdrawGuardThreshold); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -2518,7 +2518,7 @@ public static Instruction updateSpotMarketIfFactor(final AccountMeta invokedDrif putInt32LE(_data, i, userIfFactor); i += 4; putInt32LE(_data, i, totalIfFactor); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -2538,7 +2538,7 @@ public static Instruction updateSpotMarketRevenueSettlePeriod(final AccountMeta final byte[] _data = new byte[16]; int i = writeDiscriminator(UPDATE_SPOT_MARKET_REVENUE_SETTLE_PERIOD_DISCRIMINATOR, _data, 0); putInt64LE(_data, i, revenueSettlePeriod); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -2558,7 +2558,7 @@ public static Instruction updateSpotMarketStatus(final AccountMeta invokedDriftP final byte[] _data = new byte[8 + Borsh.len(status)]; int i = writeDiscriminator(UPDATE_SPOT_MARKET_STATUS_DISCRIMINATOR, _data, 0); Borsh.write(status, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -2578,7 +2578,7 @@ public static Instruction updateSpotMarketPausedOperations(final AccountMeta inv final byte[] _data = new byte[9]; int i = writeDiscriminator(UPDATE_SPOT_MARKET_PAUSED_OPERATIONS_DISCRIMINATOR, _data, 0); _data[i] = (byte) pausedOperations; - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -2598,7 +2598,7 @@ public static Instruction updateSpotMarketAssetTier(final AccountMeta invokedDri final byte[] _data = new byte[8 + Borsh.len(assetTier)]; int i = writeDiscriminator(UPDATE_SPOT_MARKET_ASSET_TIER_DISCRIMINATOR, _data, 0); Borsh.write(assetTier, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -2630,7 +2630,7 @@ public static Instruction updateSpotMarketMarginWeights(final AccountMeta invoke putInt32LE(_data, i, maintenanceLiabilityWeight); i += 4; putInt32LE(_data, i, imfFactor); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -2659,7 +2659,7 @@ public static Instruction updateSpotMarketBorrowRate(final AccountMeta invokedDr putInt32LE(_data, i, maxBorrowRate); i += 4; Borsh.writeOptional(minBorrowRate, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -2679,7 +2679,7 @@ public static Instruction updateSpotMarketMaxTokenDeposits(final AccountMeta inv final byte[] _data = new byte[16]; int i = writeDiscriminator(UPDATE_SPOT_MARKET_MAX_TOKEN_DEPOSITS_DISCRIMINATOR, _data, 0); putInt64LE(_data, i, maxTokenDeposits); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -2699,7 +2699,7 @@ public static Instruction updateSpotMarketScaleInitialAssetWeightStart(final Acc final byte[] _data = new byte[16]; int i = writeDiscriminator(UPDATE_SPOT_MARKET_SCALE_INITIAL_ASSET_WEIGHT_START_DISCRIMINATOR, _data, 0); putInt64LE(_data, i, scaleInitialAssetWeightStart); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -2724,7 +2724,7 @@ public static Instruction updateSpotMarketOracle(final AccountMeta invokedDriftP oracle.write(_data, i); i += 32; Borsh.write(oracleSource, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -2747,7 +2747,7 @@ public static Instruction updateSpotMarketStepSizeAndTickSize(final AccountMeta putInt64LE(_data, i, stepSize); i += 8; putInt64LE(_data, i, tickSize); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -2767,7 +2767,7 @@ public static Instruction updateSpotMarketMinOrderSize(final AccountMeta invoked final byte[] _data = new byte[16]; int i = writeDiscriminator(UPDATE_SPOT_MARKET_MIN_ORDER_SIZE_DISCRIMINATOR, _data, 0); putInt64LE(_data, i, orderSize); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -2787,7 +2787,7 @@ public static Instruction updateSpotMarketOrdersEnabled(final AccountMeta invoke final byte[] _data = new byte[9]; int i = writeDiscriminator(UPDATE_SPOT_MARKET_ORDERS_ENABLED_DISCRIMINATOR, _data, 0); _data[i] = (byte) (ordersEnabled ? 1 : 0); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -2807,7 +2807,7 @@ public static Instruction updateSpotMarketIfPausedOperations(final AccountMeta i final byte[] _data = new byte[9]; int i = writeDiscriminator(UPDATE_SPOT_MARKET_IF_PAUSED_OPERATIONS_DISCRIMINATOR, _data, 0); _data[i] = (byte) pausedOperations; - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -2827,7 +2827,7 @@ public static Instruction updateSpotMarketName(final AccountMeta invokedDriftPro final byte[] _data = new byte[8 + Borsh.fixedLen(name)]; int i = writeDiscriminator(UPDATE_SPOT_MARKET_NAME_DISCRIMINATOR, _data, 0); Borsh.fixedWrite(name, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -2847,7 +2847,7 @@ public static Instruction updatePerpMarketStatus(final AccountMeta invokedDriftP final byte[] _data = new byte[8 + Borsh.len(status)]; int i = writeDiscriminator(UPDATE_PERP_MARKET_STATUS_DISCRIMINATOR, _data, 0); Borsh.write(status, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -2867,7 +2867,7 @@ public static Instruction updatePerpMarketPausedOperations(final AccountMeta inv final byte[] _data = new byte[9]; int i = writeDiscriminator(UPDATE_PERP_MARKET_PAUSED_OPERATIONS_DISCRIMINATOR, _data, 0); _data[i] = (byte) pausedOperations; - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -2887,7 +2887,7 @@ public static Instruction updatePerpMarketContractTier(final AccountMeta invoked final byte[] _data = new byte[8 + Borsh.len(contractTier)]; int i = writeDiscriminator(UPDATE_PERP_MARKET_CONTRACT_TIER_DISCRIMINATOR, _data, 0); Borsh.write(contractTier, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -2910,7 +2910,7 @@ public static Instruction updatePerpMarketImfFactor(final AccountMeta invokedDri putInt32LE(_data, i, imfFactor); i += 4; putInt32LE(_data, i, unrealizedPnlImfFactor); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -2933,7 +2933,7 @@ public static Instruction updatePerpMarketUnrealizedAssetWeight(final AccountMet putInt32LE(_data, i, unrealizedInitialAssetWeight); i += 4; putInt32LE(_data, i, unrealizedMaintenanceAssetWeight); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -2953,7 +2953,7 @@ public static Instruction updatePerpMarketConcentrationCoef(final AccountMeta in final byte[] _data = new byte[24]; int i = writeDiscriminator(UPDATE_PERP_MARKET_CONCENTRATION_COEF_DISCRIMINATOR, _data, 0); putInt128LE(_data, i, concentrationScale); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -2973,7 +2973,7 @@ public static Instruction updatePerpMarketCurveUpdateIntensity(final AccountMeta final byte[] _data = new byte[9]; int i = writeDiscriminator(UPDATE_PERP_MARKET_CURVE_UPDATE_INTENSITY_DISCRIMINATOR, _data, 0); _data[i] = (byte) curveUpdateIntensity; - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -2993,7 +2993,7 @@ public static Instruction updatePerpMarketTargetBaseAssetAmountPerLp(final Accou final byte[] _data = new byte[12]; int i = writeDiscriminator(UPDATE_PERP_MARKET_TARGET_BASE_ASSET_AMOUNT_PER_LP_DISCRIMINATOR, _data, 0); putInt32LE(_data, i, targetBaseAssetAmountPerLp); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -3013,7 +3013,7 @@ public static Instruction updatePerpMarketPerLpBase(final AccountMeta invokedDri final byte[] _data = new byte[9]; int i = writeDiscriminator(UPDATE_PERP_MARKET_PER_LP_BASE_DISCRIMINATOR, _data, 0); _data[i] = (byte) perLpBase; - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -3031,7 +3031,7 @@ public static Instruction updateLpCooldownTime(final AccountMeta invokedDriftPro final byte[] _data = new byte[16]; int i = writeDiscriminator(UPDATE_LP_COOLDOWN_TIME_DISCRIMINATOR, _data, 0); putInt64LE(_data, i, lpCooldownTime); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -3049,7 +3049,7 @@ public static Instruction updatePerpFeeStructure(final AccountMeta invokedDriftP final byte[] _data = new byte[8 + Borsh.len(feeStructure)]; int i = writeDiscriminator(UPDATE_PERP_FEE_STRUCTURE_DISCRIMINATOR, _data, 0); Borsh.write(feeStructure, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -3067,7 +3067,7 @@ public static Instruction updateSpotFeeStructure(final AccountMeta invokedDriftP final byte[] _data = new byte[8 + Borsh.len(feeStructure)]; int i = writeDiscriminator(UPDATE_SPOT_FEE_STRUCTURE_DISCRIMINATOR, _data, 0); Borsh.write(feeStructure, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -3085,7 +3085,7 @@ public static Instruction updateInitialPctToLiquidate(final AccountMeta invokedD final byte[] _data = new byte[10]; int i = writeDiscriminator(UPDATE_INITIAL_PCT_TO_LIQUIDATE_DISCRIMINATOR, _data, 0); putInt16LE(_data, i, initialPctToLiquidate); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -3103,7 +3103,7 @@ public static Instruction updateLiquidationDuration(final AccountMeta invokedDri final byte[] _data = new byte[9]; int i = writeDiscriminator(UPDATE_LIQUIDATION_DURATION_DISCRIMINATOR, _data, 0); _data[i] = (byte) liquidationDuration; - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -3121,7 +3121,7 @@ public static Instruction updateLiquidationMarginBufferRatio(final AccountMeta i final byte[] _data = new byte[12]; int i = writeDiscriminator(UPDATE_LIQUIDATION_MARGIN_BUFFER_RATIO_DISCRIMINATOR, _data, 0); putInt32LE(_data, i, liquidationMarginBufferRatio); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -3139,7 +3139,7 @@ public static Instruction updateOracleGuardRails(final AccountMeta invokedDriftP final byte[] _data = new byte[8 + Borsh.len(oracleGuardRails)]; int i = writeDiscriminator(UPDATE_ORACLE_GUARD_RAILS_DISCRIMINATOR, _data, 0); Borsh.write(oracleGuardRails, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -3157,7 +3157,7 @@ public static Instruction updateStateSettlementDuration(final AccountMeta invoke final byte[] _data = new byte[10]; int i = writeDiscriminator(UPDATE_STATE_SETTLEMENT_DURATION_DISCRIMINATOR, _data, 0); putInt16LE(_data, i, settlementDuration); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -3175,7 +3175,7 @@ public static Instruction updateStateMaxNumberOfSubAccounts(final AccountMeta in final byte[] _data = new byte[10]; int i = writeDiscriminator(UPDATE_STATE_MAX_NUMBER_OF_SUB_ACCOUNTS_DISCRIMINATOR, _data, 0); putInt16LE(_data, i, maxNumberOfSubAccounts); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -3193,7 +3193,7 @@ public static Instruction updateStateMaxInitializeUserFee(final AccountMeta invo final byte[] _data = new byte[10]; int i = writeDiscriminator(UPDATE_STATE_MAX_INITIALIZE_USER_FEE_DISCRIMINATOR, _data, 0); putInt16LE(_data, i, maxInitializeUserFee); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -3218,7 +3218,7 @@ public static Instruction updatePerpMarketOracle(final AccountMeta invokedDriftP oracle.write(_data, i); i += 32; Borsh.write(oracleSource, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -3238,7 +3238,7 @@ public static Instruction updatePerpMarketBaseSpread(final AccountMeta invokedDr final byte[] _data = new byte[12]; int i = writeDiscriminator(UPDATE_PERP_MARKET_BASE_SPREAD_DISCRIMINATOR, _data, 0); putInt32LE(_data, i, baseSpread); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -3258,7 +3258,7 @@ public static Instruction updateAmmJitIntensity(final AccountMeta invokedDriftPr final byte[] _data = new byte[9]; int i = writeDiscriminator(UPDATE_AMM_JIT_INTENSITY_DISCRIMINATOR, _data, 0); _data[i] = (byte) ammJitIntensity; - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -3278,7 +3278,7 @@ public static Instruction updatePerpMarketMaxSpread(final AccountMeta invokedDri final byte[] _data = new byte[12]; int i = writeDiscriminator(UPDATE_PERP_MARKET_MAX_SPREAD_DISCRIMINATOR, _data, 0); putInt32LE(_data, i, maxSpread); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -3301,7 +3301,7 @@ public static Instruction updatePerpMarketStepSizeAndTickSize(final AccountMeta putInt64LE(_data, i, stepSize); i += 8; putInt64LE(_data, i, tickSize); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -3321,7 +3321,7 @@ public static Instruction updatePerpMarketName(final AccountMeta invokedDriftPro final byte[] _data = new byte[8 + Borsh.fixedLen(name)]; int i = writeDiscriminator(UPDATE_PERP_MARKET_NAME_DISCRIMINATOR, _data, 0); Borsh.fixedWrite(name, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -3341,7 +3341,7 @@ public static Instruction updatePerpMarketMinOrderSize(final AccountMeta invoked final byte[] _data = new byte[16]; int i = writeDiscriminator(UPDATE_PERP_MARKET_MIN_ORDER_SIZE_DISCRIMINATOR, _data, 0); putInt64LE(_data, i, orderSize); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -3361,7 +3361,7 @@ public static Instruction updatePerpMarketMaxSlippageRatio(final AccountMeta inv final byte[] _data = new byte[10]; int i = writeDiscriminator(UPDATE_PERP_MARKET_MAX_SLIPPAGE_RATIO_DISCRIMINATOR, _data, 0); putInt16LE(_data, i, maxSlippageRatio); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -3381,7 +3381,7 @@ public static Instruction updatePerpMarketMaxFillReserveFraction(final AccountMe final byte[] _data = new byte[10]; int i = writeDiscriminator(UPDATE_PERP_MARKET_MAX_FILL_RESERVE_FRACTION_DISCRIMINATOR, _data, 0); putInt16LE(_data, i, maxFillReserveFraction); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -3401,7 +3401,7 @@ public static Instruction updatePerpMarketMaxOpenInterest(final AccountMeta invo final byte[] _data = new byte[24]; int i = writeDiscriminator(UPDATE_PERP_MARKET_MAX_OPEN_INTEREST_DISCRIMINATOR, _data, 0); putInt128LE(_data, i, maxOpenInterest); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -3423,7 +3423,7 @@ public static Instruction updatePerpMarketNumberOfUsers(final AccountMeta invoke int i = writeDiscriminator(UPDATE_PERP_MARKET_NUMBER_OF_USERS_DISCRIMINATOR, _data, 0); i += Borsh.writeOptional(numberOfUsers, _data, i); Borsh.writeOptional(numberOfUsersWithBase, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -3443,7 +3443,7 @@ public static Instruction updatePerpMarketFeeAdjustment(final AccountMeta invoke final byte[] _data = new byte[10]; int i = writeDiscriminator(UPDATE_PERP_MARKET_FEE_ADJUSTMENT_DISCRIMINATOR, _data, 0); putInt16LE(_data, i, feeAdjustment); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -3463,7 +3463,7 @@ public static Instruction updateSpotMarketFeeAdjustment(final AccountMeta invoke final byte[] _data = new byte[10]; int i = writeDiscriminator(UPDATE_SPOT_MARKET_FEE_ADJUSTMENT_DISCRIMINATOR, _data, 0); putInt16LE(_data, i, feeAdjustment); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -3481,7 +3481,7 @@ public static Instruction updateAdmin(final AccountMeta invokedDriftProgramMeta, final byte[] _data = new byte[40]; int i = writeDiscriminator(UPDATE_ADMIN_DISCRIMINATOR, _data, 0); admin.write(_data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -3499,7 +3499,7 @@ public static Instruction updateWhitelistMint(final AccountMeta invokedDriftProg final byte[] _data = new byte[40]; int i = writeDiscriminator(UPDATE_WHITELIST_MINT_DISCRIMINATOR, _data, 0); whitelistMint.write(_data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -3517,7 +3517,7 @@ public static Instruction updateDiscountMint(final AccountMeta invokedDriftProgr final byte[] _data = new byte[40]; int i = writeDiscriminator(UPDATE_DISCOUNT_MINT_DISCRIMINATOR, _data, 0); discountMint.write(_data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -3535,7 +3535,7 @@ public static Instruction updateExchangeStatus(final AccountMeta invokedDriftPro final byte[] _data = new byte[9]; int i = writeDiscriminator(UPDATE_EXCHANGE_STATUS_DISCRIMINATOR, _data, 0); _data[i] = (byte) exchangeStatus; - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -3553,7 +3553,7 @@ public static Instruction updatePerpAuctionDuration(final AccountMeta invokedDri final byte[] _data = new byte[9]; int i = writeDiscriminator(UPDATE_PERP_AUCTION_DURATION_DISCRIMINATOR, _data, 0); _data[i] = (byte) minPerpAuctionDuration; - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -3571,7 +3571,7 @@ public static Instruction updateSpotAuctionDuration(final AccountMeta invokedDri final byte[] _data = new byte[9]; int i = writeDiscriminator(UPDATE_SPOT_AUCTION_DURATION_DISCRIMINATOR, _data, 0); _data[i] = (byte) defaultSpotAuctionDuration; - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -3612,7 +3612,7 @@ public static Instruction updateProtocolIfSharesTransferConfig(final AccountMeta int i = writeDiscriminator(UPDATE_PROTOCOL_IF_SHARES_TRANSFER_CONFIG_DISCRIMINATOR, _data, 0); i += Borsh.writeOptional(whitelistedSigners, _data, i); Borsh.writeOptional(maxTransferPerEpoch, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -3636,7 +3636,7 @@ public static Instruction initializePrelaunchOracle(final AccountMeta invokedDri final byte[] _data = new byte[8 + Borsh.len(params)]; int i = writeDiscriminator(INITIALIZE_PRELAUNCH_ORACLE_DISCRIMINATOR, _data, 0); Borsh.write(params, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -3658,7 +3658,7 @@ public static Instruction updatePrelaunchOracleParams(final AccountMeta invokedD final byte[] _data = new byte[8 + Borsh.len(params)]; int i = writeDiscriminator(UPDATE_PRELAUNCH_ORACLE_PARAMS_DISCRIMINATOR, _data, 0); Borsh.write(params, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -3680,7 +3680,7 @@ public static Instruction deletePrelaunchOracle(final AccountMeta invokedDriftPr final byte[] _data = new byte[10]; int i = writeDiscriminator(DELETE_PRELAUNCH_ORACLE_DISCRIMINATOR, _data, 0); putInt16LE(_data, i, perpMarketIndex); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } @@ -3704,7 +3704,7 @@ public static Instruction initializePythPullOracle(final AccountMeta invokedDrif final byte[] _data = new byte[8 + Borsh.fixedLen(feedId)]; int i = writeDiscriminator(INITIALIZE_PYTH_PULL_ORACLE_DISCRIMINATOR, _data, 0); Borsh.fixedWrite(feedId, _data, i); - + return Instruction.createInstruction(invokedDriftProgramMeta, keys, _data); } diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/AMM.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/AMM.java index 8b3e821..f892dde 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/AMM.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/AMM.java @@ -741,4 +741,4 @@ public int l() { + 4 + Borsh.fixedLen(padding); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/CurveRecord.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/CurveRecord.java index c763621..9f9de48 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/CurveRecord.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/CurveRecord.java @@ -168,4 +168,4 @@ public int l() { + 4 + 2; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/DepositRecord.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/DepositRecord.java index 3400ade..e750d23 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/DepositRecord.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/DepositRecord.java @@ -136,4 +136,4 @@ public int l() { + Borsh.len(explanation) + Borsh.lenOptional(transferUser, 32); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/FeeStructure.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/FeeStructure.java index f8a044e..e6e16e5 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/FeeStructure.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/FeeStructure.java @@ -42,4 +42,4 @@ public int write(final byte[] _data, final int offset) { public int l() { return Borsh.fixedLen(feeTiers) + Borsh.len(fillerRewardStructure) + 8 + 8; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/FeeTier.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/FeeTier.java index 6f626a3..ed71d95 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/FeeTier.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/FeeTier.java @@ -76,4 +76,4 @@ public int l() { + 4 + 4; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/FundingPaymentRecord.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/FundingPaymentRecord.java index c1da006..929182a 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/FundingPaymentRecord.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/FundingPaymentRecord.java @@ -91,4 +91,4 @@ public int l() { + 16 + 16; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/FundingRateRecord.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/FundingRateRecord.java index 489967e..c66f5f7 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/FundingRateRecord.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/FundingRateRecord.java @@ -117,4 +117,4 @@ public int l() { + 16 + 16; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/HistoricalIndexData.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/HistoricalIndexData.java index 278abd9..4e4781c 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/HistoricalIndexData.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/HistoricalIndexData.java @@ -60,4 +60,4 @@ public int l() { + 8 + 8; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/HistoricalOracleData.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/HistoricalOracleData.java index a5ddad4..f2bb29c 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/HistoricalOracleData.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/HistoricalOracleData.java @@ -68,4 +68,4 @@ public int l() { + 8 + 8; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/InsuranceClaim.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/InsuranceClaim.java index b48412b..cf61e2c 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/InsuranceClaim.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/InsuranceClaim.java @@ -66,4 +66,4 @@ public int l() { + 8 + 8; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/InsuranceFund.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/InsuranceFund.java index 9627588..69f06d2 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/InsuranceFund.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/InsuranceFund.java @@ -91,4 +91,4 @@ public int l() { + 4 + 4; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/InsuranceFundRecord.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/InsuranceFundRecord.java index d57d2d6..7aceb0c 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/InsuranceFundRecord.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/InsuranceFundRecord.java @@ -98,4 +98,4 @@ public int l() { + 16 + 8; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/InsuranceFundStake.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/InsuranceFundStake.java index 6caa788..7dd8736 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/InsuranceFundStake.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/InsuranceFundStake.java @@ -43,53 +43,53 @@ public record InsuranceFundStake(PublicKey _address, public static final int COST_BASIS_OFFSET = 112; public static final int MARKET_INDEX_OFFSET = 120; public static final int PADDING_OFFSET = 122; - + public static Filter createAuthorityFilter(final PublicKey authority) { return Filter.createMemCompFilter(AUTHORITY_OFFSET, authority); } - + public static Filter createIfSharesFilter(final BigInteger ifShares) { final byte[] _data = new byte[16]; putInt128LE(_data, 0, ifShares); return Filter.createMemCompFilter(IF_SHARES_OFFSET, _data); } - + public static Filter createLastWithdrawRequestSharesFilter(final BigInteger lastWithdrawRequestShares) { final byte[] _data = new byte[16]; putInt128LE(_data, 0, lastWithdrawRequestShares); return Filter.createMemCompFilter(LAST_WITHDRAW_REQUEST_SHARES_OFFSET, _data); } - + public static Filter createIfBaseFilter(final BigInteger ifBase) { final byte[] _data = new byte[16]; putInt128LE(_data, 0, ifBase); return Filter.createMemCompFilter(IF_BASE_OFFSET, _data); } - + public static Filter createLastValidTsFilter(final long lastValidTs) { final byte[] _data = new byte[8]; putInt64LE(_data, 0, lastValidTs); return Filter.createMemCompFilter(LAST_VALID_TS_OFFSET, _data); } - + public static Filter createLastWithdrawRequestValueFilter(final long lastWithdrawRequestValue) { final byte[] _data = new byte[8]; putInt64LE(_data, 0, lastWithdrawRequestValue); return Filter.createMemCompFilter(LAST_WITHDRAW_REQUEST_VALUE_OFFSET, _data); } - + public static Filter createLastWithdrawRequestTsFilter(final long lastWithdrawRequestTs) { final byte[] _data = new byte[8]; putInt64LE(_data, 0, lastWithdrawRequestTs); return Filter.createMemCompFilter(LAST_WITHDRAW_REQUEST_TS_OFFSET, _data); } - + public static Filter createCostBasisFilter(final long costBasis) { final byte[] _data = new byte[8]; putInt64LE(_data, 0, costBasis); return Filter.createMemCompFilter(COST_BASIS_OFFSET, _data); } - + public static Filter createMarketIndexFilter(final int marketIndex) { final byte[] _data = new byte[2]; putInt16LE(_data, 0, marketIndex); @@ -99,13 +99,13 @@ public static Filter createMarketIndexFilter(final int marketIndex) { public static InsuranceFundStake read(final byte[] _data, final int offset) { return read(null, _data, offset); } - + public static InsuranceFundStake read(final PublicKey _address, final byte[] _data) { return read(_address, _data, 0); } - + public static final BiFunction FACTORY = InsuranceFundStake::read; - + public static InsuranceFundStake read(final PublicKey _address, final byte[] _data, final int offset) { final byte[] discriminator = parseDiscriminator(_data, offset); int i = offset + discriminator.length; @@ -181,4 +181,4 @@ public int l() { + 2 + Borsh.fixedLen(padding); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/InsuranceFundStakeRecord.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/InsuranceFundStakeRecord.java index 38e32e7..7758b01 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/InsuranceFundStakeRecord.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/InsuranceFundStakeRecord.java @@ -111,4 +111,4 @@ public int l() { + 16 + 16; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/LPRecord.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/LPRecord.java index 81ebe73..8896aff 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/LPRecord.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/LPRecord.java @@ -79,4 +79,4 @@ public int l() { + 8 + 8; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/LiquidateBorrowForPerpPnlRecord.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/LiquidateBorrowForPerpPnlRecord.java index 6190bcd..f5b77f4 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/LiquidateBorrowForPerpPnlRecord.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/LiquidateBorrowForPerpPnlRecord.java @@ -68,4 +68,4 @@ public int l() { + 8 + 16; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/LiquidatePerpPnlForDepositRecord.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/LiquidatePerpPnlForDepositRecord.java index a2090d7..85d2144 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/LiquidatePerpPnlForDepositRecord.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/LiquidatePerpPnlForDepositRecord.java @@ -68,4 +68,4 @@ public int l() { + 8 + 16; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/LiquidatePerpRecord.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/LiquidatePerpRecord.java index b3d40c4..8b79195 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/LiquidatePerpRecord.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/LiquidatePerpRecord.java @@ -97,4 +97,4 @@ public int l() { + 8 + 8; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/LiquidateSpotRecord.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/LiquidateSpotRecord.java index 2bd41d6..d9a06ef 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/LiquidateSpotRecord.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/LiquidateSpotRecord.java @@ -77,4 +77,4 @@ public int l() { + 16 + 8; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/LiquidationRecord.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/LiquidationRecord.java index cfd7291..3dac46e 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/LiquidationRecord.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/LiquidationRecord.java @@ -131,4 +131,4 @@ public int l() { + Borsh.len(perpBankruptcy) + Borsh.len(spotBankruptcy); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/MarginCalculationMode.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/MarginCalculationMode.java index 731b15c..6bd9882 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/MarginCalculationMode.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/MarginCalculationMode.java @@ -5,7 +5,7 @@ public sealed interface MarginCalculationMode extends RustEnum permits MarginCalculationMode.Standard, MarginCalculationMode.Liquidation { - + static MarginCalculationMode read(final byte[] _data, final int offset) { final int ordinal = _data[offset] & 0xFF; int i = offset + 1; @@ -17,11 +17,11 @@ static MarginCalculationMode read(final byte[] _data, final int offset) { } record Standard(boolean val) implements EnumBool, MarginCalculationMode { - + public static Standard read(final byte[] _data, int i) { return new Standard(_data[i] == 1); } - + @Override public int ordinal() { return 0; @@ -29,14 +29,14 @@ public int ordinal() { } record Liquidation(MarketIdentifier val) implements BorshEnum, MarginCalculationMode { - + public static Liquidation read(final byte[] _data, final int offset) { return new Liquidation(MarketIdentifier.read(_data, offset)); } - + @Override public int ordinal() { return 1; } } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/MarketIdentifier.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/MarketIdentifier.java index cb29570..5487084 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/MarketIdentifier.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/MarketIdentifier.java @@ -30,4 +30,4 @@ public int write(final byte[] _data, final int offset) { public int l() { return Borsh.len(marketType) + 2; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/ModifyOrderId.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/ModifyOrderId.java index b001c7c..a8380b1 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/ModifyOrderId.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/ModifyOrderId.java @@ -7,7 +7,7 @@ public sealed interface ModifyOrderId extends RustEnum permits ModifyOrderId.UserOrderId, ModifyOrderId.OrderId { - + static ModifyOrderId read(final byte[] _data, final int offset) { final int ordinal = _data[offset] & 0xFF; int i = offset + 1; @@ -19,11 +19,11 @@ static ModifyOrderId read(final byte[] _data, final int offset) { } record UserOrderId(int val) implements EnumInt8, ModifyOrderId { - + public static UserOrderId read(final byte[] _data, int i) { return new UserOrderId(_data[i] & 0xFF); } - + @Override public int ordinal() { return 0; @@ -31,14 +31,14 @@ public int ordinal() { } record OrderId(int val) implements EnumInt32, ModifyOrderId { - + public static OrderId read(final byte[] _data, int i) { return new OrderId(getInt32LE(_data, i)); } - + @Override public int ordinal() { return 1; } } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/ModifyOrderParams.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/ModifyOrderParams.java index 849481b..3b207b8 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/ModifyOrderParams.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/ModifyOrderParams.java @@ -134,4 +134,4 @@ public int l() { + 9 + Borsh.lenOptional(policy); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/NewUserRecord.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/NewUserRecord.java index f23da8a..181114b 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/NewUserRecord.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/NewUserRecord.java @@ -65,4 +65,4 @@ public int l() { + Borsh.fixedLen(name) + 32; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/OracleGuardRails.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/OracleGuardRails.java index 963344f..e915849 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/OracleGuardRails.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/OracleGuardRails.java @@ -25,4 +25,4 @@ public int write(final byte[] _data, final int offset) { public int l() { return Borsh.len(priceDivergence) + Borsh.len(validity); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/Order.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/Order.java index 747d09b..40e5956 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/Order.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/Order.java @@ -219,4 +219,4 @@ public int l() { + 1 + Borsh.fixedLen(padding); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/OrderActionRecord.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/OrderActionRecord.java index bc8db53..a4276bf 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/OrderActionRecord.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/OrderActionRecord.java @@ -242,4 +242,4 @@ public int l() { + 9 + 8; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/OrderFillerRewardStructure.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/OrderFillerRewardStructure.java index d5c6d79..507269e 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/OrderFillerRewardStructure.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/OrderFillerRewardStructure.java @@ -41,4 +41,4 @@ public int write(final byte[] _data, final int offset) { public int l() { return 4 + 4 + 16; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/OrderParams.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/OrderParams.java index bbddf2f..cc9a29f 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/OrderParams.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/OrderParams.java @@ -143,4 +143,4 @@ public int l() { + 9 + 9; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/OrderRecord.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/OrderRecord.java index 558d3e6..4ae9c2d 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/OrderRecord.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/OrderRecord.java @@ -37,4 +37,4 @@ public int write(final byte[] _data, final int offset) { public int l() { return 8 + 32 + Borsh.len(order); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/PerpBankruptcyRecord.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/PerpBankruptcyRecord.java index c40c994..12e217d 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/PerpBankruptcyRecord.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/PerpBankruptcyRecord.java @@ -69,4 +69,4 @@ public int l() { + Borsh.lenOptional(clawbackUserPayment, 16) + 16; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/PerpFulfillmentMethod.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/PerpFulfillmentMethod.java index 9a5466e..b3b9a17 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/PerpFulfillmentMethod.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/PerpFulfillmentMethod.java @@ -13,7 +13,7 @@ public sealed interface PerpFulfillmentMethod extends RustEnum permits PerpFulfillmentMethod.AMM, PerpFulfillmentMethod.Match { - + static PerpFulfillmentMethod read(final byte[] _data, final int offset) { final int ordinal = _data[offset] & 0xFF; int i = offset + 1; @@ -25,11 +25,11 @@ static PerpFulfillmentMethod read(final byte[] _data, final int offset) { } record AMM(OptionalLong val) implements OptionalEnumInt64, PerpFulfillmentMethod { - + public static AMM read(final byte[] _data, int i) { return new AMM(_data[i++] == 0 ? OptionalLong.empty() : OptionalLong.of(getInt64LE(_data, i))); } - + @Override public int ordinal() { return 0; @@ -37,9 +37,9 @@ public int ordinal() { } record Match(PublicKey _publicKey, int _u16) implements PerpFulfillmentMethod { - + public static final int BYTES = 34; - + public static Match read(final byte[] _data, final int offset) { int i = offset; final var _publicKey = readPubKey(_data, i); @@ -47,7 +47,7 @@ public static Match read(final byte[] _data, final int offset) { final var _u16 = getInt16LE(_data, i); return new Match(_publicKey, _u16); } - + @Override public int write(final byte[] _data, final int offset) { _data[offset] = (byte) ordinal(); @@ -58,15 +58,15 @@ public int write(final byte[] _data, final int offset) { i += 2; return i - offset; } - + @Override public int l() { return 1 + 32 + 2; } - + @Override public int ordinal() { return 1; } } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/PerpMarket.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/PerpMarket.java index 4075caf..dfd237e 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/PerpMarket.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/PerpMarket.java @@ -96,11 +96,11 @@ public record PerpMarket(PublicKey _address, public static final int PUBKEY_OFFSET = 8; public static final int AMM_OFFSET = 40; public static final int PNL_POOL_OFFSET = 1000; - + public static Filter createPubkeyFilter(final PublicKey pubkey) { return Filter.createMemCompFilter(PUBKEY_OFFSET, pubkey); } - + public static Filter createPnlPoolFilter(final PoolBalance pnlPool) { return Filter.createMemCompFilter(PNL_POOL_OFFSET, pnlPool.write()); } @@ -108,13 +108,13 @@ public static Filter createPnlPoolFilter(final PoolBalance pnlPool) { public static PerpMarket read(final byte[] _data, final int offset) { return read(null, _data, offset); } - + public static PerpMarket read(final PublicKey _address, final byte[] _data) { return read(_address, _data, 0); } - + public static final BiFunction FACTORY = PerpMarket::read; - + public static PerpMarket read(final PublicKey _address, final byte[] _data, final int offset) { final byte[] discriminator = parseDiscriminator(_data, offset); int i = offset + discriminator.length; @@ -297,4 +297,4 @@ public int l() { + 2 + Borsh.fixedLen(padding); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/PerpPosition.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/PerpPosition.java index de739b5..b9ff266 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/PerpPosition.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/PerpPosition.java @@ -162,4 +162,4 @@ public int l() { + 1 + 1; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/PhoenixV1FulfillmentConfig.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/PhoenixV1FulfillmentConfig.java index 56ff8a9..83f2a8a 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/PhoenixV1FulfillmentConfig.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/PhoenixV1FulfillmentConfig.java @@ -37,41 +37,41 @@ public record PhoenixV1FulfillmentConfig(PublicKey _address, public static final int FULFILLMENT_TYPE_OFFSET = 202; public static final int STATUS_OFFSET = 203; public static final int PADDING_OFFSET = 204; - + public static Filter createPubkeyFilter(final PublicKey pubkey) { return Filter.createMemCompFilter(PUBKEY_OFFSET, pubkey); } - + public static Filter createPhoenixProgramIdFilter(final PublicKey phoenixProgramId) { return Filter.createMemCompFilter(PHOENIX_PROGRAM_ID_OFFSET, phoenixProgramId); } - + public static Filter createPhoenixLogAuthorityFilter(final PublicKey phoenixLogAuthority) { return Filter.createMemCompFilter(PHOENIX_LOG_AUTHORITY_OFFSET, phoenixLogAuthority); } - + public static Filter createPhoenixMarketFilter(final PublicKey phoenixMarket) { return Filter.createMemCompFilter(PHOENIX_MARKET_OFFSET, phoenixMarket); } - + public static Filter createPhoenixBaseVaultFilter(final PublicKey phoenixBaseVault) { return Filter.createMemCompFilter(PHOENIX_BASE_VAULT_OFFSET, phoenixBaseVault); } - + public static Filter createPhoenixQuoteVaultFilter(final PublicKey phoenixQuoteVault) { return Filter.createMemCompFilter(PHOENIX_QUOTE_VAULT_OFFSET, phoenixQuoteVault); } - + public static Filter createMarketIndexFilter(final int marketIndex) { final byte[] _data = new byte[2]; putInt16LE(_data, 0, marketIndex); return Filter.createMemCompFilter(MARKET_INDEX_OFFSET, _data); } - + public static Filter createFulfillmentTypeFilter(final SpotFulfillmentType fulfillmentType) { return Filter.createMemCompFilter(FULFILLMENT_TYPE_OFFSET, fulfillmentType.write()); } - + public static Filter createStatusFilter(final SpotFulfillmentConfigStatus status) { return Filter.createMemCompFilter(STATUS_OFFSET, status.write()); } @@ -79,13 +79,13 @@ public static Filter createStatusFilter(final SpotFulfillmentConfigStatus status public static PhoenixV1FulfillmentConfig read(final byte[] _data, final int offset) { return read(null, _data, offset); } - + public static PhoenixV1FulfillmentConfig read(final PublicKey _address, final byte[] _data) { return read(_address, _data, 0); } - + public static final BiFunction FACTORY = PhoenixV1FulfillmentConfig::read; - + public static PhoenixV1FulfillmentConfig read(final PublicKey _address, final byte[] _data, final int offset) { final byte[] discriminator = parseDiscriminator(_data, offset); int i = offset + discriminator.length; @@ -159,4 +159,4 @@ public int l() { + Borsh.len(status) + Borsh.fixedLen(padding); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/PoolBalance.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/PoolBalance.java index 8779743..3dfc744 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/PoolBalance.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/PoolBalance.java @@ -44,4 +44,4 @@ public int write(final byte[] _data, final int offset) { public int l() { return 16 + 2 + Borsh.fixedLen(padding); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/PrelaunchOracle.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/PrelaunchOracle.java index e7eb9e8..14faa82 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/PrelaunchOracle.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/PrelaunchOracle.java @@ -32,37 +32,37 @@ public record PrelaunchOracle(PublicKey _address, public static final int AMM_LAST_UPDATE_SLOT_OFFSET = 40; public static final int PERP_MARKET_INDEX_OFFSET = 48; public static final int PADDING_OFFSET = 50; - + public static Filter createPriceFilter(final long price) { final byte[] _data = new byte[8]; putInt64LE(_data, 0, price); return Filter.createMemCompFilter(PRICE_OFFSET, _data); } - + public static Filter createMaxPriceFilter(final long maxPrice) { final byte[] _data = new byte[8]; putInt64LE(_data, 0, maxPrice); return Filter.createMemCompFilter(MAX_PRICE_OFFSET, _data); } - + public static Filter createConfidenceFilter(final long confidence) { final byte[] _data = new byte[8]; putInt64LE(_data, 0, confidence); return Filter.createMemCompFilter(CONFIDENCE_OFFSET, _data); } - + public static Filter createLastUpdateSlotFilter(final long lastUpdateSlot) { final byte[] _data = new byte[8]; putInt64LE(_data, 0, lastUpdateSlot); return Filter.createMemCompFilter(LAST_UPDATE_SLOT_OFFSET, _data); } - + public static Filter createAmmLastUpdateSlotFilter(final long ammLastUpdateSlot) { final byte[] _data = new byte[8]; putInt64LE(_data, 0, ammLastUpdateSlot); return Filter.createMemCompFilter(AMM_LAST_UPDATE_SLOT_OFFSET, _data); } - + public static Filter createPerpMarketIndexFilter(final int perpMarketIndex) { final byte[] _data = new byte[2]; putInt16LE(_data, 0, perpMarketIndex); @@ -72,13 +72,13 @@ public static Filter createPerpMarketIndexFilter(final int perpMarketIndex) { public static PrelaunchOracle read(final byte[] _data, final int offset) { return read(null, _data, offset); } - + public static PrelaunchOracle read(final PublicKey _address, final byte[] _data) { return read(_address, _data, 0); } - + public static final BiFunction FACTORY = PrelaunchOracle::read; - + public static PrelaunchOracle read(final PublicKey _address, final byte[] _data, final int offset) { final byte[] discriminator = parseDiscriminator(_data, offset); int i = offset + discriminator.length; @@ -136,4 +136,4 @@ public int l() { + 2 + Borsh.fixedLen(padding); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/PrelaunchOracleParams.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/PrelaunchOracleParams.java index 3fc21fd..e410353 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/PrelaunchOracleParams.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/PrelaunchOracleParams.java @@ -39,4 +39,4 @@ public int write(final byte[] _data, final int offset) { public int l() { return 2 + 9 + 9; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/PriceDivergenceGuardRails.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/PriceDivergenceGuardRails.java index 504a6cd..940e08a 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/PriceDivergenceGuardRails.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/PriceDivergenceGuardRails.java @@ -31,4 +31,4 @@ public int write(final byte[] _data, final int offset) { public int l() { return 8 + 8; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/ProtocolIfSharesTransferConfig.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/ProtocolIfSharesTransferConfig.java index 5e06edc..6a792a4 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/ProtocolIfSharesTransferConfig.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/ProtocolIfSharesTransferConfig.java @@ -30,19 +30,19 @@ public record ProtocolIfSharesTransferConfig(PublicKey _address, public static final int CURRENT_EPOCH_TRANSFER_OFFSET = 152; public static final int NEXT_EPOCH_TS_OFFSET = 168; public static final int PADDING_OFFSET = 176; - + public static Filter createMaxTransferPerEpochFilter(final BigInteger maxTransferPerEpoch) { final byte[] _data = new byte[16]; putInt128LE(_data, 0, maxTransferPerEpoch); return Filter.createMemCompFilter(MAX_TRANSFER_PER_EPOCH_OFFSET, _data); } - + public static Filter createCurrentEpochTransferFilter(final BigInteger currentEpochTransfer) { final byte[] _data = new byte[16]; putInt128LE(_data, 0, currentEpochTransfer); return Filter.createMemCompFilter(CURRENT_EPOCH_TRANSFER_OFFSET, _data); } - + public static Filter createNextEpochTsFilter(final long nextEpochTs) { final byte[] _data = new byte[8]; putInt64LE(_data, 0, nextEpochTs); @@ -52,13 +52,13 @@ public static Filter createNextEpochTsFilter(final long nextEpochTs) { public static ProtocolIfSharesTransferConfig read(final byte[] _data, final int offset) { return read(null, _data, offset); } - + public static ProtocolIfSharesTransferConfig read(final PublicKey _address, final byte[] _data) { return read(_address, _data, 0); } - + public static final BiFunction FACTORY = ProtocolIfSharesTransferConfig::read; - + public static ProtocolIfSharesTransferConfig read(final PublicKey _address, final byte[] _data, final int offset) { final byte[] discriminator = parseDiscriminator(_data, offset); int i = offset + discriminator.length; @@ -103,4 +103,4 @@ public int l() { + 8 + Borsh.fixedLen(padding); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/ReferrerName.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/ReferrerName.java index 6ab0db2..7949478 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/ReferrerName.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/ReferrerName.java @@ -23,15 +23,15 @@ public record ReferrerName(PublicKey _address, public static final int USER_OFFSET = 40; public static final int USER_STATS_OFFSET = 72; public static final int NAME_OFFSET = 104; - + public static Filter createAuthorityFilter(final PublicKey authority) { return Filter.createMemCompFilter(AUTHORITY_OFFSET, authority); } - + public static Filter createUserFilter(final PublicKey user) { return Filter.createMemCompFilter(USER_OFFSET, user); } - + public static Filter createUserStatsFilter(final PublicKey userStats) { return Filter.createMemCompFilter(USER_STATS_OFFSET, userStats); } @@ -39,13 +39,13 @@ public static Filter createUserStatsFilter(final PublicKey userStats) { public static ReferrerName read(final byte[] _data, final int offset) { return read(null, _data, offset); } - + public static ReferrerName read(final PublicKey _address, final byte[] _data) { return read(_address, _data, 0); } - + public static final BiFunction FACTORY = ReferrerName::read; - + public static ReferrerName read(final PublicKey _address, final byte[] _data, final int offset) { final byte[] discriminator = parseDiscriminator(_data, offset); int i = offset + discriminator.length; @@ -82,4 +82,4 @@ public int write(final byte[] _data, final int offset) { public int l() { return 8 + 32 + 32 + 32 + Borsh.fixedLen(name); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/SerumV3FulfillmentConfig.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/SerumV3FulfillmentConfig.java index 322b0eb..6de7aca 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/SerumV3FulfillmentConfig.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/SerumV3FulfillmentConfig.java @@ -49,63 +49,63 @@ public record SerumV3FulfillmentConfig(PublicKey _address, public static final int FULFILLMENT_TYPE_OFFSET = 338; public static final int STATUS_OFFSET = 339; public static final int PADDING_OFFSET = 340; - + public static Filter createPubkeyFilter(final PublicKey pubkey) { return Filter.createMemCompFilter(PUBKEY_OFFSET, pubkey); } - + public static Filter createSerumProgramIdFilter(final PublicKey serumProgramId) { return Filter.createMemCompFilter(SERUM_PROGRAM_ID_OFFSET, serumProgramId); } - + public static Filter createSerumMarketFilter(final PublicKey serumMarket) { return Filter.createMemCompFilter(SERUM_MARKET_OFFSET, serumMarket); } - + public static Filter createSerumRequestQueueFilter(final PublicKey serumRequestQueue) { return Filter.createMemCompFilter(SERUM_REQUEST_QUEUE_OFFSET, serumRequestQueue); } - + public static Filter createSerumEventQueueFilter(final PublicKey serumEventQueue) { return Filter.createMemCompFilter(SERUM_EVENT_QUEUE_OFFSET, serumEventQueue); } - + public static Filter createSerumBidsFilter(final PublicKey serumBids) { return Filter.createMemCompFilter(SERUM_BIDS_OFFSET, serumBids); } - + public static Filter createSerumAsksFilter(final PublicKey serumAsks) { return Filter.createMemCompFilter(SERUM_ASKS_OFFSET, serumAsks); } - + public static Filter createSerumBaseVaultFilter(final PublicKey serumBaseVault) { return Filter.createMemCompFilter(SERUM_BASE_VAULT_OFFSET, serumBaseVault); } - + public static Filter createSerumQuoteVaultFilter(final PublicKey serumQuoteVault) { return Filter.createMemCompFilter(SERUM_QUOTE_VAULT_OFFSET, serumQuoteVault); } - + public static Filter createSerumOpenOrdersFilter(final PublicKey serumOpenOrders) { return Filter.createMemCompFilter(SERUM_OPEN_ORDERS_OFFSET, serumOpenOrders); } - + public static Filter createSerumSignerNonceFilter(final long serumSignerNonce) { final byte[] _data = new byte[8]; putInt64LE(_data, 0, serumSignerNonce); return Filter.createMemCompFilter(SERUM_SIGNER_NONCE_OFFSET, _data); } - + public static Filter createMarketIndexFilter(final int marketIndex) { final byte[] _data = new byte[2]; putInt16LE(_data, 0, marketIndex); return Filter.createMemCompFilter(MARKET_INDEX_OFFSET, _data); } - + public static Filter createFulfillmentTypeFilter(final SpotFulfillmentType fulfillmentType) { return Filter.createMemCompFilter(FULFILLMENT_TYPE_OFFSET, fulfillmentType.write()); } - + public static Filter createStatusFilter(final SpotFulfillmentConfigStatus status) { return Filter.createMemCompFilter(STATUS_OFFSET, status.write()); } @@ -113,13 +113,13 @@ public static Filter createStatusFilter(final SpotFulfillmentConfigStatus status public static SerumV3FulfillmentConfig read(final byte[] _data, final int offset) { return read(null, _data, offset); } - + public static SerumV3FulfillmentConfig read(final PublicKey _address, final byte[] _data) { return read(_address, _data, 0); } - + public static final BiFunction FACTORY = SerumV3FulfillmentConfig::read; - + public static SerumV3FulfillmentConfig read(final PublicKey _address, final byte[] _data, final int offset) { final byte[] discriminator = parseDiscriminator(_data, offset); int i = offset + discriminator.length; @@ -223,4 +223,4 @@ public int l() { + Borsh.len(status) + Borsh.fixedLen(padding); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/SettlePnlRecord.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/SettlePnlRecord.java index 1e3e1f5..f82e545 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/SettlePnlRecord.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/SettlePnlRecord.java @@ -90,4 +90,4 @@ public int l() { + 8 + Borsh.len(explanation); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/SpotBankruptcyRecord.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/SpotBankruptcyRecord.java index 67d380e..378e6a2 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/SpotBankruptcyRecord.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/SpotBankruptcyRecord.java @@ -49,4 +49,4 @@ public int write(final byte[] _data, final int offset) { public int l() { return 2 + 16 + 16 + 16; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/SpotFulfillmentMethod.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/SpotFulfillmentMethod.java index b2f326a..662e2d8 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/SpotFulfillmentMethod.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/SpotFulfillmentMethod.java @@ -10,7 +10,7 @@ public sealed interface SpotFulfillmentMethod extends RustEnum permits SpotFulfillmentMethod.ExternalMarket, SpotFulfillmentMethod.Match { - + static SpotFulfillmentMethod read(final byte[] _data, final int offset) { final int ordinal = _data[offset] & 0xFF; int i = offset + 1; @@ -21,7 +21,7 @@ static SpotFulfillmentMethod read(final byte[] _data, final int offset) { }; } record ExternalMarket() implements EnumNone, SpotFulfillmentMethod { - + @Override public int ordinal() { return 0; @@ -29,9 +29,9 @@ public int ordinal() { } record Match(PublicKey _publicKey, int _u16) implements SpotFulfillmentMethod { - + public static final int BYTES = 34; - + public static Match read(final byte[] _data, final int offset) { int i = offset; final var _publicKey = readPubKey(_data, i); @@ -39,7 +39,7 @@ public static Match read(final byte[] _data, final int offset) { final var _u16 = getInt16LE(_data, i); return new Match(_publicKey, _u16); } - + @Override public int write(final byte[] _data, final int offset) { _data[offset] = (byte) ordinal(); @@ -50,15 +50,15 @@ public int write(final byte[] _data, final int offset) { i += 2; return i - offset; } - + @Override public int l() { return 1 + 32 + 2; } - + @Override public int ordinal() { return 1; } } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/SpotInterestRecord.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/SpotInterestRecord.java index 9087697..bc1eff4 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/SpotInterestRecord.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/SpotInterestRecord.java @@ -91,4 +91,4 @@ public int l() { + 4 + 4; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/SpotMarket.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/SpotMarket.java index 91528c8..7cbaebb 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/SpotMarket.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/SpotMarket.java @@ -185,23 +185,23 @@ public record SpotMarket(PublicKey _address, public static final int VAULT_OFFSET = 104; public static final int NAME_OFFSET = 136; public static final int HISTORICAL_ORACLE_DATA_OFFSET = 168; - + public static Filter createPubkeyFilter(final PublicKey pubkey) { return Filter.createMemCompFilter(PUBKEY_OFFSET, pubkey); } - + public static Filter createOracleFilter(final PublicKey oracle) { return Filter.createMemCompFilter(ORACLE_OFFSET, oracle); } - + public static Filter createMintFilter(final PublicKey mint) { return Filter.createMemCompFilter(MINT_OFFSET, mint); } - + public static Filter createVaultFilter(final PublicKey vault) { return Filter.createMemCompFilter(VAULT_OFFSET, vault); } - + public static Filter createHistoricalOracleDataFilter(final HistoricalOracleData historicalOracleData) { return Filter.createMemCompFilter(HISTORICAL_ORACLE_DATA_OFFSET, historicalOracleData.write()); } @@ -209,13 +209,13 @@ public static Filter createHistoricalOracleDataFilter(final HistoricalOracleData public static SpotMarket read(final byte[] _data, final int offset) { return read(null, _data, offset); } - + public static SpotMarket read(final PublicKey _address, final byte[] _data) { return read(_address, _data, 0); } - + public static final BiFunction FACTORY = SpotMarket::read; - + public static SpotMarket read(final PublicKey _address, final byte[] _data, final int offset) { final byte[] discriminator = parseDiscriminator(_data, offset); int i = offset + discriminator.length; @@ -564,4 +564,4 @@ public int l() { + 1 + Borsh.fixedLen(padding); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/SpotPosition.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/SpotPosition.java index bfe9fca..4fe0886 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/SpotPosition.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/SpotPosition.java @@ -88,4 +88,4 @@ public int l() { + 1 + Borsh.fixedLen(padding); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/State.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/State.java index ef460e1..bde3683 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/State.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/State.java @@ -71,117 +71,117 @@ public record State(PublicKey _address, public static final int MAX_NUMBER_OF_SUB_ACCOUNTS_OFFSET = 474; public static final int MAX_INITIALIZE_USER_FEE_OFFSET = 476; public static final int PADDING_OFFSET = 478; - + public static Filter createAdminFilter(final PublicKey admin) { return Filter.createMemCompFilter(ADMIN_OFFSET, admin); } - + public static Filter createWhitelistMintFilter(final PublicKey whitelistMint) { return Filter.createMemCompFilter(WHITELIST_MINT_OFFSET, whitelistMint); } - + public static Filter createDiscountMintFilter(final PublicKey discountMint) { return Filter.createMemCompFilter(DISCOUNT_MINT_OFFSET, discountMint); } - + public static Filter createSignerFilter(final PublicKey signer) { return Filter.createMemCompFilter(SIGNER_OFFSET, signer); } - + public static Filter createSrmVaultFilter(final PublicKey srmVault) { return Filter.createMemCompFilter(SRM_VAULT_OFFSET, srmVault); } - + public static Filter createPerpFeeStructureFilter(final FeeStructure perpFeeStructure) { return Filter.createMemCompFilter(PERP_FEE_STRUCTURE_OFFSET, perpFeeStructure.write()); } - + public static Filter createSpotFeeStructureFilter(final FeeStructure spotFeeStructure) { return Filter.createMemCompFilter(SPOT_FEE_STRUCTURE_OFFSET, spotFeeStructure.write()); } - + public static Filter createOracleGuardRailsFilter(final OracleGuardRails oracleGuardRails) { return Filter.createMemCompFilter(ORACLE_GUARD_RAILS_OFFSET, oracleGuardRails.write()); } - + public static Filter createNumberOfAuthoritiesFilter(final long numberOfAuthorities) { final byte[] _data = new byte[8]; putInt64LE(_data, 0, numberOfAuthorities); return Filter.createMemCompFilter(NUMBER_OF_AUTHORITIES_OFFSET, _data); } - + public static Filter createNumberOfSubAccountsFilter(final long numberOfSubAccounts) { final byte[] _data = new byte[8]; putInt64LE(_data, 0, numberOfSubAccounts); return Filter.createMemCompFilter(NUMBER_OF_SUB_ACCOUNTS_OFFSET, _data); } - + public static Filter createLpCooldownTimeFilter(final long lpCooldownTime) { final byte[] _data = new byte[8]; putInt64LE(_data, 0, lpCooldownTime); return Filter.createMemCompFilter(LP_COOLDOWN_TIME_OFFSET, _data); } - + public static Filter createLiquidationMarginBufferRatioFilter(final int liquidationMarginBufferRatio) { final byte[] _data = new byte[4]; putInt32LE(_data, 0, liquidationMarginBufferRatio); return Filter.createMemCompFilter(LIQUIDATION_MARGIN_BUFFER_RATIO_OFFSET, _data); } - + public static Filter createSettlementDurationFilter(final int settlementDuration) { final byte[] _data = new byte[2]; putInt16LE(_data, 0, settlementDuration); return Filter.createMemCompFilter(SETTLEMENT_DURATION_OFFSET, _data); } - + public static Filter createNumberOfMarketsFilter(final int numberOfMarkets) { final byte[] _data = new byte[2]; putInt16LE(_data, 0, numberOfMarkets); return Filter.createMemCompFilter(NUMBER_OF_MARKETS_OFFSET, _data); } - + public static Filter createNumberOfSpotMarketsFilter(final int numberOfSpotMarkets) { final byte[] _data = new byte[2]; putInt16LE(_data, 0, numberOfSpotMarkets); return Filter.createMemCompFilter(NUMBER_OF_SPOT_MARKETS_OFFSET, _data); } - + public static Filter createSignerNonceFilter(final int signerNonce) { return Filter.createMemCompFilter(SIGNER_NONCE_OFFSET, new byte[]{(byte) signerNonce}); } - + public static Filter createMinPerpAuctionDurationFilter(final int minPerpAuctionDuration) { return Filter.createMemCompFilter(MIN_PERP_AUCTION_DURATION_OFFSET, new byte[]{(byte) minPerpAuctionDuration}); } - + public static Filter createDefaultMarketOrderTimeInForceFilter(final int defaultMarketOrderTimeInForce) { return Filter.createMemCompFilter(DEFAULT_MARKET_ORDER_TIME_IN_FORCE_OFFSET, new byte[]{(byte) defaultMarketOrderTimeInForce}); } - + public static Filter createDefaultSpotAuctionDurationFilter(final int defaultSpotAuctionDuration) { return Filter.createMemCompFilter(DEFAULT_SPOT_AUCTION_DURATION_OFFSET, new byte[]{(byte) defaultSpotAuctionDuration}); } - + public static Filter createExchangeStatusFilter(final int exchangeStatus) { return Filter.createMemCompFilter(EXCHANGE_STATUS_OFFSET, new byte[]{(byte) exchangeStatus}); } - + public static Filter createLiquidationDurationFilter(final int liquidationDuration) { return Filter.createMemCompFilter(LIQUIDATION_DURATION_OFFSET, new byte[]{(byte) liquidationDuration}); } - + public static Filter createInitialPctToLiquidateFilter(final int initialPctToLiquidate) { final byte[] _data = new byte[2]; putInt16LE(_data, 0, initialPctToLiquidate); return Filter.createMemCompFilter(INITIAL_PCT_TO_LIQUIDATE_OFFSET, _data); } - + public static Filter createMaxNumberOfSubAccountsFilter(final int maxNumberOfSubAccounts) { final byte[] _data = new byte[2]; putInt16LE(_data, 0, maxNumberOfSubAccounts); return Filter.createMemCompFilter(MAX_NUMBER_OF_SUB_ACCOUNTS_OFFSET, _data); } - + public static Filter createMaxInitializeUserFeeFilter(final int maxInitializeUserFee) { final byte[] _data = new byte[2]; putInt16LE(_data, 0, maxInitializeUserFee); @@ -191,13 +191,13 @@ public static Filter createMaxInitializeUserFeeFilter(final int maxInitializeUse public static State read(final byte[] _data, final int offset) { return read(null, _data, offset); } - + public static State read(final PublicKey _address, final byte[] _data) { return read(_address, _data, 0); } - + public static final BiFunction FACTORY = State::read; - + public static State read(final PublicKey _address, final byte[] _data, final int offset) { final byte[] discriminator = parseDiscriminator(_data, offset); int i = offset + discriminator.length; @@ -360,4 +360,4 @@ public int l() { + 2 + Borsh.fixedLen(padding); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/SwapRecord.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/SwapRecord.java index 386c583..b611ad1 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/SwapRecord.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/SwapRecord.java @@ -87,4 +87,4 @@ public int l() { + 8 + 8; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/UpdatePerpMarketSummaryStatsParams.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/UpdatePerpMarketSummaryStatsParams.java index 8e5d163..df828d0 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/UpdatePerpMarketSummaryStatsParams.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/UpdatePerpMarketSummaryStatsParams.java @@ -40,4 +40,4 @@ public int write(final byte[] _data, final int offset) { public int l() { return 9 + 9 + 2; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/User.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/User.java index 0b07059..3010ab2 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/User.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/User.java @@ -84,11 +84,11 @@ public record User(PublicKey _address, public static final int DELEGATE_OFFSET = 40; public static final int NAME_OFFSET = 72; public static final int SPOT_POSITIONS_OFFSET = 104; - + public static Filter createAuthorityFilter(final PublicKey authority) { return Filter.createMemCompFilter(AUTHORITY_OFFSET, authority); } - + public static Filter createDelegateFilter(final PublicKey delegate) { return Filter.createMemCompFilter(DELEGATE_OFFSET, delegate); } @@ -96,13 +96,13 @@ public static Filter createDelegateFilter(final PublicKey delegate) { public static User read(final byte[] _data, final int offset) { return read(null, _data, offset); } - + public static User read(final PublicKey _address, final byte[] _data) { return read(_address, _data, 0); } - + public static final BiFunction FACTORY = User::read; - + public static User read(final PublicKey _address, final byte[] _data, final int offset) { final byte[] discriminator = parseDiscriminator(_data, offset); int i = offset + discriminator.length; @@ -276,4 +276,4 @@ public int l() { + 1 + Borsh.fixedLen(padding); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/UserFees.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/UserFees.java index 2a4b022..518bb59 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/UserFees.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/UserFees.java @@ -74,4 +74,4 @@ public int l() { + 8 + 8; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/UserStats.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/UserStats.java index 8ccd72a..25914e5 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/UserStats.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/UserStats.java @@ -54,15 +54,15 @@ public record UserStats(PublicKey _address, public static final int AUTHORITY_OFFSET = 8; public static final int REFERRER_OFFSET = 40; public static final int FEES_OFFSET = 72; - + public static Filter createAuthorityFilter(final PublicKey authority) { return Filter.createMemCompFilter(AUTHORITY_OFFSET, authority); } - + public static Filter createReferrerFilter(final PublicKey referrer) { return Filter.createMemCompFilter(REFERRER_OFFSET, referrer); } - + public static Filter createFeesFilter(final UserFees fees) { return Filter.createMemCompFilter(FEES_OFFSET, fees.write()); } @@ -70,13 +70,13 @@ public static Filter createFeesFilter(final UserFees fees) { public static UserStats read(final byte[] _data, final int offset) { return read(null, _data, offset); } - + public static UserStats read(final PublicKey _address, final byte[] _data) { return read(_address, _data, 0); } - + public static final BiFunction FACTORY = UserStats::read; - + public static UserStats read(final PublicKey _address, final byte[] _data, final int offset) { final byte[] discriminator = parseDiscriminator(_data, offset); int i = offset + discriminator.length; @@ -187,4 +187,4 @@ public int l() { + 1 + Borsh.fixedLen(padding); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/ValidityGuardRails.java b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/ValidityGuardRails.java index 89a76b1..c6b5fd2 100644 --- a/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/ValidityGuardRails.java +++ b/programs/src/main/java/software/sava/anchor/programs/drift/anchor/types/ValidityGuardRails.java @@ -45,4 +45,4 @@ public int write(final byte[] _data, final int offset) { public int l() { return 8 + 8 + 8 + 8; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/glam/anchor/GlamProgram.java b/programs/src/main/java/software/sava/anchor/programs/glam/anchor/GlamProgram.java index 0af8200..0123125 100644 --- a/programs/src/main/java/software/sava/anchor/programs/glam/anchor/GlamProgram.java +++ b/programs/src/main/java/software/sava/anchor/programs/glam/anchor/GlamProgram.java @@ -39,7 +39,7 @@ public static Instruction initialize(final AccountMeta invokedGlamProgramMeta, final byte[] _data = new byte[8 + Borsh.len(fund)]; int i = writeDiscriminator(INITIALIZE_DISCRIMINATOR, _data, 0); Borsh.write(fund, _data, i); - + return Instruction.createInstruction(invokedGlamProgramMeta, keys, _data); } @@ -65,7 +65,7 @@ public static Instruction addShareClass(final AccountMeta invokedGlamProgramMeta final byte[] _data = new byte[8 + Borsh.len(shareClassMetadata)]; int i = writeDiscriminator(ADD_SHARE_CLASS_DISCRIMINATOR, _data, 0); Borsh.write(shareClassMetadata, _data, i); - + return Instruction.createInstruction(invokedGlamProgramMeta, keys, _data); } @@ -83,7 +83,7 @@ public static Instruction update(final AccountMeta invokedGlamProgramMeta, final byte[] _data = new byte[8 + Borsh.len(fund)]; int i = writeDiscriminator(UPDATE_DISCRIMINATOR, _data, 0); Borsh.write(fund, _data, i); - + return Instruction.createInstruction(invokedGlamProgramMeta, keys, _data); } @@ -135,7 +135,7 @@ public static Instruction subscribe(final AccountMeta invokedGlamProgramMeta, putInt64LE(_data, i, amount); i += 8; _data[i] = (byte) (skipState ? 1 : 0); - + return Instruction.createInstruction(invokedGlamProgramMeta, keys, _data); } @@ -169,7 +169,7 @@ public static Instruction redeem(final AccountMeta invokedGlamProgramMeta, _data[i] = (byte) (inKind ? 1 : 0); ++i; _data[i] = (byte) (skipState ? 1 : 0); - + return Instruction.createInstruction(invokedGlamProgramMeta, keys, _data); } @@ -201,7 +201,7 @@ public static Instruction driftInitialize(final AccountMeta invokedGlamProgramMe final byte[] _data = new byte[41]; int i = writeDiscriminator(DRIFT_INITIALIZE_DISCRIMINATOR, _data, 0); Borsh.writeOptional(trader, _data, i); - + return Instruction.createInstruction(invokedGlamProgramMeta, keys, _data); } @@ -225,7 +225,7 @@ public static Instruction driftUpdateDelegatedTrader(final AccountMeta invokedGl final byte[] _data = new byte[41]; int i = writeDiscriminator(DRIFT_UPDATE_DELEGATED_TRADER_DISCRIMINATOR, _data, 0); Borsh.writeOptional(trader, _data, i); - + return Instruction.createInstruction(invokedGlamProgramMeta, keys, _data); } @@ -259,7 +259,7 @@ public static Instruction driftDeposit(final AccountMeta invokedGlamProgramMeta, final byte[] _data = new byte[16]; int i = writeDiscriminator(DRIFT_DEPOSIT_DISCRIMINATOR, _data, 0); putInt64LE(_data, i, amount); - + return Instruction.createInstruction(invokedGlamProgramMeta, keys, _data); } @@ -295,7 +295,7 @@ public static Instruction driftWithdraw(final AccountMeta invokedGlamProgramMeta final byte[] _data = new byte[16]; int i = writeDiscriminator(DRIFT_WITHDRAW_DISCRIMINATOR, _data, 0); putInt64LE(_data, i, amount); - + return Instruction.createInstruction(invokedGlamProgramMeta, keys, _data); } @@ -364,7 +364,7 @@ public static Instruction marinadeDeposit(final AccountMeta invokedGlamProgramMe final byte[] _data = new byte[16]; int i = writeDiscriminator(MARINADE_DEPOSIT_DISCRIMINATOR, _data, 0); putInt64LE(_data, i, solAmount); - + return Instruction.createInstruction(invokedGlamProgramMeta, keys, _data); } @@ -404,7 +404,7 @@ public static Instruction marinadeLiquidUnstake(final AccountMeta invokedGlamPro final byte[] _data = new byte[16]; int i = writeDiscriminator(MARINADE_LIQUID_UNSTAKE_DISCRIMINATOR, _data, 0); putInt64LE(_data, i, solAmount); - + return Instruction.createInstruction(invokedGlamProgramMeta, keys, _data); } @@ -451,7 +451,7 @@ public static Instruction marinadeDelayedUnstake(final AccountMeta invokedGlamPr _data[i] = (byte) bump; ++i; Borsh.write(_ticketId, _data, i); - + return Instruction.createInstruction(invokedGlamProgramMeta, keys, _data); } @@ -520,7 +520,7 @@ public static Instruction stakePoolDeposit(final AccountMeta invokedGlamProgramM final byte[] _data = new byte[16]; int i = writeDiscriminator(STAKE_POOL_DEPOSIT_DISCRIMINATOR, _data, 0); putInt64LE(_data, i, lamports); - + return Instruction.createInstruction(invokedGlamProgramMeta, keys, _data); } @@ -564,7 +564,7 @@ public static Instruction stakePoolWithdrawSol(final AccountMeta invokedGlamProg final byte[] _data = new byte[16]; int i = writeDiscriminator(STAKE_POOL_WITHDRAW_SOL_DISCRIMINATOR, _data, 0); putInt64LE(_data, i, lamports); - + return Instruction.createInstruction(invokedGlamProgramMeta, keys, _data); } @@ -616,7 +616,7 @@ public static Instruction stakePoolWithdrawStake(final AccountMeta invokedGlamPr i += 8; i += Borsh.write(_stakeAccountId, _data, i); _data[i] = (byte) stakeAccountBump; - + return Instruction.createInstruction(invokedGlamProgramMeta, keys, _data); } @@ -658,7 +658,7 @@ public static Instruction nativeStakeDeposit(final AccountMeta invokedGlamProgra i += 8; i += Borsh.write(_stakeAccountId, _data, i); _data[i] = (byte) stakeAccountBump; - + return Instruction.createInstruction(invokedGlamProgramMeta, keys, _data); } @@ -744,7 +744,7 @@ public static Instruction jupiterSwap(final AccountMeta invokedGlamProgramMeta, putInt64LE(_data, i, amount); i += 8; Borsh.write(data, _data, i); - + return Instruction.createInstruction(invokedGlamProgramMeta, keys, _data); } @@ -774,7 +774,7 @@ public static Instruction wsolWrap(final AccountMeta invokedGlamProgramMeta, final byte[] _data = new byte[16]; int i = writeDiscriminator(WSOL_WRAP_DISCRIMINATOR, _data, 0); putInt64LE(_data, i, amount); - + return Instruction.createInstruction(invokedGlamProgramMeta, keys, _data); } diff --git a/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/Acl.java b/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/Acl.java index 4d952ab..9db02ec 100644 --- a/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/Acl.java +++ b/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/Acl.java @@ -29,4 +29,4 @@ public int write(final byte[] _data, final int offset) { public int l() { return 32 + Borsh.len(permissions); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/CompanyField.java b/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/CompanyField.java index 5ad0f3a..bcf0f25 100644 --- a/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/CompanyField.java +++ b/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/CompanyField.java @@ -33,4 +33,4 @@ public int write(final byte[] _data, final int offset) { public int l() { return Borsh.len(name) + Borsh.len(_value); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/CompanyModel.java b/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/CompanyModel.java index 03a79d5..997c984 100644 --- a/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/CompanyModel.java +++ b/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/CompanyModel.java @@ -70,4 +70,4 @@ public int l() { + Borsh.lenOptional(_emailAddressOfManCo) + Borsh.lenOptional(_fundWebsiteOfManCo); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/CreatedModel.java b/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/CreatedModel.java index 3368da9..10f90e6 100644 --- a/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/CreatedModel.java +++ b/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/CreatedModel.java @@ -28,4 +28,4 @@ public int write(final byte[] _data, final int offset) { public int l() { return Borsh.fixedLen(key) + Borsh.lenOptional(manager, 32); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/EngineField.java b/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/EngineField.java index d77f2b1..9f693df 100644 --- a/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/EngineField.java +++ b/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/EngineField.java @@ -26,4 +26,4 @@ public int write(final byte[] _data, final int offset) { public int l() { return Borsh.len(name) + Borsh.len(value); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/EngineFieldValue.java b/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/EngineFieldValue.java index 1a1a292..1512cb4 100644 --- a/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/EngineFieldValue.java +++ b/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/EngineFieldValue.java @@ -26,7 +26,7 @@ public sealed interface EngineFieldValue extends RustEnum permits EngineFieldValue.VecPubkey, EngineFieldValue.VecU32, EngineFieldValue.VecAcl { - + static EngineFieldValue read(final byte[] _data, final int offset) { final int ordinal = _data[offset] & 0xFF; int i = offset + 1; @@ -51,11 +51,11 @@ static EngineFieldValue read(final byte[] _data, final int offset) { } record Boolean(boolean val) implements EnumBool, EngineFieldValue { - + public static Boolean read(final byte[] _data, int i) { return new Boolean(_data[i] == 1); } - + @Override public int ordinal() { return 0; @@ -63,15 +63,15 @@ public int ordinal() { } record Date(byte[] val, java.lang.String _val) implements EnumString, EngineFieldValue { - + public static Date createRecord(final java.lang.String val) { return new Date(val.getBytes(UTF_8), val); } - + public static Date read(final byte[] data, final int offset) { return createRecord(Borsh.string(data, offset)); } - + @Override public int ordinal() { return 1; @@ -79,11 +79,11 @@ public int ordinal() { } record Double(long val) implements EnumInt64, EngineFieldValue { - + public static Double read(final byte[] _data, int i) { return new Double(getInt64LE(_data, i)); } - + @Override public int ordinal() { return 2; @@ -91,11 +91,11 @@ public int ordinal() { } record Integer(int val) implements EnumInt32, EngineFieldValue { - + public static Integer read(final byte[] _data, int i) { return new Integer(getInt32LE(_data, i)); } - + @Override public int ordinal() { return 3; @@ -103,15 +103,15 @@ public int ordinal() { } record String(byte[] val, java.lang.String _val) implements EnumString, EngineFieldValue { - + public static String createRecord(final java.lang.String val) { return new String(val.getBytes(UTF_8), val); } - + public static String read(final byte[] data, final int offset) { return createRecord(Borsh.string(data, offset)); } - + @Override public int ordinal() { return 4; @@ -119,15 +119,15 @@ public int ordinal() { } record Time(byte[] val, java.lang.String _val) implements EnumString, EngineFieldValue { - + public static Time createRecord(final java.lang.String val) { return new Time(val.getBytes(UTF_8), val); } - + public static Time read(final byte[] data, final int offset) { return createRecord(Borsh.string(data, offset)); } - + @Override public int ordinal() { return 5; @@ -135,11 +135,11 @@ public int ordinal() { } record U8(int val) implements EnumInt8, EngineFieldValue { - + public static U8 read(final byte[] _data, int i) { return new U8(_data[i] & 0xFF); } - + @Override public int ordinal() { return 6; @@ -147,11 +147,11 @@ public int ordinal() { } record U64(long val) implements EnumInt64, EngineFieldValue { - + public static U64 read(final byte[] _data, int i) { return new U64(getInt64LE(_data, i)); } - + @Override public int ordinal() { return 7; @@ -159,11 +159,11 @@ public int ordinal() { } record Pubkey(PublicKey val) implements EnumPublicKey, EngineFieldValue { - + public static Pubkey read(final byte[] _data, int i) { return new Pubkey(readPubKey(_data, i)); } - + @Override public int ordinal() { return 8; @@ -171,11 +171,11 @@ public int ordinal() { } record Percentage(int val) implements EnumInt32, EngineFieldValue { - + public static Percentage read(final byte[] _data, int i) { return new Percentage(getInt32LE(_data, i)); } - + @Override public int ordinal() { return 9; @@ -183,15 +183,15 @@ public int ordinal() { } record URI(byte[] val, java.lang.String _val) implements EnumString, EngineFieldValue { - + public static URI createRecord(final java.lang.String val) { return new URI(val.getBytes(UTF_8), val); } - + public static URI read(final byte[] data, final int offset) { return createRecord(Borsh.string(data, offset)); } - + @Override public int ordinal() { return 10; @@ -199,11 +199,11 @@ public int ordinal() { } record Timestamp(long val) implements EnumInt64, EngineFieldValue { - + public static Timestamp read(final byte[] _data, int i) { return new Timestamp(getInt64LE(_data, i)); } - + @Override public int ordinal() { return 11; @@ -211,14 +211,14 @@ public int ordinal() { } record VecPubkey(PublicKey[] val) implements EngineFieldValue { - - + + public static VecPubkey read(final byte[] _data, final int offset) { int i = offset; final var val = Borsh.readPublicKeyVector(_data, i); return new VecPubkey(val); } - + @Override public int write(final byte[] _data, final int offset) { _data[offset] = (byte) ordinal(); @@ -226,12 +226,12 @@ public int write(final byte[] _data, final int offset) { i += Borsh.write(val, _data, i); return i - offset; } - + @Override public int l() { return 1 + Borsh.len(val); } - + @Override public int ordinal() { return 12; @@ -239,14 +239,14 @@ public int ordinal() { } record VecU32(int[] val) implements EngineFieldValue { - - + + public static VecU32 read(final byte[] _data, final int offset) { int i = offset; final var val = Borsh.readintVector(_data, i); return new VecU32(val); } - + @Override public int write(final byte[] _data, final int offset) { _data[offset] = (byte) ordinal(); @@ -254,12 +254,12 @@ public int write(final byte[] _data, final int offset) { i += Borsh.write(val, _data, i); return i - offset; } - + @Override public int l() { return 1 + Borsh.len(val); } - + @Override public int ordinal() { return 13; @@ -267,14 +267,14 @@ public int ordinal() { } record VecAcl(Acl[] val) implements EngineFieldValue { - - + + public static VecAcl read(final byte[] _data, final int offset) { int i = offset; final var val = Borsh.readVector(Acl.class, Acl::read, _data, i); return new VecAcl(val); } - + @Override public int write(final byte[] _data, final int offset) { _data[offset] = (byte) ordinal(); @@ -282,15 +282,15 @@ public int write(final byte[] _data, final int offset) { i += Borsh.write(val, _data, i); return i - offset; } - + @Override public int l() { return 1 + Borsh.len(val); } - + @Override public int ordinal() { return 14; } } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/FundAccount.java b/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/FundAccount.java index 53376b6..8b874b2 100644 --- a/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/FundAccount.java +++ b/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/FundAccount.java @@ -27,7 +27,7 @@ public record FundAccount(PublicKey _address, EngineField[][] params) implements Borsh { public static final int NAME_OFFSET = 8; - + public static Filter createNameFilter(final String name) { final byte[] bytes = name.getBytes(UTF_8); final byte[] _data = new byte[4 + bytes.length]; @@ -62,13 +62,13 @@ public static FundAccount createRecord(final PublicKey _address, public static FundAccount read(final byte[] _data, final int offset) { return read(null, _data, offset); } - + public static FundAccount read(final PublicKey _address, final byte[] _data) { return read(_address, _data, 0); } - + public static final BiFunction FACTORY = FundAccount::read; - + public static FundAccount read(final PublicKey _address, final byte[] _data, final int offset) { final byte[] discriminator = parseDiscriminator(_data, offset); int i = offset + discriminator.length; @@ -134,4 +134,4 @@ public int l() { + 32 + Borsh.len(params); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/FundField.java b/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/FundField.java index 4afba7f..076e4bc 100644 --- a/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/FundField.java +++ b/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/FundField.java @@ -33,4 +33,4 @@ public int write(final byte[] _data, final int offset) { public int l() { return Borsh.len(name) + Borsh.len(_value); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/FundManagerField.java b/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/FundManagerField.java index 7a4146f..1d29fe6 100644 --- a/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/FundManagerField.java +++ b/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/FundManagerField.java @@ -33,4 +33,4 @@ public int write(final byte[] _data, final int offset) { public int l() { return Borsh.len(name) + Borsh.len(_value); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/FundMetadataAccount.java b/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/FundMetadataAccount.java index 13e1dd1..51882bb 100644 --- a/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/FundMetadataAccount.java +++ b/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/FundMetadataAccount.java @@ -19,7 +19,7 @@ public record FundMetadataAccount(PublicKey _address, public static final int FUND_PUBKEY_OFFSET = 8; public static final int COMPANY_OFFSET = 40; - + public static Filter createFundPubkeyFilter(final PublicKey fundPubkey) { return Filter.createMemCompFilter(FUND_PUBKEY_OFFSET, fundPubkey); } @@ -27,13 +27,13 @@ public static Filter createFundPubkeyFilter(final PublicKey fundPubkey) { public static FundMetadataAccount read(final byte[] _data, final int offset) { return read(null, _data, offset); } - + public static FundMetadataAccount read(final PublicKey _address, final byte[] _data) { return read(_address, _data, 0); } - + public static final BiFunction FACTORY = FundMetadataAccount::read; - + public static FundMetadataAccount read(final PublicKey _address, final byte[] _data, final int offset) { final byte[] discriminator = parseDiscriminator(_data, offset); int i = offset + discriminator.length; @@ -76,4 +76,4 @@ public int l() { + Borsh.len(shareClasses) + Borsh.len(fundManagers); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/FundModel.java b/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/FundModel.java index 0d92015..38bf11b 100644 --- a/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/FundModel.java +++ b/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/FundModel.java @@ -155,4 +155,4 @@ public int l() { + 2 + Borsh.lenOptional(rawOpenfunds); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/FundOpenfundsModel.java b/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/FundOpenfundsModel.java index 1765332..cb3790a 100644 --- a/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/FundOpenfundsModel.java +++ b/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/FundOpenfundsModel.java @@ -181,4 +181,4 @@ public int l() { + Borsh.lenOptional(_typeOfEuDirective) + Borsh.lenOptional(_ucitsVersion); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/ManagerModel.java b/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/ManagerModel.java index b8bc359..8baf746 100644 --- a/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/ManagerModel.java +++ b/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/ManagerModel.java @@ -46,4 +46,4 @@ public int write(final byte[] _data, final int offset) { public int l() { return Borsh.lenOptional(_portfolioManagerName) + Borsh.lenOptional(pubkey, 32) + Borsh.lenOptional(kind); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/ShareClassField.java b/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/ShareClassField.java index f993a89..9f04cd6 100644 --- a/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/ShareClassField.java +++ b/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/ShareClassField.java @@ -33,4 +33,4 @@ public int write(final byte[] _data, final int offset) { public int l() { return Borsh.len(name) + Borsh.len(_value); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/ShareClassModel.java b/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/ShareClassModel.java index 2639c3a..a07d559 100644 --- a/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/ShareClassModel.java +++ b/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/ShareClassModel.java @@ -121,4 +121,4 @@ public int l() { + Borsh.len(allowlist) + Borsh.len(blocklist); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/ShareClassOpenfundsModel.java b/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/ShareClassOpenfundsModel.java index 77370cf..97b7077 100644 --- a/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/ShareClassOpenfundsModel.java +++ b/programs/src/main/java/software/sava/anchor/programs/glam/anchor/types/ShareClassOpenfundsModel.java @@ -301,4 +301,4 @@ public int l() { + Borsh.lenOptional(_cusip) + Borsh.lenOptional(_valor); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/MarinadeFinanceProgram.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/MarinadeFinanceProgram.java index b39390a..9562ae9 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/MarinadeFinanceProgram.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/MarinadeFinanceProgram.java @@ -50,7 +50,7 @@ public static Instruction initialize(final AccountMeta invokedMarinadeFinancePro final byte[] _data = new byte[8 + Borsh.len(data)]; int i = writeDiscriminator(INITIALIZE_DISCRIMINATOR, _data, 0); Borsh.write(data, _data, i); - + return Instruction.createInstruction(invokedMarinadeFinanceProgramMeta, keys, _data); } @@ -68,7 +68,7 @@ public static Instruction changeAuthority(final AccountMeta invokedMarinadeFinan final byte[] _data = new byte[8 + Borsh.len(data)]; int i = writeDiscriminator(CHANGE_AUTHORITY_DISCRIMINATOR, _data, 0); Borsh.write(data, _data, i); - + return Instruction.createInstruction(invokedMarinadeFinanceProgramMeta, keys, _data); } @@ -101,7 +101,7 @@ public static Instruction addValidator(final AccountMeta invokedMarinadeFinanceP final byte[] _data = new byte[12]; int i = writeDiscriminator(ADD_VALIDATOR_DISCRIMINATOR, _data, 0); putInt32LE(_data, i, score); - + return Instruction.createInstruction(invokedMarinadeFinanceProgramMeta, keys, _data); } @@ -128,7 +128,7 @@ public static Instruction removeValidator(final AccountMeta invokedMarinadeFinan putInt32LE(_data, i, index); i += 4; validatorVote.write(_data, i); - + return Instruction.createInstruction(invokedMarinadeFinanceProgramMeta, keys, _data); } @@ -154,7 +154,7 @@ public static Instruction setValidatorScore(final AccountMeta invokedMarinadeFin validatorVote.write(_data, i); i += 32; putInt32LE(_data, i, score); - + return Instruction.createInstruction(invokedMarinadeFinanceProgramMeta, keys, _data); } @@ -172,7 +172,7 @@ public static Instruction configValidatorSystem(final AccountMeta invokedMarinad final byte[] _data = new byte[12]; int i = writeDiscriminator(CONFIG_VALIDATOR_SYSTEM_DISCRIMINATOR, _data, 0); putInt32LE(_data, i, extraRuns); - + return Instruction.createInstruction(invokedMarinadeFinanceProgramMeta, keys, _data); } @@ -209,7 +209,7 @@ public static Instruction deposit(final AccountMeta invokedMarinadeFinanceProgra final byte[] _data = new byte[16]; int i = writeDiscriminator(DEPOSIT_DISCRIMINATOR, _data, 0); putInt64LE(_data, i, lamports); - + return Instruction.createInstruction(invokedMarinadeFinanceProgramMeta, keys, _data); } @@ -254,7 +254,7 @@ public static Instruction depositStakeAccount(final AccountMeta invokedMarinadeF final byte[] _data = new byte[12]; int i = writeDiscriminator(DEPOSIT_STAKE_ACCOUNT_DISCRIMINATOR, _data, 0); putInt32LE(_data, i, validatorIndex); - + return Instruction.createInstruction(invokedMarinadeFinanceProgramMeta, keys, _data); } @@ -288,7 +288,7 @@ public static Instruction liquidUnstake(final AccountMeta invokedMarinadeFinance final byte[] _data = new byte[16]; int i = writeDiscriminator(LIQUID_UNSTAKE_DISCRIMINATOR, _data, 0); putInt64LE(_data, i, msolAmount); - + return Instruction.createInstruction(invokedMarinadeFinanceProgramMeta, keys, _data); } @@ -320,7 +320,7 @@ public static Instruction addLiquidity(final AccountMeta invokedMarinadeFinanceP final byte[] _data = new byte[16]; int i = writeDiscriminator(ADD_LIQUIDITY_DISCRIMINATOR, _data, 0); putInt64LE(_data, i, lamports); - + return Instruction.createInstruction(invokedMarinadeFinanceProgramMeta, keys, _data); } @@ -356,7 +356,7 @@ public static Instruction removeLiquidity(final AccountMeta invokedMarinadeFinan final byte[] _data = new byte[16]; int i = writeDiscriminator(REMOVE_LIQUIDITY_DISCRIMINATOR, _data, 0); putInt64LE(_data, i, tokens); - + return Instruction.createInstruction(invokedMarinadeFinanceProgramMeta, keys, _data); } @@ -374,7 +374,7 @@ public static Instruction configLp(final AccountMeta invokedMarinadeFinanceProgr final byte[] _data = new byte[8 + Borsh.len(params)]; int i = writeDiscriminator(CONFIG_LP_DISCRIMINATOR, _data, 0); Borsh.write(params, _data, i); - + return Instruction.createInstruction(invokedMarinadeFinanceProgramMeta, keys, _data); } @@ -392,7 +392,7 @@ public static Instruction configMarinade(final AccountMeta invokedMarinadeFinanc final byte[] _data = new byte[8 + Borsh.len(params)]; int i = writeDiscriminator(CONFIG_MARINADE_DISCRIMINATOR, _data, 0); Borsh.write(params, _data, i); - + return Instruction.createInstruction(invokedMarinadeFinanceProgramMeta, keys, _data); } @@ -422,7 +422,7 @@ public static Instruction orderUnstake(final AccountMeta invokedMarinadeFinanceP final byte[] _data = new byte[16]; int i = writeDiscriminator(ORDER_UNSTAKE_DISCRIMINATOR, _data, 0); putInt64LE(_data, i, msolAmount); - + return Instruction.createInstruction(invokedMarinadeFinanceProgramMeta, keys, _data); } @@ -487,7 +487,7 @@ public static Instruction stakeReserve(final AccountMeta invokedMarinadeFinanceP final byte[] _data = new byte[12]; int i = writeDiscriminator(STAKE_RESERVE_DISCRIMINATOR, _data, 0); putInt32LE(_data, i, validatorIndex); - + return Instruction.createInstruction(invokedMarinadeFinanceProgramMeta, keys, _data); } @@ -508,7 +508,7 @@ public static Instruction updateActive(final AccountMeta invokedMarinadeFinanceP putInt32LE(_data, i, stakeIndex); i += 4; putInt32LE(_data, i, validatorIndex); - + return Instruction.createInstruction(invokedMarinadeFinanceProgramMeta, keys, _data); } @@ -528,7 +528,7 @@ public static Instruction updateDeactivated(final AccountMeta invokedMarinadeFin final byte[] _data = new byte[12]; int i = writeDiscriminator(UPDATE_DEACTIVATED_DISCRIMINATOR, _data, 0); putInt32LE(_data, i, stakeIndex); - + return Instruction.createInstruction(invokedMarinadeFinanceProgramMeta, keys, _data); } @@ -573,7 +573,7 @@ public static Instruction deactivateStake(final AccountMeta invokedMarinadeFinan putInt32LE(_data, i, stakeIndex); i += 4; putInt32LE(_data, i, validatorIndex); - + return Instruction.createInstruction(invokedMarinadeFinanceProgramMeta, keys, _data); } @@ -606,7 +606,7 @@ public static Instruction emergencyUnstake(final AccountMeta invokedMarinadeFina putInt32LE(_data, i, stakeIndex); i += 4; putInt32LE(_data, i, validatorIndex); - + return Instruction.createInstruction(invokedMarinadeFinanceProgramMeta, keys, _data); } @@ -654,7 +654,7 @@ public static Instruction partialUnstake(final AccountMeta invokedMarinadeFinanc putInt32LE(_data, i, validatorIndex); i += 4; putInt64LE(_data, i, desiredUnstakeAmount); - + return Instruction.createInstruction(invokedMarinadeFinanceProgramMeta, keys, _data); } @@ -696,7 +696,7 @@ public static Instruction mergeStakes(final AccountMeta invokedMarinadeFinancePr putInt32LE(_data, i, sourceStakeIndex); i += 4; putInt32LE(_data, i, validatorIndex); - + return Instruction.createInstruction(invokedMarinadeFinanceProgramMeta, keys, _data); } @@ -746,7 +746,7 @@ public static Instruction redelegate(final AccountMeta invokedMarinadeFinancePro putInt32LE(_data, i, sourceValidatorIndex); i += 4; putInt32LE(_data, i, destValidatorIndex); - + return Instruction.createInstruction(invokedMarinadeFinanceProgramMeta, keys, _data); } @@ -823,7 +823,7 @@ public static Instruction withdrawStakeAccount(final AccountMeta invokedMarinade putInt64LE(_data, i, msolAmount); i += 8; beneficiary.write(_data, i); - + return Instruction.createInstruction(invokedMarinadeFinanceProgramMeta, keys, _data); } @@ -847,7 +847,7 @@ public static Instruction reallocValidatorList(final AccountMeta invokedMarinade final byte[] _data = new byte[12]; int i = writeDiscriminator(REALLOC_VALIDATOR_LIST_DISCRIMINATOR, _data, 0); putInt32LE(_data, i, capacity); - + return Instruction.createInstruction(invokedMarinadeFinanceProgramMeta, keys, _data); } @@ -871,7 +871,7 @@ public static Instruction reallocStakeList(final AccountMeta invokedMarinadeFina final byte[] _data = new byte[12]; int i = writeDiscriminator(REALLOC_STAKE_LIST_DISCRIMINATOR, _data, 0); putInt32LE(_data, i, capacity); - + return Instruction.createInstruction(invokedMarinadeFinanceProgramMeta, keys, _data); } diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/AddLiquidityEvent.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/AddLiquidityEvent.java index 8b5a5f2..042881b 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/AddLiquidityEvent.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/AddLiquidityEvent.java @@ -92,4 +92,4 @@ public int l() { + 8 + 8; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/AddValidatorEvent.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/AddValidatorEvent.java index f702bb2..bec3b3c 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/AddValidatorEvent.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/AddValidatorEvent.java @@ -47,4 +47,4 @@ public int write(final byte[] _data, final int offset) { public int l() { return 32 + 32 + 4 + 4; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/BoolValueChange.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/BoolValueChange.java index 4239fe0..bd0d40a 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/BoolValueChange.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/BoolValueChange.java @@ -28,4 +28,4 @@ public int write(final byte[] _data, final int offset) { public int l() { return 1 + 1; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ChangeAuthorityData.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ChangeAuthorityData.java index 091990e..a915a31 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ChangeAuthorityData.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ChangeAuthorityData.java @@ -57,4 +57,4 @@ public int l() { + Borsh.lenOptional(treasuryMsolAccount, 32) + Borsh.lenOptional(pauseAuthority, 32); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ChangeAuthorityEvent.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ChangeAuthorityEvent.java index 98c7714..0a7a198 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ChangeAuthorityEvent.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ChangeAuthorityEvent.java @@ -64,4 +64,4 @@ public int l() { + Borsh.lenOptional(treasuryMsolAccountChange) + Borsh.lenOptional(pauseAuthorityChange); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ClaimEvent.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ClaimEvent.java index 1b72df9..2edf4fa 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ClaimEvent.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ClaimEvent.java @@ -85,4 +85,4 @@ public int l() { + 8 + 8; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ConfigLpEvent.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ConfigLpEvent.java index 193cf21..755c2e8 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ConfigLpEvent.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ConfigLpEvent.java @@ -56,4 +56,4 @@ public int l() { + Borsh.lenOptional(liquidityTargetChange) + Borsh.lenOptional(treasuryCutChange); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ConfigLpParams.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ConfigLpParams.java index 254d740..8df13c5 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ConfigLpParams.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ConfigLpParams.java @@ -47,4 +47,4 @@ public int write(final byte[] _data, final int offset) { public int l() { return Borsh.lenOptional(minFee) + Borsh.lenOptional(maxFee) + 9 + Borsh.lenOptional(treasuryCut); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ConfigMarinadeEvent.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ConfigMarinadeEvent.java index 3c319a3..bcd4112 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ConfigMarinadeEvent.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ConfigMarinadeEvent.java @@ -112,4 +112,4 @@ public int l() { + Borsh.lenOptional(withdrawStakeAccountFeeChange) + Borsh.lenOptional(maxStakeMovedPerEpochChange); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ConfigMarinadeParams.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ConfigMarinadeParams.java index a8598a0..ea9dbb7 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ConfigMarinadeParams.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ConfigMarinadeParams.java @@ -108,4 +108,4 @@ public int l() { + Borsh.lenOptional(withdrawStakeAccountFee) + Borsh.lenOptional(maxStakeMovedPerEpoch); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/DeactivateStakeEvent.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/DeactivateStakeEvent.java index f67ec01..37a7f79 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/DeactivateStakeEvent.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/DeactivateStakeEvent.java @@ -129,4 +129,4 @@ public int l() { + 8 + 8; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/DepositEvent.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/DepositEvent.java index 3d572e3..2684923 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/DepositEvent.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/DepositEvent.java @@ -113,4 +113,4 @@ public int l() { + 8 + 8; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/DepositStakeAccountEvent.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/DepositStakeAccountEvent.java index aa01461..f0be940 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/DepositStakeAccountEvent.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/DepositStakeAccountEvent.java @@ -115,4 +115,4 @@ public int l() { + 8 + 8; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/EmergencyPauseEvent.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/EmergencyPauseEvent.java index b8bd665..8c908bd 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/EmergencyPauseEvent.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/EmergencyPauseEvent.java @@ -27,4 +27,4 @@ public int write(final byte[] _data, final int offset) { public int l() { return 32; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/Fee.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/Fee.java index af47ff1..8e70790 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/Fee.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/Fee.java @@ -27,4 +27,4 @@ public int write(final byte[] _data, final int offset) { public int l() { return 4; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/FeeCents.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/FeeCents.java index ae7c65a..6594bf7 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/FeeCents.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/FeeCents.java @@ -29,4 +29,4 @@ public int write(final byte[] _data, final int offset) { public int l() { return 4; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/FeeCentsValueChange.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/FeeCentsValueChange.java index 5569b9a..18864fd 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/FeeCentsValueChange.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/FeeCentsValueChange.java @@ -25,4 +25,4 @@ public int write(final byte[] _data, final int offset) { public int l() { return Borsh.len(old) + Borsh.len(_new); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/FeeValueChange.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/FeeValueChange.java index 938f1ad..9dcbc04 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/FeeValueChange.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/FeeValueChange.java @@ -25,4 +25,4 @@ public int write(final byte[] _data, final int offset) { public int l() { return Borsh.len(old) + Borsh.len(_new); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/InitializeData.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/InitializeData.java index e9b1575..9a49925 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/InitializeData.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/InitializeData.java @@ -84,4 +84,4 @@ public int l() { + 8 + 32; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/InitializeEvent.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/InitializeEvent.java index 5fdcfbc..d05c4fd 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/InitializeEvent.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/InitializeEvent.java @@ -82,4 +82,4 @@ public int l() { + 32 + 32; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/LiqPool.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/LiqPool.java index c9daf42..ea1e4bb 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/LiqPool.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/LiqPool.java @@ -106,4 +106,4 @@ public int l() { + 8 + 8; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/LiqPoolInitializeData.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/LiqPoolInitializeData.java index 39d69b7..3060824 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/LiqPoolInitializeData.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/LiqPoolInitializeData.java @@ -41,4 +41,4 @@ public int write(final byte[] _data, final int offset) { public int l() { return 8 + Borsh.len(lpMaxFee) + Borsh.len(lpMinFee) + Borsh.len(lpTreasuryCut); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/LiquidUnstakeEvent.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/LiquidUnstakeEvent.java index b16c5d2..960d86c 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/LiquidUnstakeEvent.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/LiquidUnstakeEvent.java @@ -126,4 +126,4 @@ public int l() { + Borsh.len(lpMinFee) + Borsh.len(treasuryCut); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/List.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/List.java index 678090c..e9e407f 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/List.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/List.java @@ -57,4 +57,4 @@ public int l() { + 32 + 4; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/MergeStakesEvent.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/MergeStakesEvent.java index 2d0f467..ba62432 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/MergeStakesEvent.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/MergeStakesEvent.java @@ -129,4 +129,4 @@ public int l() { + 8 + 8; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/OrderUnstakeEvent.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/OrderUnstakeEvent.java index 0132f89..f3a66d2 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/OrderUnstakeEvent.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/OrderUnstakeEvent.java @@ -108,4 +108,4 @@ public int l() { + 8 + 8; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/PubkeyValueChange.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/PubkeyValueChange.java index ac27de4..ecc68a4 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/PubkeyValueChange.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/PubkeyValueChange.java @@ -31,4 +31,4 @@ public int write(final byte[] _data, final int offset) { public int l() { return 32 + 32; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ReallocStakeListEvent.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ReallocStakeListEvent.java index df4e6d0..d3e7835 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ReallocStakeListEvent.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ReallocStakeListEvent.java @@ -39,4 +39,4 @@ public int write(final byte[] _data, final int offset) { public int l() { return 32 + 4 + 4; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ReallocValidatorListEvent.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ReallocValidatorListEvent.java index cf80015..8930659 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ReallocValidatorListEvent.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ReallocValidatorListEvent.java @@ -39,4 +39,4 @@ public int write(final byte[] _data, final int offset) { public int l() { return 32 + 4 + 4; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/RedelegateEvent.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/RedelegateEvent.java index 7eb61b6..0f7a424 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/RedelegateEvent.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/RedelegateEvent.java @@ -157,4 +157,4 @@ public int l() { + 4 + 32; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/RemoveLiquidityEvent.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/RemoveLiquidityEvent.java index 2b6bb22..256e10b 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/RemoveLiquidityEvent.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/RemoveLiquidityEvent.java @@ -92,4 +92,4 @@ public int l() { + 8 + 8; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/RemoveValidatorEvent.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/RemoveValidatorEvent.java index 83a3cef..3fef32d 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/RemoveValidatorEvent.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/RemoveValidatorEvent.java @@ -49,4 +49,4 @@ public int write(final byte[] _data, final int offset) { public int l() { return 32 + 32 + 4 + 8; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ResumeEvent.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ResumeEvent.java index d32fc25..b52955e 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ResumeEvent.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ResumeEvent.java @@ -27,4 +27,4 @@ public int write(final byte[] _data, final int offset) { public int l() { return 32; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/SetValidatorScoreEvent.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/SetValidatorScoreEvent.java index e50112c..a33f3f5 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/SetValidatorScoreEvent.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/SetValidatorScoreEvent.java @@ -45,4 +45,4 @@ public int write(final byte[] _data, final int offset) { public int l() { return 32 + 32 + 4 + Borsh.len(scoreChange); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/SplitStakeAccountInfo.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/SplitStakeAccountInfo.java index 00ea48b..f296b03 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/SplitStakeAccountInfo.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/SplitStakeAccountInfo.java @@ -33,4 +33,4 @@ public int write(final byte[] _data, final int offset) { public int l() { return 32 + 4; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/StakeList.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/StakeList.java index 7c17d40..a406b10 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/StakeList.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/StakeList.java @@ -5,18 +5,18 @@ public record StakeList() implements Borsh { private static final StakeList INSTANCE = new StakeList(); - + public static StakeList read(final byte[] _data, final int offset) { return INSTANCE; } - + @Override public int write(final byte[] _data, final int offset) { return 0; } - + @Override public int l() { return 0; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/StakeRecord.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/StakeRecord.java index eca1aac..e4b12ab 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/StakeRecord.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/StakeRecord.java @@ -47,4 +47,4 @@ public int write(final byte[] _data, final int offset) { public int l() { return 32 + 8 + 8 + 1; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/StakeReserveEvent.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/StakeReserveEvent.java index d049d93..1dd892a 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/StakeReserveEvent.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/StakeReserveEvent.java @@ -115,4 +115,4 @@ public int l() { + 8 + 8; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/StakeSystem.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/StakeSystem.java index eaba5bd..6ab6fdb 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/StakeSystem.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/StakeSystem.java @@ -82,4 +82,4 @@ public int l() { + 8 + 4; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/State.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/State.java index 6789f7f..169f5c7 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/State.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/State.java @@ -54,37 +54,37 @@ public record State(PublicKey _address, public static final int MSOL_MINT_AUTHORITY_BUMP_SEED_OFFSET = 137; public static final int RENT_EXEMPT_FOR_TOKEN_ACC_OFFSET = 138; public static final int REWARD_FEE_OFFSET = 146; - + public static Filter createMsolMintFilter(final PublicKey msolMint) { return Filter.createMemCompFilter(MSOL_MINT_OFFSET, msolMint); } - + public static Filter createAdminAuthorityFilter(final PublicKey adminAuthority) { return Filter.createMemCompFilter(ADMIN_AUTHORITY_OFFSET, adminAuthority); } - + public static Filter createOperationalSolAccountFilter(final PublicKey operationalSolAccount) { return Filter.createMemCompFilter(OPERATIONAL_SOL_ACCOUNT_OFFSET, operationalSolAccount); } - + public static Filter createTreasuryMsolAccountFilter(final PublicKey treasuryMsolAccount) { return Filter.createMemCompFilter(TREASURY_MSOL_ACCOUNT_OFFSET, treasuryMsolAccount); } - + public static Filter createReserveBumpSeedFilter(final int reserveBumpSeed) { return Filter.createMemCompFilter(RESERVE_BUMP_SEED_OFFSET, new byte[]{(byte) reserveBumpSeed}); } - + public static Filter createMsolMintAuthorityBumpSeedFilter(final int msolMintAuthorityBumpSeed) { return Filter.createMemCompFilter(MSOL_MINT_AUTHORITY_BUMP_SEED_OFFSET, new byte[]{(byte) msolMintAuthorityBumpSeed}); } - + public static Filter createRentExemptForTokenAccFilter(final long rentExemptForTokenAcc) { final byte[] _data = new byte[8]; putInt64LE(_data, 0, rentExemptForTokenAcc); return Filter.createMemCompFilter(RENT_EXEMPT_FOR_TOKEN_ACC_OFFSET, _data); } - + public static Filter createRewardFeeFilter(final Fee rewardFee) { return Filter.createMemCompFilter(REWARD_FEE_OFFSET, rewardFee.write()); } @@ -92,13 +92,13 @@ public static Filter createRewardFeeFilter(final Fee rewardFee) { public static State read(final byte[] _data, final int offset) { return read(null, _data, offset); } - + public static State read(final PublicKey _address, final byte[] _data) { return read(_address, _data, 0); } - + public static final BiFunction FACTORY = State::read; - + public static State read(final PublicKey _address, final byte[] _data, final int offset) { final byte[] discriminator = parseDiscriminator(_data, offset); int i = offset + discriminator.length; @@ -282,4 +282,4 @@ public int l() { + 8 + Borsh.len(maxStakeMovedPerEpoch); } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/TicketAccountData.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/TicketAccountData.java index 8e1f67d..a28bd73 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/TicketAccountData.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/TicketAccountData.java @@ -25,21 +25,21 @@ public record TicketAccountData(PublicKey _address, public static final int BENEFICIARY_OFFSET = 40; public static final int LAMPORTS_AMOUNT_OFFSET = 72; public static final int CREATED_EPOCH_OFFSET = 80; - + public static Filter createStateAddressFilter(final PublicKey stateAddress) { return Filter.createMemCompFilter(STATE_ADDRESS_OFFSET, stateAddress); } - + public static Filter createBeneficiaryFilter(final PublicKey beneficiary) { return Filter.createMemCompFilter(BENEFICIARY_OFFSET, beneficiary); } - + public static Filter createLamportsAmountFilter(final long lamportsAmount) { final byte[] _data = new byte[8]; putInt64LE(_data, 0, lamportsAmount); return Filter.createMemCompFilter(LAMPORTS_AMOUNT_OFFSET, _data); } - + public static Filter createCreatedEpochFilter(final long createdEpoch) { final byte[] _data = new byte[8]; putInt64LE(_data, 0, createdEpoch); @@ -49,13 +49,13 @@ public static Filter createCreatedEpochFilter(final long createdEpoch) { public static TicketAccountData read(final byte[] _data, final int offset) { return read(null, _data, offset); } - + public static TicketAccountData read(final PublicKey _address, final byte[] _data) { return read(_address, _data, 0); } - + public static final BiFunction FACTORY = TicketAccountData::read; - + public static TicketAccountData read(final PublicKey _address, final byte[] _data, final int offset) { final byte[] discriminator = parseDiscriminator(_data, offset); int i = offset + discriminator.length; @@ -93,4 +93,4 @@ public int write(final byte[] _data, final int offset) { public int l() { return 8 + 32 + 32 + 8 + 8; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/U32ValueChange.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/U32ValueChange.java index 1ac5e2e..ee7f89b 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/U32ValueChange.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/U32ValueChange.java @@ -31,4 +31,4 @@ public int write(final byte[] _data, final int offset) { public int l() { return 4 + 4; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/U64ValueChange.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/U64ValueChange.java index fd18aa8..7a39297 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/U64ValueChange.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/U64ValueChange.java @@ -31,4 +31,4 @@ public int write(final byte[] _data, final int offset) { public int l() { return 8 + 8; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/UpdateActiveEvent.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/UpdateActiveEvent.java index 557c094..e8dbe48 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/UpdateActiveEvent.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/UpdateActiveEvent.java @@ -136,4 +136,4 @@ public int l() { + 8 + 8; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/UpdateDeactivatedEvent.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/UpdateDeactivatedEvent.java index 1f86fd9..fc3cc12 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/UpdateDeactivatedEvent.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/UpdateDeactivatedEvent.java @@ -108,4 +108,4 @@ public int l() { + 8 + 8; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ValidatorList.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ValidatorList.java index f89f370..88c4c39 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ValidatorList.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ValidatorList.java @@ -5,18 +5,18 @@ public record ValidatorList() implements Borsh { private static final ValidatorList INSTANCE = new ValidatorList(); - + public static ValidatorList read(final byte[] _data, final int offset) { return INSTANCE; } - + @Override public int write(final byte[] _data, final int offset) { return 0; } - + @Override public int l() { return 0; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ValidatorRecord.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ValidatorRecord.java index c9f3a3f..02c29a0 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ValidatorRecord.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ValidatorRecord.java @@ -61,4 +61,4 @@ public int l() { + 8 + 1; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ValidatorSystem.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ValidatorSystem.java index 39ed575..2602818 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ValidatorSystem.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/ValidatorSystem.java @@ -59,4 +59,4 @@ public int l() { + 8 + 1; } -} \ No newline at end of file +} diff --git a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/WithdrawStakeAccountEvent.java b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/WithdrawStakeAccountEvent.java index 64b732f..933e0d6 100644 --- a/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/WithdrawStakeAccountEvent.java +++ b/programs/src/main/java/software/sava/anchor/programs/marinade/anchor/types/WithdrawStakeAccountEvent.java @@ -143,4 +143,4 @@ public int l() { + 8 + 8; } -} \ No newline at end of file +}