@prosopo/env 1.0.1 → 2.0.0

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/env.cjs CHANGED
@@ -1,40 +1,42 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const Api = require("@polkadot/api/promise/Api");
4
- const database = require("@prosopo/database");
5
3
  const keyring = require("@polkadot/keyring");
6
4
  const common = require("@prosopo/common");
7
- const contract = require("@prosopo/contract");
8
- const ws = require("@polkadot/rpc-provider/ws");
9
- const contractInfo = require("@prosopo/captcha-contract/contract-info");
5
+ const database = require("@prosopo/database");
10
6
  const util = require("@prosopo/util");
11
- const address = require("@polkadot/util-crypto/address");
12
7
  class Environment {
13
8
  constructor(config, pair) {
14
9
  this.config = config;
15
10
  this.defaultEnvironment = this.config.defaultEnvironment;
16
11
  this.defaultNetwork = this.config.defaultNetwork;
17
12
  this.pair = pair;
18
- this.logger = common.getLogger(this.config.logLevel, `ProsopoEnvironment`);
19
- if (this.config.defaultNetwork && Object.prototype.hasOwnProperty.call(this.config.networks, this.config.defaultNetwork) && this.config.networks && this.config.networks[this.defaultNetwork]) {
13
+ this.logger = common.getLogger(this.config.logLevel, "ProsopoEnvironment");
14
+ if (this.config.defaultNetwork && Object.prototype.hasOwnProperty.call(
15
+ this.config.networks,
16
+ this.config.defaultNetwork
17
+ ) && this.config.networks && this.config.networks[this.defaultNetwork]) {
20
18
  const network = this.config.networks[this.defaultNetwork];
21
- this.logger.info(`Endpoint: ${network?.endpoint}`);
22
- this.wsProvider = new ws.WsProvider(network?.endpoint);
23
19
  this.contractAddress = network?.contract.address;
24
20
  this.contractName = network?.contract.name;
25
21
  this.keyring = new keyring.Keyring({
26
22
  type: "sr25519"
27
23
  // TODO get this from the chain
28
24
  });
29
- if (this.pair)
30
- this.keyring.addPair(this.pair);
31
- this.abi = JSON.parse(contractInfo.ContractAbi);
32
- this.importDatabase().catch((err) => {
33
- this.logger.error(err);
34
- });
25
+ if (this.pair) this.keyring.addPair(this.pair);
26
+ if (this.config.database) {
27
+ this.importDatabase().catch((err) => {
28
+ throw new common.ProsopoEnvError("DATABASE.DATABASE_IMPORT_FAILED", {
29
+ context: { error: err },
30
+ logger: this.logger
31
+ });
32
+ });
33
+ }
35
34
  } else {
36
35
  throw new common.ProsopoEnvError("CONFIG.UNKNOWN_ENVIRONMENT", {
37
- context: { constructor: this.constructor.name, environment: this.config.defaultEnvironment }
36
+ context: {
37
+ constructor: this.constructor.name,
38
+ environment: this.config.defaultEnvironment
39
+ }
38
40
  });
39
41
  }
40
42
  }
@@ -44,7 +46,6 @@ class Environment {
44
46
  context: { failedFuncName: this.getSigner.name }
45
47
  });
46
48
  }
47
- await this.getApi().isReadyOrError;
48
49
  try {
49
50
  this.pair = this.keyring.addPair(this.pair);
50
51
  } catch (error) {
@@ -54,86 +55,49 @@ class Environment {
54
55
  }
55
56
  return this.pair;
56
57
  }
57
- getContractInterface() {
58
- if (this.contractInterface === void 0) {
59
- throw new common.ProsopoEnvError("CONTRACT.CONTRACT_UNDEFINED");
60
- }
61
- return this.contractInterface;
62
- }
63
- getApi() {
64
- if (this.api === void 0) {
65
- throw new common.ProsopoEnvError(new Error("api not setup! Please call isReady() first"));
66
- }
67
- return this.api;
68
- }
69
58
  getDb() {
70
59
  if (this.db === void 0) {
71
- throw new common.ProsopoEnvError(new Error("db not setup! Please call isReady() first"));
60
+ throw new common.ProsopoEnvError(
61
+ new Error("db not setup! Please call isReady() first")
62
+ );
72
63
  }
73
64
  return this.db;
74
65
  }
