PHP WebShell

Текущая директория: /opt/BitGoJS/modules/abstract-cosmos/dist/src

Просмотр файла: cosmosCoin.d.ts

import { BaseCoin, BitGoBase, ExplanationResult, KeyPair, MPCAlgorithm, MultisigType, ParsedTransaction, ParseTransactionOptions, SignedTransaction, SignTransactionOptions, VerifyAddressOptions, VerifyTransactionOptions } from '@bitgo/sdk-core';
import { BaseCoin as StaticsBaseCoin, CoinFamily } from '@bitgo/statics';
import { Buffer } from 'buffer';
import { Hash } from 'crypto';
import * as request from 'superagent';
import { CosmosKeyPair, CosmosLikeCoinRecoveryOutput, GasAmountDetails, RecoveryOptions } from './lib';
/**
 * Cosmos accounts support memo Id based addresses
 */
interface AddressDetails {
    address: string;
    memoId?: string | undefined;
}
export declare class CosmosCoin<CustomMessage = never> extends BaseCoin {
    protected readonly _staticsCoin: Readonly<StaticsBaseCoin>;
    protected constructor(bitgo: BitGoBase, staticsCoin?: Readonly<StaticsBaseCoin>);
    static createInstance(bitgo: BitGoBase, staticsCoin?: Readonly<StaticsBaseCoin>): BaseCoin;
    /**
     * Creates an instance of TransactionBuilderFactory for the coin specific sdk
     */
    getBuilder(): any;
    /** @inheritDoc **/
    getBaseFactor(): string | number;
    /** @inheritDoc **/
    getChain(): string;
    /** @inheritDoc **/
    getFamily(): CoinFamily;
    /** @inheritDoc **/
    getFullName(): string;
    /** @inheritDoc */
    supportsTss(): boolean;
    /** inherited doc */
    getDefaultMultisigType(): MultisigType;
    /** @inheritDoc **/
    getMPCAlgorithm(): MPCAlgorithm;
    /** @inheritDoc **/
    isValidPub(pub: string): boolean;
    /** @inheritDoc **/
    isValidPrv(prv: string): boolean;
    isValidAddress(address: string): boolean;
    /**
     * Builds a funds recovery transaction without BitGo
     * @param {RecoveryOptions} params parameters needed to construct and
     * (maybe) sign the transaction
     *
     * @returns {CosmosLikeCoinRecoveryOutput} the serialized transaction hex string and index
     * of the address being swept
     */
    recover(params: RecoveryOptions): Promise<CosmosLikeCoinRecoveryOutput>;
    /**
     * Builds a redelegate transaction
     * @param {RecoveryOptions} params parameters needed to construct and
     * (maybe) sign the transaction
     *
     * @returns {CosmosLikeCoinRecoveryOutput} the serialized transaction hex string
     */
    redelegate(params: RecoveryOptions & {
        validatorSrcAddress: string;
        validatorDstAddress: string;
        amountToRedelegate: string;
    }): Promise<CosmosLikeCoinRecoveryOutput>;
    /** @inheritDoc **/
    verifyTransaction(params: VerifyTransactionOptions): Promise<boolean>;
    /** @inheritDoc **/
    explainTransaction(options: {
        txHex: string;
    }): Promise<ExplanationResult>;
    /**
     * Sign a transaction with a single private key
     * @param params parameters in the form of { txPrebuild: {txHex}, prv }
     * @returns signed transaction in the form of { txHex }
     */
    signTransaction(params: SignTransactionOptions & {
        txPrebuild: {
            txHex: string;
        };
        prv: string;
    }): Promise<SignedTransaction>;
    /** @inheritDoc **/
    parseTransaction(params: ParseTransactionOptions & {
        txHex: string;
    }): Promise<ParsedTransaction>;
    /**
     * Get the public node url from the Environments constant we have defined
     */
    protected getPublicNodeUrl(): string;
    /**
     * Get account number from public node
     */
    protected getAccountFromNode(senderAddress: string): Promise<request.Response>;
    /**
     * Get balance from public node
     */
    protected getBalanceFromNode(senderAddress: string): Promise<request.Response>;
    /**
     * Get chain id from public node
     */
    protected getChainIdFromNode(): Promise<request.Response>;
    /**
     * Helper to fetch account balance
     */
    protected getAccountBalance(senderAddress: string): Promise<string>;
    /**
     * Helper to fetch chainId
     */
    protected getChainId(): Promise<string>;
    /**
     * Helper to fetch account number
     */
    protected getAccountDetails(senderAddress: string): Promise<string[]>;
    /** @inheritDoc **/
    generateKeyPair(seed?: Buffer): KeyPair;
    /**
     * Retrieves the address from a public key.
     * @param {string} pubKey - The public key.
     * @returns {string} The corresponding address.
     */
    getAddressFromPublicKey(pubKey: string): string;
    /** @inheritDoc **/
    isWalletAddress(params: VerifyAddressOptions): Promise<boolean>;
    /** @inheritDoc **/
    getHashFunction(): Hash;
    /**
     * Process address into address and memo id
     *
     * @param address the address
     * @returns object containing address and memo id
     */
    getAddressDetails(address: string): AddressDetails;
    /**
     * Return boolean indicating whether a memo id is valid
     *
     * @param memoId memo id
     * @returns true if memo id is valid
     */
    isValidMemoId(memoId: string): boolean;
    /**
     * Helper method to return the respective coin's base unit
     */
    getDenomination(): string;
    /**
     * Helper method to fetch gas amount details for respective coin
     */
    getGasAmountDetails(): GasAmountDetails;
    /**
     * Helper method to get key pair for individual coin
     * @param publicKey
     */
    getKeyPair(publicKey: string): CosmosKeyPair;
}
export {};
//# sourceMappingURL=cosmosCoin.d.ts.map

Выполнить команду


Для локальной разработки. Не используйте в интернете!