@streamflow/stream 5.2.6 → 5.2.8
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 +46 -17
- package/dist/common/contractUtils.d.ts +2 -0
- package/dist/common/contractUtils.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
# Streamflow
|
|
2
|
-
|
|
3
|
-
Streamflow is a token vesting and streaming payments platform.
|
|
4
|
-
|
|
5
|
-
There are several ways to use **Streamflow**:
|
|
6
|
-
|
|
7
|
-
- **(easiest) [app.streamflow.finance](https://app.streamflow.finance?utm_medium=github.com&utm_source=referral&utm_campaign=js-sdk-repo)** (React application that uses JS SDK directly)
|
|
8
|
-
- **[JS SDK](https://github.com/streamflow-finance/js-sdk)** to interact with the protocol => [NPM package](https://www.npmjs.com/package/@streamflow/stream)
|
|
9
|
-
- **[Rust SDK](https://github.com/streamflow-finance/rust-sdk)** to integrate within a Solana program => [Rust Crate](https://docs.rs/streamflow-sdk/)
|
|
10
|
-
|
|
11
|
-
**Security audit passed ✅**
|
|
12
|
-
|
|
13
|
-
Protocol audits available [here](https://www.notion.so/streamflow/Streamflow-Security-Audits-3250070c0b3a4a0690385d96316d645c).
|
|
14
|
-
Partner oracle audit available here [here](https://github.com/streamflow-finance/rust-sdk/blob/main/partner_oracle_audit.pdf).
|
|
15
|
-
|
|
16
1
|
## JS SDK to interact with Streamflow protocol.
|
|
17
2
|
|
|
18
3
|
This package allows you to `create`, `createMultiple`, `withdraw`, `cancel`, `topup`, `transfer`, `update` a token stream.
|
|
@@ -86,7 +71,6 @@ const ethereumClient = new StreamflowEVM.EvmStreamClient(
|
|
|
86
71
|
);
|
|
87
72
|
```
|
|
88
73
|
|
|
89
|
-
|
|
90
74
|
### Polygon
|
|
91
75
|
|
|
92
76
|
```javascript
|
|
@@ -117,6 +101,18 @@ const bnbClient = new StreamflowEVM.EvmStreamClient(
|
|
|
117
101
|
);
|
|
118
102
|
```
|
|
119
103
|
|
|
104
|
+
### Sui
|
|
105
|
+
|
|
106
|
+
```javascript
|
|
107
|
+
import {
|
|
108
|
+
StreamflowSui,
|
|
109
|
+
Types,
|
|
110
|
+
} from "@streamflow/stream";
|
|
111
|
+
|
|
112
|
+
const suiClient = new StreamflowSui.SuiStreamClient(
|
|
113
|
+
"https://fullnode.testnet.sui.io:443"
|
|
114
|
+
);
|
|
115
|
+
```
|
|
120
116
|
|
|
121
117
|
### Generic Stream Client
|
|
122
118
|
|
|
@@ -170,6 +166,10 @@ const aptosParams = {
|
|
|
170
166
|
senderWallet: wallet, // AptosWalletAdapter Wallet of sender
|
|
171
167
|
};
|
|
172
168
|
|
|
169
|
+
const suiParams = {
|
|
170
|
+
senderWallet: wallet, // WalletContextState | Keypair
|
|
171
|
+
};
|
|
172
|
+
|
|
173
173
|
const ethereumParams = undefined;
|
|
174
174
|
|
|
175
175
|
try {
|
|
@@ -216,6 +216,10 @@ const aptosParams = {
|
|
|
216
216
|
senderWallet: wallet, // AptosWalletAdapter Wallet of sender
|
|
217
217
|
};
|
|
218
218
|
|
|
219
|
+
const suiParams = {
|
|
220
|
+
senderWallet: wallet, // WalletContextState | Keypair
|
|
221
|
+
};
|
|
222
|
+
|
|
219
223
|
const ethereumParams = undefined;
|
|
220
224
|
|
|
221
225
|
try {
|
|
@@ -258,6 +262,11 @@ const aptosParams = {
|
|
|
258
262
|
tokenId: "0x1::aptos_coin::AptosCoin", // Aptos Coin type
|
|
259
263
|
};
|
|
260
264
|
|
|
265
|
+
const suiParams = {
|
|
266
|
+
senderWallet: wallet, // WalletContextState | Keypair
|
|
267
|
+
tokenId: "0x2::sui::SUI"
|
|
268
|
+
};
|
|
269
|
+
|
|
261
270
|
const ethereumParams = undefined;
|
|
262
271
|
|
|
263
272
|
try {
|
|
@@ -285,6 +294,11 @@ const aptosParams = {
|
|
|
285
294
|
tokenId: "0x1::aptos_coin::AptosCoin", // Aptos Coin type
|
|
286
295
|
};
|
|
287
296
|
|
|
297
|
+
const suiParams = {
|
|
298
|
+
senderWallet: wallet, // WalletContextState | Keypair
|
|
299
|
+
tokenId: "0x2::sui::SUI"
|
|
300
|
+
};
|
|
301
|
+
|
|
288
302
|
const ethereumParams = undefined;
|
|
289
303
|
|
|
290
304
|
try {
|
|
@@ -311,6 +325,11 @@ const aptosParams = {
|
|
|
311
325
|
tokenId: "0x1::aptos_coin::AptosCoin", // Aptos Coin type
|
|
312
326
|
};
|
|
313
327
|
|
|
328
|
+
const suiParams = {
|
|
329
|
+
senderWallet: wallet, // WalletContextState | Keypair
|
|
330
|
+
tokenId: "0x2::sui::SUI"
|
|
331
|
+
};
|
|
332
|
+
|
|
314
333
|
const ethereumParams = undefined;
|
|
315
334
|
|
|
316
335
|
try {
|
|
@@ -336,10 +355,15 @@ const aptosParams = {
|
|
|
336
355
|
tokenId: "0x1::aptos_coin::AptosCoin", // Aptos Coin type
|
|
337
356
|
};
|
|
338
357
|
|
|
358
|
+
const suiParams = {
|
|
359
|
+
senderWallet: wallet, // WalletContextState | Keypair
|
|
360
|
+
tokenId: "0x2::sui::SUI"
|
|
361
|
+
};
|
|
362
|
+
|
|
339
363
|
const ethereumParams = undefined;
|
|
340
364
|
|
|
341
365
|
try {
|
|
342
|
-
const { ixs, tx } = await
|
|
366
|
+
const { ixs, tx } = await client.cancel(cancelStreamParams, solanaParams);
|
|
343
367
|
} catch (exception) {
|
|
344
368
|
// handle exception
|
|
345
369
|
}
|
|
@@ -430,6 +454,11 @@ Streamflow protocol program IDs
|
|
|
430
454
|
| Testnet | 0xc6737de143d91b2f99a7e490d4f8348fdfa3bdd1eb8737a27d0455f8a3625688 |
|
|
431
455
|
| Mainnet | 0x9009d93d52576bf9ac6dc6cf10b870610bcb316342fef6eff80662fbbfce51b0 |
|
|
432
456
|
|
|
457
|
+
| Sui | |
|
|
458
|
+
| ------- | ------------------------------------------------------------------ |
|
|
459
|
+
| Testnet | 0xf1916c119a6c917d4b36f96ffc0443930745789f3126a716e05a62223c48993a |
|
|
460
|
+
| Mainnet | 0xa283fd6b45f1103176e7ae27e870c89df7c8783b15345e2b13faa81ec25c4fa6 |
|
|
461
|
+
|
|
433
462
|
**All BN amounts are denominated in their smallest units.**
|
|
434
463
|
|
|
435
464
|
E.g, if the amount is 1 SOL than this amount in lamports is `1000 \* 10^9 = 1_000_000_000.`
|
|
@@ -21,6 +21,8 @@ export declare const isPayment: (streamData: {
|
|
|
21
21
|
}) => boolean;
|
|
22
22
|
export declare const isVesting: (streamData: {
|
|
23
23
|
canTopup: boolean;
|
|
24
|
+
depositedAmount: BN;
|
|
25
|
+
cliffAmount: BN;
|
|
24
26
|
}) => boolean;
|
|
25
27
|
export declare const isTokenLock: (streamData: {
|
|
26
28
|
canTopup: boolean;
|
|
@@ -30,7 +30,7 @@ var isPayment = function (streamData) {
|
|
|
30
30
|
};
|
|
31
31
|
exports.isPayment = isPayment;
|
|
32
32
|
var isVesting = function (streamData) {
|
|
33
|
-
return !streamData.canTopup && !exports.isCliffCloseToDepositedAmount;
|
|
33
|
+
return !streamData.canTopup && !(0, exports.isCliffCloseToDepositedAmount)(streamData);
|
|
34
34
|
};
|
|
35
35
|
exports.isVesting = isVesting;
|
|
36
36
|
var isTokenLock = function (streamData) {
|
package/package.json
CHANGED