Skip to content

Commit

Permalink
Bugfix/custom destination distribute (#833)
Browse files Browse the repository at this point in the history
* bump deps (#821)

* bump deps 0.9.12 (#822)

* Fix getPositionKeysForOwner args (#823)

* Fix bug when claiming all with custom destination

---------

Co-authored-by: Bryan <[email protected]>
  • Loading branch information
ChewingGlass and bryzettler authored Nov 21, 2024
1 parent 3933796 commit 61df927
Show file tree
Hide file tree
Showing 3 changed files with 197 additions and 170 deletions.
44 changes: 22 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,34 +31,34 @@
"@coral-xyz/anchor": "^0.28.0",
"@gorhom/bottom-sheet": "4.6.4",
"@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.14",
"@helium/account-fetch-cache-hooks": "0.9.14",
"@helium/address": "4.10.2",
"@helium/circuit-breaker-sdk": "^0.9.7",
"@helium/circuit-breaker-sdk": "^0.9.14",
"@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.14",
"@helium/data-credits-sdk": "^0.9.14",
"@helium/distributor-oracle": "0.9.14",
"@helium/fanout-sdk": "^0.9.14",
"@helium/helium-entity-manager-sdk": "^0.9.14",
"@helium/helium-react-hooks": "0.9.14",
"@helium/helium-sub-daos-sdk": "^0.9.14",
"@helium/http": "4.7.5",
"@helium/idls": "0.9.7",
"@helium/lazy-distributor-sdk": "^0.9.7",
"@helium/idls": "0.9.14",
"@helium/lazy-distributor-sdk": "^0.9.14",
"@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.14",
"@helium/state-controller-sdk": "^0.0.13",
"@helium/sus": "0.9.7",
"@helium/sus": "0.9.14",
"@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.14",
"@helium/voter-stake-registry-hooks": "0.9.14",
"@helium/voter-stake-registry-sdk": "0.9.14",
"@helium/wallet-link": "4.11.0",
"@jup-ag/api": "^6.0.6",
"@keystonehq/keystone-sdk": "^0.8.0",
Expand Down Expand Up @@ -279,11 +279,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.14",
"@helium/account-fetch-cache-hooks": "^0.9.14",
"@helium/helium-react-hooks": "^0.9.14",
"@helium/voter-stake-registry-hooks": "^0.9.14",
"@helium/voter-stake-registry-sdk": "^0.9.14",
"@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 @@ -10,6 +10,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 @@ -340,17 +341,27 @@ export const TokenListGovItem = ({
[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
Loading

0 comments on commit 61df927

Please sign in to comment.