@streamflow/stream 2.0.2-beta.24 → 2.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.
- package/README.md +47 -34
- package/dist/constants.d.ts +0 -2
- package/dist/constants.js +1 -3
- package/dist/index.d.ts +1 -2
- package/dist/index.js +3 -4
- package/dist/sdk.d.ts +28 -26
- package/dist/sdk.js +194 -251
- package/dist/types.d.ts +54 -40
- package/dist/utils.d.ts +6 -6
- package/dist/utils.js +74 -32
- package/package.json +1 -1
- package/dist/instructions.d.ts +0 -97
- package/dist/instructions.js +0 -210
- package/dist/layout.d.ts +0 -18
- package/dist/layout.js +0 -73
package/dist/types.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
/// <reference types="bn.js" />
|
|
3
|
+
import { BN } from "@project-serum/anchor";
|
|
2
4
|
import { Wallet } from "@project-serum/anchor/src/provider";
|
|
3
5
|
import { WalletAdapterNetwork } from "@solana/wallet-adapter-base";
|
|
4
|
-
import { AccountInfo,
|
|
5
|
-
import { u64 } from "@solana/spl-token";
|
|
6
|
+
import { AccountInfo, Connection, PublicKey, TransactionSignature } from "@solana/web3.js";
|
|
6
7
|
export { WalletAdapterNetwork as Cluster } from "@solana/wallet-adapter-base";
|
|
7
8
|
export declare enum StreamDirection {
|
|
8
9
|
Outgoing = "outgoing",
|
|
@@ -26,63 +27,77 @@ export interface CreateStreamData {
|
|
|
26
27
|
recipient: string;
|
|
27
28
|
mint: string;
|
|
28
29
|
start: number;
|
|
29
|
-
depositedAmount:
|
|
30
|
+
depositedAmount: BN;
|
|
30
31
|
period: number;
|
|
31
32
|
cliff: number;
|
|
32
|
-
cliffAmount:
|
|
33
|
-
amountPerPeriod:
|
|
33
|
+
cliffAmount: BN;
|
|
34
|
+
amountPerPeriod: BN;
|
|
34
35
|
name: string;
|
|
35
36
|
canTopup: boolean;
|
|
36
37
|
cancelableBySender: boolean;
|
|
37
38
|
cancelableByRecipient: boolean;
|
|
38
39
|
transferableBySender: boolean;
|
|
39
40
|
transferableByRecipient: boolean;
|
|
40
|
-
automaticWithdrawal
|
|
41
|
+
automaticWithdrawal?: boolean;
|
|
42
|
+
withdrawalFrequency?: number;
|
|
41
43
|
}
|
|
42
44
|
export interface CreateStreamParams extends CreateStreamData {
|
|
45
|
+
connection: Connection;
|
|
43
46
|
sender: Wallet;
|
|
44
|
-
partner?: string
|
|
47
|
+
partner?: string;
|
|
48
|
+
cluster?: ClusterExtended;
|
|
45
49
|
}
|
|
46
50
|
export interface WithdrawStreamData {
|
|
47
51
|
id: string;
|
|
48
|
-
amount:
|
|
52
|
+
amount: BN;
|
|
49
53
|
}
|
|
50
54
|
export interface WithdrawStreamParams extends WithdrawStreamData {
|
|
55
|
+
connection: Connection;
|
|
51
56
|
invoker: Wallet;
|
|
57
|
+
cluster?: ClusterExtended;
|
|
52
58
|
}
|
|
53
59
|
export interface TopupStreamData {
|
|
54
60
|
id: string;
|
|
55
|
-
amount:
|
|
61
|
+
amount: BN;
|
|
56
62
|
}
|
|
57
63
|
export interface TopupStreamParams extends TopupStreamData {
|
|
64
|
+
connection: Connection;
|
|
58
65
|
invoker: Wallet;
|
|
66
|
+
cluster?: ClusterExtended;
|
|
59
67
|
}
|
|
60
68
|
export interface CancelStreamData {
|
|
61
69
|
id: string;
|
|
62
70
|
}
|
|
63
71
|
export interface CancelStreamParams extends CancelStreamData {
|
|
72
|
+
connection: Connection;
|
|
64
73
|
invoker: Wallet;
|
|
74
|
+
cluster?: ClusterExtended;
|
|
65
75
|
}
|
|
66
76
|
export interface TransferStreamData {
|
|
67
77
|
id: string;
|
|
68
78
|
recipientId: string;
|
|
69
79
|
}
|
|
70
80
|
export interface TransferStreamParams extends TransferStreamData {
|
|
81
|
+
connection: Connection;
|
|
71
82
|
invoker: Wallet;
|
|
83
|
+
cluster?: ClusterExtended;
|
|
72
84
|
}
|
|
73
85
|
export interface GetStreamParams {
|
|
86
|
+
connection: Connection;
|
|
74
87
|
id: string;
|
|
75
88
|
}
|
|
76
89
|
export interface GetStreamsParams {
|
|
90
|
+
connection: Connection;
|
|
77
91
|
wallet: PublicKey;
|
|
78
92
|
type?: StreamType;
|
|
79
93
|
direction?: StreamDirection;
|
|
94
|
+
cluster?: ClusterExtended;
|
|
80
95
|
}
|
|
81
96
|
export interface Stream {
|
|
82
97
|
magic: number;
|
|
83
98
|
version: number;
|
|
84
99
|
createdAt: number;
|
|
85
|
-
withdrawnAmount:
|
|
100
|
+
withdrawnAmount: BN;
|
|
86
101
|
canceledAt: number;
|
|
87
102
|
end: number;
|
|
88
103
|
lastWithdrawnAt: number;
|
|
@@ -94,20 +109,20 @@ export interface Stream {
|
|
|
94
109
|
escrowTokens: string;
|
|
95
110
|
streamflowTreasury: string;
|
|
96
111
|
streamflowTreasuryTokens: string;
|
|
97
|
-
streamflowFeeTotal:
|
|
98
|
-
streamflowFeeWithdrawn:
|
|
112
|
+
streamflowFeeTotal: BN;
|
|
113
|
+
streamflowFeeWithdrawn: BN;
|
|
99
114
|
streamflowFeePercent: number;
|
|
100
|
-
partnerFeeTotal:
|
|
101
|
-
partnerFeeWithdrawn:
|
|
115
|
+
partnerFeeTotal: BN;
|
|
116
|
+
partnerFeeWithdrawn: BN;
|
|
102
117
|
partnerFeePercent: number;
|
|
103
118
|
partner: string;
|
|
104
119
|
partnerTokens: string;
|
|
105
120
|
start: number;
|
|
106
|
-
depositedAmount:
|
|
121
|
+
depositedAmount: BN;
|
|
107
122
|
period: number;
|
|
108
|
-
amountPerPeriod:
|
|
123
|
+
amountPerPeriod: BN;
|
|
109
124
|
cliff: number;
|
|
110
|
-
cliffAmount:
|
|
125
|
+
cliffAmount: BN;
|
|
111
126
|
cancelableBySender: boolean;
|
|
112
127
|
cancelableByRecipient: boolean;
|
|
113
128
|
automaticWithdrawal: boolean;
|
|
@@ -115,16 +130,16 @@ export interface Stream {
|
|
|
115
130
|
transferableByRecipient: boolean;
|
|
116
131
|
canTopup: boolean;
|
|
117
132
|
name: string;
|
|
118
|
-
|
|
133
|
+
withdrawalFrequency: number;
|
|
119
134
|
}
|
|
120
135
|
export interface DecodedStream {
|
|
121
|
-
magic:
|
|
122
|
-
version:
|
|
123
|
-
createdAt:
|
|
124
|
-
withdrawnAmount:
|
|
125
|
-
canceledAt:
|
|
126
|
-
end:
|
|
127
|
-
lastWithdrawnAt:
|
|
136
|
+
magic: BN;
|
|
137
|
+
version: BN;
|
|
138
|
+
createdAt: BN;
|
|
139
|
+
withdrawnAmount: BN;
|
|
140
|
+
canceledAt: BN;
|
|
141
|
+
end: BN;
|
|
142
|
+
lastWithdrawnAt: BN;
|
|
128
143
|
sender: PublicKey;
|
|
129
144
|
senderTokens: PublicKey;
|
|
130
145
|
recipient: PublicKey;
|
|
@@ -133,20 +148,20 @@ export interface DecodedStream {
|
|
|
133
148
|
escrowTokens: PublicKey;
|
|
134
149
|
streamflowTreasury: PublicKey;
|
|
135
150
|
streamflowTreasuryTokens: PublicKey;
|
|
136
|
-
streamflowFeeTotal:
|
|
137
|
-
streamflowFeeWithdrawn:
|
|
138
|
-
streamflowFeePercent:
|
|
139
|
-
partnerFeeTotal:
|
|
140
|
-
partnerFeeWithdrawn:
|
|
141
|
-
partnerFeePercent:
|
|
151
|
+
streamflowFeeTotal: BN;
|
|
152
|
+
streamflowFeeWithdrawn: BN;
|
|
153
|
+
streamflowFeePercent: BN;
|
|
154
|
+
partnerFeeTotal: BN;
|
|
155
|
+
partnerFeeWithdrawn: BN;
|
|
156
|
+
partnerFeePercent: BN;
|
|
142
157
|
partner: PublicKey;
|
|
143
158
|
partnerTokens: PublicKey;
|
|
144
|
-
start:
|
|
145
|
-
depositedAmount:
|
|
146
|
-
period:
|
|
147
|
-
amountPerPeriod:
|
|
148
|
-
cliff:
|
|
149
|
-
cliffAmount:
|
|
159
|
+
start: BN;
|
|
160
|
+
depositedAmount: BN;
|
|
161
|
+
period: BN;
|
|
162
|
+
amountPerPeriod: BN;
|
|
163
|
+
cliff: BN;
|
|
164
|
+
cliffAmount: BN;
|
|
150
165
|
cancelableBySender: boolean;
|
|
151
166
|
cancelableByRecipient: boolean;
|
|
152
167
|
automaticWithdrawal: boolean;
|
|
@@ -154,12 +169,11 @@ export interface DecodedStream {
|
|
|
154
169
|
transferableByRecipient: boolean;
|
|
155
170
|
canTopup: boolean;
|
|
156
171
|
name: string;
|
|
157
|
-
|
|
172
|
+
withdrawalFrequency: BN;
|
|
158
173
|
}
|
|
159
174
|
export interface TransactionResponse {
|
|
160
|
-
ixs: TransactionInstruction[];
|
|
161
175
|
tx: TransactionSignature;
|
|
162
176
|
}
|
|
163
177
|
export interface CreateStreamResponse extends TransactionResponse {
|
|
164
|
-
|
|
178
|
+
id: string;
|
|
165
179
|
}
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import {
|
|
2
|
+
import { BN } from "@project-serum/anchor";
|
|
3
3
|
import { Stream, DecodedStream } from "./types";
|
|
4
4
|
export declare const decodeStream: (buf: Buffer) => DecodedStream;
|
|
5
5
|
export declare const formatDecodedStream: (stream: DecodedStream) => Stream;
|
|
6
6
|
/**
|
|
7
7
|
* Used for conversion of token amounts to their Big Number representation.
|
|
8
8
|
* Get Big Number representation in the smallest units from the same value in the highest units.
|
|
9
|
-
* @param {number} value - Number of tokens you want to convert to its
|
|
9
|
+
* @param {number} value - Number of tokens you want to convert to its BN representation.
|
|
10
10
|
* @param {number} decimals - Number of decimals the token has.
|
|
11
11
|
*/
|
|
12
|
-
export declare const getBN: (value: number, decimals: number) =>
|
|
12
|
+
export declare const getBN: (value: number, decimals: number) => BN;
|
|
13
13
|
/**
|
|
14
14
|
* Used for token amounts conversion from their Big Number representation to number.
|
|
15
|
-
* Get value in the highest units from
|
|
16
|
-
* @param {
|
|
15
|
+
* Get value in the highest units from BN representation of the same value in the smallest units.
|
|
16
|
+
* @param {BN} value - Big Number representation of value in the smallest units.
|
|
17
17
|
* @param {number} decimals - Number of decimals the token has.
|
|
18
18
|
*/
|
|
19
|
-
export declare const getNumberFromBN: (value:
|
|
19
|
+
export declare const getNumberFromBN: (value: BN, decimals: number) => number;
|
package/dist/utils.js
CHANGED
|
@@ -1,21 +1,63 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.getNumberFromBN = exports.getBN = exports.formatDecodedStream = exports.decodeStream = void 0;
|
|
7
|
+
var buffer_layout_1 = __importDefault(require("buffer-layout"));
|
|
4
8
|
var web3_js_1 = require("@solana/web3.js");
|
|
5
|
-
var
|
|
6
|
-
var layout_1 = require("./layout");
|
|
7
|
-
var decoder = new TextDecoder("utf-8");
|
|
9
|
+
var anchor_1 = require("@project-serum/anchor");
|
|
8
10
|
var LE = "le"; //little endian
|
|
11
|
+
var decoder = new TextDecoder("utf-8");
|
|
12
|
+
var TokenStreamDataLayout = buffer_layout_1.default.struct([
|
|
13
|
+
buffer_layout_1.default.blob(8, "magic"),
|
|
14
|
+
buffer_layout_1.default.blob(1, "version"),
|
|
15
|
+
buffer_layout_1.default.blob(8, "created_at"),
|
|
16
|
+
buffer_layout_1.default.blob(8, "withdrawn_amount"),
|
|
17
|
+
buffer_layout_1.default.blob(8, "canceled_at"),
|
|
18
|
+
buffer_layout_1.default.blob(8, "end_time"),
|
|
19
|
+
buffer_layout_1.default.blob(8, "last_withdrawn_at"),
|
|
20
|
+
buffer_layout_1.default.blob(32, "sender"),
|
|
21
|
+
buffer_layout_1.default.blob(32, "sender_tokens"),
|
|
22
|
+
buffer_layout_1.default.blob(32, "recipient"),
|
|
23
|
+
buffer_layout_1.default.blob(32, "recipient_tokens"),
|
|
24
|
+
buffer_layout_1.default.blob(32, "mint"),
|
|
25
|
+
buffer_layout_1.default.blob(32, "escrow_tokens"),
|
|
26
|
+
buffer_layout_1.default.blob(32, "streamflow_treasury"),
|
|
27
|
+
buffer_layout_1.default.blob(32, "streamflow_treasury_tokens"),
|
|
28
|
+
buffer_layout_1.default.blob(8, "streamflow_fee_total"),
|
|
29
|
+
buffer_layout_1.default.blob(8, "streamflow_fee_withdrawn"),
|
|
30
|
+
buffer_layout_1.default.blob(4, "streamflow_fee_percent"),
|
|
31
|
+
buffer_layout_1.default.blob(32, "partner"),
|
|
32
|
+
buffer_layout_1.default.blob(32, "partner_tokens"),
|
|
33
|
+
buffer_layout_1.default.blob(8, "partner_fee_total"),
|
|
34
|
+
buffer_layout_1.default.blob(8, "partner_fee_withdrawn"),
|
|
35
|
+
buffer_layout_1.default.blob(4, "partner_fee_percent"),
|
|
36
|
+
buffer_layout_1.default.blob(8, "start_time"),
|
|
37
|
+
buffer_layout_1.default.blob(8, "net_deposited_amount"),
|
|
38
|
+
buffer_layout_1.default.blob(8, "period"),
|
|
39
|
+
buffer_layout_1.default.blob(8, "amount_per_period"),
|
|
40
|
+
buffer_layout_1.default.blob(8, "cliff"),
|
|
41
|
+
buffer_layout_1.default.blob(8, "cliff_amount"),
|
|
42
|
+
buffer_layout_1.default.u8("cancelable_by_sender"),
|
|
43
|
+
buffer_layout_1.default.u8("cancelable_by_recipient"),
|
|
44
|
+
buffer_layout_1.default.u8("automatic_withdrawal"),
|
|
45
|
+
buffer_layout_1.default.u8("transferable_by_sender"),
|
|
46
|
+
buffer_layout_1.default.u8("transferable_by_recipient"),
|
|
47
|
+
buffer_layout_1.default.u8("can_topup"),
|
|
48
|
+
buffer_layout_1.default.blob(64, "stream_name"),
|
|
49
|
+
buffer_layout_1.default.blob(8, "withdraw_frequency"),
|
|
50
|
+
]);
|
|
9
51
|
var decodeStream = function (buf) {
|
|
10
|
-
var raw =
|
|
52
|
+
var raw = TokenStreamDataLayout.decode(buf);
|
|
11
53
|
return {
|
|
12
|
-
magic: new
|
|
13
|
-
version: new
|
|
14
|
-
createdAt: new
|
|
15
|
-
withdrawnAmount: new
|
|
16
|
-
canceledAt: new
|
|
17
|
-
end: new
|
|
18
|
-
lastWithdrawnAt: new
|
|
54
|
+
magic: new anchor_1.BN(raw.magic, LE),
|
|
55
|
+
version: new anchor_1.BN(raw.version, LE),
|
|
56
|
+
createdAt: new anchor_1.BN(raw.created_at, LE),
|
|
57
|
+
withdrawnAmount: new anchor_1.BN(raw.withdrawn_amount, LE),
|
|
58
|
+
canceledAt: new anchor_1.BN(raw.canceled_at, LE),
|
|
59
|
+
end: new anchor_1.BN(raw.end_time, LE),
|
|
60
|
+
lastWithdrawnAt: new anchor_1.BN(raw.last_withdrawn_at, LE),
|
|
19
61
|
sender: new web3_js_1.PublicKey(raw.sender),
|
|
20
62
|
senderTokens: new web3_js_1.PublicKey(raw.sender_tokens),
|
|
21
63
|
recipient: new web3_js_1.PublicKey(raw.recipient),
|
|
@@ -24,20 +66,20 @@ var decodeStream = function (buf) {
|
|
|
24
66
|
escrowTokens: new web3_js_1.PublicKey(raw.escrow_tokens),
|
|
25
67
|
streamflowTreasury: new web3_js_1.PublicKey(raw.streamflow_treasury),
|
|
26
68
|
streamflowTreasuryTokens: new web3_js_1.PublicKey(raw.streamflow_treasury_tokens),
|
|
27
|
-
streamflowFeeTotal: new
|
|
28
|
-
streamflowFeeWithdrawn: new
|
|
29
|
-
streamflowFeePercent: new
|
|
30
|
-
partnerFeeTotal: new
|
|
31
|
-
partnerFeeWithdrawn: new
|
|
32
|
-
partnerFeePercent: new
|
|
69
|
+
streamflowFeeTotal: new anchor_1.BN(raw.streamflow_fee_total, LE),
|
|
70
|
+
streamflowFeeWithdrawn: new anchor_1.BN(raw.streamflow_fee_withdrawn, LE),
|
|
71
|
+
streamflowFeePercent: new anchor_1.BN(raw.streamflow_fee_percent, LE),
|
|
72
|
+
partnerFeeTotal: new anchor_1.BN(raw.partner_fee_total, LE),
|
|
73
|
+
partnerFeeWithdrawn: new anchor_1.BN(raw.partner_fee_withdrawn, LE),
|
|
74
|
+
partnerFeePercent: new anchor_1.BN(raw.partner_fee_percent, LE),
|
|
33
75
|
partner: new web3_js_1.PublicKey(raw.partner),
|
|
34
76
|
partnerTokens: new web3_js_1.PublicKey(raw.partner_tokens),
|
|
35
|
-
start: new
|
|
36
|
-
depositedAmount: new
|
|
37
|
-
period: new
|
|
38
|
-
amountPerPeriod: new
|
|
39
|
-
cliff: new
|
|
40
|
-
cliffAmount: new
|
|
77
|
+
start: new anchor_1.BN(raw.start_time, LE),
|
|
78
|
+
depositedAmount: new anchor_1.BN(raw.net_deposited_amount, LE),
|
|
79
|
+
period: new anchor_1.BN(raw.period, LE),
|
|
80
|
+
amountPerPeriod: new anchor_1.BN(raw.amount_per_period, LE),
|
|
81
|
+
cliff: new anchor_1.BN(raw.cliff, LE),
|
|
82
|
+
cliffAmount: new anchor_1.BN(raw.cliff_amount, LE),
|
|
41
83
|
cancelableBySender: Boolean(raw.cancelable_by_sender),
|
|
42
84
|
cancelableByRecipient: Boolean(raw.cancelable_by_recipient),
|
|
43
85
|
automaticWithdrawal: Boolean(raw.automatic_withdrawal),
|
|
@@ -45,7 +87,7 @@ var decodeStream = function (buf) {
|
|
|
45
87
|
transferableByRecipient: Boolean(raw.transferable_by_recipient),
|
|
46
88
|
canTopup: Boolean(raw.can_topup),
|
|
47
89
|
name: decoder.decode(raw.stream_name),
|
|
48
|
-
|
|
90
|
+
withdrawalFrequency: new anchor_1.BN(raw.withdraw_frequency, LE),
|
|
49
91
|
};
|
|
50
92
|
};
|
|
51
93
|
exports.decodeStream = decodeStream;
|
|
@@ -88,31 +130,31 @@ var formatDecodedStream = function (stream) {
|
|
|
88
130
|
transferableByRecipient: stream.transferableByRecipient,
|
|
89
131
|
canTopup: stream.canTopup,
|
|
90
132
|
name: stream.name,
|
|
91
|
-
|
|
133
|
+
withdrawalFrequency: stream.withdrawalFrequency.toNumber(),
|
|
92
134
|
});
|
|
93
135
|
};
|
|
94
136
|
exports.formatDecodedStream = formatDecodedStream;
|
|
95
137
|
/**
|
|
96
138
|
* Used for conversion of token amounts to their Big Number representation.
|
|
97
139
|
* Get Big Number representation in the smallest units from the same value in the highest units.
|
|
98
|
-
* @param {number} value - Number of tokens you want to convert to its
|
|
140
|
+
* @param {number} value - Number of tokens you want to convert to its BN representation.
|
|
99
141
|
* @param {number} decimals - Number of decimals the token has.
|
|
100
142
|
*/
|
|
101
143
|
var getBN = function (value, decimals) {
|
|
102
144
|
return value > (Math.pow(2, 53) - 1) / Math.pow(10, decimals)
|
|
103
|
-
? new
|
|
104
|
-
: new
|
|
145
|
+
? new anchor_1.BN(value).mul(new anchor_1.BN(Math.pow(10, decimals)))
|
|
146
|
+
: new anchor_1.BN(value * Math.pow(10, decimals));
|
|
105
147
|
};
|
|
106
148
|
exports.getBN = getBN;
|
|
107
149
|
/**
|
|
108
150
|
* Used for token amounts conversion from their Big Number representation to number.
|
|
109
|
-
* Get value in the highest units from
|
|
110
|
-
* @param {
|
|
151
|
+
* Get value in the highest units from BN representation of the same value in the smallest units.
|
|
152
|
+
* @param {BN} value - Big Number representation of value in the smallest units.
|
|
111
153
|
* @param {number} decimals - Number of decimals the token has.
|
|
112
154
|
*/
|
|
113
155
|
var getNumberFromBN = function (value, decimals) {
|
|
114
|
-
return value.gt(new
|
|
115
|
-
? value.div(new
|
|
156
|
+
return value.gt(new anchor_1.BN(Math.pow(2, 53) - 1))
|
|
157
|
+
? value.div(new anchor_1.BN(Math.pow(10, decimals))).toNumber()
|
|
116
158
|
: value.toNumber() / Math.pow(10, decimals);
|
|
117
159
|
};
|
|
118
160
|
exports.getNumberFromBN = getNumberFromBN;
|
package/package.json
CHANGED
package/dist/instructions.d.ts
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { PublicKey, TransactionInstruction } from "@solana/web3.js";
|
|
2
|
-
import { u64 } from "@solana/spl-token";
|
|
3
|
-
interface CreateStreamData {
|
|
4
|
-
start: u64;
|
|
5
|
-
depositedAmount: u64;
|
|
6
|
-
period: u64;
|
|
7
|
-
amountPerPeriod: u64;
|
|
8
|
-
cliff: u64;
|
|
9
|
-
cliffAmount: u64;
|
|
10
|
-
cancelableBySender: boolean;
|
|
11
|
-
cancelableByRecipient: boolean;
|
|
12
|
-
automaticWithdrawal: boolean;
|
|
13
|
-
transferableBySender: boolean;
|
|
14
|
-
transferableByRecipient: boolean;
|
|
15
|
-
canTopup: boolean;
|
|
16
|
-
name: string;
|
|
17
|
-
withdrawFrequency: u64;
|
|
18
|
-
}
|
|
19
|
-
interface CreateStreamAccounts {
|
|
20
|
-
sender: PublicKey;
|
|
21
|
-
senderTokens: PublicKey;
|
|
22
|
-
recipient: PublicKey;
|
|
23
|
-
recipientTokens: PublicKey;
|
|
24
|
-
metadata: PublicKey;
|
|
25
|
-
escrowTokens: PublicKey;
|
|
26
|
-
streamflowTreasury: PublicKey;
|
|
27
|
-
streamflowTreasuryTokens: PublicKey;
|
|
28
|
-
partner: PublicKey;
|
|
29
|
-
partnerTokens: PublicKey;
|
|
30
|
-
mint: PublicKey;
|
|
31
|
-
feeOracle: PublicKey;
|
|
32
|
-
rent: PublicKey;
|
|
33
|
-
timelockProgram: PublicKey;
|
|
34
|
-
tokenProgram: PublicKey;
|
|
35
|
-
associatedTokenProgram: PublicKey;
|
|
36
|
-
withdrawor: PublicKey;
|
|
37
|
-
systemProgram: PublicKey;
|
|
38
|
-
}
|
|
39
|
-
export declare const createStreamInstruction: (data: CreateStreamData, programId: PublicKey, accounts: CreateStreamAccounts) => TransactionInstruction;
|
|
40
|
-
interface WithdrawAccounts {
|
|
41
|
-
authority: PublicKey;
|
|
42
|
-
recipient: PublicKey;
|
|
43
|
-
recipientTokens: PublicKey;
|
|
44
|
-
metadata: PublicKey;
|
|
45
|
-
escrowTokens: PublicKey;
|
|
46
|
-
streamflowTreasury: PublicKey;
|
|
47
|
-
streamflowTreasuryTokens: PublicKey;
|
|
48
|
-
partner: PublicKey;
|
|
49
|
-
partnerTokens: PublicKey;
|
|
50
|
-
mint: PublicKey;
|
|
51
|
-
tokenProgram: PublicKey;
|
|
52
|
-
}
|
|
53
|
-
export declare const withdrawStreamInstruction: (amount: u64, programId: PublicKey, { authority, recipient, recipientTokens, metadata, escrowTokens, streamflowTreasury, streamflowTreasuryTokens, partner, partnerTokens, mint, tokenProgram, }: WithdrawAccounts) => TransactionInstruction;
|
|
54
|
-
interface CancelAccounts {
|
|
55
|
-
authority: PublicKey;
|
|
56
|
-
sender: PublicKey;
|
|
57
|
-
senderTokens: PublicKey;
|
|
58
|
-
recipient: PublicKey;
|
|
59
|
-
recipientTokens: PublicKey;
|
|
60
|
-
metadata: PublicKey;
|
|
61
|
-
escrowTokens: PublicKey;
|
|
62
|
-
streamflowTreasury: PublicKey;
|
|
63
|
-
streamflowTreasuryTokens: PublicKey;
|
|
64
|
-
partner: PublicKey;
|
|
65
|
-
partnerTokens: PublicKey;
|
|
66
|
-
mint: PublicKey;
|
|
67
|
-
tokenProgram: PublicKey;
|
|
68
|
-
}
|
|
69
|
-
export declare const cancelStreamInstruction: (programId: PublicKey, { authority, sender, senderTokens, recipient, recipientTokens, metadata, escrowTokens, streamflowTreasury, streamflowTreasuryTokens, partner, partnerTokens, mint, tokenProgram, }: CancelAccounts) => TransactionInstruction;
|
|
70
|
-
interface TransferAccounts {
|
|
71
|
-
authority: PublicKey;
|
|
72
|
-
newRecipient: PublicKey;
|
|
73
|
-
newRecipientTokens: PublicKey;
|
|
74
|
-
metadata: PublicKey;
|
|
75
|
-
mint: PublicKey;
|
|
76
|
-
rent: PublicKey;
|
|
77
|
-
tokenProgram: PublicKey;
|
|
78
|
-
associatedTokenProgram: PublicKey;
|
|
79
|
-
systemProgram: PublicKey;
|
|
80
|
-
}
|
|
81
|
-
export declare const transferStreamInstruction: (programId: PublicKey, { authority, newRecipient, newRecipientTokens, metadata, mint, rent, tokenProgram, associatedTokenProgram, systemProgram, }: TransferAccounts) => TransactionInstruction;
|
|
82
|
-
interface TopupAccounts {
|
|
83
|
-
sender: PublicKey;
|
|
84
|
-
senderTokens: PublicKey;
|
|
85
|
-
metadata: PublicKey;
|
|
86
|
-
escrowTokens: PublicKey;
|
|
87
|
-
streamflowTreasury: PublicKey;
|
|
88
|
-
streamflowTreasuryTokens: PublicKey;
|
|
89
|
-
partner: PublicKey;
|
|
90
|
-
partnerTokens: PublicKey;
|
|
91
|
-
mint: PublicKey;
|
|
92
|
-
tokenProgram: PublicKey;
|
|
93
|
-
withdrawor: PublicKey;
|
|
94
|
-
systemProgram: PublicKey;
|
|
95
|
-
}
|
|
96
|
-
export declare const topupStreamInstruction: (amount: u64, programId: PublicKey, { sender, senderTokens, metadata, escrowTokens, streamflowTreasury, streamflowTreasuryTokens, partner, partnerTokens, mint, tokenProgram, withdrawor, systemProgram, }: TopupAccounts) => TransactionInstruction;
|
|
97
|
-
export {};
|