@streamflow/stream 6.3.8 → 7.0.0-alpha.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.
Files changed (121) hide show
  1. package/README.md +33 -1
  2. package/dist/{__tests__ → cjs/__tests__}/aptos/streamClient.spec.js +22 -21
  3. package/dist/cjs/__tests__/common/GenericStreamClient.spec.js +45 -0
  4. package/dist/{aptos → cjs/aptos}/StreamClient.js +20 -20
  5. package/dist/cjs/aptos/constants.js +28 -0
  6. package/dist/{aptos → cjs/aptos}/index.js +3 -3
  7. package/dist/{aptos → cjs/aptos}/types.js +12 -11
  8. package/dist/{aptos → cjs/aptos}/utils.js +2 -2
  9. package/dist/{common → cjs/common}/GenericStreamClient.js +19 -19
  10. package/dist/{common → cjs/common}/contractUtils.js +4 -4
  11. package/dist/{common → cjs/common}/utils.js +4 -6
  12. package/dist/{evm → cjs/evm}/StreamClient.js +29 -29
  13. package/dist/cjs/evm/constants.js +39 -0
  14. package/dist/{evm → cjs/evm}/index.js +8 -8
  15. package/dist/{evm → cjs/evm}/types.js +5 -5
  16. package/dist/{evm → cjs/evm}/utils.js +2 -2
  17. package/dist/{solana → cjs/solana}/StreamClient.js +73 -66
  18. package/dist/cjs/solana/constants.js +60 -0
  19. package/dist/cjs/solana/index.js +39 -0
  20. package/dist/{solana → cjs/solana}/instructions.js +20 -12
  21. package/dist/{solana → cjs/solana}/layout.js +8 -2
  22. package/dist/{solana → cjs/solana}/types.js +5 -5
  23. package/dist/{solana → cjs/solana}/utils.js +6 -6
  24. package/dist/{sui → cjs/sui}/StreamClient.js +25 -25
  25. package/dist/cjs/sui/constants.js +43 -0
  26. package/dist/{sui → cjs/sui}/index.js +5 -5
  27. package/dist/{sui → cjs/sui}/types.js +5 -5
  28. package/dist/{sui → cjs/sui}/utils.js +3 -3
  29. package/dist/esm/__tests__/aptos/streamClient.spec.js +106 -0
  30. package/dist/esm/__tests__/common/GenericStreamClient.spec.js +40 -0
  31. package/dist/{aptos → esm/aptos}/StreamClient.d.ts +3 -3
  32. package/dist/esm/aptos/StreamClient.js +226 -0
  33. package/dist/{aptos → esm/aptos}/constants.d.ts +1 -1
  34. package/dist/esm/aptos/constants.js +24 -0
  35. package/dist/{aptos → esm/aptos}/index.d.ts +1 -1
  36. package/dist/{sui/index.d.ts → esm/aptos/index.js} +1 -1
  37. package/dist/{aptos → esm/aptos}/types.d.ts +1 -1
  38. package/dist/esm/aptos/types.js +105 -0
  39. package/dist/esm/aptos/utils.js +30 -0
  40. package/dist/esm/aptos/wallet.js +33 -0
  41. package/dist/{common → esm/common}/BaseStreamClient.d.ts +1 -1
  42. package/dist/esm/common/BaseStreamClient.js +19 -0
  43. package/dist/{common → esm/common}/GenericStreamClient.d.ts +2 -2
  44. package/dist/esm/common/GenericStreamClient.js +101 -0
  45. package/dist/esm/common/constants.js +3 -0
  46. package/dist/{common → esm/common}/contractUtils.d.ts +1 -1
  47. package/dist/esm/common/contractUtils.js +42 -0
  48. package/dist/esm/common/types.js +106 -0
  49. package/dist/{common → esm/common}/utils.d.ts +0 -1
  50. package/dist/esm/common/utils.js +59 -0
  51. package/dist/{evm → esm/evm}/StreamClient.d.ts +2 -2
  52. package/dist/esm/evm/StreamClient.js +237 -0
  53. package/dist/esm/evm/abi.js +1255 -0
  54. package/dist/{evm → esm/evm}/constants.d.ts +1 -1
  55. package/dist/esm/evm/constants.js +35 -0
  56. package/dist/esm/evm/ercAbi.js +222 -0
  57. package/dist/esm/evm/index.d.ts +5 -0
  58. package/dist/esm/evm/index.js +5 -0
  59. package/dist/{evm → esm/evm}/types.d.ts +1 -1
  60. package/dist/esm/evm/types.js +102 -0
  61. package/dist/esm/evm/utils.js +8 -0
  62. package/dist/esm/index.js +9 -0
  63. package/dist/{solana → esm/solana}/StreamClient.d.ts +6 -6
  64. package/dist/esm/solana/StreamClient.js +695 -0
  65. package/dist/{solana → esm/solana}/constants.d.ts +2 -0
  66. package/dist/esm/solana/constants.js +56 -0
  67. package/dist/esm/solana/index.d.ts +6 -0
  68. package/dist/esm/solana/index.js +6 -0
  69. package/dist/esm/solana/instructionTypes.js +1 -0
  70. package/dist/{solana → esm/solana}/instructions.d.ts +5 -1
  71. package/dist/esm/solana/instructions.js +256 -0
  72. package/dist/{solana → esm/solana}/layout.d.ts +2 -1
  73. package/dist/esm/solana/layout.js +155 -0
  74. package/dist/esm/solana/timelockIDL.js +420 -0
  75. package/dist/{solana → esm/solana}/types.d.ts +2 -1
  76. package/dist/esm/solana/types.js +101 -0
  77. package/dist/{solana → esm/solana}/utils.d.ts +2 -1
  78. package/dist/esm/solana/utils.js +117 -0
  79. package/dist/{sui → esm/sui}/StreamClient.d.ts +3 -3
  80. package/dist/esm/sui/StreamClient.js +403 -0
  81. package/dist/{sui → esm/sui}/constants.d.ts +1 -1
  82. package/dist/esm/sui/constants.js +39 -0
  83. package/dist/esm/sui/index.d.ts +4 -0
  84. package/dist/esm/sui/index.js +4 -0
  85. package/dist/{sui → esm/sui}/types.d.ts +1 -1
  86. package/dist/esm/sui/types.js +104 -0
  87. package/dist/{sui → esm/sui}/utils.d.ts +1 -1
  88. package/dist/esm/sui/utils.js +23 -0
  89. package/dist/{sui → esm/sui}/wallet.d.ts +1 -1
  90. package/dist/esm/sui/wallet.js +38 -0
  91. package/package.json +36 -33
  92. package/dist/__tests__/common/GenericStreamClient.spec.js +0 -44
  93. package/dist/aptos/constants.js +0 -28
  94. package/dist/evm/constants.js +0 -39
  95. package/dist/evm/index.d.ts +0 -5
  96. package/dist/solana/constants.js +0 -59
  97. package/dist/solana/index.d.ts +0 -7
  98. package/dist/solana/index.js +0 -43
  99. package/dist/sui/constants.js +0 -43
  100. /package/dist/{aptos → cjs/aptos}/wallet.js +0 -0
  101. /package/dist/{common → cjs/common}/BaseStreamClient.js +0 -0
  102. /package/dist/{common → cjs/common}/constants.js +0 -0
  103. /package/dist/{common → cjs/common}/types.js +0 -0
  104. /package/dist/{evm → cjs/evm}/abi.js +0 -0
  105. /package/dist/{evm → cjs/evm}/ercAbi.js +0 -0
  106. /package/dist/{index.js → cjs/index.js} +0 -0
  107. /package/dist/{solana → cjs/solana}/instructionTypes.js +0 -0
  108. /package/dist/{solana → cjs/solana}/timelockIDL.js +0 -0
  109. /package/dist/{sui → cjs/sui}/wallet.js +0 -0
  110. /package/dist/{__tests__ → esm/__tests__}/aptos/streamClient.spec.d.ts +0 -0
  111. /package/dist/{__tests__ → esm/__tests__}/common/GenericStreamClient.spec.d.ts +0 -0
  112. /package/dist/{aptos → esm/aptos}/utils.d.ts +0 -0
  113. /package/dist/{aptos → esm/aptos}/wallet.d.ts +0 -0
  114. /package/dist/{common → esm/common}/constants.d.ts +0 -0
  115. /package/dist/{common → esm/common}/types.d.ts +0 -0
  116. /package/dist/{evm → esm/evm}/abi.d.ts +0 -0
  117. /package/dist/{evm → esm/evm}/ercAbi.d.ts +0 -0
  118. /package/dist/{evm → esm/evm}/utils.d.ts +0 -0
  119. /package/dist/{index.d.ts → esm/index.d.ts} +0 -0
  120. /package/dist/{solana → esm/solana}/instructionTypes.d.ts +0 -0
  121. /package/dist/{solana → esm/solana}/timelockIDL.d.ts +0 -0
