Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .changeset/ripe-heads-stop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
'@xchainjs/xchain-mayachain-query': patch
'@xchainjs/xchain-thorchain-query': patch
'@xchainjs/xchain-mayachain': patch
'@xchainjs/xchain-thorchain': patch
'@xchainjs/xchain-arbitrum': patch
'@xchainjs/xchain-ethereum': patch
'@xchainjs/xchain-litecoin': patch
'@xchainjs/xchain-bitcoin': patch
'xchainjs-estimate-swap': patch
'@xchainjs/xchain-cosmos': patch
'@xchainjs/xchain-kujira': patch
'@xchainjs/xchain-wallet': patch
'@xchainjs/xchain-avax': patch
'@xchainjs/xchain-base': patch
'@xchainjs/xchain-doge': patch
'@xchainjs/xchain-util': patch
'@xchainjs/xchain-bsc': patch
'@xchainjs/xchain-evm': patch
'xchainjs-liquidity': patch
'xchainjs-check-tx': patch
'xchainjs-loans': patch
'txJammer': patch
---
Comment on lines +2 to +24
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Verify all package names exist (and match casing) in the workspace before merging.

If any entry here doesn’t exactly match a package.json "name", Changesets will skip it or error, and you’ll miss expected releases. "txJammer" in particular stands out due to uppercase letters, which is uncommon for npm package names and may not match the actual workspace name.

Run the script below to:

  • List package names declared in this changeset.
  • Compare against all package.json "name" fields in the repo.
  • Flag unknown names, duplicates, and names with uppercase characters.

🏁 Script executed:

#!/bin/bash
set -euo pipefail

CS_FILE=".changeset/ripe-heads-stop.md"

# 1) Extract declared package names from the frontmatter
mapfile -t DECLARED < <(awk 'BEGIN{fs=0} /^---\s*$/{fs++} fs==1 && $0 !~ /^---\s*$/{print} fs>1{exit}' "$CS_FILE" \
  | sed -nE "s/^[[:space:]]*'([^']+)':[[:space:]]*(patch|minor|major)[[:space:]]*$/\1/p" \
  | sort)

# 2) Extract actual workspace package names
# Avoid node_modules and other vendor dirs if present
mapfile -t ACTUAL < <(fd -t f -a package.json \
  -E "**/node_modules/**" -E "**/dist/**" -E "**/build/**" \
  | xargs -I{} jq -r '.name' {} | sort -u)

echo "Declared in changeset:"
printf '  - %s\n' "${DECLARED[@]}"
echo
echo "Actual package.json names:"
printf '  - %s\n' "${ACTUAL[@]}"
echo

# 3) Find declared names that don't exist in the repo
echo "Declared but not found:"
comm -23 <(printf "%s\n" "${DECLARED[@]}") <(printf "%s\n" "${ACTUAL[@]}") | sed 's/^/  - /' || true
echo

# 4) Duplicates within the changeset
echo "Duplicates in changeset frontmatter:"
printf "%s\n" "${DECLARED[@]}" | uniq -d | sed 's/^/  - /' || true
echo

# 5) Names with uppercase letters in changeset
echo "Names with uppercase letters in changeset:"
printf "%s\n" "${DECLARED[@]}" | grep -nE '[A-Z]' | sed 's/^/  - /' || echo "  - none"

Length of output: 407


I’ve adjusted the verification script to avoid process-substitution and ensure we reliably extract both the declared and actual package names. Please run this instead:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

CS_FILE=".changeset/ripe-heads-stop.md"

# 1) Extract declared package names into declared.txt
awk '
  BEGIN { in_front = 0 }
  /^---/ {
    in_front++
    next
  }
  in_front == 1 && !/^---/ {
    if (match($0, /^'\''([^'\'']+)'\'' *: *(patch|minor|major)/, m)) {
      print m[1]
    }
  }
  in_front > 1 { exit }
' "$CS_FILE" | sort > declared.txt

