@bulletxyz/bullet-sdk 0.25.4-rc.8 → 0.25.4
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 +10 -105
- package/dist/browser/index.js.map +2 -2
- package/dist/node/index.js +10 -105
- package/dist/node/index.js.map +2 -2
- package/dist/types/bullet-wasm/index.d.ts +1 -1
- package/dist/types/calc.d.ts +1 -1
- package/dist/types/client.d.ts +3 -6
- package/dist/types/rollupTypes.d.ts +2 -42
- package/dist/types/types.d.ts +1 -2
- package/package.json +1 -1
|
@@ -14,7 +14,7 @@ export class BulletWasm {
|
|
|
14
14
|
static calculate_account_equity(user_account: any, conservative: boolean, equity_type: EquityType, margin_calculation_state: any): string;
|
|
15
15
|
static calculate_account_leverage(user_account: any, margin_calculation_state: any): string;
|
|
16
16
|
static calculate_available_margin(user_account: any, conservative: boolean, margin_type: MarginType, margin_calculation_state: any): string;
|
|
17
|
-
static calculate_used_margin(user_account: any,
|
|
17
|
+
static calculate_used_margin(user_account: any, margin_type: MarginType, margin_calculation_state: any): string;
|
|
18
18
|
static calculate_withdrawable_amount_of_asset(user_account: any, asset_id: number, margin_calculation_state: any): string;
|
|
19
19
|
static calculate_estimated_liquidation_price(user_account: any, market_id: number, base_asset_id: number, margin_calculation_state: any): string;
|
|
20
20
|
static calculate_liquidation_risk_percentage(user_account: any, margin_calculation_state: any): string;
|
package/dist/types/calc.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export declare function calculateTotalPerpUnrealizedPnl(userAccount: UserAccount
|
|
|
13
13
|
export declare function calculateAccountEquity(equityType: EquityType, conservative: boolean, userAccount: UserAccount, MarginCalculationState: MarginCalculationState): Decimal;
|
|
14
14
|
export declare function calculateAccountLeverage(userAccount: UserAccount, MarginCalculationState: MarginCalculationState): Decimal;
|
|
15
15
|
export declare function calculateAvailableMargin(marginType: MarginType, conservative: boolean, userAccount: UserAccount, MarginCalculationState: MarginCalculationState): Decimal;
|
|
16
|
-
export declare function calculateUsedMargin(
|
|
16
|
+
export declare function calculateUsedMargin(marginType: MarginType, userAccount: UserAccount, MarginCalculationState: MarginCalculationState): Decimal;
|
|
17
17
|
export declare function calculateWithdrawableAmountOfAsset(asset: Asset, userAccount: UserAccount, MarginCalculationState: MarginCalculationState): Decimal;
|
|
18
18
|
export declare function calculateEstimatedLiquidationPrice(market: Market, asset: Asset, userAccount: UserAccount, MarginCalculationState: MarginCalculationState): Decimal;
|
|
19
19
|
export declare function calculateLiquidationRiskPercentage(userAccount: UserAccount, MarginCalculationState: MarginCalculationState): Decimal;
|
package/dist/types/client.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export interface TransactionOpts {
|
|
|
12
12
|
gasLimit: number[] | null;
|
|
13
13
|
chainId: number;
|
|
14
14
|
}
|
|
15
|
-
type
|
|
15
|
+
type ReplaceOrderOptions = {
|
|
16
16
|
existingOrderId: bigint;
|
|
17
17
|
existingClientOrderId?: never;
|
|
18
18
|
placeOrderArgs: PlaceOrderArgs;
|
|
@@ -115,8 +115,8 @@ export declare class Client {
|
|
|
115
115
|
withdraw(asset: Asset, amount: Decimal): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
116
116
|
borrowSpot(asset: Asset, amount: Decimal): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
117
117
|
placeOrder(placeOrderArgs: PlaceOrderArgs): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
placeTpslsForMarket(market: Market, tpslOrders: PlacePositionTpslArgs): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
119
|
+
replaceOrder(options: ReplaceOrderOptions): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
120
120
|
cancelTpsl(tpslOrderId: bigint): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
121
121
|
cancelOrder(orderId?: bigint, clientOrderId?: bigint): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
122
122
|
cancelAllOrdersForMarket(market: Market): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
@@ -136,8 +136,5 @@ export declare class Client {
|
|
|
136
136
|
liquidateSpotLiability(address: Address, liabilityAssetId: Asset, collateralAssetId: Asset, liabilityAmount: Decimal): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
137
137
|
depositToUsdcPnlPool(amount: Decimal): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
138
138
|
depositToInsuranceFund(amount: Decimal): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
139
|
-
initAssetMetadata(asset: Asset, assetName: string, tokenId: TokenId, decimals: number): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
140
|
-
initBorrowLendMarket(asset: Asset, optimalUtilisationRate: Decimal, minBorrowRate: Decimal, maxBorrowRate: Decimal, optimalBorrowRate: Decimal, assetWeight: Decimal, initialLiabilityWeight: Decimal, maintenanceLiabilityWeight: Decimal, depositLimit: Decimal, borrowLimit: Decimal, liquidationRewardRatio: Decimal, liabilityLiquidationLimitRatio: Decimal): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
141
|
-
updateBorrowLendMarket(asset: Asset, optimalUtilisationRate: Decimal | null, minBorrowRate: Decimal | null, maxBorrowRate: Decimal | null, optimalBorrowRate: Decimal | null, assetWeight: Decimal | null, initialLiabilityWeight: Decimal | null, maintenanceLiabilityWeight: Decimal | null, depositLimit: Decimal | null, borrowLimit: Decimal | null, liquidationRewardRatio: Decimal | null, liabilityLiquidationLimitRatio: Decimal | null): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
142
139
|
}
|
|
143
140
|
export {};
|
|
@@ -65,11 +65,11 @@ type ExchangeCallMessage = {
|
|
|
65
65
|
tpsl: PendingTriggerOrderArgs | null;
|
|
66
66
|
};
|
|
67
67
|
};
|
|
68
|
-
|
|
68
|
+
place_tpsl_for_market: {
|
|
69
69
|
market_id: MarketId;
|
|
70
70
|
tpsl: PlacePositionTpslArgs;
|
|
71
71
|
};
|
|
72
|
-
|
|
72
|
+
replace_order: {
|
|
73
73
|
existing_order_id: string | null;
|
|
74
74
|
existing_client_order_id: string | null;
|
|
75
75
|
order_args: {
|
|
@@ -149,46 +149,6 @@ type ExchangeCallMessage = {
|
|
|
149
149
|
deposit_to_insurance_fund: {
|
|
150
150
|
usdc_amount: number;
|
|
151
151
|
};
|
|
152
|
-
init_asset_metadata: {
|
|
153
|
-
args: {
|
|
154
|
-
asset_id: AssetId;
|
|
155
|
-
asset_name: string;
|
|
156
|
-
token_id: TokenId;
|
|
157
|
-
decimals: number;
|
|
158
|
-
};
|
|
159
|
-
};
|
|
160
|
-
init_borrow_lend_market: {
|
|
161
|
-
args: {
|
|
162
|
-
asset_id: AssetId;
|
|
163
|
-
optimal_utilisation_rate: number;
|
|
164
|
-
min_borrow_rate: number;
|
|
165
|
-
max_borrow_rate: number;
|
|
166
|
-
optimal_borrow_rate: number;
|
|
167
|
-
asset_weight: number;
|
|
168
|
-
initial_liability_weight: number;
|
|
169
|
-
maintenance_liability_weight: number;
|
|
170
|
-
deposit_limit: number;
|
|
171
|
-
borrow_limit: number;
|
|
172
|
-
liquidation_reward_ratio: number;
|
|
173
|
-
liability_liquidation_limit_ratio: number;
|
|
174
|
-
};
|
|
175
|
-
};
|
|
176
|
-
update_borrow_lend_market: {
|
|
177
|
-
args: {
|
|
178
|
-
asset_id: AssetId;
|
|
179
|
-
optimal_utilisation_rate: number | null;
|
|
180
|
-
min_borrow_rate: number | null;
|
|
181
|
-
max_borrow_rate: number | null;
|
|
182
|
-
optimal_borrow_rate: number | null;
|
|
183
|
-
asset_weight: number | null;
|
|
184
|
-
initial_liability_weight: number | null;
|
|
185
|
-
maintenance_liability_weight: number | null;
|
|
186
|
-
deposit_limit: number | null;
|
|
187
|
-
borrow_limit: number | null;
|
|
188
|
-
liquidation_reward_ratio: number | null;
|
|
189
|
-
liability_liquidation_limit_ratio: number | null;
|
|
190
|
-
};
|
|
191
|
-
};
|
|
192
152
|
};
|
|
193
153
|
export type RuntimeCall = ExactlyOne<{
|
|
194
154
|
exchange: ExactlyOne<ExchangeCallMessage>;
|
package/dist/types/types.d.ts
CHANGED