import { LogionRuntimeRegion } from '@polkadot/types/lookup'; import { AnyJson } from "@polkadot/types-codec/types"; import { UUID } from "./UUID.js"; import { Hash } from './Hash.js'; import { Lgnt } from './Currency.js'; export interface TypesAccountData { available: Lgnt; reserved: Lgnt; total: Lgnt; } export interface LocItemParams { submitter: ValidAccountId; } export interface MetadataItemParams extends LocItemParams { name: Hash; value: Hash; } export interface LocItemAck { acknowledgedByOwner: boolean; acknowledgedByVerifiedIssuer: boolean; } export interface MetadataItem extends MetadataItemParams, LocItemAck { } export interface FileParams extends LocItemParams { hash: Hash; nature: Hash; size: bigint; } export interface File extends FileParams, LocItemAck { } export interface LinkParams extends LocItemParams { id: UUID; nature: Hash; } export interface Link extends LinkParams, LocItemAck { } export interface LegalOfficerCase { owner: ValidAccountId; requesterAccountId?: ValidAccountId; requesterLocId?: UUID; metadata: MetadataItem[]; files: File[]; links: Link[]; closed: boolean; locType: LocType; voidInfo?: VoidInfo; replacerOf?: UUID; collectionLastBlockSubmission?: bigint; collectionMaxSize?: number; collectionCanUpload: boolean; seal?: string; sponsorshipId?: UUID; valueFee: Lgnt; collectionItemFee: Lgnt; tokensRecordFee: Lgnt; legalFee: Lgnt; } export type LocType = 'Transaction' | 'Collection' | 'Identity'; export type IdentityLocType = 'Polkadot' | 'Logion'; export interface VoidInfo { replacer?: UUID; } export interface CollectionItem { id: Hash; description: Hash; files: ItemFile[]; token?: ItemToken; restrictedDelivery: boolean; termsAndConditions: TermsAndConditionsElement[]; } export interface ItemFile { name: Hash; contentType: Hash; size: bigint; hash: Hash; } export interface ItemTokenWithoutIssuance { type: Hash; id: Hash; } export interface ItemToken extends ItemTokenWithoutIssuance { issuance: bigint; } export interface TermsAndConditionsElement { tcType: Hash; tcLocId: UUID; details: Hash; } export declare function isLogionIdentityLoc(loc: LegalOfficerCase): boolean; export declare function isLogionDataLoc(loc: LegalOfficerCase): boolean; export interface TypesJsonObject { [index: string]: AnyJson; } export interface TypesJsonCall extends TypesJsonObject { method: string; section: string; args: TypesJsonObject; } export interface TypesEvent { name: string; section: string; data: TypesJsonObject | AnyJson[]; } export interface TypesErrorMetadata { readonly pallet: string; readonly error: string; readonly details: string; } export interface TypesTokensRecordFile { name: Hash; contentType: Hash; size: string; hash: Hash; } export interface TypesTokensRecord { description: Hash; files: TypesTokensRecordFile[]; submitter: ValidAccountId; } export interface TypesRecoveryConfig { legalOfficers: ValidAccountId[]; } export type AccountType = "Polkadot" | "Ethereum" | "Bech32"; export declare const ETHEREUM_ADDRESS_LENGTH_IN_BITS: number; export interface AccountId { readonly address: string; readonly type: AccountType; } export declare const SS58_PREFIX = 2021; export declare class AnyAccountId implements AccountId { /** * Developers should not construct directly this object but call logionApi.queries.getValidAccountId(address, type). * * @param address * @param type */ constructor(address: string, type: AccountType); readonly address: string; readonly type: AccountType; isValid(): boolean; validate(): string | undefined; private validPolkadotAccountId; isValidBech32Address(prefix?: string): boolean; toValidAccountId(): ValidAccountId; toKey(): string; static parseKey(key: string): AnyAccountId; equals(other?: AccountId | null): boolean; } export declare class ValidAccountId implements AccountId { constructor(accountId: AnyAccountId); private anyAccountId; get address(): string; get type(): AccountType; toOtherAccountId(): OtherAccountId; toKey(): string; static parseKey(key: string): ValidAccountId; equals(other?: AccountId | null): boolean; getAddress(prefix: number): string; static polkadot(address: string): ValidAccountId; static ethereum(address: string): ValidAccountId; static bech32(address: string): ValidAccountId; /** * Attempt to guess the account type from a given address, and instantiate * the corresponding valid account. * Warning: this method should NOT be used whenever caller site knows the account type. * In this case use {@link polkadot}, {@link ethereum}, {@link bech32} or {@link ValidAccountId:constructor} * * @param address the address. * @returns a valid account or undefined. */ static fromUnknown(address: string): ValidAccountId | undefined; private static normalizeAddress; private static computeAddress; } export declare class OtherAccountId implements AccountId { constructor(accountId: ValidAccountId); private validAccountId; get address(): string; get type(): AccountType; toKey(): string; toValidAccountId(): ValidAccountId; equals(other?: AccountId | null): boolean; } export interface Sponsorship { sponsor: ValidAccountId; sponsoredAccount: ValidAccountId; legalOfficer: ValidAccountId; locId: UUID | undefined; } export interface VerifiedIssuerType { account: ValidAccountId; identityLocId: UUID; } export interface LegalOfficerData { hostData?: Partial; isHost?: boolean; hostAccount?: ValidAccountId; guests?: string[]; } export interface HostData { nodeId: string; baseUrl: string; region: Region; } export type Region = LogionRuntimeRegion["type"];