mirror of
https://github.com/pezkuwichain/pezkuwi-apps.git
synced 2026-10-28 05:19:49 +00:00
feat: initial Pezkuwi Apps rebrand from polkadot-apps
Rebranded terminology: - Polkadot → Pezkuwi - Kusama → Dicle - Westend → Zagros - Rococo → PezkuwiChain - Substrate → Bizinikiwi - parachain → teyrchain Custom logos with Kurdistan brand colors (#e6007a → #86e62a): - bizinikiwi-hexagon.svg - sora-bizinikiwi.svg - hezscanner.svg - heztreasury.svg - pezkuwiscan.svg - pezkuwistats.svg - pezkuwiassembly.svg - pezkuwiholic.svg
This commit is contained in:
commit
d21bfb1320
5867 files changed
+329019
No files matched your search
@@ -0,0 +1,7 @@
|
||||
// Copyright 2017-2025 @pezkuwi/apps-config authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export * from './inflation.js';
|
||||
export * from './proposalThresholds.js';
|
||||
export * from './teleport.js';
|
||||
export * from './tracks/index.js';
|
||||
@@ -0,0 +1,61 @@
|
||||
// Copyright 2017-2025 @pezkuwi/apps-config authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { ApiPromise } from '@pezkuwi/api';
|
||||
|
||||
import { CERE_NETWORK_GENESIS, CERE_NETWORK_TESTNET_GENESIS, DOCK_POS_TESTNET_GENESIS, JOYSTREAM_GENESIS, DICLE_GENESIS, NEATCOIN_GENESIS, NFTMART_GENESIS, PEZKUWI_GENESIS, VARA_NETWORK_GENESIS, VARA_NETWORK_TESTNET_GENESIS, ZKVERIFY_GENESIS, ZKVERIFY_VOLTA_GENESIS } from '../constants.js';
|
||||
|
||||
interface InflationParams {
|
||||
auctionAdjust: number;
|
||||
auctionMax: number;
|
||||
falloff: number;
|
||||
maxInflation: number;
|
||||
minInflation: number;
|
||||
stakeTarget: number;
|
||||
}
|
||||
|
||||
const DEFAULT_PARAMS: InflationParams = {
|
||||
auctionAdjust: 0,
|
||||
auctionMax: 0,
|
||||
// 5% for falloff, as per the defaults, see
|
||||
// https://github.com/pezkuwichain/pezkuwi/blob/816cb64ea16102c6c79f6be2a917d832d98df757/runtime/dicle/src/lib.rs#L534
|
||||
falloff: 0.05,
|
||||
// 10% max, 0.25% min, see
|
||||
// https://github.com/pezkuwichain/pezkuwi/blob/816cb64ea16102c6c79f6be2a917d832d98df757/runtime/dicle/src/lib.rs#L523
|
||||
maxInflation: 0.1,
|
||||
minInflation: 0.025,
|
||||
stakeTarget: 0.5
|
||||
};
|
||||
|
||||
const CERE_NETWORK_INFLATION_PARAMS = { ...DEFAULT_PARAMS, maxInflation: 0.05, minInflation: 0.0001, stakeTarget: 0.2 };
|
||||
|
||||
const VARA_NETWORK_INFLATION_PARAMS = { ...DEFAULT_PARAMS, maxInflation: 0, minInflation: 0.0001, stakeTarget: 0.85 };
|
||||
|
||||
const JOYSTREAM_INFLATION_PARAMS = { ...DEFAULT_PARAMS, maxInflation: 0.03, minInflation: 0.0075 };
|
||||
|
||||
const ZKVERIFY_INFLATION_PARAMS = { ...DEFAULT_PARAMS, auctionAdjust: 0, maxInflation: 0.025, minInflation: 0.025, stakeTarget: 0 };
|
||||
|
||||
const ZKVERIFY_VOLTA_INFLATION_PARAMS = { ...DEFAULT_PARAMS, auctionAdjust: 0, maxInflation: 0.025, minInflation: 0.025, stakeTarget: 0 };
|
||||
|
||||
const KNOWN_PARAMS: Record<string, InflationParams> = {
|
||||
[CERE_NETWORK_GENESIS]: CERE_NETWORK_INFLATION_PARAMS,
|
||||
[CERE_NETWORK_TESTNET_GENESIS]: CERE_NETWORK_INFLATION_PARAMS,
|
||||
[DOCK_POS_TESTNET_GENESIS]: { ...DEFAULT_PARAMS, stakeTarget: 0.75 },
|
||||
[JOYSTREAM_GENESIS]: JOYSTREAM_INFLATION_PARAMS,
|
||||
// 30% for up to 60 slots, see
|
||||
// https://github.com/pezkuwichain/pezkuwi/blob/816cb64ea16102c6c79f6be2a917d832d98df757/runtime/dicle/src/lib.rs#L526-L527
|
||||
// 75% ideal target, see
|
||||
// https://github.com/pezkuwichain/pezkuwi/blob/816cb64ea16102c6c79f6be2a917d832d98df757/runtime/dicle/src/lib.rs#L529-L531
|
||||
[DICLE_GENESIS]: { ...DEFAULT_PARAMS, auctionAdjust: (0.3 / 60), auctionMax: 60, stakeTarget: 0.75 },
|
||||
[NEATCOIN_GENESIS]: { ...DEFAULT_PARAMS, stakeTarget: 0.75 },
|
||||
[NFTMART_GENESIS]: { ...DEFAULT_PARAMS, falloff: 0.04, stakeTarget: 0.60 },
|
||||
[PEZKUWI_GENESIS]: { ...DEFAULT_PARAMS, stakeTarget: 0.75 },
|
||||
[VARA_NETWORK_GENESIS]: VARA_NETWORK_INFLATION_PARAMS,
|
||||
[VARA_NETWORK_TESTNET_GENESIS]: VARA_NETWORK_INFLATION_PARAMS,
|
||||
[ZKVERIFY_GENESIS]: ZKVERIFY_INFLATION_PARAMS,
|
||||
[ZKVERIFY_VOLTA_GENESIS]: ZKVERIFY_VOLTA_INFLATION_PARAMS
|
||||
};
|
||||
|
||||
export function getInflationParams (api: ApiPromise): InflationParams {
|
||||
return KNOWN_PARAMS[api.genesisHash.toHex()] || DEFAULT_PARAMS;
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
// Copyright 2017-2025 @pezkuwi/apps-config authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { ApiPromise } from '@pezkuwi/api';
|
||||
|
||||
import { KULUPU_GENESIS, DICLE_GENESIS, PEZKUWI_GENESIS } from '../constants.js';
|
||||
|
||||
// normal fast-track proposals
|
||||
const FAST_TRACK: Record<string, number> = {
|
||||
default: 2 / 3
|
||||
};
|
||||
|
||||
// in the case where block < fastTrackVotingPeriod
|
||||
const FAST_TRACK_NO_DELAY: Record<string, number> = {
|
||||
default: 1
|
||||
};
|
||||
|
||||
const PROPOSE: Record<string, number> = {
|
||||
[KULUPU_GENESIS]: 1,
|
||||
[DICLE_GENESIS]: 1 / 2,
|
||||
[PEZKUWI_GENESIS]: 3 / 5,
|
||||
default: 1 / 2
|
||||
};
|
||||
|
||||
const SLASH: Record<string, number> = {
|
||||
[DICLE_GENESIS]: 1 / 2,
|
||||
[PEZKUWI_GENESIS]: 3 / 4,
|
||||
default: 1 / 2
|
||||
};
|
||||
|
||||
const TREASURY: Record<string, number> = {
|
||||
[KULUPU_GENESIS]: 1 / 2,
|
||||
[DICLE_GENESIS]: 3 / 5,
|
||||
[PEZKUWI_GENESIS]: 3 / 5,
|
||||
default: 3 / 5
|
||||
};
|
||||
|
||||
export function getFastTrackThreshold (api: ApiPromise, isDefault: boolean): number {
|
||||
return isDefault
|
||||
? (FAST_TRACK[api.genesisHash.toHex()] || FAST_TRACK.default)
|
||||
: (FAST_TRACK_NO_DELAY[api.genesisHash.toHex()] || FAST_TRACK_NO_DELAY.default);
|
||||
}
|
||||
|
||||
export function getProposalThreshold (api: ApiPromise): number {
|
||||
return PROPOSE[api.genesisHash.toHex()] || PROPOSE.default;
|
||||
}
|
||||
|
||||
export function getSlashProposalThreshold (api: ApiPromise): number {
|
||||
return SLASH[api.genesisHash.toHex()] || SLASH.default;
|
||||
}
|
||||
|
||||
export function getTreasuryProposalThreshold (api: ApiPromise): number {
|
||||
return TREASURY[api.genesisHash.toHex()] || TREASURY.default;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
// Copyright 2017-2025 @pezkuwi/apps-config authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { ApiPromise } from '@pezkuwi/api';
|
||||
|
||||
import { DICLE_GENESIS } from '../constants.js';
|
||||
|
||||
// 4 * BaseXcmWeight on Dicle
|
||||
const DICLE_WEIGHT = 4 * 1_000_000_000;
|
||||
|
||||
const DEFAULT_WEIGHT = DICLE_WEIGHT;
|
||||
|
||||
const KNOWN_WEIGHTS: Record<string, number> = {
|
||||
[DICLE_GENESIS]: DICLE_WEIGHT
|
||||
};
|
||||
|
||||
export function getTeleportWeight (api: ApiPromise): number {
|
||||
return KNOWN_WEIGHTS[api.genesisHash.toHex()] || DEFAULT_WEIGHT;
|
||||
}
|
||||
@@ -0,0 +1,208 @@
|
||||
// Copyright 2017-2025 @pezkuwi/apps-config authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { TrackInfo } from './types.js';
|
||||
|
||||
import { BN } from '@pezkuwi/util';
|
||||
|
||||
import { compareFellowshipRank, formatSpendFactory } from './util.js';
|
||||
|
||||
// hardcoded here since this is static (hopefully no re-denomination anytime...)
|
||||
const formatSpend = formatSpendFactory({
|
||||
decimals: 12,
|
||||
forceUnit: '-',
|
||||
withSi: true,
|
||||
withUnit: 'DCL'
|
||||
});
|
||||
|
||||
// https://github.com/pezkuwichain/pezkuwi/blob/6e3f2c5b4b6e6927915de2f784e1d831717760fa/runtime/dicle/constants/src/lib.rs#L28-L32
|
||||
const UNITS = new BN(1_000_000_000_000);
|
||||
const QUID = UNITS.divn(30);
|
||||
const GRAND = QUID.muln(1_000);
|
||||
|
||||
// https://github.com/pezkuwichain/pezkuwi/blob/6e3f2c5b4b6e6927915de2f784e1d831717760fa/runtime/dicle/src/governance/origins.rs#L170-L179
|
||||
const SPEND_LIMITS = {
|
||||
BigSpender: formatSpend(1_000, GRAND),
|
||||
BigTipper: formatSpend(1, GRAND),
|
||||
MediumSpender: formatSpend(100, GRAND),
|
||||
SmallSpender: formatSpend(10, GRAND),
|
||||
SmallTipper: formatSpend(250, QUID),
|
||||
Treasurer: formatSpend(10_000, GRAND)
|
||||
};
|
||||
|
||||
export const dicle: Record<string, TrackInfo[]> = {
|
||||
fellowshipReferenda: [
|
||||
{
|
||||
compare: compareFellowshipRank(0),
|
||||
id: 0,
|
||||
name: 'candidates',
|
||||
origin: { Origins: 'FellowshipInitiates' },
|
||||
text: 'Origin commanded by any members of the Pezkuwi Fellowship (no Dan grade needed)'
|
||||
},
|
||||
{
|
||||
compare: compareFellowshipRank(1),
|
||||
id: 1,
|
||||
name: 'members',
|
||||
origin: { Origins: 'Fellowship1Dan' },
|
||||
text: 'Origin commanded by rank 1 of the Pezkuwi Fellowship and with a success of 1'
|
||||
},
|
||||
{
|
||||
compare: compareFellowshipRank(2),
|
||||
id: 2,
|
||||
name: 'proficients',
|
||||
origin: { Origins: 'Fellowship2Dan' },
|
||||
text: 'Origin commanded by rank 2 of the Pezkuwi Fellowship and with a success of 2'
|
||||
},
|
||||
{
|
||||
|
||||
compare: compareFellowshipRank(3),
|
||||
id: 3,
|
||||
name: 'fellows',
|
||||
origin: [
|
||||
{ Origins: 'Fellowship3Dan' },
|
||||
{ Origins: 'Fellows' }
|
||||
],
|
||||
text: 'Origin commanded by Pezkuwi Fellows (3rd Dan fellows or greater)'
|
||||
},
|
||||
{
|
||||
compare: compareFellowshipRank(4),
|
||||
id: 4,
|
||||
name: 'senior fellows',
|
||||
origin: { Origins: 'Fellowship4Dan' },
|
||||
text: 'Origin commanded by rank 4 of the Pezkuwi Fellowship and with a success of 4'
|
||||
},
|
||||
{
|
||||
compare: compareFellowshipRank(5),
|
||||
id: 5,
|
||||
name: 'experts',
|
||||
origin: [
|
||||
{ Origins: 'Fellowship5Dan' },
|
||||
{ Origins: 'FellowshipExperts' }
|
||||
],
|
||||
text: 'Origin commanded by Pezkuwi Experts (5th Dan fellows or greater)'
|
||||
},
|
||||
{
|
||||
compare: compareFellowshipRank(6),
|
||||
id: 6,
|
||||
name: 'senior experts',
|
||||
origin: { Origins: 'Fellowship6Dan' },
|
||||
text: 'Origin commanded by rank 6 of the Pezkuwi Fellowship and with a success of 6'
|
||||
},
|
||||
{
|
||||
compare: compareFellowshipRank(7),
|
||||
id: 7,
|
||||
name: 'masters',
|
||||
origin: [
|
||||
{ Origins: 'Fellowship7Dan' },
|
||||
{ Origins: 'FellowshipMasters' }
|
||||
],
|
||||
text: 'Origin commanded by Pezkuwi Masters (7th Dan fellows of greater)'
|
||||
},
|
||||
{
|
||||
compare: compareFellowshipRank(8),
|
||||
id: 8,
|
||||
name: 'senior masters',
|
||||
origin: { Origins: 'Fellowship8Dan' },
|
||||
text: 'Origin commanded by rank 8 of the Pezkuwi Fellowship and with a success of 8'
|
||||
},
|
||||
{
|
||||
compare: compareFellowshipRank(9),
|
||||
id: 9,
|
||||
name: 'grand masters',
|
||||
origin: { Origins: 'Fellowship9Dan' },
|
||||
text: 'Origin commanded by rank 9 of the Pezkuwi Fellowship and with a success of 9'
|
||||
}
|
||||
],
|
||||
referenda: [
|
||||
{
|
||||
id: 0,
|
||||
name: 'root',
|
||||
origin: { system: 'Root' },
|
||||
text: 'Origin for the system root'
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
name: 'whitelisted_caller',
|
||||
origin: { Origins: 'WhitelistedCaller' },
|
||||
text: 'Origin able to dispatch a whitelisted call'
|
||||
},
|
||||
{
|
||||
id: 10,
|
||||
name: 'staking_admin',
|
||||
origin: { Origins: 'StakingAdmin' },
|
||||
text: 'Origin for cancelling slashes'
|
||||
},
|
||||
{
|
||||
id: 11,
|
||||
name: 'treasurer',
|
||||
origin: { Origins: 'Treasurer' },
|
||||
text: 'Origin for spending (any amount of) funds'
|
||||
},
|
||||
{
|
||||
id: 12,
|
||||
name: 'lease_admin',
|
||||
origin: { Origins: 'LeaseAdmin' },
|
||||
text: 'Origin able to force slot leases'
|
||||
},
|
||||
{
|
||||
id: 13,
|
||||
name: 'fellowship_admin',
|
||||
origin: { Origins: 'FellowshipAdmin' },
|
||||
text: 'Origin for managing the composition of the fellowship'
|
||||
},
|
||||
{
|
||||
id: 14,
|
||||
name: 'general_admin',
|
||||
origin: { Origins: 'GeneralAdmin' },
|
||||
text: 'Origin for managing the registrar'
|
||||
},
|
||||
{
|
||||
id: 15,
|
||||
name: 'auction_admin',
|
||||
origin: { Origins: 'AuctionAdmin' },
|
||||
text: 'Origin for starting auctions'
|
||||
},
|
||||
{
|
||||
id: 20,
|
||||
name: 'referendum_canceller',
|
||||
origin: { Origins: 'ReferendumCanceller' },
|
||||
text: 'Origin able to cancel referenda'
|
||||
},
|
||||
{
|
||||
id: 21,
|
||||
name: 'referendum_killer',
|
||||
origin: { Origins: 'ReferendumKiller' },
|
||||
text: 'Origin able to kill referenda'
|
||||
},
|
||||
{
|
||||
id: 30,
|
||||
name: 'small_tipper',
|
||||
origin: { Origins: 'SmallTipper' },
|
||||
text: `Origin able to spend up to ${SPEND_LIMITS.SmallTipper} from the treasury at once`
|
||||
},
|
||||
{
|
||||
id: 31,
|
||||
name: 'big_tipper',
|
||||
origin: { Origins: 'BigTipper' },
|
||||
text: `Origin able to spend up to ${SPEND_LIMITS.BigTipper} from the treasury at once`
|
||||
},
|
||||
{
|
||||
id: 32,
|
||||
name: 'small_spender',
|
||||
origin: { Origins: 'SmallSpender' },
|
||||
text: `Origin able to spend up to ${SPEND_LIMITS.SmallSpender} from the treasury at once`
|
||||
},
|
||||
{
|
||||
id: 33,
|
||||
name: 'medium_spender',
|
||||
origin: { Origins: 'MediumSpender' },
|
||||
text: `Origin able to spend up to ${SPEND_LIMITS.MediumSpender} from the treasury at once`
|
||||
},
|
||||
{
|
||||
id: 34,
|
||||
name: 'big_spender',
|
||||
origin: { Origins: 'BigSpender' },
|
||||
text: `Origin able to spend up to ${SPEND_LIMITS.BigSpender} from the treasury at once`
|
||||
}
|
||||
]
|
||||
};
|
||||
@@ -0,0 +1,35 @@
|
||||
// Copyright 2017-2025 @pezkuwi/apps-config authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { ApiPromise } from '@pezkuwi/api';
|
||||
import type { TrackInfo } from './types.js';
|
||||
|
||||
import { DICLE_GENESIS, PEZKUWI_GENESIS } from '../../constants.js';
|
||||
import { dicle } from './dicle.js';
|
||||
import { pezkuwi } from './pezkuwi.js';
|
||||
|
||||
const KNOWN_GENE_TRACKS: Record<string, Record<string, TrackInfo[]>> = {
|
||||
[DICLE_GENESIS]: dicle,
|
||||
[PEZKUWI_GENESIS]: pezkuwi
|
||||
};
|
||||
|
||||
const KNOWN_SPEC_TRACKS: Record<string, Record<string, TrackInfo[]>> = {
|
||||
dicle,
|
||||
// for kitchensink, we just use the root
|
||||
node: {
|
||||
referenda: [
|
||||
{
|
||||
id: 0,
|
||||
name: 'root',
|
||||
origin: { system: 'Root' }
|
||||
}
|
||||
]
|
||||
},
|
||||
pezkuwi
|
||||
};
|
||||
|
||||
export function getGovernanceTracks (api: ApiPromise, specName: string, palletReferenda: string): TrackInfo[] | undefined {
|
||||
const lookup = KNOWN_GENE_TRACKS[api.genesisHash.toHex()] || KNOWN_SPEC_TRACKS[specName];
|
||||
|
||||
return lookup?.[palletReferenda];
|
||||
}
|
||||
@@ -0,0 +1,208 @@
|
||||
// Copyright 2017-2025 @pezkuwi/apps-config authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { TrackInfo } from './types.js';
|
||||
|
||||
import { BN } from '@pezkuwi/util';
|
||||
|
||||
import { compareFellowshipRank, formatSpendFactory } from './util.js';
|
||||
|
||||
// hardcoded here since this is static (hopefully no re-denomination anytime...)
|
||||
const formatSpend = formatSpendFactory({
|
||||
decimals: 10,
|
||||
forceUnit: '-',
|
||||
withSi: true,
|
||||
withUnit: 'HEZ'
|
||||
});
|
||||
|
||||
// https://github.com/pezkuwichain/pezkuwi/blob/6e3f2c5b4b6e6927915de2f784e1d831717760fa/runtime/dicle/constants/src/lib.rs#L28-L32
|
||||
const UNITS = new BN(10_000_000_000);
|
||||
const DOLLARS = UNITS;
|
||||
const GRAND = DOLLARS.muln(1_000);
|
||||
|
||||
// https://github.com/pezkuwichain/pezkuwi/blob/6e3f2c5b4b6e6927915de2f784e1d831717760fa/runtime/dicle/src/governance/origins.rs#L170-L179
|
||||
const SPEND_LIMITS = {
|
||||
BigSpender: formatSpend(1_000, GRAND),
|
||||
BigTipper: formatSpend(1, GRAND),
|
||||
MediumSpender: formatSpend(100, GRAND),
|
||||
SmallSpender: formatSpend(10, GRAND),
|
||||
SmallTipper: formatSpend(250, DOLLARS),
|
||||
Treasurer: formatSpend(10_000, GRAND)
|
||||
};
|
||||
|
||||
export const pezkuwi: Record<string, TrackInfo[]> = {
|
||||
fellowshipReferenda: [
|
||||
{
|
||||
compare: compareFellowshipRank(0),
|
||||
id: 0,
|
||||
name: 'candidates',
|
||||
origin: { Origins: 'FellowshipInitiates' },
|
||||
text: 'Origin commanded by any members of the Pezkuwi Fellowship (no Dan grade needed)'
|
||||
},
|
||||
{
|
||||
compare: compareFellowshipRank(1),
|
||||
id: 1,
|
||||
name: 'members',
|
||||
origin: { Origins: 'Fellowship1Dan' },
|
||||
text: 'Origin commanded by rank 1 of the Pezkuwi Fellowship and with a success of 1'
|
||||
},
|
||||
{
|
||||
compare: compareFellowshipRank(2),
|
||||
id: 2,
|
||||
name: 'proficients',
|
||||
origin: { Origins: 'Fellowship2Dan' },
|
||||
text: 'Origin commanded by rank 2 of the Pezkuwi Fellowship and with a success of 2'
|
||||
},
|
||||
{
|
||||
|
||||
compare: compareFellowshipRank(3),
|
||||
id: 3,
|
||||
name: 'fellows',
|
||||
origin: [
|
||||
{ Origins: 'Fellowship3Dan' },
|
||||
{ Origins: 'Fellows' }
|
||||
],
|
||||
text: 'Origin commanded by Pezkuwi Fellows (3rd Dan fellows or greater)'
|
||||
},
|
||||
{
|
||||
compare: compareFellowshipRank(4),
|
||||
id: 4,
|
||||
name: 'senior fellows',
|
||||
origin: { Origins: 'Fellowship4Dan' },
|
||||
text: 'Origin commanded by rank 4 of the Pezkuwi Fellowship and with a success of 4'
|
||||
},
|
||||
{
|
||||
compare: compareFellowshipRank(5),
|
||||
id: 5,
|
||||
name: 'experts',
|
||||
origin: [
|
||||
{ Origins: 'Fellowship5Dan' },
|
||||
{ Origins: 'FellowshipExperts' }
|
||||
],
|
||||
text: 'Origin commanded by Pezkuwi Experts (5th Dan fellows or greater)'
|
||||
},
|
||||
{
|
||||
compare: compareFellowshipRank(6),
|
||||
id: 6,
|
||||
name: 'senior experts',
|
||||
origin: { Origins: 'Fellowship6Dan' },
|
||||
text: 'Origin commanded by rank 6 of the Pezkuwi Fellowship and with a success of 6'
|
||||
},
|
||||
{
|
||||
compare: compareFellowshipRank(7),
|
||||
id: 7,
|
||||
name: 'masters',
|
||||
origin: [
|
||||
{ Origins: 'Fellowship7Dan' },
|
||||
{ Origins: 'FellowshipMasters' }
|
||||
],
|
||||
text: 'Origin commanded by Pezkuwi Masters (7th Dan fellows of greater)'
|
||||
},
|
||||
{
|
||||
compare: compareFellowshipRank(8),
|
||||
id: 8,
|
||||
name: 'senior masters',
|
||||
origin: { Origins: 'Fellowship8Dan' },
|
||||
text: 'Origin commanded by rank 8 of the Pezkuwi Fellowship and with a success of 8'
|
||||
},
|
||||
{
|
||||
compare: compareFellowshipRank(9),
|
||||
id: 9,
|
||||
name: 'grand masters',
|
||||
origin: { Origins: 'Fellowship9Dan' },
|
||||
text: 'Origin commanded by rank 9 of the Pezkuwi Fellowship and with a success of 9'
|
||||
}
|
||||
],
|
||||
referenda: [
|
||||
{
|
||||
id: 0,
|
||||
name: 'root',
|
||||
origin: { system: 'Root' },
|
||||
text: 'Origin for the system root'
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
name: 'whitelisted_caller',
|
||||
origin: { Origins: 'WhitelistedCaller' },
|
||||
text: 'Origin able to dispatch a whitelisted call'
|
||||
},
|
||||
{
|
||||
id: 10,
|
||||
name: 'staking_admin',
|
||||
origin: { Origins: 'StakingAdmin' },
|
||||
text: 'Origin for cancelling slashes'
|
||||
},
|
||||
{
|
||||
id: 11,
|
||||
name: 'treasurer',
|
||||
origin: { Origins: 'Treasurer' },
|
||||
text: 'Origin for spending (any amount of) funds'
|
||||
},
|
||||
{
|
||||
id: 12,
|
||||
name: 'lease_admin',
|
||||
origin: { Origins: 'LeaseAdmin' },
|
||||
text: 'Origin able to force slot leases'
|
||||
},
|
||||
{
|
||||
id: 13,
|
||||
name: 'fellowship_admin',
|
||||
origin: { Origins: 'FellowshipAdmin' },
|
||||
text: 'Origin for managing the composition of the fellowship'
|
||||
},
|
||||
{
|
||||
id: 14,
|
||||
name: 'general_admin',
|
||||
origin: { Origins: 'GeneralAdmin' },
|
||||
text: 'Origin for managing the registrar'
|
||||
},
|
||||
{
|
||||
id: 15,
|
||||
name: 'auction_admin',
|
||||
origin: { Origins: 'AuctionAdmin' },
|
||||
text: 'Origin for starting auctions'
|
||||
},
|
||||
{
|
||||
id: 20,
|
||||
name: 'referendum_canceller',
|
||||
origin: { Origins: 'ReferendumCanceller' },
|
||||
text: 'Origin able to cancel referenda'
|
||||
},
|
||||
{
|
||||
id: 21,
|
||||
name: 'referendum_killer',
|
||||
origin: { Origins: 'ReferendumKiller' },
|
||||
text: 'Origin able to kill referenda'
|
||||
},
|
||||
{
|
||||
id: 30,
|
||||
name: 'small_tipper',
|
||||
origin: { Origins: 'SmallTipper' },
|
||||
text: `Origin able to spend up to ${SPEND_LIMITS.SmallTipper} from the treasury at once`
|
||||
},
|
||||
{
|
||||
id: 31,
|
||||
name: 'big_tipper',
|
||||
origin: { Origins: 'BigTipper' },
|
||||
text: `Origin able to spend up to ${SPEND_LIMITS.BigTipper} from the treasury at once`
|
||||
},
|
||||
{
|
||||
id: 32,
|
||||
name: 'small_spender',
|
||||
origin: { Origins: 'SmallSpender' },
|
||||
text: `Origin able to spend up to ${SPEND_LIMITS.SmallSpender} from the treasury at once`
|
||||
},
|
||||
{
|
||||
id: 33,
|
||||
name: 'medium_spender',
|
||||
origin: { Origins: 'MediumSpender' },
|
||||
text: `Origin able to spend up to ${SPEND_LIMITS.MediumSpender} from the treasury at once`
|
||||
},
|
||||
{
|
||||
id: 34,
|
||||
name: 'big_spender',
|
||||
origin: { Origins: 'BigSpender' },
|
||||
text: `Origin able to spend up to ${SPEND_LIMITS.BigSpender} from the treasury at once`
|
||||
}
|
||||
]
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
// Copyright 2017-2025 @pezkuwi/apps-config authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { BN } from '@pezkuwi/util';
|
||||
|
||||
export type Origin = { system: string } | { Origins: string };
|
||||
|
||||
export interface TrackInfo {
|
||||
// TODO We would want to make this generic for non-fellowship
|
||||
compare?: (memberInfo: BN) => boolean;
|
||||
id: number;
|
||||
name: string;
|
||||
origin: Origin | Origin[];
|
||||
text?: string;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
// Copyright 2017-2025 @pezkuwi/apps-config authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { BN } from '@pezkuwi/util';
|
||||
|
||||
import { formatBalance } from '@pezkuwi/util';
|
||||
|
||||
interface FormatOptions {
|
||||
decimals: number;
|
||||
forceUnit: '-',
|
||||
withSi: true,
|
||||
withUnit: string;
|
||||
}
|
||||
|
||||
export function formatSpendFactory (options: FormatOptions): (mul: number, value: BN) => string {
|
||||
return (mul: number, value: BN): string => {
|
||||
// We lose the decimals here... depending on chain config, this could be non-optimal
|
||||
// (A simple formatBalance(value.muln(mul), FMT_OPTS) formats to 4 decimals)
|
||||
return `${formatBalance(value.muln(mul), options).split('.')[0]} ${options.withUnit}`;
|
||||
};
|
||||
}
|
||||
|
||||
export function compareFellowshipRank (trackId: number): (rank: BN) => boolean {
|
||||
return (rank: BN): boolean =>
|
||||
rank.gten(trackId);
|
||||
}
|
||||
Reference in new issue
Block a user