@the-situation/sdk 0.2.0-alpha.9 → 0.3.0-alpha.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 (74) hide show
  1. package/README.md +46 -0
  2. package/dist/abi/amm.d.ts +15 -27
  3. package/dist/abi/amm.d.ts.map +1 -1
  4. package/dist/abi/amm.js +18 -28
  5. package/dist/abi/amm.js.map +1 -1
  6. package/dist/abi/factory.d.ts +20 -42
  7. package/dist/abi/factory.d.ts.map +1 -1
  8. package/dist/abi/factory.js +17 -11
  9. package/dist/abi/factory.js.map +1 -1
  10. package/dist/abi/index.d.ts +1 -1
  11. package/dist/abi/index.d.ts.map +1 -1
  12. package/dist/abi/index.js.map +1 -1
  13. package/dist/artifacts/contracts-release-manifest.json +32 -0
  14. package/dist/artifacts/index.d.ts +19 -1
  15. package/dist/artifacts/index.d.ts.map +1 -1
  16. package/dist/artifacts/index.js +6 -1
  17. package/dist/artifacts/index.js.map +1 -1
  18. package/dist/artifacts/the_situation_normal_amm.abi.json +1698 -1566
  19. package/dist/artifacts/the_situation_normal_factory.abi.json +593 -593
  20. package/dist/artifacts/the_situation_normal_math_library.abi.json +1060 -1010
  21. package/dist/artifacts/the_situation_oracle.abi.json +784 -784
  22. package/dist/collateral/compute.d.ts +13 -1
  23. package/dist/collateral/compute.d.ts.map +1 -1
  24. package/dist/collateral/compute.js +23 -3
  25. package/dist/collateral/compute.js.map +1 -1
  26. package/dist/collateral/index.d.ts +1 -1
  27. package/dist/collateral/index.d.ts.map +1 -1
  28. package/dist/collateral/index.js +1 -1
  29. package/dist/collateral/index.js.map +1 -1
  30. package/dist/contracts/amm.d.ts +61 -23
  31. package/dist/contracts/amm.d.ts.map +1 -1
  32. package/dist/contracts/amm.js +93 -44
  33. package/dist/contracts/amm.js.map +1 -1
  34. package/dist/contracts/factory.d.ts +48 -93
  35. package/dist/contracts/factory.d.ts.map +1 -1
  36. package/dist/contracts/factory.js +124 -87
  37. package/dist/contracts/factory.js.map +1 -1
  38. package/dist/contracts/index.d.ts +1 -1
  39. package/dist/contracts/index.d.ts.map +1 -1
  40. package/dist/contracts/index.js.map +1 -1
  41. package/dist/deployer-node.d.ts +11 -0
  42. package/dist/deployer-node.d.ts.map +1 -0
  43. package/dist/deployer-node.js +10 -0
  44. package/dist/deployer-node.js.map +1 -0
  45. package/dist/sdk/admin.d.ts +68 -0
  46. package/dist/sdk/admin.d.ts.map +1 -0
  47. package/dist/sdk/admin.js +121 -0
  48. package/dist/sdk/admin.js.map +1 -0
  49. package/dist/sdk/client.d.ts +5 -0
  50. package/dist/sdk/client.d.ts.map +1 -1
  51. package/dist/sdk/client.js +7 -0
  52. package/dist/sdk/client.js.map +1 -1
  53. package/dist/sdk/deployer-node.d.ts +15 -0
  54. package/dist/sdk/deployer-node.d.ts.map +1 -0
  55. package/dist/sdk/deployer-node.js +41 -0
  56. package/dist/sdk/deployer-node.js.map +1 -0
  57. package/dist/sdk/deployer.d.ts +58 -0
  58. package/dist/sdk/deployer.d.ts.map +1 -0
  59. package/dist/sdk/deployer.js +145 -0
  60. package/dist/sdk/deployer.js.map +1 -0
  61. package/dist/sdk/index.d.ts +2 -0
  62. package/dist/sdk/index.d.ts.map +1 -1
  63. package/dist/sdk/index.js +2 -0
  64. package/dist/sdk/index.js.map +1 -1
  65. package/dist/sdk/internal/position-utils.d.ts +3 -1
  66. package/dist/sdk/internal/position-utils.d.ts.map +1 -1
  67. package/dist/sdk/internal/position-utils.js +3 -2
  68. package/dist/sdk/internal/position-utils.js.map +1 -1
  69. package/dist/sdk/simple-market.d.ts.map +1 -1
  70. package/dist/sdk/simple-market.js +65 -6
  71. package/dist/sdk/simple-market.js.map +1 -1
  72. package/dist/sdk/simple-types.d.ts +12 -1
  73. package/dist/sdk/simple-types.d.ts.map +1 -1
  74. package/package.json +9 -3
