PHP WebShell
Текущая директория: /usr/lib/node_modules/bitgo/node_modules/@bitgo/abstract-utxo/dist/src/recovery
Просмотр файла: backupKeyRecovery.d.ts
import * as utxolib from '@bitgo/utxo-lib';
import { BitGoBase } from '@bitgo/sdk-core';
import { AbstractUtxoCoin } from '../abstractUtxoCoin';
import { RecoveryProvider } from './RecoveryProvider';
type ScriptType2Of3 = utxolib.bitgo.outputScripts.ScriptType2Of3;
type WalletUnspentJSON = utxolib.bitgo.WalletUnspent & {
valueString: string;
};
export interface OfflineVaultTxInfo {
inputs: WalletUnspentJSON[];
}
export interface FormattedOfflineVaultTxInfo {
txInfo: {
unspents: WalletUnspentJSON[];
};
txHex: string;
feeInfo: Record<string, never>;
coin: string;
}
export interface RecoverParams {
scan?: number;
userKey: string;
backupKey: string;
bitgoKey: string;
recoveryDestination: string;
krsProvider?: string;
ignoreAddressTypes: ScriptType2Of3[];
walletPassphrase?: string;
apiKey?: string;
userKeyPath?: string;
recoveryProvider?: RecoveryProvider;
feeRate?: number;
}
export type BackupKeyRecoveryTransansaction = {
inputs?: WalletUnspentJSON[];
transactionHex: string;
coin: string;
backupKey: string;
recoveryAmount: number;
recoveryAmountString: string;
};
/**
* Builds a funds recovery transaction without BitGo.
*
* Returns transaction hex in legacy format for unsigned sweep transaction, half signed backup recovery transaction with KRS provider (only keyternal),
* fully signed backup recovery transaction without a KRS provider.
*
* Returns PSBT hex for half signed backup recovery transaction with KRS provider (excluding keyternal)
* For PSBT hex cases, Unspents are not required in response.
*
* @param coin
* @param bitgo
* @param params
* - userKey: [encrypted] xprv, or xpub
* - backupKey: [encrypted] xprv, or xpub if the xprv is held by a KRS provider
* - walletPassphrase: necessary if one of the xprvs is encrypted
* - bitgoKey: xpub
* - krsProvider: necessary if backup key is held by KRS
* - recoveryDestination: target address to send recovered funds to
* - scan: the amount of consecutive addresses without unspents to scan through before stopping
* - ignoreAddressTypes: (optional) scripts to ignore
* for example: ['p2shP2wsh', 'p2wsh'] will prevent code from checking for wrapped-segwit and native-segwit chains on the public block explorers
*/
export declare function backupKeyRecovery(coin: AbstractUtxoCoin, bitgo: BitGoBase, params: RecoverParams): Promise<BackupKeyRecoveryTransansaction | FormattedOfflineVaultTxInfo>;
export interface BitGoV1Unspent {
tx_hash: string;
tx_output_n: number;
value: number;
}
export interface V1SweepParams {
walletId: string;
walletPassphrase: string;
unspents: BitGoV1Unspent[];
recoveryDestination: string;
userKey: string;
otp: string;
}
export interface V1RecoverParams extends Omit<V1SweepParams, 'otp'> {
backupKey: string;
}
export declare function v1BackupKeyRecovery(coin: AbstractUtxoCoin, bitgo: BitGoBase, params: V1RecoverParams): Promise<string>;
export declare function v1Sweep(coin: AbstractUtxoCoin, bitgo: BitGoBase, params: V1SweepParams): Promise<{
tx: string;
hash: string;
status: string;
}>;
export {};
//# sourceMappingURL=backupKeyRecovery.d.ts.mapВыполнить команду
Для локальной разработки. Не используйте в интернете!