@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)) {
@@ -8925,7 +8925,7 @@ var Client = class _Client {
8925
8925
  exchange: {
8926
8926
  deposit: {
8927
8927
  asset_id: asset,
8928
- amount: BulletWasm.convert_rust_decimal_to_json(amount.toFixed())
8928
+ amount: BulletWasm.convert_rust_decimal_to_json(amount.toString())
8929
8929
  }
8930
8930
  }
8931
8931
  });
@@ -8935,7 +8935,7 @@ var Client = class _Client {
8935
8935
  exchange: {
8936
8936
  withdraw: {
8937
8937
  asset_id: asset,
8938
- amount: BulletWasm.convert_rust_decimal_to_json(amount.toFixed())
8938
+ amount: BulletWasm.convert_rust_decimal_to_json(amount.toString())
8939
8939
  }
8940
8940
  }
8941
8941
  });
@@ -8945,7 +8945,7 @@ var Client = class _Client {
8945
8945
  exchange: {
8946
8946
  borrow_spot: {
8947
8947
  asset_id: asset,
8948
- amount: BulletWasm.convert_rust_decimal_to_json(amount.toFixed())
8948
+ amount: BulletWasm.convert_rust_decimal_to_json(amount.toString())
8949
8949
  }
8950
8950
  }
8951
8951
  });
@@ -8956,8 +8956,8 @@ var Client = class _Client {
8956
8956
  place_order: {
8957
8957
  order_args: {
8958
8958
  asset_id: asset,
8959
- price: BulletWasm.convert_rust_decimal_to_json(price.toFixed()),
8960
- size: BulletWasm.convert_rust_decimal_to_json(size.toFixed()),
8959
+ price: BulletWasm.convert_rust_decimal_to_json(price.toString()),
8960
+ size: BulletWasm.convert_rust_decimal_to_json(size.toString()),
8961
8961
  side,
8962
8962
  order_type: orderType,
8963
8963
  reduce_only: reduceOnly
@@ -8972,14 +8972,14 @@ var Client = class _Client {
8972
8972
  orderType: orderType2
8973
8973
  }) => ({
8974
8974
  order_price: BulletWasm.convert_rust_decimal_to_json(
8975
- orderPrice.toFixed()
8975
+ orderPrice.toString()
8976
8976
  ),
8977
8977
  trigger_price: BulletWasm.convert_rust_decimal_to_json(
8978
- triggerPrice.toFixed()
8978
+ triggerPrice.toString()
8979
8979
  ),
8980
8980
  trigger_direction: triggerDirection,
8981
8981
  tpsl_price_condition: tpslPriceCondition,
8982
- size: BulletWasm.convert_rust_decimal_to_json(size2.toFixed()),
8982
+ size: BulletWasm.convert_rust_decimal_to_json(size2.toString()),
8983
8983
  order_type: orderType2
8984
8984
  })
8985
8985
  )
@@ -9002,14 +9002,14 @@ var Client = class _Client {
9002
9002
  orderType
9003
9003
  }) => ({
9004
9004
  order_price: BulletWasm.convert_rust_decimal_to_json(
9005
- orderPrice.toFixed()
9005
+ orderPrice.toString()
9006
9006
  ),
9007
9007
  trigger_price: BulletWasm.convert_rust_decimal_to_json(
9008
- triggerPrice.toFixed()
9008
+ triggerPrice.toString()
9009
9009
  ),
9010
9010
  trigger_direction: triggerDirection,
9011
9011
  tpsl_price_condition: tpslPriceCondition,
9012
- size: BulletWasm.convert_rust_decimal_to_json(size.toFixed()),
9012
+ size: BulletWasm.convert_rust_decimal_to_json(size.toString()),
9013
9013
  order_type: orderType
9014
9014
  })
9015
9015
  )
