PHP WebShell
Текущая директория: /opt/BitGoJS/modules/sdk-coin-icp/dist/src
Просмотр файла: icp.d.ts
import { BaseBroadcastTransactionOptions, BaseBroadcastTransactionResult, BaseCoin, BitGoBase, KeyPair, MPCAlgorithm, MultisigType, ParsedTransaction, ParseTransactionOptions, SignedTransaction, SignTransactionOptions, TssVerifyAddressOptions, VerifyTransactionOptions } from '@bitgo/sdk-core';
import { BaseCoin as StaticsBaseCoin } from '@bitgo/statics';
import { Hash } from 'crypto';
import * as request from 'superagent';
import { PayloadsData, RecoveryOptions, Signatures, IcpTransactionExplanation, TransactionHexParams } from './lib/iface';
/**
* Class representing the Internet Computer (ICP) coin.
* Extends the BaseCoin class and provides specific implementations for ICP.
*
* @see {@link https://internetcomputer.org/}
* @see {@link https://internetcomputer.org/docs/current/developer-docs/defi/rosetta/icp_rosetta/data_api/}
*/
export declare class Icp extends BaseCoin {
protected readonly _staticsCoin: Readonly<StaticsBaseCoin>;
protected constructor(bitgo: BitGoBase, staticsCoin?: Readonly<StaticsBaseCoin>);
static createInstance(bitgo: BitGoBase, staticsCoin?: Readonly<StaticsBaseCoin>): BaseCoin;
getChain(): string;
getBaseChain(): string;
getFamily(): string;
getFullName(): string;
getBaseFactor(): number;
explainTransaction(params: TransactionHexParams): Promise<IcpTransactionExplanation>;
verifyTransaction(params: VerifyTransactionOptions): Promise<boolean>;
isWalletAddress(params: TssVerifyAddressOptions): Promise<boolean>;
parseTransaction(params: ParseTransactionOptions): Promise<ParsedTransaction>;
/**
* Generate a new keypair for this coin.
* @param seed Seed from which the new keypair should be generated, otherwise a random seed is used
*/
generateKeyPair(seed?: Buffer): KeyPair;
isValidAddress(address: string): boolean;
signTransaction(params: SignTransactionOptions & {
txPrebuild: {
txHex: string;
};
prv: string;
}): Promise<SignedTransaction>;
isValidPub(key: string): boolean;
isValidPrv(key: string): boolean;
/** @inheritDoc */
supportsTss(): boolean;
/** inherited doc */
getDefaultMultisigType(): MultisigType;
/** @inheritDoc */
getMPCAlgorithm(): MPCAlgorithm;
/** @inheritDoc **/
getHashFunction(): Hash;
private getAddressFromPublicKey;
/** @inheritDoc **/
protected getPublicNodeUrl(): string;
protected getRosettaNodeUrl(): string;
/**
* Sends a POST request to the Rosetta node with the specified payload and endpoint.
*
* @param payload - A JSON string representing the request payload to be sent to the Rosetta node.
* @param endpoint - The endpoint path to append to the Rosetta node URL.
* @returns A promise that resolves to the HTTP response from the Rosetta node.
* @throws An error if the HTTP request fails or if the response status is not 200.
*/
protected getRosettaNodeResponse(payload: string, endpoint: string): Promise<request.Response>;
broadcastTransaction(payload: BaseBroadcastTransactionOptions): Promise<BaseBroadcastTransactionResult>;
private getPublicNodeBroadcastEndpoint;
private extractTransactionId;
/**
* Helper to fetch account balance
* @param senderAddress - The address of the account to fetch the balance for
* @returns The balance of the account as a string
* @throws If the account is not found or there is an error fetching the balance
*/
protected getAccountBalance(address: string): Promise<string>;
private getBuilderFactory;
/**
* Generates an array of signatures for the provided payloads using MPC
*
* @param payloadsData - The data containing the payloads to be signed.
* @param senderPublicKey - The public key of the sender in hexadecimal format.
* @param userKeyShare - The user's key share as a Buffer.
* @param backupKeyShare - The backup key share as a Buffer.
* @param commonKeyChain - The common key chain identifier used for MPC signing.
* @returns A promise that resolves to an array of `Signatures` objects, each containing the signing payload,
* signature type, public key, and the generated signature in hexadecimal format.
*/
signatures(payloadsData: PayloadsData, senderPublicKey: string, userKeyShare: Buffer<ArrayBufferLike>, backupKeyShare: Buffer<ArrayBufferLike>, commonKeyChain: string): Promise<Signatures[]>;
/**
* Builds a funds recovery transaction without BitGo
* @param params
*/
recover(params: RecoveryOptions): Promise<string>;
}
//# sourceMappingURL=icp.d.ts.mapВыполнить команду
Для локальной разработки. Не используйте в интернете!