@streamflow/stream 3.0.9 → 3.0.10
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/StreamClient.d.ts +31 -0
- package/dist/StreamClient.js +115 -0
- package/dist/instructions.d.ts +32 -0
- package/dist/instructions.js +52 -1
- package/dist/layout.d.ts +4 -0
- package/dist/layout.js +24 -1
- package/package.json +1 -1
package/dist/StreamClient.d.ts
CHANGED
|
@@ -36,6 +36,37 @@ export default class StreamClient {
|
|
|
36
36
|
* @param {string | null} [data.partner = null] - Partner's wallet address (optional).
|
|
37
37
|
*/
|
|
38
38
|
create({ sender, recipient, mint, start, depositedAmount, period, cliff, cliffAmount, amountPerPeriod, name, canTopup, cancelableBySender, cancelableByRecipient, transferableBySender, transferableByRecipient, automaticWithdrawal, withdrawalFrequency, partner, }: CreateParams): Promise<CreateResponse>;
|
|
39
|
+
/**
|
|
40
|
+
* Creates a new stream/vesting contract using unchecked instruction.
|
|
41
|
+
*
|
|
42
|
+
* Unchecked instruction differes from the regular in:
|
|
43
|
+
* - does not check for initialized associated token account (wallets with no control over their ATA should not be used
|
|
44
|
+
* as sender/recipient/partner or there are risks of funds being locked in the contract)
|
|
45
|
+
* - initialized contract PDA off chain
|
|
46
|
+
*
|
|
47
|
+
* If you are not sure if you should use create or create_unchecked, go for create to be safer.
|
|
48
|
+
*
|
|
49
|
+
* @param {CreateParams} data
|
|
50
|
+
* @param {Wallet | Keypair} data.sender - Wallet signing the transaction. Its address should match the authorized wallet (sender) or transaction will fail.
|
|
51
|
+
* @param {string} data.recipient - Solana address of the recipient. Associated token account will be derived using this address and token mint address.
|
|
52
|
+
* @param {string} data.mint - SPL Token mint.
|
|
53
|
+
* @param {number} data.start - Timestamp (in seconds) when the stream/token vesting starts.
|
|
54
|
+
* @param {BN} data.depositedAmount - Initially deposited amount of tokens (in the smallest units).
|
|
55
|
+
* @param {number} data.period - Time step (period) in seconds per which the unlocking occurs.
|
|
56
|
+
* @param {number} data.cliff - Vesting contract "cliff" timestamp in seconds.
|
|
57
|
+
* @param {BN} data.cliffAmount - Amount unlocked at the "cliff".
|
|
58
|
+
* @param {BN} data.amountPerPeriod - Amount unlocked per each period.
|
|
59
|
+
* @param {string} data.name - Stream name/subject.
|
|
60
|
+
* @param {boolean} data.canTopup - TRUE for streams, FALSE for vesting contracts.
|
|
61
|
+
* @param {boolean} data.cancelableBySender - Whether or not sender can cancel the stream.
|
|
62
|
+
* @param {boolean} data.cancelableByRecipient - Whether or not recipient can cancel the stream.
|
|
63
|
+
* @param {boolean} data.transferableBySender - Whether or not sender can transfer the stream.
|
|
64
|
+
* @param {boolean} data.transferableByRecipient - Whether or not recipient can transfer the stream.
|
|
65
|
+
* @param {boolean} data.automaticWithdrawal - Whether or not a 3rd party can initiate withdraw in the name of recipient.
|
|
66
|
+
* @param {number} [data.withdrawalFrequency = 0] - Relevant when automatic withdrawal is enabled. If greater than 0 our withdrawor will take care of withdrawals. If equal to 0 our withdrawor will skip, but everyone else can initiate withdrawals.
|
|
67
|
+
* @param {string | null} [data.partner = null] - Partner's wallet address (optional).
|
|
68
|
+
*/
|
|
69
|
+
createUnchecked({ sender, recipient, mint, start, depositedAmount, period, cliff, cliffAmount, amountPerPeriod, name, canTopup, cancelableBySender, cancelableByRecipient, transferableBySender, transferableByRecipient, automaticWithdrawal, withdrawalFrequency, partner, }: CreateParams): Promise<CreateResponse>;
|
|
39
70
|
/**
|
|
40
71
|
* Creates a new stream/vesting contract.
|
|
41
72
|
* All fees are paid by sender (escrow metadata account rent, escrow token account rent, recipient's associated token account rent, Streamflow's service fee).
|
package/dist/StreamClient.js
CHANGED
|
@@ -98,6 +98,7 @@ var constants_1 = require("./constants");
|
|
|
98
98
|
var instructions_1 = require("./instructions");
|
|
99
99
|
var common_1 = require("@project-serum/common");
|
|
100
100
|
var bs58_1 = require("@project-serum/anchor/dist/cjs/utils/bytes/bs58");
|
|
101
|
+
var METADATA_ACC_SIZE = 1104;
|
|
101
102
|
var StreamClient = /** @class */ (function () {
|
|
102
103
|
/**
|
|
103
104
|
* Create Stream instance
|
|
@@ -228,6 +229,120 @@ var StreamClient = /** @class */ (function () {
|
|
|
228
229
|
});
|
|
229
230
|
});
|
|
230
231
|
};
|
|
232
|
+
/**
|
|
233
|
+
* Creates a new stream/vesting contract using unchecked instruction.
|
|
234
|
+
*
|
|
235
|
+
* Unchecked instruction differes from the regular in:
|
|
236
|
+
* - does not check for initialized associated token account (wallets with no control over their ATA should not be used
|
|
237
|
+
* as sender/recipient/partner or there are risks of funds being locked in the contract)
|
|
238
|
+
* - initialized contract PDA off chain
|
|
239
|
+
*
|
|
240
|
+
* If you are not sure if you should use create or create_unchecked, go for create to be safer.
|
|
241
|
+
*
|
|
242
|
+
* @param {CreateParams} data
|
|
243
|
+
* @param {Wallet | Keypair} data.sender - Wallet signing the transaction. Its address should match the authorized wallet (sender) or transaction will fail.
|
|
244
|
+
* @param {string} data.recipient - Solana address of the recipient. Associated token account will be derived using this address and token mint address.
|
|
245
|
+
* @param {string} data.mint - SPL Token mint.
|
|
246
|
+
* @param {number} data.start - Timestamp (in seconds) when the stream/token vesting starts.
|
|
247
|
+
* @param {BN} data.depositedAmount - Initially deposited amount of tokens (in the smallest units).
|
|
248
|
+
* @param {number} data.period - Time step (period) in seconds per which the unlocking occurs.
|
|
249
|
+
* @param {number} data.cliff - Vesting contract "cliff" timestamp in seconds.
|
|
250
|
+
* @param {BN} data.cliffAmount - Amount unlocked at the "cliff".
|
|
251
|
+
* @param {BN} data.amountPerPeriod - Amount unlocked per each period.
|
|
252
|
+
* @param {string} data.name - Stream name/subject.
|
|
253
|
+
* @param {boolean} data.canTopup - TRUE for streams, FALSE for vesting contracts.
|
|
254
|
+
* @param {boolean} data.cancelableBySender - Whether or not sender can cancel the stream.
|
|
255
|
+
* @param {boolean} data.cancelableByRecipient - Whether or not recipient can cancel the stream.
|
|
256
|
+
* @param {boolean} data.transferableBySender - Whether or not sender can transfer the stream.
|
|
257
|
+
* @param {boolean} data.transferableByRecipient - Whether or not recipient can transfer the stream.
|
|
258
|
+
* @param {boolean} data.automaticWithdrawal - Whether or not a 3rd party can initiate withdraw in the name of recipient.
|
|
259
|
+
* @param {number} [data.withdrawalFrequency = 0] - Relevant when automatic withdrawal is enabled. If greater than 0 our withdrawor will take care of withdrawals. If equal to 0 our withdrawor will skip, but everyone else can initiate withdrawals.
|
|
260
|
+
* @param {string | null} [data.partner = null] - Partner's wallet address (optional).
|
|
261
|
+
*/
|
|
262
|
+
StreamClient.prototype.createUnchecked = function (_a) {
|
|
263
|
+
var sender = _a.sender, recipient = _a.recipient, mint = _a.mint, start = _a.start, depositedAmount = _a.depositedAmount, period = _a.period, cliff = _a.cliff, cliffAmount = _a.cliffAmount, amountPerPeriod = _a.amountPerPeriod, name = _a.name, canTopup = _a.canTopup, cancelableBySender = _a.cancelableBySender, cancelableByRecipient = _a.cancelableByRecipient, transferableBySender = _a.transferableBySender, transferableByRecipient = _a.transferableByRecipient, _b = _a.automaticWithdrawal, automaticWithdrawal = _b === void 0 ? false : _b, _c = _a.withdrawalFrequency, withdrawalFrequency = _c === void 0 ? 0 : _c, _d = _a.partner, partner = _d === void 0 ? null : _d;
|
|
264
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
265
|
+
var mintPublicKey, recipientPublicKey, metadata, rentToExempt, createMetadataInstruction, _e, escrowTokens, senderTokens, partnerPublicKey, createInstruction, commitment, ixs, hash, tx, signature;
|
|
266
|
+
var _f;
|
|
267
|
+
return __generator(this, function (_g) {
|
|
268
|
+
switch (_g.label) {
|
|
269
|
+
case 0:
|
|
270
|
+
mintPublicKey = new web3_js_1.PublicKey(mint);
|
|
271
|
+
recipientPublicKey = new web3_js_1.PublicKey(recipient);
|
|
272
|
+
metadata = web3_js_1.Keypair.generate();
|
|
273
|
+
return [4 /*yield*/, this.connection.getMinimumBalanceForRentExemption(METADATA_ACC_SIZE)];
|
|
274
|
+
case 1:
|
|
275
|
+
rentToExempt = _g.sent();
|
|
276
|
+
createMetadataInstruction = web3_js_1.SystemProgram.createAccount({
|
|
277
|
+
programId: this.programId,
|
|
278
|
+
space: METADATA_ACC_SIZE,
|
|
279
|
+
lamports: rentToExempt,
|
|
280
|
+
fromPubkey: sender === null || sender === void 0 ? void 0 : sender.publicKey,
|
|
281
|
+
newAccountPubkey: metadata.publicKey,
|
|
282
|
+
});
|
|
283
|
+
return [4 /*yield*/, web3_js_1.PublicKey.findProgramAddress([buffer_1.Buffer.from("strm"), metadata.publicKey.toBuffer()], this.programId)];
|
|
284
|
+
case 2:
|
|
285
|
+
_e = __read.apply(void 0, [_g.sent(), 1]), escrowTokens = _e[0];
|
|
286
|
+
return [4 /*yield*/, ata(mintPublicKey, sender.publicKey)];
|
|
287
|
+
case 3:
|
|
288
|
+
senderTokens = _g.sent();
|
|
289
|
+
partnerPublicKey = partner
|
|
290
|
+
? new web3_js_1.PublicKey(partner)
|
|
291
|
+
: constants_1.STREAMFLOW_TREASURY_PUBLIC_KEY;
|
|
292
|
+
createInstruction = (0, instructions_1.createUncheckedStreamInstruction)({
|
|
293
|
+
start: new bn_js_1.default(start),
|
|
294
|
+
depositedAmount: depositedAmount,
|
|
295
|
+
period: new bn_js_1.default(period),
|
|
296
|
+
amountPerPeriod: amountPerPeriod,
|
|
297
|
+
cliff: new bn_js_1.default(cliff),
|
|
298
|
+
cliffAmount: cliffAmount,
|
|
299
|
+
cancelableBySender: cancelableBySender,
|
|
300
|
+
cancelableByRecipient: cancelableByRecipient,
|
|
301
|
+
automaticWithdrawal: automaticWithdrawal,
|
|
302
|
+
transferableBySender: transferableBySender,
|
|
303
|
+
transferableByRecipient: transferableByRecipient,
|
|
304
|
+
canTopup: canTopup,
|
|
305
|
+
name: name,
|
|
306
|
+
withdrawFrequency: new bn_js_1.default(automaticWithdrawal ? withdrawalFrequency : period),
|
|
307
|
+
recipient: recipientPublicKey,
|
|
308
|
+
partner: partnerPublicKey,
|
|
309
|
+
}, this.programId, {
|
|
310
|
+
sender: sender.publicKey,
|
|
311
|
+
senderTokens: senderTokens,
|
|
312
|
+
metadata: metadata.publicKey,
|
|
313
|
+
escrowTokens: escrowTokens,
|
|
314
|
+
mint: new web3_js_1.PublicKey(mint),
|
|
315
|
+
feeOracle: constants_1.FEE_ORACLE_PUBLIC_KEY,
|
|
316
|
+
rent: web3_js_1.SYSVAR_RENT_PUBKEY,
|
|
317
|
+
timelockProgram: this.programId,
|
|
318
|
+
tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
|
|
319
|
+
withdrawor: constants_1.WITHDRAWOR_PUBLIC_KEY,
|
|
320
|
+
systemProgram: web3_js_1.SystemProgram.programId,
|
|
321
|
+
});
|
|
322
|
+
commitment = typeof this.commitment == "string"
|
|
323
|
+
? this.commitment
|
|
324
|
+
: this.commitment.commitment;
|
|
325
|
+
ixs = [
|
|
326
|
+
createMetadataInstruction,
|
|
327
|
+
createInstruction,
|
|
328
|
+
];
|
|
329
|
+
return [4 /*yield*/, this.connection.getLatestBlockhash(commitment)];
|
|
330
|
+
case 4:
|
|
331
|
+
hash = _g.sent();
|
|
332
|
+
tx = (_f = new web3_js_1.Transaction({
|
|
333
|
+
feePayer: sender.publicKey,
|
|
334
|
+
blockhash: hash.blockhash,
|
|
335
|
+
lastValidBlockHeight: hash.lastValidBlockHeight,
|
|
336
|
+
})).add.apply(_f, __spreadArray([], __read(ixs), false));
|
|
337
|
+
tx.partialSign(metadata);
|
|
338
|
+
return [4 /*yield*/, this.sign(sender, tx, hash)];
|
|
339
|
+
case 5:
|
|
340
|
+
signature = _g.sent();
|
|
341
|
+
return [2 /*return*/, { ixs: ixs, tx: signature, metadata: metadata }];
|
|
342
|
+
}
|
|
343
|
+
});
|
|
344
|
+
});
|
|
345
|
+
};
|
|
231
346
|
/**
|
|
232
347
|
* Creates a new stream/vesting contract.
|
|
233
348
|
* All fees are paid by sender (escrow metadata account rent, escrow token account rent, recipient's associated token account rent, Streamflow's service fee).
|
package/dist/instructions.d.ts
CHANGED
|
@@ -37,6 +37,38 @@ interface CreateStreamAccounts {
|
|
|
37
37
|
systemProgram: PublicKey;
|
|
38
38
|
}
|
|
39
39
|
export declare const createStreamInstruction: (data: CreateStreamData, programId: PublicKey, accounts: CreateStreamAccounts) => TransactionInstruction;
|
|
40
|
+
interface CreateUncheckedStreamData {
|
|
41
|
+
start: BN;
|
|
42
|
+
depositedAmount: BN;
|
|
43
|
+
period: BN;
|
|
44
|
+
amountPerPeriod: BN;
|
|
45
|
+
cliff: BN;
|
|
46
|
+
cliffAmount: BN;
|
|
47
|
+
cancelableBySender: boolean;
|
|
48
|
+
cancelableByRecipient: boolean;
|
|
49
|
+
automaticWithdrawal: boolean;
|
|
50
|
+
transferableBySender: boolean;
|
|
51
|
+
transferableByRecipient: boolean;
|
|
52
|
+
canTopup: boolean;
|
|
53
|
+
name: string;
|
|
54
|
+
withdrawFrequency: BN;
|
|
55
|
+
recipient: PublicKey;
|
|
56
|
+
partner: PublicKey;
|
|
57
|
+
}
|
|
58
|
+
interface CreateUncheckedStreamAccounts {
|
|
59
|
+
sender: PublicKey;
|
|
60
|
+
senderTokens: PublicKey;
|
|
61
|
+
metadata: PublicKey;
|
|
62
|
+
escrowTokens: PublicKey;
|
|
63
|
+
mint: PublicKey;
|
|
64
|
+
feeOracle: PublicKey;
|
|
65
|
+
rent: PublicKey;
|
|
66
|
+
timelockProgram: PublicKey;
|
|
67
|
+
tokenProgram: PublicKey;
|
|
68
|
+
withdrawor: PublicKey;
|
|
69
|
+
systemProgram: PublicKey;
|
|
70
|
+
}
|
|
71
|
+
export declare const createUncheckedStreamInstruction: (data: CreateUncheckedStreamData, programId: PublicKey, accounts: CreateUncheckedStreamAccounts) => TransactionInstruction;
|
|
40
72
|
interface WithdrawAccounts {
|
|
41
73
|
authority: PublicKey;
|
|
42
74
|
recipient: PublicKey;
|
package/dist/instructions.js
CHANGED
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.topupStreamInstruction = exports.transferStreamInstruction = exports.cancelStreamInstruction = exports.withdrawStreamInstruction = exports.createStreamInstruction = void 0;
|
|
26
|
+
exports.topupStreamInstruction = exports.transferStreamInstruction = exports.cancelStreamInstruction = exports.withdrawStreamInstruction = exports.createUncheckedStreamInstruction = exports.createStreamInstruction = void 0;
|
|
27
27
|
var buffer_1 = require("buffer");
|
|
28
28
|
var web3_js_1 = require("@solana/web3.js");
|
|
29
29
|
var js_sha256_1 = require("js-sha256");
|
|
@@ -94,6 +94,57 @@ var createStreamInstruction = function (data, programId, accounts) {
|
|
|
94
94
|
});
|
|
95
95
|
};
|
|
96
96
|
exports.createStreamInstruction = createStreamInstruction;
|
|
97
|
+
var createUncheckedStreamInstruction = function (data, programId, accounts) {
|
|
98
|
+
var keys = [
|
|
99
|
+
{ pubkey: accounts.sender, isSigner: true, isWritable: true },
|
|
100
|
+
{ pubkey: accounts.senderTokens, isSigner: false, isWritable: true },
|
|
101
|
+
{ pubkey: accounts.metadata, isSigner: false, isWritable: true },
|
|
102
|
+
{ pubkey: accounts.escrowTokens, isSigner: false, isWritable: true },
|
|
103
|
+
{ pubkey: accounts.withdrawor, isSigner: false, isWritable: true },
|
|
104
|
+
{ pubkey: accounts.mint, isSigner: false, isWritable: false },
|
|
105
|
+
{ pubkey: accounts.feeOracle, isSigner: false, isWritable: false },
|
|
106
|
+
{ pubkey: accounts.rent, isSigner: false, isWritable: false },
|
|
107
|
+
{ pubkey: accounts.timelockProgram, isSigner: false, isWritable: false },
|
|
108
|
+
{ pubkey: accounts.tokenProgram, isSigner: false, isWritable: false },
|
|
109
|
+
{ pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
|
|
110
|
+
];
|
|
111
|
+
var bufferData = buffer_1.Buffer.alloc(Layout.createUncheckedStreamLayout.span);
|
|
112
|
+
var encodedUIntArray = new TextEncoder().encode(data.name);
|
|
113
|
+
var streamNameBuffer = buffer_1.Buffer.alloc(64).fill(encodedUIntArray, 0, encodedUIntArray.byteLength);
|
|
114
|
+
var decodedData = {
|
|
115
|
+
start_time: data.start.toArrayLike(buffer_1.Buffer, "le", 8),
|
|
116
|
+
net_amount_deposited: data.depositedAmount.toArrayLike(buffer_1.Buffer, "le", 8),
|
|
117
|
+
period: data.period.toArrayLike(buffer_1.Buffer, "le", 8),
|
|
118
|
+
amount_per_period: data.amountPerPeriod.toArrayLike(buffer_1.Buffer, "le", 8),
|
|
119
|
+
cliff: data.cliff.toArrayLike(buffer_1.Buffer, "le", 8),
|
|
120
|
+
cliff_amount: data.cliffAmount.toArrayLike(buffer_1.Buffer, "le", 8),
|
|
121
|
+
cancelable_by_sender: data.cancelableBySender,
|
|
122
|
+
cancelable_by_recipient: data.cancelableByRecipient,
|
|
123
|
+
automatic_withdrawal: data.automaticWithdrawal,
|
|
124
|
+
transferable_by_sender: data.transferableBySender,
|
|
125
|
+
transferable_by_recipient: data.transferableByRecipient,
|
|
126
|
+
can_topup: data.canTopup,
|
|
127
|
+
stream_name: streamNameBuffer,
|
|
128
|
+
withdraw_frequency: data.withdrawFrequency.toArrayLike(buffer_1.Buffer, "le", 8),
|
|
129
|
+
recipient: data.recipient.toBuffer(),
|
|
130
|
+
partner: data.partner.toBuffer(),
|
|
131
|
+
pausable: buffer_1.Buffer.alloc(1),
|
|
132
|
+
can_update_rate: buffer_1.Buffer.alloc(1),
|
|
133
|
+
};
|
|
134
|
+
var encodeLength = Layout.createUncheckedStreamLayout.encode(decodedData, bufferData);
|
|
135
|
+
bufferData = bufferData.slice(0, encodeLength);
|
|
136
|
+
bufferData = buffer_1.Buffer.concat([
|
|
137
|
+
buffer_1.Buffer.from(js_sha256_1.sha256.digest("global:create_unchecked")).slice(0, 8),
|
|
138
|
+
bufferData,
|
|
139
|
+
buffer_1.Buffer.alloc(10),
|
|
140
|
+
]);
|
|
141
|
+
return new web3_js_1.TransactionInstruction({
|
|
142
|
+
keys: keys,
|
|
143
|
+
programId: programId,
|
|
144
|
+
data: bufferData,
|
|
145
|
+
});
|
|
146
|
+
};
|
|
147
|
+
exports.createUncheckedStreamInstruction = createUncheckedStreamInstruction;
|
|
97
148
|
var withdrawStreamInstruction = function (amount, programId, _a) {
|
|
98
149
|
var authority = _a.authority, recipient = _a.recipient, recipientTokens = _a.recipientTokens, metadata = _a.metadata, escrowTokens = _a.escrowTokens, streamflowTreasury = _a.streamflowTreasury, streamflowTreasuryTokens = _a.streamflowTreasuryTokens, partner = _a.partner, partnerTokens = _a.partnerTokens, mint = _a.mint, tokenProgram = _a.tokenProgram;
|
|
99
150
|
var keys = [
|
package/dist/layout.d.ts
CHANGED
|
@@ -7,6 +7,10 @@ export declare const streamLayout: typeof BufferLayout.Structure;
|
|
|
7
7
|
* Create stream instruction layout
|
|
8
8
|
*/
|
|
9
9
|
export declare const createStreamLayout: typeof BufferLayout.Structure;
|
|
10
|
+
/**
|
|
11
|
+
* Create unchecked stream instruction layout
|
|
12
|
+
*/
|
|
13
|
+
export declare const createUncheckedStreamLayout: typeof BufferLayout.Structure;
|
|
10
14
|
/**
|
|
11
15
|
* Withdraw stream instruction layout
|
|
12
16
|
*/
|
package/dist/layout.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.topupStreamLayout = exports.withdrawStreamLayout = exports.createStreamLayout = exports.streamLayout = void 0;
|
|
3
|
+
exports.topupStreamLayout = exports.withdrawStreamLayout = exports.createUncheckedStreamLayout = exports.createStreamLayout = exports.streamLayout = void 0;
|
|
4
4
|
var BufferLayout = require("buffer-layout");
|
|
5
5
|
/**
|
|
6
6
|
* Stream layout
|
|
@@ -63,6 +63,29 @@ exports.createStreamLayout = BufferLayout.struct([
|
|
|
63
63
|
BufferLayout.blob(64, "stream_name"),
|
|
64
64
|
BufferLayout.blob(8, "withdraw_frequency"),
|
|
65
65
|
]);
|
|
66
|
+
/**
|
|
67
|
+
* Create unchecked stream instruction layout
|
|
68
|
+
*/
|
|
69
|
+
exports.createUncheckedStreamLayout = BufferLayout.struct([
|
|
70
|
+
BufferLayout.blob(8, "start_time"),
|
|
71
|
+
BufferLayout.blob(8, "net_amount_deposited"),
|
|
72
|
+
BufferLayout.blob(8, "period"),
|
|
73
|
+
BufferLayout.blob(8, "amount_per_period"),
|
|
74
|
+
BufferLayout.blob(8, "cliff"),
|
|
75
|
+
BufferLayout.blob(8, "cliff_amount"),
|
|
76
|
+
BufferLayout.u8("cancelable_by_sender"),
|
|
77
|
+
BufferLayout.u8("cancelable_by_recipient"),
|
|
78
|
+
BufferLayout.u8("automatic_withdrawal"),
|
|
79
|
+
BufferLayout.u8("transferable_by_sender"),
|
|
80
|
+
BufferLayout.u8("transferable_by_recipient"),
|
|
81
|
+
BufferLayout.u8("can_topup"),
|
|
82
|
+
BufferLayout.blob(64, "stream_name"),
|
|
83
|
+
BufferLayout.blob(8, "withdraw_frequency"),
|
|
84
|
+
BufferLayout.blob(32, "recipient"),
|
|
85
|
+
BufferLayout.blob(32, "partner"),
|
|
86
|
+
BufferLayout.u8("pausable"),
|
|
87
|
+
BufferLayout.u8("can_update_rate"),
|
|
88
|
+
]);
|
|
66
89
|
/**
|
|
67
90
|
* Withdraw stream instruction layout
|
|
68
91
|
*/
|
package/package.json
CHANGED