75
66
  getAssetsResolver() {
76
67
  if (this.assetsResolver === void 0) {
77
- throw new common.ProsopoEnvError(new Error("assetsResolver not setup! Please call isReady() first"));
68
+ throw new common.ProsopoEnvError(
69
+ new Error("assetsResolver not setup! Please call isReady() first")
70
+ );
78
71
  }
79
72
  return this.assetsResolver;
80
73
  }
81
74
  getPair() {
82
75
  if (this.pair === void 0) {
83
- throw new common.ProsopoEnvError(new Error("pair not setup! Please call isReady() first"));
76
+ throw new common.ProsopoEnvError(
77
+ new Error("pair not setup! Please call isReady() first")
78
+ );
84
79
  }
85
80
  return this.pair;
86
81
  }
87
- async changeSigner(pair) {
88
- await this.getApi().isReadyOrError;
89
- this.pair = pair;
90
- await this.getSigner();
91
- this.contractInterface = await this.getContractApi();
92
- }
93
- async getContractApi() {
94
- const nonce = this.pair ? await this.getApi().rpc.system.accountNextIndex(this.pair.address) : 0;
95
- if (!address.isAddress(this.contractAddress)) {
96
- throw new common.ProsopoEnvError("CONTRACT.CONTRACT_UNDEFINED");
97
- }
98
- this.contractInterface = new contract.ProsopoCaptchaContract(
99
- this.getApi(),
100
- this.abi,
101
- this.contractAddress,
102
- this.contractName,
103
- parseInt(nonce.toString()),
104
- this.pair,
105
- this.config.logLevel,
106
- this.config.account.address
107
- // allows calling the contract from a public address only
108
- );
109
- return this.contractInterface;
110
- }
111
82
  async isReady() {
112
83
  try {
113
84
  if (this.pair && this.config.account.password && this.pair.isLocked) {
114
85
  this.pair.unlock(this.config.account.password);
115
86
  }
116
- if (!this.api) {
117
- this.api = await Api.ApiPromise.create({ provider: this.wsProvider, initWasm: false, noInitWarn: true });
118
- }
119
87
  await this.getSigner();
120
- if (address.isAddress(this.contractAddress)) {
121
- this.contractInterface = await this.getContractApi();
122
- } else {
123
- console.warn("invalid contract address: " + this.contractAddress);
124
- }
125
88
  if (!this.db) {
126
- await this.importDatabase().catch((err) => {
127
- this.logger.error(err);
128
- });
89
+ await this.importDatabase();
129
90
  }
130
91
  if (this.db && this.db.connection?.readyState !== 1) {
131
- this.logger.warn(`Database connection is not ready, reconnecting...`);
92
+ this.logger.warn("Database connection is not ready, reconnecting...");
132
93
  await this.db.connect();
133
- this.logger.info(`Connected to db`);
94
+ this.logger.info("Connected to db");
134
95
  }
135
96
  } catch (err) {
136
- throw new common.ProsopoEnvError("GENERAL.ENVIRONMENT_NOT_READY", { context: { error: err }, logger: this.logger });
97
+ throw new common.ProsopoEnvError("GENERAL.ENVIRONMENT_NOT_READY", {
98
+ context: { error: err },
99
+ logger: this.logger
100
+ });
137
101
  }
138
102
  }
