-
Notifications
You must be signed in to change notification settings - Fork 258
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Coreum native staking via StakeKit
- Loading branch information
Showing
10 changed files
with
751 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import { coreumnative } from './pluginInfo/coreumNativeStaking' | ||
import { glifpoolCalibration } from './pluginInfo/filecoinCalibrationGlifpool' | ||
import { glifpool } from './pluginInfo/filecoinGlifpool' | ||
import { tarotpool } from './pluginInfo/optimismTarotPool' | ||
|
||
export const genericPlugins = [glifpool, glifpoolCalibration, tarotpool] | ||
export const genericPlugins = [glifpool, glifpoolCalibration, tarotpool, coreumnative] |
54 changes: 54 additions & 0 deletions
54
src/plugins/stake-plugins/generic/pluginInfo/coreumNativeStaking.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { StakeProviderInfo } from '../../types' | ||
import { StakePluginInfo, StakePolicyConfig } from '../types' | ||
|
||
interface CoreumNativeSkateKitAdapterConfig { | ||
type: string | ||
integrationId: string | ||
preferredValidatorAddress: string | ||
preferredValidatorName: string | ||
} | ||
|
||
const stakeProviderInfo: StakeProviderInfo = { | ||
displayName: 'Coreum Native Staking', | ||
pluginId: 'coreum', | ||
stakeProviderId: 'coreum_native' | ||
} | ||
|
||
const commonAdaptorConfig = { | ||
type: 'coreum-native-stake-kit', | ||
integrationId: 'coreum-core-native-staking' | ||
} | ||
|
||
const adaptors: CoreumNativeSkateKitAdapterConfig[] = [ | ||
{ | ||
...commonAdaptorConfig, | ||
preferredValidatorAddress: 'corevaloper1k0rllvenwr02gvm52fh5056g5m3hly2lpf63z5', // StakeLab | ||
preferredValidatorName: 'StakeLab' | ||
}, | ||
|
||
{ | ||
...commonAdaptorConfig, | ||
preferredValidatorAddress: 'corevaloper1puge9crcxvq02jguql4vp2dhglvjll3wzdcggq', // Bware Labs | ||
preferredValidatorName: 'Bware Labs' | ||
} | ||
] | ||
|
||
const makePolicyConfig = (adapterConfig: CoreumNativeSkateKitAdapterConfig) => { | ||
return { | ||
stakePolicyId: `coreum_native_${adapterConfig.preferredValidatorAddress}`, | ||
stakeProviderInfo: { ...stakeProviderInfo, displayName: `Coreum Native Staking - ${adapterConfig.preferredValidatorName}` }, | ||
parentPluginId: 'coreum', | ||
parentCurrencyCode: 'COREUM', | ||
hideUnstakeAction: true, | ||
adapterConfig, | ||
stakeAssets: [{ pluginId: 'coreum', currencyCode: 'COREUM' }], | ||
rewardAssets: [{ pluginId: 'coreum', currencyCode: 'COREUM' }] | ||
} | ||
} | ||
|
||
const coreumPolicyConfig: Array<StakePolicyConfig<any>> = adaptors.map(adaptor => makePolicyConfig(adaptor)) | ||
|
||
export const coreumnative: StakePluginInfo = { | ||
pluginId: 'stake:coreum:native', | ||
policyConfigs: [...coreumPolicyConfig] | ||
} |
Oops, something went wrong.