Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/streams.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* StreamsModule — all DripStream + DripFactory operations.
* StreamsModule - all DripStream + DripFactory operations.
*/

import { SorobanRpc, nativeToScVal, xdr, Address, Transaction } from '@stellar/stellar-sdk';
Expand Down Expand Up @@ -33,7 +33,7 @@ import {
import { FactoryModule } from './factory.js';
import { ConduitError, RateLimitError, StreamErrorCode } from './errors.js';

// ── Deprecation warnings ─────────────────────────────────────────────────
// Deprecation warnings

/**
* Tracks which v1-deprecated methods have already warned this session, so
Expand Down Expand Up @@ -109,7 +109,7 @@ export class StreamsModule {
/**
* Resolve the caller address, handling both sync and async getPublicKey().
* Unlike _signerPublicKey(), this can be used when the wallet adapter
* returns a promise — but it MUST only be called from async contexts.
* returns a promise - but it MUST only be called from async contexts.
*/
private async _resolveCallerAddress(): Promise<string> {
if (this.activeWallet) {
Expand Down Expand Up @@ -218,7 +218,7 @@ export class StreamsModule {
return parseStreamInfo(id, addr, val);
}

/** Get withdrawable balance — read-only, no transaction. */
/** Get withdrawable balance - read-only, no transaction. */
async withdrawable(streamId: bigint | string): Promise<bigint> {
const id = BigInt(streamId);
const addr = await this._resolveAddr(id);
Expand Down Expand Up @@ -376,7 +376,7 @@ export class StreamsModule {
return pageFromFilteredIds(await this._factory.streamsByRecipient(recipient, offset, limit));
}

// Neither sender nor recipient — return empty page
// Neither sender nor recipient - return empty page
return { streams: [], hasNextPage: false, totalCount: 0n, offset, limit };
}

Expand All @@ -391,7 +391,7 @@ export class StreamsModule {
return subscribeToStream(this.config.rpcUrl!, address, handlers);
}

/** Synchronous subscribe — resolves address lazily on first poll tick. */
/** Synchronous subscribe - resolves address lazily on first poll tick. */
subscribe(streamId: bigint | string, handlers: StreamEventHandlers): Subscription {
let inner: Subscription | null = null;
let stopped = false;
Expand All @@ -417,7 +417,7 @@ export class StreamsModule {
};
}

// ── Private helpers ──────────────────────────────────────────────────────
// Private helpers

private _ensureCanMutate(): void {
if (!this.activeWallet && !this.config.signer && !this.config.keypair) {
Expand Down Expand Up @@ -535,7 +535,7 @@ export class StreamsModule {
}
}

// ── Parsing ──────────────────────────────────────────────────────────────────
// Parsing

function parseStreamInfo(id: bigint, address: string, val: xdr.ScVal): StreamInfo {
const entries = val.map() ?? [];
Expand Down
Loading