Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rel/2.10.2 #846

Closed
wants to merge 12 commits into from
12 changes: 6 additions & 6 deletions ios/HeliumWallet.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.10.0;
MARKETING_VERSION = 2.10.2;
ONLY_ACTIVE_ARCH = NO;
OTHER_LDFLAGS = (
"$(inherited)",
Expand Down Expand Up @@ -1117,7 +1117,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.10.0;
MARKETING_VERSION = 2.10.2;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down Expand Up @@ -1303,7 +1303,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 2.10.0;
MARKETING_VERSION = 2.10.2;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_DEBUG";
Expand Down Expand Up @@ -1348,7 +1348,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 2.10.0;
MARKETING_VERSION = 2.10.2;
MTL_FAST_MATH = YES;
OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_RELEASE";
PRODUCT_BUNDLE_IDENTIFIER = com.helium.wallet.app.OneSignalNotificationServiceExtension;
Expand Down Expand Up @@ -1396,7 +1396,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 2.10.0;
MARKETING_VERSION = 2.10.2;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_DEBUG";
Expand Down Expand Up @@ -1445,7 +1445,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 2.10.0;
MARKETING_VERSION = 2.10.2;
MTL_FAST_MATH = YES;
OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_RELEASE";
PRODUCT_BUNDLE_IDENTIFIER = com.helium.wallet.app.HeliumWalletWidget;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"originHash" : "e70d3525c8e2819a8b34f22909815dab5c700c25a06c32388f3930f7b3627768",
"pins" : [
{
"identity" : "maplibre-gl-native-distribution",
Expand All @@ -9,7 +8,25 @@
"revision" : "ffda61e298c1490d4860d5184e80d618aaadc089",
"version" : "5.13.0"
}
},
{
"identity" : "swiftui-charts",
"kind" : "remoteSourceControl",
"location" : "https://github.com/spacenation/swiftui-charts",
"state" : {
"revision" : "b044e7eb04d0026490eecb115f4fc07197dad942",
"version" : "1.1.0"
}
},
{
"identity" : "swiftui-shapes",
"kind" : "remoteSourceControl",
"location" : "https://github.com/spacenation/swiftui-shapes.git",
"state" : {
"revision" : "c58b15c37eae9bd20525c6daa93a06a689ca75cb",
"version" : "1.1.0"
}
}
],
"version" : 3
"version" : 2
}
8 changes: 4 additions & 4 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1885,16 +1885,16 @@ SPEC CHECKSUMS:
ExpoSecureStore: 060cebcb956b80ddae09821610ac1aa9e1ac74cd
EXSplashScreen: fbf0ec78e9cee911df188bf17b4fe51d15a84b87
FBLazyVector: ac12dc084d1c8ec4cc4d7b3cf1b0ebda6dab85af
fmt: 8083860262b879fc92bca720969c91bdb88ada93
glog: 77f46f3d5c779b34a09b51a92fa9e0fcab64df1c
fmt: 4c2741a687cc09f0634a2e2c72a838b99f1ff120
glog: fdfdfe5479092de0c4bdbebedd9056951f092c4f
helium-react-native-sdk: 54928dcd95ea131437ac6e269cf5bb2d473bf57f
hermes-engine: e52d9706e7fd6078e529d8ada1af7b95946c4ce6
hermes-engine: 8c1577f3fdb849cbe7729c2e7b5abc4b845e88f8
lottie-ios: e047b1d2e6239b787cc5e9755b988869cf190494
lottie-react-native: f851c0e235f171d99083c803f728f644be1dcf65
maplibre-react-native: 3a0d9beca427ff9000d75e0974c366ecd3c5375e
MultiplatformBleAdapter: 5a6a897b006764392f9cef785e4360f54fb9477d
OneSignalXCFramework: f06edd9b146c7ac5935136a117ce2a5fdd6420f6
RCT-Folly: 36944e180e3143948e1c8b0c5eade65a3dd45142
RCT-Folly: 02617c592a293bd6d418e0a88ff4ee1f88329b47
RCTDeprecation: 3afceddffa65aee666dafd6f0116f1d975db1584
RCTRequired: ec1239bc9d8bf63e10fb92bd8b26171a9258e0c1
RCTTypeSafety: f5ecbc86c5c5fa163c05acb7a1c5012e15b5f994
Expand Down
46 changes: 23 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "helium-wallet",
"version": "2.10.0",
"version": "2.10.2",
"private": true,
"scripts": {
"postinstall": "patch-package && ./node_modules/.bin/rn-nodeify --hack --install && npx jetify",
Expand Down Expand Up @@ -31,34 +31,34 @@
"@coral-xyz/anchor": "^0.28.0",
"@gorhom/bottom-sheet": "4.6.0",
"@gorhom/portal": "1.0.14",
"@helium/account-fetch-cache": "0.9.7",
"@helium/account-fetch-cache-hooks": "0.9.7",
"@helium/account-fetch-cache": "0.9.18",
"@helium/account-fetch-cache-hooks": "0.9.18",
"@helium/address": "4.10.2",
"@helium/circuit-breaker-sdk": "^0.9.7",
"@helium/circuit-breaker-sdk": "^0.9.18",
"@helium/crypto-react-native": "4.8.0",
"@helium/currency-utils": "^0.9.7",
"@helium/data-credits-sdk": "^0.9.7",
"@helium/distributor-oracle": "0.9.7",
"@helium/fanout-sdk": "^0.9.7",
"@helium/helium-entity-manager-sdk": "^0.9.7",
"@helium/helium-react-hooks": "0.9.7",
"@helium/helium-sub-daos-sdk": "^0.9.7",
"@helium/currency-utils": "^0.9.18",
"@helium/data-credits-sdk": "^0.9.18",
"@helium/distributor-oracle": "0.9.18",
"@helium/fanout-sdk": "^0.9.18",
"@helium/helium-entity-manager-sdk": "^0.9.18",
"@helium/helium-react-hooks": "0.9.18",
"@helium/helium-sub-daos-sdk": "^0.9.18",
"@helium/http": "4.7.5",
"@helium/idls": "0.9.7",
"@helium/lazy-distributor-sdk": "^0.9.7",
"@helium/idls": "0.9.18",
"@helium/lazy-distributor-sdk": "^0.9.18",
"@helium/modular-governance-hooks": "^0.0.13",
"@helium/modular-governance-idls": "0.0.13",
"@helium/onboarding": "4.11.0",
"@helium/organization-sdk": "^0.0.13",
"@helium/proto-ble": "4.0.0",
"@helium/react-native-sdk": "3.0.5",
"@helium/spl-utils": "0.9.7",
"@helium/spl-utils": "0.9.18",
"@helium/state-controller-sdk": "^0.0.13",
"@helium/sus": "0.9.7",
"@helium/sus": "0.9.18",
"@helium/transactions": "4.8.1",
"@helium/treasury-management-sdk": "^0.9.7",
"@helium/voter-stake-registry-hooks": "0.9.7",
"@helium/voter-stake-registry-sdk": "0.9.7",
"@helium/treasury-management-sdk": "^0.9.18",
"@helium/voter-stake-registry-hooks": "0.9.18",
"@helium/voter-stake-registry-sdk": "0.9.18",
"@helium/wallet-link": "4.11.0",
"@jup-ag/api": "^6.0.6",
"@keystonehq/keystone-sdk": "^0.8.0",
Expand Down Expand Up @@ -276,11 +276,11 @@
"@types/react": "18",
"react": "18.2.0",
"@solana/wallet-adapter-react": "0.15.33",
"@helium/account-fetch-cache": "^0.9.7",
"@helium/account-fetch-cache-hooks": "^0.9.7",
"@helium/helium-react-hooks": "^0.9.7",
"@helium/voter-stake-registry-hooks": "^0.9.7",
"@helium/voter-stake-registry-sdk": "^0.9.7",
"@helium/account-fetch-cache": "^0.9.18",
"@helium/account-fetch-cache-hooks": "^0.9.18",
"@helium/helium-react-hooks": "^0.9.18",
"@helium/voter-stake-registry-hooks": "^0.9.18",
"@helium/voter-stake-registry-sdk": "^0.9.18",
"@helium/modular-governance-hooks": "^0.0.13",
"@helium/onboarding": "4.11.0"
},
Expand Down
21 changes: 16 additions & 5 deletions src/features/account/TokenListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { useMint, useOwnedAmount } from '@helium/helium-react-hooks'
import {
useHeliumVsrState,
usePositions,
useRegistrarForMint,
} from '@helium/voter-stake-registry-hooks'
import { getPositionKeysForOwner } from '@helium/voter-stake-registry-sdk'
import { useCurrentWallet } from '@hooks/useCurrentWallet'
Expand Down Expand Up @@ -179,17 +180,27 @@ export const TokenListGovItem = ({ mint }: { mint: PublicKey }) => {
[govMint, mint],
)

