@streamflow/stream 8.3.1 → 8.4.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.
Files changed (32) hide show
  1. package/dist/cjs/{BaseStreamClient-uzoqllcf.d.cts → BaseStreamClient-DOyJqO7R.d.cts} +2 -0
  2. package/dist/cjs/aptos/index.d.cts +2 -2
  3. package/dist/cjs/evm/index.d.cts +2 -2
  4. package/dist/cjs/{index-ehppV5TW.d.cts → index-BAZFUaQL.d.cts} +2 -1
  5. package/dist/cjs/{index-DM9lJY7y.d.cts → index-BMZATAYa.d.cts} +1 -1
  6. package/dist/cjs/{index-BpvTuTHx.d.cts → index-DYIamO0j.d.cts} +1 -1
  7. package/dist/cjs/{index-CA72ko5B.d.cts → index-Y0HH2ugY.d.cts} +1 -1
  8. package/dist/cjs/index.cjs +35 -8
  9. package/dist/cjs/index.cjs.map +1 -1
  10. package/dist/cjs/index.d.cts +10 -10
  11. package/dist/cjs/solana/descriptor/streamflow_aligned_unlocks.d.cts +26 -2
  12. package/dist/cjs/solana/index.cjs +35 -8
  13. package/dist/cjs/solana/index.cjs.map +1 -1
  14. package/dist/cjs/solana/index.d.cts +2 -2
  15. package/dist/cjs/sui/index.d.cts +2 -2
  16. package/dist/esm/{BaseStreamClient-uzoqllcf.d.ts → BaseStreamClient-DOyJqO7R.d.ts} +2 -0
  17. package/dist/esm/aptos/index.d.ts +2 -2
  18. package/dist/esm/evm/index.d.ts +2 -2
  19. package/dist/esm/{index-DvlYnKNo.d.ts → index-D54wSYym.d.ts} +1 -1
  20. package/dist/esm/{index-C_tXt0ti.d.ts → index-DKkJbavt.d.ts} +2 -1
  21. package/dist/esm/{index-BLMg_CgS.d.ts → index-DrzqsoIB.d.ts} +1 -1
  22. package/dist/esm/{index-DJNjOKR0.d.ts → index-elpYUBph.d.ts} +1 -1
  23. package/dist/esm/index.d.ts +10 -10
  24. package/dist/esm/index.js +35 -8
  25. package/dist/esm/index.js.map +1 -1
  26. package/dist/esm/solana/descriptor/idl/streamflow_aligned_unlocks.json +26 -2
  27. package/dist/esm/solana/descriptor/streamflow_aligned_unlocks.d.ts +26 -2
  28. package/dist/esm/solana/index.d.ts +2 -2
  29. package/dist/esm/solana/index.js +35 -8
  30. package/dist/esm/solana/index.js.map +1 -1
  31. package/dist/esm/sui/index.d.ts +2 -2
  32. package/package.json +4 -4
@@ -1,13 +1,13 @@
1
- import { A as AptosStreamClient, I as ICreateStreamAptosExt, a as ITransactionAptosExt } from './index-BpvTuTHx.cjs';
2
- export { i as StreamflowAptos } from './index-BpvTuTHx.cjs';
3
- import { E as EvmStreamClient } from './index-DM9lJY7y.cjs';
4
- export { i as StreamflowEVM } from './index-DM9lJY7y.cjs';
5
- import { S as SolanaStreamClient, I as ICreateStreamSolanaExt, a as IInteractStreamSolanaExt, b as ITopUpStreamSolanaExt } from './index-ehppV5TW.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-ehppV5TW.cjs';
7
- import { S as SuiStreamClient } from './index-CA72ko5B.cjs';
8
- export { i as StreamflowSui } from './index-CA72ko5B.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-uzoqllcf.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-uzoqllcf.cjs';
1
+ import { A as AptosStreamClient, I as ICreateStreamAptosExt, a as ITransactionAptosExt } from './index-DYIamO0j.cjs';
2
+ export { i as StreamflowAptos } from './index-DYIamO0j.cjs';
3
+ import { E as EvmStreamClient } from './index-BMZATAYa.cjs';
4
+ export { i as StreamflowEVM } from './index-BMZATAYa.cjs';
5
+ import { S as SolanaStreamClient, I as ICreateStreamSolanaExt, a as IInteractStreamSolanaExt, b as ITopUpStreamSolanaExt } from './index-BAZFUaQL.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-BAZFUaQL.cjs';
7
+ import { S as SuiStreamClient } from './index-Y0HH2ugY.cjs';
8
+ export { i as StreamflowSui } from './index-Y0HH2ugY.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-DOyJqO7R.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-DOyJqO7R.cjs';
11
11
  import BN from 'bn.js';
