@arca-network/sdk 1.26.0 → 2.1.0

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/types.d.ts CHANGED
@@ -632,15 +632,51 @@ export interface CctpFeeQuote {
632
632
  estimated: string;
633
633
  finality: string;
634
634
  }
635
+ /**
636
+ * Whether the bridged lane can actually carry a deposit right now.
637
+ *
638
+ * - `ready` — send. Bridged deposits are dispatchable.
639
+ * - `not_provisioned` — a definitive gap; the lane cannot work. `reason`
640
+ * says whose problem it is: `realm_receiver_not_provisioned` (ours to
641
+ * fix), `no_custody_pool` (realm provisioning still in flight, retryable),
642
+ * `chain_bridge_router_not_deployed` (this deployment does not bridge).
643
+ * - `unknown` — a read failed, so this is not an answer. Retry; do not fall
644
+ * back permanently.
645
+ *
646
+ * Gate a bridged destination on this, never on `platformFee`. The Arca
647
+ * network charges nothing, so a zero fee says nothing about lane health.
648
+ */
649
+ export type CorridorStatusValue = 'ready' | 'not_provisioned' | 'unknown';
650
+ export interface CorridorStatus {
651
+ status: CorridorStatusValue;
652
+ /** The specific gap or failure. Empty when `status` is `ready`. */
653
+ reason?: string;
654
+ }
635
655
  export interface DepositFeeQuote {
636
656
  chain: string;
637
657
  bridged: boolean;
638
658
  amount: string;
639
659
  cctpFee?: CctpFeeQuote;
660
+ /**
661
+ * `platformFee` is `"0.000000"`: the Arca network takes no fee on any
662
+ * lane. Retained because Circle's `cctpFee` is a real cost on the bridged
663
+ * lane and `estimatedCredit` nets both.
664
+ */
640
665
  platformFee: string;
641
666
  estimatedCredit: string;
642
667
  quotedAt: string;
643
- /** True when Circle's fee table was unreachable; `cctpFee` is omitted. */
668
+ /**
669
+ * Bridged-lane readiness. Present only when `bridged` is true — a
670
+ * same-chain deposit has no corridor. This is the signal to gate a
671
+ * bridged destination on.
672
+ */
673
+ corridor?: CorridorStatus;
674
+ /**
675
+ * True when the CCTP leg is missing from the arithmetic, so the real
676
+ * credit will be slightly lower than `estimatedCredit`. Usually Circle's
677
+ * fee table was briefly unreachable. A statement about this quote's
678
+ * precision, not about whether the lane works — read `corridor` for that.
679
+ */
644
680
  degraded?: boolean;
645
681
  }
646
682
  /** `POST /custody/deposits/address` — get-or-create a platform-held key. */
