@streamflow/stream 8.0.2 → 8.1.1
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/cjs/{BaseStreamClient-CQOC8m8V.d.cts → BaseStreamClient-t7I4NOSm.d.cts} +3 -0
- package/dist/cjs/aptos/index.cjs +1 -1
- package/dist/cjs/aptos/index.cjs.map +1 -1
- package/dist/cjs/aptos/index.d.cts +2 -2
- package/dist/cjs/evm/index.cjs +1 -1
- package/dist/cjs/evm/index.cjs.map +1 -1
- package/dist/cjs/evm/index.d.cts +2 -2
- package/dist/cjs/{index-b7Qo5mCj.d.cts → index-BRL3w_PW.d.cts} +1 -1
- package/dist/cjs/{index-CYu6i--S.d.cts → index-DU0JxxIj.d.cts} +1 -1
- package/dist/cjs/{index-fNLnPKzv.d.cts → index-IHOpuPSg.d.cts} +1 -1
- package/dist/cjs/{index-DUVcpIhD.d.cts → index-kcFtmz7O.d.cts} +1 -1
- package/dist/cjs/index.cjs +33 -6
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +10 -10
- package/dist/cjs/solana/index.cjs +33 -6
- package/dist/cjs/solana/index.cjs.map +1 -1
- package/dist/cjs/solana/index.d.cts +2 -2
- package/dist/cjs/sui/index.cjs +1 -1
- package/dist/cjs/sui/index.cjs.map +1 -1
- package/dist/cjs/sui/index.d.cts +2 -2
- package/dist/esm/{BaseStreamClient-CQOC8m8V.d.ts → BaseStreamClient-t7I4NOSm.d.ts} +3 -0
- package/dist/esm/aptos/index.d.ts +2 -2
- package/dist/esm/aptos/index.js +1 -1
- package/dist/esm/aptos/index.js.map +1 -1
- package/dist/esm/evm/index.d.ts +2 -2
- package/dist/esm/evm/index.js +1 -1
- package/dist/esm/evm/index.js.map +1 -1
- package/dist/esm/{index-BEo0O2IG.d.ts → index-B2txI-oF.d.ts} +1 -1
- package/dist/esm/{index-D6QYg8hn.d.ts → index-BGOG6wUc.d.ts} +1 -1
- package/dist/esm/{index-CWmb3-x9.d.ts → index-BfQ0dUgG.d.ts} +1 -1
- package/dist/esm/{index-Cgv37xlG.d.ts → index-C81Z69-K.d.ts} +1 -1
- package/dist/esm/index.d.ts +10 -10
- package/dist/esm/index.js +33 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/solana/index.d.ts +2 -2
- package/dist/esm/solana/index.js +33 -6
- package/dist/esm/solana/index.js.map +1 -1
- package/dist/esm/sui/index.d.ts +2 -2
- package/dist/esm/sui/index.js +1 -1
- package/dist/esm/sui/index.js.map +1 -1
- package/package.json +4 -4
package/dist/cjs/index.d.cts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { A as AptosStreamClient, I as ICreateStreamAptosExt, a as ITransactionAptosExt } from './index-
|
|
2
|
-
export { i as StreamflowAptos } from './index-
|
|
3
|
-
import { E as EvmStreamClient } from './index-
|
|
4
|
-
export { i as StreamflowEVM } from './index-
|
|
5
|
-
import { S as SolanaStreamClient, I as ICreateStreamSolanaExt, a as IInteractStreamSolanaExt, b as ITopUpStreamSolanaExt } from './index-
|
|
6
|
-
export { s as AIRDROP_AMOUNT, q as AIRDROP_TEST_TOKEN, j as ALIGNED_COMPUTE_LIMIT, A as ALIGNED_PRECISION_FACTOR_POW, h as ALIGNED_UNLOCKS_PROGRAM_ID, k as CONTRACT_DISCRIMINATOR, m as CONTRACT_SEED, C as CREATE_PARAMS_PADDING, D as DEFAULT_STREAMFLOW_FEE, E as ESCROW_SEED, r as FEES_METADATA_SEED, F as FEE_ORACLE_PUBLIC_KEY, O as ORIGINAL_CONTRACT_SENDER_OFFSET, u as PARTNERS_SCHEMA, o as PARTNER_ORACLE_PROGRAM_ID, t as PARTNER_SCHEMA, P as PROGRAM_ID, w as SOLANA_ERROR_MAP, v as SOLANA_ERROR_MATCH_REGEX, p as STREAMFLOW_TREASURY_PUBLIC_KEY, g as STREAM_STRUCT_OFFSETS, f as STREAM_STRUCT_OFFSET_CLOSED, e as STREAM_STRUCT_OFFSET_MINT, d as STREAM_STRUCT_OFFSET_RECIPIENT, c as STREAM_STRUCT_OFFSET_SENDER, i as StreamflowSolana, l as TEST_ORACLE_DISCRIMINATOR, n as TEST_ORACLE_SEED, T as TX_FINALITY_CONFIRMED, W as WITHDRAWOR_PUBLIC_KEY } from './index-
|
|
7
|
-
import { S as SuiStreamClient } from './index-
|
|
8
|
-
export { i as StreamflowSui } from './index-
|
|
9
|
-
import { S as Stream, A as AlignedStream, I as ICreateStreamData, a as ICreateAlignedStreamData, b as StreamType, B as BaseStreamClient, c as SolanaStreamClientOptions, d as AptosStreamClientOptions, e as SuiStreamClientOptions, E as EvmStreamClientOptions, f as ICreateStreamSuiExt, g as ICreateResult, h as ICreateMultipleStreamData, i as IMultiTransactionResult, j as IWithdrawData, k as ITransactionSuiExt, l as ITransactionResult, m as ICancelData, n as ITransferData, o as ITopUpData, p as IGetOneData, q as IGetAllData, r as IUpdateData, s as IGetFeesData, t as IFees } from './BaseStreamClient-
|
|
10
|
-
export { H as AlignedStreamData, G as ContractErrorCode, w as IAlignedStreamConfig, v as IBaseStreamConfig, x as ICreateLinearStreamData, D as ICreateMultiError, z as ICreateMultipleAlignedStreamData, y as ICreateMultipleLinearStreamData, C as IInteractData, u as IRecipient, L as LinearStream, O as OracleTypeName, K as SolanaAlignedProxyErrorCode, J as SolanaContractErrorCode, M as SolanaTransactionSchedulingOptions, F as StreamDirection } from './BaseStreamClient-
|
|
1
|
+
import { A as AptosStreamClient, I as ICreateStreamAptosExt, a as ITransactionAptosExt } from './index-kcFtmz7O.cjs';
|
|
2
|
+
export { i as StreamflowAptos } from './index-kcFtmz7O.cjs';
|
|
3
|
+
import { E as EvmStreamClient } from './index-IHOpuPSg.cjs';
|
|
4
|
+
export { i as StreamflowEVM } from './index-IHOpuPSg.cjs';
|
|
5
|
+
import { S as SolanaStreamClient, I as ICreateStreamSolanaExt, a as IInteractStreamSolanaExt, b as ITopUpStreamSolanaExt } from './index-BRL3w_PW.cjs';
|
|
6
|
+
export { s as AIRDROP_AMOUNT, q as AIRDROP_TEST_TOKEN, j as ALIGNED_COMPUTE_LIMIT, A as ALIGNED_PRECISION_FACTOR_POW, h as ALIGNED_UNLOCKS_PROGRAM_ID, k as CONTRACT_DISCRIMINATOR, m as CONTRACT_SEED, C as CREATE_PARAMS_PADDING, D as DEFAULT_STREAMFLOW_FEE, E as ESCROW_SEED, r as FEES_METADATA_SEED, F as FEE_ORACLE_PUBLIC_KEY, O as ORIGINAL_CONTRACT_SENDER_OFFSET, u as PARTNERS_SCHEMA, o as PARTNER_ORACLE_PROGRAM_ID, t as PARTNER_SCHEMA, P as PROGRAM_ID, w as SOLANA_ERROR_MAP, v as SOLANA_ERROR_MATCH_REGEX, p as STREAMFLOW_TREASURY_PUBLIC_KEY, g as STREAM_STRUCT_OFFSETS, f as STREAM_STRUCT_OFFSET_CLOSED, e as STREAM_STRUCT_OFFSET_MINT, d as STREAM_STRUCT_OFFSET_RECIPIENT, c as STREAM_STRUCT_OFFSET_SENDER, i as StreamflowSolana, l as TEST_ORACLE_DISCRIMINATOR, n as TEST_ORACLE_SEED, T as TX_FINALITY_CONFIRMED, W as WITHDRAWOR_PUBLIC_KEY } from './index-BRL3w_PW.cjs';
|
|
7
|
+
import { S as SuiStreamClient } from './index-DU0JxxIj.cjs';
|
|
8
|
+
export { i as StreamflowSui } from './index-DU0JxxIj.cjs';
|
|
9
|
+
import { S as Stream, A as AlignedStream, I as ICreateStreamData, a as ICreateAlignedStreamData, b as StreamType, B as BaseStreamClient, c as SolanaStreamClientOptions, d as AptosStreamClientOptions, e as SuiStreamClientOptions, E as EvmStreamClientOptions, f as ICreateStreamSuiExt, g as ICreateResult, h as ICreateMultipleStreamData, i as IMultiTransactionResult, j as IWithdrawData, k as ITransactionSuiExt, l as ITransactionResult, m as ICancelData, n as ITransferData, o as ITopUpData, p as IGetOneData, q as IGetAllData, r as IUpdateData, s as IGetFeesData, t as IFees } from './BaseStreamClient-t7I4NOSm.cjs';
|
|
10
|
+
export { H as AlignedStreamData, G as ContractErrorCode, w as IAlignedStreamConfig, v as IBaseStreamConfig, x as ICreateLinearStreamData, D as ICreateMultiError, z as ICreateMultipleAlignedStreamData, y as ICreateMultipleLinearStreamData, C as IInteractData, u as IRecipient, L as LinearStream, O as OracleTypeName, K as SolanaAlignedProxyErrorCode, J as SolanaContractErrorCode, M as SolanaTransactionSchedulingOptions, F as StreamDirection } from './BaseStreamClient-t7I4NOSm.cjs';
|
|
11
11
|
import BN from 'bn.js';
|
|
12
12
|
import { IChain } from '@streamflow/common';
|
|
13
13
|
export { ContractError, IChain, ICluster } from '@streamflow/common';
|
|
@@ -77,7 +77,7 @@ var isDynamicLock = (minPrice, maxPrice, minPercentage, maxPercentage) => {
|
|
|
77
77
|
return !!minPrice && !!maxPrice && minPrice > 0 && maxPrice - minPrice <= 1 && minPercentage === 0 && maxPercentage === 100;
|
|
78
78
|
};
|
|
79
79
|
var isTokenLock = (streamData) => {
|
|
80
|
-
return !streamData.canTopup && !streamData.automaticWithdrawal && !streamData.cancelableBySender && !streamData.cancelableByRecipient && !streamData.transferableBySender &&
|
|
80
|
+
return !streamData.canTopup && !streamData.automaticWithdrawal && !streamData.cancelableBySender && !streamData.cancelableByRecipient && !streamData.transferableBySender && (isCliffCloseToDepositedAmount(streamData) || isDynamicLock(streamData.minPrice, streamData.maxPrice, streamData.minPercentage, streamData.maxPercentage));
|
|
81
81
|
};
|
|
82
82
|
var buildStreamType = (streamData) => {
|
|
83
83
|
if (isVesting(streamData)) {
|
|
@@ -422,6 +422,24 @@ var encodeUpdateStream = (values, data) => {
|
|
|
422
422
|
} else {
|
|
423
423
|
structs.push(BufferLayout__namespace.u8("amount_per_period_exists"));
|
|
424
424
|
}
|
|
425
|
+
if (values.transferable_by_sender !== void 0) {
|
|
426
|
+
structs.push(BufferLayout__namespace.u8("transferable_by_sender_exists"));
|
|
427
|
+
structs.push(BufferLayout__namespace.u8("transferable_by_sender"));
|
|
428
|
+
} else {
|
|
429
|
+
structs.push(BufferLayout__namespace.u8("transferable_by_sender_exists"));
|
|
430
|
+
}
|
|
431
|
+
if (values.transferable_by_recipient !== void 0) {
|
|
432
|
+
structs.push(BufferLayout__namespace.u8("transferable_by_recipient_exists"));
|
|
433
|
+
structs.push(BufferLayout__namespace.u8("transferable_by_recipient"));
|
|
434
|
+
} else {
|
|
435
|
+
structs.push(BufferLayout__namespace.u8("transferable_by_recipient_exists"));
|
|
436
|
+
}
|
|
437
|
+
if (values.cancelable_by_sender !== void 0) {
|
|
438
|
+
structs.push(BufferLayout__namespace.u8("cancelable_by_sender_exists"));
|
|
439
|
+
structs.push(BufferLayout__namespace.u8("cancelable_by_sender"));
|
|
440
|
+
} else {
|
|
441
|
+
structs.push(BufferLayout__namespace.u8("cancelable_by_sender"));
|
|
442
|
+
}
|
|
425
443
|
return BufferLayout__namespace.struct(structs).encode(
|
|
426
444
|
{
|
|
427
445
|
enable_automatic_withdrawal_exists: values.enable_automatic_withdrawal ? 1 : 0,
|
|
@@ -429,7 +447,13 @@ var encodeUpdateStream = (values, data) => {
|
|
|
429
447
|
withdraw_frequency_exists: values.withdraw_frequency ? 1 : 0,
|
|
430
448
|
withdraw_frequency: values.withdraw_frequency ?? 0,
|
|
431
449
|
amount_per_period_exists: values.amount_per_period ? 1 : 0,
|
|
432
|
-
amount_per_period: values.amount_per_period ?? 0
|
|
450
|
+
amount_per_period: values.amount_per_period ?? 0,
|
|
451
|
+
transferable_by_sender_exists: values.transferable_by_sender !== void 0 ? 1 : 0,
|
|
452
|
+
transferable_by_sender: values.transferable_by_sender ?? 0,
|
|
453
|
+
transferable_by_recipient_exists: values.transferable_by_recipient !== void 0 ? 1 : 0,
|
|
454
|
+
transferable_by_recipient: values.transferable_by_recipient ?? 0,
|
|
455
|
+
cancelable_by_sender_exists: values.cancelable_by_sender !== void 0 ? 1 : 0,
|
|
456
|
+
cancelable_by_sender: values.cancelable_by_sender ?? 0
|
|
433
457
|
},
|
|
434
458
|
data
|
|
435
459
|
);
|
|
@@ -715,7 +739,10 @@ var updateStreamInstruction = async (params, programId, { authority, metadata, w
|
|
|
715
739
|
const decodedData = {
|
|
716
740
|
enable_automatic_withdrawal: Number(params.enableAutomaticWithdrawal),
|
|
717
741
|
withdraw_frequency: params.withdrawFrequency ? params.withdrawFrequency.toArrayLike(buffer.Buffer, "le", 8) : void 0,
|
|
718
|
-
amount_per_period: params.amountPerPeriod ? params.amountPerPeriod.toArrayLike(buffer.Buffer, "le", 8) : void 0
|
|
742
|
+
amount_per_period: params.amountPerPeriod ? params.amountPerPeriod.toArrayLike(buffer.Buffer, "le", 8) : void 0,
|
|
743
|
+
transferable_by_sender: params.transferableBySender !== void 0 ? Number(params.transferableBySender) : void 0,
|
|
744
|
+
transferable_by_recipient: params.transferableByRecipient !== void 0 ? Number(params.transferableByRecipient) : void 0,
|
|
745
|
+
cancelable_by_sender: params.cancelableBySender !== void 0 ? Number(params.cancelableBySender) : void 0
|
|
719
746
|
};
|
|
720
747
|
const encodeLength = encodeUpdateStream(decodedData, data);
|
|
721
748
|
data = data.slice(0, encodeLength);
|
|
@@ -2164,7 +2191,7 @@ var SolanaStreamClient = class extends BaseStreamClient {
|
|
|
2164
2191
|
throw new Error("Sender's PublicKey is not available, check passed wallet adapter!");
|
|
2165
2192
|
}
|
|
2166
2193
|
const ixs = await this.getCreateATAInstructions(
|
|
2167
|
-
[
|
|
2194
|
+
[partnerPublicKey],
|
|
2168
2195
|
mintPublicKey,
|
|
2169
2196
|
sender,
|
|
2170
2197
|
true,
|
|
@@ -2571,7 +2598,7 @@ var SolanaStreamClient = class extends BaseStreamClient {
|
|
|
2571
2598
|
batch.push({ tx: solana.createVersionedTransaction(ixs, sender.publicKey, hash.blockhash, [metadata]), recipient });
|
|
2572
2599
|
}
|
|
2573
2600
|
const prepareInstructions = await this.getCreateATAInstructions(
|
|
2574
|
-
[
|
|
2601
|
+
[partnerPublicKey],
|
|
2575
2602
|
mintPublicKey,
|
|
2576
2603
|
sender,
|
|
2577
2604
|
true
|
|
@@ -2691,7 +2718,7 @@ var SolanaStreamClient = class extends BaseStreamClient {
|
|
|
2691
2718
|
batch.push({ tx, recipient });
|
|
2692
2719
|
}
|
|
2693
2720
|
const prepareInstructions = await this.getCreateATAInstructions(
|
|
2694
|
-
[
|
|
2721
|
+
[partnerPublicKey],
|
|
2695
2722
|
mintPublicKey,
|
|
2696
2723
|
sender,
|
|
2697
2724
|
true
|