@verified-network/verified-sdk 0.7.4 → 0.7.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.
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ // SPDX-License-Identifier: BUSL-1.1
3
+ // @ts-nocheck
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ const index_1 = require("../../index");
6
+ const L1Bond_json_1 = require("../../../abi/deposits/L1Bond.json");
7
+ var FUNCTIONS;
8
+ (function (FUNCTIONS) {
9
+ FUNCTIONS["SUPPORTTOKENS"] = "supportTokens";
10
+ FUNCTIONS["CHECKSUPPORTFORTOKEN"] = "checkSupportForToken";
11
+ FUNCTIONS["GETSUPPORTEDTOKENS"] = "getSupportedTokens";
12
+ FUNCTIONS["REQUESTISSUE"] = "requestIssue";
13
+ FUNCTIONS["SETSIGNER"] = "setSigner";
14
+ })(FUNCTIONS || (FUNCTIONS = {}));
15
+ class VerifiedBond extends index_1.VerifiedContract {
16
+ constructor(signer, bondCurrencyAddress) {
17
+ const chainId = signer.provider._network.chainId.toString();
18
+ const address = bondCurrencyAddress;
19
+ super(address, JSON.stringify(L1Bond_json_1.abi), signer);
20
+ this.contractAddress = address;
21
+ }
22
+ /**
23
+ Specifies list of supported tokens that can be invested in the Verified Liquidity token
24
+ @param _tokens address of token supported
25
+ @param _name string name of token supported
26
+ */
27
+ async supportTokens(_tokens, _name, options) {
28
+ await this.validateInput(index_1.DATATYPES.STRING, _tokens);
29
+ await this.validateInput(index_1.DATATYPES.STRING, _name);
30
+ return this.callContract(FUNCTIONS.SUPPORTTOKENS, _tokens, this.sanitiseInput(index_1.DATATYPES.BYTE32, _name), options);
31
+ }
32
+ /**
33
+ Checks if a specified token is supported for investing in the Verified Liquidity token
34
+ @param _token token that is supported for investment
35
+ */
36
+ async checkSupportForToken(_token, options) {
37
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _token);
38
+ return this.callContract(FUNCTIONS.CHECKSUPPORTFORTOKEN, _token, options);
39
+ }
40
+ /**
41
+ * Returns list of supported liquidity tokens (eg, VITTA, USDC, DAI)
42
+ * @returns array of struct of tokens
43
+ */
44
+ async getSupportedTokens() {
45
+ return this.callContract(FUNCTIONS.GETSUPPORTEDTOKENS);
46
+ }
47
+ /**
48
+ Used by external apps (eg, exchange, wallet) to buy Verified cash token
49
+ @param _token address of token used by investor to buy the cash token
50
+ @param _amount amount of token that is transferred from investor to this cash token issuing contract
51
+ @param _buyer address of buyer
52
+ */
53
+ async requestIssue(_token, _amount, _buyer, options) {
54
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _token);
55
+ await this.validateInput(index_1.DATATYPES.NUMBER, _amount);
56
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _buyer);
57
+ return this.callContract(FUNCTIONS.REQUESTISSUE, _token, _amount, _buyer, options);
58
+ }
59
+ /**
60
+ Sets signer to verify bridge
61
+ @param _signer address of signer that can only be set by owner of bridge
62
+ */
63
+ async setSigner(_signer, options) {
64
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _signer);
65
+ return this.callContract(FUNCTIONS.SETSIGNER, _signer, options);
66
+ }
67
+ }
68
+ exports.default = VerifiedBond;
@@ -3,24 +3,26 @@
3
3
  // @ts-nocheck
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  const index_1 = require("../../index");
6
- const Cash_json_1 = require("../../../abi/deposits/Cash.json");
6
+ const L1Cash_json_1 = require("../../../abi/deposits/L1Cash.json");
7
7
  var FUNCTIONS;
