@verified-network/verified-sdk 2.3.9 → 2.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.
@@ -11,29 +11,36 @@ export default class Compound extends VerifiedContract {
11
11
  chainId: number;
12
12
  functionName: string;
13
13
  }>;
14
- setSigner(_address: string): any;
14
+ setSigner(_address: string, options?: Options): any;
15
15
  /**
16
16
  * Submits new RWA to Compound
17
- * @params (address asset, address bond, uint256 apy, string memory issuingDocs, uint256 faceValue)
17
+ * @params (address asset, address bond, uint256 apy, string memory issuingDocs, uint256 frequency, address factory)
18
18
  * @returns
19
19
  */
20
- submitNewRWA(asset: string, bond: string, apy: string, issuingDocs: string, faceValue: string, options?: Options): any;
20
+ submitNewRWA(asset: string, bond: string, apy: string, issuingDocs: string, frequency: string, factory: string, options?: Options): any;
21
21
  /**
22
22
  * Posts collateral to Compound
23
- * @params (address asset, address collateral, uint256 amount)
23
+ * @params (address bond, address issuer, address factory)
24
24
  * @returns
25
25
  */
26
- postCollateral(asset: string, collateral: string, amount: string, options?: Options): any;
26
+ postCollateral(bond: string, issuer: string, factory: string, options?: Options): any;
27
27
  /**
28
28
  * Borrows from Compound
29
- * @params (address base, uint256 amount)
29
+ * @params (address asset, uint256 amount)
30
30
  * @returns
31
31
  */
32
- borrowBase(base: string, amount: string, options?: Options): any;
32
+ borrowBase(asset: string, options?: Options): any;
33
33
  /**
34
34
  * Repays to Compound
35
- * @params (address base, uint256 amount)
35
+ * @params (address asset, uint256 amount)
36
36
  * @returns
37
37
  */
38
- repayBase(base: string, amount: string, options?: Options): any;
38
+ repayBase(asset: string, amount: string, options?: Options): any;
39
+ /**
40
+ * Withdraws collateral
41
+ * @params (address bond, address issuer, address factory)
42
+ * @returns
43
+ */
44
+ withdrawCollateral(bond: string, issuer: string, factory: string, options?: Options): any;
45
+ repayLenders(asset: string, collateral: string, options?: Options): any;
39
46
  }
@@ -6,10 +6,12 @@ const index_1 = require("../../index");
6
6
  const VerifiedMarkets_json_1 = require("../../../abi/loans/compound/VerifiedMarkets.json");
7
7
  var FUNCTIONS;
8
8
  (function (FUNCTIONS) {
9
- FUNCTIONS["NEWRWA"] = "submitNewRWA";
9
+ FUNCTIONS["SUBMITNEWRWA"] = "submitNewRWA";
10
10
  FUNCTIONS["POSTCOLLATERAL"] = "postCollateral";
11
- FUNCTIONS["BORROW"] = "borrowBase";
12
- FUNCTIONS["REPAY"] = "repayBase";
11
+ FUNCTIONS["BORROWBASE"] = "borrowBase";
12
+ FUNCTIONS["REPAYBASE"] = "repayBase";
13
+ FUNCTIONS["WITHDRAWCOLLATERAL"] = "withdrawCollateral";
14
+ FUNCTIONS["REPAYLENDERS"] = "repayLenders";
13
15
  })(FUNCTIONS || (FUNCTIONS = {}));
