@verified-network/verified-sdk 0.8.0 → 0.8.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.
- package/dist/abi/assetmanager/BalancerManager.json +38155 -23774
- package/dist/abi/assetmanager/Client.json +11249 -0
- package/dist/abi/assetmanager/Products.json +3094 -0
- package/dist/abi/assetmanager/VerifiedProducts.json +861 -0
- package/dist/abi/liquidity/Liquidity.json +8644 -8155
- package/dist/contract/assetmanager/index.js +41 -4
- package/dist/contract/public/client/index.js +59 -0
- package/dist/contract/public/product/index.js +24 -0
- package/dist/contractAddress/index.js +5 -5
- package/dist/index.js +5 -1
- package/package.json +1 -1
|
@@ -11,6 +11,12 @@ var FUNCTIONS;
|
|
|
11
11
|
FUNCTIONS["GETOFFERMADE"] = "getOfferMade";
|
|
12
12
|
FUNCTIONS["GETALLOTTEDSTAKE"] = "getAllotedStake";
|
|
13
13
|
FUNCTIONS["GETLIQUIDITYPROVIDERS"] = "getLiquidityProviders";
|
|
14
|
+
FUNCTIONS["ISSUE"] = "issue";
|
|
15
|
+
FUNCTIONS["GETSUBSCRIBERS"] = "getSubscribers";
|
|
16
|
+
FUNCTIONS["CLOSE"] = "close";
|
|
17
|
+
FUNCTIONS["ACCEPT"] = "accept";
|
|
18
|
+
FUNCTIONS["REJECT"] = "reject";
|
|
19
|
+
FUNCTIONS["SETTLE"] = "settle";
|
|
14
20
|
})(FUNCTIONS || (FUNCTIONS = {}));
|
|
15
21
|
class AssetManager extends index_1.VerifiedContract {
|
|
16
22
|
constructor(signer, platformAddress) {
|
|
@@ -19,14 +25,15 @@ class AssetManager extends index_1.VerifiedContract {
|
|
|
19
25
|
super(address, JSON.stringify(BalancerManager_json_1.abi), signer);
|
|
20
26
|
this.contractAddress = address;
|
|
21
27
|
}
|
|
22
|
-
async offer(owned, isin, offered, tomatch, desired, min, options) {
|
|
28
|
+
async offer(owned, isin, offered, tomatch, desired, min, issuer, _hashedMessage, _v, _r, _s, options) {
|
|
23
29
|
await this.validateInput(index_1.DATATYPES.ADDRESS, owned);
|
|
24
30
|
await this.validateInput(index_1.DATATYPES.ADDRESS, tomatch);
|
|
31
|
+
await this.validateInput(index_1.DATATYPES.ADDRESS, issuer);
|
|
25
32
|
await this.validateInput(index_1.DATATYPES.STRING, isin);
|
|
26
33
|
await this.validateInput(index_1.DATATYPES.NUMBER, offered);
|
|
27
34
|
await this.validateInput(index_1.DATATYPES.NUMBER, desired);
|
|
28
35
|
await this.validateInput(index_1.DATATYPES.NUMBER, min);
|
|
29
|
-
return this.callContract(FUNCTIONS.OFFER, owned, this.sanitiseInput(index_1.DATATYPES.BYTE32, isin), offered, tomatch, desired, min, options);
|
|
36
|
+
return this.callContract(FUNCTIONS.OFFER, owned, this.sanitiseInput(index_1.DATATYPES.BYTE32, isin), offered, tomatch, desired, min, issuer, _hashedMessage, _v, _r, _s, options);
|
|
30
37
|
}
|
|
31
38
|
/**
|
|
32
39
|
* Gets security tokens offered for passed token parameter
|
|
@@ -64,9 +71,39 @@ class AssetManager extends index_1.VerifiedContract {
|
|
|
64
71
|
* @param options
|
|
65
72
|
* @returns array of structs of liquidity providers
|
|
66
73
|
*/
|
|
67
|
-
async getLiquidityProviders(security, options) {
|
|
74
|
+
async getLiquidityProviders(security, _hashedMessage, _v, _r, _s, options) {
|
|
68
75
|
await this.validateInput(index_1.DATATYPES.ADDRESS, security);
|
|
69
|
-
return this.callContract(FUNCTIONS.GETLIQUIDITYPROVIDERS, security, options);
|
|
76
|
+
return this.callContract(FUNCTIONS.GETLIQUIDITYPROVIDERS, security, _hashedMessage, _v, _r, _s, options);
|
|
77
|
+
}
|
|
78
|
+
async issue(security, cutoffTime, issuer, _hashedMessage, _v, _r, _s, options) {
|
|
79
|
+
await this.validateInput(index_1.DATATYPES.ADDRESS, security);
|
|
80
|
+
await this.validateInput(index_1.DATATYPES.ADDRESS, issuer);
|
|
81
|
+
await this.validateInput(index_1.DATATYPES.NUMBER, cutoffTime);
|
|
82
|
+
return this.callContract(FUNCTIONS.ISSUE, security, cutoffTime, issuer, _hashedMessage, _v, _r, _s, options);
|
|
83
|
+
}
|
|
84
|
+
async getSubscribers(poolId, _hashedMessage, _v, _r, _s, options) {
|
|
85
|
+
await this.validateInput(index_1.DATATYPES.STRING, poolId);
|
|
86
|
+
return this.callContract(FUNCTIONS.GETSUBSCRIBERS, this.sanitiseInput(index_1.DATATYPES.BYTE32, poolId), _hashedMessage, _v, _r, _s, options);
|
|
87
|
+
}
|
|
88
|
+
async close(security, _hashedMessage, _v, _r, _s, options) {
|
|
89
|
+
await this.validateInput(index_1.DATATYPES.ADDRESS, security);
|
|
90
|
+
return this.callContract(FUNCTIONS.CLOSE, security, _hashedMessage, _v, _r, _s, options);
|
|
91
|
+
}
|
|
92
|
+
async accept(poolid, investor, amnt, asset, _hashedMessage, _v, _r, _s, options) {
|
|
93
|
+
await this.validateInput(index_1.DATATYPES.ADDRESS, investor);
|
|
94
|
+
await this.validateInput(index_1.DATATYPES.ADDRESS, asset);
|
|
95
|
+
await this.validateInput(index_1.DATATYPES.NUMBER, amnt);
|
|
96
|
+
await this.validateInput(index_1.DATATYPES.STRING, poolid);
|
|
97
|
+
return this.callContract(FUNCTIONS.ACCEPT, this.sanitiseInput(index_1.DATATYPES.BYTE32, poolId), investor, amnt, asset, _hashedMessage, _v, _r, _s, options);
|
|
98
|
+
}
|
|
99
|
+
async reject(poolid, investor, _hashedMessage, _v, _r, _s, options) {
|
|
100
|
+
await this.validateInput(index_1.DATATYPES.ADDRESS, investor);
|
|
101
|
+
await this.validateInput(index_1.DATATYPES.STRING, poolid);
|
|
102
|
+
return this.callContract(FUNCTIONS.REJECT, this.sanitiseInput(index_1.DATATYPES.BYTE32, poolId), investor, _hashedMessage, _v, _r, _s, options);
|
|
103
|
+
}
|
|
104
|
+
async settle(poolId, _hashedMessage, _v, _r, _s, options) {
|
|
105
|
+
await this.validateInput(index_1.DATATYPES.STRING, poolId);
|
|
106
|
+
return this.callContract(FUNCTIONS.SETTLE, this.sanitiseInput(index_1.DATATYPES.BYTE32, poolId), _hashedMessage, _v, _r, _s, options);
|
|
70
107
|
}
|
|
71
108
|
}
|
|
72
109
|
exports.default = AssetManager;
|
|
@@ -0,0 +1,59 @@
|
|
|
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 Client_json_1 = require("../../../abi/assetmanager/Client.json");
|
|
7
|
+
var FUNCTIONS;
|
|
8
|
+
(function (FUNCTIONS) {
|
|
9
|
+
FUNCTIONS["SETSIGNER"] = "setSigner";
|
|
10
|
+
FUNCTIONS["GETROLE"] = "getRole";
|
|
11
|
+
FUNCTIONS["REMOVEROLE"] = "removeRole";
|
|
12
|
+
FUNCTIONS["ADDROLE"] = "addRole";
|
|
13
|
+
})(FUNCTIONS || (FUNCTIONS = {}));
|
|
14
|
+
class VerifiedClient extends index_1.VerifiedContract {
|
|
15
|
+
constructor(signer) {
|
|
16
|
+
const chainId = signer.provider._network.chainId.toString();
|
|
17
|
+
const address = Client_json_1.networks[chainId].address;
|
|
18
|
+
super(address, JSON.stringify(Client_json_1.abi), signer);
|
|
19
|
+
this.contractAddress = address;
|
|
20
|
+
}
|
|
21
|
+
setSigner(_address) {
|
|
22
|
+
return this.callContract(FUNCTIONS.SETSIGNER, _address);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Get sub-managers for role [callable only by manager]
|
|
26
|
+
* @params (address _submanager, bytes32 _country)
|
|
27
|
+
* @returns {address[] memory}
|
|
28
|
+
*/
|
|
29
|
+
async getRole(_submanager, options) {
|
|
30
|
+
await this.validateInput(index_1.DATATYPES.ADDRESS, _submanager);
|
|
31
|
+
return this.callContract(FUNCTIONS.GETROLE, _submanager, options);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Remove sub-manager from role [callable only by manager]
|
|
35
|
+
* @params (address _submanager, bytes32 _country, bytes32 _role)
|
|
36
|
+
* @returns
|
|
37
|
+
*/
|
|
38
|
+
async removeRole(_manager, _submanager, _country, _role, _hashedMessage, _v, _r, _s, options) {
|
|
39
|
+
await this.validateInput(index_1.DATATYPES.ADDRESS, _manager);
|
|
40
|
+
await this.validateInput(index_1.DATATYPES.ADDRESS, _submanager);
|
|
41
|
+
await this.validateInput(index_1.DATATYPES.STRING, _country);
|
|
42
|
+
await this.validateInput(index_1.DATATYPES.STRING, _role);
|
|
43
|
+
return this.callContract(FUNCTIONS.REMOVEROLE, _manager, _submanager, this.sanitiseInput(index_1.DATATYPES.BYTE32, _country), this.sanitiseInput(index_1.DATATYPES.BYTE32, _role), _hashedMessage, _v, _r, _s, options);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Create role for sub-manager [callable only by manager
|
|
47
|
+
* @params (address _submanager, bytes32 _country, bytes32 _role)
|
|
48
|
+
* @returns
|
|
49
|
+
*/
|
|
50
|
+
async addRole(_manager, _submanager, _country, _role, _id, _hashedMessage, _v, _r, _s, options) {
|
|
51
|
+
await this.validateInput(index_1.DATATYPES.ADDRESS, _manager);
|
|
52
|
+
await this.validateInput(index_1.DATATYPES.ADDRESS, _submanager);
|
|
53
|
+
await this.validateInput(index_1.DATATYPES.STRING, _country);
|
|
54
|
+
await this.validateInput(index_1.DATATYPES.STRING, _role);
|
|
55
|
+
await this.validateInput(index_1.DATATYPES.STRING, _id);
|
|
56
|
+
return this.callContract(FUNCTIONS.ADDROLE, _manager, _submanager, this.sanitiseInput(index_1.DATATYPES.BYTE32, _country), this.sanitiseInput(index_1.DATATYPES.BYTE32, _role), this.sanitiseInput(index_1.DATATYPES.BYTE32, _id), _hashedMessage, _v, _r, _s, options);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.default = VerifiedClient;
|
|
@@ -0,0 +1,24 @@
|
|
|
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 Products_json_1 = require("../../../abi/assetmanager/Products.json");
|
|
7
|
+
var FUNCTIONS;
|
|
8
|
+
(function (FUNCTIONS) {
|
|
9
|
+
FUNCTIONS["ISSUEPRODUCT"] = "issueProduct";
|
|
10
|
+
})(FUNCTIONS || (FUNCTIONS = {}));
|
|
11
|
+
class VerifiedProducts extends index_1.VerifiedContract {
|
|
12
|
+
constructor(signer) {
|
|
13
|
+
const chainId = signer.provider._network.chainId.toString();
|
|
14
|
+
const address = Products_json_1.networks[chainId].address;
|
|
15
|
+
super(address, JSON.stringify(Products_json_1.abi), signer);
|
|
16
|
+
this.contractAddress = address;
|
|
17
|
+
}
|
|
18
|
+
async issueProduct(issue, ref, _hashedMessage, _v, _r, _s, options) {
|
|
19
|
+
await this.validateInput(index_1.DATATYPES.ADDRESS, issue);
|
|
20
|
+
await this.validateInput(index_1.DATATYPES.STRING, ref);
|
|
21
|
+
return this.callContract(FUNCTIONS.ISSUEPRODUCT, issue, this.sanitiseInput(index_1.DATATYPES.BYTE32, ref), _hashedMessage, _v, _r, _s, options);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.default = VerifiedProducts;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const contractAddress = {
|
|
4
4
|
'L1-goerli': {
|
|
5
|
-
'Client': '',
|
|
5
|
+
'Client': '0x115A7b38bE1d96F66cE5D25EaEe2f4FB91bb1E2F',
|
|
6
6
|
'KYC': '',
|
|
7
7
|
'System': '',
|
|
8
8
|
'Holder': '',
|
|
@@ -21,13 +21,13 @@ const contractAddress = {
|
|
|
21
21
|
'Security': '0x8B7D20deDF0DC7874B3C357Ba759890e51ad4bb3',
|
|
22
22
|
'OrderPool': '',
|
|
23
23
|
'PoolFactory': '',
|
|
24
|
-
'Products': '',
|
|
24
|
+
'Products': '0x812cD96Bd1D9C35EaCD3F09Dc504B2d30e63EFe5',
|
|
25
25
|
'Stocks': '',
|
|
26
26
|
'Bonds': '',
|
|
27
|
-
'Liquidity': '
|
|
27
|
+
'Liquidity': '0xf6FeBF7B2d2A9828F4B75dB9AE56414907175849',
|
|
28
28
|
'Distribution': '0x5c3171AFEC854f8B6FD138ee9533629ABd8A5365',
|
|
29
|
-
'BalancerManager': '',
|
|
30
|
-
'PrimaryIssuePoolFactory': '',
|
|
29
|
+
'BalancerManager': '0x69071961A04024F20A180B66F391DA5B14040bEa',
|
|
30
|
+
'PrimaryIssuePoolFactory': '0x3Ea829F1a0E01dFDa096f71DEAFd3582DF5E5a26',
|
|
31
31
|
'Custody': '',
|
|
32
32
|
'CASH': {
|
|
33
33
|
'VCUSD': '0xCb8eF17d0715bB115977C65e04423d9171025911',
|
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.VerifiedRates = exports.VerifiedDistribution = 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;
|
|
7
|
+
exports.contractAddress = exports.utils = exports.VerifiedClient = exports.VerifiedProducts = exports.VerifiedRates = exports.VerifiedDistribution = 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");
|
|
@@ -73,6 +73,10 @@ const distribution_2 = __importDefault(require("./contract/public/distribution")
|
|
|
73
73
|
exports.VerifiedDistribution = distribution_2.default;
|
|
74
74
|
const rates_2 = __importDefault(require("./contract/public/rates"));
|
|
75
75
|
exports.VerifiedRates = rates_2.default;
|
|
76
|
+
const product_2 = __importDefault(require("./contract/public/product"));
|
|
77
|
+
exports.VerifiedProducts = product_2.default;
|
|
78
|
+
const client_2 = __importDefault(require("./contract/public/client"));
|
|
79
|
+
exports.VerifiedClient = client_2.default;
|
|
76
80
|
const ethers_1 = require("ethers");
|
|
77
81
|
Object.defineProperty(exports, "utils", { enumerable: true, get: function () { return ethers_1.utils; } });
|
|
78
82
|
const contractAddress_1 = __importDefault(require("./contractAddress"));
|