8
8
  (function (FUNCTIONS) {
9
9
  FUNCTIONS["SUPPORTTOKENS"] = "supportTokens";
10
10
  FUNCTIONS["CHECKSUPPORTFORTOKEN"] = "checkSupportForToken";
11
11
  FUNCTIONS["GETSUPPORTEDTOKENS"] = "getSupportedTokens";
12
12
  FUNCTIONS["REQUESTISSUE"] = "requestIssue";
13
+ FUNCTIONS["SETSIGNER"] = "setSigner";
13
14
  })(FUNCTIONS || (FUNCTIONS = {}));
14
15
  class VerifiedCash extends index_1.VerifiedContract {
15
- constructor(signer) {
16
+ constructor(signer, currencyAddress) {
16
17
  const chainId = signer.provider._network.chainId.toString();
17
- const address = Cash_json_1.networks[chainId].address;
18
- super(address, JSON.stringify(Cash_json_1.abi), signer);
18
+ const address = currencyAddress;
19
+ super(address, JSON.stringify(L1Cash_json_1.abi), signer);
19
20
  this.contractAddress = address;
20
21
  }
21
22
  /**
22
23
  Specifies list of supported tokens that can be invested in the Verified Liquidity token
23
- @param _tokens array of supported token addresses
24
+ @param _tokens address of token supported
25
+ @param _name string name of token supported
24
26
  */
25
27
  async supportTokens(_tokens, _name, options) {
26
28
  await this.validateInput(index_1.DATATYPES.STRING, _tokens);
@@ -46,11 +48,21 @@ class VerifiedCash extends index_1.VerifiedContract {
46
48
  Used by external apps (eg, exchange, wallet) to buy Verified cash token
47
49
  @param _token address of token used by investor to buy the cash token
48
50
  @param _amount amount of token that is transferred from investor to this cash token issuing contract
51
+ @param _buyer address of buyer
49
52
  */
50
- async requestIssue(_token, _amount, options) {
53
+ async requestIssue(_token, _amount, _buyer, options) {
51
54
  await this.validateInput(index_1.DATATYPES.ADDRESS, _token);
52
55
  await this.validateInput(index_1.DATATYPES.NUMBER, _amount);
53
- return this.callContract(FUNCTIONS.REQUESTISSUE, _token, _amount, options);
56
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _buyer);
57
+ return this.callContract(FUNCTIONS.REQUESTISSUE, _token, _amount, _buyer, options);
58
+ }
59
+ /**
60
+ Sets signer to verify bridge
61
+ @param _signer address of signer that can only be set by owner of bridge
62
+ */
63
+ async setSigner(_signer, options) {
64
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _signer);
65
+ return this.callContract(FUNCTIONS.SETSIGNER, _signer, options);
54
66
  }
55
67
  }
56
68
  exports.default = VerifiedCash;
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ // SPDX-License-Identifier: BUSL-1.1
3
+ // @ts-nocheck
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ const index_1 = require("../../index");
6
+ const L1Factory_json_1 = require("../../../abi/deposits/L1Factory.json");
7
+ var FUNCTIONS;
8
+ (function (FUNCTIONS) {
9
+ FUNCTIONS["GETNAME"] = "getName";
10
+ FUNCTIONS["GETTYPE"] = "getType";
11
+ FUNCTIONS["GETTOKENBYNAMETYPE"] = "getTokenByNameType";
12
+ FUNCTIONS["GETISSUER"] = "getIssuer";
13
+ })(FUNCTIONS || (FUNCTIONS = {}));
14
+ class VerifiedFactory extends index_1.VerifiedContract {
15
+ constructor(signer) {
16
+ const chainId = signer.provider._network.chainId.toString();
17
+ const address = L1Factory_json_1.networks[chainId].address;
18
+ super(address, JSON.stringify(L1Factory_json_1.abi), signer);
19
+ this.contractAddress = address;
20
+ }
21
+ /**
22
+ * Get name of token
23
+ * @param _token address of token for which name is required
24
+ * @returns returns name of token
25
+ */
26
+ async getName(_token, options) {
27
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _token);
28
+ return this.callContract(FUNCTIONS.GETNAME, _token, options);
29
+ }
30
+ /**
31
+ * Get type of token
32
+ * @param _token address of token for which type is required
33
+ * @returns returns name of token
34
+ */
35
+ async getType(_token, options) {
36
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _token);
37
+ return this.callContract(FUNCTIONS.GETTYPE, _token, options);
38
+ }
39
+ /**
40
+ * Get name and type of token
41
+ * @param _tokenName string name of token
42
+ * @param _tokenType string type of token
43
+ * @returns returns address of token
44
+ */
45
+ async getTokenByNameType(tokenName, tokenType, options) {
46
+ await this.validateInput(index_1.DATATYPES.STRING, tokenName);
47
+ await this.validateInput(index_1.DATATYPES.STRING, tokenType);
48
+ return this.callContract(FUNCTIONS.GETTOKENBYNAMETYPE, this.sanitiseInput(index_1.DATATYPES.BYTE32, tokenName), this.sanitiseInput(index_1.DATATYPES.BYTE32, tokenType), options);
49
+ }
50
+ /**
51
+ * Get name and type of token issuer
52
+ * @param _tokenName string name of token
53
+ * @param _tokenType string type of token
54
+ * @returns returns address of token issuer
55
+ */
56
+ async getIssuer(tokenName, tokenType, options) {
57
+ await this.validateInput(index_1.DATATYPES.STRING, tokenName);
58
+ await this.validateInput(index_1.DATATYPES.STRING, tokenType);
59
+ return this.callContract(FUNCTIONS.GETISSUER, this.sanitiseInput(index_1.DATATYPES.BYTE32, tokenType), this.sanitiseInput(index_1.DATATYPES.BYTE32, tokenName), options);
60
+ }
61
+ }
62
+ exports.default = VerifiedFactory;
@@ -3,7 +3,7 @@
3
3
  // @ts-nocheck
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  const index_1 = require("../../index");
6
- const Rates_json_1 = require("../../../abi/deposits/Rates.json");
6
+ const L1Rates_json_1 = require("../../../abi/deposits/L1Rates.json");
7
7
  var FUNCTIONS;
