From a38f471a1cb9cb63fc4bf7361cc87f86ed4beb09 Mon Sep 17 00:00:00 2001 From: setbern Date: Fri, 20 Mar 2026 08:46:32 -0400 Subject: [PATCH 1/3] feat - add js file extension for proper import after build --- modules/abstract-utxo/src/abstractUtxoCoin.ts | 36 +++++++-------- modules/abstract-utxo/src/address/Untitled | 1 + .../abstract-utxo/src/address/fixedScript.ts | 2 +- modules/abstract-utxo/src/address/index.ts | 2 +- .../assertDescriptorWalletAddress.ts | 4 +- .../src/descriptor/builder/index.ts | 4 +- .../src/descriptor/builder/parse.ts | 2 +- .../createWallet/createDescriptorWallet.ts | 8 ++-- .../createWallet/createDescriptors.ts | 4 +- .../src/descriptor/createWallet/index.ts | 4 +- .../src/descriptor/descriptorWallet.ts | 8 ++-- modules/abstract-utxo/src/descriptor/index.ts | 12 ++--- .../src/descriptor/validatePolicy.ts | 11 +++-- modules/abstract-utxo/src/impl/bch/bch.ts | 6 +-- modules/abstract-utxo/src/impl/bch/index.ts | 4 +- modules/abstract-utxo/src/impl/bch/tbch.ts | 4 +- modules/abstract-utxo/src/impl/bcha/bcha.ts | 4 +- modules/abstract-utxo/src/impl/bcha/index.ts | 4 +- modules/abstract-utxo/src/impl/bcha/tbcha.ts | 4 +- modules/abstract-utxo/src/impl/bsv/bsv.ts | 4 +- modules/abstract-utxo/src/impl/bsv/index.ts | 4 +- modules/abstract-utxo/src/impl/bsv/tbsv.ts | 4 +- modules/abstract-utxo/src/impl/btc/btc.ts | 7 ++- modules/abstract-utxo/src/impl/btc/index.ts | 12 ++--- .../src/impl/btc/inscriptionBuilder.ts | 6 +-- modules/abstract-utxo/src/impl/btc/tbtc.ts | 4 +- modules/abstract-utxo/src/impl/btc/tbtc4.ts | 4 +- .../abstract-utxo/src/impl/btc/tbtcbgsig.ts | 4 +- modules/abstract-utxo/src/impl/btc/tbtcsig.ts | 4 +- modules/abstract-utxo/src/impl/btg/btg.ts | 4 +- modules/abstract-utxo/src/impl/btg/index.ts | 2 +- modules/abstract-utxo/src/impl/dash/dash.ts | 4 +- modules/abstract-utxo/src/impl/dash/index.ts | 4 +- modules/abstract-utxo/src/impl/dash/tdash.ts | 4 +- modules/abstract-utxo/src/impl/doge/doge.ts | 12 ++--- modules/abstract-utxo/src/impl/doge/index.ts | 4 +- modules/abstract-utxo/src/impl/doge/tdoge.ts | 4 +- modules/abstract-utxo/src/impl/index.ts | 18 ++++---- modules/abstract-utxo/src/impl/ltc/index.ts | 4 +- modules/abstract-utxo/src/impl/ltc/ltc.ts | 4 +- modules/abstract-utxo/src/impl/ltc/tltc.ts | 4 +- modules/abstract-utxo/src/impl/zec/index.ts | 4 +- modules/abstract-utxo/src/impl/zec/tzec.ts | 4 +- modules/abstract-utxo/src/impl/zec/zec.ts | 4 +- modules/abstract-utxo/src/index.ts | 44 +++++++++---------- modules/abstract-utxo/src/keychains.ts | 4 +- .../offlineVault/OfflineVaultHalfSigned.ts | 8 ++-- .../offlineVault/TransactionExplanation.ts | 6 +-- .../src/offlineVault/descriptor/index.ts | 2 +- .../offlineVault/descriptor/transaction.ts | 14 +++--- .../abstract-utxo/src/offlineVault/index.ts | 10 ++--- .../src/recovery/RecoveryProvider.ts | 4 +- .../src/recovery/backupKeyRecovery.ts | 24 +++++----- .../src/recovery/coingeckoApi.ts | 2 +- .../src/recovery/crossChainRecovery.ts | 18 ++++---- modules/abstract-utxo/src/recovery/index.ts | 12 ++--- .../abstract-utxo/src/recovery/mempoolApi.ts | 2 +- modules/abstract-utxo/src/recovery/psbt.ts | 2 +- .../abstract-utxo/src/transaction/decode.ts | 4 +- .../src/transaction/descriptor/explainPsbt.ts | 6 +-- .../src/transaction/descriptor/index.ts | 12 ++--- .../src/transaction/descriptor/parse.ts | 18 ++++---- .../descriptor/parseToAmountType.ts | 8 ++-- .../src/transaction/descriptor/signPsbt.ts | 2 +- .../descriptor/verifyTransaction.ts | 10 ++--- .../src/transaction/explainTransaction.ts | 20 ++++----- .../src/transaction/fetchInputs.ts | 4 +- .../transaction/fixedScript/SigningError.ts | 2 +- .../fixedScript/explainPsbtWasm.ts | 4 +- .../fixedScript/explainTransaction.ts | 16 +++---- .../src/transaction/fixedScript/index.ts | 18 ++++---- .../transaction/fixedScript/parseOutput.ts | 6 +-- .../fixedScript/parseTransaction.ts | 18 ++++---- .../fixedScript/replayProtection.ts | 2 +- .../fixedScript/signLegacyTransaction.ts | 10 ++--- .../fixedScript/signPsbtUtxolib.ts | 4 +- .../transaction/fixedScript/signPsbtWasm.ts | 6 +-- .../fixedScript/signTransaction.ts | 19 ++++---- .../fixedScript/verifyTransaction.ts | 8 ++-- .../transaction/getPayGoVerificationPubkey.ts | 2 +- .../abstract-utxo/src/transaction/index.ts | 16 +++---- .../src/transaction/parseTransaction.ts | 10 ++--- .../src/transaction/recipient.ts | 2 +- .../src/transaction/signTransaction.ts | 14 +++--- .../abstract-utxo/src/transaction/types.ts | 4 +- .../src/transaction/verifyTransaction.ts | 10 ++--- modules/abstract-utxo/src/verifyKey.ts | 6 +-- modules/abstract-utxo/src/wallet.ts | 2 +- .../test/unit/parseTransaction.ts | 8 ++-- .../transaction/descriptor/explainPsbt.ts | 6 +-- .../transaction/fixedScript/explainPsbt.ts | 6 +-- .../unit/transaction/fixedScript/parsePsbt.ts | 6 +-- modules/abstract-utxo/tsconfig.esm.json | 4 +- modules/utxo-core/src/bip322/index.ts | 8 ++-- modules/utxo-core/src/bip322/toSign.ts | 4 +- modules/utxo-core/src/bip322/verify.ts | 2 +- modules/utxo-core/src/bip65/index.ts | 2 +- modules/utxo-core/src/descriptor/Output.ts | 6 +-- .../utxo-core/src/descriptor/VirtualSize.ts | 4 +- modules/utxo-core/src/descriptor/index.ts | 18 ++++---- .../src/descriptor/psbt/createPsbt.ts | 8 ++-- .../src/descriptor/psbt/findDescriptors.ts | 2 +- .../utxo-core/src/descriptor/psbt/index.ts | 12 ++--- .../utxo-core/src/descriptor/psbt/parse.ts | 8 ++-- modules/utxo-core/src/index.ts | 18 ++++---- modules/utxo-core/src/paygo/index.ts | 4 +- modules/utxo-core/src/paygo/psbt/index.ts | 2 +- .../src/paygo/psbt/payGoAddressProof.ts | 6 +-- 108 files changed, 407 insertions(+), 399 deletions(-) create mode 100644 modules/abstract-utxo/src/address/Untitled diff --git a/modules/abstract-utxo/src/abstractUtxoCoin.ts b/modules/abstract-utxo/src/abstractUtxoCoin.ts index c1598ef1c6..6e42063535 100644 --- a/modules/abstract-utxo/src/abstractUtxoCoin.ts +++ b/modules/abstract-utxo/src/abstractUtxoCoin.ts @@ -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, @@ -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, @@ -82,17 +82,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; diff --git a/modules/abstract-utxo/src/address/Untitled b/modules/abstract-utxo/src/address/Untitled new file mode 100644 index 0000000000..580c19d129 --- /dev/null +++ b/modules/abstract-utxo/src/address/Untitled @@ -0,0 +1 @@ +find src -name "*.ts" | xargs grep -l "from '\.\.\|from \"\." | wc -l \ No newline at end of file diff --git a/modules/abstract-utxo/src/address/fixedScript.ts b/modules/abstract-utxo/src/address/fixedScript.ts index 6c77abbf9e..8876412695 100644 --- a/modules/abstract-utxo/src/address/fixedScript.ts +++ b/modules/abstract-utxo/src/address/fixedScript.ts @@ -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; diff --git a/modules/abstract-utxo/src/address/index.ts b/modules/abstract-utxo/src/address/index.ts index b4466837b6..f2d0719353 100644 --- a/modules/abstract-utxo/src/address/index.ts +++ b/modules/abstract-utxo/src/address/index.ts @@ -3,4 +3,4 @@ export { generateAddressWithChainAndIndex, assertFixedScriptWalletAddress, FixedScriptAddressCoinSpecific, -} from './fixedScript'; +} from './fixedScript.js'; diff --git a/modules/abstract-utxo/src/descriptor/assertDescriptorWalletAddress.ts b/modules/abstract-utxo/src/descriptor/assertDescriptorWalletAddress.ts index aefa7d3bc0..bb8ac795f1 100644 --- a/modules/abstract-utxo/src/descriptor/assertDescriptorWalletAddress.ts +++ b/modules/abstract-utxo/src/descriptor/assertDescriptorWalletAddress.ts @@ -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) { diff --git a/modules/abstract-utxo/src/descriptor/builder/index.ts b/modules/abstract-utxo/src/descriptor/builder/index.ts index fbe8b7e35d..5e0ef3d623 100644 --- a/modules/abstract-utxo/src/descriptor/builder/index.ts +++ b/modules/abstract-utxo/src/descriptor/builder/index.ts @@ -1,2 +1,2 @@ -export { getDescriptorFromBuilder, DescriptorBuilder } from './builder'; -export { parseDescriptor } from './parse'; +export { getDescriptorFromBuilder, DescriptorBuilder } from './builder.js'; +export { parseDescriptor } from './parse.js'; diff --git a/modules/abstract-utxo/src/descriptor/builder/parse.ts b/modules/abstract-utxo/src/descriptor/builder/parse.ts index 685b6ea354..1796b86ba2 100644 --- a/modules/abstract-utxo/src/descriptor/builder/parse.ts +++ b/modules/abstract-utxo/src/descriptor/builder/parse.ts @@ -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 = { [k in Key]: unknown }; diff --git a/modules/abstract-utxo/src/descriptor/createWallet/createDescriptorWallet.ts b/modules/abstract-utxo/src/descriptor/createWallet/createDescriptorWallet.ts index 211f374b1d..c023b491f9 100644 --- a/modules/abstract-utxo/src/descriptor/createWallet/createDescriptorWallet.ts +++ b/modules/abstract-utxo/src/descriptor/createWallet/createDescriptorWallet.ts @@ -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, diff --git a/modules/abstract-utxo/src/descriptor/createWallet/createDescriptors.ts b/modules/abstract-utxo/src/descriptor/createWallet/createDescriptors.ts index 8112e8abe1..0a52b1f0ce 100644 --- a/modules/abstract-utxo/src/descriptor/createWallet/createDescriptors.ts +++ b/modules/abstract-utxo/src/descriptor/createWallet/createDescriptors.ts @@ -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, diff --git a/modules/abstract-utxo/src/descriptor/createWallet/index.ts b/modules/abstract-utxo/src/descriptor/createWallet/index.ts index d801f636b3..4ecf591f2f 100644 --- a/modules/abstract-utxo/src/descriptor/createWallet/index.ts +++ b/modules/abstract-utxo/src/descriptor/createWallet/index.ts @@ -1,2 +1,2 @@ -export * from './createDescriptors'; -export * from './createDescriptorWallet'; +export * from './createDescriptors.js'; +export * from './createDescriptorWallet.js'; diff --git a/modules/abstract-utxo/src/descriptor/descriptorWallet.ts b/modules/abstract-utxo/src/descriptor/descriptorWallet.ts index 691c42e129..3b1ba8232d 100644 --- a/modules/abstract-utxo/src/descriptor/descriptorWallet.ts +++ b/modules/abstract-utxo/src/descriptor/descriptorWallet.ts @@ -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[]; diff --git a/modules/abstract-utxo/src/descriptor/index.ts b/modules/abstract-utxo/src/descriptor/index.ts index cf72b63e55..39a004fe77 100644 --- a/modules/abstract-utxo/src/descriptor/index.ts +++ b/modules/abstract-utxo/src/descriptor/index.ts @@ -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'; diff --git a/modules/abstract-utxo/src/descriptor/validatePolicy.ts b/modules/abstract-utxo/src/descriptor/validatePolicy.ts index 0df5f38bf6..4aece979ac 100644 --- a/modules/abstract-utxo/src/descriptor/validatePolicy.ts +++ b/modules/abstract-utxo/src/descriptor/validatePolicy.ts @@ -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; diff --git a/modules/abstract-utxo/src/impl/bch/bch.ts b/modules/abstract-utxo/src/impl/bch/bch.ts index 451d282ff0..86b789bc43 100644 --- a/modules/abstract-utxo/src/impl/bch/bch.ts +++ b/modules/abstract-utxo/src/impl/bch/bch.ts @@ -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'; diff --git a/modules/abstract-utxo/src/impl/bch/index.ts b/modules/abstract-utxo/src/impl/bch/index.ts index 86a13e87b1..1cbb8bdd7d 100644 --- a/modules/abstract-utxo/src/impl/bch/index.ts +++ b/modules/abstract-utxo/src/impl/bch/index.ts @@ -1,2 +1,2 @@ -export * from './bch'; -export * from './tbch'; +export * from './bch.js'; +export * from './tbch.js'; diff --git a/modules/abstract-utxo/src/impl/bch/tbch.ts b/modules/abstract-utxo/src/impl/bch/tbch.ts index a5988c4c41..3f35dd81ad 100644 --- a/modules/abstract-utxo/src/impl/bch/tbch.ts +++ b/modules/abstract-utxo/src/impl/bch/tbch.ts @@ -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'; diff --git a/modules/abstract-utxo/src/impl/bcha/bcha.ts b/modules/abstract-utxo/src/impl/bcha/bcha.ts index 7acb6c422c..ec13866b04 100644 --- a/modules/abstract-utxo/src/impl/bcha/bcha.ts +++ b/modules/abstract-utxo/src/impl/bcha/bcha.ts @@ -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'; diff --git a/modules/abstract-utxo/src/impl/bcha/index.ts b/modules/abstract-utxo/src/impl/bcha/index.ts index 8c227b6179..29d3f0f5d8 100644 --- a/modules/abstract-utxo/src/impl/bcha/index.ts +++ b/modules/abstract-utxo/src/impl/bcha/index.ts @@ -1,2 +1,2 @@ -export * from './bcha'; -export * from './tbcha'; +export * from './bcha.js'; +export * from './tbcha.js'; diff --git a/modules/abstract-utxo/src/impl/bcha/tbcha.ts b/modules/abstract-utxo/src/impl/bcha/tbcha.ts index 4df0bd1096..0785980931 100644 --- a/modules/abstract-utxo/src/impl/bcha/tbcha.ts +++ b/modules/abstract-utxo/src/impl/bcha/tbcha.ts @@ -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'; diff --git a/modules/abstract-utxo/src/impl/bsv/bsv.ts b/modules/abstract-utxo/src/impl/bsv/bsv.ts index c2e9210e6d..affcb98e60 100644 --- a/modules/abstract-utxo/src/impl/bsv/bsv.ts +++ b/modules/abstract-utxo/src/impl/bsv/bsv.ts @@ -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'; diff --git a/modules/abstract-utxo/src/impl/bsv/index.ts b/modules/abstract-utxo/src/impl/bsv/index.ts index 4706c5bdfc..b74d11c692 100644 --- a/modules/abstract-utxo/src/impl/bsv/index.ts +++ b/modules/abstract-utxo/src/impl/bsv/index.ts @@ -1,2 +1,2 @@ -export * from './bsv'; -export * from './tbsv'; +export * from './bsv.js'; +export * from './tbsv.js'; diff --git a/modules/abstract-utxo/src/impl/bsv/tbsv.ts b/modules/abstract-utxo/src/impl/bsv/tbsv.ts index 49b3533204..dde3651d37 100644 --- a/modules/abstract-utxo/src/impl/bsv/tbsv.ts +++ b/modules/abstract-utxo/src/impl/bsv/tbsv.ts @@ -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'; diff --git a/modules/abstract-utxo/src/impl/btc/btc.ts b/modules/abstract-utxo/src/impl/btc/btc.ts index d1f5f2c574..af5f5d9633 100644 --- a/modules/abstract-utxo/src/impl/btc/btc.ts +++ b/modules/abstract-utxo/src/impl/btc/btc.ts @@ -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; } diff --git a/modules/abstract-utxo/src/impl/btc/index.ts b/modules/abstract-utxo/src/impl/btc/index.ts index 8e439d2dd0..64e26d8754 100644 --- a/modules/abstract-utxo/src/impl/btc/index.ts +++ b/modules/abstract-utxo/src/impl/btc/index.ts @@ -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'; diff --git a/modules/abstract-utxo/src/impl/btc/inscriptionBuilder.ts b/modules/abstract-utxo/src/impl/btc/inscriptionBuilder.ts index cfb4332773..c919b26507 100644 --- a/modules/abstract-utxo/src/impl/btc/inscriptionBuilder.ts +++ b/modules/abstract-utxo/src/impl/btc/inscriptionBuilder.ts @@ -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'; diff --git a/modules/abstract-utxo/src/impl/btc/tbtc.ts b/modules/abstract-utxo/src/impl/btc/tbtc.ts index 93bb881376..3f425c0848 100644 --- a/modules/abstract-utxo/src/impl/btc/tbtc.ts +++ b/modules/abstract-utxo/src/impl/btc/tbtc.ts @@ -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'; diff --git a/modules/abstract-utxo/src/impl/btc/tbtc4.ts b/modules/abstract-utxo/src/impl/btc/tbtc4.ts index 25407452b8..0b689b8d9b 100644 --- a/modules/abstract-utxo/src/impl/btc/tbtc4.ts +++ b/modules/abstract-utxo/src/impl/btc/tbtc4.ts @@ -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'; diff --git a/modules/abstract-utxo/src/impl/btc/tbtcbgsig.ts b/modules/abstract-utxo/src/impl/btc/tbtcbgsig.ts index e1d8810a9c..ee93b7c35c 100644 --- a/modules/abstract-utxo/src/impl/btc/tbtcbgsig.ts +++ b/modules/abstract-utxo/src/impl/btc/tbtcbgsig.ts @@ -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'; diff --git a/modules/abstract-utxo/src/impl/btc/tbtcsig.ts b/modules/abstract-utxo/src/impl/btc/tbtcsig.ts index 2f1e466a88..0a47ebfe1e 100644 --- a/modules/abstract-utxo/src/impl/btc/tbtcsig.ts +++ b/modules/abstract-utxo/src/impl/btc/tbtcsig.ts @@ -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'; diff --git a/modules/abstract-utxo/src/impl/btg/btg.ts b/modules/abstract-utxo/src/impl/btg/btg.ts index 9b552ce023..0de3d5fbbc 100644 --- a/modules/abstract-utxo/src/impl/btg/btg.ts +++ b/modules/abstract-utxo/src/impl/btg/btg.ts @@ -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'; diff --git a/modules/abstract-utxo/src/impl/btg/index.ts b/modules/abstract-utxo/src/impl/btg/index.ts index 5678fe9a24..928ab43f4f 100644 --- a/modules/abstract-utxo/src/impl/btg/index.ts +++ b/modules/abstract-utxo/src/impl/btg/index.ts @@ -1 +1 @@ -export * from './btg'; +export * from './btg.js'; diff --git a/modules/abstract-utxo/src/impl/dash/dash.ts b/modules/abstract-utxo/src/impl/dash/dash.ts index f1b374f9f0..407a24696d 100644 --- a/modules/abstract-utxo/src/impl/dash/dash.ts +++ b/modules/abstract-utxo/src/impl/dash/dash.ts @@ -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'; diff --git a/modules/abstract-utxo/src/impl/dash/index.ts b/modules/abstract-utxo/src/impl/dash/index.ts index 8836717740..ed935cc121 100644 --- a/modules/abstract-utxo/src/impl/dash/index.ts +++ b/modules/abstract-utxo/src/impl/dash/index.ts @@ -1,2 +1,2 @@ -export * from './dash'; -export * from './tdash'; +export * from './dash.js'; +export * from './tdash.js'; diff --git a/modules/abstract-utxo/src/impl/dash/tdash.ts b/modules/abstract-utxo/src/impl/dash/tdash.ts index 93a379436a..b9928c28d9 100644 --- a/modules/abstract-utxo/src/impl/dash/tdash.ts +++ b/modules/abstract-utxo/src/impl/dash/tdash.ts @@ -3,9 +3,9 @@ */ import { BitGoBase } from '@bitgo/sdk-core'; -import { UtxoCoinName } from '../../names'; +import { UtxoCoinName } from '../../names.js'; -import { Dash } from './dash'; +import { Dash } from './dash.js'; export class Tdash extends Dash { readonly name: UtxoCoinName = 'tdash'; diff --git a/modules/abstract-utxo/src/impl/doge/doge.ts b/modules/abstract-utxo/src/impl/doge/doge.ts index 79fe2da15c..7a2506c9bb 100644 --- a/modules/abstract-utxo/src/impl/doge/doge.ts +++ b/modules/abstract-utxo/src/impl/doge/doge.ts @@ -10,12 +10,12 @@ import { RecoverFromWrongChainOptions, TransactionInfo, TransactionPrebuild, -} from '../../abstractUtxoCoin'; -import { UtxoCoinName } from '../../names'; -import { ParsedTransaction } from '../../transaction/types'; -import type { TransactionExplanation } from '../../transaction/fixedScript/explainTransaction'; -import type { CrossChainRecoverySigned, CrossChainRecoveryUnsigned } from '../../recovery/crossChainRecovery'; -import type { Unspent } from '../../unspent'; +} from '../../abstractUtxoCoin.js'; +import { UtxoCoinName } from '../../names.js'; +import { ParsedTransaction } from '../../transaction/types.js'; +import type { TransactionExplanation } from '../../transaction/fixedScript/explainTransaction.js'; +import type { CrossChainRecoverySigned, CrossChainRecoveryUnsigned } from '../../recovery/crossChainRecovery.js'; +import type { Unspent } from '../../unspent.js'; type UnspentJSON = Unspent & { valueString: string }; type TransactionInfoJSON = TransactionInfo & { unspents: UnspentJSON[] }; diff --git a/modules/abstract-utxo/src/impl/doge/index.ts b/modules/abstract-utxo/src/impl/doge/index.ts index e97b501d31..09d0ca274e 100644 --- a/modules/abstract-utxo/src/impl/doge/index.ts +++ b/modules/abstract-utxo/src/impl/doge/index.ts @@ -1,2 +1,2 @@ -export * from './doge'; -export * from './tdoge'; +export * from './doge.js'; +export * from './tdoge.js'; diff --git a/modules/abstract-utxo/src/impl/doge/tdoge.ts b/modules/abstract-utxo/src/impl/doge/tdoge.ts index 5fbb8d223c..6af10818b3 100644 --- a/modules/abstract-utxo/src/impl/doge/tdoge.ts +++ b/modules/abstract-utxo/src/impl/doge/tdoge.ts @@ -3,9 +3,9 @@ */ import { BitGoBase } from '@bitgo/sdk-core'; -import { UtxoCoinName } from '../../names'; +import { UtxoCoinName } from '../../names.js'; -import { Doge } from './doge'; +import { Doge } from './doge.js'; export class Tdoge extends Doge { readonly name: UtxoCoinName = 'tdoge'; diff --git a/modules/abstract-utxo/src/impl/index.ts b/modules/abstract-utxo/src/impl/index.ts index 37d2099f35..e1e9ebeef6 100644 --- a/modules/abstract-utxo/src/impl/index.ts +++ b/modules/abstract-utxo/src/impl/index.ts @@ -1,9 +1,9 @@ -export * as btc from './btc'; -export * as bch from './bch'; -export * as bcha from './bcha'; -export * as bsv from './bsv'; -export * as btg from './btg'; -export * as ltc from './ltc'; -export * as dash from './dash'; -export * as doge from './doge'; -export * as zec from './zec'; +export * as btc from './btc/index.js'; +export * as bch from './bch/index.js'; +export * as bcha from './bcha/index.js'; +export * as bsv from './bsv/index.js'; +export * as btg from './btg/index.js'; +export * as ltc from './ltc/index.js'; +export * as dash from './dash/index.js'; +export * as doge from './doge/index.js'; +export * as zec from './zec/index.js'; diff --git a/modules/abstract-utxo/src/impl/ltc/index.ts b/modules/abstract-utxo/src/impl/ltc/index.ts index 986c2ec074..825d6701cb 100644 --- a/modules/abstract-utxo/src/impl/ltc/index.ts +++ b/modules/abstract-utxo/src/impl/ltc/index.ts @@ -1,2 +1,2 @@ -export * from './ltc'; -export * from './tltc'; +export * from './ltc.js'; +export * from './tltc.js'; diff --git a/modules/abstract-utxo/src/impl/ltc/ltc.ts b/modules/abstract-utxo/src/impl/ltc/ltc.ts index b068c5bae6..f5175da060 100644 --- a/modules/abstract-utxo/src/impl/ltc/ltc.ts +++ b/modules/abstract-utxo/src/impl/ltc/ltc.ts @@ -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 Ltc extends AbstractUtxoCoin { readonly name: UtxoCoinName = 'ltc'; diff --git a/modules/abstract-utxo/src/impl/ltc/tltc.ts b/modules/abstract-utxo/src/impl/ltc/tltc.ts index b21202d4f5..deeb4e8dbc 100644 --- a/modules/abstract-utxo/src/impl/ltc/tltc.ts +++ b/modules/abstract-utxo/src/impl/ltc/tltc.ts @@ -1,8 +1,8 @@ import { BitGoBase } from '@bitgo/sdk-core'; -import { UtxoCoinName } from '../../names'; +import { UtxoCoinName } from '../../names.js'; -import { Ltc } from './ltc'; +import { Ltc } from './ltc.js'; export class Tltc extends Ltc { readonly name: UtxoCoinName = 'tltc'; diff --git a/modules/abstract-utxo/src/impl/zec/index.ts b/modules/abstract-utxo/src/impl/zec/index.ts index 707e753101..c1c38fa43d 100644 --- a/modules/abstract-utxo/src/impl/zec/index.ts +++ b/modules/abstract-utxo/src/impl/zec/index.ts @@ -1,2 +1,2 @@ -export * from './zec'; -export * from './tzec'; +export * from './zec.js'; +export * from './tzec.js'; diff --git a/modules/abstract-utxo/src/impl/zec/tzec.ts b/modules/abstract-utxo/src/impl/zec/tzec.ts index dfc18d56b8..2e43468cca 100644 --- a/modules/abstract-utxo/src/impl/zec/tzec.ts +++ b/modules/abstract-utxo/src/impl/zec/tzec.ts @@ -1,8 +1,8 @@ import { BitGoBase } from '@bitgo/sdk-core'; -import { UtxoCoinName } from '../../names'; +import { UtxoCoinName } from '../../names.js'; -import { Zec } from './zec'; +import { Zec } from './zec.js'; export class Tzec extends Zec { readonly name: UtxoCoinName = 'tzec'; diff --git a/modules/abstract-utxo/src/impl/zec/zec.ts b/modules/abstract-utxo/src/impl/zec/zec.ts index 0ee1df3081..11b6bb28a9 100644 --- a/modules/abstract-utxo/src/impl/zec/zec.ts +++ b/modules/abstract-utxo/src/impl/zec/zec.ts @@ -3,8 +3,8 @@ */ 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 Zec extends AbstractUtxoCoin { readonly name: UtxoCoinName = 'zec'; diff --git a/modules/abstract-utxo/src/index.ts b/modules/abstract-utxo/src/index.ts index 7957ac614d..3a35dce192 100644 --- a/modules/abstract-utxo/src/index.ts +++ b/modules/abstract-utxo/src/index.ts @@ -1,25 +1,25 @@ -export * from './abstractUtxoCoin'; -export * from './address'; -export * from './config'; -export * from './names'; -export * from './recovery'; -export * from './transaction/fixedScript/replayProtection'; -export * from './transaction/fixedScript/signLegacyTransaction'; -export * from './unspent'; +export * from './abstractUtxoCoin.js'; +export * from './address/index.js'; +export * from './config.js'; +export * from './names.js'; +export * from './recovery/index.js'; +export * from './transaction/fixedScript/replayProtection.js'; +export * from './transaction/fixedScript/signLegacyTransaction.js'; +export * from './unspent.js'; -export { UtxoWallet } from './wallet'; -export * as descriptor from './descriptor'; -export * as offlineVault from './offlineVault'; -export * as transaction from './transaction'; -export * as impl from './impl'; +export { UtxoWallet } from './wallet.js'; +export * as descriptor from './descriptor/index.js'; +export * as offlineVault from './offlineVault/index.js'; +export * as transaction from './transaction/index.js'; +export * as impl from './impl/index.js'; // Export all coin implementations -export * from './impl/btc'; -export * from './impl/bch'; -export * from './impl/bcha'; -export * from './impl/bsv'; -export * from './impl/btg'; -export * from './impl/ltc'; -export * from './impl/dash'; -export * from './impl/doge'; -export * from './impl/zec'; +export * from './impl/btc/index.js'; +export * from './impl/bch/index.js'; +export * from './impl/bcha/index.js'; +export * from './impl/bsv/index.js'; +export * from './impl/btg/index.js'; +export * from './impl/ltc/index.js'; +export * from './impl/dash/index.js'; +export * from './impl/doge/index.js'; +export * from './impl/zec/index.js'; diff --git a/modules/abstract-utxo/src/keychains.ts b/modules/abstract-utxo/src/keychains.ts index 073b40a848..e673b5d70d 100644 --- a/modules/abstract-utxo/src/keychains.ts +++ b/modules/abstract-utxo/src/keychains.ts @@ -5,8 +5,8 @@ import { bitgo } from '@bitgo/utxo-lib'; import { IRequestTracer, IWallet, KeyIndices, promiseProps, Triple } from '@bitgo/sdk-core'; import { BIP32, bip32, fixedScriptWallet } from '@bitgo/wasm-utxo'; -import { AbstractUtxoCoin } from './abstractUtxoCoin'; -import { UtxoWallet } from './wallet'; +import { AbstractUtxoCoin } from './abstractUtxoCoin.js'; +import { UtxoWallet } from './wallet.js'; /* diff --git a/modules/abstract-utxo/src/offlineVault/OfflineVaultHalfSigned.ts b/modules/abstract-utxo/src/offlineVault/OfflineVaultHalfSigned.ts index 83ffccbcef..d20506c1a0 100644 --- a/modules/abstract-utxo/src/offlineVault/OfflineVaultHalfSigned.ts +++ b/modules/abstract-utxo/src/offlineVault/OfflineVaultHalfSigned.ts @@ -1,11 +1,11 @@ import { BIP32, bip32, Psbt } from '@bitgo/wasm-utxo'; import { BaseCoin } from '@bitgo/sdk-core'; -import { UtxoCoinName } from '../names'; -import { toUtxolibBIP32 } from '../wasmUtil'; +import { UtxoCoinName } from '../names.js'; +import { toUtxolibBIP32 } from '../wasmUtil.js'; -import { OfflineVaultSignable } from './OfflineVaultSignable'; -import { DescriptorTransaction, getHalfSignedPsbt } from './descriptor'; +import { OfflineVaultSignable } from './OfflineVaultSignable.js'; +import { DescriptorTransaction, getHalfSignedPsbt } from './descriptor/index.js'; export type OfflineVaultHalfSigned = { halfSigned: { txHex: string }; diff --git a/modules/abstract-utxo/src/offlineVault/TransactionExplanation.ts b/modules/abstract-utxo/src/offlineVault/TransactionExplanation.ts index 2b5daa4fb3..98e4fc5293 100644 --- a/modules/abstract-utxo/src/offlineVault/TransactionExplanation.ts +++ b/modules/abstract-utxo/src/offlineVault/TransactionExplanation.ts @@ -1,7 +1,7 @@ -import { UtxoCoinName } from '../names'; +import { UtxoCoinName } from '../names.js'; -import { OfflineVaultSignable } from './OfflineVaultSignable'; -import { DescriptorTransaction, getTransactionExplanationFromPsbt } from './descriptor'; +import { OfflineVaultSignable } from './OfflineVaultSignable.js'; +import { DescriptorTransaction, getTransactionExplanationFromPsbt } from './descriptor/index.js'; export interface ExplanationOutput { address: string; diff --git a/modules/abstract-utxo/src/offlineVault/descriptor/index.ts b/modules/abstract-utxo/src/offlineVault/descriptor/index.ts index e8f45da2db..b039dd3065 100644 --- a/modules/abstract-utxo/src/offlineVault/descriptor/index.ts +++ b/modules/abstract-utxo/src/offlineVault/descriptor/index.ts @@ -1 +1 @@ -export * from './transaction'; +export * from './transaction.js'; diff --git a/modules/abstract-utxo/src/offlineVault/descriptor/transaction.ts b/modules/abstract-utxo/src/offlineVault/descriptor/transaction.ts index ec54140c23..becebb5f06 100644 --- a/modules/abstract-utxo/src/offlineVault/descriptor/transaction.ts +++ b/modules/abstract-utxo/src/offlineVault/descriptor/transaction.ts @@ -1,18 +1,18 @@ import * as t from 'io-ts'; import { bip32, Psbt } from '@bitgo/wasm-utxo'; -import { DescriptorMap, NamedDescriptor } from '../../descriptor'; -import { OfflineVaultSignable, toKeyTriple } from '../OfflineVaultSignable'; +import { DescriptorMap, NamedDescriptor } from '../../descriptor/index.js'; +import { OfflineVaultSignable, toKeyTriple } from '../OfflineVaultSignable.js'; import { getValidatorOneOfTemplates, getValidatorSignedByUserKey, getValidatorSome, toDescriptorMapValidate, -} from '../../descriptor/validatePolicy'; -import { explainPsbt, signPsbt } from '../../transaction/descriptor'; -import { TransactionExplanation } from '../TransactionExplanation'; -import { UtxoCoinName } from '../../names'; -import { toWasmPsbt } from '../../wasmUtil'; +} from '../../descriptor/validatePolicy.js'; +import { explainPsbt, signPsbt } from '../../transaction/descriptor/index.js'; +import { TransactionExplanation } from '../TransactionExplanation.js'; +import { UtxoCoinName } from '../../names.js'; +import { toWasmPsbt } from '../../wasmUtil.js'; export const DescriptorTransaction = t.intersection( [OfflineVaultSignable, t.type({ descriptors: t.array(NamedDescriptor) })], diff --git a/modules/abstract-utxo/src/offlineVault/index.ts b/modules/abstract-utxo/src/offlineVault/index.ts index 0ab7c904fe..30de971486 100644 --- a/modules/abstract-utxo/src/offlineVault/index.ts +++ b/modules/abstract-utxo/src/offlineVault/index.ts @@ -1,5 +1,5 @@ -export * as descriptor from './descriptor'; -export * from './OfflineVaultHalfSigned'; -export { getTransactionExplanation } from './TransactionExplanation'; -export { TransactionExplanation } from './TransactionExplanation'; -export { ExplanationOutput } from './TransactionExplanation'; +export * as descriptor from './descriptor/index.js'; +export * from './OfflineVaultHalfSigned.js'; +export { getTransactionExplanation } from './TransactionExplanation.js'; +export { TransactionExplanation } from './TransactionExplanation.js'; +export { ExplanationOutput } from './TransactionExplanation.js'; diff --git a/modules/abstract-utxo/src/recovery/RecoveryProvider.ts b/modules/abstract-utxo/src/recovery/RecoveryProvider.ts index eb5bd3b127..77cd856440 100644 --- a/modules/abstract-utxo/src/recovery/RecoveryProvider.ts +++ b/modules/abstract-utxo/src/recovery/RecoveryProvider.ts @@ -1,8 +1,8 @@ import { BlockchairApi, AddressInfo, TransactionIO } from '@bitgo/blockapis'; -import type { Unspent } from '../unspent'; +import type { Unspent } from '../unspent.js'; -import { ApiNotImplementedError } from './baseApi'; +import { ApiNotImplementedError } from './baseApi.js'; /** * An account with bear minimum information required for recoveries. diff --git a/modules/abstract-utxo/src/recovery/backupKeyRecovery.ts b/modules/abstract-utxo/src/recovery/backupKeyRecovery.ts index 8c902d1401..ff3a970ab8 100644 --- a/modules/abstract-utxo/src/recovery/backupKeyRecovery.ts +++ b/modules/abstract-utxo/src/recovery/backupKeyRecovery.ts @@ -10,18 +10,18 @@ import { } from '@bitgo/sdk-core'; import { BIP32, fixedScriptWallet } from '@bitgo/wasm-utxo'; -import { AbstractUtxoCoin } from '../abstractUtxoCoin'; -import { signAndVerifyPsbt } from '../transaction/fixedScript/signTransaction'; -import { generateAddressWithChainAndIndex } from '../address'; -import { encodeTransaction } from '../transaction/decode'; -import { getReplayProtectionPubkeys } from '../transaction/fixedScript/replayProtection'; -import { getMainnetCoinName, UtxoCoinName } from '../names'; -import { parseOutputId, unspentSum, type WalletUnspent } from '../unspent'; - -import { forCoin, RecoveryProvider } from './RecoveryProvider'; -import { MempoolApi } from './mempoolApi'; -import { CoingeckoApi } from './coingeckoApi'; -import { createBackupKeyRecoveryPsbt, getRecoveryAmount } from './psbt'; +import { AbstractUtxoCoin } from '../abstractUtxoCoin.js'; +import { signAndVerifyPsbt } from '../transaction/fixedScript/signTransaction.js'; +import { generateAddressWithChainAndIndex } from '../address/index.js'; +import { encodeTransaction } from '../transaction/decode.js'; +import { getReplayProtectionPubkeys } from '../transaction/fixedScript/replayProtection.js'; +import { getMainnetCoinName, UtxoCoinName } from '../names.js'; +import { parseOutputId, unspentSum, type WalletUnspent } from '../unspent.js'; + +import { forCoin, RecoveryProvider } from './RecoveryProvider.js'; +import { MempoolApi } from './mempoolApi.js'; +import { CoingeckoApi } from './coingeckoApi.js'; +import { createBackupKeyRecoveryPsbt, getRecoveryAmount } from './psbt.js'; type ScriptType2Of3 = fixedScriptWallet.OutputScriptType; type ChainCode = fixedScriptWallet.ChainCode; diff --git a/modules/abstract-utxo/src/recovery/coingeckoApi.ts b/modules/abstract-utxo/src/recovery/coingeckoApi.ts index 768523859b..433735c84f 100644 --- a/modules/abstract-utxo/src/recovery/coingeckoApi.ts +++ b/modules/abstract-utxo/src/recovery/coingeckoApi.ts @@ -1,4 +1,4 @@ -import { BaseApi } from './baseApi'; +import { BaseApi } from './baseApi.js'; const familyNamesToCoinGeckoIds = new Map() .set('BTC', 'bitcoin') diff --git a/modules/abstract-utxo/src/recovery/crossChainRecovery.ts b/modules/abstract-utxo/src/recovery/crossChainRecovery.ts index eb27a2423d..8805f9a59e 100644 --- a/modules/abstract-utxo/src/recovery/crossChainRecovery.ts +++ b/modules/abstract-utxo/src/recovery/crossChainRecovery.ts @@ -2,15 +2,15 @@ import { BIP32, CoinName, fixedScriptWallet, address as wasmAddress } from '@bit import { BitGoBase, IWallet, Keychain, Triple, Wallet } from '@bitgo/sdk-core'; import { decrypt } from '@bitgo/sdk-api'; -import { AbstractUtxoCoin, TransactionInfo } from '../abstractUtxoCoin'; -import { signAndVerifyPsbt } from '../transaction/fixedScript/signTransaction'; -import { UtxoCoinName } from '../names'; -import { encodeTransaction } from '../transaction/decode'; -import { getReplayProtectionPubkeys } from '../transaction/fixedScript/replayProtection'; -import { toTNumber } from '../tnumber'; -import { unspentSum, type Unspent, type WalletUnspent } from '../unspent'; - -import { createEmptyWasmPsbt, addWalletInputsToWasmPsbt, addOutputToWasmPsbt, getRecoveryAmount } from './psbt'; +import { AbstractUtxoCoin, TransactionInfo } from '../abstractUtxoCoin.js'; +import { signAndVerifyPsbt } from '../transaction/fixedScript/signTransaction.js'; +import { UtxoCoinName } from '../names.js'; +import { encodeTransaction } from '../transaction/decode.js'; +import { getReplayProtectionPubkeys } from '../transaction/fixedScript/replayProtection.js'; +import { toTNumber } from '../tnumber.js'; +import { unspentSum, type Unspent, type WalletUnspent } from '../unspent.js'; + +import { createEmptyWasmPsbt, addWalletInputsToWasmPsbt, addOutputToWasmPsbt, getRecoveryAmount } from './psbt.js'; export interface BuildRecoveryTransactionOptions { wallet: string; diff --git a/modules/abstract-utxo/src/recovery/index.ts b/modules/abstract-utxo/src/recovery/index.ts index 206cfa8b19..f084747ba3 100644 --- a/modules/abstract-utxo/src/recovery/index.ts +++ b/modules/abstract-utxo/src/recovery/index.ts @@ -1,6 +1,6 @@ -export * from './RecoveryProvider'; -export * from './backupKeyRecovery'; -export * from './baseApi'; -export * from './coingeckoApi'; -export * from './crossChainRecovery'; -export * from './mempoolApi'; +export * from './RecoveryProvider.js'; +export * from './backupKeyRecovery.js'; +export * from './baseApi.js'; +export * from './coingeckoApi.js'; +export * from './crossChainRecovery.js'; +export * from './mempoolApi.js'; diff --git a/modules/abstract-utxo/src/recovery/mempoolApi.ts b/modules/abstract-utxo/src/recovery/mempoolApi.ts index 7b5b9ff64b..4f02dfb9a6 100644 --- a/modules/abstract-utxo/src/recovery/mempoolApi.ts +++ b/modules/abstract-utxo/src/recovery/mempoolApi.ts @@ -1,6 +1,6 @@ import _ from 'lodash'; -import { ApiNotImplementedError, BaseApi } from './baseApi'; +import { ApiNotImplementedError, BaseApi } from './baseApi.js'; export class MempoolApi extends BaseApi { static forCoin(coinName: string): MempoolApi { diff --git a/modules/abstract-utxo/src/recovery/psbt.ts b/modules/abstract-utxo/src/recovery/psbt.ts index 01b7247976..6f9b517b28 100644 --- a/modules/abstract-utxo/src/recovery/psbt.ts +++ b/modules/abstract-utxo/src/recovery/psbt.ts @@ -1,6 +1,6 @@ import { CoinName, fixedScriptWallet, address as wasmAddress } from '@bitgo/wasm-utxo'; -import { parseOutputId, unspentSum, type WalletUnspent } from '../unspent'; +import { parseOutputId, unspentSum, type WalletUnspent } from '../unspent.js'; /** * Check if a chain code is for a taproot script type diff --git a/modules/abstract-utxo/src/transaction/decode.ts b/modules/abstract-utxo/src/transaction/decode.ts index d985736f48..102c8bf656 100644 --- a/modules/abstract-utxo/src/transaction/decode.ts +++ b/modules/abstract-utxo/src/transaction/decode.ts @@ -1,9 +1,9 @@ import * as utxolib from '@bitgo/utxo-lib'; import { fixedScriptWallet, utxolibCompat } from '@bitgo/wasm-utxo'; -import { getNetworkFromCoinName, UtxoCoinName } from '../names'; +import { getNetworkFromCoinName, UtxoCoinName } from '../names.js'; -import { SdkBackend, BitGoPsbt } from './types'; +import { SdkBackend, BitGoPsbt } from './types.js'; type BufferEncoding = 'hex' | 'base64'; diff --git a/modules/abstract-utxo/src/transaction/descriptor/explainPsbt.ts b/modules/abstract-utxo/src/transaction/descriptor/explainPsbt.ts index fd68d897d3..9daf47cdac 100644 --- a/modules/abstract-utxo/src/transaction/descriptor/explainPsbt.ts +++ b/modules/abstract-utxo/src/transaction/descriptor/explainPsbt.ts @@ -1,9 +1,9 @@ import { ITransactionRecipient } from '@bitgo/sdk-core'; import { Psbt, descriptorWallet } from '@bitgo/wasm-utxo'; -import type { TransactionExplanationDescriptor } from '../fixedScript/explainTransaction'; -import { UtxoCoinName } from '../../names'; -import { sumValues } from '../../wasmUtil'; +import type { TransactionExplanationDescriptor } from '../fixedScript/explainTransaction.js'; +import { UtxoCoinName } from '../../names.js'; +import { sumValues } from '../../wasmUtil.js'; function toRecipient(output: descriptorWallet.ParsedOutput, coinName: UtxoCoinName): ITransactionRecipient { const address = output.address ?? `scriptPubKey:${Buffer.from(output.script).toString('hex')}`; diff --git a/modules/abstract-utxo/src/transaction/descriptor/index.ts b/modules/abstract-utxo/src/transaction/descriptor/index.ts index 7186ef1205..ba0576c47d 100644 --- a/modules/abstract-utxo/src/transaction/descriptor/index.ts +++ b/modules/abstract-utxo/src/transaction/descriptor/index.ts @@ -1,6 +1,6 @@ -export type { DescriptorMap } from '../../wasmUtil'; -export { explainPsbt } from './explainPsbt'; -export { parse } from './parse'; -export { parseToAmountType } from './parseToAmountType'; -export { verifyTransaction } from './verifyTransaction'; -export { signPsbt } from './signPsbt'; +export type { DescriptorMap } from '../../wasmUtil.js'; +export { explainPsbt } from './explainPsbt.js'; +export { parse } from './parse.js'; +export { parseToAmountType } from './parseToAmountType.js'; +export { verifyTransaction } from './verifyTransaction.js'; +export { signPsbt } from './signPsbt.js'; diff --git a/modules/abstract-utxo/src/transaction/descriptor/parse.ts b/modules/abstract-utxo/src/transaction/descriptor/parse.ts index ce3911e57f..44c479baff 100644 --- a/modules/abstract-utxo/src/transaction/descriptor/parse.ts +++ b/modules/abstract-utxo/src/transaction/descriptor/parse.ts @@ -1,15 +1,15 @@ import { ITransactionRecipient } from '@bitgo/sdk-core'; import { Psbt, descriptorWallet } from '@bitgo/wasm-utxo'; -import { AbstractUtxoCoin, ParseTransactionOptions } from '../../abstractUtxoCoin'; -import { BaseOutput, BaseParsedTransaction, BaseParsedTransactionOutputs } from '../types'; -import { getKeySignatures, toBip32Triple, UtxoNamedKeychains } from '../../keychains'; -import { getDescriptorMapFromWallet, getPolicyForEnv } from '../../descriptor'; -import { IDescriptorWallet } from '../../descriptor/descriptorWallet'; -import { fromExtendedAddressFormatToScript, toExtendedAddressFormat } from '../recipient'; -import { outputDifferencesWithExpected, OutputDifferenceWithExpected } from '../outputDifference'; -import { UtxoCoinName } from '../../names'; -import { sumValues, toWasmPsbt, UtxoLibPsbt } from '../../wasmUtil'; +import { AbstractUtxoCoin, ParseTransactionOptions } from '../../abstractUtxoCoin.js'; +import { BaseOutput, BaseParsedTransaction, BaseParsedTransactionOutputs } from '../types.js'; +import { getKeySignatures, toBip32Triple, UtxoNamedKeychains } from '../../keychains.js'; +import { getDescriptorMapFromWallet, getPolicyForEnv } from '../../descriptor/index.js'; +import { IDescriptorWallet } from '../../descriptor/descriptorWallet.js'; +import { fromExtendedAddressFormatToScript, toExtendedAddressFormat } from '../recipient.js'; +import { outputDifferencesWithExpected, OutputDifferenceWithExpected } from '../outputDifference.js'; +import { UtxoCoinName } from '../../names.js'; +import { sumValues, toWasmPsbt, UtxoLibPsbt } from '../../wasmUtil.js'; type ParsedOutput = Omit & { script: Buffer }; diff --git a/modules/abstract-utxo/src/transaction/descriptor/parseToAmountType.ts b/modules/abstract-utxo/src/transaction/descriptor/parseToAmountType.ts index 9ddac22ffb..c77f476c41 100644 --- a/modules/abstract-utxo/src/transaction/descriptor/parseToAmountType.ts +++ b/modules/abstract-utxo/src/transaction/descriptor/parseToAmountType.ts @@ -1,8 +1,8 @@ -import { AbstractUtxoCoin, ParseTransactionOptions } from '../../abstractUtxoCoin'; -import { BaseOutput, BaseParsedTransaction } from '../types'; -import { IDescriptorWallet } from '../../descriptor/descriptorWallet'; +import { AbstractUtxoCoin, ParseTransactionOptions } from '../../abstractUtxoCoin.js'; +import { BaseOutput, BaseParsedTransaction } from '../types.js'; +import { IDescriptorWallet } from '../../descriptor/descriptorWallet.js'; -import { parse, ParsedDescriptorTransaction } from './parse'; +import { parse, ParsedDescriptorTransaction } from './parse.js'; type AmountType = 'number' | 'bigint' | 'string'; diff --git a/modules/abstract-utxo/src/transaction/descriptor/signPsbt.ts b/modules/abstract-utxo/src/transaction/descriptor/signPsbt.ts index 9d067da376..f37c6568a2 100644 --- a/modules/abstract-utxo/src/transaction/descriptor/signPsbt.ts +++ b/modules/abstract-utxo/src/transaction/descriptor/signPsbt.ts @@ -1,6 +1,6 @@ import { Psbt, descriptorWallet } from '@bitgo/wasm-utxo'; -import type { SignerKey } from '../../wasmUtil'; +import type { SignerKey } from '../../wasmUtil.js'; export class ErrorUnknownInput extends Error { constructor(public vin: number) { diff --git a/modules/abstract-utxo/src/transaction/descriptor/verifyTransaction.ts b/modules/abstract-utxo/src/transaction/descriptor/verifyTransaction.ts index 699f915400..ba38b9fe2f 100644 --- a/modules/abstract-utxo/src/transaction/descriptor/verifyTransaction.ts +++ b/modules/abstract-utxo/src/transaction/descriptor/verifyTransaction.ts @@ -1,12 +1,12 @@ import { ITransactionRecipient, TxIntentMismatchError, IBaseCoin } from '@bitgo/sdk-core'; import type { Psbt, descriptorWallet } from '@bitgo/wasm-utxo'; -import { AbstractUtxoCoin, VerifyTransactionOptions } from '../../abstractUtxoCoin'; -import { BaseOutput, BaseParsedTransactionOutputs } from '../types'; -import { UtxoCoinName } from '../../names'; -import { toWasmPsbt, UtxoLibPsbt } from '../../wasmUtil'; +import { AbstractUtxoCoin, VerifyTransactionOptions } from '../../abstractUtxoCoin.js'; +import { BaseOutput, BaseParsedTransactionOutputs } from '../types.js'; +import { UtxoCoinName } from '../../names.js'; +import { toWasmPsbt, UtxoLibPsbt } from '../../wasmUtil.js'; -import { toBaseParsedTransactionOutputsFromPsbt } from './parse'; +import { toBaseParsedTransactionOutputsFromPsbt } from './parse.js'; export class ValidationError extends Error { constructor(message: string) { diff --git a/modules/abstract-utxo/src/transaction/explainTransaction.ts b/modules/abstract-utxo/src/transaction/explainTransaction.ts index 8546431f25..a05a64c70b 100644 --- a/modules/abstract-utxo/src/transaction/explainTransaction.ts +++ b/modules/abstract-utxo/src/transaction/explainTransaction.ts @@ -2,21 +2,21 @@ import * as utxolib from '@bitgo/utxo-lib'; import { fixedScriptWallet } from '@bitgo/wasm-utxo'; import { isTriple, IWallet, Triple } from '@bitgo/sdk-core'; -import { getDescriptorMapFromWallet, isDescriptorWallet } from '../descriptor'; -import { toBip32Triple } from '../keychains'; -import { getPolicyForEnv } from '../descriptor/validatePolicy'; -import { UtxoCoinName } from '../names'; -import type { Unspent } from '../unspent'; -import { toWasmPsbt } from '../wasmUtil'; +import { getDescriptorMapFromWallet, isDescriptorWallet } from '../descriptor/index.js'; +import { toBip32Triple } from '../keychains.js'; +import { getPolicyForEnv } from '../descriptor/validatePolicy.js'; +import { UtxoCoinName } from '../names.js'; +import type { Unspent } from '../unspent.js'; +import { toWasmPsbt } from '../wasmUtil.js'; -import { getReplayProtectionPubkeys } from './fixedScript/replayProtection'; +import { getReplayProtectionPubkeys } from './fixedScript/replayProtection.js'; import type { TransactionExplanationUtxolibLegacy, TransactionExplanationUtxolibPsbt, TransactionExplanationWasm, -} from './fixedScript/explainTransaction'; -import * as fixedScript from './fixedScript'; -import * as descriptor from './descriptor'; +} from './fixedScript/explainTransaction.js'; +import * as fixedScript from './fixedScript/index.js'; +import * as descriptor from './descriptor/index.js'; /** * Decompose a raw transaction into useful information, such as the total amounts, diff --git a/modules/abstract-utxo/src/transaction/fetchInputs.ts b/modules/abstract-utxo/src/transaction/fetchInputs.ts index 01459430a4..ff2ab9a5df 100644 --- a/modules/abstract-utxo/src/transaction/fetchInputs.ts +++ b/modules/abstract-utxo/src/transaction/fetchInputs.ts @@ -1,8 +1,8 @@ import * as utxolib from '@bitgo/utxo-lib'; import { BitGoBase, IRequestTracer } from '@bitgo/sdk-core'; -import { AbstractUtxoCoin, TransactionPrebuild } from '../abstractUtxoCoin'; -import { getNetworkFromCoinName, UtxoCoinName } from '../names'; +import { AbstractUtxoCoin, TransactionPrebuild } from '../abstractUtxoCoin.js'; +import { getNetworkFromCoinName, UtxoCoinName } from '../names.js'; /** * Get the inputs for a psbt from a prebuild. diff --git a/modules/abstract-utxo/src/transaction/fixedScript/SigningError.ts b/modules/abstract-utxo/src/transaction/fixedScript/SigningError.ts index a3e728c52e..6bd967fd11 100644 --- a/modules/abstract-utxo/src/transaction/fixedScript/SigningError.ts +++ b/modules/abstract-utxo/src/transaction/fixedScript/SigningError.ts @@ -1,4 +1,4 @@ -import type { Unspent } from '../../unspent'; +import type { Unspent } from '../../unspent.js'; export type PsbtParsedScriptType = | 'p2sh' diff --git a/modules/abstract-utxo/src/transaction/fixedScript/explainPsbtWasm.ts b/modules/abstract-utxo/src/transaction/fixedScript/explainPsbtWasm.ts index e2eec34bce..1a71f09727 100644 --- a/modules/abstract-utxo/src/transaction/fixedScript/explainPsbtWasm.ts +++ b/modules/abstract-utxo/src/transaction/fixedScript/explainPsbtWasm.ts @@ -1,9 +1,9 @@ import { fixedScriptWallet } from '@bitgo/wasm-utxo'; import { Triple } from '@bitgo/sdk-core'; -import type { FixedScriptWalletOutput, Output, BitGoPsbt } from '../types'; +import type { FixedScriptWalletOutput, Output, BitGoPsbt } from '../types.js'; -import type { TransactionExplanationWasm } from './explainTransaction'; +import type { TransactionExplanationWasm } from './explainTransaction.js'; function scriptToAddress(script: Uint8Array): string { return `scriptPubKey:${Buffer.from(script).toString('hex')}`; diff --git a/modules/abstract-utxo/src/transaction/fixedScript/explainTransaction.ts b/modules/abstract-utxo/src/transaction/fixedScript/explainTransaction.ts index 1698989e16..4cedfea460 100644 --- a/modules/abstract-utxo/src/transaction/fixedScript/explainTransaction.ts +++ b/modules/abstract-utxo/src/transaction/fixedScript/explainTransaction.ts @@ -5,14 +5,14 @@ import { ITransactionExplanation as BaseTransactionExplanation, Triple } from '@ import { BIP32 } from '@bitgo/wasm-utxo'; import * as utxocore from '@bitgo/utxo-core'; -import type { Bip322Message } from '../../abstractUtxoCoin'; -import type { Output, FixedScriptWalletOutput } from '../types'; -import type { Unspent } from '../../unspent'; -import { toExtendedAddressFormat } from '../recipient'; -import { getPayGoVerificationPubkey } from '../getPayGoVerificationPubkey'; -import { toBip32Triple } from '../../keychains'; -import { toUtxolibBIP32 } from '../../wasmUtil'; -import { getNetworkFromCoinName, UtxoCoinName } from '../../names'; +import type { Bip322Message } from '../../abstractUtxoCoin.js'; +import type { Output, FixedScriptWalletOutput } from '../types.js'; +import type { Unspent } from '../../unspent.js'; +import { toExtendedAddressFormat } from '../recipient.js'; +import { getPayGoVerificationPubkey } from '../getPayGoVerificationPubkey.js'; +import { toBip32Triple } from '../../keychains.js'; +import { toUtxolibBIP32 } from '../../wasmUtil.js'; +import { getNetworkFromCoinName, UtxoCoinName } from '../../names.js'; // ===== Transaction Explanation Type Definitions ===== diff --git a/modules/abstract-utxo/src/transaction/fixedScript/index.ts b/modules/abstract-utxo/src/transaction/fixedScript/index.ts index ee341fdcfc..deddd13e79 100644 --- a/modules/abstract-utxo/src/transaction/fixedScript/index.ts +++ b/modules/abstract-utxo/src/transaction/fixedScript/index.ts @@ -1,4 +1,4 @@ -export { explainPsbt, explainLegacyTx, ChangeAddressInfo } from './explainTransaction'; +export { explainPsbt, explainLegacyTx, ChangeAddressInfo } from './explainTransaction.js'; export { explainPsbtWasm, explainPsbtWasmBigInt, @@ -6,11 +6,11 @@ export { type ExplainedInput, type TransactionExplanationBigInt, type AggregatedTransactionExplanation, -} from './explainPsbtWasm'; -export { parseTransaction } from './parseTransaction'; -export { CustomChangeOptions } from './parseOutput'; -export { verifyTransaction } from './verifyTransaction'; -export { signTransaction } from './signTransaction'; -export * from './signLegacyTransaction'; -export * from './SigningError'; -export * from './replayProtection'; +} from './explainPsbtWasm.js'; +export { parseTransaction } from './parseTransaction.js'; +export { CustomChangeOptions } from './parseOutput.js'; +export { verifyTransaction } from './verifyTransaction.js'; +export { signTransaction } from './signTransaction.js'; +export * from './signLegacyTransaction.js'; +export * from './SigningError.js'; +export * from './replayProtection.js'; diff --git a/modules/abstract-utxo/src/transaction/fixedScript/parseOutput.ts b/modules/abstract-utxo/src/transaction/fixedScript/parseOutput.ts index c48fc2600a..b15f1db459 100644 --- a/modules/abstract-utxo/src/transaction/fixedScript/parseOutput.ts +++ b/modules/abstract-utxo/src/transaction/fixedScript/parseOutput.ts @@ -12,9 +12,9 @@ import { Triple, } from '@bitgo/sdk-core'; -import { AbstractUtxoCoin } from '../../abstractUtxoCoin'; -import { Output, FixedScriptWalletOutput } from '../types'; -import { fromExtendedAddressFormatToScript } from '../recipient'; +import { AbstractUtxoCoin } from '../../abstractUtxoCoin.js'; +import { Output, FixedScriptWalletOutput } from '../types.js'; +import { fromExtendedAddressFormatToScript } from '../recipient.js'; const debug = debugLib('bitgo:v2:parseoutput'); diff --git a/modules/abstract-utxo/src/transaction/fixedScript/parseTransaction.ts b/modules/abstract-utxo/src/transaction/fixedScript/parseTransaction.ts index f5ff447050..72be29e205 100644 --- a/modules/abstract-utxo/src/transaction/fixedScript/parseTransaction.ts +++ b/modules/abstract-utxo/src/transaction/fixedScript/parseTransaction.ts @@ -3,8 +3,8 @@ import assert from 'assert'; import _ from 'lodash'; import { ITransactionRecipient, KeyIndices, Triple, VerificationOptions, Wallet } from '@bitgo/sdk-core'; -import type { AbstractUtxoCoin, ParseTransactionOptions } from '../../abstractUtxoCoin'; -import type { FixedScriptWalletOutput, Output, ParsedTransaction } from '../types'; +import type { AbstractUtxoCoin, ParseTransactionOptions } from '../../abstractUtxoCoin.js'; +import type { FixedScriptWalletOutput, Output, ParsedTransaction } from '../types.js'; import { fetchKeychains, getKeySignatures, @@ -12,20 +12,20 @@ import { toXpubTriple, UtxoKeychain, UtxoNamedKeychains, -} from '../../keychains'; -import { verifyKeySignature } from '../../verifyKey'; +} from '../../keychains.js'; +import { verifyKeySignature } from '../../verifyKey.js'; import { assertValidTransactionRecipient, fromExtendedAddressFormatToScript, isScriptRecipient, toExtendedAddressFormat, toOutputScript, -} from '../recipient'; -import { ComparableOutput, ExpectedOutput, outputDifference } from '../outputDifference'; -import { toTNumber } from '../../tnumber'; +} from '../recipient.js'; +import { ComparableOutput, ExpectedOutput, outputDifference } from '../outputDifference.js'; +import { toTNumber } from '../../tnumber.js'; -import type { TransactionExplanation } from './explainTransaction'; -import { CustomChangeOptions, parseOutput } from './parseOutput'; +import type { TransactionExplanation } from './explainTransaction.js'; +import { CustomChangeOptions, parseOutput } from './parseOutput.js'; export type ComparableOutputWithExternal = (ComparableOutput | ExpectedOutput) & { external: boolean | undefined; diff --git a/modules/abstract-utxo/src/transaction/fixedScript/replayProtection.ts b/modules/abstract-utxo/src/transaction/fixedScript/replayProtection.ts index 81fecf0cac..8dfbf605e4 100644 --- a/modules/abstract-utxo/src/transaction/fixedScript/replayProtection.ts +++ b/modules/abstract-utxo/src/transaction/fixedScript/replayProtection.ts @@ -1,6 +1,6 @@ import { address, type AddressFormat } from '@bitgo/wasm-utxo'; -import { UtxoCoinName } from '../../names'; +import { UtxoCoinName } from '../../names.js'; export const pubkeyProd = Buffer.from('0255b9f71ac2c78fffd83e3e37b9e17ae70d5437b7f56d0ed2e93b7de08015aa59', 'hex'); diff --git a/modules/abstract-utxo/src/transaction/fixedScript/signLegacyTransaction.ts b/modules/abstract-utxo/src/transaction/fixedScript/signLegacyTransaction.ts index 95fcfae2a5..9c36989fef 100644 --- a/modules/abstract-utxo/src/transaction/fixedScript/signLegacyTransaction.ts +++ b/modules/abstract-utxo/src/transaction/fixedScript/signLegacyTransaction.ts @@ -6,12 +6,12 @@ import { isTriple, Triple } from '@bitgo/sdk-core'; import { BIP32, bip32 } from '@bitgo/wasm-utxo'; import debugLib from 'debug'; -import { UtxoCoinName } from '../../names'; -import type { Unspent, WalletUnspent } from '../../unspent'; -import { toUtxolibBIP32 } from '../../wasmUtil'; +import { UtxoCoinName } from '../../names.js'; +import type { Unspent, WalletUnspent } from '../../unspent.js'; +import { toUtxolibBIP32 } from '../../wasmUtil.js'; -import { getReplayProtectionAddresses } from './replayProtection'; -import { InputSigningError, TransactionSigningError } from './SigningError'; +import { getReplayProtectionAddresses } from './replayProtection.js'; +import { InputSigningError, TransactionSigningError } from './SigningError.js'; const debug = debugLib('bitgo:v2:utxo'); diff --git a/modules/abstract-utxo/src/transaction/fixedScript/signPsbtUtxolib.ts b/modules/abstract-utxo/src/transaction/fixedScript/signPsbtUtxolib.ts index 12bf626dd1..a2ecd1a6b7 100644 --- a/modules/abstract-utxo/src/transaction/fixedScript/signPsbtUtxolib.ts +++ b/modules/abstract-utxo/src/transaction/fixedScript/signPsbtUtxolib.ts @@ -4,8 +4,8 @@ import * as utxolib from '@bitgo/utxo-lib'; import { bitgo } from '@bitgo/utxo-lib'; import debugLib from 'debug'; -import { InputSigningError, TransactionSigningError } from './SigningError'; -import { Musig2Participant } from './musig2'; +import { InputSigningError, TransactionSigningError } from './SigningError.js'; +import { Musig2Participant } from './musig2.js'; const debug = debugLib('bitgo:v2:utxo'); diff --git a/modules/abstract-utxo/src/transaction/fixedScript/signPsbtWasm.ts b/modules/abstract-utxo/src/transaction/fixedScript/signPsbtWasm.ts index 98178803fe..98e3de01b0 100644 --- a/modules/abstract-utxo/src/transaction/fixedScript/signPsbtWasm.ts +++ b/modules/abstract-utxo/src/transaction/fixedScript/signPsbtWasm.ts @@ -2,10 +2,10 @@ import assert from 'assert'; import { BIP32, bip32, ECPair, fixedScriptWallet } from '@bitgo/wasm-utxo'; -import { toWasmBIP32 } from '../../wasmUtil'; +import { toWasmBIP32 } from '../../wasmUtil.js'; -import { BulkSigningError, InputSigningError, TransactionSigningError } from './SigningError'; -import { Musig2Participant } from './musig2'; +import { BulkSigningError, InputSigningError, TransactionSigningError } from './SigningError.js'; +import { Musig2Participant } from './musig2.js'; export type ReplayProtectionKeys = { publicKeys: (Uint8Array | ECPair)[]; diff --git a/modules/abstract-utxo/src/transaction/fixedScript/signTransaction.ts b/modules/abstract-utxo/src/transaction/fixedScript/signTransaction.ts index 4844733d88..3673953c2e 100644 --- a/modules/abstract-utxo/src/transaction/fixedScript/signTransaction.ts +++ b/modules/abstract-utxo/src/transaction/fixedScript/signTransaction.ts @@ -6,15 +6,18 @@ import { bitgo } from '@bitgo/utxo-lib'; import * as utxolib from '@bitgo/utxo-lib'; import { BIP32, bip32, fixedScriptWallet } from '@bitgo/wasm-utxo'; -import { UtxoCoinName } from '../../names'; -import type { Unspent } from '../../unspent'; -import { toUtxolibBIP32 } from '../../wasmUtil'; +import { UtxoCoinName } from '../../names.js'; +import type { Unspent } from '../../unspent.js'; +import { toUtxolibBIP32 } from '../../wasmUtil.js'; -import { Musig2Participant } from './musig2'; -import { signLegacyTransaction } from './signLegacyTransaction'; -import { signPsbtWithMusig2ParticipantUtxolib, signAndVerifyPsbt as signAndVerifyPsbtUtxolib } from './signPsbtUtxolib'; -import { signPsbtWithMusig2ParticipantWasm, signAndVerifyPsbtWasm, ReplayProtectionKeys } from './signPsbtWasm'; -import { getReplayProtectionPubkeys } from './replayProtection'; +import { Musig2Participant } from './musig2.js'; +import { signLegacyTransaction } from './signLegacyTransaction.js'; +import { + signPsbtWithMusig2ParticipantUtxolib, + signAndVerifyPsbt as signAndVerifyPsbtUtxolib, +} from './signPsbtUtxolib.js'; +import { signPsbtWithMusig2ParticipantWasm, signAndVerifyPsbtWasm, ReplayProtectionKeys } from './signPsbtWasm.js'; +import { getReplayProtectionPubkeys } from './replayProtection.js'; /** * Sign and verify a PSBT using either utxolib or wasm-utxo depending on the PSBT type. diff --git a/modules/abstract-utxo/src/transaction/fixedScript/verifyTransaction.ts b/modules/abstract-utxo/src/transaction/fixedScript/verifyTransaction.ts index d9dd99a2f1..0b22308aa4 100644 --- a/modules/abstract-utxo/src/transaction/fixedScript/verifyTransaction.ts +++ b/modules/abstract-utxo/src/transaction/fixedScript/verifyTransaction.ts @@ -4,10 +4,10 @@ import BigNumber from 'bignumber.js'; import { BitGoBase, TxIntentMismatchError, IBaseCoin } from '@bitgo/sdk-core'; import * as utxolib from '@bitgo/utxo-lib'; -import { AbstractUtxoCoin, VerifyTransactionOptions } from '../../abstractUtxoCoin'; -import { Output, ParsedTransaction } from '../types'; -import { verifyCustomChangeKeySignatures, verifyKeySignature, verifyUserPublicKey } from '../../verifyKey'; -import { getPsbtTxInputs, getTxInputs } from '../fetchInputs'; +import { AbstractUtxoCoin, VerifyTransactionOptions } from '../../abstractUtxoCoin.js'; +import { Output, ParsedTransaction } from '../types.js'; +import { verifyCustomChangeKeySignatures, verifyKeySignature, verifyUserPublicKey } from '../../verifyKey.js'; +import { getPsbtTxInputs, getTxInputs } from '../fetchInputs.js'; const debug = buildDebug('bitgo:abstract-utxo:verifyTransaction'); diff --git a/modules/abstract-utxo/src/transaction/getPayGoVerificationPubkey.ts b/modules/abstract-utxo/src/transaction/getPayGoVerificationPubkey.ts index 3de6396ac6..108e2e2a6e 100644 --- a/modules/abstract-utxo/src/transaction/getPayGoVerificationPubkey.ts +++ b/modules/abstract-utxo/src/transaction/getPayGoVerificationPubkey.ts @@ -1,4 +1,4 @@ -import { isTestnetCoin, UtxoCoinName } from '../names'; +import { isTestnetCoin, UtxoCoinName } from '../names.js'; const BITGOPAYGOATTESTATIONPUBKEY = 'xpub6BKRgmCPX5oQiJgJ6Vq6BF8tDvZhwQki5dVVQohckK2ZJXtxj8K6M9pavLwt9piW33hZz17SWmG8QWsjJ1tHdde2Fs5UA3DFbApCtbdaGKn'; diff --git a/modules/abstract-utxo/src/transaction/index.ts b/modules/abstract-utxo/src/transaction/index.ts index 788f3fe112..4b4f470f24 100644 --- a/modules/abstract-utxo/src/transaction/index.ts +++ b/modules/abstract-utxo/src/transaction/index.ts @@ -1,8 +1,8 @@ -export * from './types'; -export * from './recipient'; -export { explainTx } from './explainTransaction'; -export { parseTransaction } from './parseTransaction'; -export { verifyTransaction } from './verifyTransaction'; -export * from './fetchInputs'; -export * as bip322 from './bip322'; -export { decodePsbt, decodePsbtWith } from './decode'; +export * from './types.js'; +export * from './recipient.js'; +export { explainTx } from './explainTransaction.js'; +export { parseTransaction } from './parseTransaction.js'; +export { verifyTransaction } from './verifyTransaction.js'; +export * from './fetchInputs.js'; +export * as bip322 from './bip322.js'; +export { decodePsbt, decodePsbtWith } from './decode.js'; diff --git a/modules/abstract-utxo/src/transaction/parseTransaction.ts b/modules/abstract-utxo/src/transaction/parseTransaction.ts index d597b42a33..82233edf8a 100644 --- a/modules/abstract-utxo/src/transaction/parseTransaction.ts +++ b/modules/abstract-utxo/src/transaction/parseTransaction.ts @@ -1,9 +1,9 @@ -import { AbstractUtxoCoin, ParseTransactionOptions } from '../abstractUtxoCoin'; -import { isDescriptorWallet } from '../descriptor'; +import { AbstractUtxoCoin, ParseTransactionOptions } from '../abstractUtxoCoin.js'; +import { isDescriptorWallet } from '../descriptor/index.js'; -import { ParsedTransaction } from './types'; -import * as descriptor from './descriptor'; -import * as fixedScript from './fixedScript'; +import { ParsedTransaction } from './types.js'; +import * as descriptor from './descriptor/index.js'; +import * as fixedScript from './fixedScript/index.js'; export async function parseTransaction( coin: AbstractUtxoCoin, diff --git a/modules/abstract-utxo/src/transaction/recipient.ts b/modules/abstract-utxo/src/transaction/recipient.ts index 8dde2fbd43..a4fdbc10a9 100644 --- a/modules/abstract-utxo/src/transaction/recipient.ts +++ b/modules/abstract-utxo/src/transaction/recipient.ts @@ -1,6 +1,6 @@ import { address } from '@bitgo/wasm-utxo'; -import { UtxoCoinName } from '../names'; +import { UtxoCoinName } from '../names.js'; const ScriptRecipientPrefix = 'scriptPubKey:'; diff --git a/modules/abstract-utxo/src/transaction/signTransaction.ts b/modules/abstract-utxo/src/transaction/signTransaction.ts index 85f0f42313..bd30aa9bfb 100644 --- a/modules/abstract-utxo/src/transaction/signTransaction.ts +++ b/modules/abstract-utxo/src/transaction/signTransaction.ts @@ -3,14 +3,14 @@ import { BitGoBase } from '@bitgo/sdk-core'; import { BIP32, fixedScriptWallet } from '@bitgo/wasm-utxo'; import buildDebug from 'debug'; -import { AbstractUtxoCoin, SignTransactionOptions } from '../abstractUtxoCoin'; -import { getDescriptorMapFromWallet, getPolicyForEnv, isDescriptorWallet } from '../descriptor'; -import { fetchKeychains, toBip32Triple } from '../keychains'; -import { isUtxoLibPsbt, toWasmPsbt } from '../wasmUtil'; +import { AbstractUtxoCoin, SignTransactionOptions } from '../abstractUtxoCoin.js'; +import { getDescriptorMapFromWallet, getPolicyForEnv, isDescriptorWallet } from '../descriptor/index.js'; +import { fetchKeychains, toBip32Triple } from '../keychains.js'; +import { isUtxoLibPsbt, toWasmPsbt } from '../wasmUtil.js'; -import * as fixedScript from './fixedScript'; -import * as descriptor from './descriptor'; -import { decodePsbtWith, encodeTransaction } from './decode'; +import * as fixedScript from './fixedScript/index.js'; +import * as descriptor from './descriptor/index.js'; +import { decodePsbtWith, encodeTransaction } from './decode.js'; const debug = buildDebug('bitgo:abstract-utxo:transaction:signTransaction'); diff --git a/modules/abstract-utxo/src/transaction/types.ts b/modules/abstract-utxo/src/transaction/types.ts index 329acace5b..bebadfad4a 100644 --- a/modules/abstract-utxo/src/transaction/types.ts +++ b/modules/abstract-utxo/src/transaction/types.ts @@ -1,9 +1,9 @@ import * as utxolib from '@bitgo/utxo-lib'; import { fixedScriptWallet } from '@bitgo/wasm-utxo'; -import type { UtxoNamedKeychains } from '../keychains'; +import type { UtxoNamedKeychains } from '../keychains.js'; -import type { CustomChangeOptions } from './fixedScript'; +import type { CustomChangeOptions } from './fixedScript/index.js'; export type BitGoPsbt = fixedScriptWallet.BitGoPsbt; diff --git a/modules/abstract-utxo/src/transaction/verifyTransaction.ts b/modules/abstract-utxo/src/transaction/verifyTransaction.ts index bda9ac9404..6e3ea3683f 100644 --- a/modules/abstract-utxo/src/transaction/verifyTransaction.ts +++ b/modules/abstract-utxo/src/transaction/verifyTransaction.ts @@ -1,11 +1,11 @@ import { BitGoBase } from '@bitgo/sdk-core'; -import { AbstractUtxoCoin, VerifyTransactionOptions } from '../abstractUtxoCoin'; -import { getDescriptorMapFromWallet, isDescriptorWallet, getPolicyForEnv } from '../descriptor'; -import { fetchKeychains, toBip32Triple } from '../keychains'; +import { AbstractUtxoCoin, VerifyTransactionOptions } from '../abstractUtxoCoin.js'; +import { getDescriptorMapFromWallet, isDescriptorWallet, getPolicyForEnv } from '../descriptor/index.js'; +import { fetchKeychains, toBip32Triple } from '../keychains.js'; -import * as fixedScript from './fixedScript'; -import * as descriptor from './descriptor'; +import * as fixedScript from './fixedScript/index.js'; +import * as descriptor from './descriptor/index.js'; export async function verifyTransaction( coin: AbstractUtxoCoin, diff --git a/modules/abstract-utxo/src/verifyKey.ts b/modules/abstract-utxo/src/verifyKey.ts index 15dbbc1391..062dc52739 100644 --- a/modules/abstract-utxo/src/verifyKey.ts +++ b/modules/abstract-utxo/src/verifyKey.ts @@ -9,9 +9,9 @@ import buildDebug from 'debug'; import { BIP32, message } from '@bitgo/wasm-utxo'; import { BitGoBase, decryptKeychainPrivateKey, KeyIndices } from '@bitgo/sdk-core'; -import { VerifyKeySignaturesOptions, VerifyUserPublicKeyOptions } from './abstractUtxoCoin'; -import { ParsedTransaction } from './transaction/types'; -import { UtxoKeychain } from './keychains'; +import { VerifyKeySignaturesOptions, VerifyUserPublicKeyOptions } from './abstractUtxoCoin.js'; +import { ParsedTransaction } from './transaction/types.js'; +import { UtxoKeychain } from './keychains.js'; const debug = buildDebug('bitgo:abstract-utxo:verifyKey'); diff --git a/modules/abstract-utxo/src/wallet.ts b/modules/abstract-utxo/src/wallet.ts index 604f5acb9d..eb23b68fa2 100644 --- a/modules/abstract-utxo/src/wallet.ts +++ b/modules/abstract-utxo/src/wallet.ts @@ -1,6 +1,6 @@ import { Wallet, WalletData } from '@bitgo/sdk-core'; -import { isUtxoCoinName, UtxoCoinName } from './names'; +import { isUtxoCoinName, UtxoCoinName } from './names.js'; // parseTransactions' return type makes use of WalletData's type but with customChangeKeySignatures as required. export interface UtxoWalletData extends WalletData { diff --git a/modules/abstract-utxo/test/unit/parseTransaction.ts b/modules/abstract-utxo/test/unit/parseTransaction.ts index 510efec400..526880a419 100644 --- a/modules/abstract-utxo/test/unit/parseTransaction.ts +++ b/modules/abstract-utxo/test/unit/parseTransaction.ts @@ -3,11 +3,11 @@ import assert from 'assert'; import * as sinon from 'sinon'; import { Wallet, UnexpectedAddressError, VerificationOptions } from '@bitgo/sdk-core'; -import { UtxoWallet, TransactionParams } from '../../src'; -import { Output } from '../../src/transaction/types'; -import type { TransactionExplanation } from '../../src/transaction/fixedScript/explainTransaction'; +import { UtxoWallet, TransactionParams } from '../../src/index.js'; +import { Output } from '../../src/transaction/types.js'; +import type { TransactionExplanation } from '../../src/transaction/fixedScript/explainTransaction.js'; -import { getUtxoCoin } from './util'; +import { getUtxoCoin } from './util/index.js'; describe('Parse Transaction', function () { const coin = getUtxoCoin('tbtc'); diff --git a/modules/abstract-utxo/test/unit/transaction/descriptor/explainPsbt.ts b/modules/abstract-utxo/test/unit/transaction/descriptor/explainPsbt.ts index f5111bf134..1d1a1b89cd 100644 --- a/modules/abstract-utxo/test/unit/transaction/descriptor/explainPsbt.ts +++ b/modules/abstract-utxo/test/unit/transaction/descriptor/explainPsbt.ts @@ -3,10 +3,10 @@ import assert from 'assert'; import { descriptorWallet } from '@bitgo/wasm-utxo'; import * as testutils from '@bitgo/wasm-utxo/testutils'; -import type { TransactionExplanation } from '../../../../src/transaction/fixedScript/explainTransaction'; -import { explainPsbt } from '../../../../src/transaction/descriptor'; +import type { TransactionExplanation } from '../../../../src/transaction/fixedScript/explainTransaction.js'; +import { explainPsbt } from '../../../../src/transaction/descriptor/index.js'; -import { getFixtureRoot } from './fixtures.utils'; +import { getFixtureRoot } from './fixtures.utils.js'; const { getDescriptorMap, mockPsbtDefaultWithDescriptorTemplate } = testutils.descriptor; const { assertEqualFixture } = getFixtureRoot(__dirname + '/fixtures'); diff --git a/modules/abstract-utxo/test/unit/transaction/fixedScript/explainPsbt.ts b/modules/abstract-utxo/test/unit/transaction/fixedScript/explainPsbt.ts index cacbbe2d6c..e737d343d3 100644 --- a/modules/abstract-utxo/test/unit/transaction/fixedScript/explainPsbt.ts +++ b/modules/abstract-utxo/test/unit/transaction/fixedScript/explainPsbt.ts @@ -4,15 +4,15 @@ import * as utxolib from '@bitgo/utxo-lib'; import { testutil } from '@bitgo/utxo-lib'; import { fixedScriptWallet, Triple } from '@bitgo/wasm-utxo'; -import type { TransactionExplanation } from '../../../../src/transaction/fixedScript/explainTransaction'; +import type { TransactionExplanation } from '../../../../src/transaction/fixedScript/explainTransaction.js'; import { explainPsbt, explainPsbtWasm, explainPsbtWasmBigInt, aggregateTransactionExplanations, type TransactionExplanationBigInt, -} from '../../../../src/transaction/fixedScript'; -import { getCoinName } from '../../../../src/names'; +} from '../../../../src/transaction/fixedScript/index.js'; +import { getCoinName } from '../../../../src/names.js'; function describeTransactionWith(acidTest: testutil.AcidTest) { describe(`${acidTest.name}`, function () { diff --git a/modules/abstract-utxo/test/unit/transaction/fixedScript/parsePsbt.ts b/modules/abstract-utxo/test/unit/transaction/fixedScript/parsePsbt.ts index 9e527c2e8e..c2dd6df2f5 100644 --- a/modules/abstract-utxo/test/unit/transaction/fixedScript/parsePsbt.ts +++ b/modules/abstract-utxo/test/unit/transaction/fixedScript/parsePsbt.ts @@ -13,9 +13,9 @@ import { explainLegacyTx, explainPsbt, explainPsbtWasm } from '../../../../src/t import type { TransactionExplanation, ChangeAddressInfo, -} from '../../../../src/transaction/fixedScript/explainTransaction'; -import { getCoinName } from '../../../../src/names'; -import { TransactionPrebuild } from '../../../../src/abstractUtxoCoin'; +} from '../../../../src/transaction/fixedScript/explainTransaction.js'; +import { getCoinName } from '../../../../src/names.js'; +import { TransactionPrebuild } from '../../../../src/abstractUtxoCoin.js'; function getTxParamsFromExplanation( explanation: TransactionExplanation, diff --git a/modules/abstract-utxo/tsconfig.esm.json b/modules/abstract-utxo/tsconfig.esm.json index 0063ffff05..d053202d0f 100644 --- a/modules/abstract-utxo/tsconfig.esm.json +++ b/modules/abstract-utxo/tsconfig.esm.json @@ -3,9 +3,9 @@ "compilerOptions": { "outDir": "./dist/esm", "rootDir": "./src", - "module": "ES2020", + "module": "NodeNext", "target": "ES2020", - "moduleResolution": "bundler", + "moduleResolution": "NodeNext", "lib": ["ES2020", "DOM"], "declaration": true, "declarationMap": true, diff --git a/modules/utxo-core/src/bip322/index.ts b/modules/utxo-core/src/bip322/index.ts index afa5675751..7dda5f72c2 100644 --- a/modules/utxo-core/src/bip322/index.ts +++ b/modules/utxo-core/src/bip322/index.ts @@ -1,4 +1,4 @@ -export * from './toSpend'; -export * from './toSign'; -export * from './utils'; -export * from './verify'; +export * from './toSpend.js'; +export * from './toSign.js'; +export * from './utils.js'; +export * from './verify.js'; diff --git a/modules/utxo-core/src/bip322/toSign.ts b/modules/utxo-core/src/bip322/toSign.ts index 7cd492a660..d26fad6928 100644 --- a/modules/utxo-core/src/bip322/toSign.ts +++ b/modules/utxo-core/src/bip322/toSign.ts @@ -1,8 +1,8 @@ import { Psbt, bitgo, networks, Transaction } from '@bitgo/utxo-lib'; import { toXOnlyPublicKey } from '@bitgo/utxo-lib/dist/src/bitgo/outputScripts'; -import { addBip322ProofMessage } from './utils'; -import { BIP322_TAG, buildToSpendTransaction } from './toSpend'; +import { addBip322ProofMessage } from './utils.js'; +import { BIP322_TAG, buildToSpendTransaction } from './toSpend.js'; export type AddressDetails = { redeemScript?: Buffer; diff --git a/modules/utxo-core/src/bip322/verify.ts b/modules/utxo-core/src/bip322/verify.ts index 2335958d06..e50b3f643a 100644 --- a/modules/utxo-core/src/bip322/verify.ts +++ b/modules/utxo-core/src/bip322/verify.ts @@ -2,7 +2,7 @@ import * as assert from 'assert'; import * as utxolib from '@bitgo/utxo-lib'; -import { buildToSpendTransaction } from './toSpend'; +import { buildToSpendTransaction } from './toSpend.js'; export type MessageInfo = { address: string; diff --git a/modules/utxo-core/src/bip65/index.ts b/modules/utxo-core/src/bip65/index.ts index 2ceffe5de4..788e899a27 100644 --- a/modules/utxo-core/src/bip65/index.ts +++ b/modules/utxo-core/src/bip65/index.ts @@ -1 +1 @@ -export * from './locktime'; +export * from './locktime.js'; diff --git a/modules/utxo-core/src/descriptor/Output.ts b/modules/utxo-core/src/descriptor/Output.ts index 085e703c72..eb4af40f20 100644 --- a/modules/utxo-core/src/descriptor/Output.ts +++ b/modules/utxo-core/src/descriptor/Output.ts @@ -2,10 +2,10 @@ import assert from 'assert'; import { Descriptor } from '@bitgo/wasm-utxo'; -import { getFixedOutputSum, MaxOutput, Output, PrevOutput } from '../Output'; +import { getFixedOutputSum, MaxOutput, Output, PrevOutput } from '../Output.js'; -import { DescriptorMap } from './DescriptorMap'; -import { getDescriptorAtIndexCheckScript } from './derive'; +import { DescriptorMap } from './DescriptorMap.js'; +import { getDescriptorAtIndexCheckScript } from './derive.js'; export type WithDescriptor = T & { descriptor: Descriptor; diff --git a/modules/utxo-core/src/descriptor/VirtualSize.ts b/modules/utxo-core/src/descriptor/VirtualSize.ts index fc04f9c38f..81f67bf875 100644 --- a/modules/utxo-core/src/descriptor/VirtualSize.ts +++ b/modules/utxo-core/src/descriptor/VirtualSize.ts @@ -2,8 +2,8 @@ import * as utxolib from '@bitgo/utxo-lib'; import { Dimensions, VirtualSizes } from '@bitgo/unspents'; import { Descriptor } from '@bitgo/wasm-utxo'; -import { DescriptorMap } from './DescriptorMap'; -import { findDescriptorForInput } from './psbt'; +import { DescriptorMap } from './DescriptorMap.js'; +import { findDescriptorForInput } from './psbt/index.js'; function getScriptPubKeyLength(descType: string): number { // See https://bitcoinops.org/en/tools/calc-size/ diff --git a/modules/utxo-core/src/descriptor/index.ts b/modules/utxo-core/src/descriptor/index.ts index 1d3d71aa61..2a923e744d 100644 --- a/modules/utxo-core/src/descriptor/index.ts +++ b/modules/utxo-core/src/descriptor/index.ts @@ -1,11 +1,11 @@ -export * from './psbt'; -export * from './address'; -export * from './DescriptorMap'; -export * from './derive'; -export * from './Output'; -export * from './VirtualSize'; -export * from './fromFixedScriptWallet'; -export * from './parse/PatternMatcher'; +export * from './psbt/index.js'; +export * from './address.js'; +export * from './DescriptorMap.js'; +export * from './derive.js'; +export * from './Output.js'; +export * from './VirtualSize.js'; +export * from './fromFixedScriptWallet.js'; +export * from './parse/PatternMatcher.js'; /** @deprecated - import from @bitgo/utxo-core directly instead */ -export * from '../Output'; +export * from '../Output.js'; diff --git a/modules/utxo-core/src/descriptor/psbt/createPsbt.ts b/modules/utxo-core/src/descriptor/psbt/createPsbt.ts index b33fafd90c..ac4fcf678e 100644 --- a/modules/utxo-core/src/descriptor/psbt/createPsbt.ts +++ b/modules/utxo-core/src/descriptor/psbt/createPsbt.ts @@ -2,11 +2,11 @@ import { TapLeafScript } from 'bip174/src/lib/interfaces'; import * as utxolib from '@bitgo/utxo-lib'; import { Descriptor, Miniscript } from '@bitgo/wasm-utxo'; -import { DerivedDescriptorWalletOutput, WithOptDescriptor } from '../Output'; -import { Output } from '../../Output'; +import { DerivedDescriptorWalletOutput, WithOptDescriptor } from '../Output.js'; +import { Output } from '../../Output.js'; -import { toUtxoPsbt, toWrappedPsbt } from './wrap'; -import { assertSatisfiable } from './assertSatisfiable'; +import { toUtxoPsbt, toWrappedPsbt } from './wrap.js'; +import { assertSatisfiable } from './assertSatisfiable.js'; /** * Non-Final (Replaceable) diff --git a/modules/utxo-core/src/descriptor/psbt/findDescriptors.ts b/modules/utxo-core/src/descriptor/psbt/findDescriptors.ts index 30c811cec2..02a5c99311 100644 --- a/modules/utxo-core/src/descriptor/psbt/findDescriptors.ts +++ b/modules/utxo-core/src/descriptor/psbt/findDescriptors.ts @@ -12,7 +12,7 @@ We should take a look at a more robust and standard approach like this: https:// import { PsbtInput, PsbtOutput } from 'bip174/src/lib/interfaces'; import { Descriptor } from '@bitgo/wasm-utxo'; -import { DescriptorMap } from '../DescriptorMap'; +import { DescriptorMap } from '../DescriptorMap.js'; type DescriptorWithoutIndex = { descriptor: Descriptor; index: undefined }; diff --git a/modules/utxo-core/src/descriptor/psbt/index.ts b/modules/utxo-core/src/descriptor/psbt/index.ts index f442f5620d..daf1b1a983 100644 --- a/modules/utxo-core/src/descriptor/psbt/index.ts +++ b/modules/utxo-core/src/descriptor/psbt/index.ts @@ -1,6 +1,6 @@ -export * from './assertSatisfiable'; -export * from './createPsbt'; -export * from './parse'; -export * from './findDescriptors'; -export * from './wrap'; -export * from './sign'; +export * from './assertSatisfiable.js'; +export * from './createPsbt.js'; +export * from './parse.js'; +export * from './findDescriptors.js'; +export * from './wrap.js'; +export * from './sign.js'; diff --git a/modules/utxo-core/src/descriptor/psbt/parse.ts b/modules/utxo-core/src/descriptor/psbt/parse.ts index 21d39b6fff..08dd55b3fc 100644 --- a/modules/utxo-core/src/descriptor/psbt/parse.ts +++ b/modules/utxo-core/src/descriptor/psbt/parse.ts @@ -1,11 +1,11 @@ import { Descriptor } from '@bitgo/wasm-utxo'; import * as utxolib from '@bitgo/utxo-lib'; -import { DescriptorMap } from '../DescriptorMap'; -import { getVirtualSize } from '../VirtualSize'; +import { DescriptorMap } from '../DescriptorMap.js'; +import { getVirtualSize } from '../VirtualSize.js'; -import { findDescriptorForInput, findDescriptorForOutput } from './findDescriptors'; -import { assertSatisfiable } from './assertSatisfiable'; +import { findDescriptorForInput, findDescriptorForOutput } from './findDescriptors.js'; +import { assertSatisfiable } from './assertSatisfiable.js'; export type ScriptId = { descriptor: Descriptor; index: number | undefined }; diff --git a/modules/utxo-core/src/index.ts b/modules/utxo-core/src/index.ts index e499eb472b..d22c943f63 100644 --- a/modules/utxo-core/src/index.ts +++ b/modules/utxo-core/src/index.ts @@ -1,9 +1,9 @@ -export * as bip65 from './bip65'; -export * as descriptor from './descriptor'; -export * as testutil from './testutil'; -export * as paygo from './paygo'; -export * as bip32utils from './bip32utils'; -export * as bip322 from './bip322'; -export * from './dustThreshold'; -export * from './Output'; -export * from './xOnlyPubkey'; +export * as bip65 from './bip65/index.js'; +export * as descriptor from './descriptor/index.js'; +export * as testutil from './testutil/index.js'; +export * as paygo from './paygo/index.js'; +export * as bip32utils from './bip32utils.js'; +export * as bip322 from './bip322/index.js'; +export * from './dustThreshold.js'; +export * from './Output.js'; +export * from './xOnlyPubkey.js'; diff --git a/modules/utxo-core/src/paygo/index.ts b/modules/utxo-core/src/paygo/index.ts index 8555f440b6..4154b4b96f 100644 --- a/modules/utxo-core/src/paygo/index.ts +++ b/modules/utxo-core/src/paygo/index.ts @@ -1,2 +1,2 @@ -export * from './parsePayGoAttestation'; -export * from './psbt'; +export * from './parsePayGoAttestation.js'; +export * from './psbt/index.js'; diff --git a/modules/utxo-core/src/paygo/psbt/index.ts b/modules/utxo-core/src/paygo/psbt/index.ts index bea5042737..a4bd1c6f5f 100644 --- a/modules/utxo-core/src/paygo/psbt/index.ts +++ b/modules/utxo-core/src/paygo/psbt/index.ts @@ -1 +1 @@ -export * from './payGoAddressProof'; +export * from './payGoAddressProof.js'; diff --git a/modules/utxo-core/src/paygo/psbt/payGoAddressProof.ts b/modules/utxo-core/src/paygo/psbt/payGoAddressProof.ts index 24dc10361c..1d66fb2181 100644 --- a/modules/utxo-core/src/paygo/psbt/payGoAddressProof.ts +++ b/modules/utxo-core/src/paygo/psbt/payGoAddressProof.ts @@ -1,8 +1,8 @@ import * as utxolib from '@bitgo/utxo-lib'; import { checkForOutput } from 'bip174/src/lib/utils'; -import { verifyMessage } from '../../bip32utils'; -import { createPayGoAttestationBuffer } from '../attestation'; +import { verifyMessage } from '../../bip32utils.js'; +import { createPayGoAttestationBuffer } from '../attestation.js'; import { ErrorMultiplePayGoProof, @@ -10,7 +10,7 @@ import { ErrorNoPayGoProof, ErrorOutputIndexOutOfBounds, ErrorPayGoAddressProofFailedVerification, -} from './Errors'; +} from './Errors.js'; /** This function adds the entropy and signature into the PSBT output unknown key vals. * We store the entropy so that we reconstruct the message
From 3b5e9d8be294deffd00bd33dc1ae423d8a3a4cb2 Mon Sep 17 00:00:00 2001 From: setbern Date: Tue, 31 Mar 2026 15:57:26 -0400 Subject: [PATCH 2/3] fix(abstract-utxo,utxo-core): add .js extensions for ESM compatibility Fixes #7660 --- modules/abstract-utxo/test/unit/parseTransaction.ts | 8 ++++---- .../test/unit/transaction/descriptor/explainPsbt.ts | 6 +++--- .../test/unit/transaction/fixedScript/explainPsbt.ts | 6 +++--- .../test/unit/transaction/fixedScript/parsePsbt.ts | 6 +++--- .../utxo-core/src/testutil/descriptor/descriptors.ts | 4 ++-- .../utxo-core/src/testutil/descriptor/mock.utils.ts | 4 ++-- .../utxo-core/src/testutil/descriptor/psbt.utils.ts | 2 +- .../testutil/generatePayGoAttestationProof.utils.ts | 2 +- modules/utxo-core/src/testutil/index.ts | 10 +++++----- modules/utxo-core/tsconfig.esm.json | 4 ++-- 10 files changed, 26 insertions(+), 26 deletions(-) diff --git a/modules/abstract-utxo/test/unit/parseTransaction.ts b/modules/abstract-utxo/test/unit/parseTransaction.ts index 526880a419..e375d50463 100644 --- a/modules/abstract-utxo/test/unit/parseTransaction.ts +++ b/modules/abstract-utxo/test/unit/parseTransaction.ts @@ -3,11 +3,11 @@ import assert from 'assert'; import * as sinon from 'sinon'; import { Wallet, UnexpectedAddressError, VerificationOptions } from '@bitgo/sdk-core'; -import { UtxoWallet, TransactionParams } from '../../src/index.js'; -import { Output } from '../../src/transaction/types.js'; -import type { TransactionExplanation } from '../../src/transaction/fixedScript/explainTransaction.js'; +import { UtxoWallet, TransactionParams } from '../../src/index'; +import { Output } from '../../src/transaction/types'; +import type { TransactionExplanation } from '../../src/transaction/fixedScript/explainTransaction'; -import { getUtxoCoin } from './util/index.js'; +import { getUtxoCoin } from './util/index'; describe('Parse Transaction', function () { const coin = getUtxoCoin('tbtc'); diff --git a/modules/abstract-utxo/test/unit/transaction/descriptor/explainPsbt.ts b/modules/abstract-utxo/test/unit/transaction/descriptor/explainPsbt.ts index 1d1a1b89cd..c57f774199 100644 --- a/modules/abstract-utxo/test/unit/transaction/descriptor/explainPsbt.ts +++ b/modules/abstract-utxo/test/unit/transaction/descriptor/explainPsbt.ts @@ -3,10 +3,10 @@ import assert from 'assert'; import { descriptorWallet } from '@bitgo/wasm-utxo'; import * as testutils from '@bitgo/wasm-utxo/testutils'; -import type { TransactionExplanation } from '../../../../src/transaction/fixedScript/explainTransaction.js'; -import { explainPsbt } from '../../../../src/transaction/descriptor/index.js'; +import type { TransactionExplanation } from '../../../../src/transaction/fixedScript/explainTransaction'; +import { explainPsbt } from '../../../../src/transaction/descriptor/index'; -import { getFixtureRoot } from './fixtures.utils.js'; +import { getFixtureRoot } from './fixtures.utils'; const { getDescriptorMap, mockPsbtDefaultWithDescriptorTemplate } = testutils.descriptor; const { assertEqualFixture } = getFixtureRoot(__dirname + '/fixtures'); diff --git a/modules/abstract-utxo/test/unit/transaction/fixedScript/explainPsbt.ts b/modules/abstract-utxo/test/unit/transaction/fixedScript/explainPsbt.ts index e737d343d3..b45d4449ca 100644 --- a/modules/abstract-utxo/test/unit/transaction/fixedScript/explainPsbt.ts +++ b/modules/abstract-utxo/test/unit/transaction/fixedScript/explainPsbt.ts @@ -4,15 +4,15 @@ import * as utxolib from '@bitgo/utxo-lib'; import { testutil } from '@bitgo/utxo-lib'; import { fixedScriptWallet, Triple } from '@bitgo/wasm-utxo'; -import type { TransactionExplanation } from '../../../../src/transaction/fixedScript/explainTransaction.js'; +import type { TransactionExplanation } from '../../../../src/transaction/fixedScript/explainTransaction'; import { explainPsbt, explainPsbtWasm, explainPsbtWasmBigInt, aggregateTransactionExplanations, type TransactionExplanationBigInt, -} from '../../../../src/transaction/fixedScript/index.js'; -import { getCoinName } from '../../../../src/names.js'; +} from '../../../../src/transaction/fixedScript/index'; +import { getCoinName } from '../../../../src/names'; function describeTransactionWith(acidTest: testutil.AcidTest) { describe(`${acidTest.name}`, function () { diff --git a/modules/abstract-utxo/test/unit/transaction/fixedScript/parsePsbt.ts b/modules/abstract-utxo/test/unit/transaction/fixedScript/parsePsbt.ts index c2dd6df2f5..9e527c2e8e 100644 --- a/modules/abstract-utxo/test/unit/transaction/fixedScript/parsePsbt.ts +++ b/modules/abstract-utxo/test/unit/transaction/fixedScript/parsePsbt.ts @@ -13,9 +13,9 @@ import { explainLegacyTx, explainPsbt, explainPsbtWasm } from '../../../../src/t import type { TransactionExplanation, ChangeAddressInfo, -} from '../../../../src/transaction/fixedScript/explainTransaction.js'; -import { getCoinName } from '../../../../src/names.js'; -import { TransactionPrebuild } from '../../../../src/abstractUtxoCoin.js'; +} from '../../../../src/transaction/fixedScript/explainTransaction'; +import { getCoinName } from '../../../../src/names'; +import { TransactionPrebuild } from '../../../../src/abstractUtxoCoin'; function getTxParamsFromExplanation( explanation: TransactionExplanation, diff --git a/modules/utxo-core/src/testutil/descriptor/descriptors.ts b/modules/utxo-core/src/testutil/descriptor/descriptors.ts index 8e1790e9f2..3f1ef7dfe5 100644 --- a/modules/utxo-core/src/testutil/descriptor/descriptors.ts +++ b/modules/utxo-core/src/testutil/descriptor/descriptors.ts @@ -3,8 +3,8 @@ import assert from 'assert'; import { bip32, BIP32Interface } from '@bitgo/secp256k1'; import { Miniscript, Descriptor, ast } from '@bitgo/wasm-utxo'; -import { DescriptorMap, PsbtParams } from '../../descriptor'; -import { getKeyTriple, Triple, KeyTriple } from '../key.utils'; +import { DescriptorMap, PsbtParams } from '../../descriptor/index.js'; +import { getKeyTriple, Triple, KeyTriple } from '../key.utils.js'; export function getDefaultXPubs(seed?: string): Triple { return getKeyTriple(seed).map((k) => k.neutered().toBase58()) as Triple; diff --git a/modules/utxo-core/src/testutil/descriptor/mock.utils.ts b/modules/utxo-core/src/testutil/descriptor/mock.utils.ts index 132a2fc3ac..7c3311611c 100644 --- a/modules/utxo-core/src/testutil/descriptor/mock.utils.ts +++ b/modules/utxo-core/src/testutil/descriptor/mock.utils.ts @@ -6,9 +6,9 @@ import { createPsbt, createScriptPubKeyFromDescriptor, DerivedDescriptorTransactionInput, -} from '../../descriptor'; +} from '../../descriptor/index.js'; -import { DescriptorTemplate, getDefaultXPubs, getDescriptor } from './descriptors'; +import { DescriptorTemplate, getDefaultXPubs, getDescriptor } from './descriptors.js'; type MockOutputIdParams = { hash?: string; vout?: number }; diff --git a/modules/utxo-core/src/testutil/descriptor/psbt.utils.ts b/modules/utxo-core/src/testutil/descriptor/psbt.utils.ts index 582b908ac6..5e17a6dbe6 100644 --- a/modules/utxo-core/src/testutil/descriptor/psbt.utils.ts +++ b/modules/utxo-core/src/testutil/descriptor/psbt.utils.ts @@ -1,6 +1,6 @@ import * as utxolib from '@bitgo/utxo-lib'; -import { matchPath, PathElement, toPlainObject } from '../../../src/testutil'; +import { matchPath, PathElement, toPlainObject } from '../../../src/testutil/index.js'; export function toPlainObjectFromPsbt(v: utxolib.Psbt): unknown { return toPlainObject( diff --git a/modules/utxo-core/src/testutil/generatePayGoAttestationProof.utils.ts b/modules/utxo-core/src/testutil/generatePayGoAttestationProof.utils.ts index 7a662db701..fe342e6729 100644 --- a/modules/utxo-core/src/testutil/generatePayGoAttestationProof.utils.ts +++ b/modules/utxo-core/src/testutil/generatePayGoAttestationProof.utils.ts @@ -2,7 +2,7 @@ import crypto from 'crypto'; import { bufferutils } from '@bitgo/utxo-lib'; -import { Prefix } from '../paygo'; +import { Prefix } from '../paygo/index.js'; /** We have a mirrored function similar to our hsm that generates our Bitcoin signed * message so that we can use for testing. This creates a random entropy as well using diff --git a/modules/utxo-core/src/testutil/index.ts b/modules/utxo-core/src/testutil/index.ts index f2d04b3c79..b04644ba05 100644 --- a/modules/utxo-core/src/testutil/index.ts +++ b/modules/utxo-core/src/testutil/index.ts @@ -1,5 +1,5 @@ -export * from './fixtures.utils'; -export * from './key.utils'; -export * from './toPlainObject.utils'; -export * from './generatePayGoAttestationProof.utils'; -export * from './trimMessagePrefix'; +export * from './fixtures.utils.js'; +export * from './key.utils.js'; +export * from './toPlainObject.utils.js'; +export * from './generatePayGoAttestationProof.utils.js'; +export * from './trimMessagePrefix.js'; diff --git a/modules/utxo-core/tsconfig.esm.json b/modules/utxo-core/tsconfig.esm.json index 17f39ab0f3..bed939f951 100644 --- a/modules/utxo-core/tsconfig.esm.json +++ b/modules/utxo-core/tsconfig.esm.json @@ -3,9 +3,9 @@ "compilerOptions": { "outDir": "./dist/esm", "rootDir": "./src", - "module": "ES2020", + "module": "NodeNext", "target": "ES2020", - "moduleResolution": "bundler", + "moduleResolution": "NodeNext", "lib": ["ES2020", "DOM"], "declaration": true, "declarationMap": true, From b78982654938de5b24f23f51fcfb779b43b26019 Mon Sep 17 00:00:00 2001 From: setbern Date: Tue, 31 Mar 2026 16:08:43 -0400 Subject: [PATCH 3/3] bug: add missing export fixedScript to abstract-utxo transaction exports --- modules/abstract-utxo/src/transaction/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/abstract-utxo/src/transaction/index.ts b/modules/abstract-utxo/src/transaction/index.ts index 4b4f470f24..605e872df8 100644 --- a/modules/abstract-utxo/src/transaction/index.ts +++ b/modules/abstract-utxo/src/transaction/index.ts @@ -6,3 +6,4 @@ export { verifyTransaction } from './verifyTransaction.js'; export * from './fetchInputs.js'; export * as bip322 from './bip322.js'; export { decodePsbt, decodePsbtWith } from './decode.js'; +export * from './fixedScript/index.js';