@exodus/sui-api 1.1.2 → 1.1.3

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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.1.3](https://github.com/ExodusMovement/assets/compare/@exodus/sui-api@1.1.2...@exodus/sui-api@1.1.3) (2025-11-03)
7
+
8
+ **Note:** Version bump only for package @exodus/sui-api
9
+
10
+
11
+
12
+
13
+
6
14
  ## [1.1.2](https://github.com/ExodusMovement/assets/compare/@exodus/sui-api@1.1.1...@exodus/sui-api@1.1.2) (2025-11-02)
7
15
 
8
16
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@exodus/sui-api",
3
3
  "packageManager": "yarn@4.3.1",
4
- "version": "1.1.2",
4
+ "version": "1.1.3",
5
5
  "description": "Transaction monitors, RPC with the blockchain node, and other networking code for Sui",
6
6
  "type": "module",
7
7
  "main": "src/index.js",
@@ -50,5 +50,5 @@
50
50
  "type": "git",
51
51
  "url": "git+https://github.com/ExodusMovement/assets.git"
52
52
  },
53
- "gitHead": "05a1bf4c4e5be38ef0a77d67aa11af0e49002dec"
53
+ "gitHead": "1792bda2b5f11b36e67d2e36669341b51002197f"
54
54
  }
@@ -40,17 +40,36 @@ export const getFeeAsyncFactory = ({ assetClientInterface, serverApi, createUnsi
40
40
  'Invalid simulation result'
41
41
  )
42
42
 
43
- let fee = getFeeAmount({
43
+ const fee = getFeeAmount({
44
44
  feeAsset,
45
45
  gasUsed,
46
46
  })
47
47
 
48
+ const baseAssetAccountState = await assetClientInterface.getAccountState({
49
+ assetName: asset.baseAsset.name,
50
+ walletAccount,
51
+ })
52
+
48
53
  const gasBudget = getGasBudget({ gasUsed, feeAsset })
49
54
 
55
+ const balance = baseAssetAccountState.utxos.value
56
+
50
57
  if (fee.lt(asset.feeAsset.currency.baseUnit(MIN_GAS_BUDGET))) {
51
58
  // sometimes we can receive a negative fee because of storage rebate
52
59
  // so we use the gas budget instead
53
- fee = gasBudget
60
+
61
+ return {
62
+ fee: gasBudget,
63
+ gasBudget: gasBudget.toNumber(),
64
+ }
65
+ }
66
+
67
+ if (gasBudget.gt(balance)) {
68
+ // if the gas budget is greater than balance, allow to try to send with fee
69
+ return {
70
+ fee,
71
+ gasBudget: fee.toNumber(),
72
+ }
54
73
  }
55
74
 
56
75
  return {