@streamflow/stream 8.0.2 → 8.1.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/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 +30 -3
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +10 -10
- package/dist/cjs/solana/index.cjs +30 -3
- 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 +30 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/solana/index.d.ts +2 -2
- package/dist/esm/solana/index.js +30 -3
- 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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Z as Account, a3 as AlignedContract, M as AlignedUnlocksContract, a6 as BatchItem, a8 as BatchItemError, a9 as BatchItemResult, a7 as BatchItemSuccess, U as ChangeOracleParams, y as ClientCreationOptions, a2 as Contract, R as CreateParams, V as CreateTestOracleParams, a4 as DecodedStream, $ as ICreateSolanaExt, a1 as ICreateStreamInstructions, I as ICreateStreamSolanaExt, a as IInteractStreamSolanaExt, Y as ISearchStreams, b as ITopUpStreamSolanaExt, a0 as ITransactionSolanaExtWithInstructions, aa as InstructionGenerator, a5 as MetadataRecipientHashMap, N as OracleType, S as SolanaStreamClient, Q as TestOracle, X as UpdateTestOracleParams, af as cancelStreamInstruction, x as constants, ab as createStreamInstruction, ac as createUncheckedStreamInstruction, z as decodeStream, J as deriveContractPDA, K as deriveEscrowPDA, L as deriveTestOraclePDA, H as extractSolanaErrorCode, G as sendAndConfirmStreamRawTransaction, B as signAllTransactionWithRecipients, _ as timelockIDL, ah as topupStreamInstruction, ag as transferStreamInstruction, ae as updateStreamInstruction, ad as withdrawStreamInstruction } from '../index-
|
|
1
|
+
export { Z as Account, a3 as AlignedContract, M as AlignedUnlocksContract, a6 as BatchItem, a8 as BatchItemError, a9 as BatchItemResult, a7 as BatchItemSuccess, U as ChangeOracleParams, y as ClientCreationOptions, a2 as Contract, R as CreateParams, V as CreateTestOracleParams, a4 as DecodedStream, $ as ICreateSolanaExt, a1 as ICreateStreamInstructions, I as ICreateStreamSolanaExt, a as IInteractStreamSolanaExt, Y as ISearchStreams, b as ITopUpStreamSolanaExt, a0 as ITransactionSolanaExtWithInstructions, aa as InstructionGenerator, a5 as MetadataRecipientHashMap, N as OracleType, S as SolanaStreamClient, Q as TestOracle, X as UpdateTestOracleParams, af as cancelStreamInstruction, x as constants, ab as createStreamInstruction, ac as createUncheckedStreamInstruction, z as decodeStream, J as deriveContractPDA, K as deriveEscrowPDA, L as deriveTestOraclePDA, H as extractSolanaErrorCode, G as sendAndConfirmStreamRawTransaction, B as signAllTransactionWithRecipients, _ as timelockIDL, ah as topupStreamInstruction, ag as transferStreamInstruction, ae as updateStreamInstruction, ad as withdrawStreamInstruction } from '../index-B2txI-oF.js';
|
|
2
2
|
export { ContractError, IChain, ICluster } from '@streamflow/common';
|
|
3
3
|
import 'p-queue';
|
|
4
4
|
import '@solana/web3.js';
|
|
@@ -6,7 +6,7 @@ import '@streamflow/common/solana';
|
|
|
6
6
|
import '@coral-xyz/anchor';
|
|
7
7
|
import '@solana/wallet-adapter-base';
|
|
8
8
|
import 'bn.js';
|
|
9
|
-
import '../BaseStreamClient-
|
|
9
|
+
import '../BaseStreamClient-t7I4NOSm.js';
|
|
10
10
|
import 'ethers';
|
|
11
11
|
import 'aptos';
|
|
12
12
|
import '@mysten/sui/cryptography';
|
package/dist/esm/solana/index.js
CHANGED
|
@@ -51,7 +51,7 @@ var isDynamicLock = (minPrice, maxPrice, minPercentage, maxPercentage) => {
|
|
|
51
51
|
return !!minPrice && !!maxPrice && minPrice > 0 && maxPrice - minPrice <= 1 && minPercentage === 0 && maxPercentage === 100;
|
|
52
52
|
};
|
|
53
53
|
var isTokenLock = (streamData) => {
|
|
54
|
-
return !streamData.canTopup && !streamData.automaticWithdrawal && !streamData.cancelableBySender && !streamData.cancelableByRecipient && !streamData.transferableBySender &&
|
|
54
|
+
return !streamData.canTopup && !streamData.automaticWithdrawal && !streamData.cancelableBySender && !streamData.cancelableByRecipient && !streamData.transferableBySender && (isCliffCloseToDepositedAmount(streamData) || isDynamicLock(streamData.minPrice, streamData.maxPrice, streamData.minPercentage, streamData.maxPercentage));
|
|
55
55
|
};
|
|
56
56
|
var buildStreamType = (streamData) => {
|
|
57
57
|
if (isVesting(streamData)) {
|
|
@@ -396,6 +396,24 @@ var encodeUpdateStream = (values, data) => {
|
|
|
396
396
|
} else {
|
|
397
397
|
structs.push(BufferLayout.u8("amount_per_period_exists"));
|
|
398
398
|
}
|
|
399
|
+
if (values.transferable_by_sender !== void 0) {
|
|
400
|
+
structs.push(BufferLayout.u8("transferable_by_sender_exists"));
|
|
401
|
+
structs.push(BufferLayout.u8("transferable_by_sender"));
|
|
402
|
+
} else {
|
|
403
|
+
structs.push(BufferLayout.u8("transferable_by_sender_exists"));
|
|
404
|
+
}
|
|
405
|
+
if (values.transferable_by_recipient !== void 0) {
|
|
406
|
+
structs.push(BufferLayout.u8("transferable_by_recipient_exists"));
|
|
407
|
+
structs.push(BufferLayout.u8("transferable_by_recipient"));
|
|
408
|
+
} else {
|
|
409
|
+
structs.push(BufferLayout.u8("transferable_by_recipient_exists"));
|
|
410
|
+
}
|
|
411
|
+
if (values.cancelable_by_sender !== void 0) {
|
|
412
|
+
structs.push(BufferLayout.u8("cancelable_by_sender_exists"));
|
|
413
|
+
structs.push(BufferLayout.u8("cancelable_by_sender"));
|
|
414
|
+
} else {
|
|
415
|
+
structs.push(BufferLayout.u8("cancelable_by_sender"));
|
|
416
|
+
}
|
|
399
417
|
return BufferLayout.struct(structs).encode(
|
|
400
418
|
{
|
|
401
419
|
enable_automatic_withdrawal_exists: values.enable_automatic_withdrawal ? 1 : 0,
|
|
@@ -403,7 +421,13 @@ var encodeUpdateStream = (values, data) => {
|
|
|
403
421
|
withdraw_frequency_exists: values.withdraw_frequency ? 1 : 0,
|
|
404
422
|
withdraw_frequency: values.withdraw_frequency ?? 0,
|
|
405
423
|
amount_per_period_exists: values.amount_per_period ? 1 : 0,
|
|
406
|
-
amount_per_period: values.amount_per_period ?? 0
|
|
424
|
+
amount_per_period: values.amount_per_period ?? 0,
|
|
425
|
+
transferable_by_sender_exists: values.transferable_by_sender !== void 0 ? 1 : 0,
|
|
426
|
+
transferable_by_sender: values.transferable_by_sender ?? 0,
|
|
427
|
+
transferable_by_recipient_exists: values.transferable_by_recipient !== void 0 ? 1 : 0,
|
|
428
|
+
transferable_by_recipient: values.transferable_by_recipient ?? 0,
|
|
429
|
+
cancelable_by_sender_exists: values.cancelable_by_sender !== void 0 ? 1 : 0,
|
|
430
|
+
cancelable_by_sender: values.cancelable_by_sender ?? 0
|
|
407
431
|
},
|
|
408
432
|
data
|
|
409
433
|
);
|
|
@@ -689,7 +713,10 @@ var updateStreamInstruction = async (params, programId, { authority, metadata, w
|
|
|
689
713
|
const decodedData = {
|
|
690
714
|
enable_automatic_withdrawal: Number(params.enableAutomaticWithdrawal),
|
|
691
715
|
withdraw_frequency: params.withdrawFrequency ? params.withdrawFrequency.toArrayLike(Buffer, "le", 8) : void 0,
|
|
692
|
-
amount_per_period: params.amountPerPeriod ? params.amountPerPeriod.toArrayLike(Buffer, "le", 8) : void 0
|
|
716
|
+
amount_per_period: params.amountPerPeriod ? params.amountPerPeriod.toArrayLike(Buffer, "le", 8) : void 0,
|
|
717
|
+
transferable_by_sender: params.transferableBySender !== void 0 ? Number(params.transferableBySender) : void 0,
|
|
718
|
+
transferable_by_recipient: params.transferableByRecipient !== void 0 ? Number(params.transferableByRecipient) : void 0,
|
|
719
|
+
cancelable_by_sender: params.cancelableBySender !== void 0 ? Number(params.cancelableBySender) : void 0
|
|
693
720
|
};
|
|
694
721
|
const encodeLength = encodeUpdateStream(decodedData, data);
|
|
695
722
|
data = data.slice(0, encodeLength);
|