@verified-network/verified-sdk 2.1.4 → 2.1.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.
@@ -39,87 +39,87 @@ class Custody extends index_1.VerifiedContract {
39
39
  return await this.getQuote(paymentTokenAddress, functionName, args);
40
40
  }
41
41
  async createVault(_creator, _id, options) {
42
- await this.validateInput(index_1.DATATYPES.STRING, _creator);
42
+ await this.validateInput(index_1.DATATYPES.BYTE32, _creator);
43
43
  await this.validateInput(index_1.DATATYPES.STRING, _id);
44
- return this.callContract(FUNCTIONS.CREATEVAULT, this.sanitiseInput(index_1.DATATYPES.BYTE32, _creator), _id, options);
44
+ return this.callContract(FUNCTIONS.CREATEVAULT, _creator, _id, options);
45
45
  }
46
46
  async resetPin(_creator, _id, _new, options) {
47
- await this.validateInput(index_1.DATATYPES.STRING, _creator);
47
+ await this.validateInput(index_1.DATATYPES.BYTE32, _creator);
48
48
  await this.validateInput(index_1.DATATYPES.STRING, _id);
49
49
  await this.validateInput(index_1.DATATYPES.STRING, _new);
50
- return this.callContract(FUNCTIONS.RESETPIN, this.sanitiseInput(index_1.DATATYPES.BYTE32, _creator), _id, _new, options);
50
+ return this.callContract(FUNCTIONS.RESETPIN, _creator, _id, _new, options);
51
51
  }
52
52
  async getVaults() {
53
53
  return this.callContract(FUNCTIONS.GETVAULTS);
54
54
  }
55
55
  async transferVault(_creator, _id, _transferee, options) {
56
- await this.validateInput(index_1.DATATYPES.STRING, _creator);
56
+ await this.validateInput(index_1.DATATYPES.BYTE32, _creator);
57
57
  await this.validateInput(index_1.DATATYPES.STRING, _id);
58
58
  await this.validateInput(index_1.DATATYPES.ADDRESS, _transferee);
59
- return this.callContract(FUNCTIONS.TRANSFERVAULT, this.sanitiseInput(index_1.DATATYPES.BYTE32, _creator), _id, _transferee, options);
59
+ return this.callContract(FUNCTIONS.TRANSFERVAULT, _creator, _id, _transferee, options);
60
60
  }
61
61
  async getCreator(_creator, _pin, options) {
62
- await this.validateInput(index_1.DATATYPES.STRING, _creator);
63
- await this.validateInput(index_1.DATATYPES.NUMBER, _pin);
64
- return this.callContract(FUNCTIONS.GETCREATOR, this.sanitiseInput(index_1.DATATYPES.BYTE32, _creator), _pin, options);
62
+ await this.validateInput(index_1.DATATYPES.BYTE32, _creator);
63
+ await this.validateInput(index_1.DATATYPES.STRING, _pin);
64
+ return this.callContract(FUNCTIONS.GETCREATOR, _creator, _pin, options);
65
65
  }
66
66
  async addParticipant(_creator, _id, _participant, _shard, options) {
67
- await this.validateInput(index_1.DATATYPES.STRING, _creator);
67
+ await this.validateInput(index_1.DATATYPES.BYTE32, _creator);
68
68
  await this.validateInput(index_1.DATATYPES.STRING, _id);
69
- await this.validateInput(index_1.DATATYPES.STRING, _participant);
69
+ await this.validateInput(index_1.DATATYPES.BYTE32, _participant);
70
70
  await this.validateInput(index_1.DATATYPES.STRING, _shard);
71
- return this.callContract(FUNCTIONS.ADDPARTICIPANT, this.sanitiseInput(index_1.DATATYPES.BYTE32, _creator), _id, this.sanitiseInput(index_1.DATATYPES.BYTE32, _participant), _shard, options);
71
+ return this.callContract(FUNCTIONS.ADDPARTICIPANT, _creator, _id, _participant, _shard, options);
72
72
  }
