@lightconexyz/lightcone-sdk 0.8.1 → 0.8.2

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 (95) hide show
  1. package/README.md +150 -3
  2. package/dist/auth/client.d.ts +17 -1
  3. package/dist/auth/client.d.ts.map +1 -1
  4. package/dist/auth/client.js +68 -0
  5. package/dist/auth/client.js.map +1 -1
  6. package/dist/auth/index.d.ts +57 -5
  7. package/dist/auth/index.d.ts.map +1 -1
  8. package/dist/auth/index.js +26 -5
  9. package/dist/auth/index.js.map +1 -1
  10. package/dist/client.d.ts +23 -1
  11. package/dist/client.d.ts.map +1 -1
  12. package/dist/client.js +38 -2
  13. package/dist/client.js.map +1 -1
  14. package/dist/context.d.ts +23 -2
  15. package/dist/context.d.ts.map +1 -1
  16. package/dist/context.js +238 -17
  17. package/dist/context.js.map +1 -1
  18. package/dist/domain/market/outcome.d.ts +9 -3
  19. package/dist/domain/market/outcome.d.ts.map +1 -1
  20. package/dist/domain/market/outcome.js +10 -7
  21. package/dist/domain/market/outcome.js.map +1 -1
  22. package/dist/domain/market/wire.d.ts +3 -3
  23. package/dist/domain/market/wire.d.ts.map +1 -1
  24. package/dist/domain/market/wire.js.map +1 -1
  25. package/dist/domain/orderbook/wire.d.ts +5 -0
  26. package/dist/domain/orderbook/wire.d.ts.map +1 -1
  27. package/dist/domain/orderbook/wire.js.map +1 -1
  28. package/dist/domain/position/client.d.ts +160 -4
  29. package/dist/domain/position/client.d.ts.map +1 -1
  30. package/dist/domain/position/client.js +592 -4
  31. package/dist/domain/position/client.js.map +1 -1
  32. package/dist/domain/position/index.d.ts +54 -3
  33. package/dist/domain/position/index.d.ts.map +1 -1
  34. package/dist/domain/position/index.js +1 -0
  35. package/dist/domain/position/index.js.map +1 -1
  36. package/dist/domain/position/state.d.ts +118 -0
  37. package/dist/domain/position/state.d.ts.map +1 -0
  38. package/dist/domain/position/state.js +262 -0
  39. package/dist/domain/position/state.js.map +1 -0
  40. package/dist/error.d.ts +8 -2
  41. package/dist/error.d.ts.map +1 -1
  42. package/dist/error.js +14 -1
  43. package/dist/error.js.map +1 -1
  44. package/dist/index.d.ts +4 -3
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +3 -1
  47. package/dist/index.js.map +1 -1
  48. package/dist/prelude.d.ts +6 -5
  49. package/dist/prelude.d.ts.map +1 -1
  50. package/dist/prelude.js +10 -1
  51. package/dist/prelude.js.map +1 -1
  52. package/dist/privy/client.d.ts +4 -0
  53. package/dist/privy/client.d.ts.map +1 -1
  54. package/dist/privy/client.js +4 -0
  55. package/dist/privy/client.js.map +1 -1
  56. package/dist/rpc.d.ts +46 -1
  57. package/dist/rpc.d.ts.map +1 -1
  58. package/dist/rpc.js +125 -0
  59. package/dist/rpc.js.map +1 -1
  60. package/dist/shared/api_response.d.ts +7 -0
  61. package/dist/shared/api_response.d.ts.map +1 -1
  62. package/dist/shared/api_response.js +16 -0
  63. package/dist/shared/api_response.js.map +1 -1
  64. package/dist/shared/index.d.ts +1 -1
  65. package/dist/shared/index.d.ts.map +1 -1
  66. package/dist/shared/index.js +2 -1
  67. package/dist/shared/index.js.map +1 -1
  68. package/dist/shared/signing.d.ts +17 -0
  69. package/dist/shared/signing.d.ts.map +1 -1
  70. package/dist/shared/signing.js +27 -0
  71. package/dist/shared/signing.js.map +1 -1
  72. package/dist/shared/types.d.ts +3 -1
  73. package/dist/shared/types.d.ts.map +1 -1
  74. package/dist/shared/types.js +12 -4
  75. package/dist/shared/types.js.map +1 -1
  76. package/dist/ws/client.browser.d.ts +4 -0
  77. package/dist/ws/client.browser.d.ts.map +1 -1
  78. package/dist/ws/client.browser.js +13 -1
  79. package/dist/ws/client.browser.js.map +1 -1
  80. package/dist/ws/client.node.d.ts +4 -0
  81. package/dist/ws/client.node.d.ts.map +1 -1
  82. package/dist/ws/client.node.js +13 -1
  83. package/dist/ws/client.node.js.map +1 -1
  84. package/dist/ws/index.d.ts +24 -0
  85. package/dist/ws/index.d.ts.map +1 -1
  86. package/dist/ws/index.js +162 -1
  87. package/dist/ws/index.js.map +1 -1
  88. package/dist/ws/subscriptions.d.ts +12 -1
  89. package/dist/ws/subscriptions.d.ts.map +1 -1
  90. package/dist/ws/subscriptions.js +11 -0
  91. package/dist/ws/subscriptions.js.map +1 -1
  92. package/dist/ws/types.d.ts +5 -0
  93. package/dist/ws/types.d.ts.map +1 -1
  94. package/dist/ws/types.js.map +1 -1
  95. package/package.json +2 -1