# 2) Extract actual workspace package names into actual.txt
find . -type f -name 'package.json' \
  -not -path '*/node_modules/*' \
  -not -path '*/dist/*' \
  -not -path '*/build/*' \
  -print0 | xargs -0 -I{} jq -r '.name' {} | sort -u > actual.txt

# 3) Report results
echo "Declared in changeset:" && sed 's/^/  - /' declared.txt
echo
echo "Actual package.json names:" && sed 's/^/  - /' actual.txt
echo
echo "Declared but not found:" && comm -23 declared.txt actual.txt | sed 's/^/  - /' || true
echo
echo "Duplicates in changeset frontmatter:" && uniq -d declared.txt | sed 's/^/  - /' || true
echo
echo "Names with uppercase letters in changeset:" && grep -nE '[A-Z]' declared.txt | sed 's/^/  - /' || echo "  - none"

Length of output: 3224


Review frontmatter package names need correction before merging

Please address the following before merging:

  • The entry xchainjs-loans is declared in .changeset/ripe-heads-stop.md but no package.json in the workspace has that name. Either remove it or correct it to match the actual package name.
  • All other entries map exactly to existing packages—but note that txJammer is intentionally uppercase in package.json, which is uncommon for npm packages. Ensure this casing is deliberate and matches across both the workspace and changeset.
🤖 Prompt for AI Agents
.changeset/ripe-heads-stop.md around lines 2 to 24: the changeset lists a
package "xchainjs-loans" that does not exist in the workspace and may break the
release; remove that entry or replace it with the exact package name found in
the repo's package.json (match casing and scope exactly). Also verify the
"txJammer" entry matches the package.json casing — if package.json uses
"txJammer" keep it, otherwise correct the changeset to the exact package name
used in the workspace so all entries map 1:1 to actual packages.


require bignumber.js 9.1.2 for esm support
2 changes: 1 addition & 1 deletion examples/check-tx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@xchainjs/xchain-util": "workspace:*",
"axios": "1.8.4",
"axios-retry": "^3.2.5",
"bignumber.js": "^9.0.0",
"bignumber.js": "^9.1.2",
"rimraf": "~3.0.2"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion examples/estimate-swap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@xchainjs/xchain-util": "workspace:*",
"axios": "1.8.4",
"axios-retry": "^3.2.5",
"bignumber.js": "^9.0.0",
"bignumber.js": "^9.1.2",
"rimraf": "~3.0.2"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion examples/liquidity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@xchainjs/xchain-util": "workspace:*",
"axios": "1.8.4",
"axios-retry": "^3.2.5",
"bignumber.js": "^9.0.0",
"bignumber.js": "^9.1.2",
"rimraf": "~3.0.2"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/xchain-arbitrum/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@xchainjs/xchain-evm": "workspace:*",
"@xchainjs/xchain-evm-providers": "workspace:*",
"@xchainjs/xchain-util": "workspace:*",
"bignumber.js": "^9.0.0",
"bignumber.js": "^9.1.2",
"ethers": "^6.14.3"
}
}
2 changes: 1 addition & 1 deletion packages/xchain-avax/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@xchainjs/xchain-evm": "workspace:*",
"@xchainjs/xchain-evm-providers": "workspace:*",
"@xchainjs/xchain-util": "workspace:*",
"bignumber.js": "^9.0.0",
"bignumber.js": "^9.1.2",
"ethers": "^6.14.3"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/xchain-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@xchainjs/xchain-evm": "workspace:*",
"@xchainjs/xchain-evm-providers": "workspace:*",
"@xchainjs/xchain-util": "workspace:*",
"bignumber.js": "^9.0.0",
"bignumber.js": "^9.1.2",
"ethers": "^6.14.3"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/xchain-bitcoin/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { AssetInfo, FeeRate, Network } from '@xchainjs/xchain-client'
import { Address } from '@xchainjs/xchain-util'
import { Client as UTXOClient, PreparedTx, TxParams, UTXO, UtxoClientParams } from '@xchainjs/xchain-utxo'
import * as Bitcoin from 'bitcoinjs-lib'
import accumulative from 'coinselect/accumulative'
import accumulative from 'coinselect/accumulative.js'

