@darkpay/dark-api
Version:
JavaScript API for Darkdot blockchain.
21 lines (20 loc) • 1.53 kB
TypeScript
import { IpfsCid, SubstrateId, AnyAccountId, AnyOrderingId, CommonStruct, CID, AnySwapId, AnyRedeemId } from '@darkpay/dark-types';
import { ProductId, ReactionId, SocialAccount, Reaction, Product, Ordering, Content, Swap } from '@darkpay/dark-types/substrate/interfaces';
import { GenericAccountId } from '@polkadot/types';
import { Redeem } from '@darkpay/dark-types/build/substrate/interfaces';
export declare type SupportedSubstrateId = SubstrateId | AnyAccountId | ReactionId | AnyOrderingId | AnySwapId | AnyRedeemId;
export declare type SupportedSubstrateResult = CommonStruct | SocialAccount | Reaction | Ordering | Swap | Redeem;
declare type AnyId = SupportedSubstrateId | IpfsCid;
export declare const getUniqueIds: <ID extends AnyId>(ids: (ID | undefined)[]) => ID[];
export declare function asAccountId(id: AnyAccountId): GenericAccountId | undefined;
export declare const getSharedProductId: (productData: any) => ProductId | undefined;
declare type HasProductStruct = {
struct: Product;
};
/** Return original product id from shared product or root product id if this product is a comment. */
export declare const getProductIdFromExtension: (productData?: HasProductStruct | undefined) => ProductId | undefined;
export declare const isIpfs: (content?: Content | undefined) => any;
export declare const asIpfsCid: (cid: IpfsCid) => CID;
export declare const isValidIpfsCid: (cid: IpfsCid) => boolean;
export declare const resolveCidOfContent: (content?: Content | undefined) => string | undefined;
export {};