12
12
  import { IChain } from '@streamflow/common';
13
13
  export { ContractError, IChain, ICluster } from '@streamflow/common';
@@ -8,7 +8,7 @@ type StreamflowAlignedUnlocks = {
8
8
  "address": "aSTRM2NKoKxNnkmLWk9sz3k74gKBk9t7bpPrTGxMszH";
9
9
  "metadata": {
10
10
  "name": "streamflowAlignedUnlocks";
11
- "version": "1.2.0";
11
+ "version": "1.3.0";
12
12
  "spec": "0.1.0";
13
13
  "description": "Proxy to update unlock amount within Streamflow vesting protocol according to Token performance and other metrics";
14
14
  };
@@ -1020,6 +1020,16 @@ type StreamflowAlignedUnlocks = {
1020
1020
  "code": 6014;
1021
1021
  "name": "dynamicScheduleExpired";
1022
1022
  "msg": "Dynamic schedule expired, updates are not allowed";
1023
+ },
1024
+ {
1025
+ "code": 6015;
1026
+ "name": "floorPriceReached";
1027
+ "msg": "Floor price has already been reached, updates are not allowed";
1028
+ },
1029
+ {
1030
+ "code": 6016;
1031
+ "name": "invalidFloorPrice";
1032
+ "msg": "Provided floor price is invalid, should be less than minimum price";
1023
1033
  }
1024
1034
  ];
1025
1035
  "types": [
@@ -1209,6 +1219,13 @@ type StreamflowAlignedUnlocks = {
1209
1219
  ];
1210
1220
  "type": "u64";
1211
1221
  },
1222
+ {
1223
+ "name": "floorPrice";
1224
+ "docs": [
1225
+ "Floor price boundary, if the price is below this boundary, the contract will be unlocked"
1226
+ ];
1227
+ "type": "u64";
1228
+ },
1212
1229
  {
1213
1230
  "name": "buffer";
1214
1231
  "docs": [
@@ -1217,7 +1234,7 @@ type StreamflowAlignedUnlocks = {
1217
1234
  "type": {
1218
1235
  "array": [
1219
1236
  "u8",
1220
- 16
1237
+ 8
1221
1238
  ];
1222
1239
  };
1223
1240
  }
@@ -1369,6 +1386,13 @@ type StreamflowAlignedUnlocks = {
1369
1386
  "Percentage to set when contract expires, won't be updated after it"
1370
1387
  ];
1371
1388
  "type": "u64";
1389
+ },
1390
+ {
1391
+ "name": "floorPrice";
1392
+ "docs": [
1393
+ "Floor price boundary, if the price is below this boundary, the contract will be unlocked"
1394
+ ];
1395
+ "type": "u64";
1372
1396
  }
1373
1397
  ];
1374
1398
  };
@@ -300,6 +300,7 @@ var AlignedContract = class extends Contract {
300
300
  this.initialNetAmount = alignedProxy.initialNetAmount;
301
301
  this.expiryTime = alignedProxy.expiryTime.toNumber();
302
302
  this.expiryPercentage = getNumberFromBN(alignedProxy.expiryPercentage, ALIGNED_PRECISION_FACTOR_POW);
303
+ this.floorPrice = getNumberFromBN(alignedProxy.floorPrice, ALIGNED_PRECISION_FACTOR_POW);
303
304
  this.type = buildStreamType(this);
304
305
  this.isAligned = true;
305
306
  }
@@ -899,7 +900,7 @@ var streamflow_aligned_unlocks_default = {
899
900
  address: "aSTRM2NKoKxNnkmLWk9sz3k74gKBk9t7bpPrTGxMszH",
900
901
  metadata: {
901
902
  name: "streamflow_aligned_unlocks",
902
- version: "1.2.0",
903
+ version: "1.3.0",
903
904
  spec: "0.1.0",
904
905
  description: "Proxy to update unlock amount within Streamflow vesting protocol according to Token performance and other metrics"
905
906
  },
@@ -1911,6 +1912,16 @@ var streamflow_aligned_unlocks_default = {
1911
1912
  code: 6014,
1912
1913
  name: "DynamicScheduleExpired",
1913
1914
  msg: "Dynamic schedule expired, updates are not allowed"
1915
+ },
1916
+ {
1917
+ code: 6015,
1918
+ name: "FloorPriceReached",
1919
+ msg: "Floor price has already been reached, updates are not allowed"
1920
+ },
1921
+ {
1922
+ code: 6016,
1923
+ name: "InvalidFloorPrice",
1924
+ msg: "Provided floor price is invalid, should be less than minimum price"
1914
1925
  }
1915
1926
  ],
