@prosopo/env 0.2.13 → 0.2.15

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,15 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const api = require("@polkadot/api");
3
+ const Api = require("@polkadot/api/promise/Api");
4
4
  const database = require("@prosopo/database");
5
5
  const keyring = require("@polkadot/keyring");
6
6
  const common = require("@prosopo/common");
7
7
  const contract = require("@prosopo/contract");
8
- const rpcProvider = require("@polkadot/rpc-provider");
9
- require("./contracts/captcha/dist/index.cjs");
8
+ const ws = require("@polkadot/rpc-provider/ws");
9
+ const contractInfo = require("@prosopo/captcha-contract/contract-info");
10
10
  const util = require("@prosopo/util");
11
- const utilCrypto = require("@polkadot/util-crypto");
12
- const captcha = require("./contracts/captcha/dist/contract-info/captcha.cjs");
11
+ const address = require("@polkadot/util-crypto/address");
13
12
  class Environment {
14
13
  constructor(config, pair) {
15
14
  this.config = config;
@@ -17,10 +16,10 @@ class Environment {
17
16
  this.defaultNetwork = this.config.defaultNetwork;
18
17
  this.pair = pair;
19
18
  this.logger = common.getLogger(this.config.logLevel, `ProsopoEnvironment`);
20
- if (this.config.defaultEnvironment && Object.prototype.hasOwnProperty.call(this.config.networks, this.config.defaultEnvironment) && this.config.networks && this.config.networks[this.defaultNetwork]) {
19
+ if (this.config.defaultNetwork && Object.prototype.hasOwnProperty.call(this.config.networks, this.config.defaultNetwork) && this.config.networks && this.config.networks[this.defaultNetwork]) {
21
20
  const network = this.config.networks[this.defaultNetwork];
22
21
  this.logger.info(`Endpoint: ${network == null ? void 0 : network.endpoint}`);
23
- this.wsProvider = new rpcProvider.WsProvider(network == null ? void 0 : network.endpoint);
22
+ this.wsProvider = new ws.WsProvider(network == null ? void 0 : network.endpoint);
24
23
  this.contractAddress = network == null ? void 0 : network.contract.address;
25
24
  this.contractName = network == null ? void 0 : network.contract.name;
26
25
  this.keyring = new keyring.Keyring({
@@ -29,7 +28,7 @@ class Environment {
29
28
  });
30
29
  if (this.pair)
31
30
  this.keyring.addPair(this.pair);
32
- this.abi = JSON.parse(captcha.ContractAbi);
31
+ this.abi = JSON.parse(contractInfo.ContractAbi);
33
32
  this.importDatabase().catch((err) => {
34
33
  this.logger.error(err);
35
34
  });
@@ -72,7 +71,7 @@ class Environment {
72
71
  }
73
72
  async getContractApi() {
74
73
  const nonce = this.pair ? await this.getApi().rpc.system.accountNextIndex(this.pair.address) : 0;
75
- if (!utilCrypto.isAddress(this.contractAddress)) {
74
+ if (!address.isAddress(this.contractAddress)) {
76
75
  throw new common.ProsopoEnvError("CONTRACT.CONTRACT_UNDEFINED");
77
76
  }
78
77
  this.contractInterface = new contract.ProsopoCaptchaContract(
@@ -95,10 +94,10 @@ class Environment {
95
94
  this.pair.unlock(this.config.account.password);
96
95
  }
97
96
  if (!this.api) {
98
- this.api = await api.ApiPromise.create({ provider: this.wsProvider });
97
+ this.api = await Api.ApiPromise.create({ provider: this.wsProvider, initWasm: false });
99
98
  }
100
99
  await this.getSigner();
101
- if (utilCrypto.isAddress(this.contractAddress)) {
100
+ if (address.isAddress(this.contractAddress)) {
102
101
  this.contractInterface = await this.getContractApi();
103
102
  }
104
103
  if (!this.db) {
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const provider = require("./provider.cjs");
4
- const utilCrypto = require("@polkadot/util-crypto");
4
+ const mnemonic = require("@polkadot/util-crypto/mnemonic");
5
5
  class MockEnvironment extends provider.ProviderEnvironment {
6
6
  createAccountAndAddToKeyring() {
7
- const mnemonic = utilCrypto.mnemonicGenerate();
8
- const account = this.keyring.addFromMnemonic(mnemonic);
7
+ const mnemonic$1 = mnemonic.mnemonicGenerate();
8
+ const account = this.keyring.addFromMnemonic(mnemonic$1);
9
9
  const { address } = account;
10
- return [mnemonic, address];
10
+ return [mnemonic$1, address];
11
11
  }
12
12
  }
13
13
  exports.MockEnvironment = MockEnvironment;
package/dist/env.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ApiPromise } from '@polkadot/api';
1
+ import { ApiPromise } from '@polkadot/api/promise/Api';
2
2
  import { AssetsResolver, ContractAbi, EnvironmentTypes, NetworkNames } from '@prosopo/types';
3
3
  import { Database } from '@prosopo/types-database';
4
4
  import { Keyring } from '@polkadot/keyring';
@@ -7,7 +7,7 @@ import { Logger } from '@prosopo/common';
7
7
  import { ProsopoBasicConfigOutput } from '@prosopo/types';
8
8
  import { ProsopoCaptchaContract } from '@prosopo/contract';
9
9
  import { ProsopoEnvironment } from '@prosopo/types-env';
10
- import { WsProvider } from '@polkadot/rpc-provider';
10
+ import { WsProvider } from '@polkadot/rpc-provider/ws';
11
11
  export declare class Environment implements ProsopoEnvironment {
12
12
  config: ProsopoBasicConfigOutput;
13
13
  db: Database | undefined;
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,eAAe,CAAA;AAC1C,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,wBAAwB,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, 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
- import { ApiPromise } from '@polkadot/api';
1
+ import { ApiPromise } from '@polkadot/api/promise/Api';
15
2
  import { Databases } from '@prosopo/database';
16
3
  import { Keyring } from '@polkadot/keyring';
17
4
  import { ProsopoEnvError, getLogger } from '@prosopo/common';
18
5
  import { ProsopoCaptchaContract } from '@prosopo/contract';
19
- import { WsProvider } from '@polkadot/rpc-provider';
20
- import { ContractAbi as abiJson } from '@prosopo/captcha-contract';
6
+ import { WsProvider } from '@polkadot/rpc-provider/ws';
7
+ import { ContractAbi as abiJson } from '@prosopo/captcha-contract/contract-info';
21
8
  import { get } from '@prosopo/util';
22
- import { isAddress } from '@polkadot/util-crypto';
9
+ import { isAddress } from '@polkadot/util-crypto/address';
23
10
  export class Environment {
24
11
  constructor(config, pair) {
25
12
  this.config = config;
@@ -27,8 +14,8 @@ export class Environment {
27
14
  this.defaultNetwork = this.config.defaultNetwork;
28
15
  this.pair = pair;
29
16
  this.logger = getLogger(this.config.logLevel, `ProsopoEnvironment`);
30
- if (this.config.defaultEnvironment &&
31
- Object.prototype.hasOwnProperty.call(this.config.networks, this.config.defaultEnvironment) &&
17
+ if (this.config.defaultNetwork &&
18
+ Object.prototype.hasOwnProperty.call(this.config.networks, this.config.defaultNetwork) &&
32
19
  this.config.networks &&
33
20
  this.config.networks[this.defaultNetwork]) {
34
21
  const network = this.config.networks[this.defaultNetwork];
@@ -37,7 +24,7 @@ export class Environment {
37
24
  this.contractAddress = network?.contract.address;
38
25
  this.contractName = network?.contract.name;
39
26
  this.keyring = new Keyring({
40
- type: 'sr25519', // TODO get this from the chain
27
+ type: 'sr25519',
41
28
  });
42
29
  if (this.pair)
43
30
  this.keyring.addPair(this.pair);
@@ -84,8 +71,7 @@ export class Environment {
84
71
  if (!isAddress(this.contractAddress)) {
85
72
  throw new ProsopoEnvError('CONTRACT.CONTRACT_UNDEFINED');
86
73
  }
87
- this.contractInterface = new ProsopoCaptchaContract(this.getApi(), this.abi, this.contractAddress, this.contractName, parseInt(nonce.toString()), this.pair, this.config.logLevel, this.config.account.address // allows calling the contract from a public address only
88
- );
74
+ this.contractInterface = new ProsopoCaptchaContract(this.getApi(), this.abi, this.contractAddress, this.contractName, parseInt(nonce.toString()), this.pair, this.config.logLevel, this.config.account.address);
89
75
  return this.contractInterface;
90
76
  }
91
77
  async isReady() {
@@ -94,10 +80,9 @@ export class Environment {
94
80
  this.pair.unlock(this.config.account.password);
95
81
  }
96
82
  if (!this.api) {
97
- this.api = await ApiPromise.create({ provider: this.wsProvider });
83
+ this.api = await ApiPromise.create({ provider: this.wsProvider, initWasm: false });
98
84
  }
99
85
  await this.getSigner();
100
- // make sure contract address is valid before trying to load contract interface
101
86
  if (isAddress(this.contractAddress)) {
102
87
  this.contractInterface = await this.getContractApi();
103
88
  }
@@ -114,7 +99,6 @@ export class Environment {
114
99
  }
115
100
  catch (err) {
116
101
  this.logger.error(err);
117
- // TODO fix / improve error handling
118
102
  throw new ProsopoEnvError(err, 'GENERAL.ENVIRONMENT_NOT_READY');
119
103
  }
120
104
  }
@@ -129,7 +113,6 @@ export class Environment {
129
113
  }
130
114
  }
131
115
  catch (err) {
132
- // TODO fix/improve error handling
133
116
  throw new ProsopoEnvError(err, 'DATABASE.DATABASE_IMPORT_FAILED', {}, this.config.database
134
117
  ? this.config.database[this.defaultEnvironment]
135
118
  ? this.config.database[this.defaultEnvironment]?.type
package/dist/env.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"env.js","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,EAAE;AACF,kEAAkE;A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,iBAAiB,CAAC,CAAA;aACtC;SACJ;QAAC,OAAO,GAAG,EAAE;YACV,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;YAEtB,MAAM,IAAI,eAAe,CAAC,GAAY,EAAE,+BAA+B,CAAC,CAAA;SAC3E;IACL,CAAC;IAED,KAAK,CAAC,cAAc;QAChB,IAAI;YACA,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;gBACtB,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA;gBAC9D,IAAI,QAAQ,EAAE;oBACV,MAAM,eAAe,GAAG,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAA;oBACrD,IAAI,CAAC,EAAE,GAAG,MAAM,eAAe,CAAC,MAAM,CAClC,QAAQ,CAAC,QAAQ,EACjB,QAAQ,CAAC,MAAM,EACf,IAAI,CAAC,MAAM,EACX,QAAQ,CAAC,UAAU,CACtB,CAAA;iBACJ;aACJ;SACJ;QAAC,OAAO,GAAG,EAAE;YAEV,MAAM,IAAI,eAAe,CACrB,GAAY,EACZ,iCAAiC,EACjC,EAAE,EACF,IAAI,CAAC,MAAM,CAAC,QAAQ;gBAChB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,kBAAkB,CAAC;oBAC3C,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,kBAAkB,CAAC,EAAE,IAAI;oBACrD,CAAC,CAAC,SAAS;gBACf,CAAC,CAAC,SAAS,CAClB,CAAA;SACJ;IACL,CAAC;CACJ"}
package/dist/index.js CHANGED
@@ -1,16 +1,3 @@
1
- // Copyright 2021-2023 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
1
  export { Environment } from './env.js';
15
2
  export { ProviderEnvironment } from './provider.js';
16
3
  export { MockEnvironment } from './mockenv.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,EAAE,eAAe,EAAwB,MAAM,cAAc,CAAA"}
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,OAAO,EAAE,eAAe,EAAwB,MAAM,cAAc,CAAA"}
package/dist/mockenv.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /// <reference types="bn.js" />
2
- import { BN } from '@polkadot/util';
2
+ import { BN } from '@polkadot/util/bn';
3
3
  import { ProviderEnvironment } from './provider.js';
4
4
  export declare class MockEnvironment extends ProviderEnvironment {
5
5
  createAccountAndAddToKeyring(): [string, string];
@@ -1 +1 @@
1
- {"version":3,"file":"mockenv.d.ts","sourceRoot":"","sources":["../src/mockenv.ts"],"names":[],"mappings":";AAaA,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAA;AACnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AAEnD,qBAAa,eAAgB,SAAQ,mBAAmB;IAC7C,4BAA4B,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC;CAM1D;AAED,MAAM,WAAW,eAAe;IAC5B,GAAG,EAAE,eAAe,CAAA;IACpB,sBAAsB,EAAE,EAAE,CAAA;CAC7B"}
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,mBAAmB,EAAE,MAAM,eAAe,CAAA;AAEnD,qBAAa,eAAgB,SAAQ,mBAAmB;IAC7C,4BAA4B,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC;CAM1D;AAED,MAAM,WAAW,eAAe;IAC5B,GAAG,EAAE,eAAe,CAAA;IACpB,sBAAsB,EAAE,EAAE,CAAA;CAC7B"}
package/dist/mockenv.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ProviderEnvironment } from './provider.js';
2
- import { mnemonicGenerate } from '@polkadot/util-crypto';
2
+ import { mnemonicGenerate } from '@polkadot/util-crypto/mnemonic';
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":"AAcA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,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,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IAC9B,CAAC;CACJ"}
1
+ {"version":3,"file":"mockenv.js","sourceRoot":"","sources":["../src/mockenv.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AACjE,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,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IAC9B,CAAC;CACJ"}
package/dist/provider.js CHANGED
@@ -1,16 +1,3 @@
1
- // Copyright 2021-2023 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
1
  import { Environment } from './env.js';
15
2
  export class ProviderEnvironment extends Environment {
16
3
  }
@@ -1 +1 @@
1
- {"version":3,"file":"provider.js","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AACjC,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":"AAaA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAGtC,MAAM,OAAO,mBAAoB,SAAQ,WAAW;CAEnD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prosopo/env",
3
- "version": "0.2.13",
3
+ "version": "0.2.15",
4
4
  "description": "Path env prosopo environment",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -23,13 +23,13 @@
23
23
  },
24
24
  "dependencies": {
25
25
  "@polkadot/util-crypto": "12.5.1",
26
- "@prosopo/common": "0.2.13",
27
- "@prosopo/contract": "0.2.13",
28
- "@prosopo/database": "0.2.13",
29
- "@prosopo/types": "0.2.13",
30
- "@prosopo/types-database": "0.2.13",
31
- "@prosopo/types-env": "0.2.13",
32
- "@prosopo/util": "0.2.13",
26
+ "@prosopo/common": "0.2.15",
27
+ "@prosopo/contract": "0.2.15",
28
+ "@prosopo/database": "0.2.15",
29
+ "@prosopo/types": "0.2.15",
30
+ "@prosopo/types-database": "0.2.15",
31
+ "@prosopo/types-env": "0.2.15",
32
+ "@prosopo/util": "0.2.15",
33
33
  "dotenv": "^16.0.1"
34
34
  },
35
35
  "overrides": {
@@ -1,339 +0,0 @@
1
- "use strict";
2
- const typechainTypes = require("@727-ventures/typechain-types");
3
- class Methods {
4
- constructor(nativeContract, apiPromise) {
5
- this.__nativeContract = nativeContract;
6
- this.__apiPromise = apiPromise;
7
- }
8
- /**
9
- * getGitCommitId
10
- *
11
- */
12
- getGitCommitId(__options) {
13
- return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getGitCommitId", [], __options);
14
- }
15
- /**
16
- * getAdmin
17
- *
18
- */
19
- getAdmin(__options) {
20
- return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getAdmin", [], __options);
21
- }
22
- /**
23
- * getPayees
24
- *
25
- */
26
- getPayees(__options) {
27
- return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getPayees", [], __options);
28
- }
29
- /**
30
- * getDappPayees
31
- *
32
- */
33
- getDappPayees(__options) {
34
- return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getDappPayees", [], __options);
35
- }
36
- /**
37
- * getStatuses
38
- *
39
- */
40
- getStatuses(__options) {
41
- return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getStatuses", [], __options);
42
- }
43
- /**
44
- * getProviderStakeThreshold
45
- *
46
- */
47
- getProviderStakeThreshold(__options) {
48
- return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getProviderStakeThreshold", [], __options);
49
- }
50
- /**
51
- * getDappStakeThreshold
52
- *
53
- */
54
- getDappStakeThreshold(__options) {
55
- return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getDappStakeThreshold", [], __options);
56
- }
57
- /**
58
- * getMaxProviderFee
59
- *
60
- */
61
- getMaxProviderFee(__options) {
62
- return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getMaxProviderFee", [], __options);
63
- }
64
- /**
65
- * getMinNumActiveProviders
66
- *
67
- */
68
- getMinNumActiveProviders(__options) {
69
- return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getMinNumActiveProviders", [], __options);
70
- }
71
- /**
72
- * getBlockTime
73
- *
74
- */
75
- getBlockTime(__options) {
76
- return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getBlockTime", [], __options);
77
- }
78
- /**
79
- * getMaxUserHistoryAgeSeconds
80
- *
81
- */
82
- getMaxUserHistoryAgeSeconds(__options) {
83
- return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getMaxUserHistoryAgeSeconds", [], __options);
84
- }
85
- /**
86
- * getMaxUserHistoryLen
87
- *
88
- */
89
- getMaxUserHistoryLen(__options) {
90
- return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getMaxUserHistoryLen", [], __options);
91
- }
92
- /**
93
- * getMaxUserHistoryAgeBlocks
94
- *
95
- */
96
- getMaxUserHistoryAgeBlocks(__options) {
97
- return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getMaxUserHistoryAgeBlocks", [], __options);
98
- }
99
- /**
100
- * providerRegister
101
- *
102
- * @param { Array<(number | string | BN)> } url,
103
- * @param { (number | string | BN) } fee,
104
- * @param { ArgumentTypes.Payee } payee,
105
- */
106
- providerRegister(url, fee, payee, __options) {
107
- return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "providerRegister", [url, fee, payee], __options);
108
- }
109
- /**
110
- * providerUpdate
111
- *
112
- * @param { Array<(number | string | BN)> } url,
113
- * @param { (number | string | BN) } fee,
114
- * @param { ArgumentTypes.Payee } payee,
115
- */
116
- providerUpdate(url, fee, payee, __options) {
117
- return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "providerUpdate", [url, fee, payee], __options);
118
- }
119
- /**
120
- * providerDeactivate
121
- *
122
- */
123
- providerDeactivate(__options) {
124
- return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "providerDeactivate", [], __options);
125
- }
126
- /**
127
- * providerDeregister
128
- *
129
- */
130
- providerDeregister(__options) {
131
- return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "providerDeregister", [], __options);
132
- }
133
- /**
134
- * getProvider
135
- *
136
- * @param { ArgumentTypes.AccountId } account,
137
- */
138
- getProvider(account, __options) {
139
- return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getProvider", [account], __options);
140
- }
141
- /**
142
- * providerFund
143
- *
144
- */
145
- providerFund(__options) {
146
- return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "providerFund", [], __options);
147
- }
148
- /**
149
- * providerSetDataset
150
- *
151
- * @param { ArgumentTypes.Hash } datasetId,
152
- * @param { ArgumentTypes.Hash } datasetIdContent,
153
- */
154
- providerSetDataset(datasetId, datasetIdContent, __options) {
155
- return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "providerSetDataset", [datasetId, datasetIdContent], __options);
156
- }
157
- /**
158
- * getDapp
159
- *
160
- * @param { ArgumentTypes.AccountId } contract,
161
- */
162
- getDapp(contract, __options) {
163
- return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getDapp", [contract], __options);
164
- }
165
- /**
166
- * dappRegister
167
- *
168
- * @param { ArgumentTypes.AccountId } contract,
169
- * @param { ArgumentTypes.DappPayee } payee,
170
- */
171
- dappRegister(contract, payee, __options) {
172
- return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "dappRegister", [contract, payee], __options);
173
- }
174
- /**
175
- * dappUpdate
176
- *
177
- * @param { ArgumentTypes.AccountId } contract,
178
- * @param { ArgumentTypes.DappPayee } payee,
179
- * @param { ArgumentTypes.AccountId } owner,
180
- */
181
- dappUpdate(contract, payee, owner, __options) {
182
- return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "dappUpdate", [contract, payee, owner], __options);
183
- }
184
- /**
185
- * dappFund
186
- *
187
- * @param { ArgumentTypes.AccountId } contract,
188
- */
189
- dappFund(contract, __options) {
190
- return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "dappFund", [contract], __options);
191
- }
192
- /**
193
- * dappDeregister
194
- *
195
- * @param { ArgumentTypes.AccountId } contract,
196
- */
197
- dappDeregister(contract, __options) {
198
- return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "dappDeregister", [contract], __options);
199
- }
200
- /**
201
- * dappDeactivate
202
- *
203
- * @param { ArgumentTypes.AccountId } contract,
204
- */
205
- dappDeactivate(contract, __options) {
206
- return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "dappDeactivate", [contract], __options);
207
- }
208
- /**
209
- * getUserHistorySummary
210
- *
211
- * @param { ArgumentTypes.AccountId } userAccount,
212
- */
213
- getUserHistorySummary(userAccount, __options) {
214
- return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getUserHistorySummary", [userAccount], __options);
215
- }
216
- /**
217
- * providerCommit
218
- *
219
- * @param { ArgumentTypes.Commit } commit,
220
- */
221
- providerCommit(commit, __options) {
222
- return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "providerCommit", [commit], __options);
223
- }
224
- /**
225
- * providerCommitMany
226
- *
227
- * @param { Array<ArgumentTypes.Commit> } commits,
228
- */
229
- providerCommitMany(commits, __options) {
230
- return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "providerCommitMany", [commits], __options);
231
- }
232
- /**
233
- * dappOperatorIsHumanUser
234
- *
235
- * @param { ArgumentTypes.AccountId } userAccount,
236
- * @param { (number | string | BN) } threshold,
237
- */
238
- dappOperatorIsHumanUser(userAccount, threshold, __options) {
239
- return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "dappOperatorIsHumanUser", [userAccount, threshold], __options);
240
- }
241
- /**
242
- * dappOperatorLastCorrectCaptcha
243
- *
244
- * @param { ArgumentTypes.AccountId } userAccount,
245
- */
246
- dappOperatorLastCorrectCaptcha(userAccount, __options) {
247
- return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "dappOperatorLastCorrectCaptcha", [userAccount], __options);
248
- }
249
- /**
250
- * getCaptchaData
251
- *
252
- * @param { ArgumentTypes.Hash } datasetId,
253
- */
254
- getCaptchaData(datasetId, __options) {
255
- return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getCaptchaData", [datasetId], __options);
256
- }
257
- /**
258
- * getUser
259
- *
260
- * @param { ArgumentTypes.AccountId } userAccount,
261
- */
262
- getUser(userAccount, __options) {
263
- return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getUser", [userAccount], __options);
264
- }
265
- /**
266
- * getCommit
267
- *
268
- * @param { ArgumentTypes.Hash } commitId,
269
- */
270
- getCommit(commitId, __options) {
271
- return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getCommit", [commitId], __options);
272
- }
273
- /**
274
- * listProvidersByAccounts
275
- *
276
- * @param { Array<ArgumentTypes.AccountId> } providerAccounts,
277
- */
278
- listProvidersByAccounts(providerAccounts, __options) {
279
- return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "listProvidersByAccounts", [providerAccounts], __options);
280
- }
281
- /**
282
- * listProvidersByStatus
283
- *
284
- * @param { Array<ArgumentTypes.GovernanceStatus> } statuses,
285
- */
286
- listProvidersByStatus(statuses, __options) {
287
- return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "listProvidersByStatus", [statuses], __options);
288
- }
289
- /**
290
- * getRandomActiveProvider
291
- *
292
- * @param { ArgumentTypes.AccountId } userAccount,
293
- * @param { ArgumentTypes.AccountId } dappContract,
294
- */
295
- getRandomActiveProvider(userAccount, dappContract, __options) {
296
- return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getRandomActiveProvider", [userAccount, dappContract], __options);
297
- }
298
- /**
299
- * getAllProviderAccounts
300
- *
301
- */
302
- getAllProviderAccounts(__options) {
303
- return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getAllProviderAccounts", [], __options);
304
- }
305
- /**
306
- * getRandomNumber
307
- *
308
- * @param { (string | number | BN) } len,
309
- * @param { ArgumentTypes.AccountId } userAccount,
310
- * @param { ArgumentTypes.AccountId } dappContract,
311
- */
312
- getRandomNumber(len, userAccount, dappContract, __options) {
313
- return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getRandomNumber", [len, userAccount, dappContract], __options);
314
- }
315
- /**
316
- * terminate
317
- *
318
- */
319
- terminate(__options) {
320
- return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "terminate", [], __options);
321
- }
322
- /**
323
- * withdraw
324
- *
325
- * @param { (string | number | BN) } amount,
326
- */
327
- withdraw(amount, __options) {
328
- return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "withdraw", [amount], __options);
329
- }
330
- /**
331
- * setCodeHash
332
- *
333
- * @param { Array<(number | string | BN)> } codeHash,
334
- */
335
- setCodeHash(codeHash, __options) {
336
- return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "setCodeHash", [codeHash], __options);
337
- }
338
- }
339
- module.exports = Methods;