swapQuoteFixture function
SwapQuote
swapQuoteFixture({
- String id = 'swap-1',
- String depositAddress = 'tdeposit',
- String? depositMemo,
- int expiresAt = 2000000000,
- String amountIn = '0.5',
- String minAmountOut = '49.5',
- int zecSideZat = 50000000,
- String? refundTo,
- bool deshields = true,
- bool endsShielded = false,
- bool providerLegsTransparent = true,
- List<
DisclosureItem> providerSees = const [DisclosureItem.amounts, DisclosureItem.destinationAddress], - Uint8List? binding,
A neutral SwapQuote for tests — override only what a case cares about.
Defaults to an OutOfZec-shaped quote (a de-shielding deposit) so the
disclosure carries the privacy-critical flags a swap review must render.
Implementation
SwapQuote swapQuoteFixture({
String id = 'swap-1',
String depositAddress = 'tdeposit',
String? depositMemo,
int expiresAt = 2000000000,
String amountIn = '0.5',
String minAmountOut = '49.5',
int zecSideZat = 50000000,
String? refundTo,
bool deshields = true,
bool endsShielded = false,
bool providerLegsTransparent = true,
List<DisclosureItem> providerSees = const [
DisclosureItem.amounts,
DisclosureItem.destinationAddress,
],
// FR-17 (#396): a quote returned by `swapQuote` always carries its
// spend-binding nonce, so the fixture defaults to a deterministic one.
Uint8List? binding,
}) {
return SwapQuote(
id: id,
depositAddress: depositAddress,
depositMemo: depositMemo,
expiresAt: expiresAt,
amountIn: amountIn,
minAmountOut: minAmountOut,
zecSideZat: zecSideZat,
refundTo: refundTo,
disclosure: SwapPrivacyDisclosure(
endsShielded: endsShielded,
deshields: deshields,
providerLegsTransparent: providerLegsTransparent,
providerSees: providerSees,
),
binding: binding ?? defaultSwapQuoteBinding,
);
}