@streamflow/stream 6.3.2 → 6.3.4
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/common/GenericStreamClient.d.ts +3 -0
- package/dist/common/GenericStreamClient.js +1 -1
- package/dist/solana/StreamClient.d.ts +3 -1
- package/dist/solana/StreamClient.js +39 -25
- package/dist/solana/utils.d.ts +4 -3
- package/dist/solana/utils.js +4 -3
- package/dist/sui/constants.js +10 -10
- package/dist/sui/wallet.d.ts +1 -1
- package/dist/sui/wallet.js +3 -2
- package/package.json +6 -5
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Commitment, ConnectionConfig } from "@solana/web3.js";
|
|
2
2
|
import { Signer } from "ethers";
|
|
3
|
+
import PQueue from "p-queue";
|
|
3
4
|
import { BaseStreamClient } from "./BaseStreamClient";
|
|
4
5
|
import { ICancelData, IChain, ICluster, ICreateMultipleStreamData, ICreateStreamData, IGetOneData, ITopUpData, ITransferData, IUpdateData, IWithdrawData, ITransactionResult, IMultiTransactionResult, ICreateResult, IGetAllData, Stream, IFees, IGetFeesData } from "./types";
|
|
5
6
|
import { AptosStreamClient, ICreateStreamAptosExt, ITransactionAptosExt } from "../aptos";
|
|
@@ -12,6 +13,8 @@ export interface SolanaStreamClientOptions {
|
|
|
12
13
|
cluster?: ICluster;
|
|
13
14
|
programId?: string;
|
|
14
15
|
commitment?: Commitment | ConnectionConfig;
|
|
16
|
+
sendRate?: number;
|
|
17
|
+
sendThrottler?: PQueue;
|
|
15
18
|
}
|
|
16
19
|
export interface AptosStreamClientOptions {
|
|
17
20
|
chain: IChain.Aptos;
|
|
@@ -34,7 +34,7 @@ var GenericStreamClient = /** @class */ (function (_super) {
|
|
|
34
34
|
_this.chain = options.chain;
|
|
35
35
|
switch (options.chain) {
|
|
36
36
|
case types_1.IChain.Solana:
|
|
37
|
-
_this.nativeStreamClient = new solana_1.SolanaStreamClient(options.clusterUrl, options.cluster, options.commitment, options.programId);
|
|
37
|
+
_this.nativeStreamClient = new solana_1.SolanaStreamClient(options.clusterUrl, options.cluster, options.commitment, options.programId, options.sendRate, options.sendThrottler);
|
|
38
38
|
break;
|
|
39
39
|
case types_1.IChain.Aptos:
|
|
40
40
|
_this.nativeStreamClient = new aptos_1.AptosStreamClient(options.clusterUrl, options.cluster, options.maxGas, options.programId);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import PQueue from "p-queue";
|
|
1
2
|
import { Connection, Keypair, PublicKey, TransactionInstruction, Commitment, ConnectionConfig } from "@solana/web3.js";
|
|
2
3
|
import { ICreateStreamSolanaExt, IInteractStreamSolanaExt, ITopUpStreamSolanaExt } from "./types";
|
|
3
4
|
import { ICancelData, ICluster, ICreateMultipleStreamData, ICreateResult, ICreateStreamData, IGetAllData, IGetFeesData, IGetOneData, IFees, IMultiTransactionResult, ITopUpData, ITransactionResult, ITransferData, IUpdateData, IWithdrawData, Stream } from "../common/types";
|
|
@@ -6,10 +7,11 @@ export default class SolanaStreamClient extends BaseStreamClient {
|
|
|
6
7
|
private connection;
|
|
7
8
|
private programId;
|
|
8
9
|
private commitment;
|
|
10
|
+
private sendThrottler;
|
|
9
11
|
/**
|
|
10
12
|
* Create Stream instance
|
|
11
13
|
*/
|
|
12
|
-
constructor(clusterUrl: string, cluster?: ICluster, commitment?: Commitment | ConnectionConfig, programId?: string);
|
|
14
|
+
constructor(clusterUrl: string, cluster?: ICluster, commitment?: Commitment | ConnectionConfig, programId?: string, sendRate?: number, sendThrottler?: PQueue);
|
|
13
15
|
getConnection(): Connection;
|
|
14
16
|
getCommitment(): Commitment | undefined;
|
|
15
17
|
getProgramId(): string;
|
|
@@ -145,14 +145,16 @@ var SolanaStreamClient = /** @class */ (function (_super) {
|
|
|
145
145
|
/**
|
|
146
146
|
* Create Stream instance
|
|
147
147
|
*/
|
|
148
|
-
function SolanaStreamClient(clusterUrl, cluster, commitment, programId) {
|
|
148
|
+
function SolanaStreamClient(clusterUrl, cluster, commitment, programId, sendRate, sendThrottler) {
|
|
149
149
|
if (cluster === void 0) { cluster = types_2.ICluster.Mainnet; }
|
|
150
150
|
if (commitment === void 0) { commitment = "confirmed"; }
|
|
151
151
|
if (programId === void 0) { programId = ""; }
|
|
152
|
+
if (sendRate === void 0) { sendRate = 1; }
|
|
152
153
|
var _this = _super.call(this) || this;
|
|
153
154
|
_this.commitment = commitment;
|
|
154
155
|
_this.connection = new web3_js_1.Connection(clusterUrl, _this.commitment);
|
|
155
156
|
_this.programId = programId !== "" ? new web3_js_1.PublicKey(programId) : new web3_js_1.PublicKey(constants_1.PROGRAM_ID[cluster]);
|
|
157
|
+
_this.sendThrottler = sendThrottler !== null && sendThrottler !== void 0 ? sendThrottler : (0, solana_1.buildSendThrottler)(sendRate);
|
|
156
158
|
return _this;
|
|
157
159
|
}
|
|
158
160
|
SolanaStreamClient.prototype.getConnection = function () {
|
|
@@ -183,7 +185,7 @@ var SolanaStreamClient = /** @class */ (function (_super) {
|
|
|
183
185
|
hash: hash,
|
|
184
186
|
context: context,
|
|
185
187
|
commitment: this.getCommitment(),
|
|
186
|
-
})];
|
|
188
|
+
}, { sendThrottler: this.sendThrottler })];
|
|
187
189
|
case 3:
|
|
188
190
|
signature = _c.sent();
|
|
189
191
|
return [2 /*return*/, { ixs: ixs, txId: signature, metadataId: metadataPubKey.toBase58() }];
|
|
@@ -310,7 +312,7 @@ var SolanaStreamClient = /** @class */ (function (_super) {
|
|
|
310
312
|
hash: hash,
|
|
311
313
|
context: context,
|
|
312
314
|
commitment: this.getCommitment(),
|
|
313
|
-
})];
|
|
315
|
+
}, { sendThrottler: this.sendThrottler })];
|
|
314
316
|
case 3:
|
|
315
317
|
signature = _c.sent();
|
|
316
318
|
return [2 /*return*/, { ixs: ixs, txId: signature, metadataId: metadataPubKey.toBase58() }];
|
|
@@ -413,7 +415,7 @@ var SolanaStreamClient = /** @class */ (function (_super) {
|
|
|
413
415
|
SolanaStreamClient.prototype.createMultiple = function (data, _a) {
|
|
414
416
|
var sender = _a.sender, metadataPubKeys = _a.metadataPubKeys, _b = _a.isNative, isNative = _b === void 0 ? false : _b, computePrice = _a.computePrice, computeLimit = _a.computeLimit;
|
|
415
417
|
return __awaiter(this, void 0, void 0, function () {
|
|
416
|
-
var recipients, metadatas, metadataToRecipient, errors, signatures, batch, instructionsBatch, i, recipientData, _c, ixs, metadata, metadataPubKey, _d, hash, context, instructionsBatch_1, instructionsBatch_1_1, _e, ixs, metadata, recipient, messageV0, tx, totalDepositedAmount, nativeInstructions, messageV0, tx, signedBatch, prepareTx, responses, signedBatch_1, signedBatch_1_1, batchTx, _f, _g, _h, _j, e_1_1,
|
|
418
|
+
var recipients, metadatas, metadataToRecipient, errors, signatures, batch, instructionsBatch, i, recipientData, _c, ixs, metadata, metadataPubKey, _d, hash, context, instructionsBatch_1, instructionsBatch_1_1, _e, ixs, metadata, recipient, messageV0, tx, totalDepositedAmount, nativeInstructions, messageV0, tx, signedBatch, prepareTx, responses, signedBatch_1, signedBatch_1_1, batchTx, _f, _g, _h, _j, e_1_1, _k, _l, _m, _o;
|
|
417
419
|
var e_2, _p, e_1, _q;
|
|
418
420
|
var _this = this;
|
|
419
421
|
return __generator(this, function (_r) {
|
|
@@ -500,7 +502,7 @@ var SolanaStreamClient = /** @class */ (function (_super) {
|
|
|
500
502
|
signedBatch = _r.sent();
|
|
501
503
|
if (!isNative) return [3 /*break*/, 10];
|
|
502
504
|
prepareTx = signedBatch.pop();
|
|
503
|
-
return [4 /*yield*/, (0, utils_1.sendAndConfirmStreamRawTransaction)(this.connection, prepareTx, { hash: hash, context: context })];
|
|
505
|
+
return [4 /*yield*/, (0, utils_1.sendAndConfirmStreamRawTransaction)(this.connection, prepareTx, { hash: hash, context: context }, { sendThrottler: this.sendThrottler })];
|
|
504
506
|
case 9:
|
|
505
507
|
_r.sent();
|
|
506
508
|
_r.label = 10;
|
|
@@ -519,7 +521,7 @@ var SolanaStreamClient = /** @class */ (function (_super) {
|
|
|
519
521
|
_h = [responses];
|
|
520
522
|
_j = [[]];
|
|
521
523
|
return [4 /*yield*/, Promise.allSettled([
|
|
522
|
-
(0,
|
|
524
|
+
(0, solana_1.executeTransaction)(this.connection, batchTx.tx, { hash: hash, context: context }, { sendThrottler: this.sendThrottler }),
|
|
523
525
|
])];
|
|
524
526
|
case 13:
|
|
525
527
|
_g.apply(_f, _h.concat([__spreadArray.apply(void 0, _j.concat([__read.apply(void 0, [(_r.sent())]), false]))]));
|
|
@@ -540,25 +542,37 @@ var SolanaStreamClient = /** @class */ (function (_super) {
|
|
|
540
542
|
return [7 /*endfinally*/];
|
|
541
543
|
case 18: return [3 /*break*/, 21];
|
|
542
544
|
case 19:
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
545
|
+
_l =
|
|
546
|
+
//send all transactions in parallel and wait for them to settle.
|
|
547
|
+
//it allows to speed up the process of sending transactions
|
|
548
|
+
//we then filter all promise responses and handle failed transactions
|
|
549
|
+
(_k = responses.push).apply;
|
|
550
|
+
_m = [
|
|
551
|
+
//send all transactions in parallel and wait for them to settle.
|
|
552
|
+
//it allows to speed up the process of sending transactions
|
|
553
|
+
//we then filter all promise responses and handle failed transactions
|
|
554
|
+
responses];
|
|
548
555
|
_o = [[]];
|
|
549
|
-
return [4 /*yield*/,
|
|
556
|
+
return [4 /*yield*/, (0, solana_1.executeMultipleTransactions)(this.connection, signedBatch.map(function (item) { return item.tx; }), { hash: hash, context: context }, { sendThrottler: this.sendThrottler })];
|
|
550
557
|
case 20:
|
|
558
|
+
//send all transactions in parallel and wait for them to settle.
|
|
559
|
+
//it allows to speed up the process of sending transactions
|
|
560
|
+
//we then filter all promise responses and handle failed transactions
|
|
551
561
|
_l.apply(_k, _m.concat([__spreadArray.apply(void 0, _o.concat([__read.apply(void 0, [(_r.sent())]), false]))]));
|
|
552
562
|
_r.label = 21;
|
|
553
563
|
case 21:
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
564
|
+
responses.forEach(function (item, index) {
|
|
565
|
+
if (item.status === "fulfilled") {
|
|
566
|
+
signatures.push(item.value);
|
|
567
|
+
}
|
|
568
|
+
else {
|
|
569
|
+
errors.push({
|
|
570
|
+
recipient: signedBatch[index].recipient,
|
|
571
|
+
error: item.reason,
|
|
572
|
+
contractErrorCode: _this.extractErrorCode(item.reason) || undefined,
|
|
573
|
+
});
|
|
574
|
+
}
|
|
575
|
+
});
|
|
562
576
|
return [2 /*return*/, { txs: signatures, metadatas: metadatas, metadataToRecipient: metadataToRecipient, errors: errors }];
|
|
563
577
|
}
|
|
564
578
|
});
|
|
@@ -583,7 +597,7 @@ var SolanaStreamClient = /** @class */ (function (_super) {
|
|
|
583
597
|
hash: hash,
|
|
584
598
|
context: context,
|
|
585
599
|
commitment: this.getCommitment(),
|
|
586
|
-
})];
|
|
600
|
+
}, { sendThrottler: this.sendThrottler })];
|
|
587
601
|
case 3:
|
|
588
602
|
signature = _d.sent();
|
|
589
603
|
return [2 /*return*/, { ixs: ixs, txId: signature }];
|
|
@@ -666,7 +680,7 @@ var SolanaStreamClient = /** @class */ (function (_super) {
|
|
|
666
680
|
hash: hash,
|
|
667
681
|
context: context,
|
|
668
682
|
commitment: this.getCommitment(),
|
|
669
|
-
})];
|
|
683
|
+
}, { sendThrottler: this.sendThrottler })];
|
|
670
684
|
case 3:
|
|
671
685
|
signature = _c.sent();
|
|
672
686
|
return [2 /*return*/, { ixs: ixs, txId: signature }];
|
|
@@ -752,7 +766,7 @@ var SolanaStreamClient = /** @class */ (function (_super) {
|
|
|
752
766
|
hash: hash,
|
|
753
767
|
context: context,
|
|
754
768
|
commitment: this.getCommitment(),
|
|
755
|
-
})];
|
|
769
|
+
}, { sendThrottler: this.sendThrottler })];
|
|
756
770
|
case 3:
|
|
757
771
|
signature = _c.sent();
|
|
758
772
|
return [2 /*return*/, { ixs: ixs, txId: signature }];
|
|
@@ -829,7 +843,7 @@ var SolanaStreamClient = /** @class */ (function (_super) {
|
|
|
829
843
|
hash: hash,
|
|
830
844
|
context: context,
|
|
831
845
|
commitment: this.getCommitment(),
|
|
832
|
-
})];
|
|
846
|
+
}, { sendThrottler: this.sendThrottler })];
|
|
833
847
|
case 3:
|
|
834
848
|
signature = _c.sent();
|
|
835
849
|
return [2 /*return*/, { ixs: ixs, txId: signature }];
|
|
@@ -985,7 +999,7 @@ var SolanaStreamClient = /** @class */ (function (_super) {
|
|
|
985
999
|
hash: hash,
|
|
986
1000
|
context: context,
|
|
987
1001
|
commitment: this.getCommitment(),
|
|
988
|
-
})];
|
|
1002
|
+
}, { sendThrottler: this.sendThrottler })];
|
|
989
1003
|
case 3:
|
|
990
1004
|
signature = _b.sent();
|
|
991
1005
|
return [2 /*return*/, {
|
package/dist/solana/utils.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SignerWalletAdapter } from "@solana/wallet-adapter-base";
|
|
2
2
|
import { Connection, Keypair } from "@solana/web3.js";
|
|
3
|
-
import { ConfirmationParams } from "@streamflow/common/solana";
|
|
3
|
+
import { ConfirmationParams, ThrottleParams } from "@streamflow/common/solana";
|
|
4
4
|
import { DecodedStream, BatchItem, BatchItemResult } from "./types";
|
|
5
5
|
export declare const decodeStream: (buf: Buffer) => DecodedStream;
|
|
6
6
|
/**
|
|
@@ -14,8 +14,9 @@ export declare function signAllTransactionWithRecipients(sender: Keypair | Signe
|
|
|
14
14
|
* Sign passed BatchItems with wallet request or KeyPair
|
|
15
15
|
* @param {Connection} connection - Solana web3 connection object.
|
|
16
16
|
* @param {BatchItem} batchItem - Signed transaction ready to be send.
|
|
17
|
-
* @param
|
|
17
|
+
* @param confirmationParams - Confirmation Params that will be used for execution
|
|
18
|
+
* @param throttleParams - rate or throttler instance to throttle TX sending - to not spam the blockchain too much
|
|
18
19
|
* @return {Promise<BatchItemResult>} - Returns settled transaction item
|
|
19
20
|
*/
|
|
20
|
-
export declare function sendAndConfirmStreamRawTransaction(connection: Connection, batchItem: BatchItem, confirmationParams: ConfirmationParams): Promise<BatchItemResult>;
|
|
21
|
+
export declare function sendAndConfirmStreamRawTransaction(connection: Connection, batchItem: BatchItem, confirmationParams: ConfirmationParams, throttleParams: ThrottleParams): Promise<BatchItemResult>;
|
|
21
22
|
export declare function extractSolanaErrorCode(errorText: string, logs?: string[]): string | null;
|
package/dist/solana/utils.js
CHANGED
|
@@ -154,17 +154,18 @@ exports.signAllTransactionWithRecipients = signAllTransactionWithRecipients;
|
|
|
154
154
|
* Sign passed BatchItems with wallet request or KeyPair
|
|
155
155
|
* @param {Connection} connection - Solana web3 connection object.
|
|
156
156
|
* @param {BatchItem} batchItem - Signed transaction ready to be send.
|
|
157
|
-
* @param
|
|
157
|
+
* @param confirmationParams - Confirmation Params that will be used for execution
|
|
158
|
+
* @param throttleParams - rate or throttler instance to throttle TX sending - to not spam the blockchain too much
|
|
158
159
|
* @return {Promise<BatchItemResult>} - Returns settled transaction item
|
|
159
160
|
*/
|
|
160
|
-
function sendAndConfirmStreamRawTransaction(connection, batchItem, confirmationParams) {
|
|
161
|
+
function sendAndConfirmStreamRawTransaction(connection, batchItem, confirmationParams, throttleParams) {
|
|
161
162
|
return __awaiter(this, void 0, void 0, function () {
|
|
162
163
|
var completedTxSignature, error_1;
|
|
163
164
|
return __generator(this, function (_a) {
|
|
164
165
|
switch (_a.label) {
|
|
165
166
|
case 0:
|
|
166
167
|
_a.trys.push([0, 2, , 3]);
|
|
167
|
-
return [4 /*yield*/, (0, solana_1.executeTransaction)(connection, batchItem.tx, confirmationParams)];
|
|
168
|
+
return [4 /*yield*/, (0, solana_1.executeTransaction)(connection, batchItem.tx, confirmationParams, throttleParams)];
|
|
168
169
|
case 1:
|
|
169
170
|
completedTxSignature = _a.sent();
|
|
170
171
|
return [2 /*return*/, __assign(__assign({}, batchItem), { signature: completedTxSignature })];
|
package/dist/sui/constants.js
CHANGED
|
@@ -5,22 +5,22 @@ exports.SUI_MODULE_ERROR_MAP = exports.SUI_ERROR_MATCH_REGEX = exports.SUI_FEE_T
|
|
|
5
5
|
var types_1 = require("../common/types");
|
|
6
6
|
// TODO: remove Devnet and Local addresses as they are not deployed, they are just a copy Testnet values
|
|
7
7
|
exports.SUI_PROGRAM_IDS = (_a = {},
|
|
8
|
-
_a[types_1.ICluster.Mainnet] = "
|
|
9
|
-
_a[types_1.ICluster.Devnet] = "
|
|
10
|
-
_a[types_1.ICluster.Testnet] = "
|
|
11
|
-
_a[types_1.ICluster.Local] = "
|
|
8
|
+
_a[types_1.ICluster.Mainnet] = "0xe456a3a1d4e58e85b4b7175fabe6dae895b983f1379bb8948d6ec2f137b08a7b",
|
|
9
|
+
_a[types_1.ICluster.Devnet] = "0x34dacd839e1758ebb70bdcd4e08f18fbfef5e2b96d9aa7ce2b4a71d96ca0df5a",
|
|
10
|
+
_a[types_1.ICluster.Testnet] = "0x34dacd839e1758ebb70bdcd4e08f18fbfef5e2b96d9aa7ce2b4a71d96ca0df5a",
|
|
11
|
+
_a[types_1.ICluster.Local] = "0x34dacd839e1758ebb70bdcd4e08f18fbfef5e2b96d9aa7ce2b4a71d96ca0df5a",
|
|
12
12
|
_a);
|
|
13
13
|
exports.SUI_CONFIG_IDS = (_b = {},
|
|
14
14
|
_b[types_1.ICluster.Mainnet] = "0x6cf6760b64245b8d23ef57c28ddceb6adbd540a23a509fef29b82237da4ab87b",
|
|
15
|
-
_b[types_1.ICluster.Devnet] = "
|
|
16
|
-
_b[types_1.ICluster.Testnet] = "
|
|
17
|
-
_b[types_1.ICluster.Local] = "
|
|
15
|
+
_b[types_1.ICluster.Devnet] = "0xd6c9f5074584f58074ce56e3c5cc436d82258ec3285f186a0d6438a60bacdbf8",
|
|
16
|
+
_b[types_1.ICluster.Testnet] = "0xd6c9f5074584f58074ce56e3c5cc436d82258ec3285f186a0d6438a60bacdbf8",
|
|
17
|
+
_b[types_1.ICluster.Local] = "0xd6c9f5074584f58074ce56e3c5cc436d82258ec3285f186a0d6438a60bacdbf8",
|
|
18
18
|
_b);
|
|
19
19
|
exports.SUI_FEE_TABLE_IDS = (_c = {},
|
|
20
20
|
_c[types_1.ICluster.Mainnet] = "0xad9b75399632583fb9fcae6b5bcca34e6542ab3bedb630ecbd3f15cb1cc48dbe",
|
|
21
|
-
_c[types_1.ICluster.Devnet] = "
|
|
22
|
-
_c[types_1.ICluster.Testnet] = "
|
|
23
|
-
_c[types_1.ICluster.Local] = "
|
|
21
|
+
_c[types_1.ICluster.Devnet] = "0x6057b093904c5bdfec1067d2b8a4dc35f65bcab03b3029ad716c4882b0f36078",
|
|
22
|
+
_c[types_1.ICluster.Testnet] = "0x6057b093904c5bdfec1067d2b8a4dc35f65bcab03b3029ad716c4882b0f36078",
|
|
23
|
+
_c[types_1.ICluster.Local] = "0x6057b093904c5bdfec1067d2b8a4dc35f65bcab03b3029ad716c4882b0f36078",
|
|
24
24
|
_c);
|
|
25
25
|
exports.SUI_ERROR_MATCH_REGEX = /MoveAbort\(MoveLocation \{ module: ModuleId \{ address: (\w+), name: Identifier\("([\w_]+)"\) }, function: \d+, instruction: \d+, function_name: Some\("([\w_]+)"\) }, (\d+)\) in command (\d+)/;
|
|
26
26
|
exports.SUI_MODULE_ERROR_MAP = {
|
package/dist/sui/wallet.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { SuiClient, SuiTransactionBlockResponse } from "@mysten/sui.js/client";
|
|
|
4
4
|
import { SuiSignAndExecuteTransactionBlockInput } from "./types";
|
|
5
5
|
/**
|
|
6
6
|
* Utility function to check if the transaction initiator is a Wallet object
|
|
7
|
-
* @param {Keypair |
|
|
7
|
+
* @param {Keypair | WalletContextState} walletOrKeypair - Wallet or Keypair in question
|
|
8
8
|
* @return {boolean} - Returns true if parameter is a Wallet.
|
|
9
9
|
*/
|
|
10
10
|
export declare function isSignerKeypair(walletOrKeypair: Keypair | WalletContextState): walletOrKeypair is Keypair;
|
package/dist/sui/wallet.js
CHANGED
|
@@ -51,13 +51,14 @@ exports.SuiWalletWrapper = exports.isSignerKeypair = void 0;
|
|
|
51
51
|
var cryptography_1 = require("@mysten/sui.js/cryptography");
|
|
52
52
|
/**
|
|
53
53
|
* Utility function to check if the transaction initiator is a Wallet object
|
|
54
|
-
* @param {Keypair |
|
|
54
|
+
* @param {Keypair | WalletContextState} walletOrKeypair - Wallet or Keypair in question
|
|
55
55
|
* @return {boolean} - Returns true if parameter is a Wallet.
|
|
56
56
|
*/
|
|
57
57
|
function isSignerKeypair(walletOrKeypair) {
|
|
58
58
|
return (walletOrKeypair instanceof cryptography_1.Keypair ||
|
|
59
59
|
walletOrKeypair.constructor === cryptography_1.Keypair ||
|
|
60
|
-
walletOrKeypair.constructor.name === cryptography_1.Keypair.prototype.constructor.name
|
|
60
|
+
walletOrKeypair.constructor.name === cryptography_1.Keypair.prototype.constructor.name ||
|
|
61
|
+
"export" in walletOrKeypair);
|
|
61
62
|
}
|
|
62
63
|
exports.isSignerKeypair = isSignerKeypair;
|
|
63
64
|
var SuiWalletWrapper = /** @class */ (function () {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamflow/stream",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.4",
|
|
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": "c559d33706f42ff9e0704923376aade789eaa8ce",
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@streamflow/eslint-config": "6.3.
|
|
40
|
+
"@streamflow/eslint-config": "6.3.4",
|
|
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.3.
|
|
57
|
+
"@streamflow/common": "6.3.4",
|
|
58
58
|
"@suiet/wallet-kit": "0.2.22",
|
|
59
59
|
"aptos": "1.4.0",
|
|
60
60
|
"bn.js": "5.2.1",
|
|
@@ -62,6 +62,7 @@
|
|
|
62
62
|
"bs58": "5.0.0",
|
|
63
63
|
"ethereum-checksum-address": "0.0.8",
|
|
64
64
|
"ethers": "5.7.2",
|
|
65
|
-
"js-sha256": "0.9.0"
|
|
65
|
+
"js-sha256": "0.9.0",
|
|
66
|
+
"p-queue": "^6.6.2"
|
|
66
67
|
}
|
|
67
68
|
}
|