Class: StakingService
Table of contents
Constructors
Properties
Methods
- getDailyEstimation
- getStakableAssets
- getStakeCollectionInfo
- getStakeCollectionStats
- getStakeForecast
- getStakes
- harvestStake
- stakeAssets
Constructors
constructor
• new StakingService(_debug
, _trpc
, _wallet
)
Parameters
Name | Type |
---|---|
_debug | DebugService |
_trpc | TrpcService |
_wallet | WalletService |
Properties
_debug
• Private
_debug: DebugService
_trpc
• Private
_trpc: TrpcService
_wallet
• Private
_wallet: WalletService
Methods
getDailyEstimation
▸ getDailyEstimation(params
): Promise
<{ breakdown
: { [x: string]: { unit: string; quantity: string; }[]; [x: number]: { unit: string; quantity: string; }[] | undefined; } ; mint
: { quantity: number; collectionId: number; destAddress?: string | undefined; specificIds?: string[] | undefined; context?: "evolution" | undefined; token?: string | undefined; customPrice?: number | undefined; }[] ; total
: { unit: string; quantity: string; }[] }>
Parameters
Name | Type |
---|---|
params | GetDailyEstimationParams |
Returns
Promise
<{ breakdown
: { [x: string]: { unit: string; quantity: string; }[]; [x: number]: { unit: string; quantity: string; }[] | undefined; } ; mint
: { quantity: number; collectionId: number; destAddress?: string | undefined; specificIds?: string[] | undefined; context?: "evolution" | undefined; token?: string | undefined; customPrice?: number | undefined; }[] ; total
: { unit: string; quantity: string; }[] }>
getStakableAssets
▸ getStakableAssets(params
): Promise
<({ assetName
: string
; available?
: null
| boolean
; policyId
: string
; quantity?
: number
; rarity?
: null
| number
; unit
: string
} | { assetName
: string
; available
: null
| boolean
; id
: number
; metadata
: null
| {} ; policyId
: string
; rarity
: null
| number
; unit
: string
})[]>
Parameters
Name | Type |
---|---|
params | GetStakableAssetsParams |
Returns
Promise
<({ assetName
: string
; available?
: null
| boolean
; policyId
: string
; quantity?
: number
; rarity?
: null
| number
; unit
: string
} | { assetName
: string
; available
: null
| boolean
; id
: number
; metadata
: null
| {} ; policyId
: string
; rarity
: null
| number
; unit
: string
})[]>
getStakeCollectionInfo
▸ getStakeCollectionInfo(params
): Promise
<{ stakeCollection
: { id: number; available: boolean; policies: string[]; tokens: { id: number; unit: string | null; assetName: string | null; metadata: {} | null; available: boolean | null; collectionId: number | null; decimal: number | null; }[]; policiesInfo: { ...; }[]; stakingPeriods: { ...; }[]; maxPerTransaction: number; minPerT... }>
Parameters
Name | Type |
---|---|
params | GetStakeCollectionInfoParams |
Returns
Promise
<{ stakeCollection
: { id: number; available: boolean; policies: string[]; tokens: { id: number; unit: string | null; assetName: string | null; metadata: {} | null; available: boolean | null; collectionId: number | null; decimal: number | null; }[]; policiesInfo: { ...; }[]; stakingPeriods: { ...; }[]; maxPerTransaction: number; minPerT... }>
getStakeCollectionStats
▸ getStakeCollectionStats(params
): Promise
<{ breakdown
: { name: string | null; policyId: string | null; supply: number | null; stakedNfts: number; }[] ; total
: { supply: number; stakedNfts: number; } }>
Parameters
Name | Type |
---|---|
params | GetStakeCollectionStatsParams |
Returns
Promise
<{ breakdown
: { name: string | null; policyId: string | null; supply: number | null; stakedNfts: number; }[] ; total
: { supply: number; stakedNfts: number; } }>
getStakeForecast
▸ getStakeForecast(params
): Promise
<{ date
: string
; total
: { unit: string; quantity: string; }[] }[]>
Parameters
Name | Type |
---|---|
params | GetStakeForecastParams |
Returns
Promise
<{ date
: string
; total
: { unit: string; quantity: string; }[] }[]>
getStakes
▸ getStakes(params
): Promise
<({ address
: string
; assets
: { id: number; policyId: string; unit: string; assetName: string; available?: boolean | null | undefined; rarity?: number | null | undefined; quantity?: number | undefined; }[] ; claimId
: null
| number
; claimed
: null
| boolean
; claimedTx
: boolean
; deleted
: null
| boolean
; endAt
: null
| string
; harvest
: { wallet: string | null; recipient: { address?: string | undefined; note: string | string[]; } | null; id: number; createdAt: string | null; txHash: string; metadata: {} | null; transactionId: number; ... 15 more ...; sequenceTxId: number | null; } ; harvestByAssets
: { id: number; txHash: string | null; unit: string | null; quantity: string | null; stakeId: number | null; context: string | null; stakeHarvestId: number | null; harvestAt: string | null; rewardUnit: string | null; row?: undefined; }[] ; id
: number
; keyhash
: string
; policyScript
: { type: "any" | "all"; scripts: (... | { type: "atLeast"; scripts: (... | ... | { type: "sig"; keyHash: string; } | { type: "before" | "after"; slot: number; })[]; required: number; } | { type: "sig"; keyHash: string; } | { ...; })[]; } | { type: "atLeast"; scripts: ({ type: "any" | "all"; scripts: (... | ... | { type: "sig"; keyHash: string; } | { type: "before" | "after"; slot: number; })[]; } | ... | { type: "sig"; keyHash: string; } | { ...; })[]; required: number; } | { type: "sig"; keyHash: string; } | { type: "before" | "after"; slot: number; } ; result
: { mint: { quantity: number; collectionId: number; destAddress?: string | undefined; specificIds?: string[] | undefined; context?: "evolution" | undefined; token?: string | undefined; customPrice?: number | undefined; }[]; total: { ...; }[]; breakdown: { ...; }; } ; rewards
: null
| number
; stakeCollectionId
: number
; stakedTx
: boolean
; startAt
: null
| string
; status
: StakeStatus
; transactionId
: null
| number
} | { address
: string
; assets
: { id: number; policyId: string; unit: string; assetName: string; available?: boolean | null | undefined; rarity?: number | null | undefined; quantity?: number | undefined; }[] ; claimId
: null
| number
; claimed
: null
| boolean
; deleted
: null
| boolean
; endAt
: null
| string
; harvest
: { wallet: string | null; recipient: { address?: string | undefined; note: string | string[]; } | null; id: number; createdAt: string | null; txHash: string | null; metadata: {} | null; ... 16 more ...; sequenceTxId: number | null; } ; harvestByAssets
: { id: number; txHash: string | null; unit: string | null; quantity: string | null; stakeId: number | null; context: string | null; stakeHarvestId: number | null; harvestAt: string | null; rewardUnit: string | null; row?: undefined; }[] ; id
: number
; keyhash
: string
; policyScript
: { type: "any" | "all"; scripts: (... | { type: "atLeast"; scripts: (... | ... | { type: "sig"; keyHash: string; } | { type: "before" | "after"; slot: number; })[]; required: number; } | { type: "sig"; keyHash: string; } | { ...; })[]; } | { type: "atLeast"; scripts: ({ type: "any" | "all"; scripts: (... | ... | { type: "sig"; keyHash: string; } | { type: "before" | "after"; slot: number; })[]; } | ... | { type: "sig"; keyHash: string; } | { ...; })[]; required: number; } | { type: "sig"; keyHash: string; } | { type: "before" | "after"; slot: number; } ; result
: { mint: { quantity: number; collectionId: number; destAddress?: string | undefined; specificIds?: string[] | undefined; context?: "evolution" | undefined; token?: string | undefined; customPrice?: number | undefined; }[]; total: { ...; }[]; breakdown: { ...; }; } ; rewards
: null
| number
; stakeCollectionId
: number
; startAt
: null
| string
; transactionId
: null
| number
})[]>
Parameters
Name | Type |
---|---|
params | GetStakesParams |
Returns
Promise
<({ address
: string
; assets
: { id: number; policyId: string; unit: string; assetName: string; available?: boolean | null | undefined; rarity?: number | null | undefined; quantity?: number | undefined; }[] ; claimId
: null
| number
; claimed
: null
| boolean
; claimedTx
: boolean
; deleted
: null
| boolean
; endAt
: null
| string
; harvest
: { wallet: string | null; recipient: { address?: string | undefined; note: string | string[]; } | null; id: number; createdAt: string | null; txHash: string; metadata: {} | null; transactionId: number; ... 15 more ...; sequenceTxId: number | null; } ; harvestByAssets
: { id: number; txHash: string | null; unit: string | null; quantity: string | null; stakeId: number | null; context: string | null; stakeHarvestId: number | null; harvestAt: string | null; rewardUnit: string | null; row?: undefined; }[] ; id
: number
; keyhash
: string
; policyScript
: { type: "any" | "all"; scripts: (... | { type: "atLeast"; scripts: (... | ... | { type: "sig"; keyHash: string; } | { type: "before" | "after"; slot: number; })[]; required: number; } | { type: "sig"; keyHash: string; } | { ...; })[]; } | { type: "atLeast"; scripts: ({ type: "any" | "all"; scripts: (... | ... | { type: "sig"; keyHash: string; } | { type: "before" | "after"; slot: number; })[]; } | ... | { type: "sig"; keyHash: string; } | { ...; })[]; required: number; } | { type: "sig"; keyHash: string; } | { type: "before" | "after"; slot: number; } ; result
: { mint: { quantity: number; collectionId: number; destAddress?: string | undefined; specificIds?: string[] | undefined; context?: "evolution" | undefined; token?: string | undefined; customPrice?: number | undefined; }[]; total: { ...; }[]; breakdown: { ...; }; } ; rewards
: null
| number
; stakeCollectionId
: number
; stakedTx
: boolean
; startAt
: null
| string
; status
: StakeStatus
; transactionId
: null
| number
} | { address
: string
; assets
: { id: number; policyId: string; unit: string; assetName: string; available?: boolean | null | undefined; rarity?: number | null | undefined; quantity?: number | undefined; }[] ; claimId
: null
| number
; claimed
: null
| boolean
; deleted
: null
| boolean
; endAt
: null
| string
; harvest
: { wallet: string | null; recipient: { address?: string | undefined; note: string | string[]; } | null; id: number; createdAt: string | null; txHash: string | null; metadata: {} | null; ... 16 more ...; sequenceTxId: number | null; } ; harvestByAssets
: { id: number; txHash: string | null; unit: string | null; quantity: string | null; stakeId: number | null; context: string | null; stakeHarvestId: number | null; harvestAt: string | null; rewardUnit: string | null; row?: undefined; }[] ; id
: number
; keyhash
: string
; policyScript
: { type: "any" | "all"; scripts: (... | { type: "atLeast"; scripts: (... | ... | { type: "sig"; keyHash: string; } | { type: "before" | "after"; slot: number; })[]; required: number; } | { type: "sig"; keyHash: string; } | { ...; })[]; } | { type: "atLeast"; scripts: ({ type: "any" | "all"; scripts: (... | ... | { type: "sig"; keyHash: string; } | { type: "before" | "after"; slot: number; })[]; } | ... | { type: "sig"; keyHash: string; } | { ...; })[]; required: number; } | { type: "sig"; keyHash: string; } | { type: "before" | "after"; slot: number; } ; result
: { mint: { quantity: number; collectionId: number; destAddress?: string | undefined; specificIds?: string[] | undefined; context?: "evolution" | undefined; token?: string | undefined; customPrice?: number | undefined; }[]; total: { ...; }[]; breakdown: { ...; }; } ; rewards
: null
| number
; stakeCollectionId
: number
; startAt
: null
| string
; transactionId
: null
| number
})[]>
harvestStake
▸ harvestStake(params
): Promise
<string
>
Parameters
Name | Type |
---|---|
params | HarvestStakeParams |
Returns
Promise
<string
>
stakeAssets
▸ stakeAssets(params
): Promise
<string
>
Parameters
Name | Type |
---|---|
params | StakeAssetsParams |
Returns
Promise
<string
>