@bulletxyz/bullet-sdk 0.49.4 → 0.49.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.
Binary file
@@ -2271,6 +2271,10 @@ var StateResponseSchemas = {
2271
2271
  taker_fees_tenth_bps: z3.array(I16Schema),
2272
2272
  maker_fees_tenth_bps: z3.array(I16Schema),
2273
2273
  max_order_to_trigger_price_deviation_ratio: DecimalSchema
2274
+ }), DelegateContainer = z3.object({
2275
+ delegator: Base58Address,
2276
+ expires_at: UnixTimestampMicros.nullable(),
2277
+ flags: U32Schema
2274
2278
  }), Schemas = {
2275
2279
  DummyValue: z3.number(),
2276
2280
  ExchangeInfoV1: z3.object({
@@ -2314,10 +2318,10 @@ var StateResponseSchemas = {
2314
2318
  UserAccountConfigV0: z3.object({
2315
2319
  delegates: createJsonMap(Base58Address, z3.string())
2316
2320
  }),
2317
- DelegateContainer: z3.object({
2318
- delegator: Base58Address,
2319
- expires_at: UnixTimestampMicros.nullable(),
2320
- flags: U32Schema
2321
+ Delegate: z3.object({
2322
+ name: z3.string(),
2323
+ address: Base58Address,
2324
+ container: DelegateContainer
2321
2325
  }),
2322
2326
  RiskEngineV0: z3.object({
2323
2327
  pricing_engine: PricingEngine,
@@ -2380,9 +2384,10 @@ var StateResponseSchemas = {
2380
2384
  address: Base58Address,
2381
2385
  account: Schemas.UserAccount
2382
2386
  })),
2383
- Delegate: createBaseResponse(z3.object({
2384
- address: Base58Address,
2385
- container: Schemas.DelegateContainer
2387
+ Delegate: createBaseResponse(Schemas.Delegate),
2388
+ Delegates: createBaseResponse(z3.object({
2389
+ delegator: Base58Address,
2390
+ delegates: z3.array(Schemas.Delegate)
2386
2391
  })),
2387
2392
  UserAccountConfig: StateResponseSchemas.StateMapElement(Base58Address, VersionedV0(Schemas.UserAccountConfigV0)),
2388
2393
  UserAccountBulk: createBaseResponse(z3.object({
@@ -2620,9 +2625,13 @@ class ReadOnlyClient {
2620
2625
  let path = `/modules/exchange/state/user-account-configs/items/${address}`, response = await this.fetchApiResource(path);
2621
2626
  return ResponseSchemas.UserAccountConfig.parse(response).value;
2622
2627
  }
2623
- async getDelegateContainer(delegate) {
2628
+ async getDelegate(delegate) {
2624
2629
  let path = `/modules/exchange/api/v1/delegate/${delegate}`, response = await this.fetchApiResource(path);
2625
- return ResponseSchemas.Delegate.parse(response).container;
2630
+ return ResponseSchemas.Delegate.parse(response);
2631
+ }
2632
+ async getAllDelegates(delegator) {
2633
+ let path = `/modules/exchange/api/v1/delegates/${delegator}`, response = await this.fetchApiResource(path);
2634
+ return ResponseSchemas.Delegates.parse(response);
2626
2635
  }
2627
2636
  async getExchangeAssets() {
2628
2637
  let response = await this.fetchApiResource("/modules/exchange/state/exchange-assets");
@@ -2820,6 +2829,10 @@ class AuthenticatedClient extends ReadOnlyClient {
2820
2829
  let addr = address ?? this.address;
2821
2830
  return await super.getUserAccount(addr);
2822
2831
  }
2832
+ async getAllDelegates(address) {
2833
+ let addr = address ?? this.address;
2834
+ return await super.getAllDelegates(addr);
2835
+ }
2823
2836
  async getUserAccountConfig(address) {
2824
2837
  let addr = address ?? this.address;
2825
2838
  return await super.getUserAccountConfig(addr);
@@ -4387,6 +4400,7 @@ export {
4387
4400
  ReadOnlyClient,
4388
4401
  Orderbook,
4389
4402
  NETWORKS,
4403
+ MarginMode,
4390
4404
  LedgerWallet,
4391
4405
  GLOBAL_DEFAULT_MAX_LEVERAGE,
4392
4406
  Client,
@@ -4397,4 +4411,4 @@ export {
4397
4411
  AbortError
4398
4412
  };
4399
4413
 
4400
- //# debugId=095FFDB47146803B64756E2164756E21
4414
+ //# debugId=866FE84FB953549964756E2164756E21