@bulletxyz/bullet-sdk 0.17.3-rc.0 → 0.17.3-rc.1

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.
@@ -2419,7 +2419,7 @@ function serialize(value) {
2419
2419
  return value;
2420
2420
  }
2421
2421
  if (value instanceof decimal_default) {
2422
- return value.toFixed();
2422
+ return value.toString();
2423
2423
  }
2424
2424
  if (typeof value === "bigint") {
2425
2425
  if (value > BigInt(Number.MAX_SAFE_INTEGER)) {
@@ -8939,7 +8939,7 @@ var Client = class _Client {
8939
8939
  exchange: {
8940
8940
  deposit: {
8941
8941
  asset_id: asset,
8942
- amount: BulletWasm.convert_rust_decimal_to_json(amount.toFixed())
8942
+ amount: BulletWasm.convert_rust_decimal_to_json(amount.toString())
8943
8943
  }
8944
8944
  }
8945
8945
  });
@@ -8949,7 +8949,7 @@ var Client = class _Client {
8949
8949
  exchange: {
8950
8950
  withdraw: {
8951
8951
  asset_id: asset,
8952
- amount: BulletWasm.convert_rust_decimal_to_json(amount.toFixed())
8952
+ amount: BulletWasm.convert_rust_decimal_to_json(amount.toString())
8953
8953
  }
8954
8954
  }
8955
8955
  });
@@ -8959,7 +8959,7 @@ var Client = class _Client {
8959
8959
  exchange: {
8960
8960
  borrow_spot: {
8961
8961
  asset_id: asset,
8962
- amount: BulletWasm.convert_rust_decimal_to_json(amount.toFixed())
8962
+ amount: BulletWasm.convert_rust_decimal_to_json(amount.toString())
8963
8963
  }
8964
8964
  }
8965
8965
  });
@@ -8970,8 +8970,8 @@ var Client = class _Client {
8970
8970
  place_order: {
8971
8971
  order_args: {
8972
8972
  asset_id: asset,
8973
- price: BulletWasm.convert_rust_decimal_to_json(price.toFixed()),
8974
- size: BulletWasm.convert_rust_decimal_to_json(size.toFixed()),
8973
+ price: BulletWasm.convert_rust_decimal_to_json(price.toString()),
8974
+ size: BulletWasm.convert_rust_decimal_to_json(size.toString()),
8975
8975
  side,
8976
8976
  order_type: orderType,
8977
8977
  reduce_only: reduceOnly
@@ -8986,14 +8986,14 @@ var Client = class _Client {
8986
8986
  orderType: orderType2
8987
8987
  }) => ({
8988
8988
  order_price: BulletWasm.convert_rust_decimal_to_json(
8989
- orderPrice.toFixed()
8989
+ orderPrice.toString()
8990
8990
  ),
8991
8991
  trigger_price: BulletWasm.convert_rust_decimal_to_json(
8992
- triggerPrice.toFixed()
8992
+ triggerPrice.toString()
8993
8993
  ),
8994
8994
  trigger_direction: triggerDirection,
8995
8995
  tpsl_price_condition: tpslPriceCondition,
8996
- size: BulletWasm.convert_rust_decimal_to_json(size2.toFixed()),
8996
+ size: BulletWasm.convert_rust_decimal_to_json(size2.toString()),
8997
8997
  order_type: orderType2
8998
8998
  })
8999
8999
  )
@@ -9016,14 +9016,14 @@ var Client = class _Client {
9016
9016
  orderType
9017
9017
  }) => ({
9018
9018
  order_price: BulletWasm.convert_rust_decimal_to_json(
9019
- orderPrice.toFixed()
9019
+ orderPrice.toString()
9020
9020
  ),
9021
9021
  trigger_price: BulletWasm.convert_rust_decimal_to_json(
9022
- triggerPrice.toFixed()
9022
+ triggerPrice.toString()
9023
9023
  ),
9024
9024
  trigger_direction: triggerDirection,
9025
9025
  tpsl_price_condition: tpslPriceCondition,
9026
- size: BulletWasm.convert_rust_decimal_to_json(size.toFixed()),
9026
+ size: BulletWasm.convert_rust_decimal_to_json(size.toString()),
9027
9027
  order_type: orderType
9028
9028
  })
9029
9029
  )
