@verified-network/verified-sdk 0.4.1 → 0.4.5

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.
@@ -10,7 +10,7 @@ var FUNCTIONS;
10
10
  FUNCTIONS["GETBOND"] = "getBond";
11
11
  FUNCTIONS["STARTISSUE"] = "startIssue";
12
12
  FUNCTIONS["ASKOFFERS"] = "askOffers";
13
- FUNCTIONS["CLOSEISSUE"] = "closeIssue";
13
+ FUNCTIONS["GETSUBSCRIBERS"] = "getSubscribers";
14
14
  FUNCTIONS["ALLOTISSUE"] = "allotIssue";
15
15
  FUNCTIONS["NEXTINSTALLMENT"] = "computeNextInstallment";
16
16
  FUNCTIONS["GETPAYMENTFOR"] = "getPaymentAmountFor";
@@ -25,11 +25,12 @@ var FUNCTIONS;
25
25
  FUNCTIONS["PAYOUT"] = "payOut";
26
26
  FUNCTIONS["ISSUESHARE"] = "issueShare";
27
27
  FUNCTIONS["ISSUEBOND"] = "issueBond";
28
+ FUNCTIONS["GETBENEFICIARIES"] = "getBeneficiaries";
28
29
  })(FUNCTIONS || (FUNCTIONS = {}));
