import { Chain, Sender, Fee, MessageSendParams } from '@tharsis/transactions'; import { RegistryClient } from "./registry-client"; import { Account } from "./account"; import { MessageMsgAssociateBond, MessageMsgCancelBond, MessageMsgCreateBond, MessageMsgDissociateBond, MessageMsgDissociateRecords, MessageMsgReAssociateRecords, MessageMsgRefillBond, MessageMsgWithdrawBond } from "./messages/bond"; import { MessageMsgDeleteName, MessageMsgSetAuthorityBond, MessageMsgSetName, MessageMsgSetRecord } from './messages/nameservice'; import { MessageMsgCommitBid, MessageMsgRevealBid } from './messages/auction'; export declare const parseTxResponse: (result: any, parseResponse?: ((data: string) => any) | undefined) => any; /** * Create an auction bid. */ export declare const createBid: (chainId: string, auctionId: string, bidderAddress: string, bidAmount: string, noise?: string | undefined) => Promise<{ commitHash: string; reveal: { chainId: string; auctionId: string; bidderAddress: string; bidAmount: string; noise: string; }; revealString: string; }>; export declare const isKeyValid: (key: string) => "" | RegExpMatchArray | null; export declare class Registry { _endpoints: { [key: string]: string; }; _chainID: string; _chain: Chain; _client: RegistryClient; static processWriteError(error: string): string; constructor(restUrl: string, gqlUrl: string, chainId: string); /** * Get accounts by addresses. */ getAccounts(addresses: string[]): Promise; get endpoints(): { [key: string]: string; }; get chainID(): string; /** * Get server status. */ getStatus(): Promise; /** * Get records by ids. */ getRecordsByIds(ids: string[], refs?: boolean): Promise; /** * Get records by attributes. */ queryRecords(attributes: { [key: string]: any; }, all?: boolean, refs?: boolean): Promise; /** * Resolve names to records. */ resolveNames(names: string[], refs?: boolean): Promise; /** * Publish record. * @param transactionPrivateKey - private key in HEX to sign transaction. */ setRecord(params: { privateKey: string; record: any; bondId: string; }, transactionPrivateKey: string, fee: Fee): Promise; /** * Send coins. */ sendCoins(params: MessageSendParams, privateKey: string, fee: Fee): Promise; /** * Computes the next bondId for the given account private key. */ getNextBondId(privateKey: string): Promise; /** * Get bonds by ids. */ getBondsByIds(ids: string[]): Promise; /** * Query bonds by attributes. */ queryBonds(attributes?: {}): Promise; /** * Create bond. */ createBond(params: MessageMsgCreateBond, privateKey: string, fee: Fee): Promise; /** * Refill bond. */ refillBond(params: MessageMsgRefillBond, privateKey: string, fee: Fee): Promise; /** * Withdraw (from) bond. */ withdrawBond(params: MessageMsgWithdrawBond, privateKey: string, fee: Fee): Promise; /** * Cancel bond. */ cancelBond(params: MessageMsgCancelBond, privateKey: string, fee: Fee): Promise; /** * Associate record with bond. */ associateBond(params: MessageMsgAssociateBond, privateKey: string, fee: Fee): Promise; /** * Dissociate record from bond. */ dissociateBond(params: MessageMsgDissociateBond, privateKey: string, fee: Fee): Promise; /** * Dissociate all records from bond. */ dissociateRecords(params: MessageMsgDissociateRecords, privateKey: string, fee: Fee): Promise; /** * Reassociate records (switch bond). */ reassociateRecords(params: MessageMsgReAssociateRecords, privateKey: string, fee: Fee): Promise; /** * Reserve authority. */ reserveAuthority(params: { name: string; owner?: string; }, privateKey: string, fee: Fee): Promise; /** * Set authority bond. */ setAuthorityBond(params: MessageMsgSetAuthorityBond, privateKey: string, fee: Fee): Promise; /** * Commit auction bid. */ commitBid(params: MessageMsgCommitBid, privateKey: string, fee: Fee): Promise; /** * Reveal auction bid. */ revealBid(params: MessageMsgRevealBid, privateKey: string, fee: Fee): Promise; /** * Get records by ids. */ getAuctionsByIds(ids: string[]): Promise; /** * Lookup authorities by names. */ lookupAuthorities(names: string[], auction?: boolean): Promise; /** * Set name (CRN) to record ID (CID). */ setName(params: MessageMsgSetName, privateKey: string, fee: Fee): Promise; /** * Lookup naming information. */ lookupNames(names: string[], history?: boolean): Promise; /** * Delete name (CRN) mapping. */ deleteName(params: MessageMsgDeleteName, privateKey: string, fee: Fee): Promise; /** * Submit record transaction. * @param privateKey - private key in HEX to sign message. * @param txPrivateKey - private key in HEX to sign transaction. */ _submitRecordTx({ privateKey, record, bondId }: { privateKey: string; record: any; bondId: string; }, txPrivateKey: string, fee: Fee): Promise; _submitRecordPayloadTx(params: MessageMsgSetRecord, privateKey: string, fee: Fee): Promise; /** * Submit a generic Tx to the chain. */ _submitTx(message: any, privateKey: string, sender: Sender): Promise; /** * https://evmos.dev/basics/chain_id.html */ _parseEthChainId(chainId: string): number; /** * Get sender used for creating message. */ _getSender(account: Account): Promise<{ accountAddress: string; sequence: any; accountNumber: any; pubkey: string; }>; } export { Account };