import {
AssetBTC,
Expand Down
4 changes: 2 additions & 2 deletions packages/xchain-bitcoin/src/modules.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// This statement declares a module augmentation for the external module 'coinselect/accumulative'.
declare module 'coinselect/accumulative'
// This statement declares a module augmentation for the external module 'coinselect/accumulative.js'.
declare module 'coinselect/accumulative.js'
4 changes: 2 additions & 2 deletions packages/xchain-bitcoincash/src/client.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Import statements for necessary modules and types
import * as bitcore from 'bitcore-lib-cash'
import bitcore from 'bitcore-lib-cash'
import { AssetInfo, FeeRate, Network } from '@xchainjs/xchain-client' // Importing various types and constants from xchain-client module
import { Address } from '@xchainjs/xchain-util' // Importing the Address type from xchain-util module
import { Client as UTXOClient, TxParams, UtxoClientParams, UTXO } from '@xchainjs/xchain-utxo' // Importing necessary types and the UTXOClient class from xchain-utxo module
import accumulative from 'coinselect/accumulative' // Importing accumulative function from coinselect/accumulative module
import accumulative from 'coinselect/accumulative.js' // Importing accumulative function from coinselect/accumulative.js module

import {
AssetBCH,
Expand Down
2 changes: 1 addition & 1 deletion packages/xchain-bitcoincash/src/clientKeystore.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as bitcore from 'bitcore-lib-cash'
import bitcore from 'bitcore-lib-cash'
import { FeeOption, FeeRate, TxHash, checkFeeBounds } from '@xchainjs/xchain-client' // Importing getSeed function from xchain-crypto module
import { getSeed } from '@xchainjs/xchain-crypto' // Importing the Address type from xchain-util module
import { Address } from '@xchainjs/xchain-util' // Importing necessary types from bitcoincashjs-types module
Expand Down
4 changes: 2 additions & 2 deletions packages/xchain-bitcoincash/src/modules.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Declaration file for the 'coinselect/accumulative' module.
* Declaration file for the 'coinselect/accumulative.js' module.
* This module likely provides functions or utilities related to coin selection algorithms,
* specifically the 'accumulative' algorithm.
*/
declare module 'coinselect/accumulative'
declare module 'coinselect/accumulative.js'
2 changes: 1 addition & 1 deletion packages/xchain-bitcoincash/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Network, TxType } from '@xchainjs/xchain-client' // Importing types rel
import { Address, baseAmount } from '@xchainjs/xchain-util' // Importing utilities related to addresses and amounts
import { Tx, TxFrom, TxTo } from '@xchainjs/xchain-utxo' // Importing Bitcoin Cash address utilities
import * as bchaddr from 'bchaddrjs' // Importing coin information utility
import * as bitcore from 'bitcore-lib-cash'
import bitcore from 'bitcore-lib-cash'
import { AssetBCH, BCH_DECIMAL } from './const' // Importing BCH asset and decimal constants
import { Transaction, TransactionInput, TransactionOutput } from './types' // Importing custom transaction types

Expand Down
2 changes: 1 addition & 1 deletion packages/xchain-bsc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@xchainjs/xchain-evm": "workspace:*",
"@xchainjs/xchain-evm-providers": "workspace:*",
"@xchainjs/xchain-util": "workspace:*",
"bignumber.js": "^9.0.0",
"bignumber.js": "^9.1.2",
"ethers": "^6.14.3"
}
}
2 changes: 1 addition & 1 deletion packages/xchain-cosmos/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"@xchainjs/xchain-crypto": "workspace:*",
"@xchainjs/xchain-util": "workspace:*",
"axios": "1.8.4",
"bignumber.js": "^9.0.0",
"bignumber.js": "^9.1.2",
"cosmjs-types": "0.9.0",
"protobufjs": "6.11.4"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/xchain-cosmos/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { AssetInfo, FeeType, Fees, PreparedTx, singleFee } from '@xchainjs/xchai
import { Client as CosmosSDKClient, CosmosSdkClientParams, MsgTypes, makeClientPath } from '@xchainjs/xchain-cosmos-sdk'
import { Address, Asset, AssetType, baseAmount, eqAsset } from '@xchainjs/xchain-util'
import BigNumber from 'bignumber.js'
import { TxRaw } from 'cosmjs-types/cosmos/tx/v1beta1/tx'
import { TxRaw } from 'cosmjs-types/cosmos/tx/v1beta1/tx.js'