1916
1927
  types: [
@@ -2100,6 +2111,13 @@ var streamflow_aligned_unlocks_default = {
2100
2111
  ],
2101
2112
  type: "u64"
2102
2113
  },
2114
+ {
2115
+ name: "floor_price",
2116
+ docs: [
2117
+ "Floor price boundary, if the price is below this boundary, the contract will be unlocked"
2118
+ ],
2119
+ type: "u64"
2120
+ },
2103
2121
  {
2104
2122
  name: "buffer",
2105
2123
  docs: [
@@ -2108,7 +2126,7 @@ var streamflow_aligned_unlocks_default = {
2108
2126
  type: {
2109
2127
  array: [
2110
2128
  "u8",
2111
- 16
2129
+ 8
2112
2130
  ]
2113
2131
  }
2114
2132
  }
@@ -2260,6 +2278,13 @@ var streamflow_aligned_unlocks_default = {
2260
2278
  "Percentage to set when contract expires, won't be updated after it"
2261
2279
  ],
2262
2280
  type: "u64"
2281
+ },
2282
+ {
2283
+ name: "floor_price",
2284
+ docs: [
2285
+ "Floor price boundary, if the price is below this boundary, the contract will be unlocked"
2286
+ ],
2287
+ type: "u64"
2263
2288
  }
2264
2289
  ]
2265
2290
  }
@@ -2505,7 +2530,8 @@ var SolanaStreamClient = class extends BaseStreamClient {
2505
2530
  oracleType,
2506
2531
  tokenProgramId: streamTokenProgramId,
2507
2532
  expiryTime,
2508
- expiryPercentage
2533
+ expiryPercentage,
2534
+ floorPrice
2509
2535
  } = streamParams;
2510
2536
  const { isNative, sender, computeLimit, computePrice, metadataPubKeys } = extParams;
2511
2537
  if (!sender.publicKey) {
@@ -2552,14 +2578,15 @@ var SolanaStreamClient = class extends BaseStreamClient {
2552
2578
  canTopup,
2553
2579
  oracleType: !!oracleType ? { [oracleType]: {} } : { none: {} },
2554
2580
  streamName: streamNameArray,
2555
- minPrice: minPrice instanceof BN4__default.default ? minPrice : common.getBN(minPrice, ALIGNED_PRECISION_FACTOR_POW),
2556
- maxPrice: maxPrice instanceof BN4__default.default ? maxPrice : common.getBN(maxPrice, ALIGNED_PRECISION_FACTOR_POW),
2557
- minPercentage: minPercentage instanceof BN4__default.default ? minPercentage : common.getBN(minPercentage, ALIGNED_PRECISION_FACTOR_POW),
2558
- maxPercentage: maxPercentage instanceof BN4__default.default ? maxPercentage : common.getBN(maxPercentage, ALIGNED_PRECISION_FACTOR_POW),
2581
+ minPrice: typeof minPrice === "number" ? common.getBN(minPrice, ALIGNED_PRECISION_FACTOR_POW) : minPrice,
2582
+ maxPrice: typeof maxPrice === "number" ? common.getBN(maxPrice, ALIGNED_PRECISION_FACTOR_POW) : maxPrice,
2583
+ minPercentage: typeof minPercentage === "number" ? common.getBN(minPercentage, ALIGNED_PRECISION_FACTOR_POW) : minPercentage,
2584
+ maxPercentage: typeof maxPercentage === "number" ? common.getBN(maxPercentage, ALIGNED_PRECISION_FACTOR_POW) : maxPercentage,
2559
2585
  tickSize: new BN4__default.default(tickSize || 1),
2560
2586
  skipInitial: skipInitial ?? false,
2561
2587
  expiryTime: new BN4__default.default(expiryTime ?? 0),
2562
- expiryPercentage: expiryPercentage instanceof BN4__default.default ? expiryPercentage : common.getBN(expiryPercentage ?? 0, ALIGNED_PRECISION_FACTOR_POW)
2588
+ expiryPercentage: typeof expiryPercentage === "number" ? common.getBN(expiryPercentage, ALIGNED_PRECISION_FACTOR_POW) : expiryPercentage ?? new BN4__default.default(0),
2589
+ floorPrice: typeof floorPrice === "number" ? common.getBN(floorPrice, ALIGNED_PRECISION_FACTOR_POW) : floorPrice ?? new BN4__default.default(0)
2563
2590
  }).accountsPartial({
2564
2591
  payer: sender.publicKey,
2565
2592
  sender: sender.publicKey,