@streamflow/stream 5.9.5 → 5.9.7

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,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;
@@ -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 === 64) {
29
+ if (length === 66 || length < 3) {
30
30
  return address;
31
31
  }
32
- var missingZeros = 64 - length;
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;
@@ -150,14 +150,10 @@ var ContractError = /** @class */ (function (_super) {
150
150
  */
151
151
  function ContractError(error, code) {
152
152
  var _this = _super.call(this, error.message) || this;
153
- _this.name = "ContractError"; // Set the name property
154
153
  _this.contractErrorCode = code !== null && code !== void 0 ? code : null;
155
154
  // Copy properties from the original error
156
- Object.getOwnPropertyNames(error).forEach(function (key) {
157
- _this[key] = error[key];
158
- });
159
- // If you want to capture the stack trace:
160
- _this.stack = error.stack;
155
+ Object.setPrototypeOf(_this, ContractError.prototype);
156
+ _this.name = "ContractError"; // Set the name property
161
157
  return _this;
162
158
  }
163
159
  return ContractError;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamflow/stream",
3
- "version": "5.9.5",
3
+ "version": "5.9.7",
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": "46440fa057d1544b07c6b06c631344b84ed563a0",
14
+ "gitHead": "441cd7b06358e430ea6c22a506b7a66cc8768ed6",
15
15
  "devDependencies": {
16
16
  "@types/bn.js": "5.1.1",
17
17
  "@types/ethereum-checksum-address": "^0.0.0",