8
8
  (function (FUNCTIONS) {
9
9
  FUNCTIONS["SETFEETO"] = "setFeeTo";
@@ -20,8 +20,8 @@ var FUNCTIONS;
20
20
  class VerifiedRates extends index_1.VerifiedContract {
21
21
  constructor(signer) {
22
22
  const chainId = signer.provider._network.chainId.toString();
23
- const address = Rates_json_1.networks[chainId].address;
24
- super(address, JSON.stringify(Rates_json_1.abi), signer);
23
+ const address = L1Rates_json_1.networks[chainId].address;
24
+ super(address, JSON.stringify(L1Rates_json_1.abi), signer);
25
25
  this.contractAddress = address;
26
26
  }
27
27
  async setFeeTo(_feeTo, _fee, _feeType, options) {
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ // SPDX-License-Identifier: BUSL-1.1
3
+ // @ts-nocheck
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ const index_1 = require("../../index");
6
+ const L1Security_json_1 = require("../../../abi/deposits/L1Security.json");
7
+ var FUNCTIONS;
8
+ (function (FUNCTIONS) {
9
+ FUNCTIONS["SETSIGNER"] = "setSigner";
10
+ })(FUNCTIONS || (FUNCTIONS = {}));
11
+ class VerifiedSecurity extends index_1.VerifiedContract {
12
+ constructor(signer) {
13
+ const chainId = signer.provider._network.chainId.toString();
14
+ const address = L1Security_json_1.networks[chainId].address;
15
+ super(address, JSON.stringify(L1Security_json_1.abi), signer);
16
+ this.contractAddress = address;
17
+ }
18
+ /**
19
+ Sets signer to verify bridge
20
+ @param _signer address of signer that can only be set by owner of bridge
21
+ */
22
+ async setSigner(_signer, options) {
23
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _signer);
24
+ return this.callContract(FUNCTIONS.SETSIGNER, _signer, options);
25
+ }
26
+ }
27
+ exports.default = VerifiedSecurity;
@@ -14,20 +14,20 @@ const contractAddress = {
14
14
  'Token': '0x4527637554e0d240A6a81b0fE32C894A76e8F6f4',
15
15
  'Oracle': '0xb5F2ecA071D0B70Bc4003c57e79FFA88c8A023AC',
16
16
  'Rates': '0x2f0135840b55Fc20b8Ab10CE6AF8755Dd3E6737c',
17
- 'PreTrade': '0x876ABBD1e135f83ece7C0c1467AAcbba3f8153Cc',
18
- 'Trade': '0x76d9e9c989A3FE1663A2ce35679997D35Dc9964a',
19
- 'PostTrade': '0xF7b5D120E7726BfDD668AD4415f4641Dc41974d4',
20
- 'SecuritiesRegistry': '0x2E34d254EdC5c685275AE2D8B64C72611fFa719f',
21
- 'Security': '0x2E51e70F81d1159F356eD02dC5F52D5114301485',
22
- 'OrderPool': '0xDb9eA03b276974a6F9b2F3C7F129A6893E0c0eCA',
23
- 'PoolFactory': '0x4ef43CE3CF36a12f1e064F3A272CE7a17d244cf1',
24
- 'Products': '0x86A3e6C8cfb8C01Ba75E529ac96Fd987c6bCAB6F',
25
- 'Stocks': '0x5dFF251d787AC24e7490f90B308820bea5b2f762',
26
- 'Bonds': '0x36604775A217F561B7a2d86725f96473B54f6b60',
17
+ 'PreTrade': '0xDea805F278cCF023903dcED825B5E98897B394a0',
18
+ 'Trade': '0xc2Ce803EB51b9c4ce16B6Fbda640D7E1c61Fc8f8',
19
+ 'PostTrade': '0x6B748589ed66eB4c6Fc2aa91Ea556D9f86A0eC1e',
20
+ 'SecuritiesRegistry': '0x96e1D79737F5C97614B0c800eEDC28174eFa1F7e',
21
+ 'Security': '0x7f5f10cD4Ce5c70cd16B296b6dCB374AF2B19596',
22
+ 'OrderPool': '0xe4bD71E366C65AFe21fC7c9a2320B356fe98eC97',
23
+ 'PoolFactory': '0xc1c229F590500F4031871b1Ee346841159CE8269',
24
+ 'Products': '0x8C59025b8A08Cb5dc0df9852ABa37a5ec671E34C',
25
+ 'Stocks': '0xa674FD33dCE0C9c0d3B3bb41302FFDfA942c0416',
26
+ 'Bonds': '0xcEdD153f8e17D82aa347f09F3E5FE3143d201631',
27
27
  'Liquidity': '0x38465490aE03b2641D0497baf1F2CfeE3adB33a0',
28
28
  'Distribution': '0xBBb9035864A25573Ad1f7FF7B8774218d347543F',
29
- 'BalancerManager': '0x8D1684395dd25D4FD4888f98AbDdAc09C655aAc9',
30
- 'PrimaryIssuePoolFactory': '0x5840e24E56309c6e4F2Ea9a79e7a41314c46AE2b',
29
+ 'BalancerManager': '',
30
+ 'PrimaryIssuePoolFactory': '',
31
31
  'Custody': '',
32
32
  'CASH': {
33
33
  'VCUSD': '0x0D5b968e84308ef57c4FfA5ce7EEFF8AdD6B9f66',
@@ -41,42 +41,42 @@ const contractAddress = {
41
41
  },
42
42
  },
43
43
  'rinkeby': {
44
- 'Client': '0xC938953933b2a52C26a9F7110A9877B9F981dc6f',
44
+ 'Client': '0xEf2390081e6Bc8b2d122d8201ca14D3eC2246f33',
45
45
  'KYC': '',
46
46
  'System': '',
47
47
  'Holder': '',
48
48
  'Ledger': '',
49
49
  'Account': '',
50
- 'Factory': '0xBbD4f99D851D8A3D0A66c6d6f4049Af1f547f470',
51
- 'Cash': '0x30a9b280FB9070f14ee3157c41C68c04236C1858',
52
- 'Bond': '0x785AE38047650A9CC298B7ff694Ce29466585F7F',
50
+ 'Factory': '0xB7b47966B7C9633b91cB1BEB0A997D35fF5EA77a',
51
+ 'Cash': '0x95b31E7608b37B7A7c6adee75B775bC2F1f665A1',
52
+ 'Bond': '0x5797C2340E97F026aEC6a019BE698D77E1B19Ee4',
53
53
  'Token': '',
54
54
  'Oracle': '',
55
- 'Rates': '0xD292658282828BB845c1c64CA19621a98c622c6a',
55
+ 'Rates': '0xc5c2Aeb737C016FDB2655Ff7B748667f5ab6A7f1',
56
56
  'PreTrade': '',
57
57
  'Trade': '',
58
58
  'PostTrade': '',
59
59
  'SecuritiesRegistry': '',
60
- 'Security': '',
60
+ 'Security': '0x30A613eBd1A460E4800395bc0BF6E1B6cE58Eb2c',
61
61
  'OrderPool': '',
62
62
  'PoolFactory': '',
63
- 'Products': '0xcB79E8Dc07F085234437Bf3075ABE48BE5Ab1Ec0',
63
+ 'Products': '0xE3ba3A9598Cd99851Bd671E476331622d7306191',
64
64
  'Stocks': '',
65
65
  'Bonds': '',
66
- 'Liquidity': '0xC1B58e8E4450ecB98c89D20017ea7b26F7dF9f08',
67
- 'Distribution': '0x4b310a2db3A175F236a0573A20F3866576d7161a',
68
- 'BalancerManager': '0x5214f1d37382dfD422772D6DAFbFdcD4316C8397',
69
- 'PrimaryIssuePoolFactory': '0xE136a3C959734AB9B4dbf8119949626d0b91B623',
66
+ 'Liquidity': '0xcffd111F1Ce862475d7eB1c3d4257276Ca8A4551',
67
+ 'Distribution': '0xd9AaFEc2839Ac08773154596e9ED6936CDf474B4',
68
+ 'BalancerManager': '0xF3Fa603C0Fc49DE8392A17DF8edd4E40a235f917',
69
+ 'PrimaryIssuePoolFactory': '0x48E30d2C73BCa133Bbe7fac2fD32E7a4684d5d99',
70
70
  'Custody': '',
71
71
  'CASH': {
72
- 'VCUSD': '0xc65fffD4662E35A7E4fC1E06f26D38b73585e03b',
73
- 'VCEUR': '0xCe13878defD25368a57c6fca846f745275E0CEC8',
74
- 'VCINR': '0xE5A20a77B03A49f5F27F783f2A374AAA57b8ab12'
72
+ 'VCUSD': '0x5e143828Ff6CCD59418752fc2019966EE3A97725',
73
+ 'VCEUR': '0xe1621E2A7184a2BE93A09C6288b35Ad83994fFcA',
74
+ 'VCINR': '0xE29c0CE49AE3b4b7F8A727e48A11e2Fd72df92dA'
75
75
  },
76
76
  'BOND': {
77
- 'VBUSD': '0xc18A3df9d1CabBAFb81b9017CB1cdFD299a84154',
78
- 'VBEUR': '0x7D2410710aDBb32488c6072313e851146c325939',
79
- 'VBINR': '0x7282626f2b17f106f21a7D12ad34730a39cA64D2'
77
+ 'VBUSD': '0xC341Ed6b732dd30D4b5100ecb558A8EA252E8929',
78
+ 'VBEUR': '0xD4442eFEA597aA53C4eF2E41d4c743d509266d99',
79
+ 'VBINR': '0xAcCC074Ebaa695604b9A5995Cda2EeaC5c1aF19C'
80
80
  },
81
81
  },
82
82
  'mainnet': {
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  return (mod && mod.__esModule) ? mod : { "default": mod };
5
5
  };
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.contractAddress = exports.utils = exports.AssetManager = exports.RatesContract = exports.LiquidityContract = exports.CustodyContract = exports.BondsContract = exports.StocksContract = exports.ProductContract = exports.DistributionContract = exports.OracleContract = exports.SecurityContract = exports.TokenContract = exports.FactoryContract = exports.TradeContract = exports.SecuritiesRegistryContract = exports.PreTradeContract = exports.PostTradeContract = exports.PoolFactoryContract = exports.OrderPoolContract = exports.CashContract = exports.BondContract = exports.AccountContract = exports.LedgerContract = exports.HolderContract = exports.SystemContract = exports.KYCContract = exports.ClientContract = exports.Provider = exports.VerifiedWallet = void 0;
7
+ exports.contractAddress = exports.utils = exports.VerifiedRates = exports.VerifiedFactory = exports.VerifiedSecurity = exports.VerifiedBond = exports.VerifiedCash = exports.AssetManager = exports.RatesContract = exports.LiquidityContract = exports.CustodyContract = exports.BondsContract = exports.StocksContract = exports.ProductContract = exports.DistributionContract = exports.OracleContract = exports.SecurityContract = exports.TokenContract = exports.FactoryContract = exports.TradeContract = exports.SecuritiesRegistryContract = exports.PreTradeContract = exports.PostTradeContract = exports.PoolFactoryContract = exports.OrderPoolContract = exports.CashContract = exports.BondContract = exports.AccountContract = exports.LedgerContract = exports.HolderContract = exports.SystemContract = exports.KYCContract = exports.ClientContract = exports.Provider = exports.VerifiedWallet = void 0;
8
8
  const wallet_1 = require("./wallet");
9
9
  Object.defineProperty(exports, "VerifiedWallet", { enumerable: true, get: function () { return wallet_1.VerifiedWallet; } });
10
10
  const utils_1 = require("./utils");
@@ -61,8 +61,16 @@ const rates_1 = __importDefault(require("./contract/rates"));
61
61
  exports.RatesContract = rates_1.default;
62
62
  const assetmanager_1 = __importDefault(require("./contract/assetmanager"));
63
63
  exports.AssetManager = assetmanager_1.default;
64
- //import VerifiedCash from './contract/public/cash';
65
- //import VerifiedRates from './contract/public/rates';
64
+ const cash_2 = __importDefault(require("./contract/public/cash"));
65
+ exports.VerifiedCash = cash_2.default;
66
+ const bond_2 = __importDefault(require("./contract/public/bond"));
67
+ exports.VerifiedBond = bond_2.default;
68
+ const security_2 = __importDefault(require("./contract/public/security"));
69
+ exports.VerifiedSecurity = security_2.default;
70
+ const factory_2 = __importDefault(require("./contract/public/factory"));
71
+ exports.VerifiedFactory = factory_2.default;
72
+ const rates_2 = __importDefault(require("./contract/public/rates"));
73
+ exports.VerifiedRates = rates_2.default;
66
74
  const ethers_1 = require("ethers");
67
75
  Object.defineProperty(exports, "utils", { enumerable: true, get: function () { return ethers_1.utils; } });
68
76
  const contractAddress_1 = __importDefault(require("./contractAddress"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verified-network/verified-sdk",
3
- "version": "0.7.4",
3
+ "version": "0.7.5",
4
4
  "description": "An SDK to develop applications on the Verified Network",
5
5
  "repository": {
6
6
  "type": "git",