@defuse-protocol/intents-sdk 0.62.1 → 0.62.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,7 @@
1
1
  const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
2
2
  const require_errors = require('../../classes/errors.cjs');
3
3
  const require_route_enum = require('../../constants/route-enum.cjs');
4
+ const require_caip2 = require('../../lib/caip2.cjs');
4
5
  const require_estimate_fee = require('../../lib/estimate-fee.cjs');
5
6
  const require_parse_defuse_asset_id = require('../../lib/parse-defuse-asset-id.cjs');
6
7
  const require_validateAddress = require('../../lib/validateAddress.cjs');
@@ -139,9 +140,11 @@ var OmniBridge = class {
139
140
  (0, _defuse_protocol_internal_utils.assert)(utxoProtocolFee !== void 0 && utxoProtocolFee > 0n, `Invalid Omni Bridge utxo protocol fee: expected > 0, got ${utxoProtocolFee}`);
140
141
  amount += utxoMaxGasFee + utxoProtocolFee;
141
142
  }
143
+ let destinationAddress = args.withdrawalParams.destinationAddress;
144
+ if (assetInfo.blockchain === require_caip2.Chains.Bitcoin && /^bc1/i.test(destinationAddress)) destinationAddress = destinationAddress.toLowerCase();
142
145
  intents.push(...require_omni_bridge_utils.createWithdrawIntentsPrimitive({
143
146
  assetId: args.withdrawalParams.assetId,
144
- destinationAddress: args.withdrawalParams.destinationAddress,
147
+ destinationAddress,
145
148
  amount,
146
149
  omniChainKind,
147
150
  intentsContract: this.envConfig.contractID,
@@ -1,5 +1,6 @@
1
1
  import { InvalidDestinationAddressForWithdrawalError, MinWithdrawalAmountError, UnsupportedAssetIdError } from "../../classes/errors.js";
2
2
  import { RouteEnum } from "../../constants/route-enum.js";
3
+ import { Chains } from "../../lib/caip2.js";
3
4
  import { getFeeQuote, getUnderlyingFee } from "../../lib/estimate-fee.js";
4
5
  import { parseDefuseAssetId } from "../../lib/parse-defuse-asset-id.js";
5
6
  import { validateAddress } from "../../lib/validateAddress.js";
@@ -137,9 +138,11 @@ var OmniBridge = class {
137
138
  assert(utxoProtocolFee !== void 0 && utxoProtocolFee > 0n, `Invalid Omni Bridge utxo protocol fee: expected > 0, got ${utxoProtocolFee}`);
138
139
  amount += utxoMaxGasFee + utxoProtocolFee;
139
140
  }
141
+ let destinationAddress = args.withdrawalParams.destinationAddress;
142
+ if (assetInfo.blockchain === Chains.Bitcoin && /^bc1/i.test(destinationAddress)) destinationAddress = destinationAddress.toLowerCase();
140
143
  intents.push(...createWithdrawIntentsPrimitive({
141
144
  assetId: args.withdrawalParams.assetId,
142
- destinationAddress: args.withdrawalParams.destinationAddress,
145
+ destinationAddress,
143
146
  amount,
144
147
  omniChainKind,
145
148
  intentsContract: this.envConfig.contractID,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defuse-protocol/intents-sdk",
3
- "version": "0.62.1",
3
+ "version": "0.62.2",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "repository": {