@symmio/trading-core 3.1.0 → 3.2.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.
Files changed (126) hide show
  1. package/dist/index.d.ts +4 -2
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +304 -298
  4. package/dist/quotes/get-quote-history/solver-fees.d.ts +39 -0
  5. package/dist/quotes/get-quote-history/solver-fees.d.ts.map +1 -0
  6. package/dist/quotes/get-quote-history/solver-fees.js +36 -0
  7. package/dist/quotes/get-quote-history/solver-fees.js.map +1 -0
  8. package/dist/quotes/get-quote-history/to-history-row.d.ts.map +1 -1
  9. package/dist/quotes/get-quote-history/to-history-row.js +34 -30
  10. package/dist/quotes/get-quote-history/to-history-row.js.map +1 -1
  11. package/dist/quotes/get-quote-history/types.d.ts +20 -0
  12. package/dist/quotes/get-quote-history/types.d.ts.map +1 -1
  13. package/dist/quotes/get-quote-history/types.js.map +1 -1
  14. package/dist/solvers/get-solver-info/get-solver-info.d.ts +36 -0
  15. package/dist/solvers/get-solver-info/get-solver-info.d.ts.map +1 -0
  16. package/dist/solvers/get-solver-info/get-solver-info.js +28 -0
  17. package/dist/solvers/get-solver-info/get-solver-info.js.map +1 -0
  18. package/dist/solvers/get-solver-info/index.d.ts +3 -0
  19. package/dist/solvers/get-solver-info/index.d.ts.map +1 -0
  20. package/dist/solvers/get-solver-info/query.d.ts +29 -0
  21. package/dist/solvers/get-solver-info/query.d.ts.map +1 -0
  22. package/dist/solvers/get-solver-info/query.js +24 -0
  23. package/dist/solvers/get-solver-info/query.js.map +1 -0
  24. package/dist/solvers/instant-close/get-instant-close-fees/get-instant-close-fees.d.ts +152 -0
  25. package/dist/solvers/instant-close/get-instant-close-fees/get-instant-close-fees.d.ts.map +1 -0
  26. package/dist/solvers/instant-close/get-instant-close-fees/get-instant-close-fees.js +82 -0
  27. package/dist/solvers/instant-close/get-instant-close-fees/get-instant-close-fees.js.map +1 -0
  28. package/dist/solvers/instant-close/get-instant-close-fees/index.d.ts +3 -0
  29. package/dist/solvers/instant-close/get-instant-close-fees/index.d.ts.map +1 -0
  30. package/dist/solvers/instant-close/get-instant-close-fees/query.d.ts +37 -0
  31. package/dist/solvers/instant-close/get-instant-close-fees/query.d.ts.map +1 -0
  32. package/dist/solvers/instant-close/get-instant-close-fees/query.js +32 -0
  33. package/dist/solvers/instant-close/get-instant-close-fees/query.js.map +1 -0
  34. package/dist/solvers/instant-close/index.d.ts +1 -0
  35. package/dist/solvers/instant-close/index.d.ts.map +1 -1
  36. package/dist/solvers/instant-close/instant-close/instant-close.d.ts +4 -3
  37. package/dist/solvers/instant-close/instant-close/instant-close.d.ts.map +1 -1
  38. package/dist/solvers/instant-close/instant-close/instant-close.js +26 -22
  39. package/dist/solvers/instant-close/instant-close/instant-close.js.map +1 -1
  40. package/dist/solvers/instant-close/instant-close-bulk/instant-close-bulk.d.ts +2 -0
  41. package/dist/solvers/instant-close/instant-close-bulk/instant-close-bulk.d.ts.map +1 -1
  42. package/dist/solvers/instant-close/instant-close-bulk/instant-close-bulk.js +26 -22
  43. package/dist/solvers/instant-close/instant-close-bulk/instant-close-bulk.js.map +1 -1
  44. package/dist/solvers/instant-close/shared/calldata.d.ts +1 -1
  45. package/dist/solvers/instant-close/shared/calldata.d.ts.map +1 -1
  46. package/dist/solvers/instant-close/shared/calldata.js.map +1 -1
  47. package/dist/solvers/instant-close/shared/resolve-close-order-type.d.ts +13 -0
  48. package/dist/solvers/instant-close/shared/resolve-close-order-type.d.ts.map +1 -0
  49. package/dist/solvers/instant-close/shared/resolve-close-order-type.js +9 -0
  50. package/dist/solvers/instant-close/shared/resolve-close-order-type.js.map +1 -0
  51. package/dist/solvers/instant-close/shared/types.d.ts +3 -3
  52. package/dist/solvers/instant-open/get-instant-open-fees/get-instant-open-fees.d.ts +111 -35
  53. package/dist/solvers/instant-open/get-instant-open-fees/get-instant-open-fees.d.ts.map +1 -1
  54. package/dist/solvers/instant-open/get-instant-open-fees/get-instant-open-fees.js +168 -91
  55. package/dist/solvers/instant-open/get-instant-open-fees/get-instant-open-fees.js.map +1 -1
  56. package/dist/solvers/instant-open/get-instant-open-fees/query.d.ts +3 -2
  57. package/dist/solvers/instant-open/get-instant-open-fees/query.d.ts.map +1 -1
  58. package/dist/solvers/instant-open/get-instant-open-fees/query.js +4 -15
  59. package/dist/solvers/instant-open/get-instant-open-fees/query.js.map +1 -1
  60. package/dist/solvers/instant-open/prepare-instant-open-params/index.d.ts +1 -0
  61. package/dist/solvers/instant-open/prepare-instant-open-params/index.d.ts.map +1 -1
  62. package/dist/solvers/instant-open/prepare-instant-open-params/prepare-instant-open-params.d.ts +108 -12
  63. package/dist/solvers/instant-open/prepare-instant-open-params/prepare-instant-open-params.d.ts.map +1 -1
  64. package/dist/solvers/instant-open/prepare-instant-open-params/prepare-instant-open-params.js +169 -149
  65. package/dist/solvers/instant-open/prepare-instant-open-params/prepare-instant-open-params.js.map +1 -1
  66. package/dist/solvers/instant-open/prepare-instant-open-params/query.d.ts +49 -0
  67. package/dist/solvers/instant-open/prepare-instant-open-params/query.d.ts.map +1 -0
  68. package/dist/solvers/instant-open/prepare-instant-open-params/query.js +24 -0
  69. package/dist/solvers/instant-open/prepare-instant-open-params/query.js.map +1 -0
  70. package/dist/solvers/instant-open/prepare-instant-open-params/resolvers/index.d.ts +0 -1
  71. package/dist/solvers/instant-open/prepare-instant-open-params/resolvers/index.d.ts.map +1 -1
  72. package/dist/solvers/instant-open/shared/full-balance-sizing.d.ts +164 -0
  73. package/dist/solvers/instant-open/shared/full-balance-sizing.d.ts.map +1 -0
  74. package/dist/solvers/instant-open/shared/full-balance-sizing.js +138 -0
  75. package/dist/solvers/instant-open/shared/full-balance-sizing.js.map +1 -0
  76. package/dist/solvers/instant-open/shared/index.d.ts +1 -0
  77. package/dist/solvers/instant-open/shared/index.d.ts.map +1 -1
  78. package/dist/solvers/instant-open/shared/resolve-instant-open-sizing.d.ts +46 -0
  79. package/dist/solvers/instant-open/shared/resolve-instant-open-sizing.d.ts.map +1 -0
  80. package/dist/solvers/instant-open/shared/resolve-instant-open-sizing.js +50 -0
  81. package/dist/solvers/instant-open/shared/resolve-instant-open-sizing.js.map +1 -0
  82. package/dist/solvers/instant-open/shared/trade-math.d.ts +73 -26
  83. package/dist/solvers/instant-open/shared/trade-math.d.ts.map +1 -1
  84. package/dist/solvers/instant-open/shared/trade-math.js +18 -13
  85. package/dist/solvers/instant-open/shared/trade-math.js.map +1 -1
  86. package/dist/solvers/instant-open/shared/types.d.ts +18 -1
  87. package/dist/solvers/instant-open/shared/types.d.ts.map +1 -1
  88. package/dist/solvers/instant-open/shared/types.js.map +1 -1
  89. package/dist/solvers/limit-open/prepare-limit-open-params.d.ts +3 -1
  90. package/dist/solvers/limit-open/prepare-limit-open-params.d.ts.map +1 -1
  91. package/dist/solvers/limit-open/prepare-limit-open-params.js.map +1 -1
  92. package/dist/solvers/shared/resolvers/index.d.ts +2 -0
  93. package/dist/solvers/shared/resolvers/index.d.ts.map +1 -1
  94. package/dist/solvers/{instant-open/prepare-instant-open-params → shared}/resolvers/resolve-fee-rates.d.ts +3 -3
  95. package/dist/solvers/shared/resolvers/resolve-fee-rates.d.ts.map +1 -0
  96. package/dist/solvers/{instant-open/prepare-instant-open-params → shared}/resolvers/resolve-fee-rates.js +2 -2
  97. package/dist/solvers/shared/resolvers/resolve-fee-rates.js.map +1 -0
  98. package/dist/solvers/shared/resolvers/resolve-market.d.ts +21 -0
  99. package/dist/solvers/shared/resolvers/resolve-market.d.ts.map +1 -1
  100. package/dist/solvers/shared/resolvers/resolve-market.js +34 -18
  101. package/dist/solvers/shared/resolvers/resolve-market.js.map +1 -1
  102. package/dist/solvers/shared/resolvers/resolve-solver-info.d.ts +29 -0
  103. package/dist/solvers/shared/resolvers/resolve-solver-info.d.ts.map +1 -0
  104. package/dist/solvers/shared/resolvers/resolve-solver-info.js +21 -0
  105. package/dist/solvers/shared/resolvers/resolve-solver-info.js.map +1 -0
  106. package/dist/solvers/shared/resolvers/types.d.ts +12 -0
  107. package/dist/solvers/shared/resolvers/types.d.ts.map +1 -1
  108. package/dist/solvers/types/generated/enigma-solver.d.ts +43 -82
  109. package/dist/solvers/types/generated/enigma-solver.d.ts.map +1 -1
  110. package/dist/solvers/types/generated/enigma-solver.js +6 -6
  111. package/dist/solvers/types/generated/enigma-solver.js.map +1 -1
  112. package/dist/symmio-contracts/abi/v0.8.6/account-layer.d.ts +696 -85
  113. package/dist/symmio-contracts/abi/v0.8.6/account-layer.d.ts.map +1 -1
  114. package/dist/symmio-contracts/abi/v0.8.6/account-layer.js +815 -116
  115. package/dist/symmio-contracts/abi/v0.8.6/account-layer.js.map +1 -1
  116. package/dist/symmio-contracts/abi/v0.8.6/symmio.d.ts +1044 -467
  117. package/dist/symmio-contracts/abi/v0.8.6/symmio.d.ts.map +1 -1
  118. package/dist/symmio-contracts/abi/v0.8.6/symmio.js +1183 -496
  119. package/dist/symmio-contracts/abi/v0.8.6/symmio.js.map +1 -1
  120. package/dist/symmio-contracts/symmio/types.d.ts +3 -1
  121. package/dist/symmio-contracts/symmio/types.d.ts.map +1 -1
  122. package/dist/symmio-contracts/symmio/types.js +1 -1
  123. package/dist/symmio-contracts/symmio/types.js.map +1 -1
  124. package/package.json +3 -3
  125. package/dist/solvers/instant-open/prepare-instant-open-params/resolvers/resolve-fee-rates.d.ts.map +0 -1
  126. package/dist/solvers/instant-open/prepare-instant-open-params/resolvers/resolve-fee-rates.js.map +0 -1
