Table of Contents

Class OfferBuilder

Namespace
NArk.ArkadeIntents.Assets
Assembly
NArk.ArkadeIntents.dll

Compiles an Arkade Offer into its covenant contract (and, for creation, the offer's address + wire payload). Mirrors the arkade wallet's offerVtxoScript / createOffer: picks the direction's program (BtcToAsset when wanting an asset, else AssetToBtc) and binds its $params from the offer.

public static class OfferBuilder
Inheritance
OfferBuilder
Inherited Members

Methods

BuildContract(Offer, OutputDescriptor, Network)

Compile the offer's covenant contract. The server descriptor supplies the arkd signer key (the offer never stores it — cancel rebuilds against the current server, so the derived address stays identical).

public static ArkProgramContract BuildContract(Offer offer, OutputDescriptor server, Network network)

Parameters

offer Offer
server OutputDescriptor
network Network

Returns

ArkProgramContract

BuildContract(Offer, OutputDescriptor, Network, OutputDescriptor)

Compile the covenant using an explicit maker descriptor for the cancel $user signer. Its x-only key must equal MakerPublicKey (so the derived address is identical to the funded one) — the point is to carry the wallet-spendable descriptor for signing, which the wire offer (x-only only) can't. Used by the cancel path.

public static ArkProgramContract BuildContract(Offer offer, OutputDescriptor server, Network network, OutputDescriptor maker)

Parameters

offer Offer
server OutputDescriptor
network Network
maker OutputDescriptor

Returns

ArkProgramContract

CreateOffer(byte[], byte[], byte[], OutputDescriptor, Network, long, AssetId?, AssetId?, Sequence?)

Build a fresh offer: compile the covenant, compute its address + scriptPubKey, and serialize the wire payload. Exactly one of wantAsset (BTC→asset) or offerAsset (asset→BTC) must be set.

public static CreatedOffer CreateOffer(byte[] makerPkScript, byte[] makerPublicKey, byte[] emulatorPubkey, OutputDescriptor server, Network network, long wantAmount, AssetId? wantAsset = null, AssetId? offerAsset = null, Sequence? exitDelay = null)

Parameters

makerPkScript byte[]
makerPublicKey byte[]
emulatorPubkey byte[]
server OutputDescriptor
network Network
wantAmount long
wantAsset AssetId
offerAsset AssetId
exitDelay Sequence?

The maker's unilateral exit delay, from the server's own UnilateralExitDelay. Omitting it leaves the maker with no path that does not need the server.

Returns

CreatedOffer