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