Files
pwap/pezkuwi-sdk-ui/packages/test-support/scripts/lib/changeBountyStateFunctions.ts
T
Claude 60a800b33e Add Pezkuwi SDK UI - Polkadot.js Apps clone
- Clone Polkadot.js Apps repository
- Update package.json with Pezkuwi branding
- Add Pezkuwi endpoint to production chains (wss://pezkuwichain.app:9944)
- Create comprehensive README for SDK UI
- Set up project structure with all packages

Next steps:
- Apply Kurdistan colors (Kesk, Sor, Zer, Spi + Black) to UI theme
- Replace logos with Pezkuwi branding
- Test build and deployment
2025-11-14 00:55:17 +00:00

46 lines
1.9 KiB
TypeScript

// Copyright 2017-2025 @polkadot/test-support authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ApiPromise } from '@polkadot/api';
import type { KeyringPair } from '@polkadot/keyring/types';
import type { BN } from '@polkadot/util';
import { execute } from '@polkadot/test-support/transaction';
import { acceptMotion, fillTreasury, getMotion, proposeMotion } from './helpers.js';
export async function acceptCurator (api: ApiPromise, id: number, signer: KeyringPair): Promise<void> {
await execute(api.tx.bounties.acceptCurator(id), signer);
}
export async function awardBounty (api: ApiPromise, index: number, signer: KeyringPair): Promise<void> {
await execute(api.tx.bounties.awardBounty(index, signer.address), signer);
}
export async function claimBounty (api: ApiPromise, index: number, signer: KeyringPair): Promise<void> {
await execute(api.tx.bounties.claimBounty(index), signer);
}
export async function proposeBounty (api: ApiPromise, value: BN, title: string, signer: KeyringPair): Promise<number> {
await execute(api.tx.bounties.proposeBounty(value, title), signer);
const index = await api.query.bounties.bountyCount();
return index.toNumber() - 1;
}
export async function proposeCurator (api: ApiPromise, index: number, signer: KeyringPair): Promise<void> {
await proposeMotion(api, api.tx.bounties.proposeCurator(index, signer.address, 10), signer);
const bountyProposal = await getMotion(api, index);
await acceptMotion(api, bountyProposal.hash, bountyProposal.votes?.index.toNumber() ?? 0);
}
export async function approveBounty (api: ApiPromise, index: number, signer: KeyringPair): Promise<void> {
await proposeMotion(api, api.tx.bounties.approveBounty(index), signer);
const bountyProposal = await getMotion(api, index);
await acceptMotion(api, bountyProposal.hash, bountyProposal.votes?.index.toNumber() ?? 0);
await fillTreasury(api, signer);
}