Skip to content

Commit

Permalink
fixup! Add Coreum native staking via StakeKit
Browse files Browse the repository at this point in the history
  • Loading branch information
peachbits committed Jan 17, 2024
1 parent 2cf8ea2 commit 606a06f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 26 deletions.
1 change: 1 addition & 0 deletions globals.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
// Remove when Hermes supports TextEncoder API natively: https://github.com/facebook/hermes/issues/948
global.TextEncoder = require('text-encoding').TextEncoder
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,14 @@ const adaptors: CoreumNativeSkateKitAdapterConfig[] = [
}
]

const makePolicyConfig = (adaptor: CoreumNativeSkateKitAdapterConfig) => {
const makePolicyConfig = (adapterConfig: CoreumNativeSkateKitAdapterConfig) => {
return {
stakePolicyId: `coreum_native_${adaptor.preferredValidatorAddress}`,
stakeProviderInfo: { ...stakeProviderInfo, displayName: `Coreum Native Staking - ${adaptor.preferredValidatorName}` },
stakePolicyId: `coreum_native_${adapterConfig.preferredValidatorAddress}`,
stakeProviderInfo: { ...stakeProviderInfo, displayName: `Coreum Native Staking - ${adapterConfig.preferredValidatorName}` },
parentPluginId: 'coreum',
parentCurrencyCode: 'COREUM',
hideUnstakeAction: true,
adapterConfig: {
...commonAdaptorConfig,
...adaptor
},
adapterConfig,
stakeAssets: [{ pluginId: 'coreum', currencyCode: 'COREUM' }],
rewardAssets: [{ pluginId: 'coreum', currencyCode: 'COREUM' }]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
yieldYieldOpportunity
} from '@stakekit/api-hooks'
import { add, div, eq, floor, gt, mul, sub } from 'biggystring'
import { EdgeCurrencyWallet, EdgeTransaction } from 'edge-core-js/types'
import { EdgeCurrencyWallet, EdgeTransaction } from 'edge-core-js'

import { ENV } from '../../../../env'
import { convertNativeToExchange, DECIMAL_PRECISION } from '../../../../util/utils'
Expand Down Expand Up @@ -364,11 +364,6 @@ export const makeSkateKitAdapter = (policyConfig: StakePolicyConfig<CoreumNative
})
break
}
// case 'unstaked':
// case 'unlocking':
// case 'locked':
// case 'available':
// case 'preparing':
default: {
continue
}
Expand All @@ -380,19 +375,6 @@ export const makeSkateKitAdapter = (policyConfig: StakePolicyConfig<CoreumNative
canClaim = true
break
}
// case 'STAKE':
// case 'UNSTAKE':
// case 'CLAIM_UNSTAKED':
// case 'RESTAKE_REWARDS':
// case 'RESTAKE':
// case 'WITHDRAW':
// case 'UNLOCK_LOCKED':
// case 'UNLOCK_LOCKED_LEGACY':
// case 'REVOKE':
// case 'STAKE_LOCKED':
// case 'VOTE_LOCKED':
// case 'VOTE':
// case 'REVOTE':
default: {
// do nothing
}
Expand Down

0 comments on commit 606a06f

Please sign in to comment.