@fepvenancio/stela-sdk 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -54,6 +54,10 @@ interface StoredInscription {
54
54
  debt_asset_count: number;
55
55
  interest_asset_count: number;
56
56
  collateral_asset_count: number;
57
+ /** Whether a Dutch auction has been started (T1-3) */
58
+ auction_started: boolean;
59
+ /** Timestamp when the auction was started, 0 if no auction (T1-3) */
60
+ auction_start_time: bigint;
57
61
  }
58
62
  /** Parsed inscription with computed status and ID */
59
63
  interface Inscription extends StoredInscription {
@@ -247,8 +251,26 @@ interface OrdersBulkCancelledEvent {
247
251
  transaction_hash: string;
248
252
  block_number: number;
249
253
  }
254
+ /** AuctionStarted event (emitted by start_auction()) — T1-3 */
255
+ interface AuctionStartedEvent {
256
+ type: 'AuctionStarted';
257
+ inscription_id: bigint;
258
+ starter: string;
259
+ auction_end_time: bigint;
260
+ transaction_hash: string;
261
+ block_number: number;
262
+ }
263
+ /** AuctionBid event (emitted by bid()) — T1-3 */
264
+ interface AuctionBidEvent {
265
+ type: 'AuctionBid';
266
+ inscription_id: bigint;
267
+ bidder: string;
268
+ price: bigint;
269
+ transaction_hash: string;
270
+ block_number: number;
271
+ }
250
272
  /** Discriminated union of all Stela protocol events */
251
- type StelaEvent = InscriptionCreatedEvent | InscriptionSignedEvent | InscriptionCancelledEvent | InscriptionRepaidEvent | InscriptionLiquidatedEvent | SharesRedeemedEvent | TransferSingleEvent | OrderSettledEvent | OrderFilledEvent | OrderCancelledEvent | OrdersBulkCancelledEvent;
273
+ type StelaEvent = InscriptionCreatedEvent | InscriptionSignedEvent | InscriptionCancelledEvent | InscriptionRepaidEvent | InscriptionLiquidatedEvent | SharesRedeemedEvent | TransferSingleEvent | OrderSettledEvent | OrderFilledEvent | OrderCancelledEvent | OrdersBulkCancelledEvent | AuctionStartedEvent | AuctionBidEvent;
252
274
 
253
275
  /** State of a locker account */
254
276
  interface LockerState {
@@ -278,6 +300,14 @@ declare const VIRTUAL_SHARE_OFFSET = 10000000000000000n;
278
300
  declare const ASSET_TYPE_ENUM: Record<AssetType, number>;
279
301
  /** Reverse mapping: numeric enum value to AssetType name */
280
302
  declare const ASSET_TYPE_NAMES: Record<number, AssetType>;
303
+ /** Grace period after loan expiry before auction can start (24h in seconds) */
304
+ declare const GRACE_PERIOD = 86400n;
305
+ /** Duration of the Dutch auction (24h in seconds) */
306
+ declare const AUCTION_DURATION = 86400n;
307
+ /** Penalty added to debt at auction start (5% in BPS) */
308
+ declare const AUCTION_PENALTY_BPS = 500n;
309
+ /** Minimum auction price as percentage of debt (10% floor in BPS) */
310
+ declare const AUCTION_RESERVE_BPS = 1000n;
281
311
 
282
312
  /** Convert a bigint to a [low, high] calldata pair for StarkNet u256 */
283
313
  declare const toU256: (n: bigint) => [string, string];
@@ -436,6 +466,88 @@ declare function getBatchLendOfferTypedData(params: {
436
466
  startNonce: bigint;
437
467
  chainId: string;
438
468
  }): TypedData;
469
+ /**
470
+ * Build SNIP-12 TypedData for a collection-wide lend offer (T1-2).
471
+ * The lender offers to lend against any NFT from a given collection.
472
+ */
473
+ declare function getCollectionLendOfferTypedData(params: {
474
+ lender: string;
475
+ debtAssets: Asset[];
476
+ interestAssets: Asset[];
477
+ debtCount: number;
478
+ interestCount: number;
479
+ collectionAddress: string;
480
+ duration: bigint;
481
+ deadline: bigint;
482
+ nonce: bigint;
483
+ chainId: string;
484
+ }): TypedData;
485
+ /**
486
+ * Build SNIP-12 TypedData for a borrower's collection borrow acceptance (T1-2).
487
+ * The borrower specifies which token_id from the collection to use as collateral.
488
+ */
489
+ declare function getCollectionBorrowAcceptanceTypedData(params: {
490
+ offerHash: string;
491
+ borrower: string;
492
+ tokenId: bigint;
493
+ nonce: bigint;
494
+ chainId: string;
495
+ }): TypedData;
496
+ /**
497
+ * Build SNIP-12 TypedData for a renegotiation proposal (T1-4).
498
+ * Either borrower or lender proposes new terms for an existing loan.
499
+ */
500
+ declare function getRenegotiationProposalTypedData(params: {
501
+ inscriptionId: bigint;
502
+ proposer: string;
503
+ newDuration: bigint;
504
+ newInterestAssets: Asset[];
505
+ newInterestCount: number;
506
+ proposalDeadline: bigint;
507
+ nonce: bigint;
508
+ chainId: string;
509
+ }): TypedData;
510
+ /**
511
+ * Build SNIP-12 TypedData for a collateral sale offer (T1-5).
512
+ * The borrower offers to sell locked collateral to repay the loan.
513
+ */
514
+ declare function getCollateralSaleOfferTypedData(params: {
515
+ inscriptionId: bigint;
516
+ borrower: string;
517
+ minPrice: bigint;
518
+ paymentToken: string;
519
+ allowedBuyer: string;
520
+ deadline: bigint;
521
+ nonce: bigint;
522
+ chainId: string;
523
+ }): TypedData;
524
+ /**
525
+ * Build SNIP-12 TypedData for a refinance offer (T1-1).
526
+ * A new lender offers to take over an existing loan with new terms.
527
+ */
528
+ declare function getRefinanceOfferTypedData(params: {
529
+ inscriptionId: bigint;
530
+ newLender: string;
531
+ newDebtAssets: Asset[];
532
+ newInterestAssets: Asset[];
533
+ newDebtCount: number;
534
+ newInterestCount: number;
535
+ newDuration: bigint;
536
+ deadline: bigint;
537
+ nonce: bigint;
538
+ chainId: string;
539
+ }): TypedData;
540
+ /**
541
+ * Build SNIP-12 TypedData for a refinance approval (T1-1).
542
+ * The borrower approves a specific refinance offer for their loan.
543
+ */
544
+ declare function getRefinanceApprovalTypedData(params: {
545
+ inscriptionId: bigint;
546
+ offerHash: string;
547
+ borrower: string;
548
+ nonce: bigint;
549
+ chainId: string;
550
+ }): TypedData;
439
551
 
440
552
  /**
441
553
  * Serialize a starknet.js signature (Signature type) for storage in D1.
@@ -530,6 +642,96 @@ declare class InscriptionClient {
530
642
  buildFillSignedOrder(order: SignedOrder, signature: string[], fillBps: bigint): Call;
531
643
  buildCancelOrder(order: SignedOrder): Call;
532
644
  buildCancelOrdersByNonce(minNonce: string): Call;
645
+ /** T1-2: Settle a collection-wide lend offer */
646
+ buildSettleCollection(params: {
647
+ offer: {
648
+ lender: string;
649
+ debtHash: string;
650
+ interestHash: string;
651
+ debtCount: number;
652
+ interestCount: number;
653
+ collectionAddress: string;
654
+ duration: bigint;
655
+ deadline: bigint;
656
+ nonce: bigint;
657
+ };
658
+ acceptance: {
659
+ offerHash: string;
660
+ borrower: string;
661
+ tokenId: bigint;
662
+ nonce: bigint;
663
+ };
664
+ debtAssets: Asset[];
665
+ interestAssets: Asset[];
666
+ lenderSig: string[];
667
+ borrowerSig: string[];
668
+ }): Call;
669
+ /** T1-4: Commit a renegotiation proposal hash on-chain */
670
+ buildCommitRenegotiation(inscriptionId: bigint, proposalHash: string): Call;
671
+ /** T1-4: Execute a committed renegotiation proposal */
672
+ buildExecuteRenegotiation(params: {
673
+ inscriptionId: bigint;
674
+ proposal: {
675
+ inscriptionId: bigint;
676
+ proposer: string;
677
+ newDuration: bigint;
678
+ newInterestHash: string;
679
+ newInterestCount: number;
680
+ proposalDeadline: bigint;
681
+ nonce: bigint;
682
+ };
683
+ proposerSig: string[];
684
+ newInterestAssets: Asset[];
685
+ }): Call;
686
+ /** T1-5: Buy collateral from a borrower's sale offer */
687
+ buildBuyCollateral(params: {
688
+ inscriptionId: bigint;
689
+ offer: {
690
+ inscriptionId: bigint;
691
+ borrower: string;
692
+ minPrice: bigint;
693
+ paymentToken: string;
694
+ allowedBuyer: string;
695
+ deadline: bigint;
696
+ nonce: bigint;
697
+ };
698
+ borrowerSig: string[];
699
+ salePrice: bigint;
700
+ }): Call;
701
+ /** T1-1: Refinance an existing loan with a new lender */
702
+ buildRefinance(params: {
703
+ offer: {
704
+ inscriptionId: bigint;
705
+ newLender: string;
706
+ newDebtHash: string;
707
+ newInterestHash: string;
708
+ newDebtCount: number;
709
+ newInterestCount: number;
710
+ newDuration: bigint;
711
+ deadline: bigint;
712
+ nonce: bigint;
713
+ };
714
+ newDebtAssets: Asset[];
715
+ newInterestAssets: Asset[];
716
+ newLenderSig: string[];
717
+ approval: {
718
+ inscriptionId: bigint;
719
+ offerHash: string;
720
+ borrower: string;
721
+ nonce: bigint;
722
+ };
723
+ borrowerSig: string[];
724
+ }): Call;
725
+ /** T1-3: Start a Dutch auction on an expired, unfilled inscription */
726
+ buildStartAuction(inscriptionId: bigint): Call;
727
+ /** T1-3: Bid on an active Dutch auction */
728
+ buildBid(inscriptionId: bigint): Call;
729
+ /** T1-3: Claim collateral after an auction expires with no bids */
730
+ buildClaimCollateral(inscriptionId: bigint): Call;
731
+ /** T1-3: Get the current Dutch auction price for a specific debt asset */
732
+ getAuctionPrice(inscriptionId: bigint, debtIndex: number): Promise<bigint>;
733
+ /** T1-3: Get the auction end timestamp */
734
+ getAuctionEndTime(inscriptionId: bigint): Promise<bigint>;
533
735
  /**
534
736
  * Execute one or more calls via the connected account.
535
737
  * Pass approval calls to bundle ERC20 approve + protocol call atomically.
@@ -564,6 +766,30 @@ declare class InscriptionClient {
564
766
  cancelOrdersByNonce(minNonce: string): Promise<{
565
767
  transaction_hash: string;
566
768
  }>;
769
+ settleCollection(params: Parameters<InscriptionClient['buildSettleCollection']>[0]): Promise<{
770
+ transaction_hash: string;
771
+ }>;
772
+ commitRenegotiation(inscriptionId: bigint, proposalHash: string): Promise<{
773
+ transaction_hash: string;
774
+ }>;
775
+ executeRenegotiation(params: Parameters<InscriptionClient['buildExecuteRenegotiation']>[0], approvals?: Call[]): Promise<{
776
+ transaction_hash: string;
777
+ }>;
778
+ buyCollateral(params: Parameters<InscriptionClient['buildBuyCollateral']>[0], approvals?: Call[]): Promise<{
779
+ transaction_hash: string;
780
+ }>;
781
+ refinance(params: Parameters<InscriptionClient['buildRefinance']>[0], approvals?: Call[]): Promise<{
782
+ transaction_hash: string;
783
+ }>;
784
+ startAuction(inscriptionId: bigint): Promise<{
785
+ transaction_hash: string;
786
+ }>;
787
+ bid(inscriptionId: bigint, approvals?: Call[]): Promise<{
788
+ transaction_hash: string;
789
+ }>;
790
+ claimCollateral(inscriptionId: bigint): Promise<{
791
+ transaction_hash: string;
792
+ }>;
567
793
  }
568
794
 
569
795
  interface ShareClientOptions {
@@ -704,4 +930,4 @@ declare class StelaSdk {
704
930
  constructor(opts: StelaSdkOptions);
705
931
  }
706
932
 
707
- export { ASSET_TYPE_ENUM, ASSET_TYPE_NAMES, ApiClient, type ApiClientOptions, type ApiDetailResponse, ApiError, type ApiListResponse, type Asset, type AssetRow, type AssetType, type BatchEntry, CHAIN_ID, type Call, EXPLORER_TX_URL, type Inscription, type InscriptionCancelledEvent, InscriptionClient, type InscriptionClientOptions, type InscriptionCreatedEvent, type InscriptionEventRow, type InscriptionLiquidatedEvent, type InscriptionParams, type InscriptionRepaidEvent, type InscriptionRow, type InscriptionSignedEvent, type InscriptionStatus, type ListInscriptionsParams, type LockerCall, LockerClient, type LockerInfo, type LockerState, MAX_BPS, type Network, type OrderCancelledEvent, type OrderFilledEvent, type OrderSettledEvent, type OrdersBulkCancelledEvent, type RawEvent, SELECTORS, STATUS_LABELS, STELA_ADDRESS, type ShareBalance, ShareClient, type ShareClientOptions, type SharesRedeemedEvent, type SignedOrder, type StatusInput, type StelaEvent, StelaSdk, type StelaSdkOptions, type StoredInscription, type StoredSignature, TOKENS, type TokenInfo, type TransferSingleEvent, type TreasuryAsset, VALID_STATUSES, VIRTUAL_SHARE_OFFSET, addressesEqual, calculateFeeShares, computeStatus, convertToShares, deserializeSignature, findTokenByAddress, formatAddress, formatDuration, formatTimestamp, formatTokenValue, fromU256, getBatchLendOfferTypedData, getInscriptionOrderTypedData, getLendOfferTypedData, getTokensForNetwork, hashAssets, hashBatchEntries, inscriptionIdToHex, normalizeAddress, parseAmount, parseEvent, parseEvents, resolveNetwork, scaleByPercentage, serializeSignature, sharesToPercentage, toHex, toU256 };
933
+ export { ASSET_TYPE_ENUM, ASSET_TYPE_NAMES, AUCTION_DURATION, AUCTION_PENALTY_BPS, AUCTION_RESERVE_BPS, ApiClient, type ApiClientOptions, type ApiDetailResponse, ApiError, type ApiListResponse, type Asset, type AssetRow, type AssetType, type AuctionBidEvent, type AuctionStartedEvent, type BatchEntry, CHAIN_ID, type Call, EXPLORER_TX_URL, GRACE_PERIOD, type Inscription, type InscriptionCancelledEvent, InscriptionClient, type InscriptionClientOptions, type InscriptionCreatedEvent, type InscriptionEventRow, type InscriptionLiquidatedEvent, type InscriptionParams, type InscriptionRepaidEvent, type InscriptionRow, type InscriptionSignedEvent, type InscriptionStatus, type ListInscriptionsParams, type LockerCall, LockerClient, type LockerInfo, type LockerState, MAX_BPS, type Network, type OrderCancelledEvent, type OrderFilledEvent, type OrderSettledEvent, type OrdersBulkCancelledEvent, type RawEvent, SELECTORS, STATUS_LABELS, STELA_ADDRESS, type ShareBalance, ShareClient, type ShareClientOptions, type SharesRedeemedEvent, type SignedOrder, type StatusInput, type StelaEvent, StelaSdk, type StelaSdkOptions, type StoredInscription, type StoredSignature, TOKENS, type TokenInfo, type TransferSingleEvent, type TreasuryAsset, VALID_STATUSES, VIRTUAL_SHARE_OFFSET, addressesEqual, calculateFeeShares, computeStatus, convertToShares, deserializeSignature, findTokenByAddress, formatAddress, formatDuration, formatTimestamp, formatTokenValue, fromU256, getBatchLendOfferTypedData, getCollateralSaleOfferTypedData, getCollectionBorrowAcceptanceTypedData, getCollectionLendOfferTypedData, getInscriptionOrderTypedData, getLendOfferTypedData, getRefinanceApprovalTypedData, getRefinanceOfferTypedData, getRenegotiationProposalTypedData, getTokensForNetwork, hashAssets, hashBatchEntries, inscriptionIdToHex, normalizeAddress, parseAmount, parseEvent, parseEvents, resolveNetwork, scaleByPercentage, serializeSignature, sharesToPercentage, toHex, toU256 };
package/dist/index.d.ts CHANGED
@@ -54,6 +54,10 @@ interface StoredInscription {
54
54
  debt_asset_count: number;
55
55
  interest_asset_count: number;
56
56
  collateral_asset_count: number;
57
+ /** Whether a Dutch auction has been started (T1-3) */
58
+ auction_started: boolean;
59
+ /** Timestamp when the auction was started, 0 if no auction (T1-3) */
60
+ auction_start_time: bigint;
57
61
  }
58
62
  /** Parsed inscription with computed status and ID */
59
63
  interface Inscription extends StoredInscription {
@@ -247,8 +251,26 @@ interface OrdersBulkCancelledEvent {
247
251
  transaction_hash: string;
248
252
  block_number: number;
249
253
  }
254
+ /** AuctionStarted event (emitted by start_auction()) — T1-3 */
255
+ interface AuctionStartedEvent {
256
+ type: 'AuctionStarted';
257
+ inscription_id: bigint;
258
+ starter: string;
259
+ auction_end_time: bigint;
260
+ transaction_hash: string;
261
+ block_number: number;
262
+ }
263
+ /** AuctionBid event (emitted by bid()) — T1-3 */
264
+ interface AuctionBidEvent {
265
+ type: 'AuctionBid';
266
+ inscription_id: bigint;
267
+ bidder: string;
268
+ price: bigint;
269
+ transaction_hash: string;
270
+ block_number: number;
271
+ }
250
272
  /** Discriminated union of all Stela protocol events */
251
- type StelaEvent = InscriptionCreatedEvent | InscriptionSignedEvent | InscriptionCancelledEvent | InscriptionRepaidEvent | InscriptionLiquidatedEvent | SharesRedeemedEvent | TransferSingleEvent | OrderSettledEvent | OrderFilledEvent | OrderCancelledEvent | OrdersBulkCancelledEvent;
273
+ type StelaEvent = InscriptionCreatedEvent | InscriptionSignedEvent | InscriptionCancelledEvent | InscriptionRepaidEvent | InscriptionLiquidatedEvent | SharesRedeemedEvent | TransferSingleEvent | OrderSettledEvent | OrderFilledEvent | OrderCancelledEvent | OrdersBulkCancelledEvent | AuctionStartedEvent | AuctionBidEvent;
252
274
 
253
275
  /** State of a locker account */
254
276
  interface LockerState {
@@ -278,6 +300,14 @@ declare const VIRTUAL_SHARE_OFFSET = 10000000000000000n;
278
300
  declare const ASSET_TYPE_ENUM: Record<AssetType, number>;
279
301
  /** Reverse mapping: numeric enum value to AssetType name */
280
302
  declare const ASSET_TYPE_NAMES: Record<number, AssetType>;
303
+ /** Grace period after loan expiry before auction can start (24h in seconds) */
304
+ declare const GRACE_PERIOD = 86400n;
305
+ /** Duration of the Dutch auction (24h in seconds) */
306
+ declare const AUCTION_DURATION = 86400n;
307
+ /** Penalty added to debt at auction start (5% in BPS) */
308
+ declare const AUCTION_PENALTY_BPS = 500n;
309
+ /** Minimum auction price as percentage of debt (10% floor in BPS) */
310
+ declare const AUCTION_RESERVE_BPS = 1000n;
281
311
 
282
312
  /** Convert a bigint to a [low, high] calldata pair for StarkNet u256 */
283
313
  declare const toU256: (n: bigint) => [string, string];
@@ -436,6 +466,88 @@ declare function getBatchLendOfferTypedData(params: {
436
466
  startNonce: bigint;
437
467
  chainId: string;
438
468
  }): TypedData;
469
+ /**
470
+ * Build SNIP-12 TypedData for a collection-wide lend offer (T1-2).
471
+ * The lender offers to lend against any NFT from a given collection.
472
+ */
473
+ declare function getCollectionLendOfferTypedData(params: {
474
+ lender: string;
475
+ debtAssets: Asset[];
476
+ interestAssets: Asset[];
477
+ debtCount: number;
478
+ interestCount: number;
479
+ collectionAddress: string;
480
+ duration: bigint;
481
+ deadline: bigint;
482
+ nonce: bigint;
483
+ chainId: string;
484
+ }): TypedData;
485
+ /**
486
+ * Build SNIP-12 TypedData for a borrower's collection borrow acceptance (T1-2).
487
+ * The borrower specifies which token_id from the collection to use as collateral.
488
+ */
489
+ declare function getCollectionBorrowAcceptanceTypedData(params: {
490
+ offerHash: string;
491
+ borrower: string;
492
+ tokenId: bigint;
493
+ nonce: bigint;
494
+ chainId: string;
495
+ }): TypedData;
496
+ /**
497
+ * Build SNIP-12 TypedData for a renegotiation proposal (T1-4).
498
+ * Either borrower or lender proposes new terms for an existing loan.
499
+ */
500
+ declare function getRenegotiationProposalTypedData(params: {
501
+ inscriptionId: bigint;
502
+ proposer: string;
503
+ newDuration: bigint;
504
+ newInterestAssets: Asset[];
505
+ newInterestCount: number;
506
+ proposalDeadline: bigint;
507
+ nonce: bigint;
508
+ chainId: string;
509
+ }): TypedData;
510
+ /**
511
+ * Build SNIP-12 TypedData for a collateral sale offer (T1-5).
512
+ * The borrower offers to sell locked collateral to repay the loan.
513
+ */
514
+ declare function getCollateralSaleOfferTypedData(params: {
515
+ inscriptionId: bigint;
516
+ borrower: string;
517
+ minPrice: bigint;
518
+ paymentToken: string;
519
+ allowedBuyer: string;
520
+ deadline: bigint;
521
+ nonce: bigint;
522
+ chainId: string;
523
+ }): TypedData;
524
+ /**
525
+ * Build SNIP-12 TypedData for a refinance offer (T1-1).
526
+ * A new lender offers to take over an existing loan with new terms.
527
+ */
528
+ declare function getRefinanceOfferTypedData(params: {
529
+ inscriptionId: bigint;
530
+ newLender: string;
531
+ newDebtAssets: Asset[];
532
+ newInterestAssets: Asset[];
533
+ newDebtCount: number;
534
+ newInterestCount: number;
535
+ newDuration: bigint;
536
+ deadline: bigint;
537
+ nonce: bigint;
538
+ chainId: string;
539
+ }): TypedData;
540
+ /**
541
+ * Build SNIP-12 TypedData for a refinance approval (T1-1).
542
+ * The borrower approves a specific refinance offer for their loan.
543
+ */
544
+ declare function getRefinanceApprovalTypedData(params: {
545
+ inscriptionId: bigint;
546
+ offerHash: string;
547
+ borrower: string;
548
+ nonce: bigint;
549
+ chainId: string;
550
+ }): TypedData;
439
551
 
440
552
  /**
441
553
  * Serialize a starknet.js signature (Signature type) for storage in D1.
@@ -530,6 +642,96 @@ declare class InscriptionClient {
530
642
  buildFillSignedOrder(order: SignedOrder, signature: string[], fillBps: bigint): Call;
531
643
  buildCancelOrder(order: SignedOrder): Call;
532
644
  buildCancelOrdersByNonce(minNonce: string): Call;
645
+ /** T1-2: Settle a collection-wide lend offer */
646
+ buildSettleCollection(params: {
647
+ offer: {
648
+ lender: string;
649
+ debtHash: string;
650
+ interestHash: string;
651
+ debtCount: number;
652
+ interestCount: number;
653
+ collectionAddress: string;
654
+ duration: bigint;
655
+ deadline: bigint;
656
+ nonce: bigint;
657
+ };
658
+ acceptance: {
659
+ offerHash: string;
660
+ borrower: string;
661
+ tokenId: bigint;
662
+ nonce: bigint;
663
+ };
664
+ debtAssets: Asset[];
665
+ interestAssets: Asset[];
666
+ lenderSig: string[];
667
+ borrowerSig: string[];
668
+ }): Call;
669
+ /** T1-4: Commit a renegotiation proposal hash on-chain */
670
+ buildCommitRenegotiation(inscriptionId: bigint, proposalHash: string): Call;
671
+ /** T1-4: Execute a committed renegotiation proposal */
672
+ buildExecuteRenegotiation(params: {
673
+ inscriptionId: bigint;
674
+ proposal: {
675
+ inscriptionId: bigint;
676
+ proposer: string;
677
+ newDuration: bigint;
678
+ newInterestHash: string;
679
+ newInterestCount: number;
680
+ proposalDeadline: bigint;
681
+ nonce: bigint;
682
+ };
683
+ proposerSig: string[];
684
+ newInterestAssets: Asset[];
685
+ }): Call;
686
+ /** T1-5: Buy collateral from a borrower's sale offer */
687
+ buildBuyCollateral(params: {
688
+ inscriptionId: bigint;
689
+ offer: {
690
+ inscriptionId: bigint;
691
+ borrower: string;
692
+ minPrice: bigint;
693
+ paymentToken: string;
694
+ allowedBuyer: string;
695
+ deadline: bigint;
696
+ nonce: bigint;
697
+ };
698
+ borrowerSig: string[];
699
+ salePrice: bigint;
700
+ }): Call;
701
+ /** T1-1: Refinance an existing loan with a new lender */
702
+ buildRefinance(params: {
703
+ offer: {
704
+ inscriptionId: bigint;
705
+ newLender: string;
706
+ newDebtHash: string;
707
+ newInterestHash: string;
708
+ newDebtCount: number;
709
+ newInterestCount: number;
710
+ newDuration: bigint;
711
+ deadline: bigint;
712
+ nonce: bigint;
713
+ };
714
+ newDebtAssets: Asset[];
715
+ newInterestAssets: Asset[];
716
+ newLenderSig: string[];
717
+ approval: {
718
+ inscriptionId: bigint;
719
+ offerHash: string;
720
+ borrower: string;
721
+ nonce: bigint;
722
+ };
723
+ borrowerSig: string[];
724
+ }): Call;
725
+ /** T1-3: Start a Dutch auction on an expired, unfilled inscription */
726
+ buildStartAuction(inscriptionId: bigint): Call;
727
+ /** T1-3: Bid on an active Dutch auction */
728
+ buildBid(inscriptionId: bigint): Call;
729
+ /** T1-3: Claim collateral after an auction expires with no bids */
730
+ buildClaimCollateral(inscriptionId: bigint): Call;
731
+ /** T1-3: Get the current Dutch auction price for a specific debt asset */
732
+ getAuctionPrice(inscriptionId: bigint, debtIndex: number): Promise<bigint>;
733
+ /** T1-3: Get the auction end timestamp */
734
+ getAuctionEndTime(inscriptionId: bigint): Promise<bigint>;
533
735
  /**
534
736
  * Execute one or more calls via the connected account.
535
737
  * Pass approval calls to bundle ERC20 approve + protocol call atomically.
@@ -564,6 +766,30 @@ declare class InscriptionClient {
564
766
  cancelOrdersByNonce(minNonce: string): Promise<{
565
767
  transaction_hash: string;
566
768
  }>;
769
+ settleCollection(params: Parameters<InscriptionClient['buildSettleCollection']>[0]): Promise<{
770
+ transaction_hash: string;
771
+ }>;
772
+ commitRenegotiation(inscriptionId: bigint, proposalHash: string): Promise<{
773
+ transaction_hash: string;
774
+ }>;
775
+ executeRenegotiation(params: Parameters<InscriptionClient['buildExecuteRenegotiation']>[0], approvals?: Call[]): Promise<{
776
+ transaction_hash: string;
777
+ }>;
778
+ buyCollateral(params: Parameters<InscriptionClient['buildBuyCollateral']>[0], approvals?: Call[]): Promise<{
779
+ transaction_hash: string;
780
+ }>;
781
+ refinance(params: Parameters<InscriptionClient['buildRefinance']>[0], approvals?: Call[]): Promise<{
782
+ transaction_hash: string;
783
+ }>;
784
+ startAuction(inscriptionId: bigint): Promise<{
785
+ transaction_hash: string;
786
+ }>;
787
+ bid(inscriptionId: bigint, approvals?: Call[]): Promise<{
788
+ transaction_hash: string;
789
+ }>;
790
+ claimCollateral(inscriptionId: bigint): Promise<{
791
+ transaction_hash: string;
792
+ }>;
567
793
  }
568
794
 
569
795
  interface ShareClientOptions {
@@ -704,4 +930,4 @@ declare class StelaSdk {
704
930
  constructor(opts: StelaSdkOptions);
705
931
  }
706
932
 
707
- export { ASSET_TYPE_ENUM, ASSET_TYPE_NAMES, ApiClient, type ApiClientOptions, type ApiDetailResponse, ApiError, type ApiListResponse, type Asset, type AssetRow, type AssetType, type BatchEntry, CHAIN_ID, type Call, EXPLORER_TX_URL, type Inscription, type InscriptionCancelledEvent, InscriptionClient, type InscriptionClientOptions, type InscriptionCreatedEvent, type InscriptionEventRow, type InscriptionLiquidatedEvent, type InscriptionParams, type InscriptionRepaidEvent, type InscriptionRow, type InscriptionSignedEvent, type InscriptionStatus, type ListInscriptionsParams, type LockerCall, LockerClient, type LockerInfo, type LockerState, MAX_BPS, type Network, type OrderCancelledEvent, type OrderFilledEvent, type OrderSettledEvent, type OrdersBulkCancelledEvent, type RawEvent, SELECTORS, STATUS_LABELS, STELA_ADDRESS, type ShareBalance, ShareClient, type ShareClientOptions, type SharesRedeemedEvent, type SignedOrder, type StatusInput, type StelaEvent, StelaSdk, type StelaSdkOptions, type StoredInscription, type StoredSignature, TOKENS, type TokenInfo, type TransferSingleEvent, type TreasuryAsset, VALID_STATUSES, VIRTUAL_SHARE_OFFSET, addressesEqual, calculateFeeShares, computeStatus, convertToShares, deserializeSignature, findTokenByAddress, formatAddress, formatDuration, formatTimestamp, formatTokenValue, fromU256, getBatchLendOfferTypedData, getInscriptionOrderTypedData, getLendOfferTypedData, getTokensForNetwork, hashAssets, hashBatchEntries, inscriptionIdToHex, normalizeAddress, parseAmount, parseEvent, parseEvents, resolveNetwork, scaleByPercentage, serializeSignature, sharesToPercentage, toHex, toU256 };
933
+ export { ASSET_TYPE_ENUM, ASSET_TYPE_NAMES, AUCTION_DURATION, AUCTION_PENALTY_BPS, AUCTION_RESERVE_BPS, ApiClient, type ApiClientOptions, type ApiDetailResponse, ApiError, type ApiListResponse, type Asset, type AssetRow, type AssetType, type AuctionBidEvent, type AuctionStartedEvent, type BatchEntry, CHAIN_ID, type Call, EXPLORER_TX_URL, GRACE_PERIOD, type Inscription, type InscriptionCancelledEvent, InscriptionClient, type InscriptionClientOptions, type InscriptionCreatedEvent, type InscriptionEventRow, type InscriptionLiquidatedEvent, type InscriptionParams, type InscriptionRepaidEvent, type InscriptionRow, type InscriptionSignedEvent, type InscriptionStatus, type ListInscriptionsParams, type LockerCall, LockerClient, type LockerInfo, type LockerState, MAX_BPS, type Network, type OrderCancelledEvent, type OrderFilledEvent, type OrderSettledEvent, type OrdersBulkCancelledEvent, type RawEvent, SELECTORS, STATUS_LABELS, STELA_ADDRESS, type ShareBalance, ShareClient, type ShareClientOptions, type SharesRedeemedEvent, type SignedOrder, type StatusInput, type StelaEvent, StelaSdk, type StelaSdkOptions, type StoredInscription, type StoredSignature, TOKENS, type TokenInfo, type TransferSingleEvent, type TreasuryAsset, VALID_STATUSES, VIRTUAL_SHARE_OFFSET, addressesEqual, calculateFeeShares, computeStatus, convertToShares, deserializeSignature, findTokenByAddress, formatAddress, formatDuration, formatTimestamp, formatTokenValue, fromU256, getBatchLendOfferTypedData, getCollateralSaleOfferTypedData, getCollectionBorrowAcceptanceTypedData, getCollectionLendOfferTypedData, getInscriptionOrderTypedData, getLendOfferTypedData, getRefinanceApprovalTypedData, getRefinanceOfferTypedData, getRenegotiationProposalTypedData, getTokensForNetwork, hashAssets, hashBatchEntries, inscriptionIdToHex, normalizeAddress, parseAmount, parseEvent, parseEvents, resolveNetwork, scaleByPercentage, serializeSignature, sharesToPercentage, toHex, toU256 };