@@ -1,4 +1,4 @@
1
- import { ContractErrorCode, ICluster } from "../common/types";
1
+ import { ContractErrorCode, ICluster } from "../common/types.js";
2
2
  export declare const ETHEREUM_PROGRAM_IDS: Record<ICluster, string>;
3
3
  export declare const BNB_PROGRAM_IDS: Record<ICluster, string>;
4
4
  export declare const POLYGON_PROGRAM_IDS: Record<ICluster, string>;
@@ -0,0 +1,35 @@
1
+ import { ContractErrorCode, ICluster } from "../common/types.js";
2
+ export const ETHEREUM_PROGRAM_IDS = {
3
+ [ICluster.Mainnet]: "0x94d4646Bd307Bf91CB1893BC64d976BF9E60D9B2",
4
+ [ICluster.Devnet]: "0x5Db7a43D20De64E3a3BC765334a477026FD13E7d",
5
+ [ICluster.Testnet]: "0x5Db7a43D20De64E3a3BC765334a477026FD13E7d",
6
+ [ICluster.Local]: "0x5Db7a43D20De64E3a3BC765334a477026FD13E7d",
7
+ };
8
+ export const BNB_PROGRAM_IDS = {
9
+ [ICluster.Mainnet]: "0x94d4646Bd307Bf91CB1893BC64d976BF9E60D9B2",
10
+ [ICluster.Devnet]: "0x5Db7a43D20De64E3a3BC765334a477026FD13E7d",
11
+ [ICluster.Testnet]: "0x5Db7a43D20De64E3a3BC765334a477026FD13E7d",
12
+ [ICluster.Local]: "0x5Db7a43D20De64E3a3BC765334a477026FD13E7d",
13
+ };
14
+ export const POLYGON_PROGRAM_IDS = {
15
+ [ICluster.Mainnet]: "0x94d4646Bd307Bf91CB1893BC64d976BF9E60D9B2",
16
+ [ICluster.Devnet]: "0x5Db7a43D20De64E3a3BC765334a477026FD13E7d",
17
+ [ICluster.Testnet]: "0x5Db7a43D20De64E3a3BC765334a477026FD13E7d",
18
+ [ICluster.Local]: "0x5Db7a43D20De64E3a3BC765334a477026FD13E7d",
19
+ };
20
+ export const EVM_ERROR_MATCH_REGEX = /execution reverted: ([A-Z_]+)/;
21
+ export const EVM_ERROR_MAP = {
22
+ ECONTRACT_NOT_INIT: ContractErrorCode.ECONTRACT_NOT_INIT,
23
+ EBAD_AMOUNT: ContractErrorCode.EBAD_AMOUNT,
24
+ ENO_PERMISSIONS: ContractErrorCode.ENO_PERMISSIONS,
25
+ EBADINPUT: ContractErrorCode.EBADINPUT,
26
+ ECLOSED: ContractErrorCode.ECLOSED,
27
+ EBAD_INPUT_AMOUNT_PER_PERIOD: ContractErrorCode.EBAD_INPUT_AMOUNT_PER_PERIOD,
28
+ EBAD_INPUT_PAUSABLE: ContractErrorCode.EBAD_INPUT_PAUSABLE,
29
+ EBAD_INPUT_UPDATE_RATE: ContractErrorCode.EBAD_INPUT_UPDATE_RATE,
30
+ EBAD_INPUT_CLIFF_AMOUNT: ContractErrorCode.EBAD_INPUT_CLIFF_AMOUNT,
31
+ EBAD_INPUT_PERIOD: ContractErrorCode.EBAD_INPUT_PERIOD,
32
+ EBAD_INPUT_START: ContractErrorCode.EBAD_INPUT_START,
33
+ EBAD_INSUFFICIENT_TOKEN_ALLOWANCE: ContractErrorCode.EBAD_INSUFFICIENT_TOKEN_ALLOWANCE,
34
+ EBAD_INSUFFICIENT_WITHDRAWAL_FEES: ContractErrorCode.EBAD_INSUFFICIENT_WITHDRAWAL_FEES,
35
+ };
@@ -0,0 +1,222 @@
1
+ export default [
2
+ {
3
+ constant: true,
4
+ inputs: [],
5
+ name: "name",
6
+ outputs: [
7
+ {
8
+ name: "",
9
+ type: "string",
10
+ },
11
+ ],
12
+ payable: false,
13
+ stateMutability: "view",
14
+ type: "function",
15
+ },
16
+ {
17
+ constant: false,
18
+ inputs: [
19
+ {
20
+ name: "_spender",
21
+ type: "address",
22
+ },
23
+ {
24
+ name: "_value",
25
+ type: "uint256",
26
+ },
27
+ ],
28
+ name: "approve",
29
+ outputs: [
30
+ {
31
+ name: "",
32
+ type: "bool",
33
+ },
34
+ ],
35
+ payable: false,
36
+ stateMutability: "nonpayable",
37
+ type: "function",
38
+ },
39
+ {
40
+ constant: true,
41
+ inputs: [],
42
+ name: "totalSupply",
43
+ outputs: [
44
+ {
45
+ name: "",
46
+ type: "uint256",
47
+ },
48
+ ],
49
+ payable: false,
50
+ stateMutability: "view",
51
+ type: "function",
52
+ },
53
+ {
54
+ constant: false,
55
+ inputs: [
56
+ {
57
+ name: "_from",
58
+ type: "address",
59
+ },
60
+ {
61
+ name: "_to",
62
+ type: "address",
63
+ },
64
+ {
65
+ name: "_value",
66
+ type: "uint256",
67
+ },
68
+ ],
69
+ name: "transferFrom",
70
+ outputs: [
71
+ {
72
+ name: "",
73
+ type: "bool",
74
+ },
75
+ ],
76
+ payable: false,
77
+ stateMutability: "nonpayable",
78
+ type: "function",
79
+ },
80
+ {
81
+ constant: true,
82
+ inputs: [],
83
+ name: "decimals",
84
+ outputs: [
85
+ {
86
+ name: "",
87
+ type: "uint8",
88
+ },
89
+ ],
90
+ payable: false,
91
+ stateMutability: "view",
92
+ type: "function",
93
+ },
94
+ {
95
+ constant: true,
96
+ inputs: [
97
+ {
98
+ name: "_owner",
99
+ type: "address",
100
+ },
101
+ ],
102
+ name: "balanceOf",
103
+ outputs: [
104
+ {
105
+ name: "balance",
106
+ type: "uint256",
107
+ },
108
+ ],
109
+ payable: false,
110
+ stateMutability: "view",
111
+ type: "function",
112
+ },
113
+ {
114
+ constant: true,
115
+ inputs: [],
116
+ name: "symbol",
117
+ outputs: [
118
+ {
119
+ name: "",
120
+ type: "string",
121
+ },
122
+ ],
123
+ payable: false,
124
+ stateMutability: "view",
125
+ type: "function",
126
+ },
127
+ {
128
+ constant: false,
129
+ inputs: [
130
+ {
131
+ name: "_to",
132
+ type: "address",
133
+ },
134
+ {
135
+ name: "_value",
136
+ type: "uint256",
137
+ },
138
+ ],
139
+ name: "transfer",
140
+ outputs: [
141
+ {
142
+ name: "",
143
+ type: "bool",
144
+ },
145
+ ],
146
+ payable: false,
147
+ stateMutability: "nonpayable",
148
+ type: "function",
149
+ },
150
+ {
151
+ constant: true,
152
+ inputs: [
153
+ {
154
+ name: "_owner",
155
+ type: "address",
156
+ },
157
+ {
158
+ name: "_spender",
159
+ type: "address",
160
+ },
161
+ ],
162
+ name: "allowance",
163
+ outputs: [
164
+ {
165
+ name: "",
166
+ type: "uint256",
167
+ },
168
+ ],
169
+ payable: false,
170
+ stateMutability: "view",
171
+ type: "function",
172
+ },
173
+ {
174
+ payable: true,
175
+ stateMutability: "payable",
176
+ type: "fallback",
177
+ },
178
+ {
179
+ anonymous: false,
180
+ inputs: [
181
+ {
182
+ indexed: true,
183
+ name: "owner",
184
+ type: "address",
185
+ },
186
+ {
187
+ indexed: true,
188
+ name: "spender",
189
+ type: "address",
190
+ },
191
+ {
192
+ indexed: false,
193
+ name: "value",
194
+ type: "uint256",
195
+ },
196
+ ],
197
+ name: "Approval",
198
+ type: "event",
199
+ },
200
+ {
201
+ anonymous: false,
202
+ inputs: [
203
+ {
204
+ indexed: true,
205
+ name: "from",
206
+ type: "address",
207
+ },
208
+ {
209
+ indexed: true,
210
+ name: "to",
211
+ type: "address",
212
+ },
213
+ {
214
+ indexed: false,
215
+ name: "value",
216
+ type: "uint256",
217
+ },
218
+ ],
219
+ name: "Transfer",
220
+ type: "event",
221
+ },
222
+ ];
@@ -0,0 +1,5 @@
1
+ export { default, default as EvmStreamClient } from "./StreamClient.js";
2
+ export * from "./utils.js";
3
+ export * from "./types.js";
4
+ export * as constants from "./constants.js";
5
+ export { default as ercAbi } from "./ercAbi.js";
@@ -0,0 +1,5 @@
1
+ export { default, default as EvmStreamClient } from "./StreamClient.js";
2
+ export * from "./utils.js";
3
+ export * from "./types.js";
4
+ export * as constants from "./constants.js";
5
+ export { default as ercAbi } from "./ercAbi.js";
@@ -1,6 +1,6 @@
1
1
  import BN from "bn.js";
