@verified-network/verified-sdk 0.3.8 → 0.4.2
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.
- package/dist/abi/accounts/Account.json +2552 -2552
- package/dist/abi/accounts/Client.json +5417 -5417
- package/dist/abi/accounts/Holder.json +2930 -2930
- package/dist/abi/accounts/Kyc.json +4192 -4192
- package/dist/abi/accounts/Ledger.json +1686 -1686
- package/dist/abi/accounts/System.json +20215 -12415
- package/dist/abi/trades/OrderPool.json +8002 -7193
- package/dist/abi/trades/PoolFactory.json +1131 -1424
- package/dist/abi/trades/PostTrade.json +2442 -2769
- package/dist/abi/trades/PreTrade.json +5122 -5404
- package/dist/abi/trades/SecuritiesRegistry.json +10732 -7692
- package/dist/abi/trades/Security.json +4279 -6506
- package/dist/abi/trades/Trade.json +5942 -5367
- package/dist/contract/index.js +3 -3
- package/dist/contract/issue/index.js +15 -10
- package/dist/contract/orderpool/index.js +4 -4
- package/dist/contract/posttrade/index.js +2 -2
- package/dist/contract/pretrade/index.js +32 -14
- package/dist/contract/product/index.js +5 -6
- package/dist/contract/securitiesregistry/index.js +30 -0
- package/dist/contract/trade/index.js +2 -2
- package/dist/contractAddress/index.js +13 -13
- package/package.json +1 -1
package/dist/contract/index.js
CHANGED
|
@@ -84,8 +84,7 @@ class VerifiedContract {
|
|
|
84
84
|
* @param ( value [ , unit = "ether" ] )
|
|
85
85
|
* @returns ⇒ BigNumber
|
|
86
86
|
*/
|
|
87
|
-
ethers_1.utils.parseUnits(data);
|
|
88
|
-
break;
|
|
87
|
+
return ethers_1.utils.parseUnits(data);
|
|
89
88
|
case DATATYPES.BOOLEAN:
|
|
90
89
|
const arr = [true, false, "true", "false", 'TRUE', 'FALSE'];
|
|
91
90
|
return arr.indexOf(data) !== -1 ? true : new Error("Invalid Boolean value");
|
|
@@ -140,8 +139,9 @@ class VerifiedContract {
|
|
|
140
139
|
return response.result.push(element.toString());
|
|
141
140
|
if (ethers_1.utils.isAddress(element))
|
|
142
141
|
return response.result.push(element);
|
|
142
|
+
//if (utils.isBytesLike(element)) return response.result.push(this.sanitiseOutput(DATATYPES.BYTE32, element))
|
|
143
143
|
if (ethers_1.utils.isBytesLike(element))
|
|
144
|
-
return response.result.push(
|
|
144
|
+
return response.result.push(element);
|
|
145
145
|
if (typeof element === 'boolean' || (this.validateInput(DATATYPES.ADDRESS, element)))
|
|
146
146
|
return response.result.push(element);
|
|
147
147
|
});
|
|
@@ -25,6 +25,7 @@ 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
31
|
constructor(signer) {
|
|
@@ -39,6 +40,12 @@ 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);
|
|
@@ -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,
|
|
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,
|
|
113
|
+
await this.validateInput(index_1.DATATYPES.STRING, _offeringDocuments);
|
|
107
114
|
await this.validateInput(index_1.DATATYPES.STRING, _isin);
|
|
108
|
-
|
|
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,
|
|
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,
|
|
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.
|
|
123
|
-
return this.callContract(FUNCTIONS.ISSUEBOND, _issueSize, _offerPrice, _minAskPrice, _couponPaymentCycle, _tenure, this.sanitiseInput(index_1.DATATYPES.BYTE32, _currency), this.sanitiseInput(index_1.DATATYPES.BYTE32,
|
|
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 =
|
|
17
|
+
const address = orderPool;
|
|
18
18
|
super(address, JSON.stringify(OrderPool_json_1.abi), signer);
|
|
19
19
|
this.contractAddress = address;
|
|
20
20
|
}
|
|
@@ -45,7 +45,7 @@ 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,
|
|
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]
|
|
@@ -54,7 +54,7 @@ class OrderPoolContract extends index_1.VerifiedContract {
|
|
|
54
54
|
*/
|
|
55
55
|
async cancelOrder(ref, options) {
|
|
56
56
|
await this.validateInput(index_1.DATATYPES.STRING, ref);
|
|
57
|
-
return this.callContract(FUNCTIONS.CANCELORDER,
|
|
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,
|
|
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,
|
|
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) {
|
|
@@ -24,12 +26,12 @@ class PreTradeContract extends index_1.VerifiedContract {
|
|
|
24
26
|
}
|
|
25
27
|
/**
|
|
26
28
|
* Register demat account [sent by user on PreTrade.sol]
|
|
27
|
-
* @param (bytes32
|
|
28
|
-
* @returns Returns nothing.
|
|
29
|
+
* @param (bytes32 _currencyCode)
|
|
30
|
+
* @returns Returns nothing.
|
|
29
31
|
*/
|
|
30
|
-
async registerDematAccount(
|
|
31
|
-
await this.validateInput(index_1.DATATYPES.STRING,
|
|
32
|
-
return this.callContract(FUNCTIONS.REGISTERDEMATACCOUNT, sanitiseInput(index_1.DATATYPES.BYTE32,
|
|
32
|
+
async registerDematAccount(_currencyCode, options) {
|
|
33
|
+
await this.validateInput(index_1.DATATYPES.STRING, _currencyCode);
|
|
34
|
+
return this.callContract(FUNCTIONS.REGISTERDEMATACCOUNT, this.sanitiseInput(index_1.DATATYPES.BYTE32, _currencyCode), options);
|
|
33
35
|
}
|
|
34
36
|
/**
|
|
35
37
|
* Get no of registrations [sent by manager on PreTrade.sol, only works if manager’s role is DP]
|
|
@@ -38,7 +40,7 @@ class PreTradeContract extends index_1.VerifiedContract {
|
|
|
38
40
|
*/
|
|
39
41
|
async getRegistrationRequests(_countryCode, options) {
|
|
40
42
|
await this.validateInput(index_1.DATATYPES.STRING, _countryCode);
|
|
41
|
-
return this.callContract(FUNCTIONS.GETREGISTRATIONREQUESTS, sanitiseInput(index_1.DATATYPES.BYTE32, _countryCode), options);
|
|
43
|
+
return this.callContract(FUNCTIONS.GETREGISTRATIONREQUESTS, this.sanitiseInput(index_1.DATATYPES.BYTE32, _countryCode), options);
|
|
42
44
|
}
|
|
43
45
|
/**
|
|
44
46
|
* Get registration request for passed registration reference
|
|
@@ -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
|
-
|
|
50
|
-
return this.callContract(FUNCTIONS.GETREGISTRATIONREQUEST, 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,
|
|
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
|
-
|
|
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,
|
|
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;
|
|
@@ -24,7 +24,7 @@ class ProductContract extends index_1.VerifiedContract {
|
|
|
24
24
|
super(address, JSON.stringify(Products_json_1.abi), signer);
|
|
25
25
|
this.contractAddress = address;
|
|
26
26
|
}
|
|
27
|
-
async recordProduct(_productCategory, _issuerName, _issuerAddress, _issuerCountry, _issuerSignatoryEmail, _arrangerName, _arrangerAddress, _arrangerCountry, _arrangerSignatoryEmail,
|
|
27
|
+
async recordProduct(_productCategory, _issuerName, _issuerAddress, _issuerCountry, _issuerSignatoryEmail, _arrangerName, _arrangerAddress, _arrangerCountry, _arrangerSignatoryEmail, _registrationDocuments, options) {
|
|
28
28
|
await this.validateInput(index_1.DATATYPES.STRING, _productCategory);
|
|
29
29
|
await this.validateInput(index_1.DATATYPES.STRING, _issuerName);
|
|
30
30
|
await this.validateInput(index_1.DATATYPES.STRING, _issuerAddress);
|
|
@@ -34,9 +34,8 @@ class ProductContract extends index_1.VerifiedContract {
|
|
|
34
34
|
await this.validateInput(index_1.DATATYPES.STRING, _arrangerAddress);
|
|
35
35
|
await this.validateInput(index_1.DATATYPES.STRING, _arrangerCountry);
|
|
36
36
|
await this.validateInput(index_1.DATATYPES.STRING, _arrangerSignatoryEmail);
|
|
37
|
-
await this.validateInput(index_1.DATATYPES.STRING,
|
|
38
|
-
|
|
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);
|
|
37
|
+
await this.validateInput(index_1.DATATYPES.STRING, _registrationDocuments);
|
|
38
|
+
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), _registrationDocuments, options);
|
|
40
39
|
}
|
|
41
40
|
async getProductsForClient() {
|
|
42
41
|
return this.callContract(FUNCTIONS.CLIENTPRODUCT);
|
|
@@ -49,10 +48,10 @@ class ProductContract extends index_1.VerifiedContract {
|
|
|
49
48
|
await this.validateInput(index_1.DATATYPES.STRING, _ref);
|
|
50
49
|
return this.callContract(FUNCTIONS.GETPRODUCT, this.sanitiseInput(index_1.DATATYPES.BYTE32, _ref), options);
|
|
51
50
|
}
|
|
52
|
-
async registerCertificate(_ref, _issuerCertificate,
|
|
51
|
+
async registerCertificate(_ref, _issuerCertificate, _arrangerCertificate, options) {
|
|
53
52
|
await this.validateInput(index_1.DATATYPES.STRING, _ref);
|
|
54
53
|
await this.validateInput(index_1.DATATYPES.STRING, _issuerCertificate);
|
|
55
|
-
await this.validateInput(index_1.DATATYPES.STRING,
|
|
54
|
+
await this.validateInput(index_1.DATATYPES.STRING, _arrangerCertificate);
|
|
56
55
|
return this.callContract(FUNCTIONS.REGISTERCERTIFICATE, this.sanitiseInput(index_1.DATATYPES.BYTE32, _ref), _issuerCertificate, _arrangerCertificate, options);
|
|
57
56
|
}
|
|
58
57
|
async getCertificate(_ref, options) {
|
|
@@ -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,
|
|
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,
|
|
60
|
+
return this.callContract(FUNCTIONS.GETTRADE, _ref, options);
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
exports.default = TradeContract;
|
|
@@ -2,24 +2,24 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const contractAddress = {
|
|
4
4
|
'ropsten': {
|
|
5
|
-
'Client': '
|
|
6
|
-
'KYC': '
|
|
7
|
-
'System': '
|
|
8
|
-
'Holder': '
|
|
9
|
-
'Ledger': '
|
|
10
|
-
'Account': '
|
|
5
|
+
'Client': '0xEAFb86d95575a5893E692613e3F7c4ADb1c89E03',
|
|
6
|
+
'KYC': '0x24a41AADC3aFd117BEC9db41212D517499dd651d',
|
|
7
|
+
'System': '0x2399b44c71642709e870cE081Ecd2B060DF5eD63',
|
|
8
|
+
'Holder': '0x62B91a0A10540CF935De3c36354531f2E6399228',
|
|
9
|
+
'Ledger': '0xcfD532b8B0D6Dbf1Af531D7D3497304f77e99990',
|
|
10
|
+
'Account': '0x634056BbF1083Ed881C4f3187C8dfe6280C6a879',
|
|
11
11
|
'Factory': '0x688fBf0A2e72f937e2Ef322079b746f320413063',
|
|
12
12
|
'Cash': '0xCeE5540B147b08A933FA8fD353446f6C60Fd95f7',
|
|
13
13
|
'Bond': '0xaA7461A8be14fB0Fa2682a72968dFB0d48867A81',
|
|
14
14
|
'Token': '0xFF842A06f86996a5e711eDaF835538B45A356dA0',
|
|
15
15
|
'Oracle': '0xDa6699338C5b698DaEeF18dEff5db6A89d70390e',
|
|
16
|
-
'PreTrade': '
|
|
17
|
-
'Trade': '
|
|
18
|
-
'PostTrade': '
|
|
19
|
-
'SecuritiesRegistry': '
|
|
20
|
-
'Security': '
|
|
21
|
-
'OrderPool': '
|
|
22
|
-
'PoolFactory': '
|
|
16
|
+
'PreTrade': '0x025A65c62Ea89efF732971F958e9AAc41d39151C',
|
|
17
|
+
'Trade': '0xAbe1Bc1D3CBCD9FbdD98F5E769003d9251355EEb',
|
|
18
|
+
'PostTrade': '0x02276B02719a32788F98542eFFC8fA5338a1F888',
|
|
19
|
+
'SecuritiesRegistry': '0xE760E07B86591f6d584D67a766B8af5C77889Bb0',
|
|
20
|
+
'Security': '0x62819B9f1A02f96F6685e361f2dFB74a3b5f7292',
|
|
21
|
+
'OrderPool': '0x234a02b105fa720904a829C6709859bb38E2db00',
|
|
22
|
+
'PoolFactory': '0x442900D17Ac8C7fC9B8489C1fa3c51538709cf83',
|
|
23
23
|
'Products': '',
|
|
24
24
|
'Issues': '',
|
|
25
25
|
'BalancerManager': '',
|