@polkadot/types/interfaces#BountyIndex TypeScript Examples
The following examples show how to use
@polkadot/types/interfaces#BountyIndex.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: useBounties.tsx From crust-apps with Apache License 2.0 | 5 votes |
export function useBounties (): BountyApi {
const { api } = useApi();
const bounties = useCall<DeriveBounties>(api.derive.bounties.bounties);
const bountyIndex = useCall<BountyIndex>((api.query.bounties || api.query.treasury).bountyCount);
const bestNumber = useBestNumber();
const constsBase = api.consts.bounties || api.consts.treasury;
const bountyCuratorDeposit = (constsBase.bountyCuratorDeposit as BalanceOf).toBn();
const bountyDepositBase = (constsBase.bountyDepositBase as BalanceOf).toBn();
const bountyValueMinimum = (constsBase.bountyValueMinimum as BalanceOf).toBn();
const maximumReasonLength = constsBase.maximumReasonLength.toNumber();
const dataDepositPerByte = (constsBase.dataDepositPerByte as BalanceOf).toBn();
const bountyUpdatePeriod = constsBase.bountyUpdatePeriod;
const proposeBounty = (api.tx.bounties || api.tx.treasury).proposeBounty;
const proposeCurator = (api.tx.bounties || api.tx.treasury).proposeCurator;
const claimBounty = (api.tx.bounties || api.tx.treasury).claimBounty;
const acceptCurator = (api.tx.bounties || api.tx.treasury).acceptCurator;
const approveBounty = (api.tx.bounties || api.tx.treasury).approveBounty;
const closeBounty = (api.tx.bounties || api.tx.treasury).closeBounty;
const extendBountyExpiry = (api.tx.bounties || api.tx.treasury).extendBountyExpiry;
const unassignCurator = (api.tx.bounties || api.tx.treasury).unassignCurator;
const awardBounty = (api.tx.bounties || api.tx.treasury).awardBounty;
return {
acceptCurator,
approveBounty,
awardBounty,
bestNumber,
bounties,
bountyCuratorDeposit,
bountyDepositBase,
bountyIndex,
bountyUpdatePeriod,
bountyValueMinimum,
claimBounty,
closeBounty,
dataDepositPerByte,
extendBountyExpiry,
maximumReasonLength,
proposeBounty,
proposeCurator,
unassignCurator
};
}
Example #2
Source File: bountiesPage.tsx From crust-apps with Apache License 2.0 | 5 votes |
aBountyIndex: (index?: number) => BountyIndex;
Example #3
Source File: bountyFactory.ts From crust-apps with Apache License 2.0 | 5 votes |
public aBountyIndex = (index = 0): BountyIndex =>
this.#registry.createType('BountyIndex', index);