@fepvenancio/stela-sdk 0.4.2 → 0.5.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/README.md +4 -0
- package/dist/index.cjs +54 -272
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -158
- package/dist/index.d.ts +2 -158
- package/dist/index.js +56 -267
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/abi/stela.json +43 -144
package/dist/index.d.cts
CHANGED
|
@@ -247,27 +247,8 @@ interface OrdersBulkCancelledEvent {
|
|
|
247
247
|
transaction_hash: string;
|
|
248
248
|
block_number: number;
|
|
249
249
|
}
|
|
250
|
-
/** PrivateSettled event (emitted by settle() when lender_commitment != 0) */
|
|
251
|
-
interface PrivateSettledEvent {
|
|
252
|
-
type: 'PrivateSettled';
|
|
253
|
-
inscription_id: bigint;
|
|
254
|
-
lender_commitment: string;
|
|
255
|
-
shares_committed: bigint;
|
|
256
|
-
transaction_hash: string;
|
|
257
|
-
block_number: number;
|
|
258
|
-
}
|
|
259
|
-
/** PrivateSharesRedeemed event (emitted by private_redeem()) */
|
|
260
|
-
interface PrivateSharesRedeemedEvent {
|
|
261
|
-
type: 'PrivateSharesRedeemed';
|
|
262
|
-
inscription_id: bigint;
|
|
263
|
-
nullifier: string;
|
|
264
|
-
shares: bigint;
|
|
265
|
-
recipient: string;
|
|
266
|
-
transaction_hash: string;
|
|
267
|
-
block_number: number;
|
|
268
|
-
}
|
|
269
250
|
/** Discriminated union of all Stela protocol events */
|
|
270
|
-
type StelaEvent = InscriptionCreatedEvent | InscriptionSignedEvent | InscriptionCancelledEvent | InscriptionRepaidEvent | InscriptionLiquidatedEvent | SharesRedeemedEvent | TransferSingleEvent | OrderSettledEvent | OrderFilledEvent | OrderCancelledEvent | OrdersBulkCancelledEvent
|
|
251
|
+
type StelaEvent = InscriptionCreatedEvent | InscriptionSignedEvent | InscriptionCancelledEvent | InscriptionRepaidEvent | InscriptionLiquidatedEvent | SharesRedeemedEvent | TransferSingleEvent | OrderSettledEvent | OrderFilledEvent | OrderCancelledEvent | OrdersBulkCancelledEvent;
|
|
271
252
|
|
|
272
253
|
/** State of a locker account */
|
|
273
254
|
interface LockerState {
|
|
@@ -422,27 +403,9 @@ declare function getInscriptionOrderTypedData(params: {
|
|
|
422
403
|
nonce: bigint;
|
|
423
404
|
chainId: string;
|
|
424
405
|
}): TypedData;
|
|
425
|
-
/**
|
|
426
|
-
* Build SNIP-12 TypedData for a private lend offer.
|
|
427
|
-
*
|
|
428
|
-
* Convenience wrapper around getLendOfferTypedData that sets lender to zero address
|
|
429
|
-
* and includes the deposit commitment. For private settlements, the lender is anonymous
|
|
430
|
-
* — the privacy pool's deposit commitment proves ownership instead.
|
|
431
|
-
*/
|
|
432
|
-
declare function getPrivateLendOfferTypedData(params: {
|
|
433
|
-
orderHash: string;
|
|
434
|
-
issuedDebtPercentage: bigint;
|
|
435
|
-
nonce: bigint;
|
|
436
|
-
chainId: string;
|
|
437
|
-
/** The deposit commitment from the privacy pool shield() call. */
|
|
438
|
-
depositCommitment: string;
|
|
439
|
-
}): TypedData;
|
|
440
406
|
/**
|
|
441
407
|
* Build SNIP-12 TypedData for a lender's LendOffer.
|
|
442
408
|
* The lender signs this off-chain to accept an order without gas.
|
|
443
|
-
*
|
|
444
|
-
* @param lenderCommitment - Privacy commitment. When non-zero, shares are committed to the
|
|
445
|
-
* privacy pool's Merkle tree instead of minting ERC1155 to the lender. Defaults to '0'.
|
|
446
409
|
*/
|
|
447
410
|
declare function getLendOfferTypedData(params: {
|
|
448
411
|
orderHash: string;
|
|
@@ -450,8 +413,6 @@ declare function getLendOfferTypedData(params: {
|
|
|
450
413
|
issuedDebtPercentage: bigint;
|
|
451
414
|
nonce: bigint;
|
|
452
415
|
chainId: string;
|
|
453
|
-
/** Privacy commitment (default '0' = non-private). */
|
|
454
|
-
lenderCommitment?: string;
|
|
455
416
|
}): TypedData;
|
|
456
417
|
|
|
457
418
|
/**
|
|
@@ -464,72 +425,6 @@ interface StoredSignature {
|
|
|
464
425
|
declare function serializeSignature(sig: string[]): StoredSignature;
|
|
465
426
|
declare function deserializeSignature(stored: StoredSignature): string[];
|
|
466
427
|
|
|
467
|
-
/** A private share note — represents committed shares in the privacy pool. */
|
|
468
|
-
interface PrivateNote {
|
|
469
|
-
/** The lender who owns these shares */
|
|
470
|
-
owner: string;
|
|
471
|
-
/** The inscription ID */
|
|
472
|
-
inscriptionId: bigint;
|
|
473
|
-
/** Number of shares */
|
|
474
|
-
shares: bigint;
|
|
475
|
-
/** Random salt for commitment uniqueness */
|
|
476
|
-
salt: string;
|
|
477
|
-
/** The commitment (Poseidon hash of above fields) */
|
|
478
|
-
commitment: string;
|
|
479
|
-
}
|
|
480
|
-
/** Request to privately redeem shares (matches Cairo PrivateRedeemRequest). */
|
|
481
|
-
interface PrivateRedeemRequest {
|
|
482
|
-
/** Merkle root the proof was generated against */
|
|
483
|
-
root: string;
|
|
484
|
-
/** The inscription ID */
|
|
485
|
-
inscriptionId: bigint;
|
|
486
|
-
/** Number of shares being redeemed */
|
|
487
|
-
shares: bigint;
|
|
488
|
-
/** Nullifier (prevents double-spend) */
|
|
489
|
-
nullifier: string;
|
|
490
|
-
/** Change commitment (for partial redemption). '0' if full redemption. */
|
|
491
|
-
changeCommitment: string;
|
|
492
|
-
/** Recipient address for redeemed assets */
|
|
493
|
-
recipient: string;
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
/**
|
|
497
|
-
* Compute a note commitment matching the Cairo compute_commitment function.
|
|
498
|
-
*
|
|
499
|
-
* commitment = Poseidon(domain, owner, inscription_id.low, inscription_id.high,
|
|
500
|
-
* shares.low, shares.high, salt)
|
|
501
|
-
*/
|
|
502
|
-
declare function computeCommitment(owner: string, inscriptionId: bigint, shares: bigint, salt: string): string;
|
|
503
|
-
/**
|
|
504
|
-
* Derive a nullifier from a commitment and the owner's secret.
|
|
505
|
-
* Matches Cairo: nullifier = Poseidon(domain, commitment, owner_secret)
|
|
506
|
-
*/
|
|
507
|
-
declare function computeNullifier(commitment: string, ownerSecret: string): string;
|
|
508
|
-
/**
|
|
509
|
-
* Compute a Poseidon hash of two children (for Merkle tree internal nodes).
|
|
510
|
-
* Matches Cairo: hash_pair(left, right) = Poseidon(left, right)
|
|
511
|
-
*/
|
|
512
|
-
declare function hashPair(left: string, right: string): string;
|
|
513
|
-
/**
|
|
514
|
-
* Generate a random salt for commitment uniqueness.
|
|
515
|
-
* Returns a hex-encoded felt252 (< 2^251).
|
|
516
|
-
*/
|
|
517
|
-
declare function generateSalt(): string;
|
|
518
|
-
/**
|
|
519
|
-
* Compute a deposit commitment for the privacy pool's shield() call.
|
|
520
|
-
*
|
|
521
|
-
* This is the commitment that a depositor provides when shielding tokens into the privacy pool.
|
|
522
|
-
* It links the depositor, token, amount, and a secret salt so the deposit can later be consumed
|
|
523
|
-
* during private settlement.
|
|
524
|
-
*
|
|
525
|
-
* commitment = Poseidon(domain, depositor, token, amount.low, amount.high, salt)
|
|
526
|
-
*/
|
|
527
|
-
declare function computeDepositCommitment(depositor: string, token: string, amount: bigint, salt: bigint): string;
|
|
528
|
-
/**
|
|
529
|
-
* Create a full private note: generates salt, computes commitment.
|
|
530
|
-
*/
|
|
531
|
-
declare function createPrivateNote(owner: string, inscriptionId: bigint, shares: bigint, salt?: string): PrivateNote;
|
|
532
|
-
|
|
533
428
|
interface InscriptionClientOptions {
|
|
534
429
|
stelaAddress: string;
|
|
535
430
|
provider: RpcProvider;
|
|
@@ -558,52 +453,6 @@ declare class InscriptionClient {
|
|
|
558
453
|
buildRepay(inscriptionId: bigint): Call;
|
|
559
454
|
buildLiquidate(inscriptionId: bigint): Call;
|
|
560
455
|
buildRedeem(inscriptionId: bigint, shares: bigint): Call;
|
|
561
|
-
buildPrivateRedeem(request: PrivateRedeemRequest, proof: string[]): Call;
|
|
562
|
-
/**
|
|
563
|
-
* Build a shield() call on the privacy pool contract.
|
|
564
|
-
* The depositor shields tokens into the pool, creating a commitment that can
|
|
565
|
-
* later be consumed during private settlement.
|
|
566
|
-
*/
|
|
567
|
-
buildShieldDeposit(params: {
|
|
568
|
-
privacyPoolAddress: string;
|
|
569
|
-
token: string;
|
|
570
|
-
amount: bigint;
|
|
571
|
-
commitment: string;
|
|
572
|
-
}): Call;
|
|
573
|
-
/**
|
|
574
|
-
* Build a settle() call for private settlement.
|
|
575
|
-
*
|
|
576
|
-
* In a private settlement, the lender is zero address and the lender_commitment
|
|
577
|
-
* is the deposit commitment from the privacy pool. The contract skips lender
|
|
578
|
-
* signature verification and instead consumes the deposit from the privacy pool.
|
|
579
|
-
*/
|
|
580
|
-
buildSettlePrivate(params: {
|
|
581
|
-
order: {
|
|
582
|
-
borrower: string;
|
|
583
|
-
debtHash: string;
|
|
584
|
-
interestHash: string;
|
|
585
|
-
collateralHash: string;
|
|
586
|
-
debtCount: number;
|
|
587
|
-
interestCount: number;
|
|
588
|
-
collateralCount: number;
|
|
589
|
-
duration: bigint;
|
|
590
|
-
deadline: bigint;
|
|
591
|
-
multiLender: boolean;
|
|
592
|
-
nonce: bigint;
|
|
593
|
-
};
|
|
594
|
-
debtAssets: Asset[];
|
|
595
|
-
interestAssets: Asset[];
|
|
596
|
-
collateralAssets: Asset[];
|
|
597
|
-
borrowerSig: string[];
|
|
598
|
-
offer: {
|
|
599
|
-
orderHash: string;
|
|
600
|
-
issuedDebtPercentage: bigint;
|
|
601
|
-
nonce: bigint;
|
|
602
|
-
/** The deposit commitment from the privacy pool. */
|
|
603
|
-
lenderCommitment: string;
|
|
604
|
-
};
|
|
605
|
-
lenderSig: string[];
|
|
606
|
-
}): Call;
|
|
607
456
|
buildSettle(params: {
|
|
608
457
|
order: {
|
|
609
458
|
borrower: string;
|
|
@@ -627,8 +476,6 @@ declare class InscriptionClient {
|
|
|
627
476
|
lender: string;
|
|
628
477
|
issuedDebtPercentage: bigint;
|
|
629
478
|
nonce: bigint;
|
|
630
|
-
/** Privacy commitment. When non-zero, shares go to privacy pool. Default '0'. */
|
|
631
|
-
lenderCommitment?: string;
|
|
632
479
|
};
|
|
633
480
|
lenderSig: string[];
|
|
634
481
|
}): Call;
|
|
@@ -660,9 +507,6 @@ declare class InscriptionClient {
|
|
|
660
507
|
redeem(inscriptionId: bigint, shares: bigint): Promise<{
|
|
661
508
|
transaction_hash: string;
|
|
662
509
|
}>;
|
|
663
|
-
privateRedeem(request: PrivateRedeemRequest, proof: string[]): Promise<{
|
|
664
|
-
transaction_hash: string;
|
|
665
|
-
}>;
|
|
666
510
|
fillSignedOrder(order: SignedOrder, signature: string[], fillBps: bigint, approvals?: Call[]): Promise<{
|
|
667
511
|
transaction_hash: string;
|
|
668
512
|
}>;
|
|
@@ -812,4 +656,4 @@ declare class StelaSdk {
|
|
|
812
656
|
constructor(opts: StelaSdkOptions);
|
|
813
657
|
}
|
|
814
658
|
|
|
815
|
-
export { ASSET_TYPE_ENUM, ASSET_TYPE_NAMES, ApiClient, type ApiClientOptions, type ApiDetailResponse, ApiError, type ApiListResponse, type Asset, type AssetRow, type AssetType, 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
|
|
659
|
+
export { ASSET_TYPE_ENUM, ASSET_TYPE_NAMES, ApiClient, type ApiClientOptions, type ApiDetailResponse, ApiError, type ApiListResponse, type Asset, type AssetRow, type AssetType, 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, getInscriptionOrderTypedData, getLendOfferTypedData, getTokensForNetwork, hashAssets, inscriptionIdToHex, normalizeAddress, parseAmount, parseEvent, parseEvents, resolveNetwork, scaleByPercentage, serializeSignature, sharesToPercentage, toHex, toU256 };
|
package/dist/index.d.ts
CHANGED
|
@@ -247,27 +247,8 @@ interface OrdersBulkCancelledEvent {
|
|
|
247
247
|
transaction_hash: string;
|
|
248
248
|
block_number: number;
|
|
249
249
|
}
|
|
250
|
-
/** PrivateSettled event (emitted by settle() when lender_commitment != 0) */
|
|
251
|
-
interface PrivateSettledEvent {
|
|
252
|
-
type: 'PrivateSettled';
|
|
253
|
-
inscription_id: bigint;
|
|
254
|
-
lender_commitment: string;
|
|
255
|
-
shares_committed: bigint;
|
|
256
|
-
transaction_hash: string;
|
|
257
|
-
block_number: number;
|
|
258
|
-
}
|
|
259
|
-
/** PrivateSharesRedeemed event (emitted by private_redeem()) */
|
|
260
|
-
interface PrivateSharesRedeemedEvent {
|
|
261
|
-
type: 'PrivateSharesRedeemed';
|
|
262
|
-
inscription_id: bigint;
|
|
263
|
-
nullifier: string;
|
|
264
|
-
shares: bigint;
|
|
265
|
-
recipient: string;
|
|
266
|
-
transaction_hash: string;
|
|
267
|
-
block_number: number;
|
|
268
|
-
}
|
|
269
250
|
/** Discriminated union of all Stela protocol events */
|
|
270
|
-
type StelaEvent = InscriptionCreatedEvent | InscriptionSignedEvent | InscriptionCancelledEvent | InscriptionRepaidEvent | InscriptionLiquidatedEvent | SharesRedeemedEvent | TransferSingleEvent | OrderSettledEvent | OrderFilledEvent | OrderCancelledEvent | OrdersBulkCancelledEvent
|
|
251
|
+
type StelaEvent = InscriptionCreatedEvent | InscriptionSignedEvent | InscriptionCancelledEvent | InscriptionRepaidEvent | InscriptionLiquidatedEvent | SharesRedeemedEvent | TransferSingleEvent | OrderSettledEvent | OrderFilledEvent | OrderCancelledEvent | OrdersBulkCancelledEvent;
|
|
271
252
|
|
|
272
253
|
/** State of a locker account */
|
|
273
254
|
interface LockerState {
|
|
@@ -422,27 +403,9 @@ declare function getInscriptionOrderTypedData(params: {
|
|
|
422
403
|
nonce: bigint;
|
|
423
404
|
chainId: string;
|
|
424
405
|
}): TypedData;
|
|
425
|
-
/**
|
|
426
|
-
* Build SNIP-12 TypedData for a private lend offer.
|
|
427
|
-
*
|
|
428
|
-
* Convenience wrapper around getLendOfferTypedData that sets lender to zero address
|
|
429
|
-
* and includes the deposit commitment. For private settlements, the lender is anonymous
|
|
430
|
-
* — the privacy pool's deposit commitment proves ownership instead.
|
|
431
|
-
*/
|
|
432
|
-
declare function getPrivateLendOfferTypedData(params: {
|
|
433
|
-
orderHash: string;
|
|
434
|
-
issuedDebtPercentage: bigint;
|
|
435
|
-
nonce: bigint;
|
|
436
|
-
chainId: string;
|
|
437
|
-
/** The deposit commitment from the privacy pool shield() call. */
|
|
438
|
-
depositCommitment: string;
|
|
439
|
-
}): TypedData;
|
|
440
406
|
/**
|
|
441
407
|
* Build SNIP-12 TypedData for a lender's LendOffer.
|
|
442
408
|
* The lender signs this off-chain to accept an order without gas.
|
|
443
|
-
*
|
|
444
|
-
* @param lenderCommitment - Privacy commitment. When non-zero, shares are committed to the
|
|
445
|
-
* privacy pool's Merkle tree instead of minting ERC1155 to the lender. Defaults to '0'.
|
|
446
409
|
*/
|
|
447
410
|
declare function getLendOfferTypedData(params: {
|
|
448
411
|
orderHash: string;
|
|
@@ -450,8 +413,6 @@ declare function getLendOfferTypedData(params: {
|
|
|
450
413
|
issuedDebtPercentage: bigint;
|
|
451
414
|
nonce: bigint;
|
|
452
415
|
chainId: string;
|
|
453
|
-
/** Privacy commitment (default '0' = non-private). */
|
|
454
|
-
lenderCommitment?: string;
|
|
455
416
|
}): TypedData;
|
|
456
417
|
|
|
457
418
|
/**
|
|
@@ -464,72 +425,6 @@ interface StoredSignature {
|
|
|
464
425
|
declare function serializeSignature(sig: string[]): StoredSignature;
|
|
465
426
|
declare function deserializeSignature(stored: StoredSignature): string[];
|
|
466
427
|
|
|
467
|
-
/** A private share note — represents committed shares in the privacy pool. */
|
|
468
|
-
interface PrivateNote {
|
|
469
|
-
/** The lender who owns these shares */
|
|
470
|
-
owner: string;
|
|
471
|
-
/** The inscription ID */
|
|
472
|
-
inscriptionId: bigint;
|
|
473
|
-
/** Number of shares */
|
|
474
|
-
shares: bigint;
|
|
475
|
-
/** Random salt for commitment uniqueness */
|
|
476
|
-
salt: string;
|
|
477
|
-
/** The commitment (Poseidon hash of above fields) */
|
|
478
|
-
commitment: string;
|
|
479
|
-
}
|
|
480
|
-
/** Request to privately redeem shares (matches Cairo PrivateRedeemRequest). */
|
|
481
|
-
interface PrivateRedeemRequest {
|
|
482
|
-
/** Merkle root the proof was generated against */
|
|
483
|
-
root: string;
|
|
484
|
-
/** The inscription ID */
|
|
485
|
-
inscriptionId: bigint;
|
|
486
|
-
/** Number of shares being redeemed */
|
|
487
|
-
shares: bigint;
|
|
488
|
-
/** Nullifier (prevents double-spend) */
|
|
489
|
-
nullifier: string;
|
|
490
|
-
/** Change commitment (for partial redemption). '0' if full redemption. */
|
|
491
|
-
changeCommitment: string;
|
|
492
|
-
/** Recipient address for redeemed assets */
|
|
493
|
-
recipient: string;
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
/**
|
|
497
|
-
* Compute a note commitment matching the Cairo compute_commitment function.
|
|
498
|
-
*
|
|
499
|
-
* commitment = Poseidon(domain, owner, inscription_id.low, inscription_id.high,
|
|
500
|
-
* shares.low, shares.high, salt)
|
|
501
|
-
*/
|
|
502
|
-
declare function computeCommitment(owner: string, inscriptionId: bigint, shares: bigint, salt: string): string;
|
|
503
|
-
/**
|
|
504
|
-
* Derive a nullifier from a commitment and the owner's secret.
|
|
505
|
-
* Matches Cairo: nullifier = Poseidon(domain, commitment, owner_secret)
|
|
506
|
-
*/
|
|
507
|
-
declare function computeNullifier(commitment: string, ownerSecret: string): string;
|
|
508
|
-
/**
|
|
509
|
-
* Compute a Poseidon hash of two children (for Merkle tree internal nodes).
|
|
510
|
-
* Matches Cairo: hash_pair(left, right) = Poseidon(left, right)
|
|
511
|
-
*/
|
|
512
|
-
declare function hashPair(left: string, right: string): string;
|
|
513
|
-
/**
|
|
514
|
-
* Generate a random salt for commitment uniqueness.
|
|
515
|
-
* Returns a hex-encoded felt252 (< 2^251).
|
|
516
|
-
*/
|
|
517
|
-
declare function generateSalt(): string;
|
|
518
|
-
/**
|
|
519
|
-
* Compute a deposit commitment for the privacy pool's shield() call.
|
|
520
|
-
*
|
|
521
|
-
* This is the commitment that a depositor provides when shielding tokens into the privacy pool.
|
|
522
|
-
* It links the depositor, token, amount, and a secret salt so the deposit can later be consumed
|
|
523
|
-
* during private settlement.
|
|
524
|
-
*
|
|
525
|
-
* commitment = Poseidon(domain, depositor, token, amount.low, amount.high, salt)
|
|
526
|
-
*/
|
|
527
|
-
declare function computeDepositCommitment(depositor: string, token: string, amount: bigint, salt: bigint): string;
|
|
528
|
-
/**
|
|
529
|
-
* Create a full private note: generates salt, computes commitment.
|
|
530
|
-
*/
|
|
531
|
-
declare function createPrivateNote(owner: string, inscriptionId: bigint, shares: bigint, salt?: string): PrivateNote;
|
|
532
|
-
|
|
533
428
|
interface InscriptionClientOptions {
|
|
534
429
|
stelaAddress: string;
|
|
535
430
|
provider: RpcProvider;
|
|
@@ -558,52 +453,6 @@ declare class InscriptionClient {
|
|
|
558
453
|
buildRepay(inscriptionId: bigint): Call;
|
|
559
454
|
buildLiquidate(inscriptionId: bigint): Call;
|
|
560
455
|
buildRedeem(inscriptionId: bigint, shares: bigint): Call;
|
|
561
|
-
buildPrivateRedeem(request: PrivateRedeemRequest, proof: string[]): Call;
|
|
562
|
-
/**
|
|
563
|
-
* Build a shield() call on the privacy pool contract.
|
|
564
|
-
* The depositor shields tokens into the pool, creating a commitment that can
|
|
565
|
-
* later be consumed during private settlement.
|
|
566
|
-
*/
|
|
567
|
-
buildShieldDeposit(params: {
|
|
568
|
-
privacyPoolAddress: string;
|
|
569
|
-
token: string;
|
|
570
|
-
amount: bigint;
|
|
571
|
-
commitment: string;
|
|
572
|
-
}): Call;
|
|
573
|
-
/**
|
|
574
|
-
* Build a settle() call for private settlement.
|
|
575
|
-
*
|
|
576
|
-
* In a private settlement, the lender is zero address and the lender_commitment
|
|
577
|
-
* is the deposit commitment from the privacy pool. The contract skips lender
|
|
578
|
-
* signature verification and instead consumes the deposit from the privacy pool.
|
|
579
|
-
*/
|
|
580
|
-
buildSettlePrivate(params: {
|
|
581
|
-
order: {
|
|
582
|
-
borrower: string;
|
|
583
|
-
debtHash: string;
|
|
584
|
-
interestHash: string;
|
|
585
|
-
collateralHash: string;
|
|
586
|
-
debtCount: number;
|
|
587
|
-
interestCount: number;
|
|
588
|
-
collateralCount: number;
|
|
589
|
-
duration: bigint;
|
|
590
|
-
deadline: bigint;
|
|
591
|
-
multiLender: boolean;
|
|
592
|
-
nonce: bigint;
|
|
593
|
-
};
|
|
594
|
-
debtAssets: Asset[];
|
|
595
|
-
interestAssets: Asset[];
|
|
596
|
-
collateralAssets: Asset[];
|
|
597
|
-
borrowerSig: string[];
|
|
598
|
-
offer: {
|
|
599
|
-
orderHash: string;
|
|
600
|
-
issuedDebtPercentage: bigint;
|
|
601
|
-
nonce: bigint;
|
|
602
|
-
/** The deposit commitment from the privacy pool. */
|
|
603
|
-
lenderCommitment: string;
|
|
604
|
-
};
|
|
605
|
-
lenderSig: string[];
|
|
606
|
-
}): Call;
|
|
607
456
|
buildSettle(params: {
|
|
608
457
|
order: {
|
|
609
458
|
borrower: string;
|
|
@@ -627,8 +476,6 @@ declare class InscriptionClient {
|
|
|
627
476
|
lender: string;
|
|
628
477
|
issuedDebtPercentage: bigint;
|
|
629
478
|
nonce: bigint;
|
|
630
|
-
/** Privacy commitment. When non-zero, shares go to privacy pool. Default '0'. */
|
|
631
|
-
lenderCommitment?: string;
|
|
632
479
|
};
|
|
633
480
|
lenderSig: string[];
|
|
634
481
|
}): Call;
|
|
@@ -660,9 +507,6 @@ declare class InscriptionClient {
|
|
|
660
507
|
redeem(inscriptionId: bigint, shares: bigint): Promise<{
|
|
661
508
|
transaction_hash: string;
|
|
662
509
|
}>;
|
|
663
|
-
privateRedeem(request: PrivateRedeemRequest, proof: string[]): Promise<{
|
|
664
|
-
transaction_hash: string;
|
|
665
|
-
}>;
|
|
666
510
|
fillSignedOrder(order: SignedOrder, signature: string[], fillBps: bigint, approvals?: Call[]): Promise<{
|
|
667
511
|
transaction_hash: string;
|
|
668
512
|
}>;
|
|
@@ -812,4 +656,4 @@ declare class StelaSdk {
|
|
|
812
656
|
constructor(opts: StelaSdkOptions);
|
|
813
657
|
}
|
|
814
658
|
|
|
815
|
-
export { ASSET_TYPE_ENUM, ASSET_TYPE_NAMES, ApiClient, type ApiClientOptions, type ApiDetailResponse, ApiError, type ApiListResponse, type Asset, type AssetRow, type AssetType, 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
|
|
659
|
+
export { ASSET_TYPE_ENUM, ASSET_TYPE_NAMES, ApiClient, type ApiClientOptions, type ApiDetailResponse, ApiError, type ApiListResponse, type Asset, type AssetRow, type AssetType, 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, getInscriptionOrderTypedData, getLendOfferTypedData, getTokensForNetwork, hashAssets, inscriptionIdToHex, normalizeAddress, parseAmount, parseEvent, parseEvents, resolveNetwork, scaleByPercentage, serializeSignature, sharesToPercentage, toHex, toU256 };
|