@verified-network/verified-sdk 2.0.3 → 2.0.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.
@@ -12,6 +12,7 @@ export default class Custody extends VerifiedContract {
12
12
  functionName: string;
13
13
  }>;
14
14
  createVault(_creator: string, _id: string, options?: Options): any;
15
+ resetPin(_creator: string, _id: string, _new: string, options?: Options): any;
15
16
  getVaults(): any;
16
17
  transferVault(_creator: string, _id: string, _transferee: string, options?: Options): any;
17
18
  getCreator(_creator: string, _pin: string, options?: Options): any;
@@ -19,13 +20,16 @@ export default class Custody extends VerifiedContract {
19
20
  removeParticipant(_creator: string, _id: string, _participant: string, options?: Options): any;
20
21
  confirmParticipant(_creator: string, _id: string, _participant: string, _pin: string, _confirmation: string, options?: Options): any;
21
22
  defineQuorum(_creator: string, _id: string, _minParticipants: string, options?: Options): any;
23
+ getQuorum(_creator: string, _id: string, options?: Options): any;
22
24
  promptSignatures(_creator: string, _id: string, options?: Options): any;
23
25
  signTransaction(_creator: string, _id: string, _participant: string, _tx: string, _pin: string, options?: Options): any;
24
26
  checkQuorum(_creator: string, _id: string, _participant: string, _txid: string, options?: Options): any;
25
27
  getShards(_creator: string, _id: string, _txid: string, options?: Options): any;
26
- snapshotBalance(_user: string, _token: string, options?: Options): any;
27
- calculateAverageBalance(_user: string, _token: string, _fromTime: string, _toTime: string, options?: Options): any;
28
+ snapshotBalance(_creator: string, _id: string, _token: string, options?: Options): any;
29
+ calculateAverageBalance(_creator: string, _id: string, _token: string, _fromTime: string, _toTime: string, options?: Options): any;
28
30
  collectCustodyFee(_token: string, options?: Options): any;
31
+ setDistributor(_nominee: string, options?: Options): any;
32
+ setCustodyFee(_fee: string, options?: Options): any;
29
33
  notifyNewParticipant(callback: any): object;
30
34
  notifyNewTransaction(callback: any): object;
31
35
  notifySignTransaction(callback: any): object;
@@ -7,6 +7,7 @@ const Vault_json_1 = require("../../abi/custody/Vault.json");
7
7
  var FUNCTIONS;
8
8
  (function (FUNCTIONS) {
9
9
  FUNCTIONS["CREATEVAULT"] = "createVault";
10
+ FUNCTIONS["RESETPIN"] = "resetPin";
10
11
  FUNCTIONS["GETVAULTS"] = "getVaults";
11
12
  FUNCTIONS["TRANSFERVAULT"] = "transferVault";
12
13
  FUNCTIONS["GETCREATOR"] = "getCreator";
@@ -14,6 +15,7 @@ var FUNCTIONS;
14
15
  FUNCTIONS["REMOVEPARTICIPANT"] = "removeParticipant";
15
16
  FUNCTIONS["CONFIRMPARTICIPANT"] = "confirmParticipant";
16
17
  FUNCTIONS["DEFINEQUORUM"] = "defineQuorum";
18
+ FUNCTIONS["GETQUORUM"] = "getQuorum";
17
19
  FUNCTIONS["PROMPTSIGNATURES"] = "promptSignatures";
18
20
  FUNCTIONS["SIGNTRANSACTION"] = "signTransaction";
19
21
  FUNCTIONS["CHECKQUORUM"] = "checkQuorum";
@@ -24,6 +26,8 @@ var FUNCTIONS;
24
26
  FUNCTIONS["SNAPSHOT"] = "snapshotBalance";
25
27
  FUNCTIONS["CALCULATEAVERAGEBALANCE"] = "calculateAverageBalance";
26
28
  FUNCTIONS["COLLECTCUSTODYFEE"] = "collectCustodyFee";
29
+ FUNCTIONS["SETDISTRIBUTOR"] = "setDistributor";
30
+ FUNCTIONS["SETCUSTODYFEE"] = "setCustodyFee";
27
31
  })(FUNCTIONS || (FUNCTIONS = {}));
28
32
  class Custody extends index_1.VerifiedContract {
29
33
  constructor(signer, contractNetworkAddress) {
@@ -39,6 +43,12 @@ class Custody extends index_1.VerifiedContract {
39
43
  await this.validateInput(index_1.DATATYPES.STRING, _id);
40
44
  return this.callContract(FUNCTIONS.CREATEVAULT, this.sanitiseInput(index_1.DATATYPES.BYTE32, _creator), _id, options);
41
45
  }
46
+ async resetPin(_creator, _id, _new, options) {
47
+ await this.validateInput(index_1.DATATYPES.STRING, _creator);
48
+ await this.validateInput(index_1.DATATYPES.STRING, _id);
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);
51
+ }
42
52
  async getVaults() {
43
53
  return this.callContract(FUNCTIONS.GETVAULTS);
44
54
  }
@@ -80,6 +90,11 @@ class Custody extends index_1.VerifiedContract {
80
90
  await this.validateInput(index_1.DATATYPES.NUMBER, _minParticipants);
81
91
  return this.callContract(FUNCTIONS.DEFINEQUORUM, this.sanitiseInput(index_1.DATATYPES.BYTE32, _creator), _id, _minParticipants, options);
82
92
  }
93
+ async getQuorum(_creator, _id, options) {
94
+ await this.validateInput(index_1.DATATYPES.STRING, _creator);
95
+ await this.validateInput(index_1.DATATYPES.STRING, _id);
96
+ return this.callContract(FUNCTIONS.GETQUORUM, this.sanitiseInput(index_1.DATATYPES.BYTE32, _creator), _id, options);
97
+ }
83
98
  async promptSignatures(_creator, _id, options) {
84
99
  await this.validateInput(index_1.DATATYPES.STRING, _creator);
85
100
  await this.validateInput(index_1.DATATYPES.STRING, _id);
@@ -106,21 +121,31 @@ class Custody extends index_1.VerifiedContract {
106
121
  await this.validateInput(index_1.DATATYPES.STRING, _txid);
107
122
  return this.callContract(FUNCTIONS.GETSHARDS, this.sanitiseInput(index_1.DATATYPES.BYTE32, _creator), _id, _txid, options);
108
123
  }
109
- async snapshotBalance(_user, _token, options) {
110
- await this.validateInput(index_1.DATATYPES.STRING, _user);
111
- await this.validateInput(index_1.DATATYPES.STRING, _token);
112
- return this.callContract(FUNCTIONS.SNAPSHOT, this.sanitiseInput(index_1.DATATYPES.BYTE32, _user), this.sanitiseInput(index_1.DATATYPES.BYTE32, _token), options);
124
+ async snapshotBalance(_creator, _id, _token, options) {
125
+ await this.validateInput(index_1.DATATYPES.BYTE32, _creator);
126
+ await this.validateInput(index_1.DATATYPES.STRING, _id);
127
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _token);
128
+ return this.callContract(FUNCTIONS.SNAPSHOT, _creator, _id, _token, options);
113
129
  }
114
- async calculateAverageBalance(_user, _token, _fromTime, _toTime, options) {
115
- await this.validateInput(index_1.DATATYPES.STRING, _user);
116
- await this.validateInput(index_1.DATATYPES.STRING, _token);
130
+ async calculateAverageBalance(_creator, _id, _token, _fromTime, _toTime, options) {
131
+ await this.validateInput(index_1.DATATYPES.BYTE32, _creator);
132
+ await this.validateInput(index_1.DATATYPES.STRING, _id);
133
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _token);
117
134
  await this.validateInput(index_1.DATATYPES.NUMBER, _fromTime);
118
135
  await this.validateInput(index_1.DATATYPES.NUMBER, _toTime);
119
- return this.callContract(FUNCTIONS.CALCULATEAVERAGEBALANCE, this.sanitiseInput(index_1.DATATYPES.BYTE32, _user), this.sanitiseInput(index_1.DATATYPES.BYTE32, _token), _fromTime, _toTime, options);
136
+ return this.callContract(FUNCTIONS.CALCULATEAVERAGEBALANCE, _creator, _id, _token, _fromTime, _toTime, options);
120
137
  }
121
138
  async collectCustodyFee(_token, options) {
122
- await this.validateInput(index_1.DATATYPES.STRING, _token);
123
- return this.callContract(FUNCTIONS.COLLECTCUSTODYFEE, this.sanitiseInput(index_1.DATATYPES.BYTE32, _token), options);
139
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _token);
140
+ return this.callContract(FUNCTIONS.COLLECTCUSTODYFEE, _token, options);
141
+ }
142
+ async setDistributor(_nominee, options) {
143
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _nominee);
144
+ return this.callContract(FUNCTIONS.SETDISTRIBUTOR, _nominee, options);
145
+ }
146
+ async setCustodyFee(_fee, options) {
147
+ await this.validateInput(index_1.DATATYPES.NUMBER, _fee);
148
+ return this.callContract(FUNCTIONS.SETCUSTODYFEE, _fee, options);
124
149
  }
125
150
  notifyNewParticipant(callback) {
126
151
  this.getEvent(FUNCTIONS.NEWPARTICIPANT, callback);
@@ -328,7 +328,7 @@ const contractAddress = {
328
328
  'BalancerSecondaryIssueManager': '0xE3e3e9b8c0c292eD3756C7A1037322738de6B7FC',
329
329
  'MarginTradingPoolFactory': '0xB1ae3Fc5B16d3736bf0db20606fB9a10b435392c',
330
330
  'BalancerMarginIssueManager': '0x095a3075De6950530F6053C97dB06cc74E78E11e',
331
- 'Custody': '0x60bc622E02424ACDD415373B6Dd40870d077faa4',
331
+ 'Custody': '0x503a5Aa132784d9F6c254f6a1fb0dB492dE043a8',
332
332
  'Compound': '0x8c364b06741C9fE045E0e510A39BCbAf7445D8fD',
333
333
  'CASH': {
334
334
  'VCUSD': '0xC824FCCfe6545c42B609cF6aD6219748A306D83a',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verified-network/verified-sdk",
3
- "version": "2.0.3",
3
+ "version": "2.0.6",
4
4
  "description": "An SDK to develop applications on the Verified Network",
5
5
  "repository": {
6
6
  "type": "git",