14
16
  class Compound extends index_1.VerifiedContract {
15
17
  constructor(signer, contractNetworkAddress) {
@@ -20,52 +22,69 @@ class Compound extends index_1.VerifiedContract {
20
22
  async _getMeeQuote(paymentTokenAddress, functionName, args, apiKey, rpcUrl) {
21
23
  return await this.getQuote(paymentTokenAddress, functionName, args, rpcUrl, apiKey);
22
24
  }
23
- setSigner(_address) {
24
- return this.callContract(FUNCTIONS.SETSIGNER, _address);
25
+ setSigner(_address, options) {
26
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _address);
27
+ return this.callContract(FUNCTIONS.SETSIGNER, _address, options);
25
28
  }
26
29
  /**
27
30
  * Submits new RWA to Compound
28
- * @params (address asset, address bond, uint256 apy, string memory issuingDocs, uint256 faceValue)
31
+ * @params (address asset, address bond, uint256 apy, string memory issuingDocs, uint256 frequency, address factory)
29
32
  * @returns
30
33
  */
31
- async submitNewRWA(asset, bond, apy, issuingDocs, faceValue, options) {
34
+ async submitNewRWA(asset, bond, apy, issuingDocs, frequency, factory, options) {
32
35
  await this.validateInput(index_1.DATATYPES.ADDRESS, asset);
33
36
  await this.validateInput(index_1.DATATYPES.ADDRESS, bond);
34
37
  await this.validateInput(index_1.DATATYPES.NUMBER, apy);
35
38
  await this.validateInput(index_1.DATATYPES.STRING, issuingDocs);
36
39
  await this.validateInput(index_1.DATATYPES.NUMBER, faceValue);
37
- return this.callContract(FUNCTIONS.NEWRWA, asset, bond, apy, issuingDocs, faceValue, options);
40
+ await this.validateInput(index_1.DATATYPES.ADDRESS, factory);
41
+ return this.callContract(FUNCTIONS.SUBMITNEWRWA, asset, bond, apy, issuingDocs, frequency, factory, options);
38
42
  }
39
43
  /**
40
44
  * Posts collateral to Compound
41
- * @params (address asset, address collateral, uint256 amount)
45
+ * @params (address bond, address issuer, address factory)
42
46
  * @returns
43
47
  */
44
- async postCollateral(asset, collateral, amount, options) {
45
- await this.validateInput(index_1.DATATYPES.ADDRESS, asset);
46
- await this.validateInput(index_1.DATATYPES.ADDRESS, collateral);
47
- await this.validateInput(index_1.DATATYPES.NUMBER, amount);
48
- return this.callContract(FUNCTIONS.POSTCOLLATERAL, asset, collateral, amount, options);
48
+ async postCollateral(bond, issuer, factory, options) {
49
+ await this.validateInput(index_1.DATATYPES.ADDRESS, bond);
50
+ await this.validateInput(index_1.DATATYPES.ADDRESS, issuer);
51
+ await this.validateInput(index_1.DATATYPES.ADDRESS, factory);
52
+ return this.callContract(FUNCTIONS.POSTCOLLATERAL, bond, issuer, factory, options);
49
53
  }
50
54
  /**
51
55
  * Borrows from Compound
52
- * @params (address base, uint256 amount)
56
+ * @params (address asset, uint256 amount)
53
57
  * @returns
54
58
  */
55
- async borrowBase(base, amount, options) {
56
- await this.validateInput(index_1.DATATYPES.ADDRESS, base);
57
- await this.validateInput(index_1.DATATYPES.NUMBER, amount);
58
- return this.callContract(FUNCTIONS.BORROW, base, amount, options);
59
+ async borrowBase(asset, options) {
60
+ await this.validateInput(index_1.DATATYPES.ADDRESS, asset);
61
+ return this.callContract(FUNCTIONS.BORROWBASE, asset, options);
59
62
  }
60
63
  /**
61
64
  * Repays to Compound
62
- * @params (address base, uint256 amount)
65
+ * @params (address asset, uint256 amount)
63
66
  * @returns
64
67
  */
65
- async repayBase(base, amount, options) {
66
- await this.validateInput(index_1.DATATYPES.ADDRESS, base);
68
+ async repayBase(asset, amount, options) {
69
+ await this.validateInput(index_1.DATATYPES.ADDRESS, asset);
67
70
  await this.validateInput(index_1.DATATYPES.NUMBER, amount);
68
- return this.callContract(FUNCTIONS.REPAY, base, amount, options);
71
+ return this.callContract(FUNCTIONS.REPAYBASE, asset, amount, options);
72
+ }
73
+ /**
74
+ * Withdraws collateral
75
+ * @params (address bond, address issuer, address factory)
76
+ * @returns
77
+ */
78
+ async withdrawCollateral(bond, issuer, factory, options) {
79
+ await this.validateInput(index_1.DATATYPES.ADDRESS, bond);
80
+ await this.validateInput(index_1.DATATYPES.ADDRESS, issuer);
81
+ await this.validateInput(index_1.DATATYPES.ADDRESS, factory);
82
+ return this.callContract(FUNCTIONS.WITHDRAWCOLLATERAL, bond, issuer, factory, options);
83
+ }
84
+ async repayLenders(asset, collateral, options) {
85
+ await this.validateInput(index_1.DATATYPES.ADDRESS, asset);
86
+ await this.validateInput(index_1.DATATYPES.ADDRESS, collateral);
87
+ return this.callContract(FUNCTIONS.REPAYLENDERS, asset, collateral, options);
69
88
  }
70
89
  }
71
90
  exports.default = Compound;
@@ -311,12 +311,12 @@ const contractAddress = {
311
311
  },
312
312
  11155111: {
313
313
  'Client': '0xB72629Bb4d031F1C755AFfA123AAA28E81EfdA9A',
314
- 'Factory': '0x93788E5026619d1888Bb08a24020aEC825c1a9DE',
315
- 'Cash': '0xBe51081bBAb8Fe11Ad38527A105395032EE90413',
316
- 'Bond': '0x34a3c469Ea57D60aa0Ae7Edb05E4028b6ea23516',
317
- 'Token': '0xb6be86b2560401a2F23D1f4d509c7fa04215F42E',
318
- 'Oracle': '0x5b41be2DC6c69929F933833919d3E1b60734e52d',
319
- 'Rates': '0x8ff38B3E64e9c7c5cCc944c907c559BCd5290880',
314
+ 'Factory': '0x31b9Fe8f91114d019E5ab28CaC0D9FC4Ce094B66',
315
+ 'Cash': '0x4332CAe4A4a41E234589AF265ad05DbF3E4634cA',
316
+ 'Bond': '0x776b0Da4d5E9480F299D2abfD07d3298026A3f5E',
317
+ 'Token': '0x811a1932bab04BE7301168145cE248024b7696Ff',
318
+ 'Oracle': '0x30b11E1999aC70311c6ddD17B7201A508Bb5eB15',
319
+ 'Rates': '0xD7A772238ed3Ea78E182eb25D3e9E373E1625E90',
320
320
  'Security': '0xa1c552a33FB9e391d0F50A6407385c55cd22d596',
321
321
  'SecuritiesFactory': '0x7CaB6AA90fD672F6ddBd0B92c0a5428b53ebA414',
322
322
  'Vitta': '0x87145164371Ad7851AD3B4D47C9820F95983d8EA',
@@ -331,16 +331,16 @@ const contractAddress = {
331
331
  'Custody': '0x30A613eBd1A460E4800395bc0BF6E1B6cE58Eb2c',
332
332
  'Compound': '0x7b185DFf748DD922754A636B9c6f7ac5a2f4fE11',
333
333
  'CASH': {
334
- 'VCUSD': '0x41Dff25b62a3fE91DE79F19D39E2bBebFE4DbF44',
335
- 'VCEUR': '0xE79F3b503F67910225a205A6b42116D0f9626D14',
336
- 'VCCHF': '0x47E29bB768dcef3A783EC2f30c15915f0585f894',
337
- 'VCINR': '0xeF21497E45E874D6a71A908A6B17b7D1A4b81153'
334
+ 'VCUSD': '0x1352fDe2b7993Ec3dDcC4Ea45C2707b37aD1E041',
335
+ 'VCEUR': '0x909A5A034E9E413ffEf3B19A25D63b5f3e72BADF',
336
+ 'VCCHF': '0x601E17A86b37aeF2D5Ac2DA56c0987154EA1267F',
337
+ 'VCINR': '0xd0B45d2a883F8c045A770A4c9c528Caa106CE28C'
338
338
  },
339
339
  'BOND': {
340
- 'VBUSD': '0x2c478F0894bbBa7b060323925E8182fe22A69fF6',
341
- 'VBEUR': '0xD9AC319a6Ffb0b7D7533d56fd8D7F92F040faa75',
342
- 'VBCHF': '0x88201a38a00495A186DD03F6Eae077494b536A3F',
343
- 'VBINR': '0x89ac659F98623b16F836e494e754207C48932bCE'
340
+ 'VBUSD': '0xBf3560569045f46fEa40B79386E165d575F3e03c',
341
+ 'VBEUR': '0xC6ddFb54A66B89AEE098228EBC70aCF06D196885',
342
+ 'VBCHF': '0xd41aa78a4c81A52f775eFA9c81Fcae7A7807Ed0C',
343
+ 'VBINR': '0x91c844b24409687484a32C77641cB2a37EDB87cF'
344
344
  },
345
345
  },
346
346
  'balancerVault': '0xBA12222222228d8Ba445958a75a0704d566BF2C8'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verified-network/verified-sdk",
3
- "version": "2.3.9",
3
+ "version": "2.4.1",
4
4
  "description": "An SDK to develop applications on the Verified Network",
5
5
  "repository": {
6
6
  "type": "git",