29
30
  class IssueContract extends index_1.VerifiedContract {
30
- constructor(signer) {
31
+ constructor(signer, issue) {
31
32
  const chainId = signer.provider._network.chainId.toString();
32
- const address = Issues_json_1.networks[chainId].address;
33
+ const address = issue;
33
34
  super(address, JSON.stringify(Issues_json_1.abi), signer);
34
35
  this.contractAddress = address;
35
36
  }
@@ -39,12 +40,18 @@ class IssueContract extends index_1.VerifiedContract {
39
40
  async getBond() {
40
41
  return this.callContract(FUNCTIONS.GETBOND);
41
42
  }
43
+ async askOffers() {
44
+ return this.callContract(FUNCTIONS.ASKOFFERS);
45
+ }
46
+ async getBeneficiaries() {
47
+ return this.callContract(FUNCTIONS.GETBENEFICIARIES);
48
+ }
42
49
  async startIssue(cutOffTime, options) {
43
50
  await this.validateInput(index_1.DATATYPES.NUMBER, cutOffTime);
44
51
  return this.callContract(FUNCTIONS.STARTISSUE, cutOffTime, options);
45
52
  }
46
- async closeIssue() {
47
- return this.callContract(FUNCTIONS.CLOSEISSUE);
53
+ async getSubscribers() {
54
+ return this.callContract(FUNCTIONS.GETSUBSCRIBERS);
48
55
  }
49
56
  async allotIssue(_allotment, _platform, _pool, _investor, _amount, _asset, options) {
50
57
  await this.validateInput(index_1.DATATYPES.STRING, _allotment);
@@ -96,31 +103,29 @@ class IssueContract extends index_1.VerifiedContract {
96
103
  await this.validateInput(index_1.DATATYPES.NUMBER, _amount);
97
104
  return this.callContract(FUNCTIONS.PAYOUT, _beneficiary, this.sanitiseInput(index_1.DATATYPES.BYTE32, _currency), _amount, options);
98
105
  }
99
- async issueShare(_issueSize, _offerPrice, _minAskPrice, _minSubscription, _currency, _offerType, _depository, _isin, currencyAddress, options) {
106
+ async issueShare(_issueSize, _offerPrice, _minAskPrice, _minSubscription, _currency, _offerType, _isin, _offeringDocuments, options) {
100
107
  await this.validateInput(index_1.DATATYPES.NUMBER, _issueSize);
101
108
  await this.validateInput(index_1.DATATYPES.NUMBER, _offerPrice);
102
109
  await this.validateInput(index_1.DATATYPES.NUMBER, _minAskPrice);
103
110
  await this.validateInput(index_1.DATATYPES.NUMBER, _minSubscription);
104
111
  await this.validateInput(index_1.DATATYPES.STRING, _currency);
105
112
  await this.validateInput(index_1.DATATYPES.STRING, _offerType);
106
- await this.validateInput(index_1.DATATYPES.STRING, _depository);
113
+ await this.validateInput(index_1.DATATYPES.STRING, _offeringDocuments);
107
114
  await this.validateInput(index_1.DATATYPES.STRING, _isin);
108
- await this.validateInput(index_1.DATATYPES.ADDRESS, currencyAddress);
109
- return this.callContract(FUNCTIONS.ISSUESHARE, _issueSize, _offerPrice, _minAskPrice, _minSubscription, this.sanitiseInput(index_1.DATATYPES.BYTE32, _currency), this.sanitiseInput(index_1.DATATYPES.BYTE32, _offerType), this.sanitiseInput(index_1.DATATYPES.BYTE32, _depository), this.sanitiseInput(index_1.DATATYPES.BYTE32, _isin), this.sanitiseInput(index_1.DATATYPES.BYTE32, currencyAddress), options);
115
+ return this.callContract(FUNCTIONS.ISSUESHARE, _issueSize, _offerPrice, _minAskPrice, _minSubscription, this.sanitiseInput(index_1.DATATYPES.BYTE32, _currency), this.sanitiseInput(index_1.DATATYPES.BYTE32, _offerType), this.sanitiseInput(index_1.DATATYPES.BYTE32, _isin), _offeringDocuments, options);
110
116
  }
111
- async issueBond(_issueSize, _offerPrice, _minAskPrice, _couponPaymentCycle, _tenure, _currency, _instrumentType, _priority, _depository, _isin, currencyAddress, options) {
117
+ async issueBond(_issueSize, _offerPrice, _minAskPrice, _minSubscription, _couponPaymentCycle, _tenure, _currency, _offerType, _isin, _offeringDocuments, options) {
112
118
  await this.validateInput(index_1.DATATYPES.NUMBER, _issueSize);
113
119
  await this.validateInput(index_1.DATATYPES.NUMBER, _offerPrice);
114
120
  await this.validateInput(index_1.DATATYPES.NUMBER, _minAskPrice);
121
+ await this.validateInput(index_1.DATATYPES.NUMBER, _minSubscription);
115
122
  await this.validateInput(index_1.DATATYPES.NUMBER, _couponPaymentCycle);
116
123
  await this.validateInput(index_1.DATATYPES.NUMBER, _tenure);
117
124
  await this.validateInput(index_1.DATATYPES.STRING, _currency);
118
- await this.validateInput(index_1.DATATYPES.STRING, _instrumentType);
119
- await this.validateInput(index_1.DATATYPES.STRING, _priority);
120
- await this.validateInput(index_1.DATATYPES.STRING, _depository);
125
+ await this.validateInput(index_1.DATATYPES.STRING, _offerType);
121
126
  await this.validateInput(index_1.DATATYPES.STRING, _isin);
122
- await this.validateInput(index_1.DATATYPES.ADDRESS, currencyAddress);
123
- return this.callContract(FUNCTIONS.ISSUEBOND, _issueSize, _offerPrice, _minAskPrice, _couponPaymentCycle, _tenure, this.sanitiseInput(index_1.DATATYPES.BYTE32, _currency), this.sanitiseInput(index_1.DATATYPES.BYTE32, _instrumentType), this.sanitiseInput(index_1.DATATYPES.BYTE32, _priority), this.sanitiseInput(index_1.DATATYPES.BYTE32, _depository), this.sanitiseInput(index_1.DATATYPES.BYTE32, _isin), this.sanitiseInput(index_1.DATATYPES.BYTE32, currencyAddress), options);
127
+ await this.validateInput(index_1.DATATYPES.STRING, _offeringDocuments);
128
+ return this.callContract(FUNCTIONS.ISSUEBOND, _issueSize, _offerPrice, _minAskPrice, _minSubscription, _couponPaymentCycle, _tenure, this.sanitiseInput(index_1.DATATYPES.BYTE32, _currency), this.sanitiseInput(index_1.DATATYPES.BYTE32, _offerType), this.sanitiseInput(index_1.DATATYPES.BYTE32, _isin), _offeringDocuments, options);
124
129
  }
125
130
  }
126
131
  exports.default = IssueContract;
@@ -12,9 +12,9 @@ var FUNCTIONS;
12
12
  FUNCTIONS["GETORDERREF"] = "getOrderRef";
13
13
  })(FUNCTIONS || (FUNCTIONS = {}));
14
14
  class OrderPoolContract extends index_1.VerifiedContract {
15
- constructor(signer) {
15
+ constructor(signer, orderPool) {
16
16
  const chainId = signer.provider._network.chainId.toString();
17
- const address = OrderPool_json_1.networks[chainId].address;
17
+ const address = orderPool;
18
18
  super(address, JSON.stringify(OrderPool_json_1.abi), signer);
19
19
  this.contractAddress = address;
20
20
  }
@@ -45,16 +45,16 @@ class OrderPoolContract extends index_1.VerifiedContract {
45
45
  await this.validateInput(index_1.DATATYPES.STRING, _qty);
46
46
  await this.validateInput(index_1.DATATYPES.STRING, _orderType);
47
47
  await this.validateInput(index_1.DATATYPES.STRING, _order);
48
- return this.callContract(FUNCTIONS.EDITORDER, this.sanitiseInput(index_1.DATATYPES.BYTE32, _ref), _price, _trigger, _qty, this.sanitiseInput(index_1.DATATYPES.BYTE32, _orderType), this.sanitiseInput(index_1.DATATYPES.BYTE32, _order), options);
48
+ return this.callContract(FUNCTIONS.EDITORDER, _ref, _price, _trigger, _qty, this.sanitiseInput(index_1.DATATYPES.BYTE32, _orderType), this.sanitiseInput(index_1.DATATYPES.BYTE32, _order), options);
49
49
  }
50
50
  /**
51
51
  * Get pool [callable by user on PoolFactory.sol]
52
52
  * @param (bytes32 ref)
53
53
  * @returns (bool)
54
54
  */
55
- async cancelOrder(ref, options) {
56
- await this.validateInput(index_1.DATATYPES.STRING, ref);
57
- return this.callContract(FUNCTIONS.CANCELORDER, this.sanitiseInput(index_1.DATATYPES.BYTE32, _ref), options);
55
+ async cancelOrder(_ref, options) {
56
+ await this.validateInput(index_1.DATATYPES.STRING, _ref);
57
+ return this.callContract(FUNCTIONS.CANCELORDER, _ref, options);
58
58
  }
59
59
  /**
60
60
  * Returns order reference for requestor
@@ -47,7 +47,7 @@ class PostTradeContract extends index_1.VerifiedContract {
47
47
  */
48
48
  async getSettlementRequest(_ref, options) {
49
49
  await this.validateInput(index_1.DATATYPES.STRING, _ref);
50
- return this.callContract(FUNCTIONS.GETSETTLEMENTREQUEST, this.sanitiseInput(index_1.DATATYPES.BYTE32, _ref), options);
50
+ return this.callContract(FUNCTIONS.GETSETTLEMENTREQUEST, _ref, options);
51
51
  }
52
52
  /**
53
53
  * Set settlement status [callable by manager on PostTrade.sol]
@@ -57,7 +57,7 @@ class PostTradeContract extends index_1.VerifiedContract {
57
57
  async setSettlementStatus(_ref, _settlementStatus, options) {
58
58
  await this.validateInput(index_1.DATATYPES.STRING, _ref);
59
59
  await this.validateInput(index_1.DATATYPES.STRING, _settlementStatus);
60
- return this.callContract(FUNCTIONS.SETSETTLEMENTSTATUS, this.sanitiseInput(index_1.DATATYPES.BYTE32, _ref), this.sanitiseInput(index_1.DATATYPES.BYTE32, _settlementStatus), options);
60
+ return this.callContract(FUNCTIONS.SETSETTLEMENTSTATUS, _ref, this.sanitiseInput(index_1.DATATYPES.BYTE32, _settlementStatus), options);
61
61
  }
62
62
  }
63
63
  exports.default = PostTradeContract;
@@ -14,6 +14,8 @@ var FUNCTIONS;
14
14
  FUNCTIONS["GETCONFIRMATIONREQUESTS"] = "getConfirmationRequests";
15
15
  FUNCTIONS["GETCONFIRMATIONREQUEST"] = "getConfirmationRequest";
16
16
  FUNCTIONS["CONFIRMSECURITIES"] = "confirmSecurities";
17
+ FUNCTIONS["GETSECURITY"] = "getSecurity";
18
+ FUNCTIONS["GETDPID"] = "getDP";
17
19
  })(FUNCTIONS || (FUNCTIONS = {}));
18
20
  class PreTradeContract extends index_1.VerifiedContract {
19
21
  constructor(signer) {
@@ -46,8 +48,7 @@ class PreTradeContract extends index_1.VerifiedContract {
46
48
  * @returns (address user, bytes32 countryCode, bytes32 dematAccountNo, bytes32 DPID, uint registrationDate)
47
49
  */
48
50
  async getRegistrationRequest(_ref, options) {
49
- await this.validateInput(index_1.DATATYPES.STRING, _ref);
50
- return this.callContract(FUNCTIONS.GETREGISTRATIONREQUEST, this.sanitiseInput(index_1.DATATYPES.BYTE32, _ref), options);
51
+ return this.callContract(FUNCTIONS.GETREGISTRATIONREQUEST, _ref, options);
51
52
  }
52
53
  /**
53
54
  * Set registration status [sent by manager on PreTrade.sol, only works if manager’s role is DP]
@@ -55,10 +56,9 @@ class PreTradeContract extends index_1.VerifiedContract {
55
56
  * @returns
56
57
  */
57
58
  async setRegistrationStatus(_ref, _DPID, _dematAccountNo, options) {
58
- await this.validateInput(index_1.DATATYPES.STRING, _ref);
59
59
  await this.validateInput(index_1.DATATYPES.STRING, _DPID);
60
60
  await this.validateInput(index_1.DATATYPES.STRING, _dematAccountNo);
61
- return this.callContract(FUNCTIONS.SETREGISTRATIONSTATUS, this.sanitiseInput(index_1.DATATYPES.BYTE32, _ref), this.sanitiseInput(index_1.DATATYPES.BYTE32, _DPID), this.sanitiseInput(index_1.DATATYPES.BYTE32, _dematAccountNo), options);
61
+ return this.callContract(FUNCTIONS.SETREGISTRATIONSTATUS, _ref, this.sanitiseInput(index_1.DATATYPES.BYTE32, _DPID), this.sanitiseInput(index_1.DATATYPES.BYTE32, _dematAccountNo), options);
62
62
  }
63
63
  /**
64
64
  * Set registration status [sent by manager on PreTrade.sol, only works if manager’s role is DP]
@@ -105,8 +105,7 @@ class PreTradeContract extends index_1.VerifiedContract {
105
105
  } )
106
106
  */
107
107
  async getConfirmationRequest(_ref, options) {
108
- await this.validateInput(index_1.DATATYPES.STRING, _ref);
109
- return this.callContract(FUNCTIONS.GETCONFIRMATIONREQUEST, this.sanitiseInput(index_1.DATATYPES.BYTE32, _ref), options);
108
+ return this.callContract(FUNCTIONS.GETCONFIRMATIONREQUEST, _ref, options);
110
109
  }
111
110
  /**
112
111
  * Confirm security registration request [sent by manager on PreTrade.sol, only works if manager’s role is DP]
@@ -115,9 +114,28 @@ class PreTradeContract extends index_1.VerifiedContract {
115
114
  */
116
115
  async confirmSecurities(_user, _ref, _status, options) {
117
116
  await this.validateInput(index_1.DATATYPES.ADDRESS, _user);
118
- await this.validateInput(index_1.DATATYPES.STRING, _ref);
119
117
  await this.validateInput(index_1.DATATYPES.STRING, _status);
120
- return this.callContract(FUNCTIONS.CONFIRMSECURITIES, _user, this.sanitiseInput(index_1.DATATYPES.BYTE32, _ref), this.sanitiseInput(index_1.DATATYPES.BYTE32, _status), options);
118
+ return this.callContract(FUNCTIONS.CONFIRMSECURITIES, _user, _ref, this.sanitiseInput(index_1.DATATYPES.BYTE32, _status), options);
119
+ }
120
+ /**
121
+ * Gets security ISIN, company, token
122
+ * @param _token
123
+ * @param options
124
+ * @returns
125
+ */
126
+ async getSecurity(_token, options) {
127
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _token);
128
+ return this.callContract(FUNCTIONS.GETSECURITY, _token, options);
129
+ }
130
+ /**
131
+ * Get Depositary participant ID for user
132
+ * @param _party
133
+ * @param options
134
+ * @returns
135
+ */
136
+ async getDP(_party, options) {
137
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _party);
138
+ return this.callContract(FUNCTIONS.GETDPID, _party, options);
121
139
  }
122
140
  }
123
141
  exports.default = PreTradeContract;
@@ -8,7 +8,9 @@ var FUNCTIONS;
8
8
  (function (FUNCTIONS) {
9
9
  FUNCTIONS["REGISTERPRODUCT"] = "recordProduct";
10
10
  FUNCTIONS["CLIENTPRODUCT"] = "getProductsForClient";
11
+ FUNCTIONS["CLIENTISSUE"] = "getIssuesForClient";
11
12
  FUNCTIONS["COUNTRYPRODUCT"] = "getProductsForCountry";
13
+ FUNCTIONS["COUNTRYISSUE"] = "getIssuesForCountry";
12
14
  FUNCTIONS["GETPRODUCT"] = "getProduct";
13
15
  FUNCTIONS["REGISTERCERTIFICATE"] = "registerCertificate";
14
16
  FUNCTIONS["GETCERTIFICATE"] = "getCertificate";
@@ -24,7 +26,7 @@ class ProductContract extends index_1.VerifiedContract {
24
26
  super(address, JSON.stringify(Products_json_1.abi), signer);
25
27
  this.contractAddress = address;
26
28
  }
27
- async recordProduct(_productCategory, _issuerName, _issuerAddress, _issuerCountry, _issuerSignatoryEmail, _arrangerName, _arrangerAddress, _arrangerCountry, _arrangerSignatoryEmail, _issuerRegistrationNumber, _arrangerRegistrationNumber, options) {
29
+ async recordProduct(_productCategory, _issuerName, _issuerAddress, _issuerCountry, _issuerSignatoryEmail, _arrangerName, _arrangerAddress, _arrangerCountry, _arrangerSignatoryEmail, _registrationDocuments, options) {
28
30
  await this.validateInput(index_1.DATATYPES.STRING, _productCategory);
29
31
  await this.validateInput(index_1.DATATYPES.STRING, _issuerName);
30
32
  await this.validateInput(index_1.DATATYPES.STRING, _issuerAddress);
@@ -34,46 +36,52 @@ class ProductContract extends index_1.VerifiedContract {
34
36
  await this.validateInput(index_1.DATATYPES.STRING, _arrangerAddress);
35
37
  await this.validateInput(index_1.DATATYPES.STRING, _arrangerCountry);
36
38
  await this.validateInput(index_1.DATATYPES.STRING, _arrangerSignatoryEmail);
37
- await this.validateInput(index_1.DATATYPES.STRING, _issuerRegistrationNumber);
38
- await this.validateInput(index_1.DATATYPES.STRING, _arrangerRegistrationNumber);
39
- return this.callContract(FUNCTIONS.GETTOKEN, this.sanitiseInput(index_1.DATATYPES.BYTE32, _productCategory), this.sanitiseInput(index_1.DATATYPES.BYTE32, _issuerName), this.sanitiseInput(index_1.DATATYPES.BYTE32, _issuerAddress), this.sanitiseInput(index_1.DATATYPES.BYTE32, _issuerCountry), this.sanitiseInput(index_1.DATATYPES.BYTE32, _issuerSignatoryEmail), this.sanitiseInput(index_1.DATATYPES.BYTE32, _arrangerName), this.sanitiseInput(index_1.DATATYPES.BYTE32, _arrangerAddress), this.sanitiseInput(index_1.DATATYPES.BYTE32, _arrangerCountry), this.sanitiseInput(index_1.DATATYPES.BYTE32, _arrangerSignatoryEmail), this.sanitiseInput(index_1.DATATYPES.BYTE32, _issuerRegistrationNumber), this.sanitiseInput(index_1.DATATYPES.BYTE32, _arrangerRegistrationNumber), options);
39
+ await this.validateInput(index_1.DATATYPES.STRING, _registrationDocuments);
40
+ return this.callContract(FUNCTIONS.REGISTERPRODUCT, this.sanitiseInput(index_1.DATATYPES.BYTE32, _productCategory), this.sanitiseInput(index_1.DATATYPES.BYTE32, _issuerName), this.sanitiseInput(index_1.DATATYPES.BYTE32, _issuerAddress), this.sanitiseInput(index_1.DATATYPES.BYTE32, _issuerCountry), this.sanitiseInput(index_1.DATATYPES.BYTE32, _issuerSignatoryEmail), this.sanitiseInput(index_1.DATATYPES.BYTE32, _arrangerName), this.sanitiseInput(index_1.DATATYPES.BYTE32, _arrangerAddress), this.sanitiseInput(index_1.DATATYPES.BYTE32, _arrangerCountry), this.sanitiseInput(index_1.DATATYPES.BYTE32, _arrangerSignatoryEmail), _registrationDocuments, options);
40
41
  }
41
42
  async getProductsForClient() {
42
43
  return this.callContract(FUNCTIONS.CLIENTPRODUCT);
43
44
  }
45
+ async getIssuesForClient() {
46
+ return this.callContract(FUNCTIONS.CLIENTISSUE);
47
+ }
44
48
  async getProductsForCountry(_country, options) {
45
49
  await this.validateInput(index_1.DATATYPES.STRING, _country);
46
50
  return this.callContract(FUNCTIONS.COUNTRYPRODUCT, this.sanitiseInput(index_1.DATATYPES.BYTE32, _country), options);
47
51
  }
52
+ async getIssuesForCountry(_country, options) {
53
+ await this.validateInput(index_1.DATATYPES.STRING, _country);
54
+ return this.callContract(FUNCTIONS.COUNTRYISSUE, this.sanitiseInput(index_1.DATATYPES.BYTE32, _country), options);
55
+ }
48
56
  async getProduct(_ref, options) {
49
57
  await this.validateInput(index_1.DATATYPES.STRING, _ref);
50
- return this.callContract(FUNCTIONS.GETPRODUCT, this.sanitiseInput(index_1.DATATYPES.BYTE32, _ref), options);
58
+ return this.callContract(FUNCTIONS.GETPRODUCT, _ref, options);
51
59
  }
52
- async registerCertificate(_ref, _issuerCertificate, _isin, options) {
60
+ async registerCertificate(_ref, _issuerCertificate, _arrangerCertificate, options) {
53
61
  await this.validateInput(index_1.DATATYPES.STRING, _ref);
54
62
  await this.validateInput(index_1.DATATYPES.STRING, _issuerCertificate);
55
- await this.validateInput(index_1.DATATYPES.STRING, _isin);
56
- return this.callContract(FUNCTIONS.REGISTERCERTIFICATE, this.sanitiseInput(index_1.DATATYPES.BYTE32, _ref), _issuerCertificate, _arrangerCertificate, options);
63
+ await this.validateInput(index_1.DATATYPES.STRING, _arrangerCertificate);
64
+ return this.callContract(FUNCTIONS.REGISTERCERTIFICATE, _ref, _issuerCertificate, _arrangerCertificate, options);
57
65
  }
58
66
  async getCertificate(_ref, options) {
59
67
  await this.validateInput(index_1.DATATYPES.STRING, _ref);
60
- return this.callContract(FUNCTIONS.GETCERTIFICATE, this.sanitiseInput(index_1.DATATYPES.BYTE32, _ref), options);
68
+ return this.callContract(FUNCTIONS.GETCERTIFICATE, _ref, options);
61
69
  }
62
70
  async confirmProduct(_ref, options) {
63
71
  await this.validateInput(index_1.DATATYPES.STRING, _ref);
64
- return this.callContract(FUNCTIONS.CONFIRMPRODUCT, this.sanitiseInput(index_1.DATATYPES.BYTE32, _ref), options);
72
+ return this.callContract(FUNCTIONS.CONFIRMPRODUCT, _ref, options);
65
73
  }
66
74
  async getIssue(_ref, options) {
67
75
  await this.validateInput(index_1.DATATYPES.STRING, _ref);
68
- return this.callContract(FUNCTIONS.GETISSUE, this.sanitiseInput(index_1.DATATYPES.BYTE32, _ref), options);
76
+ return this.callContract(FUNCTIONS.GETISSUE, _ref, options);
69
77
  }
70
78
  async getIssuerName(_ref, options) {
71
79
  await this.validateInput(index_1.DATATYPES.STRING, _ref);
72
- return this.callContract(FUNCTIONS.GETISSUERNAME, this.sanitiseInput(index_1.DATATYPES.BYTE32, _ref), options);
80
+ return this.callContract(FUNCTIONS.GETISSUERNAME, _ref, options);
73
81
  }
74
82
  async getIssuerAddress(_ref, options) {
75
83
  await this.validateInput(index_1.DATATYPES.STRING, _ref);
76
- return this.callContract(FUNCTIONS.GETISSUERADDRESS, this.sanitiseInput(index_1.DATATYPES.BYTE32, _ref), options);
84
+ return this.callContract(FUNCTIONS.GETISSUERADDRESS, _ref, options);
77
85
  }
78
86
  }
79
87
  exports.default = ProductContract;
@@ -12,6 +12,8 @@ var FUNCTIONS;
12
12
  FUNCTIONS["GETPRICE"] = "getPrice";
13
13
  FUNCTIONS["GETCORPORATEACTION"] = "getCorporateActions";
14
14
  FUNCTIONS["GETCREDITSCORE"] = "getCreditScore";
15
+ FUNCTIONS["GETSECURITIES"] = "getSecuritiesInvested";
16
+ FUNCTIONS["CREATESECURITY"] = "createSecurity";
15
17
  })(FUNCTIONS || (FUNCTIONS = {}));
16
18
  class SecuritiesRegistryContract extends index_1.VerifiedContract {
17
19
  constructor(signer) {
@@ -93,5 +95,33 @@ class SecuritiesRegistryContract extends index_1.VerifiedContract {
93
95
  await this.validateInput(index_1.DATATYPES.STRING, _isin);
94
96
  return this.callContract(FUNCTIONS.GETPRICE, this.sanitiseInput(index_1.DATATYPES.BYTE32, _isin), options);
95
97
  }
98
+ /**
99
+ * Gets securities invested by message sender
100
+ * @param options
101
+ * @returns array of addresses of security tokens
102
+ */
103
+ async getSecuritiesInvested(options) {
104
+ return this.callContract(FUNCTIONS.GETSECURITIES);
105
+ }
106
+ /**
107
+ * Creates a security which is either a secondary issue (created by the PreTrade contract) or a primary issue (created by the Issues contract)
108
+ * @param _issuer
109
+ * @param _security
110
+ * @param _currency
111
+ * @param _company
112
+ * @param _isin
113
+ * @param _settlementBy is either "DP" or "STP", DP settlements need to be confirmed by issuers while STP settlements are native tokens that do not require issuer confirmations
114
+ * @param options
115
+ * @returns
116
+ */
117
+ async createSecurity(_issuer, _security, _currency, _company, _isin, _settlementBy, options) {
118
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _issuer);
119
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _security);
120
+ await this.validateInput(index_1.DATATYPES.STRING, _currency);
121
+ await this.validateInput(index_1.DATATYPES.STRING, _company);
122
+ await this.validateInput(index_1.DATATYPES.STRING, _isin);
123
+ await this.validateInput(index_1.DATATYPES.STRING, _settlementBy);
124
+ return this.callContract(FUNCTIONS.CREATESECURITY, _issuer, _security, this.sanitiseInput(index_1.DATATYPES.BYTE32, _currency), this.sanitiseInput(index_1.DATATYPES.BYTE32, _company), this.sanitiseInput(index_1.DATATYPES.BYTE32, _isin), this.sanitiseInput(index_1.DATATYPES.BYTE32, _settlementBy), options);
125
+ }
96
126
  }
97
127
  exports.default = SecuritiesRegistryContract;
@@ -47,7 +47,7 @@ class TradeContract extends index_1.VerifiedContract {
47
47
  */
48
48
  async getOrder(_ref, options) {
49
49
  await this.validateInput(index_1.DATATYPES.STRING, _ref);
50
- return this.callContract(FUNCTIONS.GETORDER, this.sanitiseInput(index_1.DATATYPES.BYTE32, _ref), options);
50
+ return this.callContract(FUNCTIONS.GETORDER, _ref, options);
51
51
  }
52
52
  /**
53
53
  * View trade [callable by user]
@@ -57,7 +57,7 @@ class TradeContract extends index_1.VerifiedContract {
57
57
  */
58
58
  async getTrade(_ref, options) {
59
59
  await this.validateInput(index_1.DATATYPES.STRING, _ref);
60
- return this.callContract(FUNCTIONS.GETTRADE, this.sanitiseInput(index_1.DATATYPES.BYTE32, _ref), options);
60
+ return this.callContract(FUNCTIONS.GETTRADE, _ref, options);
61
61
  }
62
62
  }
63
63
  exports.default = TradeContract;
@@ -13,15 +13,15 @@ const contractAddress = {
13
13
  'Bond': '0xaA7461A8be14fB0Fa2682a72968dFB0d48867A81',
14
14
  'Token': '0xFF842A06f86996a5e711eDaF835538B45A356dA0',
15
15
  'Oracle': '0xDa6699338C5b698DaEeF18dEff5db6A89d70390e',
16
- 'PreTrade': '0xe451bf4555a3d664708ef95DE79483AD5707257C',
17
- 'Trade': '0xa2B1fb08866198E849Af9C5F20B8A2389C4762F1',
18
- 'PostTrade': '0xa6Ca8008702aB4f20460a6500563c81D27518Bb4',
19
- 'SecuritiesRegistry': '0x2Fed98ac417064c0F8B5C1403812742c0dbD7a5d',
20
- 'Security': '0xb8A0646BA31bF9005Fce5a7Fb8354CC26037dAd7',
21
- 'OrderPool': '0x7Ee1888b825618f936D14E89D8bF49CEed69a502',
22
- 'PoolFactory': '0xbF57Fb1eE2d13b42B80DF6Bd64EF7727F2eE4198',
23
- 'Products': '',
24
- 'Issues': '',
16
+ 'PreTrade': '0x025A65c62Ea89efF732971F958e9AAc41d39151C',
17
+ 'Trade': '0xAbe1Bc1D3CBCD9FbdD98F5E769003d9251355EEb',
18
+ 'PostTrade': '0x02276B02719a32788F98542eFFC8fA5338a1F888',
19
+ 'SecuritiesRegistry': '0xE760E07B86591f6d584D67a766B8af5C77889Bb0',
20
+ 'Security': '0x62819B9f1A02f96F6685e361f2dFB74a3b5f7292',
21
+ 'OrderPool': '0x234a02b105fa720904a829C6709859bb38E2db00',
22
+ 'PoolFactory': '0x442900D17Ac8C7fC9B8489C1fa3c51538709cf83',
23
+ 'Products': '0xF0Cdff4Fb59AeC4369EFc8DC5179D85F32b48007',
24
+ 'Issues': '0xd5134061e190a45e7378c3711D0a9B07972DA05f',
25
25
  'BalancerManager': '',
26
26
  'CASH': {
27
27
  'VCUSD': '0xe3b822b4d97604f1C73300619d9c8D507f9ED11f',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verified-network/verified-sdk",
3
- "version": "0.4.1",
3
+ "version": "0.4.5",
4
4
  "description": "An SDK to develop applications on the Verified Network",
5
5
  "repository": {
6
6
  "type": "git",