@streamflow/stream 4.1.0-beta.2 → 4.1.0-beta.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 +1 -1
- package/dist/common/GenericStreamClient.js +3 -2
- package/dist/common/types.d.ts +3 -2
- package/dist/common/types.js +3 -2
- package/dist/evm/StreamClient.js +14 -5
- package/dist/evm/constants.d.ts +3 -2
- package/dist/evm/constants.js +10 -4
- package/package.json +1 -1
|
@@ -22,7 +22,7 @@ export interface AptosStreamClientOptions {
|
|
|
22
22
|
maxGas?: string;
|
|
23
23
|
}
|
|
24
24
|
export interface EvmStreamClientOptions {
|
|
25
|
-
chain: IChain.
|
|
25
|
+
chain: IChain.Ethereum | IChain.BNB | IChain.Polygon;
|
|
26
26
|
clusterUrl: string;
|
|
27
27
|
signer: Signer;
|
|
28
28
|
cluster?: ICluster;
|
|
@@ -35,8 +35,9 @@ var GenericStreamClient = /** @class */ (function (_super) {
|
|
|
35
35
|
case types_1.IChain.Aptos:
|
|
36
36
|
_this.nativeStreamClient = new StreamClient_2.default(options.clusterUrl, options.cluster, options.maxGas, options.programId);
|
|
37
37
|
break;
|
|
38
|
-
case types_1.IChain.
|
|
39
|
-
case types_1.IChain.
|
|
38
|
+
case types_1.IChain.BNB:
|
|
39
|
+
case types_1.IChain.Ethereum:
|
|
40
|
+
case types_1.IChain.Polygon:
|
|
40
41
|
_this.nativeStreamClient = new evm_1.EvmStreamClient(options.clusterUrl, options.chain, options.signer, options.cluster, options.programId);
|
|
41
42
|
break;
|
|
42
43
|
}
|
package/dist/common/types.d.ts
CHANGED
package/dist/common/types.js
CHANGED
|
@@ -25,6 +25,7 @@ var IChain;
|
|
|
25
25
|
(function (IChain) {
|
|
26
26
|
IChain["Solana"] = "Solana";
|
|
27
27
|
IChain["Aptos"] = "Aptos";
|
|
28
|
-
IChain["
|
|
29
|
-
IChain["
|
|
28
|
+
IChain["Ethereum"] = "Ethereum";
|
|
29
|
+
IChain["BNB"] = "BNB";
|
|
30
|
+
IChain["Polygon"] = "Polygon";
|
|
30
31
|
})(IChain = exports.IChain || (exports.IChain = {}));
|
package/dist/evm/StreamClient.js
CHANGED
|
@@ -105,15 +105,24 @@ var EvmStreamClient = /** @class */ (function (_super) {
|
|
|
105
105
|
function EvmStreamClient(clusterUrl, chain, signer, cluster, programId) {
|
|
106
106
|
if (cluster === void 0) { cluster = types_1.ICluster.Mainnet; }
|
|
107
107
|
var _this = _super.call(this) || this;
|
|
108
|
-
if (chain !== types_1.IChain.
|
|
109
|
-
throw new Error("Wrong chain. Supported chains are
|
|
108
|
+
if (chain !== types_1.IChain.Ethereum && chain !== types_1.IChain.BNB && chain !== types_1.IChain.Polygon) {
|
|
109
|
+
throw new Error("Wrong chain. Supported chains are Ethereum , BNB and Polygon!");
|
|
110
110
|
}
|
|
111
111
|
if (programId) {
|
|
112
112
|
_this.programId = programId;
|
|
113
113
|
}
|
|
114
114
|
else {
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
switch (chain) {
|
|
116
|
+
case types_1.IChain.Ethereum:
|
|
117
|
+
_this.programId = constants_1.ETHEREUM_PROGRAM_IDS[cluster];
|
|
118
|
+
break;
|
|
119
|
+
case types_1.IChain.BNB:
|
|
120
|
+
_this.programId = constants_1.BNB_PROGRAM_IDS[cluster];
|
|
121
|
+
break;
|
|
122
|
+
case types_1.IChain.Polygon:
|
|
123
|
+
_this.programId = constants_1.POLYGON_PROGRAM_IDS[cluster];
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
117
126
|
}
|
|
118
127
|
_this.provider = new ethers_1.ethers.providers.JsonRpcProvider(clusterUrl);
|
|
119
128
|
_this.signer = signer;
|
|
@@ -423,7 +432,7 @@ var EvmStreamClient = /** @class */ (function (_super) {
|
|
|
423
432
|
];
|
|
424
433
|
};
|
|
425
434
|
EvmStreamClient.prototype.formatMetadataId = function (id) {
|
|
426
|
-
// 40 chars is
|
|
435
|
+
// 40 chars is ethereum address size
|
|
427
436
|
return (0, ethereum_checksum_address_1.toChecksumAddress)("0x".concat(id.slice(-40)));
|
|
428
437
|
};
|
|
429
438
|
return EvmStreamClient;
|
package/dist/evm/constants.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { ICluster } from "../common/types";
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
2
|
+
export declare const ETHEREUM_PROGRAM_IDS: Record<ICluster, string>;
|
|
3
|
+
export declare const BNB_PROGRAM_IDS: Record<ICluster, string>;
|
|
4
|
+
export declare const POLYGON_PROGRAM_IDS: Record<ICluster, string>;
|
package/dist/evm/constants.js
CHANGED
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var _a, _b;
|
|
2
|
+
var _a, _b, _c;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.POLYGON_PROGRAM_IDS = exports.BNB_PROGRAM_IDS = exports.ETHEREUM_PROGRAM_IDS = void 0;
|
|
5
5
|
var types_1 = require("../common/types");
|
|
6
|
-
exports.
|
|
6
|
+
exports.ETHEREUM_PROGRAM_IDS = (_a = {},
|
|
7
7
|
_a[types_1.ICluster.Mainnet] = "0x35fC2D13D97c13d6697Dc273fEDF93eBC92B7743",
|
|
8
8
|
_a[types_1.ICluster.Devnet] = "0x35fC2D13D97c13d6697Dc273fEDF93eBC92B7743",
|
|
9
9
|
_a[types_1.ICluster.Testnet] = "0x35fC2D13D97c13d6697Dc273fEDF93eBC92B7743",
|
|
10
10
|
_a[types_1.ICluster.Local] = "0x35fC2D13D97c13d6697Dc273fEDF93eBC92B7743",
|
|
11
11
|
_a);
|
|
12
|
-
exports.
|
|
12
|
+
exports.BNB_PROGRAM_IDS = (_b = {},
|
|
13
13
|
_b[types_1.ICluster.Mainnet] = "0xb09702834cba4c4BDb03CC7F0Fef48490a44BB50",
|
|
14
14
|
_b[types_1.ICluster.Devnet] = "0xb09702834cba4c4BDb03CC7F0Fef48490a44BB50",
|
|
15
15
|
_b[types_1.ICluster.Testnet] = "0xb09702834cba4c4BDb03CC7F0Fef48490a44BB50",
|
|
16
16
|
_b[types_1.ICluster.Local] = "0xb09702834cba4c4BDb03CC7F0Fef48490a44BB50",
|
|
17
17
|
_b);
|
|
18
|
+
exports.POLYGON_PROGRAM_IDS = (_c = {},
|
|
19
|
+
_c[types_1.ICluster.Mainnet] = "0x96C1A4347ed2C833C58B2B1ad6B616B4d3013C43",
|
|
20
|
+
_c[types_1.ICluster.Devnet] = "0x96C1A4347ed2C833C58B2B1ad6B616B4d3013C43",
|
|
21
|
+
_c[types_1.ICluster.Testnet] = "0x96C1A4347ed2C833C58B2B1ad6B616B4d3013C43",
|
|
22
|
+
_c[types_1.ICluster.Local] = "0x96C1A4347ed2C833C58B2B1ad6B616B4d3013C43",
|
|
23
|
+
_c);
|
package/package.json
CHANGED