Files
pwap/pezkuwi-sdk-ui/packages/apps-routing/src/claims.ts
T
Claude c71ddb6e0d 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

48 lines
1.3 KiB
TypeScript

// Copyright 2017-2025 @polkadot/apps-routing authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Route, TFunction } from './types.js';
import Component, { useCounter } from '@polkadot/app-claims';
import { hasBuffer, u8aToBuffer } from '@polkadot/util';
// See https://github.com/polkadot-js/apps/issues/10115 - this may not work,
// if not we will have to disable it all (no way of testing)
function needsApiCheck (): boolean {
try {
if (!Buffer.from([1, 2, 3])?.length) {
console.error('ERROR: Unable to construct Buffer object for claims module');
return false;
} else if (!hasBuffer || !Buffer.isBuffer(u8aToBuffer(new Uint8Array([1, 2, 3])))) {
console.error('ERROR: Unable to use u8aToBuffer for claims module');
return false;
}
} catch {
console.error('ERROR: Fatal error in working with Buffer module');
return false;
}
return true;
}
export default function create (t: TFunction): Route {
return {
Component,
display: {
needsAccounts: true,
needsApi: [
'tx.claims.mintClaim'
],
needsApiCheck
},
group: 'accounts',
icon: 'star',
name: 'claims',
text: t('nav.claims', 'Claim Tokens', { ns: 'apps-routing' }),
useCounter
};
}