@darkpay/dark-types
Version:
JavaScript type definitions for Darkdot blockchain.
96 lines (95 loc) • 2.79 kB
TypeScript
import CID from 'cids';
import { IpfsCid as RuntimeIpfsCid } from '../substrate/interfaces';
export { CID };
export declare type CommonContent = CommentContent | ProductContent | StorefrontContent | ProfileContent | OrderingContent | SharedProductContent;
export declare type Activity = {
account: string;
block_number: string;
event_index: number;
event: EventsName;
/** Account id. */
following_id?: string;
storefront_id?: string;
product_id?: string;
comment_id?: string;
ordering_id?: string;
/** Date of this activity. Example: "2020-12-03T19:22:36.000Z" */
date: string;
aggregated: boolean;
agg_count: number;
};
export declare type NamedLink = {
name: string;
url?: string;
};
declare type ContentFormat = {
format?: 'md' | 'html';
};
export declare type StorefrontContent = ContentFormat & {
name: string;
about: string;
image: string;
email: string;
tags: string[];
links: string[] | NamedLink[];
};
declare type CommonProductContent = ContentFormat & {
body: string;
};
export declare type SharedProductContent = CommonProductContent;
export declare type SubstrateProposal = {
kind: 'SubstrateProposal';
network: 'Kusama' | 'Polkadot';
proposalIndex: number;
};
export declare type MetaItem = SubstrateProposal;
export declare type ProductExt = {
proposal?: SubstrateProposal;
};
export declare type ShipZone = {
country: string[];
price: number;
};
export declare type ProductContent = CommonProductContent & {
title: string;
price: number;
image: string;
tags: string[];
bescrow: number;
sescrow: number;
taxpct: number;
shipzones: ShipZone[];
canonical: string;
link?: string;
meta?: MetaItem[];
};
export declare type OrderingContent = {
name: string;
address1: string;
address2: string;
postal_code: string;
city: string;
country: string;
memo: string;
orderingcontent_total: string;
orderingcontent_state: string;
};
export declare type CommentContent = CommonProductContent;
export declare type ProfileContent = {
name: string;
avatar: string;
about: string;
gpg: string;
d4rk: string;
};
export declare type IpfsCid = string | CID | RuntimeIpfsCid;
export declare type EventsName = 'AccountFollowed' | 'StorefrontFollowed' | 'StorefrontCreated' | 'CommentCreated' | 'CommentReplyCreated' | 'ProductCreated' | 'ProductShared' | 'CommentShared' | 'ProductReactionCreated' | 'OrderingCreated' | 'CommentReactionCreated';
export declare type Counts = {
productsCount: number;
commentsCount: number;
orderingsCount: number;
reactionsCount: number;
followsCount: number;
storefrontsCount: number;
activitiesCount: number;
};