Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/api-hooks/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@stakekit/api-hooks",
"description": "React hooks for StakeKit API",
"version": "0.0.108",
"version": "0.0.109",
"type": "module",
"types": "./dist/index.d.ts",
"main": "./dist/index.js",
Expand Down
14 changes: 14 additions & 0 deletions packages/api-hooks/src/api/index.msw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
ActionStatus,
ActionTypes,
BalanceTypes,
ERCStandards,
FeeConfigurationStatus,
GasMode,
HealthStatus,
Expand Down Expand Up @@ -2469,6 +2470,10 @@ export const getYieldV2ControllerGetYieldByIdResponseMock = (
})),
undefined,
]),
supportedStandards: faker.helpers.arrayElement([
faker.helpers.arrayElements(Object.values(ERCStandards)),
undefined,
]),
supportsLedgerWalletApi: faker.helpers.arrayElement([
faker.datatype.boolean(),
undefined,
Expand Down Expand Up @@ -2594,6 +2599,7 @@ export const getYieldV2ControllerGetYieldByIdResponseMock = (
undefined,
]),
image: faker.helpers.arrayElement([faker.word.sample(), undefined]),
marketCap: faker.helpers.arrayElement([faker.word.sample(), undefined]),
minimumStake: faker.helpers.arrayElement([faker.word.sample(), undefined]),
name: faker.helpers.arrayElement([faker.word.sample(), undefined]),
nominatorCount: faker.helpers.arrayElement([
Expand All @@ -2620,6 +2626,8 @@ export const getYieldV2ControllerGetYieldByIdResponseMock = (
faker.number.int({ min: undefined, max: undefined }),
undefined,
]),
subnetName: faker.helpers.arrayElement([faker.word.sample(), undefined]),
tokenSymbol: faker.helpers.arrayElement([faker.word.sample(), undefined]),
votingPower: faker.helpers.arrayElement([
faker.number.int({ min: undefined, max: undefined }),
undefined,
Expand Down Expand Up @@ -2656,6 +2664,7 @@ export const getYieldV2ControllerFindYieldValidatorsResponseMock = (
undefined,
]),
image: faker.helpers.arrayElement([faker.word.sample(), undefined]),
marketCap: faker.helpers.arrayElement([faker.word.sample(), undefined]),
minimumStake: faker.helpers.arrayElement([
faker.word.sample(),
undefined,
Expand Down Expand Up @@ -2691,6 +2700,8 @@ export const getYieldV2ControllerFindYieldValidatorsResponseMock = (
faker.number.int({ min: undefined, max: undefined }),
undefined,
]),
subnetName: faker.helpers.arrayElement([faker.word.sample(), undefined]),
tokenSymbol: faker.helpers.arrayElement([faker.word.sample(), undefined]),
votingPower: faker.helpers.arrayElement([
faker.number.int({ min: undefined, max: undefined }),
undefined,
Expand Down Expand Up @@ -2727,6 +2738,7 @@ export const getYieldV2ControllerFindValidatorsResponseMock = (
undefined,
]),
image: faker.helpers.arrayElement([faker.word.sample(), undefined]),
marketCap: faker.helpers.arrayElement([faker.word.sample(), undefined]),
minimumStake: faker.helpers.arrayElement([
faker.word.sample(),
undefined,
Expand Down Expand Up @@ -2762,6 +2774,8 @@ export const getYieldV2ControllerFindValidatorsResponseMock = (
faker.number.int({ min: undefined, max: undefined }),
undefined,
]),
subnetName: faker.helpers.arrayElement([faker.word.sample(), undefined]),
tokenSymbol: faker.helpers.arrayElement([faker.word.sample(), undefined]),
votingPower: faker.helpers.arrayElement([
faker.number.int({ min: undefined, max: undefined }),
undefined,
Expand Down
8 changes: 8 additions & 0 deletions packages/api-hooks/src/api/schemas/createOAVDto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import type { OAVStrategyDto } from './oAVStrategyDto';

export interface CreateOAVDto {
/** vOAV Integration ID (must be an existing vOAV integration from core) */
Copy link

Copilot AI Aug 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment contains inconsistent terminology. It mentions 'vOAV Integration ID' but the interface name and context suggest it should be 'OAV Integration ID' for consistency.

Suggested change
/** vOAV Integration ID (must be an existing vOAV integration from core) */
/** OAV Integration ID (must be an existing OAV integration from core) */

Copilot uses AI. Check for mistakes.
integrationId: string;
/** Array of strategies with weights and APYs */
strategies: OAVStrategyDto[];
}
9 changes: 9 additions & 0 deletions packages/api-hooks/src/api/schemas/eRCStandards.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export type ERCStandards = (typeof ERCStandards)[keyof typeof ERCStandards];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const ERCStandards = {
ERC20: 'ERC20',
ERC4626: 'ERC4626',
ERC721: 'ERC721',
ERC1155: 'ERC1155',
} as const;
5 changes: 5 additions & 0 deletions packages/api-hooks/src/api/schemas/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export * from './createFeeConfigurationDto';
export * from './createFeeConfigurationDtoV2';
export * from './createKeyDto';
export * from './createMasterBannedRegionDto';
export * from './createOAVDto';
export * from './createPayoutAddressDto';
export * from './createProjectDto';
export * from './createTeamDto';
Expand All @@ -72,6 +73,7 @@ export * from './deleteBannedRegionsDto';
export * from './deleteEnabledYieldsDto';
export * from './deleteMasterBannedRegionsDto';
export * from './durationArgumentOptionsDto';
export * from './eRCStandards';
export * from './enabledYieldDto';
export * from './evmEIP1559GasArgsDto';
export * from './evmEIP1559GasArgsDtoType';
Expand Down Expand Up @@ -106,6 +108,8 @@ export * from './masterBannedYieldDto';
export * from './masterBannedYieldDtoTagsItem';
export * from './networks';
export * from './notFoundDto';
export * from './oAVResponseDto';
export * from './oAVStrategyDto';
export * from './payoutAddressDto';
export * from './pendingActionArgumentsDto';
export * from './pendingActionConstraintAmountDto';
Expand Down Expand Up @@ -185,6 +189,7 @@ export * from './unauthorizedDto';
export * from './updateCustomUriDto';
export * from './updateFeeConfigurationDto';
export * from './updateKeyDto';
export * from './updateOAVDto';
export * from './updatePayoutAddressDto';
export * from './updateProjectDto';
export * from './updateTeamDto';
Expand Down
18 changes: 18 additions & 0 deletions packages/api-hooks/src/api/schemas/oAVResponseDto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { OAVStrategyDto } from './oAVStrategyDto';

export interface OAVResponseDto {
/** Creation timestamp */
createdAt: string;
/** Unique identifier */
id: string;
/** Integration ID for the OAV */
integrationId: string;
/** Whether the OAV is active */
isActive: boolean;
/** Project ID */
projectId: string;
/** Array of strategies with yield IDs and weights */
strategies: OAVStrategyDto[];
/** Last update timestamp */
updatedAt: string;
}
6 changes: 6 additions & 0 deletions packages/api-hooks/src/api/schemas/oAVStrategyDto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export interface OAVStrategyDto {
/** Weight percentage for this strategy (greater than 0, up to 100) */
weight: number;
/** Yield ID for the strategy */
yieldId: string;
}
2 changes: 2 additions & 0 deletions packages/api-hooks/src/api/schemas/team.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export interface Team {
deletedAt: string | null;
id: string;
name: string;
/** Whether the team can access OAV functionality */
oavEnabled: boolean;
providerId: string | null;
serviceConditionsAcceptedAt: string | null;
type: TeamType;
Expand Down
1 change: 1 addition & 0 deletions packages/api-hooks/src/api/schemas/teamDto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ export interface TeamDto {
deletedAt: string | null;
id: string;
name: string;
oavEnabled: boolean;
serviceConditionsAcceptedAt: string | null;
}
1 change: 1 addition & 0 deletions packages/api-hooks/src/api/schemas/transactionFormat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ export type TransactionFormat =
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const TransactionFormat = {
raw: 'raw',
default: 'default',
} as const;
8 changes: 8 additions & 0 deletions packages/api-hooks/src/api/schemas/updateOAVDto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import type { OAVStrategyDto } from './oAVStrategyDto';

export interface UpdateOAVDto {
/** Whether the OAV is active */
isActive?: boolean;
/** Array of strategies with weights and APYs */
strategies?: OAVStrategyDto[];
}
3 changes: 3 additions & 0 deletions packages/api-hooks/src/api/schemas/validatorDto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export interface ValidatorDto {
commission?: number;
endDate?: string;
image?: string;
marketCap?: string;
minimumStake?: string;
name?: string;
nominatorCount?: number;
Expand All @@ -17,6 +18,8 @@ export interface ValidatorDto {
stakedBalance?: string;
status: ValidatorStatusTypes;
subnetId?: number;
subnetName?: string;
tokenSymbol?: string;
votingPower?: number;
website?: string;
}
2 changes: 2 additions & 0 deletions packages/api-hooks/src/api/schemas/yieldMetadataDto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type { YieldProviderDto } from './yieldProviderDto';
import type { YieldRevshareDto } from './yieldRevshareDto';
import type { RewardClaiming } from './rewardClaiming';
import type { RewardSchedule } from './rewardSchedule';
import type { ERCStandards } from './eRCStandards';
import type { YieldType } from './yieldType';

export interface YieldMetadataDto {
Expand All @@ -25,6 +26,7 @@ export interface YieldMetadataDto {
rewardClaiming: RewardClaiming;
rewardSchedule: RewardSchedule;
rewardTokens?: TokenDto[];
supportedStandards?: ERCStandards[];
supportsLedgerWalletApi?: boolean;
supportsMultipleValidators?: boolean;
token: TokenDto;
Expand Down
Loading