@streamflow/stream 7.0.0-alpha.2 → 7.0.0-alpha.5
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/cjs/__tests__/aptos/streamClient.spec.js +83 -134
- package/dist/cjs/__tests__/common/GenericStreamClient.spec.js +9 -9
- package/dist/cjs/aptos/StreamClient.js +162 -367
- package/dist/cjs/aptos/constants.js +7 -8
- package/dist/cjs/aptos/index.js +3 -3
- package/dist/cjs/aptos/types.js +17 -26
- package/dist/cjs/aptos/utils.js +4 -4
- package/dist/cjs/aptos/wallet.js +20 -75
- package/dist/cjs/common/BaseStreamClient.js +11 -59
- package/dist/cjs/common/GenericStreamClient.js +46 -72
- package/dist/cjs/common/constants.js +1 -1
- package/dist/cjs/common/contractUtils.js +12 -13
- package/dist/cjs/common/utils.js +21 -66
- package/dist/cjs/evm/StreamClient.js +198 -456
- package/dist/cjs/evm/constants.js +19 -20
- package/dist/cjs/evm/types.js +14 -23
- package/dist/cjs/evm/utils.js +2 -2
- package/dist/cjs/index.js +10 -10
- package/dist/cjs/solana/StreamClient.js +592 -1090
- package/dist/cjs/solana/constants.js +9 -10
- package/dist/cjs/solana/instructions.js +60 -65
- package/dist/cjs/solana/layout.js +7 -8
- package/dist/cjs/solana/types.js +14 -24
- package/dist/cjs/solana/utils.js +48 -136
- package/dist/cjs/sui/StreamClient.js +325 -571
- package/dist/cjs/sui/constants.js +19 -20
- package/dist/cjs/sui/types.js +17 -51
- package/dist/cjs/sui/utils.js +7 -7
- package/dist/cjs/sui/wallet.js +13 -63
- package/dist/esm/__tests__/aptos/streamClient.spec.js +1 -1
- package/dist/esm/aptos/index.d.ts +3 -3
- package/dist/esm/aptos/index.js +3 -3
- package/dist/esm/common/GenericStreamClient.d.ts +4 -4
- package/dist/esm/common/GenericStreamClient.js +4 -4
- package/dist/esm/common/types.d.ts +1 -1
- package/dist/esm/index.d.ts +9 -9
- package/dist/esm/index.js +9 -9
- package/package.json +4 -4
|
@@ -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
|
-
|
|
6
|
-
exports.ETHEREUM_PROGRAM_IDS =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
exports.BNB_PROGRAM_IDS =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
exports.POLYGON_PROGRAM_IDS =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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,
|
package/dist/cjs/evm/types.js
CHANGED
|
@@ -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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
68
|
-
return (0, contractUtils_js_1.calculateUnlockedAmount)(
|
|
69
|
-
|
|
70
|
-
|
|
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
|
-
|
|
74
|
-
}());
|
|
64
|
+
}
|
|
65
|
+
}
|
|
75
66
|
exports.EvmContract = EvmContract;
|
package/dist/cjs/evm/utils.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.extractEvmErrorCode = void 0;
|
|
4
|
-
|
|
4
|
+
const constants_js_1 = require("./constants.js");
|
|
5
5
|
function extractEvmErrorCode(errorText) {
|
|
6
|
-
|
|
6
|
+
const match = constants_js_1.EVM_ERROR_MATCH_REGEX.exec(errorText);
|
|
7
7
|
if (!match) {
|
|
8
8
|
return null;
|
|
9
9
|
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -30,13 +30,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
30
30
|
};
|
|
31
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
32
|
exports.GenericStreamClient = exports.StreamflowSui = exports.StreamflowSolana = exports.StreamflowEVM = exports.StreamflowAptos = void 0;
|
|
33
|
-
exports.StreamflowAptos = __importStar(require("./aptos"));
|
|
34
|
-
exports.StreamflowEVM = __importStar(require("./evm"));
|
|
35
|
-
exports.StreamflowSolana = __importStar(require("./solana"));
|
|
36
|
-
exports.StreamflowSui = __importStar(require("./sui"));
|
|
37
|
-
__exportStar(require("./common/types"), exports);
|
|
38
|
-
__exportStar(require("./common/utils"), exports);
|
|
39
|
-
__exportStar(require("./common/constants"), exports);
|
|
40
|
-
__exportStar(require("./common/contractUtils"), exports);
|
|
41
|
-
var
|
|
42
|
-
Object.defineProperty(exports, "GenericStreamClient", { enumerable: true, get: function () { return __importDefault(
|
|
33
|
+
exports.StreamflowAptos = __importStar(require("./aptos/index.js"));
|
|
34
|
+
exports.StreamflowEVM = __importStar(require("./evm/index.js"));
|
|
35
|
+
exports.StreamflowSolana = __importStar(require("./solana/index.js"));
|
|
36
|
+
exports.StreamflowSui = __importStar(require("./sui/index.js"));
|
|
37
|
+
__exportStar(require("./common/types.js"), exports);
|
|
38
|
+
__exportStar(require("./common/utils.js"), exports);
|
|
39
|
+
__exportStar(require("./common/constants.js"), exports);
|
|
40
|
+
__exportStar(require("./common/contractUtils.js"), exports);
|
|
41
|
+
var GenericStreamClient_js_1 = require("./common/GenericStreamClient.js");
|
|
42
|
+
Object.defineProperty(exports, "GenericStreamClient", { enumerable: true, get: function () { return __importDefault(GenericStreamClient_js_1).default; } });
|