@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/esm/index.d.ts
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-BGOG6wUc.js';
|
|
2
|
+
export { i as StreamflowAptos } from './index-BGOG6wUc.js';
|
|
3
|
+
import { E as EvmStreamClient } from './index-C81Z69-K.js';
|
|
4
|
+
export { i as StreamflowEVM } from './index-C81Z69-K.js';
|
|
5
|
+
import { S as SolanaStreamClient, I as ICreateStreamSolanaExt, a as IInteractStreamSolanaExt, b as ITopUpStreamSolanaExt } from './index-B2txI-oF.js';
|
|
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-B2txI-oF.js';
|
|
7
|
+
import { S as SuiStreamClient } from './index-BfQ0dUgG.js';
|
|
8
|
+
export { i as StreamflowSui } from './index-BfQ0dUgG.js';
|
|
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.js';
|
|
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.js';
|
|
11
11
|
import BN from 'bn.js';
|
|
12
12
|
import { IChain } from '@streamflow/common';
|
|
13
13
|
export { ContractError, IChain, ICluster } from '@streamflow/common';
|
package/dist/esm/index.js
CHANGED
|
@@ -458,7 +458,7 @@ var isDynamicLock = (minPrice, maxPrice, minPercentage, maxPercentage) => {
|
|
|
458
458
|
return !!minPrice && !!maxPrice && minPrice > 0 && maxPrice - minPrice <= 1 && minPercentage === 0 && maxPercentage === 100;
|
|
459
459
|
};
|
|
460
460
|
var isTokenLock = (streamData) => {
|
|
461
|
-
return !streamData.canTopup && !streamData.automaticWithdrawal && !streamData.cancelableBySender && !streamData.cancelableByRecipient && !streamData.transferableBySender &&
|
|
461
|
+
return !streamData.canTopup && !streamData.automaticWithdrawal && !streamData.cancelableBySender && !streamData.cancelableByRecipient && !streamData.transferableBySender && (isCliffCloseToDepositedAmount(streamData) || isDynamicLock(streamData.minPrice, streamData.maxPrice, streamData.minPercentage, streamData.maxPercentage));
|
|
462
462
|
};
|
|
463
463
|
var buildStreamType = (streamData) => {
|
|
464
464
|
if (isVesting(streamData)) {
|
|
@@ -3012,6 +3012,24 @@ var encodeUpdateStream = (values, data) => {
|
|
|
3012
3012
|
} else {
|
|
3013
3013
|
structs.push(BufferLayout.u8("amount_per_period_exists"));
|
|
3014
3014
|
}
|
|
3015
|
+
if (values.transferable_by_sender !== void 0) {
|
|
3016
|
+
structs.push(BufferLayout.u8("transferable_by_sender_exists"));
|
|
3017
|
+
structs.push(BufferLayout.u8("transferable_by_sender"));
|
|
3018
|
+
} else {
|
|
3019
|
+
structs.push(BufferLayout.u8("transferable_by_sender_exists"));
|
|
3020
|
+
}
|
|
3021
|
+
if (values.transferable_by_recipient !== void 0) {
|
|
3022
|
+
structs.push(BufferLayout.u8("transferable_by_recipient_exists"));
|
|
3023
|
+
structs.push(BufferLayout.u8("transferable_by_recipient"));
|
|
3024
|
+
} else {
|
|
3025
|
+
structs.push(BufferLayout.u8("transferable_by_recipient_exists"));
|
|
3026
|
+
}
|
|
3027
|
+
if (values.cancelable_by_sender !== void 0) {
|
|
3028
|
+
structs.push(BufferLayout.u8("cancelable_by_sender_exists"));
|
|
3029
|
+
structs.push(BufferLayout.u8("cancelable_by_sender"));
|
|
3030
|
+
} else {
|
|
3031
|
+
structs.push(BufferLayout.u8("cancelable_by_sender"));
|
|
3032
|
+
}
|
|
3015
3033
|
return BufferLayout.struct(structs).encode(
|
|
3016
3034
|
{
|
|
3017
3035
|
enable_automatic_withdrawal_exists: values.enable_automatic_withdrawal ? 1 : 0,
|
|
@@ -3019,7 +3037,13 @@ var encodeUpdateStream = (values, data) => {
|
|
|
3019
3037
|
withdraw_frequency_exists: values.withdraw_frequency ? 1 : 0,
|
|
3020
3038
|
withdraw_frequency: values.withdraw_frequency ?? 0,
|
|
3021
3039
|
amount_per_period_exists: values.amount_per_period ? 1 : 0,
|
|
3022
|
-
amount_per_period: values.amount_per_period ?? 0
|
|
3040
|
+
amount_per_period: values.amount_per_period ?? 0,
|
|
3041
|
+
transferable_by_sender_exists: values.transferable_by_sender !== void 0 ? 1 : 0,
|
|
3042
|
+
transferable_by_sender: values.transferable_by_sender ?? 0,
|
|
3043
|
+
transferable_by_recipient_exists: values.transferable_by_recipient !== void 0 ? 1 : 0,
|
|
3044
|
+
transferable_by_recipient: values.transferable_by_recipient ?? 0,
|
|
3045
|
+
cancelable_by_sender_exists: values.cancelable_by_sender !== void 0 ? 1 : 0,
|
|
3046
|
+
cancelable_by_sender: values.cancelable_by_sender ?? 0
|
|
3023
3047
|
},
|
|
3024
3048
|
data
|
|
3025
3049
|
);
|
|
@@ -3305,7 +3329,10 @@ var updateStreamInstruction = async (params, programId, { authority, metadata, w
|
|
|
3305
3329
|
const decodedData = {
|
|
3306
3330
|
enable_automatic_withdrawal: Number(params.enableAutomaticWithdrawal),
|
|
3307
3331
|
withdraw_frequency: params.withdrawFrequency ? params.withdrawFrequency.toArrayLike(Buffer, "le", 8) : void 0,
|
|
3308
|
-
amount_per_period: params.amountPerPeriod ? params.amountPerPeriod.toArrayLike(Buffer, "le", 8) : void 0
|
|
3332
|
+
amount_per_period: params.amountPerPeriod ? params.amountPerPeriod.toArrayLike(Buffer, "le", 8) : void 0,
|
|
3333
|
+
transferable_by_sender: params.transferableBySender !== void 0 ? Number(params.transferableBySender) : void 0,
|
|
3334
|
+
transferable_by_recipient: params.transferableByRecipient !== void 0 ? Number(params.transferableByRecipient) : void 0,
|
|
3335
|
+
cancelable_by_sender: params.cancelableBySender !== void 0 ? Number(params.cancelableBySender) : void 0
|
|
3309
3336
|
};
|
|
3310
3337
|
const encodeLength = encodeUpdateStream(decodedData, data);
|
|
3311
3338
|
data = data.slice(0, encodeLength);
|
|
@@ -4732,7 +4759,7 @@ var SolanaStreamClient = class extends BaseStreamClient {
|
|
|
4732
4759
|
throw new Error("Sender's PublicKey is not available, check passed wallet adapter!");
|
|
4733
4760
|
}
|
|
4734
4761
|
const ixs = await this.getCreateATAInstructions(
|
|
4735
|
-
[
|
|
4762
|
+
[partnerPublicKey],
|
|
4736
4763
|
mintPublicKey,
|
|
4737
4764
|
sender,
|
|
4738
4765
|
true,
|
|
@@ -5139,7 +5166,7 @@ var SolanaStreamClient = class extends BaseStreamClient {
|
|
|
5139
5166
|
batch.push({ tx: createVersionedTransaction(ixs, sender.publicKey, hash.blockhash, [metadata]), recipient });
|
|
5140
5167
|
}
|
|
5141
5168
|
const prepareInstructions = await this.getCreateATAInstructions(
|
|
5142
|
-
[
|
|
5169
|
+
[partnerPublicKey],
|
|
5143
5170
|
mintPublicKey,
|
|
5144
5171
|
sender,
|
|
5145
5172
|
true
|
|
@@ -5259,7 +5286,7 @@ var SolanaStreamClient = class extends BaseStreamClient {
|
|
|
5259
5286
|
batch.push({ tx, recipient });
|
|
5260
5287
|
}
|
|
5261
5288
|
const prepareInstructions = await this.getCreateATAInstructions(
|
|
5262
|
-
[
|
|
5289
|
+
[partnerPublicKey],
|
|
5263
5290
|
mintPublicKey,
|
|
5264
5291
|
sender,
|
|
5265
5292
|
true
|