@@ -1 +1 @@
1
- {"version":3,"file":"wire.js","sourceRoot":"","sources":["../../../src/domain/orderbook/wire.ts"],"names":[],"mappings":";;AAkFA,oDA0BC;AAED,wDAkBC;AA9CD,SAAgB,oBAAoB,CAAC,IAAsB;IACzD,IACE,CAAC,IAAI;QACL,CAAC,wBAAwB,CAAC,IAAI,CAAC,kBAAkB,CAAC;QAClD,CAAC,wBAAwB,CAAC,IAAI,CAAC,kBAAkB,CAAC;QAClD,CAAC,wBAAwB,CAAC,IAAI,CAAC,6BAA6B,CAAC;QAC7D,OAAO,IAAI,CAAC,6BAA6B,KAAK,SAAS;QACvD,OAAO,IAAI,CAAC,aAAa,KAAK,QAAQ;QACtC,OAAO,IAAI,CAAC,iBAAiB,KAAK,QAAQ;QAC1C,OAAO,IAAI,CAAC,iBAAiB,KAAK,QAAQ;QAC1C,OAAO,IAAI,CAAC,qBAAqB,KAAK,QAAQ;QAC9C,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC;QACrC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,EACzC,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACpD,CAAC;IACD,OAAO;QACL,gBAAgB,EAAE,IAAI,CAAC,kBAAkB;QACzC,gBAAgB,EAAE,IAAI,CAAC,kBAAkB;QACzC,0BAA0B,EAAE,IAAI,CAAC,6BAA6B;QAC9D,0BAA0B,EAAE,IAAI,CAAC,6BAA6B;QAC9D,YAAY,EAAE,IAAI,CAAC,aAAa;QAChC,eAAe,EAAE,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC;QAC/C,eAAe,EAAE,IAAI,CAAC,iBAAiB;QACvC,kBAAkB,EAAE,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC;KACvD,CAAC;AACJ,CAAC;AAED,SAAgB,sBAAsB,CAAC,IAAsB;IAC3D,IACE,CAAC,IAAI;QACL,OAAO,IAAI,CAAC,YAAY,KAAK,QAAQ;QACrC,CAAC,wBAAwB,CAAC,IAAI,CAAC,aAAa,CAAC;QAC7C,CAAC,wBAAwB,CAAC,IAAI,CAAC,cAAc,CAAC;QAC9C,CAAC,wBAAwB,CAAC,IAAI,CAAC,cAAc,CAAC;QAC9C,CAAC,IAAI,CAAC,aAAa,EACnB,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACzD,CAAC;IACD,OAAO;QACL,WAAW,EAAE,IAAI,CAAC,YAAY;QAC9B,YAAY,EAAE,IAAI,CAAC,aAAa;QAChC,aAAa,EAAE,IAAI,CAAC,cAAc;QAClC,aAAa,EAAE,IAAI,CAAC,cAAc;QAClC,YAAY,EAAE,oBAAoB,CAAC,IAAI,CAAC,aAAa,CAAC;KACvD,CAAC;AACJ,CAAC;AAED,SAAS,wBAAwB,CAAC,KAAc;IAC9C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AAChF,CAAC","sourcesContent":["import type { OrderBookId, OrderbookRules, Side, TradingRules } from \"../../shared\";\n\nexport interface TradingRulesWire {\n base_size_decimals: number;\n max_price_decimals: number;\n max_price_significant_figures: number;\n integer_prices_always_allowed: boolean;\n price_quantum: string;\n price_quantum_raw: string;\n base_size_quantum: string;\n base_size_quantum_raw: string;\n}\n\nexport interface OrderbookResponse {\n id: number;\n market_pubkey: string;\n orderbook_id: string;\n base_token: string;\n quote_token: string;\n outcome_index?: number;\n tick_size: number;\n total_bids: number;\n total_asks: number;\n last_trade_price?: string;\n last_trade_time?: string;\n active: boolean;\n created_at: string;\n updated_at: string;\n}\n\nexport interface OrderbooksResponse {\n orderbooks: OrderbookResponse[];\n total: number;\n}\n\nexport interface RestBookLevel {\n price: string;\n size: string;\n orders?: number;\n}\n\n/**\n * REST depth response. Depth is capped server-side at 20 levels per side.\n */\nexport interface OrderbookDepthResponse {\n orderbook_id: OrderBookId;\n market_pubkey?: string;\n best_bid?: string;\n best_ask?: string;\n spread?: string;\n /** Deprecated backend alias; never use for order admission. */\n tick_size?: string;\n price_quantum: string;\n /** Parsed exact rules; raw quantum strings are exposed as bigint values. */\n trading_rules: TradingRules;\n bids_truncated: boolean;\n asks_truncated: boolean;\n revision: bigint;\n captured_at_ms: bigint;\n bids: RestBookLevel[];\n asks: RestBookLevel[];\n /** Required display decimals; size is base-token on-chain precision. */\n decimals: OrderbookDepthDecimals;\n}\n\n/**\n * Price/size display decimals from the depth endpoint. Distinct from\n * `DecimalsResponse` (the `/decimals` endpoint).\n */\nexport interface OrderbookDepthDecimals {\n price: number;\n size: number;\n}\n\nexport interface DecimalsResponse {\n orderbook_id: string;\n base_decimals: number;\n quote_decimals: number;\n price_decimals: number;\n trading_rules: TradingRulesWire;\n}\n\nexport function tradingRulesFromWire(wire: TradingRulesWire): TradingRules {\n if (\n !wire ||\n !isNonNegativeSafeInteger(wire.base_size_decimals) ||\n !isNonNegativeSafeInteger(wire.max_price_decimals) ||\n !isNonNegativeSafeInteger(wire.max_price_significant_figures) ||\n typeof wire.integer_prices_always_allowed !== \"boolean\" ||\n typeof wire.price_quantum !== \"string\" ||\n typeof wire.base_size_quantum !== \"string\" ||\n typeof wire.price_quantum_raw !== \"string\" ||\n typeof wire.base_size_quantum_raw !== \"string\" ||\n !/^\\d+$/.test(wire.price_quantum_raw) ||\n !/^\\d+$/.test(wire.base_size_quantum_raw)\n ) {\n throw new Error(\"invalid trading_rules response\");\n }\n return {\n baseSizeDecimals: wire.base_size_decimals,\n maxPriceDecimals: wire.max_price_decimals,\n maxPriceSignificantFigures: wire.max_price_significant_figures,\n integerPricesAlwaysAllowed: wire.integer_prices_always_allowed,\n priceQuantum: wire.price_quantum,\n priceQuantumRaw: BigInt(wire.price_quantum_raw),\n baseSizeQuantum: wire.base_size_quantum,\n baseSizeQuantumRaw: BigInt(wire.base_size_quantum_raw),\n };\n}\n\nexport function orderbookRulesFromWire(wire: DecimalsResponse): OrderbookRules {\n if (\n !wire ||\n typeof wire.orderbook_id !== \"string\" ||\n !isNonNegativeSafeInteger(wire.base_decimals) ||\n !isNonNegativeSafeInteger(wire.quote_decimals) ||\n !isNonNegativeSafeInteger(wire.price_decimals) ||\n !wire.trading_rules\n ) {\n throw new Error(\"invalid orderbook decimals response\");\n }\n return {\n orderbookId: wire.orderbook_id,\n baseDecimals: wire.base_decimals,\n quoteDecimals: wire.quote_decimals,\n priceDecimals: wire.price_decimals,\n tradingRules: tradingRulesFromWire(wire.trading_rules),\n };\n}\n\nfunction isNonNegativeSafeInteger(value: unknown): value is number {\n return typeof value === \"number\" && Number.isSafeInteger(value) && value >= 0;\n}\n\nexport interface WsBookLevel {\n side: Side;\n price: string;\n size: string;\n}\n\n/**\n * WS orderbook snapshot frame.\n *\n * The stream is snapshot-only: every data frame carries the full top-20\n * levels per side and replaces the previous book wholesale. `seq` is the\n * engine depth revision and is monotonic only within one subscription generation.\n */\nexport interface OrderBook {\n orderbook_id: OrderBookId;\n is_snapshot?: boolean;\n seq: bigint;\n resync?: boolean;\n timestamp?: string;\n bids: WsBookLevel[];\n asks: WsBookLevel[];\n bids_truncated?: boolean;\n asks_truncated?: boolean;\n /**\n * Aggregation tags echoed by the backend (omitted = full precision).\n * Always normalized server-side ((5, none) arrives as (5, 1)). Use\n * `aggregationFromFrame(book.n_sig_figs, book.mantissa)` to key\n * per-`(orderbook, aggregation)` book state.\n */\n n_sig_figs?: number;\n mantissa?: number;\n}\n\nexport interface WsTickerData {\n orderbook_id: OrderBookId;\n best_bid?: string;\n best_ask?: string;\n mid?: string;\n timestamp?: string;\n}\n"]}
1
+ {"version":3,"file":"wire.js","sourceRoot":"","sources":["../../../src/domain/orderbook/wire.ts"],"names":[],"mappings":";;AAkFA,oDA0BC;AAED,wDAkBC;AA9CD,SAAgB,oBAAoB,CAAC,IAAsB;IACzD,IACE,CAAC,IAAI;QACL,CAAC,wBAAwB,CAAC,IAAI,CAAC,kBAAkB,CAAC;QAClD,CAAC,wBAAwB,CAAC,IAAI,CAAC,kBAAkB,CAAC;QAClD,CAAC,wBAAwB,CAAC,IAAI,CAAC,6BAA6B,CAAC;QAC7D,OAAO,IAAI,CAAC,6BAA6B,KAAK,SAAS;QACvD,OAAO,IAAI,CAAC,aAAa,KAAK,QAAQ;QACtC,OAAO,IAAI,CAAC,iBAAiB,KAAK,QAAQ;QAC1C,OAAO,IAAI,CAAC,iBAAiB,KAAK,QAAQ;QAC1C,OAAO,IAAI,CAAC,qBAAqB,KAAK,QAAQ;QAC9C,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC;QACrC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,EACzC,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACpD,CAAC;IACD,OAAO;QACL,gBAAgB,EAAE,IAAI,CAAC,kBAAkB;QACzC,gBAAgB,EAAE,IAAI,CAAC,kBAAkB;QACzC,0BAA0B,EAAE,IAAI,CAAC,6BAA6B;QAC9D,0BAA0B,EAAE,IAAI,CAAC,6BAA6B;QAC9D,YAAY,EAAE,IAAI,CAAC,aAAa;QAChC,eAAe,EAAE,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC;QAC/C,eAAe,EAAE,IAAI,CAAC,iBAAiB;QACvC,kBAAkB,EAAE,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC;KACvD,CAAC;AACJ,CAAC;AAED,SAAgB,sBAAsB,CAAC,IAAsB;IAC3D,IACE,CAAC,IAAI;QACL,OAAO,IAAI,CAAC,YAAY,KAAK,QAAQ;QACrC,CAAC,wBAAwB,CAAC,IAAI,CAAC,aAAa,CAAC;QAC7C,CAAC,wBAAwB,CAAC,IAAI,CAAC,cAAc,CAAC;QAC9C,CAAC,wBAAwB,CAAC,IAAI,CAAC,cAAc,CAAC;QAC9C,CAAC,IAAI,CAAC,aAAa,EACnB,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACzD,CAAC;IACD,OAAO;QACL,WAAW,EAAE,IAAI,CAAC,YAAY;QAC9B,YAAY,EAAE,IAAI,CAAC,aAAa;QAChC,aAAa,EAAE,IAAI,CAAC,cAAc;QAClC,aAAa,EAAE,IAAI,CAAC,cAAc;QAClC,YAAY,EAAE,oBAAoB,CAAC,IAAI,CAAC,aAAa,CAAC;KACvD,CAAC;AACJ,CAAC;AAED,SAAS,wBAAwB,CAAC,KAAc;IAC9C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AAChF,CAAC","sourcesContent":["import type { OrderBookId, OrderbookRules, Side, TradingRules } from \"../../shared\";\n\nexport interface TradingRulesWire {\n base_size_decimals: number;\n max_price_decimals: number;\n max_price_significant_figures: number;\n integer_prices_always_allowed: boolean;\n price_quantum: string;\n price_quantum_raw: string;\n base_size_quantum: string;\n base_size_quantum_raw: string;\n}\n\nexport interface OrderbookResponse {\n id: number;\n market_pubkey: string;\n orderbook_id: string;\n base_token: string;\n quote_token: string;\n outcome_index?: number;\n tick_size: number;\n total_bids: number;\n total_asks: number;\n last_trade_price?: string;\n last_trade_time?: string;\n active: boolean;\n created_at: string;\n updated_at: string;\n}\n\nexport interface OrderbooksResponse {\n orderbooks: OrderbookResponse[];\n total: number;\n}\n\nexport interface RestBookLevel {\n price: string;\n size: string;\n orders?: number;\n}\n\n/**\n * REST depth response. Depth is capped server-side at 20 levels per side.\n */\nexport interface OrderbookDepthResponse {\n orderbook_id: OrderBookId;\n market_pubkey?: string;\n best_bid?: string;\n best_ask?: string;\n spread?: string;\n /** Deprecated backend alias; never use for order admission. */\n tick_size?: string;\n price_quantum: string;\n /** Parsed exact rules; raw quantum strings are exposed as bigint values. */\n trading_rules: TradingRules;\n bids_truncated: boolean;\n asks_truncated: boolean;\n revision: bigint;\n captured_at_ms: bigint;\n bids: RestBookLevel[];\n asks: RestBookLevel[];\n /** Required display decimals; size is base-token on-chain precision. */\n decimals: OrderbookDepthDecimals;\n}\n\n/**\n * Price/size display decimals from the depth endpoint. Distinct from\n * `DecimalsResponse` (the `/decimals` endpoint).\n */\nexport interface OrderbookDepthDecimals {\n price: number;\n size: number;\n}\n\nexport interface DecimalsResponse {\n orderbook_id: string;\n base_decimals: number;\n quote_decimals: number;\n price_decimals: number;\n trading_rules: TradingRulesWire;\n}\n\nexport function tradingRulesFromWire(wire: TradingRulesWire): TradingRules {\n if (\n !wire ||\n !isNonNegativeSafeInteger(wire.base_size_decimals) ||\n !isNonNegativeSafeInteger(wire.max_price_decimals) ||\n !isNonNegativeSafeInteger(wire.max_price_significant_figures) ||\n typeof wire.integer_prices_always_allowed !== \"boolean\" ||\n typeof wire.price_quantum !== \"string\" ||\n typeof wire.base_size_quantum !== \"string\" ||\n typeof wire.price_quantum_raw !== \"string\" ||\n typeof wire.base_size_quantum_raw !== \"string\" ||\n !/^\\d+$/.test(wire.price_quantum_raw) ||\n !/^\\d+$/.test(wire.base_size_quantum_raw)\n ) {\n throw new Error(\"invalid trading_rules response\");\n }\n return {\n baseSizeDecimals: wire.base_size_decimals,\n maxPriceDecimals: wire.max_price_decimals,\n maxPriceSignificantFigures: wire.max_price_significant_figures,\n integerPricesAlwaysAllowed: wire.integer_prices_always_allowed,\n priceQuantum: wire.price_quantum,\n priceQuantumRaw: BigInt(wire.price_quantum_raw),\n baseSizeQuantum: wire.base_size_quantum,\n baseSizeQuantumRaw: BigInt(wire.base_size_quantum_raw),\n };\n}\n\nexport function orderbookRulesFromWire(wire: DecimalsResponse): OrderbookRules {\n if (\n !wire ||\n typeof wire.orderbook_id !== \"string\" ||\n !isNonNegativeSafeInteger(wire.base_decimals) ||\n !isNonNegativeSafeInteger(wire.quote_decimals) ||\n !isNonNegativeSafeInteger(wire.price_decimals) ||\n !wire.trading_rules\n ) {\n throw new Error(\"invalid orderbook decimals response\");\n }\n return {\n orderbookId: wire.orderbook_id,\n baseDecimals: wire.base_decimals,\n quoteDecimals: wire.quote_decimals,\n priceDecimals: wire.price_decimals,\n tradingRules: tradingRulesFromWire(wire.trading_rules),\n };\n}\n\nfunction isNonNegativeSafeInteger(value: unknown): value is number {\n return typeof value === \"number\" && Number.isSafeInteger(value) && value >= 0;\n}\n\nexport interface WsBookLevel {\n side: Side;\n price: string;\n size: string;\n /**\n * Exact quote-token amount represented by the underlying maker orders.\n * For grouped books this is independent of the displayed bucket price.\n */\n quote_notional: string;\n}\n\n/**\n * WS orderbook snapshot frame.\n *\n * The stream is snapshot-only: every data frame carries the full top-20\n * levels per side and replaces the previous book wholesale. `seq` is the\n * engine depth revision and is monotonic only within one subscription generation.\n */\nexport interface OrderBook {\n orderbook_id: OrderBookId;\n is_snapshot?: boolean;\n seq: bigint;\n resync?: boolean;\n timestamp?: string;\n bids: WsBookLevel[];\n asks: WsBookLevel[];\n bids_truncated?: boolean;\n asks_truncated?: boolean;\n /**\n * Aggregation tags echoed by the backend (omitted = full precision).\n * Always normalized server-side ((5, none) arrives as (5, 1)). Use\n * `aggregationFromFrame(book.n_sig_figs, book.mantissa)` to key\n * per-`(orderbook, aggregation)` book state.\n */\n n_sig_figs?: number;\n mantissa?: number;\n}\n\nexport interface WsTickerData {\n orderbook_id: OrderBookId;\n best_bid?: string;\n best_ask?: string;\n mid?: string;\n timestamp?: string;\n}\n"]}
@@ -1,9 +1,57 @@
1
1
  import { PublicKey, Transaction, type TransactionInstruction } from "@solana/web3.js";