package/README.md ADDED
@@ -0,0 +1,46 @@
1
+ # @the-situation/sdk
2
+
3
+ TypeScript SDK for The Situation contracts.
4
+
5
+ ## Artifact Sync
6
+
7
+ The SDK bundles contract ABIs from a contracts release manifest.
8
+
9
+ ```bash
10
+ # Pull from latest contracts GitHub release
11
+ bun run pull-artifacts
12
+
13
+ # Pull from a specific contracts tag
14
+ bun run pull-artifacts --tag the-situation-contracts-v0.5.1
15
+
16
+ # Pull from a local packaged release directory
17
+ bun run pull-artifacts --release-dir /path/to/the-situation-contracts-v0.5.1
18
+ ```
19
+
20
+ Builds verify artifacts and copy them to `dist/artifacts` automatically:
21
+
22
+ ```bash
23
+ bun run build
24
+ ```
25
+
26
+ ## API Layers
27
+
28
+ - Participant APIs: `SituationClient.simpleMarket(...)`, `SituationClient.simplePosition(...)`
29
+ - Admin/deployer APIs: `SituationClient.admin()`
30
+ - Deployment helpers: `declareCoreContracts`, `deployFactory`, `deployOracle`, `deployNormalMarket`
31
+
32
+ ```ts
33
+ import { SituationClient } from '@the-situation/sdk';
34
+
35
+ const client = new SituationClient({
36
+ provider,
37
+ factoryAddress: '0x...',
38
+ });
39
+
40
+ const admin = client.admin();
41
+ const factory = await admin.factorySnapshot();
42
+ ```
43
+
44
+ ## Publish
45
+
46
+ `npm publish --access public --tag alpha`
package/dist/abi/amm.d.ts CHANGED
@@ -1,27 +1,20 @@
1
1
  /**
2
2
  * AMM contract ABI types and function names.
3
3
  *
4
- * These match the INormalAmm interface from Cairo contracts.
4
+ * These match the latest `normal_amm` interface.
5
5
  *
6
6
  * @module
7
7
  */
8
8
  import type { NormalDistributionRaw } from '../types/normal-distribution';
9
9
  import type { SQ128x128Raw } from '../types/sq128-raw';
10
- import type { AmmConfigRaw, AmmParamsRaw, ClaimResultRaw, FeeConfigRaw, LPInfoRaw, MarketStatusRaw, NormalSqrtHintsRaw, PositionCloseResultRaw, PositionDeltaRaw, PositionExtendedRaw, PositionRaw, TradeCheckRaw, TradeExecutionRaw } from './common';
10
+ import type { AmmConfigRaw, AmmParamsRaw, ClaimResultRaw, FeeConfigRaw, LPInfoRaw, MarketStatusRaw, NormalSqrtHintsRaw, PositionCloseResultRaw, PositionCompactRaw, PositionExtendedRaw, TradeExecutionRaw } from './common';
11
11
  /**
12
12
  * All AMM contract function names.
13
- *
14
- * Note: In v0.3.0, the following functions moved to MathLibrary:
15
- * - check_trade -> check_trade_view
16
- * - preview_add_liquidity -> preview_add_liquidity_view
17
- * - preview_remove_liquidity -> preview_remove_liquidity_view
18
- * - preview_claim -> preview_claim_view
19
- * - preview_close_position -> preview_close_position_view
20
13
  */
21
- export declare const AMM_FUNCTION_NAMES: readonly ["get_params", "get_distribution", "get_market_status", "get_owner", "get_admin", "get_position", "get_config", "get_position_extended", "get_position_delta", "get_all_position_deltas", "get_distribution_hints", "get_lp_info", "get_lp_shares", "get_fee_config", "get_accumulated_protocol_fees", "get_token_balance", "get_call_points", "get_extension", "get_market_key", "get_metadata_hash", "apply_trade", "execute_trade", "close_position", "claim", "add_liquidity", "remove_liquidity", "initialize", "pause", "unpause", "settle", "update_parameters", "transfer_ownership", "update_admin", "withdraw_protocol_fees", "emergency_withdraw", "clear_tokens", "set_call_points"];
14
+ export declare const AMM_FUNCTION_NAMES: readonly ["get_params", "get_config", "get_distribution", "get_market_status", "get_owner", "get_admin", "get_position_extended", "get_position_compact", "get_lp_info", "get_distribution_hints", "get_lp_shares", "get_position_settlement_status", "get_extension", "get_extension_call_points", "get_market_key", "get_metadata_hash", "get_math_class_hash", "get_fee_config", "get_accumulated_protocol_fees", "get_token_balance", "execute_trade", "check_close_position", "close_position", "close_position_guarded", "claim", "add_liquidity", "remove_liquidity", "initialize", "pause", "unpause", "settle", "update_parameters", "transfer_ownership", "update_admin", "update_math_class_hash", "withdraw_protocol_fees", "emergency_withdraw", "clear_tokens"];
22
15
  export type AmmFunctionName = (typeof AMM_FUNCTION_NAMES)[number];
23
16
  /**
24
- * Input for check_trade and execute_trade.
17
+ * Input for execute_trade.
25
18
  */
