@streamflow/stream 10.0.0-alpha.p313.4046054 → 10.0.0-alpha.p313.e531e2c
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/README.md +2 -2
- package/dist/cjs/index.cjs +10 -2
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +1 -1
- package/dist/cjs/solana/index.cjs +10 -2
- package/dist/cjs/solana/index.cjs.map +1 -1
- package/dist/cjs/solana/index.d.cts +6 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +10 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/solana/index.d.ts +6 -1
- package/dist/esm/solana/index.js +10 -3
- package/dist/esm/solana/index.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -99,7 +99,7 @@ const solanaInteractParams = {
|
|
|
99
99
|
|
|
100
100
|
## Create a Vesting Stream
|
|
101
101
|
|
|
102
|
-
Vesting Streams are a type of Stream used to linearly unlock a given amount of tokens over a period of time. You can specify the amount, cliff, start time and releasePeriod along with other configuration that controls who can transfer or cancel the contract. For a Stream to be considered Vesting in the Streamflow App it has to match the criteria from the `isVesting` helper function (or `buildStreamType` returns `StreamType.Vesting`). The cliff amount must not be too close to the total amount and it must not be a Dynamic token lock.
|
|
102
|
+
Vesting Streams are a type of Stream used to linearly unlock a given amount of tokens over a period of time. You can specify the amount, cliff, start time and releasePeriod along with other configuration that controls who can transfer or cancel the contract. For a Stream to be considered Vesting in the Streamflow App it has to match the criteria from the `isVesting` helper function (or `buildStreamType` returns `StreamType.Vesting`). The stream must not allow top-ups, the cliff amount must not be too close to the total amount and it must not be a Dynamic token lock.
|
|
103
103
|
|
|
104
104
|
For more details creating a Stream with arbitrary configuration see [General Stream creation](#general-stream-creation).
|
|
105
105
|
For creating multiple Streams at once see [Create Multiple Streams](#create-multiple-streams-at-once).
|
|
@@ -426,7 +426,7 @@ console.log(remaining);
|
|
|
426
426
|
```javascript
|
|
427
427
|
const data: IGetAllData = {
|
|
428
428
|
address: "99h00075bKjVg000000tLdk4w42NyG3Mv0000dc0M99",
|
|
429
|
-
type: StreamType.All, // StreamType.Vesting, StreamType.Lock
|
|
429
|
+
type: StreamType.All, // StreamType.Vesting, StreamType.Lock, StreamType.Payment
|
|
430
430
|
direction: StreamDirection.All, // StreamDirection.Outgoing, StreamDirection.Incoming
|
|
431
431
|
};
|
|
432
432
|
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -59,8 +59,11 @@ var calculateUnlockedAmount = ({
|
|
|
59
59
|
var isCliffCloseToDepositedAmount = (streamData) => {
|
|
60
60
|
return streamData.cliffAmount.gte(streamData.depositedAmount.sub(new BN3__default.default(1)));
|
|
61
61
|
};
|
|
62
|
+
var isPayment = (streamData) => {
|
|
63
|
+
return streamData.canTopup;
|
|
64
|
+
};
|
|
62
65
|
var isVesting = (streamData) => {
|
|
63
|
-
return !isCliffCloseToDepositedAmount(streamData) && !isDynamicLock(streamData.minPrice, streamData.maxPrice, streamData.minPercentage, streamData.maxPercentage);
|
|
66
|
+
return !streamData.canTopup && !isCliffCloseToDepositedAmount(streamData) && !isDynamicLock(streamData.minPrice, streamData.maxPrice, streamData.minPercentage, streamData.maxPercentage);
|
|
64
67
|
};
|
|
65
68
|
var isAligned = (stream) => {
|
|
66
69
|
return "minPrice" in stream && "maxPrice" in stream && "minPercentage" in stream && "maxPercentage" in stream;
|
|
@@ -75,10 +78,13 @@ var isTokenLock = (streamData) => {
|
|
|
75
78
|
return !streamData.canTopup && !streamData.automaticWithdrawal && !streamData.cancelableBySender && !streamData.cancelableByRecipient && !streamData.transferableBySender && (isCliffCloseToDepositedAmount(streamData) || isDynamicLock(streamData.minPrice, streamData.maxPrice, streamData.minPercentage, streamData.maxPercentage));
|
|
76
79
|
};
|
|
77
80
|
var buildStreamType = (streamData) => {
|
|
81
|
+
if (isVesting(streamData)) {
|
|
82
|
+
return "vesting" /* Vesting */;
|
|
83
|
+
}
|
|
78
84
|
if (isTokenLock(streamData)) {
|
|
79
85
|
return "lock" /* Lock */;
|
|
80
86
|
}
|
|
81
|
-
return "
|
|
87
|
+
return "payment" /* Payment */;
|
|
82
88
|
};
|
|
83
89
|
var decodeEndTime = (endTime) => {
|
|
84
90
|
if (endTime.gt(new BN3__default.default(MAX_SAFE_UNIX_TIME_VALUE))) {
|
|
@@ -95,6 +101,7 @@ var StreamDirection = /* @__PURE__ */ ((StreamDirection2) => {
|
|
|
95
101
|
})(StreamDirection || {});
|
|
96
102
|
var StreamType = /* @__PURE__ */ ((StreamType2) => {
|
|
97
103
|
StreamType2["All"] = "all";
|
|
104
|
+
StreamType2["Payment"] = "payment";
|
|
98
105
|
StreamType2["Vesting"] = "vesting";
|
|
99
106
|
StreamType2["Lock"] = "lock";
|
|
100
107
|
return StreamType2;
|
|
@@ -4347,6 +4354,7 @@ exports.isAligned = isAligned;
|
|
|
4347
4354
|
exports.isCliffCloseToDepositedAmount = isCliffCloseToDepositedAmount;
|
|
4348
4355
|
exports.isCreateAlignedStreamData = isCreateAlignedStreamData;
|
|
4349
4356
|
exports.isDynamicLock = isDynamicLock;
|
|
4357
|
+
exports.isPayment = isPayment;
|
|
4350
4358
|
exports.isTokenLock = isTokenLock;
|
|
4351
4359
|
exports.isVesting = isVesting;
|
|
4352
4360
|
exports.sendAndConfirmStreamRawTransaction = sendAndConfirmStreamRawTransaction;
|