@secondlayer/sdk 6.30.0 → 6.31.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/dist/index.d.ts +73 -1
- package/dist/index.js +26 -1
- package/dist/index.js.map +3 -3
- package/dist/subgraphs/index.d.ts +72 -0
- package/dist/subgraphs/index.js +26 -1
- package/dist/subgraphs/index.js.map +3 -3
- package/package.json +5 -3
package/dist/index.d.ts
CHANGED
|
@@ -1691,6 +1691,73 @@ interface PoxResource {
|
|
|
1691
1691
|
get(rewardCycle: number): Promise<PoxCycleEnvelope | null>
|
|
1692
1692
|
};
|
|
1693
1693
|
}
|
|
1694
|
+
/** The decoded `pox-5` boot-contract print topics (SIP-045 Bitcoin Staking).
|
|
1695
|
+
* Declared locally rather than imported from the server packages — the SDK is
|
|
1696
|
+
* published and owns its own dependency surface (same as {@link SbtcEventTopic}). */
|
|
1697
|
+
type IndexPox5EventTopic = "set-bond-admin" | "set-pause-admin" | "pause-rewards" | "setup-bond" | "add-to-allowlist" | "register-for-bond" | "update-bond-registration" | "register-signer" | "stake" | "stake-update" | "announce-l1-early-exit" | "unstake-sbtc" | "unstake" | "calculate-rewards" | "bond-distribution" | "claim-rewards" | "claim-staker-rewards-for-signer" | "grant-signer-key" | "revoke-signer-grant";
|
|
1698
|
+
/** A raw decoded PoX-5 print event. Promoted fields cover the hot query paths;
|
|
1699
|
+
* `data` always carries the full decoded tuple, including nested shapes
|
|
1700
|
+
* (`btc-lockup`, `bond-rewards`, `bond-periods`) that have no flat column. */
|
|
1701
|
+
type IndexPox5Event = {
|
|
1702
|
+
cursor: string
|
|
1703
|
+
block_height: number
|
|
1704
|
+
block_time: string | null
|
|
1705
|
+
tx_id: string
|
|
1706
|
+
tx_index: number
|
|
1707
|
+
event_index: number
|
|
1708
|
+
topic: IndexPox5EventTopic
|
|
1709
|
+
staker: string | null
|
|
1710
|
+
signer: string | null
|
|
1711
|
+
signer_manager: string | null
|
|
1712
|
+
bond_index: number | null
|
|
1713
|
+
/** ustx, bigint-safe string. */
|
|
1714
|
+
amount_ustx: string | null
|
|
1715
|
+
/** sats, bigint-safe string. */
|
|
1716
|
+
amount_sats: string | null
|
|
1717
|
+
reward_cycle: number | null
|
|
1718
|
+
first_reward_cycle: number | null
|
|
1719
|
+
unlock_cycle: number | null
|
|
1720
|
+
unlock_burn_height: number | null
|
|
1721
|
+
is_l1_lock: boolean | null
|
|
1722
|
+
signer_key: string | null
|
|
1723
|
+
/** The full decoded print tuple as JSON. */
|
|
1724
|
+
data: unknown
|
|
1725
|
+
};
|
|
1726
|
+
type Pox5EventsEnvelope = {
|
|
1727
|
+
events: IndexPox5Event[]
|
|
1728
|
+
next_cursor: string | null
|
|
1729
|
+
tip: IndexTip
|
|
1730
|
+
reorgs: IndexReorg[]
|
|
1731
|
+
/** Present only when the PoX-5 decoder is disabled, explaining an empty feed. */
|
|
1732
|
+
notes?: string
|
|
1733
|
+
};
|
|
1734
|
+
type Pox5EventsListParams = {
|
|
1735
|
+
cursor?: string | null
|
|
1736
|
+
fromCursor?: string | null
|
|
1737
|
+
limit?: number
|
|
1738
|
+
/** Clamp to the finality boundary — only rows past the reorg margin. */
|
|
1739
|
+
confirmed?: boolean
|
|
1740
|
+
topic?: IndexPox5EventTopic
|
|
1741
|
+
staker?: string
|
|
1742
|
+
signer?: string
|
|
1743
|
+
signerManager?: string
|
|
1744
|
+
bondIndex?: number
|
|
1745
|
+
rewardCycle?: number
|
|
1746
|
+
fromHeight?: number
|
|
1747
|
+
toHeight?: number
|
|
1748
|
+
};
|
|
1749
|
+
type Pox5EventsWalkParams = Omit<Pox5EventsListParams, "limit"> & {
|
|
1750
|
+
batchSize?: number
|
|
1751
|
+
signal?: AbortSignal
|
|
1752
|
+
};
|
|
1753
|
+
/** `index.pox5` — decoded PoX-5 print events, the staking primitive from the
|
|
1754
|
+
* epoch 4.0 hard fork onward (PoX-4's `index.stacking` stream ends there). */
|
|
1755
|
+
interface Pox5Resource {
|
|
1756
|
+
events: {
|
|
1757
|
+
list(params?: Pox5EventsListParams): Promise<Pox5EventsEnvelope>
|
|
1758
|
+
walk(params?: Pox5EventsWalkParams): AsyncIterable<IndexPox5Event>
|
|
1759
|
+
};
|
|
1760
|
+
}
|
|
1694
1761
|
/**
|
|
1695
1762
|
* `index.ftTransfers` — callable shorthand for `.list()`, with `.list`/`.walk`
|
|
1696
1763
|
* still available: `await sl.index.ftTransfers({ contractId })`.
|
|
@@ -1805,6 +1872,9 @@ declare class Index extends BaseClient {
|
|
|
1805
1872
|
/** PoX reward-cycle aggregates. Distinct from `stacking` (per-call PoX-4
|
|
1806
1873
|
* actions); `cycles` is the reward-cycle rollup. */
|
|
1807
1874
|
readonly pox: PoxResource;
|
|
1875
|
+
/** Decoded PoX-5 print events (SIP-045 Bitcoin Staking) — the raw pox-5
|
|
1876
|
+
* boot-contract log, all 19 topics. Distinct from `stacking` (PoX-4 era). */
|
|
1877
|
+
readonly pox5: Pox5Resource;
|
|
1808
1878
|
private listFtTransfers;
|
|
1809
1879
|
private listNftTransfers;
|
|
1810
1880
|
/** Shared keyset-pagination loop for every `walk*` feed: seed the cursor from
|
|
@@ -1846,6 +1916,8 @@ declare class Index extends BaseClient {
|
|
|
1846
1916
|
private listSbtcEvents;
|
|
1847
1917
|
private walkSbtcEvents;
|
|
1848
1918
|
private getSbtcSummary;
|
|
1919
|
+
private listPox5Events;
|
|
1920
|
+
private walkPox5Events;
|
|
1849
1921
|
private listPoxCycles;
|
|
1850
1922
|
private walkPoxCycles;
|
|
1851
1923
|
private getPoxCycle;
|
|
@@ -2766,4 +2838,4 @@ declare function toJsonSafe(value: unknown): unknown;
|
|
|
2766
2838
|
/** Decode a hex-encoded Clarity value to JSON-safe JS (uints as strings,
|
|
2767
2839
|
* buffers as `0x…` hex, tuples as objects). Returns the input hex on failure. */
|
|
2768
2840
|
declare function decodeClarityValue(hex: string): unknown;
|
|
2769
|
-
export { withX402, verifyWebhookSignature, verifyTransactionProof, verify as verifyStandardWebhooksHeaders, verifySecondlayerSignature, trigger, toJsonSafe, selectOffer, resolveAccountNonce, readX402Receipt, readX402Challenge, payAndRetry, isStxTransfer, isStxMint, isStxLock, isStxBurn, isPrint, isNftTransfer, isNftMint, isNftBurn, isFtTransfer, isFtMint, isFtBurn, getSubgraph, fetchRewardSet, decodeStxTransfer, decodeStxMint, decodeStxLock, decodeStxBurn, decodePrint, decodeNftTransfer, decodeNftMint, decodeNftBurn, decodeFtTransfer, decodeFtMint, decodeFtBurn, decodeClarityValue, decodeChainWebhook, createX402Client, createStreamsClient, consumeIndexFeed, buildSignedX402Payment, X402SpendGuardError, X402Result, X402Receipt, X402Fetch, X402ClientOptions, X402Client, X402Challenge, X402Accept, WithX402Options, WebhookHeaderInput, VersionConflictError, ValidationError, UpdateSubscriptionRequest2 as UpdateSubscriptionRequest, UpdateProjectParams, TransactionsWalkParams, TransactionsListParams, TransactionsEnvelope, TransactionProofVerifyResult, TransactionProof, TransactionEnvelope, Subscriptions, SubscriptionSummary2 as SubscriptionSummary, SubscriptionStatus, SubscriptionRuntime, SubscriptionKind, SubscriptionFormat, SubscriptionDetail2 as SubscriptionDetail, Subgraphs, SubgraphSpecOptions3 as SubgraphSpecOptions, SubgraphSpecFormat2 as SubgraphSpecFormat, SubgraphOperationStatus, SubgraphAgentSchema3 as SubgraphAgentSchema, StreamsUsage, StreamsTip, StreamsSignatureError, StreamsServerError, StreamsReorgsListParams, StreamsReorgsListEnvelope, StreamsReorgContext, StreamsReorg, StreamsEventsSubscribeParams, StreamsEventsStreamParams, StreamsEventsListParams, StreamsEventsListEnvelope, StreamsEventsEnvelope, StreamsEventsConsumeResult, StreamsEventsConsumeParams, StreamsEventType, StreamsEventPayload, StreamsEvent, StreamsDumpsManifest, StreamsDumps, StreamsDumpFile, StreamsConsumeParams, StreamsClient, StreamsCanonicalBlock, StreamsBatchContext, StreamsBatch, StandardWebhooksHeaders2 as StandardWebhooksHeaders, StackingWalkParams, StackingListParams, StackingEnvelope, SelectOfferOptions, SecondLayerOptions, SecondLayer, ScopedKeyProduct, SbtcWithdrawalsWalkParams, SbtcWithdrawalsListParams, SbtcWithdrawalsEnvelope, SbtcWithdrawalSweptConfirmedEvent, SbtcWithdrawalStatus, SbtcWithdrawalEvent, SbtcWithdrawalEnvelope, SbtcSummaryEnvelope, SbtcResource, SbtcEventsWalkParams, SbtcEventsListParams, SbtcEventsEnvelope, SbtcEventTopic, SbtcDepositsWalkParams, SbtcDepositsListParams, SbtcDepositsEnvelope, SbtcDepositEvent, SbtcDepositEnvelope, RotateSecretResponse2 as RotateSecretResponse, RewardSet2 as RewardSet, ReplayResult2 as ReplayResult, RateLimitError, Projects, ProjectTeamMember, ProjectTeam, ProjectInvitation, Project, PrintSchemaResponse, PoxResource, PoxCyclesWalkParams, PoxCyclesListParams, PoxCyclesEnvelope, PoxCycleEnvelope, PayAndRetryOptions, NftTransfersWalkParams, NftTransfersResource, NftTransfersListParams, NftTransfersEnvelope, NftTransferPayload, NftTransferEvent, NftTransfer, MempoolWalkParams, MempoolTransactionEnvelope, MempoolListParams, MempoolEnvelope, IndexUsage, IndexTransaction, IndexTip, IndexStackingAction, IndexSbtcWithdrawalPhase, IndexSbtcWithdrawalDetail, IndexSbtcWithdrawal, IndexSbtcSummary, IndexSbtcEvent, IndexSbtcDepositDetail, IndexSbtcDeposit, IndexReorg, IndexPoxFunctionCount, IndexPoxCycle, IndexPostCondition, IndexMempoolTransaction, IndexEventsResource, IndexEventTypeFilters, IndexEventType, IndexEvent, IndexDiscovery, IndexContractCall, IndexConsumeOptions, IndexCanonicalBlock, IndexBlock, Index, FtTransfersWalkParams, FtTransfersResource, FtTransfersListParams, FtTransfersEnvelope, FtTransferPayload, FtTransferEvent, FtTransfer, FetchLike2 as FetchLike, EventsWalkParams, EventsListParams, EventsEnvelope, EventsConsumeParams, DeliveryRow2 as DeliveryRow, DecodedStxTransferPayload, DecodedStxTransfer, DecodedStxMintPayload, DecodedStxMint, DecodedStxLockPayload, DecodedStxLock, DecodedStxBurnPayload, DecodedStxBurn, DecodedPrintValue, DecodedPrintPayload, DecodedPrint, DecodedNftTransferPayload, DecodedNftTransfer, DecodedNftMintPayload, DecodedNftMint, DecodedNftBurnPayload, DecodedNftBurn, DecodedFtTransferPayload, DecodedFtTransfer, DecodedFtMintPayload, DecodedFtMint, DecodedFtBurnPayload, DecodedFtBurn, DecodedEventRow, DecodedEventColumns, DeadRow2 as DeadRow, DEFAULT_PREFER_ASSETS, Cursor, CreateSubscriptionResponse2 as CreateSubscriptionResponse, CreateSubscriptionRequest2 as CreateSubscriptionRequest, CreateProjectParams, CreateApiKeyResponse, CreateApiKeyParams, ContractsListParams, ContractsEnvelope, Contracts, ContractSummary, ContractConformance, ContractCallsWalkParams, ContractCallsListParams, ContractCallsEnvelope, ContractCallsConsumeParams, ContextSnapshot, ContextProject, ContextApiKey, ContextAccount, ChainWebhookEnvelope, ChainWebhookDelivery2 as ChainWebhookDelivery, ChainTxLevelEvent, ChainTriggerType, ChainTrigger, ChainTestDelivery, ChainStxTransferData, ChainStxMintData, ChainStxLockData, ChainStxBurnData, ChainReorgRollbackEnvelope, ChainReorgRollbackDelivery, ChainReorgOrphanedEntry, ChainPrintEventData, ChainNftTransferData, ChainNftMintData, ChainNftBurnData, ChainFtTransferData, ChainFtMintData, ChainFtBurnData, ChainEventEnvelope, ChainApplyEnvelopeOf, ChainApplyEnvelope, ChainApplyDeliveryOf, CanonicalWalkParams, CanonicalListParams, CanonicalEnvelope, ByoBreakingChangeError, ByoBreakingChangeDetails, BuildSignedX402PaymentOptions, BlocksWalkParams, BlocksListParams, BlocksEnvelope, BlockEnvelope, AuthError, ApiKeys, ApiKeySummary, ApiError, ActiveSubgraphOperation };
|
|
2841
|
+
export { withX402, verifyWebhookSignature, verifyTransactionProof, verify as verifyStandardWebhooksHeaders, verifySecondlayerSignature, trigger, toJsonSafe, selectOffer, resolveAccountNonce, readX402Receipt, readX402Challenge, payAndRetry, isStxTransfer, isStxMint, isStxLock, isStxBurn, isPrint, isNftTransfer, isNftMint, isNftBurn, isFtTransfer, isFtMint, isFtBurn, getSubgraph, fetchRewardSet, decodeStxTransfer, decodeStxMint, decodeStxLock, decodeStxBurn, decodePrint, decodeNftTransfer, decodeNftMint, decodeNftBurn, decodeFtTransfer, decodeFtMint, decodeFtBurn, decodeClarityValue, decodeChainWebhook, createX402Client, createStreamsClient, consumeIndexFeed, buildSignedX402Payment, X402SpendGuardError, X402Result, X402Receipt, X402Fetch, X402ClientOptions, X402Client, X402Challenge, X402Accept, WithX402Options, WebhookHeaderInput, VersionConflictError, ValidationError, UpdateSubscriptionRequest2 as UpdateSubscriptionRequest, UpdateProjectParams, TransactionsWalkParams, TransactionsListParams, TransactionsEnvelope, TransactionProofVerifyResult, TransactionProof, TransactionEnvelope, Subscriptions, SubscriptionSummary2 as SubscriptionSummary, SubscriptionStatus, SubscriptionRuntime, SubscriptionKind, SubscriptionFormat, SubscriptionDetail2 as SubscriptionDetail, Subgraphs, SubgraphSpecOptions3 as SubgraphSpecOptions, SubgraphSpecFormat2 as SubgraphSpecFormat, SubgraphOperationStatus, SubgraphAgentSchema3 as SubgraphAgentSchema, StreamsUsage, StreamsTip, StreamsSignatureError, StreamsServerError, StreamsReorgsListParams, StreamsReorgsListEnvelope, StreamsReorgContext, StreamsReorg, StreamsEventsSubscribeParams, StreamsEventsStreamParams, StreamsEventsListParams, StreamsEventsListEnvelope, StreamsEventsEnvelope, StreamsEventsConsumeResult, StreamsEventsConsumeParams, StreamsEventType, StreamsEventPayload, StreamsEvent, StreamsDumpsManifest, StreamsDumps, StreamsDumpFile, StreamsConsumeParams, StreamsClient, StreamsCanonicalBlock, StreamsBatchContext, StreamsBatch, StandardWebhooksHeaders2 as StandardWebhooksHeaders, StackingWalkParams, StackingListParams, StackingEnvelope, SelectOfferOptions, SecondLayerOptions, SecondLayer, ScopedKeyProduct, SbtcWithdrawalsWalkParams, SbtcWithdrawalsListParams, SbtcWithdrawalsEnvelope, SbtcWithdrawalSweptConfirmedEvent, SbtcWithdrawalStatus, SbtcWithdrawalEvent, SbtcWithdrawalEnvelope, SbtcSummaryEnvelope, SbtcResource, SbtcEventsWalkParams, SbtcEventsListParams, SbtcEventsEnvelope, SbtcEventTopic, SbtcDepositsWalkParams, SbtcDepositsListParams, SbtcDepositsEnvelope, SbtcDepositEvent, SbtcDepositEnvelope, RotateSecretResponse2 as RotateSecretResponse, RewardSet2 as RewardSet, ReplayResult2 as ReplayResult, RateLimitError, Projects, ProjectTeamMember, ProjectTeam, ProjectInvitation, Project, PrintSchemaResponse, PoxResource, PoxCyclesWalkParams, PoxCyclesListParams, PoxCyclesEnvelope, PoxCycleEnvelope, Pox5Resource, Pox5EventsWalkParams, Pox5EventsListParams, Pox5EventsEnvelope, PayAndRetryOptions, NftTransfersWalkParams, NftTransfersResource, NftTransfersListParams, NftTransfersEnvelope, NftTransferPayload, NftTransferEvent, NftTransfer, MempoolWalkParams, MempoolTransactionEnvelope, MempoolListParams, MempoolEnvelope, IndexUsage, IndexTransaction, IndexTip, IndexStackingAction, IndexSbtcWithdrawalPhase, IndexSbtcWithdrawalDetail, IndexSbtcWithdrawal, IndexSbtcSummary, IndexSbtcEvent, IndexSbtcDepositDetail, IndexSbtcDeposit, IndexReorg, IndexPoxFunctionCount, IndexPoxCycle, IndexPox5EventTopic, IndexPox5Event, IndexPostCondition, IndexMempoolTransaction, IndexEventsResource, IndexEventTypeFilters, IndexEventType, IndexEvent, IndexDiscovery, IndexContractCall, IndexConsumeOptions, IndexCanonicalBlock, IndexBlock, Index, FtTransfersWalkParams, FtTransfersResource, FtTransfersListParams, FtTransfersEnvelope, FtTransferPayload, FtTransferEvent, FtTransfer, FetchLike2 as FetchLike, EventsWalkParams, EventsListParams, EventsEnvelope, EventsConsumeParams, DeliveryRow2 as DeliveryRow, DecodedStxTransferPayload, DecodedStxTransfer, DecodedStxMintPayload, DecodedStxMint, DecodedStxLockPayload, DecodedStxLock, DecodedStxBurnPayload, DecodedStxBurn, DecodedPrintValue, DecodedPrintPayload, DecodedPrint, DecodedNftTransferPayload, DecodedNftTransfer, DecodedNftMintPayload, DecodedNftMint, DecodedNftBurnPayload, DecodedNftBurn, DecodedFtTransferPayload, DecodedFtTransfer, DecodedFtMintPayload, DecodedFtMint, DecodedFtBurnPayload, DecodedFtBurn, DecodedEventRow, DecodedEventColumns, DeadRow2 as DeadRow, DEFAULT_PREFER_ASSETS, Cursor, CreateSubscriptionResponse2 as CreateSubscriptionResponse, CreateSubscriptionRequest2 as CreateSubscriptionRequest, CreateProjectParams, CreateApiKeyResponse, CreateApiKeyParams, ContractsListParams, ContractsEnvelope, Contracts, ContractSummary, ContractConformance, ContractCallsWalkParams, ContractCallsListParams, ContractCallsEnvelope, ContractCallsConsumeParams, ContextSnapshot, ContextProject, ContextApiKey, ContextAccount, ChainWebhookEnvelope, ChainWebhookDelivery2 as ChainWebhookDelivery, ChainTxLevelEvent, ChainTriggerType, ChainTrigger, ChainTestDelivery, ChainStxTransferData, ChainStxMintData, ChainStxLockData, ChainStxBurnData, ChainReorgRollbackEnvelope, ChainReorgRollbackDelivery, ChainReorgOrphanedEntry, ChainPrintEventData, ChainNftTransferData, ChainNftMintData, ChainNftBurnData, ChainFtTransferData, ChainFtMintData, ChainFtBurnData, ChainEventEnvelope, ChainApplyEnvelopeOf, ChainApplyEnvelope, ChainApplyDeliveryOf, CanonicalWalkParams, CanonicalListParams, CanonicalEnvelope, ByoBreakingChangeError, ByoBreakingChangeDetails, BuildSignedX402PaymentOptions, BlocksWalkParams, BlocksListParams, BlocksEnvelope, BlockEnvelope, AuthError, ApiKeys, ApiKeySummary, ApiError, ActiveSubgraphOperation };
|
package/dist/index.js
CHANGED
|
@@ -810,6 +810,12 @@ class Index extends BaseClient {
|
|
|
810
810
|
get: (rewardCycle) => this.getPoxCycle(rewardCycle)
|
|
811
811
|
}
|
|
812
812
|
};
|
|
813
|
+
pox5 = {
|
|
814
|
+
events: {
|
|
815
|
+
list: (params = {}) => this.listPox5Events(params),
|
|
816
|
+
walk: (params = {}) => this.walkPox5Events(params)
|
|
817
|
+
}
|
|
818
|
+
};
|
|
813
819
|
async listFtTransfers(params = {}) {
|
|
814
820
|
return this.request("GET", `/v1/index/ft-transfers${buildQuery({
|
|
815
821
|
cursor: params.cursor,
|
|
@@ -1038,6 +1044,25 @@ class Index extends BaseClient {
|
|
|
1038
1044
|
async getSbtcSummary() {
|
|
1039
1045
|
return this.request("GET", "/v1/index/sbtc/summary");
|
|
1040
1046
|
}
|
|
1047
|
+
async listPox5Events(params = {}) {
|
|
1048
|
+
return this.request("GET", `/v1/index/pox5/events${buildQuery({
|
|
1049
|
+
cursor: params.cursor,
|
|
1050
|
+
from_cursor: params.fromCursor,
|
|
1051
|
+
limit: params.limit,
|
|
1052
|
+
confirmed: params.confirmed,
|
|
1053
|
+
topic: params.topic,
|
|
1054
|
+
staker: params.staker,
|
|
1055
|
+
signer: params.signer,
|
|
1056
|
+
signer_manager: params.signerManager,
|
|
1057
|
+
bond_index: params.bondIndex,
|
|
1058
|
+
reward_cycle: params.rewardCycle,
|
|
1059
|
+
from_height: params.fromHeight,
|
|
1060
|
+
to_height: params.toHeight
|
|
1061
|
+
})}`);
|
|
1062
|
+
}
|
|
1063
|
+
walkPox5Events(params = {}) {
|
|
1064
|
+
return this.keysetWalk(params, (page) => this.listPox5Events({ ...params, ...page }), (e) => e.events);
|
|
1065
|
+
}
|
|
1041
1066
|
async listPoxCycles(params = {}) {
|
|
1042
1067
|
return this.request("GET", `/v1/index/pox/cycles${buildQuery({
|
|
1043
1068
|
cursor: params.cursor,
|
|
@@ -2425,5 +2450,5 @@ export {
|
|
|
2425
2450
|
ApiError
|
|
2426
2451
|
};
|
|
2427
2452
|
|
|
2428
|
-
//# debugId=
|
|
2453
|
+
//# debugId=A3035E23B178A62A64756E2164756E21
|
|
2429
2454
|
//# sourceMappingURL=index.js.map
|