@streamflow/stream 5.9.4 → 5.9.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.
- package/dist/aptos/utils.d.ts +1 -1
- package/dist/aptos/utils.js +3 -3
- package/dist/common/utils.d.ts +1 -0
- package/dist/common/utils.js +3 -1
- package/package.json +2 -2
package/dist/aptos/utils.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare function extractAptosErrorCode(errorText: string): string | null;
|
|
2
2
|
/**
|
|
3
3
|
* Aptos has inconsistencies in how it returns addresses.
|
|
4
|
-
* This method normalizes them to be 64 characters long, or leaves it as SPECIAL ADDRESS (0x0 - 0xf inclusive)
|
|
4
|
+
* This method normalizes them to be 64+2(0x...) characters long, or leaves it as SPECIAL ADDRESS (0x0 - 0xf inclusive)
|
|
5
5
|
* Per this: https://github.com/aptos-labs/aptos-ts-sdk/blob/main/src/core/accountAddress.ts#L115
|
|
6
6
|
* */
|
|
7
7
|
export declare function normalizeAptosAddress(address: string): string;
|
package/dist/aptos/utils.js
CHANGED
|
@@ -18,7 +18,7 @@ function isAddressSpecial(address) {
|
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* Aptos has inconsistencies in how it returns addresses.
|
|
21
|
-
* This method normalizes them to be 64 characters long, or leaves it as SPECIAL ADDRESS (0x0 - 0xf inclusive)
|
|
21
|
+
* This method normalizes them to be 64+2(0x...) characters long, or leaves it as SPECIAL ADDRESS (0x0 - 0xf inclusive)
|
|
22
22
|
* Per this: https://github.com/aptos-labs/aptos-ts-sdk/blob/main/src/core/accountAddress.ts#L115
|
|
23
23
|
* */
|
|
24
24
|
function normalizeAptosAddress(address) {
|
|
@@ -26,10 +26,10 @@ function normalizeAptosAddress(address) {
|
|
|
26
26
|
return address;
|
|
27
27
|
}
|
|
28
28
|
var length = address.length;
|
|
29
|
-
if (length ===
|
|
29
|
+
if (length === 66 || length < 3) {
|
|
30
30
|
return address;
|
|
31
31
|
}
|
|
32
|
-
var missingZeros =
|
|
32
|
+
var missingZeros = 66 - length;
|
|
33
33
|
return address.slice(0, 2) + "0".repeat(missingZeros) + address.slice(2);
|
|
34
34
|
}
|
|
35
35
|
exports.normalizeAptosAddress = normalizeAptosAddress;
|
package/dist/common/utils.d.ts
CHANGED
|
@@ -20,3 +20,4 @@ export declare const getNumberFromBN: (value: BN, decimals: number) => number;
|
|
|
20
20
|
* @returns {T}
|
|
21
21
|
*/
|
|
22
22
|
export declare function handleContractError<T>(func: () => Promise<T>, callback?: (err: Error) => string | null): Promise<T>;
|
|
23
|
+
export { normalizeAptosAddress } from "../aptos/utils";
|
package/dist/common/utils.js
CHANGED
|
@@ -39,7 +39,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
39
39
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
40
|
};
|
|
41
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
exports.handleContractError = exports.getNumberFromBN = exports.getBN = void 0;
|
|
42
|
+
exports.normalizeAptosAddress = exports.handleContractError = exports.getNumberFromBN = exports.getBN = void 0;
|
|
43
43
|
var bn_js_1 = __importDefault(require("bn.js"));
|
|
44
44
|
var types_1 = require("./types");
|
|
45
45
|
/**
|
|
@@ -99,3 +99,5 @@ function handleContractError(func, callback) {
|
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
101
|
exports.handleContractError = handleContractError;
|
|
102
|
+
var utils_1 = require("../aptos/utils");
|
|
103
|
+
Object.defineProperty(exports, "normalizeAptosAddress", { enumerable: true, get: function () { return utils_1.normalizeAptosAddress; } });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamflow/stream",
|
|
3
|
-
"version": "5.9.
|
|
3
|
+
"version": "5.9.6",
|
|
4
4
|
"description": "JavaScript SDK to interact with Streamflow protocol.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"homepage": "https://github.com/streamflow-finance/js-sdk/",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"lint": "eslint .",
|
|
12
12
|
"prepublishOnly": "npm run lint && npm test && npm run build"
|
|
13
13
|
},
|
|
14
|
-
"gitHead": "
|
|
14
|
+
"gitHead": "f651b32c884da0109dfec62f4468990fb6dd4eda",
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@types/bn.js": "5.1.1",
|
|
17
17
|
"@types/ethereum-checksum-address": "^0.0.0",
|