@verified-network/verified-sdk 1.2.8 → 1.2.9

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.
@@ -8,6 +8,12 @@ var FUNCTIONS;
8
8
  (function (FUNCTIONS) {
9
9
  FUNCTIONS["ISSUEPRODUCT"] = "issueProduct";
10
10
  FUNCTIONS["CLOSE"] = "close";
11
+ FUNCTIONS["OFFERCOLLATERAL"] = "offerCollateral";
12
+ FUNCTIONS["SENDCOLLATERAL"] = "sendCollateral";
13
+ FUNCTIONS["ONMATCH"] = "onMatch";
14
+ FUNCTIONS["ONTRADE"] = "onTrade";
15
+ FUNCTIONS["ONSETTLE"] = "onSettle";
16
+ FUNCTIONS["WITHDRAW"] = "withdraw";
11
17
  })(FUNCTIONS || (FUNCTIONS = {}));
12
18
  class MarginIssueManager extends index_1.VerifiedContract {
13
19
  constructor(signer, contractNetworkAddress) {
@@ -32,5 +38,52 @@ class MarginIssueManager extends index_1.VerifiedContract {
32
38
  await this.validateInput(index_1.DATATYPES.STRING, poolId);
33
39
  return this.callContract(FUNCTIONS.CLOSE, poolId, options);
34
40
  }
41
+ async offerCollateral(currency, amount, poolId, options) {
42
+ await this.validateInput(index_1.DATATYPES.ADDRESS, currency);
43
+ await this.validateInput(index_1.DATATYPES.NUMBER, amount);
44
+ await this.validateInput(index_1.DATATYPES.STRING, poolId);
45
+ return this.callContract(FUNCTIONS.OFFERCOLLATERAL, currency, amount, this.sanitiseInput(index_1.DATATYPES.BYTE32, poolId), options);
46
+ }
47
+ async sendCollateral(currency, amount, poolId, options) {
48
+ await this.validateInput(index_1.DATATYPES.ADDRESS, currency);
49
+ await this.validateInput(index_1.DATATYPES.NUMBER, amount);
50
+ await this.validateInput(index_1.DATATYPES.STRING, poolId);
51
+ return this.callContract(FUNCTIONS.SENDCOLLATERAL, currency, amount, this.sanitiseInput(index_1.DATATYPES.BYTE32, poolId), options);
52
+ }
53
+ async onMatch(party, counterparty, orderRef, security, securityTraded, currency, cashTraded, options) {
54
+ await this.validateInput(index_1.DATATYPES.ADDRESS, party);
55
+ await this.validateInput(index_1.DATATYPES.ADDRESS, counterparty);
56
+ await this.validateInput(index_1.DATATYPES.STRING, orderRef);
57
+ await this.validateInput(index_1.DATATYPES.ADDRESS, security);
58
+ await this.validateInput(index_1.DATATYPES.NUMBER, securityTraded);
59
+ await this.validateInput(index_1.DATATYPES.ADDRESS, currency);
60
+ await this.validateInput(index_1.DATATYPES.NUMBER, cashTraded);
61
+ return this.callContract(FUNCTIONS.ONMATCH, party, counterparty, this.sanitiseInput(index_1.DATATYPES.BYTE32, orderRef), security, securityTraded, currency, cashTraded, options);
62
+ }
63
+ async onTrade(ref, cref, security, securityTraded, currency, currencyTraded, executionTime, options) {
64
+ await this.validateInput(index_1.DATATYPES.STRING, ref);
65
+ await this.validateInput(index_1.DATATYPES.STRING, cref);
66
+ await this.validateInput(index_1.DATATYPES.ADDRESS, security);
67
+ await this.validateInput(index_1.DATATYPES.NUMBER, securityTraded);
68
+ await this.validateInput(index_1.DATATYPES.ADDRESS, currency);
69
+ await this.validateInput(index_1.DATATYPES.NUMBER, currencyTraded);
70
+ await this.validateInput(index_1.DATATYPES.NUMBER, executionTime);
71
+ return this.callContract(FUNCTIONS.ONTRADE, this.sanitiseInput(index_1.DATATYPES.BYTE32, ref), this.sanitiseInput(index_1.DATATYPES.BYTE32, cref), security, securityTraded, currency, currencyTraded, executionTime, options);
72
+ }
73
+ async onSettle(security, currency, financingPerSec, charge, dividendPerSec, payout, settlementTime, options) {
74
+ await this.validateInput(index_1.DATATYPES.ADDRESS, security);
75
+ await this.validateInput(index_1.DATATYPES.ADDRESS, currency);
76
+ await this.validateInput(index_1.DATATYPES.NUMBER, financingPerSec);
77
+ await this.validateInput(index_1.DATATYPES.BOOLEAN, charge);
78
+ await this.validateInput(index_1.DATATYPES.NUMBER, dividendPerSec);
79
+ await this.validateInput(index_1.DATATYPES.BOOLEAN, payout);
80
+ await this.validateInput(index_1.DATATYPES.NUMBER, settlementTime);
81
+ return this.callContract(FUNCTIONS.ONSETTLE, security, currency, financingPerSec, charge, dividendPerSec, payout, settlementTime, options);
82
+ }
83
+ async withdraw(security, currency, options) {
84
+ await this.validateInput(index_1.DATATYPES.ADDRESS, security);
85
+ await this.validateInput(index_1.DATATYPES.ADDRESS, currency);
86
+ return this.callContract(FUNCTIONS.WITHDRAW, currency, security, currency, options);
87
+ }
35
88
  }
36
89
  exports.default = MarginIssueManager;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verified-network/verified-sdk",
3
- "version": "1.2.8",
3
+ "version": "1.2.9",
4
4
  "description": "An SDK to develop applications on the Verified Network",
5
5
  "repository": {
6
6
  "type": "git",