@verified-network/verified-sdk 1.2.6 → 1.2.7
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.
|
@@ -21,6 +21,8 @@ var FUNCTIONS;
|
|
|
21
21
|
FUNCTIONS["SETORACLES"] = "setOracles";
|
|
22
22
|
FUNCTIONS["SUPPORTTOKENS"] = "supportTokens";
|
|
23
23
|
FUNCTIONS["TOKENCREATED"] = "TokenCreated";
|
|
24
|
+
FUNCTIONS["SETBONDTERM"] = "setBondTerm";
|
|
25
|
+
FUNCTIONS["GETBONDTERM"] = "getBondTerm";
|
|
24
26
|
})(FUNCTIONS || (FUNCTIONS = {}));
|
|
25
27
|
class Factory extends index_1.VerifiedContract {
|
|
26
28
|
constructor(signer, contractNetworkAddress) {
|
|
@@ -106,5 +108,14 @@ class Factory extends index_1.VerifiedContract {
|
|
|
106
108
|
await this.validateInput(index_1.DATATYPES.ADDRESS, _address);
|
|
107
109
|
return this.callContract(FUNCTIONS.SUPPORTTOKENS, this.sanitiseInput(index_1.DATATYPES.BYTE32, _currency), _address, options);
|
|
108
110
|
}
|
|
111
|
+
async setBondTerm(bondToken, term, options) {
|
|
112
|
+
await this.validateInput(index_1.DATATYPES.ADDRESS, bondToken);
|
|
113
|
+
await this.validateInput(index_1.DATATYPES.NUMBER, term);
|
|
114
|
+
return this.callContract(FUNCTIONS.SETBONDTERM, bondToken, term, options);
|
|
115
|
+
}
|
|
116
|
+
async getBondTerm(bondToken, options) {
|
|
117
|
+
await this.validateInput(index_1.DATATYPES.ADDRESS, bondToken);
|
|
118
|
+
return this.callContract(FUNCTIONS.GETBONDTERM, bondToken, options);
|
|
119
|
+
}
|
|
109
120
|
}
|
|
110
121
|
exports.default = Factory;
|
|
@@ -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 VerifiedMarkets_json_1 = require("../../abi/loans/compound/VerifiedMarkets.json");
|
|
7
|
+
var FUNCTIONS;
|
|
8
|
+
(function (FUNCTIONS) {
|
|
9
|
+
FUNCTIONS["NEWRWA"] = "submitNewRWA";
|
|
10
|
+
FUNCTIONS["POSTCOLLATERAL"] = "postCollateral";
|
|
11
|
+
FUNCTIONS["BORROW"] = "borrowBase";
|
|
12
|
+
FUNCTIONS["REPAY"] = "repayBase";
|
|
13
|
+
})(FUNCTIONS || (FUNCTIONS = {}));
|
|
14
|
+
class Compound extends index_1.VerifiedContract {
|
|
15
|
+
constructor(signer, contractNetworkAddress) {
|
|
16
|
+
const address = contractNetworkAddress;
|
|
17
|
+
super(address, JSON.stringify(VerifiedMarkets_json_1.abi), signer);
|
|
18
|
+
this.contractAddress = address;
|
|
19
|
+
}
|
|
20
|
+
setSigner(_address) {
|
|
21
|
+
return this.callContract(FUNCTIONS.SETSIGNER, _address);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Submits new RWA to Compound
|
|
25
|
+
* @params (address asset, address bond, uint256 apy, string memory issuingDocs, uint256 faceValue)
|
|
26
|
+
* @returns
|
|
27
|
+
*/
|
|
28
|
+
async submitNewRWA(asset, bond, apy, issuingDocs, faceValue, options) {
|
|
29
|
+
await this.validateInput(index_1.DATATYPES.ADDRESS, asset);
|
|
30
|
+
await this.validateInput(index_1.DATATYPES.ADDRESS, bond);
|
|
31
|
+
await this.validateInput(index_1.DATATYPES.NUMBER, apy);
|
|
32
|
+
await this.validateInput(index_1.DATATYPES.STRING, issuingDocs);
|
|
33
|
+
await this.validateInput(index_1.DATATYPES.NUMBER, faceValue);
|
|
34
|
+
return this.callContract(FUNCTIONS.NEWRWA, asset, bond, apy, issuingDocs, faceValue, options);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Posts collateral to Compound
|
|
38
|
+
* @params (address asset, address collateral, uint256 amount)
|
|
39
|
+
* @returns
|
|
40
|
+
*/
|
|
41
|
+
async postCollateral(asset, collateral, amount, options) {
|
|
42
|
+
await this.validateInput(index_1.DATATYPES.ADDRESS, asset);
|
|
43
|
+
await this.validateInput(index_1.DATATYPES.ADDRESS, collateral);
|
|
44
|
+
await this.validateInput(index_1.DATATYPES.NUMBER, amount);
|
|
45
|
+
return this.callContract(FUNCTIONS.POSTCOLLATERAL, asset, collateral, amount, options);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Borrows from Compound
|
|
49
|
+
* @params (address base, uint256 amount)
|
|
50
|
+
* @returns
|
|
51
|
+
*/
|
|
52
|
+
async borrowBase(base, amount, options) {
|
|
53
|
+
await this.validateInput(index_1.DATATYPES.ADDRESS, base);
|
|
54
|
+
await this.validateInput(index_1.DATATYPES.NUMBER, amount);
|
|
55
|
+
return this.callContract(FUNCTIONS.BORROW, base, amount, options);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Repays to Compound
|
|
59
|
+
* @params (address base, uint256 amount)
|
|
60
|
+
* @returns
|
|
61
|
+
*/
|
|
62
|
+
async repayBase(base, amount, options) {
|
|
63
|
+
await this.validateInput(index_1.DATATYPES.ADDRESS, base);
|
|
64
|
+
await this.validateInput(index_1.DATATYPES.NUMBER, amount);
|
|
65
|
+
return this.callContract(FUNCTIONS.REPAY, base, amount, options);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.default = Compound;
|
|
@@ -18,6 +18,7 @@ const contractAddress = {
|
|
|
18
18
|
'BalancerSecondaryIssueManager': '0xe1f45e7104069F998b919C26435c4aaBAeD68fEd',
|
|
19
19
|
'BalancerMarginIssueManager': '0x64Ba97dC2f89c121B4248Df4C4F077E50E8FA96b',
|
|
20
20
|
'Custody': '0x60aEDad13a34b1DC45bDeA9eD6a66d639563e917',
|
|
21
|
+
'Compound': '0xf8287e8D37863Db0Cabd25B55f77652d5d6aEb83',
|
|
21
22
|
'CASH': {
|
|
22
23
|
'VCUSD': '0x481134BE0E025EfCfeF410b33E80FeD681328390',
|
|
23
24
|
'VCEUR': '0x3744e139E7fa373F8e55C560Cc22eff4a28e5737',
|
|
@@ -48,6 +49,7 @@ const contractAddress = {
|
|
|
48
49
|
'BalancerSecondaryIssueManager': '',
|
|
49
50
|
'BalancerMarginIssueManager': '',
|
|
50
51
|
'Custody': '',
|
|
52
|
+
'Compound': '',
|
|
51
53
|
'CASH': {
|
|
52
54
|
'VCUSD': '',
|
|
53
55
|
'VCEUR': '',
|
|
@@ -78,6 +80,7 @@ const contractAddress = {
|
|
|
78
80
|
'BalancerSecondaryIssueManager': '0xb9AD11aC80AD0BE1B83ba6b83E4E27C110c18a33',
|
|
79
81
|
'BalancerMarginIssueManager': '',
|
|
80
82
|
'Custody': '',
|
|
83
|
+
'Compound': '',
|
|
81
84
|
'CASH': {
|
|
82
85
|
'VCUSD': '',
|
|
83
86
|
'VCEUR': '',
|
|
@@ -108,6 +111,7 @@ const contractAddress = {
|
|
|
108
111
|
'BalancerSecondaryIssueManager': '',
|
|
109
112
|
'BalancerMarginIssueManager': '',
|
|
110
113
|
'Custody': '',
|
|
114
|
+
'Compound': '',
|
|
111
115
|
'CASH': {
|
|
112
116
|
'VCUSD': '',
|
|
113
117
|
'VCEUR': '',
|
|
@@ -138,6 +142,7 @@ const contractAddress = {
|
|
|
138
142
|
'BalancerSecondaryIssueManager': '',
|
|
139
143
|
'BalancerMarginIssueManager': '',
|
|
140
144
|
'Custody': '',
|
|
145
|
+
'Compound': '',
|
|
141
146
|
'CASH': {
|
|
142
147
|
'VCUSD': '',
|
|
143
148
|
'VCEUR': '',
|
|
@@ -168,6 +173,7 @@ const contractAddress = {
|
|
|
168
173
|
'BalancerSecondaryIssueManager': '',
|
|
169
174
|
'BalancerMarginIssueManager': '',
|
|
170
175
|
'Custody': '',
|
|
176
|
+
'Compound': '',
|
|
171
177
|
'CASH': {
|
|
172
178
|
'VCUSD': '',
|
|
173
179
|
'VCEUR': '',
|
|
@@ -198,6 +204,7 @@ const contractAddress = {
|
|
|
198
204
|
'BalancerSecondaryIssueManager': '',
|
|
199
205
|
'BalancerMarginIssueManager': '',
|
|
200
206
|
'Custody': '',
|
|
207
|
+
'Compound': '',
|
|
201
208
|
'CASH': {
|
|
202
209
|
'VCUSD': '',
|
|
203
210
|
'VCEUR': '',
|
|
@@ -228,6 +235,7 @@ const contractAddress = {
|
|
|
228
235
|
'BalancerSecondaryIssueManager': '0x2c6F953dfc7b922ef3101c65c62f9349fCd65e1A',
|
|
229
236
|
'BalancerMarginIssueManager': '0x0d062A0064b762ed8AEe7DE9E79b532e6215c77a',
|
|
230
237
|
'Custody': '0x4A59d0A82A9e1196c7789a25b0F302A683b220E7',
|
|
238
|
+
'Compound': '',
|
|
231
239
|
'CASH': {
|
|
232
240
|
'VCUSD': '',
|
|
233
241
|
'VCEUR': '',
|
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.Client = exports.Distribution = exports.SecuritiesFactory = exports.Security = exports.MarginIssueManager = exports.SecondaryIssueManager = exports.PrimaryIssueManager = exports.Rates = exports.Liquidity = exports.Custody = exports.Pool = exports.Token = exports.Factory = exports.Cash = exports.Bond = exports.Provider = exports.VerifiedWallet = void 0;
|
|
7
|
+
exports.contractAddress = exports.utils = exports.Compound = exports.Client = exports.Distribution = exports.SecuritiesFactory = exports.Security = exports.MarginIssueManager = exports.SecondaryIssueManager = exports.PrimaryIssueManager = exports.Rates = exports.Liquidity = exports.Custody = exports.Pool = exports.Token = exports.Factory = exports.Cash = exports.Bond = 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");
|
|
@@ -39,6 +39,8 @@ const distribution_1 = __importDefault(require("./contract/distribution"));
|
|
|
39
39
|
exports.Distribution = distribution_1.default;
|
|
40
40
|
const client_1 = __importDefault(require("./contract/client"));
|
|
41
41
|
exports.Client = client_1.default;
|
|
42
|
+
const compound_1 = __importDefault(require("./contract/loans/compound"));
|
|
43
|
+
exports.Compound = compound_1.default;
|
|
42
44
|
const ethers_1 = require("ethers");
|
|
43
45
|
Object.defineProperty(exports, "utils", { enumerable: true, get: function () { return ethers_1.utils; } });
|
|
44
46
|
const contractAddress_1 = __importDefault(require("./contractAddress"));
|