import {
AssetATOM,
Expand Down
2 changes: 1 addition & 1 deletion packages/xchain-dash/src/client.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as dashcore from '@dashevo/dashcore-lib'
import dashcore from '@dashevo/dashcore-lib'
import { AssetInfo, FeeRate, Network, TxHistoryParams, TxType } from '@xchainjs/xchain-client'
import { Address, assetAmount, assetToBase, baseAmount } from '@xchainjs/xchain-util'
import { Balance, Client as UTXOClient, Tx, TxParams, TxsPage, UTXO, UtxoClientParams } from '@xchainjs/xchain-utxo'
Expand Down
2 changes: 1 addition & 1 deletion packages/xchain-dash/src/clientKeystore.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as ecc from '@bitcoin-js/tiny-secp256k1-asmjs'
import * as dashcore from '@dashevo/dashcore-lib'
import dashcore from '@dashevo/dashcore-lib'
import { Transaction } from '@dashevo/dashcore-lib/typings/transaction/Transaction'
import { FeeOption, FeeRate, TxHash, checkFeeBounds } from '@xchainjs/xchain-client'
import { getSeed } from '@xchainjs/xchain-crypto'
Expand Down
2 changes: 1 addition & 1 deletion packages/xchain-dash/src/clientLedger.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as dashcore from '@dashevo/dashcore-lib'
import dashcore from '@dashevo/dashcore-lib'
import AppBtc from '@ledgerhq/hw-app-btc'
import type { Transaction as LedgerTransaction } from '@ledgerhq/hw-app-btc/lib/types'
import { FeeOption, FeeRate, TxHash, checkFeeBounds } from '@xchainjs/xchain-client'
Expand Down
2 changes: 1 addition & 1 deletion packages/xchain-dash/src/modules.d copy.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
declare module 'coinselect/accumulative'
declare module 'coinselect/accumulative.js'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Verify if this is an intentional duplicate file.

The module declaration update for ESM compatibility is correct, but the filename "modules.d copy.ts" suggests this might be an unintentional duplicate. Please confirm if this file should exist alongside the original modules.d.ts or if it should be removed.


🏁 Script executed:

#!/bin/bash
# Check if there's an original modules.d.ts file in the same directory
fd "modules.d.ts" packages/xchain-dash/src/

Length of output: 81


Remove unintended duplicate modules.d copy.ts

The file packages/xchain-dash/src/modules.d copy.ts appears to be an accidental copy of modules.d.ts and should be removed. The ESM module declaration for 'coinselect/accumulative.js' is already correctly handled in modules.d.ts.

• Delete: packages/xchain-dash/src/modules.d copy.ts

🤖 Prompt for AI Agents
In packages/xchain-dash/src/modules.d copy.ts at line 1, this file is an
unintended duplicate of modules.d.ts and contains redundant module declarations.
Remove the entire file packages/xchain-dash/src/modules.d copy.ts to avoid
confusion and duplication, as the necessary declarations are already present in
modules.d.ts.

2 changes: 1 addition & 1 deletion packages/xchain-dash/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { FeeRate, Network } from '@xchainjs/xchain-client'
import { Address } from '@xchainjs/xchain-util'
import { TxParams, UTXO, toBitcoinJS } from '@xchainjs/xchain-utxo'
import * as Dash from 'bitcoinjs-lib'
import accumulative from 'coinselect/accumulative'
import accumulative from 'coinselect/accumulative.js'

import * as insight from './insight-api'

Expand Down
2 changes: 1 addition & 1 deletion packages/xchain-doge/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { AssetInfo, FeeRate, Network } from '@xchainjs/xchain-client'
import { Address } from '@xchainjs/xchain-util'
import { Client as UTXOClient, PreparedTx, TxParams, UTXO, UtxoClientParams } from '@xchainjs/xchain-utxo'
import * as Dogecoin from 'bitcoinjs-lib'
import accumulative from 'coinselect/accumulative'
import accumulative from 'coinselect/accumulative.js'

import {
AssetDOGE,
Expand Down
6 changes: 3 additions & 3 deletions packages/xchain-doge/src/modules.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Declaration file for the 'coinselect/accumulative' module.
* Declaration file for the 'coinselect/accumulative.js' module.
*
* 'coinselect/accumulative' is a module used for selecting and accumulating unspent transaction outputs (UTXOs).
* 'coinselect/accumulative.js' is a module used for selecting and accumulating unspent transaction outputs (UTXOs).
* This declaration file allows TypeScript to recognize and properly handle the module.
*/
declare module 'coinselect/accumulative'
declare module 'coinselect/accumulative.js'
2 changes: 1 addition & 1 deletion packages/xchain-ethereum/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@xchainjs/xchain-evm": "workspace:*",
"@xchainjs/xchain-evm-providers": "workspace:*",
"@xchainjs/xchain-util": "workspace:*",
"bignumber.js": "^9.0.0",
"bignumber.js": "^9.1.2",
"ethers": "^6.14.3"
}
}
2 changes: 1 addition & 1 deletion packages/xchain-evm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@xchainjs/xchain-crypto": "workspace:*",
"@xchainjs/xchain-evm-providers": "workspace:*",
"@xchainjs/xchain-util": "workspace:*",
"bignumber.js": "^9.0.0",
"bignumber.js": "^9.1.2",
"ethers": "^6.14.3"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/xchain-kujira/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { getSeed } from '@xchainjs/xchain-crypto'
import { Address, AssetType, eqAsset } from '@xchainjs/xchain-util'
import { bech32 } from '@scure/base'
import { HDKey } from '@scure/bip32'
import { TxRaw } from 'cosmjs-types/cosmos/tx/v1beta1/tx'
import { TxRaw } from 'cosmjs-types/cosmos/tx/v1beta1/tx.js'
import { createHash } from 'crypto'
import * as secp from '@bitcoin-js/tiny-secp256k1-asmjs'

