Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More

@bitgo/abstract-utxo

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bitgo/abstract-utxo - npm Package Compare versions

Comparing version 8.8.1 to 8.9.0

@@ -6,2 +6,9 @@ # Change Log

# [8.9.0](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-utxo@8.8.1...@bitgo/abstract-utxo@8.9.0) (2024-07-02)
### Features
- add `sweep` function for v1 wallets ([a78e2cf](https://github.com/BitGo/BitGoJS/commit/a78e2cfaec23d3a1d129b757e0bcba76ce12addf))
- export `BitGoV1Unspent` interface from `abstract-utxo` ([c6d9e63](https://github.com/BitGo/BitGoJS/commit/c6d9e63dde2404f6250a138a049dadc7a408328a))
## [8.8.1](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-utxo@8.8.0...@bitgo/abstract-utxo@8.8.1) (2024-06-27)

@@ -8,0 +15,0 @@

@@ -7,3 +7,3 @@ /// <reference types="node" />

import { bitgo } from '@bitgo/utxo-lib';
import { CrossChainRecoverySigned, CrossChainRecoveryUnsigned, RecoveryProvider, backupKeyRecovery, RecoverParams, V1RecoverParams, v1BackupKeyRecovery } from './recovery';
import { CrossChainRecoverySigned, CrossChainRecoveryUnsigned, RecoveryProvider, backupKeyRecovery, RecoverParams, V1RecoverParams, v1BackupKeyRecovery, V1SweepParams, v1Sweep } from './recovery';
import { AddressCoinSpecific, BaseCoin, BitGoBase, ExtraPrebuildParamsOptions, HalfSignedUtxoTransaction, IBaseCoin, IRequestTracer, ITransactionExplanation as BaseTransactionExplanation, Keychain, KeychainsTriplet, ParsedTransaction as BaseParsedTransaction, ParseTransactionOptions as BaseParseTransactionOptions, PrecreateBitGoOptions, PresignTransactionOptions, RequestTracer, SignedTransaction, SignTransactionOptions as BaseSignTransactionOptions, SupplementGenerateWalletOptions, TransactionParams as BaseTransactionParams, TransactionPrebuild as BaseTransactionPrebuild, Triple, VerificationOptions, VerifyAddressOptions as BaseVerifyAddressOptions, VerifyTransactionOptions as BaseVerifyTransactionOptions, Wallet, WalletData } from '@bitgo/sdk-core';

@@ -454,2 +454,3 @@ import { CustomChangeOptions } from './parseOutput';

recoverV1(params: V1RecoverParams): ReturnType<typeof v1BackupKeyRecovery>;
sweepV1(params: V1SweepParams): ReturnType<typeof v1Sweep>;
/**

@@ -456,0 +457,0 @@ * Recover coin that was sent to wrong chain

@@ -68,8 +68,8 @@ /**

export declare function backupKeyRecovery(coin: AbstractUtxoCoin, bitgo: BitGoBase, params: RecoverParams): Promise<BackupKeyRecoveryTransansaction | FormattedOfflineVaultTxInfo>;
interface BitGoV1Unspent {
value: number;
export interface BitGoV1Unspent {
tx_hash: string;
tx_output_n: number;
value: number;
}
export interface V1RecoverParams {
export interface V1SweepParams {
walletId: string;

@@ -80,6 +80,14 @@ walletPassphrase: 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

@@ -6,3 +6,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.v1BackupKeyRecovery = exports.backupKeyRecovery = void 0;
exports.v1Sweep = exports.v1BackupKeyRecovery = exports.backupKeyRecovery = void 0;
const assert = require("assert");

@@ -319,2 +319,18 @@ const _ = require("lodash");

exports.v1BackupKeyRecovery = v1BackupKeyRecovery;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFja3VwS2V5UmVjb3ZlcnkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvcmVjb3ZlcnkvYmFja3VwS2V5UmVjb3ZlcnkudHMiXS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ICAgICAgICAgICAgIGNvbnN0IHR4ID0gY29pbi5jcmVhdGVUcmFuc2FjdGlvbkZyb21IZXg8YmlnaW50Pih0eEhleCk7XG4gICAgICAgICAgICAgICAgdmFsID0gdHgub3V0c1t2b3V0XS52YWx1ZTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gdGhlIGFwaSBtYXkgcmV0dXJuIGNhc2hhZGRyJ3MgaW5zdGVhZCBvZiBsZWdhY3kgZm9yIEJDSCBhbmQgQkNIQVxuICAgICAgICAgICAgLy8gZG93bnN0cmVhbSBwcm9jZXNzZXMncyBvbmx5IGV4cGVjdCBsZWdhY3kgYWRkcmVzc2VzXG4gICAgICAgICAgICB1ID0geyAuLi51LCBhZGRyZXNzOiBjb2luLmNhbm9uaWNhbEFkZHJlc3ModS5hZGRyZXNzKSB9O1xuICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgLi4udSxcbiAgICAgICAgICAgICAgdmFsdWU6IHZhbCxcbiAgICAgICAgICAgICAgY2hhaW46IGNoYWluLFxuICAgICAgICAgICAgICBpbmRleDogYWRkckluZGV4LFxuICAgICAgICAgICAgICBwcmV2VHg6IGZldGNoUHJldlR4ID8gQnVmZmVyLmZyb20oYXdhaXQgZ2V0UHJldlR4KHR4aWQpLCAnaGV4JykgOiB1bmRlZmluZWQsXG4gICAgICAgICAgICB9IGFzIFdhbGxldFVuc3BlbnQ8YmlnaW50PjtcbiAgICAgICAgICB9KVxuICAgICAgICApO1xuXG4gICAgICAgIHdhbGxldFVuc3BlbnRzLnB1c2goLi4ucHJvY2Vzc2VkVW5zcGVudHMpO1xuICAgICAgfVxuICAgIH1cblxuICAgIGlmIChudW1TZXF1ZW50aWFsQWRkcmVzc2VzV2l0aG91dFR4cyA+PSBNQVhfU0VRVUVOVElBTF9BRERSRVNTRVNfV0lUSE9VVF9UWFMpIHtcbiAgICAgIC8vIHN0b3Agc2VhcmNoaW5nIGZvciBhZGRyZX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ryDestination) ||
!coin.isValidAddress(params.recoveryDestination, { anyFormat: true })) {
throw new Error('invalid recoveryDestination');
}
let recoveryFeePerByte = 100;
if (bitgo.env === 'prod') {
recoveryFeePerByte = await getRecoveryFeePerBytes(coin, { defaultValue: 100 });
}
const v1wallet = await bitgo.wallets().get({ id: params.walletId });
return await v1wallet.sweep({
...params,
feeRate: recoveryFeePerByte,
});
}
exports.v1Sweep = v1Sweep;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFja3VwS2V5UmVjb3ZlcnkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvcmVjb3ZlcnkvYmFja3VwS2V5UmVjb3ZlcnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBOztHQUVHOzs7QUFFSCxpQ0FBaUM7QUFDakMsNEJBQTRCO0FBQzVCLDJDQUEyQztBQUMzQyxNQUFNLEVBQUUsb0JBQW9CLEVBQUUsa0JBQWtCLEVBQUUsYUFBYSxFQUFFLG9CQUFvQixFQUFFLEdBQUcsT0FBTyxDQUFDLEtBQUssQ0FBQztBQVV4Ryw4Q0FBK0M7QUFFL0MsOENBU3lCO0FBR3pCLHlEQUErRDtBQUMvRCw2Q0FBMEM7QUFDMUMsaURBQThDO0FBQzlDLGtDQUE0QztBQUM1Qyw4Q0FBdUQ7QUFldkQ7Ozs7OztHQU1HO0FBQ0gsU0FBUyxxQkFBcUIsQ0FDNUIsUUFBZ0IsRUFDaEIsTUFBMEIsRUFDMUIsS0FBYTtJQUViLE9BQU87UUFDTCxLQUFLO1FBQ0wsTUFBTSxFQUFFO1lBQ04sUUFBUSxFQUFFLE1BQU0sQ0FBQyxNQUFNLENBQUMsR0FBRyxDQUFDLENBQUMsS0FBSyxFQUFFLEVBQUU7Z0JBQ3BDLE1BQU0sQ0FBQyxLQUFLLENBQUMsV0FBVyxDQUFDLENBQUM7Z0JBQzFCLE9BQU8sRU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MoKS5nZXQoeyBpZDogcGFyYW1zLndhbGxldElkIH0pO1xuICByZXR1cm4gYXdhaXQgdjF3YWxsZXQuc3dlZXAoe1xuICAgIC4uLnBhcmFtcyxcbiAgICBmZWVSYXRlOiByZWNvdmVyeUZlZVBlckJ5dGUsXG4gIH0pO1xufVxuIl19
{
"name": "@bitgo/abstract-utxo",
"version": "8.8.1",
"version": "8.9.0",
"description": "BitGo SDK coin library for UTXO base implementation",

@@ -41,4 +41,4 @@ "main": "./dist/src/index.js",

"@bitgo/blockapis": "^1.9.6",
"@bitgo/sdk-api": "^1.49.4",
"@bitgo/sdk-core": "^27.3.0",
"@bitgo/sdk-api": "^1.50.0",
"@bitgo/sdk-core": "^27.4.0",
"@bitgo/unspents": "^0.47.5",

@@ -56,3 +56,3 @@ "@bitgo/utxo-lib": "^9.39.0",

},
"gitHead": "95350d12285ba6c557fe3bcfd4ad4152a3e43099"
"gitHead": "3f13fab148c446f7e47d95775c4f9076e9793384"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet