@streamflow/stream 7.0.0-alpha.3 → 7.0.0-alpha.6

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.
@@ -1,26 +1,25 @@
1
1
  "use strict";
2
- var _a, _b, _c;
3
2
  Object.defineProperty(exports, "__esModule", { value: true });
4
3
  exports.EVM_ERROR_MAP = exports.EVM_ERROR_MATCH_REGEX = exports.POLYGON_PROGRAM_IDS = exports.BNB_PROGRAM_IDS = exports.ETHEREUM_PROGRAM_IDS = void 0;
5
- var types_js_1 = require("../common/types.js");
6
- exports.ETHEREUM_PROGRAM_IDS = (_a = {},
7
- _a[types_js_1.ICluster.Mainnet] = "0x94d4646Bd307Bf91CB1893BC64d976BF9E60D9B2",
8
- _a[types_js_1.ICluster.Devnet] = "0x5Db7a43D20De64E3a3BC765334a477026FD13E7d",
9
- _a[types_js_1.ICluster.Testnet] = "0x5Db7a43D20De64E3a3BC765334a477026FD13E7d",
10
- _a[types_js_1.ICluster.Local] = "0x5Db7a43D20De64E3a3BC765334a477026FD13E7d",
11
- _a);
12
- exports.BNB_PROGRAM_IDS = (_b = {},
13
- _b[types_js_1.ICluster.Mainnet] = "0x94d4646Bd307Bf91CB1893BC64d976BF9E60D9B2",
14
- _b[types_js_1.ICluster.Devnet] = "0x5Db7a43D20De64E3a3BC765334a477026FD13E7d",
15
- _b[types_js_1.ICluster.Testnet] = "0x5Db7a43D20De64E3a3BC765334a477026FD13E7d",
16
- _b[types_js_1.ICluster.Local] = "0x5Db7a43D20De64E3a3BC765334a477026FD13E7d",
17
- _b);
18
- exports.POLYGON_PROGRAM_IDS = (_c = {},
19
- _c[types_js_1.ICluster.Mainnet] = "0x94d4646Bd307Bf91CB1893BC64d976BF9E60D9B2",
20
- _c[types_js_1.ICluster.Devnet] = "0x5Db7a43D20De64E3a3BC765334a477026FD13E7d",
21
- _c[types_js_1.ICluster.Testnet] = "0x5Db7a43D20De64E3a3BC765334a477026FD13E7d",
22
- _c[types_js_1.ICluster.Local] = "0x5Db7a43D20De64E3a3BC765334a477026FD13E7d",
23
- _c);
4
+ const types_js_1 = require("../common/types.js");
5
+ exports.ETHEREUM_PROGRAM_IDS = {
6
+ [types_js_1.ICluster.Mainnet]: "0x94d4646Bd307Bf91CB1893BC64d976BF9E60D9B2",
7
+ [types_js_1.ICluster.Devnet]: "0x5Db7a43D20De64E3a3BC765334a477026FD13E7d",
8
+ [types_js_1.ICluster.Testnet]: "0x5Db7a43D20De64E3a3BC765334a477026FD13E7d",
9
+ [types_js_1.ICluster.Local]: "0x5Db7a43D20De64E3a3BC765334a477026FD13E7d",
10
+ };
11
+ exports.BNB_PROGRAM_IDS = {
12
+ [types_js_1.ICluster.Mainnet]: "0x94d4646Bd307Bf91CB1893BC64d976BF9E60D9B2",
13
+ [types_js_1.ICluster.Devnet]: "0x5Db7a43D20De64E3a3BC765334a477026FD13E7d",
14
+ [types_js_1.ICluster.Testnet]: "0x5Db7a43D20De64E3a3BC765334a477026FD13E7d",
15
+ [types_js_1.ICluster.Local]: "0x5Db7a43D20De64E3a3BC765334a477026FD13E7d",
16
+ };
17
+ exports.POLYGON_PROGRAM_IDS = {
18
+ [types_js_1.ICluster.Mainnet]: "0x94d4646Bd307Bf91CB1893BC64d976BF9E60D9B2",
19
+ [types_js_1.ICluster.Devnet]: "0x5Db7a43D20De64E3a3BC765334a477026FD13E7d",
20
+ [types_js_1.ICluster.Testnet]: "0x5Db7a43D20De64E3a3BC765334a477026FD13E7d",
21
+ [types_js_1.ICluster.Local]: "0x5Db7a43D20De64E3a3BC765334a477026FD13E7d",
22
+ };
24
23
  exports.EVM_ERROR_MATCH_REGEX = /execution reverted: ([A-Z_]+)/;
25
24
  exports.EVM_ERROR_MAP = {
26
25
  ECONTRACT_NOT_INIT: types_js_1.ContractErrorCode.ECONTRACT_NOT_INIT,
@@ -1,25 +1,14 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
14
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
15
4
  };
16
5
  Object.defineProperty(exports, "__esModule", { value: true });
17
6
  exports.EvmContract = void 0;
18
- var bignumber_js_1 = __importDefault(require("bignumber.js"));
19
- var contractUtils_js_1 = require("../common/contractUtils.js");
20
- var utils_js_1 = require("../common/utils.js");
21
- var EvmContract = /** @class */ (function () {
22
- function EvmContract(stream) {
7
+ const bignumber_js_1 = __importDefault(require("bignumber.js"));
8
+ const contractUtils_js_1 = require("../common/contractUtils.js");
9
+ const utils_js_1 = require("../common/utils.js");
10
+ class EvmContract {
11
+ constructor(stream) {
23
12
  this.magic = 0;
24
13
  this.version = 0;
25
14
  this.createdAt = stream.created.toNumber();
@@ -64,12 +53,14 @@ var EvmContract = /** @class */ (function () {
64
53
  this.fundsUnlockedAtLastRateChange = (0, bignumber_js_1.default)(stream.funds_unlocked_at_last_rate_change.toString());
65
54
  this.type = (0, contractUtils_js_1.buildStreamType)(this);
66
55
  }
67
- EvmContract.prototype.unlocked = function (currentTimestamp) {
68
- return (0, contractUtils_js_1.calculateUnlockedAmount)(__assign(__assign({}, this), { currentTimestamp: currentTimestamp }));
69
- };
70
- EvmContract.prototype.remaining = function (decimals) {
56
+ unlocked(currentTimestamp) {
57
+ return (0, contractUtils_js_1.calculateUnlockedAmount)({
58
+ ...this,
59
+ currentTimestamp,
60
+ });
61
+ }
62
+ remaining(decimals) {
71
63
  return (0, utils_js_1.getNumberFromBigNumber)(this.depositedAmount.minus(this.withdrawnAmount), decimals);
72
- };
73
- return EvmContract;
74
- }());
64
+ }
65
+ }
75
66
  exports.EvmContract = EvmContract;
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.extractEvmErrorCode = void 0;
4
- var constants_js_1 = require("./constants.js");
4
+ const constants_js_1 = require("./constants.js");
5
5
  function extractEvmErrorCode(errorText) {
6
- var match = constants_js_1.EVM_ERROR_MATCH_REGEX.exec(errorText);
6
+ const match = constants_js_1.EVM_ERROR_MATCH_REGEX.exec(errorText);
7
7
  if (!match) {
8
8
  return null;
9
9
  }