wowok
Version:
Wowok Blockchain TypeScript API
194 lines (193 loc) • 6.11 kB
TypeScript
import type { CoinBalance, PaginatedCoins, WowTransactionBlockResponse } from "../../client/index.js";
import type { ENTRYPOINT } from "../../client/network.js";
import type { AccountData, AccountFilter, FaucetCoinInfo } from "./account.js";
import { Account } from "./account.js";
import type { InfoData, LocalInfoFilter, LocalMarkFilter, MarkData, MarkParam } from "./local.js";
import { LocalInfo, LocalMark } from "./local.js";
import type { TokenDataFilter, TokenTypeInfo } from "./token.js";
export { Account, LocalInfo, LocalMark };
export interface AccountOrMark_Address {
name_or_address?: string;
local_mark_first?: boolean;
}
export interface ManyAccountOrMark_Address {
entities: AccountOrMark_Address[];
check_all_founded?: boolean;
}
export declare const GetAccountOrMark_Address: (entity?: AccountOrMark_Address | string) => Promise<string | undefined>;
export declare const GetManyAccountOrMark_Address: (entities: ManyAccountOrMark_Address) => Promise<string[]>;
export declare const query_local_mark_list: (filter: LocalMarkFilter | undefined | null) => Promise<MarkData[]>;
export declare const query_account_list: (filter?: AccountFilter) => Promise<AccountData[]>;
export declare const query_local_info_list: (filter?: LocalInfoFilter) => Promise<InfoData[]>;
export declare const query_local_token_list: (filter?: TokenDataFilter) => Promise<TokenTypeInfo[]>;
export declare const query_local_mark: <T extends string | string[]>(name_or_address: T) => Promise<T extends string ? MarkData | undefined : (MarkData | undefined)[]>;
export declare const query_local_info: <T extends string | string[]>(name?: T) => Promise<T extends string ? InfoData | undefined : (InfoData | undefined)[]>;
export declare const query_local_info_default: <T extends string | string[]>(name?: T) => Promise<T extends string ? string | undefined : (string | undefined)[]>;
export interface QueryAccount {
name_or_address?: string;
balance?: boolean;
coin?: {
cursor?: string | null | undefined;
limit?: number | null | undefined;
};
token_type?: string;
network?: ENTRYPOINT;
}
export interface QueryAccountResult {
name_or_address?: string;
address?: string;
balance?: CoinBalance;
coin?: PaginatedCoins;
}
export declare const query_account: (query: QueryAccount) => Promise<QueryAccountResult>;
export type FaucetNetwork = ENTRYPOINT.Localnet | ENTRYPOINT.Testnet;
export interface AccountOperation {
gen?: {
name?: string;
replaceExistName?: boolean;
m?: string | null;
};
faucet?: {
name_or_address?: string;
network: FaucetNetwork;
};
suspend?: {
name_or_address?: string;
};
resume?: {
address: string;
name?: string;
};
rename?: {
name_or_address?: string;
new_name: string;
};
swap_name?: {
name_or_address1?: string;
name_or_address2?: string;
};
transfer?: {
name_or_address_from?: string;
name_or_address_to?: string;
amount: number | string | bigint;
token_type?: string;
network?: ENTRYPOINT;
};
get?: {
name_or_address?: string;
balance_required: string | bigint | number;
token_type?: string;
network?: ENTRYPOINT;
};
signData?: {
name_or_address?: string;
data: string | Uint8Array;
data_encoding?: "utf8" | "base64" | "hex";
};
messenger?: {
name_or_account?: string;
m: string | null;
};
}
export interface AccountOperationResult {
gen?: {
address: string;
name?: string;
m?: string | null;
};
faucet?: {
name_or_address?: string;
result: FaucetCoinInfo[];
network: FaucetNetwork;
};
suspend?: {
name_or_address?: string;
success: boolean;
};
resume?: {
address: string;
name?: string;
success: boolean;
};
rename?: {
name_or_address?: string;
new_name: string;
success: boolean;
};
swap_name?: {
name_or_address1?: string;
name_or_address2?: string;
success: boolean;
};
transfer?: WowTransactionBlockResponse;
get?: {
coin_address?: string;
name_or_address?: string;
balance_required: string | bigint | number;
token_type?: string;
network?: ENTRYPOINT;
};
signData?: {
name_or_address?: string;
signature: string;
publicKey: string;
address: string;
};
messenger?: {
name_or_account?: string;
m: string | null;
};
}
export declare const account_operation: (op: AccountOperation) => Promise<AccountOperationResult>;
export interface LocalMarkOperation {
clear?: {
op: "clear";
};
add?: {
op: "add";
data: MarkParam[];
};
remove?: {
op: "remove";
names: string[];
};
}
export interface LocalMarkOperationResult {
clear?: boolean;
add?: MarkData[];
remove?: MarkData[];
}
export declare const local_mark_operation: (op: LocalMarkOperation) => Promise<LocalMarkOperationResult>;
export interface LocalInfoOperation {
clear?: {
op: "clear";
};
add?: {
op: "add";
data: InfoData[];
};
remove?: {
op: "remove";
data: string[];
};
reset?: {
op: "reset";
name: string;
contents: string[];
};
}
export interface LocalInfoOperationResult {
success: boolean;
}
export declare const local_info_operation: (op: LocalInfoOperation) => Promise<LocalInfoOperationResult>;
export interface FetchTokenInfoOperation {
tokenType?: string | null | undefined;
alias?: string;
network?: ENTRYPOINT;
}
export declare const fetch_token_info_operation: (op: FetchTokenInfoOperation) => Promise<TokenTypeInfo | undefined>;
export * from "./account.js";
export * from "./config.js";
export * from "./local.js";
export * from "./token.js";
export * from "./wip.js";