const { registrarKey } = useRegistrarForMint(mint)

const args = useMemo(
() =>
wallet &&
mint &&
connection && {
wallet,
mint,
provider: anchorProvider,
connection &&
registrarKey && {
registrar: registrarKey,
owner: wallet,
connection,
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[wallet?.toBase58(), mint.toBase58(), connection, anchorProvider],
[
// eslint-disable-next-line react-hooks/exhaustive-deps
registrarKey?.toBase58(),
// eslint-disable-next-line react-hooks/exhaustive-deps
wallet?.toBase58(),
connection,
anchorProvider,
],
)

const { result, loading: loadingPositionKeys } = useAsync(
Expand Down
28 changes: 18 additions & 10 deletions src/features/governance/PositionCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ import React, { useCallback, useMemo, useRef, useState } from 'react'
import { useAsync } from 'react-async-hook'
import { useTranslation } from 'react-i18next'
import { FadeIn, FadeOut } from 'react-native-reanimated'
import { EPOCH_LENGTH } from '@helium/helium-sub-daos-sdk'
import { MessagePreview } from '../../solana/MessagePreview'
import { useSolana } from '../../solana/SolanaProvider'
import { useWalletSign } from '../../solana/WalletSignProvider'
Expand Down Expand Up @@ -126,7 +127,7 @@ export const PositionCard = ({
})
}, [position, unixNow, positions])

const { lockup, hasGenesisMultiplier, votingMint } = position
const { lockup, isDelegated, hasGenesisMultiplier, votingMint } = position
const { info: mintAcc } = useMint(votingMint.mint)
const {
loading: loadingMetadata,
Expand All @@ -139,8 +140,13 @@ export const PositionCard = ({
? t('gov.positions.constant')
: t('gov.positions.decaying')
const hasActiveVotes = position.numActiveVotes > 0
const lockupExpired =
!isConstant && lockup.endTs.sub(new BN(unixNow || 0)).lt(new BN(0))
const decayedEpoch = lockup.endTs.div(new BN(EPOCH_LENGTH))
const currentEpoch = new BN(unixNow).div(new BN(EPOCH_LENGTH))
const isDecayed =
!isConstant &&
(isDelegated
? currentEpoch.gt(decayedEpoch)
: lockup.endTs.lte(new BN(unixNow)))

const lockedTokens =
mintAcc && humanReadable(position.amountDepositedNative, mintAcc.decimals)
Expand Down Expand Up @@ -436,6 +442,7 @@ export const PositionCard = ({
onInstructions: async (ixs, sigs) => {
await decideAndExecute({
header: t('gov.transactions.splitPosition'),
sequentially: true,
message: t('gov.positions.splitMessage', {
amount: values.amount,
symbol,
Expand Down Expand Up @@ -583,7 +590,7 @@ export const PositionCard = ({
)
return (
<>
{position.isDelegated ? (
{isDelegated ? (
<>
<ListItem
key="undelegate"
Expand All @@ -599,7 +606,7 @@ export const PositionCard = ({
</>
) : (
<>
{lockupExpired ? (
{isDecayed ? (
<ListItem
key="close"
title={t('gov.positions.close')}
Expand Down Expand Up @@ -690,7 +697,7 @@ export const PositionCard = ({
/>
</>
)}
{canDelegate && !position.isDelegated && (
{canDelegate && !isDelegated && (
<ListItem
key="delegate"
title={t('gov.positions.delegate')}
Expand Down Expand Up @@ -870,11 +877,12 @@ export const PositionCard = ({
</Text>
<Text variant="body2" color="primaryText">
{isConstant
? getMinDurationFmt(
position.lockup.startTs,
position.lockup.endTs,
? getMinDurationFmt(lockup.startTs, lockup.endTs)
: isDelegated
? getTimeLeftFromNowFmt(
lockup.endTs.add(new BN(EPOCH_LENGTH)),
)
: getTimeLeftFromNowFmt(position.lockup.endTs)}
: getTimeLeftFromNowFmt(lockup.endTs)}
</Text>
</Box>
{hasGenesisMultiplier && (
Expand Down
Loading
Loading