@defuse-protocol/intents-sdk 0.45.2 → 0.45.4

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.
@@ -99,15 +99,19 @@ var HotBridge = class {
99
99
  const assetInfo = this.parseAssetId(args.withdrawalParams.assetId);
100
100
  (0, _defuse_protocol_internal_utils.assert)(assetInfo != null, "Asset is not supported");
101
101
  require_hot_bridge_utils.hotBlockchainInvariant(assetInfo.blockchain);
102
- const { gasPrice: feeAmount, blockNumber } = await (0, _defuse_protocol_internal_utils.withTimeout)(() => this.hotSdk.getGaslessWithdrawFee({
103
- chain: require_hot_bridge_utils.toHotNetworkId(assetInfo.blockchain),
104
- token: "native" in assetInfo ? "native" : assetInfo.address,
105
- receiver: args.withdrawalParams.destinationAddress
106
- }), {
102
+ const feeAssetId = require_hot_bridge_utils.getFeeAssetIdForChain(assetInfo.blockchain);
103
+ const { gasPrice: feeAmount, blockNumber } = await (0, _defuse_protocol_internal_utils.withTimeout)(async () => {
104
+ const result = await this.hotSdk.getGaslessWithdrawFee({
105
+ chain: require_hot_bridge_utils.toHotNetworkId(assetInfo.blockchain),
106
+ token: "native" in assetInfo ? "native" : assetInfo.address,
107
+ receiver: args.withdrawalParams.destinationAddress
108
+ });
109
+ if (assetInfo.blockchain === require_caip2.Chains.Plasma && args.withdrawalParams.assetId !== feeAssetId) result.gasPrice *= 20n;
110
+ return result;
111
+ }, {
107
112
  errorInstance: new require_error.HotWithdrawalApiFeeRequestTimeoutError(),
108
113
  timeout: typeof window !== "undefined" ? 1e4 : 3e3
109
114
  });
110
- const feeAssetId = require_hot_bridge_utils.getFeeAssetIdForChain(assetInfo.blockchain);
111
115
  const feeQuote = args.withdrawalParams.assetId === feeAssetId || feeAmount === 0n ? null : await require_estimate_fee.getFeeQuote({
112
116
  feeAmount,
113
117
  feeAssetId,
@@ -98,15 +98,19 @@ var HotBridge$1 = class {
98
98
  const assetInfo = this.parseAssetId(args.withdrawalParams.assetId);
99
99
  assert(assetInfo != null, "Asset is not supported");
100
100
  hotBlockchainInvariant(assetInfo.blockchain);
101
- const { gasPrice: feeAmount, blockNumber } = await withTimeout(() => this.hotSdk.getGaslessWithdrawFee({
102
- chain: toHotNetworkId(assetInfo.blockchain),
103
- token: "native" in assetInfo ? "native" : assetInfo.address,
104
- receiver: args.withdrawalParams.destinationAddress
105
- }), {
101
+ const feeAssetId = getFeeAssetIdForChain(assetInfo.blockchain);
102
+ const { gasPrice: feeAmount, blockNumber } = await withTimeout(async () => {
103
+ const result = await this.hotSdk.getGaslessWithdrawFee({
104
+ chain: toHotNetworkId(assetInfo.blockchain),
105
+ token: "native" in assetInfo ? "native" : assetInfo.address,
106
+ receiver: args.withdrawalParams.destinationAddress
107
+ });
108
+ if (assetInfo.blockchain === Chains.Plasma && args.withdrawalParams.assetId !== feeAssetId) result.gasPrice *= 20n;
109
+ return result;
110
+ }, {
106
111
  errorInstance: new HotWithdrawalApiFeeRequestTimeoutError(),
107
112
  timeout: typeof window !== "undefined" ? 1e4 : 3e3
108
113
  });
109
- const feeAssetId = getFeeAssetIdForChain(assetInfo.blockchain);
110
114
  const feeQuote = args.withdrawalParams.assetId === feeAssetId || feeAmount === 0n ? null : await getFeeQuote({
111
115
  feeAmount,
112
116
  feeAssetId,
@@ -1,3 +1,4 @@
1
+ import "../shared-types.js";
1
2
  import { BaseError, ILogger } from "@defuse-protocol/internal-utils";
2
3
 
3
4
  //#region src/core/withdrawal-watcher.d.ts
@@ -1,4 +1,8 @@
1
+ import "../expirable-nonce.js";
1
2
  import { IntentHash, IntentPayload, MultiPayload, RelayParamsDefault } from "../shared-types.js";
3
+ import "../interfaces/intent-executer.js";
4
+ import "../../shared-types.js";
5
+ import "../interfaces/intent-relayer.js";
2
6
  import { ILogger, NearIntentsEnv } from "@defuse-protocol/internal-utils";
3
7
 
4
8
  //#region src/intents/intent-executer-impl/intent-executer.d.ts
@@ -1,3 +1,4 @@
1
+ import "./intent-signer-nep413.js";
1
2
  import * as near_api_js0 from "near-api-js";
2
3
 
3
4
  //#region src/intents/intent-signer-impl/intent-signer-near-keypair.d.ts
@@ -0,0 +1,2 @@
1
+ import "../expirable-nonce.js";
2
+ import "../../shared-types.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defuse-protocol/intents-sdk",
3
- "version": "0.45.2",
3
+ "version": "0.45.4",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "repository": {
@@ -47,11 +47,11 @@
47
47
  "ripple-address-codec": "^5.0.0",
48
48
  "valibot": "^1.0.0",
49
49
  "viem": "^2.0.0",
50
- "@defuse-protocol/contract-types": "0.4.3",
51
- "@defuse-protocol/internal-utils": "0.23.0"
50
+ "@defuse-protocol/contract-types": "0.4.4",
51
+ "@defuse-protocol/internal-utils": "0.23.1"
52
52
  },
53
53
  "devDependencies": {
54
- "tsdown": "0.15.5"
54
+ "tsdown": "0.19.0"
55
55
  },
56
56
  "scripts": {
57
57
  "build": "tsdown",