@bulletxyz/bullet-sdk 0.49.1 → 0.49.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/bullet_wasm_bg.wasm +0 -0
- package/dist/browser/index.js +32 -13
- package/dist/browser/index.js.map +4 -4
- package/dist/node/bullet_wasm_bg.wasm +0 -0
- package/dist/node/index.js +32 -13
- package/dist/node/index.js.map +4 -4
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/client.d.ts +4 -3
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/rollupTypes.d.ts +14 -0
- package/dist/types/rollupTypes.d.ts.map +1 -1
- package/dist/types/zod-types/rest.d.ts +60 -24
- package/dist/types/zod-types/rest.d.ts.map +1 -1
- package/package.json +1 -1
|
Binary file
|
package/dist/browser/index.js
CHANGED
|
@@ -2059,9 +2059,11 @@ var StateResponseSchemas = {
|
|
|
2059
2059
|
trigger_order_ids: z3.array(TriggerOrderId),
|
|
2060
2060
|
position: Position,
|
|
2061
2061
|
user_selected_max_leverage: U16Schema,
|
|
2062
|
-
|
|
2062
|
+
notional_open_bid_orders: DecimalSchema,
|
|
2063
|
+
notional_open_ask_orders: DecimalSchema,
|
|
2063
2064
|
twap_ids: z3.array(TwapId),
|
|
2064
|
-
|
|
2065
|
+
twap_open_bid_lots: DecimalSchema,
|
|
2066
|
+
twap_open_ask_lots: DecimalSchema
|
|
2065
2067
|
}), SpotLedger = z3.object({
|
|
2066
2068
|
order_ids: z3.array(OrderId),
|
|
2067
2069
|
trigger_order_ids: z3.array(TriggerOrderId),
|
|
@@ -2312,6 +2314,11 @@ var StateResponseSchemas = {
|
|
|
2312
2314
|
UserAccountConfigV0: z3.object({
|
|
2313
2315
|
delegates: createJsonMap(Base58Address, z3.string())
|
|
2314
2316
|
}),
|
|
2317
|
+
DelegateContainer: z3.object({
|
|
2318
|
+
delegator: Base58Address,
|
|
2319
|
+
expires_at: UnixTimestampMicros.nullable(),
|
|
2320
|
+
flags: U32Schema
|
|
2321
|
+
}),
|
|
2315
2322
|
RiskEngineV0: z3.object({
|
|
2316
2323
|
pricing_engine: PricingEngine,
|
|
2317
2324
|
margin_config: MarginConfig
|
|
@@ -2369,12 +2376,16 @@ var StateResponseSchemas = {
|
|
|
2369
2376
|
found: createJsonMap(MarketId, Schemas.OrderbookL2),
|
|
2370
2377
|
not_found: z3.array(MarketId)
|
|
2371
2378
|
})),
|
|
2372
|
-
|
|
2379
|
+
UserAccount: createBaseResponse(z3.object({
|
|
2373
2380
|
address: Base58Address,
|
|
2374
2381
|
account: Schemas.UserAccount
|
|
2375
2382
|
})),
|
|
2383
|
+
Delegate: createBaseResponse(z3.object({
|
|
2384
|
+
address: Base58Address,
|
|
2385
|
+
container: Schemas.DelegateContainer
|
|
2386
|
+
})),
|
|
2376
2387
|
UserAccountConfig: StateResponseSchemas.StateMapElement(Base58Address, VersionedV0(Schemas.UserAccountConfigV0)),
|
|
2377
|
-
|
|
2388
|
+
UserAccountBulk: createBaseResponse(z3.object({
|
|
2378
2389
|
found: createJsonMap(Base58Address, Schemas.UserAccount),
|
|
2379
2390
|
not_found: z3.array(Base58Address)
|
|
2380
2391
|
})),
|
|
@@ -2597,18 +2608,22 @@ class ReadOnlyClient {
|
|
|
2597
2608
|
}
|
|
2598
2609
|
async getUserAccount(address) {
|
|
2599
2610
|
let path = `/modules/exchange/api/v1/account/${address}`, response = await this.fetchApiResource(path);
|
|
2600
|
-
return ResponseSchemas.
|
|
2611
|
+
return ResponseSchemas.UserAccount.parse(response).account;
|
|
2601
2612
|
}
|
|
2602
2613
|
async getUserAccounts(addresses) {
|
|
2603
2614
|
let response = await this.fetchBulkApiResource("/modules/exchange/api/v1/account/bulk", {
|
|
2604
2615
|
addresses
|
|
2605
2616
|
});
|
|
2606
|
-
return ResponseSchemas.
|
|
2617
|
+
return ResponseSchemas.UserAccountBulk.parse(response).found;
|
|
2607
2618
|
}
|
|
2608
2619
|
async getUserAccountConfig(address) {
|
|
2609
2620
|
let path = `/modules/exchange/state/user-account-configs/items/${address}`, response = await this.fetchApiResource(path);
|
|
2610
2621
|
return ResponseSchemas.UserAccountConfig.parse(response).value;
|
|
2611
2622
|
}
|
|
2623
|
+
async getDelegateContainer(delegate) {
|
|
2624
|
+
let path = `/modules/exchange/api/v1/delegate/${delegate}`, response = await this.fetchApiResource(path);
|
|
2625
|
+
return ResponseSchemas.Delegate.parse(response).container;
|
|
2626
|
+
}
|
|
2612
2627
|
async getExchangeAssets() {
|
|
2613
2628
|
let response = await this.fetchApiResource("/modules/exchange/state/exchange-assets");
|
|
2614
2629
|
return ResponseSchemas.ExchangeAssets.parse(response).value;
|
|
@@ -3766,14 +3781,16 @@ class AuthenticatedClient extends ReadOnlyClient {
|
|
|
3766
3781
|
}
|
|
3767
3782
|
});
|
|
3768
3783
|
}
|
|
3769
|
-
async delegateUser(delegate, name, subAccountIndex) {
|
|
3784
|
+
async delegateUser(delegate, name, flags, subAccountIndex = null, expiresAt = null) {
|
|
3770
3785
|
return await this.submitTransaction({
|
|
3771
3786
|
exchange: {
|
|
3772
3787
|
user: {
|
|
3773
|
-
|
|
3788
|
+
delegate_user_v_2: {
|
|
3774
3789
|
delegate,
|
|
3775
3790
|
name,
|
|
3776
|
-
sub_account_index: subAccountIndex
|
|
3791
|
+
sub_account_index: subAccountIndex,
|
|
3792
|
+
expires_at: expiresAt,
|
|
3793
|
+
flags
|
|
3777
3794
|
}
|
|
3778
3795
|
}
|
|
3779
3796
|
}
|
|
@@ -3791,14 +3808,16 @@ class AuthenticatedClient extends ReadOnlyClient {
|
|
|
3791
3808
|
}
|
|
3792
3809
|
});
|
|
3793
3810
|
}
|
|
3794
|
-
async vaultDelegateUser(vaultAddress, delegate, name) {
|
|
3811
|
+
async vaultDelegateUser(vaultAddress, delegate, name, flags, expiresAt = null) {
|
|
3795
3812
|
return await this.submitTransaction({
|
|
3796
3813
|
exchange: {
|
|
3797
3814
|
vault: {
|
|
3798
|
-
|
|
3815
|
+
delegate_vault_user_v_1: {
|
|
3799
3816
|
vault_address: vaultAddress,
|
|
3800
3817
|
delegate,
|
|
3801
|
-
name
|
|
3818
|
+
name,
|
|
3819
|
+
expires_at: expiresAt,
|
|
3820
|
+
flags
|
|
3802
3821
|
}
|
|
3803
3822
|
}
|
|
3804
3823
|
}
|
|
@@ -4378,4 +4397,4 @@ export {
|
|
|
4378
4397
|
AbortError
|
|
4379
4398
|
};
|
|
4380
4399
|
|
|
4381
|
-
//# debugId=
|
|
4400
|
+
//# debugId=7A28D1BC835A397764756E2164756E21
|