PHP WebShell
Текущая директория: /opt/BitGoJS/modules/sdk-coin-rune/dist/src/lib
Просмотр файла: utils.d.ts
import { Coin } from '@cosmjs/stargate';
import { CosmosLikeTransaction, CosmosUtils, FeeData } from '@bitgo/abstract-cosmos';
import { MessageData } from './iface';
import { NetworkType } from '@bitgo/statics';
import { DecodedTxRaw } from '@cosmjs/proto-signing';
export declare class RuneUtils extends CosmosUtils {
private networkType;
constructor(networkType?: NetworkType);
getSendMessageDataFromDecodedTx(decodedTx: DecodedTxRaw): MessageData[];
/** @inheritdoc */
isValidAddress(address: string | Uint8Array): boolean;
/**
* Validates a decoded address in `Uint8Array` form by encoding it and
* checking if the encoded version is valid
*
* @param address - The decoded address as a `Uint8Array`.
* @returns `true` if the encoded address is valid, `false` otherwise.
*/
private isValidDecodedAddress;
/**
* Validates an encoded address string against network-specific criteria.
*
* @param address - The encoded address as a `string`.
* @returns `true` if the address meets network-specific validation criteria, `false` otherwise.
*/
private isValidEncodedAddress;
/**
* Encodes a given address `Uint8Array` into a bech32 string format, based on the current network type.
* Primarily serves as a utility to convert a `Uint8Array`-type address to a bech32 encoded string
*
* @param address - The address to be encoded, provided as a `Uint8Array`.
* @returns A bech32-encoded string representing the address.
* @throws Error - Throws an error if encoding fails
*/
getEncodedAddress(address: Uint8Array): string;
/**
* Decodes a bech32-encoded address string back into a `Uint8Array`.
* Primarily serves as a utility to convert a string-type address into its binary representation,
*
* @param address - The bech32-encoded address as a `string`.
* @returns The decoded address as a `Uint8Array`.
* @throws Error - Throws an error if decoding fails
*/
getDecodedAddress(address: string): Uint8Array;
/** @inheritdoc */
isValidValidatorAddress(address: string): boolean;
/** @inheritdoc */
validateAmount(amount: Coin): void;
/**
* Validates the gas limit and gas amount for a transaction.
* @param {FeeData} gasBudget - The gas budget to validate.
* @throws {InvalidTransactionError} Throws an error if the gas budget is invalid.
*/
validateGasBudget(gasBudget: FeeData): void;
/**
* Validates an array of coin amounts.
* @param {Coin[]} amountArray - The array of coin amounts to validate.
*/
validateGasAmountData(amountArray: Coin[]): void;
validateGasAmount(amount: Coin): void;
validateDenomination(amountDenom: string): void;
convertMessageAddressToUint8Array(messages: MessageData[]): MessageData[];
createTransaction(sequence: number, messages: MessageData[], gasBudget: FeeData, publicKey?: string, memo?: string): CosmosLikeTransaction;
getNetworkPrefix(): "thor" | "sthor";
}
declare const runeUtils: RuneUtils;
export default runeUtils;
//# sourceMappingURL=utils.d.ts.mapВыполнить команду
Для локальной разработки. Не используйте в интернете!