@@ -203,7 +203,9 @@ export declare enum OrderType {
203
203
  /** Fills only at the requested price or better. */
204
204
  LIMIT = 0,
205
205
  /** Fills at the prevailing market price. */
206
- MARKET = 1
206
+ MARKET = 1,
207
+ /** Close-only market order that permits a close-to-liquidation fill and cancels the unfilled request remainder. */
208
+ MARKET_BEST_EFFORT = 2
207
209
  }
208
210
  /**
209
211
  * Lifecycle status of a quote, from creation through settlement.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/symm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IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,uDAAuD;IACvD,mBAAmB,EAAE,YAAY,CAAC;IAClC,+BAA+B;IAC/B,YAAY,EAAE,YAAY,CAAC;IAC3B,2CAA2C;IAC3C,cAAc,EAAE,MAAM,CAAC;IACvB,yDAAyD;IACzD,MAAM,EAAE,OAAO,CAAC;IAChB,oFAAoF;IACpF,MAAM,EAAE,OAAO,CAAC;IAChB,gCAAgC;IAChC,WAAW,EAAE,WAAW,CAAC;IACzB,4CAA4C;IAC5C,cAAc,EAAE,MAAM,CAAC;IACvB,iDAAiD;IACjD,mBAAmB,EAAE,MAAM,CAAC;IAC5B,2CAA2C;IAC3C,eAAe,EAAE,MAAM,CAAC;IACxB,6DAA6D;IAC7D,QAAQ,EAAE,MAAM,CAAC;IACjB,6CAA6C;IAC7C,eAAe,EAAE,MAAM,CAAC;IACxB,4DAA4D;IAC5D,qBAAqB,EAAE,MAAM,CAAC;IAC9B,gDAAgD;IAChD,2BAA2B,EAAE,MAAM,CAAC;IACpC,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,wCAAwC;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,sEAAsE;IACtE,SAAS,EAAE,OAAO,CAAC;IACnB;;;;;;;;OAQG;IACH,sBAAsB,EAAE,MAAM,CAAC;IAC/B,4BAA4B;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,sCAAsC;IACtC,IAAI,EAAE,GAAG,CAAC;CACX"}
@@ -4,7 +4,7 @@ var e = /* @__PURE__ */ function(e) {
4
4
  }({}), t = /* @__PURE__ */ function(e) {
5
5
  return e[e.LONG = 0] = "LONG", e[e.SHORT = 1] = "SHORT", e;
6
6
  }({}), n = /* @__PURE__ */ function(e) {
7
- return e[e.LIMIT = 0] = "LIMIT", e[e.MARKET = 1] = "MARKET", e;
7
+ return e[e.LIMIT = 0] = "LIMIT", e[e.MARKET = 1] = "MARKET", e[e.MARKET_BEST_EFFORT = 2] = "MARKET_BEST_EFFORT", e;
8
8
  }({}), r = /* @__PURE__ */ function(e) {
9
9
  return e[e.PENDING = 0] = "PENDING", e[e.LOCKED = 1] = "LOCKED", e[e.CANCEL_PENDING = 2] = "CANCEL_PENDING", e[e.CANCELED = 3] = "CANCELED", e[e.OPENED = 4] = "OPENED", e[e.CLOSE_PENDING = 5] = "CLOSE_PENDING", e[e.CANCEL_CLOSE_PENDING = 6] = "CANCEL_CLOSE_PENDING", e[e.CLOSED = 7] = "CLOSED", e[e.LIQUIDATED = 8] = "LIQUIDATED", e[e.EXPIRED = 9] = "EXPIRED", e[e.LIQUIDATED_PENDING = 10] = "LIQUIDATED_PENDING", e;
10
10
  }({});
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../src/symmio-contracts/symmio/types.ts"],"sourcesContent":["import type { Address, Hex } from \"viem\";\nimport type { SchnorrSign } from \"../account-layer/types\";\n\n/**\n * A Muon attestation covering a party's uPnL **and** a symbol price, mirrored\n * from the on-chain `SingleUpnlAndPriceSig` struct field-for-field (same order)\n * so the object encodes directly as the contract tuple without translation.\n *\n * @remarks\n * This is the `upnlSig` argument of `sendQuoteWithAffiliateAndData`. Solvers\n * that enforce Muon verification (Rasa / majors) require a live attestation\n * here; the lowcap InstantLayer flow instead passes a placeholder and delegates\n * the byte range to the solver. Fetch a fresh one with `getSendQuoteUpnlSig`\n * immediately before signing — the attestation is timestamped and short-lived.\n *\n * Compare {@link SingleUpnlSig}, which is the uPnL-only variant (no `price`).\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.6/contracts/core/storages/MuonStorage.sol}\n */\nexport interface SingleUpnlAndPriceSig {\n /** Muon request id (opaque bytes). */\n reqId: Hex;\n /** Attestation timestamp (seconds). */\n timestamp: bigint;\n /** Signed unrealized PnL of the party, `int256` (may be negative). */\n upnl: bigint;\n /** Attested symbol price as 18-decimal fixed point. */\n price: bigint;\n /** Muon gateway signature over the request (opaque bytes). */\n gatewaySignature: Hex;\n /** The Schnorr TSS signature pieces. */\n sigs: SchnorrSign;\n}\n\n/**\n * A Muon attestation covering a symbol's price range over a time window,\n * mirrored from the on-chain `HighLowPriceSig` struct field-for-field (same\n * order) so the object encodes directly as the contract tuple without\n * translation.\n *\n * @remarks\n * This is what `forceClosePosition` / `settleAndForceClosePosition` verify to\n * prove the market traded through the position's close price during the window.\n * Fetch one with `getForceClosePriceSig`.\n *\n * **Field-order footgun:** `upnlPartyB` comes **before** `upnlPartyA`. Swapping\n * them type-checks green (both are `bigint`) and silently mis-encodes the call.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.6/contracts/core/storages/MuonStorage.sol}\n */\nexport interface HighLowPriceSig {\n /** Muon request id (opaque bytes). */\n reqId: Hex;\n /** Attestation timestamp (seconds). */\n timestamp: bigint;\n /** Symbol id the price range is for. */\n symbolId: bigint;\n /** Highest price observed in the window, 18-decimal fixed point. */\n highest: bigint;\n /** Lowest price observed in the window, 18-decimal fixed point. */\n lowest: bigint;\n /** Mean price over the window, 18-decimal fixed point (Muon returns it as `mean`). */\n averagePrice: bigint;\n /** Window start timestamp (seconds). */\n startTime: bigint;\n /** Window end timestamp (seconds). */\n endTime: bigint;\n /** PartyB's signed unrealized PnL, `int256`. Declared **before** `upnlPartyA`. */\n upnlPartyB: bigint;\n /** PartyA's signed unrealized PnL, `int256`. */\n upnlPartyA: bigint;\n /** Current price at attestation time, 18-decimal fixed point. */\n currentPrice: bigint;\n /** Muon gateway signature over the request (opaque bytes). */\n gatewaySignature: Hex;\n /** The Schnorr TSS signature pieces. */\n sigs: SchnorrSign;\n}\n\n/**\n * Lifecycle status of a SYMMIO withdraw request.\n *\n * @remarks\n * Names and ordering mirror the on-chain `enum WithdrawStatus` in\n * `WithdrawStorage.sol` (perps-core v0.8.6) exactly, so the `uint8` returned by\n * the withdraw read views casts directly to this enum without translation.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.6/contracts/core/storages/WithdrawStorage.sol}\n */\nexport enum WithdrawStatus {\n /** Created, awaiting provider acceptance (classic withdrawals stay here until finalized). */\n PENDING = 0,\n /** A provider accepted the request. */\n PROVIDER_ACCEPTED = 1,\n /** A provider declined the request; it was refunded. */\n PROVIDER_REJECTED = 2,\n /** Finalized successfully; funds were paid out. */\n COMPLETED = 3,\n /** The user requested cancellation; awaiting provider approval. */\n CANCEL_REQUESTED = 4,\n /** Fully cancelled and refunded. */\n CANCELLED = 5,\n /** Suspended due to a user-level restriction. */\n SUSPENDED = 6,\n}\n\n/**\n * One receiver \"part\" of a withdraw request. A single request may split its\n * amount across several parts (different chains/providers); a plain same-chain\n * withdrawal is a single part with both provider fields set to the zero address.\n *\n * Field shapes and ordering mirror the on-chain `WithdrawReceiverPart` struct in\n * `WithdrawStorage.sol` (perps-core v0.8.6) exactly, so the object encodes\n * directly as the contract tuple without translation.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.6/contracts/core/storages/WithdrawStorage.sol}\n */\nexport interface WithdrawReceiverPart {\n /** Caller-assigned part id, unique within the request. */\n id: bigint;\n /** Amount of collateral for this part, in the collateral token's smallest unit. */\n amount: bigint;\n /** Destination chain id (`int256` on-chain; the source chain for a same-chain part). */\n chainId: bigint;\n /** Destination address as raw bytes (a 20-byte EVM address is its own byte representation). */\n receiver: Hex;\n /** Virtual (cross-chain) provider, or the zero address for a same-chain part. */\n virtualProvider: Address;\n /** Express (instant) provider, or the zero address for a standard-cooldown part. */\n expressProvider: Address;\n}\n\n/**\n * A full withdraw request as stored on the SYMMIO core, returned by the withdraw\n * read views ({@link \"getWithdrawRequests\"}, {@link \"getPendingWithdrawRequests\"}).\n *\n * Field shapes and ordering mirror the on-chain `WithdrawRequest` struct in\n * `WithdrawStorage.sol` (perps-core v0.8.6). `status` is surfaced as the\n * {@link WithdrawStatus} enum rather than a raw `uint8`. Fields a newer\n * contracts generation added are **optional** and `undefined` on chains whose\n * deployment predates them (see `contractsVersion` in the chain config) —\n * today that is {@link WithdrawRequest.advancedAmount}, added in v0.8.6.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.6/contracts/core/storages/WithdrawStorage.sol}\n */\nexport interface WithdrawRequest {\n /** Sequential request id (starts at 1 per user). */\n id: bigint;\n /** The subaccount the request belongs to. */\n user: Address;\n /** The receiver parts the withdrawal is split into. */\n parts: readonly WithdrawReceiverPart[];\n /** Block timestamp at which the request was created. */\n timestamp: bigint;\n /** Earliest timestamp the request can be finalized. */\n cooldownEndTime: bigint;\n /** Current lifecycle status. */\n status: WithdrawStatus;\n /** Whether the request opted into the cooldown speed-up flow. */\n speedUp: boolean;\n /** Whether the cooldown was modified after creation (e.g. by an accepted speed-up). */\n isCooldownModified: boolean;\n /** The provider bound to the request, or the zero address for a classic withdrawal. */\n provider: Address;\n /** Whether the request is a pure-virtual (cross-chain, no express) withdrawal. */\n isPureVirtual: boolean;\n /** Opaque provider data (e.g. a signed option), or `0x`. */\n providerData: Hex;\n /** Total collateral amount across all parts. */\n totalAmount: bigint;\n /** Total amount delivered via virtual providers. */\n totalVirtualAmount: bigint;\n /**\n * Collateral already advanced to the provider before cooldown expiry\n * (express credit-line flow). Added in perps-core v0.8.6 — **`undefined` on a\n * `contractsVersion: \"0.8.5\"` chain**, whose contracts predate withdraw\n * advances.\n */\n advancedAmount?: bigint;\n}\n\n/**\n * Direction of a trading position.\n *\n * @remarks\n * Names and ordering mirror the on-chain `enum PositionType` in\n * `QuoteStorage.sol` (perps-core v0.8.6) exactly, so the `uint8` carried on a\n * {@link Quote} casts directly to this enum without translation.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.6/contracts/core/storages/QuoteStorage.sol}\n */\nexport enum PositionType {\n /** A long position — profits when the market price rises. */\n LONG = 0,\n /** A short position — profits when the market price falls. */\n SHORT = 1,\n}\n\n/**\n * How an order is priced and filled.\n *\n * @remarks\n * Names and ordering mirror the on-chain `enum OrderType` in `QuoteStorage.sol`\n * (perps-core v0.8.6) exactly, so the `uint8` carried on a {@link Quote} casts\n * directly to this enum without translation.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.6/contracts/core/storages/QuoteStorage.sol}\n */\nexport enum OrderType {\n /** Fills only at the requested price or better. */\n LIMIT = 0,\n /** Fills at the prevailing market price. */\n MARKET = 1,\n}\n\n/**\n * Lifecycle status of a quote, from creation through settlement.\n *\n * @remarks\n * Names and ordering mirror the on-chain `enum QuoteStatus` in\n * `QuoteStorage.sol` (perps-core v0.8.6) exactly — all 11 members, including\n * `LIQUIDATED_PENDING` (10) — so the `uint8` carried on a {@link Quote} casts\n * directly to this enum without translation. `getPartyAOpenPositions` returns\n * only `OPENED`, `CLOSE_PENDING`, `CANCEL_CLOSE_PENDING`, and `LIQUIDATED_PENDING`\n * quotes; `getPartyAPendingQuotes` returns only `PENDING`, `LOCKED`, and\n * `CANCEL_PENDING`.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.6/contracts/core/storages/QuoteStorage.sol}\n */\nexport enum QuoteStatus {\n /** Created, awaiting a partyB to lock it. */\n PENDING = 0,\n /** A partyB locked the quote and is preparing to open it. */\n LOCKED = 1,\n /** PartyA requested cancellation of a still-pending quote. */\n CANCEL_PENDING = 2,\n /** The pending quote was cancelled before opening. */\n CANCELED = 3,\n /** Opened into a live position. */\n OPENED = 4,\n /** PartyA requested a (full or partial) close of the open position. */\n CLOSE_PENDING = 5,\n /** PartyA requested cancellation of a pending close. */\n CANCEL_CLOSE_PENDING = 6,\n /** The position was fully closed. */\n CLOSED = 7,\n /** The position was liquidated. */\n LIQUIDATED = 8,\n /** The pending quote expired before being opened. */\n EXPIRED = 9,\n /** Liquidation is in progress for the position. */\n LIQUIDATED_PENDING = 10,\n}\n\n/**\n * Margin amounts locked against a {@link Quote}, in the collateral token's\n * smallest unit (raw `uint256`).\n *\n * Field shapes and ordering mirror the on-chain `struct LockedValues` in\n * `QuoteStorage.sol` (perps-core v0.8.6) exactly, so the object decodes directly\n * from the contract tuple without translation.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.6/contracts/core/storages/QuoteStorage.sol}\n */\nexport interface LockedValues {\n /** Credit Valuation Adjustment locked by partyA. */\n cva: bigint;\n /** Liquidation Fee locked by partyA. */\n lf: bigint;\n /** PartyA maintenance margin. */\n partyAmm: bigint;\n /** PartyB maintenance margin. */\n partyBmm: bigint;\n}\n\n/**\n * A full trading quote or open position as stored on the SYMMIO core, returned\n * by the quote read views ({@link \"getQuote\"}, {@link \"getPartyAOpenPositions\"}).\n *\n * Field shapes and ordering mirror the on-chain `struct Quote` in\n * `QuoteStorage.sol` (perps-core v0.8.6) exactly — every `uint256`/`int256` is a\n * raw `bigint` (no decimal scaling applied) and the `uint8` enum fields are\n * surfaced as the {@link PositionType}, {@link OrderType}, and {@link QuoteStatus}\n * enums rather than raw numbers. Prices and amounts are 18-decimal fixed point.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.6/contracts/core/storages/QuoteStorage.sol}\n */\nexport interface Quote {\n /** Sequential quote id (starts at 1; `0n` is the not-found sentinel). */\n id: bigint;\n /** PartyB addresses allowed to fill this quote (empty means any). */\n partyBsWhiteList: readonly Address[];\n /** Market identifier (`symbolId`) the quote trades. */\n symbolId: bigint;\n /** Long or short. */\n positionType: PositionType;\n /** Limit or market order. */\n orderType: OrderType;\n /** Price partyB actually opened at (0 until opened). */\n openedPrice: bigint;\n /** Price partyA originally requested to open at. */\n initialOpenedPrice: bigint;\n /** Current requested open price (may differ from `initialOpenedPrice` after edits). */\n requestedOpenPrice: bigint;\n /** Market price snapshot recorded on the quote at its last state change. */\n marketPrice: bigint;\n /** Total quantity partyA requested. */\n quantity: bigint;\n /** Quantity already closed. */\n closedAmount: bigint;\n /** Margin locked at open time (basis for leverage). */\n initialLockedValues: LockedValues;\n /** Margin currently locked. */\n lockedValues: LockedValues;\n /** Maximum funding rate partyA accepts. */\n maxFundingRate: bigint;\n /** Owner of the quote — the virtual account (lowcap). */\n partyA: Address;\n /** The partyB (hedger/solver) that locked/opened the quote, or the zero address. */\n partyB: Address;\n /** Current lifecycle status. */\n quoteStatus: QuoteStatus;\n /** Average price across executed closes. */\n avgClosedPrice: bigint;\n /** Requested limit price for a pending close. */\n requestedClosePrice: bigint;\n /** Quantity of a pending close request. */\n quantityToClose: bigint;\n /** Parent quote id for a partially-opened child, or `0n`. */\n parentId: bigint;\n /** Block timestamp the quote was created. */\n createTimestamp: bigint;\n /** Block timestamp of the last status change (sort key). */\n statusModifyTimestamp: bigint;\n /** Block timestamp funding was last applied. */\n lastFundingPaymentTimestamp: bigint;\n /** Quote deadline (expiry) timestamp. */\n deadline: bigint;\n /** Trading fee charged on the quote. */\n tradingFee: bigint;\n /** Affiliate address attributed to the quote, or the zero address. */\n affiliate: Address;\n /**\n * Per-unit cumulative funding-fee **index** recorded at this quote's last\n * settlement (`int256`, 18-decimal fixed point, cost-positive). **Not a\n * currency amount**, so summing this field across quotes is meaningless:\n * `openAmount × (currentFee − accumulatedPaidFunding) / 1e18` is the\n * **pending**, not-yet-settled fee — read that with\n * {@link getQuotePendingFunding}. For settled funding amounts use\n * {@link getQuoteFunding} / {@link aggregateGroupFunding}.\n */\n accumulatedPaidFunding: bigint;\n /** Fee charged on close. */\n closeFee: bigint;\n /** Opaque per-quote data, or `0x`. */\n data: Hex;\n}\n"],"mappings":";AAyFA,IAAY,IAAL,yBAAA,GAAA;QAEL,EAAA,EAAA,UAAA,KAAA,WAEA,EAAA,EAAA,oBAAA,KAAA,qBAEA,EAAA,EAAA,oBAAA,KAAA,qBAEA,EAAA,EAAA,YAAA,KAAA,aAEA,EAAA,EAAA,mBAAA,KAAA,oBAEA,EAAA,EAAA,YAAA,KAAA,aAEA,EAAA,EAAA,YAAA,KAAA;AACF,EAAA,CAAA,CAAA,GAuFY,IAAL,yBAAA,GAAA;QAEL,EAAA,EAAA,OAAA,KAAA,QAEA,EAAA,EAAA,QAAA,KAAA;AACF,EAAA,CAAA,CAAA,GAYY,IAAL,yBAAA,GAAA;QAEL,EAAA,EAAA,QAAA,KAAA,SAEA,EAAA,EAAA,SAAA,KAAA;AACF,EAAA,CAAA,CAAA,GAgBY,IAAL,yBAAA,GAAA;QAEL,EAAA,EAAA,UAAA,KAAA,WAEA,EAAA,EAAA,SAAA,KAAA,UAEA,EAAA,EAAA,iBAAA,KAAA,kBAEA,EAAA,EAAA,WAAA,KAAA,YAEA,EAAA,EAAA,SAAA,KAAA,UAEA,EAAA,EAAA,gBAAA,KAAA,iBAEA,EAAA,EAAA,uBAAA,KAAA,wBAEA,EAAA,EAAA,SAAA,KAAA,UAEA,EAAA,EAAA,aAAA,KAAA,cAEA,EAAA,EAAA,UAAA,KAAA,WAEA,EAAA,EAAA,qBAAA,MAAA;AACF,EAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../src/symmio-contracts/symmio/types.ts"],"sourcesContent":["import type { Address, Hex } from \"viem\";\nimport type { SchnorrSign } from \"../account-layer/types\";\n\n/**\n * A Muon attestation covering a party's uPnL **and** a symbol price, mirrored\n * from the on-chain `SingleUpnlAndPriceSig` struct field-for-field (same order)\n * so the object encodes directly as the contract tuple without translation.\n *\n * @remarks\n * This is the `upnlSig` argument of `sendQuoteWithAffiliateAndData`. Solvers\n * that enforce Muon verification (Rasa / majors) require a live attestation\n * here; the lowcap InstantLayer flow instead passes a placeholder and delegates\n * the byte range to the solver. Fetch a fresh one with `getSendQuoteUpnlSig`\n * immediately before signing — the attestation is timestamped and short-lived.\n *\n * Compare {@link SingleUpnlSig}, which is the uPnL-only variant (no `price`).\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.6/contracts/core/storages/MuonStorage.sol}\n */\nexport interface SingleUpnlAndPriceSig {\n /** Muon request id (opaque bytes). */\n reqId: Hex;\n /** Attestation timestamp (seconds). */\n timestamp: bigint;\n /** Signed unrealized PnL of the party, `int256` (may be negative). */\n upnl: bigint;\n /** Attested symbol price as 18-decimal fixed point. */\n price: bigint;\n /** Muon gateway signature over the request (opaque bytes). */\n gatewaySignature: Hex;\n /** The Schnorr TSS signature pieces. */\n sigs: SchnorrSign;\n}\n\n/**\n * A Muon attestation covering a symbol's price range over a time window,\n * mirrored from the on-chain `HighLowPriceSig` struct field-for-field (same\n * order) so the object encodes directly as the contract tuple without\n * translation.\n *\n * @remarks\n * This is what `forceClosePosition` / `settleAndForceClosePosition` verify to\n * prove the market traded through the position's close price during the window.\n * Fetch one with `getForceClosePriceSig`.\n *\n * **Field-order footgun:** `upnlPartyB` comes **before** `upnlPartyA`. Swapping\n * them type-checks green (both are `bigint`) and silently mis-encodes the call.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.6/contracts/core/storages/MuonStorage.sol}\n */\nexport interface HighLowPriceSig {\n /** Muon request id (opaque bytes). */\n reqId: Hex;\n /** Attestation timestamp (seconds). */\n timestamp: bigint;\n /** Symbol id the price range is for. */\n symbolId: bigint;\n /** Highest price observed in the window, 18-decimal fixed point. */\n highest: bigint;\n /** Lowest price observed in the window, 18-decimal fixed point. */\n lowest: bigint;\n /** Mean price over the window, 18-decimal fixed point (Muon returns it as `mean`). */\n averagePrice: bigint;\n /** Window start timestamp (seconds). */\n startTime: bigint;\n /** Window end timestamp (seconds). */\n endTime: bigint;\n /** PartyB's signed unrealized PnL, `int256`. Declared **before** `upnlPartyA`. */\n upnlPartyB: bigint;\n /** PartyA's signed unrealized PnL, `int256`. */\n upnlPartyA: bigint;\n /** Current price at attestation time, 18-decimal fixed point. */\n currentPrice: bigint;\n /** Muon gateway signature over the request (opaque bytes). */\n gatewaySignature: Hex;\n /** The Schnorr TSS signature pieces. */\n sigs: SchnorrSign;\n}\n\n/**\n * Lifecycle status of a SYMMIO withdraw request.\n *\n * @remarks\n * Names and ordering mirror the on-chain `enum WithdrawStatus` in\n * `WithdrawStorage.sol` (perps-core v0.8.6) exactly, so the `uint8` returned by\n * the withdraw read views casts directly to this enum without translation.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.6/contracts/core/storages/WithdrawStorage.sol}\n */\nexport enum WithdrawStatus {\n /** Created, awaiting provider acceptance (classic withdrawals stay here until finalized). */\n PENDING = 0,\n /** A provider accepted the request. */\n PROVIDER_ACCEPTED = 1,\n /** A provider declined the request; it was refunded. */\n PROVIDER_REJECTED = 2,\n /** Finalized successfully; funds were paid out. */\n COMPLETED = 3,\n /** The user requested cancellation; awaiting provider approval. */\n CANCEL_REQUESTED = 4,\n /** Fully cancelled and refunded. */\n CANCELLED = 5,\n /** Suspended due to a user-level restriction. */\n SUSPENDED = 6,\n}\n\n/**\n * One receiver \"part\" of a withdraw request. A single request may split its\n * amount across several parts (different chains/providers); a plain same-chain\n * withdrawal is a single part with both provider fields set to the zero address.\n *\n * Field shapes and ordering mirror the on-chain `WithdrawReceiverPart` struct in\n * `WithdrawStorage.sol` (perps-core v0.8.6) exactly, so the object encodes\n * directly as the contract tuple without translation.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.6/contracts/core/storages/WithdrawStorage.sol}\n */\nexport interface WithdrawReceiverPart {\n /** Caller-assigned part id, unique within the request. */\n id: bigint;\n /** Amount of collateral for this part, in the collateral token's smallest unit. */\n amount: bigint;\n /** Destination chain id (`int256` on-chain; the source chain for a same-chain part). */\n chainId: bigint;\n /** Destination address as raw bytes (a 20-byte EVM address is its own byte representation). */\n receiver: Hex;\n /** Virtual (cross-chain) provider, or the zero address for a same-chain part. */\n virtualProvider: Address;\n /** Express (instant) provider, or the zero address for a standard-cooldown part. */\n expressProvider: Address;\n}\n\n/**\n * A full withdraw request as stored on the SYMMIO core, returned by the withdraw\n * read views ({@link \"getWithdrawRequests\"}, {@link \"getPendingWithdrawRequests\"}).\n *\n * Field shapes and ordering mirror the on-chain `WithdrawRequest` struct in\n * `WithdrawStorage.sol` (perps-core v0.8.6). `status` is surfaced as the\n * {@link WithdrawStatus} enum rather than a raw `uint8`. Fields a newer\n * contracts generation added are **optional** and `undefined` on chains whose\n * deployment predates them (see `contractsVersion` in the chain config) —\n * today that is {@link WithdrawRequest.advancedAmount}, added in v0.8.6.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.6/contracts/core/storages/WithdrawStorage.sol}\n */\nexport interface WithdrawRequest {\n /** Sequential request id (starts at 1 per user). */\n id: bigint;\n /** The subaccount the request belongs to. */\n user: Address;\n /** The receiver parts the withdrawal is split into. */\n parts: readonly WithdrawReceiverPart[];\n /** Block timestamp at which the request was created. */\n timestamp: bigint;\n /** Earliest timestamp the request can be finalized. */\n cooldownEndTime: bigint;\n /** Current lifecycle status. */\n status: WithdrawStatus;\n /** Whether the request opted into the cooldown speed-up flow. */\n speedUp: boolean;\n /** Whether the cooldown was modified after creation (e.g. by an accepted speed-up). */\n isCooldownModified: boolean;\n /** The provider bound to the request, or the zero address for a classic withdrawal. */\n provider: Address;\n /** Whether the request is a pure-virtual (cross-chain, no express) withdrawal. */\n isPureVirtual: boolean;\n /** Opaque provider data (e.g. a signed option), or `0x`. */\n providerData: Hex;\n /** Total collateral amount across all parts. */\n totalAmount: bigint;\n /** Total amount delivered via virtual providers. */\n totalVirtualAmount: bigint;\n /**\n * Collateral already advanced to the provider before cooldown expiry\n * (express credit-line flow). Added in perps-core v0.8.6 — **`undefined` on a\n * `contractsVersion: \"0.8.5\"` chain**, whose contracts predate withdraw\n * advances.\n */\n advancedAmount?: bigint;\n}\n\n/**\n * Direction of a trading position.\n *\n * @remarks\n * Names and ordering mirror the on-chain `enum PositionType` in\n * `QuoteStorage.sol` (perps-core v0.8.6) exactly, so the `uint8` carried on a\n * {@link Quote} casts directly to this enum without translation.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.6/contracts/core/storages/QuoteStorage.sol}\n */\nexport enum PositionType {\n /** A long position — profits when the market price rises. */\n LONG = 0,\n /** A short position — profits when the market price falls. */\n SHORT = 1,\n}\n\n/**\n * How an order is priced and filled.\n *\n * @remarks\n * Names and ordering mirror the on-chain `enum OrderType` in `QuoteStorage.sol`\n * (perps-core v0.8.6) exactly, so the `uint8` carried on a {@link Quote} casts\n * directly to this enum without translation.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.6/contracts/core/storages/QuoteStorage.sol}\n */\nexport enum OrderType {\n /** Fills only at the requested price or better. */\n LIMIT = 0,\n /** Fills at the prevailing market price. */\n MARKET = 1,\n /** Close-only market order that permits a close-to-liquidation fill and cancels the unfilled request remainder. */\n MARKET_BEST_EFFORT = 2,\n}\n\n/**\n * Lifecycle status of a quote, from creation through settlement.\n *\n * @remarks\n * Names and ordering mirror the on-chain `enum QuoteStatus` in\n * `QuoteStorage.sol` (perps-core v0.8.6) exactly — all 11 members, including\n * `LIQUIDATED_PENDING` (10) — so the `uint8` carried on a {@link Quote} casts\n * directly to this enum without translation. `getPartyAOpenPositions` returns\n * only `OPENED`, `CLOSE_PENDING`, `CANCEL_CLOSE_PENDING`, and `LIQUIDATED_PENDING`\n * quotes; `getPartyAPendingQuotes` returns only `PENDING`, `LOCKED`, and\n * `CANCEL_PENDING`.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.6/contracts/core/storages/QuoteStorage.sol}\n */\nexport enum QuoteStatus {\n /** Created, awaiting a partyB to lock it. */\n PENDING = 0,\n /** A partyB locked the quote and is preparing to open it. */\n LOCKED = 1,\n /** PartyA requested cancellation of a still-pending quote. */\n CANCEL_PENDING = 2,\n /** The pending quote was cancelled before opening. */\n CANCELED = 3,\n /** Opened into a live position. */\n OPENED = 4,\n /** PartyA requested a (full or partial) close of the open position. */\n CLOSE_PENDING = 5,\n /** PartyA requested cancellation of a pending close. */\n CANCEL_CLOSE_PENDING = 6,\n /** The position was fully closed. */\n CLOSED = 7,\n /** The position was liquidated. */\n LIQUIDATED = 8,\n /** The pending quote expired before being opened. */\n EXPIRED = 9,\n /** Liquidation is in progress for the position. */\n LIQUIDATED_PENDING = 10,\n}\n\n/**\n * Margin amounts locked against a {@link Quote}, in the collateral token's\n * smallest unit (raw `uint256`).\n *\n * Field shapes and ordering mirror the on-chain `struct LockedValues` in\n * `QuoteStorage.sol` (perps-core v0.8.6) exactly, so the object decodes directly\n * from the contract tuple without translation.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.6/contracts/core/storages/QuoteStorage.sol}\n */\nexport interface LockedValues {\n /** Credit Valuation Adjustment locked by partyA. */\n cva: bigint;\n /** Liquidation Fee locked by partyA. */\n lf: bigint;\n /** PartyA maintenance margin. */\n partyAmm: bigint;\n /** PartyB maintenance margin. */\n partyBmm: bigint;\n}\n\n/**\n * A full trading quote or open position as stored on the SYMMIO core, returned\n * by the quote read views ({@link \"getQuote\"}, {@link \"getPartyAOpenPositions\"}).\n *\n * Field shapes and ordering mirror the on-chain `struct Quote` in\n * `QuoteStorage.sol` (perps-core v0.8.6) exactly — every `uint256`/`int256` is a\n * raw `bigint` (no decimal scaling applied) and the `uint8` enum fields are\n * surfaced as the {@link PositionType}, {@link OrderType}, and {@link QuoteStatus}\n * enums rather than raw numbers. Prices and amounts are 18-decimal fixed point.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.6/contracts/core/storages/QuoteStorage.sol}\n */\nexport interface Quote {\n /** Sequential quote id (starts at 1; `0n` is the not-found sentinel). */\n id: bigint;\n /** PartyB addresses allowed to fill this quote (empty means any). */\n partyBsWhiteList: readonly Address[];\n /** Market identifier (`symbolId`) the quote trades. */\n symbolId: bigint;\n /** Long or short. */\n positionType: PositionType;\n /** Limit or market order. */\n orderType: OrderType;\n /** Price partyB actually opened at (0 until opened). */\n openedPrice: bigint;\n /** Price partyA originally requested to open at. */\n initialOpenedPrice: bigint;\n /** Current requested open price (may differ from `initialOpenedPrice` after edits). */\n requestedOpenPrice: bigint;\n /** Market price snapshot recorded on the quote at its last state change. */\n marketPrice: bigint;\n /** Total quantity partyA requested. */\n quantity: bigint;\n /** Quantity already closed. */\n closedAmount: bigint;\n /** Margin locked at open time (basis for leverage). */\n initialLockedValues: LockedValues;\n /** Margin currently locked. */\n lockedValues: LockedValues;\n /** Maximum funding rate partyA accepts. */\n maxFundingRate: bigint;\n /** Owner of the quote — the virtual account (lowcap). */\n partyA: Address;\n /** The partyB (hedger/solver) that locked/opened the quote, or the zero address. */\n partyB: Address;\n /** Current lifecycle status. */\n quoteStatus: QuoteStatus;\n /** Average price across executed closes. */\n avgClosedPrice: bigint;\n /** Requested limit price for a pending close. */\n requestedClosePrice: bigint;\n /** Quantity of a pending close request. */\n quantityToClose: bigint;\n /** Parent quote id for a partially-opened child, or `0n`. */\n parentId: bigint;\n /** Block timestamp the quote was created. */\n createTimestamp: bigint;\n /** Block timestamp of the last status change (sort key). */\n statusModifyTimestamp: bigint;\n /** Block timestamp funding was last applied. */\n lastFundingPaymentTimestamp: bigint;\n /** Quote deadline (expiry) timestamp. */\n deadline: bigint;\n /** Trading fee charged on the quote. */\n tradingFee: bigint;\n /** Affiliate address attributed to the quote, or the zero address. */\n affiliate: Address;\n /**\n * Per-unit cumulative funding-fee **index** recorded at this quote's last\n * settlement (`int256`, 18-decimal fixed point, cost-positive). **Not a\n * currency amount**, so summing this field across quotes is meaningless:\n * `openAmount × (currentFee − accumulatedPaidFunding) / 1e18` is the\n * **pending**, not-yet-settled fee — read that with\n * {@link getQuotePendingFunding}. For settled funding amounts use\n * {@link getQuoteFunding} / {@link aggregateGroupFunding}.\n */\n accumulatedPaidFunding: bigint;\n /** Fee charged on close. */\n closeFee: bigint;\n /** Opaque per-quote data, or `0x`. */\n data: Hex;\n}\n"],"mappings":";AAyFA,IAAY,IAAL,yBAAA,GAAA;QAEL,EAAA,EAAA,UAAA,KAAA,WAEA,EAAA,EAAA,oBAAA,KAAA,qBAEA,EAAA,EAAA,oBAAA,KAAA,qBAEA,EAAA,EAAA,YAAA,KAAA,aAEA,EAAA,EAAA,mBAAA,KAAA,oBAEA,EAAA,EAAA,YAAA,KAAA,aAEA,EAAA,EAAA,YAAA,KAAA;AACF,EAAA,CAAA,CAAA,GAuFY,IAAL,yBAAA,GAAA;QAEL,EAAA,EAAA,OAAA,KAAA,QAEA,EAAA,EAAA,QAAA,KAAA;AACF,EAAA,CAAA,CAAA,GAYY,IAAL,yBAAA,GAAA;QAEL,EAAA,EAAA,QAAA,KAAA,SAEA,EAAA,EAAA,SAAA,KAAA,UAEA,EAAA,EAAA,qBAAA,KAAA;AACF,EAAA,CAAA,CAAA,GAgBY,IAAL,yBAAA,GAAA;QAEL,EAAA,EAAA,UAAA,KAAA,WAEA,EAAA,EAAA,SAAA,KAAA,UAEA,EAAA,EAAA,iBAAA,KAAA,kBAEA,EAAA,EAAA,WAAA,KAAA,YAEA,EAAA,EAAA,SAAA,KAAA,UAEA,EAAA,EAAA,gBAAA,KAAA,iBAEA,EAAA,EAAA,uBAAA,KAAA,wBAEA,EAAA,EAAA,SAAA,KAAA,UAEA,EAAA,EAAA,aAAA,KAAA,cAEA,EAAA,EAAA,UAAA,KAAA,WAEA,EAAA,EAAA,qBAAA,MAAA;AACF,EAAA,CAAA,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symmio/trading-core",
3
- "version": "3.1.0",
3
+ "version": "3.2.0",
4
4
  "description": "Framework-agnostic SYMMIO SDK. Contract calls, calculations, and transformations with no framework assumptions.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/SYMM-IO/Trading-SDK/tree/main/packages/trading-core#readme",
