PHP WebShell
Текущая директория: /usr/lib/node_modules/bitgo/node_modules/@bitgo/abstract-utxo/dist/src/recovery
Просмотр файла: crossChainRecovery.d.ts
import * as utxolib from '@bitgo/utxo-lib';
import { BitGoBase, IWallet } from '@bitgo/sdk-core';
import { AbstractUtxoCoin, TransactionInfo } from '../abstractUtxoCoin';
type RootWalletKeys = utxolib.bitgo.RootWalletKeys;
export interface BuildRecoveryTransactionOptions {
wallet: string;
faultyTxId: string;
recoveryAddress: string;
}
type FeeInfo = {
size: number;
feeRate: number;
fee: number;
payGoFee: number;
};
export interface CrossChainRecoveryUnsigned<TNumber extends number | bigint = number> {
txHex: string;
txInfo: TransactionInfo<TNumber>;
walletId: string;
feeInfo: FeeInfo;
address: string;
coin: string;
}
export interface CrossChainRecoverySigned<TNumber extends number | bigint = number> {
version: 1 | 2;
txHex: string;
txInfo: TransactionInfo<TNumber>;
walletId: string;
sourceCoin: string;
recoveryCoin: string;
recoveryAddress?: string;
recoveryAmount?: TNumber;
}
type WalletV1 = {
keychains: {
xpub: string;
}[];
address({ address }: {
address: string;
}): Promise<{
chain: number;
index: number;
}>;
getEncryptedUserKeychain(): Promise<{
encryptedXprv: string;
}>;
};
export declare function getWallet(bitgo: BitGoBase, coin: AbstractUtxoCoin, walletId: string): Promise<IWallet | WalletV1>;
/**
* @param recoveryCoin
* @param wallet
* @return wallet pubkeys
*/
export declare function getWalletKeys(recoveryCoin: AbstractUtxoCoin, wallet: IWallet | WalletV1): Promise<RootWalletKeys>;
export declare function isWalletAddress(wallet: IWallet | WalletV1, address: string): Promise<boolean>;
type RecoverParams = {
/** Wallet ID (can be v1 wallet or v2 wallet) */
walletId: string;
/** Coin to create the transaction for */
sourceCoin: AbstractUtxoCoin;
/** Coin that wallet keys were set up for */
recoveryCoin: AbstractUtxoCoin;
/** Source coin transaction to recover outputs from (sourceCoin) */
txid: string;
/** Source coin address to send the funds to */
recoveryAddress: string;
/** If set, decrypts private key and signs transaction */
walletPassphrase?: string;
/** If set, signs transaction */
xprv?: string;
/** for utxo coins other than [BTC,TBTC] this is a Block Chair api key **/
apiKey?: string;
};
/**
* Recover wallet deposits that were received on the wrong blockchain
* (for instance bitcoin deposits that were received for a litecoin wallet).
*
* Fetches the unspent data from BitGo's public blockchain API and the script data from the user's
* wallet.
*
* @param {BitGoBase} bitgo
* @param {RecoverParams} params
*/
export declare function recoverCrossChain<TNumber extends number | bigint = number>(bitgo: BitGoBase, params: RecoverParams): Promise<CrossChainRecoverySigned<TNumber> | CrossChainRecoveryUnsigned<TNumber>>;
export {};
//# sourceMappingURL=crossChainRecovery.d.ts.mapВыполнить команду
Для локальной разработки. Не используйте в интернете!