@streamflow/stream 11.0.2 → 11.0.4-alpha.p341.d4e1f95

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.
@@ -82,6 +82,9 @@ interface IGetAllData {
82
82
  address: string;
83
83
  type?: StreamType;
84
84
  direction?: StreamDirection;
85
+ filters?: {
86
+ closed?: boolean;
87
+ };
85
88
  }
86
89
  interface ICreateMultiError {
87
90
  recipient: string;
@@ -167,7 +170,6 @@ interface LinearStream {
167
170
  lastRateChangeTime: number;
168
171
  fundsUnlockedAtLastRateChange: BN;
169
172
  oldMetadata: PublicKey;
170
- metadata: PublicKey;
171
173
  type: StreamType;
172
174
  unlocked(currentTimestamp: number): BN;
173
175
  remaining(decimals: number): number;
@@ -398,10 +400,9 @@ declare class Contract implements LinearStream {
398
400
  lastRateChangeTime: number;
399
401
  fundsUnlockedAtLastRateChange: BN;
400
402
  oldMetadata: PublicKey;
401
- metadata: PublicKey;
402
403
  type: StreamType;
403
404
  isAligned: boolean;
404
- constructor(stream: DecodedStream, metadata: PublicKey);
405
+ constructor(stream: DecodedStream);
405
406
  unlocked(currentTimestamp: number): BN;
406
407
  remaining(decimals: number): number;
407
408
  }
@@ -422,7 +423,7 @@ declare class AlignedContract extends Contract implements AlignedStream {
422
423
  expiryTime: number;
423
424
  expiryPercentage: number;
424
425
  floorPrice: number;
425
- constructor(stream: DecodedStream, metadata: PublicKey, alignedProxy: AlignedUnlocksContract);
426
+ constructor(stream: DecodedStream, alignedProxy: AlignedUnlocksContract);
426
427
  }
427
428
  interface DecodedStream {
428
429
  magic: BN;
@@ -503,6 +504,7 @@ declare class SolanaStreamClient {
503
504
  private readonly commitment;
504
505
  readonly alignedProxyProgram: Program<StreamflowAlignedUnlocks>;
505
506
  private readonly schedulingParams;
507
+ private readonly apiClient;
506
508
  /**
507
509
  * Create Stream instance with flat arguments
508
510
  */
@@ -752,7 +754,7 @@ declare class SolanaStreamClient {
752
754
  * @param {IGetAllData} getData - Query parameters including address, stream type filter, and direction filter
753
755
  * @returns Record of stream data
754
756
  */
755
- get({ address, type, direction, }: IGetAllData): Promise<[string, Stream][]>;
757
+ get({ address, type, direction, filters, }: IGetAllData): Promise<[string, Stream][]>;
756
758
  /**
757
759
  * Searches for streams/contracts by providing filters.
758
760
  * @param {ISearchStreams} data - Search by mint, sender, recipient or closed status
@@ -812,6 +814,13 @@ declare class SolanaStreamClient {
812
814
  */
813
815
  isAlignedUnlock(streamPublicKey: PublicKey, senderPublicKey: PublicKey, oldMetadata?: PublicKey): boolean;
814
816
  private flatBuildCreateMultipleTransactionInstructions;
817
+ /**
818
+ * Gets closed streams for a given owner and direction
819
+ * @param owner - Owner address
820
+ * @param direction - Stream direction
821
+ * @returns Record of closed streams
822
+ */
823
+ getClosedStreams(owner: string, direction?: StreamDirection): Promise<Record<string, Stream>>;
815
824
  /**
816
825
  * Utility function to generate metadata for a Contract or return existing Pubkey
817
826
  */
@@ -828,7 +837,7 @@ declare class SolanaStreamClient {
828
837
  * For migrated streams, the aligned proxy PDA was derived from the original (old) metadata key,
829
838
  * so we need to use that instead of the current stream pubkey.
830
839
  */
831
- declare const getOriginalMetadataKey: (streamPubkey: PublicKey, oldMetadata: PublicKey) => PublicKey;
840
+ declare const getMetadataKey: (streamPubkey: PublicKey, oldMetadata: PublicKey) => PublicKey;
832
841
  /**
833
842
  * Calculate total amount of a Contract including all fees.
834
843
  * - first we convert fee floating to a BN with up to 4 decimals precision
@@ -868,6 +877,7 @@ declare function extractSolanaErrorCode(errorText: string, logs?: string[]): str
868
877
  declare const deriveContractPDA: (programId: PublicKey, streamMetadata: PublicKey) => PublicKey;
869
878
  declare const deriveEscrowPDA: (programId: PublicKey, streamMetadata: PublicKey) => PublicKey;
870
879
  declare const deriveTestOraclePDA: (programId: PublicKey, mint: PublicKey, creator: PublicKey) => PublicKey;
880
+ declare const deriveRepopulatedMetadataPDA: (programId: PublicKey, streamMetadata: PublicKey) => PublicKey;
871
881
 
872
882
  interface CreateStreamData {
873
883
  start: BN;
@@ -1107,6 +1117,7 @@ declare const TEST_ORACLE_DISCRIMINATOR: number[];
1107
1117
  declare const CONTRACT_SEED: Buffer$1;
1108
1118
  declare const ESCROW_SEED: Buffer$1;
1109
1119
  declare const TEST_ORACLE_SEED: Buffer$1;
1120
+ declare const REPOPULATED_METADATA_SEED: Buffer$1;
1110
1121
  declare const STREAMFLOW_TREASURY_PUBLIC_KEY: PublicKey;
1111
1122
  declare const WITHDRAWOR = "wdrwhnCv4pzW8beKsbPa4S2UDZrXenjg16KJdKSpb5u";
1112
1123
  declare const WITHDRAWOR_PUBLIC_KEY: PublicKey;
@@ -1185,4 +1196,169 @@ declare const _default: {
1185
1196
  }[];
1186
1197
  };
1187
1198
 
1188
- export { AIRDROP_AMOUNT, AIRDROP_TEST_TOKEN, ALIGNED_COMPUTE_LIMIT, ALIGNED_PRECISION_FACTOR_POW, ALIGNED_UNLOCKS_PROGRAM_ID, type Account, AlignedContract, AlignedProxyErrorCode, type AlignedStream, type AlignedStreamData, type AlignedUnlocksContract, type BatchItem, type BatchItemError, type BatchItemResult, type BatchItemSuccess, CONTRACT_DISCRIMINATOR, CONTRACT_SEED, CREATE_PARAMS_PADDING, type ChangeOracleParams, type ClientCreationOptions, Contract, ContractErrorCode, type CreateParams, type CreateTestOracleParams, DEFAULT_AUTO_CLAIM_FEE_SOL, DEFAULT_CREATION_FEE_SOL, DEFAULT_STREAMFLOW_FEE, type DecodedStream, ESCROW_SEED, FEES_METADATA_SEED, FEE_ORACLE_PUBLIC_KEY, type IAlignedStreamConfig, type IBaseStreamConfig, type ICancelData, type ICreateAlignedStreamData, type ICreateExt, type ICreateLinearStreamData, type ICreateMultiError, type ICreateMultipleAlignedStreamData, type ICreateMultipleLinearStreamData, type ICreateMultipleStreamData, type ICreateResult, type ICreateStreamData, type ICreateStreamExt, type ICreateStreamInstructions, type IFees, type IGetAllData, type IGetFeesData, type IGetOneData, type IInteractData, type IInteractStreamExt, type IMultiTransactionResult, type IPrepareCreateStreamExt, type IPrepareStreamExt, type IRecipient, type ISearchStreams, type ITopUpData, type ITopUpStreamExt, type ITransactionExtWithInstructions, type ITransactionResult, type ITransferData, type IUpdateData, type IWithdrawData, type InstructionGenerator, type LinearStream, MAX_SAFE_UNIX_TIME_VALUE, type MetadataRecipientHashMap, ORIGINAL_CONTRACT_SENDER_OFFSET, type OracleType, type OracleTypeName, PARTNERS_SCHEMA, PARTNER_ORACLE_PROGRAM_ID, PARTNER_SCHEMA, PROGRAM_ID, SOLANA_ERROR_MAP, SOLANA_ERROR_MATCH_REGEX, STREAMFLOW_TREASURY_PUBLIC_KEY, STREAM_STRUCT_OFFSETS, STREAM_STRUCT_OFFSET_CLOSED, STREAM_STRUCT_OFFSET_MINT, STREAM_STRUCT_OFFSET_OLD_METADATA_KEY, STREAM_STRUCT_OFFSET_RECIPIENT, STREAM_STRUCT_OFFSET_SENDER, SolanaStreamClient, type Stream, type StreamClientOptions, StreamDirection, StreamType, TEST_ORACLE_DISCRIMINATOR, TEST_ORACLE_SEED, TX_FINALITY_CONFIRMED, type TestOracle, type TransactionSchedulingOptions, type UpdateTestOracleParams, WITHDRAWOR, WITHDRAWOR_PUBLIC_KEY, WITHDRAW_AVAILABLE_AMOUNT, buildStreamType, calculateTotalAmountToDeposit, calculateUnlockedAmount, cancelStreamInstruction, createStreamInstruction, createUncheckedStreamInstruction, decodeEndTime, decodeStream, deriveContractPDA, deriveEscrowPDA, deriveTestOraclePDA, extractSolanaErrorCode, getOriginalMetadataKey, handleContractError, isAligned, isCliffCloseToDepositedAmount, isCreateAlignedStreamData, isDynamicLock, isTokenLock, isVesting, sendAndConfirmStreamRawTransaction, signAllTransactionWithRecipients, _default as timelockIDL, topupStreamInstruction, transferStreamInstruction, updateStreamInstruction, withdrawStreamInstruction };
1199
+ /**
1200
+ * Chain identifiers supported by Streamflow protocol
1201
+ */
1202
+ type Chain = "SOLANA" | "APTOS" | "ETHEREUM" | "BNB" | "POLYGON" | "SUI";
1203
+ /**
1204
+ * Contract types supported by Streamflow protocol
1205
+ */
1206
+ type ContractType = "VESTING" | "PAYMENT" | "TOKEN_LOCK" | "DYNAMIC_VESTING" | "DYNAMIC_LOCK";
1207
+ /**
1208
+ * Price oracle types for dynamic contracts
1209
+ */
1210
+ type PriceOracleType = "TEST" | "SWITCHBOARD" | "PYTH";
1211
+ /**
1212
+ * Contract schema matching OpenAPI specification
1213
+ * Used for API responses
1214
+ */
1215
+ interface ContractSchema {
1216
+ chain: Chain;
1217
+ programId: string;
1218
+ address: string;
1219
+ oldAddress: string | null;
1220
+ name: string;
1221
+ contractType: ContractType;
1222
+ sender: string;
1223
+ recipient: string;
1224
+ partner: string | null;
1225
+ mint: string;
1226
+ escrow: string | null;
1227
+ amount: string;
1228
+ cliffAmount: string;
1229
+ amountPerPeriod: string;
1230
+ claimedAmount: string;
1231
+ amountUnlockedAtLastRateUpdate: string;
1232
+ period: number;
1233
+ autoClaimPeriod: number;
1234
+ createdDt: string;
1235
+ startDt: string;
1236
+ endDt: string;
1237
+ canceledDt: string | null;
1238
+ pausedDt: string | null;
1239
+ lastClaimedDt: string | null;
1240
+ lastRateUpdateDt: string | null;
1241
+ isClosed: boolean;
1242
+ isFucked: boolean;
1243
+ isPausable: boolean;
1244
+ canTopup: boolean;
1245
+ hasAutoClaim: boolean;
1246
+ isCancelableBySender: boolean;
1247
+ isCancelableByRecipient: boolean;
1248
+ isTransferableBySender: boolean;
1249
+ isTransferableByRecipient: boolean;
1250
+ canUpdateRate: boolean | null;
1251
+ streamflowFee: string;
1252
+ streamflowFeeWithdrawn: string;
1253
+ streamflowFeePercentage: string;
1254
+ partnerFee: string;
1255
+ partnerFeeWithdrawn: string;
1256
+ partnerFeePercentage: string;
1257
+ txFee: string;
1258
+ pauseCumulative: number;
1259
+ creationFee: number | null;
1260
+ creationFeeClaimed: boolean | null;
1261
+ autoClaimFee: number | null;
1262
+ autoClaimFeeClaimed: boolean | null;
1263
+ lastUpdateSlot: number | null;
1264
+ dynamicContract: DynamicContractSchema | null;
1265
+ }
1266
+ /**
1267
+ * Dynamic contract schema for aligned stream data
1268
+ * Used for API responses with price-based streams
1269
+ */
1270
+ interface DynamicContractSchema {
1271
+ chain: Chain;
1272
+ programId: string;
1273
+ address: string;
1274
+ contractAddress: string;
1275
+ sender: string;
1276
+ priceOracleType: PriceOracleType | null;
1277
+ priceOracleAddress: string | null;
1278
+ minPrice: string;
1279
+ maxPrice: string;
1280
+ minPercentage: string;
1281
+ maxPercentage: string;
1282
+ tickSize: string;
1283
+ expiryDt: string | null;
1284
+ expiryPercentage: string;
1285
+ floorPrice: string;
1286
+ lastPrice: string;
1287
+ initialAmountPerPeriod: string;
1288
+ initialPrice: string;
1289
+ initialAmount: string;
1290
+ lastUpdateSlot: number | null;
1291
+ streamCanceledTime: string | number | null;
1292
+ }
1293
+ /**
1294
+ * TabulariumContract interface
1295
+ * Mirrors LinearStream with primitive types for API/public usage
1296
+ * All addresses are strings, timestamps are numbers, amounts are BN
1297
+ */
1298
+ interface TabulariumContract {
1299
+ address: string;
1300
+ sender: string;
1301
+ senderTokens: string;
1302
+ recipient: string;
1303
+ recipientTokens: string;
1304
+ partner: string;
1305
+ partnerTokens: string;
1306
+ mint: string;
1307
+ escrowTokens: string;
1308
+ streamflowTreasury: string;
1309
+ streamflowTreasuryTokens: string;
1310
+ depositedAmount: BN;
1311
+ withdrawnAmount: BN;
1312
+ cliffAmount: BN;
1313
+ amountPerPeriod: BN;
1314
+ streamflowFeeTotal: BN;
1315
+ streamflowFeeWithdrawn: BN;
1316
+ partnerFeeTotal: BN;
1317
+ partnerFeeWithdrawn: BN;
1318
+ pauseCumulative: BN;
1319
+ fundsUnlockedAtLastRateChange: BN;
1320
+ start: number;
1321
+ end: number;
1322
+ cliff: number;
1323
+ createdAt: number;
1324
+ canceledAt: number;
1325
+ lastWithdrawnAt: number;
1326
+ lastRateChangeTime: number;
1327
+ currentPauseStart: number;
1328
+ period: number;
1329
+ withdrawalFrequency: number;
1330
+ streamflowFeePercent: number;
1331
+ partnerFeePercent: number;
1332
+ cancelableBySender: boolean;
1333
+ cancelableByRecipient: boolean;
1334
+ transferableBySender: boolean;
1335
+ transferableByRecipient: boolean;
1336
+ canTopup: boolean;
1337
+ automaticWithdrawal: boolean;
1338
+ closed: boolean;
1339
+ name: string;
1340
+ type: StreamType;
1341
+ isAligned: boolean;
1342
+ magic: number;
1343
+ version: number;
1344
+ oldMetadata: string;
1345
+ }
1346
+
1347
+ interface ApiClientOptions {
1348
+ apiUrl?: string;
1349
+ cluster?: "mainnet" | "devnet";
1350
+ fetchFn?: typeof fetch;
1351
+ }
1352
+ interface GetContractsOptions {
1353
+ sender?: string;
1354
+ recipient?: string;
1355
+ }
1356
+ interface ApiClient {
1357
+ getContracts: (opts?: GetContractsOptions) => Promise<ContractSchema[]>;
1358
+ getContract: (address: string) => Promise<ContractSchema>;
1359
+ }
1360
+ declare const createClient: (options?: ApiClientOptions) => ApiClient;
1361
+
1362
+ declare const transformContract: (schema: ContractSchema) => Promise<Stream>;
1363
+
1364
+ export { AIRDROP_AMOUNT, AIRDROP_TEST_TOKEN, ALIGNED_COMPUTE_LIMIT, ALIGNED_PRECISION_FACTOR_POW, ALIGNED_UNLOCKS_PROGRAM_ID, type Account, AlignedContract, AlignedProxyErrorCode, type AlignedStream, type AlignedStreamData, type AlignedUnlocksContract, type ApiClient, type ApiClientOptions, type BatchItem, type BatchItemError, type BatchItemResult, type BatchItemSuccess, CONTRACT_DISCRIMINATOR, CONTRACT_SEED, CREATE_PARAMS_PADDING, type Chain, type ChangeOracleParams, type ClientCreationOptions, Contract, ContractErrorCode, type ContractSchema, type ContractType, type CreateParams, type CreateTestOracleParams, DEFAULT_AUTO_CLAIM_FEE_SOL, DEFAULT_CREATION_FEE_SOL, DEFAULT_STREAMFLOW_FEE, type DecodedStream, type DynamicContractSchema, ESCROW_SEED, FEES_METADATA_SEED, FEE_ORACLE_PUBLIC_KEY, type GetContractsOptions, type IAlignedStreamConfig, type IBaseStreamConfig, type ICancelData, type ICreateAlignedStreamData, type ICreateExt, type ICreateLinearStreamData, type ICreateMultiError, type ICreateMultipleAlignedStreamData, type ICreateMultipleLinearStreamData, type ICreateMultipleStreamData, type ICreateResult, type ICreateStreamData, type ICreateStreamExt, type ICreateStreamInstructions, type IFees, type IGetAllData, type IGetFeesData, type IGetOneData, type IInteractData, type IInteractStreamExt, type IMultiTransactionResult, type IPrepareCreateStreamExt, type IPrepareStreamExt, type IRecipient, type ISearchStreams, type ITopUpData, type ITopUpStreamExt, type ITransactionExtWithInstructions, type ITransactionResult, type ITransferData, type IUpdateData, type IWithdrawData, type InstructionGenerator, type LinearStream, MAX_SAFE_UNIX_TIME_VALUE, type MetadataRecipientHashMap, ORIGINAL_CONTRACT_SENDER_OFFSET, type OracleType, type OracleTypeName, PARTNERS_SCHEMA, PARTNER_ORACLE_PROGRAM_ID, PARTNER_SCHEMA, PROGRAM_ID, type PriceOracleType, REPOPULATED_METADATA_SEED, SOLANA_ERROR_MAP, SOLANA_ERROR_MATCH_REGEX, STREAMFLOW_TREASURY_PUBLIC_KEY, STREAM_STRUCT_OFFSETS, STREAM_STRUCT_OFFSET_CLOSED, STREAM_STRUCT_OFFSET_MINT, STREAM_STRUCT_OFFSET_OLD_METADATA_KEY, STREAM_STRUCT_OFFSET_RECIPIENT, STREAM_STRUCT_OFFSET_SENDER, SolanaStreamClient, type Stream, type StreamClientOptions, StreamDirection, StreamType, TEST_ORACLE_DISCRIMINATOR, TEST_ORACLE_SEED, TX_FINALITY_CONFIRMED, type TabulariumContract, type TestOracle, type TransactionSchedulingOptions, type UpdateTestOracleParams, WITHDRAWOR, WITHDRAWOR_PUBLIC_KEY, WITHDRAW_AVAILABLE_AMOUNT, buildStreamType, calculateTotalAmountToDeposit, calculateUnlockedAmount, cancelStreamInstruction, createClient, createStreamInstruction, createUncheckedStreamInstruction, decodeEndTime, decodeStream, deriveContractPDA, deriveEscrowPDA, deriveRepopulatedMetadataPDA, deriveTestOraclePDA, extractSolanaErrorCode, getMetadataKey, handleContractError, isAligned, isCliffCloseToDepositedAmount, isCreateAlignedStreamData, isDynamicLock, isTokenLock, isVesting, sendAndConfirmStreamRawTransaction, signAllTransactionWithRecipients, _default as timelockIDL, topupStreamInstruction, transferStreamInstruction, transformContract, updateStreamInstruction, withdrawStreamInstruction };
@@ -3,7 +3,7 @@ import bs58 from 'bs58';
3
3
  import { Buffer } from 'buffer';
4
4
  import { NATIVE_MINT, ASSOCIATED_TOKEN_PROGRAM_ID } from '@solana/spl-token';
5
5
  import { PublicKey, TransactionInstruction, Connection, Keypair, SYSVAR_RENT_PUBKEY, SystemProgram, TransactionMessage, VersionedTransaction } from '@solana/web3.js';
6
- import { ICluster, getNumberFromBN, isSignerKeypair, isSignerWallet, executeTransaction, ContractError, buildSendThrottler, assertHasPublicKey, prepareWrappedAccount, prepareTransaction, signAndExecuteTransaction, invariant, getMintAndProgram, prepareBaseInstructions, getBN, ata, createVersionedTransaction, executeMultipleTransactions, pk, getMultipleAccountsInfoBatched, getProgramAccounts, checkOrCreateAtaBatch } from '@streamflow/common';
6
+ import { ICluster, getNumberFromBN, isSignerKeypair, isSignerWallet, executeTransaction, ContractError, buildSendThrottler, assertHasPublicKey, prepareWrappedAccount, prepareTransaction, signAndExecuteTransaction, invariant, getMintAndProgram, prepareBaseInstructions, getBN, ata, createVersionedTransaction, executeMultipleTransactions, getMultipleAccountsInfoBatched, getProgramAccounts, isDev, checkOrCreateAtaBatch, pk } from '@streamflow/common';
7
7
  export { ContractError, ICluster, getBN, getNumberFromBN } from '@streamflow/common';
8
8
  import * as borsh from 'borsh';
9
9
  import { Program } from '@coral-xyz/anchor';
@@ -116,7 +116,7 @@ var AlignedProxyErrorCode = /* @__PURE__ */ ((AlignedProxyErrorCode2) => {
116
116
  return AlignedProxyErrorCode2;
117
117
  })(AlignedProxyErrorCode || {});
118
118
  var Contract = class {
119
- constructor(stream, metadata) {
119
+ constructor(stream) {
120
120
  this.magic = stream.magic.toNumber();
121
121
  this.version = stream.version.toNumber();
122
122
  this.createdAt = stream.createdAt.toNumber();
@@ -160,7 +160,6 @@ var Contract = class {
160
160
  this.lastRateChangeTime = stream.lastRateChangeTime.toNumber();
161
161
  this.fundsUnlockedAtLastRateChange = stream.fundsUnlockedAtLastRateChange;
162
162
  this.oldMetadata = stream.oldMetadata;
163
- this.metadata = metadata;
164
163
  this.type = buildStreamType(this);
165
164
  this.isAligned = false;
166
165
  }
@@ -175,8 +174,8 @@ var Contract = class {
175
174
  }
176
175
  };
177
176
  var AlignedContract = class extends Contract {
178
- constructor(stream, metadata, alignedProxy) {
179
- super(stream, metadata);
177
+ constructor(stream, alignedProxy) {
178
+ super(stream);
180
179
  this.minPrice = getNumberFromBN(alignedProxy.minPrice, ALIGNED_PRECISION_FACTOR_POW);
181
180
  this.maxPrice = getNumberFromBN(alignedProxy.maxPrice, ALIGNED_PRECISION_FACTOR_POW);
182
181
  this.minPercentage = getNumberFromBN(alignedProxy.minPercentage, ALIGNED_PRECISION_FACTOR_POW);
@@ -246,6 +245,7 @@ var TEST_ORACLE_DISCRIMINATOR = [198, 49, 63, 134, 232, 251, 168, 28];
246
245
  var CONTRACT_SEED = Buffer.from("contract", "utf-8");
247
246
  var ESCROW_SEED = Buffer.from("strm", "utf-8");
248
247
  var TEST_ORACLE_SEED = Buffer.from("test-oracle", "utf-8");
248
+ var REPOPULATED_METADATA_SEED = Buffer.from("strm-rep", "utf-8");
249
249
  var STREAMFLOW_TREASURY_PUBLIC_KEY = new PublicKey("5SEpbdjFK5FxwTvfsGMXVQTD2v4M2c5tyRTxhdsPkgDw");
250
250
  var WITHDRAWOR = "wdrwhnCv4pzW8beKsbPa4S2UDZrXenjg16KJdKSpb5u";
251
251
  var WITHDRAWOR_PUBLIC_KEY = new PublicKey(WITHDRAWOR);
@@ -470,7 +470,7 @@ var encodeUpdateStream = (values, data) => {
470
470
  var topupStreamLayout = BufferLayout.struct([
471
471
  BufferLayout.blob(8, "amount")
472
472
  ]);
473
- var getOriginalMetadataKey = (streamPubkey, oldMetadata) => {
473
+ var getMetadataKey = (streamPubkey, oldMetadata) => {
474
474
  if (PublicKey.default.equals(oldMetadata)) {
475
475
  return streamPubkey;
476
476
  }
@@ -2513,6 +2513,149 @@ var deriveEscrowPDA = (programId, streamMetadata) => {
2513
2513
  var deriveTestOraclePDA = (programId, mint, creator) => {
2514
2514
  return PublicKey.findProgramAddressSync([TEST_ORACLE_SEED, mint.toBuffer(), creator.toBuffer()], programId)[0];
2515
2515
  };
2516
+ var deriveRepopulatedMetadataPDA = (programId, streamMetadata) => {
2517
+ return PublicKey.findProgramAddressSync([REPOPULATED_METADATA_SEED, streamMetadata.toBuffer()], programId)[0];
2518
+ };
2519
+
2520
+ // solana/api-public/client.ts
2521
+ var DEFAULT_API_URL = "https://api-public.streamflow.finance";
2522
+ var DEFAULT_DEVNET_API_URL = "https://api-public-staging.streamflow.finance";
2523
+ var createClient = (options) => {
2524
+ const apiUrl = options?.apiUrl ?? options?.cluster === "mainnet" ? DEFAULT_API_URL : DEFAULT_DEVNET_API_URL;
2525
+ const fetchFn = options?.fetchFn ?? fetch;
2526
+ const fetchResource = async (url, options2) => {
2527
+ const res = await fetchFn(url, {
2528
+ method: "GET",
2529
+ headers: { "Content-Type": "application/json" },
2530
+ ...{}
2531
+ });
2532
+ if (!res.ok) {
2533
+ const text = await res.text().catch(() => "");
2534
+ throw new Error(`Tabularium API error`, {
2535
+ cause: new Error(`: ${res.status} ${res.statusText}${text ? ` - ${text}` : ""}`)
2536
+ });
2537
+ }
2538
+ return res.json();
2539
+ };
2540
+ return {
2541
+ getContracts: async (opts) => {
2542
+ const params = new URLSearchParams();
2543
+ if (opts?.sender) params.set("sender", opts.sender);
2544
+ if (opts?.recipient) params.set("recipient", opts.recipient);
2545
+ const url = `${apiUrl}/v2/api/contracts/tabularium/${params.toString() ? `?${params.toString()}` : ""}`;
2546
+ return fetchResource(url);
2547
+ },
2548
+ getContract: async (address) => {
2549
+ const url = `${apiUrl}/v2/api/contracts/tabularium/${encodeURIComponent(address)}`;
2550
+ return fetchResource(url);
2551
+ }
2552
+ };
2553
+ };
2554
+ var isoToUnix = (iso) => {
2555
+ if (!iso) return 0;
2556
+ const time = new Date(iso).getTime();
2557
+ return Number.isNaN(time) ? 0 : Math.floor(time / 1e3);
2558
+ };
2559
+ var toBN = (value) => new BN3(value);
2560
+ var mapOracleType = (apiType) => {
2561
+ if (!apiType) return { none: {} };
2562
+ const mapping = {
2563
+ TEST: { test: {} },
2564
+ PYTH: { pyth: {} },
2565
+ SWITCHBOARD: { switchboard: {} }
2566
+ };
2567
+ return mapping[apiType] ?? { none: {} };
2568
+ };
2569
+ async function toDecodedStream(schema) {
2570
+ const mint = pk(schema.mint);
2571
+ const sender = pk(schema.sender);
2572
+ const recipient = pk(schema.recipient);
2573
+ const partner = schema.partner ? pk(schema.partner) : sender;
2574
+ const [senderTokens, recipientTokens, partnerTokens, streamflowTreasuryTokens] = await Promise.all([
2575
+ ata(mint, sender),
2576
+ ata(mint, recipient),
2577
+ ata(mint, partner),
2578
+ ata(mint, STREAMFLOW_TREASURY_PUBLIC_KEY)
2579
+ ]);
2580
+ return {
2581
+ magic: toBN(4),
2582
+ version: toBN(4),
2583
+ createdAt: toBN(isoToUnix(schema.createdDt)),
2584
+ withdrawnAmount: toBN(schema.claimedAmount),
2585
+ canceledAt: toBN(isoToUnix(schema.canceledDt)),
2586
+ end: toBN(isoToUnix(schema.endDt)),
2587
+ lastWithdrawnAt: toBN(isoToUnix(schema.lastClaimedDt)),
2588
+ sender,
2589
+ senderTokens,
2590
+ recipient,
2591
+ recipientTokens,
2592
+ mint,
2593
+ escrowTokens: schema.escrow ? pk(schema.escrow) : PublicKey.default,
2594
+ streamflowTreasury: STREAMFLOW_TREASURY_PUBLIC_KEY,
2595
+ streamflowTreasuryTokens,
2596
+ streamflowFeeTotal: toBN(schema.streamflowFee),
2597
+ streamflowFeeWithdrawn: toBN(schema.streamflowFeeWithdrawn),
2598
+ streamflowFeePercent: parseFloat(schema.streamflowFeePercentage) || 0,
2599
+ partnerFeeTotal: toBN(schema.partnerFee),
2600
+ partnerFeeWithdrawn: toBN(schema.partnerFeeWithdrawn),
2601
+ partnerFeePercent: parseFloat(schema.partnerFeePercentage) || 0,
2602
+ partner,
2603
+ partnerTokens,
2604
+ start: toBN(isoToUnix(schema.startDt)),
2605
+ depositedAmount: toBN(schema.amount),
2606
+ period: toBN(schema.period),
2607
+ amountPerPeriod: toBN(schema.amountPerPeriod),
2608
+ cliff: toBN(isoToUnix(schema.startDt)),
2609
+ cliffAmount: toBN(schema.cliffAmount),
2610
+ cancelableBySender: schema.isCancelableBySender,
2611
+ cancelableByRecipient: schema.isCancelableByRecipient,
2612
+ automaticWithdrawal: schema.hasAutoClaim,
2613
+ transferableBySender: schema.isTransferableBySender,
2614
+ transferableByRecipient: schema.isTransferableByRecipient,
2615
+ canTopup: schema.canTopup,
2616
+ name: schema.name,
2617
+ withdrawFrequency: toBN(schema.autoClaimPeriod),
2618
+ closed: schema.isClosed,
2619
+ currentPauseStart: toBN(0),
2620
+ pauseCumulative: toBN(schema.pauseCumulative),
2621
+ lastRateChangeTime: toBN(isoToUnix(schema.lastRateUpdateDt)),
2622
+ fundsUnlockedAtLastRateChange: toBN(schema.amountUnlockedAtLastRateUpdate),
2623
+ oldMetadata: PublicKey.default
2624
+ };
2625
+ }
2626
+ function toPrecisionBN(value, precision = ALIGNED_PRECISION_FACTOR_POW2) {
2627
+ return getBN(typeof value === "number" ? value : parseFloat(value), precision);
2628
+ }
2629
+ function toAlignedProxy(dynamic) {
2630
+ const proxy = {
2631
+ sender: pk(dynamic.sender),
2632
+ minPrice: toPrecisionBN(dynamic.minPrice),
2633
+ maxPrice: toPrecisionBN(dynamic.maxPrice),
2634
+ minPercentage: toPrecisionBN(dynamic.minPercentage),
2635
+ maxPercentage: toPrecisionBN(dynamic.maxPercentage),
2636
+ priceOracleType: mapOracleType(dynamic.priceOracleType),
2637
+ priceOracle: dynamic.priceOracleAddress ? pk(dynamic.priceOracleAddress) : PublicKey.default,
2638
+ tickSize: toPrecisionBN(dynamic.tickSize),
2639
+ initialAmountPerPeriod: toBN(dynamic.initialAmountPerPeriod),
2640
+ initialPrice: toPrecisionBN(dynamic.initialPrice),
2641
+ lastPrice: toPrecisionBN(dynamic.lastPrice),
2642
+ lastAmountUpdateTime: toBN(isoToUnix(dynamic.expiryDt)),
2643
+ initialNetAmount: toBN(dynamic.initialAmount),
2644
+ expiryTime: toBN(isoToUnix(dynamic.expiryDt)),
2645
+ expiryPercentage: toPrecisionBN(dynamic.expiryPercentage),
2646
+ floorPrice: toPrecisionBN(dynamic.floorPrice),
2647
+ streamCanceledTime: dynamic.streamCanceledTime ? toBN(dynamic.streamCanceledTime) : toBN(0)
2648
+ };
2649
+ return proxy;
2650
+ }
2651
+ var transformContract = async (schema) => {
2652
+ const decodedStream = await toDecodedStream(schema);
2653
+ if (schema.dynamicContract) {
2654
+ const alignedProxy = toAlignedProxy(schema.dynamicContract);
2655
+ return new AlignedContract(decodedStream, alignedProxy);
2656
+ }
2657
+ return new Contract(decodedStream);
2658
+ };
2516
2659
 
2517
2660
  // solana/StreamClient.ts
2518
2661
  var METADATA_ACC_SIZE = 1104;
@@ -2556,6 +2699,9 @@ var SolanaStreamClient = class {
2556
2699
  address: streamflow_aligned_unlocks_default.address
2557
2700
  };
2558
2701
  this.alignedProxyProgram = new Program(alignedUnlocksProgram, { connection: this.connection });
2702
+ this.apiClient = createClient(
2703
+ typeof optionsOrClusterUrl === "object" && optionsOrClusterUrl.cluster !== ICluster.Mainnet ? { cluster: "devnet" } : { cluster: "mainnet" }
2704
+ );
2559
2705
  }
2560
2706
  getConnection() {
2561
2707
  return this.connection;
@@ -3571,14 +3717,19 @@ var SolanaStreamClient = class {
3571
3717
  }
3572
3718
  ]
3573
3719
  });
3574
- if (migrated.length === 0) {
3575
- throw new Error("Couldn't get account info.");
3720
+ if (migrated.length > 0) {
3721
+ return this.decodeStreamAccount(migrated[0].pubkey, migrated[0].account.data);
3722
+ }
3723
+ try {
3724
+ const contract = await this.apiClient.getContract(id);
3725
+ return await transformContract(contract);
3726
+ } catch (cause) {
3727
+ throw new Error(`Couldn't get account info from chain or Tabularium`, { cause });
3576
3728
  }
3577
- return this.decodeStreamAccount(migrated[0].pubkey, migrated[0].account.data);
3578
3729
  }
3579
3730
  async decodeStreamAccount(pubkey, data) {
3580
3731
  const stream = decodeStream(data);
3581
- const metadataKey = getOriginalMetadataKey(pubkey, stream.oldMetadata);
3732
+ const metadataKey = getMetadataKey(pubkey, stream.oldMetadata);
3582
3733
  if (this.isAlignedUnlock(pubkey, stream.sender, stream.oldMetadata)) {
3583
3734
  const alignedProxy = await this.alignedProxyProgram.account.contract.fetch(
3584
3735
  deriveContractPDA(this.alignedProxyProgram.programId, metadataKey)
@@ -3586,9 +3737,9 @@ var SolanaStreamClient = class {
3586
3737
  if (!alignedProxy) {
3587
3738
  throw new Error("Couldn't get proxy account info.");
3588
3739
  }
3589
- return new AlignedContract(stream, pk(pubkey), alignedProxy);
3740
+ return new AlignedContract(stream, alignedProxy);
3590
3741
  }
3591
- return new Contract(stream, pk(pubkey));
3742
+ return new Contract(stream);
3592
3743
  }
3593
3744
  /**
3594
3745
  * Fetch all aligned outgoing streams/contracts by the provided public key.
@@ -3613,7 +3764,7 @@ var SolanaStreamClient = class {
3613
3764
  streamAccounts.forEach((account, index) => {
3614
3765
  if (account) {
3615
3766
  const alignedData = alignedOutgoingProgramAccounts[index].account;
3616
- streams[streamPubKeys[index].toBase58()] = new AlignedContract(decodeStream(account.data), pk(streamPubKeys[index]), alignedData);
3767
+ streams[streamPubKeys[index].toBase58()] = new AlignedContract(decodeStream(account.data), alignedData);
3617
3768
  }
3618
3769
  });
3619
3770
  return streams;
@@ -3623,7 +3774,7 @@ var SolanaStreamClient = class {
3623
3774
  const alignedStreamsPubKeys = Object.keys(streamRecord);
3624
3775
  const alignedProxyPDAs = alignedStreamsPubKeys.map((streamPubKey) => {
3625
3776
  const pubkey = new PublicKey(streamPubKey);
3626
- const metadataKey = getOriginalMetadataKey(pubkey, streamRecord[streamPubKey].oldMetadata);
3777
+ const metadataKey = getMetadataKey(pubkey, streamRecord[streamPubKey].oldMetadata);
3627
3778
  return deriveContractPDA(this.alignedProxyProgram.programId, metadataKey);
3628
3779
  });
3629
3780
  const alignedProxyAccounts = await getMultipleAccountsInfoBatched(this.connection, alignedProxyPDAs);
@@ -3632,7 +3783,6 @@ var SolanaStreamClient = class {
3632
3783
  const alignedData = streamRecord[alignedStreamsPubKeys[index]];
3633
3784
  streams[alignedStreamsPubKeys[index]] = new AlignedContract(
3634
3785
  alignedData,
3635
- pk(alignedStreamsPubKeys[index]),
3636
3786
  this.alignedProxyProgram.account.contract.coder.accounts.decode("contract", account.data)
3637
3787
  );
3638
3788
  }
@@ -3648,7 +3798,8 @@ var SolanaStreamClient = class {
3648
3798
  async get({
3649
3799
  address,
3650
3800
  type = "all" /* All */,
3651
- direction = "all" /* All */
3801
+ direction = "all" /* All */,
3802
+ filters
3652
3803
  }) {
3653
3804
  const publicKey = new PublicKey(address);
3654
3805
  let streams = {};
@@ -3661,7 +3812,7 @@ var SolanaStreamClient = class {
3661
3812
  this.programId
3662
3813
  );
3663
3814
  outgoingStreamAccounts.forEach((account) => {
3664
- streams[account.pubkey.toBase58()] = new Contract(decodeStream(account.account.data), pk(account.pubkey));
3815
+ streams[account.pubkey.toBase58()] = new Contract(decodeStream(account.account.data));
3665
3816
  });
3666
3817
  if (shouldFetchAligned) {
3667
3818
  const alignedStreams = await this.getOutgoingAlignedStreams(address);
@@ -3681,7 +3832,7 @@ var SolanaStreamClient = class {
3681
3832
  if (this.isAlignedUnlock(account.pubkey, allIncomingStreams[index].sender, allIncomingStreams[index].oldMetadata)) {
3682
3833
  alignedDecoded[account.pubkey.toBase58()] = allIncomingStreams[index];
3683
3834
  } else {
3684
- streams[account.pubkey.toBase58()] = new Contract(allIncomingStreams[index], pk(account.pubkey));
3835
+ streams[account.pubkey.toBase58()] = new Contract(allIncomingStreams[index]);
3685
3836
  }
3686
3837
  });
3687
3838
  if (shouldFetchAligned) {
@@ -3689,6 +3840,10 @@ var SolanaStreamClient = class {
3689
3840
  streams = { ...streams, ...incomingAlignedStreams };
3690
3841
  }
3691
3842
  }
3843
+ if (filters?.closed) {
3844
+ const closedStreams = await this.getClosedStreams(address, direction);
3845
+ streams = { ...streams, ...closedStreams };
3846
+ }
3692
3847
  const sortedStreams = Object.entries(streams).sort(([, stream1], [, stream2]) => stream2.start - stream1.start);
3693
3848
  if (type === "all" /* All */) return sortedStreams;
3694
3849
  return sortedStreams.filter((stream) => stream[1].type === type);
@@ -3724,7 +3879,7 @@ var SolanaStreamClient = class {
3724
3879
  const entries = [];
3725
3880
  decoded.forEach(({ pubkey, stream }, index) => {
3726
3881
  if (this.isAlignedUnlock(pubkey, stream.sender, stream.oldMetadata)) {
3727
- const metadataKey = getOriginalMetadataKey(pubkey, stream.oldMetadata);
3882
+ const metadataKey = getMetadataKey(pubkey, stream.oldMetadata);
3728
3883
  entries.push({ index, pda: deriveContractPDA(this.alignedProxyProgram.programId, metadataKey) });
3729
3884
  }
3730
3885
  });
@@ -3741,9 +3896,9 @@ var SolanaStreamClient = class {
3741
3896
  if (alignedIdx !== -1) {
3742
3897
  const alignedProxy = alignedProxies[alignedIdx];
3743
3898
  invariant(alignedProxy, "Couldn't get aligned proxy account info");
3744
- return { publicKey: pubkey, account: new AlignedContract(stream, pk(pubkey), alignedProxy) };
3899
+ return { publicKey: pubkey, account: new AlignedContract(stream, alignedProxy) };
3745
3900
  }
3746
- return { publicKey: pubkey, account: new Contract(stream, pk(pubkey)) };
3901
+ return { publicKey: pubkey, account: new Contract(stream) };
3747
3902
  });
3748
3903
  }
3749
3904
  /**
@@ -3881,7 +4036,7 @@ var SolanaStreamClient = class {
3881
4036
  * For migrated streams, the PDA was derived from the old metadata key.
3882
4037
  */
3883
4038
  isAlignedUnlock(streamPublicKey, senderPublicKey, oldMetadata) {
3884
- const metadataKey = oldMetadata ? getOriginalMetadataKey(streamPublicKey, oldMetadata) : streamPublicKey;
4039
+ const metadataKey = oldMetadata ? getMetadataKey(streamPublicKey, oldMetadata) : streamPublicKey;
3885
4040
  const pda = deriveContractPDA(this.alignedProxyProgram.programId, metadataKey);
3886
4041
  return senderPublicKey.equals(pda);
3887
4042
  }
@@ -3900,6 +4055,40 @@ var SolanaStreamClient = class {
3900
4055
  )
3901
4056
  };
3902
4057
  }
4058
+ /**
4059
+ * Gets closed streams for a given owner and direction
4060
+ * @param owner - Owner address
4061
+ * @param direction - Stream direction
4062
+ * @returns Record of closed streams
4063
+ */
4064
+ async getClosedStreams(owner, direction = "all" /* All */) {
4065
+ const streams = {};
4066
+ try {
4067
+ const tabulariumContracts = await this.apiClient.getContracts({
4068
+ sender: direction !== "incoming" /* Incoming */ ? owner : void 0,
4069
+ recipient: direction !== "outgoing" /* Outgoing */ ? owner : void 0
4070
+ });
4071
+ for (const contract of tabulariumContracts) {
4072
+ if (!streams[contract.address]) {
4073
+ try {
4074
+ const transformed = await transformContract(contract);
4075
+ streams[contract.address] = transformed;
4076
+ } catch (cause) {
4077
+ if (isDev) {
4078
+ throw new Error(`Failed to transform contract ${contract.address}:`, { cause });
4079
+ }
4080
+ console.warn(new Error(`Failed to transform contract ${contract.address}:`, { cause }));
4081
+ }
4082
+ }
4083
+ }
4084
+ } catch (cause) {
4085
+ if (isDev) {
4086
+ throw new Error("Failed to get data from the service", { cause });
4087
+ }
4088
+ console.warn(new Error("Failed to get data from the service", { cause }));
4089
+ }
4090
+ return streams;
4091
+ }
3903
4092
  /**
3904
4093
  * Utility function to generate metadata for a Contract or return existing Pubkey
3905
4094
  */
@@ -4359,6 +4548,6 @@ var timelockIDL_default = {
4359
4548
  ]
4360
4549
  };
4361
4550
 
4362
- export { AIRDROP_AMOUNT, AIRDROP_TEST_TOKEN, ALIGNED_COMPUTE_LIMIT, ALIGNED_PRECISION_FACTOR_POW2 as ALIGNED_PRECISION_FACTOR_POW, ALIGNED_UNLOCKS_PROGRAM_ID, AlignedContract, AlignedProxyErrorCode, CONTRACT_DISCRIMINATOR, CONTRACT_SEED, CREATE_PARAMS_PADDING, Contract, ContractErrorCode, DEFAULT_AUTO_CLAIM_FEE_SOL, DEFAULT_CREATION_FEE_SOL, DEFAULT_STREAMFLOW_FEE, ESCROW_SEED, FEES_METADATA_SEED, FEE_ORACLE_PUBLIC_KEY, MAX_SAFE_UNIX_TIME_VALUE2 as MAX_SAFE_UNIX_TIME_VALUE, ORIGINAL_CONTRACT_SENDER_OFFSET, PARTNERS_SCHEMA, PARTNER_ORACLE_PROGRAM_ID, PARTNER_SCHEMA, PROGRAM_ID, SOLANA_ERROR_MAP, SOLANA_ERROR_MATCH_REGEX, STREAMFLOW_TREASURY_PUBLIC_KEY, STREAM_STRUCT_OFFSETS, STREAM_STRUCT_OFFSET_CLOSED, STREAM_STRUCT_OFFSET_MINT, STREAM_STRUCT_OFFSET_OLD_METADATA_KEY, STREAM_STRUCT_OFFSET_RECIPIENT, STREAM_STRUCT_OFFSET_SENDER, SolanaStreamClient, StreamDirection, StreamType, TEST_ORACLE_DISCRIMINATOR, TEST_ORACLE_SEED, TX_FINALITY_CONFIRMED, WITHDRAWOR, WITHDRAWOR_PUBLIC_KEY, WITHDRAW_AVAILABLE_AMOUNT, buildStreamType, calculateTotalAmountToDeposit, calculateUnlockedAmount, cancelStreamInstruction, createStreamInstruction, createUncheckedStreamInstruction, decodeEndTime, decodeStream, deriveContractPDA, deriveEscrowPDA, deriveTestOraclePDA, extractSolanaErrorCode, getOriginalMetadataKey, handleContractError, isAligned, isCliffCloseToDepositedAmount, isCreateAlignedStreamData, isDynamicLock, isTokenLock, isVesting, sendAndConfirmStreamRawTransaction, signAllTransactionWithRecipients, timelockIDL_default as timelockIDL, topupStreamInstruction, transferStreamInstruction, updateStreamInstruction, withdrawStreamInstruction };
4551
+ export { AIRDROP_AMOUNT, AIRDROP_TEST_TOKEN, ALIGNED_COMPUTE_LIMIT, ALIGNED_PRECISION_FACTOR_POW2 as ALIGNED_PRECISION_FACTOR_POW, ALIGNED_UNLOCKS_PROGRAM_ID, AlignedContract, AlignedProxyErrorCode, CONTRACT_DISCRIMINATOR, CONTRACT_SEED, CREATE_PARAMS_PADDING, Contract, ContractErrorCode, DEFAULT_AUTO_CLAIM_FEE_SOL, DEFAULT_CREATION_FEE_SOL, DEFAULT_STREAMFLOW_FEE, ESCROW_SEED, FEES_METADATA_SEED, FEE_ORACLE_PUBLIC_KEY, MAX_SAFE_UNIX_TIME_VALUE2 as MAX_SAFE_UNIX_TIME_VALUE, ORIGINAL_CONTRACT_SENDER_OFFSET, PARTNERS_SCHEMA, PARTNER_ORACLE_PROGRAM_ID, PARTNER_SCHEMA, PROGRAM_ID, REPOPULATED_METADATA_SEED, SOLANA_ERROR_MAP, SOLANA_ERROR_MATCH_REGEX, STREAMFLOW_TREASURY_PUBLIC_KEY, STREAM_STRUCT_OFFSETS, STREAM_STRUCT_OFFSET_CLOSED, STREAM_STRUCT_OFFSET_MINT, STREAM_STRUCT_OFFSET_OLD_METADATA_KEY, STREAM_STRUCT_OFFSET_RECIPIENT, STREAM_STRUCT_OFFSET_SENDER, SolanaStreamClient, StreamDirection, StreamType, TEST_ORACLE_DISCRIMINATOR, TEST_ORACLE_SEED, TX_FINALITY_CONFIRMED, WITHDRAWOR, WITHDRAWOR_PUBLIC_KEY, WITHDRAW_AVAILABLE_AMOUNT, buildStreamType, calculateTotalAmountToDeposit, calculateUnlockedAmount, cancelStreamInstruction, createClient, createStreamInstruction, createUncheckedStreamInstruction, decodeEndTime, decodeStream, deriveContractPDA, deriveEscrowPDA, deriveRepopulatedMetadataPDA, deriveTestOraclePDA, extractSolanaErrorCode, getMetadataKey, handleContractError, isAligned, isCliffCloseToDepositedAmount, isCreateAlignedStreamData, isDynamicLock, isTokenLock, isVesting, sendAndConfirmStreamRawTransaction, signAllTransactionWithRecipients, timelockIDL_default as timelockIDL, topupStreamInstruction, transferStreamInstruction, transformContract, updateStreamInstruction, withdrawStreamInstruction };
4363
4552
  //# sourceMappingURL=index.js.map
4364
4553
  //# sourceMappingURL=index.js.map