Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions modules/abstract-utxo/src/abstractUtxoCoin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ import {
V1RecoverParams,
v1Sweep,
V1SweepParams,
} from './recovery';
import { getReplayProtectionPubkeys, isReplayProtectionUnspent } from './transaction/fixedScript/replayProtection';
import { supportedCrossChainRecoveries } from './config';
} from './recovery/index.js';
import { getReplayProtectionPubkeys, isReplayProtectionUnspent } from './transaction/fixedScript/replayProtection.js';
import { supportedCrossChainRecoveries } from './config.js';
import {
assertValidTransactionRecipient,
DecodedTransaction,
Expand All @@ -66,15 +66,15 @@ import {
isScriptRecipient,
parseTransaction,
verifyTransaction,
} from './transaction';
import type { TransactionExplanation } from './transaction/fixedScript/explainTransaction';
import { Musig2Participant } from './transaction/fixedScript/musig2';
} from './transaction/index.js';
import type { TransactionExplanation } from './transaction/fixedScript/explainTransaction.js';
import { Musig2Participant } from './transaction/fixedScript/musig2.js';
import {
AggregateValidationError,
ErrorMissingOutputs,
ErrorImplicitExternalOutputs,
} from './transaction/descriptor/verifyTransaction';
import { assertDescriptorWalletAddress, getDescriptorMapFromWallet, isDescriptorWallet } from './descriptor';
} from './transaction/descriptor/verifyTransaction.js';
import { assertDescriptorWalletAddress, getDescriptorMapFromWallet, isDescriptorWallet } from './descriptor/index.js';
import {
getFullNameFromCoinName,
getMainnetCoinName,
Expand All @@ -83,17 +83,17 @@ import {
isUtxoCoinNameMainnet,
UtxoCoinName,
UtxoCoinNameMainnet,
} from './names';
import { assertFixedScriptWalletAddress } from './address/fixedScript';
import { isSdkBackend, ParsedTransaction, SdkBackend } from './transaction/types';
import { decodePsbtWith, encodeTransaction, stringToBufferTryFormats } from './transaction/decode';
} from './names.js';
import { assertFixedScriptWalletAddress } from './address/fixedScript.js';
import { isSdkBackend, ParsedTransaction, SdkBackend } from './transaction/types.js';
import { decodePsbtWith, encodeTransaction, stringToBufferTryFormats } from './transaction/decode.js';
import { fetchKeychains, toBip32Triple, UtxoKeychain } from './keychains';
import { verifyKeySignature, verifyUserPublicKey } from './verifyKey';
import { getPolicyForEnv } from './descriptor/validatePolicy';
import { signTransaction } from './transaction/signTransaction';
import { isUtxoWalletData, UtxoWallet } from './wallet';
import { isDescriptorWalletData } from './descriptor/descriptorWallet';
import type { Unspent } from './unspent';
import { verifyKeySignature, verifyUserPublicKey } from './verifyKey.js';
import { getPolicyForEnv } from './descriptor/validatePolicy.js';
import { signTransaction } from './transaction/signTransaction.js';
import { isUtxoWalletData, UtxoWallet } from './wallet.js';
import { isDescriptorWalletData } from './descriptor/descriptorWallet.js';
import type { Unspent } from './unspent.js';

import ScriptType2Of3 = utxolib.bitgo.outputScripts.ScriptType2Of3;

Expand Down
1 change: 1 addition & 0 deletions modules/abstract-utxo/src/address/Untitled
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
find src -name "*.ts" | xargs grep -l "from '\.\.\|from \"\." | wc -l
2 changes: 1 addition & 1 deletion modules/abstract-utxo/src/address/fixedScript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
} from '@bitgo/sdk-core';
import { fixedScriptWallet } from '@bitgo/wasm-utxo';

import { UtxoCoinName } from '../names';
import { UtxoCoinName } from '../names.js';

type ScriptType2Of3 = fixedScriptWallet.OutputScriptType;
type ChainCode = fixedScriptWallet.ChainCode;
Expand Down
2 changes: 1 addition & 1 deletion modules/abstract-utxo/src/address/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ export {
generateAddressWithChainAndIndex,
assertFixedScriptWalletAddress,
FixedScriptAddressCoinSpecific,
} from './fixedScript';
} from './fixedScript.js';
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import assert from 'assert';

import { Descriptor, address, descriptorWallet } from '@bitgo/wasm-utxo';

import { UtxoCoinSpecific, VerifyAddressOptions } from '../abstractUtxoCoin';
import { UtxoCoinName } from '../names';
import { UtxoCoinSpecific, VerifyAddressOptions } from '../abstractUtxoCoin.js';
import { UtxoCoinName } from '../names.js';

