@bulletxyz/bullet-sdk 0.26.3-rc.0 → 0.26.3
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 +95 -14
- package/dist/browser/index.js.map +2 -2
- package/dist/node/index.js +95 -14
- package/dist/node/index.js.map +2 -2
- package/dist/types/client.d.ts +5 -3
- package/dist/types/rollupTypes.d.ts +38 -3
- package/dist/types/types.d.ts +1 -0
- package/dist/types/zod-types/rest.d.ts +32 -0
- package/package.json +1 -1
package/dist/types/client.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { Connection } from "./connection";
|
|
|
4
4
|
import { type Endpoints } from "./constants";
|
|
5
5
|
import { ExchangeConnection } from "./exchange";
|
|
6
6
|
import type { RuntimeCall } from "./rollupTypes";
|
|
7
|
-
import { type Address, type AssetName, type MarkPriceUpdateArgs, type MarketName, type Network, type OraclePriceUpdateArgs, type PlaceOrderArgs, type PlacePositionTpslArgs, type TokenId } from "./types";
|
|
7
|
+
import { type Address, type AssetId, type AssetName, type MarkPriceUpdateArgs, type MarketName, type Network, type OraclePriceUpdateArgs, type PlaceOrderArgs, type PlacePositionTpslArgs, type TokenId } from "./types";
|
|
8
8
|
import type { Wallet } from "./wallet";
|
|
9
9
|
export interface TransactionOpts {
|
|
10
10
|
maxPriorityFeeBps: number;
|
|
@@ -184,8 +184,10 @@ export declare class Client {
|
|
|
184
184
|
liquidateSpotLiability(address: Address, liabilityAssetId: AssetName, collateralAssetId: AssetName, liabilityAmount: Decimal): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
185
185
|
depositToUsdcPnlPool(amount: Decimal): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
186
186
|
depositToInsuranceFund(amount: Decimal): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
187
|
-
initAssetMetadata(asset_id: number, assetName: string, tokenId: TokenId, decimals: number): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
188
|
-
|
|
187
|
+
initAssetMetadata(asset_id: number, assetName: string, tokenId: TokenId, decimals: number, withdrawFee: Decimal): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
188
|
+
initSpotMarket(marketId: number, baseAssetId: number, quoteAssetId: AssetId, baseMinLotSize: Decimal, quoteMinLotSize: Decimal, maxOrdersPerSide: number, takerFeesTenthBps: number[], makerFeesTenthBps: number[], name: string): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
189
|
+
initPerpMarket(marketId: number, baseAssetId: number, name: string, minTickSize: Decimal, minLotSize: Decimal, maxOrdersPerSide: number, minInterestRateClamp: Decimal, maxInterestRateClamp: Decimal, minFundingRateClamp: Decimal, maxFundingRateClamp: Decimal, impactMargin: Decimal, interestRate: Decimal, initLeverageTableArgs: Map<Decimal, number>, takerFeesTenthBps: number[], makerFeesTenthBps: number[]): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
190
|
+
initBorrowLendPool(assetId: number, optimalUtilisationRate: Decimal, minBorrowRate: Decimal, maxBorrowRate: Decimal, optimalBorrowRate: Decimal, assetWeight: Decimal, initialLiabilityWeight: Decimal, maintenanceLiabilityWeight: Decimal, depositLimit: Decimal, borrowLimit: Decimal, liquidationTotalRewardRatio: Decimal, protocolRewardRatio: Decimal, liabilityLiquidationLimitRatio: Decimal, interestFeeTenthBps: number): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
189
191
|
updateBorrowLendMarket(asset: AssetName, 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>>>;
|
|
190
192
|
}
|
|
191
193
|
export {};
|
|
@@ -158,7 +158,7 @@ type ExchangeCallMessage = {
|
|
|
158
158
|
force_close_positions: {
|
|
159
159
|
address: Address;
|
|
160
160
|
};
|
|
161
|
-
|
|
161
|
+
liquidate_perp_positions: {
|
|
162
162
|
address: Address;
|
|
163
163
|
positions: {
|
|
164
164
|
market_id: MarketId;
|
|
@@ -183,9 +183,42 @@ type ExchangeCallMessage = {
|
|
|
183
183
|
asset_name: string;
|
|
184
184
|
token_id: TokenId;
|
|
185
185
|
decimals: number;
|
|
186
|
+
withdraw_fee: number;
|
|
186
187
|
};
|
|
187
188
|
};
|
|
188
|
-
|
|
189
|
+
init_spot_market: {
|
|
190
|
+
args: {
|
|
191
|
+
market_id: MarketId;
|
|
192
|
+
base_asset_id: AssetId;
|
|
193
|
+
quote_asset_id: AssetId;
|
|
194
|
+
base_min_lot_size: number;
|
|
195
|
+
quote_min_lot_size: number;
|
|
196
|
+
max_orders_per_side: number;
|
|
197
|
+
taker_fees_tenth_bps: number[];
|
|
198
|
+
maker_fees_tenth_bps: number[];
|
|
199
|
+
name: string;
|
|
200
|
+
};
|
|
201
|
+
};
|
|
202
|
+
init_perp_market: {
|
|
203
|
+
args: {
|
|
204
|
+
market_id: MarketId;
|
|
205
|
+
base_asset_id: AssetId;
|
|
206
|
+
name: string;
|
|
207
|
+
min_tick_size: number;
|
|
208
|
+
min_lot_size: number;
|
|
209
|
+
max_orders_per_side: number;
|
|
210
|
+
min_interest_rate_clamp: number;
|
|
211
|
+
max_interest_rate_clamp: number;
|
|
212
|
+
min_funding_rate_clamp: number;
|
|
213
|
+
max_funding_rate_clamp: number;
|
|
214
|
+
impact_margin: number;
|
|
215
|
+
interest_rate: number;
|
|
216
|
+
init_leverage_table_args: Map<number, number>;
|
|
217
|
+
taker_fees_tenth_bps: number[];
|
|
218
|
+
maker_fees_tenth_bps: number[];
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
init_borrow_lend_pool: {
|
|
189
222
|
args: {
|
|
190
223
|
asset_id: AssetId;
|
|
191
224
|
optimal_utilisation_rate: number;
|
|
@@ -197,8 +230,10 @@ type ExchangeCallMessage = {
|
|
|
197
230
|
maintenance_liability_weight: number;
|
|
198
231
|
deposit_limit: number;
|
|
199
232
|
borrow_limit: number;
|
|
200
|
-
|
|
233
|
+
liquidation_total_reward_ratio: number;
|
|
234
|
+
protocol_reward_ratio: number;
|
|
201
235
|
liability_liquidation_limit_ratio: number;
|
|
236
|
+
interest_fee_tenth_bps: number;
|
|
202
237
|
};
|
|
203
238
|
};
|
|
204
239
|
update_borrow_lend_market: {
|
package/dist/types/types.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export type AssetId = number;
|
|
|
9
9
|
export type MarketId = number;
|
|
10
10
|
export type OrderId = bigint;
|
|
11
11
|
export type ClientOrderId = bigint;
|
|
12
|
+
export type MarketKind = "Perp" | "Spot";
|
|
12
13
|
export type Side = "Bid" | "Ask";
|
|
13
14
|
export type TriggerDirection = "GreaterThanOrEqual" | "LessThanOrEqual";
|
|
14
15
|
export type TpslPriceCondition = "Mark" | "Oracle" | "LastTrade";
|
|
@@ -2147,26 +2147,31 @@ export declare const Schemas: {
|
|
|
2147
2147
|
name: z.ZodString;
|
|
2148
2148
|
token_id: z.ZodString;
|
|
2149
2149
|
decimals: z.ZodNumber;
|
|
2150
|
+
withdraw_fee: z.ZodString;
|
|
2150
2151
|
}, "strip", z.ZodTypeAny, {
|
|
2151
2152
|
token_id: string;
|
|
2152
2153
|
id: number;
|
|
2153
2154
|
name: string;
|
|
2154
2155
|
decimals: number;
|
|
2156
|
+
withdraw_fee: string;
|
|
2155
2157
|
}, {
|
|
2156
2158
|
token_id: string;
|
|
2157
2159
|
id: number;
|
|
2158
2160
|
name: string;
|
|
2159
2161
|
decimals: number;
|
|
2162
|
+
withdraw_fee: string;
|
|
2160
2163
|
}>>, Map<number, {
|
|
2161
2164
|
token_id: string;
|
|
2162
2165
|
id: number;
|
|
2163
2166
|
name: string;
|
|
2164
2167
|
decimals: number;
|
|
2168
|
+
withdraw_fee: string;
|
|
2165
2169
|
}>, Record<string, {
|
|
2166
2170
|
token_id: string;
|
|
2167
2171
|
id: number;
|
|
2168
2172
|
name: string;
|
|
2169
2173
|
decimals: number;
|
|
2174
|
+
withdraw_fee: string;
|
|
2170
2175
|
}>>;
|
|
2171
2176
|
}, "strip", z.ZodTypeAny, {
|
|
2172
2177
|
metas: Map<number, {
|
|
@@ -2174,6 +2179,7 @@ export declare const Schemas: {
|
|
|
2174
2179
|
id: number;
|
|
2175
2180
|
name: string;
|
|
2176
2181
|
decimals: number;
|
|
2182
|
+
withdraw_fee: string;
|
|
2177
2183
|
}>;
|
|
2178
2184
|
}, {
|
|
2179
2185
|
metas: Record<string, {
|
|
@@ -2181,40 +2187,48 @@ export declare const Schemas: {
|
|
|
2181
2187
|
id: number;
|
|
2182
2188
|
name: string;
|
|
2183
2189
|
decimals: number;
|
|
2190
|
+
withdraw_fee: string;
|
|
2184
2191
|
}>;
|
|
2185
2192
|
}>;
|
|
2186
2193
|
readonly MarketRegistry: z.ZodObject<{
|
|
2187
2194
|
metas: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
2188
2195
|
id: z.ZodNumber;
|
|
2196
|
+
kind: z.ZodEnum<["Perp", "Spot"]>;
|
|
2189
2197
|
base_asset_id: z.ZodNumber;
|
|
2190
2198
|
name: z.ZodString;
|
|
2191
2199
|
}, "strip", z.ZodTypeAny, {
|
|
2192
2200
|
id: number;
|
|
2193
2201
|
name: string;
|
|
2202
|
+
kind: "Perp" | "Spot";
|
|
2194
2203
|
base_asset_id: number;
|
|
2195
2204
|
}, {
|
|
2196
2205
|
id: number;
|
|
2197
2206
|
name: string;
|
|
2207
|
+
kind: "Perp" | "Spot";
|
|
2198
2208
|
base_asset_id: number;
|
|
2199
2209
|
}>>, Map<number, {
|
|
2200
2210
|
id: number;
|
|
2201
2211
|
name: string;
|
|
2212
|
+
kind: "Perp" | "Spot";
|
|
2202
2213
|
base_asset_id: number;
|
|
2203
2214
|
}>, Record<string, {
|
|
2204
2215
|
id: number;
|
|
2205
2216
|
name: string;
|
|
2217
|
+
kind: "Perp" | "Spot";
|
|
2206
2218
|
base_asset_id: number;
|
|
2207
2219
|
}>>;
|
|
2208
2220
|
}, "strip", z.ZodTypeAny, {
|
|
2209
2221
|
metas: Map<number, {
|
|
2210
2222
|
id: number;
|
|
2211
2223
|
name: string;
|
|
2224
|
+
kind: "Perp" | "Spot";
|
|
2212
2225
|
base_asset_id: number;
|
|
2213
2226
|
}>;
|
|
2214
2227
|
}, {
|
|
2215
2228
|
metas: Record<string, {
|
|
2216
2229
|
id: number;
|
|
2217
2230
|
name: string;
|
|
2231
|
+
kind: "Perp" | "Spot";
|
|
2218
2232
|
base_asset_id: number;
|
|
2219
2233
|
}>;
|
|
2220
2234
|
}>;
|
|
@@ -2848,26 +2862,31 @@ export declare const ResponseSchemas: {
|
|
|
2848
2862
|
name: z.ZodString;
|
|
2849
2863
|
token_id: z.ZodString;
|
|
2850
2864
|
decimals: z.ZodNumber;
|
|
2865
|
+
withdraw_fee: z.ZodString;
|
|
2851
2866
|
}, "strip", z.ZodTypeAny, {
|
|
2852
2867
|
token_id: string;
|
|
2853
2868
|
id: number;
|
|
2854
2869
|
name: string;
|
|
2855
2870
|
decimals: number;
|
|
2871
|
+
withdraw_fee: string;
|
|
2856
2872
|
}, {
|
|
2857
2873
|
token_id: string;
|
|
2858
2874
|
id: number;
|
|
2859
2875
|
name: string;
|
|
2860
2876
|
decimals: number;
|
|
2877
|
+
withdraw_fee: string;
|
|
2861
2878
|
}>>, Map<number, {
|
|
2862
2879
|
token_id: string;
|
|
2863
2880
|
id: number;
|
|
2864
2881
|
name: string;
|
|
2865
2882
|
decimals: number;
|
|
2883
|
+
withdraw_fee: string;
|
|
2866
2884
|
}>, Record<string, {
|
|
2867
2885
|
token_id: string;
|
|
2868
2886
|
id: number;
|
|
2869
2887
|
name: string;
|
|
2870
2888
|
decimals: number;
|
|
2889
|
+
withdraw_fee: string;
|
|
2871
2890
|
}>>;
|
|
2872
2891
|
}, "strip", z.ZodTypeAny, {
|
|
2873
2892
|
metas: Map<number, {
|
|
@@ -2875,6 +2894,7 @@ export declare const ResponseSchemas: {
|
|
|
2875
2894
|
id: number;
|
|
2876
2895
|
name: string;
|
|
2877
2896
|
decimals: number;
|
|
2897
|
+
withdraw_fee: string;
|
|
2878
2898
|
}>;
|
|
2879
2899
|
}, {
|
|
2880
2900
|
metas: Record<string, {
|
|
@@ -2882,6 +2902,7 @@ export declare const ResponseSchemas: {
|
|
|
2882
2902
|
id: number;
|
|
2883
2903
|
name: string;
|
|
2884
2904
|
decimals: number;
|
|
2905
|
+
withdraw_fee: string;
|
|
2885
2906
|
}>;
|
|
2886
2907
|
}>>;
|
|
2887
2908
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -2891,6 +2912,7 @@ export declare const ResponseSchemas: {
|
|
|
2891
2912
|
id: number;
|
|
2892
2913
|
name: string;
|
|
2893
2914
|
decimals: number;
|
|
2915
|
+
withdraw_fee: string;
|
|
2894
2916
|
}>;
|
|
2895
2917
|
} | null;
|
|
2896
2918
|
}, {
|
|
@@ -2900,6 +2922,7 @@ export declare const ResponseSchemas: {
|
|
|
2900
2922
|
id: number;
|
|
2901
2923
|
name: string;
|
|
2902
2924
|
decimals: number;
|
|
2925
|
+
withdraw_fee: string;
|
|
2903
2926
|
}>;
|
|
2904
2927
|
} | null;
|
|
2905
2928
|
}>;
|
|
@@ -2907,35 +2930,42 @@ export declare const ResponseSchemas: {
|
|
|
2907
2930
|
value: z.ZodNullable<z.ZodObject<{
|
|
2908
2931
|
metas: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
2909
2932
|
id: z.ZodNumber;
|
|
2933
|
+
kind: z.ZodEnum<["Perp", "Spot"]>;
|
|
2910
2934
|
base_asset_id: z.ZodNumber;
|
|
2911
2935
|
name: z.ZodString;
|
|
2912
2936
|
}, "strip", z.ZodTypeAny, {
|
|
2913
2937
|
id: number;
|
|
2914
2938
|
name: string;
|
|
2939
|
+
kind: "Perp" | "Spot";
|
|
2915
2940
|
base_asset_id: number;
|
|
2916
2941
|
}, {
|
|
2917
2942
|
id: number;
|
|
2918
2943
|
name: string;
|
|
2944
|
+
kind: "Perp" | "Spot";
|
|
2919
2945
|
base_asset_id: number;
|
|
2920
2946
|
}>>, Map<number, {
|
|
2921
2947
|
id: number;
|
|
2922
2948
|
name: string;
|
|
2949
|
+
kind: "Perp" | "Spot";
|
|
2923
2950
|
base_asset_id: number;
|
|
2924
2951
|
}>, Record<string, {
|
|
2925
2952
|
id: number;
|
|
2926
2953
|
name: string;
|
|
2954
|
+
kind: "Perp" | "Spot";
|
|
2927
2955
|
base_asset_id: number;
|
|
2928
2956
|
}>>;
|
|
2929
2957
|
}, "strip", z.ZodTypeAny, {
|
|
2930
2958
|
metas: Map<number, {
|
|
2931
2959
|
id: number;
|
|
2932
2960
|
name: string;
|
|
2961
|
+
kind: "Perp" | "Spot";
|
|
2933
2962
|
base_asset_id: number;
|
|
2934
2963
|
}>;
|
|
2935
2964
|
}, {
|
|
2936
2965
|
metas: Record<string, {
|
|
2937
2966
|
id: number;
|
|
2938
2967
|
name: string;
|
|
2968
|
+
kind: "Perp" | "Spot";
|
|
2939
2969
|
base_asset_id: number;
|
|
2940
2970
|
}>;
|
|
2941
2971
|
}>>;
|
|
@@ -2944,6 +2974,7 @@ export declare const ResponseSchemas: {
|
|
|
2944
2974
|
metas: Map<number, {
|
|
2945
2975
|
id: number;
|
|
2946
2976
|
name: string;
|
|
2977
|
+
kind: "Perp" | "Spot";
|
|
2947
2978
|
base_asset_id: number;
|
|
2948
2979
|
}>;
|
|
2949
2980
|
} | null;
|
|
@@ -2952,6 +2983,7 @@ export declare const ResponseSchemas: {
|
|
|
2952
2983
|
metas: Record<string, {
|
|
2953
2984
|
id: number;
|
|
2954
2985
|
name: string;
|
|
2986
|
+
kind: "Perp" | "Spot";
|
|
2955
2987
|
base_asset_id: number;
|
|
2956
2988
|
}>;
|
|
2957
2989
|
} | null;
|