@verified-network/verified-sdk 2.0.2 → 2.0.3

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.
@@ -23,6 +23,9 @@ export default class Custody extends VerifiedContract {
23
23
  signTransaction(_creator: string, _id: string, _participant: string, _tx: string, _pin: string, options?: Options): any;
24
24
  checkQuorum(_creator: string, _id: string, _participant: string, _txid: string, options?: Options): any;
25
25
  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
+ collectCustodyFee(_token: string, options?: Options): any;
26
29
  notifyNewParticipant(callback: any): object;
27
30
  notifyNewTransaction(callback: any): object;
28
31
  notifySignTransaction(callback: any): object;
@@ -21,6 +21,9 @@ var FUNCTIONS;
21
21
  FUNCTIONS["NEWPARTICIPANT"] = "NewParticipant";
22
22
  FUNCTIONS["NEWTRANSACTION"] = "NewTransaction";
23
23
  FUNCTIONS["SIGNATURE"] = "SignTransaction";
24
+ FUNCTIONS["SNAPSHOT"] = "snapshotBalance";
25
+ FUNCTIONS["CALCULATEAVERAGEBALANCE"] = "calculateAverageBalance";
26
+ FUNCTIONS["COLLECTCUSTODYFEE"] = "collectCustodyFee";
24
27
  })(FUNCTIONS || (FUNCTIONS = {}));
25
28
  class Custody extends index_1.VerifiedContract {
26
29
  constructor(signer, contractNetworkAddress) {
@@ -103,6 +106,22 @@ class Custody extends index_1.VerifiedContract {
103
106
  await this.validateInput(index_1.DATATYPES.STRING, _txid);
104
107
  return this.callContract(FUNCTIONS.GETSHARDS, this.sanitiseInput(index_1.DATATYPES.BYTE32, _creator), _id, _txid, options);
105
108
  }
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);
113
+ }
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);
117
+ await this.validateInput(index_1.DATATYPES.NUMBER, _fromTime);
118
+ 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);
120
+ }
121
+ 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);
124
+ }
106
125
  notifyNewParticipant(callback) {
107
126
  this.getEvent(FUNCTIONS.NEWPARTICIPANT, callback);
108
127
  }
@@ -328,7 +328,7 @@ const contractAddress = {
328
328
  'BalancerSecondaryIssueManager': '0xE3e3e9b8c0c292eD3756C7A1037322738de6B7FC',
329
329
  'MarginTradingPoolFactory': '0xB1ae3Fc5B16d3736bf0db20606fB9a10b435392c',
330
330
  'BalancerMarginIssueManager': '0x095a3075De6950530F6053C97dB06cc74E78E11e',
331
- 'Custody': '0xA166F1f0dD40fFEBA529e327f17188d3Db0aB709',
331
+ 'Custody': '0x60bc622E02424ACDD415373B6Dd40870d077faa4',
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.2",
3
+ "version": "2.0.3",
4
4
  "description": "An SDK to develop applications on the Verified Network",
5
5
  "repository": {
6
6
  "type": "git",