@@ -1883,6 +1919,7 @@ export declare const EventType: {
1883
1919
  readonly ExchangeUpdated: "exchange.updated";
1884
1920
  readonly ExchangeProvisioned: "exchange.provisioned";
1885
1921
  readonly ExchangeReady: "exchange.ready";
1922
+ readonly OrderUpdated: "order.updated";
1886
1923
  /**
1887
1924
  * Phase 1 of two-phase fill delivery: the instant, incomplete venue-level
1888
1925
  * fill echo. `FillRecorded` (Phase 2) follows with the authoritative record;
@@ -2049,6 +2086,21 @@ export interface ExchangeReadyEvent extends BaseRealmEvent {
2049
2086
  type: typeof EventType.ExchangeReady;
2050
2087
  exchange: ExchangeProvisioningState;
2051
2088
  }
2089
+ /** Sparse authoritative execution evidence; not full order metadata or journal history. */
2090
+ export interface OrderExecutionUpdate {
2091
+ order: {
2092
+ id: string;
2093
+ orderId?: string;
2094
+ status: string;
2095
+ filledSize: string;
2096
+ avgFillPrice?: string;
2097
+ };
2098
+ fillsComplete?: boolean;
2099
+ }
2100
+ export interface OrderUpdatedEvent extends BaseRealmEvent {
2101
+ type: typeof EventType.OrderUpdated;
2102
+ order: OrderExecutionUpdate;
2103
+ }
2052
2104
  export interface FillPreviewedEvent extends BaseRealmEvent {
2053
2105
  type: typeof EventType.FillPreviewed;
2054
2106
  fill: SimFill;
@@ -2257,7 +2309,7 @@ export interface AgentExecutionDoneEvent {
2257
2309
  chatId: string;
2258
2310
  }
2259
2311
  export type AgentEvent = AgentTextEvent | AgentToolUseEvent | AgentPlanEvent | AgentConversationLogEvent | AgentDoneEvent | AgentStepUpdatedEvent | AgentExecutionDoneEvent;
2260
- export type TypedRealmEvent = OperationCreatedEvent | OperationUpdatedEvent | EventCreatedEvent | ObjectCreatedEvent | ObjectUpdatedEvent | ObjectDeletedEvent | BalanceUpdatedEvent | ExchangeUpdatedEvent | ExchangeProvisionedEvent | ExchangeReadyEvent | FillPreviewedEvent | FillRecordedEvent | ExchangeFundingEvent | AggregationUpdatedEvent | ObjectValuationEvent | FrameEvent | MidsUpdatedEvent | CandleClosedEvent | CandleUpdatedEvent | OIUpdatedEvent | TradeExecutedEvent | RealmCreatedEvent | TwapStartedEvent | TwapProgressEvent | TwapCompletedEvent | TwapCancelledEvent | TwapFailedEvent;
2312
+ export type TypedRealmEvent = OperationCreatedEvent | OperationUpdatedEvent | EventCreatedEvent | ObjectCreatedEvent | ObjectUpdatedEvent | ObjectDeletedEvent | BalanceUpdatedEvent | ExchangeUpdatedEvent | ExchangeProvisionedEvent | ExchangeReadyEvent | OrderUpdatedEvent | FillPreviewedEvent | FillRecordedEvent | ExchangeFundingEvent | AggregationUpdatedEvent | ObjectValuationEvent | FrameEvent | MidsUpdatedEvent | CandleClosedEvent | CandleUpdatedEvent | OIUpdatedEvent | TradeExecutedEvent | RealmCreatedEvent | TwapStartedEvent | TwapProgressEvent | TwapCompletedEvent | TwapCancelledEvent | TwapFailedEvent;
2261
2313
  /**
2262
2314
  * Narrow a raw ``RealmEvent`` into a discriminated ``TypedRealmEvent``.
2263
2315
  * Returns `undefined` if the event type is unrecognized or the payload
@@ -2277,6 +2329,8 @@ export interface RealmEvent {
2277
2329
  object?: ArcaObject;
2278
2330
  mids?: Record<string, string>;
2279
2331
  exchangeState?: ExchangeState;
2332
+ /** The previous exchange observation is no longer usable; wait for a fresh push. */
2333
+ exchangeStateUnavailable?: boolean;
2280
2334
  exchange?: ExchangeProvisioningState;
2281
2335
  valuation?: ObjectValuation;
2282
2336
  balances?: ArcaBalance[];
@@ -2284,6 +2338,7 @@ export interface RealmEvent {
2284
2338
  heldInbound?: ReservedBalance[];
2285
2339
  path?: string;
2286
2340
  watchId?: string;
2341
+ order?: OrderExecutionUpdate;
2287
2342
  fill?: SimFill;
2288
2343
  funding?: FundingPayment;
2289
2344
  realm?: Realm;
@@ -2333,9 +2388,31 @@ export interface CreatePerpsExchangeOptions {
2333
2388
  * Venue the exchange object trades against. `'hl-sim'` (the default)
2334
2389
  * provisions a simulated Hyperliquid account for paper realms; `'hl'`
2335
2390
  * provisions a live Hyperliquid account (production realms, gated by the
2336
- * platform's HL feature flag).
2391
+ * platform's HL feature flag); `'gll-testnet'` provisions an account on
2392
+ * LayerZero's ATLAS testnet CLOB (development realms only, gated by the
2393
+ * platform's GLL feature flag).
2394
+ *
2395
+ * ATLAS notes for `'gll-testnet'`:
2396
+ *
2397
+ * - Markets carry the `gllt` exchange prefix and NUMERIC canonical ids
2398
+ * (`gllt:3`). The id has no human meaning at all — resolve it, never
2399
+ * build it:
2400
+ * `const [btc] = await arca.resolveMarkets('BTC', { exchange: 'gllt' })`
2401
+ * then use `btc.name`. Note the symbol is the BASE ASSET (`'BTC'`), not
2402
+ * the venue symbol (`'BTC-USD-PERP'`) — the latter is `market.venueSymbol`
2403
+ * and is display text only.
2404
+ * - Leverage is fixed per market (10x on the crypto perps, derived from the
2405
+ * venue's initial-margin rate). `setLeverage` and the margin-mode calls
2406
+ * are unsupported and refuse; hide those controls rather than catching.
2407
+ * - No TP/SL and no TWAP in v1.
2408
+ * - The order book is SHARED and PUBLIC: anyone with a testnet key can
2409
+ * trade against you and can read any account's state. It is also a
2410
+ * testnet, which means its operator can reset it without notice. Say both
2411
+ * in any user-facing copy.
2412
+ * - The venue charges a one-time ~1 USDT account activation fee on first
2413
+ * activity, so equity reads as deposit − 1 afterwards.
2337
2414
  */
2338
- venue?: 'hl-sim' | 'hl';
2415
+ venue?: 'hl-sim' | 'hl' | 'gll-testnet';
2339
2416
  /** Optional operation path (idempotency key) */
2340
2417
  operationPath?: string;
2341
2418
  }
@@ -2380,6 +2457,9 @@ export interface PlaceOrderOptions {
2380
2457
  * on an isolated order is rejected with a 400.
2381
2458
  */
2382
2459
  leverage?: number;
2460
+ /** GLL-only Arca allocation intent. */
2461
+ leverageMode?: LeveragePreferenceMode;
2462
+ slippageBps?: number;
2383
2463
  /** If true, only reduces an existing position */
2384
2464
  reduceOnly?: boolean;
2385
2465
  /** If true, the order targets the asset's isolated-margin bucket.
@@ -3398,7 +3478,52 @@ export interface AvailabilityBreakdown {
3398
3478
  /** The venue's notional fraction (`"0.1"`), or `"0"` when nothing applies. */
3399
3479
  reservationRate: string;
3400
3480
  }
3481
+ /** Arca-owned GLL capital-allocation intent; it does not change liquidation. */
3482
+ export type LeveragePreferenceMode = 'venue-default' | 'fixed';
3483
+ export interface TradingLeveragePreference {
3484
+ mode: LeveragePreferenceMode;
3485
+ /** Original fixed intent, retained when a venue limit changes. */
3486
+ leverage?: number;
3487
+ }
3488
+ export interface PositionAllocation {
3489
+ market: string;
3490
+ preference: TradingLeveragePreference;
3491
+ effectiveLeverage: number;
3492
+ venueInitialMargin: string;
3493
+ allocatedMargin: string;
3494
+ extraMargin: string;
3495
+ reservedMargin: string;
3496
+ reservedExtra: string;
3497
+ }
3498
+ export interface TradingAllocationProjection {
3499
+ revision: string;
3500
+ positions: Record<string, PositionAllocation>;
3501
+ venueInitialMargin: string;
3502
+ positionAllocatedMargin: string;
3503
+ allocatedMargin: string;
3504
+ extraMargin: string;
3505
+ pendingMargin: string;
3506
+ pendingCosts: string;
3507
+ reservedExtra: string;
3508
+ availableToTrade: string;
3509
+ }
3510
+ export interface TradingAllocationState {
3511
+ asOf?: string;
3512
+ validUntil?: string;
3513
+ /** Decimal revision string; never parse through a JavaScript number. */
3514
+ revision: string;
3515
+ /** Includes preferences for markets with no open position. */
3516
+ preferences: Record<string, TradingLeveragePreference>;
3517
+ projection?: TradingAllocationProjection;
3518
+ /** Missing/stale risk facts: missing projection never means zero margin. */
3519
+ projectionUnavailable: boolean;
3520
+ }
3401
3521
  export interface ExchangeState {
3522
+ financialInputId?: string;
3523
+ mirrorUnsettledFunding?: string;
3524
+ pricingMode?: 'client' | 'server';
3525
+ /** Optional platform mirror projection. Absent until synthetic allocation is enabled. */
3526
+ tradingAllocation?: TradingAllocationState;
3402
3527
  account: SimAccount;
3403
3528
  marginSummary: SimMarginSummary;
3404
3529
  /**
@@ -3660,24 +3785,33 @@ export interface BuilderFeeStatus {
3660
3785
  approvedAt?: string;
3661
3786
  }
3662
3787
  export interface UpdateLeverageOptions {
3663
- /** Exchange Arca object ID */
3664
3788
  objectId: string;
3665
- /** Coin in canonical format (e.g. "hl:0:BTC", "hl:1:SILVER") */
3666
3789
  market: string;
3667
- /** Leverage multiplier (1 to maxLeverage for the asset) */
3668
- leverage: number;
3790
+ /** Omit for explicit venue-default GLL intent; required for venue-owned updates. */
3791
+ leverage?: number;
3792
+ mode?: LeveragePreferenceMode;
3793
+ /** Stable across a caller retry; generated once per GLL call when omitted. */
3794
+ commandId?: string;
3669
3795
  }
3670
3796
  export interface UpdateLeverageResponse {
3671
3797
  accountId: string;
3672
3798
  market: string;
3673
- leverage: number;
3674
- previousLeverage: number;
3799
+ /** null when GLL applicable risk is unavailable, never zero. */
3800
+ leverage: number | null;
3801
+ previousLeverage: number | null;
3802
+ mode?: LeveragePreferenceMode;
3803
+ intendedLeverage?: number | null;
3804
+ revision?: string;
3805
+ projectionUnavailable?: boolean;
3806
+ commandId?: string;
3675
3807
  }
3676
3808
  export interface LeverageSetting {
3677
3809
  market: string;
3678
- leverage: number;
3679
- /** Asset's configured margin mode. */
3810
+ leverage: number | null;
3680
3811
  marginMode: MarginMode;
3812
+ mode?: LeveragePreferenceMode;
3813
+ intendedLeverage?: number;
3814
+ inputId?: string;
3681
3815
  }
3682
3816
  export interface UpdateIsolatedMarginOptions {
3683
3817
  /** Exchange Arca object ID */
@@ -4230,5 +4364,42 @@ export interface GeneratedRecoveryKey {
4230
4364
  mnemonic: string;
4231
4365
  address: string;
4232
4366
  }
4367
+ /** GLL allocation selection, separate from venue margin mode. */
4368
+ export interface TradingLeverageSelection {
4369
+ mode?: LeveragePreferenceMode;
4370
+ leverage?: number;
4371
+ }
4372
+ export interface TradingAllocationRead {
4373
+ enabled: boolean;
4374
+ inputId: string;
4375
+ allocation: TradingAllocationState;
4376
+ unavailableReason?: string;
4377
+ }
4378
+ export interface TradingAllocationQuoteRequest {
4379
+ market: string;
4380
+ side: 'buy' | 'sell';
4381
+ orderType: 'market' | 'limit';
4382
+ price?: string;
4383
+ size?: string;
4384
+ slippageBps?: number;
4385
+ reduceOnly?: boolean;
4386
+ selection: TradingLeverageSelection;
4387
+ }
4388
+ export interface TradingAllocationMaximum {
4389
+ revision: string;
4390
+ maxSize: string;
4391
+ maxNotional: string;
4392
+ projection?: TradingAllocationProjection;
4393
+ }
4394
+ export interface TradingAllocationQuote {
4395
+ inputId: string;
4396
+ market: string;
4397
+ referencePrice: string;
4398
+ limitPrice: string;
4399
+ allocation: TradingAllocationState;
4400
+ maximum: TradingAllocationMaximum;
4401
+ affordable?: boolean;
4402
+ orderProjection?: TradingAllocationProjection;
4403
+ }
4233
4404
  export {};
4234
4405
  //# sourceMappingURL=types.d.ts.map