@@ -9038,8 +9038,8 @@ var Client = class _Client {
9038
9038
  existing_order_id: existingOrderId.toString(),
9039
9039
  order_args: {
9040
9040
  asset_id: asset,
9041
- price: BulletWasm.convert_rust_decimal_to_json(price.toFixed()),
9042
- size: BulletWasm.convert_rust_decimal_to_json(size.toFixed()),
9041
+ price: BulletWasm.convert_rust_decimal_to_json(price.toString()),
9042
+ size: BulletWasm.convert_rust_decimal_to_json(size.toString()),
9043
9043
  side,
9044
9044
  order_type: orderType,
9045
9045
  reduce_only: reduceOnly
@@ -9054,14 +9054,14 @@ var Client = class _Client {
9054
9054
  orderType: orderType2
9055
9055
  }) => ({
9056
9056
  order_price: BulletWasm.convert_rust_decimal_to_json(
9057
- orderPrice.toFixed()
9057
+ orderPrice.toString()
9058
9058
  ),
9059
9059
  trigger_price: BulletWasm.convert_rust_decimal_to_json(
9060
- triggerPrice.toFixed()
9060
+ triggerPrice.toString()
9061
9061
  ),
9062
9062
  trigger_direction: triggerDirection,
9063
9063
  tpsl_price_condition: tpslPriceCondition,
9064
- size: BulletWasm.convert_rust_decimal_to_json(size2.toFixed()),
9064
+ size: BulletWasm.convert_rust_decimal_to_json(size2.toString()),
9065
9065
  order_type: orderType2
9066
9066
  })
9067
9067
  )
@@ -9107,13 +9107,13 @@ var Client = class _Client {
9107
9107
  ({ asset, medianCexPrice, oraclePrice, diffEma }) => ({
9108
9108
  asset_id: asset,
9109
9109
  median_cex_price: BulletWasm.convert_rust_decimal_to_json(
9110
- medianCexPrice.toFixed()
9110
+ medianCexPrice.toString()
9111
9111
  ),
9112
9112
  oracle_price: BulletWasm.convert_rust_decimal_to_json(
9113
- oraclePrice.toFixed()
9113
+ oraclePrice.toString()
9114
9114
  ),
9115
9115
  diff_ema: BulletWasm.convert_rust_decimal_to_json(
9116
- diffEma.toFixed()
9116
+ diffEma.toString()
9117
9117
  )
9118
9118
  })
9119
9119
  ),
@@ -9177,7 +9177,7 @@ var Client = class _Client {
9177
9177
  address: base58ToBytes(address),
9178
9178
  positions: positions?.map(({ asset, size }) => ({
9179
9179
  asset_id: asset,
9180
- size: BulletWasm.convert_rust_decimal_to_json(size.toFixed())
9180
+ size: BulletWasm.convert_rust_decimal_to_json(size.toString())
9181
9181
  })) ?? null
9182
9182
  }
9183
9183
  }
@@ -9191,7 +9191,7 @@ var Client = class _Client {
9191
9191
  liability_asset_id: liabilityAssetId,
9192
9192
  collateral_asset_id: collateralAssetId,
9193
9193
  liability_amount: BulletWasm.convert_rust_decimal_to_json(
9194
- liabilityAmount.toFixed()
9194
+ liabilityAmount.toString()
9195
9195
  )
9196
9196
  }
9197
9197
  }
@@ -9202,7 +9202,7 @@ var Client = class _Client {
9202
9202
  exchange: {
9203
9203
  deposit_to_usdc_pnl_pool: {
9204
9204
  usdc_amount: BulletWasm.convert_rust_decimal_to_json(
9205
- amount.toFixed()
9205
+ amount.toString()
9206
9206
  )
9207
9207
  }
9208
9208
  }
@@ -9213,7 +9213,7 @@ var Client = class _Client {
9213
9213
  exchange: {
9214
9214
  deposit_to_insurance_fund: {
9215
9215
  usdc_amount: BulletWasm.convert_rust_decimal_to_json(
9216
- amount.toFixed()
9216
+ amount.toString()
9217
9217
  )
9218
9218
  }
9219
9219
  }
@@ -9429,12 +9429,12 @@ function calculateMaxOrderSize(assetId, side, price, reduceOnly, userAccount, ma
9429
9429
  userAccountObject,
9430
9430
  assetId,
9431
9431
  side === "Bid" ? Side.Bid : Side.Ask,
9432
- price.toFixed(),
9432
+ price.toString(),
9433
9433
  reduceOnly,
9434
9434
  marginContextObject,
9435
9435
  side == "Bid" ? makerBook.asks : makerBook.bids,
9436
9436
  n_iterations,
9437
- error_tolerance.toFixed()
9437
+ error_tolerance.toString()
9438
9438
  );
9439
9439
  return new decimal_default(result);
9440
9440
  }
@@ -9443,7 +9443,7 @@ function simulateUsedMarginOnBorrow(assetId, borrowAmount, userAccount, marginTy
9443
9443
  const marginContextObject = serialize(marginContext);
9444
9444
  const result = BulletWasm.simulate_used_margin_on_borrow(
9445
9445
  assetId,
9446
- borrowAmount.toFixed(),
9446
+ borrowAmount.toString(),
9447
9447
  userAccountObject,
9448
9448
  marginType,
9449
9449
  marginContextObject