Update to latest Substrate metadata (#2967)

* Update to latest Substrate metadata

* Update bounties derive

* Cleanups

* Update bounty location
This commit is contained in:
Jaco Greeff
2020-12-20 10:36:38 +01:00
committed by GitHub
parent ece0a4b19a
commit 0b11fc98b9
13 changed files with 1120 additions and 963 deletions
@@ -1,4 +1,4 @@
// Copyright 2017-2020 @polkadot/api authors & contributors
// Copyright 2017-2020 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ApiInterfaceRx } from '@polkadot/api/types';
@@ -6,12 +6,12 @@ import type { Bytes, Option, StorageKey } from '@polkadot/types';
import type { Bounty, BountyIndex } from '@polkadot/types/interfaces';
import type { Codec, InterfaceTypes } from '@polkadot/types/types';
import { bounties } from '@polkadot/api-derive/treasury/bounties';
import { of } from '@polkadot/x-rxjs';
import { BountyFactory } from '../../test/bountyFactory';
import { BytesFactory } from '../../test/bytesFactory';
import { createApiWithAugmentations } from '../../test/helpers';
import { bounties } from '.';
const DEFAULT_PROPOSER = '5C4hrfjw9DjXZTzV3MwzrrAr9P1MJhSrvWGWqi1eSuyUpnhM';
@@ -0,0 +1,47 @@
// Copyright 2017-2020 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ApiInterfaceRx } from '@polkadot/api/types';
import type { DeriveBounties } from '@polkadot/api-derive/types';
import type { Bytes, Option } from '@polkadot/types';
import type { Bounty, BountyIndex } from '@polkadot/types/interfaces';
import type { Observable } from '@polkadot/x-rxjs';
import { memo } from '@polkadot/api-derive/util';
import { combineLatest } from '@polkadot/x-rxjs';
import { map, switchMap } from '@polkadot/x-rxjs/operators';
type Result = [Option<Bounty>[], Option<Bytes>[]];
function parseResult ([maybeBounties, maybeDescriptions]: Result): DeriveBounties {
const bounties: DeriveBounties = [];
maybeBounties.forEach((bounty, index) => {
if (bounty.isSome) {
bounties.push({ bounty: bounty.unwrap(), description: maybeDescriptions[index].unwrapOrDefault().toUtf8() });
}
});
return bounties;
}
export function bounties (instanceId: string, api: ApiInterfaceRx): () => Observable<DeriveBounties> {
const bountyBase = api.query.bounties
? api.query.bounties
: api.query.treasury;
return memo(instanceId, (): Observable<DeriveBounties> =>
bountyBase.bountyCount<BountyIndex>().pipe(
switchMap(() => api.query.treasury.bounties.keys()),
switchMap((keys): Observable<Result> => {
const ids = keys.map(({ args: [id] }) => id);
return combineLatest([
bountyBase.bounties.multi<Option<Bounty>>(ids),
bountyBase.bountyDescriptions.multi<Option<Bytes>>(ids)
]);
}),
map(parseResult)
)
);
}
@@ -0,0 +1,4 @@
// Copyright 2017-2020 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
export * from './bounties';
+2 -1
View File
@@ -7,6 +7,7 @@ import type { Observable } from '@polkadot/x-rxjs';
import * as accounts from './accounts';
import * as balances from './balances';
import * as bounties from './bounties';
import * as chain from './chain';
import * as contracts from './contracts';
import * as council from './council';
@@ -23,7 +24,7 @@ import * as tx from './tx';
export * from './type';
export const derive = { accounts, balances, chain, contracts, council, democracy, elections, imOnline, parachains, session, society, staking, technicalCommittee, treasury, tx };
export const derive = { accounts, balances, bounties, chain, contracts, council, democracy, elections, imOnline, parachains, session, society, staking, technicalCommittee, treasury, tx };
type DeriveSection<Section> = {
[Method in keyof Section]: Section[Method] extends AnyFunction
@@ -1,41 +0,0 @@
// Copyright 2017-2020 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ApiInterfaceRx } from '@polkadot/api/types';
import type { DeriveBounties } from '@polkadot/api-derive/types';
import type { Bytes, Option, StorageKey } from '@polkadot/types';
import type { Bounty } from '@polkadot/types/interfaces';
import type { Codec } from '@polkadot/types/types';
import type { Observable } from '@polkadot/x-rxjs';
import { memo } from '@polkadot/api-derive/util';
import { combineLatest } from '@polkadot/x-rxjs';
import { map, switchMap } from '@polkadot/x-rxjs/operators';
function parseResult ([maybeBounties, maybeDescriptions]: [Option<Bounty>[], Option<Bytes>[]]): DeriveBounties {
const bounties: DeriveBounties = [];
maybeBounties.forEach((bounty, index) => {
if (bounty.isSome) {
bounties.push({ bounty: bounty.unwrap(), description: maybeDescriptions[index].unwrapOrDefault().toUtf8() });
}
});
return bounties;
}
function extractIds (keys: StorageKey[]): Codec[] {
return keys.map(({ args: [id] }: StorageKey) => id);
}
export function bounties (instanceId: string, api: ApiInterfaceRx): () => Observable<DeriveBounties> {
return memo(instanceId, (): Observable<DeriveBounties> => api.query.treasury.bountyCount().pipe(
switchMap(() => api.query.treasury.bounties.keys()),
switchMap((keys: StorageKey[]) => {
return combineLatest([
api.query.treasury.bounties.multi<Option<Bounty>>(extractIds(keys)),
api.query.treasury.bountyDescriptions.multi<Option<Bytes>>(extractIds(keys))
]
).pipe(map(parseResult));
})));
}
@@ -2,4 +2,3 @@
// SPDX-License-Identifier: Apache-2.0
export * from './proposals';
export * from './bounties';
+8 -4
View File
@@ -15,11 +15,14 @@ export class BountyFactory {
this.#registry = this.#api.registry;
}
public storageKey = (index: number): StorageKey => new StorageKey(this.#registry, this.#api.query.treasury.bounties.key(this.bountyIndex(index)));
public storageKey = (index: number): StorageKey =>
new StorageKey(this.#registry, this.#api.query.bounties.bounties.key(this.bountyIndex(index)));
public bountyIndex = (index: number): BountyIndex => this.#registry.createType('BountyIndex', index);
public bountyIndex = (index: number): BountyIndex =>
this.#registry.createType('BountyIndex', index);
public defaultBounty = (): Bounty => this.#registry.createType('Bounty');
public defaultBounty = (): Bounty =>
this.#registry.createType('Bounty');
public optionOf = <T extends Codec>(value: T): Option<T> => {
const typeName = this.#registry.getClassName(value.constructor as Constructor<T>);
@@ -27,5 +30,6 @@ export class BountyFactory {
return new Option<T>(this.#registry, typeName as keyof InterfaceTypes, value);
};
public emptyOption = <T extends Codec>(typeName: keyof InterfaceTypes): Option<T> => new Option<T>(this.#registry, typeName);
public emptyOption = <T extends Codec>(typeName: keyof InterfaceTypes): Option<T> =>
new Option<T>(this.#registry, typeName);
}
+50 -33
View File
@@ -35,6 +35,33 @@ declare module '@polkadot/api/types/consts' {
**/
existentialDeposit: Balance & AugmentedConst<ApiType>;
};
bounties: {
[key: string]: Codec;
/**
* Percentage of the curator fee that will be reserved upfront as deposit for bounty curator.
**/
bountyCuratorDeposit: Permill & AugmentedConst<ApiType>;
/**
* The amount held on deposit for placing a bounty proposal.
**/
bountyDepositBase: BalanceOf & AugmentedConst<ApiType>;
/**
* The delay period for which a bounty beneficiary need to wait before claim the payout.
**/
bountyDepositPayoutDelay: BlockNumber & AugmentedConst<ApiType>;
/**
* Minimum value for a bounty.
**/
bountyValueMinimum: BalanceOf & AugmentedConst<ApiType>;
/**
* The amount held on deposit per byte within bounty description.
**/
dataDepositPerByte: BalanceOf & AugmentedConst<ApiType>;
/**
* Maximum acceptable reason length.
**/
maximumReasonLength: u32 & AugmentedConst<ApiType>;
};
contracts: {
[key: string]: Codec;
/**
@@ -338,6 +365,29 @@ declare module '@polkadot/api/types/consts' {
**/
minimumPeriod: Moment & AugmentedConst<ApiType>;
};
tips: {
[key: string]: Codec;
/**
* The amount held on deposit per byte within the tip report reason.
**/
dataDepositPerByte: BalanceOf & AugmentedConst<ApiType>;
/**
* Maximum acceptable reason length.
**/
maximumReasonLength: u32 & AugmentedConst<ApiType>;
/**
* The period for which a tip remains open after is has achieved threshold tippers.
**/
tipCountdown: BlockNumber & AugmentedConst<ApiType>;
/**
* The amount of the final tip which goes to the original reporter of the tip.
**/
tipFindersFee: Percent & AugmentedConst<ApiType>;
/**
* The amount held on deposit for placing a tip report.
**/
tipReportDepositBase: BalanceOf & AugmentedConst<ApiType>;
};
transactionPayment: {
[key: string]: Codec;
/**
@@ -351,31 +401,10 @@ declare module '@polkadot/api/types/consts' {
};
treasury: {
[key: string]: Codec;
/**
* Percentage of the curator fee that will be reserved upfront as deposit for bounty curator.
**/
bountyCuratorDeposit: Permill & AugmentedConst<ApiType>;
/**
* The amount held on deposit for placing a bounty proposal.
**/
bountyDepositBase: BalanceOf & AugmentedConst<ApiType>;
/**
* The delay period for which a bounty beneficiary need to wait before claim the payout.
**/
bountyDepositPayoutDelay: BlockNumber & AugmentedConst<ApiType>;
bountyValueMinimum: BalanceOf & AugmentedConst<ApiType>;
/**
* Percentage of spare funds (if any) that are burnt per spend period.
**/
burn: Permill & AugmentedConst<ApiType>;
/**
* The amount held on deposit per byte within the tip report reason or bounty description.
**/
dataDepositPerByte: BalanceOf & AugmentedConst<ApiType>;
/**
* Maximum acceptable reason length.
**/
maximumReasonLength: u32 & AugmentedConst<ApiType>;
/**
* The treasury's module id, used for deriving its sovereign account ID.
**/
@@ -393,18 +422,6 @@ declare module '@polkadot/api/types/consts' {
* Period between successive spends.
**/
spendPeriod: BlockNumber & AugmentedConst<ApiType>;
/**
* The period for which a tip remains open after is has achieved threshold tippers.
**/
tipCountdown: BlockNumber & AugmentedConst<ApiType>;
/**
* The amount of the final tip which goes to the original reporter of the tip.
**/
tipFindersFee: Percent & AugmentedConst<ApiType>;
/**
* The amount held on deposit for placing a tip report.
**/
tipReportDepositBase: BalanceOf & AugmentedConst<ApiType>;
};
vesting: {
[key: string]: Codec;
+33 -27
View File
@@ -158,6 +158,25 @@ declare module '@polkadot/api/types/storage' {
**/
totalIssuance: AugmentedQuery<ApiType, () => Observable<Balance>> & QueryableStorageEntry<ApiType>;
};
bounties: {
[key: string]: QueryableStorageEntry<ApiType>;
/**
* Bounties that have been made.
**/
bounties: AugmentedQuery<ApiType, (arg: BountyIndex | AnyNumber | Uint8Array) => Observable<Option<Bounty>>> & QueryableStorageEntry<ApiType>;
/**
* Bounty indices that have been approved but not yet funded.
**/
bountyApprovals: AugmentedQuery<ApiType, () => Observable<Vec<BountyIndex>>> & QueryableStorageEntry<ApiType>;
/**
* Number of bounty proposals that have been made.
**/
bountyCount: AugmentedQuery<ApiType, () => Observable<BountyIndex>> & QueryableStorageEntry<ApiType>;
/**
* The description of each bounty.
**/
bountyDescriptions: AugmentedQuery<ApiType, (arg: BountyIndex | AnyNumber | Uint8Array) => Observable<Option<Bytes>>> & QueryableStorageEntry<ApiType>;
};
contracts: {
[key: string]: QueryableStorageEntry<ApiType>;
/**
@@ -948,6 +967,20 @@ declare module '@polkadot/api/types/storage' {
**/
now: AugmentedQuery<ApiType, () => Observable<Moment>> & QueryableStorageEntry<ApiType>;
};
tips: {
[key: string]: QueryableStorageEntry<ApiType>;
/**
* Simple preimage lookup from the reason's hash to the original data. Again, has an
* insecure enumerable hash since the key is guaranteed to be the result of a secure hash.
**/
reasons: AugmentedQuery<ApiType, (arg: Hash | string | Uint8Array) => Observable<Option<Bytes>>> & QueryableStorageEntry<ApiType>;
/**
* TipsMap that are not yet completed. Keyed by the hash of `(reason, who)` from the value.
* This has the insecure enumerable hash function since the key itself is already
* guaranteed to be a secure hash.
**/
tips: AugmentedQuery<ApiType, (arg: Hash | string | Uint8Array) => Observable<Option<OpenTip>>> & QueryableStorageEntry<ApiType>;
};
transactionPayment: {
[key: string]: QueryableStorageEntry<ApiType>;
nextFeeMultiplier: AugmentedQuery<ApiType, () => Observable<Multiplier>> & QueryableStorageEntry<ApiType>;
@@ -959,22 +992,6 @@ declare module '@polkadot/api/types/storage' {
* Proposal indices that have been approved but not yet awarded.
**/
approvals: AugmentedQuery<ApiType, () => Observable<Vec<ProposalIndex>>> & QueryableStorageEntry<ApiType>;
/**
* Bounties that have been made.
**/
bounties: AugmentedQuery<ApiType, (arg: BountyIndex | AnyNumber | Uint8Array) => Observable<Option<Bounty>>> & QueryableStorageEntry<ApiType>;
/**
* Bounty indices that have been approved but not yet funded.
**/
bountyApprovals: AugmentedQuery<ApiType, () => Observable<Vec<BountyIndex>>> & QueryableStorageEntry<ApiType>;
/**
* Number of bounty proposals that have been made.
**/
bountyCount: AugmentedQuery<ApiType, () => Observable<BountyIndex>> & QueryableStorageEntry<ApiType>;
/**
* The description of each bounty.
**/
bountyDescriptions: AugmentedQuery<ApiType, (arg: BountyIndex | AnyNumber | Uint8Array) => Observable<Option<Bytes>>> & QueryableStorageEntry<ApiType>;
/**
* Number of proposals that have been made.
**/
@@ -983,17 +1000,6 @@ declare module '@polkadot/api/types/storage' {
* Proposals that have been made.
**/
proposals: AugmentedQuery<ApiType, (arg: ProposalIndex | AnyNumber | Uint8Array) => Observable<Option<TreasuryProposal>>> & QueryableStorageEntry<ApiType>;
/**
* Simple preimage lookup from the reason's hash to the original data. Again, has an
* insecure enumerable hash since the key is guaranteed to be the result of a secure hash.
**/
reasons: AugmentedQuery<ApiType, (arg: Hash | string | Uint8Array) => Observable<Option<Bytes>>> & QueryableStorageEntry<ApiType>;
/**
* Tips that are not yet completed. Keyed by the hash of `(reason, who)` from the value.
* This has the insecure enumerable hash function since the key itself is already
* guaranteed to be a secure hash.
**/
tips: AugmentedQuery<ApiType, (arg: Hash | string | Uint8Array) => Observable<Option<OpenTip>>> & QueryableStorageEntry<ApiType>;
};
vesting: {
[key: string]: QueryableStorageEntry<ApiType>;
+167 -143
View File
@@ -341,6 +341,128 @@ declare module '@polkadot/api/types/submittable' {
**/
transferKeepAlive: AugmentedSubmittable<(dest: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, value: Compact<Balance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
};
bounties: {
[key: string]: SubmittableExtrinsicFunction<ApiType>;
/**
* Accept the curator role for a bounty.
* A deposit will be reserved from curator and refund upon successful payout.
*
* May only be called from the curator.
*
* # <weight>
* - O(1).
* # </weight>
**/
acceptCurator: AugmentedSubmittable<(bountyId: Compact<BountyIndex> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Approve a bounty proposal. At a later time, the bounty will be funded and become active
* and the original deposit will be returned.
*
* May only be called from `T::ApproveOrigin`.
*
* # <weight>
* - O(1).
* # </weight>
**/
approveBounty: AugmentedSubmittable<(bountyId: Compact<BountyIndex> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Award bounty to a beneficiary account. The beneficiary will be able to claim the funds after a delay.
*
* The dispatch origin for this call must be the curator of this bounty.
*
* - `bounty_id`: Bounty ID to award.
* - `beneficiary`: The beneficiary account whom will receive the payout.
*
* # <weight>
* - O(1).
* # </weight>
**/
awardBounty: AugmentedSubmittable<(bountyId: Compact<BountyIndex> | AnyNumber | Uint8Array, beneficiary: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Claim the payout from an awarded bounty after payout delay.
*
* The dispatch origin for this call must be the beneficiary of this bounty.
*
* - `bounty_id`: Bounty ID to claim.
*
* # <weight>
* - O(1).
* # </weight>
**/
claimBounty: AugmentedSubmittable<(bountyId: Compact<BountyIndex> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Cancel a proposed or active bounty. All the funds will be sent to treasury and
* the curator deposit will be unreserved if possible.
*
* Only `T::RejectOrigin` is able to cancel a bounty.
*
* - `bounty_id`: Bounty ID to cancel.
*
* # <weight>
* - O(1).
* # </weight>
**/
closeBounty: AugmentedSubmittable<(bountyId: Compact<BountyIndex> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Extend the expiry time of an active bounty.
*
* The dispatch origin for this call must be the curator of this bounty.
*
* - `bounty_id`: Bounty ID to extend.
* - `remark`: additional information.
*
* # <weight>
* - O(1).
* # </weight>
**/
extendBountyExpiry: AugmentedSubmittable<(bountyId: Compact<BountyIndex> | AnyNumber | Uint8Array, remark: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Propose a new bounty.
*
* The dispatch origin for this call must be _Signed_.
*
* Payment: `TipReportDepositBase` will be reserved from the origin account, as well as
* `DataDepositPerByte` for each byte in `reason`. It will be unreserved upon approval,
* or slashed when rejected.
*
* - `curator`: The curator account whom will manage this bounty.
* - `fee`: The curator fee.
* - `value`: The total payment amount of this bounty, curator fee included.
* - `description`: The description of this bounty.
**/
proposeBounty: AugmentedSubmittable<(value: Compact<BalanceOf> | AnyNumber | Uint8Array, description: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Assign a curator to a funded bounty.
*
* May only be called from `T::ApproveOrigin`.
*
* # <weight>
* - O(1).
* # </weight>
**/
proposeCurator: AugmentedSubmittable<(bountyId: Compact<BountyIndex> | AnyNumber | Uint8Array, curator: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, fee: Compact<BalanceOf> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Unassign curator from a bounty.
*
* This function can only be called by the `RejectOrigin` a signed origin.
*
* If this function is called by the `RejectOrigin`, we assume that the curator is malicious
* or inactive. As a result, we will slash the curator when possible.
*
* If the origin is the curator, we take this as a sign they are unable to do their job and
* they willingly give up. We could slash them, but for now we allow them to recover their
* deposit and exit without issue. (We may want to change this if it is abused.)
*
* Finally, the origin can be anyone if and only if the curator is "inactive". This allows
* anyone in the community to call out that a curator is not doing their due diligence, and
* we should pick a new curator. In this case the curator should also be slashed.
*
* # <weight>
* - O(1).
* # </weight>
**/
unassignCurator: AugmentedSubmittable<(bountyId: Compact<BountyIndex> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
};
contracts: {
[key: string]: SubmittableExtrinsicFunction<ApiType>;
/**
@@ -402,6 +524,9 @@ declare module '@polkadot/api/types/submittable' {
* If called after the end of the voting period abstentions are counted as rejections
* unless there is a prime member set and the prime member cast an approval.
*
* If the close operation completes successfully with disapproval, the transaction fee will
* be waived. Otherwise execution of the approved operation will be charged to the caller.
*
* + `proposal_weight_bound`: The maximum amount of weight consumed by executing the closed proposal.
* + `length_bound`: The upper bound for the length of the proposal in storage. Checked via
* `storage::read` so it is `size_of::<u32>() == 4` larger than the pure length.
@@ -512,6 +637,8 @@ declare module '@polkadot/api/types/submittable' {
*
* Requires the sender to be a member.
*
* Transaction fees will be waived if the member is voting on any particular proposal
* for the first time and the call is successful. Subsequent vote changes will charge a fee.
* # <weight>
* ## Weight
* - `O(M)` where `M` is members-count (code- and governance-bounded)
@@ -3066,6 +3193,9 @@ declare module '@polkadot/api/types/submittable' {
* If called after the end of the voting period abstentions are counted as rejections
* unless there is a prime member set and the prime member cast an approval.
*
* If the close operation completes successfully with disapproval, the transaction fee will
* be waived. Otherwise execution of the approved operation will be charged to the caller.
*
* + `proposal_weight_bound`: The maximum amount of weight consumed by executing the closed proposal.
* + `length_bound`: The upper bound for the length of the proposal in storage. Checked via
* `storage::read` so it is `size_of::<u32>() == 4` larger than the pure length.
@@ -3176,6 +3306,8 @@ declare module '@polkadot/api/types/submittable' {
*
* Requires the sender to be a member.
*
* Transaction fees will be waived if the member is voting on any particular proposal
* for the first time and the call is successful. Subsequent vote changes will charge a fee.
* # <weight>
* ## Weight
* - `O(M)` where `M` is members-count (code- and governance-bounded)
@@ -3258,73 +3390,8 @@ declare module '@polkadot/api/types/submittable' {
**/
set: AugmentedSubmittable<(now: Compact<Moment> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
};
treasury: {
tips: {
[key: string]: SubmittableExtrinsicFunction<ApiType>;
/**
* Accept the curator role for a bounty.
* A deposit will be reserved from curator and refund upon successful payout.
*
* May only be called from the curator.
*
* # <weight>
* - O(1).
* - Limited storage reads.
* - One DB change.
* # </weight>
**/
acceptCurator: AugmentedSubmittable<(bountyId: Compact<ProposalIndex> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Approve a bounty proposal. At a later time, the bounty will be funded and become active
* and the original deposit will be returned.
*
* May only be called from `T::ApproveOrigin`.
*
* # <weight>
* - O(1).
* - Limited storage reads.
* - One DB change.
* # </weight>
**/
approveBounty: AugmentedSubmittable<(bountyId: Compact<ProposalIndex> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Approve a proposal. At a later time, the proposal will be allocated to the beneficiary
* and the original deposit will be returned.
*
* May only be called from `T::ApproveOrigin`.
*
* # <weight>
* - Complexity: O(1).
* - DbReads: `Proposals`, `Approvals`
* - DbWrite: `Approvals`
* # </weight>
**/
approveProposal: AugmentedSubmittable<(proposalId: Compact<ProposalIndex> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Award bounty to a beneficiary account. The beneficiary will be able to claim the funds after a delay.
*
* The dispatch origin for this call must be the curator of this bounty.
*
* - `bounty_id`: Bounty ID to award.
* - `beneficiary`: The beneficiary account whom will receive the payout.
**/
awardBounty: AugmentedSubmittable<(bountyId: Compact<ProposalIndex> | AnyNumber | Uint8Array, beneficiary: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Claim the payout from an awarded bounty after payout delay.
*
* The dispatch origin for this call must be the beneficiary of this bounty.
*
* - `bounty_id`: Bounty ID to claim.
**/
claimBounty: AugmentedSubmittable<(bountyId: Compact<BountyIndex> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Cancel a proposed or active bounty. All the funds will be sent to treasury and
* the curator deposit will be unreserved if possible.
*
* Only `T::RejectOrigin` is able to cancel a bounty.
*
* - `bounty_id`: Bounty ID to cancel.
**/
closeBounty: AugmentedSubmittable<(bountyId: Compact<BountyIndex> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Close and payout a tip.
*
@@ -3345,66 +3412,6 @@ declare module '@polkadot/api/types/submittable' {
* # </weight>
**/
closeTip: AugmentedSubmittable<(hash: Hash | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Extend the expiry time of an active bounty.
*
* The dispatch origin for this call must be the curator of this bounty.
*
* - `bounty_id`: Bounty ID to extend.
* - `remark`: additional information.
**/
extendBountyExpiry: AugmentedSubmittable<(bountyId: Compact<BountyIndex> | AnyNumber | Uint8Array, remark: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Propose a new bounty.
*
* The dispatch origin for this call must be _Signed_.
*
* Payment: `TipReportDepositBase` will be reserved from the origin account, as well as
* `DataDepositPerByte` for each byte in `reason`. It will be unreserved upon approval,
* or slashed when rejected.
*
* - `curator`: The curator account whom will manage this bounty.
* - `fee`: The curator fee.
* - `value`: The total payment amount of this bounty, curator fee included.
* - `description`: The description of this bounty.
**/
proposeBounty: AugmentedSubmittable<(value: Compact<BalanceOf> | AnyNumber | Uint8Array, description: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Assign a curator to a funded bounty.
*
* May only be called from `T::ApproveOrigin`.
*
* # <weight>
* - O(1).
* - Limited storage reads.
* - One DB change.
* # </weight>
**/
proposeCurator: AugmentedSubmittable<(bountyId: Compact<ProposalIndex> | AnyNumber | Uint8Array, curator: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, fee: Compact<BalanceOf> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Put forward a suggestion for spending. A deposit proportional to the value
* is reserved and slashed if the proposal is rejected. It is returned once the
* proposal is awarded.
*
* # <weight>
* - Complexity: O(1)
* - DbReads: `ProposalCount`, `origin account`
* - DbWrites: `ProposalCount`, `Proposals`, `origin account`
* # </weight>
**/
proposeSpend: AugmentedSubmittable<(value: Compact<BalanceOf> | AnyNumber | Uint8Array, beneficiary: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Reject a proposed spend. The original deposit will be slashed.
*
* May only be called from `T::RejectOrigin`.
*
* # <weight>
* - Complexity: O(1)
* - DbReads: `Proposals`, `rejected proposer account`
* - DbWrites: `Proposals`, `rejected proposer account`
* # </weight>
**/
rejectProposal: AugmentedSubmittable<(proposalId: Compact<ProposalIndex> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Report something `reason` that deserves a tip and claim any eventual the finder's fee.
*
@@ -3502,29 +3509,46 @@ declare module '@polkadot/api/types/submittable' {
* # </weight>
**/
tipNew: AugmentedSubmittable<(reason: Bytes | string | Uint8Array, who: AccountId | string | Uint8Array, tipValue: Compact<BalanceOf> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
};
treasury: {
[key: string]: SubmittableExtrinsicFunction<ApiType>;
/**
* Unassign curator from a bounty.
* Approve a proposal. At a later time, the proposal will be allocated to the beneficiary
* and the original deposit will be returned.
*
* This function can only be called by the `RejectOrigin` a signed origin.
*
* If this function is called by the `RejectOrigin`, we assume that the curator is malicious
* or inactive. As a result, we will slash the curator when possible.
*
* If the origin is the curator, we take this as a sign they are unable to do their job and
* they willingly give up. We could slash them, but for now we allow them to recover their
* deposit and exit without issue. (We may want to change this if it is abused.)
*
* Finally, the origin can be anyone if and only if the curator is "inactive". This allows
* anyone in the community to call out that a curator is not doing their due diligence, and
* we should pick a new curator. In this case the curator should also be slashed.
* May only be called from `T::ApproveOrigin`.
*
* # <weight>
* - O(1).
* - Limited storage reads.
* - One DB change.
* - Complexity: O(1).
* - DbReads: `Proposals`, `Approvals`
* - DbWrite: `Approvals`
* # </weight>
**/
unassignCurator: AugmentedSubmittable<(bountyId: Compact<ProposalIndex> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
approveProposal: AugmentedSubmittable<(proposalId: Compact<ProposalIndex> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Put forward a suggestion for spending. A deposit proportional to the value
* is reserved and slashed if the proposal is rejected. It is returned once the
* proposal is awarded.
*
* # <weight>
* - Complexity: O(1)
* - DbReads: `ProposalCount`, `origin account`
* - DbWrites: `ProposalCount`, `Proposals`, `origin account`
* # </weight>
**/
proposeSpend: AugmentedSubmittable<(value: Compact<BalanceOf> | AnyNumber | Uint8Array, beneficiary: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Reject a proposed spend. The original deposit will be slashed.
*
* May only be called from `T::RejectOrigin`.
*
* # <weight>
* - Complexity: O(1)
* - DbReads: `Proposals`, `rejected proposer account`
* - DbWrites: `Proposals`, `rejected proposer account`
* # </weight>
**/
rejectProposal: AugmentedSubmittable<(proposalId: Compact<ProposalIndex> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
};
utility: {
[key: string]: SubmittableExtrinsicFunction<ApiType>;
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long