class DescriptorAddressMismatchError extends Error {
constructor(descriptor: Descriptor, index: number, derivedAddress: string, expectedAddress: string) {
Expand Down
4 changes: 2 additions & 2 deletions modules/abstract-utxo/src/descriptor/builder/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { getDescriptorFromBuilder, DescriptorBuilder } from './builder';
export { parseDescriptor } from './parse';
export { getDescriptorFromBuilder, DescriptorBuilder } from './builder.js';
export { parseDescriptor } from './parse.js';
2 changes: 1 addition & 1 deletion modules/abstract-utxo/src/descriptor/builder/parse.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { BIP32, bip32, Descriptor } from '@bitgo/wasm-utxo';

import { DescriptorBuilder, getDescriptorFromBuilder } from './builder';
import { DescriptorBuilder, getDescriptorFromBuilder } from './builder.js';

type NodeUnary<Key extends string> = { [k in Key]: unknown };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { BitGoAPI } from '@bitgo/sdk-api';
import { BIP32 } from '@bitgo/wasm-utxo';
import { Wallet } from '@bitgo/sdk-core';

import { AbstractUtxoCoin } from '../../abstractUtxoCoin';
import { IDescriptorWallet } from '../descriptorWallet';
import { NamedDescriptor } from '../NamedDescriptor';
import { AbstractUtxoCoin } from '../../abstractUtxoCoin.js';
import { IDescriptorWallet } from '../descriptorWallet.js';
import { NamedDescriptor } from '../NamedDescriptor.js';

import { DescriptorFromKeys } from './createDescriptors';
import { DescriptorFromKeys } from './createDescriptors.js';

export async function createDescriptorWallet(
bitgo: BitGoAPI,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { bip32 } from '@bitgo/wasm-utxo';

import { createNamedDescriptorWithSignature, NamedDescriptor } from '../NamedDescriptor';
import { getDescriptorFromBuilder, DescriptorBuilder } from '../builder';
import { createNamedDescriptorWithSignature, NamedDescriptor } from '../NamedDescriptor.js';
import { getDescriptorFromBuilder, DescriptorBuilder } from '../builder/index.js';

export type DescriptorFromKeys = (
userKey: bip32.BIP32Interface,
Expand Down
4 changes: 2 additions & 2 deletions modules/abstract-utxo/src/descriptor/createWallet/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './createDescriptors';
export * from './createDescriptorWallet';
export * from './createDescriptors.js';
export * from './createDescriptorWallet.js';
8 changes: 4 additions & 4 deletions modules/abstract-utxo/src/descriptor/descriptorWallet.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import * as t from 'io-ts';
import { IWallet, WalletCoinSpecific } from '@bitgo/sdk-core';

import { UtxoWallet, UtxoWalletData } from '../wallet';
import type { DescriptorMap } from '../wasmUtil';
import { UtxoWallet, UtxoWalletData } from '../wallet.js';
import type { DescriptorMap } from '../wasmUtil.js';

import { NamedDescriptor } from './NamedDescriptor';
import { DescriptorValidationPolicy, KeyTriple, toDescriptorMapValidate } from './validatePolicy';
import { NamedDescriptor } from './NamedDescriptor.js';
import { DescriptorValidationPolicy, KeyTriple, toDescriptorMapValidate } from './validatePolicy.js';

type DescriptorWalletCoinSpecific = {
descriptors: NamedDescriptor[];
Expand Down
12 changes: 6 additions & 6 deletions modules/abstract-utxo/src/descriptor/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
export { Miniscript, Descriptor } from '@bitgo/wasm-utxo';
export type { DescriptorMap } from '../wasmUtil';
export { assertDescriptorWalletAddress } from './assertDescriptorWalletAddress';
export type { DescriptorMap } from '../wasmUtil.js';
export { assertDescriptorWalletAddress } from './assertDescriptorWalletAddress.js';
export {
NamedDescriptor,
createNamedDescriptorWithSignature,
hasValidSignature,
NamedDescriptorNative,
toNamedDescriptorNative,
} from './NamedDescriptor';
export { isDescriptorWallet, getDescriptorMapFromWallet } from './descriptorWallet';
export { getPolicyForEnv } from './validatePolicy';
export * as createWallet from './createWallet';
} from './NamedDescriptor.js';
export { isDescriptorWallet, getDescriptorMapFromWallet } from './descriptorWallet.js';
export { getPolicyForEnv } from './validatePolicy.js';
export * as createWallet from './createWallet/index.js';
11 changes: 8 additions & 3 deletions modules/abstract-utxo/src/descriptor/validatePolicy.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import { EnvironmentName, Triple } from '@bitgo/sdk-core';
import { bip32, descriptorWallet } from '@bitgo/wasm-utxo';

import type { DescriptorMap } from '../wasmUtil';
import type { DescriptorMap } from '../wasmUtil.js';

import { parseDescriptor } from './builder';
import { hasValidSignature, NamedDescriptor, NamedDescriptorNative, toNamedDescriptorNative } from './NamedDescriptor';
import { parseDescriptor } from './builder/index.js';
import {
hasValidSignature,
NamedDescriptor,
NamedDescriptorNative,
toNamedDescriptorNative,
} from './NamedDescriptor.js';

export type KeyTriple = Triple<bip32.BIP32Interface>;

Expand Down
6 changes: 3 additions & 3 deletions modules/abstract-utxo/src/impl/bch/bch.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { BitGoBase } from '@bitgo/sdk-core';
import { address as wasmAddress } from '@bitgo/wasm-utxo';

import { AbstractUtxoCoin } from '../../abstractUtxoCoin';
import { UtxoCoinName } from '../../names';
import { isScriptRecipient } from '../../transaction';
import { AbstractUtxoCoin } from '../../abstractUtxoCoin.js';
import { UtxoCoinName } from '../../names.js';
import { isScriptRecipient } from '../../transaction/index.js';

export class Bch extends AbstractUtxoCoin {
readonly name: UtxoCoinName = 'bch';
Expand Down
4 changes: 2 additions & 2 deletions modules/abstract-utxo/src/impl/bch/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './bch';
export * from './tbch';
export * from './bch.js';
export * from './tbch.js';
4 changes: 2 additions & 2 deletions modules/abstract-utxo/src/impl/bch/tbch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
*/
import { BitGoBase } from '@bitgo/sdk-core';

import { UtxoCoinName } from '../../names';
import { UtxoCoinName } from '../../names.js';

import { Bch } from './bch';
import { Bch } from './bch.js';

export class Tbch extends Bch {
readonly name: UtxoCoinName = 'tbch';
Expand Down
4 changes: 2 additions & 2 deletions modules/abstract-utxo/src/impl/bcha/bcha.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BitGoBase } from '@bitgo/sdk-core';

import { Bch } from '../bch/bch';
import { UtxoCoinName } from '../../names';
import { Bch } from '../bch/bch.js';
import { UtxoCoinName } from '../../names.js';

export class Bcha extends Bch {
readonly name: UtxoCoinName = 'bcha';
Expand Down
4 changes: 2 additions & 2 deletions modules/abstract-utxo/src/impl/bcha/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './bcha';
export * from './tbcha';
export * from './bcha.js';
export * from './tbcha.js';
4 changes: 2 additions & 2 deletions modules/abstract-utxo/src/impl/bcha/tbcha.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
*/
import { BitGoBase } from '@bitgo/sdk-core';

import { UtxoCoinName } from '../../names';
import { UtxoCoinName } from '../../names.js';

import { Bcha } from './bcha';
import { Bcha } from './bcha.js';

export class Tbcha extends Bcha {
readonly name: UtxoCoinName = 'tbcha';
Expand Down
4 changes: 2 additions & 2 deletions modules/abstract-utxo/src/impl/bsv/bsv.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BitGoBase } from '@bitgo/sdk-core';

import { Bch } from '../bch/bch';
import { UtxoCoinName } from '../../names';
import { Bch } from '../bch/bch.js';
import { UtxoCoinName } from '../../names.js';

export class Bsv extends Bch {
readonly name: UtxoCoinName = 'bsv';
Expand Down
4 changes: 2 additions & 2 deletions modules/abstract-utxo/src/impl/bsv/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './bsv';
export * from './tbsv';
export * from './bsv.js';
export * from './tbsv.js';
4 changes: 2 additions & 2 deletions modules/abstract-utxo/src/impl/bsv/tbsv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
*/
import { BitGoBase } from '@bitgo/sdk-core';

import { UtxoCoinName } from '../../names';
import { UtxoCoinName } from '../../names.js';

import { Bsv } from './bsv';
import { Bsv } from './bsv.js';

export class Tbsv extends Bsv {
readonly name: UtxoCoinName = 'tbsv';
Expand Down
7 changes: 3 additions & 4 deletions modules/abstract-utxo/src/impl/btc/btc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ import {
Wallet,
} from '@bitgo/sdk-core';

import { AbstractUtxoCoin } from '../../abstractUtxoCoin';
import { UtxoCoinName } from '../../names';

import { InscriptionBuilder } from './inscriptionBuilder';
import { AbstractUtxoCoin } from '../../abstractUtxoCoin.js';
import { UtxoCoinName } from '../../names.js';

import { InscriptionBuilder } from './inscriptionBuilder.js';
export interface VerifyRecoveryTransactionOptions extends BaseVerifyRecoveryTransactionOptions {
transactionHex: string;
}
Expand Down
12 changes: 6 additions & 6 deletions modules/abstract-utxo/src/impl/btc/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export * from './btc';
export * from './tbtc';
export * from './tbtc4';
export * from './tbtcsig';
export * from './tbtcbgsig';
export * from './inscriptionBuilder';
export * from './btc.js';
export * from './tbtc.js';
export * from './tbtc4.js';
export * from './tbtcsig.js';
export * from './tbtcbgsig.js';
export * from './inscriptionBuilder.js';
6 changes: 3 additions & 3 deletions modules/abstract-utxo/src/impl/btc/inscriptionBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ import {
} from '@bitgo/utxo-ord';
import { BIP32, fixedScriptWallet } from '@bitgo/wasm-utxo';

import { AbstractUtxoCoin } from '../../abstractUtxoCoin';
import { fetchKeychains } from '../../keychains';
import { toUtxolibBIP32 } from '../../wasmUtil';
import { AbstractUtxoCoin } from '../../abstractUtxoCoin.js';
import { fetchKeychains } from '../../keychains.js';
import { toUtxolibBIP32 } from '../../wasmUtil.js';

/** Key identifier for signing */
type SignerKey = 'user' | 'backup' | 'bitgo';
Expand Down
4 changes: 2 additions & 2 deletions modules/abstract-utxo/src/impl/btc/tbtc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
*/
import { BitGoBase } from '@bitgo/sdk-core';

import { UtxoCoinName } from '../../names';
import { UtxoCoinName } from '../../names.js';

import { Btc } from './btc';
import { Btc } from './btc.js';

export class Tbtc extends Btc {
readonly name: UtxoCoinName = 'tbtc';
Expand Down
4 changes: 2 additions & 2 deletions modules/abstract-utxo/src/impl/btc/tbtc4.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
*/
import { BitGoBase } from '@bitgo/sdk-core';

import { UtxoCoinName } from '../../names';
import { UtxoCoinName } from '../../names.js';

import { Btc } from './btc';
import { Btc } from './btc.js';

export class Tbtc4 extends Btc {
readonly name: UtxoCoinName = 'tbtc4';
Expand Down
4 changes: 2 additions & 2 deletions modules/abstract-utxo/src/impl/btc/tbtcbgsig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
*/
import { BitGoBase } from '@bitgo/sdk-core';

import { UtxoCoinName } from '../../names';
import { UtxoCoinName } from '../../names.js';

import { Btc } from './btc';
import { Btc } from './btc.js';

export class Tbtcbgsig extends Btc {
readonly name: UtxoCoinName = 'tbtcbgsig';
Expand Down
4 changes: 2 additions & 2 deletions modules/abstract-utxo/src/impl/btc/tbtcsig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
*/
import { BitGoBase } from '@bitgo/sdk-core';

import { UtxoCoinName } from '../../names';
import { UtxoCoinName } from '../../names.js';

import { Btc } from './btc';
import { Btc } from './btc.js';

export class Tbtcsig extends Btc {
readonly name: UtxoCoinName = 'tbtcsig';
Expand Down
4 changes: 2 additions & 2 deletions modules/abstract-utxo/src/impl/btg/btg.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BitGoBase } from '@bitgo/sdk-core';

import { AbstractUtxoCoin } from '../../abstractUtxoCoin';
import { UtxoCoinName } from '../../names';
import { AbstractUtxoCoin } from '../../abstractUtxoCoin.js';
import { UtxoCoinName } from '../../names.js';

export class Btg extends AbstractUtxoCoin {
readonly name: UtxoCoinName = 'btg';
Expand Down
2 changes: 1 addition & 1 deletion modules/abstract-utxo/src/impl/btg/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './btg';
export * from './btg.js';
4 changes: 2 additions & 2 deletions modules/abstract-utxo/src/impl/dash/dash.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BitGoBase } from '@bitgo/sdk-core';

import { AbstractUtxoCoin } from '../../abstractUtxoCoin';
import { UtxoCoinName } from '../../names';
import { AbstractUtxoCoin } from '../../abstractUtxoCoin.js';
import { UtxoCoinName } from '../../names.js';

export class Dash extends AbstractUtxoCoin {
readonly name: UtxoCoinName = 'dash';
Expand Down
4 changes: 2 additions & 2 deletions modules/abstract-utxo/src/impl/dash/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './dash';
export * from './tdash';
export * from './dash.js';
export * from './tdash.js';
Loading
Loading