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.110",
"version": "0.0.111",
"type": "module",
"types": "./dist/index.d.ts",
"main": "./dist/index.js",
Expand Down
42 changes: 42 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,
CommissionAppliesTo,
ERCStandards,
FeeConfigurationStatus,
GasMode,
Expand All @@ -15,6 +16,7 @@ import {
TransactionFormat,
TransactionStatus,
TransactionType,
TvlLevel,
ValidatorStatusTypes,
YieldProviders,
YieldType,
Expand Down Expand Up @@ -1652,6 +1654,10 @@ export const getYieldControllerGetMultipleYieldBalancesResponseMock = (
},
undefined,
]),
receiverAddress: faker.helpers.arrayElement([
{ required: faker.datatype.boolean(), ...overrideResponse },
undefined,
]),
signatureVerification: faker.helpers.arrayElement([
{ required: faker.datatype.boolean(), ...overrideResponse },
undefined,
Expand Down Expand Up @@ -1893,6 +1899,10 @@ export const getYieldControllerGetSingleYieldBalancesResponseMock = (
},
undefined,
]),
receiverAddress: faker.helpers.arrayElement([
{ required: faker.datatype.boolean(), ...overrideResponse },
undefined,
]),
signatureVerification: faker.helpers.arrayElement([
{ required: faker.datatype.boolean(), ...overrideResponse },
undefined,
Expand Down Expand Up @@ -2172,6 +2182,10 @@ export const getYieldV2ControllerGetYieldByIdResponseMock = (
},
undefined,
]),
receiverAddress: faker.helpers.arrayElement([
{ required: faker.datatype.boolean(), ...overrideResponse },
undefined,
]),
signatureVerification: faker.helpers.arrayElement([
{ required: faker.datatype.boolean(), ...overrideResponse },
undefined,
Expand Down Expand Up @@ -2303,6 +2317,10 @@ export const getYieldV2ControllerGetYieldByIdResponseMock = (
},
undefined,
]),
receiverAddress: faker.helpers.arrayElement([
{ required: faker.datatype.boolean(), ...overrideResponse },
undefined,
]),
signatureVerification: faker.helpers.arrayElement([
{ required: faker.datatype.boolean(), ...overrideResponse },
undefined,
Expand Down Expand Up @@ -2374,6 +2392,19 @@ export const getYieldV2ControllerGetYieldByIdResponseMock = (
id: faker.word.sample(),
isAvailable: faker.datatype.boolean(),
metadata: {
commission: faker.helpers.arrayElement([
Array.from(
{ length: faker.number.int({ min: 1, max: 10 }) },
(_, i) => i + 1,
).map(() => ({
appliesTo: faker.helpers.arrayElement(
Object.values(CommissionAppliesTo),
),
value: faker.number.int({ min: undefined, max: undefined }),
...overrideResponse,
})),
undefined,
]),
cooldownPeriod: faker.helpers.arrayElement([
{
days: faker.number.int({ min: undefined, max: undefined }),
Expand Down Expand Up @@ -2527,6 +2558,17 @@ export const getYieldV2ControllerGetYieldByIdResponseMock = (
})),
undefined,
]),
tvl: faker.helpers.arrayElement([
Array.from(
{ length: faker.number.int({ min: 1, max: 10 }) },
(_, i) => i + 1,
).map(() => ({
level: faker.helpers.arrayElement(Object.values(TvlLevel)),
value: faker.word.sample(),
...overrideResponse,
})),
undefined,
]),
type: faker.helpers.arrayElement(Object.values(YieldType)),
warmupPeriod: {
days: faker.number.int({ min: undefined, max: undefined }),
Expand Down
1 change: 1 addition & 0 deletions packages/api-hooks/src/api/schemas/actionArgumentsDto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export interface ActionArgumentsDto {
ledgerWalletAPICompatible?: boolean;
nfts?: ApeNativeArgumentsDto;
providerId?: string;
receiverAddress?: string;
signatureVerification?: SignatureVerificationArgumentsDto;
subnetId?: number;
tronResource?: TronResourceType;
Expand Down
1 change: 1 addition & 0 deletions packages/api-hooks/src/api/schemas/argumentOptionsDto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export interface ArgumentOptionsDto {
feeConfigurationId?: RequiredArgumentWithOptionsDto;
nfts?: ApeNativeArgumentOptionsDto[];
providerId?: RequiredArgumentWithOptionsDto;
receiverAddress?: RequiredArgumentDto;
signatureVerification?: RequiredArgumentDto;
subnetId?: RequiredArgumentDto;
tronResource?: TronResourceArgumentOptionsDto;
Expand Down
11 changes: 11 additions & 0 deletions packages/api-hooks/src/api/schemas/commissionAppliesTo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export type CommissionAppliesTo =
(typeof CommissionAppliesTo)[keyof typeof CommissionAppliesTo];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const CommissionAppliesTo = {
all_yield: 'all_yield',
execution_layer_rewards: 'execution_layer_rewards',
consensus_layer_rewards: 'consensus_layer_rewards',
performance: 'performance',
management: 'management',
} as const;
1 change: 1 addition & 0 deletions packages/api-hooks/src/api/schemas/createTeamDto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ import type { CreateTeamDtoUser } from './createTeamDtoUser';
export interface CreateTeamDto {
contactDetails: CreateTeamDtoContactDetails;
name: string;
referredBy?: string;
user: CreateTeamDtoUser;
}
23 changes: 23 additions & 0 deletions packages/api-hooks/src/api/schemas/createValidatorDto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import type { CreateValidatorDtoStatus } from './createValidatorDtoStatus';

export interface CreateValidatorDto {
address: string;
apr?: number;
commission?: number;
endDate?: string;
image?: string;
integrationId: string;
lastFoundAt?: string;
mevCommission?: number;
minimumStake?: string;
name?: string;
nominatorCount?: number;
providerId?: string;
remainingPossibleStake?: string;
remainingSlots?: number;
stakedBalance?: string;
status?: CreateValidatorDtoStatus;
subnetId?: number;
votingPower?: number;
website?: string;
}
12 changes: 12 additions & 0 deletions packages/api-hooks/src/api/schemas/createValidatorDtoStatus.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export type CreateValidatorDtoStatus =
(typeof CreateValidatorDtoStatus)[keyof typeof CreateValidatorDtoStatus];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const CreateValidatorDtoStatus = {
active: 'active',
jailed: 'jailed',
deactivating: 'deactivating',
inactive: 'inactive',
full: 'full',
not_found: 'not_found',
} as const;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type { CreateValidatorProviderDtoRevshare } from './createValidatorProviderDtoRevshare';

export interface CreateValidatorProviderDto {
name: string;
preferred?: boolean;
rank: number;
revshare?: CreateValidatorProviderDtoRevshare;
website: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export type CreateValidatorProviderDtoRevshare = { [key: string]: any };

This file was deleted.

This file was deleted.

11 changes: 0 additions & 11 deletions packages/api-hooks/src/api/schemas/dailyCumulativeStakeDto.ts

This file was deleted.

This file was deleted.

27 changes: 0 additions & 27 deletions packages/api-hooks/src/api/schemas/dailyCumulativeStakeDtoType.ts

This file was deleted.

1 change: 1 addition & 0 deletions packages/api-hooks/src/api/schemas/evmNetworks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const EvmNetworks = {
zksync: 'zksync',
linea: 'linea',
unichain: 'unichain',
'monad-testnet': 'monad-testnet',
'avalanche-c': 'avalanche-c',
'avalanche-c-atomic': 'avalanche-c-atomic',
'avalanche-p': 'avalanche-p',
Expand Down
4 changes: 2 additions & 2 deletions packages/api-hooks/src/api/schemas/growSuccessDto.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { ProtocolInterestViewDto } from './protocolInterestViewDto';
import type { Networks } from './networks';

export interface GrowSuccessDto {
/** The deposit token */
deposit_token: string;
/** The interest information */
interest: ProtocolInterestViewDto;
network: Networks;
/** The converted network name */
network: string;
}
53 changes: 43 additions & 10 deletions packages/api-hooks/src/api/schemas/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export * from './balancesRequestDto';
export * from './bannedRegionDto';
export * from './binanceAdditionalAddressesDto';
export * from './binanceAdditionalAddressesStakeArgumentOptionsDto';
export * from './commissionAppliesTo';
export * from './confirmUserMeDto';
export * from './constructTransactionRequestDto';
export * from './constructTransactionRequestDtoGasArgs';
Expand All @@ -60,13 +61,12 @@ export * from './createTeamDto';
export * from './createTeamDtoContactDetails';
export * from './createTeamDtoUser';
export * from './createUserDto';
export * from './createWebhookSubscriptionDto';
export * from './createWebhookSubscriptionDtoEvent';
export * from './createValidatorDto';
export * from './createValidatorDtoStatus';
export * from './createValidatorProviderDto';
export * from './createValidatorProviderDtoRevshare';
export * from './customUri';
export * from './customValidatorAddresses';
export * from './dailyCumulativeStakeDto';
export * from './dailyCumulativeStakeDtoStatus';
export * from './dailyCumulativeStakeDtoType';
export * from './dailyPerformanceDto';
export * from './dailyPerformanceDtoToken';
export * from './dailyRevenueDto';
Expand Down Expand Up @@ -206,6 +206,7 @@ export * from './transactionVerificationMessageDto';
export * from './transactionVerificationMessageRequestDto';
export * from './tronResourceArgumentOptionsDto';
export * from './tronResourceType';
export * from './tvlLevel';
export * from './unauthorizedDto';
export * from './updateCustomUriDto';
export * from './updateFeeConfigurationDto';
Expand All @@ -216,17 +217,47 @@ export * from './updateProjectDto';
export * from './updateTeamDto';
export * from './updateUserDto';
export * from './updateUserMeDto';
export * from './updateWebhookSubscriptionDto';
export * from './updateWebhookSubscriptionDtoEvent';
export * from './updateValidatorDto';
export * from './updateValidatorHistoricalRevshareChangesDto';
export * from './updateValidatorProviderDto';
export * from './updateValidatorProviderDtoRevshare';
export * from './userDto';
export * from './validatorAddressesDto';
export * from './validatorAdminDto';
export * from './validatorAdminDtoApr';
export * from './validatorAdminDtoAprOverride';
export * from './validatorAdminDtoCommission';
export * from './validatorAdminDtoCommissionOverride';
export * from './validatorAdminDtoEndDate';
export * from './validatorAdminDtoImage';
export * from './validatorAdminDtoImageOverride';
export * from './validatorAdminDtoLastFoundAt';
export * from './validatorAdminDtoMevCommission';
export * from './validatorAdminDtoMevCommissionOverride';
export * from './validatorAdminDtoMinimumStake';
export * from './validatorAdminDtoName';
export * from './validatorAdminDtoNameOverride';
export * from './validatorAdminDtoNominatorCount';
export * from './validatorAdminDtoProviderId';
export * from './validatorAdminDtoRemainingPossibleStake';
export * from './validatorAdminDtoRemainingSlots';
export * from './validatorAdminDtoStakedBalance';
export * from './validatorAdminDtoSubnetId';
export * from './validatorAdminDtoVotingPower';
export * from './validatorAdminDtoWebsite';
export * from './validatorAdminDtoWebsiteOverride';
export * from './validatorDto';
export * from './validatorHistoricalRevshareChangesDto';
export * from './validatorHistoricalRevshareChangesDtoApr';
export * from './validatorHistoricalRevshareChangesDtoCommission';
export * from './validatorHistoricalRevshareChangesDtoMevCommission';
export * from './validatorHistoricalRevshareChangesDtoPreferred';
export * from './validatorHistoricalRevshareChangesDtoType';
export * from './validatorProviderDto';
export * from './validatorProviderDtoRevshare';
export * from './validatorSearchResultDto';
export * from './validatorStatusTypes';
export * from './walletViewDto';
export * from './webhookSubscriptionDto';
export * from './webhookSubscriptionEventDto';
export * from './webhookSubscriptionEventDtoEvent';
export * from './yieldBalanceDto';
export * from './yieldBalanceLabelDto';
export * from './yieldBalanceLabelDtoParams';
Expand All @@ -235,6 +266,7 @@ export * from './yieldBalanceScanEvmRequestDto';
export * from './yieldBalanceScanRequestDto';
export * from './yieldBalanceWithIntegrationIdRequestDto';
export * from './yieldBalancesWithIntegrationIdDto';
export * from './yieldCommissionDto';
export * from './yieldDto';
export * from './yieldFeeDto';
export * from './yieldGetMyYields200';
Expand All @@ -252,6 +284,7 @@ export * from './yieldRewardsSummaryDto';
export * from './yieldRewardsSummaryRequestDto';
export * from './yieldRewardsSummaryResponseDto';
export * from './yieldStatusResponseDto';
export * from './yieldTvlDto';
export * from './yieldType';
export * from './yieldV2FindValidatorsParams';
export * from './yieldV2FindYieldValidatorsParams';
Expand Down
4 changes: 1 addition & 3 deletions packages/api-hooks/src/api/schemas/networks.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/**
* The network name
*/
export type Networks = (typeof Networks)[keyof typeof Networks];

// eslint-disable-next-line @typescript-eslint/no-redeclare
Expand All @@ -21,6 +18,7 @@ export const Networks = {
zksync: 'zksync',
linea: 'linea',
unichain: 'unichain',
'monad-testnet': 'monad-testnet',
'avalanche-c': 'avalanche-c',
'avalanche-c-atomic': 'avalanche-c-atomic',
'avalanche-p': 'avalanche-p',
Expand Down
Loading
Loading