@panoptic-eng/sdk 1.0.11 → 1.0.12

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.
@@ -2374,6 +2374,421 @@ const panopticFactoryV4Abi = [
2374
2374
  name: "ZeroAddress"
2375
2375
  }
2376
2376
  ];
2377
+ const panopticGuardianAbi = [
2378
+ {
2379
+ type: "constructor",
2380
+ inputs: [{
2381
+ name: "guardianAdmin",
2382
+ internalType: "address",
2383
+ type: "address"
2384
+ }, {
2385
+ name: "treasurer",
2386
+ internalType: "address",
2387
+ type: "address"
2388
+ }],
2389
+ stateMutability: "nonpayable"
2390
+ },
2391
+ {
2392
+ type: "function",
2393
+ inputs: [],
2394
+ name: "GUARDIAN_ADMIN",
2395
+ outputs: [{
2396
+ name: "",
2397
+ internalType: "address",
2398
+ type: "address"
2399
+ }],
2400
+ stateMutability: "view"
2401
+ },
2402
+ {
2403
+ type: "function",
2404
+ inputs: [],
2405
+ name: "TREASURER",
2406
+ outputs: [{
2407
+ name: "",
2408
+ internalType: "address",
2409
+ type: "address"
2410
+ }],
2411
+ stateMutability: "view"
2412
+ },
2413
+ {
2414
+ type: "function",
2415
+ inputs: [],
2416
+ name: "UNLOCK_DELAY",
2417
+ outputs: [{
2418
+ name: "",
2419
+ internalType: "uint256",
2420
+ type: "uint256"
2421
+ }],
2422
+ stateMutability: "view"
2423
+ },
2424
+ {
2425
+ type: "function",
2426
+ inputs: [{
2427
+ name: "",
2428
+ internalType: "address",
2429
+ type: "address"
2430
+ }],
2431
+ name: "builderAdminRevoked",
2432
+ outputs: [{
2433
+ name: "",
2434
+ internalType: "bool",
2435
+ type: "bool"
2436
+ }],
2437
+ stateMutability: "view"
2438
+ },
2439
+ {
2440
+ type: "function",
2441
+ inputs: [{
2442
+ name: "pool",
2443
+ internalType: "contract PanopticPoolV2",
2444
+ type: "address"
2445
+ }],
2446
+ name: "cancelUnlock",
2447
+ outputs: [],
2448
+ stateMutability: "nonpayable"
2449
+ },
2450
+ {
2451
+ type: "function",
2452
+ inputs: [
2453
+ {
2454
+ name: "riskEngine",
2455
+ internalType: "contract IRiskEngine",
2456
+ type: "address"
2457
+ },
2458
+ {
2459
+ name: "token",
2460
+ internalType: "address",
2461
+ type: "address"
2462
+ },
2463
+ {
2464
+ name: "recipient",
2465
+ internalType: "address",
2466
+ type: "address"
2467
+ },
2468
+ {
2469
+ name: "amount",
2470
+ internalType: "uint256",
2471
+ type: "uint256"
2472
+ }
2473
+ ],
2474
+ name: "collect",
2475
+ outputs: [],
2476
+ stateMutability: "nonpayable"
2477
+ },
2478
+ {
2479
+ type: "function",
2480
+ inputs: [
2481
+ {
2482
+ name: "builderCode",
2483
+ internalType: "uint256",
2484
+ type: "uint256"
2485
+ },
2486
+ {
2487
+ name: "builderAdmin",
2488
+ internalType: "address",
2489
+ type: "address"
2490
+ },
2491
+ {
2492
+ name: "builderFactory",
2493
+ internalType: "contract BuilderFactory",
2494
+ type: "address"
2495
+ }
2496
+ ],
2497
+ name: "deployBuilder",
2498
+ outputs: [{
2499
+ name: "wallet",
2500
+ internalType: "address",
2501
+ type: "address"
2502
+ }],
2503
+ stateMutability: "nonpayable"
2504
+ },
2505
+ {
2506
+ type: "function",
2507
+ inputs: [{
2508
+ name: "pool",
2509
+ internalType: "contract PanopticPoolV2",
2510
+ type: "address"
2511
+ }],
2512
+ name: "executeUnlock",
2513
+ outputs: [],
2514
+ stateMutability: "nonpayable"
2515
+ },
2516
+ {
2517
+ type: "function",
2518
+ inputs: [
2519
+ {
2520
+ name: "account",
2521
+ internalType: "address",
2522
+ type: "address"
2523
+ },
2524
+ {
2525
+ name: "pool",
2526
+ internalType: "contract PanopticPoolV2",
2527
+ type: "address"
2528
+ },
2529
+ {
2530
+ name: "builderCode",
2531
+ internalType: "uint256",
2532
+ type: "uint256"
2533
+ }
2534
+ ],
2535
+ name: "isBuilderAdmin",
2536
+ outputs: [{
2537
+ name: "",
2538
+ internalType: "bool",
2539
+ type: "bool"
2540
+ }],
2541
+ stateMutability: "view"
2542
+ },
2543
+ {
2544
+ type: "function",
2545
+ inputs: [{
2546
+ name: "pool",
2547
+ internalType: "contract PanopticPoolV2",
2548
+ type: "address"
2549
+ }],
2550
+ name: "isPoolUnlockReady",
2551
+ outputs: [{
2552
+ name: "",
2553
+ internalType: "bool",
2554
+ type: "bool"
2555
+ }],
2556
+ stateMutability: "view"
2557
+ },
2558
+ {
2559
+ type: "function",
2560
+ inputs: [{
2561
+ name: "pool",
2562
+ internalType: "contract PanopticPoolV2",
2563
+ type: "address"
2564
+ }],
2565
+ name: "lockPool",
2566
+ outputs: [],
2567
+ stateMutability: "nonpayable"
2568
+ },
2569
+ {
2570
+ type: "function",
2571
+ inputs: [{
2572
+ name: "pool",
2573
+ internalType: "contract PanopticPoolV2",
2574
+ type: "address"
2575
+ }, {
2576
+ name: "builderCode",
2577
+ internalType: "uint256",
2578
+ type: "uint256"
2579
+ }],
2580
+ name: "lockPoolAsBuilder",
2581
+ outputs: [],
2582
+ stateMutability: "nonpayable"
2583
+ },
2584
+ {
2585
+ type: "function",
2586
+ inputs: [{
2587
+ name: "pool",
2588
+ internalType: "contract PanopticPoolV2",
2589
+ type: "address"
2590
+ }],
2591
+ name: "requestUnlock",
2592
+ outputs: [],
2593
+ stateMutability: "nonpayable"
2594
+ },
2595
+ {
2596
+ type: "function",
2597
+ inputs: [{
2598
+ name: "admin",
2599
+ internalType: "address",
2600
+ type: "address"
2601
+ }, {
2602
+ name: "revoked",
2603
+ internalType: "bool",
2604
+ type: "bool"
2605
+ }],
2606
+ name: "setBuilderAdminRevoked",
2607
+ outputs: [],
2608
+ stateMutability: "nonpayable"
2609
+ },
2610
+ {
2611
+ type: "function",
2612
+ inputs: [{
2613
+ name: "",
2614
+ internalType: "contract PanopticPoolV2",
2615
+ type: "address"
2616
+ }],
2617
+ name: "unlockEta",
2618
+ outputs: [{
2619
+ name: "",
2620
+ internalType: "uint256",
2621
+ type: "uint256"
2622
+ }],
2623
+ stateMutability: "view"
2624
+ },
2625
+ {
2626
+ type: "event",
2627
+ anonymous: false,
2628
+ inputs: [{
2629
+ name: "admin",
2630
+ internalType: "address",
2631
+ type: "address",
2632
+ indexed: true
2633
+ }],
2634
+ name: "BuilderAdminRestored"
2635
+ },
2636
+ {
2637
+ type: "event",
2638
+ anonymous: false,
2639
+ inputs: [{
2640
+ name: "admin",
2641
+ internalType: "address",
2642
+ type: "address",
2643
+ indexed: true
2644
+ }],
2645
+ name: "BuilderAdminRevoked"
2646
+ },
2647
+ {
2648
+ type: "event",
2649
+ anonymous: false,
2650
+ inputs: [{
2651
+ name: "builderCode",
2652
+ internalType: "uint256",
2653
+ type: "uint256",
2654
+ indexed: true
2655
+ }, {
2656
+ name: "wallet",
2657
+ internalType: "address",
2658
+ type: "address",
2659
+ indexed: true
2660
+ }],
2661
+ name: "BuilderDeployed"
2662
+ },
2663
+ {
2664
+ type: "event",
2665
+ anonymous: false,
2666
+ inputs: [{
2667
+ name: "pool",
2668
+ internalType: "contract PanopticPoolV2",
2669
+ type: "address",
2670
+ indexed: true
2671
+ }, {
2672
+ name: "locker",
2673
+ internalType: "address",
2674
+ type: "address",
2675
+ indexed: true
2676
+ }],
2677
+ name: "PoolLocked"
2678
+ },
2679
+ {
2680
+ type: "event",
2681
+ anonymous: false,
2682
+ inputs: [{
2683
+ name: "pool",
2684
+ internalType: "contract PanopticPoolV2",
2685
+ type: "address",
2686
+ indexed: true
2687
+ }],
2688
+ name: "PoolUnlocked"
2689
+ },
2690
+ {
2691
+ type: "event",
2692
+ anonymous: false,
2693
+ inputs: [
2694
+ {
2695
+ name: "token",
2696
+ internalType: "address",
2697
+ type: "address",
2698
+ indexed: true
2699
+ },
2700
+ {
2701
+ name: "recipient",
2702
+ internalType: "address",
2703
+ type: "address",
2704
+ indexed: true
2705
+ },
2706
+ {
2707
+ name: "amount",
2708
+ internalType: "uint256",
2709
+ type: "uint256",
2710
+ indexed: false
2711
+ }
2712
+ ],
2713
+ name: "TokensCollected"
2714
+ },
2715
+ {
2716
+ type: "event",
2717
+ anonymous: false,
2718
+ inputs: [{
2719
+ name: "pool",
2720
+ internalType: "contract PanopticPoolV2",
2721
+ type: "address",
2722
+ indexed: true
2723
+ }],
2724
+ name: "UnlockCancelled"
2725
+ },
2726
+ {
2727
+ type: "event",
2728
+ anonymous: false,
2729
+ inputs: [{
2730
+ name: "pool",
2731
+ internalType: "contract PanopticPoolV2",
2732
+ type: "address",
2733
+ indexed: true
2734
+ }, {
2735
+ name: "eta",
2736
+ internalType: "uint256",
2737
+ type: "uint256",
2738
+ indexed: false
2739
+ }],
2740
+ name: "UnlockRequested"
2741
+ },
2742
+ {
2743
+ type: "error",
2744
+ inputs: [],
2745
+ name: "InvalidBuilderCode"
2746
+ },
2747
+ {
2748
+ type: "error",
2749
+ inputs: [],
2750
+ name: "NoPendingUnlock"
2751
+ },
2752
+ {
2753
+ type: "error",
2754
+ inputs: [],
2755
+ name: "NotAuthorizedBuilder"
2756
+ },
2757
+ {
2758
+ type: "error",
2759
+ inputs: [],
2760
+ name: "NotFactoryAdmin"
2761
+ },
2762
+ {
2763
+ type: "error",
2764
+ inputs: [],
2765
+ name: "NotGuardianAdmin"
2766
+ },
2767
+ {
2768
+ type: "error",
2769
+ inputs: [],
2770
+ name: "NotTreasurer"
2771
+ },
2772
+ {
2773
+ type: "error",
2774
+ inputs: [],
2775
+ name: "UnlockAlreadyPending"
2776
+ },
2777
+ {
2778
+ type: "error",
2779
+ inputs: [{
2780
+ name: "eta",
2781
+ internalType: "uint256",
2782
+ type: "uint256"
2783
+ }],
2784
+ name: "UnlockNotReady"
2785
+ },
2786
+ {
2787
+ type: "error",
2788
+ inputs: [],
2789
+ name: "ZeroAddress"
2790
+ }
2791
+ ];
2377
2792
  const panopticPoolV2Abi = [
2378
2793
  {
2379
2794
  type: "constructor",
@@ -3704,6 +4119,17 @@ const riskEngineAbi = [
3704
4119
  }],
3705
4120
  stateMutability: "view"
3706
4121
  },
