@verified-network/verified-sdk 2.0.5 → 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.
|
@@ -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(
|
|
29
|
-
calculateAverageBalance(
|
|
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(
|
|
123
|
-
await this.validateInput(index_1.DATATYPES.
|
|
124
|
-
await this.validateInput(index_1.DATATYPES.STRING,
|
|
125
|
-
|
|
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(
|
|
128
|
-
await this.validateInput(index_1.DATATYPES.
|
|
129
|
-
await this.validateInput(index_1.DATATYPES.STRING,
|
|
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,
|
|
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.
|
|
136
|
-
return this.callContract(FUNCTIONS.COLLECTCUSTODYFEE,
|
|
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': '
|
|
331
|
+
'Custody': '0x503a5Aa132784d9F6c254f6a1fb0dB492dE043a8',
|
|
332
332
|
'Compound': '0x8c364b06741C9fE045E0e510A39BCbAf7445D8fD',
|
|
333
333
|
'CASH': {
|
|
334
334
|
'VCUSD': '0xC824FCCfe6545c42B609cF6aD6219748A306D83a',
|