Skip to content

Commit

Permalink
Formatting everything
Browse files Browse the repository at this point in the history
  • Loading branch information
ebatsell committed Dec 13, 2024
1 parent e11a049 commit 03e5c53
Show file tree
Hide file tree
Showing 42 changed files with 260 additions and 424 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

import {
combineCodec,
getOptionDecoder,
getOptionEncoder,
getStructDecoder,
getStructEncoder,
getU64Decoder,
Expand All @@ -25,8 +23,6 @@ import {
type IInstruction,
type IInstructionWithAccounts,
type IInstructionWithData,
type Option,
type OptionOrNullable,
type ReadonlyAccount,
type WritableAccount,
} from '@solana/web3.js';
Expand Down Expand Up @@ -79,20 +75,20 @@ export type DistributeBaseNcnRewardRouteInstruction<
export type DistributeBaseNcnRewardRouteInstructionData = {
discriminator: number;
ncnFeeGroup: number;
firstSlotOfNcnEpoch: Option<bigint>;
epoch: bigint;
};

export type DistributeBaseNcnRewardRouteInstructionDataArgs = {
ncnFeeGroup: number;
firstSlotOfNcnEpoch: OptionOrNullable<number | bigint>;
epoch: number | bigint;
};

export function getDistributeBaseNcnRewardRouteInstructionDataEncoder(): Encoder<DistributeBaseNcnRewardRouteInstructionDataArgs> {
return transformEncoder(
getStructEncoder([
['discriminator', getU8Encoder()],
['ncnFeeGroup', getU8Encoder()],
['firstSlotOfNcnEpoch', getOptionEncoder(getU64Encoder())],
['epoch', getU64Encoder()],
]),
(value) => ({
...value,
Expand All @@ -105,7 +101,7 @@ export function getDistributeBaseNcnRewardRouteInstructionDataDecoder(): Decoder
return getStructDecoder([
['discriminator', getU8Decoder()],
['ncnFeeGroup', getU8Decoder()],
['firstSlotOfNcnEpoch', getOptionDecoder(getU64Decoder())],
['epoch', getU64Decoder()],
]);
}

Expand Down Expand Up @@ -136,7 +132,7 @@ export type DistributeBaseNcnRewardRouteInput<
ncnRewardRouter: Address<TAccountNcnRewardRouter>;
restakingProgram: Address<TAccountRestakingProgram>;
ncnFeeGroup: DistributeBaseNcnRewardRouteInstructionDataArgs['ncnFeeGroup'];
firstSlotOfNcnEpoch: DistributeBaseNcnRewardRouteInstructionDataArgs['firstSlotOfNcnEpoch'];
epoch: DistributeBaseNcnRewardRouteInstructionDataArgs['epoch'];
};

export function getDistributeBaseNcnRewardRouteInstruction<
Expand Down
14 changes: 5 additions & 9 deletions clients/js/jito_tip_router/instructions/distributeBaseRewards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

import {
combineCodec,
getOptionDecoder,
getOptionEncoder,
getStructDecoder,
getStructEncoder,
getU64Decoder,
Expand All @@ -25,8 +23,6 @@ import {
type IInstruction,
type IInstructionWithAccounts,
type IInstructionWithData,
type Option,
type OptionOrNullable,
type ReadonlyAccount,
type WritableAccount,
} from '@solana/web3.js';
Expand Down Expand Up @@ -75,20 +71,20 @@ export type DistributeBaseRewardsInstruction<
export type DistributeBaseRewardsInstructionData = {
discriminator: number;
baseFeeGroup: number;
firstSlotOfNcnEpoch: Option<bigint>;
epoch: bigint;
};

export type DistributeBaseRewardsInstructionDataArgs = {
baseFeeGroup: number;
firstSlotOfNcnEpoch: OptionOrNullable<number | bigint>;
epoch: number | bigint;
};

export function getDistributeBaseRewardsInstructionDataEncoder(): Encoder<DistributeBaseRewardsInstructionDataArgs> {
return transformEncoder(
getStructEncoder([
['discriminator', getU8Encoder()],
['baseFeeGroup', getU8Encoder()],
['firstSlotOfNcnEpoch', getOptionEncoder(getU64Encoder())],
['epoch', getU64Encoder()],
]),
(value) => ({
...value,
Expand All @@ -101,7 +97,7 @@ export function getDistributeBaseRewardsInstructionDataDecoder(): Decoder<Distri
return getStructDecoder([
['discriminator', getU8Decoder()],
['baseFeeGroup', getU8Decoder()],
['firstSlotOfNcnEpoch', getOptionDecoder(getU64Decoder())],
['epoch', getU64Decoder()],
]);
}

Expand Down Expand Up @@ -130,7 +126,7 @@ export type DistributeBaseRewardsInput<
baseFeeWallet: Address<TAccountBaseFeeWallet>;
restakingProgram: Address<TAccountRestakingProgram>;
baseFeeGroup: DistributeBaseRewardsInstructionDataArgs['baseFeeGroup'];
firstSlotOfNcnEpoch: DistributeBaseRewardsInstructionDataArgs['firstSlotOfNcnEpoch'];
epoch: DistributeBaseRewardsInstructionDataArgs['epoch'];
};

export function getDistributeBaseRewardsInstruction<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

import {
combineCodec,
getOptionDecoder,
getOptionEncoder,
getStructDecoder,
getStructEncoder,
getU64Decoder,
Expand All @@ -25,8 +23,6 @@ import {
type IInstruction,
type IInstructionWithAccounts,
type IInstructionWithData,
type Option,
type OptionOrNullable,
type ReadonlyAccount,
type WritableAccount,
} from '@solana/web3.js';
Expand Down Expand Up @@ -75,20 +71,20 @@ export type DistributeNcnOperatorRewardsInstruction<
export type DistributeNcnOperatorRewardsInstructionData = {
discriminator: number;
ncnFeeGroup: number;
firstSlotOfNcnEpoch: Option<bigint>;
epoch: bigint;
};

export type DistributeNcnOperatorRewardsInstructionDataArgs = {
ncnFeeGroup: number;
firstSlotOfNcnEpoch: OptionOrNullable<number | bigint>;
epoch: number | bigint;
};

export function getDistributeNcnOperatorRewardsInstructionDataEncoder(): Encoder<DistributeNcnOperatorRewardsInstructionDataArgs> {
return transformEncoder(
getStructEncoder([
['discriminator', getU8Encoder()],
['ncnFeeGroup', getU8Encoder()],
['firstSlotOfNcnEpoch', getOptionEncoder(getU64Encoder())],
['epoch', getU64Encoder()],
]),
(value) => ({
...value,
Expand All @@ -101,7 +97,7 @@ export function getDistributeNcnOperatorRewardsInstructionDataDecoder(): Decoder
return getStructDecoder([
['discriminator', getU8Decoder()],
['ncnFeeGroup', getU8Decoder()],
['firstSlotOfNcnEpoch', getOptionDecoder(getU64Decoder())],
['epoch', getU64Decoder()],
]);
}

Expand Down Expand Up @@ -130,7 +126,7 @@ export type DistributeNcnOperatorRewardsInput<
ncnRewardRouter: Address<TAccountNcnRewardRouter>;
restakingProgram: Address<TAccountRestakingProgram>;
ncnFeeGroup: DistributeNcnOperatorRewardsInstructionDataArgs['ncnFeeGroup'];
firstSlotOfNcnEpoch: DistributeNcnOperatorRewardsInstructionDataArgs['firstSlotOfNcnEpoch'];
epoch: DistributeNcnOperatorRewardsInstructionDataArgs['epoch'];
};

export function getDistributeNcnOperatorRewardsInstruction<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

import {
combineCodec,
getOptionDecoder,
getOptionEncoder,
getStructDecoder,
getStructEncoder,
getU64Decoder,
Expand All @@ -25,8 +23,6 @@ import {
type IInstruction,
type IInstructionWithAccounts,
type IInstructionWithData,
type Option,
type OptionOrNullable,
type ReadonlyAccount,
type WritableAccount,
} from '@solana/web3.js';
Expand Down Expand Up @@ -75,20 +71,20 @@ export type DistributeNcnVaultRewardsInstruction<
export type DistributeNcnVaultRewardsInstructionData = {
discriminator: number;
ncnFeeGroup: number;
firstSlotOfNcnEpoch: Option<bigint>;
epoch: bigint;
};

export type DistributeNcnVaultRewardsInstructionDataArgs = {
ncnFeeGroup: number;
firstSlotOfNcnEpoch: OptionOrNullable<number | bigint>;
epoch: number | bigint;
};

export function getDistributeNcnVaultRewardsInstructionDataEncoder(): Encoder<DistributeNcnVaultRewardsInstructionDataArgs> {
return transformEncoder(
getStructEncoder([
['discriminator', getU8Encoder()],
['ncnFeeGroup', getU8Encoder()],
['firstSlotOfNcnEpoch', getOptionEncoder(getU64Encoder())],
['epoch', getU64Encoder()],
]),
(value) => ({
...value,
Expand All @@ -101,7 +97,7 @@ export function getDistributeNcnVaultRewardsInstructionDataDecoder(): Decoder<Di
return getStructDecoder([
['discriminator', getU8Decoder()],
['ncnFeeGroup', getU8Decoder()],
['firstSlotOfNcnEpoch', getOptionDecoder(getU64Decoder())],
['epoch', getU64Decoder()],
]);
}

Expand Down Expand Up @@ -130,7 +126,7 @@ export type DistributeNcnVaultRewardsInput<
vault: Address<TAccountVault>;
ncnRewardRouter: Address<TAccountNcnRewardRouter>;
ncnFeeGroup: DistributeNcnVaultRewardsInstructionDataArgs['ncnFeeGroup'];
firstSlotOfNcnEpoch: DistributeNcnVaultRewardsInstructionDataArgs['firstSlotOfNcnEpoch'];
epoch: DistributeNcnVaultRewardsInstructionDataArgs['epoch'];
};

export function getDistributeNcnVaultRewardsInstruction<
Expand Down
16 changes: 5 additions & 11 deletions clients/js/jito_tip_router/instructions/routeBaseRewards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

import {
combineCodec,
getOptionDecoder,
getOptionEncoder,
getStructDecoder,
getStructEncoder,
getU64Decoder,
Expand All @@ -25,8 +23,6 @@ import {
type IInstruction,
type IInstructionWithAccounts,
type IInstructionWithData,
type Option,
type OptionOrNullable,
type ReadonlyAccount,
type WritableAccount,
} from '@solana/web3.js';
Expand Down Expand Up @@ -74,18 +70,16 @@ export type RouteBaseRewardsInstruction<

export type RouteBaseRewardsInstructionData = {
discriminator: number;
firstSlotOfNcnEpoch: Option<bigint>;
epoch: bigint;
};

export type RouteBaseRewardsInstructionDataArgs = {
firstSlotOfNcnEpoch: OptionOrNullable<number | bigint>;
};
export type RouteBaseRewardsInstructionDataArgs = { epoch: number | bigint };

export function getRouteBaseRewardsInstructionDataEncoder(): Encoder<RouteBaseRewardsInstructionDataArgs> {
return transformEncoder(
getStructEncoder([
['discriminator', getU8Encoder()],
['firstSlotOfNcnEpoch', getOptionEncoder(getU64Encoder())],
['epoch', getU64Encoder()],
]),
(value) => ({ ...value, discriminator: ROUTE_BASE_REWARDS_DISCRIMINATOR })
);
Expand All @@ -94,7 +88,7 @@ export function getRouteBaseRewardsInstructionDataEncoder(): Encoder<RouteBaseRe
export function getRouteBaseRewardsInstructionDataDecoder(): Decoder<RouteBaseRewardsInstructionData> {
return getStructDecoder([
['discriminator', getU8Decoder()],
['firstSlotOfNcnEpoch', getOptionDecoder(getU64Decoder())],
['epoch', getU64Decoder()],
]);
}

Expand Down Expand Up @@ -122,7 +116,7 @@ export type RouteBaseRewardsInput<
ballotBox: Address<TAccountBallotBox>;
baseRewardRouter: Address<TAccountBaseRewardRouter>;
restakingProgram: Address<TAccountRestakingProgram>;
firstSlotOfNcnEpoch: RouteBaseRewardsInstructionDataArgs['firstSlotOfNcnEpoch'];
epoch: RouteBaseRewardsInstructionDataArgs['epoch'];
};

export function getRouteBaseRewardsInstruction<
Expand Down
14 changes: 5 additions & 9 deletions clients/js/jito_tip_router/instructions/routeNcnRewards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

import {
combineCodec,
getOptionDecoder,
getOptionEncoder,
getStructDecoder,
getStructEncoder,
getU64Decoder,
Expand All @@ -25,8 +23,6 @@ import {
type IInstruction,
type IInstructionWithAccounts,
type IInstructionWithData,
type Option,
type OptionOrNullable,
type ReadonlyAccount,
type WritableAccount,
} from '@solana/web3.js';
Expand Down Expand Up @@ -75,20 +71,20 @@ export type RouteNcnRewardsInstruction<
export type RouteNcnRewardsInstructionData = {
discriminator: number;
ncnFeeGroup: number;
firstSlotOfNcnEpoch: Option<bigint>;
epoch: bigint;
};

export type RouteNcnRewardsInstructionDataArgs = {
ncnFeeGroup: number;
firstSlotOfNcnEpoch: OptionOrNullable<number | bigint>;
epoch: number | bigint;
};

export function getRouteNcnRewardsInstructionDataEncoder(): Encoder<RouteNcnRewardsInstructionDataArgs> {
return transformEncoder(
getStructEncoder([
['discriminator', getU8Encoder()],
['ncnFeeGroup', getU8Encoder()],
['firstSlotOfNcnEpoch', getOptionEncoder(getU64Encoder())],
['epoch', getU64Encoder()],
]),
(value) => ({ ...value, discriminator: ROUTE_NCN_REWARDS_DISCRIMINATOR })
);
Expand All @@ -98,7 +94,7 @@ export function getRouteNcnRewardsInstructionDataDecoder(): Decoder<RouteNcnRewa
return getStructDecoder([
['discriminator', getU8Decoder()],
['ncnFeeGroup', getU8Decoder()],
['firstSlotOfNcnEpoch', getOptionDecoder(getU64Decoder())],
['epoch', getU64Decoder()],
]);
}

Expand Down Expand Up @@ -127,7 +123,7 @@ export type RouteNcnRewardsInput<
ncnRewardRouter: Address<TAccountNcnRewardRouter>;
restakingProgram: Address<TAccountRestakingProgram>;
ncnFeeGroup: RouteNcnRewardsInstructionDataArgs['ncnFeeGroup'];
firstSlotOfNcnEpoch: RouteNcnRewardsInstructionDataArgs['firstSlotOfNcnEpoch'];
epoch: RouteNcnRewardsInstructionDataArgs['epoch'];
};

export function getRouteNcnRewardsInstruction<
Expand Down
Loading

0 comments on commit 03e5c53

Please sign in to comment.