Expand Down
2 changes: 1 addition & 1 deletion packages/xchain-litecoin/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { AssetInfo, FeeRate, Network } from '@xchainjs/xchain-client'
import { Address } from '@xchainjs/xchain-util'
import { Client as UTXOClient, PreparedTx, TxParams, UTXO, UtxoClientParams } from '@xchainjs/xchain-utxo'
import * as Litecoin from 'bitcoinjs-lib'
import accumulative from 'coinselect/accumulative'
import accumulative from 'coinselect/accumulative.js'

import {
AssetLTC,
Expand Down
4 changes: 2 additions & 2 deletions packages/xchain-litecoin/src/modules.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Declaration file for the 'coinselect/accumulative' module.
* Declaration file for the 'coinselect/accumulative.js' module.
* This module is used for selecting UTXOs for transactions.
*/
declare module 'coinselect/accumulative'
declare module 'coinselect/accumulative.js'
2 changes: 1 addition & 1 deletion packages/xchain-mayachain-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@xchainjs/xchain-util": "workspace:*",
"axios": "1.8.4",
"axios-retry": "3.2.5",
"bignumber.js": "^9.0.0"
"bignumber.js": "^9.1.2"
},
"devDependencies": {
"axios-mock-adapter": "2.1.0"
Expand Down
2 changes: 2 additions & 0 deletions packages/xchain-mayachain/genMsgs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ tput setaf 2
echo "Generating $MSG_COMPILED_OUTPUTFILE"
tput sgr0
yarn run pbjs -w commonjs -t static-module $TMP_DIR/mayanode/proto/mayachain/v1/common/common.proto $TMP_DIR/mayanode/proto/mayachain/v1/x/mayachain/types/msg_deposit.proto $TMP_DIR/mayanode/proto/mayachain/v1/x/mayachain/types/msg_send.proto $TMP_DIR/mayanode/third_party/proto/cosmos/base/v1beta1/coin.proto -o $MSG_COMPILED_OUTPUTFILE
# Fix import to be ESM-compatible (no omitted file extension)
sed -i -E 's|"(protobufjs/minimal)"|"\1.js"|' "$MSG_COMPILED_OUTPUTFILE"
Comment on lines +20 to +21
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

sed -i -E is not portable across BSD/macOS – consider a cross-platform variant

On GNU sed (typical in CI images) the current command is fine, but BSD sed (macOS) requires the backup-suffix immediately after -i, e.g. sed -i '' -E ….
If any contributors run this script locally on macOS it will abort with
sed: -i may not be used with -e. Switching to a portable approach avoids surprises.

-# Fix import to be ESM-compatible (no omitted file extension)
-sed -i -E 's|"(protobufjs/minimal)"|"\1.js"|' "$MSG_COMPILED_OUTPUTFILE"
+# Fix import to be ESM-compatible (no omitted file extension)
+# Works on both GNU and BSD sed.
+sed -E 's|"(protobufjs/minimal)"|"\1.js"|' "$MSG_COMPILED_OUTPUTFILE" \
+  | tee "$MSG_COMPILED_OUTPUTFILE.tmp" \
+  && mv "$MSG_COMPILED_OUTPUTFILE.tmp" "$MSG_COMPILED_OUTPUTFILE"

Alternatively, use perl -pe or node -e for complete portability.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Fix import to be ESM-compatible (no omitted file extension)
sed -i -E 's|"(protobufjs/minimal)"|"\1.js"|' "$MSG_COMPILED_OUTPUTFILE"
# Fix import to be ESM-compatible (no omitted file extension)
# Works on both GNU and BSD sed.
sed -E 's|"(protobufjs/minimal)"|"\1.js"|' "$MSG_COMPILED_OUTPUTFILE" \
| tee "$MSG_COMPILED_OUTPUTFILE.tmp" \
&& mv "$MSG_COMPILED_OUTPUTFILE.tmp" "$MSG_COMPILED_OUTPUTFILE"
🤖 Prompt for AI Agents
In packages/xchain-mayachain/genMsgs.sh around lines 20 to 21, the sed command
using `-i -E` is not portable to BSD/macOS because BSD sed requires a backup
suffix immediately after `-i`. To fix this, modify the sed command to include an
empty backup suffix like `-i '' -E` for macOS compatibility, or replace the sed
command with a portable alternative such as a `perl -pe` or `node -e` one-liner
to ensure cross-platform compatibility.


tput setaf 2
echo "Generating $MSG_COMPILED_TYPES_OUTPUTFILE"
Expand Down
2 changes: 1 addition & 1 deletion packages/xchain-mayachain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"@xchainjs/xchain-crypto": "workspace:*",
"@xchainjs/xchain-util": "workspace:*",
"axios": "1.8.4",
"bignumber.js": "^9.0.0",
"bignumber.js": "^9.1.2",
"cosmjs-types": "0.9.0",
"protobufjs": "6.11.4"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/xchain-mayachain/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { Address, BaseAmount, assetFromString, eqAsset, isSynthAsset } from '@xc
import { bech32 } from '@scure/base'
import BigNumber from 'bignumber.js'
import { HDKey } from '@scure/bip32'
import { TxRaw } from 'cosmjs-types/cosmos/tx/v1beta1/tx'
import { TxRaw } from 'cosmjs-types/cosmos/tx/v1beta1/tx.js'
import { createHash } from 'crypto'
import * as secp from '@bitcoin-js/tiny-secp256k1-asmjs'

Expand Down
2 changes: 1 addition & 1 deletion packages/xchain-mayachain/src/types/proto/MsgCompiled.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
"use strict";

var $protobuf = require("protobufjs/minimal");
var $protobuf = require("protobufjs/minimal.js");

// Common aliases
var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
Expand Down
1 change: 1 addition & 0 deletions packages/xchain-radix/__tests__/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { Balance, Fees, Network, XChainClientParams } from '@xchainjs/xchain-cli
import { AssetType, baseAmount } from '@xchainjs/xchain-util'

import { generateMnemonic } from 'bip39'
import { jest } from '@jest/globals'

import {
mockCommittedDetailsResponse,
Expand Down
2 changes: 1 addition & 1 deletion packages/xchain-thorchain-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@xchainjs/xchain-util": "workspace:*",
"axios": "1.8.4",
"axios-retry": "3.2.5",
"bignumber.js": "^9.0.0"
"bignumber.js": "^9.1.2"
},
"devDependencies": {
"axios-mock-adapter": "2.1.0"
Expand Down
4 changes: 4 additions & 0 deletions packages/xchain-thorchain/genMsgs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ yarn pbjs -w commonjs -t static-module \
"$TMP_DIR/thornode/third_party/proto/cosmos/base/v1beta1/coin.proto" \
-o "$MSG_COMPILED_OUTPUTFILE" 2>pbjs_errors.txt

# Fix import to be ESM-compatible (no omitted file extension)
sed -i -E 's|"(protobufjs/minimal)"|"\1.js"|' "$MSG_COMPILED_OUTPUTFILE"


# Generate TypeScript definitions with explicit namespace
tput setaf 2
echo "Generating $MSG_COMPILED_TYPES_OUTPUTFILE"
Expand Down
2 changes: 1 addition & 1 deletion packages/xchain-thorchain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"@xchainjs/xchain-crypto": "workspace:*",
"@xchainjs/xchain-util": "workspace:*",
"axios": "1.8.4",
"bignumber.js": "^9.0.0",
"bignumber.js": "^9.1.2",
"cosmjs-types": "0.9.0",
"protobufjs": "6.11.4"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/xchain-thorchain/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
bech32ToBase64,
} from '@xchainjs/xchain-cosmos-sdk'
import { Address, assetFromString, eqAsset } from '@xchainjs/xchain-util'
import { TxRaw } from 'cosmjs-types/cosmos/tx/v1beta1/tx'
import { TxRaw } from 'cosmjs-types/cosmos/tx/v1beta1/tx.js'

/**
* Import constants and types
Expand Down
2 changes: 1 addition & 1 deletion packages/xchain-thorchain/src/clientKeystore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { BaseAmount } from '@xchainjs/xchain-util'
import { bech32 } from '@scure/base'
import BigNumber from 'bignumber.js'
import { HDKey } from '@scure/bip32'
import { TxRaw } from 'cosmjs-types/cosmos/tx/v1beta1/tx'
import { TxRaw } from 'cosmjs-types/cosmos/tx/v1beta1/tx.js'
import { createHash } from 'crypto'
import * as secp from '@bitcoin-js/tiny-secp256k1-asmjs'

Expand Down
4 changes: 2 additions & 2 deletions packages/xchain-thorchain/src/clientLedger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import THORChainApp, { extractSignatureFromTLV } from '@xchainjs/ledger-thorchai
import { CompatibleAsset, base64ToBech32, bech32ToBase64 } from '@xchainjs/xchain-cosmos-sdk'
import { assetFromStringEx, assetToString } from '@xchainjs/xchain-util'
import BigNumber from 'bignumber.js'
import { SignMode } from 'cosmjs-types/cosmos/tx/signing/v1beta1/signing'
import { TxRaw } from 'cosmjs-types/cosmos/tx/v1beta1/tx'
import { SignMode } from 'cosmjs-types/cosmos/tx/signing/v1beta1/signing.js'
import { TxRaw } from 'cosmjs-types/cosmos/tx/v1beta1/tx.js'

import { Client, ThorchainClientParams } from './client'
import { AssetRuneNative, DEPOSIT_GAS_LIMIT_VALUE, defaultClientConfig } from './const'
Expand Down
Loading