@verified-network/verified-sdk 2.0.5 → 2.0.7

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.
@@ -25,9 +25,11 @@ export default class Custody extends VerifiedContract {
25
25
  signTransaction(_creator: string, _id: string, _participant: string, _tx: string, _pin: string, options?: Options): any;
26
26
  checkQuorum(_creator: string, _id: string, _participant: string, _txid: string, options?: Options): any;
27
27
  getShards(_creator: string, _id: string, _txid: string, options?: Options): any;
28
- snapshotBalance(_user: string, _token: string, options?: Options): any;
29
- 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;
30
30
  collectCustodyFee(_token: string, options?: Options): any;
31
+ setDistributor(_nominee: string, options?: Options): any;
32
+ setCustodyFee(_fee: string, options?: Options): any;
31
33
  notifyNewParticipant(callback: any): object;
32
34
  notifyNewTransaction(callback: any): object;
33
35
  notifySignTransaction(callback: any): object;
@@ -26,6 +26,8 @@ var FUNCTIONS;
26
26
  FUNCTIONS["SNAPSHOT"] = "snapshotBalance";
27
27
  FUNCTIONS["CALCULATEAVERAGEBALANCE"] = "calculateAverageBalance";
28
28
  FUNCTIONS["COLLECTCUSTODYFEE"] = "collectCustodyFee";
29
+ FUNCTIONS["SETDISTRIBUTOR"] = "setDistributor";
30
+ FUNCTIONS["SETCUSTODYFEE"] = "setCustodyFee";
29
31
  })(FUNCTIONS || (FUNCTIONS = {}));
30
32
  class Custody extends index_1.VerifiedContract {
31
33
  constructor(signer, contractNetworkAddress) {
@@ -119,21 +121,31 @@ class Custody extends index_1.VerifiedContract {
119
121
  await this.validateInput(index_1.DATATYPES.STRING, _txid);
120
122
  return this.callContract(FUNCTIONS.GETSHARDS, this.sanitiseInput(index_1.DATATYPES.BYTE32, _creator), _id, _txid, options);
121
123
  }
122
- async snapshotBalance(_user, _token, options) {
123
- await this.validateInput(index_1.DATATYPES.STRING, _user);
124
- await this.validateInput(index_1.DATATYPES.STRING, _token);
125
- 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);
126
129
  }
127
- async calculateAverageBalance(_user, _token, _fromTime, _toTime, options) {
128
- await this.validateInput(index_1.DATATYPES.STRING, _user);
129
- 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);
130
134
  await this.validateInput(index_1.DATATYPES.NUMBER, _fromTime);
131
135
  await this.validateInput(index_1.DATATYPES.NUMBER, _toTime);
132
- 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);
133
137
  }
134
138
  async collectCustodyFee(_token, options) {
135
- await this.validateInput(index_1.DATATYPES.STRING, _token);
136
- 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);
137
149
  }
138
150
  notifyNewParticipant(callback) {
139
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': '0x260A6Afc5a200b721D643CbeBD16d83833F4E0BB',
331
+ 'Custody': '0x5DcE166987a5637485ca5771D22dF0B93C621159',
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.5",
3
+ "version": "2.0.7",
4
4
  "description": "An SDK to develop applications on the Verified Network",
5
5
  "repository": {
6
6
  "type": "git",