@pafi-dev/trading 0.10.0 → 0.10.1
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 +4 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -316,6 +316,23 @@ interface ApiErc20TransferRequest {
|
|
|
316
316
|
* estimate if you have one).
|
|
317
317
|
*/
|
|
318
318
|
feeAmount?: bigint;
|
|
319
|
+
/**
|
|
320
|
+
* Opt-in fallback when Chainlink / subgraph are unavailable during
|
|
321
|
+
* auto-quote. Default `false` — fails loud with the oracle's error so
|
|
322
|
+
* production knows to alert. Set `true` AND optionally configure
|
|
323
|
+
* `fallbackPtPriceUsdt` to absorb dev/staging RPC outages.
|
|
324
|
+
*
|
|
325
|
+
* Stable tokens (USDC/USDT) only use Chainlink; PT routes through both
|
|
326
|
+
* Chainlink and the V3 pool subgraph. Fallback applies to whichever
|
|
327
|
+
* fails. See `QuoteOperatorFeeForTransferConfig.allowStaleFallback`.
|
|
328
|
+
*
|
|
329
|
+
* Only consulted when `feeAmount` is undefined (auto-quote path).
|
|
330
|
+
*/
|
|
331
|
+
allowStaleFallback?: boolean;
|
|
332
|
+
/** Fallback ETH price (USD) when Chainlink fails. Default 3000. */
|
|
333
|
+
fallbackEthPriceUsd?: number;
|
|
334
|
+
/** Fallback PT price (USDT per 1 PT) when subgraph fails. Default 0.1. */
|
|
335
|
+
fallbackPtPriceUsdt?: number;
|
|
319
336
|
}
|
|
320
337
|
interface ApiErc20TransferResponse {
|
|
321
338
|
/** Sponsored variant — 2 calls (fee transfer + actual transfer). */
|
package/dist/index.d.ts
CHANGED
|
@@ -316,6 +316,23 @@ interface ApiErc20TransferRequest {
|
|
|
316
316
|
* estimate if you have one).
|
|
317
317
|
*/
|
|
318
318
|
feeAmount?: bigint;
|
|
319
|
+
/**
|
|
320
|
+
* Opt-in fallback when Chainlink / subgraph are unavailable during
|
|
321
|
+
* auto-quote. Default `false` — fails loud with the oracle's error so
|
|
322
|
+
* production knows to alert. Set `true` AND optionally configure
|
|
323
|
+
* `fallbackPtPriceUsdt` to absorb dev/staging RPC outages.
|
|
324
|
+
*
|
|
325
|
+
* Stable tokens (USDC/USDT) only use Chainlink; PT routes through both
|
|
326
|
+
* Chainlink and the V3 pool subgraph. Fallback applies to whichever
|
|
327
|
+
* fails. See `QuoteOperatorFeeForTransferConfig.allowStaleFallback`.
|
|
328
|
+
*
|
|
329
|
+
* Only consulted when `feeAmount` is undefined (auto-quote path).
|
|
330
|
+
*/
|
|
331
|
+
allowStaleFallback?: boolean;
|
|
332
|
+
/** Fallback ETH price (USD) when Chainlink fails. Default 3000. */
|
|
333
|
+
fallbackEthPriceUsd?: number;
|
|
334
|
+
/** Fallback PT price (USDT per 1 PT) when subgraph fails. Default 0.1. */
|
|
335
|
+
fallbackPtPriceUsdt?: number;
|
|
319
336
|
}
|
|
320
337
|
interface ApiErc20TransferResponse {
|
|
321
338
|
/** Sponsored variant — 2 calls (fee transfer + actual transfer). */
|
package/dist/index.js
CHANGED
|
@@ -1182,7 +1182,10 @@ var TradingHandlers = class {
|
|
|
1182
1182
|
feeAmount = await quoteOperatorFeeForTransfer({
|
|
1183
1183
|
provider: this.provider,
|
|
1184
1184
|
chainId: request.chainId,
|
|
1185
|
-
tokenAddress
|
|
1185
|
+
tokenAddress,
|
|
1186
|
+
allowStaleFallback: request.allowStaleFallback,
|
|
1187
|
+
fallbackEthPriceUsd: request.fallbackEthPriceUsd,
|
|
1188
|
+
fallbackPtPriceUsdt: request.fallbackPtPriceUsdt
|
|
1186
1189
|
});
|
|
1187
1190
|
}
|
|
1188
1191
|
if (feeAmount > 0n && feeAmount >= request.amount) {
|