@toon-protocol/sdk 2.1.0 → 2.2.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/{chunk-7LBYFU4L.js → chunk-RAZRWSJF.js} +493 -33
- package/dist/chunk-RAZRWSJF.js.map +1 -0
- package/dist/index.d.ts +24 -3
- package/dist/index.js +25 -1
- package/dist/index.js.map +1 -1
- package/dist/{swap-Oub-0vqU.d.ts → swap-PFQTJZA7.d.ts} +335 -2
- package/dist/swap.d.ts +1 -1
- package/dist/swap.js +21 -1
- package/package.json +1 -1
- package/dist/chunk-7LBYFU4L.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ import { NostrEvent, UnsignedEvent } from 'nostr-tools/pure';
|
|
|
4
4
|
import { ToonRoutingMeta } from '@toon-protocol/core/toon';
|
|
5
5
|
import { TransportConfig } from '@toon-protocol/connector';
|
|
6
6
|
export { TransportConfig } from '@toon-protocol/connector';
|
|
7
|
-
import { A as AccumulatedClaim } from './swap-
|
|
8
|
-
export { a as AdaptiveDeltaController, b as AdaptiveDeltaControllerConfig, D as DecryptFulfillClaimParams, E as EncryptFulfillClaimParams,
|
|
7
|
+
import { R as ReceiptSessionStoreLike, A as AccumulatedClaim } from './swap-PFQTJZA7.js';
|
|
8
|
+
export { a as AdaptiveDeltaController, b as AdaptiveDeltaControllerConfig, B as BoundedReceiptSessions, D as DEFAULT_RECEIPT_SESSIONS_CAP, c as DecryptFulfillClaimParams, E as EncryptFulfillClaimParams, d as EncryptFulfillClaimResult, I as InMemorySwapControllerStateStore, J as JsonFileSwapControllerStateStore, P as PacketObservation, e as PacketProgress, f as PacketResolution, g as RateMonitorCallback, h as ReceiptAddResult, i as ReceiptChainTracker, j as ReceiptSessionState, S as STREAM_RECEIPT_SIGNING_TAG, k as STREAM_RECEIPT_VERSION, l as StreamReceipt, m as StreamReceiptChain, n as StreamReceiptFields, o as StreamSwapAdaptiveController, p as StreamSwapController, q as StreamSwapParams, r as StreamSwapResult, s as SwapControllerError, t as SwapControllerState, u as SwapControllerStateStore, U as UnwrapSwapPacketFromToonParams, v as UnwrapSwapPacketParams, w as UnwrapSwapPacketResult, W as WrapSwapPacketParams, x as WrapSwapPacketResult, y as WrapSwapPacketToToonParams, z as WrapSwapPacketToToonResult, _ as __streamSwapTesting, C as decryptFulfillClaim, F as encodeReceiptSigningPayload, G as encryptFulfillClaim, H as isSwapControllerState, K as isValidStreamNonce, L as issueSessionReceipt, M as parseStreamReceipt, N as serializeReceiptChain, O as signStreamReceipt, Q as streamSwap, T as streamSwapControlled, V as swapControllerStateKey, X as unwrapSwapPacket, Y as unwrapSwapPacketFromToon, Z as verifyStreamReceipt, $ as wrapSwapPacket, a0 as wrapSwapPacketToToon } from './swap-PFQTJZA7.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Unified identity module for @toon-protocol/sdk.
|
|
@@ -1527,6 +1527,27 @@ interface CreateSwapHandlerConfig {
|
|
|
1527
1527
|
* satisfies the contract.
|
|
1528
1528
|
*/
|
|
1529
1529
|
seenPacketIds?: SeenPacketIdsLike;
|
|
1530
|
+
/**
|
|
1531
|
+
* Optional dedicated receipt signing key (issue #84, rfc-0039 stream
|
|
1532
|
+
* receipts; rolling-swap spec §7.2). 32-byte secp256k1 secret key used to
|
|
1533
|
+
* BIP-340-sign the per-fulfill {@link StreamReceipt}. When OMITTED,
|
|
1534
|
+
* receipts are signed with `recipientSecretKey` — the maker's Nostr
|
|
1535
|
+
* identity key — so senders verify against the `swapPubkey` they already
|
|
1536
|
+
* discovered via kind:10032. Provide a separate key when the receipt
|
|
1537
|
+
* signer should be provisioned independently of the identity key (e.g.
|
|
1538
|
+
* the swap#47 coupled engine binding receipts to the chain-B claim
|
|
1539
|
+
* signer); senders then verify via `StreamSwapParams.receiptPubkey`.
|
|
1540
|
+
*/
|
|
1541
|
+
receiptSecretKey?: Uint8Array;
|
|
1542
|
+
/**
|
|
1543
|
+
* Optional receipt session store (issue #84). Tracks per-`streamNonce`
|
|
1544
|
+
* `{seq, cumulativeDelivered}` so receipt totals are monotone within a
|
|
1545
|
+
* session. Defaults to a {@link BoundedReceiptSessions} in-memory LRU.
|
|
1546
|
+
* Operators that persist claims should back this with the same storage so
|
|
1547
|
+
* receipt state survives restarts alongside the claim stream (a lost
|
|
1548
|
+
* session restarts at seq 1, which senders reject as a forked chain).
|
|
1549
|
+
*/
|
|
1550
|
+
receiptSessions?: ReceiptSessionStoreLike;
|
|
1530
1551
|
/** Optional pino-compatible logger. Defaults to a no-op logger. */
|
|
1531
1552
|
logger?: SwapHandlerLogger;
|
|
1532
1553
|
}
|
|
@@ -1980,4 +2001,4 @@ interface StoreHealthResponse {
|
|
|
1980
2001
|
jobsRecent: StoreJobsRecent;
|
|
1981
2002
|
}
|
|
1982
2003
|
|
|
1983
|
-
export { AccumulatedClaim, type AddChunkResult, type ApplyRateParams, type ArweaveDvmConfig, type ArweaveUploadAdapter, type BuildSettlementTxParams, type BuildSettlementTxResult, type BuildSkillDescriptorConfig, ChunkManager, type ChunkManagerConfig, type ClaimIssuer, type CreateHandlerContextOptions, type CreateSwapHandlerConfig, type FromMnemonicOptions, GiftWrapError, type Handler, type HandlerContext, HandlerError, HandlerRegistry, type HandlerResponse, IdentityError, type IssueClaimParams, type IssueClaimResult, type MinaIdentity, type MinaSignerClientLike, type NodeConfig, NodeError, type NodeIdentity, type PaymentHandlerBridgeConfig, type PaymentRequest, type PaymentResponse, type PrefixClaimHandlerOptions, PricingError, type PricingValidationResult, type PricingValidatorConfig, type PublishEventResult, type PublishableNode, type RateQuote, SWAP_HANDLER_REJECT_CODES, SWAP_HANDLER_REJECT_MESSAGES, type ServiceNode, type SettlementBundle, SettlementTxError, type SolanaIdentity, type StartResult, type StoreHealthResponse, type StoreJobsByKindEntry, type StoreJobsByStatus, type StoreJobsRecent, StreamSwapError, SwapHandlerError, type SwapHandlerLogger, type SwapSignerConfig, SwarmCoordinator, type SwarmCoordinatorOptions, type SwarmState, type ToonIdentity, TurboUploadAdapter, type UploadBlobChunkedOptions, type UploadBlobOptions, VerificationError, type VerificationPipelineConfig, type VerificationResult, type WorkflowEventStore, WorkflowOrchestrator, type WorkflowOrchestratorOptions, type WorkflowState, applyRate, base58Decode, base58Encode, buildSettlementTx, buildSkillDescriptor, createArweaveDvmHandler, createEventStorageHandler, createHandlerContext, createNode, createPaymentHandlerBridge, createPrefixClaimHandler, createPricingValidator, createSwapHandler, createVerificationPipeline, fillEvmSettlementTxGas, findSwapPair, fromMnemonic, fromMnemonicFull, fromSecretKey, generateMnemonic, generateSolanaKeypair, loadMinaSignerClient, uploadBlob, uploadBlobChunked, verifyAccumulatedClaim, verifyEd25519Signature, verifyMinaSignature };
|
|
2004
|
+
export { AccumulatedClaim, type AddChunkResult, type ApplyRateParams, type ArweaveDvmConfig, type ArweaveUploadAdapter, type BuildSettlementTxParams, type BuildSettlementTxResult, type BuildSkillDescriptorConfig, ChunkManager, type ChunkManagerConfig, type ClaimIssuer, type CreateHandlerContextOptions, type CreateSwapHandlerConfig, type FromMnemonicOptions, GiftWrapError, type Handler, type HandlerContext, HandlerError, HandlerRegistry, type HandlerResponse, IdentityError, type IssueClaimParams, type IssueClaimResult, type MinaIdentity, type MinaSignerClientLike, type NodeConfig, NodeError, type NodeIdentity, type PaymentHandlerBridgeConfig, type PaymentRequest, type PaymentResponse, type PrefixClaimHandlerOptions, PricingError, type PricingValidationResult, type PricingValidatorConfig, type PublishEventResult, type PublishableNode, type RateQuote, ReceiptSessionStoreLike, SWAP_HANDLER_REJECT_CODES, SWAP_HANDLER_REJECT_MESSAGES, type ServiceNode, type SettlementBundle, SettlementTxError, type SolanaIdentity, type StartResult, type StoreHealthResponse, type StoreJobsByKindEntry, type StoreJobsByStatus, type StoreJobsRecent, StreamSwapError, SwapHandlerError, type SwapHandlerLogger, type SwapSignerConfig, SwarmCoordinator, type SwarmCoordinatorOptions, type SwarmState, type ToonIdentity, TurboUploadAdapter, type UploadBlobChunkedOptions, type UploadBlobOptions, VerificationError, type VerificationPipelineConfig, type VerificationResult, type WorkflowEventStore, WorkflowOrchestrator, type WorkflowOrchestratorOptions, type WorkflowState, applyRate, base58Decode, base58Encode, buildSettlementTx, buildSkillDescriptor, createArweaveDvmHandler, createEventStorageHandler, createHandlerContext, createNode, createPaymentHandlerBridge, createPrefixClaimHandler, createPricingValidator, createSwapHandler, createVerificationPipeline, fillEvmSettlementTxGas, findSwapPair, fromMnemonic, fromMnemonicFull, fromSecretKey, generateMnemonic, generateSolanaKeypair, loadMinaSignerClient, uploadBlob, uploadBlobChunked, verifyAccumulatedClaim, verifyEd25519Signature, verifyMinaSignature };
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
|
+
BoundedReceiptSessions,
|
|
3
|
+
DEFAULT_RECEIPT_SESSIONS_CAP,
|
|
2
4
|
GiftWrapError,
|
|
3
5
|
HandlerError,
|
|
4
6
|
IdentityError,
|
|
5
7
|
NodeError,
|
|
6
8
|
PricingError,
|
|
9
|
+
ReceiptChainTracker,
|
|
10
|
+
STREAM_RECEIPT_SIGNING_TAG,
|
|
11
|
+
STREAM_RECEIPT_VERSION,
|
|
7
12
|
SWAP_HANDLER_REJECT_CODES,
|
|
8
13
|
SWAP_HANDLER_REJECT_MESSAGES,
|
|
9
14
|
SettlementTxError,
|
|
@@ -16,6 +21,7 @@ import {
|
|
|
16
21
|
base58Encode,
|
|
17
22
|
createSwapHandler,
|
|
18
23
|
decryptFulfillClaim,
|
|
24
|
+
encodeReceiptSigningPayload,
|
|
19
25
|
encryptFulfillClaim,
|
|
20
26
|
findSwapPair,
|
|
21
27
|
fromMnemonic,
|
|
@@ -23,13 +29,19 @@ import {
|
|
|
23
29
|
fromSecretKey,
|
|
24
30
|
generateMnemonic,
|
|
25
31
|
generateSolanaKeypair,
|
|
32
|
+
isValidStreamNonce,
|
|
33
|
+
issueSessionReceipt,
|
|
34
|
+
parseStreamReceipt,
|
|
35
|
+
serializeReceiptChain,
|
|
36
|
+
signStreamReceipt,
|
|
26
37
|
streamSwap,
|
|
27
38
|
streamSwapControlled,
|
|
28
39
|
unwrapSwapPacket,
|
|
29
40
|
unwrapSwapPacketFromToon,
|
|
41
|
+
verifyStreamReceipt,
|
|
30
42
|
wrapSwapPacket,
|
|
31
43
|
wrapSwapPacketToToon
|
|
32
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-RAZRWSJF.js";
|
|
33
45
|
import "./chunk-UP2VWCW5.js";
|
|
34
46
|
|
|
35
47
|
// src/handler-context.ts
|
|
@@ -3394,7 +3406,9 @@ function verifyAccumulatedClaim(claim, signer, minaSignerClient) {
|
|
|
3394
3406
|
}
|
|
3395
3407
|
export {
|
|
3396
3408
|
AdaptiveDeltaController,
|
|
3409
|
+
BoundedReceiptSessions,
|
|
3397
3410
|
ChunkManager,
|
|
3411
|
+
DEFAULT_RECEIPT_SESSIONS_CAP,
|
|
3398
3412
|
GiftWrapError,
|
|
3399
3413
|
HandlerError,
|
|
3400
3414
|
HandlerRegistry,
|
|
@@ -3403,6 +3417,9 @@ export {
|
|
|
3403
3417
|
JsonFileSwapControllerStateStore,
|
|
3404
3418
|
NodeError,
|
|
3405
3419
|
PricingError,
|
|
3420
|
+
ReceiptChainTracker,
|
|
3421
|
+
STREAM_RECEIPT_SIGNING_TAG,
|
|
3422
|
+
STREAM_RECEIPT_VERSION,
|
|
3406
3423
|
SWAP_HANDLER_REJECT_CODES,
|
|
3407
3424
|
SWAP_HANDLER_REJECT_MESSAGES,
|
|
3408
3425
|
SettlementTxError,
|
|
@@ -3434,6 +3451,7 @@ export {
|
|
|
3434
3451
|
createSwapHandler,
|
|
3435
3452
|
createVerificationPipeline,
|
|
3436
3453
|
decryptFulfillClaim,
|
|
3454
|
+
encodeReceiptSigningPayload,
|
|
3437
3455
|
encryptFulfillClaim,
|
|
3438
3456
|
fillEvmSettlementTxGas,
|
|
3439
3457
|
findSwapPair,
|
|
@@ -3444,8 +3462,13 @@ export {
|
|
|
3444
3462
|
generateSolanaKeypair,
|
|
3445
3463
|
hexToBytes2 as hexToBytes,
|
|
3446
3464
|
isSwapControllerState,
|
|
3465
|
+
isValidStreamNonce,
|
|
3466
|
+
issueSessionReceipt,
|
|
3447
3467
|
loadMinaSignerClient,
|
|
3448
3468
|
minaHashToField,
|
|
3469
|
+
parseStreamReceipt,
|
|
3470
|
+
serializeReceiptChain,
|
|
3471
|
+
signStreamReceipt,
|
|
3449
3472
|
streamSwap,
|
|
3450
3473
|
streamSwapControlled,
|
|
3451
3474
|
swapControllerStateKey,
|
|
@@ -3456,6 +3479,7 @@ export {
|
|
|
3456
3479
|
verifyAccumulatedClaim,
|
|
3457
3480
|
verifyEd25519Signature,
|
|
3458
3481
|
verifyMinaSignature,
|
|
3482
|
+
verifyStreamReceipt,
|
|
3459
3483
|
wrapSwapPacket,
|
|
3460
3484
|
wrapSwapPacketToToon
|
|
3461
3485
|
};
|