Skip to content

Commit

Permalink
rename subsidy page
Browse files Browse the repository at this point in the history
  • Loading branch information
kingsleydon committed Dec 8, 2023
1 parent 8c47065 commit 74b00e5
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 19 deletions.
10 changes: 5 additions & 5 deletions apps/app/components/DashboardCarousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ import {useMemo, useState, type FC} from 'react'
import {useSnapCarousel} from 'react-snap-carousel'

const contents: Array<{name: string; imageUrl: string; href: string}> = [
{
name: 'Claim subsidies',
href: '/khala/subsidy',
imageUrl: b5.src,
},
{
name: 'Launch Gemini Tokenomic on Phala',
href: 'https://khala.subsquare.io/democracy/referendum/89',
Expand All @@ -23,11 +28,6 @@ const contents: Array<{name: string; imageUrl: string; href: string}> = [
href: 'https://phala.world/marketplace',
imageUrl: b6.src,
},
{
name: 'Claim missing delegator rewards',
href: '/claim-missing-delegator-rewards',
imageUrl: b5.src,
},
{
name: 'Vaults feature',
href: 'https://medium.com/phala-network/vaults-simplifying-and-optimizing-your-phala-delegations-368469608ea7',
Expand Down
33 changes: 33 additions & 0 deletions apps/app/hooks/useAssetBalance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,37 @@ const useAssetBalance = (
return data
}

// const useAssetBalanceList = (account: string, assetIds: number[]) => {
// const api = usePolkadotApi()
// const assetsMetadata = useAssetsMetadata()
// const {data} = useQuery(
// [
// 'assetBalanceList',
// api?.runtimeChain,
// assetsMetadata == null,
// account,
// assetIds,
// ],
// async () => {
// if (api == null || account == null) {
// return null
// }
// const res = await api.query.assets.account.multi(
// assetIds.map((assetId) => [assetId, account]),
// )
// return res.map((item, index) => {
// const assetId = assetIds[index]
// const assetMetadata = assetsMetadata?.[assetId]
// if (assetMetadata == null) return null
// const unwrapped = item.unwrapOr({balance: 0})
// return new Decimal(unwrapped.balance.toString()).div(
// Decimal.pow(10, assetMetadata.decimals),
// )
// })
// },
// )

// return data
// }

export default useAssetBalance
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ interface Row {
kind: Kind
}

const ClaimMissingDelegatorRewards: NextPage = () => {
const Subsidy: NextPage = () => {
const [chain, setChain] = useAtom(chainAtom)
const signAndSend = useSignAndSend()
const [pid, setPid] = useState<string>()
Expand Down Expand Up @@ -239,7 +239,7 @@ const ClaimMissingDelegatorRewards: NextPage = () => {

return (
<>
<PageHeader title="Claim Missing Delegator Rewards" />
<PageHeader title="Claim Subsidies" />
<Paper
variant="outlined"
sx={{p: 3, background: 'transparent', 'p + p': {mt: '1em'}}}
Expand Down Expand Up @@ -283,7 +283,10 @@ const ClaimMissingDelegatorRewards: NextPage = () => {
polkadot.js app
</Link>{' '}
to claim your rewards. Here is the{' '}
<Link href="" target="_blank">
<Link
href="https://forum.phala.network/t/how-to-claim-subsidy-via-polkadot-js-app/3921"
target="_blank"
>
tutorial
</Link>{' '}
for Multisig.
Expand Down Expand Up @@ -404,7 +407,7 @@ const ClaimMissingDelegatorRewards: NextPage = () => {
)}

<Dialog open={dialogOpen} onClose={onClose}>
<DialogTitle>Claim Missing Delegator Reward</DialogTitle>
<DialogTitle>Claim Subsidies</DialogTitle>
<DialogContent>
<TextField
autoFocus
Expand Down Expand Up @@ -459,4 +462,4 @@ const ClaimMissingDelegatorRewards: NextPage = () => {
)
}

export default ClaimMissingDelegatorRewards
export default Subsidy
2 changes: 0 additions & 2 deletions packages/polkadot-types/interfaces/augment-api-tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,6 @@ declare module '@polkadot/api-base/types/submittable' {
* See [`Pallet::add_staker_to_whitelist`].
**/
addStakerToWhitelist: AugmentedSubmittable<(pid: u64 | AnyNumber | Uint8Array, staker: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u64, AccountId32]>;
claimReimbursement: AugmentedSubmittable<(pid: u64 | AnyNumber | Uint8Array, target: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u64, AccountId32]>;
/**
* See [`Pallet::claim_reimbursement`].
**/
Expand All @@ -690,7 +689,6 @@ declare module '@polkadot/api-base/types/submittable' {
* See [`Pallet::set_pool_description`].
**/
setPoolDescription: AugmentedSubmittable<(pid: u64 | AnyNumber | Uint8Array, description: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u64, Bytes]>;
setReimbursements: AugmentedSubmittable<(input: Vec<ITuple<[AccountId32, u64, u128]>> | ([AccountId32 | string | Uint8Array, u64 | AnyNumber | Uint8Array, u128 | AnyNumber | Uint8Array])[]) => SubmittableExtrinsic<ApiType>, [Vec<ITuple<[AccountId32, u64, u128]>>]>;
/**
* See [`Pallet::set_reimbursements`].
**/
Expand Down
6 changes: 3 additions & 3 deletions packages/polkadot-types/interfaces/lookup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4903,7 +4903,7 @@ export default {
}
},
/**
* Lookup330: phala_pallets::compute::vault::pallet::Call<T>
* Lookup332: phala_pallets::compute::vault::pallet::Call<T>
**/
PhalaPalletsComputeVaultPalletCall: {
_enum: {
Expand Down Expand Up @@ -4934,7 +4934,7 @@ export default {
}
},
/**
* Lookup331: phala_pallets::compute::wrapped_balances::pallet::Call<T>
* Lookup333: phala_pallets::compute::wrapped_balances::pallet::Call<T>
**/
PhalaPalletsComputeWrappedBalancesPalletCall: {
_enum: {
Expand All @@ -4957,7 +4957,7 @@ export default {
}
},
/**
* Lookup332: phala_pallets::compute::base_pool::pallet::Call<T>
* Lookup334: phala_pallets::compute::base_pool::pallet::Call<T>
**/
PhalaPalletsComputeBasePoolPalletCall: {
_enum: {
Expand Down
6 changes: 3 additions & 3 deletions packages/polkadot-types/interfaces/types-lookup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5123,7 +5123,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Create' | 'AddWorker' | 'RemoveWorker' | 'SetCap' | 'SetPayoutPref' | 'ClaimLegacyRewards' | 'ClaimOwnerRewards' | 'CheckAndMaybeForceWithdraw' | 'Contribute' | 'Withdraw' | 'StartComputing' | 'StopComputing' | 'ReclaimPoolWorker' | 'RestartComputing';
}

/** @name PhalaPalletsComputeVaultPalletCall (330) */
/** @name PhalaPalletsComputeVaultPalletCall (332) */
interface PhalaPalletsComputeVaultPalletCall extends Enum {
readonly isCreate: boolean;
readonly isSetPayoutPref: boolean;
Expand Down Expand Up @@ -5158,7 +5158,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Create' | 'SetPayoutPref' | 'ClaimOwnerShares' | 'MaybeGainOwnerShares' | 'CheckAndMaybeForceWithdraw' | 'Contribute' | 'Withdraw';
}

/** @name PhalaPalletsComputeWrappedBalancesPalletCall (331) */
/** @name PhalaPalletsComputeWrappedBalancesPalletCall (333) */
interface PhalaPalletsComputeWrappedBalancesPalletCall extends Enum {
readonly isWrap: boolean;
readonly asWrap: {
Expand All @@ -5183,7 +5183,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Wrap' | 'UnwrapAll' | 'Unwrap' | 'Vote' | 'Unlock';
}

/** @name PhalaPalletsComputeBasePoolPalletCall (332) */
/** @name PhalaPalletsComputeBasePoolPalletCall (334) */
interface PhalaPalletsComputeBasePoolPalletCall extends Enum {
readonly isAddStakerToWhitelist: boolean;
readonly asAddStakerToWhitelist: {
Expand Down
2 changes: 1 addition & 1 deletion packages/polkadot-types/metadata.json

Large diffs are not rendered by default.

0 comments on commit 74b00e5

Please sign in to comment.