2
2
  import { BigNumber } from "ethers";
3
- import { Stream, StreamType } from "../common/types";
3
+ import { Stream, StreamType } from "../common/types.js";
4
4
  export interface StreamAbiResult {
5
5
  amount: BigNumber;
6
6
  amount_per_period: BigNumber;
@@ -0,0 +1,102 @@
1
+ import BN from "bn.js";
2
+ import { buildStreamType, calculateUnlockedAmount } from "../common/contractUtils.js";
3
+ import { getNumberFromBN } from "../common/utils.js";
4
+ export class EvmContract {
5
+ magic;
6
+ version;
7
+ createdAt;
8
+ withdrawnAmount;
9
+ canceledAt;
10
+ end;
11
+ lastWithdrawnAt;
12
+ sender;
13
+ senderTokens;
14
+ recipient;
15
+ recipientTokens;
16
+ mint;
17
+ escrowTokens;
18
+ streamflowTreasury;
19
+ streamflowTreasuryTokens;
20
+ streamflowFeeTotal;
21
+ streamflowFeeWithdrawn;
22
+ streamflowFeePercent;
23
+ partnerFeeTotal;
24
+ partnerFeeWithdrawn;
25
+ partnerFeePercent;
26
+ partner;
27
+ partnerTokens;
28
+ start;
29
+ depositedAmount;
30
+ period;
31
+ amountPerPeriod;
32
+ cliff;
33
+ cliffAmount;
34
+ cancelableBySender;
35
+ cancelableByRecipient;
36
+ automaticWithdrawal;
37
+ transferableBySender;
38
+ transferableByRecipient;
39
+ canTopup;
40
+ name;
41
+ withdrawalFrequency;
42
+ closed;
43
+ currentPauseStart;
44
+ pauseCumulative;
45
+ lastRateChangeTime;
46
+ fundsUnlockedAtLastRateChange;
47
+ type;
48
+ constructor(stream) {
49
+ this.magic = 0;
50
+ this.version = 0;
51
+ this.createdAt = stream.created.toNumber();
52
+ this.withdrawnAmount = new BN(stream.withdrawn.toString());
53
+ this.canceledAt = stream.canceled_at.toNumber();
54
+ this.end = stream.end.toNumber();
55
+ this.lastWithdrawnAt = stream.last_withdrawn_at.toNumber();
56
+ this.sender = stream.sender;
57
+ this.senderTokens = stream.sender;
58
+ this.recipient = stream.recipient;
59
+ this.recipientTokens = stream.recipient;
60
+ this.mint = stream.token.toLowerCase();
61
+ this.escrowTokens = "";
62
+ this.streamflowTreasury = "";
63
+ this.streamflowTreasuryTokens = "";
64
+ this.streamflowFeeTotal = new BN(stream.fees.streamflow_fee.toString());
65
+ this.streamflowFeeWithdrawn = new BN(stream.fees.streamflow_fee_withdrawn.toString());
66
+ this.streamflowFeePercent = stream.fees.streamflow_fee_percentage.toNumber() / 10000;
67
+ this.partnerFeeTotal = new BN(0);
68
+ this.partnerFeeWithdrawn = new BN(0);
69
+ this.partnerFeePercent = 0;
70
+ this.partner = "";
71
+ this.partnerTokens = "";
72
+ this.start = stream.start.toNumber();
73
+ this.depositedAmount = new BN(stream.amount.toString());
74
+ this.period = stream.period.toNumber();
75
+ this.amountPerPeriod = new BN(stream.amount_per_period.toString());
76
+ this.cliff = stream.start.toNumber();
77
+ this.cliffAmount = new BN(stream.cliff_amount.toString());
78
+ this.cancelableBySender = stream.meta.cancelable_by_sender;
79
+ this.cancelableByRecipient = stream.meta.cancelable_by_recipient;
80
+ this.automaticWithdrawal = stream.meta.automatic_withdrawal;
81
+ this.transferableBySender = stream.meta.transferable_by_sender;
82
+ this.transferableByRecipient = stream.meta.transferable_by_recipient;
83
+ this.canTopup = stream.meta.can_topup;
84
+ this.name = stream.meta.contract_name;
85
+ this.withdrawalFrequency = stream.meta.withdrawal_frequency.toNumber();
86
+ this.closed = stream.closed;
87
+ this.currentPauseStart = stream.current_pause_start.toNumber();
88
+ this.pauseCumulative = new BN(stream.pause_cumulative.toString());
89
+ this.lastRateChangeTime = stream.last_rate_change_time.toNumber();
90
+ this.fundsUnlockedAtLastRateChange = new BN(stream.funds_unlocked_at_last_rate_change.toString());
91
+ this.type = buildStreamType(this);
92
+ }
93
+ unlocked(currentTimestamp) {
94
+ return calculateUnlockedAmount({
95
+ ...this,
96
+ currentTimestamp,
97
+ });
98
+ }
99
+ remaining(decimals) {
100
+ return getNumberFromBN(this.depositedAmount.sub(this.withdrawnAmount), decimals);
101
+ }
102
+ }
@@ -0,0 +1,8 @@
1
+ import { EVM_ERROR_MATCH_REGEX } from "./constants.js";
2
+ export function extractEvmErrorCode(errorText) {
3
+ const match = EVM_ERROR_MATCH_REGEX.exec(errorText);
4
+ if (!match) {
5
+ return null;
6
+ }
7
+ return match[1];
8
+ }
@@ -0,0 +1,9 @@
1
+ export * as StreamflowAptos from "./aptos";
2
+ export * as StreamflowEVM from "./evm";
3
+ export * as StreamflowSolana from "./solana";
4
+ export * as StreamflowSui from "./sui";
5
+ export * from "./common/types";
6
+ export * from "./common/utils";
7
+ export * from "./common/constants";
8
+ export * from "./common/contractUtils";
9
+ export { default as GenericStreamClient } from "./common/GenericStreamClient";
@@ -1,9 +1,9 @@
1
1
  import PQueue from "p-queue";
2
2
  import { Connection, Keypair, PublicKey, TransactionInstruction, Commitment, ConnectionConfig } from "@solana/web3.js";
3
- import { ICreateStreamSolanaExt, IInteractStreamSolanaExt, ITopUpStreamSolanaExt } from "./types";
4
- import { ICancelData, ICluster, ICreateMultipleStreamData, ICreateResult, ICreateStreamData, IGetAllData, IGetFeesData, IGetOneData, IFees, IMultiTransactionResult, ITopUpData, ITransactionResult, ITransferData, IUpdateData, IWithdrawData, Stream } from "../common/types";
5
- import { BaseStreamClient } from "../common/BaseStreamClient";
6
- export default class SolanaStreamClient extends BaseStreamClient {
3
+ import { ICreateStreamSolanaExt, IInteractStreamSolanaExt, ITopUpStreamSolanaExt } from "./types.js";
4
+ import { ICancelData, ICluster, ICreateMultipleStreamData, ICreateResult, ICreateStreamData, IGetAllData, IGetFeesData, IGetOneData, IFees, IMultiTransactionResult, ITopUpData, ITransactionResult, ITransferData, IUpdateData, IWithdrawData, Stream } from "../common/types.js";
5
+ import { BaseStreamClient } from "../common/BaseStreamClient.js";
6
+ export declare class SolanaStreamClient extends BaseStreamClient {
7
7
  private connection;
8
8
  private programId;
9
9
  private commitment;
@@ -24,7 +24,7 @@ export default class SolanaStreamClient extends BaseStreamClient {
24
24
  * Creates a new stream/vesting contract.
25
25
  * All fees are paid by sender (escrow metadata account rent, escrow token account rent, recipient's associated token account rent, Streamflow's service fee).
26
26
  */
27
- prepareCreateInstructions({ recipient, tokenId: mint, start, amount: depositedAmount, period, cliff, cliffAmount, amountPerPeriod, name, canTopup, cancelableBySender, cancelableByRecipient, transferableBySender, transferableByRecipient, automaticWithdrawal, withdrawalFrequency, partner, }: ICreateStreamData, { sender, metadataPubKeys, isNative, computePrice, computeLimit }: ICreateStreamSolanaExt): Promise<{
27
+ prepareCreateInstructions({ recipient, tokenId: mint, start, amount: depositedAmount, period, cliff, cliffAmount, amountPerPeriod, name, canPause, canUpdateRate, canTopup, cancelableBySender, cancelableByRecipient, transferableBySender, transferableByRecipient, automaticWithdrawal, withdrawalFrequency, partner, }: ICreateStreamData, { sender, metadataPubKeys, isNative, computePrice, computeLimit }: ICreateStreamSolanaExt): Promise<{
28
28
  ixs: TransactionInstruction[];
29
29
  metadata: Keypair | undefined;
30
30
  metadataPubKey: PublicKey;
@@ -43,7 +43,7 @@ export default class SolanaStreamClient extends BaseStreamClient {
43
43
  /**
44
44
  * Create Transaction instructions for `createUnchecked`
45
45
  */
46
- prepareCreateUncheckedInstructions({ recipient, tokenId: mint, start, amount: depositedAmount, period, cliff, cliffAmount, amountPerPeriod, name, canTopup, cancelableBySender, cancelableByRecipient, transferableBySender, transferableByRecipient, automaticWithdrawal, withdrawalFrequency, partner, }: ICreateStreamData, { sender, metadataPubKeys, isNative, computePrice, computeLimit }: ICreateStreamSolanaExt): Promise<{
46
+ prepareCreateUncheckedInstructions({ recipient, tokenId: mint, start, amount: depositedAmount, period, cliff, cliffAmount, amountPerPeriod, name, canTopup, canUpdateRate, canPause, cancelableBySender, cancelableByRecipient, transferableBySender, transferableByRecipient, automaticWithdrawal, withdrawalFrequency, partner, }: ICreateStreamData, { sender, metadataPubKeys, isNative, computePrice, computeLimit }: ICreateStreamSolanaExt): Promise<{
47
47
  ixs: TransactionInstruction[];
48
48
  metadata: Keypair | undefined;
49
49
  metadataPubKey: PublicKey;