@streamflow/stream 4.0.0-beta.0 → 4.0.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/dist/solana/StreamClient.js +6 -5
- package/dist/solana/utils.js +10 -12
- package/package.json +1 -1
|
@@ -757,25 +757,26 @@ var SolanaStreamClient = /** @class */ (function (_super) {
|
|
|
757
757
|
};
|
|
758
758
|
SolanaStreamClient.prototype.sign = function (invoker, tx, hash) {
|
|
759
759
|
return __awaiter(this, void 0, void 0, function () {
|
|
760
|
-
var rawTx, confirmationStrategy, signature;
|
|
760
|
+
var signedTx, rawTx, confirmationStrategy, signature;
|
|
761
761
|
return __generator(this, function (_a) {
|
|
762
762
|
switch (_a.label) {
|
|
763
763
|
case 0:
|
|
764
764
|
if (!(0, utils_1.isSignerWallet)(invoker)) return [3 /*break*/, 2];
|
|
765
765
|
return [4 /*yield*/, invoker.signTransaction(tx)];
|
|
766
766
|
case 1:
|
|
767
|
-
_a.sent();
|
|
767
|
+
signedTx = _a.sent();
|
|
768
768
|
return [3 /*break*/, 3];
|
|
769
769
|
case 2:
|
|
770
770
|
tx.partialSign(invoker);
|
|
771
|
+
signedTx = tx;
|
|
771
772
|
_a.label = 3;
|
|
772
773
|
case 3:
|
|
773
|
-
rawTx =
|
|
774
|
-
if (!hash.lastValidBlockHeight || !
|
|
774
|
+
rawTx = signedTx.serialize();
|
|
775
|
+
if (!hash.lastValidBlockHeight || !signedTx.signature || !hash.blockhash)
|
|
775
776
|
throw Error("Error with transaction parameters.");
|
|
776
777
|
confirmationStrategy = {
|
|
777
778
|
lastValidBlockHeight: hash.lastValidBlockHeight,
|
|
778
|
-
signature: bs58_1.default.encode(
|
|
779
|
+
signature: bs58_1.default.encode(signedTx.signature),
|
|
779
780
|
blockhash: hash.blockhash,
|
|
780
781
|
};
|
|
781
782
|
return [4 /*yield*/, (0, web3_js_1.sendAndConfirmRawTransaction)(this.connection, rawTx, confirmationStrategy)];
|
package/dist/solana/utils.js
CHANGED
|
@@ -195,28 +195,26 @@ exports.isSignerWallet = isSignerWallet;
|
|
|
195
195
|
*/
|
|
196
196
|
function signAllTransactionWithRecipients(sender, items) {
|
|
197
197
|
return __awaiter(this, void 0, void 0, function () {
|
|
198
|
-
var
|
|
198
|
+
var isKeypair, isWallet, signedTxs_1;
|
|
199
199
|
return __generator(this, function (_a) {
|
|
200
200
|
switch (_a.label) {
|
|
201
201
|
case 0:
|
|
202
|
-
signed_batch = [];
|
|
203
202
|
isKeypair = sender instanceof web3_js_1.Keypair;
|
|
204
203
|
isWallet = isSignerWallet(sender);
|
|
205
|
-
if (!isKeypair && !isWallet)
|
|
206
|
-
return [2 /*return*/, signed_batch];
|
|
207
204
|
if (!isKeypair) return [3 /*break*/, 1];
|
|
208
|
-
items.map(function (t) {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
return [3 /*break*/, 3];
|
|
205
|
+
return [2 /*return*/, items.map(function (t) {
|
|
206
|
+
t.tx.partialSign(sender);
|
|
207
|
+
return { tx: t.tx, recipient: t.recipient };
|
|
208
|
+
})];
|
|
213
209
|
case 1:
|
|
214
210
|
if (!isWallet) return [3 /*break*/, 3];
|
|
215
211
|
return [4 /*yield*/, sender.signAllTransactions(items.map(function (t) { return t.tx; }))];
|
|
216
212
|
case 2:
|
|
217
|
-
_a.sent();
|
|
218
|
-
|
|
219
|
-
case 3:
|
|
213
|
+
signedTxs_1 = _a.sent();
|
|
214
|
+
return [2 /*return*/, items.map(function (item, index) { return (__assign(__assign({}, item), { tx: signedTxs_1[index] })); })];
|
|
215
|
+
case 3:
|
|
216
|
+
// If signer is not passed
|
|
217
|
+
return [2 /*return*/, []];
|
|
220
218
|
}
|
|
221
219
|
});
|
|
222
220
|
});
|
package/package.json
CHANGED