@streamflow/stream 10.0.0-alpha.p313.e531e2c → 10.0.0-alpha.p313.fe2295d
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 +148 -3
- package/dist/cjs/index.cjs +129 -66
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +1 -1
- package/dist/cjs/solana/index.cjs +129 -66
- package/dist/cjs/solana/index.cjs.map +1 -1
- package/dist/cjs/solana/index.d.cts +61 -21
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +127 -66
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/solana/index.d.ts +61 -21
- package/dist/esm/solana/index.js +127 -66
- package/dist/esm/solana/index.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -19,6 +19,10 @@ You can also `getOne` stream and `get` multiple streams.
|
|
|
19
19
|
- [Create a Token Lock](#create-a-token-lock)
|
|
20
20
|
- [Streamflow app token lock criteria](#streamflow-app-token-lock-criteria)
|
|
21
21
|
- [Example for creating a token lock](#example-for-creating-a-token-lock)
|
|
22
|
+
- [Create a Price-based Stream (Aligned)](#create-a-price-based-stream-aligned)
|
|
23
|
+
- [Example for creating a Price-based Vesting Stream](#example-for-creating-a-price-based-vesting-stream)
|
|
24
|
+
- [Create a Price-based Lock](#create-a-price-based-lock)
|
|
25
|
+
- [Fetching Aligned Stream Data](#fetching-aligned-stream-data)
|
|
22
26
|
- [General Stream creation](#general-stream-creation)
|
|
23
27
|
- [Create multiple streams at once](#create-multiple-streams-at-once)
|
|
24
28
|
- [Identifying created Streams](#identifying-created-streams)
|
|
@@ -72,7 +76,7 @@ import { StreamflowSolana } from "@streamflow/stream";
|
|
|
72
76
|
const solanaClient = new StreamflowSolana.SolanaStreamClient(
|
|
73
77
|
"https://api.mainnet-beta.solana.com"
|
|
74
78
|
);
|
|
75
|
-
|
|
79
|
+
```
|
|
76
80
|
|
|
77
81
|
## Universal parameters
|
|
78
82
|
|
|
@@ -99,7 +103,7 @@ const solanaInteractParams = {
|
|
|
99
103
|
|
|
100
104
|
## Create a Vesting Stream
|
|
101
105
|
|
|
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
|
|
106
|
+
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.
|
|
103
107
|
|
|
104
108
|
For more details creating a Stream with arbitrary configuration see [General Stream creation](#general-stream-creation).
|
|
105
109
|
For creating multiple Streams at once see [Create Multiple Streams](#create-multiple-streams-at-once).
|
|
@@ -214,6 +218,147 @@ try {
|
|
|
214
218
|
const { ixs } = await client.prepareCreateStreamInstructions(createTokenLockParams, solanaCreateParams)
|
|
215
219
|
```
|
|
216
220
|
|
|
221
|
+
## Create a Price-based Stream (Aligned)
|
|
222
|
+
|
|
223
|
+
Price-based Streams (also known as Aligned or Dynamic Streams) are a type of Stream where the unlock rate dynamically adjusts based on the price of a token as reported by a price oracle. The unlock percentage scales between `minPercentage` and `maxPercentage` based on whether the current price is at or below `minPrice` or at or above `maxPrice`. This allows for vesting schedules that accelerate or decelerate based on token price performance.
|
|
224
|
+
|
|
225
|
+
Price-based Streams require all the standard stream parameters plus additional price-based configuration parameters. The unlock rate is recalculated periodically based on the oracle price, making the vesting schedule responsive to market conditions.
|
|
226
|
+
|
|
227
|
+
Streamflow's custom oracles can be fetched through the Oracle API
|
|
228
|
+
- Endpoint -> `https://oracle-api-public.streamflow.finance/oracle/{mint}`
|
|
229
|
+
- [API Docs](https://oracle-api-public.streamflow.finance/docs)
|
|
230
|
+
|
|
231
|
+
For more details creating a Stream with arbitrary configuration see [General Stream creation](#general-stream-creation).
|
|
232
|
+
|
|
233
|
+
### Example for creating a Price-based Vesting Stream
|
|
234
|
+
|
|
235
|
+
The following code will create a Price-based Stream that adjusts its unlock rate based on token price. When the price is at or below `minPrice`, it unlocks at `minPercentage` rate. When the price is at or above `maxPrice`, it unlocks at `maxPercentage` rate. For prices between these bounds, the unlock rate scales proportionally.
|
|
236
|
+
|
|
237
|
+
```javascript
|
|
238
|
+
const tokenDecimals = 9;
|
|
239
|
+
const totalAmount = getBN(1000, tokenDecimals);
|
|
240
|
+
const cliffAmount = getBN(100, tokenDecimals);
|
|
241
|
+
|
|
242
|
+
const day = 60 * 60 * 24; // in seconds
|
|
243
|
+
const twoWeeks = day * 14;
|
|
244
|
+
|
|
245
|
+
const mint = "DNw99999M7e24g99999999WJirKeZ5fQc6KY999999gK"
|
|
246
|
+
const remainingAmount = totalAmount.sub(cliffAmount);
|
|
247
|
+
const baseAmountPerPeriod = remainingAmount.divn(twoWeeks);
|
|
248
|
+
|
|
249
|
+
const priceOracleAddress = await fetch(`https://oracle-api.streamflow.finance/oracle/${mint}`).then(res => res.json()).then(data => data.address);
|
|
250
|
+
|
|
251
|
+
const createPriceBasedParams: Types.ICreateAlignedStreamData = {
|
|
252
|
+
recipient: "4ih00075bKjVg000000tLdk4w42NyG3Mv0000dc0M00", // Recipient address.
|
|
253
|
+
tokenId: mint, // Token mint address.
|
|
254
|
+
start: 1643363040, // Timestamp (in seconds) when the stream starts.
|
|
255
|
+
amount: totalAmount,
|
|
256
|
+
period: day, // 1 day for daily unlock updates
|
|
257
|
+
cliff: 1643363040, // Cliff timestamp in seconds.
|
|
258
|
+
cliffAmount: cliffAmount, // Amount unlocked at the "cliff" timestamp.
|
|
259
|
+
amountPerPeriod: baseAmountPerPeriod, // Base release rate (will be adjusted based on price).
|
|
260
|
+
name: "Price-based Vesting for Jane Doe.", // The stream name or subject.
|
|
261
|
+
transferableBySender: false, // not possible for aligned streams
|
|
262
|
+
automaticWithdrawal: false, // not possible for aligned streams
|
|
263
|
+
// Price-based configuration parameters - NOTE: all of these must be present in the creation order for the created Stream to be price-based
|
|
264
|
+
minPrice: 0.05, // Minimum price threshold. If current price <= minPrice, minPercentage is used.
|
|
265
|
+
maxPrice: 1.0, // Maximum price threshold. If current price >= maxPrice, maxPercentage is used.
|
|
266
|
+
minPercentage: 1, // Minimum unlock percentage (in basis points, e.g., 1 = 0.01%). Used when price <= minPrice.
|
|
267
|
+
maxPercentage: 1000, // Maximum unlock percentage (in basis points, e.g., 1000 = 10%). Used when price >= maxPrice.
|
|
268
|
+
// If either of these are omitted or oracleType is set to "none" the resulting Stream will behave like a regular Stream
|
|
269
|
+
oracleType: "test", // "test" is passed if you are using Streamflow's price oracles, you can also pass "pyth" if you are passing a Pyth price oracle to priceOracle
|
|
270
|
+
priceOracle: priceOracleAddress, // Address of the price oracle, either a Streamflow oracle address, or a Pyth oracle address.
|
|
271
|
+
skipInitial: false, // [optional] Whether to skip initial unlock amount update when the stream starts. Defaults to false.
|
|
272
|
+
tickSize: 1, // [optional] Tick size for percentage calculations when price is between minPrice and maxPrice. Defaults to 1.
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
try {
|
|
276
|
+
const { ixs, tx, metadata } = await client.create(createPriceBasedParams, solanaCreateParams);
|
|
277
|
+
} catch (exception) {
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
const { ixs } = await client.prepareCreateStreamInstructions(createPriceBasedParams, solanaCreateParams)
|
|
281
|
+
```
|
|
282
|
+
## Create a Price-based Lock
|
|
283
|
+
|
|
284
|
+
You can also create a Stream that behaves similar to a token Lock and unlocks at a specific price. There are some technical limitations that cause a small portion of the tokens to be unlocked over time that depends on the contract amount and number of decimals, but for most cases the time it would take for the whole contract to be unlocked would be measured in decades or even hundreds of years. You can achieve this with the following settings:
|
|
285
|
+
|
|
286
|
+
```javascript
|
|
287
|
+
const targetPrice = 100; // Price at which you want tokens to unlock
|
|
288
|
+
const minPrice = targetPrice - 1;
|
|
289
|
+
const maxPrice = targetPrice;
|
|
290
|
+
const minPercentage = 0;
|
|
291
|
+
const maxPercentage = 100;
|
|
292
|
+
const totalAmount = new BN(1000000);
|
|
293
|
+
const amountPerPeriod = totalAmount;
|
|
294
|
+
const cliffAmount = new BN(0); // No cliff for price-based lock
|
|
295
|
+
|
|
296
|
+
const createPriceBasedParams: Types.ICreateAlignedStreamData = {
|
|
297
|
+
recipient: "4ih00075bKjVg000000tLdk4w42NyG3Mv0000dc0M00", // Recipient address.
|
|
298
|
+
tokenId: mint, // Token mint address.
|
|
299
|
+
start: 1643363040, // Timestamp (in seconds) when the stream starts.
|
|
300
|
+
amount: totalAmount,
|
|
301
|
+
period: 30, // 30 seconds so in case the target price is reached, the oracle has 30 seconds to fetch the price and update the contract release rate
|
|
302
|
+
cliff: 1643363040, // Cliff timestamp in seconds (should match start for price-based lock).
|
|
303
|
+
cliffAmount: cliffAmount, // Amount unlocked at the "cliff" timestamp.
|
|
304
|
+
amountPerPeriod: amountPerPeriod, // Will be updated to 1 as long as price below targetPrice,
|
|
305
|
+
// meaning that tokens are unlocked at rate of 1 smallest denominator of the token per each period (if token has 9 decimals that is 0.000000001 token every 30 seconds)
|
|
306
|
+
name: "Price-based Lock for Jane Doe.",
|
|
307
|
+
transferableBySender: false, // not possible for aligned streams
|
|
308
|
+
automaticWithdrawal: false, // not possible for aligned streams
|
|
309
|
+
// Price-based configuration parameters - NOTE: all of these must be present in the creation order for the created Stream to be price-based
|
|
310
|
+
minPrice, // Minimum price threshold. If current price <= minPrice, minPercentage is used.
|
|
311
|
+
maxPrice, // Maximum price threshold. If current price >= maxPrice, maxPercentage is used.
|
|
312
|
+
minPercentage, // Minimum unlock percentage (in basis points, e.g., 1 = 0.01%). Used when price <= minPrice.
|
|
313
|
+
maxPercentage, // Maximum unlock percentage (in basis points, e.g., 1000 = 10%). Used when price >= maxPrice.
|
|
314
|
+
// If either of these are omitted or oracleType is set to "none" the resulting Stream will behave like a regular Stream
|
|
315
|
+
oracleType: "test", // "test" is passed if you are using Streamflow's price oracles, you can also pass "pyth" if you are passing a Pyth price oracle to priceOracle
|
|
316
|
+
priceOracle: priceOracleAddress, // Address of the price oracle, either a Streamflow oracle address, or a Pyth oracle address.
|
|
317
|
+
skipInitial: false, // In this case it should not be set to true
|
|
318
|
+
// These parameters make sense for a price-based token lock
|
|
319
|
+
floorPrice: 20, // lower bound targetPrice - at or below this price tokens will be unlocked
|
|
320
|
+
expiryTime: 1643364640, // If the targetPrice has not been reached by this point in time, the tokens will be unlocked
|
|
321
|
+
expiryPercentage: maxPercentage, // The percentage unlock rate of tokens after expiryTime, it should be maxPercentage or 100
|
|
322
|
+
|
|
323
|
+
};
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
### Fetching Aligned Stream Data
|
|
327
|
+
|
|
328
|
+
When you fetch a price-based stream using `getOne()`, `get()` or `searchStreams()`, it automatically returns an `AlignedContract` instance if the stream is price-based. You can check if a stream is aligned and access its price-based properties:
|
|
329
|
+
|
|
330
|
+
```javascript
|
|
331
|
+
import { isAligned, getNumberFromBN } from "@streamflow/stream";
|
|
332
|
+
|
|
333
|
+
const tokenDecimals = 9; // Token decimals for the stream's token
|
|
334
|
+
|
|
335
|
+
const stream = await client.getOne({
|
|
336
|
+
id: "AAAAyotqTZZMAAAAmsD1JAgksT8NVAAAASfrGB5RAAAA",
|
|
337
|
+
});
|
|
338
|
+
|
|
339
|
+
// Check if the stream is price-based (aligned)
|
|
340
|
+
if (isAligned(stream)) {
|
|
341
|
+
console.log("Min Price:", stream.minPrice);
|
|
342
|
+
console.log("Max Price:", stream.maxPrice);
|
|
343
|
+
console.log("Min Percentage:", stream.minPercentage);
|
|
344
|
+
console.log("Max Percentage:", stream.maxPercentage);
|
|
345
|
+
console.log("Tick Size:", stream.tickSize);
|
|
346
|
+
console.log("Oracle Type:", stream.oracleType); // "test", "pyth", or "none"
|
|
347
|
+
console.log("Price Oracle Address:", stream.priceOracle);
|
|
348
|
+
console.log("Initial Price:", stream.initialPrice);
|
|
349
|
+
console.log("Last Price:", stream.lastPrice);
|
|
350
|
+
console.log("Last Amount Update Time:", stream.lastAmountUpdateTime);
|
|
351
|
+
console.log("Initial Amount Per Period:", getNumberFromBN(stream.initialAmountPerPeriod, tokenDecimals));
|
|
352
|
+
console.log("Expiry Time:", stream.expiryTime);
|
|
353
|
+
console.log("Expiry Percentage:", stream.expiryPercentage);
|
|
354
|
+
console.log("Floor Price:", stream.floorPrice);
|
|
355
|
+
console.log("Proxy Address:", stream.proxyAddress);
|
|
356
|
+
}
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
All standard stream properties (like `amount`, `withdrawnAmount`, `unlocked()`, etc.) are also available on aligned streams, as `AlignedContract` extends the base `Contract` class.
|
|
360
|
+
|
|
361
|
+
> **Note:** Price-based Streams use a separate proxy program (Aligned Unlocks) to manage the dynamic unlock logic. The unlock rate is recalculated periodically based on the oracle price. Automatic withdrawal and rate updates are not supported for price-based streams.
|
|
217
362
|
|
|
218
363
|
## General Stream creation
|
|
219
364
|
|
|
@@ -426,7 +571,7 @@ console.log(remaining);
|
|
|
426
571
|
```javascript
|
|
427
572
|
const data: IGetAllData = {
|
|
428
573
|
address: "99h00075bKjVg000000tLdk4w42NyG3Mv0000dc0M99",
|
|
429
|
-
type: StreamType.All, // StreamType.Vesting, StreamType.Lock
|
|
574
|
+
type: StreamType.All, // StreamType.Vesting, StreamType.Lock
|
|
430
575
|
direction: StreamDirection.All, // StreamDirection.Outgoing, StreamDirection.Incoming
|
|
431
576
|
};
|
|
432
577
|
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -59,14 +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
|
-
};
|
|
65
62
|
var isVesting = (streamData) => {
|
|
66
|
-
return !
|
|
63
|
+
return !isCliffCloseToDepositedAmount(streamData) && !isDynamicLock(streamData.minPrice, streamData.maxPrice, streamData.minPercentage, streamData.maxPercentage);
|
|
67
64
|
};
|
|
68
65
|
var isAligned = (stream) => {
|
|
69
|
-
return
|
|
66
|
+
return stream.isAligned;
|
|
70
67
|
};
|
|
71
68
|
var isCreateAlignedStreamData = (obj) => {
|
|
72
69
|
return "minPrice" in obj && "maxPrice" in obj && "minPercentage" in obj && "maxPercentage" in obj;
|
|
@@ -78,13 +75,10 @@ var isTokenLock = (streamData) => {
|
|
|
78
75
|
return !streamData.canTopup && !streamData.automaticWithdrawal && !streamData.cancelableBySender && !streamData.cancelableByRecipient && !streamData.transferableBySender && (isCliffCloseToDepositedAmount(streamData) || isDynamicLock(streamData.minPrice, streamData.maxPrice, streamData.minPercentage, streamData.maxPercentage));
|
|
79
76
|
};
|
|
80
77
|
var buildStreamType = (streamData) => {
|
|
81
|
-
if (isVesting(streamData)) {
|
|
82
|
-
return "vesting" /* Vesting */;
|
|
83
|
-
}
|
|
84
78
|
if (isTokenLock(streamData)) {
|
|
85
79
|
return "lock" /* Lock */;
|
|
86
80
|
}
|
|
87
|
-
return "
|
|
81
|
+
return "vesting" /* Vesting */;
|
|
88
82
|
};
|
|
89
83
|
var decodeEndTime = (endTime) => {
|
|
90
84
|
if (endTime.gt(new BN3__default.default(MAX_SAFE_UNIX_TIME_VALUE))) {
|
|
@@ -101,7 +95,6 @@ var StreamDirection = /* @__PURE__ */ ((StreamDirection2) => {
|
|
|
101
95
|
})(StreamDirection || {});
|
|
102
96
|
var StreamType = /* @__PURE__ */ ((StreamType2) => {
|
|
103
97
|
StreamType2["All"] = "all";
|
|
104
|
-
StreamType2["Payment"] = "payment";
|
|
105
98
|
StreamType2["Vesting"] = "vesting";
|
|
106
99
|
StreamType2["Lock"] = "lock";
|
|
107
100
|
return StreamType2;
|
|
@@ -258,25 +251,40 @@ var ALIGNED_UNLOCKS_PROGRAM_ID = {
|
|
|
258
251
|
[common.ICluster.Testnet]: "aSTRM2NKoKxNnkmLWk9sz3k74gKBk9t7bpPrTGxMszH",
|
|
259
252
|
[common.ICluster.Local]: "aSTRM2NKoKxNnkmLWk9sz3k74gKBk9t7bpPrTGxMszH"
|
|
260
253
|
};
|
|
254
|
+
var PARTNER_ORACLE_PROGRAM_ID = {
|
|
255
|
+
[common.ICluster.Devnet]: "pardoTarcc6HKsPcbXkVycxsJsoN9QEzrdHgVdHAGY3",
|
|
256
|
+
[common.ICluster.Mainnet]: "pardpVtPjC8nLj1Dwncew62mUzfChdCX1EaoZe8oCAa",
|
|
257
|
+
[common.ICluster.Testnet]: "pardoTarcc6HKsPcbXkVycxsJsoN9QEzrdHgVdHAGY3",
|
|
258
|
+
[common.ICluster.Local]: "pardoTarcc6HKsPcbXkVycxsJsoN9QEzrdHgVdHAGY3"
|
|
259
|
+
};
|
|
260
|
+
var FEE_ORACLE_PUBLIC_KEY = {
|
|
261
|
+
[common.ICluster.Devnet]: "Aa2JJfFzUN3V54DXUHRBJowFw416xfZHpPk9DaNy3iYs",
|
|
262
|
+
[common.ICluster.Mainnet]: "B743wFVk2pCYhV91cn287e1xY7f1vt4gdY48hhNiuQmT",
|
|
263
|
+
[common.ICluster.Testnet]: "Aa2JJfFzUN3V54DXUHRBJowFw416xfZHpPk9DaNy3iYs",
|
|
264
|
+
[common.ICluster.Local]: "Aa2JJfFzUN3V54DXUHRBJowFw416xfZHpPk9DaNy3iYs"
|
|
265
|
+
};
|
|
261
266
|
var ALIGNED_COMPUTE_LIMIT = 3e5;
|
|
262
267
|
var CONTRACT_DISCRIMINATOR = [172, 138, 115, 242, 121, 67, 183, 26];
|
|
263
268
|
var TEST_ORACLE_DISCRIMINATOR = [198, 49, 63, 134, 232, 251, 168, 28];
|
|
264
269
|
var CONTRACT_SEED = buffer.Buffer.from("contract", "utf-8");
|
|
265
270
|
var ESCROW_SEED = buffer.Buffer.from("strm", "utf-8");
|
|
266
271
|
var TEST_ORACLE_SEED = buffer.Buffer.from("test-oracle", "utf-8");
|
|
267
|
-
var PARTNER_ORACLE_PROGRAM_ID = "pardpVtPjC8nLj1Dwncew62mUzfChdCX1EaoZe8oCAa";
|
|
268
272
|
var STREAMFLOW_TREASURY_PUBLIC_KEY = new web3_js.PublicKey("5SEpbdjFK5FxwTvfsGMXVQTD2v4M2c5tyRTxhdsPkgDw");
|
|
269
|
-
var
|
|
270
|
-
var
|
|
273
|
+
var WITHDRAWOR = "wdrwhnCv4pzW8beKsbPa4S2UDZrXenjg16KJdKSpb5u";
|
|
274
|
+
var WITHDRAWOR_PUBLIC_KEY = new web3_js.PublicKey(WITHDRAWOR);
|
|
271
275
|
var AIRDROP_TEST_TOKEN = "Gssm3vfi8s65R31SBdmQRq6cKeYojGgup7whkw4VCiQj";
|
|
272
276
|
var FEES_METADATA_SEED = buffer.Buffer.from("strm_fees");
|
|
273
|
-
var
|
|
277
|
+
var DEFAULT_CREATION_FEE_SOL = 9e7;
|
|
278
|
+
var DEFAULT_AUTO_CLAIM_FEE_SOL = 19e7;
|
|
279
|
+
var DEFAULT_STREAMFLOW_FEE = 0.19;
|
|
274
280
|
var AIRDROP_AMOUNT = 1;
|
|
275
281
|
var PARTNER_SCHEMA = {
|
|
276
282
|
struct: {
|
|
277
283
|
pubkey: { array: { type: "u8", len: 32 } },
|
|
278
|
-
|
|
279
|
-
|
|
284
|
+
creation_fee: "u32",
|
|
285
|
+
auto_claim_fee: "u32",
|
|
286
|
+
token_fee_percent: "f32",
|
|
287
|
+
buffer: { array: { type: "u8", len: 16 } }
|
|
280
288
|
}
|
|
281
289
|
};
|
|
282
290
|
var PARTNERS_SCHEMA = { array: { type: PARTNER_SCHEMA } };
|
|
@@ -2529,6 +2537,8 @@ var SolanaStreamClient = class {
|
|
|
2529
2537
|
this.commitment = commitment;
|
|
2530
2538
|
this.connection = new web3_js.Connection(optionsOrClusterUrl, this.commitment);
|
|
2531
2539
|
this.programId = programId !== "" ? new web3_js.PublicKey(programId) : new web3_js.PublicKey(PROGRAM_ID[cluster]);
|
|
2540
|
+
this.partnerOracleProgramId = new web3_js.PublicKey(PARTNER_ORACLE_PROGRAM_ID[cluster]);
|
|
2541
|
+
this.feeOraclePublicKey = new web3_js.PublicKey(FEE_ORACLE_PUBLIC_KEY[cluster]);
|
|
2532
2542
|
this.schedulingParams = {
|
|
2533
2543
|
sendThrottler: sendThrottler ?? common.buildSendThrottler(sendRate)
|
|
2534
2544
|
};
|
|
@@ -2543,6 +2553,8 @@ var SolanaStreamClient = class {
|
|
|
2543
2553
|
this.commitment = commitment2;
|
|
2544
2554
|
this.connection = new web3_js.Connection(clusterUrl, this.commitment);
|
|
2545
2555
|
this.programId = programId2 !== "" ? new web3_js.PublicKey(programId2) : new web3_js.PublicKey(PROGRAM_ID[cluster2]);
|
|
2556
|
+
this.partnerOracleProgramId = new web3_js.PublicKey(PARTNER_ORACLE_PROGRAM_ID[cluster2]);
|
|
2557
|
+
this.feeOraclePublicKey = new web3_js.PublicKey(FEE_ORACLE_PUBLIC_KEY[cluster2]);
|
|
2546
2558
|
const schedulingOptions = sendScheduler && "sendRate" in sendScheduler ? sendScheduler : void 0;
|
|
2547
2559
|
const sendThrottler2 = !sendScheduler ? common.buildSendThrottler(1) : "sendRate" in sendScheduler ? common.buildSendThrottler(sendScheduler.sendRate ?? 1, sendScheduler.sendInterval) : sendScheduler;
|
|
2548
2560
|
this.schedulingParams = {
|
|
@@ -2583,7 +2595,7 @@ var SolanaStreamClient = class {
|
|
|
2583
2595
|
const { partner, amount, tokenProgramId } = data;
|
|
2584
2596
|
const { isNative, sender, customInstructions } = extParams;
|
|
2585
2597
|
common.assertHasPublicKey(sender, "Sender's PublicKey is not available, check passed wallet adapter!");
|
|
2586
|
-
const partnerPublicKey = partner ? new web3_js.PublicKey(partner) :
|
|
2598
|
+
const partnerPublicKey = partner ? new web3_js.PublicKey(partner) : sender.publicKey;
|
|
2587
2599
|
const mintPublicKey = new web3_js.PublicKey(data.tokenId);
|
|
2588
2600
|
const ixs = await this.getCreateATAInstructions(
|
|
2589
2601
|
[partnerPublicKey],
|
|
@@ -2671,7 +2683,7 @@ var SolanaStreamClient = class {
|
|
|
2671
2683
|
return { ixs, txId: signature, metadataId };
|
|
2672
2684
|
}
|
|
2673
2685
|
async prepareCreateInstructions(streamParams, extParams) {
|
|
2674
|
-
const { ixs, metadata, metadataPubKey } = isCreateAlignedStreamData(streamParams) ? await this.prepareCreateAlignedUnlockInstructions(streamParams, extParams) : await this.
|
|
2686
|
+
const { ixs, metadata, metadataPubKey } = isCreateAlignedStreamData(streamParams) ? await this.prepareCreateAlignedUnlockInstructions(streamParams, extParams) : await this.prepareCreateLinearStreamInstructions(streamParams, extParams);
|
|
2675
2687
|
return { ixs, metadata, metadataPubKey };
|
|
2676
2688
|
}
|
|
2677
2689
|
async prepareCreateAlignedUnlockInstructions(streamParams, extParams) {
|
|
@@ -2719,7 +2731,7 @@ var SolanaStreamClient = class {
|
|
|
2719
2731
|
if (!tokenProgramId) {
|
|
2720
2732
|
tokenProgramId = (await common.getMintAndProgram(this.connection, mintPublicKey)).tokenProgramId;
|
|
2721
2733
|
}
|
|
2722
|
-
const partnerPublicKey = partner ? new web3_js.PublicKey(partner) :
|
|
2734
|
+
const partnerPublicKey = partner ? new web3_js.PublicKey(partner) : sender.publicKey;
|
|
2723
2735
|
const streamflowProgramPublicKey = new web3_js.PublicKey(this.programId);
|
|
2724
2736
|
const escrowPDA = deriveEscrowPDA(streamflowProgramPublicKey, metadataPubKey);
|
|
2725
2737
|
const oracle = priceOracle ?? deriveTestOraclePDA(this.alignedProxyProgram.programId, mintPublicKey, sender.publicKey);
|
|
@@ -2766,7 +2778,7 @@ var SolanaStreamClient = class {
|
|
|
2766
2778
|
partner: partnerPublicKey,
|
|
2767
2779
|
recipient: recipientPublicKey,
|
|
2768
2780
|
withdrawor: WITHDRAWOR_PUBLIC_KEY,
|
|
2769
|
-
feeOracle:
|
|
2781
|
+
feeOracle: this.feeOraclePublicKey,
|
|
2770
2782
|
priceOracle: oracle,
|
|
2771
2783
|
tokenProgram: tokenProgramId,
|
|
2772
2784
|
streamflowProgram: this.programId
|
|
@@ -2781,7 +2793,7 @@ var SolanaStreamClient = class {
|
|
|
2781
2793
|
* @param {IPrepareCreateStreamExt} extParams - Transaction configuration including sender wallet, metadata keys, and compute settings
|
|
2782
2794
|
* @returns Create stream instructions
|
|
2783
2795
|
*/
|
|
2784
|
-
async
|
|
2796
|
+
async prepareCreateLinearStreamInstructions({
|
|
2785
2797
|
recipient,
|
|
2786
2798
|
tokenId: mint,
|
|
2787
2799
|
start,
|
|
@@ -2822,7 +2834,7 @@ var SolanaStreamClient = class {
|
|
|
2822
2834
|
const senderTokens = await common.ata(mintPublicKey, sender.publicKey, tokenProgramId);
|
|
2823
2835
|
const recipientTokens = await common.ata(mintPublicKey, recipientPublicKey, tokenProgramId);
|
|
2824
2836
|
const streamflowTreasuryTokens = await common.ata(mintPublicKey, STREAMFLOW_TREASURY_PUBLIC_KEY, tokenProgramId);
|
|
2825
|
-
const partnerPublicKey = partner ? new web3_js.PublicKey(partner) :
|
|
2837
|
+
const partnerPublicKey = partner ? new web3_js.PublicKey(partner) : sender.publicKey;
|
|
2826
2838
|
const partnerTokens = await common.ata(mintPublicKey, partnerPublicKey, tokenProgramId);
|
|
2827
2839
|
ixs.push(
|
|
2828
2840
|
await createStreamInstruction(
|
|
@@ -2857,7 +2869,7 @@ var SolanaStreamClient = class {
|
|
|
2857
2869
|
partner: partnerPublicKey,
|
|
2858
2870
|
partnerTokens,
|
|
2859
2871
|
mint: new web3_js.PublicKey(mint),
|
|
2860
|
-
feeOracle:
|
|
2872
|
+
feeOracle: this.feeOraclePublicKey,
|
|
2861
2873
|
rent: web3_js.SYSVAR_RENT_PUBKEY,
|
|
2862
2874
|
timelockProgram: this.programId,
|
|
2863
2875
|
tokenProgram: tokenProgramId,
|
|
@@ -2946,7 +2958,7 @@ var SolanaStreamClient = class {
|
|
|
2946
2958
|
);
|
|
2947
2959
|
const { tokenProgramId } = await common.getMintAndProgram(this.connection, mintPublicKey);
|
|
2948
2960
|
const senderTokens = await common.ata(mintPublicKey, sender.publicKey, tokenProgramId);
|
|
2949
|
-
const partnerPublicKey = partner ? new web3_js.PublicKey(partner) :
|
|
2961
|
+
const partnerPublicKey = partner ? new web3_js.PublicKey(partner) : sender.publicKey;
|
|
2950
2962
|
const ixs = common.prepareBaseInstructions(this.connection, {
|
|
2951
2963
|
computePrice,
|
|
2952
2964
|
computeLimit
|
|
@@ -2984,7 +2996,7 @@ var SolanaStreamClient = class {
|
|
|
2984
2996
|
metadata: metadataPubKey,
|
|
2985
2997
|
escrowTokens,
|
|
2986
2998
|
mint: new web3_js.PublicKey(mint),
|
|
2987
|
-
feeOracle:
|
|
2999
|
+
feeOracle: this.feeOraclePublicKey,
|
|
2988
3000
|
rent: web3_js.SYSVAR_RENT_PUBKEY,
|
|
2989
3001
|
timelockProgram: this.programId,
|
|
2990
3002
|
tokenProgram: tokenProgramId,
|
|
@@ -3002,15 +3014,14 @@ var SolanaStreamClient = class {
|
|
|
3002
3014
|
* @param {IPrepareCreateStreamExt} extParams - Transaction configuration including sender public key, native token handling, and custom instructions
|
|
3003
3015
|
* @returns Create multiple transaction instructions
|
|
3004
3016
|
*/
|
|
3005
|
-
async buildCreateMultipleTransactionInstructions(data, extParams) {
|
|
3017
|
+
async buildCreateMultipleTransactionInstructions(data, extParams, applyCustomAfterInstructions = true) {
|
|
3006
3018
|
const { recipients, ...streamParams } = data;
|
|
3007
3019
|
const { sender, metadataPubKeys: metadataPubKeysExt, isNative, customInstructions } = extParams;
|
|
3008
3020
|
common.assertHasPublicKey(sender, "Sender's PublicKey is not available, check passed wallet adapter!");
|
|
3009
3021
|
const metadatas = [];
|
|
3010
3022
|
const metadataToRecipient = {};
|
|
3011
3023
|
const instructionsBatch = [];
|
|
3012
|
-
const
|
|
3013
|
-
const partnerPublicKey = data.partner ? new web3_js.PublicKey(data.partner) : WITHDRAWOR_PUBLIC_KEY;
|
|
3024
|
+
const partnerPublicKey = data.partner ? new web3_js.PublicKey(data.partner) : sender.publicKey;
|
|
3014
3025
|
const mintPublicKey = new web3_js.PublicKey(data.tokenId);
|
|
3015
3026
|
if (recipients.length === 0) {
|
|
3016
3027
|
throw new Error("Recipients array is empty!");
|
|
@@ -3019,14 +3030,16 @@ var SolanaStreamClient = class {
|
|
|
3019
3030
|
const recipientData = recipients[i];
|
|
3020
3031
|
const createStreamData = { ...streamParams, ...recipientData };
|
|
3021
3032
|
const createStreamExtParams = {
|
|
3022
|
-
|
|
3023
|
-
|
|
3033
|
+
...extParams,
|
|
3034
|
+
metadataPubKeys: metadataPubKeysExt?.[i] ? [metadataPubKeysExt[i]] : void 0
|
|
3024
3035
|
};
|
|
3025
3036
|
const { ixs, metadata, metadataPubKey } = await this.prepareCreateInstructions(
|
|
3026
3037
|
createStreamData,
|
|
3027
3038
|
createStreamExtParams
|
|
3028
3039
|
);
|
|
3029
|
-
|
|
3040
|
+
if (applyCustomAfterInstructions) {
|
|
3041
|
+
await this.applyCustomAfterInstructions(ixs, customInstructions, metadataPubKey);
|
|
3042
|
+
}
|
|
3030
3043
|
metadataToRecipient[metadataPubKey.toBase58()] = recipientData;
|
|
3031
3044
|
metadatas.push(metadataPubKey.toBase58());
|
|
3032
3045
|
instructionsBatch.push({
|
|
@@ -3074,9 +3087,9 @@ var SolanaStreamClient = class {
|
|
|
3074
3087
|
* @param {IPrepareCreateStreamExt} extParams - Transaction configuration including sender public key, native token handling, and custom instructions
|
|
3075
3088
|
* @returns Multiple transaction information
|
|
3076
3089
|
*/
|
|
3077
|
-
async buildCreateMultipleTransactions(data, extParams) {
|
|
3090
|
+
async buildCreateMultipleTransactions(data, extParams, applyCustomAfterInstructions = true) {
|
|
3078
3091
|
const { sender } = extParams;
|
|
3079
|
-
const { instructionsBatch, metadatas, metadataToRecipient, prepareInstructions } = await this.buildCreateMultipleTransactionInstructions(data, extParams);
|
|
3092
|
+
const { instructionsBatch, metadatas, metadataToRecipient, prepareInstructions } = await this.buildCreateMultipleTransactionInstructions(data, extParams, applyCustomAfterInstructions);
|
|
3080
3093
|
const { value: hash, context } = await this.connection.getLatestBlockhashAndContext();
|
|
3081
3094
|
const batch = [];
|
|
3082
3095
|
for (const { ixs, metadata, recipient } of instructionsBatch) {
|
|
@@ -3107,7 +3120,7 @@ var SolanaStreamClient = class {
|
|
|
3107
3120
|
if (!sender.publicKey) {
|
|
3108
3121
|
throw new Error("Sender's PublicKey is not available, check passed wallet adapter!");
|
|
3109
3122
|
}
|
|
3110
|
-
const { instructionsBatch, metadatas,
|
|
3123
|
+
const { instructionsBatch, metadatas, prepareInstructions, metadataToRecipient } = await this.flatBuildCreateMultipleTransactionInstructions(data, extParams);
|
|
3111
3124
|
const errors = [];
|
|
3112
3125
|
const signatures = [];
|
|
3113
3126
|
const metadataPubKeys = metadataPubKeysExt || [];
|
|
@@ -3172,7 +3185,7 @@ var SolanaStreamClient = class {
|
|
|
3172
3185
|
if (!sender.publicKey) {
|
|
3173
3186
|
throw new Error("Sender's PublicKey is not available, check passed wallet adapter!");
|
|
3174
3187
|
}
|
|
3175
|
-
const { instructionsBatch, metadatas,
|
|
3188
|
+
const { instructionsBatch, metadatas, prepareInstructions, metadataToRecipient } = await this.flatBuildCreateMultipleTransactionInstructions(data, extParams);
|
|
3176
3189
|
const errors = [];
|
|
3177
3190
|
const signatures = [];
|
|
3178
3191
|
const batch = [];
|
|
@@ -3334,7 +3347,7 @@ var SolanaStreamClient = class {
|
|
|
3334
3347
|
}
|
|
3335
3348
|
const { sender: senderPublicKey } = decodeStream(account.data);
|
|
3336
3349
|
const isAlignedUnlock = this.isAlignedUnlock(streamPublicKey, senderPublicKey);
|
|
3337
|
-
const ixs = isAlignedUnlock ? await this.prepareCancelAlignedUnlockInstructions(cancelData, extParams) : await this.
|
|
3350
|
+
const ixs = isAlignedUnlock ? await this.prepareCancelAlignedUnlockInstructions(cancelData, extParams) : await this.prepareCancelLinearStream(cancelData, extParams);
|
|
3338
3351
|
return ixs;
|
|
3339
3352
|
}
|
|
3340
3353
|
/**
|
|
@@ -3382,7 +3395,7 @@ var SolanaStreamClient = class {
|
|
|
3382
3395
|
* @param {IPrepareStreamExt} extParams - Transaction configuration including invoker wallet, token account validation, and compute settings
|
|
3383
3396
|
* @returns Transaction instructions
|
|
3384
3397
|
*/
|
|
3385
|
-
async
|
|
3398
|
+
async prepareCancelLinearStream({ id }, { invoker, checkTokenAccounts, computePrice, computeLimit }) {
|
|
3386
3399
|
common.assertHasPublicKey(invoker, "Invoker's PublicKey is not available, check passed wallet adapter!");
|
|
3387
3400
|
const streamPublicKey = new web3_js.PublicKey(id);
|
|
3388
3401
|
const escrowAcc = await this.connection.getAccountInfo(streamPublicKey);
|
|
@@ -3686,20 +3699,41 @@ var SolanaStreamClient = class {
|
|
|
3686
3699
|
const accounts = await this.connection.getProgramAccounts(this.programId, {
|
|
3687
3700
|
filters
|
|
3688
3701
|
});
|
|
3689
|
-
const
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3702
|
+
const decoded = this.decodeStreamsFromAccounts(accounts);
|
|
3703
|
+
const alignedEntries = this.collectAlignedEntries(decoded);
|
|
3704
|
+
const alignedProxies = await this.fetchAlignedProxiesByEntries(alignedEntries);
|
|
3705
|
+
return this.mapDecodedToProgramAccounts(decoded, alignedEntries, alignedProxies);
|
|
3706
|
+
}
|
|
3707
|
+
decodeStreamsFromAccounts(accounts) {
|
|
3708
|
+
return accounts.map(({ pubkey, account }) => ({
|
|
3709
|
+
pubkey,
|
|
3710
|
+
stream: decodeStream(account.data)
|
|
3711
|
+
}));
|
|
3712
|
+
}
|
|
3713
|
+
collectAlignedEntries(decoded) {
|
|
3714
|
+
const entries = [];
|
|
3715
|
+
decoded.forEach(({ pubkey, stream }, index) => {
|
|
3716
|
+
if (this.isAlignedUnlock(pubkey, stream.sender)) {
|
|
3717
|
+
entries.push({ index, pda: deriveContractPDA(this.alignedProxyProgram.programId, pubkey) });
|
|
3718
|
+
}
|
|
3719
|
+
});
|
|
3720
|
+
return entries;
|
|
3721
|
+
}
|
|
3722
|
+
async fetchAlignedProxiesByEntries(aligned) {
|
|
3723
|
+
if (aligned.length === 0) return [];
|
|
3724
|
+
const res = await this.alignedProxyProgram.account.contract.fetchMultiple(aligned.map((a) => a.pda));
|
|
3725
|
+
return res;
|
|
3726
|
+
}
|
|
3727
|
+
mapDecodedToProgramAccounts(decoded, alignedEntries, alignedProxies) {
|
|
3728
|
+
return decoded.map(({ pubkey, stream }, idx) => {
|
|
3729
|
+
const alignedIdx = alignedEntries.findIndex((a) => a.index === idx);
|
|
3730
|
+
if (alignedIdx !== -1) {
|
|
3731
|
+
const alignedProxy = alignedProxies[alignedIdx];
|
|
3732
|
+
common.invariant(alignedProxy, "Couldn't get aligned proxy account info");
|
|
3733
|
+
return { publicKey: pubkey, account: new AlignedContract(stream, alignedProxy) };
|
|
3734
|
+
}
|
|
3735
|
+
return { publicKey: pubkey, account: new Contract(stream) };
|
|
3736
|
+
});
|
|
3703
3737
|
}
|
|
3704
3738
|
/**
|
|
3705
3739
|
* Attempts updating the stream auto withdrawal params and amount per period
|
|
@@ -3769,35 +3803,47 @@ var SolanaStreamClient = class {
|
|
|
3769
3803
|
* @returns Fees
|
|
3770
3804
|
*/
|
|
3771
3805
|
async getFees({ address }) {
|
|
3772
|
-
const
|
|
3773
|
-
[buffer.Buffer.from(FEES_METADATA_SEED)],
|
|
3774
|
-
new web3_js.PublicKey(PARTNER_ORACLE_PROGRAM_ID)
|
|
3775
|
-
);
|
|
3776
|
-
const data = await this.connection.getAccountInfo(metadataPubKey);
|
|
3806
|
+
const data = await this.connection.getAccountInfo(this.feeOraclePublicKey);
|
|
3777
3807
|
if (!data) {
|
|
3778
3808
|
return null;
|
|
3779
3809
|
}
|
|
3780
3810
|
const partners = borsh__namespace.deserialize(PARTNERS_SCHEMA, data.data);
|
|
3781
|
-
const
|
|
3782
|
-
|
|
3783
|
-
|
|
3811
|
+
for (const partner of partners) {
|
|
3812
|
+
const partnerAddress = new web3_js.PublicKey(partner.pubkey).toString();
|
|
3813
|
+
if (partnerAddress === address) {
|
|
3814
|
+
return {
|
|
3815
|
+
creationFeeSol: Number(partner.creation_fee),
|
|
3816
|
+
autoClaimFeeSol: Number(partner.auto_claim_fee),
|
|
3817
|
+
streamflowFee: Number(partner.token_fee_percent.toFixed(4)),
|
|
3818
|
+
partnerFee: 0
|
|
3819
|
+
};
|
|
3820
|
+
}
|
|
3784
3821
|
}
|
|
3785
|
-
return
|
|
3786
|
-
streamflowFee: Number(filteredPartners[0].strm_fee.toFixed(4)),
|
|
3787
|
-
partnerFee: Number(filteredPartners[0].partner_fee.toFixed(4))
|
|
3788
|
-
};
|
|
3822
|
+
return null;
|
|
3789
3823
|
}
|
|
3790
3824
|
/**
|
|
3791
3825
|
* Gets default streamflow fee
|
|
3792
3826
|
* @returns Default streamflow fee
|
|
3793
3827
|
*/
|
|
3794
3828
|
async getDefaultStreamflowFee() {
|
|
3795
|
-
return
|
|
3829
|
+
return (await this.getDefaultFees()).streamflowFee;
|
|
3830
|
+
}
|
|
3831
|
+
/**
|
|
3832
|
+
* Get all defaults fees applied by the protocol.
|
|
3833
|
+
*
|
|
3834
|
+
* Protocol will use fees set for WITHDRAWOR as default if they are set.
|
|
3835
|
+
*/
|
|
3836
|
+
async getDefaultFees() {
|
|
3837
|
+
return await this.getFees({ address: WITHDRAWOR }) || {
|
|
3838
|
+
creationFeeSol: DEFAULT_CREATION_FEE_SOL,
|
|
3839
|
+
autoClaimFeeSol: DEFAULT_AUTO_CLAIM_FEE_SOL,
|
|
3840
|
+
streamflowFee: DEFAULT_STREAMFLOW_FEE,
|
|
3841
|
+
partnerFee: 0
|
|
3842
|
+
};
|
|
3796
3843
|
}
|
|
3797
3844
|
/**
|
|
3798
3845
|
* Returns total fee percent, streamflow fees + partner fees
|
|
3799
3846
|
* @param getFeesData structure with address for which we need to derive fee, either sender or partner usually
|
|
3800
|
-
* @param chainSpecificParams additional parameters required by chain client
|
|
3801
3847
|
* @returns fee as floating number, so if fee is 0.99%, it will return 0.99
|
|
3802
3848
|
*/
|
|
3803
3849
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -3824,6 +3870,21 @@ var SolanaStreamClient = class {
|
|
|
3824
3870
|
const pda = deriveContractPDA(this.alignedProxyProgram.programId, streamPublicKey);
|
|
3825
3871
|
return senderPublicKey.equals(pda);
|
|
3826
3872
|
}
|
|
3873
|
+
async flatBuildCreateMultipleTransactionInstructions(data, extParams) {
|
|
3874
|
+
const dataArray = Array.isArray(data) ? data : [data];
|
|
3875
|
+
const results = await Promise.all(
|
|
3876
|
+
dataArray.map((item, index) => this.buildCreateMultipleTransactionInstructions(item, extParams, index === 0))
|
|
3877
|
+
);
|
|
3878
|
+
return {
|
|
3879
|
+
instructionsBatch: results.flatMap((r) => r.instructionsBatch),
|
|
3880
|
+
metadatas: results.flatMap((r) => r.metadatas),
|
|
3881
|
+
prepareInstructions: results.flatMap((r) => r.prepareInstructions),
|
|
3882
|
+
metadataToRecipient: results.reduce(
|
|
3883
|
+
(acc, r) => Object.assign(acc, r.metadataToRecipient),
|
|
3884
|
+
{}
|
|
3885
|
+
)
|
|
3886
|
+
};
|
|
3887
|
+
}
|
|
3827
3888
|
/**
|
|
3828
3889
|
* Utility function to generate metadata for a Contract or return existing Pubkey
|
|
3829
3890
|
*/
|
|
@@ -4311,6 +4372,8 @@ exports.CONTRACT_SEED = CONTRACT_SEED;
|
|
|
4311
4372
|
exports.CREATE_PARAMS_PADDING = CREATE_PARAMS_PADDING;
|
|
4312
4373
|
exports.Contract = Contract;
|
|
4313
4374
|
exports.ContractErrorCode = ContractErrorCode;
|
|
4375
|
+
exports.DEFAULT_AUTO_CLAIM_FEE_SOL = DEFAULT_AUTO_CLAIM_FEE_SOL;
|
|
4376
|
+
exports.DEFAULT_CREATION_FEE_SOL = DEFAULT_CREATION_FEE_SOL;
|
|
4314
4377
|
exports.DEFAULT_STREAMFLOW_FEE = DEFAULT_STREAMFLOW_FEE;
|
|
4315
4378
|
exports.ESCROW_SEED = ESCROW_SEED;
|
|
4316
4379
|
exports.FEES_METADATA_SEED = FEES_METADATA_SEED;
|
|
@@ -4335,6 +4398,7 @@ exports.StreamType = StreamType;
|
|
|
4335
4398
|
exports.TEST_ORACLE_DISCRIMINATOR = TEST_ORACLE_DISCRIMINATOR;
|
|
4336
4399
|
exports.TEST_ORACLE_SEED = TEST_ORACLE_SEED;
|
|
4337
4400
|
exports.TX_FINALITY_CONFIRMED = TX_FINALITY_CONFIRMED;
|
|
4401
|
+
exports.WITHDRAWOR = WITHDRAWOR;
|
|
4338
4402
|
exports.WITHDRAWOR_PUBLIC_KEY = WITHDRAWOR_PUBLIC_KEY;
|
|
4339
4403
|
exports.WITHDRAW_AVAILABLE_AMOUNT = WITHDRAW_AVAILABLE_AMOUNT;
|
|
4340
4404
|
exports.buildStreamType = buildStreamType;
|
|
@@ -4354,7 +4418,6 @@ exports.isAligned = isAligned;
|
|
|
4354
4418
|
exports.isCliffCloseToDepositedAmount = isCliffCloseToDepositedAmount;
|
|
4355
4419
|
exports.isCreateAlignedStreamData = isCreateAlignedStreamData;
|
|
4356
4420
|
exports.isDynamicLock = isDynamicLock;
|
|
4357
|
-
exports.isPayment = isPayment;
|
|
4358
4421
|
exports.isTokenLock = isTokenLock;
|
|
4359
4422
|
exports.isVesting = isVesting;
|
|
4360
4423
|
exports.sendAndConfirmStreamRawTransaction = sendAndConfirmStreamRawTransaction;
|