@fepvenancio/stela-sdk 0.9.0 → 0.10.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.cjs +22 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.js +22 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -674,6 +674,18 @@ declare function getRefinanceApprovalTypedData(params: {
|
|
|
674
674
|
nonce: bigint;
|
|
675
675
|
chainId: string;
|
|
676
676
|
}): TypedData;
|
|
677
|
+
/**
|
|
678
|
+
* Build SNIP-12 TypedData for a terms-of-use acknowledgment.
|
|
679
|
+
* The user signs this off-chain to prove they accepted the protocol terms.
|
|
680
|
+
* NOT verified on-chain — stored off-chain as proof of consent.
|
|
681
|
+
*/
|
|
682
|
+
declare function getTermsAcknowledgmentTypedData(params: {
|
|
683
|
+
user: string;
|
|
684
|
+
termsVersion: string;
|
|
685
|
+
termsHash: string;
|
|
686
|
+
agreedAt: bigint;
|
|
687
|
+
chainId: string;
|
|
688
|
+
}): TypedData;
|
|
677
689
|
|
|
678
690
|
/**
|
|
679
691
|
* Serialize a starknet.js signature (Signature type) for storage in D1.
|
|
@@ -1089,4 +1101,4 @@ declare class StelaSdk {
|
|
|
1089
1101
|
constructor(opts: StelaSdkOptions);
|
|
1090
1102
|
}
|
|
1091
1103
|
|
|
1092
|
-
export { ASSET_TYPE_ENUM, ASSET_TYPE_NAMES, AUCTION_DURATION, AUCTION_PENALTY_BPS, AUCTION_RESERVE_BPS, type AccruedInterestEntry, ApiClient, type ApiClientOptions, type ApiDetailResponse, ApiError, type ApiListResponse, type Asset, type AssetRow, type AssetType, type AssetValue, type AuctionBidEvent, type AuctionStartedEvent, type BatchEntry, CHAIN_ID, type Call, DEFAULT_DUST_BUFFER_SECONDS, 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 PositionValue, 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, accruedInterestWithBuffer, addressesEqual, calculateFeeShares, computePositionValue, computeSafePositionFloor, computeStatus, convertToShares, deserializeSignature, divCeil, findTokenByAddress, formatAddress, formatDuration, formatTimestamp, formatTokenValue, fromU256, getBatchLendOfferTypedData, getCollateralSaleOfferTypedData, getCollectionBorrowAcceptanceTypedData, getCollectionLendOfferTypedData, getInscriptionOrderTypedData, getLendOfferTypedData, getNFTCollections, getRefinanceApprovalTypedData, getRefinanceOfferTypedData, getRenegotiationProposalTypedData, getTokensForNetwork, hashAssets, hashBatchEntries, inscriptionIdToHex, normalizeAddress, parseAmount, parseEvent, parseEvents, proRataInterest, proportionalAssetValue, resolveNetwork, scaleByPercentage, serializeSignature, shareProportionBps, sharesToPercentage, toHex, toU256 };
|
|
1104
|
+
export { ASSET_TYPE_ENUM, ASSET_TYPE_NAMES, AUCTION_DURATION, AUCTION_PENALTY_BPS, AUCTION_RESERVE_BPS, type AccruedInterestEntry, ApiClient, type ApiClientOptions, type ApiDetailResponse, ApiError, type ApiListResponse, type Asset, type AssetRow, type AssetType, type AssetValue, type AuctionBidEvent, type AuctionStartedEvent, type BatchEntry, CHAIN_ID, type Call, DEFAULT_DUST_BUFFER_SECONDS, 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 PositionValue, 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, accruedInterestWithBuffer, addressesEqual, calculateFeeShares, computePositionValue, computeSafePositionFloor, computeStatus, convertToShares, deserializeSignature, divCeil, findTokenByAddress, formatAddress, formatDuration, formatTimestamp, formatTokenValue, fromU256, getBatchLendOfferTypedData, getCollateralSaleOfferTypedData, getCollectionBorrowAcceptanceTypedData, getCollectionLendOfferTypedData, getInscriptionOrderTypedData, getLendOfferTypedData, getNFTCollections, getRefinanceApprovalTypedData, getRefinanceOfferTypedData, getRenegotiationProposalTypedData, getTermsAcknowledgmentTypedData, getTokensForNetwork, hashAssets, hashBatchEntries, inscriptionIdToHex, normalizeAddress, parseAmount, parseEvent, parseEvents, proRataInterest, proportionalAssetValue, resolveNetwork, scaleByPercentage, serializeSignature, shareProportionBps, sharesToPercentage, toHex, toU256 };
|
package/dist/index.d.ts
CHANGED
|
@@ -674,6 +674,18 @@ declare function getRefinanceApprovalTypedData(params: {
|
|
|
674
674
|
nonce: bigint;
|
|
675
675
|
chainId: string;
|
|
676
676
|
}): TypedData;
|
|
677
|
+
/**
|
|
678
|
+
* Build SNIP-12 TypedData for a terms-of-use acknowledgment.
|
|
679
|
+
* The user signs this off-chain to prove they accepted the protocol terms.
|
|
680
|
+
* NOT verified on-chain — stored off-chain as proof of consent.
|
|
681
|
+
*/
|
|
682
|
+
declare function getTermsAcknowledgmentTypedData(params: {
|
|
683
|
+
user: string;
|
|
684
|
+
termsVersion: string;
|
|
685
|
+
termsHash: string;
|
|
686
|
+
agreedAt: bigint;
|
|
687
|
+
chainId: string;
|
|
688
|
+
}): TypedData;
|
|
677
689
|
|
|
678
690
|
/**
|
|
679
691
|
* Serialize a starknet.js signature (Signature type) for storage in D1.
|
|
@@ -1089,4 +1101,4 @@ declare class StelaSdk {
|
|
|
1089
1101
|
constructor(opts: StelaSdkOptions);
|
|
1090
1102
|
}
|
|
1091
1103
|
|
|
1092
|
-
export { ASSET_TYPE_ENUM, ASSET_TYPE_NAMES, AUCTION_DURATION, AUCTION_PENALTY_BPS, AUCTION_RESERVE_BPS, type AccruedInterestEntry, ApiClient, type ApiClientOptions, type ApiDetailResponse, ApiError, type ApiListResponse, type Asset, type AssetRow, type AssetType, type AssetValue, type AuctionBidEvent, type AuctionStartedEvent, type BatchEntry, CHAIN_ID, type Call, DEFAULT_DUST_BUFFER_SECONDS, 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 PositionValue, 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, accruedInterestWithBuffer, addressesEqual, calculateFeeShares, computePositionValue, computeSafePositionFloor, computeStatus, convertToShares, deserializeSignature, divCeil, findTokenByAddress, formatAddress, formatDuration, formatTimestamp, formatTokenValue, fromU256, getBatchLendOfferTypedData, getCollateralSaleOfferTypedData, getCollectionBorrowAcceptanceTypedData, getCollectionLendOfferTypedData, getInscriptionOrderTypedData, getLendOfferTypedData, getNFTCollections, getRefinanceApprovalTypedData, getRefinanceOfferTypedData, getRenegotiationProposalTypedData, getTokensForNetwork, hashAssets, hashBatchEntries, inscriptionIdToHex, normalizeAddress, parseAmount, parseEvent, parseEvents, proRataInterest, proportionalAssetValue, resolveNetwork, scaleByPercentage, serializeSignature, shareProportionBps, sharesToPercentage, toHex, toU256 };
|
|
1104
|
+
export { ASSET_TYPE_ENUM, ASSET_TYPE_NAMES, AUCTION_DURATION, AUCTION_PENALTY_BPS, AUCTION_RESERVE_BPS, type AccruedInterestEntry, ApiClient, type ApiClientOptions, type ApiDetailResponse, ApiError, type ApiListResponse, type Asset, type AssetRow, type AssetType, type AssetValue, type AuctionBidEvent, type AuctionStartedEvent, type BatchEntry, CHAIN_ID, type Call, DEFAULT_DUST_BUFFER_SECONDS, 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 PositionValue, 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, accruedInterestWithBuffer, addressesEqual, calculateFeeShares, computePositionValue, computeSafePositionFloor, computeStatus, convertToShares, deserializeSignature, divCeil, findTokenByAddress, formatAddress, formatDuration, formatTimestamp, formatTokenValue, fromU256, getBatchLendOfferTypedData, getCollateralSaleOfferTypedData, getCollectionBorrowAcceptanceTypedData, getCollectionLendOfferTypedData, getInscriptionOrderTypedData, getLendOfferTypedData, getNFTCollections, getRefinanceApprovalTypedData, getRefinanceOfferTypedData, getRenegotiationProposalTypedData, getTermsAcknowledgmentTypedData, getTokensForNetwork, hashAssets, hashBatchEntries, inscriptionIdToHex, normalizeAddress, parseAmount, parseEvent, parseEvents, proRataInterest, proportionalAssetValue, resolveNetwork, scaleByPercentage, serializeSignature, shareProportionBps, sharesToPercentage, toHex, toU256 };
|
package/dist/index.js
CHANGED
|
@@ -841,6 +841,27 @@ function getRefinanceApprovalTypedData(params) {
|
|
|
841
841
|
}
|
|
842
842
|
};
|
|
843
843
|
}
|
|
844
|
+
function getTermsAcknowledgmentTypedData(params) {
|
|
845
|
+
return {
|
|
846
|
+
types: {
|
|
847
|
+
StarknetDomain: STARKNET_DOMAIN_TYPE,
|
|
848
|
+
TermsAcknowledgment: [
|
|
849
|
+
{ name: "user", type: "ContractAddress" },
|
|
850
|
+
{ name: "terms_version", type: "shortstring" },
|
|
851
|
+
{ name: "terms_hash", type: "felt" },
|
|
852
|
+
{ name: "agreed_at", type: "u128" }
|
|
853
|
+
]
|
|
854
|
+
},
|
|
855
|
+
primaryType: "TermsAcknowledgment",
|
|
856
|
+
domain: { ...STELA_DOMAIN, chainId: params.chainId },
|
|
857
|
+
message: {
|
|
858
|
+
user: params.user,
|
|
859
|
+
terms_version: params.termsVersion,
|
|
860
|
+
terms_hash: params.termsHash,
|
|
861
|
+
agreed_at: params.agreedAt.toString()
|
|
862
|
+
}
|
|
863
|
+
};
|
|
864
|
+
}
|
|
844
865
|
|
|
845
866
|
// src/offchain/signature.ts
|
|
846
867
|
function serializeSignature(sig) {
|
|
@@ -3931,6 +3952,6 @@ var StelaSdk = class {
|
|
|
3931
3952
|
}
|
|
3932
3953
|
};
|
|
3933
3954
|
|
|
3934
|
-
export { ASSET_TYPE_ENUM, ASSET_TYPE_NAMES, AUCTION_DURATION, AUCTION_PENALTY_BPS, AUCTION_RESERVE_BPS, ApiClient, ApiError, CHAIN_ID, DEFAULT_DUST_BUFFER_SECONDS, EXPLORER_TX_URL, GRACE_PERIOD, InscriptionClient, LockerClient, MAX_BPS, SELECTORS, STATUS_LABELS, STELA_ADDRESS, ShareClient, StelaSdk, TOKENS, VALID_STATUSES, VIRTUAL_SHARE_OFFSET, accruedInterestWithBuffer, addressesEqual, calculateFeeShares, computePositionValue, computeSafePositionFloor, computeStatus, convertToShares, deserializeSignature, divCeil, findTokenByAddress, formatAddress, formatDuration, formatTimestamp, formatTokenValue, fromU256, getBatchLendOfferTypedData, getCollateralSaleOfferTypedData, getCollectionBorrowAcceptanceTypedData, getCollectionLendOfferTypedData, getInscriptionOrderTypedData, getLendOfferTypedData, getNFTCollections, getRefinanceApprovalTypedData, getRefinanceOfferTypedData, getRenegotiationProposalTypedData, getTokensForNetwork, hashAssets, hashBatchEntries, inscriptionIdToHex, normalizeAddress, parseAmount, parseEvent, parseEvents, proRataInterest, proportionalAssetValue, resolveNetwork, scaleByPercentage, serializeSignature, shareProportionBps, sharesToPercentage, toHex, toU256 };
|
|
3955
|
+
export { ASSET_TYPE_ENUM, ASSET_TYPE_NAMES, AUCTION_DURATION, AUCTION_PENALTY_BPS, AUCTION_RESERVE_BPS, ApiClient, ApiError, CHAIN_ID, DEFAULT_DUST_BUFFER_SECONDS, EXPLORER_TX_URL, GRACE_PERIOD, InscriptionClient, LockerClient, MAX_BPS, SELECTORS, STATUS_LABELS, STELA_ADDRESS, ShareClient, StelaSdk, TOKENS, VALID_STATUSES, VIRTUAL_SHARE_OFFSET, accruedInterestWithBuffer, addressesEqual, calculateFeeShares, computePositionValue, computeSafePositionFloor, computeStatus, convertToShares, deserializeSignature, divCeil, findTokenByAddress, formatAddress, formatDuration, formatTimestamp, formatTokenValue, fromU256, getBatchLendOfferTypedData, getCollateralSaleOfferTypedData, getCollectionBorrowAcceptanceTypedData, getCollectionLendOfferTypedData, getInscriptionOrderTypedData, getLendOfferTypedData, getNFTCollections, getRefinanceApprovalTypedData, getRefinanceOfferTypedData, getRenegotiationProposalTypedData, getTermsAcknowledgmentTypedData, getTokensForNetwork, hashAssets, hashBatchEntries, inscriptionIdToHex, normalizeAddress, parseAmount, parseEvent, parseEvents, proRataInterest, proportionalAssetValue, resolveNetwork, scaleByPercentage, serializeSignature, shareProportionBps, sharesToPercentage, toHex, toU256 };
|
|
3935
3956
|
//# sourceMappingURL=index.js.map
|
|
3936
3957
|
//# sourceMappingURL=index.js.map
|