2
2
  import type { ClientContext } from "../../context";
3
3
  import type { Position as ProgramPosition, RedeemWinningsParams, WithdrawConditionalFromPositionParams, WithdrawFromPositionParams, InitPositionTokensParams, ExtendPositionTokensParams, DepositToGlobalParams, DepositToGlobalAltContext, GlobalToMarketDepositParams, WithdrawFromGlobalParams, ClosePositionAltParams, ClosePositionTokenAccountsParams } from "../../program/types";
4
+ import type { Market } from "../market";
4
5
  import type { DepositTokenBalancesSnapshot } from "./index";
6
+ import { type SolActionCosts, type SolBalanceAvailability, type WalletDepositBalancesState } from "./state";
5
7
  import type { MarketPositionsResponse, PositionsResponse } from "./wire";
6
8
  import { DepositBuilder, MergeBuilder, WithdrawBuilder, RedeemWinningsBuilder, WithdrawFromPositionBuilder, InitPositionTokensBuilder, ExtendPositionTokensBuilder, DepositToGlobalBuilder, WithdrawFromGlobalBuilder, GlobalToMarketDepositBuilder } from "./builders";
9
+ /**
10
+ * Identifies the SOL-aware operation represented by an action plan.
11
+ *
12
+ * `wrap` and `unwrapAll` identify explicit native-keypair conversion plans.
13
+ * Ordinary plan kinds do not call those planners or include canonical-account
14
+ * closure.
15
+ */
16
+ export type SolActionKind = "split" | "merge" | "redeem" | "nativeWithdraw" | "wrap" | "unwrapAll";
17
+ /** Expected changes to the separately authoritative SOL components. */
18
+ export interface SolComponentDelta {
19
+ /** System-account change in lamports, including unsponsored costs. */
20
+ nativeLamports: bigint;
21
+ /** Persistent canonical WSOL ATA change in lamports. */
22
+ canonicalWsolLamports: bigint;
23
+ }
24
+ /** Unsigned prepared transaction plus the exact preflight facts authorizing it. */
25
+ export interface SolActionPlan {
26
+ /** Operation whose balance semantics produced this plan. */
27
+ kind: SolActionKind;
28
+ /** Fee-prepared message that submission must preserve exactly. */
29
+ transaction: Transaction;
30
+ /** Live fee/rent observations and explicit sponsorship capability. */
31
+ costs: SolActionCosts;
32
+ /** Component totals after action-specific native reserve. */
33
+ availability: SolBalanceAvailability;
34
+ /** Component-wise projection that does not replace authoritative state. */
35
+ expectedDelta: SolComponentDelta;
36
+ }
37
+ /**
38
+ * Derive the cross-SDK temporary-account seed for native withdrawal.
39
+ *
40
+ * SHA-256 receives the ASCII domain `lightcone:wsol-withdraw:v1`, one zero byte,
41
+ * raw 32-byte blockhash, wallet, and recipient keys, the amount as unsigned
42
+ * eight-byte big-endian lamports, then the one-byte attempt. The first 16 digest
43
+ * bytes become 32 lowercase hexadecimal ASCII characters for Solana's seed limit.
44
+ */
45
+ export declare function nativeWithdrawSeed(recentBlockhash: string, wallet: PublicKey, recipient: PublicKey, amountLamports: bigint, attempt: number): string;
46
+ /**
47
+ * Plans position operations and explicit canonical WSOL conversions.
48
+ *
49
+ * Explicit conversion state flows as follows: complete matching wallet state and
50
+ * native keypair -> live account and cost reads -> signer, account, reserve, and
51
+ * amount guards -> fee-prepared plan -> unchanged prepared submission -> complete
52
+ * snapshot covering the confirmed slot. An uncertain submission returns control
53
+ * to the caller, which refreshes authoritative state before planning again.
54
+ */
7
55
  export declare class Positions {
8
56
  private readonly client;
9
57
  constructor(client: ClientContext);
@@ -43,9 +91,12 @@ export declare class Positions {
43
91
  */
44
92
  positionsForMarketWithCookies(marketPubkey: string, cookieHeader: string): Promise<MarketPositionsResponse>;
45
93
  /**
46
- * Get a confirmed-slot snapshot of the authenticated user's deposit-token
47
- * balances. When supplied, `minContextSlot` prevents an older cached
48
- * snapshot from satisfying the request.
94
+ * Fetch a complete authenticated SPL and native-SOL balance snapshot.
95
+ *
96
+ * `minContextSlot` lower-bounds the cross-component snapshot. Native SOL is
97
+ * required canonical nine-decimal text and remains outside the SPL map. The
98
+ * generic HTTP layer trusts that shape at runtime; WebSocket frames are decoded
99
+ * strictly, while malformed REST exact values fail later when state scales them.
49
100
  */
50
101
  depositTokenBalances(minContextSlot?: number): Promise<DepositTokenBalancesSnapshot>;
51
102
  /**
@@ -54,11 +105,116 @@ export declare class Positions {
54
105
  *
55
106
  * Intended for server-side cookie forwarding (SSR / server functions)
56
107
  * where the per-request browser cookie can't propagate to the shared
57
- * client. In a browser context this is equivalent to
108
+ * client. The complete response has the same separate, exact native-SOL
109
+ * contract as {@link depositTokenBalances}. In a browser this is equivalent to
58
110
  * {@link depositTokenBalances} because the runtime is already attaching
59
111
  * the cookie via `credentials: "include"`.
60
112
  */
61
113
  depositTokenBalancesWithCookies(minContextSlot: number | undefined, cookieHeader: string): Promise<DepositTokenBalancesSnapshot>;
114
+ /**
115
+ * Return a fee-prepared plan for an exact canonical WSOL wrap.
116
+ *
117
+ * The authenticated Trading Wallet must have a local native keypair and complete
118
+ * balance state. Live canonical account data must match that state. An existing
119
+ * account must have account lamports equal to its token amount plus native
120
+ * reserve. Otherwise a later `SyncNative` instruction would recalculate the WSOL
121
+ * token amount from account lamports and wrap donated excess beyond
122
+ * `amountLamports`. The returned transaction contains strict Tokenkeg ATA
123
+ * creation only when the account is absent. It then contains the exact transfer
124
+ * and `SyncNative`. Availability uses the ordinary reserve floor.
125
+ *
126
+ * Callers rebuild immediately before prepared submission. They retain the
127
+ * returned component projection until a complete snapshot covers the confirmed
128
+ * slot. An uncertain outcome requires authoritative refresh before another plan.
129
+ */
130
+ planWrapSol(amountLamports: bigint, state: WalletDepositBalancesState): Promise<SolActionPlan>;
131
+ /**
132
+ * Return a fee-prepared plan for closing the complete canonical WSOL account.
133
+ *
134
+ * The Trading Wallet must have a local native keypair. Canonical WSOL in the
135
+ * complete balance state must be positive and equal the live token amount. The
136
+ * returned transaction contains one `CloseAccount` instruction whose authority,
137
+ * destination, and fee payer are that wallet. If submitted successfully, the
138
+ * instruction transfers the complete account balance, including rent and donated
139
+ * lamports. The returned costs contain only the fresh fee. Availability requires
140
+ * native SOL to fund that fee without relying on the later account transfer.
141
+ *
142
+ * Callers rebuild immediately before prepared submission. They retain the
143
+ * returned component projection until a complete snapshot covers the confirmed
144
+ * slot. Signing, submission, or confirmation uncertainty requires authoritative
145
+ * refresh and does not authorize automatic resubmission.
146
+ */
147
+ planUnwrapWsolAll(state: WalletDepositBalancesState): Promise<SolActionPlan>;
148
+ /**
149
+ * Plan one atomic split that consumes canonical WSOL before wrapping a shortfall.
150
+ * Amounts and live costs are lamports; unavailable account, fee, or rent reads
151
+ * fail closed, and sponsored planning is rejected until a sponsor owns costs.
152
+ */
153
+ planSolSplit(market: Market, amountLamports: bigint, state: WalletDepositBalancesState, sponsored: boolean): Promise<SolActionPlan>;
154
+ /**
155
+ * Plan a merge that leaves returned WSOL in the persistent canonical ATA.
156
+ * The prepared transaction does not mutate cached state; refresh authority
157
+ * after confirmed submission.
158
+ */
159
+ planSolMerge(market: Market, amountLamports: bigint, state: WalletDepositBalancesState, sponsored: boolean): Promise<SolActionPlan>;
160
+ /**
161
+ * Plan a redemption that leaves returned WSOL in the persistent canonical ATA.
162
+ * `amountLamports` is exact collateral scale; `outcomeIndex` is validated
163
+ * against the supplied authoritative `numOutcomes`.
164
+ */
165
+ planSolRedeem(market: PublicKey, amountLamports: bigint, outcomeIndex: number, numOutcomes: number, state: WalletDepositBalancesState, sponsored: boolean): Promise<SolActionPlan>;
166
+ /**
167
+ * Plan exact native SOL delivery without closing the canonical WSOL ATA.
168
+ *
169
+ * Native funds are preferred. A shortfall uses a bounded seeded Tokenkeg
170
+ * account whose rent returns on close; all account, rent, and fee reads fail
171
+ * closed. At most eight blockhash-scoped candidates bound RPC latency while
172
+ * making accidental exhaustion negligible. The returned transaction already
173
+ * carries its prepared message.
174
+ */
175
+ planNativeSolWithdrawal(recipient: PublicKey, amountLamports: bigint, state: WalletDepositBalancesState, sponsored: boolean): Promise<SolActionPlan>;
176
+ /** Resolve the authenticated wallet only from fresh matching cached authority. */
177
+ private planningWallet;
178
+ /**
179
+ * Return the authenticated Trading Wallet after native-keypair validation.
180
+ *
181
+ * Complete wallet state and identity are validated by `planningWallet`. This
182
+ * additional guard rejects wallet-adapter and Privy strategies before conversion
183
+ * RPC reads. Ordinary planners do not call this method.
184
+ */
185
+ private conversionPlanningWallet;
186
+ /**
187
+ * Return an unsigned wrap transaction with exact instruction ordering.
188
+ *
189
+ * When planning observed no canonical ATA, the first instruction is strict ATA
190
+ * creation. A concurrently created ATA therefore makes execution fail instead of
191
+ * using account state that was absent from the plan. The transfer and `SyncNative`
192
+ * instructions follow. Fee preparation later attaches the live blockhash.
193
+ */
194
+ private buildWrapSolTransaction;
195
+ /**
196
+ * Return an unsigned transaction containing one canonical `CloseAccount`.
197
+ *
198
+ * The Trading Wallet is the fee payer, close authority, and destination. A later
199
+ * successful submission transfers the complete account balance to that wallet.
200
+ */
201
+ private buildUnwrapWsolAllTransaction;
202
+ /**
203
+ * Build idempotent creation of the persistent Tokenkeg WSOL ATA.
204
+ * Tokenkeg is Solana's legacy SPL Token Program; canonical native-mint ATA
205
+ * derivation is pinned to it rather than Token-2022 across the protocol.
206
+ */
207
+ private createCanonicalWsolAccount;
208
+ /** Read canonical-account existence and upfront rent for merge/redeem plans. */
209
+ private receivePlanContext;
210
+ /** Finish merge/redeem planning with live fee authority and component deltas. */
211
+ private finishReceivePlan;
212
+ /**
213
+ * Build the sole WSOL-to-native path without closing canonical authority.
214
+ * The temporary Tokenkeg account is initialized, funded, and closed back to
215
+ * the wallet before the exact recipient transfer in the same transaction.
216
+ */
217
+ private buildTemporaryNativeWithdrawal;
62
218
  redeemWinningsIx(params: RedeemWinningsParams, outcomeIndex: number): TransactionInstruction;
63
219
  withdrawConditionalFromPositionIx(params: WithdrawConditionalFromPositionParams): TransactionInstruction;
64
220
  withdrawFromPositionIx(params: WithdrawFromPositionParams): TransactionInstruction;
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/domain/position/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACtF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAiBnD,OAAO,KAAK,EACV,QAAQ,IAAI,eAAe,EAC3B,oBAAoB,EACpB,qCAAqC,EAC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