4122
+ {
4123
+ type: "function",
4124
+ inputs: [],
4125
+ name: "BUILDER_FACTORY",
4126
+ outputs: [{
4127
+ name: "",
4128
+ internalType: "address",
4129
+ type: "address"
4130
+ }],
4131
+ stateMutability: "view"
4132
+ },
3707
4133
  {
3708
4134
  type: "function",
3709
4135
  inputs: [],
@@ -4407,17 +4833,6 @@ const riskEngineAbi = [
4407
4833
  }],
4408
4834
  stateMutability: "view"
4409
4835
  },
4410
- {
4411
- type: "function",
4412
- inputs: [],
4413
- name: "guardian",
4414
- outputs: [{
4415
- name: "",
4416
- internalType: "address",
4417
- type: "address"
4418
- }],
4419
- stateMutability: "view"
4420
- },
4421
4836
  {
4422
4837
  type: "function",
4423
4838
  inputs: [
@@ -9475,7 +9890,7 @@ async function getOracleState(params) {
9475
9890
  const [currentTick, spotTick, medianTick, latestTick, oraclePack] = oracleTicks;
9476
9891
  const epoch = oraclePack >> 208n & (1n << 32n) - 1n;
9477
9892
  const lastUpdateTimestamp = oraclePack >> 176n & (1n << 32n) - 1n;
9478
- const lockMode = oraclePack >> 240n & (1n << 8n) - 1n;
9893
+ const lockMode = oraclePack >> 118n & 3n;
9479
9894
  return {
9480
9895
  epoch,
9481
9896
  lastUpdateTimestamp,
@@ -10526,5 +10941,5 @@ async function getPositionGreeks(params) {
10526
10941
  }
10527
10942
 
10528
10943
  //#endregion
10529
- export { AccountInsolventError, AlreadyInitializedError, BPS_DENOMINATOR, BatchValidationError, BelowMinimumRedemptionError, CastingError, ChunkHasZeroLiquidityError, ChunkLimitError, CrossPoolError, DEFAULT_MAX_SPREAD, DEFAULT_VEGOID, DepositTooLargeError, DuplicateTokenIdError, EffectiveLiquidityAboveThresholdError, ExceedsMaximumRedemptionError, InputListFailError, InsufficientCreditLiquidityError, InvalidBuilderCodeError, InvalidHistoryRangeError, InvalidTickBoundError, InvalidTickError, InvalidTickLimitsError, InvalidTokenIdParameterError, InvalidUniswapCallbackError, LEG_BITS, LEG_LIMITS, LEG_MASKS, LengthMismatchError, LiquidityTooHighError, LoanSlotExhaustedError, MAX_TICK, MAX_TRACKED_CHUNKS, MIN_TICK, MaxRetriesExceededError, MissingPositionIdsError, MulticallNoDataError, MulticallResultFailedError, MulticallResultMissingError, NetLiquidityZeroError, NetworkMismatchError, NoLegsExercisableError, NoLoanPositionsError, NotALongLegError, NotBuilderError, NotEnoughLiquidityInChunkError, NotEnoughTokensError, NotGuardianError, NotMarginCalledError, NotPanopticPoolError, ORACLE_EPOCH_SECONDS, OracleRateLimitedError, PanopticError as PanopticError$1, PanopticHelperNotDeployedError, PanopticValidationError, PoolNotInitializedError, PositionCountNotZeroError, PositionNotOwnedError, PositionSnapshotNotFoundError, PositionTooLargeError, PriceBoundFailError, PriceImpactTooLargeError, ProviderLagError, REORG_DEPTH, ReentrancyError, RpcError, RpcResponseError, SCHEMA_VERSION, STANDARD_TICK_WIDTHS, STORAGE_PREFIX, STRIKE_CONVERSION_FACTOR, SafeModeError, StaleDataError, StaleOracleError, StorageDataNotFoundError, SwapTokenMismatchError, SyncTimeoutError, TOKEN_ID_BITS, TokenIdHasZeroLegsError, TooManyLegsOpenError, TransferFailedError, UTILIZATION_DENOMINATOR, UnauthorizedUniswapCallbackError, UnderOverFlowError, UnhealthyPoolError, WAD, WrongPoolIdError, WrongUniswapPoolError, ZERO_COLLATERAL, ZERO_VALUATION, ZeroAddressError, ZeroCollateralRequirementError, calculatePositionDelta, calculatePositionDeltaWithSwap, calculatePositionGamma, calculatePositionGreeks, calculatePositionValue, collateralTrackerV2Abi, createTxResult, decodeLeftRightSigned, decodeLeftRightUnsigned, decodePosition, decodePositionBalance$1 as decodePositionBalance, decodeTickSpacing, fetchPoolId as fetchPoolId$1, formatPriceRange as formatPriceRange$1, formatTick as formatTick$1, formatTickRange as formatTickRange$1, getBlockMeta, getLegDelta, getLegGamma, getLegValue, getOracleState as getOracleState$1, getPool as getPool$1, getPoolMetadata as getPoolMetadata$1, getPosition, getPositionGreeks, getPositions, getPricesAtTick as getPricesAtTick$1, getRiskParameters as getRiskParameters$1, getTickSpacing as getTickSpacing$1, getUtilization as getUtilization$1, isCall, isDefinedRisk, isPanopticErrorType, panopticErrorsAbi, panopticFactoryV3Abi, panopticFactoryV4Abi, panopticPoolV2Abi, panopticQueryAbi, parsePanopticError, priceToTick as priceToTick$1, riskEngineAbi, roundToTickSpacing as roundToTickSpacing$1, semiFungiblePositionManagerV3Abi, semiFungiblePositionManagerV4Abi, sqrtPriceX96ToPriceDecimalScaled as sqrtPriceX96ToPriceDecimalScaled$1, sqrtPriceX96ToTick as sqrtPriceX96ToTick$1, stateViewAbi, submitWrite, tickLimits as tickLimits$1, tickToPrice as tickToPrice$1, tickToPriceDecimalScaled as tickToPriceDecimalScaled$1, tickToSqrtPriceX96 as tickToSqrtPriceX96$1, uniswapV3PoolAbi, validateBuilderCode as validateBuilderCode$1 };
10530
- //# sourceMappingURL=position-BVhvYRm8.js.map
10944
+ export { AccountInsolventError, AlreadyInitializedError, BPS_DENOMINATOR, BatchValidationError, BelowMinimumRedemptionError, CastingError, ChunkHasZeroLiquidityError, ChunkLimitError, CrossPoolError, DEFAULT_MAX_SPREAD, DEFAULT_VEGOID, DepositTooLargeError, DuplicateTokenIdError, EffectiveLiquidityAboveThresholdError, ExceedsMaximumRedemptionError, InputListFailError, InsufficientCreditLiquidityError, InvalidBuilderCodeError, InvalidHistoryRangeError, InvalidTickBoundError, InvalidTickError, InvalidTickLimitsError, InvalidTokenIdParameterError, InvalidUniswapCallbackError, LEG_BITS, LEG_LIMITS, LEG_MASKS, LengthMismatchError, LiquidityTooHighError, LoanSlotExhaustedError, MAX_TICK, MAX_TRACKED_CHUNKS, MIN_TICK, MaxRetriesExceededError, MissingPositionIdsError, MulticallNoDataError, MulticallResultFailedError, MulticallResultMissingError, NetLiquidityZeroError, NetworkMismatchError, NoLegsExercisableError, NoLoanPositionsError, NotALongLegError, NotBuilderError, NotEnoughLiquidityInChunkError, NotEnoughTokensError, NotGuardianError, NotMarginCalledError, NotPanopticPoolError, ORACLE_EPOCH_SECONDS, OracleRateLimitedError, PanopticError as PanopticError$1, PanopticHelperNotDeployedError, PanopticValidationError, PoolNotInitializedError, PositionCountNotZeroError, PositionNotOwnedError, PositionSnapshotNotFoundError, PositionTooLargeError, PriceBoundFailError, PriceImpactTooLargeError, ProviderLagError, REORG_DEPTH, ReentrancyError, RpcError, RpcResponseError, SCHEMA_VERSION, STANDARD_TICK_WIDTHS, STORAGE_PREFIX, STRIKE_CONVERSION_FACTOR, SafeModeError, StaleDataError, StaleOracleError, StorageDataNotFoundError, SwapTokenMismatchError, SyncTimeoutError, TOKEN_ID_BITS, TokenIdHasZeroLegsError, TooManyLegsOpenError, TransferFailedError, UTILIZATION_DENOMINATOR, UnauthorizedUniswapCallbackError, UnderOverFlowError, UnhealthyPoolError, WAD, WrongPoolIdError, WrongUniswapPoolError, ZERO_COLLATERAL, ZERO_VALUATION, ZeroAddressError, ZeroCollateralRequirementError, calculatePositionDelta, calculatePositionDeltaWithSwap, calculatePositionGamma, calculatePositionGreeks, calculatePositionValue, collateralTrackerV2Abi, createTxResult, decodeLeftRightSigned, decodeLeftRightUnsigned, decodePosition, decodePositionBalance$1 as decodePositionBalance, decodeTickSpacing, fetchPoolId as fetchPoolId$1, formatPriceRange as formatPriceRange$1, formatTick as formatTick$1, formatTickRange as formatTickRange$1, getBlockMeta, getLegDelta, getLegGamma, getLegValue, getOracleState as getOracleState$1, getPool as getPool$1, getPoolMetadata as getPoolMetadata$1, getPosition, getPositionGreeks, getPositions, getPricesAtTick as getPricesAtTick$1, getRiskParameters as getRiskParameters$1, getTickSpacing as getTickSpacing$1, getUtilization as getUtilization$1, isCall, isDefinedRisk, isPanopticErrorType, panopticErrorsAbi, panopticFactoryV3Abi, panopticFactoryV4Abi, panopticGuardianAbi, panopticPoolV2Abi, panopticQueryAbi, parsePanopticError, priceToTick as priceToTick$1, riskEngineAbi, roundToTickSpacing as roundToTickSpacing$1, semiFungiblePositionManagerV3Abi, semiFungiblePositionManagerV4Abi, sqrtPriceX96ToPriceDecimalScaled as sqrtPriceX96ToPriceDecimalScaled$1, sqrtPriceX96ToTick as sqrtPriceX96ToTick$1, stateViewAbi, submitWrite, tickLimits as tickLimits$1, tickToPrice as tickToPrice$1, tickToPriceDecimalScaled as tickToPriceDecimalScaled$1, tickToSqrtPriceX96 as tickToSqrtPriceX96$1, uniswapV3PoolAbi, validateBuilderCode as validateBuilderCode$1 };
10945
+ //# sourceMappingURL=position-DiqNO8a0.js.map