mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-07-23 17:45:47 +00:00
1295c36241
- Fixed TypeScript type assertion issues - Updated imports from api-augment/substrate to api-augment/bizinikiwi - Fixed imgConvert.mjs header and imports - Added @ts-expect-error for runtime-converted types - Fixed all @polkadot copyright headers to @pezkuwi
21 lines
793 B
TypeScript
21 lines
793 B
TypeScript
// Copyright 2017-2025 @pezkuwi/app-bounties authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import type { PezpalletStakingStakingLedger } from '@pezkuwi/types/lookup';
|
|
|
|
import { TypeRegistry } from '@pezkuwi/types/create';
|
|
import { BN } from '@pezkuwi/util';
|
|
|
|
export function makeStakingLedger (active: BN | number | string): PezpalletStakingStakingLedger {
|
|
const reg = new TypeRegistry();
|
|
|
|
// Constructing the whole StakingLedger structure is hard,
|
|
// so we fill out just the fields that are definitely required,
|
|
// and hope that nothing more is required.
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
return {
|
|
active: reg.createType('Compact<Balance>', reg.createType('Balance', new BN(active)))
|
|
} as PezpalletStakingStakingLedger;
|
|
}
|