@streamflow/stream 12.0.0 → 12.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.
@@ -8,7 +8,7 @@ type StreamflowAlignedUnlocks = {
8
8
  "address": "aSTRM2NKoKxNnkmLWk9sz3k74gKBk9t7bpPrTGxMszH";
9
9
  "metadata": {
10
10
  "name": "streamflowAlignedUnlocks";
11
- "version": "1.4.0";
11
+ "version": "1.7.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
  };
@@ -391,6 +391,388 @@ type StreamflowAlignedUnlocks = {
391
391
  ];
392
392
  "args": [];
393
393
  },
394
+ {
395
+ "name": "cancelV2";
396
+ "discriminator": [
397
+ 160,
398
+ 58,
399
+ 112,
400
+ 172,
401
+ 233,
402
+ 228,
403
+ 38,
404
+ 140
405
+ ];
406
+ "accounts": [
407
+ {
408
+ "name": "caller";
409
+ "writable": true;
410
+ "signer": true;
411
+ },
412
+ {
413
+ "name": "sender";
414
+ "writable": true;
415
+ },
416
+ {
417
+ "name": "senderTokens";
418
+ "docs": [
419
+ "Associated token account address of `sender`."
420
+ ];
421
+ "writable": true;
422
+ "pda": {
423
+ "seeds": [
424
+ {
425
+ "kind": "account";
426
+ "path": "sender";
427
+ },
428
+ {
429
+ "kind": "account";
430
+ "path": "tokenProgram";
431
+ },
432
+ {
433
+ "kind": "account";
434
+ "path": "mint";
435
+ }
436
+ ];
437
+ "program": {
438
+ "kind": "const";
439
+ "value": [
440
+ 140,
441
+ 151,
442
+ 37,
443
+ 143,
444
+ 78,
445
+ 36,
446
+ 137,
447
+ 241,
448
+ 187,
449
+ 61,
450
+ 16,
451
+ 41,
452
+ 20,
453
+ 142,
454
+ 13,
455
+ 131,
456
+ 11,
457
+ 90,
458
+ 19,
459
+ 153,
460
+ 218,
461
+ 255,
462
+ 16,
463
+ 132,
464
+ 4,
465
+ 142,
466
+ 123,
467
+ 216,
468
+ 219,
469
+ 233,
470
+ 248,
471
+ 89
472
+ ];
473
+ };
474
+ };
475
+ },
476
+ {
477
+ "name": "recipient";
478
+ "writable": true;
479
+ },
480
+ {
481
+ "name": "recipientTokens";
482
+ "docs": [
483
+ "CHECK; Associated token account address of `recipient`."
484
+ ];
485
+ "writable": true;
486
+ "pda": {
487
+ "seeds": [
488
+ {
489
+ "kind": "account";
490
+ "path": "recipient";
491
+ },
492
+ {
493
+ "kind": "account";
494
+ "path": "tokenProgram";
495
+ },
496
+ {
497
+ "kind": "account";
498
+ "path": "mint";
499
+ }
500
+ ];
501
+ "program": {
502
+ "kind": "const";
503
+ "value": [
504
+ 140,
505
+ 151,
506
+ 37,
507
+ 143,
508
+ 78,
509
+ 36,
510
+ 137,
511
+ 241,
512
+ 187,
513
+ 61,
514
+ 16,
515
+ 41,
516
+ 20,
517
+ 142,
518
+ 13,
519
+ 131,
520
+ 11,
521
+ 90,
522
+ 19,
523
+ 153,
524
+ 218,
525
+ 255,
526
+ 16,
527
+ 132,
528
+ 4,
529
+ 142,
530
+ 123,
531
+ 216,
532
+ 219,
533
+ 233,
534
+ 248,
535
+ 89
536
+ ];
537
+ };
538
+ };
539
+ },
540
+ {
541
+ "name": "proxyMetadata";
542
+ "docs": [
543
+ "Proxy Contract"
544
+ ];
545
+ "writable": true;
546
+ "pda": {
547
+ "seeds": [
548
+ {
549
+ "kind": "const";
550
+ "value": [
551
+ 99,
552
+ 111,
553
+ 110,
554
+ 116,
555
+ 114,
556
+ 97,
557
+ 99,
558
+ 116
559
+ ];
560
+ },
561
+ {
562
+ "kind": "account";
563
+ "path": "streamMetadata";
564
+ }
565
+ ];
566
+ };
567
+ },
568
+ {
569
+ "name": "proxyTokens";
570
+ "writable": true;
571
+ "pda": {
572
+ "seeds": [
573
+ {
574
+ "kind": "account";
575
+ "path": "proxyMetadata";
576
+ },
577
+ {
578
+ "kind": "account";
579
+ "path": "tokenProgram";
580
+ },
581
+ {
582
+ "kind": "account";
583
+ "path": "mint";
584
+ }
585
+ ];
586
+ "program": {
587
+ "kind": "const";
588
+ "value": [
589
+ 140,
590
+ 151,
591
+ 37,
592
+ 143,
593
+ 78,
594
+ 36,
595
+ 137,
596
+ 241,
597
+ 187,
598
+ 61,
599
+ 16,
600
+ 41,
601
+ 20,
602
+ 142,
603
+ 13,
604
+ 131,
605
+ 11,
606
+ 90,
607
+ 19,
608
+ 153,
609
+ 218,
610
+ 255,
611
+ 16,
612
+ 132,
613
+ 4,
614
+ 142,
615
+ 123,
616
+ 216,
617
+ 219,
618
+ 233,
619
+ 248,
620
+ 89
621
+ ];
622
+ };
623
+ };
624
+ },
625
+ {
626
+ "name": "streamMetadata";
627
+ "writable": true;
628
+ },
629
+ {
630
+ "name": "escrowTokens";
631
+ "writable": true;
632
+ },
633
+ {
634
+ "name": "streamflowTreasury";
635
+ "writable": true;
636
+ },
637
+ {
638
+ "name": "streamflowTreasuryTokens";
639
+ "writable": true;
640
+ "pda": {
641
+ "seeds": [
642
+ {
643
+ "kind": "account";
644
+ "path": "streamflowTreasury";
645
+ },
646
+ {
647
+ "kind": "account";
648
+ "path": "tokenProgram";
649
+ },
650
+ {
651
+ "kind": "account";
652
+ "path": "mint";
653
+ }
654
+ ];
655
+ "program": {
656
+ "kind": "const";
657
+ "value": [
658
+ 140,
659
+ 151,
660
+ 37,
661
+ 143,
662
+ 78,
663
+ 36,
664
+ 137,
665
+ 241,
666
+ 187,
667
+ 61,
668
+ 16,
669
+ 41,
670
+ 20,
671
+ 142,
672
+ 13,
673
+ 131,
674
+ 11,
675
+ 90,
676
+ 19,
677
+ 153,
678
+ 218,
679
+ 255,
680
+ 16,
681
+ 132,
682
+ 4,
683
+ 142,
684
+ 123,
685
+ 216,
686
+ 219,
687
+ 233,
688
+ 248,
689
+ 89
690
+ ];
691
+ };
692
+ };
693
+ },
694
+ {
695
+ "name": "partner";
696
+ "writable": true;
697
+ },
698
+ {
699
+ "name": "partnerTokens";
700
+ "writable": true;
701
+ "pda": {
702
+ "seeds": [
703
+ {
704
+ "kind": "account";
705
+ "path": "partner";
706
+ },
707
+ {
708
+ "kind": "account";
709
+ "path": "tokenProgram";
710
+ },
711
+ {
712
+ "kind": "account";
713
+ "path": "mint";
714
+ }
715
+ ];
716
+ "program": {
717
+ "kind": "const";
718
+ "value": [
719
+ 140,
720
+ 151,
721
+ 37,
722
+ 143,
723
+ 78,
724
+ 36,
725
+ 137,
726
+ 241,
727
+ 187,
728
+ 61,
729
+ 16,
730
+ 41,
731
+ 20,
732
+ 142,
733
+ 13,
734
+ 131,
735
+ 11,
736
+ 90,
737
+ 19,
738
+ 153,
739
+ 218,
740
+ 255,
741
+ 16,
742
+ 132,
743
+ 4,
744
+ 142,
745
+ 123,
746
+ 216,
747
+ 219,
748
+ 233,
749
+ 248,
750
+ 89
751
+ ];
752
+ };
753
+ };
754
+ },
755
+ {
756
+ "name": "mint";
757
+ "docs": [
758
+ "The SPL token mint account."
759
+ ];
760
+ "writable": true;
761
+ },
762
+ {
763
+ "name": "streamflowProgram";
764
+ "address": "strmRqUCoQUgGUan5YhzUZa6KqdzwX5L6FpUxfmKg5m";
765
+ },
766
+ {
767
+ "name": "tokenProgram";
768
+ "docs": [
769
+ "The SPL program needed in case an associated account",
770
+ "for the new recipient is being created."
771
+ ];
772
+ }
773
+ ];
774
+ "args": [];
775
+ },
394
776
  {
395
777
  "name": "changeOracle";
396
778
  "discriminator": [
@@ -679,6 +1061,7 @@ type StreamflowAlignedUnlocks = {
679
1061
  },
680
1062
  {
681
1063
  "name": "feeOracle";
1064
+ "address": "B743wFVk2pCYhV91cn287e1xY7f1vt4gdY48hhNiuQmT";
682
1065
  },
683
1066
  {
684
1067
  "name": "priceOracle";
@@ -1104,6 +1487,21 @@ type StreamflowAlignedUnlocks = {
1104
1487
  "code": 6016;
1105
1488
  "name": "invalidFloorPrice";
1106
1489
  "msg": "Provided floor price is invalid, should be less than minimum price";
1490
+ },
1491
+ {
1492
+ "code": 6017;
1493
+ "name": "amountNotUpdated";
1494
+ "msg": "Update won't lead to any changes in unlock schedule";
1495
+ },
1496
+ {
1497
+ "code": 6018;
1498
+ "name": "oldMetadataNotDrained";
1499
+ "msg": "Old metadata account must be drained";
1500
+ },
1501
+ {
1502
+ "code": 6019;
1503
+ "name": "newMetadataMissing";
1504
+ "msg": "New metadata account does not exist";
1107
1505
  }
1108
1506
  ];
1109
1507
  "types": [
@@ -73,6 +73,8 @@ interface IUpdateData extends IInteractData {
73
73
  cancelableBySender?: boolean;
74
74
  }
75
75
  type ICancelData = IInteractData;
76
+ type IRequestCancelData = IInteractData;
77
+ type IWithdrawCancelRequestData = IInteractData;
76
78
  interface ITransferData extends IInteractData {
77
79
  newRecipient: string;
78
80
  }
@@ -179,6 +181,8 @@ interface LinearStream {
179
181
  oldMetadata: PublicKey;
180
182
  payer: string;
181
183
  bump: number;
184
+ feePartner: string;
185
+ cancelRequestTime: number;
182
186
  type: StreamType;
183
187
  unlocked(currentTimestamp: number): BN;
184
188
  remaining(decimals: number): number;
@@ -418,6 +422,8 @@ declare class Contract implements LinearStream {
418
422
  oldMetadata: PublicKey;
419
423
  payer: string;
420
424
  bump: number;
425
+ feePartner: string;
426
+ cancelRequestTime: number;
421
427
  type: StreamType;
422
428
  isAligned: boolean;
423
429
  constructor(stream: DecodedStream);
@@ -491,6 +497,8 @@ interface DecodedStream {
491
497
  oldMetadata: PublicKey;
492
498
  payer: PublicKey;
493
499
  bump: number;
500
+ feePartner: PublicKey;
501
+ cancelRequestTime: BN;
494
502
  }
495
503
  interface MetadataRecipientHashMap {
496
504
  [metadataPubKey: string]: IRecipient;
@@ -730,6 +738,34 @@ declare class SolanaStreamClient {
730
738
  * @returns Transaction instructions
731
739
  */
732
740
  prepareCancelLinearStream({ id }: ICancelData, { invoker, checkTokenAccounts, computePrice, computeLimit }: IPrepareStreamExt): Promise<TransactionInstruction[]>;
741
+ /**
742
+ * Requests cancellation of a stream by the fee partner authority.
743
+ * @param {IRequestCancelData} data - Request cancel parameters including stream ID
744
+ * @param {IInteractStreamExt} extParams - Transaction configuration including invoker wallet and compute settings
745
+ * @returns Transaction result
746
+ */
747
+ requestCancel(data: IRequestCancelData, extParams: IInteractStreamExt): Promise<ITransactionResult>;
748
+ /**
749
+ * Creates Transaction Instructions for request_cancel
750
+ * @param {IRequestCancelData} data - Request cancel parameters including stream ID
751
+ * @param {IPrepareStreamExt} extParams - Transaction configuration including invoker wallet and compute settings
752
+ * @returns Transaction instructions
753
+ */
754
+ prepareRequestCancelInstructions({ id }: IRequestCancelData, { invoker, computePrice, computeLimit }: IPrepareStreamExt): Promise<TransactionInstruction[]>;
755
+ /**
756
+ * Withdraws a previously submitted cancel request.
757
+ * @param {IWithdrawCancelRequestData} data - Withdraw cancel request parameters including stream ID
758
+ * @param {IInteractStreamExt} extParams - Transaction configuration including invoker wallet and compute settings
759
+ * @returns Transaction result
760
+ */
761
+ withdrawCancelRequest(data: IWithdrawCancelRequestData, extParams: IInteractStreamExt): Promise<ITransactionResult>;
762
+ /**
763
+ * Creates Transaction Instructions for withdraw_cancel_request
764
+ * @param {IWithdrawCancelRequestData} data - Withdraw cancel request parameters including stream ID
765
+ * @param {IPrepareStreamExt} extParams - Transaction configuration including invoker wallet and compute settings
766
+ * @returns Transaction instructions
767
+ */
768
+ prepareWithdrawCancelRequestInstructions({ id }: IWithdrawCancelRequestData, { invoker, computePrice, computeLimit }: IPrepareStreamExt): Promise<TransactionInstruction[]>;
733
769
  /**
734
770
  * Attempts changing the stream/vesting contract's recipient (effectively transferring the stream/vesting contract).
735
771
  * Potential associated token account rent fee (to make it rent-exempt) is paid by the transaction initiator.
@@ -1089,6 +1125,16 @@ interface TransferAccounts {
1089
1125
  systemProgram: PublicKey;
1090
1126
  }
1091
1127
  declare const transferStreamInstruction: (programId: PublicKey, { authority, newRecipient, newRecipientTokens, metadata, mint, rent, tokenProgram, associatedTokenProgram, systemProgram, }: TransferAccounts) => Promise<TransactionInstruction>;
1128
+ interface RequestCancelAccounts {
1129
+ authority: PublicKey;
1130
+ metadata: PublicKey;
1131
+ }
1132
+ declare const requestCancelStreamInstruction: (programId: PublicKey, { authority, metadata }: RequestCancelAccounts) => Promise<TransactionInstruction>;
1133
+ interface WithdrawCancelRequestAccounts {
1134
+ authority: PublicKey;
1135
+ metadata: PublicKey;
1136
+ }
1137
+ declare const withdrawCancelRequestInstruction: (programId: PublicKey, { authority, metadata }: WithdrawCancelRequestAccounts) => Promise<TransactionInstruction>;
1092
1138
  interface TopupAccounts {
1093
1139
  sender: PublicKey;
1094
1140
  senderTokens: PublicKey;
@@ -1357,6 +1403,8 @@ interface ContractSchema {
1357
1403
  nonce: number | null;
1358
1404
  payer: string | null;
1359
1405
  bump: number | null;
1406
+ feePartner: string | null;
1407
+ cancelRequestDt: string | null;
1360
1408
  dynamicContract: DynamicContractSchema | null;
1361
1409
  }
1362
1410
  /**
@@ -1457,4 +1505,4 @@ declare const createClient: (options?: ApiClientOptions) => ApiClient;
1457
1505
 
1458
1506
  declare const transformContract: (schema: ContractSchema) => Promise<Stream>;
1459
1507
 
1460
- export { AIRDROP_AMOUNT, AIRDROP_TEST_TOKEN, ALIGNED_COMPUTE_LIMIT, ALIGNED_PRECISION_FACTOR_POW, ALIGNED_UNLOCKS_PROGRAM_ID, type Account, AlignedContract, AlignedProxyErrorCode, type AlignedStream, type AlignedStreamData, type AlignedUnlocksContract, type ApiClient, type ApiClientOptions, type BatchItem, type BatchItemError, type BatchItemResult, type BatchItemSuccess, CONTRACT_DISCRIMINATOR, CONTRACT_SEED, CREATE_PARAMS_PADDING, type Chain, type ChangeOracleParams, type ClientCreationOptions, Contract, ContractErrorCode, type ContractSchema, type ContractType, type CreateParams, type CreateTestOracleParams, DEFAULT_AUTO_CLAIM_FEE_SOL, DEFAULT_CREATION_FEE_SOL, DEFAULT_STREAMFLOW_FEE, type DecodedStream, type DynamicContractSchema, ESCROW_SEED, FEES_METADATA_SEED, FEE_ORACLE_PUBLIC_KEY, type GetContractsOptions, type IAlignedStreamConfig, type IBaseStreamConfig, type ICancelData, type ICreateAlignedStreamData, type ICreateExt, type ICreateLinearStreamData, type ICreateMultiError, type ICreateMultipleAlignedStreamData, type ICreateMultipleLinearStreamData, type ICreateMultipleStreamData, type ICreateResult, type ICreateStreamData, type ICreateStreamExt, type ICreateStreamInstructions, type IFees, type IGetAllData, type IGetFeesData, type IGetOneData, type IInteractData, type IInteractStreamExt, type IMultiTransactionResult, type IPrepareCreateStreamExt, type IPrepareStreamExt, type IPrepareTopUpstreamExt, type IRecipient, type ISearchStreams, type ITopUpData, type ITopUpStreamExt, type ITransactionExtWithInstructions, type ITransactionResult, type ITransferData, type IUpdateData, type IWithdrawData, type InstructionGenerator, type LinearStream, MAX_SAFE_UNIX_TIME_VALUE, METADATA_SEED, type MetadataRecipientHashMap, ORIGINAL_CONTRACT_SENDER_OFFSET, type OracleType, type OracleTypeName, PARTNERS_SCHEMA, PARTNER_ORACLE_PROGRAM_ID, PARTNER_SCHEMA, PROGRAM_ID, type PriceOracleType, REPOPULATED_METADATA_SEED, SOLANA_ERROR_MAP, SOLANA_ERROR_MATCH_REGEX, STREAMFLOW_TREASURY_PUBLIC_KEY, STREAM_STRUCT_OFFSETS, STREAM_STRUCT_OFFSET_CLOSED, STREAM_STRUCT_OFFSET_MINT, STREAM_STRUCT_OFFSET_OLD_METADATA_KEY, STREAM_STRUCT_OFFSET_RECIPIENT, STREAM_STRUCT_OFFSET_SENDER, SolanaStreamClient, type Stream, type StreamClientOptions, StreamDirection, StreamType, TEST_ORACLE_DISCRIMINATOR, TEST_ORACLE_SEED, TX_FINALITY_CONFIRMED, type TabulariumContract, type TestOracle, type TransactionSchedulingOptions, type UpdateTestOracleParams, WITHDRAWOR, WITHDRAWOR_PUBLIC_KEY, WITHDRAW_AVAILABLE_AMOUNT, buildStreamType, calculateTotalAmountToDeposit, calculateUnlockedAmount, cancelStreamInstruction, createClient, createStreamInstruction, createStreamV2Instruction, createUncheckedStreamInstruction, createUncheckedStreamV2Instruction, decodeEndTime, decodeStream, deriveContractPDA, deriveEscrowPDA, deriveRepopulatedMetadataPDA, deriveStreamMetadataPDA, deriveTestOraclePDA, extractSolanaErrorCode, getMetadataKey, handleContractError, isAligned, isCliffCloseToDepositedAmount, isCreateAlignedStreamData, isDynamicLock, isTokenLock, isVesting, sendAndConfirmStreamRawTransaction, signAllTransactionWithRecipients, _default as timelockIDL, topupStreamInstruction, transferStreamInstruction, transformContract, updateStreamInstruction, withdrawStreamInstruction };
1508
+ export { AIRDROP_AMOUNT, AIRDROP_TEST_TOKEN, ALIGNED_COMPUTE_LIMIT, ALIGNED_PRECISION_FACTOR_POW, ALIGNED_UNLOCKS_PROGRAM_ID, type Account, AlignedContract, AlignedProxyErrorCode, type AlignedStream, type AlignedStreamData, type AlignedUnlocksContract, type ApiClient, type ApiClientOptions, type BatchItem, type BatchItemError, type BatchItemResult, type BatchItemSuccess, CONTRACT_DISCRIMINATOR, CONTRACT_SEED, CREATE_PARAMS_PADDING, type Chain, type ChangeOracleParams, type ClientCreationOptions, Contract, ContractErrorCode, type ContractSchema, type ContractType, type CreateParams, type CreateTestOracleParams, DEFAULT_AUTO_CLAIM_FEE_SOL, DEFAULT_CREATION_FEE_SOL, DEFAULT_STREAMFLOW_FEE, type DecodedStream, type DynamicContractSchema, ESCROW_SEED, FEES_METADATA_SEED, FEE_ORACLE_PUBLIC_KEY, type GetContractsOptions, type IAlignedStreamConfig, type IBaseStreamConfig, type ICancelData, type ICreateAlignedStreamData, type ICreateExt, type ICreateLinearStreamData, type ICreateMultiError, type ICreateMultipleAlignedStreamData, type ICreateMultipleLinearStreamData, type ICreateMultipleStreamData, type ICreateResult, type ICreateStreamData, type ICreateStreamExt, type ICreateStreamInstructions, type IFees, type IGetAllData, type IGetFeesData, type IGetOneData, type IInteractData, type IInteractStreamExt, type IMultiTransactionResult, type IPrepareCreateStreamExt, type IPrepareStreamExt, type IPrepareTopUpstreamExt, type IRecipient, type IRequestCancelData, type ISearchStreams, type ITopUpData, type ITopUpStreamExt, type ITransactionExtWithInstructions, type ITransactionResult, type ITransferData, type IUpdateData, type IWithdrawCancelRequestData, type IWithdrawData, type InstructionGenerator, type LinearStream, MAX_SAFE_UNIX_TIME_VALUE, METADATA_SEED, type MetadataRecipientHashMap, ORIGINAL_CONTRACT_SENDER_OFFSET, type OracleType, type OracleTypeName, PARTNERS_SCHEMA, PARTNER_ORACLE_PROGRAM_ID, PARTNER_SCHEMA, PROGRAM_ID, type PriceOracleType, REPOPULATED_METADATA_SEED, SOLANA_ERROR_MAP, SOLANA_ERROR_MATCH_REGEX, STREAMFLOW_TREASURY_PUBLIC_KEY, STREAM_STRUCT_OFFSETS, STREAM_STRUCT_OFFSET_CLOSED, STREAM_STRUCT_OFFSET_MINT, STREAM_STRUCT_OFFSET_OLD_METADATA_KEY, STREAM_STRUCT_OFFSET_RECIPIENT, STREAM_STRUCT_OFFSET_SENDER, SolanaStreamClient, type Stream, type StreamClientOptions, StreamDirection, StreamType, TEST_ORACLE_DISCRIMINATOR, TEST_ORACLE_SEED, TX_FINALITY_CONFIRMED, type TabulariumContract, type TestOracle, type TransactionSchedulingOptions, type UpdateTestOracleParams, WITHDRAWOR, WITHDRAWOR_PUBLIC_KEY, WITHDRAW_AVAILABLE_AMOUNT, buildStreamType, calculateTotalAmountToDeposit, calculateUnlockedAmount, cancelStreamInstruction, createClient, createStreamInstruction, createStreamV2Instruction, createUncheckedStreamInstruction, createUncheckedStreamV2Instruction, decodeEndTime, decodeStream, deriveContractPDA, deriveEscrowPDA, deriveRepopulatedMetadataPDA, deriveStreamMetadataPDA, deriveTestOraclePDA, extractSolanaErrorCode, getMetadataKey, handleContractError, isAligned, isCliffCloseToDepositedAmount, isCreateAlignedStreamData, isDynamicLock, isTokenLock, isVesting, requestCancelStreamInstruction, sendAndConfirmStreamRawTransaction, signAllTransactionWithRecipients, _default as timelockIDL, topupStreamInstruction, transferStreamInstruction, transformContract, updateStreamInstruction, withdrawCancelRequestInstruction, withdrawStreamInstruction };