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.109",
"version": "0.0.110",
"type": "module",
"types": "./dist/index.d.ts",
"main": "./dist/index.js",
Expand Down
5 changes: 5 additions & 0 deletions packages/api-hooks/src/api/schemas/adaDetailsViewDto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export interface AdaDetailsViewDto {
activationDate: string;
activationEpoch: number;
poolId: string;
}
11 changes: 11 additions & 0 deletions packages/api-hooks/src/api/schemas/cosmosDetailsViewDto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export interface CosmosDetailsViewDto {
available_rewards: number;
balance: number;
delegated_at?: string;
delegator_address: string;
net_apy: number;
rewards: number;
undelegated_at?: string;
updated_at: string;
validator_address: string;
}
4 changes: 4 additions & 0 deletions packages/api-hooks/src/api/schemas/ethDeFiDetailsViewDto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export interface EthDeFiDetailsViewDto {
contract_address: string;
type?: string;
}
14 changes: 14 additions & 0 deletions packages/api-hooks/src/api/schemas/ethNativeDetailsViewDto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export interface EthNativeDetailsViewDto {
/** The total rewards earned from validating blocks and participating in consensus, represented in wei. */
consensus_rewards: string;
/** The Ethereum address that initiated the deposit transaction to the staking contract. This indicates the source of the staked ETH. */
deposit_tx_sender?: string;
/** The Ethereum address that will receive execution layer rewards, including transaction fees and Maximal Extractable Value (MEV). */
execution_fee_recipient?: string;
/** The total execution layer rewards earned from transaction fees and MEV, represented in wei. */
execution_rewards: string;
/** The Ethereum address of the validator. */
validator_address: string;
/** The withdrawal credentials for accessing staked ETH and rewards. This can be a BLS public key or an Ethereum address. */
withdrawal_credentials?: string;
}
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 @@ -31,4 +31,5 @@ export const EvmNetworks = {
core: 'core',
sonic: 'sonic',
katana: 'katana',
hyperevm: 'hyperevm',
} as const;
10 changes: 10 additions & 0 deletions packages/api-hooks/src/api/schemas/failureViewDto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import type { FailureViewDtoDetails } from './failureViewDtoDetails';

