@prosopo/account 0.3.2 → 0.3.3

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.
@@ -10,6 +10,7 @@ exports.at = util.at;
10
10
  exports.flattenObj = util.flattenObj;
11
11
  exports.get = util.get;
12
12
  exports.getCurrentFileDirectory = util.getCurrentFileDirectory;
13
+ exports.hashToHex = util.hashToHex;
13
14
  exports.isArray = util.isArray;
14
15
  exports.isObject = util.isObject;
15
16
  exports.kebabCase = util.kebabCase;
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const util = require("@polkadot/util");
3
4
  const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
4
5
  function* permutations(bins, options) {
5
6
  if (options?.includeEmpty) {
@@ -141,10 +142,17 @@ const isArray = (value) => {
141
142
  const isObject = (value) => {
142
143
  return value instanceof Object && !isArray(value);
143
144
  };
145
+ const hashToHex = (hash) => {
146
+ if (isArray(hash)) {
147
+ return util.u8aToHex(new Uint8Array(hash));
148
+ }
149
+ return hash.toString();
150
+ };
144
151
  exports.at = at;
145
152
  exports.flattenObj = flattenObj;
146
153
  exports.get = get;
147
154
  exports.getCurrentFileDirectory = getCurrentFileDirectory;
155
+ exports.hashToHex = hashToHex;
148
156
  exports.isArray = isArray;
149
157
  exports.isObject = isObject;
150
158
  exports.kebabCase = kebabCase;
@@ -6,11 +6,11 @@ export declare class ExtensionWeb2 extends Extension {
6
6
  private createAccount;
7
7
  private getFingerprint;
8
8
  getNetwork: (config: ProcaptchaClientConfigOutput) => {
9
- endpoint: string;
10
9
  contract: {
11
- address: string;
12
10
  name: string;
11
+ address: string;
13
12
  };
13
+ endpoint: string;
14
14
  pairType: "ed25519" | "sr25519" | "ecdsa" | "ethereum";
15
15
  ss58Format: number;
16
16
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prosopo/account",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "Services and Utils for Prosopo account gen and management",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -45,12 +45,12 @@
45
45
  "@polkadot/rpc-provider": "10.11.2",
46
46
  "@polkadot/util": "12.6.2",
47
47
  "@polkadot/util-crypto": "12.6.2",
48
- "@prosopo/common": "0.3.2",
49
- "@prosopo/types": "0.3.2",
50
- "@prosopo/util": "0.3.2"
48
+ "@prosopo/common": "0.3.3",
49
+ "@prosopo/types": "0.3.3",
50
+ "@prosopo/util": "0.3.3"
51
51
  },
52
52
  "devDependencies": {
53
- "@prosopo/config": "0.3.2",
53
+ "@prosopo/config": "0.3.3",
54
54
  "tslib": "2.6.2",
55
55
  "typescript": "5.1.6"
56
56
  },