@bulletxyz/bullet-sdk 0.26.2-rc.4 → 0.26.2-rc.6

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.
@@ -9807,9 +9807,30 @@ var Client = class _Client {
9807
9807
  }
9808
9808
  });
9809
9809
  }
9810
- async initPerpMarket(market, baseAsset, name, minTickSize, minLotSize, maxOrdersPerSide, minInterestRateClamp, maxInterestRateClamp, minFundingRateClamp, maxFundingRateClamp, impactMargin, interestRate, initLeverageTableArgs, takerFeesTenthBps, makerFeesTenthBps) {
9811
- const marketId = this.exchange.getMarketId(market);
9812
- const baseAssetId = this.exchange.getAssetId(baseAsset);
9810
+ async initSpotMarket(marketId, baseAssetId, quoteAssetId, baseMinLotSize, quoteMinLotSize, maxOrdersPerSide, takerFeesTenthBps, makerFeesTenthBps, name) {
9811
+ return await this.submitTransaction({
9812
+ exchange: {
9813
+ init_spot_market: {
9814
+ args: {
9815
+ market_id: marketId,
9816
+ base_asset_id: baseAssetId,
9817
+ quote_asset_id: quoteAssetId,
9818
+ base_min_lot_size: BulletWasm.convert_rust_decimal_to_json(
9819
+ baseMinLotSize.toFixed()
9820
+ ),
9821
+ quote_min_lot_size: BulletWasm.convert_rust_decimal_to_json(
9822
+ quoteMinLotSize.toFixed()
9823
+ ),
9824
+ max_orders_per_side: maxOrdersPerSide,
9825
+ taker_fees_tenth_bps: takerFeesTenthBps,
9826
+ maker_fees_tenth_bps: makerFeesTenthBps,
9827
+ name
9828
+ }
9829
+ }
9830
+ }
9831
+ });
9832
+ }
9833
+ async initPerpMarket(marketId, baseAssetId, name, minTickSize, minLotSize, maxOrdersPerSide, minInterestRateClamp, maxInterestRateClamp, minFundingRateClamp, maxFundingRateClamp, impactMargin, interestRate, initLeverageTableArgs, takerFeesTenthBps, makerFeesTenthBps) {
9813
9834
  return await this.submitTransaction({
9814
9835
  exchange: {
9815
9836
  init_perp_market: {
@@ -9842,7 +9863,14 @@ var Client = class _Client {
9842
9863
  interest_rate: BulletWasm.convert_rust_decimal_to_json(
9843
9864
  interestRate.toFixed()
9844
9865
  ),
9845
- init_leverage_table_args: initLeverageTableArgs,
9866
+ init_leverage_table_args: new Map(
9867
+ Array.from(initLeverageTableArgs.entries()).map(
9868
+ ([decimalKey, value]) => [
9869
+ BulletWasm.convert_rust_decimal_to_json(decimalKey.toFixed()),
9870
+ value
9871
+ ]
9872
+ )
9873
+ ),
9846
9874
  taker_fees_tenth_bps: takerFeesTenthBps,
9847
9875
  maker_fees_tenth_bps: makerFeesTenthBps
9848
9876
  }
@@ -9850,8 +9878,7 @@ var Client = class _Client {
9850
9878
  }
9851
9879
  });
9852
9880
  }
9853
- async initBorrowLendPool(asset, optimalUtilisationRate, minBorrowRate, maxBorrowRate, optimalBorrowRate, assetWeight, initialLiabilityWeight, maintenanceLiabilityWeight, depositLimit, borrowLimit, liquidationRewardRatio, liabilityLiquidationLimitRatio, interestFeeTenthBps) {
9854
- const assetId = this.exchange.getAssetId(asset);
9881
+ async initBorrowLendPool(assetId, optimalUtilisationRate, minBorrowRate, maxBorrowRate, optimalBorrowRate, assetWeight, initialLiabilityWeight, maintenanceLiabilityWeight, depositLimit, borrowLimit, liquidationTotalRewardRatio, protocolRewardRatio, liabilityLiquidationLimitRatio, interestFeeTenthBps) {
9855
9882
  return await this.submitTransaction({
9856
9883
  exchange: {
9857
9884
  init_borrow_lend_pool: {
@@ -9884,8 +9911,11 @@ var Client = class _Client {
9884
9911
  borrow_limit: BulletWasm.convert_rust_decimal_to_json(
9885
9912
  borrowLimit.toFixed()
9886
9913
  ),
9887
- liquidation_reward_ratio: BulletWasm.convert_rust_decimal_to_json(
9888
- liquidationRewardRatio.toFixed()
9914
+ liquidation_total_reward_ratio: BulletWasm.convert_rust_decimal_to_json(
9915
+ liquidationTotalRewardRatio.toFixed()
9916
+ ),
9917
+ protocol_reward_ratio: BulletWasm.convert_rust_decimal_to_json(
9918
+ protocolRewardRatio.toFixed()
9889
9919
  ),
9890
9920
  liability_liquidation_limit_ratio: BulletWasm.convert_rust_decimal_to_json(
9891
9921
  liabilityLiquidationLimitRatio.toFixed()