export interface FailureViewDto {
/** The error code */
code: number;
/** The error details */
details: FailureViewDtoDetails;
/** The error reason */
reason: string;
}
4 changes: 4 additions & 0 deletions packages/api-hooks/src/api/schemas/failureViewDtoDetails.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/**
* The error details
*/
export type FailureViewDtoDetails = { [key: string]: any };
21 changes: 21 additions & 0 deletions packages/api-hooks/src/api/schemas/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export * from './actionRequestDto';
export * from './actionStatus';
export * from './actionTypes';
export * from './actionWithLivePriceDto';
export * from './adaDetailsViewDto';
export * from './addressArgumentsDto';
export * from './addressWithTokenDto';
export * from './addressWithTokenDtoAdditionalAddresses';
Expand Down Expand Up @@ -43,6 +44,7 @@ export * from './confirmUserMeDto';
export * from './constructTransactionRequestDto';
export * from './constructTransactionRequestDtoGasArgs';
export * from './cosmosAdditionalAddressesDto';
export * from './cosmosDetailsViewDto';
export * from './cosmosGasArgsDto';
export * from './createBannedRegionDto';
export * from './createCustomUriDto';
Expand Down Expand Up @@ -75,11 +77,15 @@ export * from './deleteMasterBannedRegionsDto';
export * from './durationArgumentOptionsDto';
export * from './eRCStandards';
export * from './enabledYieldDto';
export * from './ethDeFiDetailsViewDto';
export * from './ethNativeDetailsViewDto';
export * from './evmEIP1559GasArgsDto';
export * from './evmEIP1559GasArgsDtoType';
export * from './evmLegacyGasArgsDto';
export * from './evmLegacyGasArgsDtoType';
export * from './evmNetworks';
export * from './failureViewDto';
export * from './failureViewDtoDetails';
export * from './feeConfigurationDto';
export * from './feeConfigurationStatus';
export * from './feeConfigurationWithApyDto';
Expand All @@ -99,17 +105,22 @@ export * from './healthStatus';
export * from './healthStatusDto';
export * from './infinityPaginatedDto';
export * from './infinityPaginatedDtoDataItem';
export * from './injectiveDetailsViewDto';
export * from './interestViewDto';
export * from './invalidRequestDto';
export * from './key';
export * from './keyCategory';
export * from './kilnEthereumPoolingDetailsViewDto';
export * from './masterBannedRegionDto';
export * from './masterBannedRegionDtoTagsItem';
export * from './masterBannedYieldDto';
export * from './masterBannedYieldDtoTagsItem';
export * from './nearDetailsViewDto';
export * from './networks';
export * from './notFoundDto';
export * from './oAVResponseDto';
export * from './oAVStrategyDto';
export * from './osmosisDetailsViewDto';
export * from './payoutAddressDto';
export * from './pendingActionArgumentsDto';
export * from './pendingActionConstraintAmountDto';
Expand Down Expand Up @@ -149,10 +160,19 @@ export * from './role';
export * from './serverErrorDto';
export * from './signatureVerificationArgumentsDto';
export * from './solanaAdditionalAddressesDto';
export * from './solanaDetailsViewDto';
export * from './stakeFailureDto';
export * from './stakeKitErrorDto';
export * from './stakeKitErrorDtoDetails';
export * from './stakeKitStakeDetailsViewDto';
export * from './stakeKitVaultDetailsViewDto';
export * from './stakeResponseDto';
export * from './stakeResponseDtoStake';
export * from './stakeViewSuccessDto';
export * from './stakeViewSuccessDtoCommission';
export * from './stakeViewSuccessDtoDetails';
export * from './stakeViewSuccessDtoRewardsItem';
export * from './stakeViewSuccessDtoStatus';
export * from './structuredTransactionTronDto';
export * from './structuredTransactionTronDtoVotesItem';
export * from './submitHashRequestDto';
Expand All @@ -165,6 +185,7 @@ export * from './teamDto';
export * from './teamDtoContactDetails';
export * from './teamType';
export * from './tezosAdditionalAddressesDto';
export * from './tezosDetailsViewDto';
export * from './timePeriodDto';
export * from './tokenBalanceScanDto';
export * from './tokenBalanceScanResponseDto';
Expand Down
11 changes: 11 additions & 0 deletions packages/api-hooks/src/api/schemas/injectiveDetailsViewDto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export interface InjectiveDetailsViewDto {
available_rewards: number;
balance: number;
delegated_at?: string;
delegator_address: string;
net_apy: number;
rewards: number;
undelegated_at?: string;
updated_at: string;
validator_address: string;
}
6 changes: 6 additions & 0 deletions packages/api-hooks/src/api/schemas/interestViewDto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export interface InterestViewDto {
/** The type of interest - APY */
type: string;
/** The Net APY interest rate. Interest user is getting from their staking position. Not the protocol's APY. */
value: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export interface KilnEthereumPoolingDetailsViewDto {
delegated_at: string;
delegated_block: number;
owner: string;
}
9 changes: 9 additions & 0 deletions packages/api-hooks/src/api/schemas/nearDetailsViewDto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export interface NearDetailsViewDto {
activatedAt: string;
activatedEpoch: number;
canWithdraw: boolean;
netApy: number;
stakeAccount: string;
updatedAt: string;
validator: string;
}
1 change: 1 addition & 0 deletions packages/api-hooks/src/api/schemas/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const Networks = {
core: 'core',
sonic: 'sonic',
katana: 'katana',
hyperevm: 'hyperevm',
agoric: 'agoric',
akash: 'akash',
axelar: 'axelar',
Expand Down
8 changes: 8 additions & 0 deletions packages/api-hooks/src/api/schemas/osmosisDetailsViewDto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export interface OsmosisDetailsViewDto {
available_rewards: number;
balance: number;
delegator_address: string;
net_apy: number;
rewards: number;
updated_at: string;
}
10 changes: 10 additions & 0 deletions packages/api-hooks/src/api/schemas/solanaDetailsViewDto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export interface SolanaDetailsViewDto {
activated_at: string;
activated_epoch: number;
balance: number;
net_apy: number;
stake_account: string;
updated_at: string;
validator_address: string;
withdraw_pubkey: string;
}
5 changes: 5 additions & 0 deletions packages/api-hooks/src/api/schemas/stakeFailureDto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import type { FailureViewDto } from './failureViewDto';

export interface StakeFailureDto {
error: FailureViewDto;
}
16 changes: 16 additions & 0 deletions packages/api-hooks/src/api/schemas/stakeKitStakeDetailsViewDto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export interface StakeKitStakeDetailsViewDto {
/** Total current stake balance. */
balance: number;
/** Net annual percentage yield. */
net_apy: number;
/** Total stake rewards. */
rewards: number;
/** The symbol of the token held by the user. */
symbol: string;
/** The address of the validator the user delegated assets to. */
validator?: string;
/** Array of validator addresses (for multi-validator integrations like TRON). */
validators?: string[];
/** Stakekit Integration ID. */
yield_id: string;
}
14 changes: 14 additions & 0 deletions packages/api-hooks/src/api/schemas/stakeKitVaultDetailsViewDto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export interface StakeKitVaultDetailsViewDto {
/** The URL pointing to the asset's icon in PNG format. */
asset_icon: string;
/** Address of the token held in the user's wallet. */
contract_address: string;
/** The name of the protocol. */
protocol: string;
/** The name of the protocol to display. */
protocol_display_name: string;
/** The URL pointing to the protocol's icon in PNG format. */
protocol_icon: string;
/** The symbol of the asset held in the user's wallet. */
shared_symbol: string;
}
1 change: 1 addition & 0 deletions packages/api-hooks/src/api/schemas/stakeResponseDto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ import type { StakeResponseDtoStake } from './stakeResponseDtoStake';

export interface StakeResponseDto {
id: WalletViewDto;
/** Stake information */
stake: StakeResponseDtoStake;
}
8 changes: 7 additions & 1 deletion packages/api-hooks/src/api/schemas/stakeResponseDtoStake.ts
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
export type StakeResponseDtoStake = { [key: string]: any };
import type { StakeViewSuccessDto } from './stakeViewSuccessDto';
import type { StakeFailureDto } from './stakeFailureDto';

/**
* Stake information
*/
export type StakeResponseDtoStake = StakeViewSuccessDto | StakeFailureDto;
28 changes: 28 additions & 0 deletions packages/api-hooks/src/api/schemas/stakeViewSuccessDto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import type { StakeViewSuccessDtoCommission } from './stakeViewSuccessDtoCommission';
import type { StakeViewSuccessDtoDetails } from './stakeViewSuccessDtoDetails';
import type { InterestViewDto } from './interestViewDto';
import type { StakeViewSuccessDtoRewardsItem } from './stakeViewSuccessDtoRewardsItem';
import type { StakeViewSuccessDtoStatus } from './stakeViewSuccessDtoStatus';

export interface StakeViewSuccessDto {
/** The commission type */
commission: StakeViewSuccessDtoCommission;
/** The currency of the staked asset in Ledger's crypto currency ID */
currency: string;
/** Details view */
details: StakeViewSuccessDtoDetails;
/** The interest rate */
interest: InterestViewDto;
/** The logo of the protocol (path to logo in .svg format) */
logo?: string;
/** The name of the protocol */
protocol_name: string;
/** Rewards information */
rewards: StakeViewSuccessDtoRewardsItem[];
/** The date when the stake was created */
since?: string;
/** The staked balance, denominated in the smallest unit of the currency (e.g., wei for ETH). */
staked_balance: string;
/** The status of the stake */
status: StakeViewSuccessDtoStatus;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* The commission type
*/
export type StakeViewSuccessDtoCommission =
(typeof StakeViewSuccessDtoCommission)[keyof typeof StakeViewSuccessDtoCommission];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const StakeViewSuccessDtoCommission = {
Net: 'Net',
} as const;
29 changes: 29 additions & 0 deletions packages/api-hooks/src/api/schemas/stakeViewSuccessDtoDetails.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import type { EthDeFiDetailsViewDto } from './ethDeFiDetailsViewDto';
import type { AdaDetailsViewDto } from './adaDetailsViewDto';
import type { CosmosDetailsViewDto } from './cosmosDetailsViewDto';
import type { EthNativeDetailsViewDto } from './ethNativeDetailsViewDto';
import type { InjectiveDetailsViewDto } from './injectiveDetailsViewDto';
import type { KilnEthereumPoolingDetailsViewDto } from './kilnEthereumPoolingDetailsViewDto';
import type { NearDetailsViewDto } from './nearDetailsViewDto';
import type { OsmosisDetailsViewDto } from './osmosisDetailsViewDto';
import type { SolanaDetailsViewDto } from './solanaDetailsViewDto';
import type { StakeKitStakeDetailsViewDto } from './stakeKitStakeDetailsViewDto';
import type { StakeKitVaultDetailsViewDto } from './stakeKitVaultDetailsViewDto';
import type { TezosDetailsViewDto } from './tezosDetailsViewDto';

/**
* Details view
*/
export type StakeViewSuccessDtoDetails =
| EthDeFiDetailsViewDto
| AdaDetailsViewDto
| CosmosDetailsViewDto
| EthNativeDetailsViewDto
| InjectiveDetailsViewDto
| KilnEthereumPoolingDetailsViewDto
| NearDetailsViewDto
| OsmosisDetailsViewDto
| SolanaDetailsViewDto
| StakeKitStakeDetailsViewDto
| StakeKitVaultDetailsViewDto
| TezosDetailsViewDto;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export type StakeViewSuccessDtoRewardsItem = { [key: string]: any };
14 changes: 14 additions & 0 deletions packages/api-hooks/src/api/schemas/stakeViewSuccessDtoStatus.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* The status of the stake
*/
export type StakeViewSuccessDtoStatus =
(typeof StakeViewSuccessDtoStatus)[keyof typeof StakeViewSuccessDtoStatus];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const StakeViewSuccessDtoStatus = {
activated: 'activated',
activating: 'activating',
archived: 'archived',
deactivated: 'deactivated',
deactivating: 'deactivating',
} as const;
13 changes: 13 additions & 0 deletions packages/api-hooks/src/api/schemas/tezosDetailsViewDto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export interface TezosDetailsViewDto {
activated_at?: string;
activated_cycle?: number;
backer_address: string;
balance: number;
delegated_at?: string;
delegated_block?: number;
delegated_cycle: number;
gross_apy: number;
rewards: number;
stake_address: string;
updated_at: string;
}
8 changes: 8 additions & 0 deletions packages/api-hooks/src/api/schemas/yieldProviders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,12 @@ export const YieldProviders = {
blend: 'blend',
synthetix: 'synthetix',
euler: 'euler',
maple: 'maple',
sky: 'sky',
'yo-protocol': 'yo-protocol',
meria: 'meria',
stakin: 'stakin',
globalstake: 'globalstake',
simplystaking: 'simplystaking',
coinbase: 'coinbase',
} as const;
1 change: 1 addition & 0 deletions packages/api-hooks/src/api/schemas/yieldV2YieldsNetwork.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const YieldV2YieldsNetwork = {
core: 'core',
sonic: 'sonic',
katana: 'katana',
hyperevm: 'hyperevm',
agoric: 'agoric',
akash: 'akash',
axelar: 'axelar',
Expand Down
Loading
Loading