73
73
  async removeParticipant(_creator, _id, _participant, options) {
74
- await this.validateInput(index_1.DATATYPES.STRING, _creator);
74
+ await this.validateInput(index_1.DATATYPES.BYTE32, _creator);
75
75
  await this.validateInput(index_1.DATATYPES.STRING, _id);
76
- await this.validateInput(index_1.DATATYPES.STRING, _participant);
77
- return this.callContract(FUNCTIONS.REMOVEPARTICIPANT, this.sanitiseInput(index_1.DATATYPES.BYTE32, _creator), _id, this.sanitiseInput(index_1.DATATYPES.BYTE32, _participant), options);
76
+ await this.validateInput(index_1.DATATYPES.BYTE32, _participant);
77
+ return this.callContract(FUNCTIONS.REMOVEPARTICIPANT, _creator, _id, _participant, options);
78
78
  }
79
79
  async confirmParticipant(_creator, _id, _participant, _pin, _confirmation, options) {
80
- await this.validateInput(index_1.DATATYPES.STRING, _creator);
80
+ await this.validateInput(index_1.DATATYPES.BYTE32, _creator);
81
81
  await this.validateInput(index_1.DATATYPES.STRING, _id);
82
- await this.validateInput(index_1.DATATYPES.STRING, _participant);
82
+ await this.validateInput(index_1.DATATYPES.BYTE32, _participant);
83
83
  await this.validateInput(index_1.DATATYPES.STRING, _pin);
84
84
  await this.validateInput(index_1.DATATYPES.BOOLEAN, _confirmation);
85
- return this.callContract(FUNCTIONS.CONFIRMPARTICIPANT, this.sanitiseInput(index_1.DATATYPES.BYTE32, _creator), _id, this.sanitiseInput(index_1.DATATYPES.BYTE32, _participant), _pin, _confirmation, options);
85
+ return this.callContract(FUNCTIONS.CONFIRMPARTICIPANT, _creator, _id, _participant, _pin, _confirmation, options);
86
86
  }
87
87
  async defineQuorum(_creator, _id, _minParticipants, options) {
88
- await this.validateInput(index_1.DATATYPES.STRING, _creator);
88
+ await this.validateInput(index_1.DATATYPES.BYTE32, _creator);
89
89
  await this.validateInput(index_1.DATATYPES.STRING, _id);
90
90
  await this.validateInput(index_1.DATATYPES.NUMBER, _minParticipants);
91
- return this.callContract(FUNCTIONS.DEFINEQUORUM, this.sanitiseInput(index_1.DATATYPES.BYTE32, _creator), _id, _minParticipants, options);
91
+ return this.callContract(FUNCTIONS.DEFINEQUORUM, _creator, _id, _minParticipants, options);
92
92
  }
93
93
  async getQuorum(_creator, _id, options) {
94
- await this.validateInput(index_1.DATATYPES.STRING, _creator);
94
+ await this.validateInput(index_1.DATATYPES.BYTE32, _creator);
95
95
  await this.validateInput(index_1.DATATYPES.STRING, _id);
96
- return this.callContract(FUNCTIONS.GETQUORUM, this.sanitiseInput(index_1.DATATYPES.BYTE32, _creator), _id, options);
96
+ return this.callContract(FUNCTIONS.GETQUORUM, _creator, _id, options);
97
97
  }
98
98
  async promptSignatures(_creator, _id, options) {
99
- await this.validateInput(index_1.DATATYPES.STRING, _creator);
99
+ await this.validateInput(index_1.DATATYPES.BYTE32, _creator);
100
100
  await this.validateInput(index_1.DATATYPES.STRING, _id);
101
- return this.callContract(FUNCTIONS.PROMPTSIGNATURES, this.sanitiseInput(index_1.DATATYPES.BYTE32, _creator), _id, options);
101
+ return this.callContract(FUNCTIONS.PROMPTSIGNATURES, _creator, _id, options);
102
102
  }
103
103
  async signTransaction(_creator, _id, _participant, _tx, _pin, options) {
104
- await this.validateInput(index_1.DATATYPES.STRING, _creator);
104
+ await this.validateInput(index_1.DATATYPES.BYTE32, _creator);
105
105
  await this.validateInput(index_1.DATATYPES.STRING, _id);
106
- await this.validateInput(index_1.DATATYPES.STRING, _participant);
106
+ await this.validateInput(index_1.DATATYPES.BYTE32, _participant);
107
107
  await this.validateInput(index_1.DATATYPES.STRING, _tx);
108
108
  await this.validateInput(index_1.DATATYPES.STRING, _pin);
109
- return this.callContract(FUNCTIONS.SIGNTRANSACTION, this.sanitiseInput(index_1.DATATYPES.BYTE32, _creator), _id, this.sanitiseInput(index_1.DATATYPES.BYTE32, _participant), _tx, _pin, options);
109
+ return this.callContract(FUNCTIONS.SIGNTRANSACTION, _creator, _id, _participant, _tx, _pin, options);
110
110
  }
