@verified-network/verified-sdk 0.4.7 → 0.5.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/README.md +1 -1
- package/dist/abi/accounts/Account.json +1657 -1657
- package/dist/abi/accounts/Client.json +6337 -5458
- package/dist/abi/accounts/Holder.json +1777 -1777
- package/dist/abi/accounts/Kyc.json +12833 -7944
- package/dist/abi/accounts/Ledger.json +1037 -1037
- package/dist/abi/accounts/System.json +2942 -2942
- package/dist/abi/custody/Vault.json +20567 -0
- package/dist/abi/securities/Issues.json +3 -3
- package/dist/abi/securities/Products.json +3 -3
- package/dist/abi/trades/OrderPool.json +4362 -4362
- package/dist/abi/trades/PoolFactory.json +676 -676
- package/dist/abi/trades/PostTrade.json +365 -365
- package/dist/abi/trades/PreTrade.json +7451 -5357
- package/dist/abi/trades/SecuritiesRegistry.json +6107 -5263
- package/dist/abi/trades/Security.json +927 -927
- package/dist/abi/trades/Trade.json +3761 -3761
- package/dist/contract/client/index.js +3 -2
- package/dist/contract/custody/index.js +85 -0
- package/dist/contract/factory/index.js +17 -0
- package/dist/contract/kyc/index.js +11 -0
- package/dist/contract/securitiesregistry/index.js +2 -2
- package/dist/contractAddress/index.js +16 -15
- package/dist/index.js +3 -1
- package/package.json +1 -1
|
@@ -137,11 +137,12 @@ class ClientContract extends index_1.VerifiedContract {
|
|
|
137
137
|
* @params (address _submanager, bytes32 _country, bytes32 _role)
|
|
138
138
|
* @returns
|
|
139
139
|
*/
|
|
140
|
-
async addRole(_submanager, _country, _role, options) {
|
|
140
|
+
async addRole(_submanager, _country, _role, _id, options) {
|
|
141
141
|
await this.validateInput(index_1.DATATYPES.ADDRESS, _submanager);
|
|
142
142
|
await this.validateInput(index_1.DATATYPES.STRING, _country);
|
|
143
143
|
await this.validateInput(index_1.DATATYPES.STRING, _role);
|
|
144
|
-
|
|
144
|
+
await this.validateInput(index_1.DATATYPES.STRING, _id);
|
|
145
|
+
return this.callContract(FUNCTIONS.ADDROLE, _submanager, this.sanitiseInput(index_1.DATATYPES.BYTE32, _country), this.sanitiseInput(index_1.DATATYPES.BYTE32, _role), this.sanitiseInput(index_1.DATATYPES.BYTE32, _id), options);
|
|
145
146
|
}
|
|
146
147
|
async getManagers(_role, _country, options) {
|
|
147
148
|
await this.validateInput(index_1.DATATYPES.STRING, _role);
|
|
@@ -0,0 +1,85 @@
|
|
|
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 Vault_json_1 = require("../../abi/custody/Vault.json");
|
|
7
|
+
var FUNCTIONS;
|
|
8
|
+
(function (FUNCTIONS) {
|
|
9
|
+
FUNCTIONS["CREATEVAULT"] = "createVault";
|
|
10
|
+
FUNCTIONS["GETCREATOR"] = "getCreator";
|
|
11
|
+
FUNCTIONS["ADDPARTICIPANT"] = "addParticipant";
|
|
12
|
+
FUNCTIONS["REMOVEPARTICIPANT"] = "removeParticipant";
|
|
13
|
+
FUNCTIONS["CONFIRMPARTICIPANT"] = "confirmParticipant";
|
|
14
|
+
FUNCTIONS["DEFINEQUORUM"] = "defineQuorum";
|
|
15
|
+
FUNCTIONS["PROMPTSIGNATURES"] = "promptSignatures";
|
|
16
|
+
FUNCTIONS["SIGNTRANSACTION"] = "signTransaction";
|
|
17
|
+
FUNCTIONS["CHECKQUORUM"] = "checkQuorum";
|
|
18
|
+
FUNCTIONS["GETSHARDS"] = "getShards";
|
|
19
|
+
})(FUNCTIONS || (FUNCTIONS = {}));
|
|
20
|
+
class CustodyContract extends index_1.VerifiedContract {
|
|
21
|
+
constructor(signer) {
|
|
22
|
+
const chainId = signer.provider._network.chainId.toString();
|
|
23
|
+
const address = Vault_json_1.networks[chainId].address;
|
|
24
|
+
super(address, JSON.stringify(Vault_json_1.abi), signer);
|
|
25
|
+
this.contractAddress = address;
|
|
26
|
+
}
|
|
27
|
+
async createVault(_creator, _id, options) {
|
|
28
|
+
await this.validateInput(index_1.DATATYPES.STRING, _creator);
|
|
29
|
+
await this.validateInput(index_1.DATATYPES.STRING, _id);
|
|
30
|
+
return this.callContract(FUNCTIONS.CREATEVAULT, this.sanitiseInput(index_1.DATATYPES.BYTE32, _creator), this.sanitiseInput(index_1.DATATYPES.BYTE32, _id), options);
|
|
31
|
+
}
|
|
32
|
+
async getCreator(_creator, options) {
|
|
33
|
+
await this.validateInput(index_1.DATATYPES.STRING, _creator);
|
|
34
|
+
return this.callContract(FUNCTIONS.GETCREATOR, this.sanitiseInput(index_1.DATATYPES.BYTE32, _creator), options);
|
|
35
|
+
}
|
|
36
|
+
async addParticipant(_creator, _id, _participant, options) {
|
|
37
|
+
await this.validateInput(index_1.DATATYPES.STRING, _creator);
|
|
38
|
+
await this.validateInput(index_1.DATATYPES.STRING, _id);
|
|
39
|
+
await this.validateInput(index_1.DATATYPES.STRING, _participant);
|
|
40
|
+
return this.callContract(FUNCTIONS.ADDPARTICIPANT, this.sanitiseInput(index_1.DATATYPES.BYTE32, _creator), this.sanitiseInput(index_1.DATATYPES.BYTE32, _id), this.sanitiseInput(index_1.DATATYPES.BYTE32, _participant), options);
|
|
41
|
+
}
|
|
42
|
+
async removeParticipant(_creator, _id, _participant, options) {
|
|
43
|
+
await this.validateInput(index_1.DATATYPES.STRING, _creator);
|
|
44
|
+
await this.validateInput(index_1.DATATYPES.STRING, _id);
|
|
45
|
+
await this.validateInput(index_1.DATATYPES.STRING, _participant);
|
|
46
|
+
return this.callContract(FUNCTIONS.REMOVEPARTICIPANT, this.sanitiseInput(index_1.DATATYPES.BYTE32, _creator), this.sanitiseInput(index_1.DATATYPES.BYTE32, _id), this.sanitiseInput(index_1.DATATYPES.BYTE32, _participant), options);
|
|
47
|
+
}
|
|
48
|
+
async confirmParticipant(_creator, _participant, _id, _shard, _pin, options) {
|
|
49
|
+
await this.validateInput(index_1.DATATYPES.STRING, _creator);
|
|
50
|
+
await this.validateInput(index_1.DATATYPES.STRING, _id);
|
|
51
|
+
await this.validateInput(index_1.DATATYPES.STRING, _participant);
|
|
52
|
+
await this.validateInput(index_1.DATATYPES.STRING, _shard);
|
|
53
|
+
return this.callContract(FUNCTIONS.CONFIRMPARTICIPANT, this.sanitiseInput(index_1.DATATYPES.BYTE32, _creator), this.sanitiseInput(index_1.DATATYPES.BYTE32, _participant), this.sanitiseInput(index_1.DATATYPES.BYTE32, _id), _shard, _pin, options);
|
|
54
|
+
}
|
|
55
|
+
async defineQuorum(_creator, _id, _minParticipants, options) {
|
|
56
|
+
await this.validateInput(index_1.DATATYPES.STRING, _creator);
|
|
57
|
+
await this.validateInput(index_1.DATATYPES.STRING, _id);
|
|
58
|
+
return this.callContract(FUNCTIONS.DEFINEQUORUM, this.sanitiseInput(index_1.DATATYPES.BYTE32, _creator), this.sanitiseInput(index_1.DATATYPES.BYTE32, _id), _minParticipants, options);
|
|
59
|
+
}
|
|
60
|
+
async promptSignatures(_creator, _id, options) {
|
|
61
|
+
await this.validateInput(index_1.DATATYPES.STRING, _creator);
|
|
62
|
+
await this.validateInput(index_1.DATATYPES.STRING, _id);
|
|
63
|
+
return this.callContract(FUNCTIONS.PROMPTSIGNATURES, this.sanitiseInput(index_1.DATATYPES.BYTE32, _creator), this.sanitiseInput(index_1.DATATYPES.BYTE32, _id), options);
|
|
64
|
+
}
|
|
65
|
+
async signTransaction(_creator, _participant, _id, _tx, _pin, options) {
|
|
66
|
+
await this.validateInput(index_1.DATATYPES.STRING, _creator);
|
|
67
|
+
await this.validateInput(index_1.DATATYPES.STRING, _id);
|
|
68
|
+
await this.validateInput(index_1.DATATYPES.STRING, _participant);
|
|
69
|
+
return this.callContract(FUNCTIONS.SIGNTRANSACTION, this.sanitiseInput(index_1.DATATYPES.BYTE32, _creator), this.sanitiseInput(index_1.DATATYPES.BYTE32, _participant), this.sanitiseInput(index_1.DATATYPES.BYTE32, _id), _tx, _pin, options);
|
|
70
|
+
}
|
|
71
|
+
async checkQuorum(_creator, _id, _participant, _txid, options) {
|
|
72
|
+
await this.validateInput(index_1.DATATYPES.STRING, _creator);
|
|
73
|
+
await this.validateInput(index_1.DATATYPES.STRING, _id);
|
|
74
|
+
await this.validateInput(index_1.DATATYPES.STRING, _participant);
|
|
75
|
+
await this.validateInput(index_1.DATATYPES.STRING, _txid);
|
|
76
|
+
return this.callContract(FUNCTIONS.CHECKQUORUM, this.sanitiseInput(index_1.DATATYPES.BYTE32, _creator), this.sanitiseInput(index_1.DATATYPES.BYTE32, _id), this.sanitiseInput(index_1.DATATYPES.BYTE32, _participant), this.sanitiseInput(index_1.DATATYPES.BYTE32, _txid), options);
|
|
77
|
+
}
|
|
78
|
+
async getShards(_creator, _id, _txid, options) {
|
|
79
|
+
await this.validateInput(index_1.DATATYPES.STRING, _creator);
|
|
80
|
+
await this.validateInput(index_1.DATATYPES.STRING, _id);
|
|
81
|
+
await this.validateInput(index_1.DATATYPES.STRING, _txid);
|
|
82
|
+
return this.callContract(FUNCTIONS.GETSHARDS, this.sanitiseInput(index_1.DATATYPES.BYTE32, _creator), this.sanitiseInput(index_1.DATATYPES.BYTE32, _id), this.sanitiseInput(index_1.DATATYPES.BYTE32, _txid), options);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
exports.default = CustodyContract;
|
|
@@ -10,6 +10,9 @@ var FUNCTIONS;
|
|
|
10
10
|
FUNCTIONS["GETTOKEN"] = "getToken";
|
|
11
11
|
FUNCTIONS["GETNAMEANDTYPE"] = "getNameAndType";
|
|
12
12
|
FUNCTIONS["TOKENCREATED"] = "TokenCreated";
|
|
13
|
+
FUNCTIONS["GETTOKENBYNAMETYPE"] = "getTokenByNameType";
|
|
14
|
+
FUNCTIONS["GETISSUER"] = "getIssuer";
|
|
15
|
+
FUNCTIONS["GETADDRESSTYPE"] = "getAddressAndType";
|
|
13
16
|
})(FUNCTIONS || (FUNCTIONS = {}));
|
|
14
17
|
class FactoryContract extends index_1.VerifiedContract {
|
|
15
18
|
constructor(signer) {
|
|
@@ -51,5 +54,19 @@ class FactoryContract extends index_1.VerifiedContract {
|
|
|
51
54
|
notifyTokenCreated(callback) {
|
|
52
55
|
this.getEvent(FUNCTIONS.TOKENCREATED, callback);
|
|
53
56
|
}
|
|
57
|
+
async getTokenByNameType(tokenName, tokenType, options) {
|
|
58
|
+
await this.validateInput(index_1.DATATYPES.STRING, tokenName);
|
|
59
|
+
await this.validateInput(index_1.DATATYPES.STRING, tokenType);
|
|
60
|
+
return this.callContract(FUNCTIONS.GETTOKENBYNAMETYPE, this.sanitiseInput(index_1.DATATYPES.BYTE32, tokenName), this.sanitiseInput(index_1.DATATYPES.BYTE32, tokenType), options);
|
|
61
|
+
}
|
|
62
|
+
async getIssuer(tokenName, tokenType, options) {
|
|
63
|
+
await this.validateInput(index_1.DATATYPES.STRING, tokenName);
|
|
64
|
+
await this.validateInput(index_1.DATATYPES.STRING, tokenType);
|
|
65
|
+
return this.callContract(FUNCTIONS.GETISSUER, this.sanitiseInput(index_1.DATATYPES.BYTE32, tokenName), this.sanitiseInput(index_1.DATATYPES.BYTE32, tokenType), options);
|
|
66
|
+
}
|
|
67
|
+
async getAddressAndType(tokenName, options) {
|
|
68
|
+
await this.validateInput(index_1.DATATYPES.STRING, tokenName);
|
|
69
|
+
return this.callContract(FUNCTIONS.GETADDRESSTYPE, this.sanitiseInput(index_1.DATATYPES.BYTE32, tokenName), options);
|
|
70
|
+
}
|
|
54
71
|
}
|
|
55
72
|
exports.default = FactoryContract;
|
|
@@ -31,6 +31,8 @@ var FUNCTIONS;
|
|
|
31
31
|
FUNCTIONS["GETPHONE"] = "getPhone";
|
|
32
32
|
FUNCTIONS["SETEMAIL"] = "setEmail";
|
|
33
33
|
FUNCTIONS["GETEMAIL"] = "getEmail";
|
|
34
|
+
FUNCTIONS["GETKYCPAID"] = "getKYCPaid";
|
|
35
|
+
FUNCTIONS["SETKYCPAID"] = "setKYCPaid";
|
|
34
36
|
})(FUNCTIONS || (FUNCTIONS = {}));
|
|
35
37
|
class KYCContract extends index_1.VerifiedContract {
|
|
36
38
|
constructor(signer) {
|
|
@@ -187,5 +189,14 @@ class KYCContract extends index_1.VerifiedContract {
|
|
|
187
189
|
await this.validateInput(index_1.DATATYPES.ADDRESS, _clientAddress);
|
|
188
190
|
return this.callContract(FUNCTIONS.GETEMAIL, _clientAddress, options);
|
|
189
191
|
}
|
|
192
|
+
async setKYCPaid(_clientAddress, _paidStatus, options) {
|
|
193
|
+
await this.validateInput(index_1.DATATYPES.ADDRESS, _clientAddress);
|
|
194
|
+
await this.validateInput(index_1.DATATYPES.STRING, _paidStatus);
|
|
195
|
+
return this.callContract(FUNCTIONS.SETKYCPAID, _clientAddress, this.sanitiseInput(index_1.DATATYPES.BYTE32, _paidStatus), options);
|
|
196
|
+
}
|
|
197
|
+
async getKYCPaid(_clientAddress, options) {
|
|
198
|
+
await this.validateInput(index_1.DATATYPES.ADDRESS, _clientAddress);
|
|
199
|
+
return this.callContract(FUNCTIONS.GETKYCPAID, _clientAddress, options);
|
|
200
|
+
}
|
|
190
201
|
}
|
|
191
202
|
exports.default = KYCContract;
|
|
@@ -47,7 +47,7 @@ class SecuritiesRegistryContract extends index_1.VerifiedContract {
|
|
|
47
47
|
await this.validateInput(index_1.DATATYPES.STRING, _category);
|
|
48
48
|
await this.validateInput(index_1.DATATYPES.STRING, _action);
|
|
49
49
|
await this.validateInput(index_1.DATATYPES.STRING, _isin);
|
|
50
|
-
return this.callContract(FUNCTIONS.REGISTERCORPORATEACTION,
|
|
50
|
+
return this.callContract(FUNCTIONS.REGISTERCORPORATEACTION, _category, _action, this.sanitiseInput(index_1.DATATYPES.BYTE32, _isin), options);
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
53
|
* Registers credit score of issuer. Can only be called by the admin contract on the Verified Network.
|
|
@@ -73,7 +73,7 @@ class SecuritiesRegistryContract extends index_1.VerifiedContract {
|
|
|
73
73
|
async getCorporateActions(_category, _isin, options) {
|
|
74
74
|
await this.validateInput(index_1.DATATYPES.STRING, _category);
|
|
75
75
|
await this.validateInput(index_1.DATATYPES.STRING, _isin);
|
|
76
|
-
return this.callContract(FUNCTIONS.GETCORPORATEACTION,
|
|
76
|
+
return this.callContract(FUNCTIONS.GETCORPORATEACTION, _category, this.sanitiseInput(index_1.DATATYPES.BYTE32, _isin), options);
|
|
77
77
|
}
|
|
78
78
|
/**
|
|
79
79
|
* Gets credit score
|
|
@@ -2,27 +2,28 @@
|
|
|
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': '0x4c0cB1cfB353f5387Bce7D2a9D3d8f9710E93dd7',
|
|
6
|
+
'KYC': '0x4d219Bde2787C57A54749AD88C8448f5ddD453b5',
|
|
7
|
+
'System': '0x00393538a3FD1872dE705aAD242B666630c89BF6',
|
|
8
|
+
'Holder': '0x6f34FFb2D85CB5aA0d028b55013bca291AE2738e',
|
|
9
|
+
'Ledger': '0x8a0125C0995D4428F9D35aDd5e300AbE612aC3d9',
|
|
10
|
+
'Account': '0x0446A54F9eA6BFE6B9e567c30E93a255b0A3E90e',
|
|
11
11
|
'Factory': '0x36f49e8e1D3d713B461D4Cd12f961bC9B784dF67',
|
|
12
12
|
'Cash': '0x93d5C6B832A9c4FEB1d9897D9b1088124c882eE3',
|
|
13
13
|
'Bond': '0x04dd0A9405B8DE91f92A0ee5F9972a1E898cFd79',
|
|
14
14
|
'Token': '0x4ef2b7de40058c71f8718D8c3bB93220Ec077305',
|
|
15
15
|
'Oracle': '0xf11cB9C121490294be1Db534d0162C390935FBf7',
|
|
16
|
-
'PreTrade': '
|
|
17
|
-
'Trade': '
|
|
18
|
-
'PostTrade': '
|
|
19
|
-
'SecuritiesRegistry': '
|
|
20
|
-
'Security': '
|
|
21
|
-
'OrderPool': '
|
|
22
|
-
'PoolFactory': '
|
|
23
|
-
'Products': '
|
|
24
|
-
'Issues': '
|
|
16
|
+
'PreTrade': '0xc2239361eA58d6d3d2BA71cF519A66E47Bb852E5',
|
|
17
|
+
'Trade': '0x7463E81B06a7B49F89f5D2293aCE7E17EB9E70D9',
|
|
18
|
+
'PostTrade': '0x50D54Fca76ABDb7d8883cb6D5d6d6cD64aE7ab9F',
|
|
19
|
+
'SecuritiesRegistry': '0x745C78f4c84CA03d851342E594377079Bd235f5D',
|
|
20
|
+
'Security': '0xD5e94c19513B998A8432dCE101a94BACA75A1A5c',
|
|
21
|
+
'OrderPool': '0xb87da4B188D4EbEd1935d3981eF11F0b67DC0659',
|
|
22
|
+
'PoolFactory': '0x1a124dAF4bD0C8bC482b8Cb34511B672E16cdcDc',
|
|
23
|
+
'Products': '0x454FAFBA1430bADaaE6f8894aA459145Ae19F479',
|
|
24
|
+
'Issues': '0xb1f3891D8BC3195716D3D551eB5BABDD4d070352',
|
|
25
25
|
'BalancerManager': '',
|
|
26
|
+
'Custody': '0xb6DD33C076fE95ffACC84E048Bda1caa6C304673',
|
|
26
27
|
'CASH': {
|
|
27
28
|
'VCUSD': '0x56849B0a8108d03926062187b2D97f67465Bb1a6',
|
|
28
29
|
'VCEUR': '0xB1D0B7a9d2CcD787dedc7f70aE6462062dc84255',
|
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.IssueContract = exports.ProductContract = exports.BalancerManagerContract = 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.CustodyContract = exports.IssueContract = exports.ProductContract = exports.BalancerManagerContract = 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");
|
|
@@ -51,6 +51,8 @@ const product_1 = __importDefault(require("./contract/product"));
|
|
|
51
51
|
exports.ProductContract = product_1.default;
|
|
52
52
|
const issue_1 = __importDefault(require("./contract/issue"));
|
|
53
53
|
exports.IssueContract = issue_1.default;
|
|
54
|
+
const custody_1 = __importDefault(require("./contract/custody"));
|
|
55
|
+
exports.CustodyContract = custody_1.default;
|
|
54
56
|
const ethers_1 = require("ethers");
|
|
55
57
|
Object.defineProperty(exports, "utils", { enumerable: true, get: function () { return ethers_1.utils; } });
|
|
56
58
|
const contractAddress_1 = __importDefault(require("./contractAddress"));
|