@@ -48,8 +48,8 @@
48
48
  "vite": "^8.0.13",
49
49
  "vite-plugin-dts": "^5.0.0",
50
50
  "vitest": "^4.1.10",
51
- "@symmio/eslint-config": "^1.0.0",
52
- "@symmio/typescript-config": "^1.0.0"
51
+ "@symmio/typescript-config": "^1.0.0",
52
+ "@symmio/eslint-config": "^1.0.0"
53
53
  },
54
54
  "dependencies": {
55
55
  "@tanstack/query-core": "^5.90.5",
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve-fee-rates.d.ts","sourceRoot":"","sources":["../../../../../src/solvers/instant-open/prepare-instant-open-params/resolvers/resolve-fee-rates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,8DAA8D,CAAC;AAC9G,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAEvE;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,UAAU,CAAC;CACvB;AAED;;;GAGG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,yBAAyB,GACpC,OAAO,CAAC,uBAAuB,CAAC,CAWlC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve-fee-rates.js","names":[],"sources":["../../../../../src/solvers/instant-open/prepare-instant-open-params/resolvers/resolve-fee-rates.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../../../core/config\";\nimport { getFeeForUser, type FeeForUser } from \"../../../../symmio-contracts/symmio/actions/get-fee-for-user\";\nimport type { ComputePlatformFeeRates } from \"../../shared/trade-math\";\n\n/**\n * Parameters for {@link resolveFeeRates}.\n */\nexport interface ResolveFeeRatesParameters {\n chainId?: number;\n subAccountAddress: Address;\n marketId: number;\n /**\n * Pre-fetched on-chain fee rates (matches `getFeeForUser` return shape).\n * When supplied, the fetch is skipped.\n */\n feeRates?: FeeForUser;\n}\n\n/**\n * Resolve `openFee` / `closeFee` rates. Returns caller-supplied values when\n * present; otherwise calls `getFeeForUser` on-chain.\n */\nexport async function resolveFeeRates(\n config: Config,\n parameters: ResolveFeeRatesParameters,\n): Promise<ComputePlatformFeeRates> {\n if (parameters.feeRates) {\n return { openFee: parameters.feeRates.openFee, closeFee: parameters.feeRates.closeFee };\n }\n\n const fee = await getFeeForUser(config, {\n chainId: parameters.chainId,\n user: parameters.subAccountAddress,\n symbolId: BigInt(parameters.marketId),\n });\n return { openFee: fee.openFee, closeFee: fee.closeFee };\n}\n"],"mappings":";;AAuBA,eAAsB,EACpB,GACA,GACkC;CAClC,IAAI,EAAW,UACb,OAAO;EAAE,SAAS,EAAW,SAAS;EAAS,UAAU,EAAW,SAAS;CAAS;CAGxF,IAAM,IAAM,MAAM,EAAc,GAAQ;EACtC,SAAS,EAAW;EACpB,MAAM,EAAW;EACjB,UAAU,OAAO,EAAW,QAAQ;CACtC,CAAC;CACD,OAAO;EAAE,SAAS,EAAI;EAAS,UAAU,EAAI;CAAS;AACxD"}