111
111
  async checkQuorum(_creator, _id, _participant, _txid, options) {
112
- await this.validateInput(index_1.DATATYPES.STRING, _creator);
112
+ await this.validateInput(index_1.DATATYPES.BYTE32, _creator);
113
113
  await this.validateInput(index_1.DATATYPES.STRING, _id);
114
- await this.validateInput(index_1.DATATYPES.STRING, _participant);
114
+ await this.validateInput(index_1.DATATYPES.BYTE32, _participant);
115
115
  await this.validateInput(index_1.DATATYPES.STRING, _txid);
116
- return this.callContract(FUNCTIONS.CHECKQUORUM, this.sanitiseInput(index_1.DATATYPES.BYTE32, _creator), _id, this.sanitiseInput(index_1.DATATYPES.BYTE32, _participant), _txid, options);
116
+ return this.callContract(FUNCTIONS.CHECKQUORUM, _creator, _id, _participant, _txid, options);
117
117
  }
118
118
  async getShards(_creator, _id, _txid, options) {
119
- await this.validateInput(index_1.DATATYPES.STRING, _creator);
119
+ await this.validateInput(index_1.DATATYPES.BYTE32, _creator);
120
120
  await this.validateInput(index_1.DATATYPES.STRING, _id);
121
121
  await this.validateInput(index_1.DATATYPES.STRING, _txid);
122
- return this.callContract(FUNCTIONS.GETSHARDS, this.sanitiseInput(index_1.DATATYPES.BYTE32, _creator), _id, _txid, options);
122
+ return this.callContract(FUNCTIONS.GETSHARDS, _creator, _id, _txid, options);
123
123
  }
124
124
  async snapshotBalance(_creator, _id, _token, options) {
125
125
  await this.validateInput(index_1.DATATYPES.BYTE32, _creator);
@@ -205,7 +205,6 @@ class VerifiedContract {
205
205
  biconomyPaymasterApiKey: constants_1.PaymasterConstants[`${chainId}`]["PAYMASTER_API_KEY"],
206
206
  bundlerUrl: `${constants_1.PaymasterConstants.BUNDLER_URL_FIRST_SECTION}/${chainId}/${constants_1.PaymasterConstants[`${chainId}`]["BUNDLER_API_KEY"]}`,
207
207
  });
208
- // console.log("smart account address", await smartAccount.getAccountAddress());
209
208
  return smartAccount;
210
209
  }
211
210
  async fetchUserOpReceipt(userOpHash) {
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PaymasterConstants = void 0;
4
4
  //Todo: add more network paymaster details for gasless
5
5
  exports.PaymasterConstants = {
6
- MAX_WAITING_ROUND: 3, //number of rounds gassless transactions will wait to fetch receipt. Note: each round is 1 minute, so 3 for example is 3 minutes
6
+ MAX_WAITING_ROUND: 10, //number of rounds gassless transactions will wait to fetch receipt. Note: each round is 6 seconds, so 10 for example is 1 minute
7
7
  BUNDLER_URL_FIRST_SECTION: "https://bundler.biconomy.io/api/v2",
8
8
  GENERAL_PAYMASTER_URL: "https://paymaster.biconomy.io/api/v1",
9
9
  BICONOMY_REVERT_TOPIC: "0x1c4fada7374c0a9ee8841fc38afe82932dc0f8e69012e927f061a8bae611a201",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verified-network/verified-sdk",
3
- "version": "2.1.4",
3
+ "version": "2.1.6",
4
4
  "description": "An SDK to develop applications on the Verified Network",
5
5
  "repository": {
6
6
  "type": "git",
package/tsconfig.json CHANGED
@@ -6,7 +6,7 @@
6
6
  // "incremental": true, /* Enable incremental compilation */
7
7
  "target": "ES2017", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
8
8
  "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
9
- "lib": ["es5","DOM"], /* Specify library files to be included in the compilation. */
9
+ "lib": ["es2015","DOM"], /* Specify library files to be included in the compilation. */
10
10
  //"allowJs": true, /* Allow javascript files to be compiled. */
11
11
  // "checkJs": true, /* Report errors in .js files. */
12
12
  // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'. */