@dvmkit/sdk 0.1.0-rc.5 → 0.1.0-rc.7

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.
@@ -1,14 +1,16 @@
1
1
  import {
2
- authorizeProtectedRemoval,
3
2
  fundingReachableAt,
4
3
  info,
5
- isValidEvmPrivateKey,
6
4
  listCredits,
7
- loadConfig,
8
5
  maxAdvertisedMicro,
9
- updateConfig,
10
6
  withinAdvertisedTolerance
11
- } from "./chunk-4KB3LTOS.js";
7
+ } from "./chunk-KSQEFVFJ.js";
8
+ import {
9
+ authorizeProtectedRemoval,
10
+ isValidEvmPrivateKey,
11
+ loadConfig,
12
+ updateConfig
13
+ } from "./chunk-TSWKITGR.js";
12
14
  import {
13
15
  X402_DEFAULT_NETWORK,
14
16
  X402_V1_VERSION,
@@ -29,21 +31,23 @@ import {
29
31
  x402NetworkByCaip2,
30
32
  x402NetworkToCaip2,
31
33
  x402SupportedNetworksHint
32
- } from "./chunk-AAJNGQMC.js";
34
+ } from "./chunk-JGGI65I3.js";
33
35
  import {
34
- DvmError,
35
- X402_CHANNELS_FILE,
36
36
  costAnchor,
37
- ensureConfigDir,
38
37
  fetchBtcUsdRate,
39
38
  formatStaleness,
40
39
  formatUsd,
41
40
  getLastKnownBtcRate,
42
41
  msatsToUsdc,
43
- resolveRpcHttpTransportOptions,
44
- resolveRpcOverride,
45
42
  usdcToMsats
46
- } from "./chunk-F2L6KIMD.js";
43
+ } from "./chunk-5URG56JJ.js";
44
+ import {
45
+ DvmError,
46
+ X402_CHANNELS_FILE,
47
+ ensureConfigDir,
48
+ resolveRpcHttpTransportOptions,
49
+ resolveRpcOverride
50
+ } from "./chunk-MKI6OVW4.js";
47
51
  import {
48
52
  callerLoggers
49
53
  } from "./chunk-66HGCPBU.js";
@@ -96,6 +100,15 @@ async function tryResolveBtcUsdRate() {
96
100
  return null;
97
101
  }
98
102
  }
103
+ function staleRateNotice(resolved) {
104
+ if (!resolved?.stale || resolved.cachedAt === void 0) return void 0;
105
+ const age = formatStaleness(resolved.cachedAt);
106
+ return {
107
+ cached_at: new Date(resolved.cachedAt).toISOString(),
108
+ age,
109
+ display: `Priced with a BTC/USD rate cached ${age} \u2014 the rate provider is unreachable, so dollar figures may have drifted.`
110
+ };
111
+ }
99
112
  var warnedStale = false;
100
113
  function warnStaleRate(cachedAt) {
101
114
  if (warnedStale) return;
@@ -1048,6 +1061,7 @@ export {
1048
1061
  x402WrongAssetHint,
1049
1062
  resolveBtcUsdRate,
1050
1063
  tryResolveBtcUsdRate,
1064
+ staleRateNotice,
1051
1065
  X402_EXACT_AUTHORIZATION_TTL_SECONDS,
1052
1066
  X402_REFUSAL_TRANSACTION_DISCOVERY_WINDOW_MS,
1053
1067
  x402ExactFundingDead,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  DvmError
3
- } from "./chunk-F2L6KIMD.js";
3
+ } from "./chunk-MKI6OVW4.js";
4
4
  import {
5
5
  callerLoggers
6
6
  } from "./chunk-66HGCPBU.js";