139
103
  async importDatabase() {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const provider = require("./provider.cjs");
4
3
  const mnemonic = require("@polkadot/util-crypto/mnemonic");
4
+ const provider = require("./provider.cjs");
5
5
  class MockEnvironment extends provider.ProviderEnvironment {
6
6
  createAccountAndAddToKeyring() {
7
7
  const mnemonic$1 = mnemonic.mnemonicGenerate();
package/dist/env.d.ts CHANGED
@@ -1,37 +1,26 @@
1
- import { ApiPromise } from '@polkadot/api/promise/Api';
2
- import { AssetsResolver, ContractAbi, EnvironmentTypes, NetworkNames } from '@prosopo/types';
3
- import { Database } from '@prosopo/types-database';
4
- import { Keyring } from '@polkadot/keyring';
5
- import { KeyringPair } from '@polkadot/keyring/types';
6
- import { Logger } from '@prosopo/common';
7
- import { ProsopoBasicConfigOutput } from '@prosopo/types';
8
- import { ProsopoCaptchaContract } from '@prosopo/contract';
9
- import { ProsopoEnvironment } from '@prosopo/types-env';
10
- import { WsProvider } from '@polkadot/rpc-provider/ws';
1
+ import { Keyring } from "@polkadot/keyring";
2
+ import type { KeyringPair } from "@polkadot/keyring/types";
3
+ import { type Logger } from "@prosopo/common";
4
+ import type { AssetsResolver, EnvironmentTypes, NetworkNames } from "@prosopo/types";
5
+ import type { ProsopoBasicConfigOutput } from "@prosopo/types";
6
+ import type { Database } from "@prosopo/types-database";
7
+ import type { ProsopoEnvironment } from "@prosopo/types-env";
11
8
  export declare class Environment implements ProsopoEnvironment {
12
9
  config: ProsopoBasicConfigOutput;
13
10
  db: Database | undefined;
14
- contractInterface: ProsopoCaptchaContract | undefined;
15
11
  contractAddress: string;
16
12
  defaultEnvironment: EnvironmentTypes;
17
13
  defaultNetwork: NetworkNames;
18
14
  contractName: string;
19
- abi: ContractAbi;
20
15
  logger: Logger;
21
16
  assetsResolver: AssetsResolver | undefined;
22
- wsProvider: WsProvider;
23
17
  keyring: Keyring;
24
18
  pair: KeyringPair | undefined;
25
- api: ApiPromise | undefined;
26
19
  constructor(config: ProsopoBasicConfigOutput, pair?: KeyringPair);
27
20
  getSigner(): Promise<KeyringPair>;
28
- getContractInterface(): ProsopoCaptchaContract;
29
- getApi(): ApiPromise;
30
21
  getDb(): Database;
31
22
  getAssetsResolver(): AssetsResolver;
32
23
  getPair(): KeyringPair;
33
- changeSigner(pair: KeyringPair): Promise<void>;
34
- getContractApi(): Promise<ProsopoCaptchaContract>;
35
24
  isReady(): Promise<void>;
36
25
  importDatabase(): Promise<void>;
37
26
  }
package/dist/env.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AACtD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC5F,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAElD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACrD,OAAO,EAAY,MAAM,EAA8B,MAAM,iBAAiB,CAAA;AAC9E,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAKtD,qBAAa,WAAY,YAAW,kBAAkB;IAClD,MAAM,EAAE,wBAAwB,CAAA;IAChC,EAAE,EAAE,QAAQ,GAAG,SAAS,CAAA;IACxB,iBAAiB,EAAE,sBAAsB,GAAG,S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AAC;AACxD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAG7D,qBAAa,WAAY,YAAW,kBAAkB;IACrD,MAAM,EAAE,wBAAwB,CAAC;IACjC,EAAE,EAAE,QAAQ,GAAG,SAAS,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,kBAAkB,EAAE,gBAAgB,CAAC;IACrC,cAAc,EAAE,YAAY,CAAC;IAC7B,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,cAAc,GAAG,SAAS,CAAC;IAC3C,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,WAAW,GAAG,SAAS,CAAC;gBAElB,MAAM,EAAE,wBAAwB,EAAE,IAAI,CAAC,EAAE,WAAW;IAyC1D,SAAS,IAAI,OAAO,CAAC,WAAW,CAAC;IAkBvC,KAAK,IAAI,QAAQ;IASjB,iBAAiB,IAAI,cAAc;IASnC,OAAO,IAAI,WAAW;IAShB,OAAO;IAuBP,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;CA2BrC"}
package/dist/env.js CHANGED
@@ -1,133 +1,98 @@
1
- import { ApiPromise } from '@polkadot/api/promise/Api';
2
- import { Databases } from '@prosopo/database';
3
- import { Keyring } from '@polkadot/keyring';
4
- import { ProsopoEnvError, getLogger } from '@prosopo/common';
5
- import { ProsopoCaptchaContract } from '@prosopo/contract';
6
- import { WsProvider } from '@polkadot/rpc-provider/ws';
7
- import { ContractAbi as abiJson } from '@prosopo/captcha-contract/contract-info';
8
- import { get } from '@prosopo/util';
9
- import { isAddress } from '@polkadot/util-crypto/address';
1
+ import { Keyring } from "@polkadot/keyring";
2
+ import { ProsopoEnvError, getLogger } from "@prosopo/common";
3
+ import { Databases } from "@prosopo/database";
4
+ import { get } from "@prosopo/util";
10
5
  export class Environment {
11
6
  constructor(config, pair) {
12
7
  this.config = config;
13
8
  this.defaultEnvironment = this.config.defaultEnvironment;
14
9
  this.defaultNetwork = this.config.defaultNetwork;
15
10
  this.pair = pair;
16
- this.logger = getLogger(this.config.logLevel, `ProsopoEnvironment`);
11
+ this.logger = getLogger(this.config.logLevel, "ProsopoEnvironment");
17
12
  if (this.config.defaultNetwork &&
18
13
  Object.prototype.hasOwnProperty.call(this.config.networks, this.config.defaultNetwork) &&
19
14
  this.config.networks &&
20
15
  this.config.networks[this.defaultNetwork]) {
21
16
  const network = this.config.networks[this.defaultNetwork];
22
- this.logger.info(`Endpoint: ${network?.endpoint}`);
23
- this.wsProvider = new WsProvider(network?.endpoint);
24
17
  this.contractAddress = network?.contract.address;
25
18
  this.contractName = network?.contract.name;
26
19
  this.keyring = new Keyring({
27
- type: 'sr25519',
20
+ type: "sr25519",
28
21
  });
29
22
  if (this.pair)
30
23
  this.keyring.addPair(this.pair);
31
- this.abi = JSON.parse(abiJson);
32
- this.importDatabase().catch((err) => {
33
- this.logger.error(err);
34
- });
24
+ if (this.config.database) {
25
+ this.importDatabase().catch((err) => {
26
+ throw new ProsopoEnvError("DATABASE.DATABASE_IMPORT_FAILED", {
27
+ context: { error: err },
28
+ logger: this.logger,
29
+ });
30
+ });
31
+ }
35
32
  }
36
33
  else {
37
- throw new ProsopoEnvError('CONFIG.UNKNOWN_ENVIRONMENT', {
38
- context: { constructor: this.constructor.name, environment: this.config.defaultEnvironment },
34
+ throw new ProsopoEnvError("CONFIG.UNKNOWN_ENVIRONMENT", {
35
+ context: {
36
+ constructor: this.constructor.name,
37
+ environment: this.config.defaultEnvironment,
38
+ },
39
39
  });
40
40
  }
41
41
  }
42
42
  async getSigner() {
43
43
  if (!this.pair) {
44
- throw new ProsopoEnvError('CONTRACT.SIGNER_UNDEFINED', {
44
+ throw new ProsopoEnvError("CONTRACT.SIGNER_UNDEFINED", {
45
45
  context: { failedFuncName: this.getSigner.name },
46
46
  });
47
47
  }
48
- await this.getApi().isReadyOrError;
49
48
  try {
50
49
  this.pair = this.keyring.addPair(this.pair);
51
50
  }
52
51
  catch (error) {
53
- throw new ProsopoEnvError('CONTRACT.SIGNER_UNDEFINED', {
52
+ throw new ProsopoEnvError("CONTRACT.SIGNER_UNDEFINED", {
54
53
  context: { failedFuncName: this.getSigner.name, error },
55
54
  });
56
55
  }
57
56
  return this.pair;
58
57
  }
59
- getContractInterface() {
60
- if (this.contractInterface === undefined) {
61
- throw new ProsopoEnvError('CONTRACT.CONTRACT_UNDEFINED');
62
- }
63
- return this.contractInterface;
64
- }
65
- getApi() {
66
- if (this.api === undefined) {
67
- throw new ProsopoEnvError(new Error('api not setup! Please call isReady() first'));
68
- }
69
- return this.api;
70
- }
71
58
  getDb() {
72
59
  if (this.db === undefined) {
73
- throw new ProsopoEnvError(new Error('db not setup! Please call isReady() first'));
60
+ throw new ProsopoEnvError(new Error("db not setup! Please call isReady() first"));
74
61
  }
75
62
  return this.db;
76
63
  }
77
64
  getAssetsResolver() {
78
65
  if (this.assetsResolver === undefined) {
79
- throw new ProsopoEnvError(new Error('assetsResolver not setup! Please call isReady() first'));
66
+ throw new ProsopoEnvError(new Error("assetsResolver not setup! Please call isReady() first"));
80
67
  }
81
68
  return this.assetsResolver;
82
69
  }
83
70
  getPair() {
84
71
  if (this.pair === undefined) {
85
- throw new ProsopoEnvError(new Error('pair not setup! Please call isReady() first'));
72
+ throw new ProsopoEnvError(new Error("pair not setup! Please call isReady() first"));
86
73
  }
87
74
  return this.pair;
88
75
  }
89
- async changeSigner(pair) {
90
- await this.getApi().isReadyOrError;
91
- this.pair = pair;
92
- await this.getSigner();
93
- this.contractInterface = await this.getContractApi();
94
- }
95
- async getContractApi() {
96
- const nonce = this.pair ? await this.getApi().rpc.system.accountNextIndex(this.pair.address) : 0;
97
- if (!isAddress(this.contractAddress)) {
98
- throw new ProsopoEnvError('CONTRACT.CONTRACT_UNDEFINED');
99
- }
100
- this.contractInterface = new ProsopoCaptchaContract(this.getApi(), this.abi, this.contractAddress, this.contractName, parseInt(nonce.toString()), this.pair, this.config.logLevel, this.config.account.address);
101
- return this.contractInterface;
102
- }
103
76
  async isReady() {
104
77
  try {
105
78
  if (this.pair && this.config.account.password && this.pair.isLocked) {
106
79
  this.pair.unlock(this.config.account.password);
107
80
  }
108
- if (!this.api) {
109
- this.api = await ApiPromise.create({ provider: this.wsProvider, initWasm: false, noInitWarn: true });
110
- }
111
81
  await this.getSigner();
112
- if (isAddress(this.contractAddress)) {
113
- this.contractInterface = await this.getContractApi();
114
- }
115
- else {
116
- console.warn('invalid contract address: ' + this.contractAddress);
117
- }
118
82
  if (!this.db) {
119
- await this.importDatabase().catch((err) => {
120
- this.logger.error(err);
121
- });
83
+ await this.importDatabase();
122
84
  }
123
85
  if (this.db && this.db.connection?.readyState !== 1) {
124
- this.logger.warn(`Database connection is not ready, reconnecting...`);
86
+ this.logger.warn("Database connection is not ready, reconnecting...");
125
87
  await this.db.connect();
126
- this.logger.info(`Connected to db`);
88
+ this.logger.info("Connected to db");
127
89
  }
128
90
  }
129
91
  catch (err) {
130
- throw new ProsopoEnvError('GENERAL.ENVIRONMENT_NOT_READY', { context: { error: err }, logger: this.logger });
92
+ throw new ProsopoEnvError("GENERAL.ENVIRONMENT_NOT_READY", {
93
+ context: { error: err },
94
+ logger: this.logger,
95
+ });
131
96
  }
132
97
  }
133
98
  async importDatabase() {
@@ -141,7 +106,7 @@ export class Environment {
141
106
  }
142
107
  }
143
108
  catch (error) {
144
- throw new ProsopoEnvError('DATABASE.DATABASE_IMPORT_FAILED', {
109
+ throw new ProsopoEnvError("DATABASE.DATABASE_IMPORT_FAILED", {
145
110
  context: {
146
111
  error,
147
112
  environment: this.config.database
package/dist/env.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"env.js","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAGtD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAE3C,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AM,EACX,QAAQ,CAAC,UAAU,CACnB,CAAC;iBACF;aACD;SACD;QAAC,OAAO,KAAK,EAAE;YACf,MAAM,IAAI,eAAe,CAAC,iCAAiC,EAAE;gBAC5D,OAAO,EAAE;oBACR,KAAK;oBACL,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ;wBAChC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,kBAAkB,CAAC;4BAC9C,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,kBAAkB,CAAC,EAAE,IAAI;4BACrD,CAAC,CAAC,SAAS;wBACZ,CAAC,CAAC,SAAS;iBACZ;aACD,CAAC,CAAC;SACH;IACF,CAAC;CACD"}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { Environment } from './env.js';
2
- export { ProviderEnvironment } from './provider.js';
3
- export * from './mockenv.js';
1
+ export { Environment } from "./env.js";
2
+ export { ProviderEnvironment } from "./provider.js";
3
+ export * from "./mockenv.js";
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AACnD,cAAc,cAAc,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,cAAc,cAAc,CAAC"}
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { Environment } from './env.js';
2
- export { ProviderEnvironment } from './provider.js';
3
- export * from './mockenv.js';
1
+ export { Environment } from "./env.js";
2
+ export { ProviderEnvironment } from "./provider.js";
3
+ export * from "./mockenv.js";
4
4
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AACnD,cAAc,cAAc,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,cAAc,cAAc,CAAC"}
package/dist/mockenv.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /// <reference types="bn.js" />
2
- import { BN } from '@polkadot/util/bn';
3
- import { Dapp, Provider } from '@prosopo/captcha-contract/types-returns';
4
- import { ProviderEnvironment } from './provider.js';
2
+ import type { BN } from "@polkadot/util/bn";
3
+ import type { Dapp, Provider } from "@prosopo/types";
4
+ import { ProviderEnvironment } from "./provider.js";
5
5
  export type TestAccount = {
6
6
  mnemonic: string;
7
7
  address: string;
@@ -1 +1 @@
1
- {"version":3,"file":"mockenv.d.ts","sourceRoot":"","sources":["../src/mockenv.ts"],"names":[],"mappings":";AAaA,OAAO,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAA;AACtC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AAGnD,MAAM,MAAM,WAAW,GAAG;IACtB,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,eAAe,EAAE,MAAM,GAAG,SAAS,CAAA;CACtC,CAAA;AAED,MAAM,WAAW,mBAAoB,SAAQ,WAAW;IACpD,aAAa,EAAE,QAAQ,CAAA;CAC1B;AAED,MAAM,WAAW,cAAe,SAAQ,WAAW;IAC/C,aAAa,EAAE,IAAI,CAAA;CACtB;AAED,qBAAa,eAAgB,SAAQ,mBAAmB;IAC7C,4BAA4B,IAAI,WAAW;CAMrD;AAED,MAAM,WAAW,eAAe;IAC5B,GAAG,EAAE,eAAe,CAAA;IACpB,sBAAsB,EAAE,EAAE,CAAA;IAC1B,kBAAkB,EAAE,EAAE,CAAA;CACzB"}
1
+ {"version":3,"file":"mockenv.d.ts","sourceRoot":"","sources":["../src/mockenv.ts"],"names":[],"mappings":";AAcA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEpD,MAAM,MAAM,WAAW,GAAG;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC,CAAC;AAEF,MAAM,WAAW,mBAAoB,SAAQ,WAAW;IACvD,aAAa,EAAE,QAAQ,CAAC;CACxB;AAED,MAAM,WAAW,cAAe,SAAQ,WAAW;IAClD,aAAa,EAAE,IAAI,CAAC;CACpB;AAED,qBAAa,eAAgB,SAAQ,mBAAmB;IAChD,4BAA4B,IAAI,WAAW;CAMlD;AAED,MAAM,WAAW,eAAe;IAC/B,GAAG,EAAE,eAAe,CAAC;IACrB,sBAAsB,EAAE,EAAE,CAAC;IAC3B,kBAAkB,EAAE,EAAE,CAAC;CACvB"}
package/dist/mockenv.js CHANGED
@@ -1,5 +1,5 @@
1
- import { ProviderEnvironment } from './provider.js';
2
- import { mnemonicGenerate } from '@polkadot/util-crypto/mnemonic';
1
+ import { mnemonicGenerate } from "@polkadot/util-crypto/mnemonic";
2
+ import { ProviderEnvironment } from "./provider.js";
3
3
  export class MockEnvironment extends ProviderEnvironment {
4
4
  createAccountAndAddToKeyring() {
5
5
  const mnemonic = mnemonicGenerate();
@@ -1 +1 @@
1
- {"version":3,"file":"mockenv.js","sourceRoot":"","sources":["../src/mockenv.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAgBjE,MAAM,OAAO,eAAgB,SAAQ,mBAAmB;IAC7C,4BAA4B;QAC/B,MAAM,QAAQ,GAAW,gBAAgB,EAAE,CAAA;QAC3C,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAA;QACtD,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAA;QAC3B,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,SAAS,EAAE,CAAA;IAC5D,CAAC;CACJ"}
1
+ {"version":3,"file":"mockenv.js","sourceRoot":"","sources":["../src/mockenv.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAgBlE,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAgBpD,MAAM,OAAO,eAAgB,SAAQ,mBAAmB;IAChD,4BAA4B;QAClC,MAAM,QAAQ,GAAW,gBAAgB,EAAE,CAAC;QAC5C,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;QACvD,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;QAC5B,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,SAAS,EAAE,CAAC;IAC1D,CAAC;CACD"}
@@ -1,5 +1,5 @@
1
- import { Environment } from './env.js';
2
- import { ProsopoConfigOutput } from '@prosopo/types';
1
+ import type { ProsopoConfigOutput } from "@prosopo/types";
2
+ import { Environment } from "./env.js";
3
3
  export declare class ProviderEnvironment extends Environment {
4
4
  config: ProsopoConfigOutput;
5
5
  }
@@ -1 +1 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAEpD,qBAAa,mBAAoB,SAAQ,WAAW;IACxC,MAAM,EAAE,mBAAmB,CAAA;CACtC"}
1
+ {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAc1D,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,qBAAa,mBAAoB,SAAQ,WAAW;IAC3C,MAAM,EAAE,mBAAmB,CAAC;CACpC"}
package/dist/provider.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Environment } from './env.js';
1
+ import { Environment } from "./env.js";
2
2
  export class ProviderEnvironment extends Environment {
3
3
  }
4
4
  //# sourceMappingURL=provider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"provider.js","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAGtC,MAAM,OAAO,mBAAoB,SAAQ,WAAW;CAEnD"}
1
+ {"version":3,"file":"provider.js","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,MAAM,OAAO,mBAAoB,SAAQ,WAAW;CAEnD"}
package/package.json CHANGED
@@ -1,54 +1,49 @@
1
1
  {
2
- "name": "@prosopo/env",
3
- "version": "1.0.1",
4
- "description": "Path env prosopo environment",
5
- "main": "dist/index.js",
6
- "type": "module",
7
- "engines": {
8
- "node": ">=18",
9
- "npm": ">=9"
10
- },
11
- "exports": {
12
- ".": {
13
- "import": "./dist/index.js",
14
- "require": "./dist/cjs/index.cjs"
15
- }
16
- },
17
- "scripts": {
18
- "test": "echo \"No test specified\"",
19
- "clean": "tsc --build --clean",
20
- "build": "tsc --build --verbose tsconfig.json",
21
- "build:cjs": "npx vite --config vite.cjs.config.ts build",
22
- "eslint": "npx eslint . --no-error-on-unmatched-pattern --ignore-path ../../.eslintignore --quiet",
23
- "eslint:fix": "npm run eslint -- --fix",
24
- "prettier": "npx prettier . --check --no-error-on-unmatched-pattern --ignore-path ../../.eslintignore",
25
- "prettier:fix": "npm run prettier -- --write",
26
- "lint": "npm run eslint && npm run prettier",
27
- "lint:fix": "npm run eslint:fix && npm run prettier:fix"
28
- },
29
- "dependencies": {
30
- "@polkadot/api": "10.13.1",
31
- "@polkadot/keyring": "12.6.2",
32
- "@polkadot/rpc-provider": "10.13.1",
33
- "@polkadot/util": "12.6.2",
34
- "@polkadot/util-crypto": "12.6.2",
35
- "@prosopo/captcha-contract": "1.0.1",
36
- "@prosopo/common": "1.0.1",
37
- "@prosopo/contract": "1.0.1",
38
- "@prosopo/database": "1.0.1",
39
- "@prosopo/types": "1.0.1",
40
- "@prosopo/types-database": "1.0.1",
41
- "@prosopo/types-env": "1.0.1",
42
- "@prosopo/util": "1.0.1"
43
- },
44
- "overrides": {
45
- "@polkadot/keyring": "12.6.2"
46
- },
47
- "devDependencies": {
48
- "tslib": "2.6.2",
49
- "typescript": "5.1.6"
50
- },
51
- "author": "Prosopo",
52
- "license": "Apache-2.0",
53
- "sideEffects": false
2
+ "name": "@prosopo/env",
3
+ "version": "2.0.0",
4
+ "description": "Path env prosopo environment",
5
+ "main": "dist/index.js",
6
+ "type": "module",
7
+ "engines": {
8
+ "node": ">=20",
9
+ "npm": ">=9"
10
+ },
11
+ "exports": {
12
+ ".": {
13
+ "import": "./dist/index.js",
14
+ "require": "./dist/cjs/index.cjs"
15
+ }
16
+ },
17
+ "scripts": {
18
+ "test": "echo \"No test specified\"",
19
+ "clean": "tsc --build --clean",
20
+ "build": "tsc --build --verbose",
21
+ "build:cjs": "npx vite --config vite.cjs.config.ts build"
22
+ },
23
+ "dependencies": {
24
+ "@polkadot/api": "10.13.1",
25
+ "@polkadot/keyring": "12.6.2",
26
+ "@polkadot/rpc-provider": "10.13.1",
27
+ "@polkadot/util": "12.6.2",
28
+ "@polkadot/util-crypto": "12.6.2",
29
+
30
+ "@prosopo/common": "2.0.0",
31
+ "@prosopo/contract": "2.0.0",
32
+ "@prosopo/database": "2.0.0",
33
+ "@prosopo/types": "2.0.0",
34
+ "@prosopo/types-database": "2.0.0",
35
+ "@prosopo/types-env": "2.0.0",
36
+ "@prosopo/util": "2.0.0"
37
+ },
38
+ "overrides": {
39
+ "@polkadot/keyring": "12.6.2"
40
+ },
41
+ "devDependencies": {
42
+ "@prosopo/config": "2.0.0",
43
+ "tslib": "2.6.2",
44
+ "typescript": "5.1.6"
45
+ },
46
+ "author": "Prosopo",
47
+ "license": "Apache-2.0",
48
+ "sideEffects": false
54
49
  }
@@ -1,3 +1,4 @@
1
+ import path from "node:path";
1
2
  // Copyright 2021-2024 Prosopo (UK) Ltd.
2
3
  //
3
4
  // Licensed under the Apache License, Version 2.0 (the "License");
@@ -11,9 +12,8 @@
11
12
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
13
  // See the License for the specific language governing permissions and
13
14
  // limitations under the License.
14
- import { ViteCommonJSConfig } from '@prosopo/config'
15
- import path from 'path'
15
+ import { ViteCommonJSConfig } from "@prosopo/config";
16
16
 
17
17
  export default function () {
18
- return ViteCommonJSConfig('env', path.resolve('./tsconfig.cjs.json'))
18
+ return ViteCommonJSConfig("env", path.resolve("./tsconfig.cjs.json"));
19
19
  }
package/typedoc.config.js DELETED
@@ -1,19 +0,0 @@
1
- // Copyright 2021-2024 Prosopo (UK) Ltd.
2
- //
3
- // Licensed under the Apache License, Version 2.0 (the "License");
4
- // you may not use this file except in compliance with the License.
5
- // You may obtain a copy of the License at
6
- //
7
- // http://www.apache.org/licenses/LICENSE-2.0
8
- //
9
- // Unless required by applicable law or agreed to in writing, software
10
- // distributed under the License is distributed on an "AS IS" BASIS,
11
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- // See the License for the specific language governing permissions and
13
- // limitations under the License.
14
- export default {
15
- entryPoints: ['src/**/*.ts', 'src/**/*.tsx', 'src/**/*.js', 'src/**/*.jsx', 'src/**/*.json'],
16
- includes: 'src',
17
- extends: '../../typedoc.base.config.js',
18
- readme: 'README.md',
19
- }