@streamflow/stream 6.0.0-alpha.2 → 6.0.0-alpha.3
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.
|
@@ -17,7 +17,7 @@ export default class SolanaStreamClient extends BaseStreamClient {
|
|
|
17
17
|
* Creates a new stream/vesting contract.
|
|
18
18
|
* All fees are paid by sender (escrow metadata account rent, escrow token account rent, recipient's associated token account rent, Streamflow's service fee).
|
|
19
19
|
*/
|
|
20
|
-
create(data: ICreateStreamData,
|
|
20
|
+
create(data: ICreateStreamData, extParams: ICreateStreamSolanaExt): Promise<ICreateResult>;
|
|
21
21
|
/**
|
|
22
22
|
* Creates a new stream/vesting contract.
|
|
23
23
|
* All fees are paid by sender (escrow metadata account rent, escrow token account rent, recipient's associated token account rent, Streamflow's service fee).
|
|
@@ -37,7 +37,7 @@ export default class SolanaStreamClient extends BaseStreamClient {
|
|
|
37
37
|
*
|
|
38
38
|
* If you are not sure if you should use create or create_unchecked, go for create to be safer.
|
|
39
39
|
*/
|
|
40
|
-
createUnchecked(data: ICreateStreamData,
|
|
40
|
+
createUnchecked(data: ICreateStreamData, extParams: ICreateStreamSolanaExt): Promise<ICreateResult>;
|
|
41
41
|
/**
|
|
42
42
|
* Create Transaction instructions for `createUnchecked`
|
|
43
43
|
*/
|
|
@@ -50,19 +50,19 @@ export default class SolanaStreamClient extends BaseStreamClient {
|
|
|
50
50
|
* Creates multiple stream/vesting contracts.
|
|
51
51
|
* All fees are paid by sender (escrow metadata account rent, escrow token account rent, recipient's associated token account rent, Streamflow's service fee).
|
|
52
52
|
*/
|
|
53
|
-
createMultiple(data: ICreateMultipleStreamData, { sender, metadataPubKeys, isNative }: ICreateStreamSolanaExt): Promise<IMultiTransactionResult>;
|
|
53
|
+
createMultiple(data: ICreateMultipleStreamData, { sender, metadataPubKeys, isNative, computePrice, computeLimit }: ICreateStreamSolanaExt): Promise<IMultiTransactionResult>;
|
|
54
54
|
/**
|
|
55
55
|
* Attempts withdrawing from the specified stream.
|
|
56
56
|
*/
|
|
57
|
-
withdraw({ id, amount }: IWithdrawData,
|
|
57
|
+
withdraw({ id, amount }: IWithdrawData, extParams: IInteractStreamSolanaExt): Promise<ITransactionResult>;
|
|
58
58
|
/**
|
|
59
59
|
* Creates Transaction Instructions for withdrawal
|
|
60
60
|
*/
|
|
61
|
-
|
|
61
|
+
prepareWithdrawInstructions({ id, amount }: IWithdrawData, { invoker, checkTokenAccounts, computePrice, computeLimit }: IInteractStreamSolanaExt): Promise<TransactionInstruction[]>;
|
|
62
62
|
/**
|
|
63
63
|
* Attempts canceling the specified stream.
|
|
64
64
|
*/
|
|
65
|
-
cancel({ id }: ICancelData,
|
|
65
|
+
cancel({ id }: ICancelData, extParams: IInteractStreamSolanaExt): Promise<ITransactionResult>;
|
|
66
66
|
/**
|
|
67
67
|
* Creates Transaction Instructions for cancel
|
|
68
68
|
*/
|
|
@@ -71,7 +71,7 @@ export default class SolanaStreamClient extends BaseStreamClient {
|
|
|
71
71
|
* Attempts changing the stream/vesting contract's recipient (effectively transferring the stream/vesting contract).
|
|
72
72
|
* Potential associated token account rent fee (to make it rent-exempt) is paid by the transaction initiator.
|
|
73
73
|
*/
|
|
74
|
-
transfer({ id, newRecipient }: ITransferData,
|
|
74
|
+
transfer({ id, newRecipient }: ITransferData, extParams: IInteractStreamSolanaExt): Promise<ITransactionResult>;
|
|
75
75
|
/**
|
|
76
76
|
* Attempts changing the stream/vesting contract's recipient (effectively transferring the stream/vesting contract).
|
|
77
77
|
* Potential associated token account rent fee (to make it rent-exempt) is paid by the transaction initiator.
|
|
@@ -80,7 +80,7 @@ export default class SolanaStreamClient extends BaseStreamClient {
|
|
|
80
80
|
/**
|
|
81
81
|
* Tops up stream account with specified amount.
|
|
82
82
|
*/
|
|
83
|
-
topup({ id, amount }: ITopUpData,
|
|
83
|
+
topup({ id, amount }: ITopUpData, extParams: ITopUpStreamSolanaExt): Promise<ITransactionResult>;
|
|
84
84
|
/**
|
|
85
85
|
* Create Transaction instructions for topup
|
|
86
86
|
*/
|
|
@@ -97,7 +97,7 @@ export default class SolanaStreamClient extends BaseStreamClient {
|
|
|
97
97
|
/**
|
|
98
98
|
* Attempts updating the stream auto withdrawal params and amount per period
|
|
99
99
|
*/
|
|
100
|
-
update(data: IUpdateData,
|
|
100
|
+
update(data: IUpdateData, extParams: IInteractStreamSolanaExt): Promise<ITransactionResult>;
|
|
101
101
|
/**
|
|
102
102
|
* Create Transaction instructions for update
|
|
103
103
|
*/
|
|
@@ -168,18 +168,18 @@ var SolanaStreamClient = /** @class */ (function (_super) {
|
|
|
168
168
|
* Creates a new stream/vesting contract.
|
|
169
169
|
* All fees are paid by sender (escrow metadata account rent, escrow token account rent, recipient's associated token account rent, Streamflow's service fee).
|
|
170
170
|
*/
|
|
171
|
-
SolanaStreamClient.prototype.create = function (data,
|
|
171
|
+
SolanaStreamClient.prototype.create = function (data, extParams) {
|
|
172
172
|
return __awaiter(this, void 0, void 0, function () {
|
|
173
173
|
var _a, ixs, metadata, metadataPubKey, _b, tx, hash, signature;
|
|
174
174
|
return __generator(this, function (_c) {
|
|
175
175
|
switch (_c.label) {
|
|
176
|
-
case 0: return [4 /*yield*/, this.prepareCreateInstructions(data,
|
|
176
|
+
case 0: return [4 /*yield*/, this.prepareCreateInstructions(data, extParams)];
|
|
177
177
|
case 1:
|
|
178
178
|
_a = _c.sent(), ixs = _a.ixs, metadata = _a.metadata, metadataPubKey = _a.metadataPubKey;
|
|
179
|
-
return [4 /*yield*/, (0, solana_1.prepareTransaction)(this.connection, ixs,
|
|
179
|
+
return [4 /*yield*/, (0, solana_1.prepareTransaction)(this.connection, ixs, extParams.sender.publicKey, this.getCommitment(), metadata)];
|
|
180
180
|
case 2:
|
|
181
181
|
_b = _c.sent(), tx = _b.tx, hash = _b.hash;
|
|
182
|
-
return [4 /*yield*/, (0, solana_1.signAndExecuteTransaction)(this.connection,
|
|
182
|
+
return [4 /*yield*/, (0, solana_1.signAndExecuteTransaction)(this.connection, extParams.sender, tx, hash)];
|
|
183
183
|
case 3:
|
|
184
184
|
signature = _c.sent();
|
|
185
185
|
return [2 /*return*/, { ixs: ixs, txId: signature, metadataId: metadataPubKey.toBase58() }];
|
|
@@ -288,18 +288,18 @@ var SolanaStreamClient = /** @class */ (function (_super) {
|
|
|
288
288
|
*
|
|
289
289
|
* If you are not sure if you should use create or create_unchecked, go for create to be safer.
|
|
290
290
|
*/
|
|
291
|
-
SolanaStreamClient.prototype.createUnchecked = function (data,
|
|
291
|
+
SolanaStreamClient.prototype.createUnchecked = function (data, extParams) {
|
|
292
292
|
return __awaiter(this, void 0, void 0, function () {
|
|
293
293
|
var _a, ixs, metadata, metadataPubKey, _b, tx, hash, signature;
|
|
294
294
|
return __generator(this, function (_c) {
|
|
295
295
|
switch (_c.label) {
|
|
296
|
-
case 0: return [4 /*yield*/, this.prepareCreateUncheckedInstructions(data,
|
|
296
|
+
case 0: return [4 /*yield*/, this.prepareCreateUncheckedInstructions(data, extParams)];
|
|
297
297
|
case 1:
|
|
298
298
|
_a = _c.sent(), ixs = _a.ixs, metadata = _a.metadata, metadataPubKey = _a.metadataPubKey;
|
|
299
|
-
return [4 /*yield*/, (0, solana_1.prepareTransaction)(this.connection, ixs,
|
|
299
|
+
return [4 /*yield*/, (0, solana_1.prepareTransaction)(this.connection, ixs, extParams.sender.publicKey, this.getCommitment(), metadata)];
|
|
300
300
|
case 2:
|
|
301
301
|
_b = _c.sent(), tx = _b.tx, hash = _b.hash;
|
|
302
|
-
return [4 /*yield*/, (0, solana_1.signAndExecuteTransaction)(this.connection,
|
|
302
|
+
return [4 /*yield*/, (0, solana_1.signAndExecuteTransaction)(this.connection, extParams.sender, tx, hash)];
|
|
303
303
|
case 3:
|
|
304
304
|
signature = _c.sent();
|
|
305
305
|
return [2 /*return*/, { ixs: ixs, txId: signature, metadataId: metadataPubKey.toBase58() }];
|
|
@@ -397,9 +397,9 @@ var SolanaStreamClient = /** @class */ (function (_super) {
|
|
|
397
397
|
* All fees are paid by sender (escrow metadata account rent, escrow token account rent, recipient's associated token account rent, Streamflow's service fee).
|
|
398
398
|
*/
|
|
399
399
|
SolanaStreamClient.prototype.createMultiple = function (data, _a) {
|
|
400
|
-
var sender = _a.sender, metadataPubKeys = _a.metadataPubKeys, _b = _a.isNative, isNative = _b === void 0 ? false : _b;
|
|
400
|
+
var sender = _a.sender, metadataPubKeys = _a.metadataPubKeys, _b = _a.isNative, isNative = _b === void 0 ? false : _b, computePrice = _a.computePrice, computeLimit = _a.computeLimit;
|
|
401
401
|
return __awaiter(this, void 0, void 0, function () {
|
|
402
|
-
var recipients, metadatas, metadataToRecipient, errors, signatures, batch, instructionsBatch, i, recipientData, _c, ixs, metadata, metadataPubKey, commitment, hash, instructionsBatch_1, instructionsBatch_1_1, _d, ixs, metadata, recipient, tx, totalDepositedAmount, nativeInstructions,
|
|
402
|
+
var recipients, metadatas, metadataToRecipient, errors, signatures, batch, instructionsBatch, i, recipientData, _c, ixs, metadata, metadataPubKey, commitment, hash, instructionsBatch_1, instructionsBatch_1_1, _d, ixs, metadata, recipient, tx, totalDepositedAmount, nativeInstructions, tx, signedBatch, prepareTx, responses, signedBatch_1, signedBatch_1_1, batchTx, _e, _f, _g, _h, e_1_1, batchTransactionsCalls, _j, _k, _l, _m, successes, failures;
|
|
403
403
|
var e_2, _o, _p, _q, e_1, _r;
|
|
404
404
|
var _this = this;
|
|
405
405
|
return __generator(this, function (_s) {
|
|
@@ -424,6 +424,8 @@ var SolanaStreamClient = /** @class */ (function (_super) {
|
|
|
424
424
|
return [4 /*yield*/, this.prepareStreamInstructions(recipientData, data, {
|
|
425
425
|
sender: sender,
|
|
426
426
|
metadataPubKeys: metadataPubKeys[i] ? [metadataPubKeys[i]] : undefined,
|
|
427
|
+
computePrice: computePrice,
|
|
428
|
+
computeLimit: computeLimit,
|
|
427
429
|
})];
|
|
428
430
|
case 2:
|
|
429
431
|
_c = _s.sent(), ixs = _c.ixs, metadata = _c.metadata, metadataPubKey = _c.metadataPubKey;
|
|
@@ -469,13 +471,13 @@ var SolanaStreamClient = /** @class */ (function (_super) {
|
|
|
469
471
|
return [4 /*yield*/, (0, solana_1.prepareWrappedAccount)(this.connection, sender.publicKey, totalDepositedAmount)];
|
|
470
472
|
case 6:
|
|
471
473
|
nativeInstructions = _s.sent();
|
|
472
|
-
|
|
474
|
+
tx = (_q = new web3_js_1.Transaction({
|
|
473
475
|
feePayer: sender.publicKey,
|
|
474
476
|
blockhash: hash.blockhash,
|
|
475
477
|
lastValidBlockHeight: hash.lastValidBlockHeight,
|
|
476
478
|
})).add.apply(_q, __spreadArray([], __read(nativeInstructions), false));
|
|
477
479
|
batch.push({
|
|
478
|
-
tx:
|
|
480
|
+
tx: tx,
|
|
479
481
|
recipient: sender.publicKey.toBase58(),
|
|
480
482
|
});
|
|
481
483
|
_s.label = 7;
|
|
@@ -550,22 +552,21 @@ var SolanaStreamClient = /** @class */ (function (_super) {
|
|
|
550
552
|
/**
|
|
551
553
|
* Attempts withdrawing from the specified stream.
|
|
552
554
|
*/
|
|
553
|
-
SolanaStreamClient.prototype.withdraw = function (_a,
|
|
554
|
-
var id = _a.id,
|
|
555
|
-
var invoker = _b.invoker, checkTokenAccounts = _b.checkTokenAccounts;
|
|
555
|
+
SolanaStreamClient.prototype.withdraw = function (_a, extParams) {
|
|
556
|
+
var id = _a.id, _b = _a.amount, amount = _b === void 0 ? constants_2.WITHDRAW_AVAILABLE_AMOUNT : _b;
|
|
556
557
|
return __awaiter(this, void 0, void 0, function () {
|
|
557
|
-
var ixs,
|
|
558
|
-
return __generator(this, function (
|
|
559
|
-
switch (
|
|
560
|
-
case 0: return [4 /*yield*/, this.
|
|
558
|
+
var ixs, _c, tx, hash, signature;
|
|
559
|
+
return __generator(this, function (_d) {
|
|
560
|
+
switch (_d.label) {
|
|
561
|
+
case 0: return [4 /*yield*/, this.prepareWithdrawInstructions({ id: id, amount: amount }, extParams)];
|
|
561
562
|
case 1:
|
|
562
|
-
ixs =
|
|
563
|
-
return [4 /*yield*/, (0, solana_1.prepareTransaction)(this.connection, ixs, invoker.publicKey, this.getCommitment())];
|
|
563
|
+
ixs = _d.sent();
|
|
564
|
+
return [4 /*yield*/, (0, solana_1.prepareTransaction)(this.connection, ixs, extParams.invoker.publicKey, this.getCommitment())];
|
|
564
565
|
case 2:
|
|
565
|
-
|
|
566
|
-
return [4 /*yield*/, (0, solana_1.signAndExecuteTransaction)(this.connection, invoker, tx, hash)];
|
|
566
|
+
_c = _d.sent(), tx = _c.tx, hash = _c.hash;
|
|
567
|
+
return [4 /*yield*/, (0, solana_1.signAndExecuteTransaction)(this.connection, extParams.invoker, tx, hash)];
|
|
567
568
|
case 3:
|
|
568
|
-
signature =
|
|
569
|
+
signature = _d.sent();
|
|
569
570
|
return [2 /*return*/, { ixs: ixs, txId: signature }];
|
|
570
571
|
}
|
|
571
572
|
});
|
|
@@ -574,7 +575,7 @@ var SolanaStreamClient = /** @class */ (function (_super) {
|
|
|
574
575
|
/**
|
|
575
576
|
* Creates Transaction Instructions for withdrawal
|
|
576
577
|
*/
|
|
577
|
-
SolanaStreamClient.prototype.
|
|
578
|
+
SolanaStreamClient.prototype.prepareWithdrawInstructions = function (_a, _b) {
|
|
578
579
|
var id = _a.id, _c = _a.amount, amount = _c === void 0 ? constants_2.WITHDRAW_AVAILABLE_AMOUNT : _c;
|
|
579
580
|
var invoker = _b.invoker, checkTokenAccounts = _b.checkTokenAccounts, computePrice = _b.computePrice, computeLimit = _b.computeLimit;
|
|
580
581
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -627,19 +628,19 @@ var SolanaStreamClient = /** @class */ (function (_super) {
|
|
|
627
628
|
/**
|
|
628
629
|
* Attempts canceling the specified stream.
|
|
629
630
|
*/
|
|
630
|
-
SolanaStreamClient.prototype.cancel = function (_a,
|
|
631
|
+
SolanaStreamClient.prototype.cancel = function (_a, extParams) {
|
|
631
632
|
var id = _a.id;
|
|
632
633
|
return __awaiter(this, void 0, void 0, function () {
|
|
633
634
|
var ixs, _b, tx, hash, signature;
|
|
634
635
|
return __generator(this, function (_c) {
|
|
635
636
|
switch (_c.label) {
|
|
636
|
-
case 0: return [4 /*yield*/, this.prepareCancelInstructions({ id: id },
|
|
637
|
+
case 0: return [4 /*yield*/, this.prepareCancelInstructions({ id: id }, extParams)];
|
|
637
638
|
case 1:
|
|
638
639
|
ixs = _c.sent();
|
|
639
|
-
return [4 /*yield*/, (0, solana_1.prepareTransaction)(this.connection, ixs,
|
|
640
|
+
return [4 /*yield*/, (0, solana_1.prepareTransaction)(this.connection, ixs, extParams.invoker.publicKey, this.getCommitment())];
|
|
640
641
|
case 2:
|
|
641
642
|
_b = _c.sent(), tx = _b.tx, hash = _b.hash;
|
|
642
|
-
return [4 /*yield*/, (0, solana_1.signAndExecuteTransaction)(this.connection,
|
|
643
|
+
return [4 /*yield*/, (0, solana_1.signAndExecuteTransaction)(this.connection, extParams.invoker, tx, hash)];
|
|
643
644
|
case 3:
|
|
644
645
|
signature = _c.sent();
|
|
645
646
|
return [2 /*return*/, { ixs: ixs, txId: signature }];
|
|
@@ -706,19 +707,19 @@ var SolanaStreamClient = /** @class */ (function (_super) {
|
|
|
706
707
|
* Attempts changing the stream/vesting contract's recipient (effectively transferring the stream/vesting contract).
|
|
707
708
|
* Potential associated token account rent fee (to make it rent-exempt) is paid by the transaction initiator.
|
|
708
709
|
*/
|
|
709
|
-
SolanaStreamClient.prototype.transfer = function (_a,
|
|
710
|
+
SolanaStreamClient.prototype.transfer = function (_a, extParams) {
|
|
710
711
|
var id = _a.id, newRecipient = _a.newRecipient;
|
|
711
712
|
return __awaiter(this, void 0, void 0, function () {
|
|
712
713
|
var ixs, _b, tx, hash, signature;
|
|
713
714
|
return __generator(this, function (_c) {
|
|
714
715
|
switch (_c.label) {
|
|
715
|
-
case 0: return [4 /*yield*/, this.prepareTransferInstructions({ id: id, newRecipient: newRecipient },
|
|
716
|
+
case 0: return [4 /*yield*/, this.prepareTransferInstructions({ id: id, newRecipient: newRecipient }, extParams)];
|
|
716
717
|
case 1:
|
|
717
718
|
ixs = _c.sent();
|
|
718
|
-
return [4 /*yield*/, (0, solana_1.prepareTransaction)(this.connection, ixs,
|
|
719
|
+
return [4 /*yield*/, (0, solana_1.prepareTransaction)(this.connection, ixs, extParams.invoker.publicKey, this.getCommitment())];
|
|
719
720
|
case 2:
|
|
720
721
|
_b = _c.sent(), tx = _b.tx, hash = _b.hash;
|
|
721
|
-
return [4 /*yield*/, (0, solana_1.signAndExecuteTransaction)(this.connection,
|
|
722
|
+
return [4 /*yield*/, (0, solana_1.signAndExecuteTransaction)(this.connection, extParams.invoker, tx, hash)];
|
|
722
723
|
case 3:
|
|
723
724
|
signature = _c.sent();
|
|
724
725
|
return [2 /*return*/, { ixs: ixs, txId: signature }];
|
|
@@ -776,19 +777,19 @@ var SolanaStreamClient = /** @class */ (function (_super) {
|
|
|
776
777
|
/**
|
|
777
778
|
* Tops up stream account with specified amount.
|
|
778
779
|
*/
|
|
779
|
-
SolanaStreamClient.prototype.topup = function (_a,
|
|
780
|
+
SolanaStreamClient.prototype.topup = function (_a, extParams) {
|
|
780
781
|
var id = _a.id, amount = _a.amount;
|
|
781
782
|
return __awaiter(this, void 0, void 0, function () {
|
|
782
783
|
var ixs, _b, tx, hash, signature;
|
|
783
784
|
return __generator(this, function (_c) {
|
|
784
785
|
switch (_c.label) {
|
|
785
|
-
case 0: return [4 /*yield*/, this.prepareTopupInstructions({ id: id, amount: amount },
|
|
786
|
+
case 0: return [4 /*yield*/, this.prepareTopupInstructions({ id: id, amount: amount }, extParams)];
|
|
786
787
|
case 1:
|
|
787
788
|
ixs = _c.sent();
|
|
788
|
-
return [4 /*yield*/, (0, solana_1.prepareTransaction)(this.connection, ixs,
|
|
789
|
+
return [4 /*yield*/, (0, solana_1.prepareTransaction)(this.connection, ixs, extParams.invoker.publicKey, this.getCommitment())];
|
|
789
790
|
case 2:
|
|
790
791
|
_b = _c.sent(), tx = _b.tx, hash = _b.hash;
|
|
791
|
-
return [4 /*yield*/, (0, solana_1.signAndExecuteTransaction)(this.connection,
|
|
792
|
+
return [4 /*yield*/, (0, solana_1.signAndExecuteTransaction)(this.connection, extParams.invoker, tx, hash)];
|
|
792
793
|
case 3:
|
|
793
794
|
signature = _c.sent();
|
|
794
795
|
return [2 /*return*/, { ixs: ixs, txId: signature }];
|
|
@@ -926,18 +927,18 @@ var SolanaStreamClient = /** @class */ (function (_super) {
|
|
|
926
927
|
/**
|
|
927
928
|
* Attempts updating the stream auto withdrawal params and amount per period
|
|
928
929
|
*/
|
|
929
|
-
SolanaStreamClient.prototype.update = function (data,
|
|
930
|
+
SolanaStreamClient.prototype.update = function (data, extParams) {
|
|
930
931
|
return __awaiter(this, void 0, void 0, function () {
|
|
931
932
|
var ixs, _a, tx, hash, signature;
|
|
932
933
|
return __generator(this, function (_b) {
|
|
933
934
|
switch (_b.label) {
|
|
934
|
-
case 0: return [4 /*yield*/, this.prepareUpdateInstructions(data,
|
|
935
|
+
case 0: return [4 /*yield*/, this.prepareUpdateInstructions(data, extParams)];
|
|
935
936
|
case 1:
|
|
936
937
|
ixs = _b.sent();
|
|
937
|
-
return [4 /*yield*/, (0, solana_1.prepareTransaction)(this.connection, ixs,
|
|
938
|
+
return [4 /*yield*/, (0, solana_1.prepareTransaction)(this.connection, ixs, extParams.invoker.publicKey, this.getCommitment())];
|
|
938
939
|
case 2:
|
|
939
940
|
_a = _b.sent(), tx = _a.tx, hash = _a.hash;
|
|
940
|
-
return [4 /*yield*/, (0, solana_1.signAndExecuteTransaction)(this.connection,
|
|
941
|
+
return [4 /*yield*/, (0, solana_1.signAndExecuteTransaction)(this.connection, extParams.invoker, tx, hash)];
|
|
941
942
|
case 3:
|
|
942
943
|
signature = _b.sent();
|
|
943
944
|
return [2 /*return*/, {
|
|
@@ -1024,14 +1025,14 @@ var SolanaStreamClient = /** @class */ (function (_super) {
|
|
|
1024
1025
|
/**
|
|
1025
1026
|
* Forms instructions from params, creates a raw transaction and fetch recent blockhash.
|
|
1026
1027
|
*/
|
|
1027
|
-
SolanaStreamClient.prototype.prepareStreamInstructions = function (recipient, streamParams,
|
|
1028
|
+
SolanaStreamClient.prototype.prepareStreamInstructions = function (recipient, streamParams, extParams) {
|
|
1028
1029
|
return __awaiter(this, void 0, void 0, function () {
|
|
1029
1030
|
var mint, start, period, cliff, canTopup, cancelableBySender, cancelableByRecipient, transferableBySender, transferableByRecipient, _a, automaticWithdrawal, _b, withdrawalFrequency, partner, sender, metadataPubKeys, ixs, recipientPublicKey, mintPublicKey, _c, metadata, metadataPubKey, _d, escrowTokens, senderTokens, recipientTokens, streamflowTreasuryTokens, partnerPublicKey, partnerTokens;
|
|
1030
1031
|
return __generator(this, function (_e) {
|
|
1031
1032
|
switch (_e.label) {
|
|
1032
1033
|
case 0:
|
|
1033
1034
|
mint = streamParams.tokenId, start = streamParams.start, period = streamParams.period, cliff = streamParams.cliff, canTopup = streamParams.canTopup, cancelableBySender = streamParams.cancelableBySender, cancelableByRecipient = streamParams.cancelableByRecipient, transferableBySender = streamParams.transferableBySender, transferableByRecipient = streamParams.transferableByRecipient, _a = streamParams.automaticWithdrawal, automaticWithdrawal = _a === void 0 ? false : _a, _b = streamParams.withdrawalFrequency, withdrawalFrequency = _b === void 0 ? 0 : _b, partner = streamParams.partner;
|
|
1034
|
-
sender =
|
|
1035
|
+
sender = extParams.sender, metadataPubKeys = extParams.metadataPubKeys;
|
|
1035
1036
|
if (!sender.publicKey) {
|
|
1036
1037
|
throw new Error("Sender's PublicKey is not available, check passed wallet adapter!");
|
|
1037
1038
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamflow/stream",
|
|
3
|
-
"version": "6.0.0-alpha.
|
|
3
|
+
"version": "6.0.0-alpha.3",
|
|
4
4
|
"description": "JavaScript SDK to interact with Streamflow protocol.",
|
|
5
5
|
"homepage": "https://github.com/streamflow-finance/js-sdk/",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
"lint": "eslint --fix .",
|
|
36
36
|
"prepublishOnly": "npm run lint && npm test && npm run build"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "4f5eed327dda8e1c9d5c3ad74046aff4b99a80ed",
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@streamflow/eslint-config": "6.0.0-alpha.
|
|
40
|
+
"@streamflow/eslint-config": "6.0.0-alpha.3",
|
|
41
41
|
"@types/bn.js": "5.1.1",
|
|
42
42
|
"@types/ethereum-checksum-address": "^0.0.0",
|
|
43
43
|
"@types/jest": "29.2.4",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@solana/spl-token": "0.3.6",
|
|
55
55
|
"@solana/wallet-adapter-base": "0.9.19",
|
|
56
56
|
"@solana/web3.js": "1.70.1",
|
|
57
|
-
"@streamflow/common": "6.0.0-alpha.
|
|
57
|
+
"@streamflow/common": "6.0.0-alpha.3",
|
|
58
58
|
"@suiet/wallet-kit": "0.2.22",
|
|
59
59
|
"aptos": "1.4.0",
|
|
60
60
|
"bn.js": "5.2.1",
|