@verified-network/verified-sdk 0.9.7 → 0.9.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,7 @@ const PrimaryIssueManager_json_2 = require("../../../abi/assetmanager/kyber/Prim
8
8
  var FUNCTIONS;
9
9
  (function (FUNCTIONS) {
10
10
  FUNCTIONS["OFFER"] = "offer";
11
+ FUNCTIONS["OFFERTERMS"] = "setOfferTerms";
11
12
  FUNCTIONS["GETOFFERED"] = "getOffered";
12
13
  FUNCTIONS["GETOFFERMADE"] = "getOfferMade";
13
14
  FUNCTIONS["GETALLOTTEDSTAKE"] = "getAllotedStake";
@@ -25,27 +26,44 @@ class PrimaryIssueManager extends index_1.VerifiedContract {
25
26
  constructor(signer, platformAddress, platform) {
26
27
  const address = platformAddress;
27
28
  if (platform == "balancer")
28
- super(address, JSON.stringify(PrimaryIssueManager_json_1.abiBalancer), signer);
29
+ super(address, JSON.stringify(PrimaryIssueManager_json_1.abi), signer);
29
30
  else if (platform == "kyber")
30
- super(address, JSON.stringify(PrimaryIssueManager_json_2.abiKyber), signer);
31
+ super(address, JSON.stringify(PrimaryIssueManager_json_2.abi), signer);
31
32
  this.contractAddress = address;
32
33
  }
33
- async offer(owned, isin, offered, tomatch, desired, min, issuer,
34
- //_hashedMessage: string,
35
- //_v: string,
36
- //_r: string,
37
- //_s: string,
34
+ async offer(owned, isin, offered, tomatch, desired, min, issuer, docs,
35
+ // _hashedMessage: string,
36
+ // _v: string,
37
+ // _r: string,
38
+ // _s: string,
38
39
  options) {
39
40
  await this.validateInput(index_1.DATATYPES.ADDRESS, owned);
40
41
  await this.validateInput(index_1.DATATYPES.ADDRESS, tomatch);
41
42
  await this.validateInput(index_1.DATATYPES.ADDRESS, issuer);
42
43
  await this.validateInput(index_1.DATATYPES.STRING, isin);
44
+ await this.validateInput(index_1.DATATYPES.STRING, docs);
43
45
  await this.validateInput(index_1.DATATYPES.NUMBER, offered);
44
46
  await this.validateInput(index_1.DATATYPES.NUMBER, desired);
45
47
  await this.validateInput(index_1.DATATYPES.NUMBER, min);
46
- return this.callContract(FUNCTIONS.OFFER, owned, this.sanitiseInput(index_1.DATATYPES.BYTE32, isin), offered, tomatch, desired, min, issuer,
48
+ return this.callContract(FUNCTIONS.OFFER, owned, this.sanitiseInput(index_1.DATATYPES.BYTE32, isin), offered, tomatch, desired, min, issuer, docs,
47
49
  /*_hashedMessage, _v, _r, _s,*/ options);
48
50
  }
51
+ /**
52
+ * Lets issuer or manager set minimum order size for issue
53
+ * @param owner address of issuer
54
+ * @param offered address of security issued
55
+ * @param tomatch address of currency paired
56
+ * @param ordersize minimum order value
57
+ * @param options
58
+ * @returns
59
+ */
60
+ async setOfferTerms(owner, offered, tomatch, ordersize, _hashedMessage, _v, _r, _s, options) {
61
+ await this.validateInput(index_1.DATATYPES.ADDRESS, owner);
62
+ await this.validateInput(index_1.DATATYPES.ADDRESS, offered);
63
+ await this.validateInput(index_1.DATATYPES.ADDRESS, tomatch);
64
+ await this.validateInput(index_1.DATATYPES.NUMBER, ordersize);
65
+ return this.callContract(FUNCTIONS.OFFERTERMS, owner, offered, tomatch, ordersize, _hashedMessage, _v, _r, _s, options);
66
+ }
49
67
  /**
50
68
  * Gets security tokens offered for passed token parameter
51
69
  * @param offered address of liquidity token offered by asset manager
@@ -116,7 +134,7 @@ class PrimaryIssueManager extends index_1.VerifiedContract {
116
134
  }
117
135
  async getSubscribers(poolId, _hashedMessage, _v, _r, _s, options) {
118
136
  await this.validateInput(index_1.DATATYPES.STRING, poolId);
119
- return this.callContract(FUNCTIONS.GETSUBSCRIBERS, this.sanitiseInput(index_1.DATATYPES.BYTE32, poolId), _hashedMessage, _v, _r, _s, options);
137
+ return this.callContract(FUNCTIONS.GETSUBSCRIBERS, poolId, _hashedMessage, _v, _r, _s, options);
120
138
  }
121
139
  async close(security, redeem, _hashedMessage, _v, _r, _s, options) {
122
140
  await this.validateInput(index_1.DATATYPES.ADDRESS, security);
@@ -127,16 +145,16 @@ class PrimaryIssueManager extends index_1.VerifiedContract {
127
145
  await this.validateInput(index_1.DATATYPES.ADDRESS, asset);
128
146
  await this.validateInput(index_1.DATATYPES.NUMBER, amnt);
129
147
  await this.validateInput(index_1.DATATYPES.STRING, poolid);
130
- return this.callContract(FUNCTIONS.ACCEPT, this.sanitiseInput(index_1.DATATYPES.BYTE32, poolId), investor, amnt, asset, _hashedMessage, _v, _r, _s, options);
148
+ return this.callContract(FUNCTIONS.ACCEPT, poolid, investor, amnt, asset, _hashedMessage, _v, _r, _s, options);
131
149
  }
132
150
  async reject(poolid, investor, _hashedMessage, _v, _r, _s, options) {
133
151
  await this.validateInput(index_1.DATATYPES.ADDRESS, investor);
134
152
  await this.validateInput(index_1.DATATYPES.STRING, poolid);
135
- return this.callContract(FUNCTIONS.REJECT, this.sanitiseInput(index_1.DATATYPES.BYTE32, poolId), investor, _hashedMessage, _v, _r, _s, options);
153
+ return this.callContract(FUNCTIONS.REJECT, poolid, investor, _hashedMessage, _v, _r, _s, options);
136
154
  }
137
155
  async settle(poolId, _hashedMessage, _v, _r, _s, options) {
138
156
  await this.validateInput(index_1.DATATYPES.STRING, poolId);
139
- return this.callContract(FUNCTIONS.SETTLE, this.sanitiseInput(index_1.DATATYPES.BYTE32, poolId), _hashedMessage, _v, _r, _s, options);
157
+ return this.callContract(FUNCTIONS.SETTLE, poolId, _hashedMessage, _v, _r, _s, options);
140
158
  }
141
159
  }
142
160
  exports.default = PrimaryIssueManager;
@@ -18,26 +18,27 @@ class SecondaryIssueManager extends index_1.VerifiedContract {
18
18
  super(address, JSON.stringify(SecondaryIssueManager_json_1.abi), signer);
19
19
  this.contractAddress = address;
20
20
  }
21
- async issueSecondary(security, currency, amount, id, _hashedMessage, _v, _r, _s, options) {
21
+ async issueSecondary(security, currency, securityAmount, minOrderSize, currencyAmount, _hashedMessage, _v, _r, _s, options) {
22
22
  await this.validateInput(index_1.DATATYPES.ADDRESS, security);
23
23
  await this.validateInput(index_1.DATATYPES.ADDRESS, currency);
24
- await this.validateInput(index_1.DATATYPES.STRING, id);
25
- await this.validateInput(index_1.DATATYPES.NUMBER, amount);
26
- return this.callContract(FUNCTIONS.ISSUESECONDARY, security, currency, amount, this.sanitiseInput(index_1.DATATYPES.BYTE32, id), _hashedMessage, _v, _r, _s, options);
24
+ await this.validateInput(index_1.DATATYPES.NUMBER, securityAmount);
25
+ await this.validateInput(index_1.DATATYPES.NUMBER, minOrderSize);
26
+ await this.validateInput(index_1.DATATYPES.NUMBER, currencyAmount);
27
+ return this.callContract(FUNCTIONS.ISSUESECONDARY, security, currency, securityAmount, minOrderSize, currencyAmount, _hashedMessage, _v, _r, _s, options);
27
28
  }
28
- async getSettlementRequests(dpid, options) {
29
+ async getSettlementRequests(dpid, poolid, options) {
29
30
  await this.validateInput(index_1.DATATYPES.STRING, dpid);
30
- return this.callContract(FUNCTIONS.GETSETTLEMENTREQUESTS, this.sanitiseInput(index_1.DATATYPES.BYTE32, dpid), options);
31
+ await this.validateInput(index_1.DATATYPES.STRING, poolid);
32
+ return this.callContract(FUNCTIONS.GETSETTLEMENTREQUESTS, this.sanitiseInput(index_1.DATATYPES.BYTE32, dpid), poolid, options);
31
33
  }
32
34
  async getSettlementRequest(ref, options) {
33
35
  await this.validateInput(index_1.DATATYPES.STRING, ref);
34
- return this.callContract(FUNCTIONS.GETSETTLEMENTREQUEST, this.sanitiseInput(index_1.DATATYPES.BYTE32, ref), options);
36
+ return this.callContract(FUNCTIONS.GETSETTLEMENTREQUEST, ref, options);
35
37
  }
36
- async setSettlementStatus(ref, status, id, options) {
38
+ async setSettlementStatus(ref, status, options) {
37
39
  await this.validateInput(index_1.DATATYPES.STRING, ref);
38
40
  await this.validateInput(index_1.DATATYPES.STRING, status);
39
- await this.validateInput(index_1.DATATYPES.STRING, id);
40
- return this.callContract(FUNCTIONS.SETSETTLEMENTSTATUS, this.sanitiseInput(index_1.DATATYPES.BYTE32, ref), this.sanitiseInput(index_1.DATATYPES.BYTE32, status), this.sanitiseInput(index_1.DATATYPES.BYTE32, id), options);
41
+ return this.callContract(FUNCTIONS.SETSETTLEMENTSTATUS, this.sanitiseInput(index_1.DATATYPES.BYTE32, ref), this.sanitiseInput(index_1.DATATYPES.BYTE32, status), options);
41
42
  }
42
43
  }
43
44
  exports.default = SecondaryIssueManager;
@@ -7,6 +7,8 @@ const Vault_json_1 = require("../../abi/custody/Vault.json");
7
7
  var FUNCTIONS;
8
8
  (function (FUNCTIONS) {
9
9
  FUNCTIONS["CREATEVAULT"] = "createVault";
10
+ FUNCTIONS["GETVAULTS"] = "getVaults";
11
+ FUNCTIONS["TRANSFERVAULT"] = "transferVault";
10
12
  FUNCTIONS["GETCREATOR"] = "getCreator";
11
13
  FUNCTIONS["ADDPARTICIPANT"] = "addParticipant";
12
14
  FUNCTIONS["REMOVEPARTICIPANT"] = "removeParticipant";
@@ -32,6 +34,14 @@ class CustodyContract extends index_1.VerifiedContract {
32
34
  await this.validateInput(index_1.DATATYPES.STRING, _id);
33
35
  return this.callContract(FUNCTIONS.CREATEVAULT, this.sanitiseInput(index_1.DATATYPES.BYTE32, _creator), _id, options);
34
36
  }
37
+ async getVaults() {
38
+ return this.callContract(FUNCTIONS.GETVAULTS);
39
+ }
40
+ async transferVault(_creator, _transferee, options) {
41
+ await this.validateInput(index_1.DATATYPES.STRING, _creator);
42
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _transferee);
43
+ return this.callContract(FUNCTIONS.TRANSFERVAULT, this.sanitiseInput(index_1.DATATYPES.BYTE32, _creator), _transferee, options);
44
+ }
35
45
  async getCreator(_creator, options) {
36
46
  await this.validateInput(index_1.DATATYPES.STRING, _creator);
37
47
  return this.callContract(FUNCTIONS.GETCREATOR, this.sanitiseInput(index_1.DATATYPES.BYTE32, _creator), options);
@@ -11,6 +11,9 @@ var FUNCTIONS;
11
11
  FUNCTIONS["GETPAYMENTFEECOLLECTED"] = "getPaymentFeeCollected";
12
12
  FUNCTIONS["GETLOANFEECOLLECTED"] = "getLoanFeeCollected";
13
13
  FUNCTIONS["SHAREFEE"] = "shareFee";
14
+ FUNCTIONS["GETISSUINGFEECOLLECTED"] = "getIssuingFeeCollected";
15
+ FUNCTIONS["GETTRADINGFEECOLLECTED"] = "getTradingFeeCollected";
16
+ FUNCTIONS["SHARECOLLECTEDFEE"] = "shareCollection";
14
17
  })(FUNCTIONS || (FUNCTIONS = {}));
15
18
  class DistributionContract extends index_1.VerifiedContract {
16
19
  constructor(signer) {
@@ -25,6 +28,12 @@ class DistributionContract extends index_1.VerifiedContract {
25
28
  async shareFee() {
26
29
  return this.callContract(FUNCTIONS.SHAREFEE);
27
30
  }
31
+ /**
32
+ Shares issuing and trading fee collected with shareholders
33
+ */
34
+ async shareCollection() {
35
+ return this.callContract(FUNCTIONS.SHARECOLLECTEDFEE);
36
+ }
28
37
  /**
29
38
  Gets payment fee collected
30
39
  @param _currency payment fee in currency collected
@@ -41,6 +50,26 @@ class DistributionContract extends index_1.VerifiedContract {
41
50
  await this.validateInput(index_1.DATATYPES.STRING, _currency);
42
51
  return this.callContract(FUNCTIONS.GETLOANFEECOLLECTED, this.sanitiseInput(index_1.DATATYPES.BYTE32, _currency), options);
43
52
  }
53
+ /**
54
+ Gets issuing fee collected
55
+ @param _platform address of platform from which fee needs to be collected
56
+ @param _token address of token for which fee needs to be collected
57
+ */
58
+ async getIssuingFeeCollected(_platform, _token, options) {
59
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _platform);
60
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _token);
61
+ return this.callContract(FUNCTIONS.GETISSUINGFEECOLLECTED, _platform, _token, options);
62
+ }
63
+ /**
64
+ Gets trading fee collected
65
+ @param _platform address of platform from which fee needs to be collected
66
+ @param _token address of token for which fee needs to be collected
67
+ */
68
+ async getTradingFeeCollected(_platform, _token, options) {
69
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _platform);
70
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _token);
71
+ return this.callContract(FUNCTIONS.GETTRADINGFEECOLLECTED, _platform, _token, options);
72
+ }
44
73
  /**
45
74
  Get revenue shareholders
46
75
  @param _type type of shareholder, ie, 'BUSINESS' or 'OPERATOR'
@@ -54,7 +54,7 @@ class LiquidityContract extends index_1.VerifiedContract {
54
54
  async supportTokens(_tokens, _name, options) {
55
55
  await this.validateInput(index_1.DATATYPES.STRING, _tokens);
56
56
  await this.validateInput(index_1.DATATYPES.STRING, _name);
57
- return this.callContract(FUNCTIONS.SUPPORTTOKENS, _tokens, this.sanitiseInput(index_1.DATATYPES.BYTE32, _name), options);
57
+ return this.callContract(FUNCTIONS.SUPPORTTOKENS, _tokens, _name, options);
58
58
  }
59
59
  /**
60
60
  Checks if a specified token is supported for investing in the Verified Liquidity token
@@ -11,6 +11,7 @@ var FUNCTIONS;
11
11
  FUNCTIONS["REMOVEROLE"] = "removeRole";
12
12
  FUNCTIONS["ADDROLE"] = "addRole";
13
13
  FUNCTIONS["UPDATEKYC"] = "KycUpdate";
14
+ FUNCTIONS["GETCLIENTKYC"] = "getClientKYC";
14
15
  })(FUNCTIONS || (FUNCTIONS = {}));
15
16
  class VerifiedClient extends index_1.VerifiedContract {
16
17
  constructor(signer) {
@@ -64,5 +65,9 @@ class VerifiedClient extends index_1.VerifiedContract {
64
65
  await this.validateInput(index_1.DATATYPES.NUMBER, status);
65
66
  return this.callContract(FUNCTIONS.UPDATEKYC, client, this.sanitiseInput(index_1.DATATYPES.BYTE32, name), this.sanitiseInput(index_1.DATATYPES.BYTE32, surname), this.sanitiseInput(index_1.DATATYPES.BYTE32, country), status, _hashedMessage, _v, _r, _s, options);
66
67
  }
68
+ async getClientKYC(_client, options) {
69
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _client);
70
+ return this.callContract(FUNCTIONS.GETCLIENTKYC, _client, options);
71
+ }
67
72
  }
68
73
  exports.default = VerifiedClient;
@@ -19,6 +19,8 @@ var FUNCTIONS;
19
19
  FUNCTIONS["ISSUESECURITY"] = "issueSecurity";
20
20
  FUNCTIONS["SECURITIESADDED"] = "securitiesAdded";
21
21
  FUNCTIONS["GETSECURITYTOKEN"] = "getSecurityToken";
22
+ FUNCTIONS["GETHOLDER"] = "getHolder";
23
+ FUNCTIONS["GETSECURITY"] = "getSecurity";
22
24
  })(FUNCTIONS || (FUNCTIONS = {}));
23
25
  class VerifiedFactory extends index_1.VerifiedContract {
24
26
  constructor(signer) {
@@ -110,6 +112,14 @@ class VerifiedFactory extends index_1.VerifiedContract {
110
112
  async getIssues() {
111
113
  return this.callContract(FUNCTIONS.GETISSUES);
112
114
  }
115
+ async getHolder(_token, options) {
116
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _token);
117
+ return this.callContract(FUNCTIONS.GETHOLDER, _token, options);
118
+ }
119
+ async getSecurity(_token, options) {
120
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _token);
121
+ return this.callContract(FUNCTIONS.GETSECURITY, _token, options);
122
+ }
113
123
  async issueSecurity(_security, _company, _isin, _currency, _issuer, _hashedMessage, _v, _r, _s, options) {
114
124
  await this.validateInput(index_1.DATATYPES.ADDRESS, _security);
115
125
  await this.validateInput(index_1.DATATYPES.ADDRESS, _issuer);
@@ -2,41 +2,42 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const contractAddress = {
4
4
  'L1-goerli': {
5
- 'Client': '0x531D045632dAf6bD7B00dD24D8bd43760a25bD74',
5
+ 'Client': '0x7297afd7950C966367A31cb15A56C2bC81E22AC0',
6
6
  'KYC': '',
7
7
  'System': '',
8
8
  'Holder': '',
9
9
  'Ledger': '',
10
10
  'Account': '',
11
- 'Factory': '0x0d13E5aFECC9b56d7284A9B78DDCDDc00Bd447d0',
12
- 'Cash': '0x56770Bb626268588Fa771d09A0A7c942A416ca48',
13
- 'Bond': '0xc5838564A9eB72a1badc1a7d930b4F380D35c8A7',
11
+ 'Factory': '0x6405ddCD72841f0827D51A65a6AB89B7486d4A48',
12
+ 'Cash': '0x2f7Ff905D8aD56Ab2F9afE10AD7486DbD258d3F8',
13
+ 'Bond': '0x2E44D8FDd5343142b5224c57E44E13e249e93FdB',
14
14
  'Token': '',
15
15
  'Oracle': '',
16
- 'Rates': '0x9b884592F9B73A02EC1C1D62b8ab778307a6C179',
16
+ 'Rates': '0x04d3C888F112AF5cD43928e2456631401D591664',
17
17
  'PreTrade': '',
18
18
  'Trade': '',
19
19
  'PostTrade': '',
20
20
  'SecuritiesRegistry': '',
21
- 'Security': '0x9892B3200A52E5051ba991b8F70c286B53f6966d',
21
+ 'Security': '0xDF81795A2c6078FD541F6C5E949153F2bC76b6b6',
22
22
  'OrderPool': '',
23
23
  'PoolFactory': '',
24
24
  'Stocks': '',
25
25
  'Bonds': '',
26
- 'Liquidity': '0xD932b535D8394C3236816725994Bf7e75172C1D8',
27
- 'Distribution': '0xf871AAE04baa897a1310670B561e597F53Ff2a9F',
28
- 'BalancerPrimaryIssueManager': '0x5ABDD4568C52352f96925d13a810410D359EE59e',
29
- 'BalancerSecondaryIssueManager': '0x5e8f5D4a471552C1914774A8d12E2c0b2d487061',
26
+ 'Liquidity': '0x9Ab60Ce0ae460Cfa7961858c0065034e35e009FD',
27
+ 'Vitta': '0xB40716004C92C8B6C65DA47b8073089027C189D1',
28
+ 'Distribution': '0x721965FAf93C94EeB1479F649f3c6ce67b0108D2',
29
+ 'BalancerPrimaryIssueManager': '0x215a3B1F93b231e5c085aE4016aeF89BD5D0EF14',
30
+ 'BalancerSecondaryIssueManager': '0xE2FC98AF62c4274819a3EBc96eB0a34980CEE6F0',
30
31
  'Custody': '0xF6ebB33E758eC36A2D3065F4633131DFF8307A07',
31
32
  'CASH': {
32
- 'VCUSD': '0xe0AF68900126e592f50e0A989aC2206CC467C055',
33
- 'VCEUR': '0xB738563f64EE3983D6ed02b44f2ADb0c83C0362D',
34
- 'VCINR': '0xd2f9341BBaC7fb75D46F6e99Fe252248eE8a277E'
33
+ 'VCUSD': '0x441059c70c8294BecC1796275507C93Ea61db12B',
34
+ 'VCEUR': '0xA63D3324C253A6947dFfC2Fa7731297073632fce',
35
+ 'VCINR': '0x17166D19107Be2a588Adf9773492090631e97c80'
35
36
  },
36
37
  'BOND': {
37
- 'VBUSD': '0xA8BC2e1a3846BAf1f83fE0fced5C995E9A9d4C49',
38
- 'VBEUR': '0xBa5B286b4b73d813035E353A207926E5a5a931d9',
39
- 'VBINR': '0xf00024605E944b1C3723B7066888cEd9E9BC2f55'
38
+ 'VBUSD': '0xA5CcB17569195C2C4DC71099232C5046da568b06',
39
+ 'VBEUR': '0xBa60968eF7A487B53c22e019061d4FDa946313C1',
40
+ 'VBINR': '0x167E576bEBf95d25449E6EFa0516b23d52Bef19a'
40
41
  },
41
42
  },
42
43
  'L2-goerli': {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verified-network/verified-sdk",
3
- "version": "0.9.7",
3
+ "version": "0.9.9",
4
4
  "description": "An SDK to develop applications on the Verified Network",
5
5
  "repository": {
6
6
  "type": "git",