26
19
  export interface TradeInput {
27
20
  readonly candidate: NormalDistributionRaw;
@@ -38,48 +31,45 @@ export interface UpdateParametersInput {
38
31
  }
39
32
  /**
40
33
  * Return type mapping for AMM view functions.
41
- * Keys match Cairo contract function names (snake_case).
42
- *
43
- * Note: In v0.3.0, preview functions moved to MathLibrary.
44
34
  */
45
35
  export interface AmmViewReturns {
46
36
  get_params: AmmParamsRaw;
37
+ get_config: AmmConfigRaw;
47
38
  get_distribution: NormalDistributionRaw;
48
39
  get_market_status: MarketStatusRaw;
49
40
  get_owner: string;
50
41
  get_admin: string;
51
- get_position: PositionRaw;
52
- get_config: AmmConfigRaw;
53
42
  get_position_extended: PositionExtendedRaw;
54
- get_all_position_deltas: PositionDeltaRaw[];
55
- get_distribution_hints: NormalSqrtHintsRaw;
43
+ get_position_compact: PositionCompactRaw;
56
44
  get_lp_info: LPInfoRaw;
45
+ get_distribution_hints: NormalSqrtHintsRaw;
57
46
  get_lp_shares: SQ128x128Raw;
47
+ get_position_settlement_status: unknown;
48
+ get_extension: string;
49
+ get_extension_call_points: unknown;
50
+ get_market_key: bigint;
51
+ get_metadata_hash: string;
52
+ get_math_class_hash: string;
58
53
  get_fee_config: FeeConfigRaw;
59
54
  get_accumulated_protocol_fees: bigint;
60
55
  get_token_balance: bigint;
61
- get_extension: string;
62
- get_metadata_hash: string;
63
56
  }
64
57
  /**
65
58
  * Return type mapping for AMM close position functions.
66
59
  */
67
60
  export interface AmmCloseReturns {
61
+ check_close_position: PositionCloseResultRaw;
68
62
  close_position: PositionCloseResultRaw;
63
+ close_position_guarded: PositionCloseResultRaw;
69
64
  }
70
65
  /**
71
66
  * Return type mapping for AMM trade functions.
72
- *
73
- * Note: check_trade moved to MathLibrary as check_trade_view in v0.3.0.
74
67
  */
75
68
  export interface AmmTradeReturns {
76
- apply_trade: TradeCheckRaw;
77
69
  execute_trade: TradeExecutionRaw;
78
70
  }
79
71
  /**
80
72
  * Return type mapping for AMM LP functions.
81
- *
82
- * Note: preview functions moved to MathLibrary in v0.3.0.
83
73
  */
84
74
  export interface AmmLPReturns {
85
75
  add_liquidity: bigint;
@@ -87,8 +77,6 @@ export interface AmmLPReturns {
87
77
  }
88
78
  /**
89
79
  * Return type mapping for AMM settlement functions.
90
- *
91
- * Note: preview_claim moved to MathLibrary as preview_claim_view in v0.3.0.
92
80
  */
93
81
  export interface AmmSettlementReturns {
94
82
  claim: ClaimResultRaw;
@@ -1 +1 @@
1
- {"version":3,"file":"amm.d.ts","sourceRoot":"","sources":["../../src/abi/amm.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,mBAAmB,EACnB,WAAW,EACX,aAAa,EACb,iBAAiB,EAClB,MAAM,UAAU,CAAC;AAMlB;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,2qBAyDrB,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAMlE;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,SAAS,EAAE,qBAAqB,CAAC;IAC1C,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,QAAQ,CAAC,kBAAkB,EAAE,YAAY,CAAC;IAC1C,QAAQ,CAAC,cAAc,EAAE,kBAAkB,CAAC;CAC7C;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,SAAS,EAAE,YAAY,CAAC;IACjC,QAAQ,CAAC,kBAAkB,EAAE,YAAY,CAAC;CAC3C;AAMD;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,YAAY,CAAC;IACzB,gBAAgB,EAAE,qBAAqB,CAAC;IACxC,iBAAiB,EAAE,eA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BAAoB,EAAE,sBAAsB,CAAC;IAC7C,cAAc,EAAE,sBAAsB,CAAC;IACvC,sBAAsB,EAAE,sBAAsB,CAAC;CAChD;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,aAAa,EAAE,iBAAiB,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,cAAc,CAAC;CACvB"}
package/dist/abi/amm.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * AMM contract ABI types and function names.
3
3
  *
4
- * These match the INormalAmm interface from Cairo contracts.
4
+ * These match the latest `normal_amm` interface.
5
5
  *
6
6
  * @module
7
7
  */
@@ -10,61 +10,51 @@
10
10
  // ============================================================================
11
11
  /**
12
12
  * All AMM contract function names.
13
- *
14
- * Note: In v0.3.0, the following functions moved to MathLibrary:
15
- * - check_trade -> check_trade_view
16
- * - preview_add_liquidity -> preview_add_liquidity_view
17
- * - preview_remove_liquidity -> preview_remove_liquidity_view
18
- * - preview_claim -> preview_claim_view
19
- * - preview_close_position -> preview_close_position_view
20
13
  */
21
14
  export const AMM_FUNCTION_NAMES = [
22
15
  // View functions
23
16
  'get_params',
17
+ 'get_config',
24
18
  'get_distribution',
25
19
  'get_market_status',
26
20
  'get_owner',
27
21
  'get_admin',
28
- 'get_position',
29
- 'get_config',
30
22
  'get_position_extended',
31
- 'get_position_delta',
32
- 'get_all_position_deltas',
33
- 'get_distribution_hints',
23
+ 'get_position_compact',
34
24
  'get_lp_info',
25
+ 'get_distribution_hints',
35
26
  'get_lp_shares',
36
- 'get_fee_config',
37
- 'get_accumulated_protocol_fees',
38
- 'get_token_balance',
39
- 'get_call_points',
27
+ 'get_position_settlement_status',
40
28
  'get_extension',
29
+ 'get_extension_call_points',
41
30
  'get_market_key',
42
31
  'get_metadata_hash',
43
- // Trade functions
44
- 'apply_trade',
32
+ 'get_math_class_hash',
33
+ 'get_fee_config',
34
+ 'get_accumulated_protocol_fees',
35
+ 'get_token_balance',
36
+ // Trade / close
45
37
  'execute_trade',
46
- // Position close functions (v0.1.4)
38
+ 'check_close_position',
47
39
  'close_position',
48
- // Settlement functions
40
+ 'close_position_guarded',
41
+ // Position settlement
49
42
  'claim',
50
- // LP functions
43
+ // LP
51
44
  'add_liquidity',
52
45
  'remove_liquidity',
53
- // Initialization
46
+ // Lifecycle + admin
54
47
  'initialize',
55
- // Admin functions
56
48
  'pause',
57
49
  'unpause',
58
50
  'settle',
59
51
  'update_parameters',
60
52
  'transfer_ownership',
61
53
  'update_admin',
62
- // Fee functions
54
+ 'update_math_class_hash',
55
+ // Fee / emergency
63
56
  'withdraw_protocol_fees',
64
- // Emergency functions
65
57
  'emergency_withdraw',
66
58
  'clear_tokens',
67
- // Extension functions
68
- 'set_call_points',
69
59
  ];
70
60
  //# sourceMappingURL=amm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"amm.js","sourceRoot":"","sources":["../../src/abi/amm.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAoBH,+EAA+E;AAC/E,iBAAiB;AACjB,+EAA+E;AAE/E;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,iBAAiB;IACjB,YAAY;IACZ,kBAAkB;IAClB,mBAAmB;IACnB,WAAW;IACX,WAAW;IACX,cAAc;IACd,YAAY;IACZ,uBAAuB;IACvB,oBAAoB;IACpB,yBAAyB;IACzB,wBAAwB;IACxB,aAAa;IACb,eAAe;IACf,gBAAgB;IAChB,+BAA+B;IAC/B,mBAAmB;IACnB,iBAAiB;IACjB,eAAe;IACf,gBAAgB;IAChB,mBAAmB;IAEnB,kBAAkB;IAClB,aAAa;IACb,eAAe;IAEf,oCAAoC;IACpC,gBAAgB;IAEhB,uBAAuB;IACvB,OAAO;IAEP,eAAe;IACf,eAAe;IACf,kBAAkB;IAElB,iBAAiB;IACjB,YAAY;IAEZ,kBAAkB;IAClB,OAAO;IACP,SAAS;IACT,QAAQ;IACR,mBAAmB;IACnB,oBAAoB;IACpB,cAAc;IAEd,gBAAgB;IAChB,wBAAwB;IAExB,sBAAsB;IACtB,oBAAoB;IACpB,cAAc;IAEd,sBAAsB;IACtB,iBAAiB;CACT,CAAC"}
1
+ {"version":3,"file":"amm.js","sourceRoot":"","sources":["../../src/abi/amm.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAkBH,+EAA+E;AAC/E,iBAAiB;AACjB,+EAA+E;AAE/E;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,iBAAiB;IACjB,YAAY;IACZ,YAAY;IACZ,kBAAkB;IAClB,mBAAmB;IACnB,WAAW;IACX,WAAW;IACX,uBAAuB;IACvB,sBAAsB;IACtB,aAAa;IACb,wBAAwB;IACxB,eAAe;IACf,gCAAgC;IAChC,eAAe;IACf,2BAA2B;IAC3B,gBAAgB;IAChB,mBAAmB;IACnB,qBAAqB;IACrB,gBAAgB;IAChB,+BAA+B;IAC/B,mBAAmB;IAEnB,gBAAgB;IAChB,eAAe;IACf,sBAAsB;IACtB,gBAAgB;IAChB,wBAAwB;IAExB,sBAAsB;IACtB,OAAO;IAEP,KAAK;IACL,eAAe;IACf,kBAAkB;IAElB,oBAAoB;IACpB,YAAY;IACZ,OAAO;IACP,SAAS;IACT,QAAQ;IACR,mBAAmB;IACnB,oBAAoB;IACpB,cAAc;IACd,wBAAwB;IAExB,kBAAkB;IAClB,wBAAwB;IACxB,oBAAoB;IACpB,cAAc;CACN,CAAC"}
@@ -1,69 +1,47 @@
1
1
  /**
2
2
  * Factory contract ABI types and function names.
3
3
  *
4
- * These match the IFactory interface from Cairo contracts.
4
+ * These match the latest `normal_factory` Cairo interface.
5
5
  *
6
6
  * @module
7
7
  */
8
+ import type { FeeConfigRaw, NormalSqrtHintsRaw } from './common';
9
+ import type { NormalDistributionRaw } from '../types/normal-distribution';
8
10
  import type { SQ128x128Raw } from '../types/sq128-raw';
9
- import type { FeeConfigRaw } from './common';
10
11
  /**
11
- * All Factory contract function names.
12
+ * All factory contract function names.
12
13
  */
13
- export declare const FACTORY_FUNCTION_NAMES: readonly ["deploy_market", "get_market_count", "get_market_at", "get_markets", "get_amm_class_hash", "get_owner", "get_default_fee_config", "update_amm_class_hash", "update_default_fee_config", "transfer_ownership"];
14
+ export declare const FACTORY_FUNCTION_NAMES: readonly ["get_amm_class_hash", "get_math_class_hash", "get_owner", "is_paused", "is_extension_approved", "deploy_normal_market", "approve_extension", "revoke_extension", "update_class_hash", "update_math_class_hash", "transfer_ownership", "pause", "unpause", "withdraw_protocol_fees"];
14
15
  export type FactoryFunctionName = (typeof FACTORY_FUNCTION_NAMES)[number];
15
16
  /**
16
- * Parameters for deploying a new market.
17
+ * Parameters for deploying a normal market via the factory.
17
18
  */
18
- export interface MarketDeploymentParamsRaw {
19
- /** Collateral token contract address */
19
+ export interface NormalMarketDeploymentParamsRaw {
20
+ readonly salt: string | bigint;
21
+ readonly marketOwner: string;
22
+ readonly marketAdmin: string;
20
23
  readonly collateralToken: string;
21
- /** Token decimals (native token precision) */
22
24
  readonly tokenDecimals: number;
23
- /** Internal decimals for SQ128x128 math (≤7) */
24
25
  readonly internalDecimals: number;
25
- /** L2 norm constraint: ||f||_2 = k */
26
+ readonly initialDistribution: NormalDistributionRaw;
26
27
  readonly k: SQ128x128Raw;
27
- /** Initial backing requirement */
28
28
  readonly backing: SQ128x128Raw;
29
- /** Numerical tolerance for verification */
30
29
  readonly tolerance: SQ128x128Raw;
31
- /** Minimum collateral per trade */
32
30
  readonly minTradeCollateral: SQ128x128Raw;
33
- /** Initial distribution mean */
34
- readonly initialMean: SQ128x128Raw;
35
- /** Initial distribution variance */
36
- readonly initialVariance: SQ128x128Raw;
31
+ readonly initialHints: NormalSqrtHintsRaw;
32
+ readonly feeConfig: FeeConfigRaw;
33
+ readonly extension: string;
34
+ readonly extensionCallPoints: number;
35
+ readonly metadataHash: string;
37
36
  }
38
37
  /**
39
- * Result of deploying a new market.
40
- */
41
- export interface MarketDeploymentResultRaw {
42
- /** Address of the deployed market contract */
43
- readonly marketAddress: string;
44
- /** Index of the market in the factory's market list */
45
- readonly marketIndex: number;
46
- }
47
- /**
48
- * Factory configuration.
49
- */
50
- export interface FactoryConfigRaw {
51
- /** Class hash of the AMM contract to deploy */
52
- readonly ammClassHash: string;
53
- /** Owner address */
54
- readonly owner: string;
55
- /** Default fee configuration for new markets */
56
- readonly defaultFeeConfig: FeeConfigRaw;
57
- }
58
- /**
59
- * Return type mapping for Factory view functions.
38
+ * Return type mapping for factory view functions.
60
39
  */
61
40
  export interface FactoryViewReturns {
62
- get_market_count: number;
63
- get_market_at: string;
64
- get_markets: readonly string[];
65
41
  get_amm_class_hash: string;
42
+ get_math_class_hash: string;
66
43
  get_owner: string;
67
- get_default_fee_config: FeeConfigRaw;
44
+ is_paused: boolean;
45
+ is_extension_approved: boolean;
68
46
  }
69
47
  //# sourceMappingURL=factory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../src/abi/factory.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAM7C;;GAEG;AACH,eAAO,MAAM,sBAAsB,yNAgBzB,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AAM1E;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,wCAAwC;IACxC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,8CAA8C;IAC9C,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,gDAAgD;IAChD,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,sCA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o contracts.
4
+ * These match the latest `normal_factory` Cairo interface.
5
5
  *
6
6
  * @module
7
7
  */
@@ -9,21 +9,27 @@
9
9
  // Function Names
10
10
  // ============================================================================
11
11
  /**
12
- * All Factory contract function names.
12
+ * All factory contract function names.
13
13
  */
14
14
  export const FACTORY_FUNCTION_NAMES = [
15
- // Deploy functions
16
- 'deploy_market',
17
15
  // View functions
18
- 'get_market_count',
19
- 'get_market_at',
20
- 'get_markets',
21
16
  'get_amm_class_hash',
17
+ 'get_math_class_hash',
22
18
  'get_owner',
23
- 'get_default_fee_config',
24
- // Admin functions
25
- 'update_amm_class_hash',
26
- 'update_default_fee_config',
19
+ 'is_paused',
20
+ 'is_extension_approved',
21
+ // Deployment
22
+ 'deploy_normal_market',
23
+ // Extension admin
24
+ 'approve_extension',
25
+ 'revoke_extension',
26
+ // Contract admin
27
+ 'update_class_hash',
28
+ 'update_math_class_hash',
27
29
  'transfer_ownership',
30
+ 'pause',
31
+ 'unpause',
32
+ // Fee operations
33
+ 'withdraw_protocol_fees',
28
34
  ];
29
35
  //# sourceMappingURL=factory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"factory.js","sourceRoot":"","sources":["../../src/abi/factory.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,+EAA+E;AAC/E,iBAAiB;AACjB,+EAA+E;AAE/E;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,mBAAmB;IACnB,eAAe;IAEf,iBAAiB;IACjB,kBAAkB;IAClB,eAAe;IACf,aAAa;IACb,oBAAoB;IACpB,WAAW;IACX,wBAAwB;IAExB,kBAAkB;IAClB,uBAAuB;IACvB,2BAA2B;IAC3B,oBAAoB;CACZ,CAAC"}
1
+ {"version":3,"file":"factory.js","sourceRoot":"","sources":["../../src/abi/factory.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,+EAA+E;AAC/E,iBAAiB;AACjB,+EAA+E;AAE/E;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,iBAAiB;IACjB,oBAAoB;IACpB,qBAAqB;IACrB,WAAW;IACX,WAAW;IACX,uBAAuB;IAEvB,aAAa;IACb,sBAAsB;IAEtB,kBAAkB;IAClB,mBAAmB;IACnB,kBAAkB;IAElB,iBAAiB;IACjB,mBAAmB;IACnB,wBAAwB;IACxB,oBAAoB;IACpB,OAAO;IACP,SAAS;IAET,iBAAiB;IACjB,wBAAwB;CAChB,CAAC"}
@@ -8,7 +8,7 @@
8
8
  */
9
9
  export { AMM_FUNCTION_NAMES, type AmmCloseReturns, type AmmFunctionName, type AmmLPReturns, type AmmSettlementReturns, type AmmTradeReturns, type AmmViewReturns, type TradeInput, type UpdateParametersInput, } from './amm';
10
10
  export { type AmmConfigRaw, type AmmParamsRaw, type ClaimResultRaw, type ClosePreviewRaw, CloseRejectionReason, type CollateralVerificationRaw, createAmmParamsRaw, createFeeConfigRaw, createMarketStatusRaw, type FeeConfigRaw, isValidFeeConfigRaw, type LPInfoRaw, MAX_FEE_BPS, type MarketStatusRaw, type NormalSqrtHintsRaw, type PdfNormCheckRaw, type PositionCloseResultRaw, type PositionDeltaRaw, type PositionExtendedRaw, type PositionRaw, type ScaledBackingCheckRaw, type TradeCheckRaw, type TradeExecutionRaw, } from './common';
11
- export { FACTORY_FUNCTION_NAMES, type FactoryConfigRaw, type FactoryFunctionName, type FactoryViewReturns, type MarketDeploymentParamsRaw, type MarketDeploymentResultRaw, } from './factory';
11
+ export { FACTORY_FUNCTION_NAMES, type FactoryFunctionName, type FactoryViewReturns, type NormalMarketDeploymentParamsRaw, } from './factory';
12
12
  export { MATH_LIBRARY_FUNCTION_NAMES, type CheckTradeViewInput, type MathLibraryFunctionName, type MathLibraryViewReturns, type PreviewAddLiquidityViewInput, type PreviewClaimViewInput, type PreviewClosePositionViewInput, type PreviewRemoveLiquidityViewInput, } from './math-library';
13
13
  export { ORACLE_FUNCTION_NAMES, type Cumulative256Raw, type MarketKeyInput, type OracleFunctionName, type OracleViewReturns, type SnapshotRaw, } from './oracle';
14
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/abi/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EACL,kBAAkB,EAClB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,qBAAqB,GAC3B,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,KAAK,YAAY,EAEjB,KAAK,YAAY,EAEjB,KAAK,cAAc,EAEnB,KAAK,eAAe,EACpB,oBAAoB,EACpB,KAAK,yBAAyB,EAC9B,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EAErB,KAAK,YAAY,EACjB,mBAAmB,EAEnB,KAAK,SAAS,EAEd,WAAW,EAEX,KAAK,eAAe,EAEpB,KAAK,kBAAkB,EAEvB,KAAK,eAAe,EAEpB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EAExB,KAAK,WAAW,EAEhB,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAClB,KAAK,iBAAiB,GACvB,MAAM,UAAU,CAAC;AAGlB,OAAO,EACL,sBAAsB,EACtB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,GAC/B,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,2BAA2B,EAC3B,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,4BAA4B,EACjC,KAAK,qBAAqB,EAC1B,KAAK,6BAA6B,EAClC,KAAK,+BAA+B,GACrC,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,qBAAqB,EACrB,KAAK,gBAAgB,EACrB,KAAK,cA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EACvB,KAAK,iBAAiB,EACtB,KAAK,WAAW,GACjB,MAAM,UAAU,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/abi/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,qBAAqB;AACrB,OAAO,EACL,kBAAkB,GASnB,MAAM,OAAO,CAAC;AACf,uCAAuC;AACvC,OAAO,EASL,oBAAoB,EAEpB,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EAGrB,mBAAmB;AAGnB,YAAY;AACZ,WAAW,GAiBZ,MAAM,UAAU,CAAC;AAElB,yBAAyB;AACzB,OAAO,EACL,sBAAsB,GAMvB,MAAM,WAAW,CAAC;AAEnB,sCAAsC;AACtC,OAAO,EACL,2BAA2B,GAQ5B,MAAM,gBAAgB,CAAC;AAExB,wBAAwB;AACxB,OAAO,EACL,qBAAqB,GAMtB,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/abi/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,qBAAqB;AACrB,OAAO,EACL,kBAAkB,GASnB,MAAM,OAAO,CAAC;AACf,uCAAuC;AACvC,OAAO,EASL,oBAAoB,EAEpB,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EAGrB,mBAAmB;AAGnB,YAAY;AACZ,WAAW,GAiBZ,MAAM,UAAU,CAAC;AAElB,yBAAyB;AACzB,OAAO,EACL,sBAAsB,GAIvB,MAAM,WAAW,CAAC;AAEnB,sCAAsC;AACtC,OAAO,EACL,2BAA2B,GAQ5B,MAAM,gBAAgB,CAAC;AAExB,wBAAwB;AACxB,OAAO,EACL,qBAAqB,GAMtB,MAAM,UAAU,CAAC"}
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "the-situation-contracts",
3
+ "version": "0.6.0",
4
+ "timestamp": "2026-02-06T17:13:37Z",
5
+ "commit": "eb50b6f231c194bab850e31e4cd853fa4cc71c2f",
6
+ "contracts": [
7
+ {
8
+ "name": "normal_amm",
9
+ "sierra": "the_situation_normal_amm.contract_class.json",
10
+ "casm": "the_situation_normal_amm.compiled_contract_class.json",
11
+ "abi": "the_situation_normal_amm.abi.json"
12
+ },
13
+ {
14
+ "name": "normal_factory",
15
+ "sierra": "the_situation_normal_factory.contract_class.json",
16
+ "casm": "the_situation_normal_factory.compiled_contract_class.json",
17
+ "abi": "the_situation_normal_factory.abi.json"
18
+ },
19
+ {
20
+ "name": "normal_math_library",
21
+ "sierra": "the_situation_normal_math_library.contract_class.json",
22
+ "casm": "the_situation_normal_math_library.compiled_contract_class.json",
23
+ "abi": "the_situation_normal_math_library.abi.json"
24
+ },
25
+ {
26
+ "name": "oracle",
27
+ "sierra": "the_situation_oracle.contract_class.json",
28
+ "casm": "the_situation_oracle.compiled_contract_class.json",
29
+ "abi": "the_situation_oracle.abi.json"
30
+ }
31
+ ]
32
+ }
@@ -15,9 +15,23 @@
15
15
  */
16
16
  import type { Abi } from 'starknet';
17
17
  import ammAbi from './the_situation_normal_amm.abi.json';
18
+ import releaseManifest from './contracts-release-manifest.json';
18
19
  import factoryAbi from './the_situation_normal_factory.abi.json';
19
20
  import mathLibraryAbi from './the_situation_normal_math_library.abi.json';
20
21
  import oracleAbi from './the_situation_oracle.abi.json';
22
+ export interface ContractReleaseManifestEntry {
23
+ readonly name: string;
24
+ readonly sierra: string;
25
+ readonly casm: string;
26
+ readonly abi: string;
27
+ }
28
+ export interface ContractReleaseManifest {
29
+ readonly name: string;
30
+ readonly version: string;
31
+ readonly timestamp: string;
32
+ readonly commit: string;
33
+ readonly contracts: readonly ContractReleaseManifestEntry[];
34
+ }
21
35
  /** AMM (Market) contract ABI */
22
36
  export declare const AMM_ABI: Abi;
23
37
  /** Factory contract ABI */
@@ -26,5 +40,9 @@ export declare const FACTORY_ABI: Abi;
26
40
  export declare const MATH_LIBRARY_ABI: Abi;
27
41
  /** Oracle contract ABI */
28
42
  export declare const ORACLE_ABI: Abi;
29
- export { ammAbi, factoryAbi, mathLibraryAbi, oracleAbi };
43
+ /** Contracts release metadata (source release used for bundled ABIs). */
44
+ export declare const CONTRACT_RELEASE_MANIFEST: ContractReleaseManifest;
45
+ /** Version string from the bundled contracts release manifest. */
46
+ export declare const CONTRACT_RELEASE_VERSION: string;
47
+ export { ammAbi, factoryAbi, mathLibraryAbi, oracleAbi, releaseManifest };
30
48
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/artifacts/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAEpC,OAAO,MAAM,MAAM,qCAAqC,CAAC;AACzD,OAAO,UAAU,MAAM,yCAAyC,CAAC;AACjE,OAAO,cAAc,MAAM,8CAA8C,CAAC;AAC1E,OAAO,SAAS,MAAM,iCAAiC,CAAC;AAExD,gCAAgC;AAChC,eAAO,MAAM,OAAO,EAAE,GAAmB,CAAC;AAE1C,2BAA2B;AAC3B,eAAO,MAAM,WAAW,EAAE,GAAuB,CAAC;AAElD,8DAA8D;AAC9D,eAAO,MAAM,gBAAgB,EAAE,GAA2B,CAAC;AAE3D,0BAA0B;AAC1B,eAAO,MAAM,UAAU,EAAE,GAAsB,CAAC;AAGhD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,SAAS,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/artifacts/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAEpC,OAAO,MAAM,MAAM,qCAAqC,CAAC;AACzD,OAAO,eAAe,MAAM,mCAAmC,CAAC;AAChE,OAAO,UAAU,MAAM,yCAAyC,CAAC;AACjE,OAAO,cAAc,MAAM,8CAA8C,CAAC;AAC1E,OAAO,SAAS,MAAM,iCAAiC,CAAC;AAExD,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,SAAS,4BAA4B,EAAE,CAAC;CAC7D;AAED,gCAAgC;AAChC,eAAO,MAAM,OAAO,EAAE,GAAmB,CAAC;AAE1C,2BAA2B;AAC3B,eAAO,MAAM,WAAW,EAAE,GAAuB,CAAC;AAElD,8DAA8D;AAC9D,eAAO,MAAM,gBAAgB,EAAE,GAA2B,CAAC;AAE3D,0BAA0B;AAC1B,eAAO,MAAM,UAAU,EAAE,GAAsB,CAAC;AAEhD,yEAAyE;AACzE,eAAO,MAAM,yBAAyB,EAAE,uBACI,CAAC;AAE7C,kEAAkE;AAClE,eAAO,MAAM,wBAAwB,EAAE,MAA0C,CAAC;AAGlF,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC"}
@@ -14,6 +14,7 @@
14
14
  * @module
15
15
  */
16
16
  import ammAbi from './the_situation_normal_amm.abi.json';
17
+ import releaseManifest from './contracts-release-manifest.json';
17
18
  import factoryAbi from './the_situation_normal_factory.abi.json';
18
19
  import mathLibraryAbi from './the_situation_normal_math_library.abi.json';
19
20
  import oracleAbi from './the_situation_oracle.abi.json';
@@ -25,6 +26,10 @@ export const FACTORY_ABI = factoryAbi;
25
26
  export const MATH_LIBRARY_ABI = mathLibraryAbi;
26
27
  /** Oracle contract ABI */
27
28
  export const ORACLE_ABI = oracleAbi;
29
+ /** Contracts release metadata (source release used for bundled ABIs). */
30
+ export const CONTRACT_RELEASE_MANIFEST = releaseManifest;
31
+ /** Version string from the bundled contracts release manifest. */
32
+ export const CONTRACT_RELEASE_VERSION = CONTRACT_RELEASE_MANIFEST.version;
28
33
  // Re-export for convenience
29
- export { ammAbi, factoryAbi, mathLibraryAbi, oracleAbi };
34
+ export { ammAbi, factoryAbi, mathLibraryAbi, oracleAbi, releaseManifest };
30
35
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/artifacts/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,MAAM,MAAM,qCAAqC,CAAC;AACzD,OAAO,UAAU,MAAM,yCAAyC,CAAC;AACjE,OAAO,cAAc,MAAM,8CAA8C,CAAC;AAC1E,OAAO,SAAS,MAAM,iCAAiC,CAAC;AAExD,gCAAgC;AAChC,MAAM,CAAC,MAAM,OAAO,GAAQ,MAAa,CAAC;AAE1C,2BAA2B;AAC3B,MAAM,CAAC,MAAM,WAAW,GAAQ,UAAiB,CAAC;AAElD,8DAA8D;AAC9D,MAAM,CAAC,MAAM,gBAAgB,GAAQ,cAAqB,CAAC;AAE3D,0BAA0B;AAC1B,MAAM,CAAC,MAAM,UAAU,GAAQ,SAAgB,CAAC;AAEhD,4BAA4B;AAC5B,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,SAAS,EAAE,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/artifacts/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,MAAM,MAAM,qCAAqC,CAAC;AACzD,OAAO,eAAe,MAAM,mCAAmC,CAAC;AAChE,OAAO,UAAU,MAAM,yCAAyC,CAAC;AACjE,OAAO,cAAc,MAAM,8CAA8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