@peerme/core-ts
Version:
Core ts library
773 lines (717 loc) • 44 kB
TypeScript
import { A as AppNetwork, a as AppNetworkName, M as MediaItems, C as Contract, S as ScInfo, K as Kyc, b as KycData, T as Ticket, c as TicketType, E as Entity, d as EntityTemplate, e as EntityStrategy, f as SocialPlatform, g as ActionExecution, h as EntityBoost, U as User, i as Proposal, j as ProposalAction, k as ProposalPollOption, l as ProposalPrediction, W as WithdrawableEntity, V as Vote, m as EntityMember, R as Role, n as EntityVault, P as Permission, o as EntityFeatureDetails, p as EntitySearchHit, q as ProposalActionPayment, r as ProposalActionExtras, s as ProposalActionSerializable, t as ProposalActionPaymentSerializable, u as UserPrivate, I as Identity, v as Profession, w as UserSearchHit, B as BountyStatus, x as Bounty, y as BountyPayment, z as BountyApplication, D as BountySubmission, F as PolicyMethod } from './types-pLOJWJEX.js';
export { af as Affiliate, ai as AffiliateStatus, ah as AffiliateTier, ag as AffiliateTierName, G as AppEnv, aj as AppSystemColor, L as BountyAgent, H as BountySearchHit, J as BountySubmissionStatus, X as EntityCredits, O as EntityCreditsPerks, a2 as EntityFeature, a0 as EntityKycInfo, Y as EntityLevel, Q as EntitySpecialization, $ as EntityStrategyId, N as EntityTag, a1 as EntityVaultToken, ab as KycPrivate, a8 as KycProvider, aa as KycStatus, a9 as KycThresholdInCents, a6 as Policy, a5 as ProposalPoll, a3 as ProposalSearchHit, a4 as ProposalStatus, ad as SocialAccount, ae as SocialPlatformProvider, _ as Specialization, Z as SpecializationType, ac as UserExperience, a7 as WithdrawableProposal } from './types-pLOJWJEX.js';
import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
import * as _multiversx_sdk_core from '@multiversx/sdk-core';
import { TokenTransfer, TypedValue, Transaction, AbiRegistry, EnumValue, StructType, Struct } from '@multiversx/sdk-core';
import 'react';
interface IHttpService {
readonly baseUrl: string;
readonly authToken: string | null;
onNetworkError: (error: Error) => void;
onUnauthorized: (response: IAppResponse<any>) => void;
onSuccessfulResponse: (response: IAppResponse<any>) => void;
onMaintenanceMode: (response: IAppResponse<any>) => void;
get: <T>(url: string, options?: IRequestOptions) => Promise<IAppResponse<T>>;
post: <T>(url: string, data?: any, options?: IRequestOptions) => Promise<IAppResponse<T>>;
put: <T>(url: string, data?: any, options?: IRequestOptions) => Promise<IAppResponse<T>>;
delete: <T>(url: string, options?: IRequestOptions) => Promise<IAppResponse<T>>;
}
interface IAppResponse<T> {
data: T;
meta?: any;
body: any;
errors: any;
ok: boolean;
paymentRequired: boolean;
noContent: boolean;
original: Response;
}
type ReqCookie = {
name: string;
value: string;
};
interface IRequestOptions {
isJson?: boolean;
headers?: {
[name: string]: string;
};
}
declare class HttpService implements IHttpService {
baseUrl: string;
authToken: string | null;
cookies: ReqCookie[];
onNetworkError: (error: any) => any;
onUnauthorized: (response: IAppResponse<any>) => any;
onSuccessfulResponse: (response: IAppResponse<any>) => any;
onMaintenanceMode: (response: IAppResponse<any>) => any;
onTooManyRequests: (response: IAppResponse<any>) => any;
constructor(baseUrl: string, cookies?: ReqCookie[], authToken?: string | null);
get: <T>(url: string, options?: IRequestOptions) => Promise<IAppResponse<T>>;
post: <T>(url: string, data?: any, options?: IRequestOptions) => Promise<IAppResponse<T>>;
put: <T>(url: string, data?: any, options?: IRequestOptions) => Promise<IAppResponse<T>>;
delete: <T>(url: string, options?: IRequestOptions) => Promise<IAppResponse<T>>;
private request;
private convertResponse;
private getRequestInfo;
}
type SearchServiceConfig = {
HostUrl: string;
ApiKey: string;
Indexes: {
Users: () => string;
Entities: () => string;
Proposals: () => string;
};
};
interface ISearchService {
readonly hostUrl: string;
readonly apiKey: string;
readonly index: string;
query: (query: string, filter: string) => Promise<{
[key: string]: any;
}[]>;
}
declare class SearchService implements ISearchService {
hostUrl: string;
apiKey: string;
index: string;
constructor(hostUrl: string, apiKey: string, index: string);
query: <T>(query: string, filter: string) => Promise<T>;
}
type AnalyticsData = {
users: string;
userProfessions: string;
supply: string;
burnt: string;
holders: string;
price: number;
marketCap: number;
liquidityPercent: number;
entities: number;
proposals: number;
votes: number;
};
declare const getAnalyticsRequest: (http: IHttpService) => Promise<IAppResponse<AnalyticsData>>;
type ApiToken = {
id: number;
name: string;
createdAt: string;
token?: string;
mobileConnectUri?: string;
};
declare const getApiTokensRequest: (http: IHttpService) => Promise<IAppResponse<ApiToken[]>>;
declare const storeApiTokenRequest: (http: IHttpService, name: string) => Promise<IAppResponse<ApiToken>>;
declare const destoryApiTokenRequest: (http: IHttpService, apiTokenId: number) => Promise<IAppResponse<unknown>>;
declare const getAppNetworksRequest: (http: IHttpService) => Promise<IAppResponse<AppNetwork[]>>;
declare const getAppNetworkRequest: (http: IHttpService, network: AppNetworkName) => Promise<IAppResponse<AppNetwork>>;
type OrderRequiredBillingInfo = 'email' | 'name' | 'address1' | 'city' | 'zip' | 'country';
type OrderStatus = 'pending' | 'completed' | 'canceled';
type PaymentProvider = 'blockchain' | 'xmoney' | 'lemonsqueezy' | 'paddle';
type Product = {
slug: string;
name: string;
description: string;
price: number;
variations: ProductVariation[];
};
type ProductVariation = {
sku: string;
name: string;
description: string;
price: number;
quantity: number | null;
media: MediaItems;
};
type Order = {
id: string;
productVariations: ProductVariation[];
total: number;
provider: PaymentProvider;
status: OrderStatus;
invoiceUrl: string;
createdAt: string;
};
type BillingAddress = {
firstName: string;
lastName: string;
addressOne: string | null;
city: string | null;
state: string | null;
zipCode: string | null;
country: string;
vatId: string | null;
isEU: boolean;
};
declare const getOrdersRequest: (http: IHttpService, page?: number) => Promise<IAppResponse<Order[]>>;
declare const getOrderRequest: (http: IHttpService, id: string) => Promise<IAppResponse<Order>>;
declare const getBillingAddressRequest: (http: IHttpService) => Promise<IAppResponse<BillingAddress>>;
declare const storeBillingAddressRequest: (http: IHttpService, firstName: string, lastName: string, addressOne: string, city: string, state: string, zipCode: string, country: string, vatId: string, email: string) => Promise<IAppResponse<BillingAddress>>;
declare const getProductsRequest: (http: IHttpService) => Promise<IAppResponse<Product[]>>;
declare const getProductRequest: (http: IHttpService, slug: string) => Promise<IAppResponse<Product>>;
declare const storeOrderPaddleBoostRequest: (http: IHttpService, priceInCents: number, entityId?: string) => Promise<IAppResponse<{
order: Order;
paymentUrl: string;
}>>;
declare const BillingConfig: {
Skus: {
Boost: string;
};
};
declare const getContractRequest: (http: IHttpService, address: string) => Promise<IAppResponse<Contract>>;
declare const getContractsRequest: (http: IHttpService, entityId?: string, page?: number) => Promise<IAppResponse<Contract[]>>;
declare const getContractsCallableRequest: (http: IHttpService) => Promise<IAppResponse<Contract[]>>;
declare const storeContractFavoriteToggleRequest: (http: IHttpService, address: string) => Promise<IAppResponse<unknown>>;
type ContractsAddressConfig = {
Organization: string;
Identity: string;
Manager: string;
Earn: string;
Payout: string;
Bounty: string;
ContractStage: string;
DexRouter: string;
};
declare const ContractsConfig: (contracts: ContractsAddressConfig) => {
Multisig: {
ProposeAny: (address: string, endpoint: string) => ScInfo;
ProposeBatch: (address: string, extraGasLimit?: number) => ScInfo;
ProposeChangeQuorum: (address: string) => ScInfo;
ProposeAddBoardMember: (address: string) => ScInfo;
ProposeAddProposer: (address: string) => ScInfo;
ProposeRemoveUser: (address: string) => ScInfo;
ProposeTransferExecute: (address: string) => ScInfo;
ProposeTransferExecuteEsdt: (address: string) => ScInfo;
ProposeSyncCall: (address: string) => ScInfo;
ProposeAsyncCall: (address: string) => ScInfo;
ProposeAddModule: (address: string) => ScInfo;
ProposeRemoveModule: (address: string) => ScInfo;
ProposeSCDeployFromSource: (address: string) => ScInfo;
ProposeSCUpgradeFromSource: (address: string) => ScInfo;
Sign: (address: string) => ScInfo;
SignBatch: (address: string) => ScInfo;
SignAndPerform: (address: string, extraGasLimit?: number) => ScInfo;
SignBatchAndPerform: (address: string, extraGasLimit?: number) => ScInfo;
Unsign: (address: string) => ScInfo;
UnsignBatch: (address: string) => ScInfo;
DiscardAction: (address: string) => ScInfo;
PerformAction: (address: string, extraGasLimit?: number) => ScInfo;
PerformBatch: (address: string, extraGasLimit?: number) => ScInfo;
GetNumBoardMembers: (address: string) => ScInfo;
};
Payout: {
CreatePayout: ScInfo;
CreatePendingKycPayout: ScInfo;
ReleasePayout: ScInfo;
CancelPayout: ScInfo;
};
Organization: {
Buy: ScInfo;
VoucherRedeem: ScInfo;
xGetVoucherCollection: ScInfo;
};
ContracStage: {
Register: ScInfo;
AddDeveloper: ScInfo;
RemoveDeveloper: ScInfo;
StageContract: (extraGasLimit?: number) => ScInfo;
UnlockStage: ScInfo;
GetContractLock: ScInfo;
};
IdentityAvatarSet: ScInfo;
IdentityAvatarRemove: ScInfo;
ManagerEntityCreate: ScInfo;
ManagerCreateExternalEntity: ScInfo;
ManagerRegisterExternalEntity: ScInfo;
ManagerEntityBoost: (extraGasLimit?: number) => ScInfo;
ManagerFeaturesSet: ScInfo;
xManagerEntityCreditsInfo: ScInfo;
ManagerTicketExecute: ScInfo;
EntityGovTokenIssue: (address: string) => ScInfo;
EntityGovTokenInit: (address: string) => ScInfo;
xEntityGuardedVoteTokens: (address: string) => ScInfo;
EntityPropose: (address: string, extraGasLimit?: number) => ScInfo;
EntityVoteFor: (address: string, extraGasLimit?: number) => ScInfo;
EntityVoteAgainst: (address: string, extraGasLimit?: number) => ScInfo;
xEntityProposalNftVotes: (address: string) => ScInfo;
EntitySign: (address: string) => ScInfo;
EntityExecute: (address: string, extraGasLimit?: number) => ScInfo;
EntityDirectExecute: (address: string, extraGasLimit?: number) => ScInfo;
EntityCancel: (address: string) => ScInfo;
EntityWithdraw: (address: string, extraGasLimit?: number) => ScInfo;
EntityChangeQuorum: (address: string) => ScInfo;
EntityChangeMinProposeWeight: (address: string) => ScInfo;
EntityChangeMinVoteWeight: (address: string) => ScInfo;
EntityChangeVotingPeriodMinutes: (address: string) => ScInfo;
xEntityPlugVoteWeight: (address: string) => ScInfo;
xEntityPlugHasVoted: (address: string) => ScInfo;
xDexRouterGetPair: ScInfo;
EarnStake: ScInfo;
EarnWithdraw: ScInfo;
EarnClaimRewards: ScInfo;
EarnDistribute: ScInfo;
EarnRegister: ScInfo;
xEarnerInfo: ScInfo;
xAllEarnerInfo: ScInfo;
BountyCreate: (extraGasLimit?: number) => ScInfo;
BountyStart: ScInfo;
BountyComplete: ScInfo;
BountyRewardsClaim: (extraGasLimit?: number) => ScInfo;
xDexPair: (address: string) => ScInfo;
};
declare const getKycRequest: (http: IHttpService, entityId: string) => Promise<IAppResponse<Kyc>>;
declare const storeKycRequest: (http: IHttpService, entityId: string, data: KycData) => Promise<IAppResponse<Kyc>>;
declare const storeKycRunsRequest: (http: IHttpService, entityId: string) => Promise<IAppResponse<unknown>>;
declare const getTicketsRequest: (http: IHttpService) => Promise<IAppResponse<Ticket[]>>;
declare const getTicketRequest: (http: IHttpService, ticketId: string) => Promise<IAppResponse<Ticket>>;
declare const storeTicketRequest: (http: IHttpService, type: string, data: any, media: MediaItems) => Promise<IAppResponse<Ticket>>;
declare const TicketConfig: {
ExecutionScEndpoint: string;
AvailableTypes: TicketType[];
};
declare const toTicketTypePrettyName: (type: TicketType) => string;
type EntityOptionalRequestParams = 'credits' | 'caller-roles' | 'children' | 'kyc';
type ProposalOptionalRequestParams = 'permissions' | 'signing' | EntityOptionalRequestParams;
declare const getEntitiesRequest: (http: IHttpService) => Promise<IAppResponse<Entity[]>>;
declare const getEntitiesByAddressesRequest: (http: IHttpService, addresses: string[]) => Promise<IAppResponse<Entity[]>>;
declare const getEntityRequest: (http: IHttpService, entityId: string, withParams?: EntityOptionalRequestParams[]) => Promise<IAppResponse<Entity>>;
declare const getBrandEntityRequest: (http: IHttpService, withParams?: EntityOptionalRequestParams[]) => Promise<IAppResponse<Entity>>;
declare const storeEntityRequest: (http: IHttpService, network: AppNetworkName, txHash: string, name: string, description: string, isPrivate: boolean, template?: EntityTemplate) => Promise<IAppResponse<Entity>>;
declare const getStrategiesRequest: (http: IHttpService) => Promise<IAppResponse<EntityStrategy[]>>;
declare const storeEntitySetup: (http: IHttpService, entityId: string, logo: MediaItems, socials: [SocialPlatform, string]) => Promise<IAppResponse<unknown>>;
declare const storeEntityGovConfigFinalizeRequest: (http: IHttpService, txHash: string) => Promise<IAppResponse<unknown>>;
declare const storeEntityVoteTokenWithdrawRequest: (http: IHttpService, network: AppNetworkName, txHash: string) => Promise<IAppResponse<unknown>>;
declare const storeEntityBoostFinalizeRequest: (http: IHttpService, network: AppNetworkName, txHash: string) => Promise<IAppResponse<unknown>>;
declare const getEntityActionExecutionsRequest: (http: IHttpService, entityId: string, page?: number) => Promise<IAppResponse<ActionExecution[]>>;
declare const getEntityBoostersTopRequest: (http: IHttpService, entityId: string) => Promise<IAppResponse<EntityBoost[]>>;
declare const getEntityBoostersRecentRequest: (http: IHttpService, entityId: string) => Promise<IAppResponse<User[]>>;
declare const getEntityBoostersGlobalRequest: (http: IHttpService, page?: number) => Promise<IAppResponse<User[]>>;
declare const getProposalsRequest: (http: IHttpService, entityId: string, page?: number) => Promise<IAppResponse<Proposal[]>>;
declare const getProposalRequest: (http: IHttpService, proposalId: string, withParams?: ProposalOptionalRequestParams[]) => Promise<IAppResponse<Proposal>>;
declare const storeProposalRequest: (http: IHttpService, entityId: string, title: string, description: string, actions: ProposalAction[], attachments: MediaItems, poll: ProposalPollOption[]) => Promise<IAppResponse<Proposal>>;
declare const storeProposalPredictionRequest: (http: IHttpService, entityId: string, actions: ProposalAction[]) => Promise<IAppResponse<ProposalPrediction>>;
declare const storeProposalFinalizeRequest: (http: IHttpService, proposalId: string, txHash: string) => Promise<IAppResponse<unknown>>;
declare const storeExecuteFinalizeRequest: (http: IHttpService, network: AppNetworkName, txHash: string, actions?: ProposalAction[]) => Promise<IAppResponse<unknown>>;
declare const storeProposalVoteFinalizeRequest: (http: IHttpService, proposalId: string, txHash: string, delay?: boolean) => Promise<IAppResponse<unknown>>;
declare const storeProposalSignatureFinalizeRequest: (http: IHttpService, proposalId: string, txHash: string, delay?: boolean) => Promise<IAppResponse<unknown>>;
declare const storeProposalCancellationFinalizeRequest: (http: IHttpService, proposalId: string, txHash: string, delay?: boolean) => Promise<IAppResponse<unknown>>;
declare const getVotesWithdrawableRequest: (http: IHttpService) => Promise<IAppResponse<WithdrawableEntity[]>>;
declare const getVotesProposalRequest: (http: IHttpService, proposalId: string, page?: number, perPage?: number) => Promise<IAppResponse<Vote[]>>;
declare const getProposalExecutablesRequest: (http: IHttpService) => Promise<IAppResponse<Proposal[]>>;
declare const getProposalCommentsRequest: (http: IHttpService, proposalId: string, page?: number) => Promise<IAppResponse<Comment[]>>;
declare const storeProposalCommentRequest: (http: IHttpService, proposalId: string, text: string, repliedToId?: string | null) => Promise<IAppResponse<unknown>>;
declare const getEntityMembersRequest: (http: IHttpService, entityId: string, page?: number) => Promise<IAppResponse<EntityMember[]>>;
declare const getEntityMemberRolesRequest: (http: IHttpService, entityId: string) => Promise<IAppResponse<Role[]>>;
declare const getEntityVaultRequest: (http: IHttpService, address: string) => Promise<IAppResponse<EntityVault>>;
declare const getEntityPermissionRolesRequest: (http: IHttpService, entityId: string) => Promise<IAppResponse<Role[]>>;
declare const getEntityPermissionEntitlementsRequest: (http: IHttpService, entityId: string) => Promise<IAppResponse<Permission[]>>;
declare const getEntityPermissionUsersRequest: (http: IHttpService, entityId: string) => Promise<IAppResponse<Role[]>>;
declare const getEntityPermissionsRequest: (http: IHttpService, entityId: string, withParams?: "token-decimals"[]) => Promise<IAppResponse<Permission[]>>;
declare const getEntityPermissionMeRequest: (http: IHttpService, entityId: string) => Promise<IAppResponse<Permission[]>>;
declare const getEntityFavoritesRequest: (http: IHttpService) => Promise<IAppResponse<Entity[]>>;
declare const storeEntityFavoriteToggleRequest: (http: IHttpService, entityId: string) => Promise<IAppResponse<unknown>>;
declare const getEntityFeatures: (http: IHttpService) => Promise<IAppResponse<EntityFeatureDetails[]>>;
declare const storeEntityMigrationRequest: (http: IHttpService, tx: string, address: string, template: EntityTemplate, name: string, description: string) => Promise<IAppResponse<Entity>>;
declare const EntityConfig: {
ProductName: string;
BrandStaticId: string;
BuiltInRoles: string[];
BuiltInRoleLeader: string;
BuiltInRoleAccountant: string;
BuiltInRoleReviewer: string;
BoostedTag: string;
AvailableSocialPlatforms: SocialPlatform[];
DefaultActionCallables: (entity: Entity) => Contract[];
};
declare const getEntityAvatarPlaceholder: (entity: Entity | EntitySearchHit) => string;
declare const toFullUnit: (value: string, decimals: number) => string;
declare const toFullUnitFormatted: (value: string, decimals: number) => string;
declare const toFormattedTokenAmount: (value: bigint | string, tokenDecimals: number, formatDecimals?: number) => string;
declare const toTokenPaymentFromProposalPayment: (payment: ProposalActionPayment) => TokenTransfer;
declare const toVotingPeriodDisplayInDays: (minutes: number) => string;
declare const createAction: (receiver: string, endpoint: string | null, value: bigint, args: TypedValue[], payments: TokenTransfer[], extras?: ProposalActionExtras) => ProposalAction;
declare const toSerializableAction: (deserializable: ProposalAction, gasLimit: number) => ProposalActionSerializable;
declare const toSerializableTokenPayment: (transfer: TokenTransfer) => ProposalActionPaymentSerializable;
declare const numberToPaddedHex: (value: string | number | bigint) => string;
declare const toRoleDisplayName: (role: string) => string;
declare const isEntityMultisig: (entity: Entity) => boolean;
declare const transformScInfoIntoAction: (scInfo: ScInfo, { args, value, payments }: {
args?: TypedValue[];
value?: bigint;
payments?: TokenTransfer[];
}) => ProposalAction;
declare const convertActionToTx: (network: AppNetwork, sender: string, action: ProposalAction, gasLimit: number) => Promise<_multiversx_sdk_core.Transaction>;
declare const MultisigContractInfos: {
ProposeAny: (address: string, endpoint: string) => ScInfo;
ProposeBatch: (address: string, extraGasLimit?: number) => ScInfo;
ProposeChangeQuorum: (address: string) => ScInfo;
ProposeAddBoardMember: (address: string) => ScInfo;
ProposeAddProposer: (address: string) => ScInfo;
ProposeRemoveUser: (address: string) => ScInfo;
ProposeTransferExecute: (address: string) => ScInfo;
ProposeTransferExecuteEsdt: (address: string) => ScInfo;
ProposeSyncCall: (address: string) => ScInfo;
ProposeAsyncCall: (address: string) => ScInfo;
ProposeAddModule: (address: string) => ScInfo;
ProposeRemoveModule: (address: string) => ScInfo;
ProposeSCDeployFromSource: (address: string) => ScInfo;
ProposeSCUpgradeFromSource: (address: string) => ScInfo;
Sign: (address: string) => ScInfo;
SignBatch: (address: string) => ScInfo;
SignAndPerform: (address: string, extraGasLimit?: number) => ScInfo;
SignBatchAndPerform: (address: string, extraGasLimit?: number) => ScInfo;
Unsign: (address: string) => ScInfo;
UnsignBatch: (address: string) => ScInfo;
DiscardAction: (address: string) => ScInfo;
PerformAction: (address: string, extraGasLimit?: number) => ScInfo;
PerformBatch: (address: string, extraGasLimit?: number) => ScInfo;
GetNumBoardMembers: (address: string) => ScInfo;
};
type CommonEntity = {
network: CommonNetwork;
address: string;
version: string;
};
type CommonProposal = {
entity: CommonEntity;
proposer: CommonUser;
actions: CommonAction[];
};
type CommonUser = {
address: string;
};
type CommonAction = {
destination: string;
endpoint: string | null;
value: string;
payments: ProposalActionPayment[];
arguments: string[];
};
type CommonNetwork = {
chainId: string;
};
declare const transformActionToMultisigProposeCall: (proposal: CommonProposal, gasLimit?: number) => Promise<Transaction>;
declare const transformActionToMultisigProposeCallV1: (proposal: CommonProposal) => Promise<Transaction>;
declare const transformActionToMultisigProposeCallV2: (proposal: CommonProposal, gasLimit?: number) => Promise<Transaction>;
declare const toTypedMultisigAction: (action: CommonAction, abi: AbiRegistry, entity: CommonEntity, gasLimit?: number) => EnumValue;
declare const toActionArgBytes: (args: string[]) => TypedValue[];
declare const storeAuthVerifyRequest: (http: IHttpService, accessToken: string, withMobileApiToken?: boolean) => Promise<IAppResponse<UserPrivate>>;
declare const storeAuthLogoutRequest: (http: IHttpService) => Promise<IAppResponse<unknown>>;
declare const getMeRequest: (http: IHttpService) => Promise<IAppResponse<UserPrivate>>;
declare const storeMeUserInfoRequest: (http: IHttpService, name: string, bio: string, timezone: string) => Promise<IAppResponse<unknown>>;
declare const storeUserEmailAddressRequest: (http: IHttpService, email: string) => Promise<IAppResponse<UserPrivate>>;
declare const storeFollowRelationToggleRequest: (http: IHttpService, address: string) => Promise<IAppResponse<unknown>>;
declare const getProfileFollowingsRequest: (http: IHttpService, address: string, page: number, searchQuery?: string) => Promise<IAppResponse<User[]>>;
declare const getProfileFollowersRequest: (http: IHttpService, address: string, page: number, searchQuery?: string) => Promise<IAppResponse<User[]>>;
declare const getIdentityRequest: (http: IHttpService, id: string) => Promise<IAppResponse<Identity | null>>;
declare const getProfessionsRequest: (http: IHttpService) => Promise<IAppResponse<Profession[]>>;
declare const storeProfessionsRequest: (http: IHttpService, professions: string[]) => Promise<IAppResponse<unknown>>;
declare const getIdentityEntitiesRequest: (http: IHttpService, id: string) => Promise<IAppResponse<Entity[]>>;
declare const getIdentityProposalsRequest: (http: IHttpService, id: string, page?: number) => Promise<IAppResponse<Proposal[]>>;
declare const UserConfig: {
ProductName: string;
Affiliate: {
ProductName: string;
};
};
declare const getRawUsername: (username: string) => string;
declare const toUserChainId: (user: User | UserPrivate | UserSearchHit) => string;
declare const toUserDisplayName: (user: User | UserPrivate | UserSearchHit | Identity, keepHashAmount?: number) => string;
declare const isUserBlockchainId: (user: User | UserPrivate | null, identifier: string) => boolean;
declare const hasConnectedProvider: (user: UserPrivate | null, providerId: string) => boolean;
declare const getConnectedUsername: (user: UserPrivate | null, providerId: string) => any;
declare const needsUserOnboarding: (user: UserPrivate) => boolean;
declare const getEsdtTokenPaymentType: () => StructType;
declare const toEsdtTokenPaymentStruct: (payment: ProposalActionPayment) => Struct;
type Comment = {
id: string;
user: User;
text: string;
replies: Comment[];
sensitive: boolean;
createdAt: string;
};
type BountiesRequestSortFilter = 'deadline' | 'latest' | 'oldest';
type BountiesRequestFilter = {
sort?: BountiesRequestSortFilter;
status?: BountyStatus;
entity?: Entity | null;
search?: string;
};
declare const getBountiesRequest: (http: IHttpService, filter: BountiesRequestFilter | null, page: number) => Promise<IAppResponse<Bounty[]>>;
declare const getBountyRequest: (http: IHttpService, id: string, withParams?: EntityOptionalRequestParams[]) => Promise<IAppResponse<Bounty>>;
declare const storeEntityBountyRequest: (http: IHttpService, entity: Entity, title: string, description: string, isPrivate: boolean, source: string | null) => Promise<IAppResponse<Bounty>>;
declare const storeUserBountyRequest: (http: IHttpService, user: UserPrivate | User, title: string, description: string, isPrivate: boolean, source: string | null) => Promise<IAppResponse<Bounty>>;
declare const getBountyRewards: (http: IHttpService) => Promise<IAppResponse<BountyPayment[]>>;
declare const storeBountyFinalizeRequest: (http: IHttpService, bountyId: string, network: AppNetwork, txHash: string) => Promise<IAppResponse<unknown>>;
declare const getBountyApplicationsRequest: (http: IHttpService, bountyId: string, page?: number) => Promise<IAppResponse<BountyApplication[]>>;
declare const storeBountyApplicationApplyRequest: (http: IHttpService, bountyId: string, message: string) => Promise<IAppResponse<unknown>>;
declare const storeBountyApplicationCancelRequest: (http: IHttpService, bountyId: string) => Promise<IAppResponse<unknown>>;
declare const getBountyCommentsRequest: (http: IHttpService, bountyId: string, page?: number) => Promise<IAppResponse<Comment[]>>;
declare const storeBountyCommentRequest: (http: IHttpService, bountyId: string, text: string, repliedToId?: string | null) => Promise<IAppResponse<unknown>>;
declare const getBountySubmissionsRequest: (http: IHttpService, bountyId: string, page?: number, options?: {
user?: string | null;
}) => Promise<IAppResponse<BountySubmission[]>>;
declare const storeBountySubmissionRequest: (http: IHttpService, bountyId: string, content: string, attachments: MediaItems) => Promise<IAppResponse<unknown>>;
declare const storeBountySubmissionChangeRequest: (http: IHttpService, submissionId: string, message: string) => Promise<IAppResponse<unknown>>;
declare const getBountySubmissionCommentsRequest: (http: IHttpService, submissionId: string, page?: number) => Promise<IAppResponse<Comment[]>>;
declare const storeBountySubmissionCommentRequest: (http: IHttpService, submissionId: string, text: string, repliedToId?: string | null) => Promise<IAppResponse<unknown>>;
declare const storeBountyTopupRequest: (http: IHttpService, tx: string) => Promise<IAppResponse<unknown>>;
declare const BountyConfig: {
ProductName: string;
PercentPrecision: number;
};
declare const CreditsConfig: {
ProductName: string;
DefaultAmount: number;
MinAmount: number;
UserPerks: LevelPerk[];
Levels: EntityLevelConfig[];
};
type EntityLevelConfig = {
Name: string;
NameShort: string;
PerksOneLiner: LevelPerk;
Perks: LevelPerk[];
};
type LevelPerk = {
Icon: IconDefinition;
IconColorClassName: string;
Text: string;
Tooltip?: string;
};
type Payout = {
entity: Entity;
type: PayoutType;
condition: PayoutCondition;
amount: string;
currency: string;
usd: number | null;
tx: string | null;
ref: string | null;
chainId: number | null;
bounty: Bounty | null;
pending: boolean;
createdAt: string;
token: PayoutTokenInfo | null;
};
type PayoutTokenInfo = {
name: string;
decimals: number;
logo: string | null;
};
type PayoutType = 'default' | 'earn' | 'bounty' | 'grant';
type PayoutCondition = 'none' | 'manual' | 'kyc';
declare const getPayoutsPendingRequest: (http: IHttpService) => Promise<IAppResponse<Payout[]>>;
declare const EarnConfig: {
AvailablePayoutTypes: PayoutType[];
AvailablePayoutConditions: PayoutCondition[];
};
type Event = {
slug: string;
title: string;
description: string;
startsAt: string;
endsAt: string;
createdAt: string;
ongoing: boolean;
};
declare const getEventsRequest: (http: IHttpService, page?: number) => Promise<IAppResponse<Event[]>>;
declare const getEventsUpcomingRequest: (http: IHttpService, page?: number) => Promise<IAppResponse<Event[]>>;
declare const getEventRequest: (http: IHttpService, slug: string) => Promise<IAppResponse<Event>>;
type Tag = {
slug: string;
name: string;
type: TagType;
};
type TagType = 'entity';
declare const getTagsRequest: (http: IHttpService, type?: TagType) => Promise<IAppResponse<Tag[]>>;
type ExploreUsersData = {
popular: User[];
new: User[];
};
type ExploreEntitiesData = {
tags: Tag[];
featured: Entity[];
popular: Entity[];
boosted: Entity[];
};
declare const getExploreUsersDataRequest: (http: IHttpService) => Promise<IAppResponse<ExploreUsersData>>;
declare const getExploreEntitiesDataRequest: (http: IHttpService, tags: Tag[]) => Promise<IAppResponse<ExploreEntitiesData>>;
type ForumChannel = {
slug: string;
name: string;
color: string;
hasAccess: boolean;
};
type ForumThread = {
slug: string;
channel: ForumChannel | null;
entity: Entity | null;
title: string;
body: string;
pinned: boolean;
views: number;
createdAt: string;
author: User;
replyCount: number;
votes: number;
voted: ForumVoteInfo;
justCreated: boolean;
url: string;
hasAccess: boolean;
};
type ForumReply = {
id: string;
body: string;
children: ForumReply[];
createdAt: string;
author: User;
votes: number;
voted: ForumVoteInfo;
};
type ForumVoteInfo = 0 | 1 | -1;
type ForumThreadsRequestSortFilter = 'latest' | 'popular' | 'mine';
type ForumThreadsRequestFilter = {
sort: ForumThreadsRequestSortFilter;
channel?: ForumChannel | null;
entity?: Entity | null;
search?: string;
};
declare const getForumThreadsRequest: (http: IHttpService, filter: ForumThreadsRequestFilter | null, page: number) => Promise<IAppResponse<ForumThread[]>>;
declare const getForumThreadRequest: (http: IHttpService, slug: string) => Promise<IAppResponse<ForumThread>>;
declare const storeForumThreadRequest: (http: IHttpService, title: string, body: string, channelSlug?: string | null, entityId?: string | null) => Promise<IAppResponse<ForumThread>>;
declare const updateForumThreadRequest: (http: IHttpService, threadId: string, title: string, body: string) => Promise<IAppResponse<ForumThread>>;
declare const deleteForumThreadRequest: (http: IHttpService, thread: ForumThread) => Promise<IAppResponse<unknown>>;
declare const getForumChannels: (http: IHttpService, entity?: string | null) => Promise<IAppResponse<ForumChannel[]>>;
declare const getForumRepliesRequest: (http: IHttpService, thread: ForumThread, page: number) => Promise<IAppResponse<ForumReply[]>>;
declare const storeForumReplyRequest: (http: IHttpService, thread: ForumThread, body: string, repliedToId?: string | null) => Promise<IAppResponse<ForumThread>>;
declare const updateForumReplyRequest: (http: IHttpService, replyId: string, body: string) => Promise<IAppResponse<ForumReply>>;
declare const deleteForumReplyRequest: (http: IHttpService, reply: ForumReply) => Promise<IAppResponse<unknown>>;
declare const storeForumThreadVoteRequest: (http: IHttpService, thread: ForumThread, withVote: ForumVoteInfo) => Promise<IAppResponse<ForumThread>>;
declare const storeForumReplyVoteRequest: (http: IHttpService, reply: ForumReply, withVote: ForumVoteInfo) => Promise<IAppResponse<ForumReply>>;
declare const ForumConfig: {
ProductName: string;
CategoryProductName: string;
};
declare const KnowConfig: {
Url: string;
Pages: {
Boosting: string;
Bounties: string;
ContractManagement: string;
Entity: string;
Extensions: string;
LogFeature: string;
Permissions: string;
Staking: string;
Strategies: string;
Security: string;
SmartContracts: string;
};
};
declare const MobileConfig: {
ApiTokenName: string;
};
type NotificationChannel = 'mail' | 'push';
type NotificationType = 'unknown' | 'marketing' | 'bot' | 'follower_received' | 'role_assigned' | 'proposal_created' | 'proposal_executable' | 'vote_withdrawable' | 'order_all' | 'forum_replies' | 'forum_votes' | 'bounty_created' | 'bounty_pers_updates';
type Notification = {
id: string;
type: NotificationType;
title: string;
message: string | null;
url: string | null;
time: string;
readAt: string | null;
respondedAt: string | null;
createdAt: string;
actions: NotificationAction[];
};
type NotificationAction = {
identifier: string;
text: string;
highlight: boolean;
};
type NotificationSetting = {
identifier: string;
name: string;
description: string;
channels: {
identifier: NotificationChannel;
name: string;
isEnabled: boolean;
}[];
};
declare const getUnreadNotificationsRequest: (httpService: IHttpService) => Promise<IAppResponse<Notification[]>>;
declare const getNotificationsRequest: (httpService: IHttpService, page?: number) => Promise<IAppResponse<Notification[]>>;
declare const storeNotificationResponseRequest: (httpService: IHttpService, notificationId: string, notificationActionId: string) => Promise<IAppResponse<unknown>>;
declare const getNotificationSettingsRequest: (httpService: IHttpService) => Promise<IAppResponse<NotificationSetting[]>>;
declare const storeNotificationSettingToggleRequest: (httpService: IHttpService, notificationType: string, channel: NotificationChannel) => Promise<IAppResponse<NotificationSetting[]>>;
declare const OrganizationContractInfos: (address: string) => {
Buy: ScInfo;
VoucherRedeem: ScInfo;
xGetVoucherCollection: ScInfo;
};
type PolicySetting = {
Method: PolicyMethod;
Name: string;
Function: string;
};
declare const PermissionConfig: {
ContractFunctions: {
RoleCreate: string;
RoleRemove: string;
RoleAssign: string;
RoleUnassign: string;
PermissionCreate: string;
};
PolicySettings: PolicySetting[];
};
type TimelineItemTargetResource = 'user' | 'proposal' | 'comment' | 'entity' | 'thread' | 'reply';
type ActivityType = 'follow' | 'proposal-created' | 'proposal-voted' | 'comment-created' | 'entity-boosted' | 'forum-thread-created' | 'forum-thread-reply-created';
type TimelineItem = {
type: ActivityType;
user: User;
targetId: string;
targetResource: TimelineItemTargetResource;
content: string;
time: string;
privacy: boolean;
meta: (string | null)[];
};
declare const getTimelineMeRequest: (http: IHttpService, page: number) => Promise<IAppResponse<TimelineItem[]>>;
declare const getTimelineUserRequest: (http: IHttpService, address: string, page: number) => Promise<IAppResponse<TimelineItem[]>>;
declare const getTimelineEntityRequest: (http: IHttpService, entityAddress: string, page: number) => Promise<IAppResponse<TimelineItem[]>>;
declare const Constants: {
Egld: {
Id: string;
DisplayName: string;
Decimals: number;
};
GasLimit: {
MaxPerBlock: number;
EgldTransfer: number;
EsdtTransfer: number;
};
NetworkCosts: {
IssueEsdt: number;
};
SystemSc: {
Esdt: string;
};
};
declare const trimHash: (hash: string, keep?: number) => string;
declare const isValidBlockchainAddress: (val: string) => boolean;
declare const sanitizeAlphanumeric: (val: string) => string;
declare const sanitizeNumeric: (val: string) => string;
declare const toHtmlLineBreaks: (val: string) => string;
declare const capitalizeFirstLetter: (val: string) => string;
declare const abbreviateNumber: (val: number) => string | number;
declare const isFileFormatImage: (filename: string | null) => boolean;
declare const isFileFormatVideo: (filename: string | null) => boolean;
declare const isFileFormatAudio: (filename: string | null) => boolean;
declare const toPreviewText: (text: string, maxChars?: number) => string;
declare const toDateDisplay: (date: string) => string;
declare const toDateTimeDisplay: (date: string) => string;
declare const toCurrencyDisplay: (valueInCents: number, currency?: string) => string;
declare const capMaxMiniBlockGasLimit: (gasLimit: number) => number;
export { ActionExecution, type ActivityType, type AnalyticsData, type ApiToken, AppNetwork, AppNetworkName, type BillingAddress, BillingConfig, type BountiesRequestFilter, type BountiesRequestSortFilter, Bounty, BountyApplication, BountyConfig, BountyPayment, BountyStatus, BountySubmission, type Comment, type CommonAction, type CommonEntity, type CommonNetwork, type CommonProposal, type CommonUser, Constants, Contract, ContractsConfig, CreditsConfig, EarnConfig, Entity, EntityBoost, EntityConfig, EntityFeatureDetails, type EntityLevelConfig, EntityMember, type EntityOptionalRequestParams, EntitySearchHit, EntityStrategy, EntityTemplate, EntityVault, type Event, type ExploreEntitiesData, type ExploreUsersData, type ForumChannel, ForumConfig, type ForumReply, type ForumThread, type ForumThreadsRequestFilter, type ForumThreadsRequestSortFilter, type ForumVoteInfo, HttpService, type IAppResponse, type IHttpService, type ISearchService, Identity, KnowConfig, Kyc, KycData, type LevelPerk, MediaItems, MobileConfig, MultisigContractInfos, type Notification, type NotificationAction, type NotificationChannel, type NotificationSetting, type Order, type OrderRequiredBillingInfo, type OrderStatus, OrganizationContractInfos, type PaymentProvider, type Payout, type PayoutCondition, type PayoutTokenInfo, type PayoutType, Permission, PermissionConfig, PolicyMethod, type PolicySetting, type Product, type ProductVariation, Profession, Proposal, ProposalAction, ProposalActionExtras, ProposalActionPayment, ProposalActionPaymentSerializable, ProposalActionSerializable, type ProposalOptionalRequestParams, ProposalPollOption, ProposalPrediction, Role, ScInfo, SearchService, type SearchServiceConfig, SocialPlatform, type Tag, type TagType, Ticket, TicketConfig, TicketType, type TimelineItem, type TimelineItemTargetResource, User, UserConfig, UserPrivate, UserSearchHit, Vote, WithdrawableEntity, abbreviateNumber, capMaxMiniBlockGasLimit, capitalizeFirstLetter, convertActionToTx, createAction, deleteForumReplyRequest, deleteForumThreadRequest, destoryApiTokenRequest, getAnalyticsRequest, getApiTokensRequest, getAppNetworkRequest, getAppNetworksRequest, getBillingAddressRequest, getBountiesRequest, getBountyApplicationsRequest, getBountyCommentsRequest, getBountyRequest, getBountyRewards, getBountySubmissionCommentsRequest, getBountySubmissionsRequest, getBrandEntityRequest, getConnectedUsername, getContractRequest, getContractsCallableRequest, getContractsRequest, getEntitiesByAddressesRequest, getEntitiesRequest, getEntityActionExecutionsRequest, getEntityAvatarPlaceholder, getEntityBoostersGlobalRequest, getEntityBoostersRecentRequest, getEntityBoostersTopRequest, getEntityFavoritesRequest, getEntityFeatures, getEntityMemberRolesRequest, getEntityMembersRequest, getEntityPermissionEntitlementsRequest, getEntityPermissionMeRequest, getEntityPermissionRolesRequest, getEntityPermissionUsersRequest, getEntityPermissionsRequest, getEntityRequest, getEntityVaultRequest, getEsdtTokenPaymentType, getEventRequest, getEventsRequest, getEventsUpcomingRequest, getExploreEntitiesDataRequest, getExploreUsersDataRequest, getForumChannels, getForumRepliesRequest, getForumThreadRequest, getForumThreadsRequest, getIdentityEntitiesRequest, getIdentityProposalsRequest, getIdentityRequest, getKycRequest, getMeRequest, getNotificationSettingsRequest, getNotificationsRequest, getOrderRequest, getOrdersRequest, getPayoutsPendingRequest, getProductRequest, getProductsRequest, getProfessionsRequest, getProfileFollowersRequest, getProfileFollowingsRequest, getProposalCommentsRequest, getProposalExecutablesRequest, getProposalRequest, getProposalsRequest, getRawUsername, getStrategiesRequest, getTagsRequest, getTicketRequest, getTicketsRequest, getTimelineEntityRequest, getTimelineMeRequest, getTimelineUserRequest, getUnreadNotificationsRequest, getVotesProposalRequest, getVotesWithdrawableRequest, hasConnectedProvider, isEntityMultisig, isFileFormatAudio, isFileFormatImage, isFileFormatVideo, isUserBlockchainId, isValidBlockchainAddress, needsUserOnboarding, numberToPaddedHex, sanitizeAlphanumeric, sanitizeNumeric, storeApiTokenRequest, storeAuthLogoutRequest, storeAuthVerifyRequest, storeBillingAddressRequest, storeBountyApplicationApplyRequest, storeBountyApplicationCancelRequest, storeBountyCommentRequest, storeBountyFinalizeRequest, storeBountySubmissionChangeRequest, storeBountySubmissionCommentRequest, storeBountySubmissionRequest, storeBountyTopupRequest, storeContractFavoriteToggleRequest, storeEntityBoostFinalizeRequest, storeEntityBountyRequest, storeEntityFavoriteToggleRequest, storeEntityGovConfigFinalizeRequest, storeEntityMigrationRequest, storeEntityRequest, storeEntitySetup, storeEntityVoteTokenWithdrawRequest, storeExecuteFinalizeRequest, storeFollowRelationToggleRequest, storeForumReplyRequest, storeForumReplyVoteRequest, storeForumThreadRequest, storeForumThreadVoteRequest, storeKycRequest, storeKycRunsRequest, storeMeUserInfoRequest, storeNotificationResponseRequest, storeNotificationSettingToggleRequest, storeOrderPaddleBoostRequest, storeProfessionsRequest, storeProposalCancellationFinalizeRequest, storeProposalCommentRequest, storeProposalFinalizeRequest, storeProposalPredictionRequest, storeProposalRequest, storeProposalSignatureFinalizeRequest, storeProposalVoteFinalizeRequest, storeTicketRequest, storeUserBountyRequest, storeUserEmailAddressRequest, toActionArgBytes, toCurrencyDisplay, toDateDisplay, toDateTimeDisplay, toEsdtTokenPaymentStruct, toFormattedTokenAmount, toFullUnit, toFullUnitFormatted, toHtmlLineBreaks, toPreviewText, toRoleDisplayName, toSerializableAction, toSerializableTokenPayment, toTicketTypePrettyName, toTokenPaymentFromProposalPayment, toTypedMultisigAction, toUserChainId, toUserDisplayName, toVotingPeriodDisplayInDays, transformActionToMultisigProposeCall, transformActionToMultisigProposeCallV1, transformActionToMultisigProposeCallV2, transformScInfoIntoAction, trimHash, updateForumReplyRequest, updateForumThreadRequest };