@compass-labs/api-sdk 2.2.108-rc.0 → 2.2.108
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/commonjs/models/components/creditswaprequest.d.ts +8 -3
- package/dist/commonjs/models/components/creditswaprequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditswaprequest.js +2 -1
- package/dist/commonjs/models/components/creditswaprequest.js.map +1 -1
- package/dist/commonjs/models/components/creditswapresponse.d.ts +6 -6
- package/dist/commonjs/models/components/creditswapresponse.js +1 -1
- package/dist/esm/models/components/creditswaprequest.d.ts +8 -3
- package/dist/esm/models/components/creditswaprequest.d.ts.map +1 -1
- package/dist/esm/models/components/creditswaprequest.js +2 -1
- package/dist/esm/models/components/creditswaprequest.js.map +1 -1
- package/dist/esm/models/components/creditswapresponse.d.ts +6 -6
- package/dist/esm/models/components/creditswapresponse.js +1 -1
- package/docs/models/components/creditswaprequest.md +12 -11
- package/docs/models/components/creditswaprequestpricing.md +1 -1
- package/docs/models/components/creditswapresponse.md +7 -7
- package/docs/models/components/creditswapresponseswapprovider.md +1 -1
- package/openapi_prepped_for_speakeasy.json +11 -5
- package/package.json +1 -1
- package/src/models/components/creditswaprequest.ts +9 -3
- package/src/models/components/creditswapresponse.ts +6 -6
|
@@ -24,7 +24,7 @@ export declare const CreditSwapRequestChain: {
|
|
|
24
24
|
*/
|
|
25
25
|
export type CreditSwapRequestChain = ClosedEnum<typeof CreditSwapRequestChain>;
|
|
26
26
|
/**
|
|
27
|
-
* Swap routing policy. 'auto': a firm zero-slippage quote when a firm venue covers the pair, transparent fallback to the market aggregator otherwise. 'firm': never price on the market route; an uncovered pair fails with a typed error instead of silently substituting market pricing. 'market': never route through the firm venue; the swap is priced by the aggregator and bounded by `slippage` (which firm fills ignore). 'firm' is incompatible with gas_sponsorship (sponsored swaps force market routing).
|
|
27
|
+
* Swap routing policy. 'auto': a firm zero-slippage quote when a firm venue covers the pair, transparent fallback to the market aggregator otherwise. 'firm': never price on the market route; an uncovered pair fails with a typed error instead of silently substituting market pricing — previews included: a preview the firm provider's live price levels cannot price returns the same typed error rather than market numbers. 'market': never route through the firm venue; the swap is priced by the aggregator and bounded by `slippage` (which firm fills ignore). 'firm' is incompatible with gas_sponsorship (sponsored swaps force market routing).
|
|
28
28
|
*/
|
|
29
29
|
export declare const CreditSwapRequestPricing: {
|
|
30
30
|
readonly Auto: "auto";
|
|
@@ -32,7 +32,7 @@ export declare const CreditSwapRequestPricing: {
|
|
|
32
32
|
readonly Market: "market";
|
|
33
33
|
};
|
|
34
34
|
/**
|
|
35
|
-
* Swap routing policy. 'auto': a firm zero-slippage quote when a firm venue covers the pair, transparent fallback to the market aggregator otherwise. 'firm': never price on the market route; an uncovered pair fails with a typed error instead of silently substituting market pricing. 'market': never route through the firm venue; the swap is priced by the aggregator and bounded by `slippage` (which firm fills ignore). 'firm' is incompatible with gas_sponsorship (sponsored swaps force market routing).
|
|
35
|
+
* Swap routing policy. 'auto': a firm zero-slippage quote when a firm venue covers the pair, transparent fallback to the market aggregator otherwise. 'firm': never price on the market route; an uncovered pair fails with a typed error instead of silently substituting market pricing — previews included: a preview the firm provider's live price levels cannot price returns the same typed error rather than market numbers. 'market': never route through the firm venue; the swap is priced by the aggregator and bounded by `slippage` (which firm fills ignore). 'firm' is incompatible with gas_sponsorship (sponsored swaps force market routing).
|
|
36
36
|
*/
|
|
37
37
|
export type CreditSwapRequestPricing = ClosedEnum<typeof CreditSwapRequestPricing>;
|
|
38
38
|
/**
|
|
@@ -76,7 +76,11 @@ export type CreditSwapRequest = {
|
|
|
76
76
|
*/
|
|
77
77
|
gasSponsorship?: boolean | undefined;
|
|
78
78
|
/**
|
|
79
|
-
*
|
|
79
|
+
* If true, build a display ESTIMATE: no firm RFQ quote is ever requested (quote_expires_at stays null). NOTE that this guarantees only that no firm quote was spent — it does not guarantee an absent payload: under 'auto' when the firm provider does not cover or cannot currently price the pair, and always under pricing=market, the call falls through to the aggregator and returns a signable market build (an unsigned transaction, or EIP-712 typed data when gas_sponsorship=true), without requiring the account to hold token_in yet. How the estimate is priced follows `pricing`: on a firm-covered pair whose size the firm provider's live price levels can serve, 'auto' and 'firm' price it from those levels (indicative, transaction stays null — re-call with preview=false for the signable build); otherwise it comes from the market build above (pricing='firm' instead refuses with a typed error). Set it on every call made while a user is exploring parameters, and leave it false only for the build they actually intend to sign — firm quotes are single-use maker commitments, and requesting them for displays that are never executed degrades the pricing this API is offered.
|
|
80
|
+
*/
|
|
81
|
+
preview?: boolean | undefined;
|
|
82
|
+
/**
|
|
83
|
+
* Swap routing policy. 'auto': a firm zero-slippage quote when a firm venue covers the pair, transparent fallback to the market aggregator otherwise. 'firm': never price on the market route; an uncovered pair fails with a typed error instead of silently substituting market pricing — previews included: a preview the firm provider's live price levels cannot price returns the same typed error rather than market numbers. 'market': never route through the firm venue; the swap is priced by the aggregator and bounded by `slippage` (which firm fills ignore). 'firm' is incompatible with gas_sponsorship (sponsored swaps force market routing).
|
|
80
84
|
*/
|
|
81
85
|
pricing?: CreditSwapRequestPricing | undefined;
|
|
82
86
|
};
|
|
@@ -104,6 +108,7 @@ export type CreditSwapRequest$Outbound = {
|
|
|
104
108
|
owner: string;
|
|
105
109
|
chain: string;
|
|
106
110
|
gas_sponsorship?: boolean | undefined;
|
|
111
|
+
preview?: boolean | undefined;
|
|
107
112
|
pricing?: string | undefined;
|
|
108
113
|
};
|
|
109
114
|
/** @internal */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"creditswaprequest.d.ts","sourceRoot":"","sources":["../../../../src/models/components/creditswaprequest.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,MAAM,GAAG,MAAM,CAAC;AAExD;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,MAAM,GA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AE,CAAC,CAAC,OAAO,CAC9D,kCAAkC,EAClC,CAAC,CAAC,UAAU,EACZ,yBAAyB,CACU,CAAC;AAEtC,wBAAgB,+BAA+B,CAC7C,yBAAyB,EAAE,yBAAyB,GACnD,MAAM,CAIR;AAED,gBAAgB;AAChB,eAAO,MAAM,qCAAqC,EAAE,CAAC,CAAC,aAAa,CACjE,OAAO,sBAAsB,CACS,CAAC;AAEzC,gBAAgB;AAChB,eAAO,MAAM,uCAAuC,EAAE,CAAC,CAAC,aAAa,CACnE,OAAO,wBAAwB,CACS,CAAC;AAE3C,gBAAgB;AAChB,MAAM,MAAM,0BAA0B,GAAG;IACvC,WAAW,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACtC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,gCAAgC,EAAE,CAAC,CAAC,OAAO,CACtD,0BAA0B,EAC1B,CAAC,CAAC,UAAU,EACZ,iBAAiB,
|
|
1
|
+
{"version":3,"file":"creditswaprequest.d.ts","sourceRoot":"","sources":["../../../../src/models/components/creditswaprequest.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,MAAM,GAAG,MAAM,CAAC;AAExD;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,MAAM,GAAG,MAAM,CAAC;AAEx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EjE,gBAAgB;AAChB,eAAO,MAAM,wCAAwC,EAAE,CAAC,CAAC,OAAO,CAC9D,kCAAkC,EAClC,CAAC,CAAC,UAAU,EACZ,yBAAyB,CACU,CAAC;AAEtC,wBAAgB,+BAA+B,CAC7C,yBAAyB,EAAE,yBAAyB,GACnD,MAAM,CAIR;AAED,gBAAgB;AAChB,eAAO,MAAM,qCAAqC,EAAE,CAAC,CAAC,aAAa,CACjE,OAAO,sBAAsB,CACS,CAAC;AAEzC,gBAAgB;AAChB,eAAO,MAAM,uCAAuC,EAAE,CAAC,CAAC,aAAa,CACnE,OAAO,wBAAwB,CACS,CAAC;AAE3C,gBAAgB;AAChB,MAAM,MAAM,0BAA0B,GAAG;IACvC,WAAW,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACtC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,gCAAgC,EAAE,CAAC,CAAC,OAAO,CACtD,0BAA0B,EAC1B,CAAC,CAAC,UAAU,EACZ,iBAAiB,CAoBjB,CAAC;AAEH,wBAAgB,uBAAuB,CACrC,iBAAiB,EAAE,iBAAiB,GACnC,MAAM,CAIR"}
|
|
@@ -54,7 +54,7 @@ exports.CreditSwapRequestChain = {
|
|
|
54
54
|
Tempo: "tempo",
|
|
55
55
|
};
|
|
56
56
|
/**
|
|
57
|
-
* Swap routing policy. 'auto': a firm zero-slippage quote when a firm venue covers the pair, transparent fallback to the market aggregator otherwise. 'firm': never price on the market route; an uncovered pair fails with a typed error instead of silently substituting market pricing. 'market': never route through the firm venue; the swap is priced by the aggregator and bounded by `slippage` (which firm fills ignore). 'firm' is incompatible with gas_sponsorship (sponsored swaps force market routing).
|
|
57
|
+
* Swap routing policy. 'auto': a firm zero-slippage quote when a firm venue covers the pair, transparent fallback to the market aggregator otherwise. 'firm': never price on the market route; an uncovered pair fails with a typed error instead of silently substituting market pricing — previews included: a preview the firm provider's live price levels cannot price returns the same typed error rather than market numbers. 'market': never route through the firm venue; the swap is priced by the aggregator and bounded by `slippage` (which firm fills ignore). 'firm' is incompatible with gas_sponsorship (sponsored swaps force market routing).
|
|
58
58
|
*/
|
|
59
59
|
exports.CreditSwapRequestPricing = {
|
|
60
60
|
Auto: "auto",
|
|
@@ -85,6 +85,7 @@ exports.CreditSwapRequest$outboundSchema = z.object({
|
|
|
85
85
|
owner: z.string(),
|
|
86
86
|
chain: exports.CreditSwapRequestChain$outboundSchema,
|
|
87
87
|
gasSponsorship: z.boolean().optional(),
|
|
88
|
+
preview: z.boolean().optional(),
|
|
88
89
|
pricing: exports.CreditSwapRequestPricing$outboundSchema.optional(),
|
|
89
90
|
}).transform((v) => {
|
|
90
91
|
return (0, primitives_js_1.remap)(v, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"creditswaprequest.js","sourceRoot":"","sources":["../../../../src/models/components/creditswaprequest.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"creditswaprequest.js","sourceRoot":"","sources":["../../../../src/models/components/creditswaprequest.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2GH,0EAMC;AAYD,0EAMC;AAoDD,0DAMC;AA3LD,0CAA4B;AAC5B,2DAA0D;AAa1D;;GAEG;AACU,QAAA,sBAAsB,GAAG;IACp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,MAAM,EAAE;IACpB,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IAC3C,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE;IACtD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,KAAK,EAAE,6CAAqC;IAC5C,cAAc,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACtC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC/B,OAAO,EAAE,+CAAuC,CAAC,QAAQ,EAAE;CAC5D,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,IAAA,qBAAM,EAAC,CAAC,EAAE;QACf,UAAU,EAAE,aAAa;QACzB,OAAO,EAAE,UAAU;QACnB,QAAQ,EAAE,WAAW;QACrB,QAAQ,EAAE,WAAW;QACrB,cAAc,EAAE,iBAAiB;KAClC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,SAAgB,uBAAuB,CACrC,iBAAoC;IAEpC,OAAO,IAAI,CAAC,SAAS,CACnB,wCAAgC,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAC1D,CAAC;AACJ,CAAC"}
|
|
@@ -5,14 +5,14 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
|
5
5
|
import { BatchedSafeOperationsResponseOutput } from "./batchedsafeoperationsresponseoutput.js";
|
|
6
6
|
import { UnsignedTransaction } from "./unsignedtransaction.js";
|
|
7
7
|
/**
|
|
8
|
-
* Identifies which route priced the swap. 'market': a DEX aggregator, slippage-bounded. 'firm': a zero-slippage quote that fills exactly or reverts. Always present. This is the authoritative firm-vs-market signal and clients do need to read it: `pricing` is only what was REQUESTED, and under 'auto' a firm build can fall back to market transparently.
|
|
8
|
+
* Identifies which route priced the swap. 'market': a DEX aggregator, slippage-bounded. 'firm': a zero-slippage quote that fills exactly or reverts. On preview=true responses 'firm' means the estimate is INDICATIVE, computed from live maker price levels without spending any quote; execution fetches the firm quote at signing time. Always present. This is the authoritative firm-vs-market signal and clients do need to read it: `pricing` is only what was REQUESTED, and under 'auto' a firm build can fall back to market transparently.
|
|
9
9
|
*/
|
|
10
10
|
export declare const CreditSwapResponseSwapProvider: {
|
|
11
11
|
readonly Market: "market";
|
|
12
12
|
readonly Firm: "firm";
|
|
13
13
|
};
|
|
14
14
|
/**
|
|
15
|
-
* Identifies which route priced the swap. 'market': a DEX aggregator, slippage-bounded. 'firm': a zero-slippage quote that fills exactly or reverts. Always present. This is the authoritative firm-vs-market signal and clients do need to read it: `pricing` is only what was REQUESTED, and under 'auto' a firm build can fall back to market transparently.
|
|
15
|
+
* Identifies which route priced the swap. 'market': a DEX aggregator, slippage-bounded. 'firm': a zero-slippage quote that fills exactly or reverts. On preview=true responses 'firm' means the estimate is INDICATIVE, computed from live maker price levels without spending any quote; execution fetches the firm quote at signing time. Always present. This is the authoritative firm-vs-market signal and clients do need to read it: `pricing` is only what was REQUESTED, and under 'auto' a firm build can fall back to market transparently.
|
|
16
16
|
*/
|
|
17
17
|
export type CreditSwapResponseSwapProvider = ClosedEnum<typeof CreditSwapResponseSwapProvider>;
|
|
18
18
|
/**
|
|
@@ -23,7 +23,7 @@ export type CreditSwapResponseSwapProvider = ClosedEnum<typeof CreditSwapRespons
|
|
|
23
23
|
*/
|
|
24
24
|
export type CreditSwapResponse = {
|
|
25
25
|
/**
|
|
26
|
-
* Unsigned transaction for direct execution. Present when gas_sponsorship=false.
|
|
26
|
+
* Unsigned transaction for direct execution. Present when gas_sponsorship=false — except firm-priced previews (preview=true responses reporting swap_provider='firm'), which carry the estimate only: the firm quote is fetched at execution time, so there is no payload to sign yet. A preview whose response reports swap_provider='market' does carry this signable payload.
|
|
27
27
|
*/
|
|
28
28
|
transaction?: UnsignedTransaction | null | undefined;
|
|
29
29
|
/**
|
|
@@ -31,15 +31,15 @@ export type CreditSwapResponse = {
|
|
|
31
31
|
*/
|
|
32
32
|
eip712?: BatchedSafeOperationsResponseOutput | null | undefined;
|
|
33
33
|
/**
|
|
34
|
-
* Estimated amount of output token received from the swap. Exact on firm builds (a firm quote fills at this amount or reverts). On market builds it is a quote-time estimate, and `slippage` sets how far below it the transaction's enforced minimum output sits.
|
|
34
|
+
* Estimated amount of output token received from the swap. Exact on executable firm builds (a firm quote fills at this amount or reverts). On market builds it is a quote-time estimate, and `slippage` sets how far below it the transaction's enforced minimum output sits. On preview=true responses reporting 'firm' it is INDICATIVE — computed from the firm provider's live price levels without spending a quote.
|
|
35
35
|
*/
|
|
36
36
|
estimatedAmountOut: string;
|
|
37
37
|
/**
|
|
38
|
-
* Identifies which route priced the swap. 'market': a DEX aggregator, slippage-bounded. 'firm': a zero-slippage quote that fills exactly or reverts. Always present. This is the authoritative firm-vs-market signal and clients do need to read it: `pricing` is only what was REQUESTED, and under 'auto' a firm build can fall back to market transparently.
|
|
38
|
+
* Identifies which route priced the swap. 'market': a DEX aggregator, slippage-bounded. 'firm': a zero-slippage quote that fills exactly or reverts. On preview=true responses 'firm' means the estimate is INDICATIVE, computed from live maker price levels without spending any quote; execution fetches the firm quote at signing time. Always present. This is the authoritative firm-vs-market signal and clients do need to read it: `pricing` is only what was REQUESTED, and under 'auto' a firm build can fall back to market transparently.
|
|
39
39
|
*/
|
|
40
40
|
swapProvider?: CreditSwapResponseSwapProvider | undefined;
|
|
41
41
|
/**
|
|
42
|
-
* Deadline of the firm swap quote. Sign and broadcast before it or the transaction reverts on-chain; refresh by re-calling this endpoint (discard the previous payload). Null on market builds.
|
|
42
|
+
* Deadline of the firm swap quote. Sign and broadcast before it or the transaction reverts on-chain; refresh by re-calling this endpoint (discard the previous payload). Null on market builds and on every preview (a preview never holds a firm quote).
|
|
43
43
|
*/
|
|
44
44
|
quoteExpiresAt?: Date | null | undefined;
|
|
45
45
|
};
|
|
@@ -44,7 +44,7 @@ const schemas_js_1 = require("../../lib/schemas.js");
|
|
|
44
44
|
const batchedsafeoperationsresponseoutput_js_1 = require("./batchedsafeoperationsresponseoutput.js");
|
|
45
45
|
const unsignedtransaction_js_1 = require("./unsignedtransaction.js");
|
|
46
46
|
/**
|
|
47
|
-
* Identifies which route priced the swap. 'market': a DEX aggregator, slippage-bounded. 'firm': a zero-slippage quote that fills exactly or reverts. Always present. This is the authoritative firm-vs-market signal and clients do need to read it: `pricing` is only what was REQUESTED, and under 'auto' a firm build can fall back to market transparently.
|
|
47
|
+
* Identifies which route priced the swap. 'market': a DEX aggregator, slippage-bounded. 'firm': a zero-slippage quote that fills exactly or reverts. On preview=true responses 'firm' means the estimate is INDICATIVE, computed from live maker price levels without spending any quote; execution fetches the firm quote at signing time. Always present. This is the authoritative firm-vs-market signal and clients do need to read it: `pricing` is only what was REQUESTED, and under 'auto' a firm build can fall back to market transparently.
|
|
48
48
|
*/
|
|
49
49
|
exports.CreditSwapResponseSwapProvider = {
|
|
50
50
|
Market: "market",
|
|
@@ -24,7 +24,7 @@ export declare const CreditSwapRequestChain: {
|
|
|
24
24
|
*/
|
|
25
25
|
export type CreditSwapRequestChain = ClosedEnum<typeof CreditSwapRequestChain>;
|
|
26
26
|
/**
|
|
27
|
-
* Swap routing policy. 'auto': a firm zero-slippage quote when a firm venue covers the pair, transparent fallback to the market aggregator otherwise. 'firm': never price on the market route; an uncovered pair fails with a typed error instead of silently substituting market pricing. 'market': never route through the firm venue; the swap is priced by the aggregator and bounded by `slippage` (which firm fills ignore). 'firm' is incompatible with gas_sponsorship (sponsored swaps force market routing).
|
|
27
|
+
* Swap routing policy. 'auto': a firm zero-slippage quote when a firm venue covers the pair, transparent fallback to the market aggregator otherwise. 'firm': never price on the market route; an uncovered pair fails with a typed error instead of silently substituting market pricing — previews included: a preview the firm provider's live price levels cannot price returns the same typed error rather than market numbers. 'market': never route through the firm venue; the swap is priced by the aggregator and bounded by `slippage` (which firm fills ignore). 'firm' is incompatible with gas_sponsorship (sponsored swaps force market routing).
|
|
28
28
|
*/
|
|
29
29
|
export declare const CreditSwapRequestPricing: {
|
|
30
30
|
readonly Auto: "auto";
|
|
@@ -32,7 +32,7 @@ export declare const CreditSwapRequestPricing: {
|
|
|
32
32
|
readonly Market: "market";
|
|
33
33
|
};
|
|
34
34
|
/**
|
|
35
|
-
* Swap routing policy. 'auto': a firm zero-slippage quote when a firm venue covers the pair, transparent fallback to the market aggregator otherwise. 'firm': never price on the market route; an uncovered pair fails with a typed error instead of silently substituting market pricing. 'market': never route through the firm venue; the swap is priced by the aggregator and bounded by `slippage` (which firm fills ignore). 'firm' is incompatible with gas_sponsorship (sponsored swaps force market routing).
|
|
35
|
+
* Swap routing policy. 'auto': a firm zero-slippage quote when a firm venue covers the pair, transparent fallback to the market aggregator otherwise. 'firm': never price on the market route; an uncovered pair fails with a typed error instead of silently substituting market pricing — previews included: a preview the firm provider's live price levels cannot price returns the same typed error rather than market numbers. 'market': never route through the firm venue; the swap is priced by the aggregator and bounded by `slippage` (which firm fills ignore). 'firm' is incompatible with gas_sponsorship (sponsored swaps force market routing).
|
|
36
36
|
*/
|
|
37
37
|
export type CreditSwapRequestPricing = ClosedEnum<typeof CreditSwapRequestPricing>;
|
|
38
38
|
/**
|
|
@@ -76,7 +76,11 @@ export type CreditSwapRequest = {
|
|
|
76
76
|
*/
|
|
77
77
|
gasSponsorship?: boolean | undefined;
|
|
78
78
|
/**
|
|
79
|
-
*
|
|
79
|
+
* If true, build a display ESTIMATE: no firm RFQ quote is ever requested (quote_expires_at stays null). NOTE that this guarantees only that no firm quote was spent — it does not guarantee an absent payload: under 'auto' when the firm provider does not cover or cannot currently price the pair, and always under pricing=market, the call falls through to the aggregator and returns a signable market build (an unsigned transaction, or EIP-712 typed data when gas_sponsorship=true), without requiring the account to hold token_in yet. How the estimate is priced follows `pricing`: on a firm-covered pair whose size the firm provider's live price levels can serve, 'auto' and 'firm' price it from those levels (indicative, transaction stays null — re-call with preview=false for the signable build); otherwise it comes from the market build above (pricing='firm' instead refuses with a typed error). Set it on every call made while a user is exploring parameters, and leave it false only for the build they actually intend to sign — firm quotes are single-use maker commitments, and requesting them for displays that are never executed degrades the pricing this API is offered.
|
|
80
|
+
*/
|
|
81
|
+
preview?: boolean | undefined;
|
|
82
|
+
/**
|
|
83
|
+
* Swap routing policy. 'auto': a firm zero-slippage quote when a firm venue covers the pair, transparent fallback to the market aggregator otherwise. 'firm': never price on the market route; an uncovered pair fails with a typed error instead of silently substituting market pricing — previews included: a preview the firm provider's live price levels cannot price returns the same typed error rather than market numbers. 'market': never route through the firm venue; the swap is priced by the aggregator and bounded by `slippage` (which firm fills ignore). 'firm' is incompatible with gas_sponsorship (sponsored swaps force market routing).
|
|
80
84
|
*/
|
|
81
85
|
pricing?: CreditSwapRequestPricing | undefined;
|
|
82
86
|
};
|
|
@@ -104,6 +108,7 @@ export type CreditSwapRequest$Outbound = {
|
|
|
104
108
|
owner: string;
|
|
105
109
|
chain: string;
|
|
106
110
|
gas_sponsorship?: boolean | undefined;
|
|
111
|
+
preview?: boolean | undefined;
|
|
107
112
|
pricing?: string | undefined;
|
|
108
113
|
};
|
|
109
114
|
/** @internal */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"creditswaprequest.d.ts","sourceRoot":"","sources":["../../../../src/models/components/creditswaprequest.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,MAAM,GAAG,MAAM,CAAC;AAExD;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,MAAM,GAAG,MAAM,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;CAOzB,CAAC;AACX;;GAEG;AACH,MAAM,MAAM,sBAA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B,CAC7C,yBAAyB,EAAE,yBAAyB,GACnD,MAAM,CAIR;AAED,gBAAgB;AAChB,eAAO,MAAM,qCAAqC,EAAE,CAAC,CAAC,aAAa,CACjE,OAAO,sBAAsB,CACS,CAAC;AAEzC,gBAAgB;AAChB,eAAO,MAAM,uCAAuC,EAAE,CAAC,CAAC,aAAa,CACnE,OAAO,wBAAwB,CACS,CAAC;AAE3C,gBAAgB;AAChB,MAAM,MAAM,0BAA0B,GAAG;IACvC,WAAW,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACtC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,gCAAgC,EAAE,CAAC,CAAC,OAAO,CACtD,0BAA0B,EAC1B,CAAC,CAAC,UAAU,EACZ,iBAAiB,
|
|
1
|
+
{"version":3,"file":"creditswaprequest.d.ts","sourceRoot":"","sources":["../../../../src/models/components/creditswaprequest.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,MAAM,GAAG,MAAM,CAAC;AAExD;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,MAAM,GAAG,MAAM,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;CAOzB,CAAC;AACX;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,UAAU,CAA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,yBAAyB,CACU,CAAC;AAEtC,wBAAgB,+BAA+B,CAC7C,yBAAyB,EAAE,yBAAyB,GACnD,MAAM,CAIR;AAED,gBAAgB;AAChB,eAAO,MAAM,qCAAqC,EAAE,CAAC,CAAC,aAAa,CACjE,OAAO,sBAAsB,CACS,CAAC;AAEzC,gBAAgB;AAChB,eAAO,MAAM,uCAAuC,EAAE,CAAC,CAAC,aAAa,CACnE,OAAO,wBAAwB,CACS,CAAC;AAE3C,gBAAgB;AAChB,MAAM,MAAM,0BAA0B,GAAG;IACvC,WAAW,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACtC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,gCAAgC,EAAE,CAAC,CAAC,OAAO,CACtD,0BAA0B,EAC1B,CAAC,CAAC,UAAU,EACZ,iBAAiB,CAoBjB,CAAC;AAEH,wBAAgB,uBAAuB,CACrC,iBAAiB,EAAE,iBAAiB,GACnC,MAAM,CAIR"}
|
|
@@ -15,7 +15,7 @@ export const CreditSwapRequestChain = {
|
|
|
15
15
|
Tempo: "tempo",
|
|
16
16
|
};
|
|
17
17
|
/**
|
|
18
|
-
* Swap routing policy. 'auto': a firm zero-slippage quote when a firm venue covers the pair, transparent fallback to the market aggregator otherwise. 'firm': never price on the market route; an uncovered pair fails with a typed error instead of silently substituting market pricing. 'market': never route through the firm venue; the swap is priced by the aggregator and bounded by `slippage` (which firm fills ignore). 'firm' is incompatible with gas_sponsorship (sponsored swaps force market routing).
|
|
18
|
+
* Swap routing policy. 'auto': a firm zero-slippage quote when a firm venue covers the pair, transparent fallback to the market aggregator otherwise. 'firm': never price on the market route; an uncovered pair fails with a typed error instead of silently substituting market pricing — previews included: a preview the firm provider's live price levels cannot price returns the same typed error rather than market numbers. 'market': never route through the firm venue; the swap is priced by the aggregator and bounded by `slippage` (which firm fills ignore). 'firm' is incompatible with gas_sponsorship (sponsored swaps force market routing).
|
|
19
19
|
*/
|
|
20
20
|
export const CreditSwapRequestPricing = {
|
|
21
21
|
Auto: "auto",
|
|
@@ -46,6 +46,7 @@ export const CreditSwapRequest$outboundSchema = z.object({
|
|
|
46
46
|
owner: z.string(),
|
|
47
47
|
chain: CreditSwapRequestChain$outboundSchema,
|
|
48
48
|
gasSponsorship: z.boolean().optional(),
|
|
49
|
+
preview: z.boolean().optional(),
|
|
49
50
|
pricing: CreditSwapRequestPricing$outboundSchema.optional(),
|
|
50
51
|
}).transform((v) => {
|
|
51
52
|
return remap$(v, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"creditswaprequest.js","sourceRoot":"","sources":["../../../../src/models/components/creditswaprequest.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAa1D;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,QAAQ,EAAE,UAAU;IACpB,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,KAAK;IACV,QAAQ,EAAE,UAAU;IACpB,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,OAAO;CACN,CAAC;AAMX;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ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,iBAAiB,CAAC,CAC1D,CAAC;AACJ,CAAC"}
|
|
@@ -5,14 +5,14 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
|
5
5
|
import { BatchedSafeOperationsResponseOutput } from "./batchedsafeoperationsresponseoutput.js";
|
|
6
6
|
import { UnsignedTransaction } from "./unsignedtransaction.js";
|
|
7
7
|
/**
|
|
8
|
-
* Identifies which route priced the swap. 'market': a DEX aggregator, slippage-bounded. 'firm': a zero-slippage quote that fills exactly or reverts. Always present. This is the authoritative firm-vs-market signal and clients do need to read it: `pricing` is only what was REQUESTED, and under 'auto' a firm build can fall back to market transparently.
|
|
8
|
+
* Identifies which route priced the swap. 'market': a DEX aggregator, slippage-bounded. 'firm': a zero-slippage quote that fills exactly or reverts. On preview=true responses 'firm' means the estimate is INDICATIVE, computed from live maker price levels without spending any quote; execution fetches the firm quote at signing time. Always present. This is the authoritative firm-vs-market signal and clients do need to read it: `pricing` is only what was REQUESTED, and under 'auto' a firm build can fall back to market transparently.
|
|
9
9
|
*/
|
|
10
10
|
export declare const CreditSwapResponseSwapProvider: {
|
|
11
11
|
readonly Market: "market";
|
|
12
12
|
readonly Firm: "firm";
|
|
13
13
|
};
|
|
14
14
|
/**
|
|
15
|
-
* Identifies which route priced the swap. 'market': a DEX aggregator, slippage-bounded. 'firm': a zero-slippage quote that fills exactly or reverts. Always present. This is the authoritative firm-vs-market signal and clients do need to read it: `pricing` is only what was REQUESTED, and under 'auto' a firm build can fall back to market transparently.
|
|
15
|
+
* Identifies which route priced the swap. 'market': a DEX aggregator, slippage-bounded. 'firm': a zero-slippage quote that fills exactly or reverts. On preview=true responses 'firm' means the estimate is INDICATIVE, computed from live maker price levels without spending any quote; execution fetches the firm quote at signing time. Always present. This is the authoritative firm-vs-market signal and clients do need to read it: `pricing` is only what was REQUESTED, and under 'auto' a firm build can fall back to market transparently.
|
|
16
16
|
*/
|
|
17
17
|
export type CreditSwapResponseSwapProvider = ClosedEnum<typeof CreditSwapResponseSwapProvider>;
|
|
18
18
|
/**
|
|
@@ -23,7 +23,7 @@ export type CreditSwapResponseSwapProvider = ClosedEnum<typeof CreditSwapRespons
|
|
|
23
23
|
*/
|
|
24
24
|
export type CreditSwapResponse = {
|
|
25
25
|
/**
|
|
26
|
-
* Unsigned transaction for direct execution. Present when gas_sponsorship=false.
|
|
26
|
+
* Unsigned transaction for direct execution. Present when gas_sponsorship=false — except firm-priced previews (preview=true responses reporting swap_provider='firm'), which carry the estimate only: the firm quote is fetched at execution time, so there is no payload to sign yet. A preview whose response reports swap_provider='market' does carry this signable payload.
|
|
27
27
|
*/
|
|
28
28
|
transaction?: UnsignedTransaction | null | undefined;
|
|
29
29
|
/**
|
|
@@ -31,15 +31,15 @@ export type CreditSwapResponse = {
|
|
|
31
31
|
*/
|
|
32
32
|
eip712?: BatchedSafeOperationsResponseOutput | null | undefined;
|
|
33
33
|
/**
|
|
34
|
-
* Estimated amount of output token received from the swap. Exact on firm builds (a firm quote fills at this amount or reverts). On market builds it is a quote-time estimate, and `slippage` sets how far below it the transaction's enforced minimum output sits.
|
|
34
|
+
* Estimated amount of output token received from the swap. Exact on executable firm builds (a firm quote fills at this amount or reverts). On market builds it is a quote-time estimate, and `slippage` sets how far below it the transaction's enforced minimum output sits. On preview=true responses reporting 'firm' it is INDICATIVE — computed from the firm provider's live price levels without spending a quote.
|
|
35
35
|
*/
|
|
36
36
|
estimatedAmountOut: string;
|
|
37
37
|
/**
|
|
38
|
-
* Identifies which route priced the swap. 'market': a DEX aggregator, slippage-bounded. 'firm': a zero-slippage quote that fills exactly or reverts. Always present. This is the authoritative firm-vs-market signal and clients do need to read it: `pricing` is only what was REQUESTED, and under 'auto' a firm build can fall back to market transparently.
|
|
38
|
+
* Identifies which route priced the swap. 'market': a DEX aggregator, slippage-bounded. 'firm': a zero-slippage quote that fills exactly or reverts. On preview=true responses 'firm' means the estimate is INDICATIVE, computed from live maker price levels without spending any quote; execution fetches the firm quote at signing time. Always present. This is the authoritative firm-vs-market signal and clients do need to read it: `pricing` is only what was REQUESTED, and under 'auto' a firm build can fall back to market transparently.
|
|
39
39
|
*/
|
|
40
40
|
swapProvider?: CreditSwapResponseSwapProvider | undefined;
|
|
41
41
|
/**
|
|
42
|
-
* Deadline of the firm swap quote. Sign and broadcast before it or the transaction reverts on-chain; refresh by re-calling this endpoint (discard the previous payload). Null on market builds.
|
|
42
|
+
* Deadline of the firm swap quote. Sign and broadcast before it or the transaction reverts on-chain; refresh by re-calling this endpoint (discard the previous payload). Null on market builds and on every preview (a preview never holds a firm quote).
|
|
43
43
|
*/
|
|
44
44
|
quoteExpiresAt?: Date | null | undefined;
|
|
45
45
|
};
|
|
@@ -7,7 +7,7 @@ import { safeParse } from "../../lib/schemas.js";
|
|
|
7
7
|
import { BatchedSafeOperationsResponseOutput$inboundSchema, } from "./batchedsafeoperationsresponseoutput.js";
|
|
8
8
|
import { UnsignedTransaction$inboundSchema, } from "./unsignedtransaction.js";
|
|
9
9
|
/**
|
|
10
|
-
* Identifies which route priced the swap. 'market': a DEX aggregator, slippage-bounded. 'firm': a zero-slippage quote that fills exactly or reverts. Always present. This is the authoritative firm-vs-market signal and clients do need to read it: `pricing` is only what was REQUESTED, and under 'auto' a firm build can fall back to market transparently.
|
|
10
|
+
* Identifies which route priced the swap. 'market': a DEX aggregator, slippage-bounded. 'firm': a zero-slippage quote that fills exactly or reverts. On preview=true responses 'firm' means the estimate is INDICATIVE, computed from live maker price levels without spending any quote; execution fetches the firm quote at signing time. Always present. This is the authoritative firm-vs-market signal and clients do need to read it: `pricing` is only what was REQUESTED, and under 'auto' a firm build can fall back to market transparently.
|
|
11
11
|
*/
|
|
12
12
|
export const CreditSwapResponseSwapProvider = {
|
|
13
13
|
Market: "market",
|
|
@@ -23,14 +23,15 @@ let value: CreditSwapRequest = {
|
|
|
23
23
|
|
|
24
24
|
## Fields
|
|
25
25
|
|
|
26
|
-
| Field
|
|
27
|
-
|
|
|
28
|
-
| `actionType`
|
|
29
|
-
| `tokenIn`
|
|
30
|
-
| `tokenOut`
|
|
31
|
-
| `amountIn`
|
|
32
|
-
| `slippage`
|
|
33
|
-
| `owner`
|
|
34
|
-
| `chain`
|
|
35
|
-
| `gasSponsorship`
|
|
36
|
-
| `
|
|
26
|
+
| Field | Type | Required | Description | Example |
|
|
27
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
28
|
+
| `actionType` | *"V2_SWAP"* | :heavy_minus_sign: | Action type identifier for swap operations. | V2_SWAP |
|
|
29
|
+
| `tokenIn` | *string* | :heavy_check_mark: | Token to sell (input). Provide a token symbol from a limited set (e.g., 'USDC') or any token address. | USDC |
|
|
30
|
+
| `tokenOut` | *string* | :heavy_check_mark: | Token to buy (output). Provide a token symbol from a limited set (e.g., 'USDT') or any token address. | USDT |
|
|
31
|
+
| `amountIn` | *components.CreditSwapRequestAmountIn* | :heavy_check_mark: | Human-readable amount of `token_in` to swap (token units, not wei). | 0.01 |
|
|
32
|
+
| `slippage` | *components.CreditSwapRequestSlippage* | :heavy_minus_sign: | Maximum slippage tolerance as a percentage (e.g., 0.5 = 0.5%). Bounds the market route only; a firm quote fills exactly and ignores it. | 0.5 |
|
|
33
|
+
| `owner` | *string* | :heavy_check_mark: | The owner's wallet address. Their Credit Account must already exist (create it with `/v2/credit/create_account`) and hold `token_in` (deposit with `/v2/credit/transfer`). | 0x06A9aF046187895AcFc7258450B15397CAc67400 |
|
|
34
|
+
| `chain` | [components.CreditSwapRequestChain](../../models/components/creditswaprequestchain.md) | :heavy_check_mark: | Target blockchain network where the swap will execute. | base |
|
|
35
|
+
| `gasSponsorship` | *boolean* | :heavy_minus_sign: | Optionally request gas sponsorship. If `true`, EIP-712 typed data will be returned that must be signed by the `owner` and submitted to the 'Prepare gas-sponsored transaction' endpoint (`/gas_sponsorship/prepare`). Gas-sponsored builds always execute at market rate. | false |
|
|
36
|
+
| `preview` | *boolean* | :heavy_minus_sign: | If true, build a display ESTIMATE: no firm RFQ quote is ever requested (quote_expires_at stays null). NOTE that this guarantees only that no firm quote was spent — it does not guarantee an absent payload: under 'auto' when the firm provider does not cover or cannot currently price the pair, and always under pricing=market, the call falls through to the aggregator and returns a signable market build (an unsigned transaction, or EIP-712 typed data when gas_sponsorship=true), without requiring the account to hold token_in yet. How the estimate is priced follows `pricing`: on a firm-covered pair whose size the firm provider's live price levels can serve, 'auto' and 'firm' price it from those levels (indicative, transaction stays null — re-call with preview=false for the signable build); otherwise it comes from the market build above (pricing='firm' instead refuses with a typed error). Set it on every call made while a user is exploring parameters, and leave it false only for the build they actually intend to sign — firm quotes are single-use maker commitments, and requesting them for displays that are never executed degrades the pricing this API is offered. | false |
|
|
37
|
+
| `pricing` | [components.CreditSwapRequestPricing](../../models/components/creditswaprequestpricing.md) | :heavy_minus_sign: | Swap routing policy. 'auto': a firm zero-slippage quote when a firm venue covers the pair, transparent fallback to the market aggregator otherwise. 'firm': never price on the market route; an uncovered pair fails with a typed error instead of silently substituting market pricing — previews included: a preview the firm provider's live price levels cannot price returns the same typed error rather than market numbers. 'market': never route through the firm venue; the swap is priced by the aggregator and bounded by `slippage` (which firm fills ignore). 'firm' is incompatible with gas_sponsorship (sponsored swaps force market routing). | auto |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# CreditSwapRequestPricing
|
|
2
2
|
|
|
3
|
-
Swap routing policy. 'auto': a firm zero-slippage quote when a firm venue covers the pair, transparent fallback to the market aggregator otherwise. 'firm': never price on the market route; an uncovered pair fails with a typed error instead of silently substituting market pricing. 'market': never route through the firm venue; the swap is priced by the aggregator and bounded by `slippage` (which firm fills ignore). 'firm' is incompatible with gas_sponsorship (sponsored swaps force market routing).
|
|
3
|
+
Swap routing policy. 'auto': a firm zero-slippage quote when a firm venue covers the pair, transparent fallback to the market aggregator otherwise. 'firm': never price on the market route; an uncovered pair fails with a typed error instead of silently substituting market pricing — previews included: a preview the firm provider's live price levels cannot price returns the same typed error rather than market numbers. 'market': never route through the firm venue; the swap is priced by the aggregator and bounded by `slippage` (which firm fills ignore). 'firm' is incompatible with gas_sponsorship (sponsored swaps force market routing).
|
|
4
4
|
|
|
5
5
|
## Example Usage
|
|
6
6
|
|
|
@@ -16,10 +16,10 @@ let value: CreditSwapResponse = {
|
|
|
16
16
|
|
|
17
17
|
## Fields
|
|
18
18
|
|
|
19
|
-
| Field
|
|
20
|
-
|
|
|
21
|
-
| `transaction`
|
|
22
|
-
| `eip712`
|
|
23
|
-
| `estimatedAmountOut`
|
|
24
|
-
| `swapProvider`
|
|
25
|
-
| `quoteExpiresAt`
|
|
19
|
+
| Field | Type | Required | Description | Example |
|
|
20
|
+
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
21
|
+
| `transaction` | [components.UnsignedTransaction](../../models/components/unsignedtransaction.md) | :heavy_minus_sign: | Unsigned transaction for direct execution. Present when gas_sponsorship=false — except firm-priced previews (preview=true responses reporting swap_provider='firm'), which carry the estimate only: the firm quote is fetched at execution time, so there is no payload to sign yet. A preview whose response reports swap_provider='market' does carry this signable payload. | |
|
|
22
|
+
| `eip712` | [components.BatchedSafeOperationsResponseOutput](../../models/components/batchedsafeoperationsresponseoutput.md) | :heavy_minus_sign: | EIP-712 typed data for gas-sponsored execution. Present when gas_sponsorship=true. | |
|
|
23
|
+
| `estimatedAmountOut` | *string* | :heavy_check_mark: | Estimated amount of output token received from the swap. Exact on executable firm builds (a firm quote fills at this amount or reverts). On market builds it is a quote-time estimate, and `slippage` sets how far below it the transaction's enforced minimum output sits. On preview=true responses reporting 'firm' it is INDICATIVE — computed from the firm provider's live price levels without spending a quote. | |
|
|
24
|
+
| `swapProvider` | [components.CreditSwapResponseSwapProvider](../../models/components/creditswapresponseswapprovider.md) | :heavy_minus_sign: | Identifies which route priced the swap. 'market': a DEX aggregator, slippage-bounded. 'firm': a zero-slippage quote that fills exactly or reverts. On preview=true responses 'firm' means the estimate is INDICATIVE, computed from live maker price levels without spending any quote; execution fetches the firm quote at signing time. Always present. This is the authoritative firm-vs-market signal and clients do need to read it: `pricing` is only what was REQUESTED, and under 'auto' a firm build can fall back to market transparently. | market |
|
|
25
|
+
| `quoteExpiresAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | Deadline of the firm swap quote. Sign and broadcast before it or the transaction reverts on-chain; refresh by re-calling this endpoint (discard the previous payload). Null on market builds and on every preview (a preview never holds a firm quote). | |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# CreditSwapResponseSwapProvider
|
|
2
2
|
|
|
3
|
-
Identifies which route priced the swap. 'market': a DEX aggregator, slippage-bounded. 'firm': a zero-slippage quote that fills exactly or reverts. Always present. This is the authoritative firm-vs-market signal and clients do need to read it: `pricing` is only what was REQUESTED, and under 'auto' a firm build can fall back to market transparently.
|
|
3
|
+
Identifies which route priced the swap. 'market': a DEX aggregator, slippage-bounded. 'firm': a zero-slippage quote that fills exactly or reverts. On preview=true responses 'firm' means the estimate is INDICATIVE, computed from live maker price levels without spending any quote; execution fetches the firm quote at signing time. Always present. This is the authoritative firm-vs-market signal and clients do need to read it: `pricing` is only what was REQUESTED, and under 'auto' a firm build can fall back to market transparently.
|
|
4
4
|
|
|
5
5
|
## Example Usage
|
|
6
6
|
|
|
@@ -14041,6 +14041,12 @@
|
|
|
14041
14041
|
"description": "Optionally request gas sponsorship. If `true`, EIP-712 typed data will be returned that must be signed by the `owner` and submitted to the 'Prepare gas-sponsored transaction' endpoint (`/gas_sponsorship/prepare`). Gas-sponsored builds always execute at market rate.",
|
|
14042
14042
|
"example": false
|
|
14043
14043
|
},
|
|
14044
|
+
"preview": {
|
|
14045
|
+
"type": "boolean",
|
|
14046
|
+
"title": "Preview",
|
|
14047
|
+
"description": "If true, build a display ESTIMATE: no firm RFQ quote is ever requested (quote_expires_at stays null). NOTE that this guarantees only that no firm quote was spent \u2014 it does not guarantee an absent payload: under 'auto' when the firm provider does not cover or cannot currently price the pair, and always under pricing=market, the call falls through to the aggregator and returns a signable market build (an unsigned transaction, or EIP-712 typed data when gas_sponsorship=true), without requiring the account to hold token_in yet. How the estimate is priced follows `pricing`: on a firm-covered pair whose size the firm provider's live price levels can serve, 'auto' and 'firm' price it from those levels (indicative, transaction stays null \u2014 re-call with preview=false for the signable build); otherwise it comes from the market build above (pricing='firm' instead refuses with a typed error). Set it on every call made while a user is exploring parameters, and leave it false only for the build they actually intend to sign \u2014 firm quotes are single-use maker commitments, and requesting them for displays that are never executed degrades the pricing this API is offered.",
|
|
14048
|
+
"example": false
|
|
14049
|
+
},
|
|
14044
14050
|
"pricing": {
|
|
14045
14051
|
"type": "string",
|
|
14046
14052
|
"enum": [
|
|
@@ -14049,7 +14055,7 @@
|
|
|
14049
14055
|
"market"
|
|
14050
14056
|
],
|
|
14051
14057
|
"title": "Pricing",
|
|
14052
|
-
"description": "Swap routing policy. 'auto': a firm zero-slippage quote when a firm venue covers the pair, transparent fallback to the market aggregator otherwise. 'firm': never price on the market route; an uncovered pair fails with a typed error instead of silently substituting market pricing. 'market': never route through the firm venue; the swap is priced by the aggregator and bounded by `slippage` (which firm fills ignore). 'firm' is incompatible with gas_sponsorship (sponsored swaps force market routing).",
|
|
14058
|
+
"description": "Swap routing policy. 'auto': a firm zero-slippage quote when a firm venue covers the pair, transparent fallback to the market aggregator otherwise. 'firm': never price on the market route; an uncovered pair fails with a typed error instead of silently substituting market pricing \u2014 previews included: a preview the firm provider's live price levels cannot price returns the same typed error rather than market numbers. 'market': never route through the firm venue; the swap is priced by the aggregator and bounded by `slippage` (which firm fills ignore). 'firm' is incompatible with gas_sponsorship (sponsored swaps force market routing).",
|
|
14053
14059
|
"example": "auto"
|
|
14054
14060
|
}
|
|
14055
14061
|
},
|
|
@@ -14085,7 +14091,7 @@
|
|
|
14085
14091
|
"type": "null"
|
|
14086
14092
|
}
|
|
14087
14093
|
],
|
|
14088
|
-
"description": "Unsigned transaction for direct execution. Present when gas_sponsorship=false."
|
|
14094
|
+
"description": "Unsigned transaction for direct execution. Present when gas_sponsorship=false \u2014 except firm-priced previews (preview=true responses reporting swap_provider='firm'), which carry the estimate only: the firm quote is fetched at execution time, so there is no payload to sign yet. A preview whose response reports swap_provider='market' does carry this signable payload."
|
|
14089
14095
|
},
|
|
14090
14096
|
"eip_712": {
|
|
14091
14097
|
"anyOf": [
|
|
@@ -14102,7 +14108,7 @@
|
|
|
14102
14108
|
"type": "string",
|
|
14103
14109
|
"pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
|
|
14104
14110
|
"title": "Estimated Amount Out",
|
|
14105
|
-
"description": "Estimated amount of output token received from the swap. Exact on firm builds (a firm quote fills at this amount or reverts). On market builds it is a quote-time estimate, and `slippage` sets how far below it the transaction's enforced minimum output sits."
|
|
14111
|
+
"description": "Estimated amount of output token received from the swap. Exact on executable firm builds (a firm quote fills at this amount or reverts). On market builds it is a quote-time estimate, and `slippage` sets how far below it the transaction's enforced minimum output sits. On preview=true responses reporting 'firm' it is INDICATIVE \u2014 computed from the firm provider's live price levels without spending a quote."
|
|
14106
14112
|
},
|
|
14107
14113
|
"swap_provider": {
|
|
14108
14114
|
"type": "string",
|
|
@@ -14111,7 +14117,7 @@
|
|
|
14111
14117
|
"firm"
|
|
14112
14118
|
],
|
|
14113
14119
|
"title": "Swap Provider",
|
|
14114
|
-
"description": "Identifies which route priced the swap. 'market': a DEX aggregator, slippage-bounded. 'firm': a zero-slippage quote that fills exactly or reverts. Always present. This is the authoritative firm-vs-market signal and clients do need to read it: `pricing` is only what was REQUESTED, and under 'auto' a firm build can fall back to market transparently.",
|
|
14120
|
+
"description": "Identifies which route priced the swap. 'market': a DEX aggregator, slippage-bounded. 'firm': a zero-slippage quote that fills exactly or reverts. On preview=true responses 'firm' means the estimate is INDICATIVE, computed from live maker price levels without spending any quote; execution fetches the firm quote at signing time. Always present. This is the authoritative firm-vs-market signal and clients do need to read it: `pricing` is only what was REQUESTED, and under 'auto' a firm build can fall back to market transparently.",
|
|
14115
14121
|
"example": "market"
|
|
14116
14122
|
},
|
|
14117
14123
|
"quote_expires_at": {
|
|
@@ -14125,7 +14131,7 @@
|
|
|
14125
14131
|
}
|
|
14126
14132
|
],
|
|
14127
14133
|
"title": "Quote Expires At",
|
|
14128
|
-
"description": "Deadline of the firm swap quote. Sign and broadcast before it or the transaction reverts on-chain; refresh by re-calling this endpoint (discard the previous payload). Null on market builds."
|
|
14134
|
+
"description": "Deadline of the firm swap quote. Sign and broadcast before it or the transaction reverts on-chain; refresh by re-calling this endpoint (discard the previous payload). Null on market builds and on every preview (a preview never holds a firm quote)."
|
|
14129
14135
|
}
|
|
14130
14136
|
},
|
|
14131
14137
|
"type": "object",
|
package/package.json
CHANGED
|
@@ -33,7 +33,7 @@ export const CreditSwapRequestChain = {
|
|
|
33
33
|
export type CreditSwapRequestChain = ClosedEnum<typeof CreditSwapRequestChain>;
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
|
-
* Swap routing policy. 'auto': a firm zero-slippage quote when a firm venue covers the pair, transparent fallback to the market aggregator otherwise. 'firm': never price on the market route; an uncovered pair fails with a typed error instead of silently substituting market pricing. 'market': never route through the firm venue; the swap is priced by the aggregator and bounded by `slippage` (which firm fills ignore). 'firm' is incompatible with gas_sponsorship (sponsored swaps force market routing).
|
|
36
|
+
* Swap routing policy. 'auto': a firm zero-slippage quote when a firm venue covers the pair, transparent fallback to the market aggregator otherwise. 'firm': never price on the market route; an uncovered pair fails with a typed error instead of silently substituting market pricing — previews included: a preview the firm provider's live price levels cannot price returns the same typed error rather than market numbers. 'market': never route through the firm venue; the swap is priced by the aggregator and bounded by `slippage` (which firm fills ignore). 'firm' is incompatible with gas_sponsorship (sponsored swaps force market routing).
|
|
37
37
|
*/
|
|
38
38
|
export const CreditSwapRequestPricing = {
|
|
39
39
|
Auto: "auto",
|
|
@@ -41,7 +41,7 @@ export const CreditSwapRequestPricing = {
|
|
|
41
41
|
Market: "market",
|
|
42
42
|
} as const;
|
|
43
43
|
/**
|
|
44
|
-
* Swap routing policy. 'auto': a firm zero-slippage quote when a firm venue covers the pair, transparent fallback to the market aggregator otherwise. 'firm': never price on the market route; an uncovered pair fails with a typed error instead of silently substituting market pricing. 'market': never route through the firm venue; the swap is priced by the aggregator and bounded by `slippage` (which firm fills ignore). 'firm' is incompatible with gas_sponsorship (sponsored swaps force market routing).
|
|
44
|
+
* Swap routing policy. 'auto': a firm zero-slippage quote when a firm venue covers the pair, transparent fallback to the market aggregator otherwise. 'firm': never price on the market route; an uncovered pair fails with a typed error instead of silently substituting market pricing — previews included: a preview the firm provider's live price levels cannot price returns the same typed error rather than market numbers. 'market': never route through the firm venue; the swap is priced by the aggregator and bounded by `slippage` (which firm fills ignore). 'firm' is incompatible with gas_sponsorship (sponsored swaps force market routing).
|
|
45
45
|
*/
|
|
46
46
|
export type CreditSwapRequestPricing = ClosedEnum<
|
|
47
47
|
typeof CreditSwapRequestPricing
|
|
@@ -88,7 +88,11 @@ export type CreditSwapRequest = {
|
|
|
88
88
|
*/
|
|
89
89
|
gasSponsorship?: boolean | undefined;
|
|
90
90
|
/**
|
|
91
|
-
*
|
|
91
|
+
* If true, build a display ESTIMATE: no firm RFQ quote is ever requested (quote_expires_at stays null). NOTE that this guarantees only that no firm quote was spent — it does not guarantee an absent payload: under 'auto' when the firm provider does not cover or cannot currently price the pair, and always under pricing=market, the call falls through to the aggregator and returns a signable market build (an unsigned transaction, or EIP-712 typed data when gas_sponsorship=true), without requiring the account to hold token_in yet. How the estimate is priced follows `pricing`: on a firm-covered pair whose size the firm provider's live price levels can serve, 'auto' and 'firm' price it from those levels (indicative, transaction stays null — re-call with preview=false for the signable build); otherwise it comes from the market build above (pricing='firm' instead refuses with a typed error). Set it on every call made while a user is exploring parameters, and leave it false only for the build they actually intend to sign — firm quotes are single-use maker commitments, and requesting them for displays that are never executed degrades the pricing this API is offered.
|
|
92
|
+
*/
|
|
93
|
+
preview?: boolean | undefined;
|
|
94
|
+
/**
|
|
95
|
+
* Swap routing policy. 'auto': a firm zero-slippage quote when a firm venue covers the pair, transparent fallback to the market aggregator otherwise. 'firm': never price on the market route; an uncovered pair fails with a typed error instead of silently substituting market pricing — previews included: a preview the firm provider's live price levels cannot price returns the same typed error rather than market numbers. 'market': never route through the firm venue; the swap is priced by the aggregator and bounded by `slippage` (which firm fills ignore). 'firm' is incompatible with gas_sponsorship (sponsored swaps force market routing).
|
|
92
96
|
*/
|
|
93
97
|
pricing?: CreditSwapRequestPricing | undefined;
|
|
94
98
|
};
|
|
@@ -149,6 +153,7 @@ export type CreditSwapRequest$Outbound = {
|
|
|
149
153
|
owner: string;
|
|
150
154
|
chain: string;
|
|
151
155
|
gas_sponsorship?: boolean | undefined;
|
|
156
|
+
preview?: boolean | undefined;
|
|
152
157
|
pricing?: string | undefined;
|
|
153
158
|
};
|
|
154
159
|
|
|
@@ -166,6 +171,7 @@ export const CreditSwapRequest$outboundSchema: z.ZodType<
|
|
|
166
171
|
owner: z.string(),
|
|
167
172
|
chain: CreditSwapRequestChain$outboundSchema,
|
|
168
173
|
gasSponsorship: z.boolean().optional(),
|
|
174
|
+
preview: z.boolean().optional(),
|
|
169
175
|
pricing: CreditSwapRequestPricing$outboundSchema.optional(),
|
|
170
176
|
}).transform((v) => {
|
|
171
177
|
return remap$(v, {
|
|
@@ -18,14 +18,14 @@ import {
|
|
|
18
18
|
} from "./unsignedtransaction.js";
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
* Identifies which route priced the swap. 'market': a DEX aggregator, slippage-bounded. 'firm': a zero-slippage quote that fills exactly or reverts. Always present. This is the authoritative firm-vs-market signal and clients do need to read it: `pricing` is only what was REQUESTED, and under 'auto' a firm build can fall back to market transparently.
|
|
21
|
+
* Identifies which route priced the swap. 'market': a DEX aggregator, slippage-bounded. 'firm': a zero-slippage quote that fills exactly or reverts. On preview=true responses 'firm' means the estimate is INDICATIVE, computed from live maker price levels without spending any quote; execution fetches the firm quote at signing time. Always present. This is the authoritative firm-vs-market signal and clients do need to read it: `pricing` is only what was REQUESTED, and under 'auto' a firm build can fall back to market transparently.
|
|
22
22
|
*/
|
|
23
23
|
export const CreditSwapResponseSwapProvider = {
|
|
24
24
|
Market: "market",
|
|
25
25
|
Firm: "firm",
|
|
26
26
|
} as const;
|
|
27
27
|
/**
|
|
28
|
-
* Identifies which route priced the swap. 'market': a DEX aggregator, slippage-bounded. 'firm': a zero-slippage quote that fills exactly or reverts. Always present. This is the authoritative firm-vs-market signal and clients do need to read it: `pricing` is only what was REQUESTED, and under 'auto' a firm build can fall back to market transparently.
|
|
28
|
+
* Identifies which route priced the swap. 'market': a DEX aggregator, slippage-bounded. 'firm': a zero-slippage quote that fills exactly or reverts. On preview=true responses 'firm' means the estimate is INDICATIVE, computed from live maker price levels without spending any quote; execution fetches the firm quote at signing time. Always present. This is the authoritative firm-vs-market signal and clients do need to read it: `pricing` is only what was REQUESTED, and under 'auto' a firm build can fall back to market transparently.
|
|
29
29
|
*/
|
|
30
30
|
export type CreditSwapResponseSwapProvider = ClosedEnum<
|
|
31
31
|
typeof CreditSwapResponseSwapProvider
|
|
@@ -39,7 +39,7 @@ export type CreditSwapResponseSwapProvider = ClosedEnum<
|
|
|
39
39
|
*/
|
|
40
40
|
export type CreditSwapResponse = {
|
|
41
41
|
/**
|
|
42
|
-
* Unsigned transaction for direct execution. Present when gas_sponsorship=false.
|
|
42
|
+
* Unsigned transaction for direct execution. Present when gas_sponsorship=false — except firm-priced previews (preview=true responses reporting swap_provider='firm'), which carry the estimate only: the firm quote is fetched at execution time, so there is no payload to sign yet. A preview whose response reports swap_provider='market' does carry this signable payload.
|
|
43
43
|
*/
|
|
44
44
|
transaction?: UnsignedTransaction | null | undefined;
|
|
45
45
|
/**
|
|
@@ -47,15 +47,15 @@ export type CreditSwapResponse = {
|
|
|
47
47
|
*/
|
|
48
48
|
eip712?: BatchedSafeOperationsResponseOutput | null | undefined;
|
|
49
49
|
/**
|
|
50
|
-
* Estimated amount of output token received from the swap. Exact on firm builds (a firm quote fills at this amount or reverts). On market builds it is a quote-time estimate, and `slippage` sets how far below it the transaction's enforced minimum output sits.
|
|
50
|
+
* Estimated amount of output token received from the swap. Exact on executable firm builds (a firm quote fills at this amount or reverts). On market builds it is a quote-time estimate, and `slippage` sets how far below it the transaction's enforced minimum output sits. On preview=true responses reporting 'firm' it is INDICATIVE — computed from the firm provider's live price levels without spending a quote.
|
|
51
51
|
*/
|
|
52
52
|
estimatedAmountOut: string;
|
|
53
53
|
/**
|
|
54
|
-
* Identifies which route priced the swap. 'market': a DEX aggregator, slippage-bounded. 'firm': a zero-slippage quote that fills exactly or reverts. Always present. This is the authoritative firm-vs-market signal and clients do need to read it: `pricing` is only what was REQUESTED, and under 'auto' a firm build can fall back to market transparently.
|
|
54
|
+
* Identifies which route priced the swap. 'market': a DEX aggregator, slippage-bounded. 'firm': a zero-slippage quote that fills exactly or reverts. On preview=true responses 'firm' means the estimate is INDICATIVE, computed from live maker price levels without spending any quote; execution fetches the firm quote at signing time. Always present. This is the authoritative firm-vs-market signal and clients do need to read it: `pricing` is only what was REQUESTED, and under 'auto' a firm build can fall back to market transparently.
|
|
55
55
|
*/
|
|
56
56
|
swapProvider?: CreditSwapResponseSwapProvider | undefined;
|
|
57
57
|
/**
|
|
58
|
-
* Deadline of the firm swap quote. Sign and broadcast before it or the transaction reverts on-chain; refresh by re-calling this endpoint (discard the previous payload). Null on market builds.
|
|
58
|
+
* Deadline of the firm swap quote. Sign and broadcast before it or the transaction reverts on-chain; refresh by re-calling this endpoint (discard the previous payload). Null on market builds and on every preview (a preview never holds a firm quote).
|
|
59
59
|
*/
|
|
60
60
|
quoteExpiresAt?: Date | null | undefined;
|
|
61
61
|
};
|