@streamflow/stream 2.0.2-beta.24 → 2.0.2-test.11
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/dist/{sdk.d.ts → Stream.d.ts} +27 -25
- package/dist/Stream.js +503 -0
- package/dist/StreamClient.d.ts +107 -0
- package/dist/{sdk.js → StreamClient.js} +252 -78
- package/dist/constants.d.ts +2 -1
- package/dist/constants.js +3 -2
- package/dist/index.d.ts +2 -1
- package/dist/index.js +5 -3
- package/dist/types.d.ts +72 -3
- package/package.json +1 -1
package/dist/constants.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export declare const PROGRAM_ID: {
|
|
|
9
9
|
local: string;
|
|
10
10
|
};
|
|
11
11
|
export declare const STREAMFLOW_PROGRAM_ID = "strmRqUCoQUgGUan5YhzUZa6KqdzwX5L6FpUxfmKg5m";
|
|
12
|
-
export declare const STREAMFLOW_DEVNET_PROGRAM_ID = "
|
|
12
|
+
export declare const STREAMFLOW_DEVNET_PROGRAM_ID = "FGjLaVo5zLGdzCxMo9gu9tXr1kzTToKd8C8K7YS5hNM1";
|
|
13
13
|
export declare const STREAMFLOW_TREASURY_PUBLIC_KEY: PublicKey;
|
|
14
14
|
export declare const WITHDRAWOR_PUBLIC_KEY: PublicKey;
|
|
15
|
+
export declare const FEE_ORACLE_PUBLIC_KEY: PublicKey;
|
package/dist/constants.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.WITHDRAWOR_PUBLIC_KEY = exports.STREAMFLOW_TREASURY_PUBLIC_KEY = exports.STREAMFLOW_DEVNET_PROGRAM_ID = exports.STREAMFLOW_PROGRAM_ID = exports.PROGRAM_ID = exports.STREAM_STRUCT_OFFSET_RECIPIENT = exports.STREAM_STRUCT_OFFSET_SENDER = exports.TX_FINALITY_CONFIRMED = void 0;
|
|
4
|
+
exports.FEE_ORACLE_PUBLIC_KEY = exports.WITHDRAWOR_PUBLIC_KEY = exports.STREAMFLOW_TREASURY_PUBLIC_KEY = exports.STREAMFLOW_DEVNET_PROGRAM_ID = exports.STREAMFLOW_PROGRAM_ID = exports.PROGRAM_ID = exports.STREAM_STRUCT_OFFSET_RECIPIENT = exports.STREAM_STRUCT_OFFSET_SENDER = exports.TX_FINALITY_CONFIRMED = void 0;
|
|
5
5
|
var web3_js_1 = require("@solana/web3.js");
|
|
6
6
|
var types_1 = require("./types");
|
|
7
7
|
exports.TX_FINALITY_CONFIRMED = "confirmed";
|
|
@@ -14,6 +14,7 @@ exports.PROGRAM_ID = (_a = {},
|
|
|
14
14
|
_a[types_1.LocalCluster.Local] = "HqDGZjaVRXJ9MGRQEw7qDc2rAr6iH1n1kAQdCZaCMfMZ",
|
|
15
15
|
_a);
|
|
16
16
|
exports.STREAMFLOW_PROGRAM_ID = "strmRqUCoQUgGUan5YhzUZa6KqdzwX5L6FpUxfmKg5m";
|
|
17
|
-
exports.STREAMFLOW_DEVNET_PROGRAM_ID = "
|
|
17
|
+
exports.STREAMFLOW_DEVNET_PROGRAM_ID = "FGjLaVo5zLGdzCxMo9gu9tXr1kzTToKd8C8K7YS5hNM1";
|
|
18
18
|
exports.STREAMFLOW_TREASURY_PUBLIC_KEY = new web3_js_1.PublicKey("5SEpbdjFK5FxwTvfsGMXVQTD2v4M2c5tyRTxhdsPkgDw");
|
|
19
19
|
exports.WITHDRAWOR_PUBLIC_KEY = new web3_js_1.PublicKey("wdrwhnCv4pzW8beKsbPa4S2UDZrXenjg16KJdKSpb5u");
|
|
20
|
+
exports.FEE_ORACLE_PUBLIC_KEY = new web3_js_1.PublicKey("B743wFVk2pCYhV91cn287e1xY7f1vt4gdY48hhNiuQmT");
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -13,9 +13,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
14
14
|
};
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.u64 = exports.default = void 0;
|
|
17
|
-
var
|
|
18
|
-
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(
|
|
16
|
+
exports.u64 = exports.StreamClient = exports.default = void 0;
|
|
17
|
+
var Stream_1 = require("./Stream");
|
|
18
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(Stream_1).default; } });
|
|
19
|
+
var StreamClient_1 = require("./StreamClient");
|
|
20
|
+
Object.defineProperty(exports, "StreamClient", { enumerable: true, get: function () { return __importDefault(StreamClient_1).default; } });
|
|
19
21
|
__exportStar(require("./utils"), exports);
|
|
20
22
|
__exportStar(require("./types"), exports);
|
|
21
23
|
__exportStar(require("./instructions"), exports);
|
package/dist/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { Wallet } from "@project-serum/anchor/src/provider";
|
|
3
3
|
import { WalletAdapterNetwork } from "@solana/wallet-adapter-base";
|
|
4
|
-
import { AccountInfo, PublicKey, Keypair, TransactionSignature, TransactionInstruction } from "@solana/web3.js";
|
|
4
|
+
import { AccountInfo, Connection, PublicKey, Keypair, TransactionSignature, TransactionInstruction } from "@solana/web3.js";
|
|
5
5
|
import { u64 } from "@solana/spl-token";
|
|
6
6
|
export { WalletAdapterNetwork as Cluster } from "@solana/wallet-adapter-base";
|
|
7
7
|
export declare enum StreamDirection {
|
|
@@ -37,17 +37,54 @@ export interface CreateStreamData {
|
|
|
37
37
|
cancelableByRecipient: boolean;
|
|
38
38
|
transferableBySender: boolean;
|
|
39
39
|
transferableByRecipient: boolean;
|
|
40
|
-
automaticWithdrawal
|
|
40
|
+
automaticWithdrawal?: boolean;
|
|
41
|
+
withdrawalFrequency?: number;
|
|
42
|
+
}
|
|
43
|
+
export interface MultiRecipient {
|
|
44
|
+
recipient: string;
|
|
45
|
+
depositedAmount: u64;
|
|
46
|
+
name: string;
|
|
47
|
+
}
|
|
48
|
+
export interface CreateMultiData {
|
|
49
|
+
recipientsData: MultiRecipient[];
|
|
50
|
+
mint: string;
|
|
51
|
+
start: number;
|
|
52
|
+
period: number;
|
|
53
|
+
cliff: number;
|
|
54
|
+
cliffAmount: u64;
|
|
55
|
+
amountPerPeriod: u64;
|
|
56
|
+
canTopup: boolean;
|
|
57
|
+
cancelableBySender: boolean;
|
|
58
|
+
cancelableByRecipient: boolean;
|
|
59
|
+
transferableBySender: boolean;
|
|
60
|
+
transferableByRecipient: boolean;
|
|
61
|
+
automaticWithdrawal?: boolean;
|
|
62
|
+
withdrawalFrequency?: number;
|
|
41
63
|
}
|
|
42
64
|
export interface CreateStreamParams extends CreateStreamData {
|
|
65
|
+
connection: Connection;
|
|
43
66
|
sender: Wallet;
|
|
44
67
|
partner?: string | null;
|
|
68
|
+
cluster?: ClusterExtended;
|
|
69
|
+
}
|
|
70
|
+
export interface CreateParams extends CreateStreamData {
|
|
71
|
+
sender: Wallet | Keypair;
|
|
72
|
+
partner?: string | null;
|
|
73
|
+
}
|
|
74
|
+
export interface CreateMultiParams extends CreateMultiData {
|
|
75
|
+
sender: Wallet | Keypair;
|
|
76
|
+
partner?: string | null;
|
|
45
77
|
}
|
|
46
78
|
export interface WithdrawStreamData {
|
|
47
79
|
id: string;
|
|
48
80
|
amount: u64;
|
|
49
81
|
}
|
|
50
82
|
export interface WithdrawStreamParams extends WithdrawStreamData {
|
|
83
|
+
connection: Connection;
|
|
84
|
+
invoker: Wallet;
|
|
85
|
+
cluster?: ClusterExtended;
|
|
86
|
+
}
|
|
87
|
+
export interface WithdrawParams extends WithdrawStreamData {
|
|
51
88
|
invoker: Wallet;
|
|
52
89
|
}
|
|
53
90
|
export interface TopupStreamData {
|
|
@@ -55,12 +92,22 @@ export interface TopupStreamData {
|
|
|
55
92
|
amount: u64;
|
|
56
93
|
}
|
|
57
94
|
export interface TopupStreamParams extends TopupStreamData {
|
|
95
|
+
connection: Connection;
|
|
96
|
+
invoker: Wallet;
|
|
97
|
+
cluster?: ClusterExtended;
|
|
98
|
+
}
|
|
99
|
+
export interface TopupParams extends TopupStreamData {
|
|
58
100
|
invoker: Wallet;
|
|
59
101
|
}
|
|
60
102
|
export interface CancelStreamData {
|
|
61
103
|
id: string;
|
|
62
104
|
}
|
|
63
105
|
export interface CancelStreamParams extends CancelStreamData {
|
|
106
|
+
connection: Connection;
|
|
107
|
+
invoker: Wallet;
|
|
108
|
+
cluster?: ClusterExtended;
|
|
109
|
+
}
|
|
110
|
+
export interface CancelParams extends CancelStreamData {
|
|
64
111
|
invoker: Wallet;
|
|
65
112
|
}
|
|
66
113
|
export interface TransferStreamData {
|
|
@@ -68,12 +115,25 @@ export interface TransferStreamData {
|
|
|
68
115
|
recipientId: string;
|
|
69
116
|
}
|
|
70
117
|
export interface TransferStreamParams extends TransferStreamData {
|
|
118
|
+
connection: Connection;
|
|
119
|
+
invoker: Wallet;
|
|
120
|
+
cluster?: ClusterExtended;
|
|
121
|
+
}
|
|
122
|
+
export interface TransferParams extends TransferStreamData {
|
|
71
123
|
invoker: Wallet;
|
|
72
124
|
}
|
|
73
125
|
export interface GetStreamParams {
|
|
126
|
+
connection: Connection;
|
|
74
127
|
id: string;
|
|
75
128
|
}
|
|
76
129
|
export interface GetStreamsParams {
|
|
130
|
+
connection: Connection;
|
|
131
|
+
wallet: PublicKey;
|
|
132
|
+
type?: StreamType;
|
|
133
|
+
direction?: StreamDirection;
|
|
134
|
+
cluster?: ClusterExtended;
|
|
135
|
+
}
|
|
136
|
+
export interface GetAllParams {
|
|
77
137
|
wallet: PublicKey;
|
|
78
138
|
type?: StreamType;
|
|
79
139
|
direction?: StreamDirection;
|
|
@@ -157,9 +217,18 @@ export interface DecodedStream {
|
|
|
157
217
|
withdrawFrequency: u64;
|
|
158
218
|
}
|
|
159
219
|
export interface TransactionResponse {
|
|
160
|
-
ixs: TransactionInstruction[];
|
|
161
220
|
tx: TransactionSignature;
|
|
162
221
|
}
|
|
163
222
|
export interface CreateStreamResponse extends TransactionResponse {
|
|
223
|
+
id: string;
|
|
224
|
+
}
|
|
225
|
+
export interface TxResponse {
|
|
226
|
+
ixs: TransactionInstruction[];
|
|
227
|
+
tx: TransactionSignature;
|
|
228
|
+
}
|
|
229
|
+
export interface CreateResponse extends TxResponse {
|
|
164
230
|
metadata: Keypair;
|
|
165
231
|
}
|
|
232
|
+
export interface CreateMultiResponse {
|
|
233
|
+
txs: TransactionSignature[];
|
|
234
|
+
}
|
package/package.json
CHANGED