@secondlayer/stacks 2.6.0 → 2.8.0
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/README.md +70 -0
- package/dist/shared/{stacks-ffsv2t3t.js → stacks-1qmx9kt8.js} +2 -2
- package/dist/shared/{stacks-a9cn5ehj.js → stacks-cmyyp5c4.js} +2 -2
- package/dist/shared/{stacks-yb8xesdm.js → stacks-deprc4zq.js} +3 -3
- package/dist/shared/{stacks-hr5rg2et.js → stacks-jkykwc61.js} +2 -2
- package/dist/shared/{stacks-gxhznn3h.js → stacks-ttbq8emk.js} +54 -4
- package/dist/shared/stacks-ttbq8emk.js.map +15 -0
- package/dist/shared/{stacks-1wra341e.cjs → stacks-xmsms921.cjs} +53 -3
- package/dist/shared/stacks-xmsms921.cjs.map +15 -0
- package/dist/src/actions/index.d.cts +5 -0
- package/dist/src/actions/index.d.ts +5 -0
- package/dist/src/actions/index.js +5 -5
- package/dist/src/bns/index.d.cts +5 -0
- package/dist/src/bns/index.d.ts +5 -0
- package/dist/src/bns/index.js +3 -3
- package/dist/src/index.cjs +102 -1
- package/dist/src/index.cjs.map +5 -4
- package/dist/src/index.d.cts +150 -1
- package/dist/src/index.d.ts +150 -1
- package/dist/src/index.js +109 -6
- package/dist/src/index.js.map +5 -4
- package/dist/src/pox/index.d.cts +5 -0
- package/dist/src/pox/index.d.ts +5 -0
- package/dist/src/pox/index.js +3 -3
- package/dist/src/sbtc/index.d.cts +5 -0
- package/dist/src/sbtc/index.d.ts +5 -0
- package/dist/src/sbtc/index.js +3 -3
- package/dist/src/stackingdao/index.d.cts +5 -0
- package/dist/src/stackingdao/index.d.ts +5 -0
- package/dist/src/stackingdao/index.js +3 -3
- package/dist/src/subscriptions/index.d.cts +5 -0
- package/dist/src/subscriptions/index.d.ts +5 -0
- package/dist/src/tools/index.cjs +6 -2
- package/dist/src/tools/index.cjs.map +4 -4
- package/dist/src/tools/index.d.cts +5 -0
- package/dist/src/tools/index.d.ts +5 -0
- package/dist/src/tools/index.js +6 -2
- package/dist/src/tools/index.js.map +4 -4
- package/dist/src/x402/index.d.cts +5 -0
- package/dist/src/x402/index.d.ts +5 -0
- package/dist/src/x402/index.js +2 -2
- package/package.json +1 -1
- package/dist/shared/stacks-1wra341e.cjs.map +0 -15
- package/dist/shared/stacks-gxhznn3h.js.map +0 -15
- /package/dist/shared/{stacks-ffsv2t3t.js.map → stacks-1qmx9kt8.js.map} +0 -0
- /package/dist/shared/{stacks-a9cn5ehj.js.map → stacks-cmyyp5c4.js.map} +0 -0
- /package/dist/shared/{stacks-yb8xesdm.js.map → stacks-deprc4zq.js.map} +0 -0
- /package/dist/shared/{stacks-hr5rg2et.js.map → stacks-jkykwc61.js.map} +0 -0
package/dist/src/index.d.ts
CHANGED
|
@@ -308,6 +308,13 @@ type NonceStore = {
|
|
|
308
308
|
reserve(key: string, getFloor: () => Promise<bigint>): Promise<bigint>
|
|
309
309
|
/** Forget tracked state for `key` so the next reserve re-syncs from the floor. */
|
|
310
310
|
reset(key: string): void | Promise<void>
|
|
311
|
+
/**
|
|
312
|
+
* Return the next nonce that {@link NonceStore.reserve} would hand out for
|
|
313
|
+
* `key` WITHOUT consuming it, or `undefined` if `key` is untracked. Used by
|
|
314
|
+
* {@link reconcileNonce} to detect drift. Optional — stores that omit it
|
|
315
|
+
* simply opt out of reconciliation.
|
|
316
|
+
*/
|
|
317
|
+
peek?(key: string): Promise<bigint | undefined> | bigint | undefined
|
|
311
318
|
};
|
|
312
319
|
/** Allocates mempool-safe sequential nonces across rapid broadcasts from one account. */
|
|
313
320
|
type NonceManager = {
|
|
@@ -319,6 +326,11 @@ type NonceManager = {
|
|
|
319
326
|
client: Client
|
|
320
327
|
address: string
|
|
321
328
|
}): void | Promise<void>
|
|
329
|
+
/** Next nonce that {@link NonceManager.consume} would return without consuming it, or `undefined` if untracked. */
|
|
330
|
+
peek(params: {
|
|
331
|
+
client: Client
|
|
332
|
+
address: string
|
|
333
|
+
}): Promise<bigint | undefined>
|
|
322
334
|
};
|
|
323
335
|
type CreateNonceManagerParams = {
|
|
324
336
|
source?: NonceManagerSource
|
|
@@ -344,6 +356,65 @@ declare function memoryStore(): NonceStore;
|
|
|
344
356
|
declare function createNonceManager(params?: CreateNonceManagerParams): NonceManager;
|
|
345
357
|
/** Resolve the next nonce via the client's nonce manager, falling back to a confirmed read. */
|
|
346
358
|
declare function resolveNonce(client: Client, address: string): Promise<bigint>;
|
|
359
|
+
type ReconcileNonceParams = {
|
|
360
|
+
client: Client
|
|
361
|
+
address: string
|
|
362
|
+
/** Authoritative (ideally mempool-aware) source to reconcile against. */
|
|
363
|
+
source: NonceManagerSource
|
|
364
|
+
/**
|
|
365
|
+
* Allow resetting DOWNWARD when the source's next nonce is below what the
|
|
366
|
+
* store tracks — i.e. a previously-allocated tx is no longer pending or
|
|
367
|
+
* confirmed (dropped/GC'd), so its nonce should be reused. Default `true`.
|
|
368
|
+
*
|
|
369
|
+
* Downward resets rely on `source` being current: with a go-forward mempool
|
|
370
|
+
* source that lags broadcast, run reconciliation on an interval comfortably
|
|
371
|
+
* longer than mempool propagation so a still-missing tx is genuinely dropped.
|
|
372
|
+
* Set `false` for upward-only reconciliation (always safe).
|
|
373
|
+
*/
|
|
374
|
+
downward?: boolean
|
|
375
|
+
};
|
|
376
|
+
type ReconcileNonceResult = {
|
|
377
|
+
/** Whether the manager was reset (drift detected). */
|
|
378
|
+
reset: boolean
|
|
379
|
+
/** Authoritative next nonce from `source`. */
|
|
380
|
+
authoritative: bigint
|
|
381
|
+
/** Next nonce the store tracked, or `undefined` if untracked. */
|
|
382
|
+
tracked: bigint | undefined
|
|
383
|
+
};
|
|
384
|
+
/**
|
|
385
|
+
* Reconcile a tracked nonce against an authoritative source, healing silent
|
|
386
|
+
* drift that produces no broadcast error (a dropped/GC'd mempool tx leaving the
|
|
387
|
+
* counter overshot, or the chain advancing past the local view).
|
|
388
|
+
*
|
|
389
|
+
* When the source's next nonce differs from the tracked value, the manager is
|
|
390
|
+
* {@link NonceManager.reset}; the next `consume` re-seeds from `source`. A no-op
|
|
391
|
+
* if the store is untracked or does not implement `peek`.
|
|
392
|
+
*/
|
|
393
|
+
declare function reconcileNonce(manager: NonceManager, params: ReconcileNonceParams): Promise<ReconcileNonceResult>;
|
|
394
|
+
type StartNonceReconcilerParams = {
|
|
395
|
+
client: Client
|
|
396
|
+
addresses: string[]
|
|
397
|
+
source: NonceManagerSource
|
|
398
|
+
/** Reconcile interval in ms. Default 60_000. Keep well above mempool propagation. */
|
|
399
|
+
intervalMs?: number
|
|
400
|
+
downward?: boolean
|
|
401
|
+
/** Per-address callback after each reconcile (observability). */
|
|
402
|
+
onReconcile?: (address: string, result: ReconcileNonceResult) => void
|
|
403
|
+
/** Per-address error callback; reconciliation continues on the next tick. */
|
|
404
|
+
onError?: (address: string, error: unknown) => void
|
|
405
|
+
};
|
|
406
|
+
/**
|
|
407
|
+
* Run {@link reconcileNonce} on a timer for a set of addresses.
|
|
408
|
+
*
|
|
409
|
+
* SINGLE-WRITER: run this in exactly ONE process. With a shared persisted store,
|
|
410
|
+
* a reconciler resetting the counter while other workers allocate is racy — keep
|
|
411
|
+
* reconciliation on one designated process and let the others only allocate.
|
|
412
|
+
*
|
|
413
|
+
* Returns a handle; call `stop()` to clear the timer.
|
|
414
|
+
*/
|
|
415
|
+
declare function startNonceReconciler(manager: NonceManager, params: StartNonceReconcilerParams): {
|
|
416
|
+
stop: () => void
|
|
417
|
+
};
|
|
347
418
|
/** True when a broadcast was rejected for a nonce conflict (`ConflictingNonceInMempool`, `BadNonce`). */
|
|
348
419
|
declare function isNonceConflictError(error: unknown): boolean;
|
|
349
420
|
/**
|
|
@@ -939,6 +1010,84 @@ type PostgresStoreParams = {
|
|
|
939
1010
|
*/
|
|
940
1011
|
declare function postgresStore(params: PostgresStoreParams): NonceStore;
|
|
941
1012
|
/**
|
|
1013
|
+
* Mempool-aware {@link NonceManagerSource}s.
|
|
1014
|
+
*
|
|
1015
|
+
* The default {@link jsonRpcSource} reads only the confirmed nonce, so a tx
|
|
1016
|
+
* sitting in the mempool is invisible — broadcasting many quickly forces manual
|
|
1017
|
+
* tracking. These sources fold pending (mempool) txs into the next-nonce
|
|
1018
|
+
* computation. The gap-filling core is generic; where the pending set comes from
|
|
1019
|
+
* is pluggable, so you are never locked to any one provider:
|
|
1020
|
+
*
|
|
1021
|
+
* - {@link mempoolAwareSource} — bring your own `getPending`.
|
|
1022
|
+
* - {@link indexSource} — prebuilt over Secondlayer's `/v1/index/mempool`.
|
|
1023
|
+
* - {@link hiroNonceSource} — prebuilt over Hiro's `/extended` nonces endpoint.
|
|
1024
|
+
*/
|
|
1025
|
+
type FetchImpl = typeof globalThis.fetch;
|
|
1026
|
+
/**
|
|
1027
|
+
* The next free nonce ≥ `confirmed` not already taken by a pending tx.
|
|
1028
|
+
*
|
|
1029
|
+
* Unlike Hiro's `possible_next_nonce` (which is `max(pending) + 1` and strands
|
|
1030
|
+
* higher txs when a lower nonce is missing), this FILLS gaps: it returns the
|
|
1031
|
+
* lowest unused slot, so a dropped-tx hole is reused instead of stranding the
|
|
1032
|
+
* chain.
|
|
1033
|
+
*/
|
|
1034
|
+
declare function nextFreeNonce(confirmed: bigint, pending: bigint[]): bigint;
|
|
1035
|
+
type MempoolAwareSourceParams = {
|
|
1036
|
+
/** Pending (mempool) nonces for an address. */
|
|
1037
|
+
getPending: (args: {
|
|
1038
|
+
client: Client
|
|
1039
|
+
address: string
|
|
1040
|
+
}) => Promise<bigint[]>
|
|
1041
|
+
/**
|
|
1042
|
+
* Confirmed-nonce floor. Defaults to the node's `/v2/accounts` read — the
|
|
1043
|
+
* user's own node via the client transport, no provider dependency.
|
|
1044
|
+
*/
|
|
1045
|
+
getConfirmed?: (args: {
|
|
1046
|
+
client: Client
|
|
1047
|
+
address: string
|
|
1048
|
+
}) => Promise<bigint>
|
|
1049
|
+
};
|
|
1050
|
+
/**
|
|
1051
|
+
* Build a gap-filling, mempool-aware source from any `getPending`. The confirmed
|
|
1052
|
+
* floor defaults to the node read; if `getPending` throws, the source degrades
|
|
1053
|
+
* to confirmed-only rather than blocking a broadcast.
|
|
1054
|
+
*/
|
|
1055
|
+
declare function mempoolAwareSource(params: MempoolAwareSourceParams): NonceManagerSource;
|
|
1056
|
+
type IndexSourceParams = {
|
|
1057
|
+
/** Secondlayer Index base URL. Default `https://api.secondlayer.tools`. */
|
|
1058
|
+
baseUrl?: string
|
|
1059
|
+
/** Optional API key (keyless by default; supply to raise rate limits). */
|
|
1060
|
+
apiKey?: string
|
|
1061
|
+
fetchImpl?: FetchImpl
|
|
1062
|
+
/** Max mempool pages to page through per address. Default 10 (×200 = 2000 txs). */
|
|
1063
|
+
maxPages?: number
|
|
1064
|
+
/** Override the confirmed floor (defaults to the node read). */
|
|
1065
|
+
getConfirmed?: (args: {
|
|
1066
|
+
client: Client
|
|
1067
|
+
address: string
|
|
1068
|
+
}) => Promise<bigint>
|
|
1069
|
+
};
|
|
1070
|
+
/**
|
|
1071
|
+
* Mempool-aware source backed by Secondlayer's `/v1/index/mempool` (our node's
|
|
1072
|
+
* observed mempool). `baseUrl` is configurable — point it at any shape-compatible
|
|
1073
|
+
* endpoint. Note our mempool is a go-forward, single-node observed view (not a
|
|
1074
|
+
* globally-aggregated mempool), so it can lag or miss txs our node never saw.
|
|
1075
|
+
*/
|
|
1076
|
+
declare function indexSource(params?: IndexSourceParams): NonceManagerSource;
|
|
1077
|
+
type HiroNonceSourceParams = {
|
|
1078
|
+
/** Hiro API base URL, e.g. `https://api.hiro.so` or `https://api.testnet.hiro.so`. */
|
|
1079
|
+
baseUrl: string
|
|
1080
|
+
apiKey?: string
|
|
1081
|
+
fetchImpl?: FetchImpl
|
|
1082
|
+
};
|
|
1083
|
+
/**
|
|
1084
|
+
* Off-the-shelf, non-Secondlayer mempool-aware source over Hiro's
|
|
1085
|
+
* `/extended/v1/address/{address}/nonces`. Fills the lowest detected gap first,
|
|
1086
|
+
* then falls back to `possible_next_nonce`. Requires a host that serves Hiro's
|
|
1087
|
+
* extended API (a bare stacks-node does not).
|
|
1088
|
+
*/
|
|
1089
|
+
declare function hiroNonceSource(params: HiroNonceSourceParams): NonceManagerSource;
|
|
1090
|
+
/**
|
|
942
1091
|
* Create an HTTP transport for Stacks node RPC calls.
|
|
943
1092
|
* Falls back to the chain's default RPC URL, then `localhost:3999`.
|
|
944
1093
|
*/
|
|
@@ -1196,4 +1345,4 @@ declare class ReadOnlyCallError extends BaseError {
|
|
|
1196
1345
|
declare class WebSocketError extends BaseError {
|
|
1197
1346
|
name: string;
|
|
1198
1347
|
}
|
|
1199
|
-
export { webSocket, walletActions, testnet, resolveNonce, redisStore, publicActions, providerToAccount, postgresStore, parseStx, exports_on as on, multisigActions, mocknet, memoryStore, mainnet, jsonRpcSource, isValidAddress, isNonceConflictError, isAddressEqual, http, getContractAddress, formatStx, fallback, devnet, defineChain, custom, createWalletClient, createPublicClient, createNonceManager, createMultiSigClient, createClient, broadcastWithNonceReset, ZERO_ADDRESS, WebSocketTransportConfig, WebSocketTransport, WebSocketError, WalletClientConfig, WalletClient, WalletActions, TransportFactory, TransportConfig, Transport, TransactionError, TESTNET_ZERO_ADDRESS, SubscriptionFilterSpec, Subscription, StacksProvider, StacksChain, SqlLike, SimulationError, SigningError, SerializationError, RequestOptions, RequestFn, RedisStoreParams, RedisLike, ReadOnlyCallError, PublicClientConfig, PublicClient, PublicActions, ProviderAccount, PoxFunction, PostgresStoreParams, NonceStore, NonceManagerSource, NonceManager, MultiSigClientConfig, MultiSigClient, MultiSigActions, MICROSTX_PER_STX, LocalAccount, FilterPrimitive, FilterOperator, FilterClause, Filter, FactoryTarget, CustomAccount, CreateNonceManagerParams, ContractCallError, ClientConfig, Client, BroadcastError, BnsAction, BaseError, AddressVersion, Account };
|
|
1348
|
+
export { webSocket, walletActions, testnet, startNonceReconciler, resolveNonce, redisStore, reconcileNonce, publicActions, providerToAccount, postgresStore, parseStx, exports_on as on, nextFreeNonce, multisigActions, mocknet, mempoolAwareSource, memoryStore, mainnet, jsonRpcSource, isValidAddress, isNonceConflictError, isAddressEqual, indexSource, http, hiroNonceSource, getContractAddress, formatStx, fallback, devnet, defineChain, custom, createWalletClient, createPublicClient, createNonceManager, createMultiSigClient, createClient, broadcastWithNonceReset, ZERO_ADDRESS, WebSocketTransportConfig, WebSocketTransport, WebSocketError, WalletClientConfig, WalletClient, WalletActions, TransportFactory, TransportConfig, Transport, TransactionError, TESTNET_ZERO_ADDRESS, SubscriptionFilterSpec, Subscription, StartNonceReconcilerParams, StacksProvider, StacksChain, SqlLike, SimulationError, SigningError, SerializationError, RequestOptions, RequestFn, RedisStoreParams, RedisLike, ReconcileNonceResult, ReconcileNonceParams, ReadOnlyCallError, PublicClientConfig, PublicClient, PublicActions, ProviderAccount, PoxFunction, PostgresStoreParams, NonceStore, NonceManagerSource, NonceManager, MultiSigClientConfig, MultiSigClient, MultiSigActions, MempoolAwareSourceParams, MICROSTX_PER_STX, LocalAccount, IndexSourceParams, HiroNonceSourceParams, FilterPrimitive, FilterOperator, FilterClause, Filter, FactoryTarget, CustomAccount, CreateNonceManagerParams, ContractCallError, ClientConfig, Client, BroadcastError, BnsAction, BaseError, AddressVersion, Account };
|
package/dist/src/index.js
CHANGED
|
@@ -22,12 +22,12 @@ import {
|
|
|
22
22
|
simulateCall,
|
|
23
23
|
simulateTransaction,
|
|
24
24
|
transferStx
|
|
25
|
-
} from "../shared/stacks-
|
|
25
|
+
} from "../shared/stacks-deprc4zq.js";
|
|
26
26
|
import {
|
|
27
27
|
callContract,
|
|
28
28
|
getMapEntry,
|
|
29
29
|
readContract
|
|
30
|
-
} from "../shared/stacks-
|
|
30
|
+
} from "../shared/stacks-cmyyp5c4.js";
|
|
31
31
|
import {
|
|
32
32
|
WebSocketError,
|
|
33
33
|
watchAddress,
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
} from "../shared/stacks-tjjnkt3r.js";
|
|
40
40
|
import {
|
|
41
41
|
sponsorTransaction
|
|
42
|
-
} from "../shared/stacks-
|
|
42
|
+
} from "../shared/stacks-1qmx9kt8.js";
|
|
43
43
|
import {
|
|
44
44
|
BroadcastError,
|
|
45
45
|
SerializationError,
|
|
@@ -52,9 +52,11 @@ import {
|
|
|
52
52
|
isNonceConflictError,
|
|
53
53
|
jsonRpcSource,
|
|
54
54
|
memoryStore,
|
|
55
|
+
reconcileNonce,
|
|
55
56
|
resolveNonce,
|
|
56
|
-
sendTransaction
|
|
57
|
-
|
|
57
|
+
sendTransaction,
|
|
58
|
+
startNonceReconciler
|
|
59
|
+
} from "../shared/stacks-ttbq8emk.js";
|
|
58
60
|
import {
|
|
59
61
|
BaseError
|
|
60
62
|
} from "../shared/stacks-709tra19.js";
|
|
@@ -307,6 +309,10 @@ function redisStore(params) {
|
|
|
307
309
|
},
|
|
308
310
|
async reset(key) {
|
|
309
311
|
await redis.send("DEL", [prefix + key]);
|
|
312
|
+
},
|
|
313
|
+
async peek(key) {
|
|
314
|
+
const v = await redis.send("GET", [prefix + key]);
|
|
315
|
+
return v == null ? undefined : BigInt(v);
|
|
310
316
|
}
|
|
311
317
|
};
|
|
312
318
|
}
|
|
@@ -337,6 +343,97 @@ function postgresStore(params) {
|
|
|
337
343
|
async reset(key) {
|
|
338
344
|
await ensureTable();
|
|
339
345
|
await sql`DELETE FROM stacks_nonce_state WHERE key = ${key}`;
|
|
346
|
+
},
|
|
347
|
+
async peek(key) {
|
|
348
|
+
await ensureTable();
|
|
349
|
+
const rows = await sql`SELECT next FROM stacks_nonce_state WHERE key = ${key}`;
|
|
350
|
+
const row = rows[0];
|
|
351
|
+
return row ? BigInt(String(row.next)) : undefined;
|
|
352
|
+
}
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
// src/actions/wallet/nonceSources.ts
|
|
356
|
+
function resolveFetch(fetchImpl) {
|
|
357
|
+
const f = fetchImpl ?? globalThis.fetch;
|
|
358
|
+
if (!f)
|
|
359
|
+
throw new Error("No fetch implementation available; pass `fetchImpl`");
|
|
360
|
+
return f;
|
|
361
|
+
}
|
|
362
|
+
function nextFreeNonce(confirmed, pending) {
|
|
363
|
+
const taken = new Set(pending.filter((n2) => n2 >= confirmed).map((n2) => n2.toString()));
|
|
364
|
+
let n = confirmed;
|
|
365
|
+
while (taken.has(n.toString()))
|
|
366
|
+
n += 1n;
|
|
367
|
+
return n;
|
|
368
|
+
}
|
|
369
|
+
function mempoolAwareSource(params) {
|
|
370
|
+
const getConfirmed = params.getConfirmed ?? (({ client, address }) => getNonce(client, { address }));
|
|
371
|
+
return {
|
|
372
|
+
async get({ client, address }) {
|
|
373
|
+
const confirmed = await getConfirmed({ client, address });
|
|
374
|
+
let pending = [];
|
|
375
|
+
try {
|
|
376
|
+
pending = await params.getPending({ client, address });
|
|
377
|
+
} catch {
|
|
378
|
+
return confirmed;
|
|
379
|
+
}
|
|
380
|
+
return nextFreeNonce(confirmed, pending);
|
|
381
|
+
}
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
function indexSource(params = {}) {
|
|
385
|
+
const baseUrl = (params.baseUrl ?? "https://api.secondlayer.tools").replace(/\/$/, "");
|
|
386
|
+
const fetchImpl = resolveFetch(params.fetchImpl);
|
|
387
|
+
const maxPages = params.maxPages ?? 10;
|
|
388
|
+
return mempoolAwareSource({
|
|
389
|
+
getConfirmed: params.getConfirmed,
|
|
390
|
+
async getPending({ address }) {
|
|
391
|
+
const out = [];
|
|
392
|
+
let cursor;
|
|
393
|
+
let pages = 0;
|
|
394
|
+
do {
|
|
395
|
+
const url = new URL(`${baseUrl}/v1/index/mempool`);
|
|
396
|
+
url.searchParams.set("sender", address);
|
|
397
|
+
url.searchParams.set("limit", "200");
|
|
398
|
+
if (cursor)
|
|
399
|
+
url.searchParams.set("from_cursor", cursor);
|
|
400
|
+
const res = await fetchImpl(url, {
|
|
401
|
+
headers: params.apiKey ? { authorization: `Bearer ${params.apiKey}` } : undefined
|
|
402
|
+
});
|
|
403
|
+
if (!res.ok) {
|
|
404
|
+
throw new Error(`indexSource: /v1/index/mempool ${res.status}`);
|
|
405
|
+
}
|
|
406
|
+
const data = await res.json();
|
|
407
|
+
for (const tx of data.mempool ?? []) {
|
|
408
|
+
if (tx.nonce != null)
|
|
409
|
+
out.push(BigInt(tx.nonce));
|
|
410
|
+
}
|
|
411
|
+
cursor = data.next_cursor ?? undefined;
|
|
412
|
+
pages += 1;
|
|
413
|
+
} while (cursor && pages < maxPages);
|
|
414
|
+
if (cursor) {
|
|
415
|
+
console.warn(`indexSource: stopped paging mempool for ${address} after ${maxPages} pages; pending set may be incomplete`);
|
|
416
|
+
}
|
|
417
|
+
return out;
|
|
418
|
+
}
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
function hiroNonceSource(params) {
|
|
422
|
+
const baseUrl = params.baseUrl.replace(/\/$/, "");
|
|
423
|
+
const fetchImpl = resolveFetch(params.fetchImpl);
|
|
424
|
+
return {
|
|
425
|
+
async get({ address }) {
|
|
426
|
+
const res = await fetchImpl(`${baseUrl}/extended/v1/address/${address}/nonces`, {
|
|
427
|
+
headers: params.apiKey ? { "x-api-key": params.apiKey } : undefined
|
|
428
|
+
});
|
|
429
|
+
if (!res.ok) {
|
|
430
|
+
throw new Error(`hiroNonceSource: /nonces ${res.status}`);
|
|
431
|
+
}
|
|
432
|
+
const data = await res.json();
|
|
433
|
+
const missing = (data.detected_missing_nonces ?? []).map((n) => BigInt(n)).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
434
|
+
if (missing[0] !== undefined)
|
|
435
|
+
return missing[0];
|
|
436
|
+
return BigInt(data.possible_next_nonce ?? 0);
|
|
340
437
|
}
|
|
341
438
|
};
|
|
342
439
|
}
|
|
@@ -761,22 +858,28 @@ export {
|
|
|
761
858
|
webSocket,
|
|
762
859
|
walletActions,
|
|
763
860
|
testnet,
|
|
861
|
+
startNonceReconciler,
|
|
764
862
|
resolveNonce,
|
|
765
863
|
redisStore,
|
|
864
|
+
reconcileNonce,
|
|
766
865
|
publicActions,
|
|
767
866
|
providerToAccount,
|
|
768
867
|
postgresStore,
|
|
769
868
|
parseStx,
|
|
770
869
|
exports_on as on,
|
|
870
|
+
nextFreeNonce,
|
|
771
871
|
multisigActions,
|
|
772
872
|
mocknet,
|
|
873
|
+
mempoolAwareSource,
|
|
773
874
|
memoryStore,
|
|
774
875
|
mainnet,
|
|
775
876
|
jsonRpcSource,
|
|
776
877
|
isValidAddress,
|
|
777
878
|
isNonceConflictError,
|
|
778
879
|
isAddressEqual,
|
|
880
|
+
indexSource,
|
|
779
881
|
http,
|
|
882
|
+
hiroNonceSource,
|
|
780
883
|
getContractAddress,
|
|
781
884
|
formatStx,
|
|
782
885
|
fallback,
|
|
@@ -804,5 +907,5 @@ export {
|
|
|
804
907
|
AddressVersion
|
|
805
908
|
};
|
|
806
909
|
|
|
807
|
-
//# debugId=
|
|
910
|
+
//# debugId=59A29616F35E1A0D64756E2164756E21
|
|
808
911
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/clients/createClient.ts", "../src/clients/decorators/public.ts", "../src/clients/createPublicClient.ts", "../src/clients/decorators/wallet.ts", "../src/clients/createWalletClient.ts", "../src/clients/decorators/multisig.ts", "../src/clients/createMultiSigClient.ts", "../src/actions/wallet/nonceStores.ts", "../src/transports/createTransport.ts", "../src/transports/http.ts", "../src/transports/custom.ts", "../src/transports/fallback.ts", "../src/transports/webSocket.ts", "../src/on/spec.ts", "../src/on/bns.ts", "../src/on/pox.ts", "../src/on/sbtc.ts", "../src/on/transfer.ts", "../src/errors/contract.ts"],
|
|
3
|
+
"sources": ["../src/clients/createClient.ts", "../src/clients/decorators/public.ts", "../src/clients/createPublicClient.ts", "../src/clients/decorators/wallet.ts", "../src/clients/createWalletClient.ts", "../src/clients/decorators/multisig.ts", "../src/clients/createMultiSigClient.ts", "../src/actions/wallet/nonceStores.ts", "../src/actions/wallet/nonceSources.ts", "../src/transports/createTransport.ts", "../src/transports/http.ts", "../src/transports/custom.ts", "../src/transports/fallback.ts", "../src/transports/webSocket.ts", "../src/on/spec.ts", "../src/on/bns.ts", "../src/on/pox.ts", "../src/on/sbtc.ts", "../src/on/transfer.ts", "../src/errors/contract.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"import type { Client, ClientConfig } from \"./types.ts\";\n\nconst BASE_KEYS = new Set([\n\t\"chain\",\n\t\"account\",\n\t\"transport\",\n\t\"request\",\n\t\"nonceManager\",\n\t\"extend\",\n]);\n\nfunction bindExtend(base: Client): Client[\"extend\"] {\n\t// biome-ignore lint/suspicious/noExplicitAny: interop boundary or dynamic-shape value where typing adds friction without runtime safety\n\treturn ((fn: any) => {\n\t\tconst extensions = fn(base);\n\t\tconst next = { ...base };\n\t\tfor (const [key, value] of Object.entries(extensions)) {\n\t\t\tif (BASE_KEYS.has(key)) continue;\n\t\t\t// biome-ignore lint/suspicious/noExplicitAny: interop boundary or dynamic-shape value where typing adds friction without runtime safety\n\t\t\t(next as any)[key] = value;\n\t\t}\n\t\tnext.extend = bindExtend(next);\n\t\t// biome-ignore lint/suspicious/noExplicitAny: interop boundary or dynamic-shape value where typing adds friction without runtime safety\n\t\treturn next as any;\n\t}) as Client[\"extend\"];\n}\n\n/**\n * Create a base client with transport and optional chain/account.\n * Use `.extend()` to compose action decorators (public, wallet, multisig).\n */\nexport function createClient<\n\tTExtended extends Record<string, unknown> = Record<string, unknown>,\n>(config: ClientConfig): Client<TExtended> {\n\tconst transport = config.transport({ chain: config.chain });\n\n\tconst client: Client = {\n\t\tchain: config.chain,\n\t\taccount: config.account,\n\t\ttransport,\n\t\trequest: transport.request,\n\t\tnonceManager: config.nonceManager,\n\t\t// biome-ignore lint/suspicious/noExplicitAny: interop boundary or dynamic-shape value where typing adds friction without runtime safety\n\t\textend: null as any,\n\t};\n\n\tclient.extend = bindExtend(client);\n\n\treturn client as Client<TExtended>;\n}\n",
|
|
6
6
|
"import {\n\ttype EstimateFeeParams,\n\ttype FeeEstimation,\n\testimateFee,\n} from \"../../actions/public/estimateFee.ts\";\nimport {\n\ttype AccountInfo,\n\ttype GetAccountInfoParams,\n\tgetAccountInfo,\n} from \"../../actions/public/getAccountInfo.ts\";\nimport {\n\ttype GetBalanceParams,\n\tgetBalance,\n} from \"../../actions/public/getBalance.ts\";\nimport {\n\ttype GetBlockParams,\n\tgetBlock,\n} from \"../../actions/public/getBlock.ts\";\nimport { getBlockHeight } from \"../../actions/public/getBlockHeight.ts\";\nimport {\n\ttype GetContractAbiParams,\n\tgetContractAbi,\n} from \"../../actions/public/getContractAbi.ts\";\nimport {\n\ttype GetMapEntryParams,\n\tgetMapEntry,\n} from \"../../actions/public/getMapEntry.ts\";\nimport {\n\ttype GetNonceParams,\n\tgetNonce,\n} from \"../../actions/public/getNonce.ts\";\nimport {\n\ttype MulticallParams,\n\ttype MulticallResult,\n\tmulticall,\n} from \"../../actions/public/multicall.ts\";\nimport {\n\ttype ReadContractParams,\n\treadContract,\n} from \"../../actions/public/readContract.ts\";\nimport {\n\ttype SimulateCallParams,\n\ttype SimulateCallResult,\n\tsimulateCall,\n} from \"../../actions/public/simulateCall.ts\";\nimport {\n\ttype SimulateTransactionParams,\n\ttype SimulateTransactionResult,\n\tsimulateTransaction,\n} from \"../../actions/public/simulateTransaction.ts\";\nimport type { ClarityValue } from \"../../clarity/types.ts\";\nimport {\n\ttype WatchAddressBalanceParams,\n\ttype WatchAddressParams,\n\ttype WatchBlocksParams,\n\ttype WatchMempoolParams,\n\ttype WatchNftEventParams,\n\ttype WatchTransactionParams,\n\twatchAddress,\n\twatchAddressBalance,\n\twatchBlocks,\n\twatchMempool,\n\twatchNftEvent,\n\twatchTransaction,\n} from \"../../subscriptions/actions.ts\";\nimport type { Subscription } from \"../../subscriptions/types.ts\";\nimport type { Client } from \"../types.ts\";\n\n/** Read-only actions: balance queries, contract reads, block data, and event subscriptions. */\nexport type PublicActions = {\n\tgetNonce: (params: GetNonceParams) => Promise<bigint>;\n\tgetBalance: (params: GetBalanceParams) => Promise<bigint>;\n\tgetAccountInfo: (params: GetAccountInfoParams) => Promise<AccountInfo>;\n\t// biome-ignore lint/suspicious/noExplicitAny: interop boundary or dynamic-shape value where typing adds friction without runtime safety\n\tgetBlock: (params: GetBlockParams) => Promise<any>;\n\tgetBlockHeight: () => Promise<number>;\n\treadContract: (params: ReadContractParams) => Promise<ClarityValue>;\n\t// biome-ignore lint/suspicious/noExplicitAny: interop boundary or dynamic-shape value where typing adds friction without runtime safety\n\tgetContractAbi: (params: GetContractAbiParams) => Promise<any>;\n\tgetMapEntry: (params: GetMapEntryParams) => Promise<ClarityValue>;\n\testimateFee: (params: EstimateFeeParams) => Promise<FeeEstimation[]>;\n\tmulticall: <T extends boolean = true>(\n\t\tparams: MulticallParams<T>,\n\t) => Promise<MulticallResult<T>>;\n\tsimulateCall: (params: SimulateCallParams) => Promise<SimulateCallResult>;\n\tsimulateTransaction: (\n\t\tparams: SimulateTransactionParams,\n\t) => Promise<SimulateTransactionResult>;\n\twatchBlocks: (params: WatchBlocksParams) => Promise<Subscription>;\n\twatchMempool: (params: WatchMempoolParams) => Promise<Subscription>;\n\twatchTransaction: (params: WatchTransactionParams) => Promise<Subscription>;\n\twatchAddress: (params: WatchAddressParams) => Promise<Subscription>;\n\twatchAddressBalance: (\n\t\tparams: WatchAddressBalanceParams,\n\t) => Promise<Subscription>;\n\twatchNftEvent: (params: WatchNftEventParams) => Promise<Subscription>;\n};\n\n/** Decorator that binds {@link PublicActions} to a client instance. */\nexport function publicActions(client: Client): PublicActions {\n\treturn {\n\t\tgetNonce: (params) => getNonce(client, params),\n\t\tgetBalance: (params) => getBalance(client, params),\n\t\tgetAccountInfo: (params) => getAccountInfo(client, params),\n\t\tgetBlock: (params) => getBlock(client, params),\n\t\tgetBlockHeight: () => getBlockHeight(client),\n\t\treadContract: (params) => readContract(client, params),\n\t\tgetContractAbi: (params) => getContractAbi(client, params),\n\t\tgetMapEntry: (params) => getMapEntry(client, params),\n\t\testimateFee: (params) => estimateFee(client, params),\n\t\tmulticall: (params) => multicall(client, params),\n\t\tsimulateCall: (params) => simulateCall(client, params),\n\t\tsimulateTransaction: (params) => simulateTransaction(client, params),\n\t\twatchBlocks: (params) => watchBlocks(client, params),\n\t\twatchMempool: (params) => watchMempool(client, params),\n\t\twatchTransaction: (params) => watchTransaction(client, params),\n\t\twatchAddress: (params) => watchAddress(client, params),\n\t\twatchAddressBalance: (params) => watchAddressBalance(client, params),\n\t\twatchNftEvent: (params) => watchNftEvent(client, params),\n\t};\n}\n",
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
"import { createClient } from \"./createClient.ts\";\nimport { type WalletActions, walletActions } from \"./decorators/wallet.ts\";\nimport type { Account, Client, ClientConfig } from \"./types.ts\";\n\n/** Configuration for {@link createWalletClient} — requires an account for signing. */\nexport type WalletClientConfig = ClientConfig & {\n\taccount: Account;\n};\n\n/**\n * Create a client pre-extended with {@link WalletActions} for signing and broadcasting transactions.\n */\nexport function createWalletClient(\n\tconfig: WalletClientConfig,\n): Client<WalletActions> & WalletActions & { account: Account } {\n\t// biome-ignore lint/suspicious/noExplicitAny: interop boundary or dynamic-shape value where typing adds friction without runtime safety\n\treturn createClient(config).extend(walletActions) as any;\n}\n",
|
|
10
10
|
"import { estimateFee } from \"../../actions/public/estimateFee.ts\";\nimport { getNonce } from \"../../actions/public/getNonce.ts\";\nimport {\n\ttype SendTransactionResult,\n\tsendTransaction,\n} from \"../../actions/wallet/sendTransaction.ts\";\nimport type { ClarityValue } from \"../../clarity/types.ts\";\nimport type { PostCondition } from \"../../postconditions/types.ts\";\nimport {\n\tbuildContractCall,\n\tbuildContractDeploy,\n\tbuildTokenTransfer,\n} from \"../../transactions/build.ts\";\nimport {\n\tfinalizeMultiSig,\n\tmakeMultiSigAddress,\n} from \"../../transactions/multisig.ts\";\nimport type {\n\tClarityVersion,\n\tMultiSigHashMode,\n\tStacksTransaction,\n} from \"../../transactions/types.ts\";\nimport { parseContractId } from \"../../utils/address.ts\";\nimport type { IntegerType } from \"../../utils/encoding.ts\";\nimport type { Client } from \"../types.ts\";\n\nexport type MultiSigTransferStxParams = {\n\tto: string;\n\tamount: IntegerType;\n\tmemo?: string;\n\tfee?: IntegerType;\n\tnonce?: IntegerType;\n\tpostConditionMode?: \"allow\" | \"deny\";\n\tpostConditions?: PostCondition[];\n};\n\nexport type MultiSigCallContractParams = {\n\tcontract: string;\n\tfunctionName: string;\n\tfunctionArgs?: ClarityValue[];\n\tfee?: IntegerType;\n\tnonce?: IntegerType;\n\tpostConditionMode?: \"allow\" | \"deny\";\n\tpostConditions?: PostCondition[];\n};\n\nexport type MultiSigDeployContractParams = {\n\tcontractName: string;\n\tcodeBody: string;\n\tclarityVersion?: ClarityVersion;\n\tfee?: IntegerType;\n\tnonce?: IntegerType;\n\tpostConditionMode?: \"allow\" | \"deny\";\n\tpostConditions?: PostCondition[];\n};\n\nexport type MultiSigSendTransactionParams = {\n\ttransaction: StacksTransaction;\n\tattachment?: Uint8Array | string;\n};\n\n/** Multi-sig transaction actions: build unsigned transactions and broadcast with auto-finalization. */\nexport type MultiSigActions = {\n\ttransferStx: (\n\t\tparams: MultiSigTransferStxParams,\n\t) => Promise<StacksTransaction>;\n\tcallContract: (\n\t\tparams: MultiSigCallContractParams,\n\t) => Promise<StacksTransaction>;\n\tdeployContract: (\n\t\tparams: MultiSigDeployContractParams,\n\t) => Promise<StacksTransaction>;\n\tsendTransaction: (\n\t\tparams: MultiSigSendTransactionParams,\n\t) => Promise<SendTransactionResult>;\n};\n\n/** Decorator that binds {@link MultiSigActions} to a multi-sig client. */\nexport function multisigActions(client: Client): MultiSigActions {\n\t// biome-ignore lint/suspicious/noExplicitAny: interop boundary or dynamic-shape value where typing adds friction without runtime safety\n\tconst msConfig = (client as any)._multisigConfig as {\n\t\tsigners: string[];\n\t\trequiredSignatures: number;\n\t\thashMode?: MultiSigHashMode;\n\t};\n\n\tif (!msConfig) throw new Error(\"multisigActions requires a multi-sig client\");\n\n\tconst { signers, requiredSignatures, hashMode } = msConfig;\n\n\t/** Resolve nonce from the multi-sig address */\n\tasync function resolveNonce(nonce?: IntegerType): Promise<IntegerType> {\n\t\tif (nonce !== undefined) return nonce;\n\t\tconst address = makeMultiSigAddress(\n\t\t\tsigners,\n\t\t\trequiredSignatures,\n\t\t\tclient.chain,\n\t\t);\n\t\tif (client.nonceManager)\n\t\t\treturn client.nonceManager.consume({ client, address });\n\t\treturn getNonce(client, { address });\n\t}\n\n\treturn {\n\t\tasync transferStx(params) {\n\t\t\tconst nonce = await resolveNonce(params.nonce);\n\n\t\t\tconst unsigned = buildTokenTransfer({\n\t\t\t\trecipient: params.to,\n\t\t\t\tamount: params.amount,\n\t\t\t\tmemo: params.memo,\n\t\t\t\tfee: params.fee ?? 0n,\n\t\t\t\tnonce,\n\t\t\t\tpublicKeys: signers,\n\t\t\t\tsignaturesRequired: requiredSignatures,\n\t\t\t\thashMode,\n\t\t\t\tchain: client.chain,\n\t\t\t\tpostConditionMode: params.postConditionMode,\n\t\t\t\tpostConditions: params.postConditions,\n\t\t\t});\n\n\t\t\tif (params.fee === undefined) {\n\t\t\t\tconst estimates = await estimateFee(client, { transaction: unsigned });\n\t\t\t\tconst mid = estimates[1] ?? estimates[0];\n\t\t\t\tif (mid) {\n\t\t\t\t\t// biome-ignore lint/suspicious/noExplicitAny: interop boundary or dynamic-shape value where typing adds friction without runtime safety\n\t\t\t\t\t(unsigned.auth.spendingCondition as any).fee = BigInt(mid.fee);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn unsigned;\n\t\t},\n\n\t\tasync callContract(params) {\n\t\t\tconst [contractAddress, contractName] = parseContractId(params.contract);\n\t\t\tconst nonce = await resolveNonce(params.nonce);\n\n\t\t\tconst unsigned = buildContractCall({\n\t\t\t\tcontractAddress,\n\t\t\t\tcontractName,\n\t\t\t\tfunctionName: params.functionName,\n\t\t\t\tfunctionArgs: params.functionArgs ?? [],\n\t\t\t\tfee: params.fee ?? 0n,\n\t\t\t\tnonce,\n\t\t\t\tpublicKeys: signers,\n\t\t\t\tsignaturesRequired: requiredSignatures,\n\t\t\t\thashMode,\n\t\t\t\tchain: client.chain,\n\t\t\t\tpostConditionMode: params.postConditionMode,\n\t\t\t\tpostConditions: params.postConditions,\n\t\t\t});\n\n\t\t\tif (params.fee === undefined) {\n\t\t\t\tconst estimates = await estimateFee(client, { transaction: unsigned });\n\t\t\t\tconst mid = estimates[1] ?? estimates[0];\n\t\t\t\tif (mid) {\n\t\t\t\t\t// biome-ignore lint/suspicious/noExplicitAny: interop boundary or dynamic-shape value where typing adds friction without runtime safety\n\t\t\t\t\t(unsigned.auth.spendingCondition as any).fee = BigInt(mid.fee);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn unsigned;\n\t\t},\n\n\t\tasync deployContract(params) {\n\t\t\tconst nonce = await resolveNonce(params.nonce);\n\n\t\t\tconst unsigned = buildContractDeploy({\n\t\t\t\tcontractName: params.contractName,\n\t\t\t\tcodeBody: params.codeBody,\n\t\t\t\tclarityVersion: params.clarityVersion,\n\t\t\t\tfee: params.fee ?? 0n,\n\t\t\t\tnonce,\n\t\t\t\tpublicKeys: signers,\n\t\t\t\tsignaturesRequired: requiredSignatures,\n\t\t\t\thashMode,\n\t\t\t\tchain: client.chain,\n\t\t\t\tpostConditionMode: params.postConditionMode,\n\t\t\t\tpostConditions: params.postConditions,\n\t\t\t});\n\n\t\t\tif (params.fee === undefined) {\n\t\t\t\tconst estimates = await estimateFee(client, { transaction: unsigned });\n\t\t\t\tconst mid = estimates[1] ?? estimates[0];\n\t\t\t\tif (mid) {\n\t\t\t\t\t// biome-ignore lint/suspicious/noExplicitAny: interop boundary or dynamic-shape value where typing adds friction without runtime safety\n\t\t\t\t\t(unsigned.auth.spendingCondition as any).fee = BigInt(mid.fee);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn unsigned;\n\t\t},\n\n\t\tasync sendTransaction(params) {\n\t\t\t// Auto-finalize before broadcast\n\t\t\tconst finalized = finalizeMultiSig(params.transaction, signers);\n\t\t\treturn sendTransaction(client, {\n\t\t\t\ttransaction: finalized,\n\t\t\t\tattachment: params.attachment,\n\t\t\t});\n\t\t},\n\t};\n}\n",
|
|
11
11
|
"import type { MultiSigHashMode } from \"../transactions/types.ts\";\nimport { createClient } from \"./createClient.ts\";\nimport {\n\ttype MultiSigActions,\n\tmultisigActions,\n} from \"./decorators/multisig.ts\";\nimport type { Client, ClientConfig } from \"./types.ts\";\n\n/** Configuration for {@link createMultiSigClient} — requires signer public keys and threshold. */\nexport type MultiSigClientConfig = Omit<ClientConfig, \"account\"> & {\n\tsigners: string[];\n\trequiredSignatures: number;\n\thashMode?: MultiSigHashMode;\n};\n\n/** A client pre-extended with {@link MultiSigActions} for m-of-n signing flows. */\nexport type MultiSigClient = Client<MultiSigActions> & MultiSigActions;\n\n/**\n * Create a client for multi-sig transaction flows.\n * Builds unsigned transactions that can be signed by each party then broadcast.\n */\nexport function createMultiSigClient(\n\tconfig: MultiSigClientConfig,\n): MultiSigClient {\n\tconst client = createClient(config);\n\n\t// Attach multi-sig config for the decorator to read\n\t// biome-ignore lint/suspicious/noExplicitAny: interop boundary or dynamic-shape value where typing adds friction without runtime safety\n\t(client as any)._multisigConfig = {\n\t\tsigners: config.signers,\n\t\trequiredSignatures: config.requiredSignatures,\n\t\thashMode: config.hashMode,\n\t};\n\n\t// biome-ignore lint/suspicious/noExplicitAny: interop boundary or dynamic-shape value where typing adds friction without runtime safety\n\treturn client.extend(multisigActions) as any;\n}\n",
|
|
12
|
-
"import type { NonceStore } from \"./nonceManager.ts\";\n\n/**\n * Persisted {@link NonceStore} adapters for multi-process / multi-builder\n * deployments (the smart-wallet-as-a-service case).\n *\n * The in-memory {@link memoryStore} is correct only within one process: two\n * workers sharing a signing key both read the same confirmed floor and collide.\n * These adapters move the atomic reserve into a shared datastore — Redis `INCR`\n * inside an `EVAL`, or a single Postgres upsert under a row lock — so the store\n * itself becomes the cross-process lock and the durable source of truth.\n *\n * Both are dependency-injected: pass your own `Bun.redis` / `Bun.sql` client.\n * No global `Bun` reference, so importing this module is runtime-agnostic.\n */\n\n/** Minimal structural shape of a `Bun.redis` client (the `send` escape hatch). */\nexport type RedisLike = {\n\tsend(command: string, args: string[]): Promise<unknown>;\n};\n\nexport type RedisStoreParams = {\n\tredis: RedisLike;\n\t/** Key prefix for stored nonce counters. Default `\"stacks:nonce:\"`. */\n\tprefix?: string;\n};\n\n// Warm path: counter exists → atomically hand out the current value and bump.\n// Returns the nonce (bulk string) or `false` (RESP nil) when the key is unset.\nconst TAKE_IF_PRESENT = `local v = redis.call('GET', KEYS[1])\nif v == false then return false end\nredis.call('INCR', KEYS[1])\nreturn v`;\n\n// Cold path: seed from the confirmed floor if still unset, then hand out and\n// bump. Atomic, so two racing cold reservers can never return the same nonce.\nconst SEED_OR_TAKE = `local v = redis.call('GET', KEYS[1])\nif v == false then redis.call('SET', KEYS[1], ARGV[1]); v = ARGV[1] end\nredis.call('INCR', KEYS[1])\nreturn v`;\n\n/**\n * Redis-backed nonce store. The atomic reserve lives in a Lua `EVAL`, so it is\n * safe across processes sharing one Redis. The confirmed floor (`getFloor`) is\n * read only once per key, on cold start.\n */\nexport function redisStore(params: RedisStoreParams): NonceStore {\n\tconst { redis } = params;\n\tconst prefix = params.prefix ?? \"stacks:nonce:\";\n\n\treturn {\n\t\tasync reserve(key, getFloor) {\n\t\t\tconst k = prefix + key;\n\t\t\tconst present = await redis.send(\"EVAL\", [TAKE_IF_PRESENT, \"1\", k]);\n\t\t\tif (present != null) return BigInt(present as string | number);\n\n\t\t\tconst floor = await getFloor();\n\t\t\tconst seeded = await redis.send(\"EVAL\", [\n\t\t\t\tSEED_OR_TAKE,\n\t\t\t\t\"1\",\n\t\t\t\tk,\n\t\t\t\tfloor.toString(),\n\t\t\t]);\n\t\t\treturn BigInt(seeded as string | number);\n\t\t},\n\t\tasync reset(key) {\n\t\t\tawait redis.send(\"DEL\", [prefix + key]);\n\t\t},\n\t};\n}\n\n/** Minimal structural shape of a `Bun.sql` tagged-template client. */\nexport type SqlLike = (\n\tstrings: TemplateStringsArray,\n\t...values: unknown[]\n) => Promise<Array<Record<string, unknown>>>;\n\nexport type PostgresStoreParams = {\n\tsql: SqlLike;\n\t/**\n\t * Run `CREATE TABLE IF NOT EXISTS stacks_nonce_state` lazily on first use.\n\t * Default `true`. Set `false` if you manage the schema via migrations.\n\t */\n\tensureTable?: boolean;\n};\n\n/**\n * Postgres-backed nonce store. Each reserve is a single atomic statement under\n * a row lock, so concurrent reservers on the same key serialize and never\n * collide across processes. State is durable — survives restarts.\n *\n * Uses a fixed table `stacks_nonce_state (key text primary key, next numeric)`.\n */\nexport function postgresStore(params: PostgresStoreParams): NonceStore {\n\tconst { sql } = params;\n\tconst shouldEnsure = params.ensureTable ?? true;\n\tlet ensured = false;\n\n\tasync function ensureTable() {\n\t\tif (!shouldEnsure || ensured) return;\n\t\tawait sql`CREATE TABLE IF NOT EXISTS stacks_nonce_state (key text PRIMARY KEY, next numeric NOT NULL)`;\n\t\tensured = true;\n\t}\n\n\treturn {\n\t\tasync reserve(key, getFloor) {\n\t\t\tawait ensureTable();\n\n\t\t\t// Warm path: bump and return the pre-increment value atomically.\n\t\t\tconst updated =\n\t\t\t\tawait sql`UPDATE stacks_nonce_state SET next = next + 1 WHERE key = ${key} RETURNING next - 1 AS nonce`;\n\t\t\tconst warm = updated[0];\n\t\t\tif (warm) return BigInt(String(warm.nonce));\n\n\t\t\t// Cold path: seed from the confirmed floor. ON CONFLICT keeps the seed\n\t\t\t// atomic against a racing reserver.\n\t\t\tconst floor = await getFloor();\n\t\t\tconst seeded =\n\t\t\t\tawait sql`INSERT INTO stacks_nonce_state (key, next) VALUES (${key}, ${(floor + 1n).toString()}) ON CONFLICT (key) DO UPDATE SET next = stacks_nonce_state.next + 1 RETURNING next - 1 AS nonce`;\n\t\t\tconst cold = seeded[0];\n\t\t\tif (!cold) throw new Error(\"postgresStore: insert returned no row\");\n\t\t\treturn BigInt(String(cold.nonce));\n\t\t},\n\t\tasync reset(key) {\n\t\t\tawait ensureTable();\n\t\t\tawait sql`DELETE FROM stacks_nonce_state WHERE key = ${key}`;\n\t\t},\n\t};\n}\n",
|
|
12
|
+
"import type { NonceStore } from \"./nonceManager.ts\";\n\n/**\n * Persisted {@link NonceStore} adapters for multi-process / multi-builder\n * deployments (the smart-wallet-as-a-service case).\n *\n * The in-memory {@link memoryStore} is correct only within one process: two\n * workers sharing a signing key both read the same confirmed floor and collide.\n * These adapters move the atomic reserve into a shared datastore — Redis `INCR`\n * inside an `EVAL`, or a single Postgres upsert under a row lock — so the store\n * itself becomes the cross-process lock and the durable source of truth.\n *\n * Both are dependency-injected: pass your own `Bun.redis` / `Bun.sql` client.\n * No global `Bun` reference, so importing this module is runtime-agnostic.\n */\n\n/** Minimal structural shape of a `Bun.redis` client (the `send` escape hatch). */\nexport type RedisLike = {\n\tsend(command: string, args: string[]): Promise<unknown>;\n};\n\nexport type RedisStoreParams = {\n\tredis: RedisLike;\n\t/** Key prefix for stored nonce counters. Default `\"stacks:nonce:\"`. */\n\tprefix?: string;\n};\n\n// Warm path: counter exists → atomically hand out the current value and bump.\n// Returns the nonce (bulk string) or `false` (RESP nil) when the key is unset.\nconst TAKE_IF_PRESENT = `local v = redis.call('GET', KEYS[1])\nif v == false then return false end\nredis.call('INCR', KEYS[1])\nreturn v`;\n\n// Cold path: seed from the confirmed floor if still unset, then hand out and\n// bump. Atomic, so two racing cold reservers can never return the same nonce.\nconst SEED_OR_TAKE = `local v = redis.call('GET', KEYS[1])\nif v == false then redis.call('SET', KEYS[1], ARGV[1]); v = ARGV[1] end\nredis.call('INCR', KEYS[1])\nreturn v`;\n\n/**\n * Redis-backed nonce store. The atomic reserve lives in a Lua `EVAL`, so it is\n * safe across processes sharing one Redis. The confirmed floor (`getFloor`) is\n * read only once per key, on cold start.\n */\nexport function redisStore(params: RedisStoreParams): NonceStore {\n\tconst { redis } = params;\n\tconst prefix = params.prefix ?? \"stacks:nonce:\";\n\n\treturn {\n\t\tasync reserve(key, getFloor) {\n\t\t\tconst k = prefix + key;\n\t\t\tconst present = await redis.send(\"EVAL\", [TAKE_IF_PRESENT, \"1\", k]);\n\t\t\tif (present != null) return BigInt(present as string | number);\n\n\t\t\tconst floor = await getFloor();\n\t\t\tconst seeded = await redis.send(\"EVAL\", [\n\t\t\t\tSEED_OR_TAKE,\n\t\t\t\t\"1\",\n\t\t\t\tk,\n\t\t\t\tfloor.toString(),\n\t\t\t]);\n\t\t\treturn BigInt(seeded as string | number);\n\t\t},\n\t\tasync reset(key) {\n\t\t\tawait redis.send(\"DEL\", [prefix + key]);\n\t\t},\n\t\tasync peek(key) {\n\t\t\tconst v = await redis.send(\"GET\", [prefix + key]);\n\t\t\treturn v == null ? undefined : BigInt(v as string | number);\n\t\t},\n\t};\n}\n\n/** Minimal structural shape of a `Bun.sql` tagged-template client. */\nexport type SqlLike = (\n\tstrings: TemplateStringsArray,\n\t...values: unknown[]\n) => Promise<Array<Record<string, unknown>>>;\n\nexport type PostgresStoreParams = {\n\tsql: SqlLike;\n\t/**\n\t * Run `CREATE TABLE IF NOT EXISTS stacks_nonce_state` lazily on first use.\n\t * Default `true`. Set `false` if you manage the schema via migrations.\n\t */\n\tensureTable?: boolean;\n};\n\n/**\n * Postgres-backed nonce store. Each reserve is a single atomic statement under\n * a row lock, so concurrent reservers on the same key serialize and never\n * collide across processes. State is durable — survives restarts.\n *\n * Uses a fixed table `stacks_nonce_state (key text primary key, next numeric)`.\n */\nexport function postgresStore(params: PostgresStoreParams): NonceStore {\n\tconst { sql } = params;\n\tconst shouldEnsure = params.ensureTable ?? true;\n\tlet ensured = false;\n\n\tasync function ensureTable() {\n\t\tif (!shouldEnsure || ensured) return;\n\t\tawait sql`CREATE TABLE IF NOT EXISTS stacks_nonce_state (key text PRIMARY KEY, next numeric NOT NULL)`;\n\t\tensured = true;\n\t}\n\n\treturn {\n\t\tasync reserve(key, getFloor) {\n\t\t\tawait ensureTable();\n\n\t\t\t// Warm path: bump and return the pre-increment value atomically.\n\t\t\tconst updated =\n\t\t\t\tawait sql`UPDATE stacks_nonce_state SET next = next + 1 WHERE key = ${key} RETURNING next - 1 AS nonce`;\n\t\t\tconst warm = updated[0];\n\t\t\tif (warm) return BigInt(String(warm.nonce));\n\n\t\t\t// Cold path: seed from the confirmed floor. ON CONFLICT keeps the seed\n\t\t\t// atomic against a racing reserver.\n\t\t\tconst floor = await getFloor();\n\t\t\tconst seeded =\n\t\t\t\tawait sql`INSERT INTO stacks_nonce_state (key, next) VALUES (${key}, ${(floor + 1n).toString()}) ON CONFLICT (key) DO UPDATE SET next = stacks_nonce_state.next + 1 RETURNING next - 1 AS nonce`;\n\t\t\tconst cold = seeded[0];\n\t\t\tif (!cold) throw new Error(\"postgresStore: insert returned no row\");\n\t\t\treturn BigInt(String(cold.nonce));\n\t\t},\n\t\tasync reset(key) {\n\t\t\tawait ensureTable();\n\t\t\tawait sql`DELETE FROM stacks_nonce_state WHERE key = ${key}`;\n\t\t},\n\t\tasync peek(key) {\n\t\t\tawait ensureTable();\n\t\t\tconst rows =\n\t\t\t\tawait sql`SELECT next FROM stacks_nonce_state WHERE key = ${key}`;\n\t\t\tconst row = rows[0];\n\t\t\treturn row ? BigInt(String(row.next)) : undefined;\n\t\t},\n\t};\n}\n",
|
|
13
|
+
"import type { Client } from \"../../clients/types.ts\";\nimport { getNonce } from \"../public/getNonce.ts\";\nimport type { NonceManagerSource } from \"./nonceManager.ts\";\n\n/**\n * Mempool-aware {@link NonceManagerSource}s.\n *\n * The default {@link jsonRpcSource} reads only the confirmed nonce, so a tx\n * sitting in the mempool is invisible — broadcasting many quickly forces manual\n * tracking. These sources fold pending (mempool) txs into the next-nonce\n * computation. The gap-filling core is generic; where the pending set comes from\n * is pluggable, so you are never locked to any one provider:\n *\n * - {@link mempoolAwareSource} — bring your own `getPending`.\n * - {@link indexSource} — prebuilt over Secondlayer's `/v1/index/mempool`.\n * - {@link hiroNonceSource} — prebuilt over Hiro's `/extended` nonces endpoint.\n */\n\ntype FetchImpl = typeof globalThis.fetch;\n\nfunction resolveFetch(fetchImpl?: FetchImpl): FetchImpl {\n\tconst f = fetchImpl ?? globalThis.fetch;\n\tif (!f)\n\t\tthrow new Error(\"No fetch implementation available; pass `fetchImpl`\");\n\treturn f;\n}\n\n/**\n * The next free nonce ≥ `confirmed` not already taken by a pending tx.\n *\n * Unlike Hiro's `possible_next_nonce` (which is `max(pending) + 1` and strands\n * higher txs when a lower nonce is missing), this FILLS gaps: it returns the\n * lowest unused slot, so a dropped-tx hole is reused instead of stranding the\n * chain.\n */\nexport function nextFreeNonce(confirmed: bigint, pending: bigint[]): bigint {\n\tconst taken = new Set(\n\t\tpending.filter((n) => n >= confirmed).map((n) => n.toString()),\n\t);\n\tlet n = confirmed;\n\twhile (taken.has(n.toString())) n += 1n;\n\treturn n;\n}\n\nexport type MempoolAwareSourceParams = {\n\t/** Pending (mempool) nonces for an address. */\n\tgetPending: (args: {\n\t\tclient: Client;\n\t\taddress: string;\n\t}) => Promise<bigint[]>;\n\t/**\n\t * Confirmed-nonce floor. Defaults to the node's `/v2/accounts` read — the\n\t * user's own node via the client transport, no provider dependency.\n\t */\n\tgetConfirmed?: (args: { client: Client; address: string }) => Promise<bigint>;\n};\n\n/**\n * Build a gap-filling, mempool-aware source from any `getPending`. The confirmed\n * floor defaults to the node read; if `getPending` throws, the source degrades\n * to confirmed-only rather than blocking a broadcast.\n */\nexport function mempoolAwareSource(\n\tparams: MempoolAwareSourceParams,\n): NonceManagerSource {\n\tconst getConfirmed =\n\t\tparams.getConfirmed ??\n\t\t(({ client, address }) => getNonce(client, { address }));\n\n\treturn {\n\t\tasync get({ client, address }) {\n\t\t\tconst confirmed = await getConfirmed({ client, address });\n\t\t\tlet pending: bigint[] = [];\n\t\t\ttry {\n\t\t\t\tpending = await params.getPending({ client, address });\n\t\t\t} catch {\n\t\t\t\t// Source unavailable — fall back to the confirmed floor. The local\n\t\t\t\t// increment in the manager still prevents same-process collisions.\n\t\t\t\treturn confirmed;\n\t\t\t}\n\t\t\treturn nextFreeNonce(confirmed, pending);\n\t\t},\n\t};\n}\n\nexport type IndexSourceParams = {\n\t/** Secondlayer Index base URL. Default `https://api.secondlayer.tools`. */\n\tbaseUrl?: string;\n\t/** Optional API key (keyless by default; supply to raise rate limits). */\n\tapiKey?: string;\n\tfetchImpl?: FetchImpl;\n\t/** Max mempool pages to page through per address. Default 10 (×200 = 2000 txs). */\n\tmaxPages?: number;\n\t/** Override the confirmed floor (defaults to the node read). */\n\tgetConfirmed?: (args: { client: Client; address: string }) => Promise<bigint>;\n};\n\ntype IndexMempoolResponse = {\n\tmempool?: Array<{ nonce?: string | number | null }>;\n\tnext_cursor?: string | null;\n};\n\n/**\n * Mempool-aware source backed by Secondlayer's `/v1/index/mempool` (our node's\n * observed mempool). `baseUrl` is configurable — point it at any shape-compatible\n * endpoint. Note our mempool is a go-forward, single-node observed view (not a\n * globally-aggregated mempool), so it can lag or miss txs our node never saw.\n */\nexport function indexSource(\n\tparams: IndexSourceParams = {},\n): NonceManagerSource {\n\tconst baseUrl = (params.baseUrl ?? \"https://api.secondlayer.tools\").replace(\n\t\t/\\/$/,\n\t\t\"\",\n\t);\n\tconst fetchImpl = resolveFetch(params.fetchImpl);\n\tconst maxPages = params.maxPages ?? 10;\n\n\treturn mempoolAwareSource({\n\t\tgetConfirmed: params.getConfirmed,\n\t\tasync getPending({ address }) {\n\t\t\tconst out: bigint[] = [];\n\t\t\tlet cursor: string | undefined;\n\t\t\tlet pages = 0;\n\n\t\t\tdo {\n\t\t\t\tconst url = new URL(`${baseUrl}/v1/index/mempool`);\n\t\t\t\turl.searchParams.set(\"sender\", address);\n\t\t\t\turl.searchParams.set(\"limit\", \"200\");\n\t\t\t\tif (cursor) url.searchParams.set(\"from_cursor\", cursor);\n\n\t\t\t\tconst res = await fetchImpl(url, {\n\t\t\t\t\theaders: params.apiKey\n\t\t\t\t\t\t? { authorization: `Bearer ${params.apiKey}` }\n\t\t\t\t\t\t: undefined,\n\t\t\t\t});\n\t\t\t\tif (!res.ok) {\n\t\t\t\t\tthrow new Error(`indexSource: /v1/index/mempool ${res.status}`);\n\t\t\t\t}\n\n\t\t\t\tconst data = (await res.json()) as IndexMempoolResponse;\n\t\t\t\tfor (const tx of data.mempool ?? []) {\n\t\t\t\t\tif (tx.nonce != null) out.push(BigInt(tx.nonce));\n\t\t\t\t}\n\t\t\t\tcursor = data.next_cursor ?? undefined;\n\t\t\t\tpages += 1;\n\t\t\t} while (cursor && pages < maxPages);\n\n\t\t\tif (cursor) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`indexSource: stopped paging mempool for ${address} after ${maxPages} pages; pending set may be incomplete`,\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\t});\n}\n\nexport type HiroNonceSourceParams = {\n\t/** Hiro API base URL, e.g. `https://api.hiro.so` or `https://api.testnet.hiro.so`. */\n\tbaseUrl: string;\n\tapiKey?: string;\n\tfetchImpl?: FetchImpl;\n};\n\ntype HiroNoncesResponse = {\n\tlast_executed_tx_nonce?: number | null;\n\tlast_mempool_tx_nonce?: number | null;\n\tpossible_next_nonce?: number | null;\n\tdetected_missing_nonces?: number[];\n};\n\n/**\n * Off-the-shelf, non-Secondlayer mempool-aware source over Hiro's\n * `/extended/v1/address/{address}/nonces`. Fills the lowest detected gap first,\n * then falls back to `possible_next_nonce`. Requires a host that serves Hiro's\n * extended API (a bare stacks-node does not).\n */\nexport function hiroNonceSource(\n\tparams: HiroNonceSourceParams,\n): NonceManagerSource {\n\tconst baseUrl = params.baseUrl.replace(/\\/$/, \"\");\n\tconst fetchImpl = resolveFetch(params.fetchImpl);\n\n\treturn {\n\t\tasync get({ address }) {\n\t\t\tconst res = await fetchImpl(\n\t\t\t\t`${baseUrl}/extended/v1/address/${address}/nonces`,\n\t\t\t\t{\n\t\t\t\t\theaders: params.apiKey ? { \"x-api-key\": params.apiKey } : undefined,\n\t\t\t\t},\n\t\t\t);\n\t\t\tif (!res.ok) {\n\t\t\t\tthrow new Error(`hiroNonceSource: /nonces ${res.status}`);\n\t\t\t}\n\t\t\tconst data = (await res.json()) as HiroNoncesResponse;\n\n\t\t\t// Fill the lowest gap first — possible_next_nonce ignores gaps and would\n\t\t\t// strand the missing slots.\n\t\t\tconst missing = (data.detected_missing_nonces ?? [])\n\t\t\t\t.map((n) => BigInt(n))\n\t\t\t\t.sort((a, b) => (a < b ? -1 : a > b ? 1 : 0));\n\t\t\tif (missing[0] !== undefined) return missing[0];\n\n\t\t\treturn BigInt(data.possible_next_nonce ?? 0);\n\t\t},\n\t};\n}\n",
|
|
13
14
|
"import type {\n\tRequestFn,\n\tRequestOptions,\n\tTransport,\n\tTransportConfig,\n} from \"./types.ts\";\n\nexport function createTransport(\n\ttype: string,\n\tconfig: TransportConfig & { request: RequestFn },\n): Transport {\n\treturn {\n\t\ttype,\n\t\trequest: config.request,\n\t\tconfig,\n\t};\n}\n\nexport async function fetchWithRetry(\n\turl: string,\n\toptions: RequestInit,\n\tretryCount: number,\n\tretryDelay: number,\n\ttimeout: number,\n): Promise<Response> {\n\tlet lastError: Error | undefined;\n\n\tfor (let attempt = 0; attempt <= retryCount; attempt++) {\n\t\ttry {\n\t\t\tconst controller = new AbortController();\n\t\t\tconst timeoutId = setTimeout(() => controller.abort(), timeout);\n\n\t\t\tconst response = await fetch(url, {\n\t\t\t\t...options,\n\t\t\t\tsignal: controller.signal,\n\t\t\t});\n\n\t\t\tclearTimeout(timeoutId);\n\n\t\t\tif (response.ok || response.status < 500) {\n\t\t\t\treturn response;\n\t\t\t}\n\n\t\t\tlastError = new Error(`HTTP ${response.status}: ${response.statusText}`);\n\t\t} catch (error) {\n\t\t\tlastError = error instanceof Error ? error : new Error(String(error));\n\t\t}\n\n\t\tif (attempt < retryCount) {\n\t\t\tawait new Promise((r) => setTimeout(r, retryDelay * (attempt + 1)));\n\t\t}\n\t}\n\n\tthrow lastError ?? new Error(\"Request failed\");\n}\n\nexport function buildRequestFn(\n\tbaseUrl: string,\n\tconfig: TransportConfig,\n): RequestFn {\n\tconst {\n\t\ttimeout = 30_000,\n\t\tretryCount = 3,\n\t\tretryDelay = 150,\n\t\tfetchOptions = {},\n\t\tapiKey,\n\t} = config;\n\n\treturn async (path: string, options?: RequestOptions) => {\n\t\tconst url = `${baseUrl.replace(/\\/$/, \"\")}${path}`;\n\t\tconst headers: Record<string, string> = {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t...(fetchOptions.headers as Record<string, string>),\n\t\t\t...options?.headers,\n\t\t};\n\n\t\tif (apiKey) {\n\t\t\theaders[\"x-api-key\"] = apiKey;\n\t\t}\n\n\t\tconst init: RequestInit = {\n\t\t\t...fetchOptions,\n\t\t\tmethod: options?.method ?? \"GET\",\n\t\t\theaders,\n\t\t};\n\n\t\tif (options?.body !== undefined) {\n\t\t\tinit.body = JSON.stringify(options.body);\n\t\t}\n\n\t\tconst response = await fetchWithRetry(\n\t\t\turl,\n\t\t\tinit,\n\t\t\tretryCount,\n\t\t\tretryDelay,\n\t\t\ttimeout,\n\t\t);\n\n\t\tconst contentType = response.headers.get(\"content-type\") ?? \"\";\n\t\tif (contentType.includes(\"application/json\")) {\n\t\t\treturn response.json();\n\t\t}\n\t\treturn response.text();\n\t};\n}\n",
|
|
14
15
|
"import { buildRequestFn, createTransport } from \"./createTransport.ts\";\nimport type { TransportConfig, TransportFactory } from \"./types.ts\";\n\n/**\n * Create an HTTP transport for Stacks node RPC calls.\n * Falls back to the chain's default RPC URL, then `localhost:3999`.\n */\nexport function http(url?: string, config?: TransportConfig): TransportFactory {\n\treturn (params) => {\n\t\tconst resolvedUrl =\n\t\t\turl ?? params?.chain?.rpcUrls.default.http[0] ?? \"http://localhost:3999\";\n\n\t\tconst mergedConfig: TransportConfig = {\n\t\t\t...config,\n\t\t\turl: resolvedUrl,\n\t\t};\n\n\t\treturn createTransport(\"http\", {\n\t\t\t...mergedConfig,\n\t\t\trequest: buildRequestFn(resolvedUrl, mergedConfig),\n\t\t});\n\t};\n}\n",
|
|
15
16
|
"import { createTransport } from \"./createTransport.ts\";\nimport type { RequestFn, TransportFactory } from \"./types.ts\";\n\n/** Create a transport backed by a user-provided request function. */\nexport function custom(params: { request: RequestFn }): TransportFactory {\n\treturn () => createTransport(\"custom\", { request: params.request });\n}\n",
|
|
@@ -22,7 +23,7 @@
|
|
|
22
23
|
"import {\n\ttype FactoryTarget,\n\ttype SubscriptionFilterSpec,\n\tmakeSpec,\n} from \"./spec.ts\";\n\n/**\n * Match transfer events into a recipient address.\n *\n * Works against any subgraph table that has a `recipient` column (and\n * optionally `asset_identifier`). Templates that scaffold this shape:\n * `sip-010-balances`, `sbtc-flows`.\n *\n * @param target the user's subgraph + table to bind against\n * @param recipient stx principal that should receive the transfer\n * @param opts.asset optional asset identifier (e.g. `\"SP1...usdc::usdc-token\"`)\n * to filter to a specific FT/NFT contract\n */\nexport function transferTo(\n\ttarget: FactoryTarget,\n\trecipient: string,\n\topts?: { asset?: string },\n): SubscriptionFilterSpec {\n\treturn makeSpec(target, {\n\t\trecipient,\n\t\t...(opts?.asset && { asset_identifier: opts.asset }),\n\t});\n}\n\n/**\n * SIP-010 (fungible token) transfer sugar — alias for `transferTo` that\n * makes the asset filter intent explicit at the call site. Same backing\n * filter; the `asset` param is optional (omit to match every SIP-010\n * transfer in the bound table).\n */\nexport function sip010Transfer(\n\ttarget: FactoryTarget,\n\tasset?: string,\n\topts?: { recipient?: string },\n): SubscriptionFilterSpec {\n\treturn makeSpec(target, {\n\t\t...(asset && { asset_identifier: asset }),\n\t\t...(opts?.recipient && { recipient: opts.recipient }),\n\t});\n}\n\n/**\n * SIP-009 (non-fungible token) transfer sugar — same pattern as\n * `sip010Transfer`. Bind against an NFT-shaped table (see template\n * `nft-transfers` if/when published).\n */\nexport function sip009Transfer(\n\ttarget: FactoryTarget,\n\tasset?: string,\n\topts?: { recipient?: string; tokenId?: string | number },\n): SubscriptionFilterSpec {\n\treturn makeSpec(target, {\n\t\t...(asset && { asset_identifier: asset }),\n\t\t...(opts?.recipient && { recipient: opts.recipient }),\n\t\t...(opts?.tokenId !== undefined && { token_id: String(opts.tokenId) }),\n\t});\n}\n",
|
|
23
24
|
"import { BaseError } from \"./base.ts\";\n\nexport class ContractCallError extends BaseError {\n\toverride name = \"ContractCallError\";\n}\n\nexport class ReadOnlyCallError extends BaseError {\n\toverride name = \"ReadOnlyCallError\";\n}\n"
|
|
24
25
|
],
|
|
25
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAM,YAAY,IAAI,IAAI;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,CAAC;AAED,SAAS,UAAU,CAAC,MAAgC;AAAA,EAEnD,OAAQ,CAAC,OAAY;AAAA,IACpB,MAAM,aAAa,GAAG,IAAI;AAAA,IAC1B,MAAM,OAAO,KAAK,KAAK;AAAA,IACvB,YAAY,KAAK,UAAU,OAAO,QAAQ,UAAU,GAAG;AAAA,MACtD,IAAI,UAAU,IAAI,GAAG;AAAA,QAAG;AAAA,MAEvB,KAAa,OAAO;AAAA,IACtB;AAAA,IACA,KAAK,SAAS,WAAW,IAAI;AAAA,IAE7B,OAAO;AAAA;AAAA;AAQF,SAAS,YAEf,CAAC,QAAyC;AAAA,EAC1C,MAAM,YAAY,OAAO,UAAU,EAAE,OAAO,OAAO,MAAM,CAAC;AAAA,EAE1D,MAAM,SAAiB;AAAA,IACtB,OAAO,OAAO;AAAA,IACd,SAAS,OAAO;AAAA,IAChB;AAAA,IACA,SAAS,UAAU;AAAA,IACnB,cAAc,OAAO;AAAA,IAErB,QAAQ;AAAA,EACT;AAAA,EAEA,OAAO,SAAS,WAAW,MAAM;AAAA,EAEjC,OAAO;AAAA;;ACmDD,SAAS,aAAa,CAAC,QAA+B;AAAA,EAC5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dist/src/pox/index.d.cts
CHANGED
|
@@ -37,6 +37,11 @@ type NonceManager = {
|
|
|
37
37
|
client: Client
|
|
38
38
|
address: string
|
|
39
39
|
}): void | Promise<void>
|
|
40
|
+
/** Next nonce that {@link NonceManager.consume} would return without consuming it, or `undefined` if untracked. */
|
|
41
|
+
peek(params: {
|
|
42
|
+
client: Client
|
|
43
|
+
address: string
|
|
44
|
+
}): Promise<bigint | undefined>
|
|
40
45
|
};
|
|
41
46
|
/** Full chain descriptor used by clients and transports for network-aware operations. */
|
|
42
47
|
type StacksChain = {
|
package/dist/src/pox/index.d.ts
CHANGED
|
@@ -37,6 +37,11 @@ type NonceManager = {
|
|
|
37
37
|
client: Client
|
|
38
38
|
address: string
|
|
39
39
|
}): void | Promise<void>
|
|
40
|
+
/** Next nonce that {@link NonceManager.consume} would return without consuming it, or `undefined` if untracked. */
|
|
41
|
+
peek(params: {
|
|
42
|
+
client: Client
|
|
43
|
+
address: string
|
|
44
|
+
}): Promise<bigint | undefined>
|
|
40
45
|
};
|
|
41
46
|
/** Full chain descriptor used by clients and transports for network-aware operations. */
|
|
42
47
|
type StacksChain = {
|
package/dist/src/pox/index.js
CHANGED
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
} from "../../shared/stacks-9z833ww5.js";
|
|
5
5
|
import {
|
|
6
6
|
getContract
|
|
7
|
-
} from "../../shared/stacks-
|
|
8
|
-
import"../../shared/stacks-
|
|
9
|
-
import"../../shared/stacks-
|
|
7
|
+
} from "../../shared/stacks-jkykwc61.js";
|
|
8
|
+
import"../../shared/stacks-cmyyp5c4.js";
|
|
9
|
+
import"../../shared/stacks-ttbq8emk.js";
|
|
10
10
|
import"../../shared/stacks-709tra19.js";
|
|
11
11
|
import"../../shared/stacks-g7ffp8aj.js";
|
|
12
12
|
import"../../shared/stacks-z53fwfcm.js";
|
|
@@ -37,6 +37,11 @@ type NonceManager = {
|
|
|
37
37
|
client: Client
|
|
38
38
|
address: string
|
|
39
39
|
}): void | Promise<void>
|
|
40
|
+
/** Next nonce that {@link NonceManager.consume} would return without consuming it, or `undefined` if untracked. */
|
|
41
|
+
peek(params: {
|
|
42
|
+
client: Client
|
|
43
|
+
address: string
|
|
44
|
+
}): Promise<bigint | undefined>
|
|
40
45
|
};
|
|
41
46
|
/** Full chain descriptor used by clients and transports for network-aware operations. */
|
|
42
47
|
type StacksChain = {
|
package/dist/src/sbtc/index.d.ts
CHANGED
|
@@ -37,6 +37,11 @@ type NonceManager = {
|
|
|
37
37
|
client: Client
|
|
38
38
|
address: string
|
|
39
39
|
}): void | Promise<void>
|
|
40
|
+
/** Next nonce that {@link NonceManager.consume} would return without consuming it, or `undefined` if untracked. */
|
|
41
|
+
peek(params: {
|
|
42
|
+
client: Client
|
|
43
|
+
address: string
|
|
44
|
+
}): Promise<bigint | undefined>
|
|
40
45
|
};
|
|
41
46
|
/** Full chain descriptor used by clients and transports for network-aware operations. */
|
|
42
47
|
type StacksChain = {
|
package/dist/src/sbtc/index.js
CHANGED
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
} from "../../shared/stacks-9z833ww5.js";
|
|
5
5
|
import {
|
|
6
6
|
getContract
|
|
7
|
-
} from "../../shared/stacks-
|
|
8
|
-
import"../../shared/stacks-
|
|
9
|
-
import"../../shared/stacks-
|
|
7
|
+
} from "../../shared/stacks-jkykwc61.js";
|
|
8
|
+
import"../../shared/stacks-cmyyp5c4.js";
|
|
9
|
+
import"../../shared/stacks-ttbq8emk.js";
|
|
10
10
|
import"../../shared/stacks-709tra19.js";
|
|
11
11
|
import"../../shared/stacks-g7ffp8aj.js";
|
|
12
12
|
import"../../shared/stacks-4trgpb5a.js";
|