Skip to main content

Types

Types are exported from the module that owns them. The table below lists the import path for each.

Auction

import {type Auction, type AuctionState} from '@sealedip/sdk/auction'

interface Auction {
seller: `0x${string}`
ipId: `0x${string}`
licenseTermsId: bigint
reserveUuid: number // CDR vault uuid for the seller's sealed reserve
reserveHasCiphertext: boolean // true once the seller calls submitEncryptedReserve
deadline: bigint // unix seconds
state: AuctionState
bidCount: number
}

type AuctionState =
| 'Open'
| 'Triggered'
| 'Settled'
| 'ExpiredNoWinner'
| 'ExpiredEmpty'

Returned by getAuction(auctionId, rpcUrl?). The on-chain storage tuple is (seller, ipId, licenseTermsId, reserveUuid, reserveHasCiphertext, deadline, state, bidCount).

Note: there is no reservePrice field. The reserve is sealed and is never readable until settlement.

Bid

import {type Bid} from '@sealedip/sdk/auction'

interface Bid {
bidder: `0x${string}`
deposit: bigint // WIP held in escrow
ciphertextUuid: number
hasCiphertext: boolean // true only after submitEncryptedBid
blockNumber: bigint
txIndex: bigint
}

Returned by getBid(auctionId, bidIndex, rpcUrl?) and as elements of the array returned by getAllBids(auctionId, rpcUrl?).

hasCiphertext is false for slots where allocateBidSlot was called but submitEncryptedBid was never sent. At settle, such slots are refunded automatically without needing a reveal entry.

BidPayloadFields

import {type BidPayloadFields} from '@sealedip/sdk/payload'

interface BidPayloadFields {
bidder: `0x${string}`
amount: bigint
nonce: `0x${string}` // 32 bytes (Hex)
signature: `0x${string}` // 65 bytes r||s||v (Hex)
}

The decoded form of the 149-byte on-chain BidPayload: address(20) || uint256(32) || bytes32(32) || signature(65).

Used by both bids (signer is the bidder) and the sealed reserve (signer is the seller). The inner digest is keccak256(abi.encode(auctionId, signer, amount, nonce)) and is Ethereum personal-sign prefixed before ecrecover on-chain.

PlaceBidInput / PlaceBidResult

import {type PlaceBidInput, type PlaceBidResult} from '@sealedip/sdk/bidder'

interface PlaceBidInput {
auctionId: bigint
amount: bigint
/** Deposit held in escrow. Defaults to `amount` if omitted. */
deposit?: bigint
bidderPrivateKey: `0x${string}`
rpcUrl?: string
}

interface PlaceBidResult {
bidderAddress: `0x${string}`
uuid: number // CDR vault uuid bound to this bid
nonce: `0x${string}`
ciphertextHex: `0x${string}`
approveTxHash: `0x${string}`
allocateTxHash: `0x${string}`
submitTxHash: `0x${string}`
}

SealReserveInput / SealReserveResult

import {type SealReserveInput, type SealReserveResult} from '@sealedip/sdk'
// also importable from '@sealedip/sdk/seller'

interface SealReserveInput {
auctionId: bigint
reserve: bigint // reserve amount in wei
sellerPrivateKey: `0x${string}`
rpcUrl?: string
}

interface SealReserveResult {
sellerAddress: `0x${string}`
reserveUuid: number // CDR vault uuid (same as Auction.reserveUuid)
nonce: `0x${string}`
ciphertextHex: `0x${string}`
submitTxHash: `0x${string}`
}

SettleAuctionInput / SettleAuctionResult

import {type SettleAuctionInput, type SettleAuctionResult} from '@sealedip/sdk/orchestrator'

interface SettleAuctionInput {
auctionId: bigint
orchestratorPrivateKey: `0x${string}`
rpcUrl?: string
/**
* Default true. When true, the orchestrator sleeps until
* `auction.deadline + DEFAULT_POST_DEADLINE_BUFFER_SECONDS` before
* attempting to trigger.
*/
waitForDeadline?: boolean
}

interface SettleAuctionResult {
triggerTxHash?: `0x${string}` // undefined if auction was already Triggered
decryptTxHashes: `0x${string}`[] // one per bid + one for reserve (if sealed)
settleTxHash: `0x${string}`
bidCount: number
}

BidReveal (on-chain struct)

The struct passed inside the reveals array of settle():

// Shape the orchestrator constructs — matches the Solidity BidReveal struct
interface BidReveal {
bidIndex: bigint
amount: bigint
nonce: `0x${string}` // bytes32
signature: `0x${string}` // 65-byte r||s||v
}

ReserveReveal (on-chain struct)

The struct passed as the third argument of settle():

interface ReserveReveal {
amount: bigint
nonce: `0x${string}` // bytes32
signature: `0x${string}` // 65-byte r||s||v, signer must recover to seller
}

If the seller never called submitEncryptedReserve, pass an all-zeros ReserveReveal; the contract treats a missing reserve as a floor of 0.

EncryptBidInput / EncryptedBid

import {type EncryptBidInput, type EncryptedBid} from '@sealedip/sdk/encrypt'

interface EncryptBidInput {
uuid: number // CDR vault uuid from allocateBidSlot
plaintext: Uint8Array // encoded 149-byte BidPayload
globalPubKey?: Uint8Array // override; normally fetched + cached from CDR
}

interface EncryptedBid {
ciphertext: `0x${string}` // TDH2 ciphertext bytes as hex
}

DecryptBidInput / DecryptBidResult

decryptBid is used internally by settleAuction; there is no public @sealedip/sdk/decrypt subpath export. The types are shown here for reference.

// internal — consumed by settleAuction in @sealedip/sdk/orchestrator

interface DecryptBidInput {
uuid: number
decryptorPrivateKey: `0x${string}`
rpcUrl?: string
timeoutMs?: number // default 60 000 ms
}

interface DecryptBidResult {
payload: BidPayloadFields
readTxHash: `0x${string}`
}

Contract addresses

import {
SEALED_AUCTION_ADDRESS, // '0xb41B87f2E58E3f6139d6B6D2323C7AdFd47FC9ee'
AUCTION_REVEAL_CONDITION_ADDRESS, // '0x1A3cCd475CCFb47D1353f62F3bca6DEfAC3D69bC'
WIP_ADDRESS, // '0x1514000000000000000000000000000000000000'
PIL_LICENSE_TEMPLATE_ADDRESS, // '0x2E896b0b2Fdb7457499B56AAaA4AE55BCB4Cd316'
LICENSING_MODULE_ADDRESS, // '0x04fbd8a2e56dd85CFD5500A4A4DfA955B9f1dE6f'
LICENSE_REGISTRY_ADDRESS, // '0x529a750E02d8E2f15649c13D69a465286a780e24'
GAS_PRICE_WEI, // 100_000_000_000n — required on Aeneid
STORY_NC_SOCIAL_REMIXING_TERMS_ID, // 1n
DEMO_LICENSE_TERMS_ID, // 2834n
} from '@sealedip/sdk/constants'

All addresses are on Story Aeneid testnet (chain id 1315).

AuctionState enum values

ValueMeaning
'Open'Accepting bids
'Triggered'Deadline passed; CDR validators can now release shares
'Settled'Winner selected, license token minted
'ExpiredNoWinner'No bid cleared the reserve; all deposits refunded
'ExpiredEmpty'No bids at all; closed with no winner