@@ -9024,8 +9024,8 @@ var Client = class _Client {
9024
9024
  existing_order_id: existingOrderId.toString(),
9025
9025
  order_args: {
9026
9026
  asset_id: asset,
9027
- price: BulletWasm.convert_rust_decimal_to_json(price.toFixed()),
9028
- size: BulletWasm.convert_rust_decimal_to_json(size.toFixed()),
9027
+ price: BulletWasm.convert_rust_decimal_to_json(price.toString()),
9028
+ size: BulletWasm.convert_rust_decimal_to_json(size.toString()),
9029
9029
  side,
9030
9030
  order_type: orderType,
9031
9031
  reduce_only: reduceOnly
@@ -9040,14 +9040,14 @@ var Client = class _Client {
9040
9040
  orderType: orderType2
9041
9041
  }) => ({
9042
9042
  order_price: BulletWasm.convert_rust_decimal_to_json(
9043
- orderPrice.toFixed()
9043
+ orderPrice.toString()
9044
9044
  ),
9045
9045
  trigger_price: BulletWasm.convert_rust_decimal_to_json(
9046
- triggerPrice.toFixed()
9046
+ triggerPrice.toString()
9047
9047
  ),
9048
9048
  trigger_direction: triggerDirection,
9049
9049
  tpsl_price_condition: tpslPriceCondition,
9050
- size: BulletWasm.convert_rust_decimal_to_json(size2.toFixed()),
9050
+ size: BulletWasm.convert_rust_decimal_to_json(size2.toString()),
9051
9051
  order_type: orderType2
9052
9052
  })
9053
9053
  )
@@ -9093,13 +9093,13 @@ var Client = class _Client {
9093
9093
  ({ asset, medianCexPrice, oraclePrice, diffEma }) => ({
9094
9094
  asset_id: asset,
9095
9095
  median_cex_price: BulletWasm.convert_rust_decimal_to_json(
9096
- medianCexPrice.toFixed()
9096
+ medianCexPrice.toString()
9097
9097
  ),
9098
9098
  oracle_price: BulletWasm.convert_rust_decimal_to_json(
9099
- oraclePrice.toFixed()
9099
+ oraclePrice.toString()
9100
9100
  ),
9101
9101
  diff_ema: BulletWasm.convert_rust_decimal_to_json(
9102
- diffEma.toFixed()
9102
+ diffEma.toString()
9103
9103
  )
9104
9104
  })
9105
9105
  ),
@@ -9163,7 +9163,7 @@ var Client = class _Client {
9163
9163
  address: base58ToBytes(address),
9164
9164
  positions: positions?.map(({ asset, size }) => ({
9165
9165
  asset_id: asset,
9166
- size: BulletWasm.convert_rust_decimal_to_json(size.toFixed())
9166
+ size: BulletWasm.convert_rust_decimal_to_json(size.toString())
9167
9167
  })) ?? null
9168
9168
  }
9169
9169
  }
@@ -9177,7 +9177,7 @@ var Client = class _Client {
9177
9177
  liability_asset_id: liabilityAssetId,
9178
9178
  collateral_asset_id: collateralAssetId,
9179
9179
  liability_amount: BulletWasm.convert_rust_decimal_to_json(
9180
- liabilityAmount.toFixed()
9180
+ liabilityAmount.toString()
9181
9181
  )
9182
9182
  }
9183
9183
  }
@@ -9188,7 +9188,7 @@ var Client = class _Client {
9188
9188
  exchange: {
9189
9189
  deposit_to_usdc_pnl_pool: {
9190
9190
  usdc_amount: BulletWasm.convert_rust_decimal_to_json(
9191
- amount.toFixed()
9191
+ amount.toString()
9192
9192
  )
9193
9193
  }
9194
9194
  }
@@ -9199,7 +9199,7 @@ var Client = class _Client {
9199
9199
  exchange: {
9200
9200
  deposit_to_insurance_fund: {
9201
9201
  usdc_amount: BulletWasm.convert_rust_decimal_to_json(
9202
- amount.toFixed()
9202
+ amount.toString()
9203
9203
  )
9204
9204
  }
9205
9205
  }
@@ -9348,12 +9348,12 @@ function calculateMaxOrderSize(assetId, side, price, reduceOnly, userAccount, ma
9348
9348
  userAccountObject,
9349
9349
  assetId,
9350
9350
  side === "Bid" ? Side.Bid : Side.Ask,
9351
- price.toFixed(),
9351
+ price.toString(),
9352
9352
  reduceOnly,
9353
9353
  marginContextObject,
9354
9354
  side == "Bid" ? makerBook.asks : makerBook.bids,
9355
9355
  n_iterations,
9356
- error_tolerance.toFixed()
9356
+ error_tolerance.toString()
9357
9357
  );
9358
9358
  return new decimal_default(result);
9359
9359
  }
@@ -9362,7 +9362,7 @@ function simulateUsedMarginOnBorrow(assetId, borrowAmount, userAccount, marginTy
9362
9362
  const marginContextObject = serialize(marginContext);
9363
9363
  const result = BulletWasm.simulate_used_margin_on_borrow(
9364
9364
  assetId,
9365
- borrowAmount.toFixed(),
9365
+ borrowAmount.toString(),
9366
9366
  userAccountObject,
9367
9367
  marginType,
9368
9368
  marginContextObject