@verified-network/verified-sdk 0.4.0 → 0.4.1

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.
@@ -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(this.sanitiseOutput(DATATYPES.BYTE32, element));
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
  });
@@ -24,12 +24,12 @@ class PreTradeContract extends index_1.VerifiedContract {
24
24
  }
25
25
  /**
26
26
  * Register demat account [sent by user on PreTrade.sol]
27
- * @param (bytes32 _countryCode)
28
- * @returns Returns nothing. Ensure _countryCode maps to http://country.io/names.json
27
+ * @param (bytes32 _currencyCode)
28
+ * @returns Returns nothing.
29
29
  */
30
- async registerDematAccount(_countryCode, options) {
31
- await this.validateInput(index_1.DATATYPES.STRING, _countryCode);
32
- return this.callContract(FUNCTIONS.REGISTERDEMATACCOUNT, sanitiseInput(index_1.DATATYPES.BYTE32, _countryCode), options);
30
+ async registerDematAccount(_currencyCode, options) {
31
+ await this.validateInput(index_1.DATATYPES.STRING, _currencyCode);
32
+ return this.callContract(FUNCTIONS.REGISTERDEMATACCOUNT, this.sanitiseInput(index_1.DATATYPES.BYTE32, _currencyCode), options);
33
33
  }
34
34
  /**
35
35
  * Get no of registrations [sent by manager on PreTrade.sol, only works if manager’s role is DP]
@@ -38,7 +38,7 @@ class PreTradeContract extends index_1.VerifiedContract {
38
38
  */
39
39
  async getRegistrationRequests(_countryCode, options) {
40
40
  await this.validateInput(index_1.DATATYPES.STRING, _countryCode);
41
- return this.callContract(FUNCTIONS.GETREGISTRATIONREQUESTS, sanitiseInput(index_1.DATATYPES.BYTE32, _countryCode), options);
41
+ return this.callContract(FUNCTIONS.GETREGISTRATIONREQUESTS, this.sanitiseInput(index_1.DATATYPES.BYTE32, _countryCode), options);
42
42
  }
43
43
  /**
44
44
  * Get registration request for passed registration reference
@@ -47,7 +47,7 @@ class PreTradeContract extends index_1.VerifiedContract {
47
47
  */
48
48
  async getRegistrationRequest(_ref, options) {
49
49
  await this.validateInput(index_1.DATATYPES.STRING, _ref);
50
- return this.callContract(FUNCTIONS.GETREGISTRATIONREQUEST, sanitiseInput(index_1.DATATYPES.BYTE32, _ref), options);
50
+ return this.callContract(FUNCTIONS.GETREGISTRATIONREQUEST, this.sanitiseInput(index_1.DATATYPES.BYTE32, _ref), options);
51
51
  }
52
52
  /**
53
53
  * Set registration status [sent by manager on PreTrade.sol, only works if manager’s role is DP]
@@ -58,7 +58,7 @@ class PreTradeContract extends index_1.VerifiedContract {
58
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, sanitiseInput(index_1.DATATYPES.BYTE32, _ref), sanitiseInput(index_1.DATATYPES.BYTE32, _DPID), sanitiseInput(index_1.DATATYPES.BYTE32, _dematAccountNo), options);
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);
62
62
  }
63
63
  /**
64
64
  * Set registration status [sent by manager on PreTrade.sol, only works if manager’s role is DP]
@@ -2,24 +2,24 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const contractAddress = {
4
4
  'ropsten': {
5
- 'Client': '0x84176eED2492e6e13D0eb4C61E7996c2A2d88638',
6
- 'KYC': '0x25238A104BA8f500d0d1F691FB521FcD639B6B52',
7
- 'System': '0xe68E1C9FA4158fC7f512833d454a967DE474d9B4',
8
- 'Holder': '0x6af2Ea20426927cfDb23583AEec382b7A2E88525',
9
- 'Ledger': '0xc8Cc23D39fA6A32D4d76844ebaD80d09fA519cB6',
10
- 'Account': '0x1af295D84f00f825add18Fd0B7A30B70969b7665',
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': '0xa6579c02f40AcE0E7Af2aED58192caD97C35adc7',
17
- 'Trade': '0x70DC746Fb1520F34473cE02CA9378e9Db3d222ae',
18
- 'PostTrade': '0x94100Bd9f28C1bd69C34601C7900d9d82C7cBF9B',
19
- 'SecuritiesRegistry': '0x4Ac7F6B13ef4acdEa1B22a7a07529C980584Fe97',
20
- 'Security': '0x6aBF021D2BD9B143F285Da68b89e33C59C9c878c',
21
- 'OrderPool': '0x64E090ce540e70dD7187866f4C3C88381d0Dbf5b',
22
- 'PoolFactory': '0x4bc81aC97F1258b18C02bB2aC95703F5396160c3',
16
+ 'PreTrade': '0xe451bf4555a3d664708ef95DE79483AD5707257C',
17
+ 'Trade': '0xa2B1fb08866198E849Af9C5F20B8A2389C4762F1',
18
+ 'PostTrade': '0xa6Ca8008702aB4f20460a6500563c81D27518Bb4',
19
+ 'SecuritiesRegistry': '0x2Fed98ac417064c0F8B5C1403812742c0dbD7a5d',
20
+ 'Security': '0xb8A0646BA31bF9005Fce5a7Fb8354CC26037dAd7',
21
+ 'OrderPool': '0x7Ee1888b825618f936D14E89D8bF49CEed69a502',
22
+ 'PoolFactory': '0xbF57Fb1eE2d13b42B80DF6Bd64EF7727F2eE4198',
23
23
  'Products': '',
24
24
  'Issues': '',
25
25
  'BalancerManager': '',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verified-network/verified-sdk",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "An SDK to develop applications on the Verified Network",
5
5
  "repository": {
6
6
  "type": "git",